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

/***/ 85436:
/***/ ((module) => {

/*!
 * AdGuard Assistant - v4.3.70 - Thu Jun 01 2023
 * https://github.com/AdguardTeam/AdguardAssistant#adguard-assistant
 * Copyright (c) 2023 AdGuard. Licensed GPL-3.0
 */
(function webpackUniversalModuleDefinition(root, factory) {
	if(true)
		module.exports = factory();
	else { var i, a; }
})(self, () => {
return /******/ (() => { // webpackBootstrap
/******/ 	var __webpack_modules__ = ({

/***/ 1503:
/***/ ((module, __unused_webpack_exports, __nested_webpack_require_667__) => {

var map = {
	"./ar/messages.json": 5443,
	"./be/messages.json": 24,
	"./cs/messages.json": 3337,
	"./da/messages.json": 7691,
	"./de/messages.json": 9947,
	"./el/messages.json": 1773,
	"./en/messages.json": 1272,
	"./es/messages.json": 8194,
	"./fa/messages.json": 5455,
	"./fi/messages.json": 6183,
	"./fr/messages.json": 4652,
	"./he/messages.json": 6514,
	"./hi/messages.json": 1996,
	"./hr/messages.json": 2178,
	"./hu/messages.json": 2698,
	"./id/messages.json": 710,
	"./it/messages.json": 7294,
	"./ja/messages.json": 9265,
	"./ko/messages.json": 1474,
	"./lt/messages.json": 8612,
	"./nl/messages.json": 8967,
	"./no/messages.json": 6251,
	"./pl/messages.json": 1549,
	"./pt-PT/messages.json": 1902,
	"./pt/messages.json": 9274,
	"./ro/messages.json": 6090,
	"./ru/messages.json": 3999,
	"./sk/messages.json": 89,
	"./sl/messages.json": 6058,
	"./sr/messages.json": 9177,
	"./sv/messages.json": 6105,
	"./tr/messages.json": 147,
	"./uk/messages.json": 1249,
	"./vi/messages.json": 4534,
	"./zh-HK/messages.json": 3476,
	"./zh-TW/messages.json": 5480,
	"./zh/messages.json": 8868
};


function webpackContext(req) {
	var id = webpackContextResolve(req);
	return __nested_webpack_require_667__(id);
}
function webpackContextResolve(req) {
	if(!__nested_webpack_require_667__.o(map, req)) {
		var e = new Error("Cannot find module '" + req + "'");
		e.code = 'MODULE_NOT_FOUND';
		throw e;
	}
	return map[req];
}
webpackContext.keys = function webpackContextKeys() {
	return Object.keys(map);
};
webpackContext.resolve = webpackContextResolve;
module.exports = webpackContext;
webpackContext.id = 1503;

/***/ }),

/***/ 14:
/***/ ((module, __unused_webpack_exports, __nested_webpack_require_2344__) => {

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 _require = __nested_webpack_require_2344__(897),
    _require2 = _slicedToArray(_require, 1),
    _require2$ = _require2[0],
    BASE_LOCALE = _require2$.base_locale,
    PROJECT_ID = _require2$.project_id,
    LANGUAGES = _require2$.languages,
    LOCALIZABLE_FILES = _require2$.localizable_files;
/**
 * Users locale may be defined with only two chars (language code)
 * Here we provide a map of equivalent translation for such locales
 */


var LOCALES_EQUIVALENTS_MAP = {
  'pt-BR': 'pt',
  'zh-CN': 'zh'
};
module.exports = {
  LOCALES_EQUIVALENTS_MAP: LOCALES_EQUIVALENTS_MAP,
  BASE_LOCALE: BASE_LOCALE,
  PROJECT_ID: PROJECT_ID,
  LANGUAGES: LANGUAGES,
  LOCALIZABLE_FILES: LOCALIZABLE_FILES
};

/***/ }),

/***/ 4123:
/***/ ((module, exports, __nested_webpack_require_4635__) => {

// Imports
var ___CSS_LOADER_API_IMPORT___ = __nested_webpack_require_4635__(3645);
var ___CSS_LOADER_GET_URL_IMPORT___ = __nested_webpack_require_4635__(1667);
var ___CSS_LOADER_URL_IMPORT_0___ = __nested_webpack_require_4635__(2668);
var ___CSS_LOADER_URL_IMPORT_1___ = __nested_webpack_require_4635__(1823);
exports = ___CSS_LOADER_API_IMPORT___(false);
var ___CSS_LOADER_URL_REPLACEMENT_0___ = ___CSS_LOADER_GET_URL_IMPORT___(___CSS_LOADER_URL_IMPORT_0___);
var ___CSS_LOADER_URL_REPLACEMENT_1___ = ___CSS_LOADER_GET_URL_IMPORT___(___CSS_LOADER_URL_IMPORT_1___);
// Module
exports.push([module.id, "/*! normalize.css v3.0.1 | MIT License | git.io/normalize */\n/**\n * 1. Set default font family to sans-serif.\n * 2. Prevent iOS text size adjust after orientation change, without disabling\n *    user zoom.\n */\nhtml {\n  font-family: sans-serif;\n  /* 1 */\n  -ms-text-size-adjust: 100%;\n  /* 2 */\n  -webkit-text-size-adjust: 100%;\n  /* 2 */\n}\n/**\n * Remove default margin.\n */\nbody {\n  margin: 0;\n}\n/* HTML5 display definitions\n========================================================================== */\n/**\n * Correct `block` display not defined for any HTML5 element in IE 8/9.\n * Correct `block` display not defined for `details` or `summary` in IE 10/11 and Firefox.\n * Correct `block` display not defined for `main` in IE 11.\n */\narticle,\naside,\ndetails,\nfigcaption,\nfigure,\nfooter,\nheader,\nhgroup,\nmain,\nnav,\nsection,\nsummary {\n  display: block;\n}\n/**\n * 1. Correct `inline-block` display not defined in IE 8/9.\n * 2. Normalize vertical alignment of `progress` in Chrome, Firefox, and Opera.\n */\naudio,\ncanvas,\nprogress,\nvideo {\n  display: inline-block;\n  /* 1 */\n  vertical-align: baseline;\n  /* 2 */\n}\n/**\n * Prevent modern browsers from displaying `audio` without controls.\n * Remove excess height in iOS 5 devices.\n */\naudio:not([controls]) {\n  display: none;\n  height: 0;\n}\n/**\n * Address `[hidden]` styling not present in IE 8/9/10.\n * Hide the `template` element in IE 8/9/11, Safari, and Firefox < 22.\n */\n[hidden],\ntemplate {\n  display: none;\n}\n/* Links\n========================================================================== */\n/**\n * Remove the gray background color from active links in IE 10.\n */\na {\n  background: transparent;\n}\n/**\n * Improve readability when focused and also mouse hovered in all browsers.\n */\na:active,\na:hover {\n  outline: 0;\n}\n/* Text-level semantics\n========================================================================== */\n/**\n * Address styling not present in IE 8/9/10/11, Safari, and Chrome.\n */\nabbr[title] {\n  border-bottom: 1px dotted;\n}\n/**\n * Address style set to `bolder` in Firefox 4+, Safari, and Chrome.\n */\nb,\nstrong {\n  font-weight: bold;\n}\n/**\n * Address styling not present in Safari and Chrome.\n */\ndfn {\n  font-style: italic;\n}\n/**\n * Address variable `h1` font-size and margin within `section` and `article`\n * contexts in Firefox 4+, Safari, and Chrome.\n */\nh1 {\n  font-size: 2em;\n  margin: 0.67em 0;\n}\n/**\n * Address styling not present in IE 8/9.\n */\nmark {\n  background: #ff0;\n  color: #000;\n}\n/**\n * Address inconsistent and variable font size in all browsers.\n */\nsmall {\n  font-size: 80%;\n}\n/**\n * Prevent `sub` and `sup` affecting `line-height` in all browsers.\n */\nsub,\nsup {\n  font-size: 75%;\n  line-height: 0;\n  position: relative;\n  vertical-align: baseline;\n}\nsup {\n  top: -0.5em;\n}\nsub {\n  bottom: -0.25em;\n}\n/* Embedded content\n========================================================================== */\n/**\n * Remove border when inside `a` element in IE 8/9/10.\n */\nimg {\n  border: 0;\n}\n/**\n * Correct overflow not hidden in IE 9/10/11.\n */\nsvg:not(:root) {\n  overflow: hidden;\n}\n/* Grouping content\n========================================================================== */\n/**\n * Address margin not present in IE 8/9 and Safari.\n */\nfigure {\n  margin: 1em 40px;\n}\n/**\n * Address differences between Firefox and other browsers.\n */\nhr {\n  -moz-box-sizing: content-box;\n  box-sizing: content-box;\n  height: 0;\n}\n/**\n * Contain overflow in all browsers.\n */\npre {\n  overflow: auto;\n}\n/**\n * Address odd `em`-unit font size rendering in all browsers.\n */\ncode,\nkbd,\npre,\nsamp {\n  font-family: monospace, monospace;\n  font-size: 1em;\n}\n/* Forms\n========================================================================== */\n/**\n * Known limitation: by default, Chrome and Safari on OS X allow very limited\n * styling of `select`, unless a `border` property is set.\n */\n/**\n * 1. Correct color not being inherited.\n *    Known issue: affects color of disabled elements.\n * 2. Correct font properties not being inherited.\n * 3. Address margins set differently in Firefox 4+, Safari, and Chrome.\n */\nbutton,\ninput,\noptgroup,\nselect,\ntextarea {\n  color: inherit;\n  /* 1 */\n  font: inherit;\n  /* 2 */\n  margin: 0;\n  /* 3 */\n}\n/**\n * Address `overflow` set to `hidden` in IE 8/9/10/11.\n */\nbutton {\n  overflow: visible;\n}\n/**\n * Address inconsistent `text-transform` inheritance for `button` and `select`.\n * All other form control elements do not inherit `text-transform` values.\n * Correct `button` style inheritance in Firefox, IE 8/9/10/11, and Opera.\n * Correct `select` style inheritance in Firefox.\n */\nbutton,\nselect {\n  text-transform: none;\n}\n/**\n * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio`\n *    and `video` controls.\n * 2. Correct inability to style clickable `input` types in iOS.\n * 3. Improve usability and consistency of cursor style between image-type\n *    `input` and others.\n */\nbutton,\nhtml input[type=\"button\"],\ninput[type=\"reset\"],\ninput[type=\"submit\"] {\n  -webkit-appearance: button;\n  /* 2 */\n  cursor: pointer;\n  /* 3 */\n}\n/**\n * Re-set default cursor for disabled elements.\n */\nbutton[disabled],\nhtml input[disabled] {\n  cursor: default;\n}\n/**\n * Remove inner padding and border in Firefox 4+.\n */\nbutton::-moz-focus-inner,\ninput::-moz-focus-inner {\n  border: 0;\n  padding: 0;\n}\n/**\n * Address Firefox 4+ setting `line-height` on `input` using `!important` in\n * the UA stylesheet.\n */\ninput {\n  line-height: normal;\n}\n/**\n * It's recommended that you don't attempt to style these elements.\n * Firefox's implementation doesn't respect box-sizing, padding, or width.\n *\n * 1. Address box sizing set to `content-box` in IE 8/9/10.\n * 2. Remove excess padding in IE 8/9/10.\n */\ninput[type=\"checkbox\"],\ninput[type=\"radio\"] {\n  box-sizing: border-box;\n  /* 1 */\n  padding: 0;\n  /* 2 */\n}\n/**\n * Fix the cursor style for Chrome's increment/decrement buttons. For certain\n * `font-size` values of the `input`, it causes the cursor style of the\n * decrement button to change from `default` to `text`.\n */\ninput[type=\"number\"]::-webkit-inner-spin-button,\ninput[type=\"number\"]::-webkit-outer-spin-button {\n  height: auto;\n}\n/**\n * 1. Address `appearance` set to `searchfield` in Safari and Chrome.\n * 2. Address `box-sizing` set to `border-box` in Safari and Chrome\n *    (include `-moz` to future-proof).\n */\ninput[type=\"search\"] {\n  -webkit-appearance: textfield;\n  /* 1 */\n  -moz-box-sizing: content-box;\n  -webkit-box-sizing: content-box;\n  /* 2 */\n  box-sizing: content-box;\n}\n/**\n * Remove inner padding and search cancel button in Safari and Chrome on OS X.\n * Safari (but not Chrome) clips the cancel button when the search input has\n * padding (and `textfield` appearance).\n */\ninput[type=\"search\"]::-webkit-search-cancel-button,\ninput[type=\"search\"]::-webkit-search-decoration {\n  -webkit-appearance: none;\n}\n/**\n * Define consistent border, margin, and padding.\n */\nfieldset {\n  border: 1px solid #c0c0c0;\n  margin: 0 2px;\n  padding: 0.35em 0.625em 0.75em;\n}\n/**\n * 1. Correct `color` not being inherited in IE 8/9/10/11.\n * 2. Remove padding so people aren't caught out if they zero out fieldsets.\n */\nlegend {\n  border: 0;\n  /* 1 */\n  padding: 0;\n  /* 2 */\n}\n/**\n * Remove default vertical scrollbar in IE 8/9/10/11.\n */\ntextarea {\n  overflow: auto;\n}\n/**\n * Don't inherit the `font-weight` (applied by a rule above).\n * NOTE: the default cannot safely be changed in Chrome and Safari on OS X.\n */\noptgroup {\n  font-weight: bold;\n}\n/* Tables\n========================================================================== */\n/**\n * Remove most spacing between table cells.\n */\ntable {\n  border-collapse: collapse;\n  border-spacing: 0;\n}\ntd,\nth {\n  padding: 0;\n}\n* {\n  box-sizing: border-box;\n}\n*:after,\n*:before {\n  box-sizing: border-box;\n}\nhtml {\n  font-size: 10px;\n  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\n}\nbody {\n  position: relative;\n  font-size: 1.3rem;\n  line-height: 1.42857143;\n  background-color: #e6e6e6;\n  font-family: \"Open Sans\", Arial, sans-serif;\n  font-weight: 400;\n  overflow-y: hidden;\n}\nbutton,\ninput,\nselect,\ntextarea {\n  font-family: inherit;\n  font-size: inherit;\n  line-height: inherit;\n  outline: none;\n  border-radius: 0;\n  box-shadow: none;\n}\na {\n  color: #36ba53;\n  text-decoration: underline;\n  outline: 0;\n}\na:hover {\n  color: #257f39;\n  text-decoration: underline;\n}\nfigure {\n  margin: 0;\n}\nimg {\n  vertical-align: middle;\n  max-width: 100%;\n}\nform {\n  margin: 0;\n}\nfieldset {\n  padding: 0;\n  margin: 0;\n  border: 0;\n  min-width: 0;\n}\nlegend {\n  display: block;\n  width: 100%;\n  padding: 0;\n  margin-bottom: 1.57142857;\n  font-size: 21px;\n  line-height: inherit;\n  border: 0;\n}\nlabel {\n  display: inline-block;\n}\ninput[type=\"search\"] {\n  box-sizing: border-box;\n}\ninput[type=\"radio\"],\ninput[type=\"checkbox\"] {\n  display: none;\n}\ninput[type=\"file\"]:focus,\ninput[type=\"radio\"]:focus,\ninput[type=\"checkbox\"]:focus {\n  outline: thin dotted;\n  outline: 5px auto -webkit-focus-ring-color;\n  outline-offset: -2px;\n}\n.form-control {\n  display: block;\n  width: 100%;\n  height: 40px;\n  padding: 6px 15px 4px;\n  font-size: 14px;\n  line-height: 22px;\n  box-shadow: inset 0 3px 3px rgba(0, 0, 0, 0.04);\n}\n.form-control:focus {\n  border-color: #8c8c8c;\n  outline: 0;\n}\n.form-control::-moz-placeholder {\n  color: #777777;\n  opacity: 1;\n}\n.form-control:-ms-input-placeholder {\n  color: #777777;\n}\n.form-control::-webkit-input-placeholder {\n  color: #777777;\n}\n.form-control[disabled],\n.form-control[readonly],\nfieldset[disabled] .form-control {\n  cursor: not-allowed;\n  background-color: #fff;\n  opacity: 1;\n}\ntextarea.form-control {\n  height: auto;\n}\n/*\n.fieldset.error{\n    .form-control{\n        border-color: @state-danger-text;\n        .placeholder(@state-danger-text);\n    }\n}\n*/\ninput[type=\"search\"] {\n  -webkit-appearance: none;\n}\ninput[type=\"date\"],\ninput[type=\"time\"],\ninput[type=\"datetime-local\"],\ninput[type=\"month\"] {\n  line-height: 22px;\n}\n.form-group {\n  margin: 23px 0 0;\n}\n.form-group:first-child {\n  margin-top: 0;\n}\ninput[type=\"radio\"][disabled],\ninput[type=\"checkbox\"][disabled],\ninput[type=\"radio\"].disabled,\ninput[type=\"checkbox\"].disabled,\nfieldset[disabled] input[type=\"radio\"],\nfieldset[disabled] input[type=\"checkbox\"] {\n  cursor: not-allowed;\n}\n@font-face {\n    font-family: 'Open Sans';\n    src: url('data:application/font-woff;base64, ') format('woff');\n    font-weight: normal;\n    font-style: normal;\n}\n\n@font-face {\n    font-family: 'Open Sans';\n    src: url('data:application/font-woff;base64, ') format('woff');\n    font-weight: 600;\n    font-style: normal;\n}\n\n@font-face {\n    font-family: 'Open Sans';\n    src: url('data:application/font-woff;base64, ') format('woff');\n    font-weight: bold;\n    font-style: normal;\n}\n\n.weight-regular {\n  font-family: \"Open Sans\", Arial, sans-serif;\n  font-weight: 400;\n}\n.weight-medium {\n  font-family: \"Open Sans\", Arial, sans-serif;\n  font-weight: 600;\n}\n.weight-bold {\n  font-family: \"Open Sans\", Arial, sans-serif;\n  font-weight: 700;\n}\n.form-ui {\n  position: relative;\n  display: inline-block;\n  vertical-align: top;\n  margin: 0;\n  line-height: 20px;\n  font-weight: 400;\n  cursor: pointer;\n}\n.form-ui-control {\n  position: absolute;\n  top: -9999px;\n  left: -9999px;\n  width: 0;\n  height: 0;\n  overflow: hidden;\n  clip: rect(0, 0, 0, 0);\n  outline: 0 none;\n}\n.form-ui-txt {\n  position: relative;\n  display: inline-block;\n  vertical-align: top;\n  padding: 2px 0 0 30px;\n}\n.form-ui-txt:before {\n  content: '';\n  position: absolute;\n  top: 0;\n  left: 0;\n  width: 22px;\n  height: 22px;\n}\n.form-ui-txt:after {\n  content: '';\n  position: absolute;\n}\ninput[type=\"radio\"] + .form-ui .form-ui-txt:before {\n  border: 1px solid #cfcfcf;\n  border-radius: 50%;\n}\ninput[type=\"radio\"] + .form-ui .form-ui-txt:after {\n  top: 7px;\n  left: 7px;\n  width: 8px;\n  height: 8px;\n  border-radius: 50%;\n}\ninput[type=\"radio\"]:disabled + .form-ui .form-ui-txt:before {\n  background: #f2f2f2;\n  opacity: 0.6;\n}\ninput[type=\"radio\"]:disabled + .form-ui .form-ui-txt:after {\n  opacity: 0.6;\n}\ninput[type=\"checkbox\"] + .form-ui .form-ui-txt:after {\n  top: 7px;\n  left: 5px;\n  width: 13px;\n  height: 6px;\n  border-bottom: 2px solid transparent;\n  border-left: 2px solid transparent;\n  transform: rotate(-45deg);\n}\ninput[type=\"checkbox\"]:disabled + .form-ui .form-ui-txt:before {\n  opacity: 0.6;\n}\ninput[type=\"checkbox\"]:disabled + .form-ui .form-ui-txt:after {\n  opacity: 0.6;\n}\n.btn {\n  display: inline-block;\n  margin-bottom: 0;\n  padding: 10px 20px;\n  font-size: 13px;\n  line-height: 18px;\n  text-align: center;\n  text-decoration: none;\n  vertical-align: middle;\n  cursor: pointer;\n  background-image: none;\n  border: 1px solid transparent;\n  white-space: nowrap;\n  user-select: none;\n}\n.btn:hover {\n  color: #000;\n  text-decoration: none;\n}\n.btn:active,\n.btn.active {\n  outline: none;\n}\n.btn:focus {\n  outline: none;\n  box-shadow: inset 0 0 0 1px #fff;\n}\n.btn[disabled],\n.btn.disabled {\n  cursor: default;\n  box-shadow: none;\n  opacity: 0.5;\n  pointer-events: none;\n}\n.btn-default {\n  border-color: #58595b;\n  background: #58595b;\n  color: #fff;\n}\n.btn-default:hover {\n  border-color: #717275;\n  background: #717275;\n  color: #fff;\n}\n.btn-default.active,\n.btn-default:active {\n  border-color: #717275;\n  background: #717275;\n}\n.btn-default.disabled,\n.btn-default[disabled] {\n  border-color: #58595b;\n  background: #58595b;\n}\n@media (max-width: 320px) {\n  .btn-another-el {\n    font-size: 9px;\n    padding-left: 0;\n    padding-right: 0;\n    background-color: transparent;\n    border: 0;\n    color: #000;\n  }\n  .btn-another-el:hover {\n    border-color: transparent;\n    background: transparent;\n    color: #000;\n  }\n}\n.btn-lg {\n  font-size: 20px;\n  padding: 14px 24px 12px;\n}\n.btn-sm {\n  font-size: 16px;\n  padding-top: 14px;\n  padding-bottom: 14px;\n}\n.btn-xs {\n  font-size: 14px;\n  padding-top: 12px;\n  padding-bottom: 12px;\n}\n.btn-block {\n  display: block;\n  width: 100%;\n  padding-left: 0;\n  padding-right: 0;\n}\n.btn-block + .btn-block {\n  margin-top: 5px;\n}\ninput[type=\"submit\"].btn-block,\ninput[type=\"reset\"].btn-block,\ninput[type=\"button\"].btn-block {\n  width: 100%;\n}\n.btn-upload {\n  position: relative;\n  overflow: hidden;\n}\n.btn-upload input[type=file] {\n  position: absolute;\n  top: 0;\n  right: 0;\n  margin: 0;\n  font-size: 600%;\n  line-height: 600%;\n  width: auto;\n  height: auto;\n  opacity: 0;\n  cursor: pointer;\n}\n@media (prefers-color-scheme: light) {\n  body {\n    color: #282828;\n  }\n  .main {\n    background: #ffffff;\n  }\n  .main-popup__btn {\n    background: #ffffff;\n    border: 1px solid #cfcfcf;\n  }\n  .main-popup__btn:hover {\n    background-color: #efefef;\n  }\n  .main-menu__btn {\n    background-color: #ffffff;\n  }\n  .main-menu__btn:hover {\n    background-color: #efefef;\n  }\n  .main-menu__btn:active,\n  .main-menu__btn.active {\n    background-color: #f3f3f3;\n  }\n  .main-version {\n    color: #dfdfdf;\n  }\n  .head_title {\n    color: #343434;\n  }\n  .head_text {\n    color: #343434;\n  }\n  .element-rule_expand-link_txt {\n    color: #36ba53;\n    border-bottom: 1px solid #36ba53;\n  }\n  .element-rule_expand-link:hover .element-rule_expand-link_txt {\n    color: #36ba53;\n    border-bottom-color: #36ba53;\n  }\n  .element-rule_form-cont {\n    border-top: 1px solid #e0dfdb;\n    background: #f4f4ef;\n  }\n  .tick {\n    border: 20px solid #ffffff;\n    border-left: 1px solid #ffffff;\n    border-right: 1px solid #ffffff;\n  }\n  .close {\n    background: url(" + ___CSS_LOADER_URL_REPLACEMENT_0___ + ") no-repeat 0 0 / cover;\n    opacity: 0.6;\n  }\n  .close:hover {\n    opacity: 0.8;\n  }\n  .form-control {\n    color: #343434;\n    background: #ffffff;\n    border: 1px solid #cfcfcf;\n  }\n  input[type=\"checkbox\"] + .form-ui .form-ui-txt:before {\n    border: 1px solid #cfcfcf;\n    background: #ffffff;\n  }\n  input[type=\"checkbox\"]:checked + .form-ui .form-ui-txt:before {\n    border: 1px solid #36ba53;\n    background: #36ba53;\n  }\n  input[type=\"checkbox\"]:checked + .form-ui .form-ui-txt:after {\n    border-bottom-color: #ffffff;\n    border-left-color: #ffffff;\n  }\n  .menu,\n  .menu-filter,\n  .content,\n  .foot {\n    border-top: 1px solid #e0dfdb;\n  }\n  .settings_fieldset {\n    border-top: 1px solid #e0dfdb;\n  }\n  .btn-primary {\n    border-color: #36ba53;\n    background: #36ba53;\n    color: #fff;\n  }\n  .btn-primary:hover {\n    border-color: #30a64a;\n    background: #30a64a;\n    color: #fff;\n  }\n  .btn-primary.active,\n  .btn-primary:active {\n    border-color: #30a64a;\n    background: #30a64a;\n  }\n  .btn-primary.disabled,\n  .btn-primary[disabled] {\n    border-color: #30a64a;\n    background: #30a64a;\n  }\n  .btn-cancel {\n    border-color: #f3523d;\n    background: #f3523d;\n    color: #fff;\n  }\n  .btn-cancel:hover {\n    border-color: #ee290f;\n    background: #ee290f;\n    color: #fff;\n  }\n  .btn-cancel.active,\n  .btn-cancel:active {\n    border-color: #ee290f;\n    background: #ee290f;\n  }\n  .btn-cancel.disabled,\n  .btn-cancel[disabled] {\n    border-color: #ee290f;\n    background: #ee290f;\n  }\n  .ui-slider-handle:after {\n    background: #36ba53;\n  }\n  .change-position_input:checked + .change-position_label {\n    border-color: #36ba53;\n    background: #36ba53;\n  }\n  input[type=\"radio\"] + .form-ui .form-ui-txt:before {\n    background: #ffffff;\n  }\n  input[type=\"radio\"]:checked + .form-ui .form-ui-txt:after {\n    background: #36ba53;\n  }\n  .menu-head_title {\n    color: #343434;\n  }\n  .menu-head_text {\n    color: #343434;\n  }\n  .menu-filter_handle {\n    background: #ffffff;\n  }\n}\n@media (prefers-color-scheme: dark) {\n  body {\n    color: #ddd;\n  }\n  .main {\n    background: #323232;\n  }\n  .main-popup__btn {\n    background: #323232;\n    border: 1px solid #666;\n  }\n  .main-popup__btn:hover {\n    background-color: #555555;\n  }\n  .main-menu__btn {\n    background-color: #323232;\n  }\n  .main-menu__btn:hover {\n    background-color: #555555;\n  }\n  .main-menu__btn:active,\n  .main-menu__btn.active {\n    background-color: #4d4d4d;\n  }\n  .main-version {\n    color: #444;\n  }\n  .head_title {\n    color: #ccc;\n  }\n  .head_text {\n    color: #ccc;\n  }\n  .element-rule_expand-link_txt {\n    color: #67B279;\n    border-bottom: 1px solid #67B279;\n  }\n  .element-rule_expand-link:hover .element-rule_expand-link_txt {\n    color: #4D995F;\n    border-bottom-color: #4D995F;\n  }\n  .element-rule_form-cont {\n    border-top: 1px solid #444;\n    background: #555;\n  }\n  .tick {\n    border: 20px solid #323232;\n    border-left: 1px solid #323232;\n    border-right: 1px solid #323232;\n  }\n  .close {\n    background: url(" + ___CSS_LOADER_URL_REPLACEMENT_1___ + ") no-repeat 0 0 / cover;\n    opacity: 0.7;\n  }\n  .close:hover {\n    opacity: 1;\n  }\n  .form-control {\n    color: #ccc;\n    background: #323232;\n    border: 1px solid #666;\n  }\n  input[type=\"checkbox\"] + .form-ui .form-ui-txt:before {\n    border: 1px solid #666;\n    background: #323232;\n  }\n  input[type=\"checkbox\"]:checked + .form-ui .form-ui-txt:before {\n    border: 1px solid #4D995F;\n    background: #4D995F;\n  }\n  input[type=\"checkbox\"]:checked + .form-ui .form-ui-txt:after {\n    border-bottom-color: #323232;\n    border-left-color: #323232;\n  }\n  .menu,\n  .menu-filter,\n  .content,\n  .foot {\n    border-top: 1px solid #444;\n  }\n  .settings_fieldset {\n    border-top: 1px solid #444;\n  }\n  .btn-primary {\n    border-color: #4D995F;\n    background: #4D995F;\n    color: #fff;\n  }\n  .btn-primary:hover {\n    border-color: #39774C;\n    background: #39774C;\n    color: #fff;\n  }\n  .btn-primary.active,\n  .btn-primary:active {\n    border-color: #39774C;\n    background: #39774C;\n  }\n  .btn-primary.disabled,\n  .btn-primary[disabled] {\n    border-color: #39774C;\n    background: #39774C;\n  }\n  .btn-cancel {\n    border-color: #8E2C13;\n    background: #8E2C13;\n    color: #fff;\n  }\n  .btn-cancel:hover {\n    border-color: #732613;\n    background: #732613;\n    color: #fff;\n  }\n  .btn-cancel.active,\n  .btn-cancel:active {\n    border-color: #732613;\n    background: #732613;\n  }\n  .btn-cancel.disabled,\n  .btn-cancel[disabled] {\n    border-color: #732613;\n    background: #732613;\n  }\n  .ui-slider-handle:after {\n    background: #4D995F;\n  }\n  .change-position_input:checked + .change-position_label {\n    border-color: #4D995F;\n    background: #4D995F;\n  }\n  input[type=\"radio\"] + .form-ui .form-ui-txt:before {\n    background: #323232;\n  }\n  input[type=\"radio\"]:checked + .form-ui .form-ui-txt:after {\n    background: #4D995F;\n  }\n  .menu-head_title {\n    color: #ccc;\n  }\n  .menu-head_text {\n    color: #ccc;\n  }\n  .menu-filter_handle {\n    background: #323232;\n  }\n}\n", ""]);
// Exports
module.exports = exports;


/***/ }),

/***/ 2571:
/***/ ((module, exports, __nested_webpack_require_223876__) => {

// Imports
var ___CSS_LOADER_API_IMPORT___ = __nested_webpack_require_223876__(3645);
var ___CSS_LOADER_GET_URL_IMPORT___ = __nested_webpack_require_223876__(1667);
var ___CSS_LOADER_URL_IMPORT_0___ = __nested_webpack_require_223876__(9053);
exports = ___CSS_LOADER_API_IMPORT___(false);
var ___CSS_LOADER_URL_REPLACEMENT_0___ = ___CSS_LOADER_GET_URL_IMPORT___(___CSS_LOADER_URL_IMPORT_0___);
// Module
exports.push([module.id, ":host {\n  display: block!important;\n  position: relative!important;\n  width: 0!important;\n  height: 0!important;\n  margin: 0!important;\n  padding: 0!important;\n  z-index: 2147483647!important;\n}\n:host ::after,\n:host ::before {\n  display: none!important;\n}\n.adguard-assistant-button-main-logo {\n  background-image: url(" + ___CSS_LOADER_URL_REPLACEMENT_0___ + ") !important;\n}\n.adguard-alert {\n  cursor: pointer;\n  left: 0;\n  top: 0;\n  position: fixed !important;\n  z-index: 2147483647 !important;\n  width: 40px !important;\n  height: 40px !important;\n  zoom: 1 !important;\n  display: inline-block !important;\n  margin: 0 !important;\n  border: 0 !important;\n  padding: 0 !important;\n  will-change: transform;\n  opacity: 1;\n  touch-action: none;\n  -ms-touch-action: none;\n  visibility: visible !important;\n  min-height: auto !important;\n  max-height: auto !important;\n  min-width: auto !important;\n  max-width: auto !important;\n  background-size: 21px!important;\n  background-position: center center!important;\n  background-repeat: no-repeat !important;\n  background-color: #fff !important;\n  border: none !important;\n  box-shadow: 0 0 10px 3px rgba(162, 161, 161, 0.3) !important;\n  border-radius: 100% !important;\n  transition: background-color 0.3s ease;\n}\n.adguard-alert.sg_hide_element {\n  display: none!important;\n}\n.adguard-alert.logo-small {\n  width: 24px !important;\n  height: 24px !important;\n  background-position: 50% 6px!important;\n  background-size: 14px!important;\n}\n.adguard-alert:hover {\n  background-color: #ccf0d4 !important;\n}\n@media print {\n  .adguard-alert {\n    display: none!important;\n  }\n}\n.adguard-assistant-button-right {\n  left: auto;\n  right: 0;\n}\n.adguard-assistant-button-left {\n  left: 0;\n  right: auto;\n}\n.adguard-assistant-button-top {\n  top: 0;\n  bottom: auto;\n}\n.adguard-assistant-button-bottom {\n  top: auto;\n  bottom: 0;\n}\n.adguard-assistant-button-top.adguard-assistant-button-left {\n  left: 0;\n  right: auto;\n  transform: translate3d(10px, 10px, 0);\n}\n.adguard-assistant-button-top.adguard-assistant-button-right {\n  left: auto;\n  right: 0;\n  transform: translate3d(-10px, 10px, 0);\n}\n.adguard-assistant-button-bottom.adguard-assistant-button-left {\n  left: 0;\n  right: auto;\n  transform: translate3d(10px, -10px, 0);\n}\n.adguard-assistant-button-bottom.adguard-assistant-button-right {\n  left: auto;\n  right: 0;\n  transform: translate3d(-10px, -10px, 0);\n}\n.adguard-assistant-button-bottom.adguard-assistant-button-respect-vk {\n  transform: translate3d(-70px, -5px, 0);\n}\n.adguard-assistant-button-bottom.adguard-assistant-button-respect-fb {\n  transform: translate3d(-5px, -40px, 0);\n}\n", ""]);
// Exports
module.exports = exports;


/***/ }),

/***/ 6469:
/***/ ((module, exports, __nested_webpack_require_227117__) => {

// Imports
var ___CSS_LOADER_API_IMPORT___ = __nested_webpack_require_227117__(3645);
var ___CSS_LOADER_GET_URL_IMPORT___ = __nested_webpack_require_227117__(1667);
var ___CSS_LOADER_URL_IMPORT_0___ = __nested_webpack_require_227117__(8115);
var ___CSS_LOADER_URL_IMPORT_1___ = __nested_webpack_require_227117__(1660);
var ___CSS_LOADER_URL_IMPORT_2___ = __nested_webpack_require_227117__(1372);
var ___CSS_LOADER_URL_IMPORT_3___ = __nested_webpack_require_227117__(6112);
var ___CSS_LOADER_URL_IMPORT_4___ = __nested_webpack_require_227117__(9919);
var ___CSS_LOADER_URL_IMPORT_5___ = __nested_webpack_require_227117__(9023);
var ___CSS_LOADER_URL_IMPORT_6___ = __nested_webpack_require_227117__(6810);
var ___CSS_LOADER_URL_IMPORT_7___ = __nested_webpack_require_227117__(2307);
var ___CSS_LOADER_URL_IMPORT_8___ = __nested_webpack_require_227117__(7062);
var ___CSS_LOADER_URL_IMPORT_9___ = __nested_webpack_require_227117__(6255);
var ___CSS_LOADER_URL_IMPORT_10___ = __nested_webpack_require_227117__(9385);
var ___CSS_LOADER_URL_IMPORT_11___ = __nested_webpack_require_227117__(8225);
var ___CSS_LOADER_URL_IMPORT_12___ = __nested_webpack_require_227117__(6523);
var ___CSS_LOADER_URL_IMPORT_13___ = __nested_webpack_require_227117__(2286);
var ___CSS_LOADER_URL_IMPORT_14___ = __nested_webpack_require_227117__(2668);
var ___CSS_LOADER_URL_IMPORT_15___ = __nested_webpack_require_227117__(1823);
exports = ___CSS_LOADER_API_IMPORT___(false);
var ___CSS_LOADER_URL_REPLACEMENT_0___ = ___CSS_LOADER_GET_URL_IMPORT___(___CSS_LOADER_URL_IMPORT_0___);
var ___CSS_LOADER_URL_REPLACEMENT_1___ = ___CSS_LOADER_GET_URL_IMPORT___(___CSS_LOADER_URL_IMPORT_1___);
var ___CSS_LOADER_URL_REPLACEMENT_2___ = ___CSS_LOADER_GET_URL_IMPORT___(___CSS_LOADER_URL_IMPORT_2___);
var ___CSS_LOADER_URL_REPLACEMENT_3___ = ___CSS_LOADER_GET_URL_IMPORT___(___CSS_LOADER_URL_IMPORT_3___);
var ___CSS_LOADER_URL_REPLACEMENT_4___ = ___CSS_LOADER_GET_URL_IMPORT___(___CSS_LOADER_URL_IMPORT_4___);
var ___CSS_LOADER_URL_REPLACEMENT_5___ = ___CSS_LOADER_GET_URL_IMPORT___(___CSS_LOADER_URL_IMPORT_5___);
var ___CSS_LOADER_URL_REPLACEMENT_6___ = ___CSS_LOADER_GET_URL_IMPORT___(___CSS_LOADER_URL_IMPORT_6___);
var ___CSS_LOADER_URL_REPLACEMENT_7___ = ___CSS_LOADER_GET_URL_IMPORT___(___CSS_LOADER_URL_IMPORT_7___);
var ___CSS_LOADER_URL_REPLACEMENT_8___ = ___CSS_LOADER_GET_URL_IMPORT___(___CSS_LOADER_URL_IMPORT_8___);
var ___CSS_LOADER_URL_REPLACEMENT_9___ = ___CSS_LOADER_GET_URL_IMPORT___(___CSS_LOADER_URL_IMPORT_9___);
var ___CSS_LOADER_URL_REPLACEMENT_10___ = ___CSS_LOADER_GET_URL_IMPORT___(___CSS_LOADER_URL_IMPORT_10___);
var ___CSS_LOADER_URL_REPLACEMENT_11___ = ___CSS_LOADER_GET_URL_IMPORT___(___CSS_LOADER_URL_IMPORT_11___);
var ___CSS_LOADER_URL_REPLACEMENT_12___ = ___CSS_LOADER_GET_URL_IMPORT___(___CSS_LOADER_URL_IMPORT_12___);
var ___CSS_LOADER_URL_REPLACEMENT_13___ = ___CSS_LOADER_GET_URL_IMPORT___(___CSS_LOADER_URL_IMPORT_13___);
var ___CSS_LOADER_URL_REPLACEMENT_14___ = ___CSS_LOADER_GET_URL_IMPORT___(___CSS_LOADER_URL_IMPORT_14___);
var ___CSS_LOADER_URL_REPLACEMENT_15___ = ___CSS_LOADER_GET_URL_IMPORT___(___CSS_LOADER_URL_IMPORT_15___);
// Module
exports.push([module.id, ".close {\n  position: absolute;\n  top: 10px;\n  right: 10px;\n  display: inline-block;\n  vertical-align: top;\n  width: 1em;\n  font-size: 12px;\n  line-height: 1;\n  cursor: pointer;\n  transition: opacity 0.3s ease;\n}\n.close:before {\n  content: \"\\00a0\";\n}\n@media (max-width: 320px) {\n  .close {\n    font-size: 15px;\n    top: 18px;\n    right: 14px;\n  }\n}\n.a-logo {\n  display: inline-block;\n  vertical-align: top;\n  width: 40px;\n  height: 40px;\n  padding: 10px 0 0;\n  font-size: 20px;\n  text-align: center;\n  border: 1px solid #cdcdcd;\n  border-radius: 50%;\n  background: #fff;\n}\n.a-logo__small {\n  width: 24px;\n  height: 24px;\n  font-size: 12px;\n  padding: 6px 0 0;\n}\n.tooltip {\n  position: relative;\n}\n.tooltip:before {\n  display: none;\n  content: attr(data-title);\n  position: absolute;\n  top: 100%;\n  left: 50%;\n  width: 170px;\n  margin: 7px 0 0 -85px;\n  padding: 6px 0 5px;\n  font-size: 10px;\n  font-style: normal;\n  font-weight: 500;\n  color: #fff;\n  text-align: center;\n  white-space: nowrap;\n  border-radius: 4px;\n  background: rgba(0, 0, 0, 0.8);\n}\n.tooltip:after {\n  display: none;\n  content: '';\n  position: absolute;\n  top: 100%;\n  left: 50%;\n  margin: 3px 0 0 -4px;\n  border-bottom: 4px solid rgba(0, 0, 0, 0.8);\n  border-left: 4px solid transparent;\n  border-right: 4px solid transparent;\n}\n.tooltip:hover:before,\n.tooltip:hover:after {\n  display: block;\n}\n.main {\n  position: relative;\n}\n.head {\n  padding: 18px 20px;\n  cursor: move;\n}\n.head_title {\n  font-size: 16px;\n  font-weight: 700;\n}\n.head_text {\n  margin: 4px 0 0;\n  font-size: 12px;\n}\n.foot {\n  padding: 20px;\n}\n.foot_action {\n  float: right;\n}\n.foot_action_btn {\n  font-size: 0;\n}\n.foot_action_btn .btn + .btn {\n  margin-left: 10px;\n}\n.foot .cf {\n  clear: right;\n}\n.element-rule {\n  padding: 20px;\n}\n.element-rule_slider {\n  margin: 5px 0 7px;\n  user-select: none;\n}\n@media (max-width: 320px) {\n  .element-rule_slider {\n    display: none;\n  }\n}\n.element-rule_expand-link {\n  font-size: 12px;\n  line-height: 15px;\n  font-weight: 500;\n  cursor: pointer;\n}\n.element-rule_expand-link_txt {\n  display: inline-block;\n  vertical-align: top;\n}\n.element-rule_expand-link_arr {\n  display: inline-block;\n  vertical-align: top;\n  width: 5px;\n  height: 5px;\n  margin: 3px 0 0 3px;\n  border-bottom: 1px solid #91a795;\n  border-left: 1px solid #91a795;\n  transform: rotate(-45deg);\n  transition: 0.2s;\n}\n.element-rule_expand-link.active .element-rule_expand-link_arr {\n  margin-top: 5px;\n  transform: rotate(-225deg);\n}\n.element-rule_form {\n  height: 0;\n  margin: 0 -20px;\n  overflow: hidden;\n}\n.element-rule_form.open {\n  height: auto;\n  margin-bottom: -20px;\n}\n@media (max-width: 320px) {\n  .element-rule_form.open {\n    padding: 20px;\n    padding-top: 0;\n  }\n}\n.element-rule_form-cont {\n  margin: 4px 0 0;\n  padding: 20px;\n}\n@media (max-width: 320px) {\n  .element-rule_form-cont {\n    margin-top: 0;\n  }\n}\n.element-rule_fieldset {\n  margin: 10px 0 0;\n}\n.element-rule_fieldset:first-child {\n  margin: 0;\n}\n.element-rule_more--mobile {\n  display: none;\n}\n@media (max-width: 320px) {\n  .element-rule_more--mobile {\n    display: block;\n  }\n  .element-rule_more--mobile .element-rule_expand-link {\n    display: none;\n  }\n  .element-rule_more--mobile #adg-cancel {\n    width: 106px;\n    padding: 10px 7px;\n  }\n  .element-rule_more--mobile #adg-accept {\n    padding: 10px 6px;\n  }\n}\n.adg-slide {\n  position: relative;\n  width: 500px;\n  height: 44px;\n  margin: auto;\n  transform: translate3d(0, 0, 0);\n}\n.adg-slide-clue-min,\n.adg-slide-clue-max {\n  position: absolute;\n  top: 14px;\n  left: -40px;\n  width: 30px;\n  font-size: 12px;\n  font-weight: 500;\n  color: #8f9b92;\n  cursor: pointer;\n}\n.adg-slide-clue-min {\n  left: auto;\n  right: -40px;\n  text-align: right;\n}\n.adg-slide-btns {\n  display: none;\n}\n.adg-slide-btn {\n  position: relative;\n  width: 36px;\n  height: 36px;\n  border: 2px solid #e2e2e2;\n  border-radius: 2px;\n}\n.adg-slide-btn:after {\n  content: \"\";\n  position: absolute;\n  left: 8px;\n  top: 15.3px;\n  width: 18px;\n  height: 2px;\n  background-color: #4e4e4e;\n  border-radius: 2px;\n}\n.adg-slide-btn--plus {\n  margin-left: 9px;\n}\n.adg-slide-btn--plus:before {\n  content: \"\";\n  position: absolute;\n  left: 16px;\n  top: 8px;\n  height: 17px;\n  width: 2px;\n  background-color: #4e4e4e;\n  border-radius: 2px;\n}\n.ui-slider-handle {\n  position: absolute;\n  top: 22px;\n  z-index: 2;\n  cursor: pointer;\n}\n.ui-slider-handle:before {\n  content: '';\n  position: absolute;\n  top: 50%;\n  left: 50%;\n  width: 30px;\n  height: 30px;\n  margin: -15px 0 0 -15px;\n  background: rgba(0, 0, 0, 0.1);\n  border-radius: 50%;\n  transition: 0.2s;\n}\n.ui-slider-handle:after {\n  content: '';\n  position: absolute;\n  top: 50%;\n  left: 50%;\n  width: 20px;\n  height: 20px;\n  margin: -10px 0 0 -10px;\n  border-radius: 50%;\n}\n.ui-slider-handle:hover:active,\n.ui-slider-handle:hover:before {\n  background: rgba(0, 0, 0, 0.15);\n}\n.tick {\n  position: absolute;\n  height: 44px;\n}\n.settings_fieldset {\n  padding: 20px;\n}\n.settings_fieldset:first-child {\n  border: 0;\n}\n.settings_fieldset_lbl {\n  float: left;\n  width: 126px;\n  margin: 1px 0 0;\n  font-weight: 500;\n}\n.settings_fieldset_lbl__pos {\n  margin-top: 21px;\n}\n.settings_fieldset_val {\n  margin: 0 0 0 126px;\n}\n.choice-size {\n  position: relative;\n  font-size: 14px;\n}\n.choice-size_field {\n  margin: 10px 0 0;\n}\n.choice-size_field:first-child {\n  margin: 0;\n}\n.choice-size_logo {\n  display: none;\n  position: absolute;\n  top: 10px;\n  right: 15px;\n  width: 40px;\n  height: 40px;\n  background-size: 21px;\n  background-position: 50% 11px;\n  background-repeat: no-repeat;\n  background-color: #fff;\n  border: none ;\n  box-shadow: 0 0 10px 3px rgba(162, 161, 161, 0.3);\n  border-radius: 100% ;\n}\n.choice-size_logo.logo__small {\n  top: 15px;\n  right: 20px;\n  width: 24px;\n  height: 24px;\n  background-position: 50% 6px;\n  background-size: 14px;\n}\n.choice-size_input:checked ~ .choice-size_logo {\n  display: block;\n}\n[class^=\"s-position-arr-\"] {\n  display: block;\n  width: 11px;\n  height: 11px;\n  background: url(" + ___CSS_LOADER_URL_REPLACEMENT_0___ + ") no-repeat;\n  background-size: 44px 22px;\n}\n.s-position-arr-top-left {\n  background-position: 0 0;\n}\n.s-position-arr-top-right {\n  background-position: -11px 0;\n}\n.s-position-arr-bottom-left {\n  background-position: 0 -11px;\n}\n.s-position-arr-bottom-right {\n  background-position: -11px -11px;\n}\n.change-position {\n  position: relative;\n  display: inline-block;\n  vertical-align: top;\n  width: 70px;\n  margin: -3px 0 0 -3px;\n}\n.change-position_i {\n  float: left;\n  margin: 3px 0 0 3px;\n}\n.change-position_input:checked + .change-position_label .s-position-arr-top-left {\n  background-position: -22px 0;\n}\n.change-position_input:checked + .change-position_label .s-position-arr-top-right {\n  background-position: -33px 0;\n}\n.change-position_input:checked + .change-position_label .s-position-arr-bottom-left {\n  background-position: -22px -11px;\n}\n.change-position_input:checked + .change-position_label .s-position-arr-bottom-right {\n  background-position: -33px -11px;\n}\n.change-position_input:checked ~ .change-position_val {\n  display: block;\n}\n.change-position_label {\n  display: block;\n  width: 32px;\n  height: 32px;\n  margin: 0;\n  padding: 9px 0 0 9px;\n  border: 1px solid #dfdedb;\n  cursor: pointer;\n}\n.change-position_val {\n  display: none;\n  position: absolute;\n  top: 27px;\n  left: 82px;\n  font-size: 12px;\n  white-space: nowrap;\n}\n.position-save .position-save_field {\n  margin-bottom: 10px;\n}\n.wot-indicator {\n  display: inline-block;\n  vertical-align: top;\n  margin-right: 5px;\n}\n#WotDescriptionText {\n  white-space: pre-line;\n}\n#WotDescriptionText #WotLogo {\n  cursor: pointer;\n}\n.adg-wot {\n  width: 18px;\n  height: 18px;\n  display: block;\n  border: 5px solid #000;\n  border-radius: 50%;\n}\n.adg-wot-unknown {\n  border-color: #ccc;\n}\n.adg-wot-red {\n  border-color: #b60000;\n}\n.adg-wot-lightRed {\n  border-color: #f21800;\n}\n.adg-wot-yellow {\n  border-color: #fac000;\n}\n.adg-wot-lightGreen {\n  border-color: #69d225;\n}\n.adg-wot-green {\n  border-color: #00ae17;\n}\n.adg-wot-confidence {\n  width: 52px;\n  height: 18px;\n  display: inline-block;\n  vertical-align: middle;\n}\n.adg-wot-confidence-0 {\n  background-image: url(" + ___CSS_LOADER_URL_REPLACEMENT_1___ + ");\n}\n.adg-wot-confidence-1 {\n  background-image: url(" + ___CSS_LOADER_URL_REPLACEMENT_2___ + ");\n}\n.adg-wot-confidence-2 {\n  background-image: url(" + ___CSS_LOADER_URL_REPLACEMENT_3___ + ");\n}\n.adg-wot-confidence-3 {\n  background-image: url(" + ___CSS_LOADER_URL_REPLACEMENT_4___ + ");\n}\n.adg-wot-confidence-4 {\n  background-image: url(" + ___CSS_LOADER_URL_REPLACEMENT_5___ + ");\n}\n.adg-wot-confidence-5 {\n  background-image: url(" + ___CSS_LOADER_URL_REPLACEMENT_6___ + ");\n}\n.confidence-indication,\n.wot-indicator {\n  text-decoration: none;\n  vertical-align: middle;\n}\n.confidence-indication:hover,\n.wot-indicator:hover {\n  text-decoration: none;\n}\n.confidence-indication {\n  display: inline-block;\n  margin-right: 10px;\n}\n.wot-logo {\n  display: inline-block;\n  vertical-align: top;\n  width: 31px;\n  height: 12px;\n  background: url(" + ___CSS_LOADER_URL_REPLACEMENT_7___ + ") no-repeat 0 0 / cover;\n  margin-top: 3px;\n}\n.wot-hide {\n  display: none;\n}\niframe#adguard-assistant-dialog {\n  position: fixed;\n  clip: auto;\n  border-radius: 3px;\n  box-shadow: 0 0 10px 3px rgba(162, 161, 161, 0.3);\n  z-index: 2147483647;\n  display: block!important;\n}\n.sg_hide_element {\n  display: none!important;\n}\nimg.adguard_sg_selected {\n  border: 5px solid #0F0 !important;\n}\n#_sg_div.sg_top {\n  top: 5px !important;\n}\n#_sg_div.sg_bottom {\n  bottom: 5px !important;\n}\n#_sg_div input {\n  margin-right: 10px !important;\n  font-size: 15px !important;\n}\n#_sg_path_field {\n  width: 400px !important;\n}\n#_sg_div .sg_new_line {\n  clear: both !important;\n}\n#_sg_div .sg_option {\n  float: left !important;\n}\n#_sg_div .adguard_sg_selected_option {\n  text-decoration: underline;\n}\n.adguard-placeholder {\n  background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPCAMAAAAMCGV4AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyFpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDE0IDc5LjE1MTQ4MSwgMjAxMy8wMy8xMy0xMjowOToxNSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIChXaW5kb3dzKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDo1OUM5OUE4MEZEQzUxMUUyOTAzM0EyODQyRjc5QjI2QyIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDo1OUM5OUE4MUZEQzUxMUUyOTAzM0EyODQyRjc5QjI2QyI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjU5Qzk5QTdFRkRDNTExRTI5MDMzQTI4NDJGNzlCMjZDIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjU5Qzk5QTdGRkRDNTExRTI5MDMzQTI4NDJGNzlCMjZDIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+9rJm9wAAAAZQTFRF2+7g1OfZ+LX/EgAAACtJREFUeNpiYIQABhhA5TIyoHIhfCS1DKhcEB/FJAZG7AYzoNlLLy5AgAEAMigAar6TcqkAAAAASUVORK5CYII=);\n}\n.adguard-placeholder-icon {\n  background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACYAAAAwCAYAAAB9sggoAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyFpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDE0IDc5LjE1MTQ4MSwgMjAxMy8wMy8xMy0xMjowOToxNSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIChXaW5kb3dzKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDpENkNBQTNGMkZEQzUxMUUyQjVFMkZEMUFFRjlGOEQyMyIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDpENkNBQTNGM0ZEQzUxMUUyQjVFMkZEMUFFRjlGOEQyMyI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOkQ2Q0FBM0YwRkRDNTExRTJCNUUyRkQxQUVGOUY4RDIzIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOkQ2Q0FBM0YxRkRDNTExRTJCNUUyRkQxQUVGOUY4RDIzIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+49sbDwAAAl9JREFUeNrMmE0o5VEYxq9vJmpI2SBZjCSNKKGwkDE0m8mg2QwzEtkNCeUjGyVhYTbTUIZEMWmkbCVlw9QkG4mammbK5zAWuLqek3ch3W7v+Z8P/7d+u/cczz3neM7zP0Htg12eR6wUkA+eg2yQDOLAYegjiIkEr0AjyAPRfnp8toW9Be20QoHKa0tYEhgCVdwBNoQVgCmQKjPItLAKMAtiZAeaFFYM5sATJ4ODDYl6BuadijIlLAJMgHiFOWJMbGUfmaZsHYN98Bvs6haWA1olx2yCMfAd/DF1+Psl5rwGPWAYXJn8r3wNXjB7L0ENrZLRwy/m6ZDorw8kSqewUpDL7P0Epm3YRRBoYfbugW5bPpZDK8apTnBqS9h7WjWOLXyz5fxPQSWjz0dWcmPrEhdJNIEprIlW198Z7aUV1SasQWJnAp3Dzw+FqWxlOmV2HeXVecbegHBTYS5YYVy1yejrVJhIpxluFPaB6V1WhSWQTXjcJqyKjFVnhagabBhFFk7tgnPmlp+oChNbmMXM70XgL3Nen6qwj8y+xfv53fQZKweFzN5xW4c/Cgwwe9fAui1hIuBlMntHZOKNirAyiQ+NLbBkw8fEE9IM2QSnBv19I+oWVguWQSxzrnX6EVrqoV2I15kS0AxeSszjo+326hQm3hoSQRqR6mCeL2BV5x0VSjYQojDHNmgzcYn/Uxj/H9SBM7fkMQ951Tuw4aageEMpY8FUHnPy+XZECXbRTUFxhezEqCiZFfsFRnXdg1xhgcT9BF/BJG2htRKiDjx376EX9Md36HoR/NDp5jJ1K8AAcQBmooZhTgQAAAAASUVORK5CYII=);\n  background-position: center center;\n  background-repeat: no-repeat;\n  height: 100%;\n}\n.adguard-placeholder-domain {\n  background: #778b7c;\n  color: #ffffff;\n  left: 0;\n  top: 0;\n  padding: 2px 4px;\n  position: relative;\n}\n@media print {\n  .adguard-alert,\n  #adguard-assistant-dialog {\n    display: none!important;\n    opacity: 0!important;\n    visibility: hidden!important;\n  }\n}\n.menu-head {\n  padding: 18px 20px;\n  cursor: move;\n  touch-action: none;\n  -ms-touch-action: none;\n}\n.menu-head_title {\n  font-size: 16px;\n  font-weight: 700;\n}\n.menu-head_name {\n  display: inline-block;\n  vertical-align: top;\n  text-overflow: ellipsis;\n  overflow: hidden;\n  white-space: nowrap;\n  max-width: 260px;\n  line-height: 26px;\n  margin: 0 10px 5px 0;\n}\n.menu-head_text {\n  margin: 4px 10px 0 0;\n  font-size: 12px;\n}\n.menu-filter {\n  width: 100%;\n  display: table;\n  padding: 20px;\n}\n.menu-filter_lbl {\n  display: table-cell;\n  vertical-align: middle;\n}\n.menu-filter_val {\n  display: table-cell;\n  vertical-align: middle;\n}\n.menu-filter_label {\n  position: relative;\n  width: 30px;\n  height: 12px;\n  border-radius: 25px;\n  background-color: #ed7865;\n  cursor: pointer;\n  transition: all 0.3s ease;\n  float: right;\n}\n.menu-filter_label:after {\n  content: \"\";\n  cursor: pointer;\n  border-radius: 100%;\n  position: absolute;\n  left: -3px;\n  top: -4px;\n  box-shadow: 0 0 10px 3px rgba(162, 161, 161, 0.3);\n  width: 20px;\n  height: 20px;\n  background-color: #e85037;\n  transition: all 0.3s ease;\n}\n.menu-filter_handle {\n  position: absolute;\n  width: 20px;\n  height: 20px;\n  top: 1px;\n  left: 1px;\n  border-radius: 4px;\n}\n.menu-filter_input:checked + .menu-filter_label {\n  background-color: #bde5c1;\n}\n.menu-filter_input:checked + .menu-filter_label:after {\n  left: 12px;\n  background-color: #68bc72;\n}\n.menu__btn {\n  position: relative;\n  cursor: pointer;\n  line-height: 45px;\n  height: 45px;\n  background-repeat: no-repeat;\n  background-position: 20px 50%;\n  transition: 0.3s ease;\n  padding: 0 20px 0 60px;\n  white-space: nowrap;\n  overflow: hidden;\n  text-overflow: ellipsis;\n}\n.menu__btn:hover {\n  background-color: rgba(104, 188, 113, 0.2);\n}\n.menu__btn--clock {\n  background-image: url(" + ___CSS_LOADER_URL_REPLACEMENT_8___ + ");\n  background-size: 16px 19px;\n}\n.menu__btn--landscape {\n  background-image: url(" + ___CSS_LOADER_URL_REPLACEMENT_9___ + ");\n  background-size: 19px 17px;\n}\n.menu__btn--report {\n  background-image: url(" + ___CSS_LOADER_URL_REPLACEMENT_10___ + ");\n  background-size: 16px 17px;\n}\n.menu__btn--security {\n  background-image: url(" + ___CSS_LOADER_URL_REPLACEMENT_11___ + ");\n  background-size: 15px 16px;\n}\n.menu__btn--extensions {\n  background-image: url(" + ___CSS_LOADER_URL_REPLACEMENT_12___ + ");\n  background-size: 18px;\n}\n.menu__btn--settings {\n  background-image: url(" + ___CSS_LOADER_URL_REPLACEMENT_13___ + ");\n  background-size: 19px;\n}\n.menu__btn.hidden {\n  display: none;\n}\nbody {\n  color: #282828;\n}\n.main {\n  background: #ffffff;\n}\n.main-popup__btn {\n  background: #ffffff;\n  border: 1px solid #cfcfcf;\n}\n.main-popup__btn:hover {\n  background-color: #efefef;\n}\n.main-menu__btn {\n  background-color: #ffffff;\n}\n.main-menu__btn:hover {\n  background-color: #efefef;\n}\n.main-menu__btn:active,\n.main-menu__btn.active {\n  background-color: #f3f3f3;\n}\n.main-version {\n  color: #dfdfdf;\n}\n.head_title {\n  color: #343434;\n}\n.head_text {\n  color: #343434;\n}\n.element-rule_expand-link_txt {\n  color: #36ba53;\n  border-bottom: 1px solid #36ba53;\n}\n.element-rule_expand-link:hover .element-rule_expand-link_txt {\n  color: #36ba53;\n  border-bottom-color: #36ba53;\n}\n.element-rule_form-cont {\n  border-top: 1px solid #e0dfdb;\n  background: #f4f4ef;\n}\n.tick {\n  border: 20px solid #ffffff;\n  border-left: 1px solid #ffffff;\n  border-right: 1px solid #ffffff;\n}\n.close {\n  background: url(" + ___CSS_LOADER_URL_REPLACEMENT_14___ + ") no-repeat 0 0 / cover;\n  opacity: 0.6;\n}\n.close:hover {\n  opacity: 0.8;\n}\n.form-control {\n  color: #343434;\n  background: #ffffff;\n  border: 1px solid #cfcfcf;\n}\ninput[type=\"checkbox\"] + .form-ui .form-ui-txt:before {\n  border: 1px solid #cfcfcf;\n  background: #ffffff;\n}\ninput[type=\"checkbox\"]:checked + .form-ui .form-ui-txt:before {\n  border: 1px solid #36ba53;\n  background: #36ba53;\n}\ninput[type=\"checkbox\"]:checked + .form-ui .form-ui-txt:after {\n  border-bottom-color: #ffffff;\n  border-left-color: #ffffff;\n}\n.menu,\n.menu-filter,\n.content,\n.foot {\n  border-top: 1px solid #e0dfdb;\n}\n.settings_fieldset {\n  border-top: 1px solid #e0dfdb;\n}\n.btn-primary {\n  border-color: #36ba53;\n  background: #36ba53;\n  color: #fff;\n}\n.btn-primary:hover {\n  border-color: #30a64a;\n  background: #30a64a;\n  color: #fff;\n}\n.btn-primary.active,\n.btn-primary:active {\n  border-color: #30a64a;\n  background: #30a64a;\n}\n.btn-primary.disabled,\n.btn-primary[disabled] {\n  border-color: #30a64a;\n  background: #30a64a;\n}\n.btn-cancel {\n  border-color: #f3523d;\n  background: #f3523d;\n  color: #fff;\n}\n.btn-cancel:hover {\n  border-color: #ee290f;\n  background: #ee290f;\n  color: #fff;\n}\n.btn-cancel.active,\n.btn-cancel:active {\n  border-color: #ee290f;\n  background: #ee290f;\n}\n.btn-cancel.disabled,\n.btn-cancel[disabled] {\n  border-color: #ee290f;\n  background: #ee290f;\n}\n.ui-slider-handle:after {\n  background: #36ba53;\n}\n.change-position_input:checked + .change-position_label {\n  border-color: #36ba53;\n  background: #36ba53;\n}\ninput[type=\"radio\"] + .form-ui .form-ui-txt:before {\n  background: #ffffff;\n}\ninput[type=\"radio\"]:checked + .form-ui .form-ui-txt:after {\n  background: #36ba53;\n}\n.menu-head_title {\n  color: #343434;\n}\n.menu-head_text {\n  color: #343434;\n}\n.menu-filter_handle {\n  background: #ffffff;\n}\n@media (prefers-color-scheme: dark) {\n  body {\n    color: #ddd;\n  }\n  .main {\n    background: #323232;\n  }\n  .main-popup__btn {\n    background: #323232;\n    border: 1px solid #666;\n  }\n  .main-popup__btn:hover {\n    background-color: #555555;\n  }\n  .main-menu__btn {\n    background-color: #323232;\n  }\n  .main-menu__btn:hover {\n    background-color: #555555;\n  }\n  .main-menu__btn:active,\n  .main-menu__btn.active {\n    background-color: #4d4d4d;\n  }\n  .main-version {\n    color: #444;\n  }\n  .head_title {\n    color: #ccc;\n  }\n  .head_text {\n    color: #ccc;\n  }\n  .element-rule_expand-link_txt {\n    color: #67B279;\n    border-bottom: 1px solid #67B279;\n  }\n  .element-rule_expand-link:hover .element-rule_expand-link_txt {\n    color: #4D995F;\n    border-bottom-color: #4D995F;\n  }\n  .element-rule_form-cont {\n    border-top: 1px solid #444;\n    background: #555;\n  }\n  .tick {\n    border: 20px solid #323232;\n    border-left: 1px solid #323232;\n    border-right: 1px solid #323232;\n  }\n  .close {\n    background: url(" + ___CSS_LOADER_URL_REPLACEMENT_15___ + ") no-repeat 0 0 / cover;\n    opacity: 0.7;\n  }\n  .close:hover {\n    opacity: 1;\n  }\n  .form-control {\n    color: #ccc;\n    background: #323232;\n    border: 1px solid #666;\n  }\n  input[type=\"checkbox\"] + .form-ui .form-ui-txt:before {\n    border: 1px solid #666;\n    background: #323232;\n  }\n  input[type=\"checkbox\"]:checked + .form-ui .form-ui-txt:before {\n    border: 1px solid #4D995F;\n    background: #4D995F;\n  }\n  input[type=\"checkbox\"]:checked + .form-ui .form-ui-txt:after {\n    border-bottom-color: #323232;\n    border-left-color: #323232;\n  }\n  .menu,\n  .menu-filter,\n  .content,\n  .foot {\n    border-top: 1px solid #444;\n  }\n  .settings_fieldset {\n    border-top: 1px solid #444;\n  }\n  .btn-primary {\n    border-color: #4D995F;\n    background: #4D995F;\n    color: #fff;\n  }\n  .btn-primary:hover {\n    border-color: #39774C;\n    background: #39774C;\n    color: #fff;\n  }\n  .btn-primary.active,\n  .btn-primary:active {\n    border-color: #39774C;\n    background: #39774C;\n  }\n  .btn-primary.disabled,\n  .btn-primary[disabled] {\n    border-color: #39774C;\n    background: #39774C;\n  }\n  .btn-cancel {\n    border-color: #8E2C13;\n    background: #8E2C13;\n    color: #fff;\n  }\n  .btn-cancel:hover {\n    border-color: #732613;\n    background: #732613;\n    color: #fff;\n  }\n  .btn-cancel.active,\n  .btn-cancel:active {\n    border-color: #732613;\n    background: #732613;\n  }\n  .btn-cancel.disabled,\n  .btn-cancel[disabled] {\n    border-color: #732613;\n    background: #732613;\n  }\n  .ui-slider-handle:after {\n    background: #4D995F;\n  }\n  .change-position_input:checked + .change-position_label {\n    border-color: #4D995F;\n    background: #4D995F;\n  }\n  input[type=\"radio\"] + .form-ui .form-ui-txt:before {\n    background: #323232;\n  }\n  input[type=\"radio\"]:checked + .form-ui .form-ui-txt:after {\n    background: #4D995F;\n  }\n  .menu-head_title {\n    color: #ccc;\n  }\n  .menu-head_text {\n    color: #ccc;\n  }\n  .menu-filter_handle {\n    background: #323232;\n  }\n}\n:host {\n  display: block!important;\n  position: relative!important;\n  width: 0!important;\n  height: 0!important;\n  margin: 0!important;\n  padding: 0!important;\n  z-index: 2147483647!important;\n}\n:host ::after,\n:host ::before {\n  display: none!important;\n}\n", ""]);
// Exports
module.exports = exports;


/***/ }),

/***/ 817:
/***/ ((module, exports, __nested_webpack_require_253421__) => {

// Imports
var ___CSS_LOADER_API_IMPORT___ = __nested_webpack_require_253421__(3645);
var ___CSS_LOADER_GET_URL_IMPORT___ = __nested_webpack_require_253421__(1667);
var ___CSS_LOADER_URL_IMPORT_0___ = __nested_webpack_require_253421__(2668);
var ___CSS_LOADER_URL_IMPORT_1___ = __nested_webpack_require_253421__(1823);
var ___CSS_LOADER_URL_IMPORT_2___ = __nested_webpack_require_253421__(9053);
var ___CSS_LOADER_URL_IMPORT_3___ = __nested_webpack_require_253421__(8269);
var ___CSS_LOADER_URL_IMPORT_4___ = __nested_webpack_require_253421__(2834);
var ___CSS_LOADER_URL_IMPORT_5___ = __nested_webpack_require_253421__(9713);
var ___CSS_LOADER_URL_IMPORT_6___ = __nested_webpack_require_253421__(7693);
var ___CSS_LOADER_URL_IMPORT_7___ = __nested_webpack_require_253421__(6265);
var ___CSS_LOADER_URL_IMPORT_8___ = __nested_webpack_require_253421__(1109);
exports = ___CSS_LOADER_API_IMPORT___(false);
var ___CSS_LOADER_URL_REPLACEMENT_0___ = ___CSS_LOADER_GET_URL_IMPORT___(___CSS_LOADER_URL_IMPORT_0___);
var ___CSS_LOADER_URL_REPLACEMENT_1___ = ___CSS_LOADER_GET_URL_IMPORT___(___CSS_LOADER_URL_IMPORT_1___);
var ___CSS_LOADER_URL_REPLACEMENT_2___ = ___CSS_LOADER_GET_URL_IMPORT___(___CSS_LOADER_URL_IMPORT_2___);
var ___CSS_LOADER_URL_REPLACEMENT_3___ = ___CSS_LOADER_GET_URL_IMPORT___(___CSS_LOADER_URL_IMPORT_3___);
var ___CSS_LOADER_URL_REPLACEMENT_4___ = ___CSS_LOADER_GET_URL_IMPORT___(___CSS_LOADER_URL_IMPORT_4___);
var ___CSS_LOADER_URL_REPLACEMENT_5___ = ___CSS_LOADER_GET_URL_IMPORT___(___CSS_LOADER_URL_IMPORT_5___);
var ___CSS_LOADER_URL_REPLACEMENT_6___ = ___CSS_LOADER_GET_URL_IMPORT___(___CSS_LOADER_URL_IMPORT_6___);
var ___CSS_LOADER_URL_REPLACEMENT_7___ = ___CSS_LOADER_GET_URL_IMPORT___(___CSS_LOADER_URL_IMPORT_7___);
var ___CSS_LOADER_URL_REPLACEMENT_8___ = ___CSS_LOADER_GET_URL_IMPORT___(___CSS_LOADER_URL_IMPORT_8___);
// Module
exports.push([module.id, ":host {\n  display: block!important;\n  position: relative!important;\n  width: 0!important;\n  height: 0!important;\n  margin: 0!important;\n  padding: 0!important;\n  z-index: 2147483647!important;\n}\n:host ::after,\n:host ::before {\n  display: none!important;\n}\nbody {\n  color: #282828;\n}\n.main {\n  background: #ffffff;\n}\n.main-popup__btn {\n  background: #ffffff;\n  border: 1px solid #cfcfcf;\n}\n.main-popup__btn:hover {\n  background-color: #efefef;\n}\n.main-menu__btn {\n  background-color: #ffffff;\n}\n.main-menu__btn:hover {\n  background-color: #efefef;\n}\n.main-menu__btn:active,\n.main-menu__btn.active {\n  background-color: #f3f3f3;\n}\n.main-version {\n  color: #dfdfdf;\n}\n.head_title {\n  color: #343434;\n}\n.head_text {\n  color: #343434;\n}\n.element-rule_expand-link_txt {\n  color: #36ba53;\n  border-bottom: 1px solid #36ba53;\n}\n.element-rule_expand-link:hover .element-rule_expand-link_txt {\n  color: #36ba53;\n  border-bottom-color: #36ba53;\n}\n.element-rule_form-cont {\n  border-top: 1px solid #e0dfdb;\n  background: #f4f4ef;\n}\n.tick {\n  border: 20px solid #ffffff;\n  border-left: 1px solid #ffffff;\n  border-right: 1px solid #ffffff;\n}\n.close {\n  background: url(" + ___CSS_LOADER_URL_REPLACEMENT_0___ + ") no-repeat 0 0 / cover;\n  opacity: 0.6;\n}\n.close:hover {\n  opacity: 0.8;\n}\n.form-control {\n  color: #343434;\n  background: #ffffff;\n  border: 1px solid #cfcfcf;\n}\ninput[type=\"checkbox\"] + .form-ui .form-ui-txt:before {\n  border: 1px solid #cfcfcf;\n  background: #ffffff;\n}\ninput[type=\"checkbox\"]:checked + .form-ui .form-ui-txt:before {\n  border: 1px solid #36ba53;\n  background: #36ba53;\n}\ninput[type=\"checkbox\"]:checked + .form-ui .form-ui-txt:after {\n  border-bottom-color: #ffffff;\n  border-left-color: #ffffff;\n}\n.menu,\n.menu-filter,\n.content,\n.foot {\n  border-top: 1px solid #e0dfdb;\n}\n.settings_fieldset {\n  border-top: 1px solid #e0dfdb;\n}\n.btn-primary {\n  border-color: #36ba53;\n  background: #36ba53;\n  color: #fff;\n}\n.btn-primary:hover {\n  border-color: #30a64a;\n  background: #30a64a;\n  color: #fff;\n}\n.btn-primary.active,\n.btn-primary:active {\n  border-color: #30a64a;\n  background: #30a64a;\n}\n.btn-primary.disabled,\n.btn-primary[disabled] {\n  border-color: #30a64a;\n  background: #30a64a;\n}\n.btn-cancel {\n  border-color: #f3523d;\n  background: #f3523d;\n  color: #fff;\n}\n.btn-cancel:hover {\n  border-color: #ee290f;\n  background: #ee290f;\n  color: #fff;\n}\n.btn-cancel.active,\n.btn-cancel:active {\n  border-color: #ee290f;\n  background: #ee290f;\n}\n.btn-cancel.disabled,\n.btn-cancel[disabled] {\n  border-color: #ee290f;\n  background: #ee290f;\n}\n.ui-slider-handle:after {\n  background: #36ba53;\n}\n.change-position_input:checked + .change-position_label {\n  border-color: #36ba53;\n  background: #36ba53;\n}\ninput[type=\"radio\"] + .form-ui .form-ui-txt:before {\n  background: #ffffff;\n}\ninput[type=\"radio\"]:checked + .form-ui .form-ui-txt:after {\n  background: #36ba53;\n}\n.menu-head_title {\n  color: #343434;\n}\n.menu-head_text {\n  color: #343434;\n}\n.menu-filter_handle {\n  background: #ffffff;\n}\n@media (prefers-color-scheme: dark) {\n  body {\n    color: #ddd;\n  }\n  .main {\n    background: #323232;\n  }\n  .main-popup__btn {\n    background: #323232;\n    border: 1px solid #666;\n  }\n  .main-popup__btn:hover {\n    background-color: #555555;\n  }\n  .main-menu__btn {\n    background-color: #323232;\n  }\n  .main-menu__btn:hover {\n    background-color: #555555;\n  }\n  .main-menu__btn:active,\n  .main-menu__btn.active {\n    background-color: #4d4d4d;\n  }\n  .main-version {\n    color: #444;\n  }\n  .head_title {\n    color: #ccc;\n  }\n  .head_text {\n    color: #ccc;\n  }\n  .element-rule_expand-link_txt {\n    color: #67B279;\n    border-bottom: 1px solid #67B279;\n  }\n  .element-rule_expand-link:hover .element-rule_expand-link_txt {\n    color: #4D995F;\n    border-bottom-color: #4D995F;\n  }\n  .element-rule_form-cont {\n    border-top: 1px solid #444;\n    background: #555;\n  }\n  .tick {\n    border: 20px solid #323232;\n    border-left: 1px solid #323232;\n    border-right: 1px solid #323232;\n  }\n  .close {\n    background: url(" + ___CSS_LOADER_URL_REPLACEMENT_1___ + ") no-repeat 0 0 / cover;\n    opacity: 0.7;\n  }\n  .close:hover {\n    opacity: 1;\n  }\n  .form-control {\n    color: #ccc;\n    background: #323232;\n    border: 1px solid #666;\n  }\n  input[type=\"checkbox\"] + .form-ui .form-ui-txt:before {\n    border: 1px solid #666;\n    background: #323232;\n  }\n  input[type=\"checkbox\"]:checked + .form-ui .form-ui-txt:before {\n    border: 1px solid #4D995F;\n    background: #4D995F;\n  }\n  input[type=\"checkbox\"]:checked + .form-ui .form-ui-txt:after {\n    border-bottom-color: #323232;\n    border-left-color: #323232;\n  }\n  .menu,\n  .menu-filter,\n  .content,\n  .foot {\n    border-top: 1px solid #444;\n  }\n  .settings_fieldset {\n    border-top: 1px solid #444;\n  }\n  .btn-primary {\n    border-color: #4D995F;\n    background: #4D995F;\n    color: #fff;\n  }\n  .btn-primary:hover {\n    border-color: #39774C;\n    background: #39774C;\n    color: #fff;\n  }\n  .btn-primary.active,\n  .btn-primary:active {\n    border-color: #39774C;\n    background: #39774C;\n  }\n  .btn-primary.disabled,\n  .btn-primary[disabled] {\n    border-color: #39774C;\n    background: #39774C;\n  }\n  .btn-cancel {\n    border-color: #8E2C13;\n    background: #8E2C13;\n    color: #fff;\n  }\n  .btn-cancel:hover {\n    border-color: #732613;\n    background: #732613;\n    color: #fff;\n  }\n  .btn-cancel.active,\n  .btn-cancel:active {\n    border-color: #732613;\n    background: #732613;\n  }\n  .btn-cancel.disabled,\n  .btn-cancel[disabled] {\n    border-color: #732613;\n    background: #732613;\n  }\n  .ui-slider-handle:after {\n    background: #4D995F;\n  }\n  .change-position_input:checked + .change-position_label {\n    border-color: #4D995F;\n    background: #4D995F;\n  }\n  input[type=\"radio\"] + .form-ui .form-ui-txt:before {\n    background: #323232;\n  }\n  input[type=\"radio\"]:checked + .form-ui .form-ui-txt:after {\n    background: #4D995F;\n  }\n  .menu-head_title {\n    color: #ccc;\n  }\n  .menu-head_text {\n    color: #ccc;\n  }\n  .menu-filter_handle {\n    background: #323232;\n  }\n}\nbody {\n  padding: 1vw;\n  background: transparent;\n}\n.main {\n  position: relative;\n  padding: 8vw 3vw;\n}\n.main .footer {\n  letter-spacing: 3vw;\n}\n.main-version {\n  position: absolute;\n  bottom: 0;\n  right: 7px;\n  font-size: 5vw;\n}\n.main-popup {\n  text-align: center;\n  display: flex;\n  flex-direction: column;\n  align-items: center;\n  margin: 5vw;\n  box-shadow: 0 0px 5vw 0 rgba(0, 0, 0, 0.2);\n}\n.main-popup__logo {\n  width: 11vw;\n  height: 11vw;\n}\n.main-popup__logo.adguard-assistant-button-main-logo {\n  background-image: url(" + ___CSS_LOADER_URL_REPLACEMENT_2___ + ");\n  background-repeat: no-repeat;\n}\n.main-popup__title {\n  font-size: 6vw;\n  margin: 3vw 0;\n}\n.main-popup__content {\n  font-size: 5vw;\n  padding: 0 3vw;\n  margin-bottom: 5vw;\n  border-top: none;\n}\n.main-popup__btn {\n  font-size: 5vw;\n  padding: 2vh 8vw;\n  border-radius: 3px;\n  letter-spacing: normal;\n}\n.main-popup__btn--green {\n  color: #ffffff;\n  border: 1px solid #66B574;\n  background-color: #66B574;\n  box-shadow: none;\n}\n.main-popup__btn--green:hover {\n  background-color: #5ea76b;\n  color: #fff;\n}\n.main-popup__btn:focus {\n  box-shadow: none;\n}\n.main-menu {\n  margin: 4vw;\n  padding: 4vw;\n  display: flex;\n  justify-content: space-between;\n  border-radius: 4vw;\n  box-shadow: 0 0 4vw -2px rgba(0, 0, 0, 0.3);\n}\n.main-menu__info {\n  width: 100%;\n  text-align: center;\n}\n.main-menu__btn {\n  border: 0;\n  font-size: 0;\n  width: 12vw;\n  height: 12vw;\n  border-radius: 2vw;\n  background-repeat: no-repeat;\n  background-position: 50%;\n  background-size: 100%;\n  position: relative;\n}\n.main-menu__btn:disabled {\n  opacity: 0.5;\n  pointer-events: none;\n}\n.main-menu__btn--accept {\n  background-image: url(" + ___CSS_LOADER_URL_REPLACEMENT_3___ + ");\n}\n.main-menu__btn--preview {\n  background-image: url(" + ___CSS_LOADER_URL_REPLACEMENT_4___ + ");\n}\n.main-menu__btn--preview:active,\n.main-menu__btn--preview.active {\n  background-image: url(" + ___CSS_LOADER_URL_REPLACEMENT_5___ + ");\n}\n.main-menu__btn--plus {\n  background-image: url(" + ___CSS_LOADER_URL_REPLACEMENT_6___ + ");\n}\n.main-menu__btn--minus {\n  background-image: url(" + ___CSS_LOADER_URL_REPLACEMENT_7___ + ");\n}\n.main-menu__btn--close {\n  background-image: url(" + ___CSS_LOADER_URL_REPLACEMENT_8___ + ");\n}\n", ""]);
// Exports
module.exports = exports;


/***/ }),

/***/ 3596:
/***/ ((module, exports, __nested_webpack_require_263981__) => {

// Imports
var ___CSS_LOADER_API_IMPORT___ = __nested_webpack_require_263981__(3645);
exports = ___CSS_LOADER_API_IMPORT___(false);
// Module
exports.push([module.id, "iframe#adguard-assistant-dialog {\n  position: fixed;\n  clip: auto;\n  border-radius: 3px;\n  box-shadow: 0 0 10px 3px rgba(162, 161, 161, 0.3);\n  z-index: 2147483647;\n  display: block!important;\n}\n.sg_hide_element {\n  display: none!important;\n}\nimg.adguard_sg_selected {\n  border: 5px solid #0F0 !important;\n}\n#_sg_div.sg_top {\n  top: 5px !important;\n}\n#_sg_div.sg_bottom {\n  bottom: 5px !important;\n}\n#_sg_div input {\n  margin-right: 10px !important;\n  font-size: 15px !important;\n}\n#_sg_path_field {\n  width: 400px !important;\n}\n#_sg_div .sg_new_line {\n  clear: both !important;\n}\n#_sg_div .sg_option {\n  float: left !important;\n}\n#_sg_div .adguard_sg_selected_option {\n  text-decoration: underline;\n}\n.adguard-placeholder {\n  background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPCAMAAAAMCGV4AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyFpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDE0IDc5LjE1MTQ4MSwgMjAxMy8wMy8xMy0xMjowOToxNSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIChXaW5kb3dzKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDo1OUM5OUE4MEZEQzUxMUUyOTAzM0EyODQyRjc5QjI2QyIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDo1OUM5OUE4MUZEQzUxMUUyOTAzM0EyODQyRjc5QjI2QyI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjU5Qzk5QTdFRkRDNTExRTI5MDMzQTI4NDJGNzlCMjZDIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjU5Qzk5QTdGRkRDNTExRTI5MDMzQTI4NDJGNzlCMjZDIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+9rJm9wAAAAZQTFRF2+7g1OfZ+LX/EgAAACtJREFUeNpiYIQABhhA5TIyoHIhfCS1DKhcEB/FJAZG7AYzoNlLLy5AgAEAMigAar6TcqkAAAAASUVORK5CYII=);\n}\n.adguard-placeholder-icon {\n  background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACYAAAAwCAYAAAB9sggoAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyFpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDE0IDc5LjE1MTQ4MSwgMjAxMy8wMy8xMy0xMjowOToxNSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIChXaW5kb3dzKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDpENkNBQTNGMkZEQzUxMUUyQjVFMkZEMUFFRjlGOEQyMyIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDpENkNBQTNGM0ZEQzUxMUUyQjVFMkZEMUFFRjlGOEQyMyI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOkQ2Q0FBM0YwRkRDNTExRTJCNUUyRkQxQUVGOUY4RDIzIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOkQ2Q0FBM0YxRkRDNTExRTJCNUUyRkQxQUVGOUY4RDIzIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+49sbDwAAAl9JREFUeNrMmE0o5VEYxq9vJmpI2SBZjCSNKKGwkDE0m8mg2QwzEtkNCeUjGyVhYTbTUIZEMWmkbCVlw9QkG4mammbK5zAWuLqek3ch3W7v+Z8P/7d+u/cczz3neM7zP0Htg12eR6wUkA+eg2yQDOLAYegjiIkEr0AjyAPRfnp8toW9Be20QoHKa0tYEhgCVdwBNoQVgCmQKjPItLAKMAtiZAeaFFYM5sATJ4ODDYl6BuadijIlLAJMgHiFOWJMbGUfmaZsHYN98Bvs6haWA1olx2yCMfAd/DF1+Psl5rwGPWAYXJn8r3wNXjB7L0ENrZLRwy/m6ZDorw8kSqewUpDL7P0Epm3YRRBoYfbugW5bPpZDK8apTnBqS9h7WjWOLXyz5fxPQSWjz0dWcmPrEhdJNIEprIlW198Z7aUV1SasQWJnAp3Dzw+FqWxlOmV2HeXVecbegHBTYS5YYVy1yejrVJhIpxluFPaB6V1WhSWQTXjcJqyKjFVnhagabBhFFk7tgnPmlp+oChNbmMXM70XgL3Nen6qwj8y+xfv53fQZKweFzN5xW4c/Cgwwe9fAui1hIuBlMntHZOKNirAyiQ+NLbBkw8fEE9IM2QSnBv19I+oWVguWQSxzrnX6EVrqoV2I15kS0AxeSszjo+326hQm3hoSQRqR6mCeL2BV5x0VSjYQojDHNmgzcYn/Uxj/H9SBM7fkMQ951Tuw4aageEMpY8FUHnPy+XZECXbRTUFxhezEqCiZFfsFRnXdg1xhgcT9BF/BJG2htRKiDjx376EX9Md36HoR/NDp5jJ1K8AAcQBmooZhTgQAAAAASUVORK5CYII=);\n  background-position: center center;\n  background-repeat: no-repeat;\n  height: 100%;\n}\n.adguard-placeholder-domain {\n  background: #778b7c;\n  color: #ffffff;\n  left: 0;\n  top: 0;\n  padding: 2px 4px;\n  position: relative;\n}\n@media print {\n  .adguard-alert,\n  #adguard-assistant-dialog {\n    display: none!important;\n    opacity: 0!important;\n    visibility: hidden!important;\n  }\n}\n", ""]);
// Exports
module.exports = exports;


/***/ }),

/***/ 3645:
/***/ ((module) => {

"use strict";


/*
  MIT License http://www.opensource.org/licenses/mit-license.php
  Author Tobias Koppers @sokra
*/
// css base code, injected by the css-loader
// eslint-disable-next-line func-names
module.exports = function (useSourceMap) {
  var list = []; // return the list of modules as css string

  list.toString = function toString() {
    return this.map(function (item) {
      var content = cssWithMappingToString(item, useSourceMap);

      if (item[2]) {
        return "@media ".concat(item[2], " {").concat(content, "}");
      }

      return content;
    }).join('');
  }; // import a list of modules into the list
  // eslint-disable-next-line func-names


  list.i = function (modules, mediaQuery, dedupe) {
    if (typeof modules === 'string') {
      // eslint-disable-next-line no-param-reassign
      modules = [[null, modules, '']];
    }

    var alreadyImportedModules = {};

    if (dedupe) {
      for (var i = 0; i < this.length; i++) {
        // eslint-disable-next-line prefer-destructuring
        var id = this[i][0];

        if (id != null) {
          alreadyImportedModules[id] = true;
        }
      }
    }

    for (var _i = 0; _i < modules.length; _i++) {
      var item = [].concat(modules[_i]);

      if (dedupe && alreadyImportedModules[item[0]]) {
        // eslint-disable-next-line no-continue
        continue;
      }

      if (mediaQuery) {
        if (!item[2]) {
          item[2] = mediaQuery;
        } else {
          item[2] = "".concat(mediaQuery, " and ").concat(item[2]);
        }
      }

      list.push(item);
    }
  };

  return list;
};

function cssWithMappingToString(item, useSourceMap) {
  var content = item[1] || ''; // eslint-disable-next-line prefer-destructuring

  var cssMapping = item[3];

  if (!cssMapping) {
    return content;
  }

  if (useSourceMap && typeof btoa === 'function') {
    var sourceMapping = toComment(cssMapping);
    var sourceURLs = cssMapping.sources.map(function (source) {
      return "/*# sourceURL=".concat(cssMapping.sourceRoot || '').concat(source, " */");
    });
    return [content].concat(sourceURLs).concat([sourceMapping]).join('\n');
  }

  return [content].join('\n');
} // Adapted from convert-source-map (MIT)


function toComment(sourceMap) {
  // eslint-disable-next-line no-undef
  var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));
  var data = "sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(base64);
  return "/*# ".concat(data, " */");
}

/***/ }),

/***/ 1667:
/***/ ((module) => {

"use strict";


module.exports = function (url, options) {
  if (!options) {
    // eslint-disable-next-line no-param-reassign
    options = {};
  } // eslint-disable-next-line no-underscore-dangle, no-param-reassign


  url = url && url.__esModule ? url.default : url;

  if (typeof url !== 'string') {
    return url;
  } // If url is already wrapped in quotes, remove them


  if (/^['"].*['"]$/.test(url)) {
    // eslint-disable-next-line no-param-reassign
    url = url.slice(1, -1);
  }

  if (options.hash) {
    // eslint-disable-next-line no-param-reassign
    url += options.hash;
  } // Should url be wrapped?
  // See https://drafts.csswg.org/css-values-3/#urls


  if (/["'() \t\n]/.test(url) || options.needQuotes) {
    return "\"".concat(url.replace(/"/g, '\\"').replace(/\n/g, '\\n'), "\"");
  }

  return url;
};

/***/ }),

/***/ 5688:
/***/ ((module) => {

// Module
var code = "<div class=\"main\"> <div class=\"close\"></div> <div class=\"head\"> <div i18n=\"assistant_preview_header\" class=\"head_title\"> </div> <div i18n=\"assistant_preview_header_info\" class=\"head_text\"> </div> </div> <div class=\"foot\"> <button i18n=\"assistant_another_element\" class=\"btn btn-default\" id=\"select-another-element\" type=\"button\"></button> <div class=\"foot_action\"> <div class=\"foot_action_btn\"> <button i18n=\"assistant_preview_end\" class=\"btn btn-primary\" id=\"end-preview\" type=\"button\"></button> <button i18n=\"assistant_block\" class=\"btn btn-cancel\" id=\"block-element\" type=\"button\"></button> </div> </div> </div> </div>";
// Exports
module.exports = code;

/***/ }),

/***/ 6696:
/***/ ((module) => {

// Module
var code = "<div class=\"adguard-alert adguard-assistant-button-fixed adguard-assistant-button-main-logo\"></div> ";
// Exports
module.exports = code;

/***/ }),

/***/ 3317:
/***/ ((module) => {

// Module
var code = "<div class=\"main\"> <div class=\"close\"></div> <div class=\"menu-head\"> <div class=\"menu-head_title\"> <span class=\"menu-head_name\"></span> <div class=\"confidence-indication wot-hide\"> <a class=\"wot-indicator wot-hide\" target=\"_blank\" href=\"https://link.adtidy.org/forward.html?action=wot_scorecard&from=main_menu&app=assistant&domain=example.org\"> <i id=\"WotIndication\" class=\"adg-wot tooltip\" data-title=\"Site reputation indicator\"></i> </a> <i id=\"ConfidenceIndication\" class=\"adg-wot-confidence tooltip\" data-title=\"Reputation Confidence Level\"></i> </div> </div> <div class=\"menu-head_text wot-hide\" id=\"WotDescriptionText\"></div> </div> <div class=\"menu-filter\"> <div i18n=\"menu_filtration_status\" class=\"menu-filter_lbl\"> </div> <div class=\"menu-filter_val\"> <input type=\"checkbox\" class=\"menu-filter_input\" id=\"is-filter\"> <label for=\"is-filter\" class=\"menu-filter_label\"></label> </div> </div> <div class=\"menu\"> <div id=\"do-not-block-30-sec\" class=\"menu__btn menu__btn--clock\" i18n=\"menu_do_not_filter_30_sec\"></div> <div id=\"block-ad\" class=\"menu__btn menu__btn--landscape\" i18n=\"menu_block_ad_on_site\"></div> <div id=\"report-abuse\" class=\"menu__btn menu__btn--report\" i18n=\"menu_report_abuse\"></div> <div id=\"site-report\" class=\"menu__btn menu__btn--security\" i18n=\"menu_site_report\"></div> <div id=\"assistant-settings\" class=\"menu__btn menu__btn--settings\" i18n=\"menu_settings\"></div> </div> </div> ";
// Exports
module.exports = code;

/***/ }),

/***/ 4825:
/***/ ((module) => {

// Module
var code = "<div class=\"main mobile main-menu\"> <button i18n-title=\"close\" class=\"adg-close main-menu__btn main-menu__btn--close\">close</button> <button i18n-title=\"minus\" class=\"adg-minus main-menu__btn main-menu__btn--minus\">minus</button> <button i18n-title=\"plus\" class=\"adg-plus main-menu__btn main-menu__btn--plus\">plus</button> <button i18n-title=\"assistant_preview\" class=\"adg-preview main-menu__btn main-menu__btn--preview\">preview</button> <button i18n-title=\"assistant_block\" class=\"adg-accept main-menu__btn main-menu__btn--accept\">accept</button> </div> ";
// Exports
module.exports = code;

/***/ }),

/***/ 2115:
/***/ ((module) => {

// Module
var code = "<div class=\"main mobile main-popup\"> <div class=\"main-popup__logo adguard-assistant-button-main-logo\"></div> <h2 class=\"mobile-title main-popup__title\" i18n=\"assistant_select_element\"></h2> <div class=\"content main-popup__content\" i18n=\"assistant_select_element_text\"></div> <div class=\"footer\"> <button i18n=\"assistant_select_element_start\" class=\"btn btn-active start-select-mode main-popup__btn main-popup__btn--green\"></button> <button i18n=\"assistant_select_element_cancel\" class=\"btn cancel-select-mode main-popup__btn\"></button> </div> <i class=\"main-version\" id=\"appVersion\"></i> </div> ";
// Exports
module.exports = code;

/***/ }),

/***/ 8514:
/***/ ((module) => {

// Module
var code = "<div class=\"main adguard_sg_ignore\"> <div class=\"close adg-close\" id=\"close-button\"></div> <div class=\"head\" id=\"drag-handle\"> <div i18n=\"assistant_select_element\" class=\"head_title\"></div> <div i18n=\"assistant_select_element_ext\" class=\"head_text\"></div> </div> <div class=\"foot\"> <button i18n=\"assistant_select_element_cancel\" type=\"button\" class=\"btn btn-default\" id=\"cancel-select-mode\"></button> </div> </div> ";
// Exports
module.exports = code;

/***/ }),

/***/ 4693:
/***/ ((module) => {

// Module
var code = "<div class=\"main\"> <div class=\"close\"></div> <div class=\"head\"> <div i18n=\"assistant_settings\" class=\"head_title\"></div> <div i18n=\"settings_choose_size_and_position\" class=\"head_text head_text--mobile-h\"></div> </div> <div class=\"content\"> <div class=\"settings settings__horizontal\"> <div class=\"settings_fieldset\"> <div i18n=\"settings_position_save\" class=\"settings_fieldset_lbl\"></div> <div class=\"settings_fieldset_val\"> <div class=\"position-save\"> <div class=\"position-save_group\"> <div class=\"position-save_field\"> <input class=\"form-ui-control\" id=\"all-site\" type=\"radio\" name=\"position-save\"> <label class=\"form-ui\" for=\"all-site\"> <span i18n=\"settings_position_save_all\" class=\"form-ui-txt\"></span> </label> </div> <div class=\"position-save_field\"> <input class=\"form-ui-control\" id=\"this-site\" type=\"radio\" name=\"position-save\"> <label class=\"form-ui\" for=\"this-site\"> <span i18n=\"settings_position_save_this\" class=\"form-ui-txt\"></span> </label> </div> </div> </div> </div> </div> <div class=\"settings_fieldset\"> <div i18n=\"settings_icon_size\" class=\"settings_fieldset_lbl\"></div> <div class=\"settings_fieldset_val\"> <div class=\"choice-size\"> <div class=\"choice-size_group\"> <div class=\"choice-size_field\"> <input class=\"choice-size_input form-ui-control\" id=\"size-small\" type=\"radio\" name=\"radio\"> <label class=\"form-ui\" for=\"size-small\"> <span i18n=\"settings_small\" class=\"form-ui-txt\"></span> </label> <div class=\"adguard-assistant-button-main-logo choice-size_logo logo__small\"></div> </div> <div class=\"choice-size_field\"> <input class=\"choice-size_input form-ui-control\" id=\"size-big\" type=\"radio\" name=\"radio\"> <label class=\"form-ui\" for=\"size-big\"> <span i18n=\"settings_big\" class=\"form-ui-txt\"></span> </label> <div class=\"adguard-assistant-button-main-logo choice-size_logo\"></div> </div> </div> </div> </div> </div> <div class=\"settings_fieldset\"> <div i18n=\"settings_position\" class=\"settings_fieldset_lbl settings_fieldset_lbl__pos\"></div> <div class=\"settings_fieldset_val\"> <div class=\"change-position\"> <div class=\"change-position_i\"> <input type=\"radio\" name=\"position\" class=\"change-position_input\" id=\"position-top-left\"> <label class=\"change-position_label\" for=\"position-top-left\"> <span class=\"s-position-arr-top-left\"></span> </label> <div i18n=\"settings_left_top\" class=\"change-position_val\"></div> </div> <div class=\"change-position_i\"> <input type=\"radio\" name=\"position\" class=\"change-position_input\" id=\"position-top-right\"> <label class=\"change-position_label\" for=\"position-top-right\"> <span class=\"s-position-arr-top-right\"></span> </label> <div i18n=\"settings_right_top\" class=\"change-position_val\"></div> </div> <div class=\"change-position_i\"> <input type=\"radio\" name=\"position\" class=\"change-position_input\" id=\"position-bottom-left\"> <label class=\"change-position_label\" for=\"position-bottom-left\"> <span class=\"s-position-arr-bottom-left\"></span> </label> <div i18n=\"settings_left_bottom\" class=\"change-position_val\"></div> </div> <div class=\"change-position_i\"> <input type=\"radio\" name=\"position\" class=\"change-position_input\" id=\"position-bottom-right\"> <label class=\"change-position_label\" for=\"position-bottom-right\"> <span class=\"s-position-arr-bottom-right\"></span> </label> <div i18n=\"settings_right_bottom\" class=\"change-position_val\"></div> </div> </div> </div> </div> </div> </div> <div class=\"foot\"> <div class=\"foot_action\"> <div class=\"foot_action_btn\"> <button i18n=\"settings_cancel\" class=\"btn btn-default\" type=\"button\" id=\"cancel\"></button> <button i18n=\"settings_save\" class=\"btn btn-primary\" type=\"button\" id=\"save-settings\"></button> </div> </div> <div class=\"cf\"></div> </div> </div> ";
// Exports
module.exports = code;

/***/ }),

/***/ 7726:
/***/ ((module) => {

// Module
var code = "<div class=\"main\"> <div class=\"close adg-close\"></div> <div class=\"head head--slider\"> <div class=\"head_in head_in--slider\"> <div i18n=\"assistant_block_element\" class=\"head_title head_title--slider\" id=\"head_title\"></div> <div class=\"element-rule_more element-rule_more--mobile\"> <span class=\"element-rule_expand-link\" id=\"ExtendedSettingsText\"></span> <button i18n=\"assistant_block\" type=\"button\" class=\"btn btn-cancel\" id=\"adg-accept\"></button> <button i18n=\"assistant_another_element\" type=\"button\" class=\"btn btn-default\" id=\"adg-cancel\"></button> </div> </div> <div class=\"adg-slide-btns\"> <div class=\"adg-slide-btn adg-slide-btn--minus\"></div> <div class=\"adg-slide-btn adg-slide-btn--plus\"></div> </div> <div i18n=\"assistant_block_element_explain\" class=\"head_text head_text--mobile-h\" id=\"head_text\"></div> </div> <div class=\"content\" id=\"slider-area\"> <div class=\"element-rule element-rule--slider\"> <div i18n=\"assistant_slider_explain\" class=\"element-rule_text element-rule_text--slider\"></div> <div class=\"element-rule_slider\"> <div class=\"adg-slide\" id=\"slider\"> <div class=\"adg-slide-clue-max\">MAX</div> <div class=\"adg-slide-clue-min\">MIN</div> </div> </div> <div class=\"element-rule_more\"> <span class=\"element-rule_expand-link\" id=\"ExtendedSettingsText\"> <span i18n=\"assistant_extended_settings\" class=\"element-rule_expand-link_txt\"></span> <span class=\"element-rule_expand-link_arr\"></span> </span> </div> <div class=\"element-rule_form\" id=\"advanced-settings\"> <div class=\"element-rule_form-cont\"> <div class=\"element-rule_fieldset\" id=\"one-domain-checkbox-block\"> <input class=\"form-ui-control\" id=\"one-domain-checkbox\" type=\"checkbox\"/> <label for=\"one-domain-checkbox\" class=\"form-ui\"> <span i18n=\"assistant_apply_rule_to_all_sites\" class=\"form-ui-txt\"></span> </label> </div> <div style=\"display:none\" class=\"element-rule_fieldset\" id=\"block-by-url-checkbox-block\"> <input class=\"form-ui-control\" id=\"block-by-url-checkbox\" type=\"checkbox\"/> <label for=\"block-by-url-checkbox\" class=\"form-ui\"> <span i18n=\"assistant_block_by_reference\" class=\"form-ui-txt\"></span> </label> </div> <div style=\"display:none\" class=\"element-rule_fieldset\" id=\"block-similar-checkbox-block\"> <input class=\"form-ui-control\" id=\"block-similar-checkbox\" type=\"checkbox\"/> <label for=\"block-similar-checkbox\" class=\"form-ui\"> <span i18n=\"assistant_block_similar\" class=\"form-ui-txt\"></span> </label> </div> <div class=\"element-rule_fieldset\"> <input class=\"form-control\" id=\"filter-rule\" type=\"text\"/> </div> </div> </div> </div> </div> <div class=\"foot foot--slider\"> <button i18n=\"assistant_another_element\" type=\"button\" class=\"btn btn-default btn-another-el\" id=\"adg-cancel\"></button> <div class=\"foot_action\"> <div class=\"foot_action_btn\"> <button i18n=\"assistant_preview\" type=\"button\" class=\"btn btn-primary\" id=\"adg-preview\"></button> <button i18n=\"assistant_block\" type=\"button\" class=\"btn btn-cancel\" id=\"adg-accept\"></button> </div> </div> </div> </div> ";
// Exports
module.exports = code;

/***/ }),

/***/ 1403:
/***/ ((module, __unused_webpack_exports, __nested_webpack_require_284095__) => {


        var result = __nested_webpack_require_284095__(4123);

        if (typeof result === "string") {
            module.exports = result;
        } else {
            module.exports = result.toString();
        }
    

/***/ }),

/***/ 5487:
/***/ ((module, __unused_webpack_exports, __nested_webpack_require_284397__) => {


        var result = __nested_webpack_require_284397__(2571);

        if (typeof result === "string") {
            module.exports = result;
        } else {
            module.exports = result.toString();
        }
    

/***/ }),

/***/ 3228:
/***/ ((module, __unused_webpack_exports, __nested_webpack_require_284699__) => {


        var result = __nested_webpack_require_284699__(6469);

        if (typeof result === "string") {
            module.exports = result;
        } else {
            module.exports = result.toString();
        }
    

/***/ }),

/***/ 1953:
/***/ ((module, __unused_webpack_exports, __nested_webpack_require_285001__) => {


        var result = __nested_webpack_require_285001__(817);

        if (typeof result === "string") {
            module.exports = result;
        } else {
            module.exports = result.toString();
        }
    

/***/ }),

/***/ 5317:
/***/ ((module, __unused_webpack_exports, __nested_webpack_require_285302__) => {


        var result = __nested_webpack_require_285302__(3596);

        if (typeof result === "string") {
            module.exports = result;
        } else {
            module.exports = result.toString();
        }
    

/***/ }),

/***/ 8269:
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_285616__) => {

"use strict";
__nested_webpack_require_285616__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_285616__.d(__nested_webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTUgMTEuNzY2NUwxMC41ODc4IDE3TDE5IDgiIHN0cm9rZT0iIzY3QjI3OSIgc3Ryb2tlLXdpZHRoPSIxLjUiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPgo8L3N2Zz4K");

/***/ }),

/***/ 7062:
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_286335__) => {

"use strict";
__nested_webpack_require_286335__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_286335__.d(__nested_webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ("data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB2aWV3Qm94PSIwIDAgMTcgMTciIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8ZyBpZD0iQXJ0Ym9hcmQiIHN0cm9rZT0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMi4wMDAwMDAsIC0xNDQuMDAwMDAwKSI+CiAgICAgICAgPGcgaWQ9Ikdyb3VwLTIiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDIzLjAwMDAwMCwgMTQxLjAwMDAwMCkiIHN0cm9rZT0iIzk3OTc5NyIgc3Ryb2tlLXdpZHRoPSIxLjM1Ij4KICAgICAgICAgICAgPGNpcmNsZSBpZD0iT3ZhbCIgY3g9IjcuODcwMzYxMzMiIGN5PSIxMS4yNzU5NzY2IiByPSI3LjM3ODg1NzQyIj48L2NpcmNsZT4KICAgICAgICAgICAgPHBvbHlsaW5lIGlkPSJMaW5lLTIiIHN0cm9rZS1saW5lY2FwPSJzcXVhcmUiIHBvaW50cz0iNy43Njc5Njg3NSA3LjQ2MzI4MTI1IDcuNzY3OTY4NzUgMTEuOTYzMjgxMiAxMS4zNjc5Njg3IDExLjk2MzI4MTIiPjwvcG9seWxpbmU+CiAgICAgICAgPC9nPgogICAgPC9nPgo8L3N2Zz4K");

/***/ }),

/***/ 1823:
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_287630__) => {

"use strict";
__nested_webpack_require_287630__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_287630__.d(__nested_webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ("data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmlld0JveD0iMCAwIDEwMCAxMDAiPgogICAgPGxpbmUgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjZWVlIiBzdHJva2Utd2lkdGg9IjIwIiB4MT0iNSIgeTE9IjUiIHgyPSI5NSIgeTI9Ijk1Ii8+CiAgICA8bGluZSBmaWxsPSJub25lIiBzdHJva2U9IiNlZWUiIHN0cm9rZS13aWR0aD0iMjAiIHgxPSI5NSIgeTE9IjUiIHgyPSI1IiB5Mj0iOTUiLz4KPC9zdmc+Cg==");

/***/ }),

/***/ 2668:
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_288445__) => {

"use strict";
__nested_webpack_require_288445__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_288445__.d(__nested_webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ("data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmlld0JveD0iMCAwIDEwMCAxMDAiPgogICAgPGxpbmUgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjMDAwMDAwIiBzdHJva2Utd2lkdGg9IjIwIiB4MT0iNSIgeTE9IjUiIHgyPSI5NSIgeTI9Ijk1Ii8+CiAgICA8bGluZSBmaWxsPSJub25lIiBzdHJva2U9IiMwMDAwMDAiIHN0cm9rZS13aWR0aD0iMjAiIHgxPSI5NSIgeTE9IjUiIHgyPSI1IiB5Mj0iOTUiLz4KPC9zdmc+Cg==");

/***/ }),

/***/ 1109:
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_289268__) => {

"use strict";
__nested_webpack_require_289268__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_289268__.d(__nested_webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTYuNDI4NTcgNi40Mjg1N0wxNy42MDQzIDE3LjYwNDMiIHN0cm9rZT0iI0E0QTRBNCIgc3Ryb2tlLXdpZHRoPSIxLjUiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIvPgo8cGF0aCBkPSJNNi40Mjc3MyAxNy41NzE0TDE3LjYwMzUgNi4zOTU2MyIgc3Ryb2tlPSIjQTRBNEE0IiBzdHJva2Utd2lkdGg9IjEuNSIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIi8+Cjwvc3ZnPgo=");

/***/ }),

/***/ 6523:
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_290103__) => {

"use strict";
__nested_webpack_require_290103__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_290103__.d(__nested_webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ("data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB2aWV3Qm94PSIwIDAgMjAgMTkiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8ZGVmcz4KICAgICAgICA8cGF0aAogICAgICAgICAgICBkPSJNMjcuNjE1NjkzMSwzMjIuMjg4MDg2IEwyMC43Njc5Njg3LDMyMi4yODgwODYgTDIwLjc2Nzk2ODcsMzE1LjQxNjAyNiBMMjEuOTU5OTMxNCwzMTUuNDE2MDI2IEMyMi41MTAyOTA4LDMxNS40MTYwMjYgMjIuOTU2NDQ1MywzMTQuOTY5ODcxIDIyLjk1NjQ0NTMsMzE0LjQxOTUxMiBDMjIuOTU2NDQ1MywzMTMuODY5MTUzIDIyLjUxMDI5MDgsMzEzLjQyMjk5OCAyMS45NTk5MzE0LDMxMy40MjI5OTggTDIwLjc2Nzk2ODcsMzEzLjQyMjk5OCBMMjAuNzY3OTY4NywzMDYuOTE3MTEgTDI1LjkzOTg5MjYsMzA2LjkxNzExIEwyNS45Mzk4OTI2LDMwNi44MTYzNjggQzI1LjkzOTg5MjYsMzA1LjMyNTE5OSAyNy4xNDg3MjM4LDMwNC4xMTYzNjggMjguNjM5ODkyNiwzMDQuMTE2MzY4IEMzMC4xMzEwNjE0LDMwNC4xMTYzNjggMzEuMzM5ODkyNiwzMDUuMzI1MTk5IDMxLjMzOTg5MjYsMzA2LjgxNjM2OCBMMzEuMzM5ODkyNiwzMDYuOTE3MTEgTDM2LjEzODk0NDUsMzA2LjkxNzExIEwzNi4xMzg5NDQ1LDMxMS45MDI1OTggTDM2LjMzMjA4MDEsMzExLjkwMjU5OCBDMzcuODIzMjQ4OSwzMTEuOTAyNTk4IDM5LjAzMjA4MDEsMzEzLjExMTQyOSAzOS4wMzIwODAxLDMxNC42MDI1OTggQzM5LjAzMjA4MDEsMzE2LjA5Mzc2NyAzNy44MjMyNDg5LDMxNy4zMDI1OTggMzYuMzMyMDgwMSwzMTcuMzAyNTk4IEwzNi4xMzg5NDQ1LDMxNy4zMDI1OTggTDM2LjEzODk0NDUsMzIyLjI4ODA4NiBMMjkuNjA4NzIwOSwzMjIuMjg4MDg2IEwyOS42MDg3MjA5LDMyMC41NzE2OSBDMjkuNjA4NzIwOSwzMjAuMDIxMzMgMjkuMTYyNTY2NSwzMTkuNTc1MTc2IDI4LjYxMjIwNywzMTkuNTc1MTc2IEMyOC4wNjE4NDc2LDMxOS41NzUxNzYgMjcuNjE1NjkzMSwzMjAuMDIxMzMgMjcuNjE1NjkzMSwzMjAuNTcxNjkgTDI3LjYxNTY5MzEsMzIyLjI4ODA4NiBaIgogICAgICAgICAgICBpZD0icGF0aC0xIj48L3BhdGg+CiAgICA8L2RlZnM+CiAgICA8ZyBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMjAuMDAwMDAwLCAtMzA0LjAwMDAwMCkiPgogICAgICAgIDxnPgogICAgICAgICAgICA8dXNlIGZpbGwtcnVsZT0iZXZlbm9kZCIgeGxpbms6aHJlZj0iI3BhdGgtMSI+PC91c2U+CiAgICAgICAgICAgIDxwYXRoCiAgICAgICAgICAgICAgICBzdHJva2U9IiM5Nzk3OTciCiAgICAgICAgICAgICAgICBzdHJva2Utd2lkdGg9IjEuMzUiCiAgICAgICAgICAgICAgICBkPSJNMjYuOTQwNjkzMSwzMjEuNjEzMDg2IEwyNi45NDA2OTMxLDMyMC41NzE2OSBDMjYuOTQwNjkzMSwzMTkuNjQ4NTM4IDI3LjY4OTA1NTQsMzE4LjkwMDE3NiAyOC42MTIyMDcsMzE4LjkwMDE3NiBDMjkuNTM1MzU4NywzMTguOTAwMTc2IDMwLjI4MzcyMDksMzE5LjY0ODUzOCAzMC4yODM3MjA5LDMyMC41NzE2OSBMMzAuMjgzNzIwOSwzMjEuNjEzMDg2IEwzNS40NjM5NDQ1LDMyMS42MTMwODYgTDM1LjQ2Mzk0NDUsMzE2LjYyNzU5OCBMMzYuMzMyMDgwMSwzMTYuNjI3NTk4IEMzNy40NTA0NTY3LDMxNi42Mjc1OTggMzguMzU3MDgwMSwzMTUuNzIwOTc1IDM4LjM1NzA4MDEsMzE0LjYwMjU5OCBDMzguMzU3MDgwMSwzMTMuNDg0MjIxIDM3LjQ1MDQ1NjcsMzEyLjU3NzU5OCAzNi4zMzIwODAxLDMxMi41Nzc1OTggTDM1LjQ2Mzk0NDUsMzEyLjU3NzU5OCBMMzUuNDYzOTQ0NSwzMDcuNTkyMTEgTDMwLjY2NDg5MjYsMzA3LjU5MjExIEwzMC42NjQ4OTI2LDMwNi44MTYzNjggQzMwLjY2NDg5MjYsMzA1LjY5Nzk5MSAyOS43NTgyNjkyLDMwNC43OTEzNjggMjguNjM5ODkyNiwzMDQuNzkxMzY4IEMyNy41MjE1MTYsMzA0Ljc5MTM2OCAyNi42MTQ4OTI2LDMwNS42OTc5OTEgMjYuNjE0ODkyNiwzMDYuODE2MzY4IEwyNi42MTQ4OTI2LDMwNy41OTIxMSBMMjEuNDQyOTY4NywzMDcuNTkyMTEgTDIxLjQ0Mjk2ODcsMzEyLjc0Nzk5OCBMMjEuOTU5OTMxNCwzMTIuNzQ3OTk4IEMyMi44ODMwODMxLDMxMi43NDc5OTggMjMuNjMxNDQ1MywzMTMuNDk2MzYgMjMuNjMxNDQ1MywzMTQuNDE5NTEyIEMyMy42MzE0NDUzLDMxNS4zNDI2NjQgMjIuODgzMDgzMSwzMTYuMDkxMDI2IDIxLjk1OTkzMTQsMzE2LjA5MTAyNiBMMjEuNDQyOTY4NywzMTYuMDkxMDI2IEwyMS40NDI5Njg3LDMyMS42MTMwODYgTDI2Ljk0MDY5MzEsMzIxLjYxMzA4NiBaIj48L3BhdGg+CiAgICAgICAgPC9nPgogICAgPC9nPgo8L3N2Zz4K");

/***/ }),

/***/ 9713:
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_293750__) => {

"use strict";
__nested_webpack_require_293750__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_293750__.d(__nested_webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTQgMTBDNCAxMCA4IDE0Ljc3MiAxMiAxNC43NzJDMTYgMTQuNzcyIDIwIDEwIDIwIDEwIiBzdHJva2U9IiM2N0IyNzkiIHN0cm9rZS13aWR0aD0iMS41IiBzdHJva2UtbGluZWNhcD0icm91bmQiLz4KPHBhdGggZD0iTTEyIDE1VjE3IiBzdHJva2U9IiM2N0IyNzkiIHN0cm9rZS13aWR0aD0iMS41IiBzdHJva2UtbGluZWNhcD0icm91bmQiLz4KPHBhdGggZD0iTTE4IDEzVjE1IiBzdHJva2U9IiM2N0IyNzkiIHN0cm9rZS13aWR0aD0iMS41IiBzdHJva2UtbGluZWNhcD0icm91bmQiLz4KPHBhdGggZD0iTTYgMTNWMTUiIHN0cm9rZT0iIzY3QjI3OSIgc3Ryb2tlLXdpZHRoPSIxLjUiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIvPgo8L3N2Zz4K");

/***/ }),

/***/ 2834:
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_294793__) => {

"use strict";
__nested_webpack_require_294793__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_294793__.d(__nested_webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik00IDExLjc3MkM2LjY2NjY3IDguNTkwNjUgOS4zMzMzMyA3IDEyIDdDMTQuNjY2NyA3IDE3LjMzMzMgOC41OTA2NSAyMCAxMS43NzJDMjAgMTEuNzcyIDE2IDE2Ljc3MiAxMiAxNi43NzJDOCAxNi43NzIgNCAxMS43NzIgNCAxMS43NzJaIiBzdHJva2U9IiM2N0IyNzkiIHN0cm9rZS13aWR0aD0iMS41IiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xMiAxMEMxMy4xMDQ2IDEwIDE0IDEwLjg5NTQgMTQgMTJDMTQgMTMuMTA0NiAxMy4xMDQ2IDE0IDEyIDE0QzEwLjg5NTQgMTQgMTAgMTMuMTA0NiAxMCAxMkMxMCAxMC44OTU0IDEwLjg5NTQgMTAgMTIgMTBaIiBzdHJva2U9IiM2N0IyNzkiIHN0cm9rZS13aWR0aD0iMS41Ii8+Cjwvc3ZnPgo=");

/***/ }),

/***/ 6255:
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_295988__) => {

"use strict";
__nested_webpack_require_295988__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_295988__.d(__nested_webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ("data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB2aWV3Qm94PSIwIDAgMTkgMTciIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8ZGVmcz4KICAgICAgICA8cmVjdCBpZD0icGF0aC0xIiB4PSIwLjc2Nzk2ODc1IiB5PSIwLjk4MDY2NDA2MyIgd2lkdGg9IjE4IiBoZWlnaHQ9IjE1Ljg4MDUxNzYiIHJ4PSIxLjgiPjwvcmVjdD4KICAgIDwvZGVmcz4KICAgIDxnIHN0cm9rZT0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMC4wMDAwMDAsIC0xODQuMDAwMDAwKSI+CiAgICAgICAgPGcgaWQ9Ikdyb3VwLTMiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDIwLjAwMDAwMCwgMTg0LjAwMDAwMCkiPgogICAgICAgICAgICA8ZyBpZD0iUmVjdGFuZ2xlIj4KICAgICAgICAgICAgICAgIDx1c2UgZmlsbC1ydWxlPSJldmVub2RkIiB4bGluazpocmVmPSIjcGF0aC0xIj48L3VzZT4KICAgICAgICAgICAgICAgIDxyZWN0IHN0cm9rZT0iIzk3OTc5NyIgc3Ryb2tlLXdpZHRoPSIxLjM1IiB4PSIxLjQ0Mjk2ODc1IiB5PSIxLjY1NTY2NDA2IiB3aWR0aD0iMTYuNjUiIGhlaWdodD0iMTQuNTMwNTE3NiIgcng9IjEuOCI+PC9yZWN0PgogICAgICAgICAgICA8L2c+CiAgICAgICAgICAgIDxwb2x5bGluZSBpZD0iTGluZS0zIiBzdHJva2U9IiM5Nzk3OTciIHN0cm9rZS13aWR0aD0iMS4zNSIgc3Ryb2tlLWxpbmVjYXA9InNxdWFyZSIgcG9pbnRzPSIxLjYyNjY2MDE2IDEzLjA3MTMzNzkgNS4yMjY2NjAxNiA5LjQ3MTMzNzg5IDguMTc0MDcyMjcgMTIuMTE1NTI3MyAxMi45Mjk4MzQgNi43MjgyNzE0OCAxNy44Njc5Njg3IDEyLjMzMzA1NjYiPjwvcG9seWxpbmU+CiAgICAgICAgPC9nPgogICAgPC9nPgo8L3N2Zz4K");

/***/ }),

/***/ 9053:
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_297719__) => {

"use strict";
__nested_webpack_require_297719__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_297719__.d(__nested_webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ("data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB2aWV3Qm94PSIwIDAgMzUgMzYiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8ZyBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMTY0LjAwMDAwMCwgLTIxOS4wMDAwMDApIj4KICAgICAgICA8ZyBpZD0iMyIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoNDAuMDAwMDAwLCAxOTAuMDAwMDAwKSI+CiAgICAgICAgICAgIDxnIHRyYW5zZm9ybT0idHJhbnNsYXRlKDEyNC41MDAwMDAsIDI5LjQxNDA2MikiPgogICAgICAgICAgICAgICAgPGcgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMC40NTM2NTYsIDAuMjI2ODI4KSI+CiAgICAgICAgICAgICAgICAgICAgPGc+CiAgICAgICAgICAgICAgICAgICAgICAgIDxnPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgPHBhdGgKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkPSJNMTYuNzE1NzQ5MiwwIEMxMS40OTA5MTk1LDAgNS4xODg0Njg3NywxLjI2NTU4MzUxIDUuMTI2MjAxMTRlLTA2LDQuMDUxMjIyMzkgQzUuMTI2MjAxMTRlLTA2LDEwLjA2NzQ0OTUgLTAuMDcxNjEzNjMyNCwyNS4wNTU2OTI1IDE2LjcxNTc0OTIsMzUuMjk2Njc5OCBDMzMuNTAzNDgzLDI1LjA1NTY5MjUgMzMuNDMyMjM1NCwxMC4wNjc0NDk1IDMzLjQzMjIzNTQsNC4wNTEyMjIzOSBDMjguMjQzNDAwNiwxLjI2NTU4MzUxIDIxLjk0MDk0OTksMCAxNi43MTU3NDkyLDAgTDE2LjcxNTc0OTIsMCBaIgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlkPSJQYXRoIgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZpbGw9IiM2OEJDNzEiPjwvcGF0aD4KICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxwYXRoIGQ9Ik0xNi42OTg2NzQzLDM1LjI4NjI1ODIgQy0wLjA3MTU2NTA2MDUsMjUuMDQ1NTI2OCA1LjEyNjIwMTEzZS0wNiwxMC4wNjU0MDkxIDUuMTI2MjAxMTNlLTA2LDQuMDUxMjIyMzkgQzUuMTgyODE4MDIsMS4yNjg2MTczNCAxMS40NzcxOTI5LDAuMDAyNzU4NDkxMjQgMTYuNjk4Njc0Myw0LjUwMzc4MzExZS0wNiBMMTYuNjk4Njc0MywzNS4yODYyNjE3IFoiIGlkPSJDb21iaW5lZC1TaGFwZSIgZmlsbD0iIzY3QjI3OSI+PC9wYXRoPgogICAgICAgICAgICAgICAgICAgICAgICA8L2c+CiAgICAgICAgICAgICAgICAgICAgICAgIDxwYXRoCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkPSJNMTYuMTA2MDI0NywyMy41NTEwOTQgTDI2LjIxNDMxNTUsOS41MTgwMTg2OSBDMjUuNDczNjAwNSw4LjkwNjQ3MjQ5IDI0LjgyMzg4NzYsOS4zMzgwODkxNiAyNC40NjYyMjgxLDkuNjcyMjQ0IEwyNC40NTMxNzc0LDkuNjczMzE1MDEgTDE2LjAyNDg5ODcsMTguNzA0NDIwOCBMMTIuODQ5MzQ3NywxNC43NjgxMDUzIEMxMS4zMzQ0MDkxLDEyLjk2NTI0IDkuMjc0ODY4NjYsMTQuMzQwNDE1NyA4Ljc5Mzc1NjYyLDE0LjcwMzg0NDggTDE2LjEwNjAyNDcsMjMuNTUxMDk0IgogICAgICAgICAgICAgICAgICAgICAgICAgICAgaWQ9IkZpbGwtMTEiCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmaWxsPSIjRkZGRkZGIj48L3BhdGg+CiAgICAgICAgICAgICAgICAgICAgPC9nPgogICAgICAgICAgICAgICAgPC9nPgogICAgICAgICAgICA8L2c+CiAgICAgICAgPC9nPgogICAgPC9nPgo8L3N2Zz4K");

/***/ }),

/***/ 6265:
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_300518__) => {

"use strict";
__nested_webpack_require_300518__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_300518__.d(__nested_webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTEwIDZWMTBINiIgc3Ryb2tlPSIjQTRBNEE0IiBzdHJva2Utd2lkdGg9IjEuNSIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+CjxwYXRoIGQ9Ik0xMCAxOFYxNEg2IiBzdHJva2U9IiNBNEE0QTQiIHN0cm9rZS13aWR0aD0iMS41IiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz4KPHBhdGggZD0iTTE0IDZWMTBIMTgiIHN0cm9rZT0iI0E0QTRBNCIgc3Ryb2tlLXdpZHRoPSIxLjUiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPgo8cGF0aCBkPSJNMTQgMThWMTRIMTgiIHN0cm9rZT0iI0E0QTRBNCIgc3Ryb2tlLXdpZHRoPSIxLjUiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPgo8L3N2Zz4K");

/***/ }),

/***/ 7693:
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_301645__) => {

"use strict";
__nested_webpack_require_301645__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_301645__.d(__nested_webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTYgMTBWNkgxME02IDE0VjE4SDEwTTE4IDEwVjZIMTRNMTggMTRWMThIMTQiIHN0cm9rZT0iI0E0QTRBNCIgc3Ryb2tlLXdpZHRoPSIxLjUiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPgo8L3N2Zz4K");

/***/ }),

/***/ 8115:
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_302388__) => {

"use strict";
__nested_webpack_require_302388__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_302388__.d(__nested_webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ("data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiCiAgICAgd2lkdGg9IjQwMCIgaGVpZ2h0PSIyMDAiIHZpZXdCb3g9IjAgMCA0MDAgMjAwIj4KICAgIDxkZWZzPgogICAgICAgIDxnIGlkPSJhcnIiPgogICAgICAgICAgICA8cG9seWdvbiBwb2ludHM9IjE4LjgsODQuNSAxOC44LDMyIDg2LjcsMTAwIDEwMCw4Ni43IDMyLDE4LjggODQuNSwxOC44IDg0LjUsMCAxOC44LDAgMCwwIDAsMTguOAogICAgICAgICAgICAgICAgMCw4NC41IAkiLz4KICAgICAgICA8L2c+CiAgICA8L2RlZnM+CgogICAgPHVzZSB4bGluazpocmVmPSIjYXJyIiBmaWxsPSIjYWJhYmFiIi8+CiAgICA8dXNlIHhsaW5rOmhyZWY9IiNhcnIiIGZpbGw9IiNhYmFiYWIiIHRyYW5zZm9ybT0icm90YXRlKDkwIDEwMCAxMDApIi8+CiAgICA8dXNlIHhsaW5rOmhyZWY9IiNhcnIiIGZpbGw9IiNhYmFiYWIiIHRyYW5zZm9ybT0icm90YXRlKDE4MCAxMDAgMTAwKSIvPgogICAgPHVzZSB4bGluazpocmVmPSIjYXJyIiBmaWxsPSIjYWJhYmFiIiB0cmFuc2Zvcm09InJvdGF0ZSgyNzAgMTAwIDEwMCkiLz4KCiAgICA8dXNlIHhsaW5rOmhyZWY9IiNhcnIiIGZpbGw9IiNmZmYiIHg9IjIwMCIvPgogICAgPHVzZSB4bGluazpocmVmPSIjYXJyIiBmaWxsPSIjZmZmIiB5PSItMjAwIiB0cmFuc2Zvcm09InJvdGF0ZSg5MCAxMDAgMTAwKSIvPgogICAgPHVzZSB4bGluazpocmVmPSIjYXJyIiBmaWxsPSIjZmZmIiB4PSItMjAwIiB0cmFuc2Zvcm09InJvdGF0ZSgxODAgMTAwIDEwMCkiLz4KICAgIDx1c2UgeGxpbms6aHJlZj0iI2FyciIgZmlsbD0iI2ZmZiIgeT0iMjAwIiB0cmFuc2Zvcm09InJvdGF0ZSgyNzAgMTAwIDEwMCkiLz4KPC9zdmc+Cg==");

/***/ }),

/***/ 9385:
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_304083__) => {

"use strict";
__nested_webpack_require_304083__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_304083__.d(__nested_webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ("data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB2aWV3Qm94PSIwIDAgMTcgMTgiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8ZyBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMjIuMDAwMDAwLCAtMjI0LjAwMDAwMCkiPgogICAgICAgIDxwYXRoIGQ9Ik0yMi44MTc1NzgxLDIzNC40MTc0NTUgTDIyLjgxNzU3ODEsMjQwLjU1OTc0NyBMMzYuODk2MDY2LDIzMi43MjMwODkgTDIyLjgxNzU3ODEsMjI1LjY5OTEyMSBMMjIuODE3NTc4MSwyMzEuMDgwNTcyIEwyNS45Nzg4MzYzLDIzMi42NTc3NzEgTDIyLjgxNzU3ODEsMjM0LjQxNzQ1NSBaIiBpZD0iQ29tYmluZWQtU2hhcGUiIHN0cm9rZT0iIzk3OTc5NyIgc3Ryb2tlLXdpZHRoPSIxLjM1Ij48L3BhdGg+CiAgICA8L2c+Cjwvc3ZnPgo=");

/***/ }),

/***/ 8225:
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_305218__) => {

"use strict";
__nested_webpack_require_305218__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_305218__.d(__nested_webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ("data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB2aWV3Qm94PSIwIDAgMTggMTgiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8ZyBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMjEuMDAwMDAwLCAtMjYzLjAwMDAwMCkiPgogICAgICAgIDxwYXRoIGQ9Ik0zMC4wMjM1ODk1LDI4MC4xMTkwMjQgQzI5Ljk3MTAwMTYsMjgwLjExOTAyNCAyOS45MTgzNjI1LDI4MC4xMTA4OTggMjkuODY3NjY1NSwyODAuMDk0NjQ3IEMyOC4xNjM1OTE1LDI3OS41NDg3ODUgMjYuNzEyNzk4MSwyNzguNTAxNzc5IDI1LjU1NTUwNTcsMjc2Ljk4Mjc1OSBDMjQuNjQ0MzkwMywyNzUuNzg2ODMxIDIzLjkxNDg1NCwyNzQuMjk4MzczIDIzLjM4NzI4ODEsMjcyLjU1ODcyOSBDMjIuNDk3MzMwNSwyNjkuNjI0NDg1IDIyLjQ4NzEwOTQsMjY3LjAxMDUyMiAyMi40ODcxMDk0LDI2Ni45MDA2OTYgQzIyLjQ4NzEwOTQsMjY2LjYzNzUwMSAyMi42ODcwMzU1LDI2Ni40MTcyODYgMjIuOTQ5MDU1MywyNjYuMzkxOTg4IEMyMi45ODg1MDksMjY2LjM4ODE1NSAyNi45NTc2OTc0LDI2NS45ODA2ODggMjkuNzIzMjkxNCwyNjMuOTcyMjc5IEMyOS45MDIzNjY0LDI2My44NDIxNjMgMzAuMTQ0ODYzNywyNjMuODQyMzE2IDMwLjMyMzkzODcsMjYzLjk3MjMzIEMzMy4wODg3NjYyLDI2NS45ODA2ODggMzcuMDU4NDY1NiwyNjYuMzg4MTU1IDM3LjA5ODIyNTksMjY2LjM5MjAzOSBDMzcuMzYwMDQxMywyNjYuNDE3NTkyIDM3LjU1OTkxNjMsMjY2LjYzNzcwNSAzNy41NTk5MTYzLDI2Ni45MDA2OTYgQzM3LjU1OTkxNjMsMjY3LjAxMDUyMiAzNy41NDk2OTUyLDI2OS42MjQ0ODUgMzYuNjU5Nzg4NywyNzIuNTU4NzggQzM2LjEzMjE3MTcsMjc0LjI5ODQyNCAzNS40MDI2ODY1LDI3NS43ODY4ODIgMzQuNDkxNTcxMSwyNzYuOTgyODExIEMzMy4zMzQzMjk5LDI3OC41MDE4MyAzMS44ODM1MzY1LDI3OS41NDg4MzYgMzAuMTc5NDYyNCwyODAuMDk0Njk4IEMzMC4xMjg3NjU0LDI4MC4xMTA4OTggMzAuMDc2MTc3NSwyODAuMTE5MDI0IDMwLjAyMzU4OTUsMjgwLjExOTAyNCBMMzAuMDIzNTg5NSwyODAuMTE5MDI0IFoiIGlkPSJQYXRoIiBzdHJva2U9IiM5Nzk3OTciIHN0cm9rZS13aWR0aD0iMS4zNSI+PC9wYXRoPgogICAgPC9nPgo8L3N2Zz4K");

/***/ }),

/***/ 2286:
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_307341__) => {

"use strict";
__nested_webpack_require_307341__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_307341__.d(__nested_webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ("data:image/svg+xml;base64, ");

/***/ }),

/***/ 1660:
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_311896__) => {

"use strict";
__nested_webpack_require_311896__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_311896__.d(__nested_webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ("data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmlld0JveD0iMCAwIDUyIDE4Ij4KICAgIDxwYXRoIGQ9Ik01LjM1Myw3LjQxMiBMNS4zMDQsNy4zNjMgQzcuMTIxLDcuMTI1IDguNTI5LDUuNTg3IDguNTI5LDMuNzA2IEM4LjUyOSwxLjY1OSA2Ljg3LDAgNC44MjQsMCBDMi43NzcsMCAxLjExOCwxLjY1OSAxLjExOCwzLjcwNiBDMS4xMTgsNS41NzIgMi41MDIsNy4wOTkgNC4yOTQsNy4zNTggTDQuMjk0LDcuNDEyIEMxLjExOCw3LjQxMiAwLjA1OSw5LjUyOSAwLjA1OSw5LjUyOSBMMS4xMTgsMTUuODgyIEMxLjExOCwxNi45MzggMi40NzUsMTcuODA2IDQuMjQ0LDE3Ljk2NyBMNC4yOTQsMTggTDUuMzUzLDE4IEw1LjQwMywxNy45NjcgQzcuMTcyLDE3LjgwNiA4LjUyOSwxNi45MzggOC41MjksMTUuODgyIEw5LjU4OCw5LjUyOSBDOS41ODgsOS41MjkgOC41MjksNy40MTIgNS4zNTMsNy40MTIgeiIgZmlsbD0iI0Q2RDZENiIvPgogICAgPHBhdGggZD0iTTE1Ljk0MSw3LjQxMiBMMTUuODkyLDcuMzYzIEMxNy43MDksNy4xMjUgMTkuMTE4LDUuNTg3IDE5LjExOCwzLjcwNiBDMTkuMTE4LDEuNjU5IDE3LjQ1OCwwIDE1LjQxMiwwIEMxMy4zNjUsMCAxMS43MDYsMS42NTkgMTEuNzA2LDMuNzA2IEMxMS43MDYsNS41NzIgMTMuMDksNy4wOTkgMTQuODgyLDcuMzU4IEwxNC44ODIsNy40MTIgQzExLjcwNiw3LjQxMiAxMC42NDcsOS41MjkgMTAuNjQ3LDkuNTI5IEwxMS43MDYsMTUuODgyIEMxMS43MDYsMTYuOTM4IDEzLjA2MywxNy44MDYgMTQuODMzLDE3Ljk2NyBMMTQuODgyLDE4IEwxNS45NDEsMTggTDE1Ljk5MSwxNy45NjcgQzE3Ljc2LDE3LjgwNiAxOS4xMTgsMTYuOTM4IDE5LjExOCwxNS44ODIgTDIwLjE3Niw5LjUyOSBDMjAuMTc2LDkuNTI5IDE5LjExOCw3LjQxMiAxNS45NDEsNy40MTIgeiIgZmlsbD0iI0Q2RDZENiIvPgogICAgPHBhdGggZD0iTTI2LjUyOSw3LjQxMiBMMjYuNDgxLDcuMzYzIEMyOC4yOTgsNy4xMjUgMjkuNzA2LDUuNTg3IDI5LjcwNiwzLjcwNiBDMjkuNzA2LDEuNjU5IDI4LjA0NywwIDI2LDAgQzIzLjk1MywwIDIyLjI5NCwxLjY1OSAyMi4yOTQsMy43MDYgQzIyLjI5NCw1LjU3MiAyMy42NzgsNy4wOTkgMjUuNDcxLDcuMzU4IEwyNS40NzEsNy40MTIgQzIyLjI5NCw3LjQxMiAyMS4yMzUsOS41MjkgMjEuMjM1LDkuNTI5IEwyMi4yOTQsMTUuODgyIEMyMi4yOTQsMTYuOTM4IDIzLjY1MiwxNy44MDYgMjUuNDIxLDE3Ljk2NyBMMjUuNDcxLDE4IEwyNi41MjksMTggTDI2LjU3OSwxNy45NjcgQzI4LjM0OCwxNy44MDYgMjkuNzA2LDE2LjkzOCAyOS43MDYsMTUuODgyIEwzMC43NjUsOS41MjkgQzMwLjc2NSw5LjUyOSAyOS43MDYsNy40MTIgMjYuNTI5LDcuNDEyIHoiIGZpbGw9IiNENkQ2RDYiLz4KICAgIDxwYXRoIGQ9Ik0zNy4xMTgsNy40MTIgTDM3LjA2OSw3LjM2MyBDMzguODg2LDcuMTI1IDQwLjI5NCw1LjU4NyA0MC4yOTQsMy43MDYgQzQwLjI5NCwxLjY1OSAzOC42MzUsMCAzNi41ODgsMCBDMzQuNTQyLDAgMzIuODgyLDEuNjU5IDMyLjg4MiwzLjcwNiBDMzIuODgyLDUuNTcyIDM0LjI2Niw3LjA5OSAzNi4wNTksNy4zNTggTDM2LjA1OSw3LjQxMiBDMzIuODgyLDcuNDEyIDMxLjgyNCw5LjUyOSAzMS44MjQsOS41MjkgTDMyLjg4MiwxNS44ODIgQzMyLjg4MiwxNi45MzggMzQuMjQsMTcuODA2IDM2LjAwOSwxNy45NjcgTDM2LjA1OSwxOCBMMzcuMTE4LDE4IEwzNy4xNjcsMTcuOTY3IEMzOC45MzcsMTcuODA2IDQwLjI5NCwxNi45MzggNDAuMjk0LDE1Ljg4MiBMNDEuMzUzLDkuNTI5IEM0MS4zNTMsOS41MjkgNDAuMjk0LDcuNDEyIDM3LjExOCw3LjQxMiB6IiBmaWxsPSIjRDZENkQ2Ii8+CiAgICA8cGF0aCBkPSJNNDcuNzA2LDcuNDEyIEw0Ny42NTcsNy4zNjMgQzQ5LjQ3NCw3LjEyNSA1MC44ODIsNS41ODcgNTAuODgyLDMuNzA2IEM1MC44ODIsMS42NTkgNDkuMjIzLDAgNDcuMTc2LDAgQzQ1LjEzLDAgNDMuNDcxLDEuNjU5IDQzLjQ3MSwzLjcwNiBDNDMuNDcxLDUuNTcyIDQ0Ljg1NCw3LjA5OSA0Ni42NDcsNy4zNTggTDQ2LjY0Nyw3LjQxMiBDNDMuNDcxLDcuNDEyIDQyLjQxMiw5LjUyOSA0Mi40MTIsOS41MjkgTDQzLjQ3MSwxNS44ODIgQzQzLjQ3MSwxNi45MzggNDQuODI4LDE3LjgwNiA0Ni41OTcsMTcuOTY3IEw0Ni42NDcsMTggTDQ3LjcwNiwxOCBMNDcuNzU2LDE3Ljk2NyBDNDkuNTI1LDE3LjgwNiA1MC44ODIsMTYuOTM4IDUwLjg4MiwxNS44ODIgTDUxLjk0MSw5LjUyOSBDNTEuOTQxLDkuNTI5IDUwLjg4Miw3LjQxMiA0Ny43MDYsNy40MTIgeiIgZmlsbD0iI0Q2RDZENiIvPgo8L3N2Zz4K");

/***/ }),

/***/ 1372:
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_315455__) => {

"use strict";
__nested_webpack_require_315455__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_315455__.d(__nested_webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ("data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmlld0JveD0iMCAwIDUyIDE4Ij4KICAgIDxwYXRoIGQ9Ik01LjM1Myw3LjQxMiBMNS4zMDQsNy4zNjMgQzcuMTIxLDcuMTI1IDguNTI5LDUuNTg3IDguNTI5LDMuNzA2IEM4LjUyOSwxLjY1OSA2Ljg3LDAgNC44MjQsMCBDMi43NzcsMCAxLjExOCwxLjY1OSAxLjExOCwzLjcwNiBDMS4xMTgsNS41NzIgMi41MDIsNy4wOTkgNC4yOTQsNy4zNTggTDQuMjk0LDcuNDEyIEMxLjExOCw3LjQxMiAwLjA1OSw5LjUyOSAwLjA1OSw5LjUyOSBMMS4xMTgsMTUuODgyIEMxLjExOCwxNi45MzggMi40NzUsMTcuODA2IDQuMjQ0LDE3Ljk2NyBMNC4yOTQsMTggTDUuMzUzLDE4IEw1LjQwMywxNy45NjcgQzcuMTcyLDE3LjgwNiA4LjUyOSwxNi45MzggOC41MjksMTUuODgyIEw5LjU4OCw5LjUyOSBDOS41ODgsOS41MjkgOC41MjksNy40MTIgNS4zNTMsNy40MTIgeiIgZmlsbD0iIzcxNzE3MSIvPgogICAgPHBhdGggZD0iTTE1Ljk0MSw3LjQxMiBMMTUuODkyLDcuMzYzIEMxNy43MDksNy4xMjUgMTkuMTE4LDUuNTg3IDE5LjExOCwzLjcwNiBDMTkuMTE4LDEuNjU5IDE3LjQ1OCwwIDE1LjQxMiwwIEMxMy4zNjUsMCAxMS43MDYsMS42NTkgMTEuNzA2LDMuNzA2IEMxMS43MDYsNS41NzIgMTMuMDksNy4wOTkgMTQuODgyLDcuMzU4IEwxNC44ODIsNy40MTIgQzExLjcwNiw3LjQxMiAxMC42NDcsOS41MjkgMTAuNjQ3LDkuNTI5IEwxMS43MDYsMTUuODgyIEMxMS43MDYsMTYuOTM4IDEzLjA2MywxNy44MDYgMTQuODMzLDE3Ljk2NyBMMTQuODgyLDE4IEwxNS45NDEsMTggTDE1Ljk5MSwxNy45NjcgQzE3Ljc2LDE3LjgwNiAxOS4xMTgsMTYuOTM4IDE5LjExOCwxNS44ODIgTDIwLjE3Niw5LjUyOSBDMjAuMTc2LDkuNTI5IDE5LjExOCw3LjQxMiAxNS45NDEsNy40MTIgeiIgZmlsbD0iI0Q2RDZENiIvPgogICAgPHBhdGggZD0iTTI2LjUyOSw3LjQxMiBMMjYuNDgxLDcuMzYzIEMyOC4yOTgsNy4xMjUgMjkuNzA2LDUuNTg3IDI5LjcwNiwzLjcwNiBDMjkuNzA2LDEuNjU5IDI4LjA0NywwIDI2LDAgQzIzLjk1MywwIDIyLjI5NCwxLjY1OSAyMi4yOTQsMy43MDYgQzIyLjI5NCw1LjU3MiAyMy42NzgsNy4wOTkgMjUuNDcxLDcuMzU4IEwyNS40NzEsNy40MTIgQzIyLjI5NCw3LjQxMiAyMS4yMzUsOS41MjkgMjEuMjM1LDkuNTI5IEwyMi4yOTQsMTUuODgyIEMyMi4yOTQsMTYuOTM4IDIzLjY1MiwxNy44MDYgMjUuNDIxLDE3Ljk2NyBMMjUuNDcxLDE4IEwyNi41MjksMTggTDI2LjU3OSwxNy45NjcgQzI4LjM0OCwxNy44MDYgMjkuNzA2LDE2LjkzOCAyOS43MDYsMTUuODgyIEwzMC43NjUsOS41MjkgQzMwLjc2NSw5LjUyOSAyOS43MDYsNy40MTIgMjYuNTI5LDcuNDEyIHoiIGZpbGw9IiNENkQ2RDYiLz4KICAgIDxwYXRoIGQ9Ik0zNy4xMTgsNy40MTIgTDM3LjA2OSw3LjM2MyBDMzguODg2LDcuMTI1IDQwLjI5NCw1LjU4NyA0MC4yOTQsMy43MDYgQzQwLjI5NCwxLjY1OSAzOC42MzUsMCAzNi41ODgsMCBDMzQuNTQyLDAgMzIuODgyLDEuNjU5IDMyLjg4MiwzLjcwNiBDMzIuODgyLDUuNTcyIDM0LjI2Niw3LjA5OSAzNi4wNTksNy4zNTggTDM2LjA1OSw3LjQxMiBDMzIuODgyLDcuNDEyIDMxLjgyNCw5LjUyOSAzMS44MjQsOS41MjkgTDMyLjg4MiwxNS44ODIgQzMyLjg4MiwxNi45MzggMzQuMjQsMTcuODA2IDM2LjAwOSwxNy45NjcgTDM2LjA1OSwxOCBMMzcuMTE4LDE4IEwzNy4xNjcsMTcuOTY3IEMzOC45MzcsMTcuODA2IDQwLjI5NCwxNi45MzggNDAuMjk0LDE1Ljg4MiBMNDEuMzUzLDkuNTI5IEM0MS4zNTMsOS41MjkgNDAuMjk0LDcuNDEyIDM3LjExOCw3LjQxMiB6IiBmaWxsPSIjRDZENkQ2Ii8+CiAgICA8cGF0aCBkPSJNNDcuNzA2LDcuNDEyIEw0Ny42NTcsNy4zNjMgQzQ5LjQ3NCw3LjEyNSA1MC44ODIsNS41ODcgNTAuODgyLDMuNzA2IEM1MC44ODIsMS42NTkgNDkuMjIzLDAgNDcuMTc2LDAgQzQ1LjEzLDAgNDMuNDcxLDEuNjU5IDQzLjQ3MSwzLjcwNiBDNDMuNDcxLDUuNTcyIDQ0Ljg1NCw3LjA5OSA0Ni42NDcsNy4zNTggTDQ2LjY0Nyw3LjQxMiBDNDMuNDcxLDcuNDEyIDQyLjQxMiw5LjUyOSA0Mi40MTIsOS41MjkgTDQzLjQ3MSwxNS44ODIgQzQzLjQ3MSwxNi45MzggNDQuODI4LDE3LjgwNiA0Ni41OTcsMTcuOTY3IEw0Ni42NDcsMTggTDQ3LjcwNiwxOCBMNDcuNzU2LDE3Ljk2NyBDNDkuNTI1LDE3LjgwNiA1MC44ODIsMTYuOTM4IDUwLjg4MiwxNS44ODIgTDUxLjk0MSw5LjUyOSBDNTEuOTQxLDkuNTI5IDUwLjg4Miw3LjQxMiA0Ny43MDYsNy40MTIgeiIgZmlsbD0iI0Q2RDZENiIvPgo8L3N2Zz4K");

/***/ }),

/***/ 6112:
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_319014__) => {

"use strict";
__nested_webpack_require_319014__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_319014__.d(__nested_webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ("data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmlld0JveD0iMCAwIDUyIDE4Ij4KICAgIDxwYXRoIGQ9Ik01LjM1Myw3LjQxMiBMNS4zMDQsNy4zNjMgQzcuMTIxLDcuMTI1IDguNTI5LDUuNTg3IDguNTI5LDMuNzA2IEM4LjUyOSwxLjY1OSA2Ljg3LDAgNC44MjQsMCBDMi43NzcsMCAxLjExOCwxLjY1OSAxLjExOCwzLjcwNiBDMS4xMTgsNS41NzIgMi41MDIsNy4wOTkgNC4yOTQsNy4zNTggTDQuMjk0LDcuNDEyIEMxLjExOCw3LjQxMiAwLjA1OSw5LjUyOSAwLjA1OSw5LjUyOSBMMS4xMTgsMTUuODgyIEMxLjExOCwxNi45MzggMi40NzUsMTcuODA2IDQuMjQ0LDE3Ljk2NyBMNC4yOTQsMTggTDUuMzUzLDE4IEw1LjQwMywxNy45NjcgQzcuMTcyLDE3LjgwNiA4LjUyOSwxNi45MzggOC41MjksMTUuODgyIEw5LjU4OCw5LjUyOSBDOS41ODgsOS41MjkgOC41MjksNy40MTIgNS4zNTMsNy40MTIgeiIgZmlsbD0iIzcxNzE3MSIvPgogICAgPHBhdGggZD0iTTE1Ljk0MSw3LjQxMiBMMTUuODkyLDcuMzYzIEMxNy43MDksNy4xMjUgMTkuMTE4LDUuNTg3IDE5LjExOCwzLjcwNiBDMTkuMTE4LDEuNjU5IDE3LjQ1OCwwIDE1LjQxMiwwIEMxMy4zNjUsMCAxMS43MDYsMS42NTkgMTEuNzA2LDMuNzA2IEMxMS43MDYsNS41NzIgMTMuMDksNy4wOTkgMTQuODgyLDcuMzU4IEwxNC44ODIsNy40MTIgQzExLjcwNiw3LjQxMiAxMC42NDcsOS41MjkgMTAuNjQ3LDkuNTI5IEwxMS43MDYsMTUuODgyIEMxMS43MDYsMTYuOTM4IDEzLjA2MywxNy44MDYgMTQuODMzLDE3Ljk2NyBMMTQuODgyLDE4IEwxNS45NDEsMTggTDE1Ljk5MSwxNy45NjcgQzE3Ljc2LDE3LjgwNiAxOS4xMTgsMTYuOTM4IDE5LjExOCwxNS44ODIgTDIwLjE3Niw5LjUyOSBDMjAuMTc2LDkuNTI5IDE5LjExOCw3LjQxMiAxNS45NDEsNy40MTIgeiIgZmlsbD0iIzcxNzE3MSIvPgogICAgPHBhdGggZD0iTTI2LjUyOSw3LjQxMiBMMjYuNDgxLDcuMzYzIEMyOC4yOTgsNy4xMjUgMjkuNzA2LDUuNTg3IDI5LjcwNiwzLjcwNiBDMjkuNzA2LDEuNjU5IDI4LjA0NywwIDI2LDAgQzIzLjk1MywwIDIyLjI5NCwxLjY1OSAyMi4yOTQsMy43MDYgQzIyLjI5NCw1LjU3MiAyMy42NzgsNy4wOTkgMjUuNDcxLDcuMzU4IEwyNS40NzEsNy40MTIgQzIyLjI5NCw3LjQxMiAyMS4yMzUsOS41MjkgMjEuMjM1LDkuNTI5IEwyMi4yOTQsMTUuODgyIEMyMi4yOTQsMTYuOTM4IDIzLjY1MiwxNy44MDYgMjUuNDIxLDE3Ljk2NyBMMjUuNDcxLDE4IEwyNi41MjksMTggTDI2LjU3OSwxNy45NjcgQzI4LjM0OCwxNy44MDYgMjkuNzA2LDE2LjkzOCAyOS43MDYsMTUuODgyIEwzMC43NjUsOS41MjkgQzMwLjc2NSw5LjUyOSAyOS43MDYsNy40MTIgMjYuNTI5LDcuNDEyIHoiIGZpbGw9IiNENkQ2RDYiLz4KICAgIDxwYXRoIGQ9Ik0zNy4xMTgsNy40MTIgTDM3LjA2OSw3LjM2MyBDMzguODg2LDcuMTI1IDQwLjI5NCw1LjU4NyA0MC4yOTQsMy43MDYgQzQwLjI5NCwxLjY1OSAzOC42MzUsMCAzNi41ODgsMCBDMzQuNTQyLDAgMzIuODgyLDEuNjU5IDMyLjg4MiwzLjcwNiBDMzIuODgyLDUuNTcyIDM0LjI2Niw3LjA5OSAzNi4wNTksNy4zNTggTDM2LjA1OSw3LjQxMiBDMzIuODgyLDcuNDEyIDMxLjgyNCw5LjUyOSAzMS44MjQsOS41MjkgTDMyLjg4MiwxNS44ODIgQzMyLjg4MiwxNi45MzggMzQuMjQsMTcuODA2IDM2LjAwOSwxNy45NjcgTDM2LjA1OSwxOCBMMzcuMTE4LDE4IEwzNy4xNjcsMTcuOTY3IEMzOC45MzcsMTcuODA2IDQwLjI5NCwxNi45MzggNDAuMjk0LDE1Ljg4MiBMNDEuMzUzLDkuNTI5IEM0MS4zNTMsOS41MjkgNDAuMjk0LDcuNDEyIDM3LjExOCw3LjQxMiB6IiBmaWxsPSIjRDZENkQ2Ii8+CiAgICA8cGF0aCBkPSJNNDcuNzA2LDcuNDEyIEw0Ny42NTcsNy4zNjMgQzQ5LjQ3NCw3LjEyNSA1MC44ODIsNS41ODcgNTAuODgyLDMuNzA2IEM1MC44ODIsMS42NTkgNDkuMjIzLDAgNDcuMTc2LDAgQzQ1LjEzLDAgNDMuNDcxLDEuNjU5IDQzLjQ3MSwzLjcwNiBDNDMuNDcxLDUuNTcyIDQ0Ljg1NCw3LjA5OSA0Ni42NDcsNy4zNTggTDQ2LjY0Nyw3LjQxMiBDNDMuNDcxLDcuNDEyIDQyLjQxMiw5LjUyOSA0Mi40MTIsOS41MjkgTDQzLjQ3MSwxNS44ODIgQzQzLjQ3MSwxNi45MzggNDQuODI4LDE3LjgwNiA0Ni41OTcsMTcuOTY3IEw0Ni42NDcsMTggTDQ3LjcwNiwxOCBMNDcuNzU2LDE3Ljk2NyBDNDkuNTI1LDE3LjgwNiA1MC44ODIsMTYuOTM4IDUwLjg4MiwxNS44ODIgTDUxLjk0MSw5LjUyOSBDNTEuOTQxLDkuNTI5IDUwLjg4Miw3LjQxMiA0Ny43MDYsNy40MTIgeiIgZmlsbD0iI0Q2RDZENiIvPgo8L3N2Zz4K");

/***/ }),

/***/ 9919:
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_322573__) => {

"use strict";
__nested_webpack_require_322573__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_322573__.d(__nested_webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ("data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmlld0JveD0iMCAwIDUyIDE4Ij4KICAgIDxwYXRoIGQ9Ik01LjM1Myw3LjQxMiBMNS4zMDQsNy4zNjMgQzcuMTIxLDcuMTI1IDguNTI5LDUuNTg3IDguNTI5LDMuNzA2IEM4LjUyOSwxLjY1OSA2Ljg3LDAgNC44MjQsMCBDMi43NzcsMCAxLjExOCwxLjY1OSAxLjExOCwzLjcwNiBDMS4xMTgsNS41NzIgMi41MDIsNy4wOTkgNC4yOTQsNy4zNTggTDQuMjk0LDcuNDEyIEMxLjExOCw3LjQxMiAwLjA1OSw5LjUyOSAwLjA1OSw5LjUyOSBMMS4xMTgsMTUuODgyIEMxLjExOCwxNi45MzggMi40NzUsMTcuODA2IDQuMjQ0LDE3Ljk2NyBMNC4yOTQsMTggTDUuMzUzLDE4IEw1LjQwMywxNy45NjcgQzcuMTcyLDE3LjgwNiA4LjUyOSwxNi45MzggOC41MjksMTUuODgyIEw5LjU4OCw5LjUyOSBDOS41ODgsOS41MjkgOC41MjksNy40MTIgNS4zNTMsNy40MTIgeiIgZmlsbD0iIzcxNzE3MSIvPgogICAgPHBhdGggZD0iTTE1Ljk0MSw3LjQxMiBMMTUuODkyLDcuMzYzIEMxNy43MDksNy4xMjUgMTkuMTE4LDUuNTg3IDE5LjExOCwzLjcwNiBDMTkuMTE4LDEuNjU5IDE3LjQ1OCwwIDE1LjQxMiwwIEMxMy4zNjUsMCAxMS43MDYsMS42NTkgMTEuNzA2LDMuNzA2IEMxMS43MDYsNS41NzIgMTMuMDksNy4wOTkgMTQuODgyLDcuMzU4IEwxNC44ODIsNy40MTIgQzExLjcwNiw3LjQxMiAxMC42NDcsOS41MjkgMTAuNjQ3LDkuNTI5IEwxMS43MDYsMTUuODgyIEMxMS43MDYsMTYuOTM4IDEzLjA2MywxNy44MDYgMTQuODMzLDE3Ljk2NyBMMTQuODgyLDE4IEwxNS45NDEsMTggTDE1Ljk5MSwxNy45NjcgQzE3Ljc2LDE3LjgwNiAxOS4xMTgsMTYuOTM4IDE5LjExOCwxNS44ODIgTDIwLjE3Niw5LjUyOSBDMjAuMTc2LDkuNTI5IDE5LjExOCw3LjQxMiAxNS45NDEsNy40MTIgeiIgZmlsbD0iIzcxNzE3MSIvPgogICAgPHBhdGggZD0iTTI2LjUyOSw3LjQxMiBMMjYuNDgxLDcuMzYzIEMyOC4yOTgsNy4xMjUgMjkuNzA2LDUuNTg3IDI5LjcwNiwzLjcwNiBDMjkuNzA2LDEuNjU5IDI4LjA0NywwIDI2LDAgQzIzLjk1MywwIDIyLjI5NCwxLjY1OSAyMi4yOTQsMy43MDYgQzIyLjI5NCw1LjU3MiAyMy42NzgsNy4wOTkgMjUuNDcxLDcuMzU4IEwyNS40NzEsNy40MTIgQzIyLjI5NCw3LjQxMiAyMS4yMzUsOS41MjkgMjEuMjM1LDkuNTI5IEwyMi4yOTQsMTUuODgyIEMyMi4yOTQsMTYuOTM4IDIzLjY1MiwxNy44MDYgMjUuNDIxLDE3Ljk2NyBMMjUuNDcxLDE4IEwyNi41MjksMTggTDI2LjU3OSwxNy45NjcgQzI4LjM0OCwxNy44MDYgMjkuNzA2LDE2LjkzOCAyOS43MDYsMTUuODgyIEwzMC43NjUsOS41MjkgQzMwLjc2NSw5LjUyOSAyOS43MDYsNy40MTIgMjYuNTI5LDcuNDEyIHoiIGZpbGw9IiM3MTcxNzEiLz4KICAgIDxwYXRoIGQ9Ik0zNy4xMTgsNy40MTIgTDM3LjA2OSw3LjM2MyBDMzguODg2LDcuMTI1IDQwLjI5NCw1LjU4NyA0MC4yOTQsMy43MDYgQzQwLjI5NCwxLjY1OSAzOC42MzUsMCAzNi41ODgsMCBDMzQuNTQyLDAgMzIuODgyLDEuNjU5IDMyLjg4MiwzLjcwNiBDMzIuODgyLDUuNTcyIDM0LjI2Niw3LjA5OSAzNi4wNTksNy4zNTggTDM2LjA1OSw3LjQxMiBDMzIuODgyLDcuNDEyIDMxLjgyNCw5LjUyOSAzMS44MjQsOS41MjkgTDMyLjg4MiwxNS44ODIgQzMyLjg4MiwxNi45MzggMzQuMjQsMTcuODA2IDM2LjAwOSwxNy45NjcgTDM2LjA1OSwxOCBMMzcuMTE4LDE4IEwzNy4xNjcsMTcuOTY3IEMzOC45MzcsMTcuODA2IDQwLjI5NCwxNi45MzggNDAuMjk0LDE1Ljg4MiBMNDEuMzUzLDkuNTI5IEM0MS4zNTMsOS41MjkgNDAuMjk0LDcuNDEyIDM3LjExOCw3LjQxMiB6IiBmaWxsPSIjRDZENkQ2Ii8+CiAgICA8cGF0aCBkPSJNNDcuNzA2LDcuNDEyIEw0Ny42NTcsNy4zNjMgQzQ5LjQ3NCw3LjEyNSA1MC44ODIsNS41ODcgNTAuODgyLDMuNzA2IEM1MC44ODIsMS42NTkgNDkuMjIzLDAgNDcuMTc2LDAgQzQ1LjEzLDAgNDMuNDcxLDEuNjU5IDQzLjQ3MSwzLjcwNiBDNDMuNDcxLDUuNTcyIDQ0Ljg1NCw3LjA5OSA0Ni42NDcsNy4zNTggTDQ2LjY0Nyw3LjQxMiBDNDMuNDcxLDcuNDEyIDQyLjQxMiw5LjUyOSA0Mi40MTIsOS41MjkgTDQzLjQ3MSwxNS44ODIgQzQzLjQ3MSwxNi45MzggNDQuODI4LDE3LjgwNiA0Ni41OTcsMTcuOTY3IEw0Ni42NDcsMTggTDQ3LjcwNiwxOCBMNDcuNzU2LDE3Ljk2NyBDNDkuNTI1LDE3LjgwNiA1MC44ODIsMTYuOTM4IDUwLjg4MiwxNS44ODIgTDUxLjk0MSw5LjUyOSBDNTEuOTQxLDkuNTI5IDUwLjg4Miw3LjQxMiA0Ny43MDYsNy40MTIgeiIgZmlsbD0iI0Q2RDZENiIvPgo8L3N2Zz4K");

/***/ }),

/***/ 9023:
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_326132__) => {

"use strict";
__nested_webpack_require_326132__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_326132__.d(__nested_webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ("data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmlld0JveD0iMCAwIDUyIDE4Ij4KICAgIDxwYXRoIGQ9Ik01LjM1Myw3LjQxMiBMNS4zMDQsNy4zNjMgQzcuMTIxLDcuMTI1IDguNTI5LDUuNTg3IDguNTI5LDMuNzA2IEM4LjUyOSwxLjY1OSA2Ljg3LDAgNC44MjQsMCBDMi43NzcsMCAxLjExOCwxLjY1OSAxLjExOCwzLjcwNiBDMS4xMTgsNS41NzIgMi41MDIsNy4wOTkgNC4yOTQsNy4zNTggTDQuMjk0LDcuNDEyIEMxLjExOCw3LjQxMiAwLjA1OSw5LjUyOSAwLjA1OSw5LjUyOSBMMS4xMTgsMTUuODgyIEMxLjExOCwxNi45MzggMi40NzUsMTcuODA2IDQuMjQ0LDE3Ljk2NyBMNC4yOTQsMTggTDUuMzUzLDE4IEw1LjQwMywxNy45NjcgQzcuMTcyLDE3LjgwNiA4LjUyOSwxNi45MzggOC41MjksMTUuODgyIEw5LjU4OCw5LjUyOSBDOS41ODgsOS41MjkgOC41MjksNy40MTIgNS4zNTMsNy40MTIgeiIgZmlsbD0iIzcxNzE3MSIvPgogICAgPHBhdGggZD0iTTE1Ljk0MSw3LjQxMiBMMTUuODkyLDcuMzYzIEMxNy43MDksNy4xMjUgMTkuMTE4LDUuNTg3IDE5LjExOCwzLjcwNiBDMTkuMTE4LDEuNjU5IDE3LjQ1OCwwIDE1LjQxMiwwIEMxMy4zNjUsMCAxMS43MDYsMS42NTkgMTEuNzA2LDMuNzA2IEMxMS43MDYsNS41NzIgMTMuMDksNy4wOTkgMTQuODgyLDcuMzU4IEwxNC44ODIsNy40MTIgQzExLjcwNiw3LjQxMiAxMC42NDcsOS41MjkgMTAuNjQ3LDkuNTI5IEwxMS43MDYsMTUuODgyIEMxMS43MDYsMTYuOTM4IDEzLjA2MywxNy44MDYgMTQuODMzLDE3Ljk2NyBMMTQuODgyLDE4IEwxNS45NDEsMTggTDE1Ljk5MSwxNy45NjcgQzE3Ljc2LDE3LjgwNiAxOS4xMTgsMTYuOTM4IDE5LjExOCwxNS44ODIgTDIwLjE3Niw5LjUyOSBDMjAuMTc2LDkuNTI5IDE5LjExOCw3LjQxMiAxNS45NDEsNy40MTIgeiIgZmlsbD0iIzcxNzE3MSIvPgogICAgPHBhdGggZD0iTTI2LjUyOSw3LjQxMiBMMjYuNDgxLDcuMzYzIEMyOC4yOTgsNy4xMjUgMjkuNzA2LDUuNTg3IDI5LjcwNiwzLjcwNiBDMjkuNzA2LDEuNjU5IDI4LjA0NywwIDI2LDAgQzIzLjk1MywwIDIyLjI5NCwxLjY1OSAyMi4yOTQsMy43MDYgQzIyLjI5NCw1LjU3MiAyMy42NzgsNy4wOTkgMjUuNDcxLDcuMzU4IEwyNS40NzEsNy40MTIgQzIyLjI5NCw3LjQxMiAyMS4yMzUsOS41MjkgMjEuMjM1LDkuNTI5IEwyMi4yOTQsMTUuODgyIEMyMi4yOTQsMTYuOTM4IDIzLjY1MiwxNy44MDYgMjUuNDIxLDE3Ljk2NyBMMjUuNDcxLDE4IEwyNi41MjksMTggTDI2LjU3OSwxNy45NjcgQzI4LjM0OCwxNy44MDYgMjkuNzA2LDE2LjkzOCAyOS43MDYsMTUuODgyIEwzMC43NjUsOS41MjkgQzMwLjc2NSw5LjUyOSAyOS43MDYsNy40MTIgMjYuNTI5LDcuNDEyIHoiIGZpbGw9IiM3MTcxNzEiLz4KICAgIDxwYXRoIGQ9Ik0zNy4xMTgsNy40MTIgTDM3LjA2OSw3LjM2MyBDMzguODg2LDcuMTI1IDQwLjI5NCw1LjU4NyA0MC4yOTQsMy43MDYgQzQwLjI5NCwxLjY1OSAzOC42MzUsMCAzNi41ODgsMCBDMzQuNTQyLDAgMzIuODgyLDEuNjU5IDMyLjg4MiwzLjcwNiBDMzIuODgyLDUuNTcyIDM0LjI2Niw3LjA5OSAzNi4wNTksNy4zNTggTDM2LjA1OSw3LjQxMiBDMzIuODgyLDcuNDEyIDMxLjgyNCw5LjUyOSAzMS44MjQsOS41MjkgTDMyLjg4MiwxNS44ODIgQzMyLjg4MiwxNi45MzggMzQuMjQsMTcuODA2IDM2LjAwOSwxNy45NjcgTDM2LjA1OSwxOCBMMzcuMTE4LDE4IEwzNy4xNjcsMTcuOTY3IEMzOC45MzcsMTcuODA2IDQwLjI5NCwxNi45MzggNDAuMjk0LDE1Ljg4MiBMNDEuMzUzLDkuNTI5IEM0MS4zNTMsOS41MjkgNDAuMjk0LDcuNDEyIDM3LjExOCw3LjQxMiB6IiBmaWxsPSIjNzE3MTcxIi8+CiAgICA8cGF0aCBkPSJNNDcuNzA2LDcuNDEyIEw0Ny42NTcsNy4zNjMgQzQ5LjQ3NCw3LjEyNSA1MC44ODIsNS41ODcgNTAuODgyLDMuNzA2IEM1MC44ODIsMS42NTkgNDkuMjIzLDAgNDcuMTc2LDAgQzQ1LjEzLDAgNDMuNDcxLDEuNjU5IDQzLjQ3MSwzLjcwNiBDNDMuNDcxLDUuNTcyIDQ0Ljg1NCw3LjA5OSA0Ni42NDcsNy4zNTggTDQ2LjY0Nyw3LjQxMiBDNDMuNDcxLDcuNDEyIDQyLjQxMiw5LjUyOSA0Mi40MTIsOS41MjkgTDQzLjQ3MSwxNS44ODIgQzQzLjQ3MSwxNi45MzggNDQuODI4LDE3LjgwNiA0Ni41OTcsMTcuOTY3IEw0Ni42NDcsMTggTDQ3LjcwNiwxOCBMNDcuNzU2LDE3Ljk2NyBDNDkuNTI1LDE3LjgwNiA1MC44ODIsMTYuOTM4IDUwLjg4MiwxNS44ODIgTDUxLjk0MSw5LjUyOSBDNTEuOTQxLDkuNTI5IDUwLjg4Miw3LjQxMiA0Ny43MDYsNy40MTIgeiIgZmlsbD0iI0Q2RDZENiIvPgo8L3N2Zz4K");

/***/ }),

/***/ 6810:
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_329691__) => {

"use strict";
__nested_webpack_require_329691__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_329691__.d(__nested_webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ("data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmlld0JveD0iMCAwIDUyIDE4Ij4KICAgIDxwYXRoIGQ9Ik01LjM1Myw3LjQxMiBMNS4zMDQsNy4zNjMgQzcuMTIxLDcuMTI1IDguNTI5LDUuNTg3IDguNTI5LDMuNzA2IEM4LjUyOSwxLjY1OSA2Ljg3LDAgNC44MjQsMCBDMi43NzcsMCAxLjExOCwxLjY1OSAxLjExOCwzLjcwNiBDMS4xMTgsNS41NzIgMi41MDIsNy4wOTkgNC4yOTQsNy4zNTggTDQuMjk0LDcuNDEyIEMxLjExOCw3LjQxMiAwLjA1OSw5LjUyOSAwLjA1OSw5LjUyOSBMMS4xMTgsMTUuODgyIEMxLjExOCwxNi45MzggMi40NzUsMTcuODA2IDQuMjQ0LDE3Ljk2NyBMNC4yOTQsMTggTDUuMzUzLDE4IEw1LjQwMywxNy45NjcgQzcuMTcyLDE3LjgwNiA4LjUyOSwxNi45MzggOC41MjksMTUuODgyIEw5LjU4OCw5LjUyOSBDOS41ODgsOS41MjkgOC41MjksNy40MTIgNS4zNTMsNy40MTIgeiIgZmlsbD0iIzcxNzE3MSIvPgogICAgPHBhdGggZD0iTTE1Ljk0MSw3LjQxMiBMMTUuODkyLDcuMzYzIEMxNy43MDksNy4xMjUgMTkuMTE4LDUuNTg3IDE5LjExOCwzLjcwNiBDMTkuMTE4LDEuNjU5IDE3LjQ1OCwwIDE1LjQxMiwwIEMxMy4zNjUsMCAxMS43MDYsMS42NTkgMTEuNzA2LDMuNzA2IEMxMS43MDYsNS41NzIgMTMuMDksNy4wOTkgMTQuODgyLDcuMzU4IEwxNC44ODIsNy40MTIgQzExLjcwNiw3LjQxMiAxMC42NDcsOS41MjkgMTAuNjQ3LDkuNTI5IEwxMS43MDYsMTUuODgyIEMxMS43MDYsMTYuOTM4IDEzLjA2MywxNy44MDYgMTQuODMzLDE3Ljk2NyBMMTQuODgyLDE4IEwxNS45NDEsMTggTDE1Ljk5MSwxNy45NjcgQzE3Ljc2LDE3LjgwNiAxOS4xMTgsMTYuOTM4IDE5LjExOCwxNS44ODIgTDIwLjE3Niw5LjUyOSBDMjAuMTc2LDkuNTI5IDE5LjExOCw3LjQxMiAxNS45NDEsNy40MTIgeiIgZmlsbD0iIzcxNzE3MSIvPgogICAgPHBhdGggZD0iTTI2LjUyOSw3LjQxMiBMMjYuNDgxLDcuMzYzIEMyOC4yOTgsNy4xMjUgMjkuNzA2LDUuNTg3IDI5LjcwNiwzLjcwNiBDMjkuNzA2LDEuNjU5IDI4LjA0NywwIDI2LDAgQzIzLjk1MywwIDIyLjI5NCwxLjY1OSAyMi4yOTQsMy43MDYgQzIyLjI5NCw1LjU3MiAyMy42NzgsNy4wOTkgMjUuNDcxLDcuMzU4IEwyNS40NzEsNy40MTIgQzIyLjI5NCw3LjQxMiAyMS4yMzUsOS41MjkgMjEuMjM1LDkuNTI5IEwyMi4yOTQsMTUuODgyIEMyMi4yOTQsMTYuOTM4IDIzLjY1MiwxNy44MDYgMjUuNDIxLDE3Ljk2NyBMMjUuNDcxLDE4IEwyNi41MjksMTggTDI2LjU3OSwxNy45NjcgQzI4LjM0OCwxNy44MDYgMjkuNzA2LDE2LjkzOCAyOS43MDYsMTUuODgyIEwzMC43NjUsOS41MjkgQzMwLjc2NSw5LjUyOSAyOS43MDYsNy40MTIgMjYuNTI5LDcuNDEyIHoiIGZpbGw9IiM3MTcxNzEiLz4KICAgIDxwYXRoIGQ9Ik0zNy4xMTgsNy40MTIgTDM3LjA2OSw3LjM2MyBDMzguODg2LDcuMTI1IDQwLjI5NCw1LjU4NyA0MC4yOTQsMy43MDYgQzQwLjI5NCwxLjY1OSAzOC42MzUsMCAzNi41ODgsMCBDMzQuNTQyLDAgMzIuODgyLDEuNjU5IDMyLjg4MiwzLjcwNiBDMzIuODgyLDUuNTcyIDM0LjI2Niw3LjA5OSAzNi4wNTksNy4zNTggTDM2LjA1OSw3LjQxMiBDMzIuODgyLDcuNDEyIDMxLjgyNCw5LjUyOSAzMS44MjQsOS41MjkgTDMyLjg4MiwxNS44ODIgQzMyLjg4MiwxNi45MzggMzQuMjQsMTcuODA2IDM2LjAwOSwxNy45NjcgTDM2LjA1OSwxOCBMMzcuMTE4LDE4IEwzNy4xNjcsMTcuOTY3IEMzOC45MzcsMTcuODA2IDQwLjI5NCwxNi45MzggNDAuMjk0LDE1Ljg4MiBMNDEuMzUzLDkuNTI5IEM0MS4zNTMsOS41MjkgNDAuMjk0LDcuNDEyIDM3LjExOCw3LjQxMiB6IiBmaWxsPSIjNzE3MTcxIi8+CiAgICA8cGF0aCBkPSJNNDcuNzA2LDcuNDEyIEw0Ny42NTcsNy4zNjMgQzQ5LjQ3NCw3LjEyNSA1MC44ODIsNS41ODcgNTAuODgyLDMuNzA2IEM1MC44ODIsMS42NTkgNDkuMjIzLDAgNDcuMTc2LDAgQzQ1LjEzLDAgNDMuNDcxLDEuNjU5IDQzLjQ3MSwzLjcwNiBDNDMuNDcxLDUuNTcyIDQ0Ljg1NCw3LjA5OSA0Ni42NDcsNy4zNTggTDQ2LjY0Nyw3LjQxMiBDNDMuNDcxLDcuNDEyIDQyLjQxMiw5LjUyOSA0Mi40MTIsOS41MjkgTDQzLjQ3MSwxNS44ODIgQzQzLjQ3MSwxNi45MzggNDQuODI4LDE3LjgwNiA0Ni41OTcsMTcuOTY3IEw0Ni42NDcsMTggTDQ3LjcwNiwxOCBMNDcuNzU2LDE3Ljk2NyBDNDkuNTI1LDE3LjgwNiA1MC44ODIsMTYuOTM4IDUwLjg4MiwxNS44ODIgTDUxLjk0MSw5LjUyOSBDNTEuOTQxLDkuNTI5IDUwLjg4Miw3LjQxMiA0Ny43MDYsNy40MTIgeiIgZmlsbD0iIzcxNzE3MSIvPgo8L3N2Zz4K");

/***/ }),

/***/ 2307:
/***/ ((__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_333250__) => {

"use strict";
__nested_webpack_require_333250__.r(__nested_webpack_exports__);
/* harmony export */ __nested_webpack_require_333250__.d(__nested_webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ("data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmlld0JveD0iMCAwIDM4IDE1Ij4KICAgIDxwYXRoIGQ9Ik0yMS45MSwxLjA4MyBDMTguMDA4LDEuMDgzIDE0Ljg0Niw0LjA3IDE0Ljg0Niw3Ljc1OCBDMTQuODQ2LDExLjQ0NSAxOC4wMDgsMTQuNDMyIDIxLjkxLDE0LjQzMiBDMjUuODEzLDE0LjQzMiAyOC45NzcsMTEuNDQ1IDI4Ljk3Nyw3Ljc1OCBDMjguOTc4LDQuMDcgMjUuODEzLDEuMDgzIDIxLjkxLDEuMDgzIHogTTIxLjc3MSwxMS45IEMxOS41LDExLjkgMTcuNjU3LDEwLjA1NiAxNy42NTcsNy43ODMgQzE3LjY1Nyw1LjUwOCAxOS41MDEsMy42NjQgMjEuNzcxLDMuNjY0IEMyNC4wNDUsMy42NjQgMjUuODg2LDUuNTA4IDI1Ljg4Niw3Ljc4MyBDMjUuODg2LDEwLjA1NyAyNC4wNDUsMTEuOSAyMS43NzEsMTEuOSB6IiBmaWxsPSIjNzRCMDNFIi8+CiAgICA8cGF0aCBkPSJNMTYuNzUxLDAuNjQyIEwxNy4wMzEsMCBMMTQuMDYzLDAgTDExLjI3LDggTDguNjQ4LDAgTDguMjcyLDAgTDUuNjUsOCBMMywwIEwwLjAzMSwwIEw0LjksMTMuNDg2IEM0LjksMTMuNDg2IDUuMDc4LDEzLjg2IDUuMjc1LDEzLjg2IEM1LjQ1MSwxMy44NiA1LjY0OSwxMy40ODYgNS42NDksMTMuNDg2IEw4LjQ0NSw2LjQwNiBMMTEuMjY5LDEzLjQ4NiBDMTEuMjY5LDEzLjQ4NiAxMS40NTUsMTMuODYgMTEuNjQzLDEzLjg2IEMxMS44MjksMTMuODYgMTIuMDE4LDEzLjQ4NiAxMi4wMTgsMTMuNDg2IEwxMy42MTQsOS4wNjcgQzEzLjQ0NSw4LjQzMyAxMy4zNDUsNy43NzMgMTMuMzQ1LDcuMDg5IEMxMy4zNDYsNC40NTMgMTQuNjg2LDIuMTE4IDE2Ljc1MSwwLjY0MiB6IiBmaWxsPSIjRUUzNDI4Ii8+CiAgICA8cGF0aCBkPSJNMjcuMDMxLDAgTDI3LjAzMSwwLjYxMyBDMjcuOTQ0LDEuMjU4IDI4LjcxNSwyLjA2NyAyOS4yOTUsMyBMMzEuMDMxLDMgTDMxLjAzMSwxNCBMMzQuMDMxLDE0IEwzNC4wMzEsMyBMMzguMDMxLDMgTDM4LjAzMSwwIEwyNy4wMzEsMCB6IiBmaWxsPSIjRjA4NjE1Ii8+Cjwvc3ZnPgo=");

/***/ }),

/***/ 897:
/***/ ((module) => {

"use strict";
module.exports = JSON.parse('[{"project_id":"adguard-assistant","base_locale":"en","languages":{"en":"English","ar":"Arabic","be":"Belarusian","cs":"Czech","da":"Danish","de":"German","el":"Greek","es":"Spanish","fa":"Persian","fi":"Finnish","fr":"French","he":"Hebrew","hu":"Hungarian","id":"Indonesian","it":"Italian","ja":"Japanese","ko":"Korean","lt":"Lithuanian","no":"Norwegian","nl":"Dutch","pl":"Polish","pt-BR":"Portuguese (Brazil)","pt-PT":"Portuguese","ro":"Romanian","ru":"Russian","sk":"Slovak","sl":"Slovenian","sr":"Serbian (latin)","sv":"Swedish","tr":"Turkish","uk":"Ukrainian","vi":"Vietnamese","zh-CN":"Chinese Simplified (mainland China)","zh-HK":"Chinese Traditional (Hong Kong)","zh-TW":"Chinese Traditional (Taiwan)","hi":"Hindi","hr":"Croatian"},"localizable_files":["locales/en/messages.json","locales/en/messages.meta.json"]}]');

/***/ }),

/***/ 5443:
/***/ ((module) => {

"use strict";
module.exports = JSON.parse('{"settings_position_save":"مواقع الويب","settings_position_save_all":"كافة مواقع الويب","settings_position_save_this":"هذا الموقع","assistant_select_element_start":"بدء","assistant_select_element_text":"اختر عنصرا في الصفحة للحظرقم بتحديث الصفحة لالغاء وضع حظر العنصر","menu_filtration_status":{"message":"تفعيل الفلترةعلى هذا الموقع"},"menu_do_not_filter_30_sec":{"message":"عدم الفلترة لمده 30 ثانيه"},"menu_block_ad_on_site":{"message":"منع الإعلان على هذا الموقع"},"menu_report_abuse":{"message":"الإبلاغ عن هذا الموقع"},"menu_site_report":{"message":"تقرير أمن الموقع"},"menu_settings":{"message":"إعدادات المساعد"},"menu_wot_reputation_indicator":{"message":"مؤشر سمعة الموقع"},"menu_wot_reputation_confidence_level":{"message":"مستوى الثقة في السمعة"},"assistant_select_element":{"message":"حظر العنصر"},"assistant_select_element_ext":{"message":"اختر عنصرا في الصفحة للحظر"},"assistant_select_element_cancel":{"message":"الغاء"},"assistant_block_element":{"message":"حظر العنصر"},"assistant_block_element_explain":{"message":"ضبط قاعدة حظر العنصر"},"assistant_slider_explain":{"message":"حرك شريط التمرير لتغيير حجم الإطار الذي ستعمل عليه القاعدة الجديدة:"},"assistant_extended_settings":{"message":"إعدادات متقدمة"},"assistant_apply_rule_to_all_sites":{"message":"تطبيق القاعدة علي كافة مواقع الويب"},"assistant_block_by_reference":{"message":"حظر حسب الارتباط المرجعي"},"assistant_block_similar":{"message":"حظر عنصر مما ثل"},"assistant_another_element":{"message":"حدد عنصرًا مختلفًا"},"assistant_preview":{"message":"المعاينه"},"assistant_block":{"message":"حظر"},"assistant_settings":{"message":"إعدادات المساعد"},"assistant_preview_header":{"message":"حجب عنصر--معاينه"},"assistant_preview_header_info":{"message":"تاكد من حظر هذا العنصر كما هو مقصود"},"assistant_preview_end":{"message":"إنهاء المعاينة"},"wot_unknown_description":{"message":"$1 لم يتم تعريف سمعه هذا الموقع من قبل"},"wot_bad_description":{"message":"$1هذا الموقع لديه سمعة سيئة للغاية \\nوفقاً لـ"},"wot_poor_description":{"message":"$1 هذا الموقع له سمعة سيئة \\nوفقا لـ"},"wot_unsatisfactory_description":{"message":"$1هذا الموقع له سمعة سيئة\\nوفقا لـ"},"wot_good_description":{"message":"$1يتمتع هذا الموقع بسمعة طيبة\\nوفقا لـ"},"wot_excellent_description":{"message":"هذا الموقع يتمتع بسمعة ممتازة\\nوفقاً لـ $1"},"settings_choose_size_and_position":{"message":"وموضعه AdGuard ضبط حجم مساعد"},"settings_icon_size":{"message":":حجم الرمز"},"settings_small":{"message":"صغير"},"settings_big":{"message":"كبير"},"settings_position":{"message":"وضع"},"settings_left_top":{"message":"اعلي اليسار"},"settings_right_top":{"message":"اعلي اليمين"},"settings_left_bottom":{"message":"أسفل لليسار"},"settings_right_bottom":{"message":"أسفل لليمين"},"settings_cancel":{"message":"الغاء"},"settings_save":{"message":"حفظ التغييرات"}}');

/***/ }),

/***/ 24:
/***/ ((module) => {

"use strict";
module.exports = JSON.parse('{"settings_position_save":"Сайты","settings_position_save_all":"На ўсіх","settings_position_save_this":"Толькі на гэтым","assistant_select_element_start":"Пачаць","assistant_select_element_text":"Абярыце на старонцы элемент для блакавання. Абнавіце старонку, каб скасаваць рэжым блакавання элементаў.","menu_filtration_status":{"message":"Фільтрацыя на гэтым сайце"},"menu_do_not_filter_30_sec":{"message":"Не фільтраваць 30 секундаў"},"menu_block_ad_on_site":{"message":"Заблакаваць рэкламу на сайце"},"menu_report_abuse":{"message":"Паскардзіцца на сайт"},"menu_site_report":{"message":"Справаздача пра бяспеку сайта"},"menu_settings":{"message":"Наладзіць памочнік"},"menu_wot_reputation_indicator":{"message":"Індыкатар рэпутацыі сайта"},"menu_wot_reputation_confidence_level":{"message":"Узровень верагоднасці рэпутацыі"},"assistant_select_element":{"message":"Блакаванне элемента"},"assistant_select_element_ext":{"message":"Абярыце на старонцы элемент, які трэба заблакаваць"},"assistant_select_element_cancel":{"message":"Скасаванне"},"assistant_block_element":{"message":"Блакаванне элемента"},"assistant_block_element_explain":{"message":"Наладзьце правіла блакавання элемента"},"assistant_slider_explain":{"message":"Перасоўвайце бегунок, каб змяніць памер блока, для якога будзе дзейнічаць правіла:"},"assistant_extended_settings":{"message":"Пашыраныя налады"},"assistant_apply_rule_to_all_sites":{"message":"Ужыць правіла для ўсіх сайтаў"},"assistant_block_by_reference":{"message":"Блакаваць па спасылцы"},"assistant_block_similar":{"message":"Блакаваць падобныя"},"assistant_another_element":{"message":"Абраць іншы элемент"},"assistant_preview":{"message":"Перадпрагляд"},"assistant_block":{"message":"Заблакаваць"},"assistant_settings":{"message":"Налада памочніка"},"assistant_preview_header":{"message":"Блакаванне элемента - перадпрагляд"},"assistant_preview_header_info":{"message":"Пераканаецеся, што элемент заблакаваны як задумана"},"assistant_preview_end":{"message":"Скончыць перадпрагляд"},"wot_unknown_description":{"message":"Рэпутацыя не вызначана"},"wot_bad_description":{"message":"У сайта вельмі дрэнная рэпутацыя па дадзеных $1"},"wot_poor_description":{"message":"У сайта дрэнная рэпутацыя па дадзеных $1"},"wot_unsatisfactory_description":{"message":"У сайта нездавальняльная рэпутацыя па дадзеных $1"},"wot_good_description":{"message":"У сайта добрая рэпутацыя па дадзеных $1"},"wot_excellent_description":{"message":"У сайта выдатная рэпутацыя па дадзеных $1"},"settings_choose_size_and_position":{"message":"Наладзьце памер і становішча памочніка AdGuard"},"settings_icon_size":{"message":"Памер іконкі:"},"settings_small":{"message":"Маленькая"},"settings_big":{"message":"Вялікая"},"settings_position":{"message":"Месцаванне:"},"settings_left_top":{"message":"Уверсе злева"},"settings_right_top":{"message":"Уверсе справа"},"settings_left_bottom":{"message":"Унізе злева"},"settings_right_bottom":{"message":"Унізе справа"},"settings_cancel":{"message":"Скасаваць"},"settings_save":{"message":"Захаваць налады"}}');

/***/ }),

/***/ 3337:
/***/ ((module) => {

"use strict";
module.exports = JSON.parse('{"settings_position_save":"Webové stránky","settings_position_save_all":"Všechny webové stránky","settings_position_save_this":"Tato webová stránka","assistant_select_element_start":"Spustit","assistant_select_element_text":"Vyberte prvek na stránce, který chcete zablokovat. Obnovte stránku pro zrušení režimu blokování prvků.","menu_filtration_status":{"message":"Filtrování na těchto webových stránkách"},"menu_do_not_filter_30_sec":{"message":"Nefiltrovat po dobu 30 sekund"},"menu_block_ad_on_site":{"message":"Blokovat reklamy na této webové stránce"},"menu_report_abuse":{"message":"Nahlásit webovou stránku"},"menu_site_report":{"message":"Zpráva o bezpečnosti webové stránky"},"menu_settings":{"message":"Nastavení asistenta"},"menu_wot_reputation_indicator":{"message":"Indikátor reputace webu"},"menu_wot_reputation_confidence_level":{"message":"Úroveň důvěryhodnosti reputace"},"assistant_select_element":{"message":"Blokování prvku"},"assistant_select_element_ext":{"message":"Vyberte prvek na stránce, který chcete zablokovat"},"assistant_select_element_cancel":{"message":"Zrušit"},"assistant_block_element":{"message":"Blokování prvku"},"assistant_block_element_explain":{"message":"Upravit pravidlo blokování prvku"},"assistant_slider_explain":{"message":"Přesunutím posuvníku změňte velikost rámce, pro který bude nové pravidlo fungovat:"},"assistant_extended_settings":{"message":"Pokročilá nastavení"},"assistant_apply_rule_to_all_sites":{"message":"Použít pravidlo pro všechny webové stránky"},"assistant_block_by_reference":{"message":"Blokovat referenčním odkazem"},"assistant_block_similar":{"message":"Blokovat podobné"},"assistant_another_element":{"message":"Vyber jiný prvek"},"assistant_preview":{"message":"Náhled"},"assistant_block":{"message":"Blokovat"},"assistant_settings":{"message":"Nastavení asistenta"},"assistant_preview_header":{"message":"Blokování prvku - náhled"},"assistant_preview_header_info":{"message":"Ujistěte se, že je prvek zablokován podle určení"},"assistant_preview_end":{"message":"Ukončit náhled"},"wot_unknown_description":{"message":"Pověst této webové stránky není definována podle $1"},"wot_bad_description":{"message":"Tato webová stránka má velmi špatnou pověst \\npodle $1"},"wot_poor_description":{"message":"Tato webová stránka má špatnou pověst \\npodle $1"},"wot_unsatisfactory_description":{"message":"Tato webová stránka má špatnou pověst \\npodle $1"},"wot_good_description":{"message":"Tato webová stránka má dobrou pověst \\npodle $1"},"wot_excellent_description":{"message":"Tato webová stránka má výbornou pověst \\npodle $1"},"settings_choose_size_and_position":{"message":"Upravit velikost a pozici AdGuard Asistenta"},"settings_icon_size":{"message":"Velikost ikony:"},"settings_small":{"message":"Malá"},"settings_big":{"message":"Velká"},"settings_position":{"message":"Pozice:"},"settings_left_top":{"message":"Vlevo nahoře"},"settings_right_top":{"message":"Vpravo nahoře"},"settings_left_bottom":{"message":"Vlevo dole"},"settings_right_bottom":{"message":"Vpravo dole"},"settings_cancel":{"message":"Zrušit"},"settings_save":{"message":"Uložit změny"}}');

/***/ }),

/***/ 7691:
/***/ ((module) => {

"use strict";
module.exports = JSON.parse('{"settings_position_save":"Websteder","settings_position_save_all":"Alle websteder","settings_position_save_this":"Dette websted","assistant_select_element_start":"Start","assistant_select_element_text":"Vælg et element på denne side, der skal blokeres. Opfrisk siden for at afbryde elementblokeringstilstanden.","menu_filtration_status":{"message":"Filtrering på dette websted"},"menu_do_not_filter_30_sec":{"message":"Filtrér ikke i 30 sekunder"},"menu_block_ad_on_site":{"message":"Blokér annoncer på dette websted"},"menu_report_abuse":{"message":"Anmeld dette websted"},"menu_site_report":{"message":"Webstedssikkerhedsrapport"},"menu_settings":{"message":"Assistent-indstillinger"},"menu_wot_reputation_indicator":{"message":"Webstedsomdømmeindikator"},"menu_wot_reputation_confidence_level":{"message":"Omdømmetillidsniveau"},"assistant_select_element":{"message":"Elementblokering"},"assistant_select_element_ext":{"message":"Vælg et element på siden, der skal blokeres"},"assistant_select_element_cancel":{"message":"Afbryd"},"assistant_block_element":{"message":"Elementblokering"},"assistant_block_element_explain":{"message":"Justér regel for elementblokering"},"assistant_slider_explain":{"message":"Flyt skyderen for at ændre størrelsen på den ramme, den nye regel vil fungere for:"},"assistant_extended_settings":{"message":"Avancerede indstillinger"},"assistant_apply_rule_to_all_sites":{"message":"Anvend reglen på alle websteder"},"assistant_block_by_reference":{"message":"Blokér efter referencelink"},"assistant_block_similar":{"message":"Blokér lignende"},"assistant_another_element":{"message":"Vælg et andet element"},"assistant_preview":{"message":"Forhåndsvisning"},"assistant_block":{"message":"Blokér"},"assistant_settings":{"message":"Assistent-indstillinger"},"assistant_preview_header":{"message":"Elementblokering - forhåndsvisning"},"assistant_preview_header_info":{"message":"Sørg for, at elementet er blokeret som tilsigtet"},"assistant_preview_end":{"message":"Afslut forhåndsvisning"},"wot_unknown_description":{"message":"Dette websteds omdømme er ikke defineret af $1"},"wot_bad_description":{"message":"Dette websted har et meget dårligt omdømme jf. $1"},"wot_poor_description":{"message":"Dette websted har et dårligt omdømme jf. $1"},"wot_unsatisfactory_description":{"message":"Dette websted har et ringe omdømme jf. $1"},"wot_good_description":{"message":"Dette websted har et godt omdømme jf. $1"},"wot_excellent_description":{"message":"Dette websted har et fremragende omdømme \\njf. $1"},"settings_choose_size_and_position":{"message":"Justér størrelse og position for AdGuard Assistent"},"settings_icon_size":{"message":"Ikonstørrelse:"},"settings_small":{"message":"Lille"},"settings_big":{"message":"Stor"},"settings_position":{"message":"Position:"},"settings_left_top":{"message":"Øverst til venstre"},"settings_right_top":{"message":"Øverst til højre"},"settings_left_bottom":{"message":"Nederst til venstre"},"settings_right_bottom":{"message":"Nederst til højre"},"settings_cancel":{"message":"Afbryd"},"settings_save":{"message":"Gem ændringer"}}');

/***/ }),

/***/ 9947:
/***/ ((module) => {

"use strict";
module.exports = JSON.parse('{"settings_position_save":"Webseiten","settings_position_save_all":"Alle Webseiten","settings_position_save_this":"Diese Webseite","assistant_select_element_start":"Starten","assistant_select_element_text":"Wählen Sie ein zu sperrenden Element auf der Seite aus. Laden Sie die Seite neu, um den Sperrmodus zu verlassen.","menu_filtration_status":{"message":"Diese Webseite filtern"},"menu_do_not_filter_30_sec":{"message":"Schutz für 30 Sekunden deaktivieren"},"menu_block_ad_on_site":{"message":"Werbung auf dieser Seite sperren"},"menu_report_abuse":{"message":"Diese Webseite melden"},"menu_site_report":{"message":"Sicherheitsbericht dieser Webseite"},"menu_settings":{"message":"Assistent-Einstellungen"},"menu_wot_reputation_indicator":{"message":"Website-Reputations-Indikator"},"menu_wot_reputation_confidence_level":{"message":"Reputationsvertrauensgrad"},"assistant_select_element":{"message":"Element sperren"},"assistant_select_element_ext":{"message":"Zu sperrendes Element auf der Seite auswählen"},"assistant_select_element_cancel":{"message":"Abbrechen"},"assistant_block_element":{"message":"Element sperren"},"assistant_block_element_explain":{"message":"Regel zum Sperren von Elementen anpassen"},"assistant_slider_explain":{"message":"Bewegen Sie den Schieberegler, um die Ausmaßgröße der neuen Regeln zu ändern:"},"assistant_extended_settings":{"message":"Erweiterte Einstellungen"},"assistant_apply_rule_to_all_sites":{"message":"Regel auf alle Webseiten anwenden"},"assistant_block_by_reference":{"message":"Durch Referenzlink sperren"},"assistant_block_similar":{"message":"Ähnliche Elemente sperren"},"assistant_another_element":{"message":"Ein anderes Element wählen"},"assistant_preview":{"message":"Vorschau"},"assistant_block":{"message":"Sperren"},"assistant_settings":{"message":"Assistent-Einstellungen"},"assistant_preview_header":{"message":"Vorschau der zu sperrenden Elemente"},"assistant_preview_header_info":{"message":"Prüfen Sie, ob das Element wie vorgesehen gesperrt wurde."},"assistant_preview_end":{"message":"Vorschau beenden"},"wot_unknown_description":{"message":"Der Ruf dieser Webseite wird nicht durch $1 festgelegt"},"wot_bad_description":{"message":"Diese Webseite hat einen sehr schlechten Ruf laut $1"},"wot_poor_description":{"message":"Diese Webseite hat einen schlechten Ruf laut $1"},"wot_unsatisfactory_description":{"message":"Diese Webseite hat einen schlechten Ruf laut $1"},"wot_good_description":{"message":"Diese Webseite hat einen guten Ruf laut $1"},"wot_excellent_description":{"message":"Diese Webseite hat einen exzellenten Ruf laut $1"},"settings_choose_size_and_position":{"message":"Anpassen der Größe und Position des AdGuard-Assistent"},"settings_icon_size":{"message":"Symbol-Größe:"},"settings_small":{"message":"Klein"},"settings_big":{"message":"Groß"},"settings_position":{"message":"Position:"},"settings_left_top":{"message":"Oben links"},"settings_right_top":{"message":"Oben rechts"},"settings_left_bottom":{"message":"Unten links"},"settings_right_bottom":{"message":"Unten rechts"},"settings_cancel":{"message":"Abbrechen"},"settings_save":{"message":"Änderungen speichern"}}');

/***/ }),

/***/ 1773:
/***/ ((module) => {

"use strict";
module.exports = JSON.parse('{"settings_position_save":"Ιστοσελίδες","settings_position_save_all":"Όλοι οι ιστότοποι","settings_position_save_this":"Αυτός ο ιστότοπος","assistant_select_element_start":"Εκκίνηση","assistant_select_element_text":"Επιλέξτε ένα στοιχείο στη σελίδα για αποκλεισμό. Ανανεώστε τη σελίδα για να ακυρώσετε τη λειτουργία αποκλεισμού στοιχείων.","menu_filtration_status":{"message":"Φιλτράρισμα σε αυτόν τον ιστότοπο"},"menu_do_not_filter_30_sec":{"message":"Παύση φιλτραρίσματος για 30 δευτερόλεπτα"},"menu_block_ad_on_site":{"message":"Αποκλεισμός διαφήμισης σε αυτόν τον ιστότοπο"},"menu_report_abuse":{"message":"Αναφέρετε αυτόν τον ιστότοπο"},"menu_site_report":{"message":"Αναφορά ασφάλειας ιστότοπου"},"menu_settings":{"message":"Ρυθμίσεις βοηθού"},"menu_wot_reputation_indicator":{"message":"Δείκτης φήμης ιστότοπου"},"menu_wot_reputation_confidence_level":{"message":"Επίπεδο εμπιστοσύνης φήμης"},"assistant_select_element":{"message":"Αποκλεισμός στοιχείου"},"assistant_select_element_ext":{"message":"Επιλέξτε ένα στοιχείο στη σελίδα για αποκλεισμό"},"assistant_select_element_cancel":{"message":"Άκυρο"},"assistant_block_element":{"message":"Αποκλεισμός στοιχείου"},"assistant_block_element_explain":{"message":"Προσαρμόστε τον κανόνα αποκλεισμού στοιχείου"},"assistant_slider_explain":{"message":"Μετακινήστε το ρυθμιστικό για να αλλάξετε το μέγεθος του πλαισίου για τον οποίο θα λειτουργεί ο νέος κανόνας:"},"assistant_extended_settings":{"message":"Προηγμένες ρυθμίσεις"},"assistant_apply_rule_to_all_sites":{"message":"Εφαρμογή του κανόνα σε όλες τις ιστοσελίδες"},"assistant_block_by_reference":{"message":"Αποκλεισμός μέσω συνδέσμου αναφοράς"},"assistant_block_similar":{"message":"Αποκλεισμός παρόμοιου"},"assistant_another_element":{"message":"Επιλέξτε ένα διαφορετικό στοιχείο"},"assistant_preview":{"message":"Προεπισκόπηση"},"assistant_block":{"message":"Αποκλεισμός"},"assistant_settings":{"message":"Ρυθμίσεις βοηθού"},"assistant_preview_header":{"message":"Αποκλεισμός στοιχείου - προεπισκόπηση"},"assistant_preview_header_info":{"message":"Βεβαιωθείτε ότι το στοιχείο είναι μπλοκαρισμένο όπως προορίζεται"},"assistant_preview_end":{"message":"Έξοδος προεπισκόπησης"},"wot_unknown_description":{"message":"Η φήμη αυτού του ιστότοπου δεν έχει καθοριστεί από το $1"},"wot_bad_description":{"message":"Αυτός ο ιστότοπος έχει πολύ κακή φήμη\\nσύμφωνα με το $1"},"wot_poor_description":{"message":"Αυτός ο ιστότοπος έχει κακή φήμη\\nσύμφωνα με το $1"},"wot_unsatisfactory_description":{"message":"Αυτός ο ιστότοπος έχει κακή φήμη\\nσύμφωνα με το $1"},"wot_good_description":{"message":"Αυτός ο ιστότοπος έχει καλή φήμη\\nσύμφωνα με το $1"},"wot_excellent_description":{"message":"Αυτός ο ιστότοπος έχει εξαιρετική φήμη\\nσύμφωνα με το $1"},"settings_choose_size_and_position":{"message":"Προσαρμόστε το μέγεθος και τη θέση του Βοηθού AdGuard"},"settings_icon_size":{"message":"Μέγεθος εικονιδίου:"},"settings_small":{"message":"Μικρό"},"settings_big":{"message":"Μεγάλο"},"settings_position":{"message":"Θέση:"},"settings_left_top":{"message":"Πάνω αριστερά"},"settings_right_top":{"message":"Πάνω δεξιά"},"settings_left_bottom":{"message":"Κάτω αριστερά"},"settings_right_bottom":{"message":"Κάτω δεξιά"},"settings_cancel":{"message":"Άκυρο"},"settings_save":{"message":"Αποθήκευση αλλαγών"}}');

/***/ }),

/***/ 1272:
/***/ ((module) => {

"use strict";
module.exports = JSON.parse('{"settings_position_save":"Websites","settings_position_save_all":"All websites","settings_position_save_this":"This website","assistant_select_element_start":"Start","assistant_select_element_text":"Choose an element on the page to block. Refresh the page to cancel the element blocking mode.","menu_filtration_status":{"message":"Filtering on this website"},"menu_do_not_filter_30_sec":{"message":"Do not filter for 30 seconds"},"menu_block_ad_on_site":{"message":"Block ad on this website"},"menu_report_abuse":{"message":"Report the website"},"menu_site_report":{"message":"Website security report"},"menu_settings":{"message":"Assistant settings"},"menu_wot_reputation_indicator":{"message":"Site reputation indicator"},"menu_wot_reputation_confidence_level":{"message":"Reputation Confidence Level"},"assistant_select_element":{"message":"Element blocking"},"assistant_select_element_ext":{"message":"Choose an element on the page to block"},"assistant_select_element_cancel":{"message":"Cancel"},"assistant_block_element":{"message":"Element blocking"},"assistant_block_element_explain":{"message":"Adjust element blocking rule"},"assistant_slider_explain":{"message":"Move the slider to change the size of the frame the new rule will work for:"},"assistant_extended_settings":{"message":"Advanced settings"},"assistant_apply_rule_to_all_sites":{"message":"Apply the rule to all websites"},"assistant_block_by_reference":{"message":"Block by reference link"},"assistant_block_similar":{"message":"Block similar"},"assistant_another_element":{"message":"Select a different element"},"assistant_preview":{"message":"Preview"},"assistant_block":{"message":"Block"},"assistant_settings":{"message":"Assistant settings"},"assistant_preview_header":{"message":"Element blocking - preview"},"assistant_preview_header_info":{"message":"Make sure that element is blocked as intended"},"assistant_preview_end":{"message":"Exit preview"},"wot_unknown_description":{"message":"This website\'s reputation is not defined by $1"},"wot_bad_description":{"message":"This website has a very bad reputation\\naccording to $1"},"wot_poor_description":{"message":"This website has a bad reputation \\naccording to $1"},"wot_unsatisfactory_description":{"message":"This website has a poor reputation\\naccording to $1"},"wot_good_description":{"message":"This website has a good reputation\\naccording to $1"},"wot_excellent_description":{"message":"This website has an excellent reputation\\naccording to $1"},"settings_choose_size_and_position":{"message":"Adjust AdGuard Assistant size and position"},"settings_icon_size":{"message":"Icon size:"},"settings_small":{"message":"Small"},"settings_big":{"message":"Large"},"settings_position":{"message":"Position:"},"settings_left_top":{"message":"Top left"},"settings_right_top":{"message":"Top right"},"settings_left_bottom":{"message":"Bottom left"},"settings_right_bottom":{"message":"Bottom right"},"settings_cancel":{"message":"Cancel"},"settings_save":{"message":"Save changes"}}');

/***/ }),

/***/ 8194:
/***/ ((module) => {

"use strict";
module.exports = JSON.parse('{"settings_position_save":"Sitios web","settings_position_save_all":"Todos los sitios web","settings_position_save_this":"Este sitio web","assistant_select_element_start":"Comenzar","assistant_select_element_text":"Elige un elemento en la página para bloquear. Actualiza la página para cancelar el bloqueo de elementos.","menu_filtration_status":{"message":"Filtrado en este sitio web"},"menu_do_not_filter_30_sec":{"message":"No filtrar durante 30 segundos"},"menu_block_ad_on_site":{"message":"Bloquear anuncios en este sitio web"},"menu_report_abuse":{"message":"Reportar el sitio web"},"menu_site_report":{"message":"Informe de seguridad del sitio web"},"menu_settings":{"message":"Configuración del asistente"},"menu_wot_reputation_indicator":{"message":"Indicador de reputación del sitio"},"menu_wot_reputation_confidence_level":{"message":"Nivel de confianza de reputación"},"assistant_select_element":{"message":"Bloqueo de elementos"},"assistant_select_element_ext":{"message":"Elige un elemento en la página para bloquear"},"assistant_select_element_cancel":{"message":"Cancelar"},"assistant_block_element":{"message":"Bloqueo de elementos"},"assistant_block_element_explain":{"message":"Ajustar la regla de bloqueo del elemento"},"assistant_slider_explain":{"message":"Mueve el control deslizante para cambiar el tamaño del marco para el que funcionará la nueva regla:"},"assistant_extended_settings":{"message":"Configuración avanzada"},"assistant_apply_rule_to_all_sites":{"message":"Aplicar la regla a todos los sitios web"},"assistant_block_by_reference":{"message":"Bloquear por enlace de referencia"},"assistant_block_similar":{"message":"Bloquear elemento similar"},"assistant_another_element":{"message":"Seleccionar otro elemento"},"assistant_preview":{"message":"Vista previa"},"assistant_block":{"message":"Bloquear"},"assistant_settings":{"message":"Configuración del asistente"},"assistant_preview_header":{"message":"Bloqueo de elementos - vista previa"},"assistant_preview_header_info":{"message":"Asegúrate de que el elemento esté bloqueado como se deseaba"},"assistant_preview_end":{"message":"Salir de vista previa"},"wot_unknown_description":{"message":"La reputación de este sitio web no está definida por $1"},"wot_bad_description":{"message":"Este sitio web tiene muy mala reputación\\nde acuerdo a $1"},"wot_poor_description":{"message":"Este sitio web tiene mala reputación\\nde acuerdo a $1"},"wot_unsatisfactory_description":{"message":"Este sitio web tiene pobre reputación\\nde acuerdo a $1"},"wot_good_description":{"message":"Este sitio web tiene buena reputación\\nde acuerdo a $1"},"wot_excellent_description":{"message":"Este sitio web tiene excelente reputación\\nde acuerdo a $1"},"settings_choose_size_and_position":{"message":"Ajustar el tamaño y la posición del Asistente de AdGuard"},"settings_icon_size":{"message":"Tamaño del icono:"},"settings_small":{"message":"Pequeño"},"settings_big":{"message":"Grande"},"settings_position":{"message":"Posición:"},"settings_left_top":{"message":"Arriba a la izquierda"},"settings_right_top":{"message":"Arriba a la derecha"},"settings_left_bottom":{"message":"Abajo a la izquierda"},"settings_right_bottom":{"message":"Abajo a la derecha"},"settings_cancel":{"message":"Cancelar"},"settings_save":{"message":"Guardar cambios"}}');

/***/ }),

/***/ 5455:
/***/ ((module) => {

"use strict";
module.exports = JSON.parse('{"settings_position_save":"وبسایت","settings_position_save_all":"همه وبسایت ها","settings_position_save_this":"این وبسایت","assistant_select_element_start":"شروع","assistant_select_element_text":"عنصری در صفحه برای مسدودسازی انتخاب کنید. برای لغو،صفحه را رفرش کنید.","menu_filtration_status":{"message":"فیلترینگ در این وبسایت"},"menu_do_not_filter_30_sec":{"message":"به مدت 30 ثانیه فیلتر نکن"},"menu_block_ad_on_site":{"message":"مسدودسازی تبلیغ در این وبسایت"},"menu_report_abuse":{"message":"گزارش وبسایت"},"menu_site_report":{"message":"گزارش امنیتی وبسایت"},"menu_settings":{"message":"تنظیمات دستیار"},"menu_wot_reputation_indicator":{"message":"نشانگر اعتبار سایت"},"menu_wot_reputation_confidence_level":{"message":"سطح اعتبار"},"assistant_select_element":{"message":"مسدودسازی عنصر"},"assistant_select_element_ext":{"message":"عنصری در صفحه برای مسدودسازی انتخاب کنید"},"assistant_select_element_cancel":{"message":"لغو"},"assistant_block_element":{"message":"مسدودسازی عنصر"},"assistant_block_element_explain":{"message":"تنظیم دستور مسدودسازی عنصر"},"assistant_slider_explain":{"message":"جابجایی لغزنده برای تغییر اندازه فریم که دستور جدیدی کار خواهد کرد:"},"assistant_extended_settings":{"message":"تنظیمات پیشرفته"},"assistant_apply_rule_to_all_sites":{"message":"اِعمال دستور در همه وبسایت ها"},"assistant_block_by_reference":{"message":"مسدودسازی با لینک مرجع"},"assistant_block_similar":{"message":"مسدودسازی مشابه"},"assistant_another_element":{"message":"عنصر دیگری انتخاب کنید"},"assistant_preview":{"message":"پیشنمایش"},"assistant_block":{"message":"مسدود"},"assistant_settings":{"message":"تنظیمات دستیار"},"assistant_preview_header":{"message":"مسدودسازی عنصر - پیشنمایش"},"assistant_preview_header_info":{"message":"مطمئن شوید عنصر به شکل دلخواه مسدود شود"},"assistant_preview_end":{"message":"خروج از پیشنمایش"},"wot_unknown_description":{"message":"اعتبار تعریف نشده است"},"wot_bad_description":{"message":"این وبسایت اعتبار خیلی بدی دارد\\nبر طبق "},"wot_poor_description":{"message":"این وبسایت اعتبار بدی دارد\\nبر طبق "},"wot_unsatisfactory_description":{"message":"این وبسایت اعتبار کمی دارد\\nبر طبق "},"wot_good_description":{"message":"این وبسایت اعتبار خوبی دارد\\nبر طبق "},"wot_excellent_description":{"message":"این وبسایت اعتبار عالی دارد\\nبر طبق "},"settings_choose_size_and_position":{"message":"تنظیم اندازه و موقعیت دستیار AdGuard"},"settings_icon_size":{"message":"اندازه آیکون:"},"settings_small":{"message":"کوچک"},"settings_big":{"message":"بزرگ"},"settings_position":{"message":"موقعیت:"},"settings_left_top":{"message":"بالا سمت چپ"},"settings_right_top":{"message":"بالا سمت راست"},"settings_left_bottom":{"message":"پایین سمت چپ"},"settings_right_bottom":{"message":"پایین سمت راست"},"settings_cancel":{"message":"لغو"},"settings_save":{"message":"ذخیره تغییرات"}}');

/***/ }),

/***/ 6183:
/***/ ((module) => {

"use strict";
module.exports = JSON.parse('{"settings_position_save":"Verkkosivustot","settings_position_save_all":"Kaikki sivustot","settings_position_save_this":"Tämä sivusto","assistant_select_element_start":"Aloita","assistant_select_element_text":"Valitse sivulta estettävä elementti. Päivitä sivu poistuaksesi elementtien estotilasta.","menu_filtration_status":{"message":"Tämän sivuston suodatus"},"menu_do_not_filter_30_sec":{"message":"Pysäytä suodatus 30 sekunnin ajaksi"},"menu_block_ad_on_site":{"message":"Estä mainos tältä sivustolta"},"menu_report_abuse":{"message":"Ilmoita ongelmasta"},"menu_site_report":{"message":"Sivuston suojausraportti"},"menu_settings":{"message":"Apurin asetukset"},"menu_wot_reputation_indicator":{"message":"Sivuston maine"},"menu_wot_reputation_confidence_level":{"message":"Mainearvion luotettavuus"},"assistant_select_element":{"message":"Elementin esto"},"assistant_select_element_ext":{"message":"Valitse sivulta estettävä elementti"},"assistant_select_element_cancel":{"message":"Peruuta"},"assistant_block_element":{"message":"Elementin esto"},"assistant_block_element_explain":{"message":"Muokkaa elementinestosääntöä"},"assistant_slider_explain":{"message":"Siirrä liukukytkintä muuttaaksesi sen kehyksen kokoa, johon tämä sääntö vaikuttaa:"},"assistant_extended_settings":{"message":"Edistyneet lisäasetukset"},"assistant_apply_rule_to_all_sites":{"message":"Käytä kaikilla sivustoilla"},"assistant_block_by_reference":{"message":"Estä viitelinkillä"},"assistant_block_similar":{"message":"Estä samankaltaiset"},"assistant_another_element":{"message":"Valitse eri elementti"},"assistant_preview":{"message":"Esikatsele"},"assistant_block":{"message":"Estä"},"assistant_settings":{"message":"Apurin asetukset"},"assistant_preview_header":{"message":"Elementin estosäännön esikatselu"},"assistant_preview_header_info":{"message":"Varmista, että elementti estetään tarkoituksenmukaisesti"},"assistant_preview_end":{"message":"Sulje esikatselu"},"wot_unknown_description":{"message":"$1 ei tarjoa sivustolle mainearviointia"},"wot_bad_description":{"message":"$1 arvioinnin mukaan sivustolla on erittäin huono maine"},"wot_poor_description":{"message":"$1 arvioinnin mukaan sivustolla on huono maine"},"wot_unsatisfactory_description":{"message":"$1 arvioinnin mukaan sivustolla on heikko maine"},"wot_good_description":{"message":"$1 arvioinnin mukaan sivustolla on hyvä maine"},"wot_excellent_description":{"message":"$1 arvioinnin mukaan sivustolla on erinomainen maine"},"settings_choose_size_and_position":{"message":"Säädä AdGuard Avustajan kokoa ja sijaintia"},"settings_icon_size":{"message":"Kuvakkeen koko:"},"settings_small":{"message":"Pieni"},"settings_big":{"message":"Suuri"},"settings_position":{"message":"Sijainti:"},"settings_left_top":{"message":"Ylhäällä vasemmalla"},"settings_right_top":{"message":"Ylhäällä oikealla"},"settings_left_bottom":{"message":"Alhaalla vasemmalla"},"settings_right_bottom":{"message":"Alhaalla oikealla"},"settings_cancel":{"message":"Peruuta"},"settings_save":{"message":"Tallenna muutokset"}}');

/***/ }),

/***/ 4652:
/***/ ((module) => {

"use strict";
module.exports = JSON.parse('{"settings_position_save":"Sites web","settings_position_save_all":"Tous les sites web","settings_position_save_this":"Ce site web","assistant_select_element_start":"Démarrer","assistant_select_element_text":"Choisissez un élément de la page à bloquer. Pour afficher l\'élément de nouveau, rafraîchissez la page.","menu_filtration_status":{"message":"Filtrages sur ce site"},"menu_do_not_filter_30_sec":{"message":"Ne pas filtrer pendant 30 secondes "},"menu_block_ad_on_site":{"message":"Blocage des annonces sur ce site "},"menu_report_abuse":{"message":"Signaler le site"},"menu_site_report":{"message":"Rapport de sécurité du site"},"menu_settings":{"message":"Réglages de l\'Assistant AdGuard"},"menu_wot_reputation_indicator":{"message":"Indice de réputation du site"},"menu_wot_reputation_confidence_level":{"message":"Niveau de confiance"},"assistant_select_element":{"message":"Blocage d\'éléments "},"assistant_select_element_ext":{"message":"Choisir un élément de la page à bloquer "},"assistant_select_element_cancel":{"message":"Annuler"},"assistant_block_element":{"message":"Blocage d\'éléments "},"assistant_block_element_explain":{"message":"Affiner la règle de blocage d\'elements"},"assistant_slider_explain":{"message":"Déplacez le curseur pour modifier la taille du cadre de travail de la nouvelle règle"},"assistant_extended_settings":{"message":"Paramétrages avancés "},"assistant_apply_rule_to_all_sites":{"message":"Appliquer la règle à tous les sites"},"assistant_block_by_reference":{"message":"Blocage par liens de reference"},"assistant_block_similar":{"message":"Blocage des objets similaires "},"assistant_another_element":{"message":"Sélectionner un élément différent"},"assistant_preview":{"message":"Previsualisation "},"assistant_block":{"message":"Blocage "},"assistant_settings":{"message":"Réglages de l\'Assistant AdGuard"},"assistant_preview_header":{"message":"Blocage d\'éléments - Previsualisation "},"assistant_preview_header_info":{"message":"Assurez-vous que l\'élément est bloqué comme prévu"},"assistant_preview_end":{"message":"Sortir de la previsualisation "},"wot_unknown_description":{"message":"La définition de la réputation de ce site web n\'est pas définie par $1"},"wot_bad_description":{"message":"Ce site web a très mauvaise réputation selon $1"},"wot_poor_description":{"message":"Ce site web a mauvaise réputation selon $1"},"wot_unsatisfactory_description":{"message":"Ce site web a une reputation médiocre selon $1"},"wot_good_description":{"message":"Ce site a bonne réputation selon $1"},"wot_excellent_description":{"message":"Ce site a une réputation excellente selon $1"},"settings_choose_size_and_position":{"message":"Affiner la taille et la position de l\'assistant AdGuard "},"settings_icon_size":{"message":"Taille de l\'icone"},"settings_small":{"message":"Petite"},"settings_big":{"message":"Grande"},"settings_position":{"message":"Positionnement"},"settings_left_top":{"message":"En haut à gauche"},"settings_right_top":{"message":"En haut à droite"},"settings_left_bottom":{"message":"En bas à gauche"},"settings_right_bottom":{"message":"En bas à droite "},"settings_cancel":{"message":"Annuler"},"settings_save":{"message":"Sauvegarder les modifications "}}');

/***/ }),

/***/ 6514:
/***/ ((module) => {

"use strict";
module.exports = JSON.parse('{"settings_position_save":"אתרים","settings_position_save_all":"כל האתרים","settings_position_save_this":"האתר הזה","assistant_select_element_start":"התחל","assistant_select_element_text":".בחר אלמנט בדף לחסימה .רענן את הדף כדי לבטל את מצב חסימת האלמנטים","menu_filtration_status":{"message":"סינון באתר זה"},"menu_do_not_filter_30_sec":{"message":"אל תסנן למשך 30 שניות"},"menu_block_ad_on_site":{"message":"חסום פרסומת באתר זה"},"menu_report_abuse":{"message":"דווח על האתר"},"menu_site_report":{"message":"דוח אבטחת אתר"},"menu_settings":{"message":"הגדרות המסייע"},"menu_wot_reputation_indicator":{"message":"מד של מוניטין אתרים"},"menu_wot_reputation_confidence_level":{"message":"רמת אמון מוניטין"},"assistant_select_element":{"message":"חסימת אלמנט"},"assistant_select_element_ext":{"message":"בחר אלמנט בדף לחסימה"},"assistant_select_element_cancel":{"message":"בטל"},"assistant_block_element":{"message":"חסימת אלמנט"},"assistant_block_element_explain":{"message":"התאם כלל של חסימת אלמנט"},"assistant_slider_explain":{"message":"הזז את המַחְלֵק כדי לשנות את גודל המסגרת שבה הכלל החדש יעבוד:"},"assistant_extended_settings":{"message":"הגדרות מתקדמות"},"assistant_apply_rule_to_all_sites":{"message":"החל את הכלל בכל האתרים"},"assistant_block_by_reference":{"message":"חסום לפי קישור הפניה"},"assistant_block_similar":{"message":"חסום דומה"},"assistant_another_element":{"message":"בחר אלמנט אחר"},"assistant_preview":{"message":"הצג מראש"},"assistant_block":{"message":"חסום"},"assistant_settings":{"message":"הגדרות המסייע"},"assistant_preview_header":{"message":"חסימת אלמנט - תצוגה מקדימה"},"assistant_preview_header_info":{"message":"ודא כי אלמנט זה חסום כמתוכנן"},"assistant_preview_end":{"message":"צא מתצוגה מקדימה"},"wot_unknown_description":{"message":"המוניטין של אתר זה אינו מוגדר על ידי $1"},"wot_bad_description":{"message":"לאתר זה יש מוניטין רע מאוד\\nעל פי $1"},"wot_poor_description":{"message":"לאתר זה יש מוניטין רע \\nעל פי $1"},"wot_unsatisfactory_description":{"message":"לאתר זה יש מוניטין ירוד\\nעל פי $1"},"wot_good_description":{"message":"לאתר זה יש מוניטין טוב\\nעל פי $1"},"wot_excellent_description":{"message":"לאתר זה יש מוניטין מצויין\\nעל פי $1"},"settings_choose_size_and_position":{"message":"התאם גודל ומיקום של מסייע AdGuard"},"settings_icon_size":{"message":"גודל איקון:"},"settings_small":{"message":"קטן"},"settings_big":{"message":"גדול"},"settings_position":{"message":"מיקום:"},"settings_left_top":{"message":"בחלק העליון משמאל"},"settings_right_top":{"message":"בחלק העליון מימין"},"settings_left_bottom":{"message":"צד שמאל למטה"},"settings_right_bottom":{"message":"צד ימין למטה"},"settings_cancel":{"message":"בטל"},"settings_save":{"message":"שמור שינויים"}}');

/***/ }),

/***/ 1996:
/***/ ((module) => {

"use strict";
module.exports = JSON.parse('{"assistant_extended_settings":{"message":"उन्नत सेटिंग"},"assistant_block":{"message":"अवरुद्ध"},"settings_icon_size":{"message":"आइकन का आकार:"},"settings_small":{"message":"छोटा"},"settings_big":{"message":"बड़ा"}}');

/***/ }),

/***/ 2178:
/***/ ((module) => {

"use strict";
module.exports = JSON.parse('{"settings_position_save":"Web stranice","settings_position_save_all":"Sve web stranice","settings_position_save_this":"Ova web stranica","assistant_select_element_start":"Započni","assistant_select_element_text":"Odaberite element na stranici za blokiranje. Osvježite stranicu za izlazak iz načina blokade elemenata.","menu_filtration_status":{"message":"Filtriranje na ovoj web stranici"},"menu_do_not_filter_30_sec":{"message":"Ne filtriraj idućih 30 sekundi"},"menu_block_ad_on_site":{"message":"Blokiraj oglas na ovoj web stranici"},"menu_report_abuse":{"message":"Prijavi ovu stranicu"},"menu_site_report":{"message":"Sigurnosni izvještaj stranice"},"menu_settings":{"message":"Postavke pomoćnika"},"menu_wot_reputation_indicator":{"message":"Indikator reputacije stranice"},"menu_wot_reputation_confidence_level":{"message":"Razina povjerenja reputacije"},"assistant_select_element":{"message":"Blokiranje elementa"},"assistant_select_element_ext":{"message":"Odaberite element na stranici za blokiranje"},"assistant_select_element_cancel":{"message":"Poništi"},"assistant_block_element":{"message":"Blokiranje elementa"},"assistant_block_element_explain":{"message":"Prilagodite pravilo blokiranja elemenata"},"assistant_slider_explain":{"message":"Pomaknite klizač da biste promijenili veličinu okvira na koji će se primijeniti novo pravilo:"},"assistant_extended_settings":{"message":"Napredne postavke"},"assistant_apply_rule_to_all_sites":{"message":"Primjeni pravilo na sve web stranice"},"assistant_block_by_reference":{"message":"Blokiraj referentnom vezom"},"assistant_block_similar":{"message":"Blokiraj slične"},"assistant_another_element":{"message":"Odaberite drugi element"},"assistant_preview":{"message":"Pregled"},"assistant_block":{"message":"Blokiraj"},"assistant_settings":{"message":"Postavke pomoćnika"},"assistant_preview_header":{"message":"Pregled blokiranja elementa"},"assistant_preview_header_info":{"message":"Provjerite da je li element blokiran kako ste željeli"},"assistant_preview_end":{"message":"Izlaz iz pregleda"},"wot_unknown_description":{"message":"Reputaciju stranice nije odredio $1"},"wot_bad_description":{"message":"Web stranica ima jako lošu reputaciju \\nprema $1"},"wot_poor_description":{"message":"Web stranica ima lošu reputaciju \\nprema $1"},"wot_unsatisfactory_description":{"message":"Web stranica ima lošu reputaciju \\nprema $1"},"wot_good_description":{"message":"Web stranica ima dobru reputaciju \\nprema $1"},"wot_excellent_description":{"message":"Web stranica ima odličnu reputaciju \\nprema $1"},"settings_choose_size_and_position":{"message":"Podesite veličinu i poziciju AdGuard Pomoćnika"},"settings_icon_size":{"message":"Veličina ikone:"},"settings_small":{"message":"Malo"},"settings_big":{"message":"Veliko"},"settings_position":{"message":"Pozicija:"},"settings_left_top":{"message":"Gore lijevo"},"settings_right_top":{"message":"Gore desno"},"settings_left_bottom":{"message":"Dolje lijevo"},"settings_right_bottom":{"message":"Dolje desno"},"settings_cancel":{"message":"Poništi"},"settings_save":{"message":"Spremi promjene"}}');

/***/ }),

/***/ 2698:
/***/ ((module) => {

"use strict";
module.exports = JSON.parse('{"settings_position_save":"Weboldalak","settings_position_save_all":"Minden weboldal","settings_position_save_this":"Ez a weboldal","assistant_select_element_start":"Indítás","assistant_select_element_text":"Válassza ki az elemet az oldalon, amit blokkolni szeretne. Frissítse az oldalt, hogy kilépjen az elemblokkoló módból.","menu_filtration_status":{"message":"Szűrés ezen a weboldalon"},"menu_do_not_filter_30_sec":{"message":"Szüneteltetés 30 másodpercig"},"menu_block_ad_on_site":{"message":"Hirdetés blokkolása ezen a weboldalon"},"menu_report_abuse":{"message":"Weboldal jelentése"},"menu_site_report":{"message":"Weboldal biztonsági jelentése"},"menu_settings":{"message":"Asszisztens beállításai"},"menu_wot_reputation_indicator":{"message":"A webhely hírnevének mutatója"},"menu_wot_reputation_confidence_level":{"message":"A hírnév bizalmi szintje"},"assistant_select_element":{"message":"Elem blokkolása"},"assistant_select_element_ext":{"message":"Válassza ki az elemet az oldalon, amit blokkolni szeretne"},"assistant_select_element_cancel":{"message":"Mégse"},"assistant_block_element":{"message":"Elem blokkolása"},"assistant_block_element_explain":{"message":"Állítsa be az elemet blokkoló szabályt"},"assistant_slider_explain":{"message":"Mozgassa a csúszkát a keret méretének megváltoztatásához, amelyre az új szabály működni fog:"},"assistant_extended_settings":{"message":"Haladó beállítások"},"assistant_apply_rule_to_all_sites":{"message":"Szabály alkalmazása az összes weboldalra"},"assistant_block_by_reference":{"message":"Blokkolás link alapján"},"assistant_block_similar":{"message":"Hasonlók blokkolása"},"assistant_another_element":{"message":"Másik elem választása"},"assistant_preview":{"message":"Előnézet"},"assistant_block":{"message":"Blokkolás"},"assistant_settings":{"message":"Asszisztens beállításai"},"assistant_preview_header":{"message":"Elem blokkolása - előnézet"},"assistant_preview_header_info":{"message":"Ellenőrizze, hogy az elem blokkolva van-e a tervezett módon"},"assistant_preview_end":{"message":"Kilépés az előnézetből"},"wot_unknown_description":{"message":"Ez a weboldal nincs nyilvántartva a $1 alapján"},"wot_bad_description":{"message":"Ennek a weboldalnak nagyon rossz a megítélése a $1 alapján"},"wot_poor_description":{"message":"Ennek a weboldalnak rossz a megítélése a $1 alapján"},"wot_unsatisfactory_description":{"message":"Ennek a weboldalnak gyenge a megítélése a $1 alapján"},"wot_good_description":{"message":"Ennek a weboldalnak jó a megítélése a $1 alapján"},"wot_excellent_description":{"message":"Ennek a weboldalnak kitűnő a megítélése a $1 alapján"},"settings_choose_size_and_position":{"message":"Állítsa be az AdGuard Assistant méretét és pozícióját"},"settings_icon_size":{"message":"Ikon mérete:"},"settings_small":{"message":"Kicsi"},"settings_big":{"message":"Nagy"},"settings_position":{"message":"Pozíció:"},"settings_left_top":{"message":"Bal felül"},"settings_right_top":{"message":"Jobb felül"},"settings_left_bottom":{"message":"Bal alul"},"settings_right_bottom":{"message":"Jobb alul"},"settings_cancel":{"message":"Mégse"},"settings_save":{"message":"Változások mentése"}}');

/***/ }),

/***/ 710:
/***/ ((module) => {

"use strict";
module.exports = JSON.parse('{"settings_position_save":"Situs web","settings_position_save_all":"Semua situs web","settings_position_save_this":"Situs web ini","assistant_select_element_start":"Mulai","assistant_select_element_text":"Pilih elemen di halaman untuk diblokir. Segarkan halaman untuk membatalkan mode pemblokiran elemen.","menu_filtration_status":{"message":"Penyaringan di situs ini"},"menu_do_not_filter_30_sec":{"message":"Nonaktifkan penyaring untuk 30 detik"},"menu_block_ad_on_site":{"message":"Blokir iklan di situs ini"},"menu_report_abuse":{"message":"Laporkan situs"},"menu_site_report":{"message":"Laporan keamanan situs"},"menu_settings":{"message":"Pengaturan Asisten"},"menu_wot_reputation_indicator":{"message":"Indikator reputasi situs"},"menu_wot_reputation_confidence_level":{"message":"Tingkat Keyakinan Reputasi"},"assistant_select_element":{"message":"Blok Elemen"},"assistant_select_element_ext":{"message":"Pilih elemen di halaman untuk diblok"},"assistant_select_element_cancel":{"message":"Batalkan"},"assistant_block_element":{"message":"Blok Elemen"},"assistant_block_element_explain":{"message":"Atur aturan blokir elemen"},"assistant_slider_explain":{"message":"Pindahkan slider untuk mengatur ukuran frame dimana aturan baru akan aktif:"},"assistant_extended_settings":{"message":"Pengaturan lanjutan"},"assistant_apply_rule_to_all_sites":{"message":"Aktifkan aturan untuk seluruh situs"},"assistant_block_by_reference":{"message":"Blok berdasarkan referensi situs"},"assistant_block_similar":{"message":"Blok semacamnya"},"assistant_another_element":{"message":"Pilih elemen lainnya"},"assistant_preview":{"message":"Pratinjau"},"assistant_block":{"message":"Blokir"},"assistant_settings":{"message":"Pengaturan Asisten"},"assistant_preview_header":{"message":"Blok elemen - pratinjau"},"assistant_preview_header_info":{"message":"Harap pastikan bahwa elemen diblok sesuai kemauan Anda"},"assistant_preview_end":{"message":"Keluar pratinjau"},"wot_unknown_description":{"message":"Reputasi tidak terdefinisi"},"wot_bad_description":{"message":"Situs ini mempunyai reputasi sangat buruk\\nberdasarkan $1"},"wot_poor_description":{"message":"Situs ini mempunyai reputasi buruk\\nberdasarkan $1"},"wot_unsatisfactory_description":{"message":"Situs ini mempunyai reputasi biasa \\nberdasarkan $1"},"wot_good_description":{"message":"Situs ini mempunyai reputasi baik \\nberdasarkan $1"},"wot_excellent_description":{"message":"Situs ini mempunyai reputasi sempurna \\nberdasarkan $1"},"settings_choose_size_and_position":{"message":"Atur ukuran dan posisi AdGuard Assistant"},"settings_icon_size":{"message":"Ukuran ikon:"},"settings_small":{"message":"Kecil"},"settings_big":{"message":"Besar"},"settings_position":{"message":"Posisi:"},"settings_left_top":{"message":"Atas kiri"},"settings_right_top":{"message":"Atas kanan"},"settings_left_bottom":{"message":"Bawah kiri"},"settings_right_bottom":{"message":"Bawah kanan"},"settings_cancel":{"message":"Batal"},"settings_save":{"message":"Simpan perubahan"}}');

/***/ }),

/***/ 7294:
/***/ ((module) => {

"use strict";
module.exports = JSON.parse('{"settings_position_save":"Siti","settings_position_save_all":"Tutti i siti","settings_position_save_this":"Questo sito web","assistant_select_element_start":"Inizio","assistant_select_element_text":"Seleziona un elemento nella pagina per bloccarlo. Ricarica la pagina per annullare la modalità di blocco di un elemento.","menu_filtration_status":{"message":"Filtraggio su questo sito web"},"menu_do_not_filter_30_sec":{"message":"Non filtrare per 30 secondi"},"menu_block_ad_on_site":{"message":"Blocca annunci su questo sito web"},"menu_report_abuse":{"message":"Segnala il sito"},"menu_site_report":{"message":"Rapporto di sicurezza del sito"},"menu_settings":{"message":"Impostazioni di Assistant"},"menu_wot_reputation_indicator":{"message":"Indicatore reputazione sito"},"menu_wot_reputation_confidence_level":{"message":"Livello della reputazione"},"assistant_select_element":{"message":"Blocca elemento"},"assistant_select_element_ext":{"message":"Scegli un elemento da bloccare sulla pagina"},"assistant_select_element_cancel":{"message":"Annulla"},"assistant_block_element":{"message":"Blocca elemento"},"assistant_block_element_explain":{"message":"Modifica la regola di blocco di un elemento"},"assistant_slider_explain":{"message":"Muovi la barra per cambiare la grandezza del frame da per il quale la nuova regola funzionerà:"},"assistant_extended_settings":{"message":"Impostazioni avanzate"},"assistant_apply_rule_to_all_sites":{"message":"Applica la regola a tutti i siti"},"assistant_block_by_reference":{"message":"Blocco mediante indirizzo di riferimento"},"assistant_block_similar":{"message":"Blocca simile"},"assistant_another_element":{"message":"Seleziona un altro elemento"},"assistant_preview":{"message":"Anteprima"},"assistant_block":{"message":"Blocca"},"assistant_settings":{"message":"Impostazioni di Assistant"},"assistant_preview_header":{"message":"Blocco elemento - anteprima"},"assistant_preview_header_info":{"message":"Assicurati che l\'elemento è bloccato come richiesto"},"assistant_preview_end":{"message":"Esci dall\'anteprima"},"wot_unknown_description":{"message":"La reputazione di questo sito web non è definita da $1"},"wot_bad_description":{"message":"Questo sito web ha una pessima reputazione\\nsecondo $1"},"wot_poor_description":{"message":"Questo sito web ha una brutta reputazione\\nsecondo $1"},"wot_unsatisfactory_description":{"message":"Questo sito web ha una mediocre reputazione\\nsecondo $1"},"wot_good_description":{"message":"Questo sito web ha una buona reputazione\\nsecondo $1"},"wot_excellent_description":{"message":"Questo sito web ha una eccellente reputazione\\nsecondo $1"},"settings_choose_size_and_position":{"message":"Regola dimensione e posizione di AdGuard Assistant"},"settings_icon_size":{"message":"Grandezza dell\'icona:"},"settings_small":{"message":"Piccola"},"settings_big":{"message":"Grande"},"settings_position":{"message":"Posizione:"},"settings_left_top":{"message":"In alto a sinistra"},"settings_right_top":{"message":"In alto a destra"},"settings_left_bottom":{"message":"In basso a sinistra"},"settings_right_bottom":{"message":"In basso a destra"},"settings_cancel":{"message":"Annulla"},"settings_save":{"message":"Salva cambiamenti"}}');

/***/ }),

/***/ 9265:
/***/ ((module) => {

"use strict";
module.exports = JSON.parse('{"settings_position_save":"ウェブサイト","settings_position_save_all":"すべてのウェブサイト","settings_position_save_this":"このウェブサイト","assistant_select_element_start":"開始","assistant_select_element_text":"ブロックするページ上の要素を選択してください。 ページを更新し要素のブロックモードを解除します。","menu_filtration_status":{"message":"このウェブサイトをフィルタリング"},"menu_do_not_filter_30_sec":{"message":"30秒間フィルタリングしない"},"menu_block_ad_on_site":{"message":"このサイトで広告を手動ブロックする"},"menu_report_abuse":{"message":"このサイトの問題を報告する"},"menu_site_report":{"message":"ウェブサイトのセキュリティレポート"},"menu_settings":{"message":"アシスタントの設定"},"assistant_select_element":{"message":"要素をブロック"},"assistant_select_element_ext":{"message":"ブロックする要素を選択"},"assistant_select_element_cancel":{"message":"キャンセル"},"assistant_block_element":{"message":"要素をブロック"},"assistant_block_element_explain":{"message":"要素のブロックルールを調整する"},"assistant_slider_explain":{"message":"スライダーを動かすと、ブロックするフレームのサイズを変更できます:"},"assistant_extended_settings":{"message":"高度な設定"},"assistant_apply_rule_to_all_sites":{"message":"全てのウェブサイトにこのルールを適用"},"assistant_block_by_reference":{"message":"参照リンクによるブロック"},"assistant_block_similar":{"message":"類似項目をブロック"},"assistant_another_element":{"message":"他の要素を選択"},"assistant_preview":{"message":"プレビュー"},"assistant_block":{"message":"ブロック"},"assistant_settings":{"message":"アシスタントの設定"},"assistant_preview_header":{"message":"要素のブロック - プレビュー"},"assistant_preview_header_info":{"message":"要素が意図したとおりにブロックされていることを確認します"},"assistant_preview_end":{"message":"プレビューを終了"},"wot_unknown_description":{"message":"評判が定義されていません"},"wot_bad_description":{"message":"このウェブサイトは非常に評判が悪いです: "},"wot_poor_description":{"message":"このウェブサイトは評判が悪いです: "},"wot_unsatisfactory_description":{"message":"このウェブサイトは評判がやや悪いです: "},"wot_good_description":{"message":"このウェブサイトは評判が良いです: "},"wot_excellent_description":{"message":"このウェブサイトはとても評判が良いです: "},"settings_choose_size_and_position":{"message":"AdGuardアシスタントのサイズと位置を調整する"},"settings_icon_size":{"message":"アイコンの大きさ:"},"settings_small":{"message":"小"},"settings_big":{"message":"大"},"settings_position":{"message":"位置:"},"settings_left_top":{"message":"左上"},"settings_right_top":{"message":"右上"},"settings_left_bottom":{"message":"左下"},"settings_right_bottom":{"message":"右下"},"settings_cancel":{"message":"キャンセル"},"settings_save":{"message":"設定を保存"}}');

/***/ }),

/***/ 1474:
/***/ ((module) => {

"use strict";
module.exports = JSON.parse('{"settings_position_save":"웹사이트","settings_position_save_all":"모든 웹사이트","settings_position_save_this":"이 웹사이트","assistant_select_element_start":"시작","assistant_select_element_text":"페이지에서 차단할 요소를 선택하세요. 요소 차단 모드를 취소하려면 페이지를 새로 고침하세요.","menu_filtration_status":{"message":"이 웹사이트에서의 보호"},"menu_do_not_filter_30_sec":{"message":"30초 동안 차단 일시정지"},"menu_block_ad_on_site":{"message":"이 웹사이트에서 광고 차단"},"menu_report_abuse":{"message":"이 웹사이트에 관한 불만 사항 제출"},"menu_site_report":{"message":"웹사이트 보안 보고"},"menu_settings":{"message":"어시스턴트 설정"},"menu_wot_reputation_indicator":{"message":"웹사이트 평판 표시기"},"menu_wot_reputation_confidence_level":{"message":"평판 신뢰 수준"},"assistant_select_element":{"message":"선택 모드"},"assistant_select_element_ext":{"message":"페이지에서 아무 요소나 클릭하거나"},"assistant_select_element_cancel":{"message":"선택 모드 취소"},"assistant_block_element":{"message":"요소 차단"},"assistant_block_element_explain":{"message":"요소 차단 규칙 설정"},"assistant_slider_explain":{"message":"슬라이더로 차단할 요소의 범위를 지정하세요."},"assistant_extended_settings":{"message":"고급 설정"},"assistant_apply_rule_to_all_sites":{"message":"모든 웹사이트에 이 규칙 적용"},"assistant_block_by_reference":{"message":"참조 링크가 차단"},"assistant_block_similar":{"message":"유사한 요소 차단"},"assistant_another_element":{"message":"다른 요소 선택"},"assistant_preview":{"message":"미리 보기"},"assistant_block":{"message":"차단"},"assistant_settings":{"message":"어시스턴트 설정"},"assistant_preview_header":{"message":"요소 차단 - 미리 보기"},"assistant_preview_header_info":{"message":"의도한 대로 요소가 차단되었는지 확인하세요."},"assistant_preview_end":{"message":"미리 보기 종료"},"wot_unknown_description":{"message":"평판이 등록되지 않았습니다."},"wot_bad_description":{"message":"이 웹사이트는 아주 나쁜 평판을 갖고 있습니다.\\n제공 "},"wot_poor_description":{"message":"이 웹사이트는 나쁜 평판을 갖고 있습니다.\\n제공 "},"wot_unsatisfactory_description":{"message":"이 웹사이트는 좋지 않은 평판을 갖고 있습니다.\\n제공 "},"wot_good_description":{"message":"이 웹사이트는 좋은 평판을 갖고 있습니다.\\n제공 "},"wot_excellent_description":{"message":"이 웹사이트는 아주 좋은 평판을 갖고 있습니다.\\n제공 "},"settings_choose_size_and_position":{"message":"AdGuard 어시스턴트 크기와 위치를 조정합니다"},"settings_icon_size":{"message":"아이콘 크기:"},"settings_small":{"message":"작게"},"settings_big":{"message":"크게"},"settings_position":{"message":"위치:"},"settings_left_top":{"message":"왼쪽 위"},"settings_right_top":{"message":"오른쪽 위"},"settings_left_bottom":{"message":"왼쪽 아래"},"settings_right_bottom":{"message":"오른쪽 아래"},"settings_cancel":{"message":"취소"},"settings_save":{"message":"저장"}}');

/***/ }),

/***/ 8612:
/***/ ((module) => {

"use strict";
module.exports = JSON.parse('{"settings_position_save":"Interneto svetainės","settings_position_save_all":"Visos svetainės","settings_position_save_this":"Ši svetainė","assistant_select_element_start":"Pradėti","assistant_select_element_text":"Pasirinkite elementą puslapyje, kurį norite blokuoti. Atnaujinkite puslapį, kad atšauktumėte elementų blokavimo režimą.","menu_filtration_status":{"message":"Filtravimas šioje svetainėje"},"menu_do_not_filter_30_sec":{"message":"Nefiltruoti 30 sekundžių"},"menu_block_ad_on_site":{"message":"Blokuoti reklamą šioje svetainėje"},"menu_report_abuse":{"message":"Pranešti apie svetainę"},"menu_site_report":{"message":"Svetainės saugumo ataskaita"},"menu_settings":{"message":"Asistento nustatymai"},"menu_wot_reputation_indicator":{"message":"Svetainės reputacijos rodiklis"},"menu_wot_reputation_confidence_level":{"message":"Reputacijos pasitikėjimo lygis"},"assistant_select_element":{"message":"Elemento blokavimas"},"assistant_select_element_ext":{"message":"Pasirinkite elementą puslapyje, kurį norite blokuoti"},"assistant_select_element_cancel":{"message":"Atšaukti"},"assistant_block_element":{"message":"Elemento blokavimas"},"assistant_block_element_explain":{"message":"Nustatykite elemento blokavimo taisyklę"},"assistant_slider_explain":{"message":"Slankiklio pagalba, keiskite rėmelio dydį, kuriame galios nauja taisyklė:"},"assistant_extended_settings":{"message":"Išplėstiniai nustatymai"},"assistant_apply_rule_to_all_sites":{"message":"Pritaikyti taisyklę visoms svetainėms"},"assistant_block_by_reference":{"message":"Blokuoti pagal nuorodą"},"assistant_block_similar":{"message":"Blokuoti panašius"},"assistant_another_element":{"message":"Pasirinkti kitą elementą"},"assistant_preview":{"message":"Peržiūra"},"assistant_block":{"message":"Užblokuoti"},"assistant_settings":{"message":"Asistento nustatymai"},"assistant_preview_header":{"message":"Elemento blokavimas - peržiūra"},"assistant_preview_header_info":{"message":"Įsitikinkite, kad elementas yra užblokuotas kaip sumanyta"},"assistant_preview_end":{"message":"Baigti peržiūrą"},"wot_unknown_description":{"message":"Šios svetainės reputacija nėra apibrėžta $1"},"wot_bad_description":{"message":"Ši svetainė turi labai blogą reputaciją\\npagal $1"},"wot_poor_description":{"message":"Ši svetainė turi blogą reputaciją pagal $1"},"wot_unsatisfactory_description":{"message":"Ši svetainė turi prastą reputaciją pagal $1"},"wot_good_description":{"message":"Ši svetainė turi gerą reputaciją pagal $1"},"wot_excellent_description":{"message":"Ši svetainė turi puikią reputaciją pagal $1"},"settings_choose_size_and_position":{"message":"Nustatykite AdGuard Asistento dydį ir padėtį"},"settings_icon_size":{"message":"Piktogramos dydis:"},"settings_small":{"message":"Maža"},"settings_big":{"message":"Didelė"},"settings_position":{"message":"Padėtis:"},"settings_left_top":{"message":"Viršuje kairėje"},"settings_right_top":{"message":"Viršuje dešinėje"},"settings_left_bottom":{"message":"Apačioje kairėje"},"settings_right_bottom":{"message":"Apačioje dešinėje"},"settings_cancel":{"message":"Atšaukti"},"settings_save":{"message":"Išsaugoti pakeitimus"}}');

/***/ }),

/***/ 8967:
/***/ ((module) => {

"use strict";
module.exports = JSON.parse('{"settings_position_save":"Websites","settings_position_save_all":"Alle websites","settings_position_save_this":"Deze website","assistant_select_element_start":"Starten","assistant_select_element_text":"Kies een element op deze webpagina om te blokkeren. Herlaad de pagina om het blokkeren van het element te stoppen.","menu_filtration_status":{"message":"Filteren op deze website"},"menu_do_not_filter_30_sec":{"message":"Niet filtreren voor 30 seconden"},"menu_block_ad_on_site":{"message":"Blokkeer ad op deze website"},"menu_report_abuse":{"message":"Rapporteer de website"},"menu_site_report":{"message":"Beveiligingsrapport van website"},"menu_settings":{"message":"Instelling van de assistent"},"menu_wot_reputation_indicator":{"message":"Website reputatie indicator"},"menu_wot_reputation_confidence_level":{"message":"Vertrouwensniveau reputatie"},"assistant_select_element":{"message":"Element blokkeren"},"assistant_select_element_ext":{"message":"Kies een element op deze pagina dat je wil blokkeren"},"assistant_select_element_cancel":{"message":"Annuleren"},"assistant_block_element":{"message":"Element blokkeren"},"assistant_block_element_explain":{"message":"Pas de Element blokkeren regel aan"},"assistant_slider_explain":{"message":"Beweeg de schuifregelaar om de grootte van het frame te wijzigen waarvoor de nieuwe regel werkt:"},"assistant_extended_settings":{"message":"Geavanceerde instellingen"},"assistant_apply_rule_to_all_sites":{"message":"Regel toepassen op alle websites"},"assistant_block_by_reference":{"message":"Blokkeren via referentielink"},"assistant_block_similar":{"message":"Blokkeer vergelijkbare"},"assistant_another_element":{"message":"Een ander element selecteren"},"assistant_preview":{"message":"Voorbeeldweergave"},"assistant_block":{"message":"Blokkeren"},"assistant_settings":{"message":"Assistent instellingen"},"assistant_preview_header":{"message":"Elementblokkering - voorbeeld"},"assistant_preview_header_info":{"message":"Zorg ervoor dat het element wordt geblokkeerd zoals bedoeld"},"assistant_preview_end":{"message":"Voorbeeldweergave afsluiten"},"wot_unknown_description":{"message":"De reputatie van deze website wordt niet bepaald door $1"},"wot_bad_description":{"message":"Deze website heeft een zeer slechte reputatie\\nvolgens $1"},"wot_poor_description":{"message":"Deze website heeft een slechte reputatie\\nvolgens $ 1"},"wot_unsatisfactory_description":{"message":"Deze website heeft een slechte reputatie volgens $1"},"wot_good_description":{"message":"Deze website heeft een goede reputatie volgens $1"},"wot_excellent_description":{"message":"Deze website heeft een uitstekende reputatie volgens $1"},"settings_choose_size_and_position":{"message":"Grootte en positie van AdGuard Assistent aanpassen"},"settings_icon_size":{"message":"Grootte pictogram:"},"settings_small":{"message":"Klein"},"settings_big":{"message":"Groot"},"settings_position":{"message":"Positie:"},"settings_left_top":{"message":"Linksboven"},"settings_right_top":{"message":"Rechtsboven"},"settings_left_bottom":{"message":"Linksonder"},"settings_right_bottom":{"message":"Rechtsonder"},"settings_cancel":{"message":"Annuleren"},"settings_save":{"message":"Wijzigingen opslaan"}}');

/***/ }),

/***/ 6251:
/***/ ((module) => {

"use strict";
module.exports = JSON.parse('{"settings_position_save":"Nettsider","settings_position_save_all":"Alle nettsider","settings_position_save_this":"Denne nettsiden","assistant_select_element_start":"Start","assistant_select_element_text":"Velg et element på siden som skal blokkeres. Oppdater siden for å avbryte elementblokkeringsmodusen.","menu_filtration_status":{"message":"Filtrering på denne nettsiden"},"menu_do_not_filter_30_sec":{"message":"Ikke filtrer i 30 sekunder"},"menu_block_ad_on_site":{"message":"Blokker annonse på denne nettsiden"},"menu_report_abuse":{"message":"Rapporter denne nettsiden"},"menu_site_report":{"message":"Nettsidens sikkerhetsrapport"},"menu_settings":{"message":"Assistentinnstillinger"},"menu_wot_reputation_indicator":{"message":"Nettsteds-rykteindikator"},"menu_wot_reputation_confidence_level":{"message":"Ryktepålitelighetsnivå"},"assistant_select_element":{"message":"Elementblokkering"},"assistant_select_element_ext":{"message":"Velg et element på siden som skal blokkeres"},"assistant_select_element_cancel":{"message":"Avbryt"},"assistant_block_element":{"message":"Elementblokkering"},"assistant_block_element_explain":{"message":"Juster elementblokkeringsregel"},"assistant_slider_explain":{"message":"Flytt glidebryteren for å endre størrelsen på rammen den nye regelen vil fungere for:"},"assistant_extended_settings":{"message":"Avanserte innstillinger"},"assistant_apply_rule_to_all_sites":{"message":"Bruk regelen for alle nettsider"},"assistant_block_by_reference":{"message":"Blokker med referanselenke"},"assistant_block_similar":{"message":"Blokker lignende"},"assistant_another_element":{"message":"Velg et annet element"},"assistant_preview":{"message":"Forhåndsvisning"},"assistant_block":{"message":"Blokker"},"assistant_settings":{"message":"Assistentinnstillinger"},"assistant_preview_header":{"message":"Elementblokkering - forhåndsvisning"},"assistant_preview_header_info":{"message":"Kontroller at elementet er blokkert som det skal"},"assistant_preview_end":{"message":"Avslutt forhåndsvisning"},"wot_unknown_description":{"message":"Rykte er ikke definert"},"wot_bad_description":{"message":"Denne nettsiden har et veldig dårlig rykte\\ni følge $1"},"wot_poor_description":{"message":"Denne nettsiden har et dårlig rykte\\ni følge $1"},"wot_unsatisfactory_description":{"message":"Denne nettsiden har et dårlig rykte\\ni følge $1"},"wot_good_description":{"message":"Denne nettsiden har et godt rykte\\ni følge $1"},"wot_excellent_description":{"message":"Denne nettsiden har et utmerket rykte\\ni følge $1"},"settings_choose_size_and_position":{"message":"Juster størrelsen og posisjonen til AdGuard-assistent"},"settings_icon_size":{"message":"Ikonstørrelse:"},"settings_small":{"message":"Liten"},"settings_big":{"message":"Stor"},"settings_position":{"message":"Posisjoner:"},"settings_left_top":{"message":"Øverst til venstre"},"settings_right_top":{"message":"Øverst til høyre"},"settings_left_bottom":{"message":"Nederst til venstre"},"settings_right_bottom":{"message":"Nederst til høyre"},"settings_cancel":{"message":"Avbryt"},"settings_save":{"message":"Lagre endringer"}}');

/***/ }),

/***/ 1549:
/***/ ((module) => {

"use strict";
module.exports = JSON.parse('{"settings_position_save":"Strony internetowe","settings_position_save_all":"Wszystkie strony internetowe","settings_position_save_this":"Ta strona internetowa","assistant_select_element_start":"Rozpocznij","assistant_select_element_text":"Wybierz element na stronie do zablokowania. Odśwież stronę, aby anulować tryb blokowania elementu.","menu_filtration_status":{"message":"Filtrowanie na tej stronie internetowej"},"menu_do_not_filter_30_sec":{"message":"Nie filtruj przez 30 sekund"},"menu_block_ad_on_site":{"message":"Zablokuj reklamę na tej stronie internetowej"},"menu_report_abuse":{"message":"Raportuj stronę internetową"},"menu_site_report":{"message":"Raport bezpieczeństwa strony internetowej"},"menu_settings":{"message":"Ustawienia Asystenta"},"menu_wot_reputation_indicator":{"message":"Wskaźnik reputacji witryny"},"menu_wot_reputation_confidence_level":{"message":"Poziom zaufania do reputacji"},"assistant_select_element":{"message":"Blokowanie elementów"},"assistant_select_element_ext":{"message":"Wybierz element na stronie by zablokować"},"assistant_select_element_cancel":{"message":"Anuluj"},"assistant_block_element":{"message":"Blokowanie elementów"},"assistant_block_element_explain":{"message":"Dostosuj regułę blokowania elementów"},"assistant_slider_explain":{"message":"Przesuń suwak by zmienić rozmiar ramki, dla której będzie obowiązywać nowa reguła:"},"assistant_extended_settings":{"message":"Ustawienia zaawansowane"},"assistant_apply_rule_to_all_sites":{"message":"Zastosuj regułę dla wszystkich stron internetowych"},"assistant_block_by_reference":{"message":"Blokuj używając linka referencyjnego"},"assistant_block_similar":{"message":"Blokuj podobne"},"assistant_another_element":{"message":"Wybierz inny element"},"assistant_preview":{"message":"Podgląd"},"assistant_block":{"message":"Blokuj"},"assistant_settings":{"message":"Ustawienia Asystenta"},"assistant_preview_header":{"message":"Blokowanie elementów - podgląd"},"assistant_preview_header_info":{"message":"Upewnij się, że element jest blokowany jak zamierzono"},"assistant_preview_end":{"message":"Zamknij podgląd"},"wot_unknown_description":{"message":"Reputacja nie jest zdefiniowana"},"wot_bad_description":{"message":"Ta strona internetowa ma bardzo złą reputację zgodnie z $1"},"wot_poor_description":{"message":"Ta strona internetowa ma złą reputację zgodnie z $1"},"wot_unsatisfactory_description":{"message":"Ta strona internetowa ma słabą reputację zgodnie z $1"},"wot_good_description":{"message":"Ta strona internetowa ma dobrą reputację zgodnie z $1"},"wot_excellent_description":{"message":"Ta strona internetowa ma doskonałą reputację zgodnie z $1"},"settings_choose_size_and_position":{"message":"Dostosuj rozmiar i pozycję Asystenta AdGuarda"},"settings_icon_size":{"message":"Rozmiar ikony:"},"settings_small":{"message":"Mały"},"settings_big":{"message":"Duży"},"settings_position":{"message":"Pozycja:"},"settings_left_top":{"message":"Lewy górny"},"settings_right_top":{"message":"Prawy górny"},"settings_left_bottom":{"message":"Na dole po lewej"},"settings_right_bottom":{"message":"Na dole po prawej"},"settings_cancel":{"message":"Anuluj"},"settings_save":{"message":"Zapisz zmiany"}}');

/***/ }),

/***/ 1902:
/***/ ((module) => {

"use strict";
module.exports = JSON.parse('{"settings_position_save":"Sítios","settings_position_save_all":"Todos os sítios","settings_position_save_this":"Este sítio","assistant_select_element_start":"Iniciar","assistant_select_element_text":"Escolha um elemento na página para bloquear. Atualize a página para cancelar o bloqueio do elemento.","menu_filtration_status":{"message":"A filtrar este sítio"},"menu_do_not_filter_30_sec":{"message":"Não filtrar durante 30 segundos"},"menu_block_ad_on_site":{"message":"Bloquear publicidade neste sítio"},"menu_report_abuse":{"message":"Denunciar o sítio"},"menu_site_report":{"message":"Relatório de segurança do sítio"},"menu_settings":{"message":"Configurações do assistente"},"menu_wot_reputation_indicator":{"message":"Indicador de reputação do sítio"},"menu_wot_reputation_confidence_level":{"message":"Nível de Confiança de Reputação"},"assistant_select_element":{"message":"Bloqueio de elemento"},"assistant_select_element_ext":{"message":"Escolha um elemento na página para bloquear"},"assistant_select_element_cancel":{"message":"Cancelar"},"assistant_block_element":{"message":"Bloqueio de elementos"},"assistant_block_element_explain":{"message":"Ajustar a regra de bloqueio do elemento"},"assistant_slider_explain":{"message":"Desloque o controlo deslizante para alterar o tamanho do quadro para o qual a nova regra irá funcionar:"},"assistant_extended_settings":{"message":"Definições avançadas"},"assistant_apply_rule_to_all_sites":{"message":"Aplicar a regra para todos os sítios"},"assistant_block_by_reference":{"message":"Bloquear por link de referência"},"assistant_block_similar":{"message":"Bloquear semelhante"},"assistant_another_element":{"message":"Selecionar um elemento diferente"},"assistant_preview":{"message":"Pré-visualização"},"assistant_block":{"message":"Bloquear"},"assistant_settings":{"message":"Configurações do assistente"},"assistant_preview_header":{"message":"Bloquear elemento - pré-visualização"},"assistant_preview_header_info":{"message":"Certifique-se de que o elemento está bloqueado como pretendido"},"assistant_preview_end":{"message":"Sair da previsualização"},"wot_unknown_description":{"message":"A reputação deste sítio não está definida por $1"},"wot_bad_description":{"message":"Este sítio tem uma péssima reputação\\nde acordo com $1"},"wot_poor_description":{"message":"Este sítio tem uma má reputação\\nde acordo com $1"},"wot_unsatisfactory_description":{"message":"Este sítio tem uma frágil reputação\\nde acordo com $1"},"wot_good_description":{"message":"Este sítio tem uma boa reputação\\nde acordo com $1"},"wot_excellent_description":{"message":"Este sítio tem uma excelente reputação\\nde acordo com $1"},"settings_choose_size_and_position":{"message":"Ajustar o tamanho e a posição do Assistente do AdGuard"},"settings_icon_size":{"message":"Tamanho do ícone:"},"settings_small":{"message":"Pequeno"},"settings_big":{"message":"Grande"},"settings_position":{"message":"Posição:"},"settings_left_top":{"message":"Canto superior esquerdo"},"settings_right_top":{"message":"Canto superior direito"},"settings_left_bottom":{"message":"Canto inferior esquerdo"},"settings_right_bottom":{"message":"Canto inferior direito"},"settings_cancel":{"message":"Cancelar"},"settings_save":{"message":"Guardar alterações"}}');

/***/ }),

/***/ 9274:
/***/ ((module) => {

"use strict";
module.exports = JSON.parse('{"settings_position_save":"Sites","settings_position_save_all":"Todos os sites","settings_position_save_this":"Neste site","assistant_select_element_start":"Iniciar","assistant_select_element_text":"Escolha um elemento na página para bloquear. Atualize a página para cancelar o bloqueio do elemento.","menu_filtration_status":{"message":"Filtragem neste site"},"menu_do_not_filter_30_sec":{"message":"Não filtrar durante 30 segundos"},"menu_block_ad_on_site":{"message":"Bloquear anúncios neste site"},"menu_report_abuse":{"message":"Reportar o site"},"menu_site_report":{"message":"Relatório de segurança do site"},"menu_settings":{"message":"Configurações do assistente"},"menu_wot_reputation_indicator":{"message":"Indicador de reputação do site"},"menu_wot_reputation_confidence_level":{"message":"Nível de confiança de reputação"},"assistant_select_element":{"message":"Bloqueio de elemento"},"assistant_select_element_ext":{"message":"Escolha um elemento na página para bloquear"},"assistant_select_element_cancel":{"message":"Cancelar"},"assistant_block_element":{"message":"Bloqueio de elemento"},"assistant_block_element_explain":{"message":"Ajustar a regra de bloqueio de elemento"},"assistant_slider_explain":{"message":"Mova o controle deslizante para alterar o tamanho do quadro para o qual a nova regra funcionará:"},"assistant_extended_settings":{"message":"Configurações avançadas"},"assistant_apply_rule_to_all_sites":{"message":"Aplicar regra para todos os sites"},"assistant_block_by_reference":{"message":"Bloquear pelo link de referência"},"assistant_block_similar":{"message":"Bloquear semelhante"},"assistant_another_element":{"message":"Selecione um elemento diferente"},"assistant_preview":{"message":"Pré-visualização"},"assistant_block":{"message":"Bloquear"},"assistant_settings":{"message":"Configurações do assistente"},"assistant_preview_header":{"message":"Bloqueio de elemento - pré-visualização"},"assistant_preview_header_info":{"message":"Certifique-se de que o elemento esteja bloqueado como desejado"},"assistant_preview_end":{"message":"Sair da pré-visualização"},"wot_unknown_description":{"message":"A reputação deste site ainda não foi definida por $1"},"wot_bad_description":{"message":"Este site tem uma reputação muito ruim\\nde acordo com $1"},"wot_poor_description":{"message":"Este site tem uma má reputação\\nde acordo com $1"},"wot_unsatisfactory_description":{"message":"Este site tem uma reputação ruim\\nde acordo com $1"},"wot_good_description":{"message":"Este site tem uma boa reputação\\nde acordo com $1"},"wot_excellent_description":{"message":"Este site tem uma excelente reputação\\nde acordo com $1"},"settings_choose_size_and_position":{"message":"Ajuste o tamanho e posição do Assistente do AdGuard"},"settings_icon_size":{"message":"Tamanho do ícone:"},"settings_small":{"message":"Pequeno"},"settings_big":{"message":"Grande"},"settings_position":{"message":"Posição:"},"settings_left_top":{"message":"Canto superior esquerdo"},"settings_right_top":{"message":"Canto superior direito"},"settings_left_bottom":{"message":"Canto inferior esquerdo"},"settings_right_bottom":{"message":"Canto inferior direito"},"settings_cancel":{"message":"Cancelar"},"settings_save":{"message":"Salvar alterações"}}');

/***/ }),

/***/ 6090:
/***/ ((module) => {

"use strict";
module.exports = JSON.parse('{"settings_position_save":"Site web","settings_position_save_all":"Toate site-urile","settings_position_save_this":"Acest site","assistant_select_element_start":"Start","assistant_select_element_text":"Alegeți elementul de blocat pe pagină. Actualizați pagina ca să anulați modul de blocare a elementului.","menu_filtration_status":{"message":"Filtrare pe acest site web"},"menu_do_not_filter_30_sec":{"message":"Nu filtra pentru 30 secunde"},"menu_block_ad_on_site":{"message":"Blocare reclame pe acest site"},"menu_report_abuse":{"message":"Raportați site-ul"},"menu_site_report":{"message":"Raport de securitate site"},"menu_settings":{"message":"Setări asistent"},"menu_wot_reputation_indicator":{"message":"Indicator reputație site"},"menu_wot_reputation_confidence_level":{"message":"Nivel de încredere în reputație"},"assistant_select_element":{"message":"Element de blocat"},"assistant_select_element_ext":{"message":"Alegeți un element de blocat pe pagină"},"assistant_select_element_cancel":{"message":"Anulare"},"assistant_block_element":{"message":"Blocare de element"},"assistant_block_element_explain":{"message":"Ajustați regula de blocare element"},"assistant_slider_explain":{"message":"Mișcarea glisorului schimbă talia cadrului în care va funcționa noua regulă:"},"assistant_extended_settings":{"message":"Setări avansate"},"assistant_apply_rule_to_all_sites":{"message":"Aplică regula pe orice site"},"assistant_block_by_reference":{"message":"Blocare după link de referință"},"assistant_block_similar":{"message":"Blocare similare"},"assistant_another_element":{"message":"Alegeți un element diferit"},"assistant_preview":{"message":"Ecran"},"assistant_block":{"message":"Blocați"},"assistant_settings":{"message":"Setări asistent"},"assistant_preview_header":{"message":"Blocare element - previzualizare"},"assistant_preview_header_info":{"message":"Verificați blocarea elementului conform planului"},"assistant_preview_end":{"message":"Ieșire ecran"},"wot_unknown_description":{"message":"Reputația acestui site nu este definită de $1"},"wot_bad_description":{"message":"Acest site are o reputație foarte proastă\\nconform cu $1"},"wot_poor_description":{"message":"Acest site are o reputație proastă\\nconform cu $1"},"wot_unsatisfactory_description":{"message":"Acest site are o reputație slabă\\nconform cu $1"},"wot_good_description":{"message":"Acest site are o reputație bună\\nconform cu $1"},"wot_excellent_description":{"message":"Acest site are o reputație excelentă\\nconform cu $1"},"settings_choose_size_and_position":{"message":"Ajustați talia și poziția Asistentului AdGuard"},"settings_icon_size":{"message":"Talie icoană:"},"settings_small":{"message":"Mică"},"settings_big":{"message":"Mare"},"settings_position":{"message":"Poziție:"},"settings_left_top":{"message":"Stânga sus"},"settings_right_top":{"message":"Dreapta sus"},"settings_left_bottom":{"message":"Stânga jos"},"settings_right_bottom":{"message":"Dreapta jos"},"settings_cancel":{"message":"Anulare"},"settings_save":{"message":"Salvare alegeri"}}');

/***/ }),

/***/ 3999:
/***/ ((module) => {

"use strict";
module.exports = JSON.parse('{"settings_position_save":"Сайты","settings_position_save_all":"На всех","settings_position_save_this":"Только на этом","assistant_select_element_start":"Начать","assistant_select_element_text":"Выберите на странице элемент для блокирования. Обновите страницу, чтобы отменить режим блокировки элементов.","menu_filtration_status":{"message":"Фильтрация на этом сайте"},"menu_do_not_filter_30_sec":{"message":"Не фильтровать 30 секунд"},"menu_block_ad_on_site":{"message":"Заблокировать рекламу на сайте"},"menu_report_abuse":{"message":"Пожаловаться на сайт"},"menu_site_report":{"message":"Отчёт о безопасности сайта"},"menu_settings":{"message":"Настроить помощник"},"menu_wot_reputation_indicator":{"message":"Индикатор репутации сайта"},"menu_wot_reputation_confidence_level":{"message":"Уровень доверия к репутации"},"assistant_select_element":{"message":" Блокировка элемента"},"assistant_select_element_ext":{"message":"Выберите на странице элемент, который надо заблокировать"},"assistant_select_element_cancel":{"message":"Отмена"},"assistant_block_element":{"message":"Блокировка элемента"},"assistant_block_element_explain":{"message":"Настройте правило блокирования элемента"},"assistant_slider_explain":{"message":"Перемещайте бегунок, чтобы изменить размер блока, для которого будет действовать правило:"},"assistant_extended_settings":{"message":"Расширенные настройки"},"assistant_apply_rule_to_all_sites":{"message":"Применить правило для всех сайтов"},"assistant_block_by_reference":{"message":"Блокировать по ссылке"},"assistant_block_similar":{"message":"Блокировать похожие"},"assistant_another_element":{"message":"Выбрать другой элемент"},"assistant_preview":{"message":"Предпросмотр"},"assistant_block":{"message":"Заблокировать"},"assistant_settings":{"message":"Настройка помощника"},"assistant_preview_header":{"message":"Блокировка элемента – предпросмотр"},"assistant_preview_header_info":{"message":"Убедитесь, что элемент заблокирован как задумано"},"assistant_preview_end":{"message":"Закончить предпросмотр"},"wot_unknown_description":{"message":"Репутация не определена расширением $1"},"wot_bad_description":{"message":"У сайта очень плохая репутация по данным $1"},"wot_poor_description":{"message":"У сайта плохая репутация по данным $1"},"wot_unsatisfactory_description":{"message":"У сайта неудовлетворительная репутация по данным $1"},"wot_good_description":{"message":"У сайта хорошая репутация по данным $1"},"wot_excellent_description":{"message":"У сайта отличная репутация по данным $1"},"settings_choose_size_and_position":{"message":"Настройте размер и положение помощника AdGuard"},"settings_icon_size":{"message":"Размер иконки:"},"settings_small":{"message":"Маленькая"},"settings_big":{"message":"Большая"},"settings_position":{"message":"Расположение:"},"settings_left_top":{"message":"Вверху слева"},"settings_right_top":{"message":"Вверху справа"},"settings_left_bottom":{"message":"Внизу слева"},"settings_right_bottom":{"message":"Внизу справа"},"settings_cancel":{"message":"Отмена"},"settings_save":{"message":"Сохранить настройки"}}');

/***/ }),

/***/ 89:
/***/ ((module) => {

"use strict";
module.exports = JSON.parse('{"settings_position_save":"Webové stránky","settings_position_save_all":"Všetky stránky","settings_position_save_this":"Táto stránka","assistant_select_element_start":"Štart","assistant_select_element_text":"Vyberte prvok na stránke, ktorý chcete zablokovať. Obnovte stránku pre zrušenie režimu blokovania prvkov.","menu_filtration_status":{"message":"Filtrácia na tejto stránke"},"menu_do_not_filter_30_sec":{"message":"Nefiltrovať počas 30 sekúnd"},"menu_block_ad_on_site":{"message":"Blokovať reklamy na tejto stránke"},"menu_report_abuse":{"message":"Nahlásiť stránku"},"menu_site_report":{"message":"Bezpečnostná správa o stránke"},"menu_settings":{"message":"Nastavenia asistenta"},"menu_wot_reputation_indicator":{"message":"Indikátor reputácie stránok"},"menu_wot_reputation_confidence_level":{"message":"Úroveň spoľahlivosti reputácie"},"assistant_select_element":{"message":"Blokovanie prvku"},"assistant_select_element_ext":{"message":"Vyberte prvok stránky, ktorý sa má blokovať"},"assistant_select_element_cancel":{"message":"Zrušiť"},"assistant_block_element":{"message":"Blokovanie prvku"},"assistant_block_element_explain":{"message":"Upraviť pravidlo blokovania prvku"},"assistant_slider_explain":{"message":"Použite posuvník pre zmenu veľkosti rámu pre nové pravidlo, ktoré bude použité na:"},"assistant_extended_settings":{"message":"Pokročilé nastavenia"},"assistant_apply_rule_to_all_sites":{"message":"Použiť pravidlo na všetky stránky"},"assistant_block_by_reference":{"message":"Blokovať referenčným odkazom"},"assistant_block_similar":{"message":"Blokovať podobné"},"assistant_another_element":{"message":"Zvoliť iný prvok"},"assistant_preview":{"message":"Náhľad"},"assistant_block":{"message":"Blokovať"},"assistant_settings":{"message":"Nastavenia asistenta"},"assistant_preview_header":{"message":"Blokovanie prvku - náhľad"},"assistant_preview_header_info":{"message":"Uistite sa, že prvok je blokovaný podľa Vašich predstáv"},"assistant_preview_end":{"message":"Ukončenie náhľadu"},"wot_unknown_description":{"message":"Reputácia tejto webovej stránky nie je v $1 definovaná"},"wot_bad_description":{"message":"Táto stránka má podľa $1\\nveľmi zlú reputáciu"},"wot_poor_description":{"message":"Táto stránka má podľa $1\\nzlú reputáciu"},"wot_unsatisfactory_description":{"message":"Táto stránka má podľa $1\\nslabú reputáciu"},"wot_good_description":{"message":"Táto stránka má podľa $1\\ndobrú reputáciu"},"wot_excellent_description":{"message":"Táto stránka má podľa $1\\nvýbornú reputáciu"},"settings_choose_size_and_position":{"message":"Prispôsobiť veľkosť a polohu AdGuard asistenta"},"settings_icon_size":{"message":"Veľkosť ikony:"},"settings_small":{"message":"Malá"},"settings_big":{"message":"Veľká"},"settings_position":{"message":"Poloha:"},"settings_left_top":{"message":"Vľavo hore"},"settings_right_top":{"message":"Vpravo hore"},"settings_left_bottom":{"message":"Vľavo dole"},"settings_right_bottom":{"message":"Vpravo dole"},"settings_cancel":{"message":"Zrušiť"},"settings_save":{"message":"Uložiť zmeny"}}');

/***/ }),

/***/ 6058:
/***/ ((module) => {

"use strict";
module.exports = JSON.parse('{"settings_position_save":"Spletne strani","settings_position_save_all":"Vse pletne strani","settings_position_save_this":"To spletno stran","assistant_select_element_start":"Začni","assistant_select_element_text":"Izberite element na strani, ki jo želite onemogočiti. Osvežite stran, da prekličete način zaviranja elementa.","menu_filtration_status":{"message":"Filtriranje na tej spletni strani"},"menu_do_not_filter_30_sec":{"message":"Ne filtriraj 30 sekund"},"menu_block_ad_on_site":{"message":"Onemogoči oglas na tej spletni strani"},"menu_report_abuse":{"message":"Prijavi spletno stran"},"menu_site_report":{"message":"Poročilo o varnosti spletne strani"},"menu_settings":{"message":"Nastavitve Pomočnika"},"menu_wot_reputation_indicator":{"message":"Kazalnik ugleda spletnestrani"},"menu_wot_reputation_confidence_level":{"message":"Raven ugleda zaupanja"},"assistant_select_element":{"message":"Onemogočanje elementa"},"assistant_select_element_ext":{"message":"Izberite element na strani, ki ga želite onemogočiti"},"assistant_select_element_cancel":{"message":"Prekliči"},"assistant_block_element":{"message":"Onemogočanje elementa"},"assistant_block_element_explain":{"message":"Prilagodite pravilo za onemogočanje elementa"},"assistant_slider_explain":{"message":"Premaknite drsnik, da spremenite velikost okvirja, za katerega bo delovalo novo pravilo:"},"assistant_extended_settings":{"message":"Napredne nastavitve"},"assistant_apply_rule_to_all_sites":{"message":"Uporabi pravilo za vse spletne strani"},"assistant_block_by_reference":{"message":"Onemogočij z napotitveno povezavo"},"assistant_block_similar":{"message":"Onemogoči podobno"},"assistant_another_element":{"message":"Izberi drug element"},"assistant_preview":{"message":"Predogled"},"assistant_block":{"message":"Onemogoči"},"assistant_settings":{"message":"Nastavitve Pomočnika"},"assistant_preview_header":{"message":"Onemogočanje elementa - predogled"},"assistant_preview_header_info":{"message":"Prepričajte se, da je element bil onemogočen, kot je bilo predvideno"},"assistant_preview_end":{"message":"Zapusti predogled"},"wot_unknown_description":{"message":"Ugled te spletne strani ni opredeljen z $1"},"wot_bad_description":{"message":"Ta spletna stran ima zelo slab ugled\\nglede na $1"},"wot_poor_description":{"message":"Ta spletna stran ima slab ugled\\nglede na $1"},"wot_unsatisfactory_description":{"message":"Ta spletna stran ima zelo slab ugled\\nglede na $1"},"wot_good_description":{"message":"Ta spletna stran ima dober ugled\\nglede na $1"},"wot_excellent_description":{"message":"Ta spletna stran ima odličen ugled\\nglede na $1"},"settings_choose_size_and_position":{"message":"Prilagodi velikost in položaj AdGuard Pomočnika"},"settings_icon_size":{"message":"Velikost ikone:"},"settings_small":{"message":"Majhna"},"settings_big":{"message":"Velika"},"settings_position":{"message":"Položaj:"},"settings_left_top":{"message":"Zgoraj levo"},"settings_right_top":{"message":"Zgoraj desno"},"settings_left_bottom":{"message":"Spodaj levo"},"settings_right_bottom":{"message":"Spodaj desno"},"settings_cancel":{"message":"Prekliči"},"settings_save":{"message":"Shrani nastavitve"}}');

/***/ }),

/***/ 9177:
/***/ ((module) => {

"use strict";
module.exports = JSON.parse('{"settings_position_save":"Sajtovi","settings_position_save_all":"Svi sajtovi","settings_position_save_this":"Ovaj sajt","assistant_select_element_start":"Započni","assistant_select_element_text":"Izaberite element na stranici koji želite da blokirate. Osvežite stranicu da otkažete blokiranje elemenata.","menu_filtration_status":{"message":"Filtriranje na ovom sajtu"},"menu_do_not_filter_30_sec":{"message":"Ne filtriraj u narednih 30 sekundi"},"menu_block_ad_on_site":{"message":"Blokiraj reklamu na ovom sajtu"},"menu_report_abuse":{"message":"Prijavi sajt"},"menu_site_report":{"message":"Bezbednosni izveštaj o sajtu"},"menu_settings":{"message":"Postavke pomoćnika"},"menu_wot_reputation_indicator":{"message":"Indikator reputacije sajta"},"menu_wot_reputation_confidence_level":{"message":"Nivo poverljivosti reputacije"},"assistant_select_element":{"message":"Blokiranje elementa"},"assistant_select_element_ext":{"message":"Izaberite element koji želite da blokirate na stranici"},"assistant_select_element_cancel":{"message":"Otkaži"},"assistant_block_element":{"message":"Blokiranje elementa"},"assistant_block_element_explain":{"message":"Podesite pravilo blokiranja elementa"},"assistant_slider_explain":{"message":"Pomerajte klizač kako bi ste promenili veličinu okvira po kom će pravilo raditi:"},"assistant_extended_settings":{"message":"Napredne postavke"},"assistant_apply_rule_to_all_sites":{"message":"Primeni pravilo na sve sajtove"},"assistant_block_by_reference":{"message":"Blokiraj po linku reference"},"assistant_block_similar":{"message":"Blokiraj slično"},"assistant_another_element":{"message":"Izaberite drugi element"},"assistant_preview":{"message":"Pregled"},"assistant_block":{"message":"Blokiraj"},"assistant_settings":{"message":"Postavke pomoćnika"},"assistant_preview_header":{"message":"Pregled blokiranja elementa"},"assistant_preview_header_info":{"message":"Uverite se da je element blokiran kako ste želeli"},"assistant_preview_end":{"message":"Napusti pregled"},"wot_unknown_description":{"message":"Reputacija nije definisana"},"wot_bad_description":{"message":"Ovaj sajt ima veoma lošu reputaciju\\nprema "},"wot_poor_description":{"message":"Ovaj sajt ima lošu reputaciju\\nprema "},"wot_unsatisfactory_description":{"message":"Ovaj sajt ima slabu reputaciju\\nprema "},"wot_good_description":{"message":"Ovaj sajt ima dobru reputaciju\\nprema "},"wot_excellent_description":{"message":"Ovaj sajt ima odličnu reputaciju\\nprema "},"settings_choose_size_and_position":{"message":"Podesite veličinu i poziciju AdGuard pomoćnika"},"settings_icon_size":{"message":"Veličina ikonice"},"settings_small":{"message":"Mala"},"settings_big":{"message":"Velika"},"settings_position":{"message":"Pozicija:"},"settings_left_top":{"message":"Gore levo"},"settings_right_top":{"message":"Gore desno"},"settings_left_bottom":{"message":"Dole levo"},"settings_right_bottom":{"message":"Dole desno"},"settings_cancel":{"message":"Otkaži"},"settings_save":{"message":"Sačuvaj promene"}}');

/***/ }),

/***/ 6105:
/***/ ((module) => {

"use strict";
module.exports = JSON.parse('{"settings_position_save":"Webbplatser","settings_position_save_all":"Alla webbplatser","settings_position_save_this":"Den här webbplatsen","assistant_select_element_text":"Välj ett element sidan att blockera. Återladda sidan för att återställa elementblockeringsläget.","menu_filtration_status":{"message":"Webbplatsens filtrering"},"menu_do_not_filter_30_sec":{"message":"Pausa filtrering 30 sekunder"},"menu_block_ad_on_site":{"message":"Blockera annons på den här webbplatsen"},"menu_report_abuse":{"message":"Rapportera webbplatsen"},"menu_site_report":{"message":"Säkerhetsrapport för webbplatsen"},"menu_settings":{"message":"Assistentinställningar"},"assistant_select_element":{"message":"Blockering av annonselement"},"assistant_select_element_ext":{"message":"Välj ett annonselement för blockering"},"assistant_select_element_cancel":{"message":"Avbryt"},"assistant_block_element":{"message":"Blockering av annonselement"},"assistant_block_element_explain":{"message":"Anpassa blockeringsregeln för annonselementet"},"assistant_slider_explain":{"message":"Justera storleken på annonselementet som den nya blockeringsregeln skall avse:"},"assistant_extended_settings":{"message":"Avancerade val"},"assistant_apply_rule_to_all_sites":{"message":"Tillämpa regelns på alla webbplatster"},"assistant_block_by_reference":{"message":"Blockera med referenslänk"},"assistant_block_similar":{"message":"Blockera liknande"},"assistant_another_element":{"message":"Markera ett annat annonselement"},"assistant_preview":{"message":"Förhandsgranska"},"assistant_block":{"message":"Blockera"},"assistant_settings":{"message":"Assistentval"},"assistant_preview_header":{"message":"Förhandsgranskning av elementblockeringen"},"assistant_preview_header_info":{"message":"Kontrollera att elementet blockerats som avsett"},"assistant_preview_end":{"message":"Avsluta förhandsgranskningen"},"wot_unknown_description":{"message":"Den här sajtens anseende är inte klarlagd av $1"},"wot_bad_description":{"message":"Webbplatsen har ett mycket dåligt anseende\\nenligt $1"},"wot_poor_description":{"message":"Webbplatsen har dåligt anseende\\nenligt $1"},"wot_unsatisfactory_description":{"message":"Webbplatsen har tveksamt anseende\\nenligt $1"},"wot_good_description":{"message":"Webbplatsen har gott anseende\\nenligt $1"},"wot_excellent_description":{"message":"Webbplatsen har ett mycket gott anseende\\nenligt $1"},"settings_choose_size_and_position":{"message":"Anpassas storlek och läge för AdGuardassistenten"},"settings_icon_size":{"message":"Ikonstorlek"},"settings_small":{"message":"Liten"},"settings_big":{"message":"Stor"},"settings_position":{"message":"Läge:"},"settings_left_top":{"message":"Ovan vänster"},"settings_right_top":{"message":"Ovan höger"},"settings_left_bottom":{"message":"Nedan vänster"},"settings_right_bottom":{"message":"Nedan höger"},"settings_cancel":{"message":"Avbryt"},"settings_save":{"message":"Spara ändringar"}}');

/***/ }),

/***/ 147:
/***/ ((module) => {

"use strict";
module.exports = JSON.parse('{"settings_position_save":"Siteler","settings_position_save_all":"Tüm siteler","settings_position_save_this":"Bu site","assistant_select_element_start":"Başla","assistant_select_element_text":"Engellemek için sayfada bir öğe seçin. Öğe engelleme modunu iptal etmek için sayfayı yenileyin.","menu_filtration_status":{"message":"Bu sitedeki filtreleme"},"menu_do_not_filter_30_sec":{"message":"30 saniyeliğine filtreleme yapma"},"menu_block_ad_on_site":{"message":"Bu sitede reklam engelle"},"menu_report_abuse":{"message":"Siteyi bildir"},"menu_site_report":{"message":"Sitenin güvenlik raporu"},"menu_settings":{"message":"Asistan ayarları"},"menu_wot_reputation_indicator":{"message":"Site itibarı göstergesi"},"menu_wot_reputation_confidence_level":{"message":"İtibarın Güven Seviyesi"},"assistant_select_element":{"message":"Öğe engelleme"},"assistant_select_element_ext":{"message":"Sayfada engellenecek bir öğe seçin"},"assistant_select_element_cancel":{"message":"İptal"},"assistant_block_element":{"message":"Öğe engelleme"},"assistant_block_element_explain":{"message":"Öğe engelleme kuralını ayarla"},"assistant_slider_explain":{"message":"Yeni kuralın çalışacağı çerçevenin boyutunu değiştirmek için kayar düğmeyi hareket ettirin"},"assistant_extended_settings":{"message":"Gelişmiş ayarlar"},"assistant_apply_rule_to_all_sites":{"message":"Kuralı tüm sitelerde uygula"},"assistant_block_by_reference":{"message":"Referans bağlantı ile engelle"},"assistant_block_similar":{"message":"Benzerlerini engelle"},"assistant_another_element":{"message":"Farklı bir öğe seç"},"assistant_preview":{"message":"Önizleme"},"assistant_block":{"message":"Engelle"},"assistant_settings":{"message":"Asistan ayarları"},"assistant_preview_header":{"message":"Öğe engelleme - ön izleme"},"assistant_preview_header_info":{"message":"Öğenin istediğiniz gibi engellendiğinden emin olun"},"assistant_preview_end":{"message":"Önizlemeden çık"},"wot_unknown_description":{"message":"Bu sitenin itibarı $1 tarafından henüz belirlenmemiş"},"wot_bad_description":{"message":"1$\'a göre bu site çok kötü \\nbir itibara sahip"},"wot_poor_description":{"message":"1$\'a göre bu site kötü \\nbir itibara sahip"},"wot_unsatisfactory_description":{"message":"1$\'a göre bu site zayıf\\nbir itibara sahip"},"wot_good_description":{"message":"1$\'a göre bu site iyi\\nbir itibara sahip"},"wot_excellent_description":{"message":"1$\'a göre bu site mükemmel\\nbir itibara sahip"},"settings_choose_size_and_position":{"message":"AdGuard Asistanın boyutunu ve konumunu ayarlayın"},"settings_icon_size":{"message":"Simge boyutu:"},"settings_small":{"message":"Küçük"},"settings_big":{"message":"Büyük"},"settings_position":{"message":"Konum:"},"settings_left_top":{"message":"Sol üst"},"settings_right_top":{"message":"Sağ üst"},"settings_left_bottom":{"message":"Sol alt"},"settings_right_bottom":{"message":"Sağ alt"},"settings_cancel":{"message":"İptal"},"settings_save":{"message":"Değişiklikleri kaydet"}}');

/***/ }),

/***/ 1249:
/***/ ((module) => {

"use strict";
module.exports = JSON.parse('{"settings_position_save":"Сайти","settings_position_save_all":"На всіх","settings_position_save_this":"Тільки на даному","assistant_select_element_start":"Почати","assistant_select_element_text":"Виберіть елемент на сторінці, який треба заблокувати. Оновіть сторінку, щоб скасувати режим блокування.","menu_filtration_status":{"message":"Фільтрування на цьому сайті"},"menu_do_not_filter_30_sec":{"message":"Не фільтрувати 30 секунд"},"menu_block_ad_on_site":{"message":"Заблокувати рекламу на даному сайті"},"menu_report_abuse":{"message":"Повідомити про сайт"},"menu_site_report":{"message":"Звіт про безпеку сайту"},"menu_settings":{"message":"Налаштування помічника"},"menu_wot_reputation_indicator":{"message":"Індикатор репутації сайту"},"menu_wot_reputation_confidence_level":{"message":"Рівень надійності репутації"},"assistant_select_element":{"message":"Блокування елементу"},"assistant_select_element_ext":{"message":"Виберіть елемент на сторінці, який треба заблокувати"},"assistant_select_element_cancel":{"message":"Скасувати"},"assistant_block_element":{"message":"Блокування елементу"},"assistant_block_element_explain":{"message":"Налаштуйте правило блокування елементу"},"assistant_slider_explain":{"message":"Пересувайте повзунок, щоб змінити розмір блоку, для якого діятиме правило:"},"assistant_extended_settings":{"message":"Розширені налаштування"},"assistant_apply_rule_to_all_sites":{"message":"Застосувати правило для всіх сайтів"},"assistant_block_by_reference":{"message":"Блокувати за посиланням"},"assistant_block_similar":{"message":"Блокувати схожі елементи"},"assistant_another_element":{"message":"Вибрати інший елемент"},"assistant_preview":{"message":"Попередній перегляд"},"assistant_block":{"message":"Заблокувати"},"assistant_settings":{"message":"Налаштування помічника"},"assistant_preview_header":{"message":"Блокування елементу - попередній перегляд"},"assistant_preview_header_info":{"message":"Переконайтеся, що елемент заблокований як слід"},"assistant_preview_end":{"message":"Закінчити попередній перегляд"},"wot_unknown_description":{"message":"Репутація цього вебсайту не визначена"},"wot_bad_description":{"message":"Цей сайт має дуже погану репутацію\\nза версією $1"},"wot_poor_description":{"message":"Цей сайт має погану репутацію\\nза версією $1"},"wot_unsatisfactory_description":{"message":"Цей сайт має незадовільну репутацію\\nза версією $1"},"wot_good_description":{"message":"Цей сайт має добру репутацію\\nза версією $1"},"wot_excellent_description":{"message":"Цей сайт має дуже відмінну репутацію\\nза версією $1"},"settings_choose_size_and_position":{"message":"Налаштуйте розмір і положення помічника AdGuard"},"settings_icon_size":{"message":"Розмір іконки:"},"settings_small":{"message":"Маленька"},"settings_big":{"message":"Велика"},"settings_position":{"message":"Позиція:"},"settings_left_top":{"message":"Зверху зліва"},"settings_right_top":{"message":"Зверху справа"},"settings_left_bottom":{"message":"Внизу зліва"},"settings_right_bottom":{"message":"Внизу справа"},"settings_cancel":{"message":"Скасувати"},"settings_save":{"message":"Зберегти зміни"}}');

/***/ }),

/***/ 4534:
/***/ ((module) => {

"use strict";
module.exports = JSON.parse('{"settings_position_save":"Trang Web","settings_position_save_all":"Tất cả trang web","settings_position_save_this":"Chỉ trang web này","assistant_select_element_start":"Bắt đầu","assistant_select_element_text":"Chọn một thành phần trên trang để chặn. Làm mới trang web để hủy bỏ chế độ chặn thành phần.","menu_filtration_status":{"message":"Lọc trên website này"},"menu_do_not_filter_30_sec":{"message":"Không lọc trong 30 giây"},"menu_block_ad_on_site":{"message":"Chặn quảng cáo đối với trang web này"},"menu_report_abuse":{"message":"Báo cáo trang web này"},"menu_site_report":{"message":"Báo cáo bảo mật website"},"menu_settings":{"message":"Cài đặt trợ lý"},"menu_wot_reputation_indicator":{"message":"Chỉ số danh tiếng của trang Web"},"menu_wot_reputation_confidence_level":{"message":"Mức độ đáng tin của danh tiếng"},"assistant_select_element":{"message":"Chặn thành phần"},"assistant_select_element_ext":{"message":"Chọn một thành phần trên trang để chặn"},"assistant_select_element_cancel":{"message":"Hủy bỏ"},"assistant_block_element":{"message":"Chặn thành phần"},"assistant_block_element_explain":{"message":"Điều chỉnh quy tắc chặn phần tử"},"assistant_slider_explain":{"message":"Di chuyển thanh trượt để thay đổi kích thước của khung, quy tắc mới sẽ hoạt động cho:"},"assistant_extended_settings":{"message":"Cài đặt nâng cao"},"assistant_apply_rule_to_all_sites":{"message":"Áp dụng tất cả các điều luật đối với mọi trang web"},"assistant_block_by_reference":{"message":"Chặn theo liên kết tham chiếu"},"assistant_block_similar":{"message":"Chặn tương tự"},"assistant_another_element":{"message":"Chọn một phần tử khác"},"assistant_preview":{"message":"Xem trước"},"assistant_block":{"message":"Chặn"},"assistant_settings":{"message":"Cài đặt trợ lý"},"assistant_preview_header":{"message":"Element blocking-xem trước"},"assistant_preview_header_info":{"message":"Đảm bảo rằng thành phần đó bị chặn như dự định"},"assistant_preview_end":{"message":"Thoát xem trước"},"wot_unknown_description":{"message":"Website này danh tiếng chưa được xác định bởi $1"},"wot_bad_description":{"message":"Website này có danh tiếng cực xấu dựa theo $1"},"wot_poor_description":{"message":"Website này có danh tiếng xấu dựa theo $1"},"wot_unsatisfactory_description":{"message":"Website này có danh tiếng không tốt dựa theo $1"},"wot_good_description":{"message":"Website này có danh tiếng tốt dựa theo $1"},"wot_excellent_description":{"message":"Website này có danh tiếng tuyệt vời dựa theo $1"},"settings_choose_size_and_position":{"message":"Điều chỉnh kích thước và vị trí của Trợ Lý AdGuard"},"settings_icon_size":{"message":"Kích thước biểu tượng:"},"settings_small":{"message":"Nhỏ"},"settings_big":{"message":"Lớn"},"settings_position":{"message":"Vị trí:"},"settings_left_top":{"message":"Trên cùng bên trái"},"settings_right_top":{"message":"Trên cùng bên phải"},"settings_left_bottom":{"message":"Dưới cùng bên trái"},"settings_right_bottom":{"message":"Dưới cùng bên phải"},"settings_cancel":{"message":"Hủy bỏ"},"settings_save":{"message":"Lưu các thay đổi"}}');

/***/ }),

/***/ 3476:
/***/ ((module) => {

"use strict";
module.exports = JSON.parse('{"settings_position_save":"網站","settings_position_save_all":"所有網站","settings_position_save_this":"此網站","assistant_select_element_start":"開始","assistant_select_element_text":"選擇網頁上的元素來阻擋。若要取消重新整理網頁即可。","menu_filtration_status":{"message":"過濾此網頁上的廣告"},"menu_do_not_filter_30_sec":{"message":"暫停過濾 30 秒"},"menu_block_ad_on_site":{"message":"封鎖此網頁上的廣告"},"menu_report_abuse":{"message":"回報此網站"},"menu_site_report":{"message":"網站安全性報告"},"menu_settings":{"message":"助手設定"},"menu_wot_reputation_indicator":{"message":"網頁名譽指標"},"menu_wot_reputation_confidence_level":{"message":"名譽可信程度"},"assistant_select_element":{"message":"封鎖網頁元素"},"assistant_select_element_ext":{"message":"選取網頁上的元素來封鎖"},"assistant_select_element_cancel":{"message":"取消"},"assistant_block_element":{"message":"阻擋網頁元素"},"assistant_block_element_explain":{"message":"調整網頁元素阻擋條件"},"assistant_slider_explain":{"message":"移動滑桿可以更改阻擋元素範圍："},"assistant_extended_settings":{"message":"進階設定"},"assistant_apply_rule_to_all_sites":{"message":"套用至所有網站"},"assistant_block_by_reference":{"message":"通過參考連結封鎖"},"assistant_block_similar":{"message":"封鎖相關或類似的"},"assistant_another_element":{"message":"選取其他網頁元素"},"assistant_preview":{"message":"預覽"},"assistant_block":{"message":"封鎖"},"assistant_settings":{"message":"助手設定"},"assistant_preview_header":{"message":"封鎖網頁元祖 - 預覽"},"assistant_preview_header_info":{"message":"確保網頁元素已被正確封鎖"},"assistant_preview_end":{"message":"關閉預覽"},"wot_unknown_description":{"message":"此網站名譽尚未被 $1 評定"},"wot_bad_description":{"message":"根據 $1\\n此網站名譽非常糟糕"},"wot_poor_description":{"message":"根據 $1\\n此網站擁有不良的名譽"},"wot_unsatisfactory_description":{"message":"根據 $1\\n此網站擁有不好的名譽"},"wot_good_description":{"message":"根據 $1\\n此網站擁有良好的名譽"},"wot_excellent_description":{"message":"根據 $1\\n此網站擁有非常優秀的名譽"},"settings_choose_size_and_position":{"message":"調整 AdGuard 小助手大小與位置"},"settings_icon_size":{"message":"圖示大小："},"settings_small":{"message":"小"},"settings_big":{"message":"大"},"settings_position":{"message":"位置："},"settings_left_top":{"message":"左上角"},"settings_right_top":{"message":"右上角"},"settings_left_bottom":{"message":"左下角"},"settings_right_bottom":{"message":"右下角"},"settings_cancel":{"message":"取消"},"settings_save":{"message":"儲存變更"}}');

/***/ }),

/***/ 5480:
/***/ ((module) => {

"use strict";
module.exports = JSON.parse('{"settings_position_save":"網站","settings_position_save_all":"所有的網站","settings_position_save_this":"此網站","assistant_select_element_start":"開始","assistant_select_element_text":"選擇於該頁面上之元件以封鎖。重新整理該頁面以取消元件封鎖模式。","menu_filtration_status":{"message":"對此網站之過濾"},"menu_do_not_filter_30_sec":{"message":"計 30 秒不過濾"},"menu_block_ad_on_site":{"message":"封鎖於此網站上之廣告"},"menu_report_abuse":{"message":"報告該網站"},"menu_site_report":{"message":"網站安全性報告"},"menu_settings":{"message":"助理設定"},"menu_wot_reputation_indicator":{"message":"網站信譽指標"},"menu_wot_reputation_confidence_level":{"message":"信譽信賴等級"},"assistant_select_element":{"message":"元件封鎖"},"assistant_select_element_ext":{"message":"選擇於該頁面上之元件以封鎖"},"assistant_select_element_cancel":{"message":"取消"},"assistant_block_element":{"message":"元件封鎖"},"assistant_block_element_explain":{"message":"調整元件封鎖規則"},"assistant_slider_explain":{"message":"移動該滑標以更改新的規則將作用於的框架之尺寸："},"assistant_extended_settings":{"message":"進階設定"},"assistant_apply_rule_to_all_sites":{"message":"對所有的網站套用該規則"},"assistant_block_by_reference":{"message":"按照參考連結封鎖"},"assistant_block_similar":{"message":"封鎖相似之物"},"assistant_another_element":{"message":"選擇不同的元件"},"assistant_preview":{"message":"預覽"},"assistant_block":{"message":"封鎖"},"assistant_settings":{"message":"助理設定"},"assistant_preview_header":{"message":"元件封鎖 - 預覽"},"assistant_preview_header_info":{"message":"確定元件如預期的被封鎖"},"assistant_preview_end":{"message":"離開預覽"},"wot_unknown_description":{"message":"此網站的信譽未被 $1 界定"},"wot_bad_description":{"message":"根據 $1，\\n此網站有非常壞的信譽"},"wot_poor_description":{"message":"根據 $1，\\n此網站有壞的信譽"},"wot_unsatisfactory_description":{"message":"根據 $1，\\n此網站有不好的信譽"},"wot_good_description":{"message":"根據 $1，\\n此網站有好的信譽"},"wot_excellent_description":{"message":"根據 $1，\\n此網站有極好的信譽"},"settings_choose_size_and_position":{"message":"調整 AdGuard 助理尺寸和位置"},"settings_icon_size":{"message":"圖示尺寸："},"settings_small":{"message":"小的"},"settings_big":{"message":"大的"},"settings_position":{"message":"位置："},"settings_left_top":{"message":"左上角"},"settings_right_top":{"message":"右上角"},"settings_left_bottom":{"message":"左下角"},"settings_right_bottom":{"message":"右下角"},"settings_cancel":{"message":"取消"},"settings_save":{"message":"儲存更改"}}');

/***/ }),

/***/ 8868:
/***/ ((module) => {

"use strict";
module.exports = JSON.parse('{"settings_position_save":"网站","settings_position_save_all":"所有网站","settings_position_save_this":"此网站","assistant_select_element_start":"开始","assistant_select_element_text":"选择要拦截的网页元素。要取消元素拦截模式，请刷新网页。","menu_filtration_status":{"message":"对此网站进行过滤"},"menu_do_not_filter_30_sec":{"message":"暂停过滤 30 秒"},"menu_block_ad_on_site":{"message":"拦截此网站上的广告"},"menu_report_abuse":{"message":"报告此网站"},"menu_site_report":{"message":"网站安全报告"},"menu_settings":{"message":"助手设置"},"menu_wot_reputation_indicator":{"message":"网站声誉指标"},"menu_wot_reputation_confidence_level":{"message":"声望置信度"},"assistant_select_element":{"message":"拦截元素"},"assistant_select_element_ext":{"message":"选择此页面上需要拦截的元素"},"assistant_select_element_cancel":{"message":"取消"},"assistant_block_element":{"message":"拦截元素"},"assistant_block_element_explain":{"message":"调整元素拦截规则"},"assistant_slider_explain":{"message":"使用滑块改变要由新规则将要拦截的框架大小："},"assistant_extended_settings":{"message":"高级设置"},"assistant_apply_rule_to_all_sites":{"message":"应用规则至所有网站"},"assistant_block_by_reference":{"message":"通过参考链接进行拦截"},"assistant_block_similar":{"message":"拦截类似元素"},"assistant_another_element":{"message":"选择其它元素"},"assistant_preview":{"message":"预览"},"assistant_block":{"message":"拦截"},"assistant_settings":{"message":"AdGuard 助手设置"},"assistant_preview_header":{"message":"元素拦截 - 预览"},"assistant_preview_header_info":{"message":"请确保元素拦截方式符合预期"},"assistant_preview_end":{"message":"退出预览"},"wot_unknown_description":{"message":"声望尚未定义"},"wot_bad_description":{"message":"此网站在以下数据库中声望极低"},"wot_poor_description":{"message":"此网站在以下数据库中声望低下 "},"wot_unsatisfactory_description":{"message":"此网站在以下数据库中声望不佳 "},"wot_good_description":{"message":"此网站在以下数据库中声望良好 "},"wot_excellent_description":{"message":"此网站在以下数据库中声望极佳 "},"settings_choose_size_and_position":{"message":"调整 AdGuard 助手的大小与位置"},"settings_icon_size":{"message":"图标大小："},"settings_small":{"message":"小"},"settings_big":{"message":"大"},"settings_position":{"message":"位置："},"settings_left_top":{"message":"左上角"},"settings_right_top":{"message":"右上角"},"settings_left_bottom":{"message":"左下角"},"settings_right_bottom":{"message":"右下角"},"settings_cancel":{"message":"取消"},"settings_save":{"message":"保存更改"}}');

/***/ })

/******/ 	});
/************************************************************************/
/******/ 	// The module cache
/******/ 	var __webpack_module_cache__ = {};
/******/ 	
/******/ 	// The require function
/******/ 	function __nested_webpack_require_447230__(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,
/******/ 			// no module.loaded needed
/******/ 			exports: {}
/******/ 		};
/******/ 	
/******/ 		// Execute the module function
/******/ 		__webpack_modules__[moduleId](module, module.exports, __nested_webpack_require_447230__);
/******/ 	
/******/ 		// Return the exports of the module
/******/ 		return module.exports;
/******/ 	}
/******/ 	
/************************************************************************/
/******/ 	/* webpack/runtime/compat get default export */
/******/ 	(() => {
/******/ 		// getDefaultExport function for compatibility with non-harmony modules
/******/ 		__nested_webpack_require_447230__.n = (module) => {
/******/ 			var getter = module && module.__esModule ?
/******/ 				() => (module['default']) :
/******/ 				() => (module);
/******/ 			__nested_webpack_require_447230__.d(getter, { a: getter });
/******/ 			return getter;
/******/ 		};
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/define property getters */
/******/ 	(() => {
/******/ 		// define getter functions for harmony exports
/******/ 		__nested_webpack_require_447230__.d = (exports, definition) => {
/******/ 			for(var key in definition) {
/******/ 				if(__nested_webpack_require_447230__.o(definition, key) && !__nested_webpack_require_447230__.o(exports, key)) {
/******/ 					Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ 				}
/******/ 			}
/******/ 		};
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/hasOwnProperty shorthand */
/******/ 	(() => {
/******/ 		__nested_webpack_require_447230__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/make namespace object */
/******/ 	(() => {
/******/ 		// define __esModule on exports
/******/ 		__nested_webpack_require_447230__.r = (exports) => {
/******/ 			if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ 				Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ 			}
/******/ 			Object.defineProperty(exports, '__esModule', { value: true });
/******/ 		};
/******/ 	})();
/******/ 	
/************************************************************************/
var __nested_webpack_exports__ = {};
// This entry need to be wrapped in an IIFE because it need to be in strict mode.
(() => {
"use strict";
// ESM COMPAT FLAG
__nested_webpack_require_447230__.r(__nested_webpack_exports__);

// EXPORTS
__nested_webpack_require_447230__.d(__nested_webpack_exports__, {
  "adguardAssistant": () => (/* binding */ adguardAssistant)
});

;// CONCATENATED MODULE: ./src/ioc.js
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; }

var getArguments = function getArguments(func) {
  // This regex is from require.js
  var FN_ARGS = /^function\s*[^(]*\(\s*([^)]*)\)/m;
  var args = func.toString().match(FN_ARGS)[1].split(',');

  if (args[0] === '') {
    return [];
  }

  return args;
};

var Ioc = /*#__PURE__*/function () {
  function Ioc() {
    _classCallCheck(this, Ioc);

    this.dependencies = {};
  }

  _createClass(Ioc, [{
    key: "resolveDependencies",
    value: function resolveDependencies(func) {
      var args = getArguments(func);
      var resolved = [];

      for (var i = 0; i < args.length; i += 1) {
        var depName = args[i].trim();
        var dep = this.dependencies[depName];

        if (!dep) {
          throw new Error("Can't find dependency: ".concat(depName));
        }

        resolved.push(this.dependencies[depName]);
      }

      return resolved;
    }
  }, {
    key: "register",
    value: function register(qualifier, obj) {
      this.dependencies[qualifier] = obj;
    }
  }, {
    key: "get",
    value: function get(func) {
      if (typeof func === 'string') {
        var resolved = this.dependencies[func];

        if (!resolved) {
          throw new Error("Can't resolve ".concat(func));
        }

        return resolved;
      }

      var resolvedDependencies = this.resolveDependencies(func);

      function FuncWrapper() {
        return func.apply(func, resolvedDependencies);
      }

      FuncWrapper.prototype = func.prototype;
      return new FuncWrapper();
    }
  }]);

  return Ioc;
}();

var ioc = new Ioc();
/* harmony default export */ const src_ioc = (ioc);
;// CONCATENATED MODULE: ./src/protectedApi.js
/**
 * TODO: rewrite to class
 * TODO: add relevant jsdoc
 * Protected API
 * @constructor
 */
function ProtectedApi() {
  var win = window;
  var functionPType = Function.prototype;
  var originalGetOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
  var _document = document,
      documentMode = _document.documentMode,
      documentElement = _document.documentElement;
  var originalAppendChild = document.appendChild;
  var originalJSON = win.JSON;
  var functionApply = functionPType.apply;
  var functionBind = functionPType.bind;
  var COMPLETE = 'complete';
  var originalAttachShadow = documentElement.attachShadow; // eslint-disable-next-line func-names

  var apply = typeof Reflect !== 'undefined' ? Reflect.apply : function (target, _this, _arguments) {
    return functionApply.call(target, _this, _arguments);
  };

  var noop = function noop() {};

  var methodCallerFactory = function methodCallerFactory(owner, prop) {
    if (!owner) {
      return noop;
    } // Keeps reference to the method, so that it is unaffected
    // when `owner` is mutated.


    var method = owner[prop]; // eslint-disable-next-line consistent-return, func-names

    return function () {
      if (method) {
        // eslint-disable-next-line prefer-rest-params
        return apply(method, owner, arguments);
      }
    };
  };

  var getReadyState = function getReadyState() {
    // We need to add this hook for tests, because a phantomjs
    // doesn't work with Object.getOwnPropertyDescriptor correctly
    if (typeof originalGetOwnPropertyDescriptor(Document.prototype, 'readyState') === 'undefined') {
      return COMPLETE;
    }

    var readyStateGetter = originalGetOwnPropertyDescriptor(Document.prototype, 'readyState').get;
    return apply(readyStateGetter, document, []);
  };

  var addListenerToWindow = methodCallerFactory(win, 'addEventListener');
  var removeListenerFromWindow = methodCallerFactory(win, 'removeEventListener');
  var querySelector = methodCallerFactory(document, 'querySelector');

  var appendChildToElement = function appendChildToElement(elem, child) {
    apply(originalAppendChild, elem, [child]);
  };
  /**
   * Creating element instead `document.createElement`
   * to prevented a custom `document.createElement`
   * see: https://github.com/AdguardTeam/AdguardAssistant/issues/165
   */


  var createElement = function createElement(markup) {
    var doc = document.implementation.createHTMLDocument('');

    if (markup && markup[0] !== '<') {
      // eslint-disable-next-line no-param-reassign
      markup = "<".concat(markup, "></").concat(markup, ">");
    }

    doc.body.innerHTML = markup;
    return doc.body.firstChild;
  };

  var json = {
    parse: methodCallerFactory(originalJSON, 'parse'),
    stringify: methodCallerFactory(originalJSON, 'stringify')
  };
  /**
   * Creating style element
   * @param {String} styles css styles in string
   * @param {String} nonce  attribute for content-security-policy
   * @param {String} id to prevent duplicates, can be empty
   * @return {Object|false} style tag with styles or false
   * if the styles with transferred id is exist
   */

  var createStylesElement = function createStylesElement(styles, nonce, id) {
    if (id && querySelector("#".concat(id))) {
      return false;
    }

    var tagNode = createElement('style');
    tagNode.setAttribute('type', 'text/css');

    if (id) {
      tagNode.setAttribute('id', id);
    }

    tagNode.setAttribute('nonce', nonce);

    if (tagNode.styleSheet) {
      tagNode.styleSheet.cssText = styles;
    } else {
      appendChildToElement(tagNode, document.createTextNode(styles));
    }

    return tagNode;
  };
  /**
   * Check browser shadow dom support.
   * Safari crashes after adding style tag in attachShadow so exclude it
   * see: https://github.com/AdguardTeam/AdguardBrowserExtension/issues/974
   */


  var checkShadowDomSupport = function checkShadowDomSupport() {
    var SAFARI_UA_REGEX = /^((?!chrome|android).)*safari/i;
    var isSafari = window.safari !== undefined || SAFARI_UA_REGEX.test(navigator.userAgent);
    return typeof originalAttachShadow !== 'undefined' && !isSafari;
  };

  return {
    functionBind: functionBind,
    addListenerToWindow: addListenerToWindow,
    removeListenerFromWindow: removeListenerFromWindow,
    getReadyState: getReadyState,
    documentMode: documentMode,
    appendChildToElement: appendChildToElement,
    createElement: createElement,
    json: json,
    createStylesElement: createStylesElement,
    checkShadowDomSupport: checkShadowDomSupport
  };
}

var protectedApi = new ProtectedApi();
/* harmony default export */ const src_protectedApi = (protectedApi);
;// CONCATENATED MODULE: ./src/wot.js
/**
 * Object that manages wot data
 * @returns {{
 * registerWotEventHandler: Function,
 * getWotData: Function,
 * getWotScorecardUrl: Function,
 * WOT_URL: string
 * }}
 * @constructor
 */
function Wot() {
  var wotUrlScorecardTemplate = 'https://link.adtidy.org/forward.html?action=wot_scorecard&from=main_menu&app=assistant&domain=';
  var WOT_URL = 'https://link.adtidy.org/forward.html?action=wot&from=main_menu&app=assistant';
  var wotData = null;

  var registerWotEventHandler = function registerWotEventHandler() {
    var wotDataCb = function wotDataCb(data) {
      wotData = data;
    };

    if (window.WotData) {
      wotData = window.WotData;
    } else {
      window.WotData = wotDataCb;
    }
  };

  var getWotData = function getWotData() {
    return wotData;
  };

  var getWotScorecardUrl = function getWotScorecardUrl(url) {
    return "".concat(wotUrlScorecardTemplate).concat(url);
  };

  return {
    registerWotEventHandler: registerWotEventHandler,
    getWotData: getWotData,
    getWotScorecardUrl: getWotScorecardUrl,
    WOT_URL: WOT_URL
  };
}

var wot = new Wot();
/* harmony default export */ const src_wot = (wot);
;// CONCATENATED MODULE: ./src/utils/common-utils.js
var cropDomain = function cropDomain(domain) {
  return domain.replace('www.', '').replace(/:\d+/, '');
};
/**
 * Force clear the page cache
 * see: https://stackoverflow.com/questions/10719505/force-a-reload-of-page-in-chrome-using-javascript-no-cache/27058362#27058362
 * @param callback
 */

var bypassCache = function bypassCache(callback) {
  var xhr = new XMLHttpRequest();
  xhr.open('GET', window.location.href, true);
  xhr.setRequestHeader('Pragma', 'no-cache');
  xhr.setRequestHeader('Expires', '-1');
  xhr.setRequestHeader('Cache-Control', 'no-cache');

  xhr.onreadystatechange = function () {
    if (xhr.readyState === 4 && callback) {
      callback();
    }
  };

  xhr.send();
};
/**
 * Reload page after bypassing cache
 */

var reloadPageBypassCache = function reloadPageBypassCache() {
  bypassCache(function () {
    window.location.reload(true);
  });
};
/**
 * Multiple event handler helper.
 * @param {Object}  elements  element or nodeList.
 * @param {String}  events    multiple events divided by space.
 * @param {Function}  eventHandler   event handler.
 * @param {Boolean}  useCapture   capture.
 * @return {Function} add/remove.
 */

var events = {
  add: function add(elements, es, eventHandler, useCapture) {
    this.addRemoveEvents(true, elements, es, eventHandler, useCapture);
  },
  remove: function remove(elements, es, eventHandler, useCapture) {
    this.addRemoveEvents(false, elements, es, eventHandler, useCapture);
  },
  // eslint-disable-next-line consistent-return
  addRemoveEvents: function addRemoveEvents(add, elements, es, eventHandler, useCapture) {
    if (!elements || !es || !eventHandler) {
      return false;
    }

    var eventList = es.split(' ');

    if (!eventList || eventList.length < 1) {
      return false;
    }

    if (!elements.length) {
      // eslint-disable-next-line no-param-reassign
      elements = new Array(elements);
    }

    for (var el = 0; el < elements.length; el += 1) {
      for (var evt = 0; evt < eventList.length; evt += 1) {
        if (!eventList[evt] || !eventList[evt].length) {
          // eslint-disable-next-line no-continue
          continue;
        }

        if (add) {
          elements[el].addEventListener(eventList[evt], eventHandler, !!useCapture);
        } else {
          elements[el].removeEventListener(eventList[evt], eventHandler, !!useCapture);
        }
      }
    }
  }
};
/**
 * Common utils
 * @type {{
 * cropDomain: Function,
 * bypassCache: Function,
 * reloadPageBypassCache: Function,
 * events: Object
 * }}
 */

var CommonUtils = {
  cropDomain: cropDomain,
  bypassCache: bypassCache,
  reloadPageBypassCache: reloadPageBypassCache,
  events: events
};
/* harmony default export */ const common_utils = ((/* unused pure expression or super */ null && (0)));
;// CONCATENATED MODULE: ./src/log.js
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); }

/* global DEBUG */

/**
 * Simple logger with log levels
 * @returns {{
 *  warn: warn,
 *  info: info,
 *  debug: debug,
 *  error: error
 * }}
 * @constructor
 */
function Log() {
  var currentLevel =   false ? 0 : 'ERROR';
  var LogLevels = {
    ERROR: 1,
    WARN: 2,
    INFO: 3,
    DEBUG: 4
  };

  var print = function print(level, method, args) {
    // check log level
    if (LogLevels[currentLevel] < LogLevels[level]) {
      return;
    }

    if (!args || args.length === 0 || !args[0]) {
      return;
    }

    var formatted;

    if (_typeof(args[0]) === 'object') {
      // eslint-disable-next-line prefer-destructuring
      formatted = args[0];
    } else {
      var str = "".concat(args[0]); // eslint-disable-next-line no-param-reassign

      args = Array.prototype.slice.call(args, 1);
      formatted = str.replace(/{(\d+)}/g, function (match, number) {
        return typeof args[number] !== 'undefined' ? args[number] : match;
      });

      if (LogLevels[level] >= LogLevels[currentLevel]) {
        var now = new Date();
        formatted = "".concat(now.toISOString(), ": ").concat(formatted);
      }
    } // eslint-disable-next-line no-console


    console[method](formatted);
  };

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

    print('DEBUG', 'log', args);
  };

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

    print('INFO', 'info', args);
  };

  var warn = function warn() {
    for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
      args[_key3] = arguments[_key3];
    }

    print('WARN', 'info', args);
  };

  var error = function error() {
    for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
      args[_key4] = arguments[_key4];
    }

    print('ERROR', 'error', args);
  };

  return {
    debug: debug,
    info: info,
    warn: warn,
    error: error
  };
}

var log = new Log();
/* harmony default export */ const src_log = (log);
;// CONCATENATED MODULE: ./src/upgradeHelper.js
function upgradeHelper_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

function upgradeHelper_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 upgradeHelper_createClass(Constructor, protoProps, staticProps) { if (protoProps) upgradeHelper_defineProperties(Constructor.prototype, protoProps); if (staticProps) upgradeHelper_defineProperties(Constructor, staticProps); return Constructor; }



/* eslint-disable no-param-reassign */

/**
 * Helper for backward compatibility
 * @returns {{}}
 * @constructor
 */

var UpgradeHelper = /*#__PURE__*/function () {
  function UpgradeHelper() {
    upgradeHelper_classCallCheck(this, UpgradeHelper);

    this.Constants = {
      BUTTON_POSITION_ITEM_NAME: '__adbpos'
    };
  }

  upgradeHelper_createClass(UpgradeHelper, [{
    key: "getButtonPositionData",
    value: function getButtonPositionData() {
      try {
        var userPosition = localStorage.getItem(this.Constants.BUTTON_POSITION_ITEM_NAME);

        if (userPosition) {
          return src_protectedApi.json.parse(userPosition);
        }

        return undefined;
      } catch (ex) {
        src_log.error(ex);
        return undefined;
      }
    }
  }, {
    key: "removeUserPositionForButton",
    value: function removeUserPositionForButton() {
      try {
        localStorage.removeItem(this.Constants.BUTTON_POSITION_ITEM_NAME);
      } catch (ex) {
        src_log.error(ex);
      }
    } // eslint-disable-next-line class-methods-use-this

  }, {
    key: "upgradeGmStorage",
    value: function upgradeGmStorage(settings, version) {
      settings.personal = {};
      settings.scriptVersion = version;
      settings.personalConfig = true;
      return settings;
    } // Helper for assistant update from 4.1 to 4.2

  }, {
    key: "upgradeLocalStorage",
    value: function upgradeLocalStorage(settings, sitename) {
      var position = this.getButtonPositionData();

      if (position) {
        if (!settings.personal[sitename]) {
          settings.personal[sitename] = {};
        }

        settings.personal[sitename].position = position;
        settings.personal[sitename].largeIcon = settings.largeIcon;
      }

      this.removeUserPositionForButton();
      return settings;
    }
  }]);

  return UpgradeHelper;
}();

var upgradeHelper = new UpgradeHelper();
/* harmony default export */ const src_upgradeHelper = (upgradeHelper);
;// CONCATENATED MODULE: ./src/gm.js
/* harmony default export */ const gm = ({});
;// CONCATENATED MODULE: ./src/settings.js
function settings_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { settings_typeof = function _typeof(obj) { return typeof obj; }; } else { settings_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return settings_typeof(obj); }






/**
 * Object that manages user settings.
 * @returns {{
 * Constants: {
 *  MINIMUM_IE_SUPPORTED_VERSION: number,
 *  MINIMUM_VISIBLE_HEIGHT_TO_SHOW_BUTTON: number,
 *  BUTTON_POSITION_ITEM_NAME: string,
 *  IFRAME_ID: string
 * },
 * MenuItemsNames: {
 *  DetailedMenu: string,
 *  SelectorMenu: string,
 *  SliderMenu: string,
 *  BlockPreview: string,
 *  SettingsMenu: string
 * },
 * getSettings: getSettings,
 * loadSettings: loadSettings,
 * getWotData: getWotData,
 * setWotData: setWotData,
 * saveSettings: saveSettings,
 * getUserPositionForButton: getUserPositionForButton,
 * removeUserPositionForButton: removeUserPositionForButton,
 * selectedElement: *,
 * setAdguardSettings: setAdguardSettings,
 * getAdguardSettings: getAdguardSettings
 * }}
 * @constructor
 */

function Settings() {
  var Constants = {
    MINIMUM_IE_SUPPORTED_VERSION: 10,
    MINIMUM_VISIBLE_HEIGHT_TO_SHOW_BUTTON: 250,
    IFRAME_ID: 'adguard-assistant-dialog',
    REPORT_URL: 'https://link.adtidy.org/forward.html?action=site_report_page&domain={0}&from=main_menu&app=assistant'
  };
  var MenuItemsNames = {
    DetailedMenu: 'mainMenu.html',
    SelectorMenu: 'selectorMenu.html',
    SliderMenu: 'sliderMenu.html',
    BlockPreview: 'blockPreview.html',
    SettingsMenu: 'settingsMenu.html'
  };
  /**
   * Config data stored in GM storage
   * @typedef {Object} DefaultConfig
   * @property {boolean} buttonPositionTop - Static button position from top.
   * @property {boolean} buttonPositionLeft - Static button position from left.
   * @property {boolean} smallIcon - Button size. true - small, false - large.
   * @property {boolean} personalConfig - Is the settings save for all
   * sites or for each site individually.
   * @property {number} scriptVersion - Version of scheme. 2 is set since assistant version 4.2.
   * @property {object} personal - Object config that may includes the same properties,
   * except `scriptVersion`, but for each site individually.
   */

  var DefaultConfig = {
    buttonPositionTop: false,
    buttonPositionLeft: false,
    smallIcon: false,
    personalConfig: true,
    scriptVersion: 2,
    personal: {}
  };
  var wotData = null;
  var Config = null;
  var adguardSettings = null;
  var SITENAME = window.location.host;

  var getSettings = function getSettings() {
    return gm.getValue('settings').then(function (config) {
      try {
        return config && src_protectedApi.json.parse(config);
      } catch (ex) {
        src_log.error(ex);
        return null;
      }
    });
  };

  var validateSettings = function validateSettings(settings) {
    if (!settings) {
      src_log.error('Invalid settings object');
      return false;
    } // eslint-disable-next-line no-restricted-syntax, prefer-const


    for (var prop in settings) {
      // eslint-disable-next-line no-prototype-builtins
      if (!settings.hasOwnProperty(prop)) {
        // eslint-disable-next-line no-continue
        continue;
      }

      var property = DefaultConfig[prop];

      if (property && settings_typeof(property) !== settings_typeof(settings[prop])) {
        src_log.error('Invalid settings object');
        return false;
      }
    }

    if (settings.scriptVersion > DefaultConfig.scriptVersion) {
      src_log.error('Invalid settings object');
      return false;
    }

    if (settings.scriptVersion < DefaultConfig.scriptVersion) {
      src_log.info('Settings object is outdated. Updating...'); // eslint-disable-next-line no-param-reassign

      settings = src_upgradeHelper.upgradeGmStorage(settings, DefaultConfig.scriptVersion);
    } // save to gm store position data from localStorage
    // eslint-disable-next-line no-param-reassign


    settings = src_upgradeHelper.upgradeLocalStorage(settings, SITENAME);
    return settings;
  };

  var loadSettings = function loadSettings(showButton) {
    src_log.debug('Trying to get settings'); // getting config from gm storage

    getSettings().then(function (config) {
      // check and validate config data for prevent errors and backward compatibility
      var checkedConfig = config && validateSettings(config);

      if (checkedConfig) {
        // saving existing settings to Config variable in the gm storage
        Config = checkedConfig;
        src_log.debug('Settings parsed successfully');
      } else {
        // use default settings without saving
        Config = DefaultConfig;
        src_log.debug('No settings found');
      }

      showButton();
    });
  };

  var saveSettings = function saveSettings(config) {
    if (config) {
      Config = config;
    }

    src_log.debug('Update settings...');
    src_log.debug(Config);
    gm.setValue('settings', Config);
    bypassCache();
  };

  var getWotData = wotData;

  var setWotData = function setWotData(data) {
    wotData = data;
  };

  var setAdguardSettings = function setAdguardSettings(settings) {
    if (typeof settings === 'undefined') {
      src_log.info('No Adguard API Found');
      return;
    }

    adguardSettings = settings;
  };

  var getAdguardSettings = function getAdguardSettings() {
    return adguardSettings;
  };

  var getUserPositionForButton = function getUserPositionForButton() {
    var userPosition;

    if (Config.personalConfig) {
      if (Config.personal && Config.personal[SITENAME]) {
        userPosition = Config.personal[SITENAME].position;
      }
    } else {
      userPosition = Config.position;
    }

    if (userPosition) {
      return userPosition;
    }

    return null;
  };

  var setUserPositionForButton = function setUserPositionForButton(position) {
    if (Config.personalConfig) {
      if (!Config.personal[SITENAME]) {
        Config.personal[SITENAME] = {};
      }

      Config.personal[SITENAME].position = position;
    } else {
      Config.position = position;
    }

    saveSettings(Config);
  };

  var setIconSize = function setIconSize(smallIcon) {
    if (Config.personalConfig) {
      Config.personal[SITENAME].smallIcon = smallIcon;
    } else {
      Config.smallIcon = smallIcon;
    }
  };

  var getIconSize = function getIconSize() {
    if (Config.personalConfig && Config.personal && Config.personal[SITENAME]) {
      return Config.personal[SITENAME].smallIcon;
    }

    return Config.smallIcon;
  };
  /**
   * Set the parameters to which corner of the browser
   * window the button position is placed by option (not drag)
   */


  var setButtonSide = function setButtonSide(buttonSides) {
    if (Config.personalConfig) {
      delete Config.personal[SITENAME].position;
      Config.personal[SITENAME].buttonPositionTop = buttonSides.top;
      Config.personal[SITENAME].buttonPositionLeft = buttonSides.left;
    } else {
      delete Config.position;
      Config.buttonPositionTop = buttonSides.top;
      Config.buttonPositionLeft = buttonSides.left;
    }
  };
  /**
   * Save a setting that specifies how to save button settings: for all sites or only on this
   */


  var setPersonalParam = function setPersonalParam(personalConfig) {
    Config.personalConfig = personalConfig;

    if (Config.personalConfig && !Config.personal) {
      Config.personal = {};
    }

    if (Config.personalConfig && !Config.personal[SITENAME]) {
      Config.personal[SITENAME] = {};
      Config.personal[SITENAME].position = Config.position;
    }

    if (!Config.personalConfig && Config.personal) {
      Config.position = Config.personal[SITENAME] && Config.personal[SITENAME].position;
      delete Config.personal;
    }
  };
  /**
   * Get config that specifies how to save button settings: for all sites or only on this
   */


  var getPersonalConfig = function getPersonalConfig() {
    return Config.personalConfig;
  };
  /**
   * Get the option to which corner of the browser window the button position is placed
   * @return {Object}
   */


  var getButtonSide = function getButtonSide() {
    var config = Config;

    if (config.personalConfig && config.personal && config.personal[SITENAME]) {
      return {
        top: config.personal[SITENAME].buttonPositionTop,
        left: config.personal[SITENAME].buttonPositionLeft
      };
    }

    return {
      top: config.buttonPositionTop,
      left: config.buttonPositionLeft
    };
  };

  return {
    Constants: Constants,
    MenuItemsNames: MenuItemsNames,
    getSettings: getSettings,
    loadSettings: loadSettings,
    getWotData: getWotData,
    setWotData: setWotData,
    saveSettings: saveSettings,
    getUserPositionForButton: getUserPositionForButton,
    getButtonSide: getButtonSide,
    setIconSize: setIconSize,
    setUserPositionForButton: setUserPositionForButton,
    setAdguardSettings: setAdguardSettings,
    setPersonalParam: setPersonalParam,
    setButtonSide: setButtonSide,
    getAdguardSettings: getAdguardSettings,
    getIconSize: getIconSize,
    getPersonalConfig: getPersonalConfig
  };
}

var settings = new Settings();
/* harmony default export */ const src_settings = (settings);
// EXTERNAL MODULE: ./src/templates/button.html
var templates_button = __nested_webpack_require_447230__(6696);
var button_default = /*#__PURE__*/__nested_webpack_require_447230__.n(templates_button);
// EXTERNAL MODULE: ./src/templates/mainMenu.html
var mainMenu = __nested_webpack_require_447230__(3317);
var mainMenu_default = /*#__PURE__*/__nested_webpack_require_447230__.n(mainMenu);
// EXTERNAL MODULE: ./src/templates/selectorMenu.html
var selectorMenu = __nested_webpack_require_447230__(8514);
var selectorMenu_default = /*#__PURE__*/__nested_webpack_require_447230__.n(selectorMenu);
// EXTERNAL MODULE: ./src/templates/settingsMenu.html
var settingsMenu = __nested_webpack_require_447230__(4693);
var settingsMenu_default = /*#__PURE__*/__nested_webpack_require_447230__.n(settingsMenu);
// EXTERNAL MODULE: ./src/templates/sliderMenu.html
var sliderMenu = __nested_webpack_require_447230__(7726);
var sliderMenu_default = /*#__PURE__*/__nested_webpack_require_447230__.n(sliderMenu);
// EXTERNAL MODULE: ./src/templates/blockPreview.html
var blockPreview = __nested_webpack_require_447230__(5688);
var blockPreview_default = /*#__PURE__*/__nested_webpack_require_447230__.n(blockPreview);
// EXTERNAL MODULE: ./src/templates/mobilePopup.html
var mobilePopup = __nested_webpack_require_447230__(2115);
var mobilePopup_default = /*#__PURE__*/__nested_webpack_require_447230__.n(mobilePopup);
// EXTERNAL MODULE: ./src/templates/mobileMenu.html
var mobileMenu = __nested_webpack_require_447230__(4825);
var mobileMenu_default = /*#__PURE__*/__nested_webpack_require_447230__.n(mobileMenu);
// EXTERNAL MODULE: ./src/styles/base/base-common.less
var base_common = __nested_webpack_require_447230__(1403);
var base_common_default = /*#__PURE__*/__nested_webpack_require_447230__.n(base_common);
// EXTERNAL MODULE: ./src/styles/button.less
var styles_button = __nested_webpack_require_447230__(5487);
var styles_button_default = /*#__PURE__*/__nested_webpack_require_447230__.n(styles_button);
// EXTERNAL MODULE: ./src/styles/menu.less
var menu = __nested_webpack_require_447230__(3228);
var menu_default = /*#__PURE__*/__nested_webpack_require_447230__.n(menu);
// EXTERNAL MODULE: ./src/styles/selector.less
var selector = __nested_webpack_require_447230__(5317);
var selector_default = /*#__PURE__*/__nested_webpack_require_447230__.n(selector);
// EXTERNAL MODULE: ./src/styles/mobile-style.less
var mobile_style = __nested_webpack_require_447230__(1953);
var mobile_style_default = /*#__PURE__*/__nested_webpack_require_447230__.n(mobile_style);
;// CONCATENATED MODULE: ./src/inline-resources.js













var CSS = {
  common: (base_common_default()),
  button: (styles_button_default()),
  iframe: (menu_default()),
  selector: (selector_default()),
  mobile: (mobile_style_default())
};
var HTML = {
  button: (button_default()),
  detailed_menu: (mainMenu_default()),
  selector_menu: (selectorMenu_default()),
  settings_menu: (settingsMenu_default()),
  slider_menu: (sliderMenu_default()),
  preview: (blockPreview_default()),
  popup: (mobilePopup_default()),
  mobile_menu: (mobileMenu_default())
};
;// CONCATENATED MODULE: ./src/event.js
/**
 * Custom event
 * @returns {{attach: attach, notify: notify}}
 * @constructor
 */
function CustomEvent() {
  // jshint ignore:line
  var listeners = [];

  var attach = function attach(listener) {
    listeners.push(listener);
  };

  var notify = function notify(args) {
    for (var i = 0; i < listeners.length; i += 1) {
      listeners[i](args);
    }
  };

  return {
    attach: attach,
    notify: notify
  };
}
;// CONCATENATED MODULE: ./src/utils/dom-utils.js
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 _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 _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; }

/**
 * Returns tag name for passed element
 * @param {Element} element target element
 */
var getNodeName = function getNodeName(element) {
  return element && element.nodeName ? element.nodeName.toUpperCase() : '';
};
/**
 * Returns arrays of parents for passed element
 * @param {Element} element target element
 */

var getParentsLevel = function getParentsLevel(element) {
  var parent = element;
  var parentArr = []; // eslint-disable-next-line no-cond-assign

  while ((parent = parent.parentNode) && getNodeName(parent) !== 'BODY') {
    parentArr.push(parent);
  }

  return parentArr;
};
/**
 * Returns child element if it only one ELEMENT_NODE child
 * @param {Element} element target element
 */
// eslint-disable-next-line consistent-return

var getSingleChildren = function getSingleChildren(element) {
  var children = element.childNodes;

  if (children) {
    var count = 0;
    var child;

    for (var i = 0; i < children.length; i += 1) {
      if (children[i].nodeType === 1) {
        child = children[i];
        count += 1;
      }
    }

    return count === 1 ? child : null;
  }
};
/**
 * Returns all children for target element
 * @param {Element} element target element
 */

var getAllChildren = function getAllChildren(element) {
  var childArray = [];
  var child = element; // eslint-disable-next-line no-cond-assign

  while (child = getSingleChildren(child)) {
    childArray.push(child);
  }

  return childArray;
};
/**
 * Converts passed argument to array
 * Usually used for transformatin NodeList to simple Array
 * @param {any} elems
 */

var toArray = function toArray(elems) {
  return elems && elems.length !== undefined ? Array.prototype.slice.call(elems) : [elems];
};
/**
 * Adds passed classes to target element
 * @param {Element} elem target element
 * @param {string} className string where classess must be separeted with space
 */

var addClass = function addClass(elem, className) {
  var elems = toArray(elem);
  elems.forEach(function (item) {
    var classList = item.classList;
    classList.add.apply(classList, _toConsumableArray(className.split(/\s/)));
  });
};
/**
 * Removes passed classes from target element
 * @param {Element} elem target element
 * @param {string} className string where classess must be separeted with space
 */

var removeClass = function removeClass(elem, className) {
  var elems = toArray(elem);
  elems.forEach(function (item) {
    var classList = item.classList;
    classList.remove.apply(classList, _toConsumableArray(className.split(/\s/)));
  });
};
/**
 * Checks whether class in target element
 * @param {Element} elem target element
 * @param {string} className target classname
 */

var hasClass = function hasClass(elem, className) {
  var elems = toArray(elem);

  var _elems = _slicedToArray(elems, 1),
      target = _elems[0];

  return !!(target.classList && target.classList.contains(className));
};
/**
 * Makes element visible via style.display = block
 * @param {Element} elem target element
 */

var show = function show(elem) {
  var elems = toArray(elem);
  elems.forEach(function (item) {
    // eslint-disable-next-line no-param-reassign
    item.style.display = 'block';
  });
};
/**
 * Makes element invisible via style.display = none
 * @param {Element} elem target element
 */

var hide = function hide(elem) {
  var elems = toArray(elem);
  elems.forEach(function (item) {
    // eslint-disable-next-line no-param-reassign
    item.style.display = 'none';
  });
};
/**
 * Inlines css styles to target element
 * @param {Element} elem target element
 * @param {string} attr css name
 * @param {string} value css value
 */

var addStyle = function addStyle(elem, attr, value) {
  var elems = toArray(elem);
  elems.forEach(function (item) {
    // eslint-disable-next-line no-param-reassign
    item.style[attr] = value;
  });
};
;// CONCATENATED MODULE: ./locales/index.js
var _require = __nested_webpack_require_447230__(14),
    LOCALES_EQUIVALENTS_MAP = _require.LOCALES_EQUIVALENTS_MAP,
    LANGUAGES = _require.LANGUAGES;

var locales = Object.keys(LANGUAGES).reduce(function (acc, language) {
  var resultLocale = LOCALES_EQUIVALENTS_MAP[language] || language; // eslint-disable-next-line global-require,import/no-dynamic-require

  var dictionary = __nested_webpack_require_447230__(1503)("./".concat(resultLocale, "/messages.json"));

  acc[resultLocale] = dictionary;
  return acc;
}, {});
/* harmony default export */ const locales_0 = (locales);
;// CONCATENATED MODULE: ./src/localization.js
function localization_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { localization_typeof = function _typeof(obj) { return typeof obj; }; } else { localization_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return localization_typeof(obj); }

function localization_slicedToArray(arr, i) { return localization_arrayWithHoles(arr) || localization_iterableToArrayLimit(arr, i) || localization_unsupportedIterableToArray(arr, i) || localization_nonIterableRest(); }

function localization_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 localization_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return localization_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 localization_arrayLikeToArray(o, minLen); }

function localization_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 localization_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 localization_arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }

/* global AdguardSettings */



var localization_require = __nested_webpack_require_447230__(897),
    _require2 = localization_slicedToArray(localization_require, 1),
    BASE_LOCALE = _require2[0].base_locale;
/**
 * Object that manages localizations
 * @returns {{getMessage: Function, translateElement: Function}}
 * @constructor
 */


function Localization() {
  var currentLocale = null;
  var locale; // convert locales keys to lower case

  var supportedLocales = Object.keys(locales_0).reduce(function (acc, key) {
    var lowerCasedKey = key.toLowerCase();
    acc[lowerCasedKey] = locales_0[key];
    return acc;
  }, {});
  /*
   * In Edge, there is undocumented behavior. When you run the script
   * through `executeScript`, the Edge browser blocks access to the
   * `languages` property of the `navigator` object without displaying
   * an error in the console and stopping the processing of the code.
   * When you call `navigator.languages` manually from the console,
   * there is no error and the correct value is returned. Therefore,
   * it is necessary to check `typeof navigator.languages !== 'undefined'`.
   * issue: https://github.com/AdguardTeam/AdguardBrowserExtension/issues/983
   */

  if (typeof AdguardSettings !== 'undefined') {
    // eslint-disable-next-line prefer-destructuring
    locale = AdguardSettings.locale;
  } else if (typeof navigator.languages !== 'undefined') {
    // eslint-disable-next-line prefer-destructuring
    locale = navigator.languages[0];
  } else if (navigator.language) {
    locale = navigator.language;
  } else if (navigator.browserLanguage) {
    locale = navigator.browserLanguage;
  } else {
    locale = BASE_LOCALE;
  }

  if (supportedLocales[locale]) {
    currentLocale = locale;
  } else if (supportedLocales[locale.toLowerCase()]) {
    currentLocale = locale.toLowerCase();
  } else {
    var langSplit = locale.split('-')[0];

    if (supportedLocales[langSplit]) {
      currentLocale = langSplit;
    } else {
      currentLocale = BASE_LOCALE;
    }
  }

  var getMessage = function getMessage(messageId) {
    var message = supportedLocales[currentLocale][messageId];

    if (!message) {
      return localization_typeof(supportedLocales[BASE_LOCALE][messageId]) === 'object' ? supportedLocales[BASE_LOCALE][messageId].message : supportedLocales[BASE_LOCALE][messageId] || '';
    }

    return supportedLocales[currentLocale][messageId].message || supportedLocales[currentLocale][messageId];
  };

  var createElement = function createElement(tagName, attributes) {
    var el = src_protectedApi.createElement(tagName);

    if (!attributes) {
      return el;
    }

    var attrs = attributes.split(/([a-z]+='[^']+')/);

    for (var i = 0; i < attrs.length; i += 1) {
      var attr = attrs[i].trim();

      if (!attr) {
        // eslint-disable-next-line no-continue
        continue;
      }

      var index = attr.indexOf('=');
      var attrName = void 0;
      var attrValue = void 0;

      if (index > 0) {
        attrName = attr.substring(0, index);
        attrValue = attr.substring(index + 2, attr.length - 1);
      }

      if (attrName && attrValue) {
        el.setAttribute(attrName, attrValue);
      }
    }

    return el;
  };

  var processString = function processString(str, element) {
    var el;
    var match1 = /^([^]*?)<(a|strong|span|i)([^>]*)>(.*?)<\/\2>([^]*)$/m.exec(str);
    var match2 = /^([^]*?)<(br|input)([^>]*)\/?>([^]*)$/m.exec(str);

    if (match1) {
      processString(match1[1], element);
      el = createElement(match1[2], match1[3]);
      processString(match1[4], el);
      element.appendChild(el);
      processString(match1[5], element);
    } else if (match2) {
      processString(match2[1], element);
      el = createElement(match2[2], match2[3]);
      element.appendChild(el);
      processString(match2[4], element);
    } else {
      element.appendChild(document.createTextNode(str.replace(/&nbsp;/g, "\xA0")));
    }
  };

  var translateElement = function translateElement(element, message) {
    try {
      while (element.lastChild) {
        element.removeChild(element.lastChild);
      }

      processString(message, element);
    } catch (ex) {// Ignore exceptions
    }
  };

  return {
    getMessage: getMessage,
    translateElement: translateElement
  };
}

var localization = new Localization();
/* harmony default export */ const src_localization = (localization);
;// CONCATENATED MODULE: ./src/controllers/mainMenuController.js








/**
 * Main menu controller
 * @param iframe
 * @returns {{init: init}}
 * @constructor
 */

function DetailedMenuController(iframe) {
  var contentDocument = null;
  var iframeCtrl = iframe;
  var domain = null;
  var FILTERING_STATE_LS_PROPERTY = '__adfstate';
  var CONFIDENCE_LEVEL = {
    ZERO: {
      from: 0,
      to: 5
    },
    ONE: {
      from: 6,
      to: 11
    },
    TWO: {
      from: 12,
      to: 22
    },
    THREE: {
      from: 23,
      to: 33
    },
    FOUR: {
      from: 34,
      to: 44
    },
    FIVE: {
      from: 45,
      to: Infinity
    }
  };

  var setDomain = function setDomain() {
    domain = decodeURIComponent(window.location.hostname);
    contentDocument.getElementsByClassName('menu-head_name')[0].textContent = domain || 'unknown';
  };

  var truncateDecimals = function truncateDecimals(number) {
    return Math[number < 0 ? 'ceil' : 'floor'](number);
  };

  var getWotReputationSettings = function getWotReputationSettings(wotData) {
    if (!wotData) {
      return null;
    }

    var prefix = 'adg-wot-';
    var averageWot = wotData.reputation;
    var wotRatingText = null;
    var wotRating = null;

    if (averageWot === 0) {
      wotRatingText = src_localization.getMessage('wot_unknown_description');
      wotRating = "".concat(prefix, "unknown");
      return {
        text: wotRatingText,
        "class": wotRating
      };
    }

    var wotSettings = {
      0: {
        color: 'red',
        string: src_localization.getMessage('wot_bad_description')
      },
      1: {
        color: 'lightRed',
        string: src_localization.getMessage('wot_poor_description')
      },
      2: {
        color: 'yellow',
        string: src_localization.getMessage('wot_unsatisfactory_description')
      },
      3: {
        color: 'lightGreen',
        string: src_localization.getMessage('wot_good_description')
      },
      4: {
        color: 'green',
        string: src_localization.getMessage('wot_excellent_description')
      },
      5: {
        color: 'green',
        string: src_localization.getMessage('wot_excellent_description')
      }
    };
    var current = wotSettings[truncateDecimals(averageWot / 20)];
    wotRatingText = current.string;
    wotRating = prefix + current.color;
    return {
      text: wotRatingText,
      "class": wotRating
    };
  };

  var getWotConfidenceClass = function getWotConfidenceClass(wotData) {
    if (!wotData) {
      return null;
    }

    var prefix = 'adg-wot-confidence-';

    var isThisLevel = function isThisLevel(num, level) {
      return num >= level.from && num <= level.to;
    };

    var confidenceWot = wotData.confidence;

    if (isThisLevel(confidenceWot, CONFIDENCE_LEVEL.ZERO)) {
      return "".concat(prefix, "0");
    }

    if (isThisLevel(confidenceWot, CONFIDENCE_LEVEL.ONE)) {
      return "".concat(prefix, "1");
    }

    if (isThisLevel(confidenceWot, CONFIDENCE_LEVEL.TWO)) {
      return "".concat(prefix, "2");
    }

    if (isThisLevel(confidenceWot, CONFIDENCE_LEVEL.THREE)) {
      return "".concat(prefix, "3");
    }

    if (isThisLevel(confidenceWot, CONFIDENCE_LEVEL.FOUR)) {
      return "".concat(prefix, "4");
    }

    if (isThisLevel(confidenceWot, CONFIDENCE_LEVEL.FIVE)) {
      return "".concat(prefix, "5");
    }

    return undefined;
  };

  var setWotData = function setWotData() {
    var wotData = src_wot.getWotData();
    var wotReputationSettings = getWotReputationSettings(wotData);

    if (!wotReputationSettings) {
      return;
    }

    var wotIndication = contentDocument.querySelector('#WotIndication');
    addClass(wotIndication, wotReputationSettings["class"]);
    wotIndication.dataset.title = src_localization.getMessage('menu_wot_reputation_indicator');
    var wotDescriptionText = contentDocument.querySelector('#WotDescriptionText');
    var wotLogo = '<span id="WotLogo"><span class="wot-logo"></span></span>';
    wotDescriptionText.innerHTML = wotReputationSettings.text.replace('$1', wotLogo);
    var confidenceIndication = contentDocument.querySelector('#ConfidenceIndication');
    var wotConfidenceClass = getWotConfidenceClass(wotData);
    addClass(confidenceIndication, wotConfidenceClass);
    wotIndication.dataset.title = src_localization.getMessage('menu_wot_reputation_confidence_level');
    var wotLinkElem = contentDocument.querySelector('.wot-indicator');
    wotLinkElem.href = src_wot.getWotScorecardUrl(domain);
    removeClass(contentDocument.querySelectorAll('.wot-hide'), 'wot-hide');
  };

  var startAdSelector = function startAdSelector() {
    iframeCtrl.showSelectorMenu();
  };

  var goToWotUrl = function goToWotUrl() {
    window.open(src_wot.WOT_URL, '_blank');
  };

  var doNotBlock = function doNotBlock() {
    gm.ADG_temporaryDontBlock(30, function () {
      reloadPageBypassCache();
    });
  };

  var reportAbuse = function reportAbuse() {
    gm.ADG_sendAbuse(function () {
      iframeCtrl.removeIframe();
    });
  };

  var goToSiteReport = function goToSiteReport() {
    var url = src_settings.Constants.REPORT_URL.replace('{0}', domain);
    window.open(url, '_blank');
  };

  var showHideBlockAdButton = function showHideBlockAdButton(isFilter) {
    var blockAd = contentDocument.querySelector('#block-ad');

    if (isFilter) {
      removeClass(blockAd, 'hidden');
    } else {
      addClass(blockAd, 'hidden');
    }

    iframeCtrl.resizeIframe();
  };
  /**
   * Storing the filtering state for quick initialization
   *
   * @param {Boolean} state  on/off filtering state
   */
  // eslint-disable-next-line consistent-return


  var setFilteringStateToStore = function setFilteringStateToStore(state) {
    try {
      localStorage.setItem(FILTERING_STATE_LS_PROPERTY, src_protectedApi.json.stringify({
        state: state
      }));
    } catch (ex) {
      src_log.error(ex);
      return null;
    }
  };

  var onIsFilterChange = function onIsFilterChange() {
    var isFilter = contentDocument.getElementById('is-filter').checked; // animate class for prevent animation while the state from the application is determined

    addClass(contentDocument.querySelectorAll('.menu-filter_label'), 'animate');
    showHideBlockAdButton(isFilter);
    setFilteringStateToStore(isFilter);
    gm.ADG_changeFilteringState(isFilter, function () {
      reloadPageBypassCache();
    });
  };

  var bindEvents = function bindEvents() {
    var menuEvents = {
      '.close': iframeCtrl.removeIframe,
      '#block-ad': startAdSelector,
      '#assistant-settings': iframeCtrl.showSettingsMenu,
      '#WotLogo': goToWotUrl,
      '#do-not-block-30-sec': doNotBlock,
      '#report-abuse': reportAbuse,
      '#site-report': goToSiteReport,
      '#is-filter': onIsFilterChange
    };
    Object.keys(menuEvents).forEach(function (item) {
      var elems = contentDocument.querySelectorAll(item);
      toArray(elems).forEach(function (elem) {
        return elem.addEventListener('click', menuEvents[item]);
      });
    });
  };
  /**
   * Getting the filtering state for quick initialization from the localStorage,
   * while the state from the application is determined
   *
   * @returns {Boolean} on/off filtering state
   */


  var getFilteringStateFromStore = function getFilteringStateFromStore() {
    try {
      var state = localStorage.getItem(FILTERING_STATE_LS_PROPERTY);

      if (state) {
        return src_protectedApi.json.parse(state).state;
      }

      return false;
    } catch (ex) {
      src_log.error(ex);
      return false;
    }
  };

  var setInitFilteringState = function setInitFilteringState() {
    var input = contentDocument.getElementById('is-filter');
    input.checked = getFilteringStateFromStore();
    gm.ADG_isFiltered(function (isFiltered) {
      input.checked = isFiltered;
      setFilteringStateToStore(isFiltered);
      showHideBlockAdButton(isFiltered);
    });
  };
  /*
   Called from IframeController._showMenuItem to initialize view
   */
  // eslint-disable-next-line no-shadow


  var init = function init(iframe) {
    // eslint-disable-next-line prefer-destructuring
    contentDocument = iframe.contentDocument;
    setDomain();
    setWotData();
    bindEvents();
    setInitFilteringState();
  };

  return {
    init: init
  };
}
;// CONCATENATED MODULE: ./src/adguard-selector.js
function adguard_selector_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { adguard_selector_typeof = function _typeof(obj) { return typeof obj; }; } else { adguard_selector_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return adguard_selector_typeof(obj); }

/* eslint-disable no-param-reassign, func-names */


/**
 * Adguard selector
 * @type {Function}
 */

function AdguardSelector() {
  var api = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  var PLACEHOLDER_PREFIX = 'adguard-placeholder';
  var placeholdedElements = null;
  var transparentPlaceholdedElement = null;
  var restrictedElements = null;
  var SELECTED_CLASS = 'adguard_sg_selected';
  var REJECTED_CLASS = 'adguard_sg_rejected';
  var IGNORED_CLASS = 'adguard_sg_ignore';
  var unbound = true;
  var onElementSelectedHandler = null;
  var ignoreTouchEvent = 0;
  var selectionRenderer; // PRIVATE METHODS

  var removeClassName = function removeClassName(className) {
    var elem = document.querySelectorAll(".".concat(className));
    removeClass(elem, className);
  };

  var firstSelectedOrSuggestedParent = function firstSelectedOrSuggestedParent(element) {
    if (hasClass(element, SELECTED_CLASS)) {
      return element;
    } // eslint-disable-next-line no-cond-assign, no-param-reassign


    while (element.parentNode && (element = element.parentNode)) {
      if (restrictedElements.indexOf(element) === -1) {
        if (hasClass(element, SELECTED_CLASS)) {
          return element;
        }
      }
    }

    return null;
  };

  var px = function px(p) {
    return "".concat(p, "px");
  };

  var getTagPath = function getTagPath(element) {
    if (element.parentNode) {
      return "".concat(element.parentNode.tagName.toLowerCase(), " ").concat(element.tagName.toLowerCase());
    }

    return element.tagName.toLowerCase();
  };
  /** ******** Events ************** */


  var sgMouseoverHandler = function sgMouseoverHandler(e) {
    e.stopPropagation();

    if (unbound) {
      return true;
    }

    if (this === document.documentElement || this === document.documentElement.parentNode) {
      return false;
    }

    var parent = firstSelectedOrSuggestedParent(this);

    if (parent !== null && parent !== this) {
      selectionRenderer.add(parent);
    } else {
      selectionRenderer.add(this);
    }

    return false;
  }; // e.isTrusted checking for prevent programmatically events
  // see: https://github.com/AdguardTeam/AdguardAssistant/issues/134


  var sgMousedownHandler = function sgMousedownHandler(e) {
    if (e && e.isTrusted === false) {
      return false;
    }

    if (hasClass(e.target, IGNORED_CLASS)) {
      return false;
    }

    e.preventDefault();
    e.stopImmediatePropagation();

    if (unbound) {
      return true;
    }

    var elem = e.target;
    var borders = elem === selectionRenderer.borderTop || elem === selectionRenderer.borderLeft || elem === selectionRenderer.borderRight || elem === selectionRenderer.borderBottom;

    if (borders) {
      // Clicked on one of our floating borders, target the element that we are bordering.
      elem = elem.target_elem || elem;
    }

    if (elem === document.documentElement || elem === document.documentElement.parentNode) {
      return undefined;
    }

    selectionRenderer.remove();
    onElementSelectedHandler(elem);
    return false;
  };
  /** ******** Touch event handlers ************** */


  var touchElementSelectHandler = function touchElementSelectHandler(e) {
    e.preventDefault();
    e.stopImmediatePropagation();
    sgMouseoverHandler.call(this, e);
    sgMousedownHandler.call(this, e);
  };

  var removeElementToPreventEvents = function removeElementToPreventEvents() {
    if (!transparentPlaceholdedElement) {
      return false;
    }

    transparentPlaceholdedElement.removeEventListener('click', touchElementSelectHandler);
    transparentPlaceholdedElement.removeEventListener('touchstart', touchElementSelectHandler);
    transparentPlaceholdedElement.removeEventListener('pointerdown', touchElementSelectHandler);
    transparentPlaceholdedElement.parentNode.removeChild(transparentPlaceholdedElement);
    transparentPlaceholdedElement = null;
    return undefined;
  };

  var clearSelected = function clearSelected() {
    removeElementToPreventEvents();
    removeClassName(SELECTED_CLASS);
    removeClassName(REJECTED_CLASS);
    selectionRenderer.remove();
  };
  /**
   * Returns element offset coordinates extended with width and height values.
   *
   * @param elem
   * @returns {{top: number, left: number, outerWidth: number, outerHeight: number}}
   */


  var getOffsetExtended = function getOffsetExtended(elem) {
    var bodyRect = document.documentElement.getBoundingClientRect();
    var elemRect = elem.getBoundingClientRect();
    var rectTop = elemRect.top - bodyRect.top;
    var rectLeft = elemRect.left - bodyRect.left;
    return {
      top: rectTop,
      left: rectLeft,
      outerWidth: elem.offsetWidth,
      outerHeight: elem.offsetHeight
    };
  };
  /**
   * Adds borders to selected element.
   *
   * Default implementation of selection renderer.
   * Can be overwritten with custom implementation as a parameter of init function.
   *
   * @param element
   * @private
   */
  // eslint-disable-next-line no-shadow


  var BorderSelectionRenderer = function (api) {
    var BORDER_WIDTH = 5;
    var BORDER_PADDING = 2;
    var BORDER_CSS = {
      position: 'absolute',
      background: 'white',
      margin: '0px',
      padding: '0px',
      display: 'block',
      "float": 'none',
      border: '0',
      outline: '0',
      'background-color': '#13a35e',
      'font-style': 'normal',
      'vertical-align': 'baseline',
      'text-align': 'left',
      'line-height': '12px',
      'box-sizing': 'content-box',
      'min-height': 'auto',
      'max-height': 'auto',
      'min-width': 'auto',
      'max-width': 'auto',
      width: 0,
      height: 0,
      'z-index': 2147483646,
      'border-radius': 0
    };
    var BORDER_BOTTOM_CSS = {
      'font-size': '10px',
      'font-weight': 'bold',
      color: 'white',
      padding: '2px 0px 2px 5px',
      overflow: 'hidden'
    };
    var borderTop = null;
    var borderLeft = null;
    var borderRight = null;
    var borderBottom = null;

    var showBorders = function showBorders() {
      if (borderTop && borderBottom && borderLeft && borderRight) {
        show(borderTop);
        show(borderBottom);
        show(borderLeft);
        show(borderRight);
      }
    };

    var addBorderToDom = function addBorderToDom() {
      document.documentElement.appendChild(borderTop);
      document.documentElement.appendChild(borderBottom);
      document.documentElement.appendChild(borderLeft);
      document.documentElement.appendChild(borderRight);
    };

    var addBorderCSS = function addBorderCSS() {
      Object.keys(BORDER_CSS).forEach(function (item) {
        borderTop.style[item] = BORDER_CSS[item];
        borderBottom.style[item] = BORDER_CSS[item];
        borderLeft.style[item] = BORDER_CSS[item];
        borderRight.style[item] = BORDER_CSS[item];
      });
      Object.keys(BORDER_BOTTOM_CSS).forEach(function (item) {
        borderBottom.style[item] = BORDER_BOTTOM_CSS[item];
      });
    };

    var removeBorderFromDom = function removeBorderFromDom() {
      if (borderTop) {
        var parent = borderTop.parentNode;

        if (parent) {
          parent.removeChild(borderTop);
          parent.removeChild(borderBottom);
          parent.removeChild(borderLeft);
          parent.removeChild(borderRight);
        }
      }

      borderTop = null;
      borderBottom = null;
      borderRight = null;
      borderLeft = null;
    };
    /**
     * Preparing renderer.
     */


    api.init = function () {
      if (!borderTop) {
        var width = px(BORDER_WIDTH);
        var bottomHeight = px(BORDER_WIDTH + 6);
        borderTop = src_protectedApi.createElement('div');
        borderBottom = src_protectedApi.createElement('div');
        borderLeft = src_protectedApi.createElement('div');
        borderRight = src_protectedApi.createElement('div');
        borderTop.addEventListener('click', sgMousedownHandler);
        borderBottom.addEventListener('click', sgMousedownHandler);
        borderLeft.addEventListener('click', sgMousedownHandler);
        borderRight.addEventListener('click', sgMousedownHandler);
        addStyle(borderTop, 'height', width);
        addStyle(borderBottom, 'height', bottomHeight);
        addStyle(borderLeft, 'width', width);
        addStyle(borderRight, 'width', width);
        hide(borderTop);
        hide(borderBottom);
        hide(borderLeft);
        hide(borderRight); // eslint-disable-next-line prefer-destructuring

        api.borderTop = borderTop; // eslint-disable-next-line prefer-destructuring

        api.borderBottom = borderBottom; // eslint-disable-next-line prefer-destructuring

        api.borderLeft = borderLeft; // eslint-disable-next-line prefer-destructuring

        api.borderRight = borderRight;
        addBorderCSS();
        addBorderToDom();
      }
    };
    /**
     * Clearing DOM and so on.
     */


    api.finalize = function () {
      removeBorderFromDom();
    };
    /**
     * Adds borders to specified element
     *
     * @param element
     */


    api.add = function (element) {
      api.remove();

      if (!element) {
        return;
      }

      var p = getOffsetExtended(element);
      var top = p.top;
      var left = p.left;
      var width = p.outerWidth;
      var height = p.outerHeight;
      addStyle(borderTop, 'width', px(width + BORDER_PADDING * 2 + BORDER_WIDTH * 2));
      addStyle(borderTop, 'height', px(5));
      addStyle(borderTop, 'top', px(top - BORDER_WIDTH - BORDER_PADDING));
      addStyle(borderTop, 'left', px(left - BORDER_PADDING - BORDER_WIDTH));
      addStyle(borderBottom, 'width', px(width + BORDER_PADDING * 2 + BORDER_WIDTH));
      addStyle(borderBottom, 'height', px(12));
      addStyle(borderBottom, 'top', px(top + height + BORDER_PADDING));
      addStyle(borderBottom, 'left', px(left - BORDER_PADDING - BORDER_WIDTH));
      addStyle(borderLeft, 'height', px(height + BORDER_PADDING * 2));
      addStyle(borderLeft, 'width', px(5));
      addStyle(borderLeft, 'top', px(top - BORDER_PADDING));
      addStyle(borderLeft, 'left', px(left - BORDER_PADDING - BORDER_WIDTH));
      addStyle(borderRight, 'height', px(height + BORDER_PADDING * 2));
      addStyle(borderRight, 'width', px(5));
      addStyle(borderRight, 'top', px(top - BORDER_PADDING));
      addStyle(borderRight, 'left', px(left + width + BORDER_PADDING));
      borderBottom.textContent = getTagPath(element);
      borderRight.target_elem = element;
      borderLeft.target_elem = element;
      borderTop.target_elem = element;
      borderBottom.target_elem = element;
      showBorders();
    };
    /**
     * Removes borders
     */


    api.remove = function () {
      if (borderTop && borderBottom && borderLeft && borderRight) {
        hide(borderTop);
        hide(borderBottom);
        hide(borderLeft);
        hide(borderRight);
      }
    };

    return api; // eslint-disable-next-line no-use-before-define
  }(BorderSelectionRenderer || {});

  var linkHelper = src_protectedApi.createElement('a');

  var getHost = function getHost(url) {
    if (!url) {
      return '';
    }

    linkHelper.href = url;
    return linkHelper.hostname;
  };

  var makePlaceholderImage = function makePlaceholderImage(element) {
    var placeHolder = src_protectedApi.createElement('div');
    var style = window.getComputedStyle(element);
    placeHolder.style.height = style.height;
    placeHolder.style.width = style.width;
    placeHolder.style.position = style.position;
    placeHolder.style.top = style.top;
    placeHolder.style.bottom = style.bottom;
    placeHolder.style.left = style.left;
    placeHolder.style.right = style.right;
    placeHolder.className += "".concat(PLACEHOLDER_PREFIX, " ").concat(IGNORED_CLASS);
    var icon = src_protectedApi.createElement('div');
    icon.className += "".concat(PLACEHOLDER_PREFIX, "-icon ").concat(IGNORED_CLASS);
    var domain = src_protectedApi.createElement('div');
    domain.textContent = getHost(element.src);
    domain.className += "".concat(PLACEHOLDER_PREFIX, "-domain ").concat(IGNORED_CLASS);
    icon.appendChild(domain);
    placeHolder.appendChild(icon);
    return placeHolder;
  };

  var removePlaceholders = function removePlaceholders() {
    removeElementToPreventEvents();

    if (!placeholdedElements) {
      return;
    }

    var elements = placeholdedElements;

    for (var i = 0; i < elements.length; i += 1) {
      var current = elements[i];
      var id = PLACEHOLDER_PREFIX + i;
      var placeHolder = document.querySelector("#".concat(id));

      if (placeHolder) {
        var parent = placeHolder.parentNode;

        if (parent) {
          parent.replaceChild(current, placeHolder);
        }
      }
    }

    placeholdedElements = null;
  };

  var placeholderClick = function placeholderClick(element) {
    selectionRenderer.remove();
    removePlaceholders();
    onElementSelectedHandler(element);
  };
  /**
   * Making top level transparent layer to prevented events on emerging ad.
   * see: https://github.com/AdguardTeam/AdguardAssistant/issues/220
   *
   * @param element element where ad is added
   */


  var preventEvents = function preventEvents(element) {
    var placeHolder = src_protectedApi.createElement('div');
    var style = getOffsetExtended(element);
    placeHolder.style.height = px(style.outerHeight);
    placeHolder.style.width = px(style.outerWidth);
    placeHolder.style.top = px(style.top);
    placeHolder.style.left = px(style.left);
    placeHolder.style.background = 'transparent';
    placeHolder.style.position = 'absolute';
    placeHolder.style['pointer-events'] = 'all';
    placeHolder.style['box-sizing'] = 'content-box';
    placeHolder.style['z-index'] = '2147483646';
    placeHolder.className += IGNORED_CLASS;
    transparentPlaceholdedElement = placeHolder;
    placeHolder.addEventListener('click', touchElementSelectHandler);
    placeHolder.addEventListener('touchstart', touchElementSelectHandler);
    placeHolder.addEventListener('pointerdown', touchElementSelectHandler);
    document.documentElement.appendChild(placeHolder);
  };

  var gestureEndHandler = function gestureEndHandler() {
    ignoreTouchEvent = 2;
    return true;
  };

  var touchMoveHandler = function touchMoveHandler() {
    ignoreTouchEvent = 1;
    return true;
  };

  var needIgnoreTouchEvent = function needIgnoreTouchEvent() {
    if (ignoreTouchEvent > 0) {
      ignoreTouchEvent -= 1;
      return true;
    }

    return false;
  };

  var makeIFrameAndEmbeddedSelector = function makeIFrameAndEmbeddedSelector() {
    placeholdedElements = document.querySelectorAll("iframe:not(.".concat(IGNORED_CLASS, "),embed,object"));
    toArray(placeholdedElements).filter(function (elem) {
      var isVisible = elem.style.display !== 'none';
      var isHaveSize = elem.offsetWidth !== 0 && elem.offsetHeight !== 0;
      return isVisible && isHaveSize;
    });
    var elements = placeholdedElements;

    var _loop = function _loop(i) {
      var current = elements[i]; // eslint-disable-next-line no-shadow

      (function (current) {
        var placeHolder = makePlaceholderImage(current);
        var id = PLACEHOLDER_PREFIX + i;
        placeHolder.setAttribute('id', id);
        var parent = current.parentNode;

        if (parent) {
          parent.replaceChild(placeHolder, current);
          placeHolder.addEventListener('gestureend', gestureEndHandler);
          placeHolder.addEventListener('touchmove', touchMoveHandler); // eslint-disable-next-line consistent-return

          placeHolder.addEventListener('touchend', function (e) {
            e.preventDefault();

            if (needIgnoreTouchEvent()) {
              return true;
            }

            placeholderClick(current);
          });
          var elems = document.querySelectorAll("#".concat(id));
          toArray(elems).forEach(function (elem) {
            elem.addEventListener('click', function (e) {
              e.preventDefault();
              placeholderClick(current);
            });
          });
        }
      })(current);
    };

    for (var i = 0; i < elements.length; i += 1) {
      _loop(i);
    }
  };

  var sgMouseoutHandler = function sgMouseoutHandler() {
    if (unbound) {
      return true;
    }

    if (this === document.documentElement || this === document.documentElement.parentNode) {
      return false;
    }

    selectionRenderer.remove();
    return false;
  };

  var elementTouchendHandler = function elementTouchendHandler(e) {
    if (hasClass(e.target, IGNORED_CLASS)) {
      return false;
    }

    e.stopPropagation();

    if (needIgnoreTouchEvent()) {
      return true;
    }

    touchElementSelectHandler.call(this, e);
    return false;
  };

  var emptyEventHandler = function emptyEventHandler(e) {
    e.stopPropagation();
    return false;
  };

  var setupEventHandlers = function setupEventHandlers() {
    makeIFrameAndEmbeddedSelector();
    var elements = document.querySelectorAll("body *:not(.".concat(IGNORED_CLASS, ")"));
    toArray(elements).forEach(function (el) {
      el.addEventListener('gestureend', gestureEndHandler);
      el.addEventListener('touchmove', touchMoveHandler);
      el.addEventListener('touchend', elementTouchendHandler, true);
      el.addEventListener('touchstart', emptyEventHandler);
      el.addEventListener('mouseover', sgMouseoverHandler);
      el.addEventListener('mouseout', sgMouseoutHandler);
      el.addEventListener('click', sgMousedownHandler, true);
    });
  };

  var deleteEventHandlers = function deleteEventHandlers() {
    removePlaceholders();
    var elements = document.querySelectorAll('body *');
    toArray(elements).forEach(function (el) {
      el.removeEventListener('gestureend', gestureEndHandler);
      el.removeEventListener('touchmove', touchMoveHandler);
      el.removeEventListener('touchend', elementTouchendHandler, true);
      el.removeEventListener('touchstart', emptyEventHandler);
      el.removeEventListener('mouseover', sgMouseoverHandler);
      el.removeEventListener('mouseout', sgMouseoutHandler);
      el.removeEventListener('click', sgMousedownHandler, true);
    });
  }; // Define default implementation of selection renderer.


  selectionRenderer = BorderSelectionRenderer; // PUBLIC API

  /**
   * Starts selector module.
   *
   * @param onElementSelected callback function
   * @param selectionRenderImpl optional object contains selection presentation implementation
   */

  api.init = function (onElementSelected, selectionRenderImpl) {
    onElementSelectedHandler = onElementSelected;

    if (selectionRenderImpl && adguard_selector_typeof(selectionRenderImpl) === 'object') {
      selectionRenderer = selectionRenderImpl;
    }

    restrictedElements = ['html', 'body', 'head', 'base'].map(function (selector) {
      return document.querySelector(selector);
    });
    selectionRenderer.init();
    setupEventHandlers();
    unbound = false;
  };
  /**
   * Resets state of selector.
   * Clears current selection.
   */


  api.reset = function () {
    clearSelected();
  };
  /**
   * Destroys selector module.
   * Removes all selector elements and unbinds event handlers.
   */


  api.close = function () {
    unbound = true;
    selectionRenderer.finalize();
    deleteEventHandlers();
  };
  /**
   * Selects specified element.
   * Marks element as selected and holds selection on it.
   *
   * @param element
   */


  api.selectElement = function (element) {
    selectionRenderer.add(element);
    removePlaceholders();
    unbound = true;
    preventEvents(element);
  };
  /**
   Returns css class name.
   If this class assigns to HTML element, then Adguard Selector ignores it.
   */
  // eslint-disable-next-line func-names


  api.ignoreClassName = function () {
    return IGNORED_CLASS;
  };

  return api;
}

var adguard_selector_selector = new AdguardSelector();
/* harmony default export */ const adguard_selector = (adguard_selector_selector);
;// CONCATENATED MODULE: ./src/controllers/selectorMenuController.js


/**
 * Selector menu controller
 * @returns {{init: init}}
 * @constructor
 */

function SelectorMenuController(iframe) {
  var contentDocument = null;
  var iframeCtrl = iframe;

  var close = function close() {
    iframeCtrl.removeIframe();
  };

  var bindEvents = function bindEvents() {
    var menuEvents = {
      '.close': close,
      '.btn-default': close
    };
    Object.keys(menuEvents).forEach(function (item) {
      var elems = contentDocument.querySelectorAll(item);
      toArray(elems).forEach(function (elem) {
        return elem.addEventListener('click', menuEvents[item]);
      });
    });
  };

  var onElementSelected = function onElementSelected(element) {
    iframeCtrl.showSliderMenu(element);
  };

  var startSelector = function startSelector() {
    adguard_selector.reset();
    adguard_selector.init(onElementSelected);
  };
  /*
   Called from IframeController._showMenuItem to initialize view
   */
  // eslint-disable-next-line no-shadow


  var init = function init(iframe) {
    // eslint-disable-next-line prefer-destructuring
    contentDocument = iframe.contentDocument;
    bindEvents();
    startSelector();
  };

  iframeCtrl.onCloseMenu.attach(adguard_selector.close);
  return {
    init: init,
    startSelector: startSelector
  };
}
;// CONCATENATED MODULE: ./src/slider-widget.js


var BASIC_GREEN_COLOR = '#36BA53';
var DARK_GREEN_COLOR = '#4D995F';
var TICK_RIGHT_COLOR = '#E0DFDB';
/**
 * Slider widget
 * @type {Function}
 */

function SliderWidget() {
  var api = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  var PLACEHOLDER_CLASS = 'adg-slide ui-slider ui-slider-horizontal ui-widget ui-widget-content ui-corner-all';
  var HANDLE_CLASS = 'ui-slider-handle';
  var HANDLE_FULL_CLASS = 'ui-slider-handle ui-state-default ui-corner-all';
  var TICK_CLASS = 'tick';
  var TICK_FULL_CLASS = 'tick ui-widget-content';
  var tickLeftColor = BASIC_GREEN_COLOR;
  var placeholder = null;
  var min = 0;
  var max = 1;
  var value = 0;
  var sliderArea = null;
  var onValueChanged = null;

  if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
    tickLeftColor = DARK_GREEN_COLOR;
  }

  var refresh = function refresh() {
    var handle = placeholder.querySelectorAll(".".concat(HANDLE_CLASS));
    addStyle(handle, 'left', "".concat((value - 1) * 100 / (max - min), "%"));
    var ticks = placeholder.querySelectorAll(".".concat(TICK_CLASS));

    for (var i = 0; i < ticks.length; i += 1) {
      if (i + 1 < value) {
        addStyle(ticks[i], 'background-color', tickLeftColor);
      } else {
        addStyle(ticks[i], 'background-color', TICK_RIGHT_COLOR);
      }
    }
  };

  var render = function render() {
    addClass(placeholder, PLACEHOLDER_CLASS);
    var handle = src_protectedApi.createElement('span');
    handle.setAttribute('class', HANDLE_FULL_CLASS);
    placeholder.appendChild(handle);
    var count = max - min;

    var prepare = function prepare(i) {
      var tick = src_protectedApi.createElement('div');
      tick.setAttribute('class', TICK_FULL_CLASS);
      tick.style.left = "".concat(100 / count * i, "%");
      tick.style.width = "".concat(100 / count, "%");
      placeholder.appendChild(tick);
    };

    for (var i = 0; i < count; i += 1) {
      prepare(i);
    }

    refresh();
  };

  var setValue = function setValue(v) {
    if (v < min) {
      value = min;
    } else if (v > max) {
      value = max;
    } else {
      value = v;
    }

    refresh();
    onValueChanged(value);
  };

  var bindEvents = function bindEvents() {
    var rect = placeholder.getBoundingClientRect();
    var sliderWidth = rect.width;
    var offsetLeft = rect.left + document.body.scrollLeft;

    var getSliderValue = function getSliderValue(pageX) {
      return Math.round((max - min) / sliderWidth * (pageX - offsetLeft) + min);
    };

    var onMouseMove = function onMouseMove(e) {
      // calculate the correct position of the slider set the value
      var val = getSliderValue(e.pageX);
      setValue(val);
    };

    var onClick = function onClick(e) {
      // calculate the correct position of the slider set the value
      var val = getSliderValue(e.pageX);
      setValue(val);
    };

    var onMouseDown = function onMouseDown(e) {
      e.stopPropagation();
      e.preventDefault();
      e.cancelBubble = true;
      e.returnValue = false;
      sliderArea.addEventListener('mousemove', onMouseMove);
      sliderArea.addEventListener('touchmove', onMouseMove);
      sliderArea.addEventListener('pointermove', onMouseMove);
    };

    var sliderAreaRemoveListeners = function sliderAreaRemoveListeners() {
      sliderArea.removeEventListener('mousemove', onMouseMove);
      sliderArea.removeEventListener('touchmove', onMouseMove);
      sliderArea.removeEventListener('pointermove', onMouseMove);
    };

    document.addEventListener('mouseup', sliderAreaRemoveListeners);
    document.addEventListener('touchend', sliderAreaRemoveListeners);
    document.addEventListener('pointerup', sliderAreaRemoveListeners);
    placeholder.addEventListener('click', onClick);
    placeholder.addEventListener('mousedown', onMouseDown);
    placeholder.addEventListener('touchstart', onMouseDown);
    sliderArea.addEventListener('mouseup', sliderAreaRemoveListeners);
    sliderArea.addEventListener('touchend', sliderAreaRemoveListeners);
    sliderArea.addEventListener('pointerup', sliderAreaRemoveListeners);
    sliderArea.addEventListener('mouseleave', sliderAreaRemoveListeners);
  };
  /**
   * @param placeholderElement
   * @param options
   */
  // eslint-disable-next-line no-param-reassign


  api.init = function (placeholderElement, options) {
    placeholder = placeholderElement; // eslint-disable-next-line prefer-destructuring

    min = options.min; // eslint-disable-next-line prefer-destructuring

    max = options.max; // eslint-disable-next-line prefer-destructuring

    value = options.value; // eslint-disable-next-line prefer-destructuring

    onValueChanged = options.onValueChanged; // eslint-disable-next-line prefer-destructuring

    sliderArea = options.sliderArea;
    render();
    bindEvents();
  };

  return api;
}

var sliderWidget = new SliderWidget();
/* harmony default export */ const slider_widget = (sliderWidget);
;// CONCATENATED MODULE: ./src/libs/css.escape.js
/*! https://mths.be/cssescape v1.5.1 by @mathias | MIT license */
// https://drafts.csswg.org/cssom/#serialize-an-identifier
function cssEscape(value) {
  if (arguments.length === 0) {
    throw new TypeError('`CSS.escape` requires an argument.');
  }

  var string = String(value);
  var length = string.length;
  var index = -1;
  var codeUnit;
  var result = '';
  var firstCodeUnit = string.charCodeAt(0); // eslint-disable-next-line no-plusplus

  while (++index < length) {
    codeUnit = string.charCodeAt(index); // Note: there’s no need to special-case astral symbols, surrogate
    // pairs, or lone surrogates.
    // If the character is NULL (U+0000), then the REPLACEMENT CHARACTER
    // (U+FFFD).

    if (codeUnit === 0x0000) {
      result += "\uFFFD"; // eslint-disable-next-line no-continue

      continue;
    }

    if ( // If the character is in the range [\1-\1F] (U+0001 to U+001F) or is
    // U+007F, […]
    // eslint-disable-next-line eqeqeq
    codeUnit >= 0x0001 && codeUnit <= 0x001F || codeUnit == 0x007F // If the character is the first character and is in the range [0-9]
    // (U+0030 to U+0039), […]
    || index === 0 && codeUnit >= 0x0030 && codeUnit <= 0x0039 // If the character is the second character and is in the range [0-9]
    // (U+0030 to U+0039) and the first character is a `-` (U+002D), […]
    || index === 1 && codeUnit >= 0x0030 && codeUnit <= 0x0039 // eslint-disable-next-line eqeqeq
    && firstCodeUnit == 0x002D) {
      // https://drafts.csswg.org/cssom/#escape-a-character-as-code-point
      result += "\\".concat(codeUnit.toString(16), " "); // eslint-disable-next-line no-continue

      continue;
    }

    if ( // If the character is the first character and is a `-` (U+002D), and
    // there is no second character, […]
    index === 0 && length === 1 // eslint-disable-next-line eqeqeq
    && codeUnit == 0x002D) {
      result += "\\".concat(string.charAt(index)); // eslint-disable-next-line no-continue

      continue;
    } // If the character is not handled by one of the above rules and is
    // greater than or equal to U+0080, is `-` (U+002D) or `_` (U+005F), or
    // is in one of the ranges [0-9] (U+0030 to U+0039), [A-Z] (U+0041 to
    // U+005A), or [a-z] (U+0061 to U+007A), […]


    if (codeUnit >= 0x0080 // eslint-disable-next-line eqeqeq
    || codeUnit == 0x002D // eslint-disable-next-line eqeqeq
    || codeUnit == 0x005F || codeUnit >= 0x0030 && codeUnit <= 0x0039 || codeUnit >= 0x0041 && codeUnit <= 0x005A || codeUnit >= 0x0061 && codeUnit <= 0x007A) {
      // the character itself
      result += string.charAt(index); // eslint-disable-next-line no-continue

      continue;
    } // Otherwise, the escaped character.
    // https://drafts.csswg.org/cssom/#escape-a-character


    result += "\\".concat(string.charAt(index));
  }

  return result;
}
;// CONCATENATED MODULE: ./src/adguard-rules-constructor.js


/**
 * Adguard rules constructor
 * @type {Function}
 */

function AdguardRulesConstructorLib() {
  var api = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  var CSS_RULE_MARK = '##';
  var RULE_OPTIONS_MARK = '$';
  var URLBLOCK_ATTRIBUTES = ['src', 'data'];
  var linkHelper = src_protectedApi.createElement('a');
  /**
   * Constructs css selector by combining classes by AND
   * @param classList
   * @returns {string}
   */

  var constructClassCssSelectorByAND = function constructClassCssSelectorByAND(classList) {
    var selectors = [];

    if (classList) {
      for (var i = 0; i < classList.length; i += 1) {
        selectors.push(".".concat(cssEscape(classList[i])));
      }
    }

    return selectors.join('');
  };
  /**
   * Constructs css selector for element using tag name,
   * id and classed, like: tagName#id.class1.class2
   *
   * @param element Element
   * @param classList Override element classes
   * (If classList is null, element classes will be used)
   * @param excludeTagName Omit tag name in selector
   * @param excludeId Omit element id in selector
   * @returns {string}
   */


  var makeDefaultCssFilter = function makeDefaultCssFilter(element, classList, excludeTagName, excludeId) {
    var cssSelector = excludeTagName ? '' : element.tagName.toLowerCase();

    if (element.id && !excludeId) {
      cssSelector += "#".concat(cssEscape(element.id));
    }

    cssSelector += constructClassCssSelectorByAND(classList || element.classList);
    return cssSelector;
  };
  /**
   * Constructs css selector for element using parent elements
   * and nth-child (first-child, last-child) pseudo classes.
   *
   * @param element Element
   * @param options Construct options.
   * For example: {excludeTagName: false, excludeId: false, classList: []}
   * @returns {string}
   */


  var makeCssNthChildFilter = function makeCssNthChildFilter(element, options) {
    // eslint-disable-next-line no-param-reassign
    options = options || {};
    var _options = options,
        classList = _options.classList,
        excludeTagName = _options.excludeTagName,
        excludeId = _options.excludeId;
    var excludeTagNameOverride = ('excludeTagName' in options);
    var excludeIdOverride = ('excludeId' in options);
    var path = [];
    var el = element;

    while (el.parentNode) {
      var nodeName = el && el.nodeName ? el.nodeName.toUpperCase() : '';

      if (nodeName === 'BODY') {
        break;
      }

      if (el.id) {
        /**
         * Be default we don't include tag name and classes
         * to selector for element with id attribute
         */
        var cssSelector = '';

        if (el === element) {
          cssSelector = makeDefaultCssFilter(el, classList || [], excludeTagNameOverride ? excludeTagName : true, excludeIdOverride ? excludeId : false);
        } else {
          cssSelector = makeDefaultCssFilter(el, [], true, false);
        }

        path.unshift(cssSelector);
        break;
      } else {
        var c = 1;

        for (var e = el; e.previousSibling; e = e.previousSibling) {
          if (e.previousSibling.nodeType === 1) {
            c += 1;
          }
        }

        var cldCount = 0;

        for (var i = 0; el.parentNode && i < el.parentNode.childNodes.length; i += 1) {
          cldCount += el.parentNode.childNodes[i].nodeType === 1 ? 1 : 0;
        }

        var ch = void 0;

        if (cldCount === 0 || cldCount === 1) {
          ch = '';
        } else if (c === 1) {
          ch = ':first-child';
        } else if (c === cldCount) {
          ch = ':last-child';
        } else {
          ch = ":nth-child(".concat(c, ")");
        }
        /**
         * By default we include tag name and
         * element classes to selector for element without id attribute
         */


        if (el === element) {
          var p = makeDefaultCssFilter(el, classList, excludeId, excludeTagNameOverride ? excludeTagName : false);
          p += ch;
          path.unshift(p);
        } else {
          path.unshift(makeDefaultCssFilter(el, el.classList, false, false) + ch);
        }

        el = el.parentNode;
      }
    }

    return path.join(' > ');
  };
  /**
   * Constructs css selector by combining classes by OR
   * @param classList
   * @returns {string}
   */


  var constructClassCssSelectorByOR = function constructClassCssSelectorByOR(classList) {
    var selectors = [];

    if (classList) {
      for (var i = 0; i < classList.length; i += 1) {
        selectors.push(".".concat(cssEscape(classList[i])));
      }
    }

    return selectors.join(', ');
  };
  /**
   * Constructs element selector for matching elements
   * that contain any of classes in original element.
   * For example <el class='cl1 cl2 cl3'></el> => .cl1, .cl2, .cl3
   *
   * @param element Element
   * @param classList Override element classes
   * (If classList is null, element classes will be used)
   * @returns {string}
   */


  var makeSimilarCssFilter = function makeSimilarCssFilter(element, classList) {
    return constructClassCssSelectorByOR(classList || element.classList);
  };
  /**
   * Creates css rule text
   * @param element Element
   * @param options Construct options.
   * For example: {
   *  cssSelectorType: 'STRICT_FULL',
   *  excludeTagName: false,
   *  excludeId: false, classList: []
   * }
   * @returns {string}
   */


  var constructCssRuleText = function constructCssRuleText(element, options) {
    if (!element) {
      return;
    } // eslint-disable-next-line no-param-reassign


    options = options || {};
    var cssSelectorType = options.cssSelectorType || 'STRICT_FULL';
    var selector;

    switch (cssSelectorType) {
      case 'STRICT_FULL':
        selector = makeCssNthChildFilter(element, options);
        break;

      case 'STRICT':
        selector = makeDefaultCssFilter(element, options.classList, options.excludeTagName, options.excludeId);
        break;

      case 'SIMILAR':
        selector = makeSimilarCssFilter(element, options.classList, true);
        break;

      default:
        break;
    } // eslint-disable-next-line consistent-return


    return selector ? CSS_RULE_MARK + selector : '';
  };

  var constructUrlBlockRuleText = function constructUrlBlockRuleText(element, urlBlockAttribute, oneDomain, domain) {
    if (!urlBlockAttribute) {
      return null;
    }

    var blockUrlRuleText = urlBlockAttribute.replace(/^http:\/\/(www\.)?/, '||');

    if (blockUrlRuleText.indexOf('.') === 0) {
      blockUrlRuleText = blockUrlRuleText.substring(1);
    }

    if (!oneDomain) {
      blockUrlRuleText = "".concat(blockUrlRuleText).concat(RULE_OPTIONS_MARK, "domain=").concat(domain);
    }

    return blockUrlRuleText;
  };

  var isValidUrl = function isValidUrl(value) {
    if (value) {
      linkHelper.href = value;

      if (linkHelper.hostname) {
        return true;
      }
    }

    return false;
  };

  var getUrlBlockAttribute = function getUrlBlockAttribute(element) {
    if (!element || !element.getAttribute) {
      return null;
    }

    for (var i = 0; i < URLBLOCK_ATTRIBUTES.length; i += 1) {
      var attr = URLBLOCK_ATTRIBUTES[i];
      var value = element.getAttribute(attr);

      if (isValidUrl(value)) {
        return value;
      }
    }

    return null;
  };

  var haveUrlBlockParameter = function haveUrlBlockParameter(element) {
    var value = getUrlBlockAttribute(element);
    return value && value !== '';
  };

  var haveClassAttribute = function haveClassAttribute(element) {
    return element.classList && element.classList.length > 0;
  };

  var haveIdAttribute = function haveIdAttribute(element) {
    return element.id && element.id.trim() !== '';
  };

  var getUrl = function getUrl(url) {
    var pattern = '^(([^:/\\?#]+):)?(//(([^:/\\?#]*)(?::([^/\\?#]*))?))?([^\\?#]*)(\\?([^#]*))?(#(.*))?$';
    var rx = new RegExp(pattern);
    var parts = rx.exec(url);
    return {
      host: parts[4] || '',
      path: parts[7] || ''
    };
  };

  var cropDomain = function cropDomain(url) {
    var domain = getUrl(url).host;
    return domain.replace('www.', '').replace(/:\d+/, '');
  };
  /**
   * Utility method
   *
   * @param element
   * @returns {string}
   */
  // eslint-disable-next-line no-param-reassign


  api.makeCssNthChildFilter = makeCssNthChildFilter;
  /**
   * Returns detailed element info
   *
   * @param element
   */
  // eslint-disable-next-line no-param-reassign

  api.getElementInfo = function (element) {
    // Convert attributes to array
    var attributes = [];
    var elementAttributes = element.attributes;

    if (elementAttributes) {
      for (var i = 0; i < elementAttributes.length; i += 1) {
        var attr = elementAttributes[i];
        attributes.push({
          name: attr.name,
          value: attr.value
        });
      }
    }

    return {
      tagName: element.tagName,
      attributes: attributes,
      urlBlockAttributeValue: getUrlBlockAttribute(element),
      haveUrlBlockParameter: haveUrlBlockParameter(element),
      haveClassAttribute: haveClassAttribute(element),
      haveIdAttribute: haveIdAttribute(element)
    };
  };
  /**
   * Constructs css selector for specified rule
   *
   * @param ruleText rule text
   * @returns {string} css style selector
   */
  // eslint-disable-next-line no-param-reassign


  api.constructRuleCssSelector = function (ruleText) {
    if (!ruleText) {
      return null;
    }

    var index = ruleText.indexOf(CSS_RULE_MARK);
    var optionsIndex = ruleText.indexOf(RULE_OPTIONS_MARK);

    if (index >= 0) {
      return ruleText.substring(index + CSS_RULE_MARK.length, optionsIndex >= 0 ? optionsIndex : ruleText.length);
    }

    var s = ruleText.substring(0, optionsIndex);
    s = s.replace(/[|]|[\^]/g, '');

    if (isValidUrl(s)) {
      return "[src*=\"".concat(s, "\"]");
    }

    return null;
  };
  /**
   * Constructs adguard rule text from element node and specified options
   *
   * const options = {
   *  urlMask: url block attributes,
   *  isBlockOneDomain: boolean,
   *  url: url,
   *  attributes: attributesSelectorText,
   *  ruleType: (URL, CSS)
   *  cssSelectorType: (STRICT_FULL, STRICT, SIMILAR),
   *  excludeTagName: false, (Exclude element tag name from selector)
   *  excludeId: false, (Exclude element identifier from selector)
   *  classList: []
   *      (Override element classes (If classList is null, element classes will be used))
   * }
   *
   * @param element
   * @param options
   * @returns {*}
   */
  // eslint-disable-next-line no-param-reassign


  api.constructRuleText = function (element, options) {
    var croppedDomain = cropDomain(options.url);
    var ruleType = options.ruleType;

    if (ruleType === 'URL') {
      var blockUrlRuleText = constructUrlBlockRuleText(element, options.urlMask, options.isBlockOneDomain, croppedDomain);

      if (blockUrlRuleText) {
        return blockUrlRuleText;
      }
    }

    var result;

    if (ruleType === 'CSS') {
      result = constructCssRuleText(element, options); // Append html attributes to css selector

      if (options.attributes) {
        result = (result || CSS_RULE_MARK + result) + options.attributes;
      }
    }

    if (!options.isBlockOneDomain) {
      result = croppedDomain + result;
    }

    return result;
  };

  return api;
}

var adguardRulesConstructor = new AdguardRulesConstructorLib();
/* harmony default export */ const adguard_rules_constructor = (adguardRulesConstructor);
;// CONCATENATED MODULE: ./src/controllers/sliderMenuController.js





/**
 * Slider menu controller
 * @param addRule
 * @returns {{init: init}}
 * @constructor
 */

function SliderMenuController(addRule, iframe) {
  var contentDocument = null;
  var selectedElement = null;
  var startElement = null;
  var currentElement = null;
  var iframeCtrl = iframe;

  var getFilterRuleInputText = function getFilterRuleInputText() {
    return contentDocument.getElementById('filter-rule').value;
  };

  var close = function close() {
    iframeCtrl.removeIframe();
  };

  var expandAdvanced = function expandAdvanced() {
    var advancedSettings = contentDocument.querySelector('#advanced-settings');
    var extendedSettingsText = contentDocument.querySelector('#ExtendedSettingsText');
    var hidden = !hasClass(advancedSettings, 'open');

    if (hidden) {
      addClass(advancedSettings, 'open');
      addClass(extendedSettingsText, 'active');
      iframeCtrl.resizeSliderMenuToAdvanced();
    } else {
      removeClass(advancedSettings, 'open');
      removeClass(extendedSettingsText, 'active');
      iframeCtrl.resizeSliderMenuToNormal();
    }
  };

  var showPreview = function showPreview() {
    var options = {
      isBlockByUrl: contentDocument.getElementById('block-by-url-checkbox').checked,
      isBlockSimilar: contentDocument.getElementById('block-similar-checkbox').checked,
      isBlockOneDomain: contentDocument.getElementById('one-domain-checkbox').checked
    };
    iframeCtrl.showBlockPreview(selectedElement, getFilterRuleInputText(), startElement, options);
  };

  var blockElement = function blockElement() {
    var path = getFilterRuleInputText();
    iframeCtrl.blockElement(path, addRule);
  };

  var handleShowBlockSettings = function handleShowBlockSettings(showBlockByUrl, showBlockSimilar) {
    var blockByUrlBlock = contentDocument.querySelector('#block-by-url-checkbox-block');
    var blockSimilarBlock = contentDocument.querySelector('#block-similar-checkbox-block');

    if (showBlockByUrl) {
      show(blockByUrlBlock);
    } else {
      contentDocument.getElementById('block-by-url-checkbox').checked = false;
      hide(blockByUrlBlock);
    }

    if (showBlockSimilar) {
      show(blockSimilarBlock);
    } else {
      contentDocument.getElementById('block-similar-checkbox').checked = false;
      hide(blockSimilarBlock);
    }
  };

  var getUrlBlockAttribute = function getUrlBlockAttribute(element) {
    var urlBlockAttributes = ['src', 'data'];

    for (var i = 0; i < urlBlockAttributes.length; i += 1) {
      var attr = urlBlockAttributes[i];
      var value = element.getAttribute(attr);

      if (value) {
        return value;
      }
    }

    return null;
  };

  var haveUrlBlockParameter = function haveUrlBlockParameter(element) {
    var value = getUrlBlockAttribute(element);
    return value && value !== '';
  };

  var haveClassAttribute = function haveClassAttribute(element) {
    var className = element.className;
    return className && typeof className === 'string' && className.trim() !== '';
  };

  var setFilterRuleInputText = function setFilterRuleInputText(ruleText) {
    contentDocument.getElementById('filter-rule').value = ruleText;
  };

  var onScopeChange = function onScopeChange() {
    var isBlockByUrl = contentDocument.getElementById('block-by-url-checkbox').checked;
    var isBlockSimilar = contentDocument.getElementById('block-similar-checkbox').checked;
    var isBlockOneDomain = contentDocument.getElementById('one-domain-checkbox').checked;
    handleShowBlockSettings(haveUrlBlockParameter(selectedElement) && !isBlockSimilar, haveClassAttribute(selectedElement) && !isBlockByUrl);
    var options = {
      urlMask: getUrlBlockAttribute(selectedElement),
      cssSelectorType: isBlockSimilar ? 'SIMILAR' : 'STRICT_FULL',
      isBlockOneDomain: isBlockOneDomain,
      url: document.location,
      ruleType: isBlockByUrl ? 'URL' : 'CSS'
    };
    var ruleText = adguard_rules_constructor.constructRuleText(selectedElement, options);
    setFilterRuleInputText(ruleText);
    iframeCtrl.resizeIframe();
  };

  var bindEvents = function bindEvents() {
    var menuEvents = {
      '.close': close,
      '#ExtendedSettingsText': expandAdvanced,
      '#adg-cancel': iframeCtrl.showSelectorMenu,
      '#adg-preview': showPreview,
      '#adg-accept': blockElement,
      '#block-by-url-checkbox-block': onScopeChange,
      '#one-domain-checkbox-block': onScopeChange,
      '#block-similar-checkbox-block': onScopeChange
    };
    Object.keys(menuEvents).forEach(function (item) {
      var elems = contentDocument.querySelectorAll(item);
      toArray(elems).forEach(function (elem) {
        return elem.addEventListener('click', menuEvents[item]);
      });
    });
  };

  var makeDefaultCheckboxesForDetailedMenu = function makeDefaultCheckboxesForDetailedMenu(options) {
    contentDocument.getElementById('block-by-url-checkbox').checked = options && options.isBlockByUrl;
    contentDocument.getElementById('block-similar-checkbox').checked = options && options.isBlockSimilar;
    contentDocument.getElementById('one-domain-checkbox').checked = options && options.isBlockOneDomain;

    if (options && (options.isBlockByUrl || options.isBlockSimilar)) {
      handleShowBlockSettings(options.isBlockByUrl, options.isBlockSimilar);
    }
  };

  var onSliderMove = function onSliderMove(element) {
    selectedElement = element;
    adguard_selector.selectElement(element);
    makeDefaultCheckboxesForDetailedMenu();
    onScopeChange();
    handleShowBlockSettings(haveUrlBlockParameter(element), haveClassAttribute(element));
  };

  var createSlider = function createSlider(setElement) {
    var parents = getParentsLevel(selectedElement);
    var children = getAllChildren(selectedElement);
    var value = Math.abs(parents.length + 1);
    var max = parents.length + children.length + 1;
    var min = 1;
    var options = {
      value: value,
      min: min,
      max: max
    };
    var slider = contentDocument.querySelector('#slider');
    var sliderArea = contentDocument.querySelector('#slider-area');

    if (min === max) {
      // hide slider text
      hide(slider);
      hide(contentDocument.querySelectorAll('.element-rule_text'));
      expandAdvanced();
    }

    options.onSliderMove = function (delta) {
      var elem;

      if (delta > 0) {
        elem = parents[delta - 1];
      }

      if (delta === 0) {
        elem = startElement;
      }

      if (delta < 0) {
        elem = children[Math.abs(delta + 1)];
      }

      onSliderMove(elem);
    };

    var currentVal = options.value; // set slider position on current element after returning from preview mode

    if (setElement) {
      var setElementparents = getParentsLevel(setElement);
      currentVal = setElementparents.length + 1;
    }

    slider_widget.init(slider, {
      min: options.min,
      max: options.max,
      value: currentVal,
      // eslint-disable-next-line no-shadow
      onValueChanged: function onValueChanged(value) {
        var delta = options.value - value;
        options.onSliderMove(delta);
      },
      sliderArea: sliderArea
    });
  };
  /*
   Called from IframeController._showMenuItem to initialize view
   */
  // eslint-disable-next-line no-shadow


  var init = function init(iframe, options) {
    selectedElement = options.element;
    startElement = selectedElement; // eslint-disable-next-line prefer-destructuring

    contentDocument = iframe.contentDocument; // eslint-disable-next-line prefer-destructuring

    currentElement = options.currentElement;
    bindEvents();
    createSlider(currentElement);
    onScopeChange();
    adguard_selector.selectElement(selectedElement); // select current element after returning from preview mode

    if (currentElement) {
      onSliderMove(currentElement);
    } // make input clickable with right mouse button for text editing


    events.add(contentDocument.getElementById('filter-rule'), 'contextmenu', function (e) {
      e.stopPropagation();
    });

    if (options.path) {
      setFilterRuleInputText(options.path);
      expandAdvanced();
    }

    if (options.options) {
      makeDefaultCheckboxesForDetailedMenu(options.options);
    }
  };

  return {
    init: init
  };
}
;// CONCATENATED MODULE: ./src/controllers/blockPreviewController.js



/**
 * Block preview controller
 * @param addRule
 * @param iframe
 * @returns {{init: init}}
 * @constructor
 */

function BlockPreviewController(addRule, iframe) {
  var contentDocument = null;
  var currentElement = null;
  var selectedElement = null;
  var selectedPath = null;
  var optionsState = null;
  var iframeCtrl = iframe;
  var previewStyleID = 'ag-preview-style-id';

  var showElement = function showElement() {
    iframeCtrl.showHiddenElements(previewStyleID);
  };

  var close = function close() {
    showElement();
    iframeCtrl.removeIframe();
  };

  var selectAnotherElement = function selectAnotherElement() {
    showElement();
    iframeCtrl.showSelectorMenu();
  };

  var blockElement = function blockElement(e) {
    e.stopPropagation();
    iframeCtrl.blockElement(selectedPath, addRule);
  };

  var showDetailedMenu = function showDetailedMenu() {
    showElement();
    iframeCtrl.showSliderMenu(currentElement, selectedElement, selectedPath, optionsState);
  };

  var bindEvents = function bindEvents() {
    var menuEvents = {
      '.close': close,
      '#select-another-element': selectAnotherElement,
      '#end-preview': showDetailedMenu,
      '#block-element': blockElement
    };
    Object.keys(menuEvents).forEach(function (item) {
      var elems = contentDocument.querySelectorAll(item);
      toArray(elems).forEach(function (elem) {
        return elem.addEventListener('click', menuEvents[item]);
      });
    });
  };

  var hideElement = function hideElement() {
    if (!selectedPath) {
      src_log.error('Can`t block element: `selector` path is empty');
      return;
    }

    iframeCtrl.hideElementsByPath(selectedPath, previewStyleID);
  };
  /*
   Called from IframeController.showMenuItem to initialize view
   */
  // eslint-disable-next-line no-shadow


  var init = function init(iframe, options) {
    selectedElement = options.element;
    selectedPath = options.path; // eslint-disable-next-line prefer-destructuring

    currentElement = options.currentElement; // eslint-disable-next-line prefer-destructuring

    contentDocument = iframe.contentDocument;
    optionsState = options.options;
    adguard_selector.reset();
    bindEvents();
    hideElement();
  };

  return {
    init: init
  };
}
;// CONCATENATED MODULE: ./src/utils/ui-validation-utils.js


/**
 * Utils that checks environment for compatibility with assistant
 * @returns {{
 * checkVisibleAreaSize: checkVisibleAreaSize,
 * validateBrowser: validateBrowser,
 * validatePage: validatePage,
 * getViewPort: getViewPort
 * }}
 * @constructor
 */

function UIValidationUtils() {
  var _window = window,
      document = _window.document;

  var getViewPort = function getViewPort() {
    var width = window.innerWidth;
    var height = window.innerHeight;
    return {
      width: width,
      height: height
    };
  };
  /**
   * Check if visible area are enough to show menu.
   * @returns boolean. True if area enough
   */


  var checkVisibleAreaSize = function checkVisibleAreaSize() {
    var viewPort = getViewPort(); // eslint-disable-next-line max-len

    var visibleAreaSize = viewPort.height > src_settings.Constants.MINIMUM_VISIBLE_HEIGHT_TO_SHOW_BUTTON;

    if (!visibleAreaSize) {
      src_log.error("Viewport height is too small: ".concat(viewPort.height));
    }

    return visibleAreaSize;
  };
  /**
   * Checks if browser is valid for Adguard assistant
   * @returns boolean. True if browser valid
   */


  var validateBrowser = function validateBrowser() {
    var valid = !document.documentMode || document.documentMode > src_settings.Constants.MINIMUM_IE_SUPPORTED_VERSION;

    if (!valid) {
      src_log.error("IE version is ".concat(document.documentMode));
    }

    return valid;
  };
  /**
   * Checks if page is valid for Adguard assistant to work here.
   */


  var validatePage = function validatePage() {
    // Assistant do not work in iframes
    if (window.window !== window.top) {
      return false;
    }

    return true;
  };

  return {
    checkVisibleAreaSize: checkVisibleAreaSize,
    validateBrowser: validateBrowser,
    validatePage: validatePage,
    getViewPort: getViewPort
  };
}

var uiValidationUtils = new UIValidationUtils();
/* harmony default export */ const ui_validation_utils = (uiValidationUtils);
;// CONCATENATED MODULE: ./src/utils/ui-utils.js



/**
 * UI utils
 * @returns {{
 *  makeElementDraggable: Function,
 *  makeIframeDraggable: Function,
 *  moveElementTo: Function,
`*  setAnchorPosition: Function,
 *  checkElementPosition: Function,
 * }}
 * @constructor
 */

function UIUtils() {
  var elWidth;
  var elHeight;
  var windowWidth;
  var windowHeight; // Stored button anchor position

  var storedAnchor = {};
  /**
   * Get original event object for touch
   * devices to getting current coordinates
   * @param {Object}
   * @returns {Object}
   */

  var getOriginalEvent = function getOriginalEvent(e) {
    return e.targetTouches ? e.targetTouches[0] : e;
  };

  var outsidePosition = {
    top: function top(pos) {
      return storedAnchor.top && (pos.y + elHeight > windowHeight || pos.y < 0);
    },
    bottom: function bottom(pos) {
      return !storedAnchor.top && (Math.abs(pos.y) + elHeight > windowHeight || pos.y > 0);
    },
    left: function left(pos) {
      return storedAnchor.left && (pos.x + elWidth > windowWidth || pos.x < 0);
    },
    right: function right(pos) {
      return !storedAnchor.left && (Math.abs(pos.x) + elWidth > windowWidth || pos.x > 0);
    }
  };
  /**
   * Set transition css property for drag
   * translate3d is for better rendering performance
   * see: https://www.html5rocks.com/en/tutorials/speed/layers/
   */

  var moveElementTo = function moveElementTo(el, x, y) {
    var transform = "translate3d(".concat(x, "px,").concat(y, "px, 0px)"); // eslint-disable-next-line no-param-reassign

    el.style.webkitTransform = transform; // eslint-disable-next-line no-param-reassign

    el.style.mozTransform = transform; // eslint-disable-next-line no-param-reassign

    el.style.msTransform = transform; // eslint-disable-next-line no-param-reassign

    el.style.oTransform = transform; // eslint-disable-next-line no-param-reassign

    el.style.transform = transform;
  }; // getting screen width and height without scroll bars


  var getWindowSize = function getWindowSize() {
    return {
      width: Math.min(document.documentElement.clientWidth, window.innerWidth || window.screen.width),
      height: Math.min(document.documentElement.clientHeight, window.innerHeight || window.screen.height)
    };
  };
  /**
   * Functions for saving left/top anchors and setting class position
   *
   * @param {Object} element  button element
   * @param {Boolean} anchor  anchors positions `true` for top/left or `false` for bottom/right
   */


  var setAnchorPosition = {
    positionY: function positionY(element, anchor) {
      storedAnchor.top = anchor;

      if (storedAnchor.top) {
        addClass(element, 'adguard-assistant-button-top');
        removeClass(element, 'adguard-assistant-button-bottom');
      } else {
        addClass(element, 'adguard-assistant-button-bottom');
        removeClass(element, 'adguard-assistant-button-top');
      }
    },
    positionX: function positionX(element, anchor) {
      storedAnchor.left = anchor;

      if (storedAnchor.left) {
        addClass(element, 'adguard-assistant-button-left');
        removeClass(element, 'adguard-assistant-button-right');
      } else {
        addClass(element, 'adguard-assistant-button-right');
        removeClass(element, 'adguard-assistant-button-left');
      }
    }
  };
  /**
   * Make element draggable
   * @param element
   * @param onDragEnd
   * @param onClick
   */

  function makeElementDraggable(element, onDragEnd, onClick) {
    var coords;
    var shiftX;
    var shiftY;
    /**
     * Prevent text selection
     * With cursor drag
     */

    var pauseEvent = function pauseEvent(e) {
      e.stopPropagation();
      e.preventDefault();
      e.cancelBubble = true;
      e.returnValue = false;
      return false;
    };

    var onMouseMove = function onMouseMove(e) {
      pauseEvent(e); // eslint-disable-next-line no-use-before-define

      moveAt(e);
    };

    var preventedEvent = function preventedEvent(e) {
      e.preventDefault();
    };

    var getCoords = function getCoords(elem) {
      var box = elem.getBoundingClientRect();
      return {
        top: box.top,
        left: box.left,
        bottom: box.bottom,
        right: box.right
      };
    };
    /**
     * On mouse up event
     * @param {Object} e  event object
     * @param {Boolean|undefined} doNotOpenIframe do not open the iframe if true.
     * This is necessary when the cursor is out of bounds
     */


    var onMouseUp = function onMouseUp(e, doNotOpenIframe) {
      e.stopPropagation(); // make scroll availalbe

      events.remove(document.documentElement, 'wheel mousewheel', preventedEvent); // When a user finishes dragging icon, we set icon anchor
      // depending on the icon position, i.e. which quarter
      // of the screen it belongs.

      var lastX;
      var lastY;
      var lastCoords = getCoords(element);
      var topHalf = lastCoords.top < windowHeight / 2;
      var leftHalf = lastCoords.left < windowWidth / 2;
      setAnchorPosition.positionY(element, topHalf);
      setAnchorPosition.positionX(element, leftHalf);

      if (topHalf) {
        lastY = lastCoords.top;
      } else {
        lastY = lastCoords.bottom - windowHeight;
      }

      if (leftHalf) {
        lastX = lastCoords.left;
      } else {
        lastX = lastCoords.right - windowWidth;
      }

      moveElementTo(element, lastX, lastY); // Open the frame if the button has been shifted by no more than 5 pixels

      if (Math.abs(coords.left - lastCoords.left) > 5 || Math.abs(coords.top - lastCoords.top) > 5) {
        if (onDragEnd) {
          var store = {
            x: lastX,
            y: lastY,
            storedAnchor: storedAnchor
          };
          onDragEnd(store);
        }
      } else if (onClick && !doNotOpenIframe) {
        onClick(e);
      }

      events.remove(document.documentElement, 'mouseup touchend pointerup', onMouseUp);
      events.remove(document.documentElement, 'mousemove touchmove pointermove', onMouseMove);
    };

    var moveAt = function moveAt(e) {
      var position = {
        x: getOriginalEvent(e).pageX - shiftX,
        y: getOriginalEvent(e).pageY - shiftY
      }; // disable mousemove if button element outside the screen

      var out = outsidePosition.top(position) || outsidePosition.left(position) || outsidePosition.bottom(position) || outsidePosition.right(position);

      if (out) {
        onMouseUp(e, true);
      } else {
        moveElementTo(element, position.x, position.y);
      }
    };

    var mouseDown = function mouseDown(e) {
      pauseEvent(e); // prevent browser scroll

      events.add(document.documentElement, 'wheel mousewheel', preventedEvent); // prevent right button mousedown

      if (e.button > 0) return;
      elWidth = element.clientWidth;
      elHeight = element.clientWidth;
      windowWidth = getWindowSize().width;
      windowHeight = getWindowSize().height;
      coords = getCoords(element);

      if (storedAnchor.top) {
        shiftY = getOriginalEvent(e).pageY - coords.top;
      } else {
        shiftY = windowHeight - (coords.bottom - getOriginalEvent(e).pageY);
      }

      if (storedAnchor.left) {
        shiftX = getOriginalEvent(e).pageX - coords.left;
      } else {
        shiftX = windowWidth - (coords.right - getOriginalEvent(e).pageX);
      }
      /**
       * binding both mouse and touch/pointer events simultaneously
       * see: http://www.html5rocks.com/en/mobile/touchandmouse/
       */


      events.add(document.documentElement, 'mouseup touchend pointerup', onMouseUp);
      events.add(document.documentElement, 'mousemove touchmove pointermove', onMouseMove);
    };

    events.add(element, 'mousedown touchstart', src_protectedApi.functionBind.call(mouseDown, this));
    events.add(element, 'dragstart', function () {});
  }
  /**
   * Makes iframe draggable
   *
   * @param iframe
   * @param handleElement
   */


  var makeIframeDraggable = function makeIframeDraggable(iframe, handleElement) {
    var iframeDoc = iframe.contentDocument;
    var offset = Object.create(null);
    /**
     * Function that does actual "dragging"
     *
     * @param x
     * @param y
     */

    var drag = function drag(x, y) {
      // eslint-disable-next-line no-param-reassign
      iframe.style.left = "".concat(x, "px"); // eslint-disable-next-line no-param-reassign

      iframe.style.top = "".concat(y, "px");
    };

    var cancelIFrameSelection = function cancelIFrameSelection(e) {
      e.preventDefault();
      e.stopPropagation();
    };

    var onMouseMove = function onMouseMove(e) {
      var eventPosition = getOriginalEvent(e);
      drag(eventPosition.screenX + offset.x, eventPosition.screenY + offset.y);
    };

    var onMouseDown = function onMouseDown(e) {
      var eventPosition = getOriginalEvent(e);
      var rect = iframe.getBoundingClientRect();
      offset.x = rect.left + handleElement.offsetLeft - eventPosition.screenX;
      offset.y = rect.top + handleElement.offsetTop - eventPosition.screenY;
      events.add(iframeDoc, 'mousemove touchmove pointermove', onMouseMove);
      events.add(iframeDoc, 'selectstart', cancelIFrameSelection);
    };

    var onMouseUp = function onMouseUp() {
      events.remove(iframeDoc, 'mousemove touchmove pointermove', onMouseMove);
      events.remove(iframeDoc, 'selectstart', cancelIFrameSelection);
    }; // prevent iframe dragging while browser tabs is switching


    document.addEventListener('visibilitychange', onMouseUp);
    events.add(handleElement, 'mousedown touchstart', onMouseDown);
    events.add(iframeDoc, 'mouseup touchend pointerup', onMouseUp);
    events.add(iframeDoc, 'contextmenu', function (e) {
      e.preventDefault();
      return false;
    });
  };

  var checkElementPosition = function checkElementPosition(element, pos) {
    var position = pos;
    windowWidth = getWindowSize().width;
    windowHeight = getWindowSize().height;
    elWidth = element.clientWidth;
    elHeight = element.clientHeight;
    if (outsidePosition.top(position)) position.y = windowHeight - 60;
    if (outsidePosition.bottom(position)) position.y = -windowHeight + 60;
    if (outsidePosition.left(position)) position.x = windowWidth - 60;
    if (outsidePosition.right(position)) position.x = -windowWidth + 60;
    moveElementTo(element, position.x, position.y);
  };

  return {
    makeElementDraggable: makeElementDraggable,
    makeIframeDraggable: makeIframeDraggable,
    moveElementTo: moveElementTo,
    setAnchorPosition: setAnchorPosition,
    checkElementPosition: checkElementPosition
  };
}

var uiUtils = new UIUtils();
/* harmony default export */ const ui_utils = (uiUtils);
;// CONCATENATED MODULE: ./src/button.js








/**
 * Adguard assistant button
 * @returns {{show: show, remove: remove}}
 * @constructor
 */

function UIButton() {
  var button = null;
  var buttonElement = null;
  var isFullScreenEventsRegistered = false;
  var iframeController = null; // Important attribute for all inline stylesheets.
  // It needs for Content-Security-Policy.

  var getStyleNonce = function getStyleNonce() {
    var adgSettings = src_settings.getAdguardSettings();

    if (adgSettings === null) {
      return '';
    }

    return adgSettings.nonce;
  };

  var isButtonAlreadyInDOM = function isButtonAlreadyInDOM() {
    var alert = document.querySelector('.adguard-alert');

    if (alert) {
      src_log.error('Assistant button is already in DOM');
      return true;
    }

    return false;
  };
  /**
   * Checking browser and other requirements.
   * @private
   */


  var checkRequirements = function checkRequirements() {
    if (!ui_validation_utils.validateBrowser()) {
      return false;
    }

    if (!ui_validation_utils.validatePage()) {
      return false;
    }

    if (!ui_validation_utils.checkVisibleAreaSize()) {
      return false;
    }

    if (isButtonAlreadyInDOM()) {
      return false;
    }

    return true;
  };
  /**
   * Set a special classes for the pages on which
   * under the button there are important elements
   * issue: https://github.com/AdguardTeam/AdguardAssistant/issues/32
   */


  var respectPageElements = function respectPageElements(btn) {
    var buttonInRightBottom = hasClass(btn, 'adguard-assistant-button-bottom') && hasClass(btn, 'adguard-assistant-button-right');

    if (buttonInRightBottom && document.location.hostname.indexOf('vk.com') >= 0) {
      addClass(btn, 'adguard-assistant-button-respect adguard-assistant-button-respect-vk');
    }

    if (buttonInRightBottom && document.location.hostname.indexOf('facebook.com') >= 0) {
      addClass(btn, 'adguard-assistant-button-respect adguard-assistant-button-respect-fb');
    }

    return false;
  };

  var setPositionSettingsToButton = function setPositionSettingsToButton(btn) {
    var position = src_settings.getUserPositionForButton();

    if (src_settings.getIconSize()) {
      addClass(btn, 'logo-small');
    } // The anchor determines from which side of the
    // browser the positions of `position.x`, `position.y`.
    // If `position` parameter is not defined,
    // so the position of the button is set in the corners of the browser


    if (position && position.storedAnchor) {
      ui_utils.setAnchorPosition.positionY(btn, position.storedAnchor.top);
      ui_utils.setAnchorPosition.positionX(btn, position.storedAnchor.left);
      ui_utils.moveElementTo(btn, position.x, position.y);
      ui_utils.checkElementPosition(btn, position);
      return false;
    } // Getting the corner of the browser where the button is placed


    var side = src_settings.getButtonSide();

    if (side) {
      ui_utils.setAnchorPosition.positionY(btn, side.top);
      ui_utils.setAnchorPosition.positionX(btn, side.left);
      respectPageElements(btn);
    }

    return undefined;
  };
  /**
   * Get center button position
   * @returns {{left: *, top: *}}
   * @private
   */


  var getButtonPosition = function getButtonPosition(btn) {
    var box = btn.getBoundingClientRect();
    return {
      top: box.top + btn.offsetHeight / 2,
      left: box.left + btn.offsetWidth / 2
    };
  };

  var hideButton = function hideButton() {
    if (!button) {
      return;
    }

    button.style.setProperty('display', 'none', 'important');
  };

  var showButton = function showButton() {
    if (!button) {
      return;
    }

    button.style.setProperty('display', 'block', 'important');
  };

  var hideRestoreOnFullScreen = function hideRestoreOnFullScreen() {
    if (isFullScreenEventsRegistered) {
      return;
    }

    var isFullScreen = false;

    var onFullScreen = function onFullScreen() {
      if (!isFullScreen) {
        hideButton();
        isFullScreen = true;
      } else {
        showButton();
        isFullScreen = false;
      }
    };

    document.addEventListener('webkitfullscreenchange', onFullScreen);
    document.addEventListener('mozfullscreenchange', onFullScreen);
    document.addEventListener('fullscreenchange', onFullScreen);
    isFullScreenEventsRegistered = true;
  };

  var registerEvents = function registerEvents(btn) {
    var onDragEnd = function onDragEnd(data) {
      src_settings.setUserPositionForButton(data);
    };

    var openMenu = function openMenu() {
      iframeController.setButtonPosition(getButtonPosition(btn));
      iframeController.showDetailedMenu();
    };

    ui_utils.makeElementDraggable(btn, onDragEnd, openMenu);
    hideRestoreOnFullScreen();
  };
  /**
   * Shows Adguard initial button
   */


  var show = function show() {
    // TODO: get rid of it
    iframeController = src_ioc.get('iframeController');
    iframeController.onCloseMenu.attach(showButton);
    iframeController.onShowMenuItem.attach(hideButton);

    if (!checkRequirements()) {
      src_log.info('Environment doesn\'t satisfy requirements, so don\'t show Adguard');
      return;
    }

    if (button) {
      return;
    }

    src_log.debug('Requirements checked, all ok');
    buttonElement = src_protectedApi.createElement('div');
    buttonElement.innerHTML = HTML.button;
    button = buttonElement.firstChild;
    var adgStylesButton;

    if (src_protectedApi.checkShadowDomSupport()) {
      var shadowbuttonElement = buttonElement.attachShadow({
        mode: 'closed'
      });
      adgStylesButton = src_protectedApi.createStylesElement(CSS.common + CSS.button, getStyleNonce());
      shadowbuttonElement.appendChild(adgStylesButton);
      shadowbuttonElement.appendChild(button);
      document.documentElement.appendChild(buttonElement);
    } else {
      adgStylesButton = src_protectedApi.createStylesElement(CSS.button, getStyleNonce(), 'adg-styles-button');

      if (adgStylesButton) {
        document.documentElement.appendChild(adgStylesButton);
      }

      document.documentElement.appendChild(button);
      buttonElement = button;
    }

    setPositionSettingsToButton(button);
    registerEvents(button);
  };

  var removeButton = function removeButton() {
    if (!button) {
      return;
    }

    document.documentElement.removeChild(buttonElement);
    button = null;
  };

  return {
    show: show,
    remove: removeButton
  };
}

var button_button = new UIButton();
/* harmony default export */ const src_button = (button_button);
;// CONCATENATED MODULE: ./src/controllers/settingsMenuController.js



/**
 * Settings menu controller
 * @returns {{init: init}}
 * @constructor
 */

function SettingsMenuController(iframe) {
  var contentDocument = null;
  var iframeCtrl = iframe;
  var buttonSides = {
    'position-bottom-right': {
      top: false,
      left: false
    },
    'position-bottom-left': {
      top: false,
      left: true
    },
    'position-top-right': {
      top: true,
      left: false
    },
    'position-top-left': {
      top: true,
      left: true
    }
  };

  var close = function close() {
    iframeCtrl.removeIframe();
  };

  var setIconSize = function setIconSize() {
    var smallIcon = contentDocument.getElementById('size-small').checked;
    src_settings.setIconSize(smallIcon);
  };

  var setPersonalParam = function setPersonalParam() {
    var personalConfig = contentDocument.getElementById('this-site').checked;
    src_settings.setPersonalParam(personalConfig);
  };

  var setButtonSide = function setButtonSide() {
    var sideItem = null;
    Object.keys(buttonSides).forEach(function (item) {
      if (contentDocument.getElementById(item).checked) {
        sideItem = item;
      }
    });

    if (sideItem) {
      src_settings.setButtonSide(buttonSides[sideItem]);
    }
  };

  var setDefaultSettings = function setDefaultSettings() {
    if (src_settings.getIconSize()) {
      contentDocument.getElementById('size-small').checked = true;
    } else {
      contentDocument.getElementById('size-big').checked = true;
    }

    if (src_settings.getPersonalConfig()) {
      contentDocument.getElementById('this-site').checked = true;
    } else {
      contentDocument.getElementById('all-site').checked = true;
    }

    var position = src_settings.getUserPositionForButton();

    if (position) {
      return;
    }

    var sideFromSettings = src_settings.getButtonSide();
    Object.keys(buttonSides).forEach(function (item) {
      var sideItem = buttonSides[item];

      if (sideItem.left === sideFromSettings.left && sideItem.top === sideFromSettings.top) {
        contentDocument.getElementById(item).checked = true;
      }
    });
  };

  var saveSettings = function saveSettings() {
    setPersonalParam();
    setIconSize();
    setButtonSide();
    src_settings.saveSettings();
    close();
    src_button.remove();
    src_button.show();
  };

  var bindEvents = function bindEvents() {
    var menuEvents = {
      '.close': close,
      '#cancel': iframeCtrl.showDetailedMenu,
      '#save-settings': saveSettings
    };
    Object.keys(menuEvents).forEach(function (item) {
      var elems = contentDocument.querySelectorAll(item);
      toArray(elems).forEach(function (elem) {
        return elem.addEventListener('click', menuEvents[item]);
      });
    });
  };
  /*
   Called from IframeController._showMenuItem to initialize view
   */
  // eslint-disable-next-line no-shadow


  var init = function init(iframe) {
    // eslint-disable-next-line prefer-destructuring
    contentDocument = iframe.contentDocument;
    bindEvents();
    setDefaultSettings();
  };

  return {
    init: init
  };
}
;// CONCATENATED MODULE: ./src/iframe.js

















/**
 * Manages iframe and it's content
 * @returns {{
 * showDetailedMenu: showDetailedMenu,
 * showSelectorMenu: showSelectorMenu,
 * showSliderMenu: showSliderMenu,
 * showBlockPreview: showBlockPreview,
 * showSettingsMenu: showSettingsMenu,
 * setButtonPosition: setButtonPosition,
 * onCloseMenu: CustomEvent,
 * onShowMenuItem: CustomEvent,
 * removeIframe: removeIframe,
 * resizeSliderMenuToAdvanced: resizeSliderMenuToAdvanced,
 * resizeSliderMenuToNormal: resizeSliderMenuToNormal
 * }}
 * @constructor
 */

function IframeController() {
  var iframe = null;
  var iframeAnchor = null;
  var currentItem = null;
  var iframeMaxWidth = 320;
  var iframeMaxHeight = 407;
  var menuMaxWidth = 668;
  var settingsMaxWidth = 458;
  var iframePositionOffset = 20;
  var buttonPosition = null;
  var blockedElementsStyleID = 'ag-hide-elements-style-id';
  var views = {};
  views[src_settings.MenuItemsNames.DetailedMenu] = HTML.detailed_menu;
  views[src_settings.MenuItemsNames.SelectorMenu] = HTML.selector_menu;
  views[src_settings.MenuItemsNames.SliderMenu] = HTML.slider_menu;
  views[src_settings.MenuItemsNames.BlockPreview] = HTML.preview;
  views[src_settings.MenuItemsNames.SettingsMenu] = HTML.settings_menu;
  if (window.innerWidth < menuMaxWidth) menuMaxWidth = window.innerWidth;
  if (window.innerWidth < settingsMaxWidth) settingsMaxWidth = window.innerWidth;
  var onCloseMenu = new CustomEvent();
  var onShowMenuItem = new CustomEvent(); // Important attribute for all inline stylesheets.
  // It needs for Content-Security-Policy.

  var getStyleNonce = function getStyleNonce() {
    var adgSettings = src_settings.getAdguardSettings();

    if (adgSettings === null) {
      return '';
    }

    return adgSettings.nonce;
  };

  var createShadowRootElement = function createShadowRootElement(iframeAnc) {
    var shadowiframeAnchor = iframeAnc.attachShadow({
      mode: 'closed'
    });
    var stylesElement = src_protectedApi.createStylesElement(CSS.common + CSS.iframe, getStyleNonce());
    shadowiframeAnchor.appendChild(stylesElement);
    return shadowiframeAnchor;
  };

  var createIframe = function createIframe(onIframeLoadCallback) {
    src_log.debug('Creating iframe');
    iframe = src_protectedApi.createElement('iframe'); // IE hack for prevent access denied error
    // see: https://stackoverflow.com/questions/1886547/access-is-denied-javascript-error-when-trying-to-access-the-document-object-of

    if (navigator.userAgent.match(/msie/i)) {
      iframe.src = "javascript:'<script>window.onload=function(){document.write(\\'<script>document.domain=\\\"".concat(document.domain, "\\\";<\\\\/script>\\');document.close();};</script>'");
    }

    var attributes = {
      id: src_settings.Constants.IFRAME_ID,
      "class": adguard_selector.ignoreClassName(),
      frameBorder: 0,
      allowTransparency: 'true'
    };
    Object.keys(attributes).forEach(function (item) {
      iframe.setAttribute(item, attributes[item]);
    });
    var iframeAlreadyLoaded = false;
    iframe.addEventListener('load', function () {
      if (iframeAlreadyLoaded) {
        // IE calls load each time when we use document.close
        return;
      }

      iframeAlreadyLoaded = true;
      onIframeLoadCallback();
    });

    if (src_protectedApi.checkShadowDomSupport()) {
      iframeAnchor = src_protectedApi.createElement('div');
      createShadowRootElement(iframeAnchor).appendChild(iframe);
    } else {
      iframeAnchor = iframe;
    }

    document.documentElement.appendChild(iframeAnchor);
  };

  var getIframePosition = function getIframePosition() {
    var viewPort = ui_validation_utils.getViewPort();

    if (!buttonPosition) {
      return {
        left: iframe.offsetLeft <= 0 ? window.innerWidth : iframe.offsetLeft,
        top: parseInt(iframe.style.top, 10) || iframePositionOffset
      };
    }

    var defaultPosition = {
      left: buttonPosition.left,
      top: buttonPosition.top
    };
    var sides = [{
      // left top
      left: buttonPosition.left - iframeMaxWidth - iframePositionOffset,
      top: buttonPosition.top - iframeMaxHeight - iframePositionOffset
    }, {
      // right top
      left: buttonPosition.left + iframePositionOffset,
      checkLeft: buttonPosition.left + iframeMaxWidth + iframePositionOffset,
      top: buttonPosition.top - iframeMaxHeight - iframePositionOffset
    }, {
      // bottom right
      left: buttonPosition.left + iframePositionOffset,
      checkLeft: buttonPosition.left + iframeMaxWidth + iframePositionOffset,
      checkTop: buttonPosition.top + iframeMaxHeight + iframePositionOffset,
      top: buttonPosition.top + iframePositionOffset
    }, {
      // bottom left
      left: buttonPosition.left - iframeMaxWidth - iframePositionOffset,
      checkTop: buttonPosition.top + iframeMaxHeight + iframePositionOffset,
      top: buttonPosition.top + iframePositionOffset
    }];

    for (var i = 0; i < sides.length; i += 1) {
      var currentSide = sides[i];
      var left = currentSide.checkLeft ? currentSide.checkLeft : currentSide.left;
      var top = currentSide.checkTop ? currentSide.checkTop : currentSide.top;

      if (left < 0 || left > viewPort.width) {
        // eslint-disable-next-line no-continue
        continue;
      }

      if (top < 0 || top > viewPort.height) {
        // eslint-disable-next-line no-continue
        continue;
      }

      return currentSide;
    }

    return defaultPosition;
  };

  var specifyIframePosition = function specifyIframePosition() {
    var viewPort = ui_validation_utils.getViewPort();

    if (iframe.offsetLeft + iframe.offsetWidth > viewPort.width) {
      iframe.style.left = "".concat(Math.max(0, viewPort.width - iframe.offsetWidth - iframePositionOffset), "px");
    }

    if (iframe.offsetLeft < 0) {
      iframe.style.left = "".concat(iframePositionOffset, "px");
    }

    if (iframe.offsetTop + iframe.offsetHeight > viewPort.height) {
      iframe.style.top = "".concat(Math.max(0, viewPort.height - iframe.offsetHeight - iframePositionOffset), "px");
    }

    if (iframe.offsetHeight < 0) {
      iframe.style.top = "".concat(iframePositionOffset, "px");
    }
  };

  var appendContent = function appendContent(view) {
    var body = iframe.contentDocument.body;

    for (var i = 0; i < body.children.length; i += 1) {
      body.removeChild(body.children[i]);
    }

    body.appendChild(view);
  };

  var localize = function localize() {
    var elements = iframe.contentDocument.querySelectorAll('[i18n]');

    for (var i = 0; i < elements.length; i += 1) {
      var message = src_localization.getMessage(elements[i].getAttribute('i18n'));
      src_localization.translateElement(elements[i], message);
    }
  };

  var resizeIframe = function resizeIframe(width, height) {
    var frame = iframe; // setting iframe height dynamically based on inner content

    if (height === 'auto' || !height) {
      // eslint-disable-next-line no-param-reassign
      height = frame.contentWindow.document.body.querySelector('.main').clientHeight || iframeMaxHeight;
    }

    if (width) {
      frame.width = width;
      frame.style.setProperty('width', "".concat(width, "px"), 'important');
    }

    if (height) {
      frame.height = height;
      frame.style.setProperty('height', "".concat(height, "px"), 'important');
    }
  };

  var showMenuItem = function showMenuItem(viewName, controller, width, height, options) {
    src_log.debug("Showing menu item: ".concat(viewName));

    if (currentItem === viewName) {
      return;
    }

    var onIframeLoad = function onIframeLoad() {
      var frameElement = iframe;
      var view = src_protectedApi.createElement(views[viewName]);
      var stylesElement = src_protectedApi.createStylesElement(CSS.common + CSS.button + CSS.iframe, getStyleNonce());
      view.appendChild(stylesElement);
      appendContent(view);
      localize();

      if (!options) {
        // eslint-disable-next-line no-param-reassign
        options = {};
      } // eslint-disable-next-line no-param-reassign


      options.iframeAnchor = iframeAnchor;
      controller.init(frameElement, options);
      currentItem = viewName;
      onShowMenuItem.notify();

      if (options.dragElement) {
        ui_utils.makeIframeDraggable(iframe, iframe.contentDocument.querySelector(options.dragElement));
      } // make iframe size as like internal content size


      resizeIframe(width, height);
      var iframePosition = getIframePosition();
      iframe.style.left = "".concat(iframePosition.left, "px");
      iframe.style.top = "".concat(iframePosition.top, "px"); // fixing iframe position after resize, to avoid iframe outside of the viewport

      specifyIframePosition();
    };

    if (!iframe) {
      var adgStylesSelector = src_protectedApi.createStylesElement(CSS.selector, getStyleNonce(), 'adg-styles-selector');

      if (adgStylesSelector) {
        document.documentElement.appendChild(adgStylesSelector);
      }

      createIframe(onIframeLoad);
      return;
    }

    onIframeLoad();
  };

  var setButtonPosition = function setButtonPosition(coords) {
    buttonPosition = coords;
  }; // e.isTrusted checking for prevent programmatically events
  // see: https://github.com/AdguardTeam/AdguardAssistant/issues/134


  var removeIframe = function removeIframe(e) {
    if (e && e.isTrusted === false) {
      return false;
    }

    if (!iframeAnchor) {
      return false;
    }

    document.removeEventListener('click', removeIframe);
    document.documentElement.removeChild(iframeAnchor);
    iframe = null;
    iframeAnchor = null;
    currentItem = null;
    adguard_selector.close();
    onCloseMenu.notify();
    return undefined;
  };

  var setCloseEventIfNotHitIframe = function setCloseEventIfNotHitIframe(setEvent) {
    document.removeEventListener('click', removeIframe);

    if (setEvent) {
      window.setTimeout(function () {
        document.addEventListener('click', removeIframe);
      }, 150);
    }
  };

  var showDetailedMenu = function showDetailedMenu() {
    var controller = new DetailedMenuController(src_ioc.get('iframeController'));
    var options = {
      dragElement: '.menu-head'
    };
    showMenuItem(src_settings.MenuItemsNames.DetailedMenu, controller, iframeMaxWidth, 'auto', options);
    setCloseEventIfNotHitIframe(true);
  };

  var showSelectorMenu = function showSelectorMenu() {
    var controller = new SelectorMenuController(src_ioc.get('iframeController'));
    var options = {
      dragElement: '.head'
    };
    showMenuItem(src_settings.MenuItemsNames.SelectorMenu, controller, menuMaxWidth, 160, options);
    setCloseEventIfNotHitIframe(false);
  };

  var showSliderMenu = function showSliderMenu(initElement, currentElement, path, optionsState) {
    var controller = new SliderMenuController(src_ioc.get('addRule'), src_ioc.get('iframeController'));
    var options = {
      path: path,
      currentElement: currentElement,
      element: initElement,
      dragElement: '.head',
      options: optionsState
    };
    showMenuItem(src_settings.MenuItemsNames.SliderMenu, controller, menuMaxWidth, 'auto', options);
    setCloseEventIfNotHitIframe(true);
  };

  var showBlockPreview = function showBlockPreview(initElement, path, currentElement, optionsState) {
    var controller = new BlockPreviewController(src_ioc.get('addRule'), src_ioc.get('iframeController'));
    var options = {
      path: path,
      currentElement: currentElement,
      element: initElement,
      dragElement: '.head',
      options: optionsState
    };
    showMenuItem(src_settings.MenuItemsNames.BlockPreview, controller, menuMaxWidth, 'auto', options);
    setCloseEventIfNotHitIframe(true);
  };

  var showSettingsMenu = function showSettingsMenu() {
    var controller = new SettingsMenuController(src_ioc.get('iframeController'));
    var options = {
      dragElement: '.head'
    };
    showMenuItem(src_settings.MenuItemsNames.SettingsMenu, controller, 400, 468, options);
    setCloseEventIfNotHitIframe(true);
  };

  var resizeSliderMenuToAdvanced = function resizeSliderMenuToAdvanced() {
    resizeIframe(null, null);
  };

  var resizeSliderMenuToNormal = function resizeSliderMenuToNormal() {
    resizeIframe(null, null);
  };

  var hideElementsByPath = function hideElementsByPath(selectedPath, styleID) {
    if (!selectedPath) {
      return false;
    }

    var slctr;
    var style;

    if (selectedPath.indexOf('://') > 0) {
      // all images by src
      slctr = "[src*=\"".concat(selectedPath.split('$domain=')[0], "\"]");
    } else {
      // eslint-disable-next-line prefer-destructuring
      slctr = selectedPath.split('##')[1];
    }

    if (slctr) {
      style = "".concat(slctr, "{display:none!important}");
    } else {
      src_log.error('Can`t block element: `selector` path is empty');
      return false;
    }

    if (!styleID) {
      // eslint-disable-next-line no-param-reassign
      styleID = blockedElementsStyleID;
    }

    var stylesElement = document.documentElement.querySelector("#".concat(styleID));

    if (stylesElement) {
      stylesElement.innerHTML = "".concat(stylesElement.innerHTML, " ").concat(style);
    } else {
      document.documentElement.appendChild(src_protectedApi.createStylesElement(style, getStyleNonce(), styleID));
    } // do not hide assistant div if the user wrote a rule
    // that blocks all div or iframe elements


    if (iframeAnchor) {
      iframeAnchor.style.setProperty('display', 'block', 'important');
    }

    return undefined;
  }; // show elements hidden by `hideElementsByPath` function


  var showHiddenElements = function showHiddenElements(styleID) {
    if (!styleID) {
      // eslint-disable-next-line no-param-reassign
      styleID = blockedElementsStyleID;
    }

    var stylesElement = document.documentElement.querySelector("#".concat(styleID));

    if (stylesElement) {
      stylesElement.parentNode.removeChild(stylesElement);
    }
  };

  var blockElement = function blockElement(path, addRule) {
    if (gm.ADG_addRule) {
      gm.ADG_addRule(path, function () {
        removeIframe();
        hideElementsByPath(path);
        bypassCache();
      });
    } else {
      if (!addRule) {
        src_log.error('Callback function `addRule` can\'t be undefined!');
      }

      addRule(path);
      removeIframe();
      hideElementsByPath(path);
      bypassCache();
    }
  };

  return {
    showDetailedMenu: showDetailedMenu,
    showSelectorMenu: showSelectorMenu,
    showSliderMenu: showSliderMenu,
    showBlockPreview: showBlockPreview,
    showSettingsMenu: showSettingsMenu,
    setButtonPosition: setButtonPosition,
    onCloseMenu: onCloseMenu,
    onShowMenuItem: onShowMenuItem,
    removeIframe: removeIframe,
    resizeSliderMenuToAdvanced: resizeSliderMenuToAdvanced,
    resizeSliderMenuToNormal: resizeSliderMenuToNormal,
    resizeIframe: resizeIframe,
    hideElementsByPath: hideElementsByPath,
    showHiddenElements: showHiddenElements,
    blockElement: blockElement
  };
}

/* harmony default export */ const iframe = (IframeController);
;// CONCATENATED MODULE: ./src/controllers/sliderMenuControllerMobile.js



/**
 * Slider menu controller mobile
 * @param addRule
 * @param iframe
 * @returns {{init: init}}
 * @constructor
 */

function SliderMenuControllerMobile(addRule, iframe) {
  var contentDocument = null;
  var selectedElement = null;
  var iframeCtrl = iframe;
  var nodeParentsCount = 0;
  var nodeChildsCount = 0;
  var parents;
  var children;
  var nodeNumber = 0;

  function showPreview() {
    adguard_selector.reset();

    if (this.classList.contains('active')) {
      removeClass(selectedElement, 'sg_hide_element');
      removeClass(this, 'active');
      adguard_selector.selectElement(selectedElement);
      contentDocument.querySelector('.adg-plus').removeAttribute('disabled');
      contentDocument.querySelector('.adg-minus').removeAttribute('disabled');
      contentDocument.querySelector('.adg-close').removeAttribute('disabled');
    } else {
      addClass(selectedElement, 'sg_hide_element');
      addClass(this, 'active');
      contentDocument.querySelector('.adg-plus').setAttribute('disabled', 'disabled');
      contentDocument.querySelector('.adg-minus').setAttribute('disabled', 'disabled');
      contentDocument.querySelector('.adg-close').setAttribute('disabled', 'disabled');
    }
  }

  var getUrlBlockAttribute = function getUrlBlockAttribute(element) {
    var urlBlockAttributes = ['src', 'data'];

    for (var i = 0; i < urlBlockAttributes.length; i += 1) {
      var attr = urlBlockAttributes[i];
      var value = element.getAttribute(attr);

      if (value) {
        return value;
      }
    }

    return null;
  };

  var getFilterText = function getFilterText() {
    var options = {
      urlMask: getUrlBlockAttribute(selectedElement),
      cssSelectorType: 'STRICT_FULL',
      isBlockOneDomain: false,
      url: document.location,
      ruleType: 'CSS'
    };
    return adguard_rules_constructor.constructRuleText(selectedElement, options);
  };

  var blockElement = function blockElement() {
    selectedElement.classList.remove('sg_hide_element');
    selectedElement.style.display = 'none';
    addRule(getFilterText());
    iframeCtrl.removeIframe();
  };

  var onSliderMove = function onSliderMove(element) {
    selectedElement = element;
    adguard_selector.selectElement(element);
  };

  var plus = function plus() {
    nodeNumber = nodeNumber + 1 > nodeParentsCount ? nodeNumber : nodeNumber + 1;

    if (nodeNumber >= 0) {
      if (parents[nodeNumber]) onSliderMove(parents[nodeNumber]); // eslint-disable-next-line no-bitwise
    } else if (children[~nodeNumber]) onSliderMove(children[~nodeNumber]);
  };

  var minus = function minus() {
    // TODO: rewrite this
    // eslint-disable-next-line no-unused-expressions, no-self-assign
    nodeNumber <= -nodeChildsCount ? nodeNumber = nodeNumber : nodeNumber -= 1;

    if (nodeNumber >= 0) {
      if (parents[nodeNumber]) onSliderMove(parents[nodeNumber]); // eslint-disable-next-line no-bitwise
    } else if (children[~nodeNumber]) onSliderMove(children[~nodeNumber]);
  };

  var bindEvents = function bindEvents() {
    var menuEvents = {
      '.adg-close': iframeCtrl.showSelectorMenu,
      '.adg-preview': showPreview,
      '.adg-accept': blockElement,
      '.adg-plus': plus,
      '.adg-minus': minus
    };
    Object.keys(menuEvents).forEach(function (item) {
      var elems = contentDocument.querySelectorAll(item);
      toArray(elems).forEach(function (elem) {
        return elem.addEventListener('click', menuEvents[item]);
      });
    });
    window.addEventListener('orientationchange', iframeCtrl.showSelectorMenu);
  };
  /*
   Called from IframeController._showMenuItem to initialize view
   */
  // eslint-disable-next-line no-shadow


  var init = function init(iframe, options) {
    selectedElement = options.element; // eslint-disable-next-line prefer-destructuring

    contentDocument = iframe.contentDocument;
    bindEvents();
    adguard_selector.selectElement(selectedElement);
    children = getAllChildren(selectedElement);
    parents = getParentsLevel(selectedElement);
    parents.splice(0, 0, selectedElement);
    nodeParentsCount = parents.length;
    nodeChildsCount = children.length;
  };

  return {
    init: init
  };
}
;// CONCATENATED MODULE: ./package.json
const package_namespaceObject = {"i8":"4.3.70"};
;// CONCATENATED MODULE: ./src/iframe.mobile.js
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 _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; }











/**
 * Manages iframe and it's content
 * @returns {{
 * showSelectorMenu: showSelectorMenu,
 * showSliderMenu: showSliderMenu,
 * setButtonPosition: setButtonPosition,
 * onCloseMenu: CustomEvent,
 * onShowMenuItem: CustomEvent,
 * removeIframe: removeIframe
 * }}
 * @constructor
 */

function IframeControllerMobile() {
  var iframe = null;
  var iframeElement = null;
  var currentItem = null;
  var onCloseMenu = new CustomEvent();
  var onShowMenuItem = new CustomEvent();
  var views = {};
  views['mobilePopup.html'] = HTML.popup;
  views['mobileMenu.html'] = HTML.mobile_menu;
  var defaultCSS = {
    clip: 'auto',
    'z-index': 2147483647
  };
  var defaultAttributes = {
    "class": adguard_selector.ignoreClassName(),
    frameBorder: 0,
    allowTransparency: 'true',
    id: 'iframe-x2eRYVVQRsG9'
  };

  var updateIframeAttrs = function updateIframeAttrs(attrs) {
    iframe.removeAttribute('style');
    iframe.removeAttribute('height');

    var attributes = _objectSpread(_objectSpread({}, defaultAttributes), attrs);

    Object.keys(attributes).forEach(function (item) {
      iframe.setAttribute(item, attributes[item]);
    });
  };

  var updateIframeStyles = function updateIframeStyles(styles) {
    var css = _objectSpread(_objectSpread({}, defaultCSS), styles);

    Object.keys(css).forEach(function (item) {
      iframe.style[item] = css[item];
    });
  };

  var createIframe = function createIframe(onIframeLoadCallback, styles, attrs) {
    src_log.debug('Creating iframe');

    if (document.querySelector("#".concat(defaultAttributes.id))) {
      src_log.error('Iframe already added');
      return;
    }

    iframe = src_protectedApi.createElement('iframe');
    iframe.addEventListener('load', function () {
      onIframeLoadCallback();
      updateIframeAttrs(attrs);
      updateIframeStyles(styles);
    });
    iframeElement = iframe;
    var adgStylesSelector = src_protectedApi.createStylesElement(CSS.selector, 'adg-styles-selector');

    if (adgStylesSelector) {
      document.documentElement.appendChild(adgStylesSelector);
    }

    document.documentElement.appendChild(iframeElement);
  };

  var appendContent = function appendContent(view) {
    var body = iframe.contentDocument.body;

    for (var i = 0; i < body.children.length; i += 1) {
      body.removeChild(body.children[i]);
    }

    body.appendChild(view);
  };

  var localize = function localize() {
    var elements = iframe.contentDocument.querySelectorAll('[i18n]');

    for (var i = 0; i < elements.length; i += 1) {
      var message = src_localization.getMessage(elements[i].getAttribute('i18n'));
      src_localization.translateElement(elements[i], message);
    }

    var elementsWithTitle = iframe.contentDocument.querySelectorAll('[i18n-title]');

    for (var j = 0; j < elementsWithTitle.length; j += 1) {
      var title = src_localization.getMessage(elementsWithTitle[j].getAttribute('i18n-title'));
      elementsWithTitle[j].setAttribute('title', title);
    }
  };

  var hideIframe = function hideIframe() {
    if (iframe) {
      iframe.style.display = 'none';
    }
  };

  var showIframe = function showIframe() {
    if (iframe) {
      iframe.style.display = 'block';
    }
  };

  var showMenuItem = function showMenuItem(viewName, controller, options, styles, attrs) {
    if (currentItem === viewName) {
      return;
    }

    var onIframeLoad = function onIframeLoad() {
      var frameElement = iframe;
      var view = src_protectedApi.createElement(views[viewName]);
      var iframeStyles = CSS.common + CSS.mobile;
      view.appendChild(src_protectedApi.createStylesElement(iframeStyles));
      appendContent(view);
      localize();

      if (!options) {
        // eslint-disable-next-line no-param-reassign
        options = {};
      }

      if (controller) {
        controller.init(frameElement, options);
      }

      updateIframeAttrs(attrs);
      updateIframeStyles(styles);
      currentItem = viewName;
      onShowMenuItem.notify();
      showIframe();
    };

    if (!iframe) {
      var adgStylesSelector = src_protectedApi.createStylesElement(CSS.selector, 'adg-styles-selector');

      if (adgStylesSelector) {
        document.documentElement.appendChild(adgStylesSelector);
      }

      createIframe(onIframeLoad, styles, attrs);
      return;
    }

    onIframeLoad();
  };

  var startSelect = function startSelect() {
    hideIframe();
    var controller = new SelectorMenuController(src_ioc.get('iframeController'));
    controller.startSelector();
  };

  var showSelectorMenu = function showSelectorMenu() {
    hideIframe();
    adguard_selector.close();
    var styles = {
      position: 'fixed',
      left: 0,
      top: 0,
      right: 0,
      bottom: 0,
      margin: 'auto',
      'border-radius': '2px',
      background: 'transparent',
      width: '40vmax',
      height: '40vmax'
    }; // eslint-disable-next-line no-use-before-define

    showMenuItem('mobilePopup.html', mobilePopupButtonsInit(), null, styles);
  }; // e.isTrusted checking for prevent programmatically events
  // see: https://github.com/AdguardTeam/AdguardAssistant/issues/134


  var removeIframe = function removeIframe(e) {
    if (e && e.isTrusted === false) {
      return false;
    }

    if (!iframeElement) {
      return false;
    }

    document.removeEventListener('click', removeIframe);
    window.removeEventListener('orientationchange', showSelectorMenu);
    document.documentElement.removeChild(iframeElement);
    iframe = null;
    iframeElement = null;
    currentItem = null;
    adguard_selector.close();
    onCloseMenu.notify();
    return undefined;
  };

  var mobilePopupButtonsInit = function mobilePopupButtonsInit() {
    return {
      init: function init() {
        var startSelectMode = iframe.contentDocument.querySelector('.start-select-mode');
        var cancelSelectMode = iframe.contentDocument.querySelector('.cancel-select-mode');
        var appVersionElem = iframe.contentDocument.querySelector('#appVersion');
        startSelectMode.addEventListener('click', startSelect);
        cancelSelectMode.addEventListener('click', removeIframe);
        appVersionElem.innerText = "v".concat(package_namespaceObject.i8);
      }
    };
  };

  var showSliderMenu = function showSliderMenu(element) {
    var controller = new SliderMenuControllerMobile(src_ioc.get('addRule'), src_ioc.get('iframeController'));
    var options = {
      element: element
    };
    var styles = {
      position: 'fixed',
      bottom: 0,
      left: '50%',
      transform: 'translateX(-50%)',
      width: '70vw',
      height: '27vw'
    };
    showMenuItem('mobileMenu.html', controller, options, styles);
  };

  return {
    showSelectorMenu: showSelectorMenu,
    showSliderMenu: showSliderMenu,
    onCloseMenu: onCloseMenu,
    onShowMenuItem: onShowMenuItem,
    removeIframe: removeIframe,
    startSelect: startSelect
  };
}
;// CONCATENATED MODULE: ./src/embedded.js
/* global AdguardSettings */






/* embedded script for extensions */

/*
 * adguardAssistantExtended main function is for desktop browsers
 */

function adguardAssistantExtended() {
  var adguardSettings = typeof AdguardSettings === 'undefined' ? null : AdguardSettings;
  src_wot.registerWotEventHandler();
  src_settings.setAdguardSettings(adguardSettings);
  var iframeController = new iframe();
  src_ioc.register('iframeController', iframeController);
  return {
    start: function start(element, callback) {
      src_ioc.register('addRule', src_protectedApi.functionBind.call(callback, this));

      if (element) {
        iframeController.showSelectorMenu();
        iframeController.showSliderMenu(element);
      } else {
        iframeController.showSelectorMenu();
      }
    },
    close: function close() {
      iframeController.removeIframe();
    }
  };
}
/*
 * adguardAssistantMini function is for mobile browsers
 */

function adguardAssistantMini() {
  var iframeController = new IframeControllerMobile();
  src_ioc.register('iframeController', iframeController);
  return {
    start: function start(element, callback) {
      src_ioc.register('addRule', src_protectedApi.functionBind.call(callback, this));

      if (element) {
        iframeController.showSelectorMenu();
        iframeController.showSliderMenu(element);
      } else {
        iframeController.showSelectorMenu();
      }
    },
    close: function close() {
      iframeController.removeIframe();
    }
  };
}
;// CONCATENATED MODULE: ./src/helpers.js
var mobileReg = /(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|ipad|iris|kindle|Android|Silk|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i;
var isMobile = function isMobile(ua) {
  return mobileReg.test(ua);
};
;// CONCATENATED MODULE: ./src/index.js


var adguardAssistant = isMobile(navigator.userAgent) ? adguardAssistantMini : adguardAssistantExtended;
})();

/******/ 	return __nested_webpack_exports__;
/******/ })()
;
});

/***/ }),

/***/ 54274:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";

var isCallable = __webpack_require__(35340);
var tryToString = __webpack_require__(82910);

var $TypeError = TypeError;

// `Assert: IsCallable(argument) is true`
module.exports = function (argument) {
  if (isCallable(argument)) return argument;
  throw $TypeError(tryToString(argument) + ' is not a function');
};


/***/ }),

/***/ 21704:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";

var isCallable = __webpack_require__(35340);

var $String = String;
var $TypeError = TypeError;

module.exports = function (argument) {
  if (typeof argument == 'object' || isCallable(argument)) return argument;
  throw $TypeError("Can't set " + $String(argument) + ' as a prototype');
};


/***/ }),

/***/ 70517:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";

var isObject = __webpack_require__(48159);

var $String = String;
var $TypeError = TypeError;

// `Assert: Type(argument) is Object`
module.exports = function (argument) {
  if (isObject(argument)) return argument;
  throw $TypeError($String(argument) + ' is not an object');
};


/***/ }),

/***/ 6170:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";

var toIndexedObject = __webpack_require__(65065);
var toAbsoluteIndex = __webpack_require__(3343);
var lengthOfArrayLike = __webpack_require__(35119);

// `Array.prototype.{ indexOf, includes }` methods implementation
var createMethod = function (IS_INCLUDES) {
  return function ($this, el, fromIndex) {
    var O = toIndexedObject($this);
    var length = lengthOfArrayLike(O);
    var index = toAbsoluteIndex(fromIndex, length);
    var value;
    // Array#includes uses SameValueZero equality algorithm
    // eslint-disable-next-line no-self-compare -- NaN check
    if (IS_INCLUDES && el != el) while (length > index) {
      value = O[index++];
      // eslint-disable-next-line no-self-compare -- NaN check
      if (value != value) return true;
    // Array#indexOf ignores holes, Array#includes - not
    } else for (;length > index; index++) {
      if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
    } return !IS_INCLUDES && -1;
  };
};

module.exports = {
  // `Array.prototype.includes` method
  // https://tc39.es/ecma262/#sec-array.prototype.includes
  includes: createMethod(true),
  // `Array.prototype.indexOf` method
  // https://tc39.es/ecma262/#sec-array.prototype.indexof
  indexOf: createMethod(false)
};


/***/ }),

/***/ 95258:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";

var uncurryThis = __webpack_require__(76891);

var toString = uncurryThis({}.toString);
var stringSlice = uncurryThis(''.slice);

module.exports = function (it) {
  return stringSlice(toString(it), 8, -1);
};


/***/ }),

/***/ 34688:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";

var TO_STRING_TAG_SUPPORT = __webpack_require__(24278);
var isCallable = __webpack_require__(35340);
var classofRaw = __webpack_require__(95258);
var wellKnownSymbol = __webpack_require__(37366);

var TO_STRING_TAG = wellKnownSymbol('toStringTag');
var $Object = Object;

// ES3 wrong here
var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';

// fallback for IE11 Script Access Denied error
var tryGet = function (it, key) {
  try {
    return it[key];
  } catch (error) { /* empty */ }
};

// getting tag from ES6+ `Object.prototype.toString`
module.exports = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {
  var O, tag, result;
  return it === undefined ? 'Undefined' : it === null ? 'Null'
    // @@toStringTag case
    : typeof (tag = tryGet(O = $Object(it), TO_STRING_TAG)) == 'string' ? tag
    // builtinTag case
    : CORRECT_ARGUMENTS ? classofRaw(O)
    // ES3 arguments fallback
    : (result = classofRaw(O)) == 'Object' && isCallable(O.callee) ? 'Arguments' : result;
};


/***/ }),

/***/ 28932:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";

var hasOwn = __webpack_require__(93120);
var ownKeys = __webpack_require__(55275);
var getOwnPropertyDescriptorModule = __webpack_require__(67685);
var definePropertyModule = __webpack_require__(70784);

module.exports = function (target, source, exceptions) {
  var keys = ownKeys(source);
  var defineProperty = definePropertyModule.f;
  var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
  for (var i = 0; i < keys.length; i++) {
    var key = keys[i];
    if (!hasOwn(target, key) && !(exceptions && hasOwn(exceptions, key))) {
      defineProperty(target, key, getOwnPropertyDescriptor(source, key));
    }
  }
};


/***/ }),

/***/ 29671:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";

var DESCRIPTORS = __webpack_require__(97581);
var definePropertyModule = __webpack_require__(70784);
var createPropertyDescriptor = __webpack_require__(87567);

module.exports = DESCRIPTORS ? function (object, key, value) {
  return definePropertyModule.f(object, key, createPropertyDescriptor(1, value));
} : function (object, key, value) {
  object[key] = value;
  return object;
};


/***/ }),

/***/ 87567:
/***/ ((module) => {

"use strict";

module.exports = function (bitmap, value) {
  return {
    enumerable: !(bitmap & 1),
    configurable: !(bitmap & 2),
    writable: !(bitmap & 4),
    value: value
  };
};


/***/ }),

/***/ 70636:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";

var makeBuiltIn = __webpack_require__(96386);
var defineProperty = __webpack_require__(70784);

module.exports = function (target, name, descriptor) {
  if (descriptor.get) makeBuiltIn(descriptor.get, name, { getter: true });
  if (descriptor.set) makeBuiltIn(descriptor.set, name, { setter: true });
  return defineProperty.f(target, name, descriptor);
};


/***/ }),

/***/ 27919:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";

var isCallable = __webpack_require__(35340);
var definePropertyModule = __webpack_require__(70784);
var makeBuiltIn = __webpack_require__(96386);
var defineGlobalProperty = __webpack_require__(43637);

module.exports = function (O, key, value, options) {
  if (!options) options = {};
  var simple = options.enumerable;
  var name = options.name !== undefined ? options.name : key;
  if (isCallable(value)) makeBuiltIn(value, name, options);
  if (options.global) {
    if (simple) O[key] = value;
    else defineGlobalProperty(key, value);
  } else {
    try {
      if (!options.unsafe) delete O[key];
      else if (O[key]) simple = true;
    } catch (error) { /* empty */ }
    if (simple) O[key] = value;
    else definePropertyModule.f(O, key, {
      value: value,
      enumerable: false,
      configurable: !options.nonConfigurable,
      writable: !options.nonWritable
    });
  } return O;
};


/***/ }),

/***/ 43637:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";

var global = __webpack_require__(17773);

// eslint-disable-next-line es/no-object-defineproperty -- safe
var defineProperty = Object.defineProperty;

module.exports = function (key, value) {
  try {
    defineProperty(global, key, { value: value, configurable: true, writable: true });
  } catch (error) {
    global[key] = value;
  } return value;
};


/***/ }),

/***/ 97581:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";

var fails = __webpack_require__(62728);

// Detect IE8's incomplete defineProperty implementation
module.exports = !fails(function () {
  // eslint-disable-next-line es/no-object-defineproperty -- required for testing
  return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
});


/***/ }),

/***/ 34900:
/***/ ((module) => {

"use strict";

var documentAll = typeof document == 'object' && document.all;

// https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot
// eslint-disable-next-line unicorn/no-typeof-undefined -- required for testing
var IS_HTMLDDA = typeof documentAll == 'undefined' && documentAll !== undefined;

module.exports = {
  all: documentAll,
  IS_HTMLDDA: IS_HTMLDDA
};


/***/ }),

/***/ 63019:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";

var global = __webpack_require__(17773);
var isObject = __webpack_require__(48159);

var document = global.document;
// typeof document.createElement is 'object' in old IE
var EXISTS = isObject(document) && isObject(document.createElement);

module.exports = function (it) {
  return EXISTS ? document.createElement(it) : {};
};


/***/ }),

/***/ 64857:
/***/ ((module) => {

"use strict";

module.exports = typeof navigator != 'undefined' && String(navigator.userAgent) || '';


/***/ }),

/***/ 48051:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";

var global = __webpack_require__(17773);
var userAgent = __webpack_require__(64857);

var process = global.process;
var Deno = global.Deno;
var versions = process && process.versions || Deno && Deno.version;
var v8 = versions && versions.v8;
var match, version;

if (v8) {
  match = v8.split('.');
  // in old Chrome, versions of V8 isn't V8 = Chrome / 10
  // but their correct versions are not interesting for us
  version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
}

// BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`
// so check `userAgent` even if `.v8` exists, but 0
if (!version && userAgent) {
  match = userAgent.match(/Edge\/(\d+)/);
  if (!match || match[1] >= 74) {
    match = userAgent.match(/Chrome\/(\d+)/);
    if (match) version = +match[1];
  }
}

module.exports = version;


/***/ }),

/***/ 62071:
/***/ ((module) => {

"use strict";

// IE8- don't enum bug keys
module.exports = [
  'constructor',
  'hasOwnProperty',
  'isPrototypeOf',
  'propertyIsEnumerable',
  'toLocaleString',
  'toString',
  'valueOf'
];


/***/ }),

/***/ 70179:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";

var uncurryThis = __webpack_require__(76891);

var $Error = Error;
var replace = uncurryThis(''.replace);

var TEST = (function (arg) { return String($Error(arg).stack); })('zxcasd');
// eslint-disable-next-line redos/no-vulnerable -- safe
var V8_OR_CHAKRA_STACK_ENTRY = /\n\s*at [^:]*:[^\n]*/;
var IS_V8_OR_CHAKRA_STACK = V8_OR_CHAKRA_STACK_ENTRY.test(TEST);

module.exports = function (stack, dropEntries) {
  if (IS_V8_OR_CHAKRA_STACK && typeof stack == 'string' && !$Error.prepareStackTrace) {
    while (dropEntries--) stack = replace(stack, V8_OR_CHAKRA_STACK_ENTRY, '');
  } return stack;
};


/***/ }),

/***/ 11496:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";

var createNonEnumerableProperty = __webpack_require__(29671);
var clearErrorStack = __webpack_require__(70179);
var ERROR_STACK_INSTALLABLE = __webpack_require__(7791);

// non-standard V8
var captureStackTrace = Error.captureStackTrace;

module.exports = function (error, C, stack, dropEntries) {
  if (ERROR_STACK_INSTALLABLE) {
    if (captureStackTrace) captureStackTrace(error, C);
    else createNonEnumerableProperty(error, 'stack', clearErrorStack(stack, dropEntries));
  }
};


/***/ }),

/***/ 7791:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";

var fails = __webpack_require__(62728);
var createPropertyDescriptor = __webpack_require__(87567);

module.exports = !fails(function () {
  var error = Error('a');
  if (!('stack' in error)) return true;
  // eslint-disable-next-line es/no-object-defineproperty -- safe
  Object.defineProperty(error, 'stack', createPropertyDescriptor(1, 7));
  return error.stack !== 7;
});


/***/ }),

/***/ 24134:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";

var global = __webpack_require__(17773);
var getOwnPropertyDescriptor = (__webpack_require__(67685).f);
var createNonEnumerableProperty = __webpack_require__(29671);
var defineBuiltIn = __webpack_require__(27919);
var defineGlobalProperty = __webpack_require__(43637);
var copyConstructorProperties = __webpack_require__(28932);
var isForced = __webpack_require__(68465);

/*
  options.target         - name of the target object
  options.global         - target is the global object
  options.stat           - export as static methods of target
  options.proto          - export as prototype methods of target
  options.real           - real prototype method for the `pure` version
  options.forced         - export even if the native feature is available
  options.bind           - bind methods to the target, required for the `pure` version
  options.wrap           - wrap constructors to preventing global pollution, required for the `pure` version
  options.unsafe         - use the simple assignment of property instead of delete + defineProperty
  options.sham           - add a flag to not completely full polyfills
  options.enumerable     - export as enumerable property
  options.dontCallGetSet - prevent calling a getter on target
  options.name           - the .name of the function if it does not match the key
*/
module.exports = function (options, source) {
  var TARGET = options.target;
  var GLOBAL = options.global;
  var STATIC = options.stat;
  var FORCED, target, key, targetProperty, sourceProperty, descriptor;
  if (GLOBAL) {
    target = global;
  } else if (STATIC) {
    target = global[TARGET] || defineGlobalProperty(TARGET, {});
  } else {
    target = (global[TARGET] || {}).prototype;
  }
  if (target) for (key in source) {
    sourceProperty = source[key];
    if (options.dontCallGetSet) {
      descriptor = getOwnPropertyDescriptor(target, key);
      targetProperty = descriptor && descriptor.value;
    } else targetProperty = target[key];
    FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
    // contained in target
    if (!FORCED && targetProperty !== undefined) {
      if (typeof sourceProperty == typeof targetProperty) continue;
      copyConstructorProperties(sourceProperty, targetProperty);
    }
    // add a flag to not completely full polyfills
    if (options.sham || (targetProperty && targetProperty.sham)) {
      createNonEnumerableProperty(sourceProperty, 'sham', true);
    }
    defineBuiltIn(target, key, sourceProperty, options);
  }
};


/***/ }),

/***/ 62728:
/***/ ((module) => {

"use strict";

module.exports = function (exec) {
  try {
    return !!exec();
  } catch (error) {
    return true;
  }
};


/***/ }),

/***/ 72504:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";

var NATIVE_BIND = __webpack_require__(15257);

var FunctionPrototype = Function.prototype;
var apply = FunctionPrototype.apply;
var call = FunctionPrototype.call;

// eslint-disable-next-line es/no-reflect -- safe
module.exports = typeof Reflect == 'object' && Reflect.apply || (NATIVE_BIND ? call.bind(apply) : function () {
  return call.apply(apply, arguments);
});


/***/ }),

/***/ 15257:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";

var fails = __webpack_require__(62728);

module.exports = !fails(function () {
  // eslint-disable-next-line es/no-function-prototype-bind -- safe
  var test = (function () { /* empty */ }).bind();
  // eslint-disable-next-line no-prototype-builtins -- safe
  return typeof test != 'function' || test.hasOwnProperty('prototype');
});


/***/ }),

/***/ 21327:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";

var NATIVE_BIND = __webpack_require__(15257);

var call = Function.prototype.call;

module.exports = NATIVE_BIND ? call.bind(call) : function () {
  return call.apply(call, arguments);
};


/***/ }),

/***/ 23096:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";

var DESCRIPTORS = __webpack_require__(97581);
var hasOwn = __webpack_require__(93120);

var FunctionPrototype = Function.prototype;
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
var getDescriptor = DESCRIPTORS && Object.getOwnPropertyDescriptor;

var EXISTS = hasOwn(FunctionPrototype, 'name');
// additional protection from minified / mangled / dropped function names
var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
var CONFIGURABLE = EXISTS && (!DESCRIPTORS || (DESCRIPTORS && getDescriptor(FunctionPrototype, 'name').configurable));

module.exports = {
  EXISTS: EXISTS,
  PROPER: PROPER,
  CONFIGURABLE: CONFIGURABLE
};


/***/ }),

/***/ 54809:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";

var uncurryThis = __webpack_require__(76891);
var aCallable = __webpack_require__(54274);

module.exports = function (object, key, method) {
  try {
    // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
    return uncurryThis(aCallable(Object.getOwnPropertyDescriptor(object, key)[method]));
  } catch (error) { /* empty */ }
};


/***/ }),

/***/ 76891:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";

var NATIVE_BIND = __webpack_require__(15257);

var FunctionPrototype = Function.prototype;
var call = FunctionPrototype.call;
var uncurryThisWithBind = NATIVE_BIND && FunctionPrototype.bind.bind(call, call);

module.exports = NATIVE_BIND ? uncurryThisWithBind : function (fn) {
  return function () {
    return call.apply(fn, arguments);
  };
};


/***/ }),

/***/ 33492:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";

var global = __webpack_require__(17773);
var isCallable = __webpack_require__(35340);

var aFunction = function (argument) {
  return isCallable(argument) ? argument : undefined;
};

module.exports = function (namespace, method) {
  return arguments.length < 2 ? aFunction(global[namespace]) : global[namespace] && global[namespace][method];
};


/***/ }),

/***/ 79570:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";

var aCallable = __webpack_require__(54274);
var isNullOrUndefined = __webpack_require__(8276);

// `GetMethod` abstract operation
// https://tc39.es/ecma262/#sec-getmethod
module.exports = function (V, P) {
  var func = V[P];
  return isNullOrUndefined(func) ? undefined : aCallable(func);
};


/***/ }),

/***/ 17773:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

"use strict";

var check = function (it) {
  return it && it.Math == Math && it;
};

// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
module.exports =
  // eslint-disable-next-line es/no-global-this -- safe
  check(typeof globalThis == 'object' && globalThis) ||
  check(typeof window == 'object' && window) ||
  // eslint-disable-next-line no-restricted-globals -- safe
  check(typeof self == 'object' && self) ||
  check(typeof __webpack_require__.g == 'object' && __webpack_require__.g) ||
  // eslint-disable-next-line no-new-func -- fallback
  (function () { return this; })() || this || Function('return this')();


/***/ }),

/***/ 93120:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";

var uncurryThis = __webpack_require__(76891);
var toObject = __webpack_require__(80358);

var hasOwnProperty = uncurryThis({}.hasOwnProperty);

// `HasOwnProperty` abstract operation
// https://tc39.es/ecma262/#sec-hasownproperty
// eslint-disable-next-line es/no-object-hasown -- safe
module.exports = Object.hasOwn || function hasOwn(it, key) {
  return hasOwnProperty(toObject(it), key);
};


/***/ }),

/***/ 43698:
/***/ ((module) => {

"use strict";

module.exports = {};


/***/ }),

/***/ 717:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";

var DESCRIPTORS = __webpack_require__(97581);
var fails = __webpack_require__(62728);
var createElement = __webpack_require__(63019);

// Thanks to IE8 for its funny defineProperty
module.exports = !DESCRIPTORS && !fails(function () {
  // eslint-disable-next-line es/no-object-defineproperty -- required for testing
  return Object.defineProperty(createElement('div'), 'a', {
    get: function () { return 7; }
  }).a != 7;
});


/***/ }),

/***/ 91546:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";

var uncurryThis = __webpack_require__(76891);
var fails = __webpack_require__(62728);
var classof = __webpack_require__(95258);

var $Object = Object;
var split = uncurryThis(''.split);

// fallback for non-array-like ES3 and non-enumerable old V8 strings
module.exports = fails(function () {
  // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
  // eslint-disable-next-line no-prototype-builtins -- safe
  return !$Object('z').propertyIsEnumerable(0);
}) ? function (it) {
  return classof(it) == 'String' ? split(it, '') : $Object(it);
} : $Object;


/***/ }),

/***/ 19525:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";

var isCallable = __webpack_require__(35340);
var isObject = __webpack_require__(48159);
var setPrototypeOf = __webpack_require__(36718);

// makes subclassing work correct for wrapped built-ins
module.exports = function ($this, dummy, Wrapper) {
  var NewTarget, NewTargetPrototype;
  if (
    // it can work only with native `setPrototypeOf`
    setPrototypeOf &&
    // we haven't completely correct pre-ES6 way for getting `new.target`, so use this
    isCallable(NewTarget = dummy.constructor) &&
    NewTarget !== Wrapper &&
    isObject(NewTargetPrototype = NewTarget.prototype) &&
    NewTargetPrototype !== Wrapper.prototype
  ) setPrototypeOf($this, NewTargetPrototype);
  return $this;
};


/***/ }),

/***/ 21538:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";

var uncurryThis = __webpack_require__(76891);
var isCallable = __webpack_require__(35340);
var store = __webpack_require__(88655);

var functionToString = uncurryThis(Function.toString);

// this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
if (!isCallable(store.inspectSource)) {
  store.inspectSource = function (it) {
    return functionToString(it);
  };
}

module.exports = store.inspectSource;


/***/ }),

/***/ 59710:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";

var isObject = __webpack_require__(48159);
var createNonEnumerableProperty = __webpack_require__(29671);

// `InstallErrorCause` abstract operation
// https://tc39.es/proposal-error-cause/#sec-errorobjects-install-error-cause
module.exports = function (O, options) {
  if (isObject(options) && 'cause' in options) {
    createNonEnumerableProperty(O, 'cause', options.cause);
  }
};


/***/ }),

/***/ 14928:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";

var NATIVE_WEAK_MAP = __webpack_require__(40114);
var global = __webpack_require__(17773);
var isObject = __webpack_require__(48159);
var createNonEnumerableProperty = __webpack_require__(29671);
var hasOwn = __webpack_require__(93120);
var shared = __webpack_require__(88655);
var sharedKey = __webpack_require__(95174);
var hiddenKeys = __webpack_require__(43698);

var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
var TypeError = global.TypeError;
var WeakMap = global.WeakMap;
var set, get, has;

var enforce = function (it) {
  return has(it) ? get(it) : set(it, {});
};

var getterFor = function (TYPE) {
  return function (it) {
    var state;
    if (!isObject(it) || (state = get(it)).type !== TYPE) {
      throw TypeError('Incompatible receiver, ' + TYPE + ' required');
    } return state;
  };
};

if (NATIVE_WEAK_MAP || shared.state) {
  var store = shared.state || (shared.state = new WeakMap());
  /* eslint-disable no-self-assign -- prototype methods protection */
  store.get = store.get;
  store.has = store.has;
  store.set = store.set;
  /* eslint-enable no-self-assign -- prototype methods protection */
  set = function (it, metadata) {
    if (store.has(it)) throw TypeError(OBJECT_ALREADY_INITIALIZED);
    metadata.facade = it;
    store.set(it, metadata);
    return metadata;
  };
  get = function (it) {
    return store.get(it) || {};
  };
  has = function (it) {
    return store.has(it);
  };
} else {
  var STATE = sharedKey('state');
  hiddenKeys[STATE] = true;
  set = function (it, metadata) {
    if (hasOwn(it, STATE)) throw TypeError(OBJECT_ALREADY_INITIALIZED);
    metadata.facade = it;
    createNonEnumerableProperty(it, STATE, metadata);
    return metadata;
  };
  get = function (it) {
    return hasOwn(it, STATE) ? it[STATE] : {};
  };
  has = function (it) {
    return hasOwn(it, STATE);
  };
}

module.exports = {
  set: set,
  get: get,
  has: has,
  enforce: enforce,
  getterFor: getterFor
};


/***/ }),

/***/ 35340:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";

var $documentAll = __webpack_require__(34900);

var documentAll = $documentAll.all;

// `IsCallable` abstract operation
// https://tc39.es/ecma262/#sec-iscallable
module.exports = $documentAll.IS_HTMLDDA ? function (argument) {
  return typeof argument == 'function' || argument === documentAll;
} : function (argument) {
  return typeof argument == 'function';
};


/***/ }),

/***/ 68465:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";

var fails = __webpack_require__(62728);
var isCallable = __webpack_require__(35340);

var replacement = /#|\.prototype\./;

var isForced = function (feature, detection) {
  var value = data[normalize(feature)];
  return value == POLYFILL ? true
    : value == NATIVE ? false
    : isCallable(detection) ? fails(detection)
    : !!detection;
};

var normalize = isForced.normalize = function (string) {
  return String(string).replace(replacement, '.').toLowerCase();
};

var data = isForced.data = {};
var NATIVE = isForced.NATIVE = 'N';
var POLYFILL = isForced.POLYFILL = 'P';

module.exports = isForced;


/***/ }),

/***/ 8276:
/***/ ((module) => {

"use strict";

// we can't use just `it == null` since of `document.all` special case
// https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot-aec
module.exports = function (it) {
  return it === null || it === undefined;
};


/***/ }),

/***/ 48159:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";

var isCallable = __webpack_require__(35340);
var $documentAll = __webpack_require__(34900);

var documentAll = $documentAll.all;

module.exports = $documentAll.IS_HTMLDDA ? function (it) {
  return typeof it == 'object' ? it !== null : isCallable(it) || it === documentAll;
} : function (it) {
  return typeof it == 'object' ? it !== null : isCallable(it);
};


/***/ }),

/***/ 37259:
/***/ ((module) => {

"use strict";

module.exports = false;


/***/ }),

/***/ 48136:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";

var getBuiltIn = __webpack_require__(33492);
var isCallable = __webpack_require__(35340);
var isPrototypeOf = __webpack_require__(85726);
var USE_SYMBOL_AS_UID = __webpack_require__(14167);

var $Object = Object;

module.exports = USE_SYMBOL_AS_UID ? function (it) {
  return typeof it == 'symbol';
} : function (it) {
  var $Symbol = getBuiltIn('Symbol');
  return isCallable($Symbol) && isPrototypeOf($Symbol.prototype, $Object(it));
};


/***/ }),

/***/ 35119:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";

var toLength = __webpack_require__(93292);

// `LengthOfArrayLike` abstract operation
// https://tc39.es/ecma262/#sec-lengthofarraylike
module.exports = function (obj) {
  return toLength(obj.length);
};


/***/ }),

/***/ 96386:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";

var uncurryThis = __webpack_require__(76891);
var fails = __webpack_require__(62728);
var isCallable = __webpack_require__(35340);
var hasOwn = __webpack_require__(93120);
var DESCRIPTORS = __webpack_require__(97581);
var CONFIGURABLE_FUNCTION_NAME = (__webpack_require__(23096).CONFIGURABLE);
var inspectSource = __webpack_require__(21538);
var InternalStateModule = __webpack_require__(14928);

var enforceInternalState = InternalStateModule.enforce;
var getInternalState = InternalStateModule.get;
var $String = String;
// eslint-disable-next-line es/no-object-defineproperty -- safe
var defineProperty = Object.defineProperty;
var stringSlice = uncurryThis(''.slice);
var replace = uncurryThis(''.replace);
var join = uncurryThis([].join);

var CONFIGURABLE_LENGTH = DESCRIPTORS && !fails(function () {
  return defineProperty(function () { /* empty */ }, 'length', { value: 8 }).length !== 8;
});

var TEMPLATE = String(String).split('String');

var makeBuiltIn = module.exports = function (value, name, options) {
  if (stringSlice($String(name), 0, 7) === 'Symbol(') {
    name = '[' + replace($String(name), /^Symbol\(([^)]*)\)/, '$1') + ']';
  }
  if (options && options.getter) name = 'get ' + name;
  if (options && options.setter) name = 'set ' + name;
  if (!hasOwn(value, 'name') || (CONFIGURABLE_FUNCTION_NAME && value.name !== name)) {
    if (DESCRIPTORS) defineProperty(value, 'name', { value: name, configurable: true });
    else value.name = name;
  }
  if (CONFIGURABLE_LENGTH && options && hasOwn(options, 'arity') && value.length !== options.arity) {
    defineProperty(value, 'length', { value: options.arity });
  }
  try {
    if (options && hasOwn(options, 'constructor') && options.constructor) {
      if (DESCRIPTORS) defineProperty(value, 'prototype', { writable: false });
    // in V8 ~ Chrome 53, prototypes of some methods, like `Array.prototype.values`, are non-writable
    } else if (value.prototype) value.prototype = undefined;
  } catch (error) { /* empty */ }
  var state = enforceInternalState(value);
  if (!hasOwn(state, 'source')) {
    state.source = join(TEMPLATE, typeof name == 'string' ? name : '');
  } return value;
};

// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
// eslint-disable-next-line no-extend-native -- required
Function.prototype.toString = makeBuiltIn(function toString() {
  return isCallable(this) && getInternalState(this).source || inspectSource(this);
}, 'toString');


/***/ }),

/***/ 54279:
/***/ ((module) => {

"use strict";

var ceil = Math.ceil;
var floor = Math.floor;

// `Math.trunc` method
// https://tc39.es/ecma262/#sec-math.trunc
// eslint-disable-next-line es/no-math-trunc -- safe
module.exports = Math.trunc || function trunc(x) {
  var n = +x;
  return (n > 0 ? floor : ceil)(n);
};


/***/ }),

/***/ 21160:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";

var toString = __webpack_require__(87257);

module.exports = function (argument, $default) {
  return argument === undefined ? arguments.length < 2 ? '' : $default : toString(argument);
};


/***/ }),

/***/ 70784:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";

var DESCRIPTORS = __webpack_require__(97581);
var IE8_DOM_DEFINE = __webpack_require__(717);
var V8_PROTOTYPE_DEFINE_BUG = __webpack_require__(74060);
var anObject = __webpack_require__(70517);
var toPropertyKey = __webpack_require__(3255);

var $TypeError = TypeError;
// eslint-disable-next-line es/no-object-defineproperty -- safe
var $defineProperty = Object.defineProperty;
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
var ENUMERABLE = 'enumerable';
var CONFIGURABLE = 'configurable';
var WRITABLE = 'writable';

// `Object.defineProperty` method
// https://tc39.es/ecma262/#sec-object.defineproperty
exports.f = DESCRIPTORS ? V8_PROTOTYPE_DEFINE_BUG ? function defineProperty(O, P, Attributes) {
  anObject(O);
  P = toPropertyKey(P);
  anObject(Attributes);
  if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
    var current = $getOwnPropertyDescriptor(O, P);
    if (current && current[WRITABLE]) {
      O[P] = Attributes.value;
      Attributes = {
        configurable: CONFIGURABLE in Attributes ? Attributes[CONFIGURABLE] : current[CONFIGURABLE],
        enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
        writable: false
      };
    }
  } return $defineProperty(O, P, Attributes);
} : $defineProperty : function defineProperty(O, P, Attributes) {
  anObject(O);
  P = toPropertyKey(P);
  anObject(Attributes);
  if (IE8_DOM_DEFINE) try {
    return $defineProperty(O, P, Attributes);
  } catch (error) { /* empty */ }
  if ('get' in Attributes || 'set' in Attributes) throw $TypeError('Accessors not supported');
  if ('value' in Attributes) O[P] = Attributes.value;
  return O;
};


/***/ }),

/***/ 67685:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";

var DESCRIPTORS = __webpack_require__(97581);
var call = __webpack_require__(21327);
var propertyIsEnumerableModule = __webpack_require__(79804);
var createPropertyDescriptor = __webpack_require__(87567);
var toIndexedObject = __webpack_require__(65065);
var toPropertyKey = __webpack_require__(3255);
var hasOwn = __webpack_require__(93120);
var IE8_DOM_DEFINE = __webpack_require__(717);

// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;

// `Object.getOwnPropertyDescriptor` method
// https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
exports.f = DESCRIPTORS ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
  O = toIndexedObject(O);
  P = toPropertyKey(P);
  if (IE8_DOM_DEFINE) try {
    return $getOwnPropertyDescriptor(O, P);
  } catch (error) { /* empty */ }
  if (hasOwn(O, P)) return createPropertyDescriptor(!call(propertyIsEnumerableModule.f, O, P), O[P]);
};


/***/ }),

/***/ 94255:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";

var internalObjectKeys = __webpack_require__(87122);
var enumBugKeys = __webpack_require__(62071);

var hiddenKeys = enumBugKeys.concat('length', 'prototype');

// `Object.getOwnPropertyNames` method
// https://tc39.es/ecma262/#sec-object.getownpropertynames
// eslint-disable-next-line es/no-object-getownpropertynames -- safe
exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
  return internalObjectKeys(O, hiddenKeys);
};


/***/ }),

/***/ 77489:
/***/ ((__unused_webpack_module, exports) => {

"use strict";

// eslint-disable-next-line es/no-object-getownpropertysymbols -- safe
exports.f = Object.getOwnPropertySymbols;


/***/ }),

/***/ 85726:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";

var uncurryThis = __webpack_require__(76891);

module.exports = uncurryThis({}.isPrototypeOf);


/***/ }),

/***/ 87122:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";

var uncurryThis = __webpack_require__(76891);
var hasOwn = __webpack_require__(93120);
var toIndexedObject = __webpack_require__(65065);
var indexOf = (__webpack_require__(6170).indexOf);
var hiddenKeys = __webpack_require__(43698);

var push = uncurryThis([].push);

module.exports = function (object, names) {
  var O = toIndexedObject(object);
  var i = 0;
  var result = [];
  var key;
  for (key in O) !hasOwn(hiddenKeys, key) && hasOwn(O, key) && push(result, key);
  // Don't enum bug & hidden keys
  while (names.length > i) if (hasOwn(O, key = names[i++])) {
    ~indexOf(result, key) || push(result, key);
  }
  return result;
};


/***/ }),

/***/ 79804:
/***/ ((__unused_webpack_module, exports) => {

"use strict";

var $propertyIsEnumerable = {}.propertyIsEnumerable;
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;

// Nashorn ~ JDK8 bug
var NASHORN_BUG = getOwnPropertyDescriptor && !$propertyIsEnumerable.call({ 1: 2 }, 1);

// `Object.prototype.propertyIsEnumerable` method implementation
// https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
exports.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
  var descriptor = getOwnPropertyDescriptor(this, V);
  return !!descriptor && descriptor.enumerable;
} : $propertyIsEnumerable;


/***/ }),

/***/ 36718:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";

/* eslint-disable no-proto -- safe */
var uncurryThisAccessor = __webpack_require__(54809);
var anObject = __webpack_require__(70517);
var aPossiblePrototype = __webpack_require__(21704);

// `Object.setPrototypeOf` method
// https://tc39.es/ecma262/#sec-object.setprototypeof
// Works with __proto__ only. Old v8 can't work with null proto objects.
// eslint-disable-next-line es/no-object-setprototypeof -- safe
module.exports = Object.setPrototypeOf || ('__proto__' in {} ? function () {
  var CORRECT_SETTER = false;
  var test = {};
  var setter;
  try {
    setter = uncurryThisAccessor(Object.prototype, '__proto__', 'set');
    setter(test, []);
    CORRECT_SETTER = test instanceof Array;
  } catch (error) { /* empty */ }
  return function setPrototypeOf(O, proto) {
    anObject(O);
    aPossiblePrototype(proto);
    if (CORRECT_SETTER) setter(O, proto);
    else O.__proto__ = proto;
    return O;
  };
}() : undefined);


/***/ }),

/***/ 10735:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";

var call = __webpack_require__(21327);
var isCallable = __webpack_require__(35340);
var isObject = __webpack_require__(48159);

var $TypeError = TypeError;

// `OrdinaryToPrimitive` abstract operation
// https://tc39.es/ecma262/#sec-ordinarytoprimitive
module.exports = function (input, pref) {
  var fn, val;
  if (pref === 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) return val;
  if (isCallable(fn = input.valueOf) && !isObject(val = call(fn, input))) return val;
  if (pref !== 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) return val;
  throw $TypeError("Can't convert object to primitive value");
};


/***/ }),

/***/ 55275:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";

var getBuiltIn = __webpack_require__(33492);
var uncurryThis = __webpack_require__(76891);
var getOwnPropertyNamesModule = __webpack_require__(94255);
var getOwnPropertySymbolsModule = __webpack_require__(77489);
var anObject = __webpack_require__(70517);

var concat = uncurryThis([].concat);

// all object keys, includes non-enumerable and symbols
module.exports = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
  var keys = getOwnPropertyNamesModule.f(anObject(it));
  var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
  return getOwnPropertySymbols ? concat(keys, getOwnPropertySymbols(it)) : keys;
};


/***/ }),

/***/ 62556:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";

var defineProperty = (__webpack_require__(70784).f);

module.exports = function (Target, Source, key) {
  key in Target || defineProperty(Target, key, {
    configurable: true,
    get: function () { return Source[key]; },
    set: function (it) { Source[key] = it; }
  });
};


/***/ }),

/***/ 64405:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";

var isNullOrUndefined = __webpack_require__(8276);

var $TypeError = TypeError;

// `RequireObjectCoercible` abstract operation
// https://tc39.es/ecma262/#sec-requireobjectcoercible
module.exports = function (it) {
  if (isNullOrUndefined(it)) throw $TypeError("Can't call method on " + it);
  return it;
};


/***/ }),

/***/ 95174:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";

var shared = __webpack_require__(53762);
var uid = __webpack_require__(37135);

var keys = shared('keys');

module.exports = function (key) {
  return keys[key] || (keys[key] = uid(key));
};


/***/ }),

/***/ 88655:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";

var global = __webpack_require__(17773);
var defineGlobalProperty = __webpack_require__(43637);

var SHARED = '__core-js_shared__';
var store = global[SHARED] || defineGlobalProperty(SHARED, {});

module.exports = store;


/***/ }),

/***/ 53762:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";

var IS_PURE = __webpack_require__(37259);
var store = __webpack_require__(88655);

(module.exports = function (key, value) {
  return store[key] || (store[key] = value !== undefined ? value : {});
})('versions', []).push({
  version: '3.32.0',
  mode: IS_PURE ? 'pure' : 'global',
  copyright: '© 2014-2023 Denis Pushkarev (zloirock.ru)',
  license: 'https://github.com/zloirock/core-js/blob/v3.32.0/LICENSE',
  source: 'https://github.com/zloirock/core-js'
});


/***/ }),

/***/ 78223:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";

/* eslint-disable es/no-symbol -- required for testing */
var V8_VERSION = __webpack_require__(48051);
var fails = __webpack_require__(62728);
var global = __webpack_require__(17773);

var $String = global.String;

// eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
module.exports = !!Object.getOwnPropertySymbols && !fails(function () {
  var symbol = Symbol();
  // Chrome 38 Symbol has incorrect toString conversion
  // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
  // nb: Do not call `String` directly to avoid this being optimized out to `symbol+''` which will,
  // of course, fail.
  return !$String(symbol) || !(Object(symbol) instanceof Symbol) ||
    // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
    !Symbol.sham && V8_VERSION && V8_VERSION < 41;
});


/***/ }),

/***/ 3343:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";

var toIntegerOrInfinity = __webpack_require__(75147);

var max = Math.max;
var min = Math.min;

// Helper for a popular repeating case of the spec:
// Let integer be ? ToInteger(index).
// If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
module.exports = function (index, length) {
  var integer = toIntegerOrInfinity(index);
  return integer < 0 ? max(integer + length, 0) : min(integer, length);
};


/***/ }),

/***/ 65065:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";

// toObject with fallback for non-array-like ES3 strings
var IndexedObject = __webpack_require__(91546);
var requireObjectCoercible = __webpack_require__(64405);

module.exports = function (it) {
  return IndexedObject(requireObjectCoercible(it));
};


/***/ }),

/***/ 75147:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";

var trunc = __webpack_require__(54279);

// `ToIntegerOrInfinity` abstract operation
// https://tc39.es/ecma262/#sec-tointegerorinfinity
module.exports = function (argument) {
  var number = +argument;
  // eslint-disable-next-line no-self-compare -- NaN check
  return number !== number || number === 0 ? 0 : trunc(number);
};


/***/ }),

/***/ 93292:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";

var toIntegerOrInfinity = __webpack_require__(75147);

var min = Math.min;

// `ToLength` abstract operation
// https://tc39.es/ecma262/#sec-tolength
module.exports = function (argument) {
  return argument > 0 ? min(toIntegerOrInfinity(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
};


/***/ }),

/***/ 80358:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";

var requireObjectCoercible = __webpack_require__(64405);

var $Object = Object;

// `ToObject` abstract operation
// https://tc39.es/ecma262/#sec-toobject
module.exports = function (argument) {
  return $Object(requireObjectCoercible(argument));
};


/***/ }),

/***/ 73178:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";

var call = __webpack_require__(21327);
var isObject = __webpack_require__(48159);
var isSymbol = __webpack_require__(48136);
var getMethod = __webpack_require__(79570);
var ordinaryToPrimitive = __webpack_require__(10735);
var wellKnownSymbol = __webpack_require__(37366);

var $TypeError = TypeError;
var TO_PRIMITIVE = wellKnownSymbol('toPrimitive');

// `ToPrimitive` abstract operation
// https://tc39.es/ecma262/#sec-toprimitive
module.exports = function (input, pref) {
  if (!isObject(input) || isSymbol(input)) return input;
  var exoticToPrim = getMethod(input, TO_PRIMITIVE);
  var result;
  if (exoticToPrim) {
    if (pref === undefined) pref = 'default';
    result = call(exoticToPrim, input, pref);
    if (!isObject(result) || isSymbol(result)) return result;
    throw $TypeError("Can't convert object to primitive value");
  }
  if (pref === undefined) pref = 'number';
  return ordinaryToPrimitive(input, pref);
};


/***/ }),

/***/ 3255:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";

var toPrimitive = __webpack_require__(73178);
var isSymbol = __webpack_require__(48136);

// `ToPropertyKey` abstract operation
// https://tc39.es/ecma262/#sec-topropertykey
module.exports = function (argument) {
  var key = toPrimitive(argument, 'string');
  return isSymbol(key) ? key : key + '';
};


/***/ }),

/***/ 24278:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";

var wellKnownSymbol = __webpack_require__(37366);

var TO_STRING_TAG = wellKnownSymbol('toStringTag');
var test = {};

test[TO_STRING_TAG] = 'z';

module.exports = String(test) === '[object z]';


/***/ }),

/***/ 87257:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";

var classof = __webpack_require__(34688);

var $String = String;

module.exports = function (argument) {
  if (classof(argument) === 'Symbol') throw TypeError('Cannot convert a Symbol value to a string');
  return $String(argument);
};


/***/ }),

/***/ 82910:
/***/ ((module) => {

"use strict";

var $String = String;

module.exports = function (argument) {
  try {
    return $String(argument);
  } catch (error) {
    return 'Object';
  }
};


/***/ }),

/***/ 37135:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";

var uncurryThis = __webpack_require__(76891);

var id = 0;
var postfix = Math.random();
var toString = uncurryThis(1.0.toString);

module.exports = function (key) {
  return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString(++id + postfix, 36);
};


/***/ }),

/***/ 14167:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";

/* eslint-disable es/no-symbol -- required for testing */
var NATIVE_SYMBOL = __webpack_require__(78223);

module.exports = NATIVE_SYMBOL
  && !Symbol.sham
  && typeof Symbol.iterator == 'symbol';


/***/ }),

/***/ 74060:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";

var DESCRIPTORS = __webpack_require__(97581);
var fails = __webpack_require__(62728);

// V8 ~ Chrome 36-
// https://bugs.chromium.org/p/v8/issues/detail?id=3334
module.exports = DESCRIPTORS && fails(function () {
  // eslint-disable-next-line es/no-object-defineproperty -- required for testing
  return Object.defineProperty(function () { /* empty */ }, 'prototype', {
    value: 42,
    writable: false
  }).prototype != 42;
});


/***/ }),

/***/ 40114:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";

var global = __webpack_require__(17773);
var isCallable = __webpack_require__(35340);

var WeakMap = global.WeakMap;

module.exports = isCallable(WeakMap) && /native code/.test(String(WeakMap));


/***/ }),

/***/ 37366:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";

var global = __webpack_require__(17773);
var shared = __webpack_require__(53762);
var hasOwn = __webpack_require__(93120);
var uid = __webpack_require__(37135);
var NATIVE_SYMBOL = __webpack_require__(78223);
var USE_SYMBOL_AS_UID = __webpack_require__(14167);

var Symbol = global.Symbol;
var WellKnownSymbolsStore = shared('wks');
var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol['for'] || Symbol : Symbol && Symbol.withoutSetter || uid;

module.exports = function (name) {
  if (!hasOwn(WellKnownSymbolsStore, name)) {
    WellKnownSymbolsStore[name] = NATIVE_SYMBOL && hasOwn(Symbol, name)
      ? Symbol[name]
      : createWellKnownSymbol('Symbol.' + name);
  } return WellKnownSymbolsStore[name];
};


/***/ }),

/***/ 1450:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";

var getBuiltIn = __webpack_require__(33492);
var hasOwn = __webpack_require__(93120);
var createNonEnumerableProperty = __webpack_require__(29671);
var isPrototypeOf = __webpack_require__(85726);
var setPrototypeOf = __webpack_require__(36718);
var copyConstructorProperties = __webpack_require__(28932);
var proxyAccessor = __webpack_require__(62556);
var inheritIfRequired = __webpack_require__(19525);
var normalizeStringArgument = __webpack_require__(21160);
var installErrorCause = __webpack_require__(59710);
var installErrorStack = __webpack_require__(11496);
var DESCRIPTORS = __webpack_require__(97581);
var IS_PURE = __webpack_require__(37259);

module.exports = function (FULL_NAME, wrapper, FORCED, IS_AGGREGATE_ERROR) {
  var STACK_TRACE_LIMIT = 'stackTraceLimit';
  var OPTIONS_POSITION = IS_AGGREGATE_ERROR ? 2 : 1;
  var path = FULL_NAME.split('.');
  var ERROR_NAME = path[path.length - 1];
  var OriginalError = getBuiltIn.apply(null, path);

  if (!OriginalError) return;

  var OriginalErrorPrototype = OriginalError.prototype;

  // V8 9.3- bug https://bugs.chromium.org/p/v8/issues/detail?id=12006
  if (!IS_PURE && hasOwn(OriginalErrorPrototype, 'cause')) delete OriginalErrorPrototype.cause;

  if (!FORCED) return OriginalError;

  var BaseError = getBuiltIn('Error');

  var WrappedError = wrapper(function (a, b) {
    var message = normalizeStringArgument(IS_AGGREGATE_ERROR ? b : a, undefined);
    var result = IS_AGGREGATE_ERROR ? new OriginalError(a) : new OriginalError();
    if (message !== undefined) createNonEnumerableProperty(result, 'message', message);
    installErrorStack(result, WrappedError, result.stack, 2);
    if (this && isPrototypeOf(OriginalErrorPrototype, this)) inheritIfRequired(result, this, WrappedError);
    if (arguments.length > OPTIONS_POSITION) installErrorCause(result, arguments[OPTIONS_POSITION]);
    return result;
  });

  WrappedError.prototype = OriginalErrorPrototype;

  if (ERROR_NAME !== 'Error') {
    if (setPrototypeOf) setPrototypeOf(WrappedError, BaseError);
    else copyConstructorProperties(WrappedError, BaseError, { name: true });
  } else if (DESCRIPTORS && STACK_TRACE_LIMIT in OriginalError) {
    proxyAccessor(WrappedError, OriginalError, STACK_TRACE_LIMIT);
    proxyAccessor(WrappedError, OriginalError, 'prepareStackTrace');
  }

  copyConstructorProperties(WrappedError, OriginalError);

  if (!IS_PURE) try {
    // Safari 13- bug: WebAssembly errors does not have a proper `.name`
    if (OriginalErrorPrototype.name !== ERROR_NAME) {
      createNonEnumerableProperty(OriginalErrorPrototype, 'name', ERROR_NAME);
    }
    OriginalErrorPrototype.constructor = WrappedError;
  } catch (error) { /* empty */ }

  return WrappedError;
};


/***/ }),

/***/ 82514:
/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {

"use strict";

/* eslint-disable no-unused-vars -- required for functions `.length` */
var $ = __webpack_require__(24134);
var global = __webpack_require__(17773);
var apply = __webpack_require__(72504);
var wrapErrorConstructorWithCause = __webpack_require__(1450);

var WEB_ASSEMBLY = 'WebAssembly';
var WebAssembly = global[WEB_ASSEMBLY];

var FORCED = Error('e', { cause: 7 }).cause !== 7;

var exportGlobalErrorCauseWrapper = function (ERROR_NAME, wrapper) {
  var O = {};
  O[ERROR_NAME] = wrapErrorConstructorWithCause(ERROR_NAME, wrapper, FORCED);
  $({ global: true, constructor: true, arity: 1, forced: FORCED }, O);
};

var exportWebAssemblyErrorCauseWrapper = function (ERROR_NAME, wrapper) {
  if (WebAssembly && WebAssembly[ERROR_NAME]) {
    var O = {};
    O[ERROR_NAME] = wrapErrorConstructorWithCause(WEB_ASSEMBLY + '.' + ERROR_NAME, wrapper, FORCED);
    $({ target: WEB_ASSEMBLY, stat: true, constructor: true, arity: 1, forced: FORCED }, O);
  }
};

// https://tc39.es/ecma262/#sec-nativeerror
exportGlobalErrorCauseWrapper('Error', function (init) {
  return function Error(message) { return apply(init, this, arguments); };
});
exportGlobalErrorCauseWrapper('EvalError', function (init) {
  return function EvalError(message) { return apply(init, this, arguments); };
});
exportGlobalErrorCauseWrapper('RangeError', function (init) {
  return function RangeError(message) { return apply(init, this, arguments); };
});
exportGlobalErrorCauseWrapper('ReferenceError', function (init) {
  return function ReferenceError(message) { return apply(init, this, arguments); };
});
exportGlobalErrorCauseWrapper('SyntaxError', function (init) {
  return function SyntaxError(message) { return apply(init, this, arguments); };
});
exportGlobalErrorCauseWrapper('TypeError', function (init) {
  return function TypeError(message) { return apply(init, this, arguments); };
});
exportGlobalErrorCauseWrapper('URIError', function (init) {
  return function URIError(message) { return apply(init, this, arguments); };
});
exportWebAssemblyErrorCauseWrapper('CompileError', function (init) {
  return function CompileError(message) { return apply(init, this, arguments); };
});
exportWebAssemblyErrorCauseWrapper('LinkError', function (init) {
  return function LinkError(message) { return apply(init, this, arguments); };
});
exportWebAssemblyErrorCauseWrapper('RuntimeError', function (init) {
  return function RuntimeError(message) { return apply(init, this, arguments); };
});


/***/ }),

/***/ 44088:
/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {

"use strict";

var $ = __webpack_require__(24134);
var global = __webpack_require__(17773);
var defineBuiltInAccessor = __webpack_require__(70636);
var DESCRIPTORS = __webpack_require__(97581);

var $TypeError = TypeError;
// eslint-disable-next-line es/no-object-defineproperty -- safe
var defineProperty = Object.defineProperty;
var INCORRECT_VALUE = global.self !== global;

// `self` getter
// https://html.spec.whatwg.org/multipage/window-object.html#dom-self
try {
  if (DESCRIPTORS) {
    // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
    var descriptor = Object.getOwnPropertyDescriptor(global, 'self');
    // some engines have `self`, but with incorrect descriptor
    // https://github.com/denoland/deno/issues/15765
    if (INCORRECT_VALUE || !descriptor || !descriptor.get || !descriptor.enumerable) {
      defineBuiltInAccessor(global, 'self', {
        get: function self() {
          return global;
        },
        set: function self(value) {
          if (this !== global) throw $TypeError('Illegal invocation');
          defineProperty(global, 'self', {
            value: value,
            writable: true,
            configurable: true,
            enumerable: true
          });
        },
        configurable: true,
        enumerable: true
      });
    }
  } else $({ global: true, simple: true, forced: INCORRECT_VALUE }, {
    self: global
  });
} catch (error) { /* empty */ }


/***/ }),

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

var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) {
  if (true) {
    !(__WEBPACK_AMD_DEFINE_ARRAY__ = [module], __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 { var mod; }
})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (module) {
  /* webextension-polyfill - v0.12.0 - Tue May 14 2024 18:01:29 */
  /* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
  /* vim: set sts=2 sw=2 et tw=80: */
  /* This Source Code Form is subject to the terms of the Mozilla Public
   * License, v. 2.0. If a copy of the MPL was not distributed with this
   * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  "use strict";

  if (!(globalThis.chrome && globalThis.chrome.runtime && globalThis.chrome.runtime.id)) {
    throw new Error("This script should only be loaded in a browser extension.");
  }
  if (!(globalThis.browser && globalThis.browser.runtime && globalThis.browser.runtime.id)) {
    const CHROME_SEND_MESSAGE_CALLBACK_NO_RESPONSE_MESSAGE = "The message port closed before a response was received.";

    // Wrapping the bulk of this polyfill in a one-time-use function is a minor
    // optimization for Firefox. Since Spidermonkey does not fully parse the
    // contents of a function until the first time it's called, and since it will
    // never actually need to be called, this allows the polyfill to be included
    // in Firefox nearly for free.
    const wrapAPIs = extensionAPIs => {
      // NOTE: apiMetadata is associated to the content of the api-metadata.json file
      // at build time by replacing the following "include" with the content of the
      // JSON file.
      const apiMetadata = {
        "alarms": {
          "clear": {
            "minArgs": 0,
            "maxArgs": 1
          },
          "clearAll": {
            "minArgs": 0,
            "maxArgs": 0
          },
          "get": {
            "minArgs": 0,
            "maxArgs": 1
          },
          "getAll": {
            "minArgs": 0,
            "maxArgs": 0
          }
        },
        "bookmarks": {
          "create": {
            "minArgs": 1,
            "maxArgs": 1
          },
          "get": {
            "minArgs": 1,
            "maxArgs": 1
          },
          "getChildren": {
            "minArgs": 1,
            "maxArgs": 1
          },
          "getRecent": {
            "minArgs": 1,
            "maxArgs": 1
          },
          "getSubTree": {
            "minArgs": 1,
            "maxArgs": 1
          },
          "getTree": {
            "minArgs": 0,
            "maxArgs": 0
          },
          "move": {
            "minArgs": 2,
            "maxArgs": 2
          },
          "remove": {
            "minArgs": 1,
            "maxArgs": 1
          },
          "removeTree": {
            "minArgs": 1,
            "maxArgs": 1
          },
          "search": {
            "minArgs": 1,
            "maxArgs": 1
          },
          "update": {
            "minArgs": 2,
            "maxArgs": 2
          }
        },
        "browserAction": {
          "disable": {
            "minArgs": 0,
            "maxArgs": 1,
            "fallbackToNoCallback": true
          },
          "enable": {
            "minArgs": 0,
            "maxArgs": 1,
            "fallbackToNoCallback": true
          },
          "getBadgeBackgroundColor": {
            "minArgs": 1,
            "maxArgs": 1
          },
          "getBadgeText": {
            "minArgs": 1,
            "maxArgs": 1
          },
          "getPopup": {
            "minArgs": 1,
            "maxArgs": 1
          },
          "getTitle": {
            "minArgs": 1,
            "maxArgs": 1
          },
          "openPopup": {
            "minArgs": 0,
            "maxArgs": 0
          },
          "setBadgeBackgroundColor": {
            "minArgs": 1,
            "maxArgs": 1,
            "fallbackToNoCallback": true
          },
          "setBadgeText": {
            "minArgs": 1,
            "maxArgs": 1,
            "fallbackToNoCallback": true
          },
          "setIcon": {
            "minArgs": 1,
            "maxArgs": 1
          },
          "setPopup": {
            "minArgs": 1,
            "maxArgs": 1,
            "fallbackToNoCallback": true
          },
          "setTitle": {
            "minArgs": 1,
            "maxArgs": 1,
            "fallbackToNoCallback": true
          }
        },
        "browsingData": {
          "remove": {
            "minArgs": 2,
            "maxArgs": 2
          },
          "removeCache": {
            "minArgs": 1,
            "maxArgs": 1
          },
          "removeCookies": {
            "minArgs": 1,
            "maxArgs": 1
          },
          "removeDownloads": {
            "minArgs": 1,
            "maxArgs": 1
          },
          "removeFormData": {
            "minArgs": 1,
            "maxArgs": 1
          },
          "removeHistory": {
            "minArgs": 1,
            "maxArgs": 1
          },
          "removeLocalStorage": {
            "minArgs": 1,
            "maxArgs": 1
          },
          "removePasswords": {
            "minArgs": 1,
            "maxArgs": 1
          },
          "removePluginData": {
            "minArgs": 1,
            "maxArgs": 1
          },
          "settings": {
            "minArgs": 0,
            "maxArgs": 0
          }
        },
        "commands": {
          "getAll": {
            "minArgs": 0,
            "maxArgs": 0
          }
        },
        "contextMenus": {
          "remove": {
            "minArgs": 1,
            "maxArgs": 1
          },
          "removeAll": {
            "minArgs": 0,
            "maxArgs": 0
          },
          "update": {
            "minArgs": 2,
            "maxArgs": 2
          }
        },
        "cookies": {
          "get": {
            "minArgs": 1,
            "maxArgs": 1
          },
          "getAll": {
            "minArgs": 1,
            "maxArgs": 1
          },
          "getAllCookieStores": {
            "minArgs": 0,
            "maxArgs": 0
          },
          "remove": {
            "minArgs": 1,
            "maxArgs": 1
          },
          "set": {
            "minArgs": 1,
            "maxArgs": 1
          }
        },
        "devtools": {
          "inspectedWindow": {
            "eval": {
              "minArgs": 1,
              "maxArgs": 2,
              "singleCallbackArg": false
            }
          },
          "panels": {
            "create": {
              "minArgs": 3,
              "maxArgs": 3,
              "singleCallbackArg": true
            },
            "elements": {
              "createSidebarPane": {
                "minArgs": 1,
                "maxArgs": 1
              }
            }
          }
        },
        "downloads": {
          "cancel": {
            "minArgs": 1,
            "maxArgs": 1
          },
          "download": {
            "minArgs": 1,
            "maxArgs": 1
          },
          "erase": {
            "minArgs": 1,
            "maxArgs": 1
          },
          "getFileIcon": {
            "minArgs": 1,
            "maxArgs": 2
          },
          "open": {
            "minArgs": 1,
            "maxArgs": 1,
            "fallbackToNoCallback": true
          },
          "pause": {
            "minArgs": 1,
            "maxArgs": 1
          },
          "removeFile": {
            "minArgs": 1,
            "maxArgs": 1
          },
          "resume": {
            "minArgs": 1,
            "maxArgs": 1
          },
          "search": {
            "minArgs": 1,
            "maxArgs": 1
          },
          "show": {
            "minArgs": 1,
            "maxArgs": 1,
            "fallbackToNoCallback": true
          }
        },
        "extension": {
          "isAllowedFileSchemeAccess": {
            "minArgs": 0,
            "maxArgs": 0
          },
          "isAllowedIncognitoAccess": {
            "minArgs": 0,
            "maxArgs": 0
          }
        },
        "history": {
          "addUrl": {
            "minArgs": 1,
            "maxArgs": 1
          },
          "deleteAll": {
            "minArgs": 0,
            "maxArgs": 0
          },
          "deleteRange": {
            "minArgs": 1,
            "maxArgs": 1
          },
          "deleteUrl": {
            "minArgs": 1,
            "maxArgs": 1
          },
          "getVisits": {
            "minArgs": 1,
            "maxArgs": 1
          },
          "search": {
            "minArgs": 1,
            "maxArgs": 1
          }
        },
        "i18n": {
          "detectLanguage": {
            "minArgs": 1,
            "maxArgs": 1
          },
          "getAcceptLanguages": {
            "minArgs": 0,
            "maxArgs": 0
          }
        },
        "identity": {
          "launchWebAuthFlow": {
            "minArgs": 1,
            "maxArgs": 1
          }
        },
        "idle": {
          "queryState": {
            "minArgs": 1,
            "maxArgs": 1
          }
        },
        "management": {
          "get": {
            "minArgs": 1,
            "maxArgs": 1
          },
          "getAll": {
            "minArgs": 0,
            "maxArgs": 0
          },
          "getSelf": {
            "minArgs": 0,
            "maxArgs": 0
          },
          "setEnabled": {
            "minArgs": 2,
            "maxArgs": 2
          },
          "uninstallSelf": {
            "minArgs": 0,
            "maxArgs": 1
          }
        },
        "notifications": {
          "clear": {
            "minArgs": 1,
            "maxArgs": 1
          },
          "create": {
            "minArgs": 1,
            "maxArgs": 2
          },
          "getAll": {
            "minArgs": 0,
            "maxArgs": 0
          },
          "getPermissionLevel": {
            "minArgs": 0,
            "maxArgs": 0
          },
          "update": {
            "minArgs": 2,
            "maxArgs": 2
          }
        },
        "pageAction": {
          "getPopup": {
            "minArgs": 1,
            "maxArgs": 1
          },
          "getTitle": {
            "minArgs": 1,
            "maxArgs": 1
          },
          "hide": {
            "minArgs": 1,
            "maxArgs": 1,
            "fallbackToNoCallback": true
          },
          "setIcon": {
            "minArgs": 1,
            "maxArgs": 1
          },
          "setPopup": {
            "minArgs": 1,
            "maxArgs": 1,
            "fallbackToNoCallback": true
          },
          "setTitle": {
            "minArgs": 1,
            "maxArgs": 1,
            "fallbackToNoCallback": true
          },
          "show": {
            "minArgs": 1,
            "maxArgs": 1,
            "fallbackToNoCallback": true
          }
        },
        "permissions": {
          "contains": {
            "minArgs": 1,
            "maxArgs": 1
          },
          "getAll": {
            "minArgs": 0,
            "maxArgs": 0
          },
          "remove": {
            "minArgs": 1,
            "maxArgs": 1
          },
          "request": {
            "minArgs": 1,
            "maxArgs": 1
          }
        },
        "runtime": {
          "getBackgroundPage": {
            "minArgs": 0,
            "maxArgs": 0
          },
          "getPlatformInfo": {
            "minArgs": 0,
            "maxArgs": 0
          },
          "openOptionsPage": {
            "minArgs": 0,
            "maxArgs": 0
          },
          "requestUpdateCheck": {
            "minArgs": 0,
            "maxArgs": 0
          },
          "sendMessage": {
            "minArgs": 1,
            "maxArgs": 3
          },
          "sendNativeMessage": {
            "minArgs": 2,
            "maxArgs": 2
          },
          "setUninstallURL": {
            "minArgs": 1,
            "maxArgs": 1
          }
        },
        "sessions": {
          "getDevices": {
            "minArgs": 0,
            "maxArgs": 1
          },
          "getRecentlyClosed": {
            "minArgs": 0,
            "maxArgs": 1
          },
          "restore": {
            "minArgs": 0,
            "maxArgs": 1
          }
        },
        "storage": {
          "local": {
            "clear": {
              "minArgs": 0,
              "maxArgs": 0
            },
            "get": {
              "minArgs": 0,
              "maxArgs": 1
            },
            "getBytesInUse": {
              "minArgs": 0,
              "maxArgs": 1
            },
            "remove": {
              "minArgs": 1,
              "maxArgs": 1
            },
            "set": {
              "minArgs": 1,
              "maxArgs": 1
            }
          },
          "managed": {
            "get": {
              "minArgs": 0,
              "maxArgs": 1
            },
            "getBytesInUse": {
              "minArgs": 0,
              "maxArgs": 1
            }
          },
          "sync": {
            "clear": {
              "minArgs": 0,
              "maxArgs": 0
            },
            "get": {
              "minArgs": 0,
              "maxArgs": 1
            },
            "getBytesInUse": {
              "minArgs": 0,
              "maxArgs": 1
            },
            "remove": {
              "minArgs": 1,
              "maxArgs": 1
            },
            "set": {
              "minArgs": 1,
              "maxArgs": 1
            }
          }
        },
        "tabs": {
          "captureVisibleTab": {
            "minArgs": 0,
            "maxArgs": 2
          },
          "create": {
            "minArgs": 1,
            "maxArgs": 1
          },
          "detectLanguage": {
            "minArgs": 0,
            "maxArgs": 1
          },
          "discard": {
            "minArgs": 0,
            "maxArgs": 1
          },
          "duplicate": {
            "minArgs": 1,
            "maxArgs": 1
          },
          "executeScript": {
            "minArgs": 1,
            "maxArgs": 2
          },
          "get": {
            "minArgs": 1,
            "maxArgs": 1
          },
          "getCurrent": {
            "minArgs": 0,
            "maxArgs": 0
          },
          "getZoom": {
            "minArgs": 0,
            "maxArgs": 1
          },
          "getZoomSettings": {
            "minArgs": 0,
            "maxArgs": 1
          },
          "goBack": {
            "minArgs": 0,
            "maxArgs": 1
          },
          "goForward": {
            "minArgs": 0,
            "maxArgs": 1
          },
          "highlight": {
            "minArgs": 1,
            "maxArgs": 1
          },
          "insertCSS": {
            "minArgs": 1,
            "maxArgs": 2
          },
          "move": {
            "minArgs": 2,
            "maxArgs": 2
          },
          "query": {
            "minArgs": 1,
            "maxArgs": 1
          },
          "reload": {
            "minArgs": 0,
            "maxArgs": 2
          },
          "remove": {
            "minArgs": 1,
            "maxArgs": 1
          },
          "removeCSS": {
            "minArgs": 1,
            "maxArgs": 2
          },
          "sendMessage": {
            "minArgs": 2,
            "maxArgs": 3
          },
          "setZoom": {
            "minArgs": 1,
            "maxArgs": 2
          },
          "setZoomSettings": {
            "minArgs": 1,
            "maxArgs": 2
          },
          "update": {
            "minArgs": 1,
            "maxArgs": 2
          }
        },
        "topSites": {
          "get": {
            "minArgs": 0,
            "maxArgs": 0
          }
        },
        "webNavigation": {
          "getAllFrames": {
            "minArgs": 1,
            "maxArgs": 1
          },
          "getFrame": {
            "minArgs": 1,
            "maxArgs": 1
          }
        },
        "webRequest": {
          "handlerBehaviorChanged": {
            "minArgs": 0,
            "maxArgs": 0
          }
        },
        "windows": {
          "create": {
            "minArgs": 0,
            "maxArgs": 1
          },
          "get": {
            "minArgs": 1,
            "maxArgs": 2
          },
          "getAll": {
            "minArgs": 0,
            "maxArgs": 1
          },
          "getCurrent": {
            "minArgs": 0,
            "maxArgs": 1
          },
          "getLastFocused": {
            "minArgs": 0,
            "maxArgs": 1
          },
          "remove": {
            "minArgs": 1,
            "maxArgs": 1
          },
          "update": {
            "minArgs": 2,
            "maxArgs": 2
          }
        }
      };
      if (Object.keys(apiMetadata).length === 0) {
        throw new Error("api-metadata.json has not been included in browser-polyfill");
      }

      /**
       * A WeakMap subclass which creates and stores a value for any key which does
       * not exist when accessed, but behaves exactly as an ordinary WeakMap
       * otherwise.
       *
       * @param {function} createItem
       *        A function which will be called in order to create the value for any
       *        key which does not exist, the first time it is accessed. The
       *        function receives, as its only argument, the key being created.
       */
      class DefaultWeakMap extends WeakMap {
        constructor(createItem, items = undefined) {
          super(items);
          this.createItem = createItem;
        }
        get(key) {
          if (!this.has(key)) {
            this.set(key, this.createItem(key));
          }
          return super.get(key);
        }
      }

      /**
       * Returns true if the given object is an object with a `then` method, and can
       * therefore be assumed to behave as a Promise.
       *
       * @param {*} value The value to test.
       * @returns {boolean} True if the value is thenable.
       */
      const isThenable = value => {
        return value && typeof value === "object" && typeof value.then === "function";
      };

      /**
       * Creates and returns a function which, when called, will resolve or reject
       * the given promise based on how it is called:
       *
       * - If, when called, `chrome.runtime.lastError` contains a non-null object,
       *   the promise is rejected with that value.
       * - If the function is called with exactly one argument, the promise is
       *   resolved to that value.
       * - Otherwise, the promise is resolved to an array containing all of the
       *   function's arguments.
       *
       * @param {object} promise
       *        An object containing the resolution and rejection functions of a
       *        promise.
       * @param {function} promise.resolve
       *        The promise's resolution function.
       * @param {function} promise.reject
       *        The promise's rejection function.
       * @param {object} metadata
       *        Metadata about the wrapped method which has created the callback.
       * @param {boolean} metadata.singleCallbackArg
       *        Whether or not the promise is resolved with only the first
       *        argument of the callback, alternatively an array of all the
       *        callback arguments is resolved. By default, if the callback
       *        function is invoked with only a single argument, that will be
       *        resolved to the promise, while all arguments will be resolved as
       *        an array if multiple are given.
       *
       * @returns {function}
       *        The generated callback function.
       */
      const makeCallback = (promise, metadata) => {
        return (...callbackArgs) => {
          if (extensionAPIs.runtime.lastError) {
            promise.reject(new Error(extensionAPIs.runtime.lastError.message));
          } else if (metadata.singleCallbackArg || callbackArgs.length <= 1 && metadata.singleCallbackArg !== false) {
            promise.resolve(callbackArgs[0]);
          } else {
            promise.resolve(callbackArgs);
          }
        };
      };
      const pluralizeArguments = numArgs => numArgs == 1 ? "argument" : "arguments";

      /**
       * Creates a wrapper function for a method with the given name and metadata.
       *
       * @param {string} name
       *        The name of the method which is being wrapped.
       * @param {object} metadata
       *        Metadata about the method being wrapped.
       * @param {integer} metadata.minArgs
       *        The minimum number of arguments which must be passed to the
       *        function. If called with fewer than this number of arguments, the
       *        wrapper will raise an exception.
       * @param {integer} metadata.maxArgs
       *        The maximum number of arguments which may be passed to the
       *        function. If called with more than this number of arguments, the
       *        wrapper will raise an exception.
       * @param {boolean} metadata.singleCallbackArg
       *        Whether or not the promise is resolved with only the first
       *        argument of the callback, alternatively an array of all the
       *        callback arguments is resolved. By default, if the callback
       *        function is invoked with only a single argument, that will be
       *        resolved to the promise, while all arguments will be resolved as
       *        an array if multiple are given.
       *
       * @returns {function(object, ...*)}
       *       The generated wrapper function.
       */
      const wrapAsyncFunction = (name, metadata) => {
        return function asyncFunctionWrapper(target, ...args) {
          if (args.length < metadata.minArgs) {
            throw new Error(`Expected at least ${metadata.minArgs} ${pluralizeArguments(metadata.minArgs)} for ${name}(), got ${args.length}`);
          }
          if (args.length > metadata.maxArgs) {
            throw new Error(`Expected at most ${metadata.maxArgs} ${pluralizeArguments(metadata.maxArgs)} for ${name}(), got ${args.length}`);
          }
          return new Promise((resolve, reject) => {
            if (metadata.fallbackToNoCallback) {
              // This API method has currently no callback on Chrome, but it return a promise on Firefox,
              // and so the polyfill will try to call it with a callback first, and it will fallback
              // to not passing the callback if the first call fails.
              try {
                target[name](...args, makeCallback({
                  resolve,
                  reject
                }, metadata));
              } catch (cbError) {
                console.warn(`${name} API method doesn't seem to support the callback parameter, ` + "falling back to call it without a callback: ", cbError);
                target[name](...args);

                // Update the API method metadata, so that the next API calls will not try to
                // use the unsupported callback anymore.
                metadata.fallbackToNoCallback = false;
                metadata.noCallback = true;
                resolve();
              }
            } else if (metadata.noCallback) {
              target[name](...args);
              resolve();
            } else {
              target[name](...args, makeCallback({
                resolve,
                reject
              }, metadata));
            }
          });
        };
      };

      /**
       * Wraps an existing method of the target object, so that calls to it are
       * intercepted by the given wrapper function. The wrapper function receives,
       * as its first argument, the original `target` object, followed by each of
       * the arguments passed to the original method.
       *
       * @param {object} target
       *        The original target object that the wrapped method belongs to.
       * @param {function} method
       *        The method being wrapped. This is used as the target of the Proxy
       *        object which is created to wrap the method.
       * @param {function} wrapper
       *        The wrapper function which is called in place of a direct invocation
       *        of the wrapped method.
       *
       * @returns {Proxy<function>}
       *        A Proxy object for the given method, which invokes the given wrapper
       *        method in its place.
       */
      const wrapMethod = (target, method, wrapper) => {
        return new Proxy(method, {
          apply(targetMethod, thisObj, args) {
            return wrapper.call(thisObj, target, ...args);
          }
        });
      };
      let hasOwnProperty = Function.call.bind(Object.prototype.hasOwnProperty);

      /**
       * Wraps an object in a Proxy which intercepts and wraps certain methods
       * based on the given `wrappers` and `metadata` objects.
       *
       * @param {object} target
       *        The target object to wrap.
       *
       * @param {object} [wrappers = {}]
       *        An object tree containing wrapper functions for special cases. Any
       *        function present in this object tree is called in place of the
       *        method in the same location in the `target` object tree. These
       *        wrapper methods are invoked as described in {@see wrapMethod}.
       *
       * @param {object} [metadata = {}]
       *        An object tree containing metadata used to automatically generate
       *        Promise-based wrapper functions for asynchronous. Any function in
       *        the `target` object tree which has a corresponding metadata object
       *        in the same location in the `metadata` tree is replaced with an
       *        automatically-generated wrapper function, as described in
       *        {@see wrapAsyncFunction}
       *
       * @returns {Proxy<object>}
       */
      const wrapObject = (target, wrappers = {}, metadata = {}) => {
        let cache = Object.create(null);
        let handlers = {
          has(proxyTarget, prop) {
            return prop in target || prop in cache;
          },
          get(proxyTarget, prop, receiver) {
            if (prop in cache) {
              return cache[prop];
            }
            if (!(prop in target)) {
              return undefined;
            }
            let value = target[prop];
            if (typeof value === "function") {
              // This is a method on the underlying object. Check if we need to do
              // any wrapping.

              if (typeof wrappers[prop] === "function") {
                // We have a special-case wrapper for this method.
                value = wrapMethod(target, target[prop], wrappers[prop]);
              } else if (hasOwnProperty(metadata, prop)) {
                // This is an async method that we have metadata for. Create a
                // Promise wrapper for it.
                let wrapper = wrapAsyncFunction(prop, metadata[prop]);
                value = wrapMethod(target, target[prop], wrapper);
              } else {
                // This is a method that we don't know or care about. Return the
                // original method, bound to the underlying object.
                value = value.bind(target);
              }
            } else if (typeof value === "object" && value !== null && (hasOwnProperty(wrappers, prop) || hasOwnProperty(metadata, prop))) {
              // This is an object that we need to do some wrapping for the children
              // of. Create a sub-object wrapper for it with the appropriate child
              // metadata.
              value = wrapObject(value, wrappers[prop], metadata[prop]);
            } else if (hasOwnProperty(metadata, "*")) {
              // Wrap all properties in * namespace.
              value = wrapObject(value, wrappers[prop], metadata["*"]);
            } else {
              // We don't need to do any wrapping for this property,
              // so just forward all access to the underlying object.
              Object.defineProperty(cache, prop, {
                configurable: true,
                enumerable: true,
                get() {
                  return target[prop];
                },
                set(value) {
                  target[prop] = value;
                }
              });
              return value;
            }
            cache[prop] = value;
            return value;
          },
          set(proxyTarget, prop, value, receiver) {
            if (prop in cache) {
              cache[prop] = value;
            } else {
              target[prop] = value;
            }
            return true;
          },
          defineProperty(proxyTarget, prop, desc) {
            return Reflect.defineProperty(cache, prop, desc);
          },
          deleteProperty(proxyTarget, prop) {
            return Reflect.deleteProperty(cache, prop);
          }
        };

        // Per contract of the Proxy API, the "get" proxy handler must return the
        // original value of the target if that value is declared read-only and
        // non-configurable. For this reason, we create an object with the
        // prototype set to `target` instead of using `target` directly.
        // Otherwise we cannot return a custom object for APIs that
        // are declared read-only and non-configurable, such as `chrome.devtools`.
        //
        // The proxy handlers themselves will still use the original `target`
        // instead of the `proxyTarget`, so that the methods and properties are
        // dereferenced via the original targets.
        let proxyTarget = Object.create(target);
        return new Proxy(proxyTarget, handlers);
      };

      /**
       * Creates a set of wrapper functions for an event object, which handles
       * wrapping of listener functions that those messages are passed.
       *
       * A single wrapper is created for each listener function, and stored in a
       * map. Subsequent calls to `addListener`, `hasListener`, or `removeListener`
       * retrieve the original wrapper, so that  attempts to remove a
       * previously-added listener work as expected.
       *
       * @param {DefaultWeakMap<function, function>} wrapperMap
       *        A DefaultWeakMap object which will create the appropriate wrapper
       *        for a given listener function when one does not exist, and retrieve
       *        an existing one when it does.
       *
       * @returns {object}
       */
      const wrapEvent = wrapperMap => ({
        addListener(target, listener, ...args) {
          target.addListener(wrapperMap.get(listener), ...args);
        },
        hasListener(target, listener) {
          return target.hasListener(wrapperMap.get(listener));
        },
        removeListener(target, listener) {
          target.removeListener(wrapperMap.get(listener));
        }
      });
      const onRequestFinishedWrappers = new DefaultWeakMap(listener => {
        if (typeof listener !== "function") {
          return listener;
        }

        /**
         * Wraps an onRequestFinished listener function so that it will return a
         * `getContent()` property which returns a `Promise` rather than using a
         * callback API.
         *
         * @param {object} req
         *        The HAR entry object representing the network request.
         */
        return function onRequestFinished(req) {
          const wrappedReq = wrapObject(req, {} /* wrappers */, {
            getContent: {
              minArgs: 0,
              maxArgs: 0
            }
          });
          listener(wrappedReq);
        };
      });
      const onMessageWrappers = new DefaultWeakMap(listener => {
        if (typeof listener !== "function") {
          return listener;
        }

        /**
         * Wraps a message listener function so that it may send responses based on
         * its return value, rather than by returning a sentinel value and calling a
         * callback. If the listener function returns a Promise, the response is
         * sent when the promise either resolves or rejects.
         *
         * @param {*} message
         *        The message sent by the other end of the channel.
         * @param {object} sender
         *        Details about the sender of the message.
         * @param {function(*)} sendResponse
         *        A callback which, when called with an arbitrary argument, sends
         *        that value as a response.
         * @returns {boolean}
         *        True if the wrapped listener returned a Promise, which will later
         *        yield a response. False otherwise.
         */
        return function onMessage(message, sender, sendResponse) {
          let didCallSendResponse = false;
          let wrappedSendResponse;
          let sendResponsePromise = new Promise(resolve => {
            wrappedSendResponse = function (response) {
              didCallSendResponse = true;
              resolve(response);
            };
          });
          let result;
          try {
            result = listener(message, sender, wrappedSendResponse);
          } catch (err) {
            result = Promise.reject(err);
          }
          const isResultThenable = result !== true && isThenable(result);

          // If the listener didn't returned true or a Promise, or called
          // wrappedSendResponse synchronously, we can exit earlier
          // because there will be no response sent from this listener.
          if (result !== true && !isResultThenable && !didCallSendResponse) {
            return false;
          }

          // A small helper to send the message if the promise resolves
          // and an error if the promise rejects (a wrapped sendMessage has
          // to translate the message into a resolved promise or a rejected
          // promise).
          const sendPromisedResult = promise => {
            promise.then(msg => {
              // send the message value.
              sendResponse(msg);
            }, error => {
              // Send a JSON representation of the error if the rejected value
              // is an instance of error, or the object itself otherwise.
              let message;
              if (error && (error instanceof Error || typeof error.message === "string")) {
                message = error.message;
              } else {
                message = "An unexpected error occurred";
              }
              sendResponse({
                __mozWebExtensionPolyfillReject__: true,
                message
              });
            }).catch(err => {
              // Print an error on the console if unable to send the response.
              console.error("Failed to send onMessage rejected reply", err);
            });
          };

          // If the listener returned a Promise, send the resolved value as a
          // result, otherwise wait the promise related to the wrappedSendResponse
          // callback to resolve and send it as a response.
          if (isResultThenable) {
            sendPromisedResult(result);
          } else {
            sendPromisedResult(sendResponsePromise);
          }

          // Let Chrome know that the listener is replying.
          return true;
        };
      });
      const wrappedSendMessageCallback = ({
        reject,
        resolve
      }, reply) => {
        if (extensionAPIs.runtime.lastError) {
          // Detect when none of the listeners replied to the sendMessage call and resolve
          // the promise to undefined as in Firefox.
          // See https://github.com/mozilla/webextension-polyfill/issues/130
          if (extensionAPIs.runtime.lastError.message === CHROME_SEND_MESSAGE_CALLBACK_NO_RESPONSE_MESSAGE) {
            resolve();
          } else {
            reject(new Error(extensionAPIs.runtime.lastError.message));
          }
        } else if (reply && reply.__mozWebExtensionPolyfillReject__) {
          // Convert back the JSON representation of the error into
          // an Error instance.
          reject(new Error(reply.message));
        } else {
          resolve(reply);
        }
      };
      const wrappedSendMessage = (name, metadata, apiNamespaceObj, ...args) => {
        if (args.length < metadata.minArgs) {
          throw new Error(`Expected at least ${metadata.minArgs} ${pluralizeArguments(metadata.minArgs)} for ${name}(), got ${args.length}`);
        }
        if (args.length > metadata.maxArgs) {
          throw new Error(`Expected at most ${metadata.maxArgs} ${pluralizeArguments(metadata.maxArgs)} for ${name}(), got ${args.length}`);
        }
        return new Promise((resolve, reject) => {
          const wrappedCb = wrappedSendMessageCallback.bind(null, {
            resolve,
            reject
          });
          args.push(wrappedCb);
          apiNamespaceObj.sendMessage(...args);
        });
      };
      const staticWrappers = {
        devtools: {
          network: {
            onRequestFinished: wrapEvent(onRequestFinishedWrappers)
          }
        },
        runtime: {
          onMessage: wrapEvent(onMessageWrappers),
          onMessageExternal: wrapEvent(onMessageWrappers),
          sendMessage: wrappedSendMessage.bind(null, "sendMessage", {
            minArgs: 1,
            maxArgs: 3
          })
        },
        tabs: {
          sendMessage: wrappedSendMessage.bind(null, "sendMessage", {
            minArgs: 2,
            maxArgs: 3
          })
        }
      };
      const settingMetadata = {
        clear: {
          minArgs: 1,
          maxArgs: 1
        },
        get: {
          minArgs: 1,
          maxArgs: 1
        },
        set: {
          minArgs: 1,
          maxArgs: 1
        }
      };
      apiMetadata.privacy = {
        network: {
          "*": settingMetadata
        },
        services: {
          "*": settingMetadata
        },
        websites: {
          "*": settingMetadata
        }
      };
      return wrapObject(extensionAPIs, staticWrappers, apiMetadata);
    };

    // The build process adds a UMD wrapper around this file, which makes the
    // `module` variable available.
    module.exports = wrapAPIs(chrome);
  } else {
    module.exports = globalThis.browser;
  }
});


/***/ })

/******/ 	});
/************************************************************************/
/******/ 	// 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] = {
/******/ 			// no module.id needed
/******/ 			// no module.loaded needed
/******/ 			exports: {}
/******/ 		};
/******/ 	
/******/ 		// Execute the module function
/******/ 		__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/ 	
/******/ 		// Return the exports of the module
/******/ 		return module.exports;
/******/ 	}
/******/ 	
/************************************************************************/
/******/ 	/* webpack/runtime/compat get default export */
/******/ 	(() => {
/******/ 		// getDefaultExport function for compatibility with non-harmony modules
/******/ 		__webpack_require__.n = (module) => {
/******/ 			var getter = module && module.__esModule ?
/******/ 				() => (module['default']) :
/******/ 				() => (module);
/******/ 			__webpack_require__.d(getter, { a: getter });
/******/ 			return getter;
/******/ 		};
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/define property getters */
/******/ 	(() => {
/******/ 		// define getter functions for harmony exports
/******/ 		__webpack_require__.d = (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 */
/******/ 	(() => {
/******/ 		__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 */
/******/ 	(() => {
/******/ 		__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
/******/ 	})();
/******/ 	
/************************************************************************/
var __webpack_exports__ = {};
// This entry need to be wrapped in an IIFE because it need to be in strict mode.
(() => {
"use strict";

// EXTERNAL MODULE: ./node_modules/.pnpm/webextension-polyfill@0.12.0/node_modules/webextension-polyfill/dist/browser-polyfill.js
var browser_polyfill = __webpack_require__(70914);
var browser_polyfill_default = /*#__PURE__*/__webpack_require__.n(browser_polyfill);
// EXTERNAL MODULE: ./node_modules/.pnpm/@adguard+assistant@4.3.70/node_modules/@adguard/assistant/dist/assistant.js
var dist_assistant = __webpack_require__(85436);
;// CONCATENATED MODULE: ./node_modules/.pnpm/@adguard+extended-css@2.1.1/node_modules/@adguard/extended-css/dist/extended-css.esm.js
/**
 * @adguard/extended-css - v2.1.1 - Thu Dec 19 2024
 * https://github.com/AdguardTeam/ExtendedCss#homepage
 * Copyright (c) 2024 AdGuard. Licensed GPL-3.0
 */
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;
}

/**
 * Possible ast node types.
 *
 * IMPORTANT: it is used as 'const' instead of 'enum' to avoid side effects
 * during ExtendedCss import into other libraries.
 */
const NODE = {
  SELECTOR_LIST: 'SelectorList',
  SELECTOR: 'Selector',
  REGULAR_SELECTOR: 'RegularSelector',
  EXTENDED_SELECTOR: 'ExtendedSelector',
  ABSOLUTE_PSEUDO_CLASS: 'AbsolutePseudoClass',
  RELATIVE_PSEUDO_CLASS: 'RelativePseudoClass'
};

/**
 * Class needed for creating ast nodes while selector parsing.
 * Used for SelectorList, Selector, ExtendedSelector.
 */
class AnySelectorNode {
  /**
   * Creates new ast node.
   *
   * @param type Ast node type.
   */
  constructor(type) {
    _defineProperty(this, "children", []);

    this.type = type;
  }
  /**
   * Adds child node to children array.
   *
   * @param child Ast node.
   */


  addChild(child) {
    this.children.push(child);
  }

}
/**
 * Class needed for creating RegularSelector ast node while selector parsing.
 */

class RegularSelectorNode extends AnySelectorNode {
  /**
   * Creates RegularSelector ast node.
   *
   * @param value Value of RegularSelector node.
   */
  constructor(value) {
    super(NODE.REGULAR_SELECTOR);
    this.value = value;
  }

}
/**
 * Class needed for creating RelativePseudoClass ast node while selector parsing.
 */

class RelativePseudoClassNode extends AnySelectorNode {
  /**
   * Creates RegularSelector ast node.
   *
   * @param name Name of RelativePseudoClass node.
   */
  constructor(name) {
    super(NODE.RELATIVE_PSEUDO_CLASS);
    this.name = name;
  }

}
/**
 * Class needed for creating AbsolutePseudoClass ast node while selector parsing.
 */

class AbsolutePseudoClassNode extends AnySelectorNode {
  /**
   * Creates AbsolutePseudoClass ast node.
   *
   * @param name Name of AbsolutePseudoClass node.
   */
  constructor(name) {
    super(NODE.ABSOLUTE_PSEUDO_CLASS);

    _defineProperty(this, "value", '');

    this.name = name;
  }

}
/* eslint-disable jsdoc/require-description-complete-sentence */

/**
 * Root node.
 *
 * SelectorList
 *   : Selector
 *     ...
 *   ;
 */

/**
 * Selector node.
 *
 * Selector
 *   : RegularSelector
 *   | ExtendedSelector
 *     ...
 *   ;
 */

/**
 * Regular selector node.
 * It can be selected by querySelectorAll().
 *
 * RegularSelector
 *   : type
 *   : value
 *   ;
 */

/**
 * Extended selector node.
 *
 * ExtendedSelector
 *   : AbsolutePseudoClass
 *   | RelativePseudoClass
 *   ;
 */

/**
 * Absolute extended pseudo-class node,
 * i.e. none-selector args.
 *
 * AbsolutePseudoClass
 *   : type
 *   : name
 *   : value
 *   ;
 */

/**
 * Relative extended pseudo-class node
 * i.e. selector as arg.
 *
 * RelativePseudoClass
 *   : type
 *   : name
 *   : SelectorList
 *   ;
 */
//
//  ast example
//
//  div.banner > div:has(span, p), a img.ad
//
//  SelectorList - div.banner > div:has(span, p), a img.ad
//      Selector - div.banner > div:has(span, p)
//          RegularSelector - div.banner > div
//          ExtendedSelector - :has(span, p)
//              PseudoClassSelector - :has
//              SelectorList - span, p
//                  Selector - span
//                      RegularSelector - span
//                  Selector - p
//                      RegularSelector - p
//      Selector - a img.ad
//          RegularSelector - a img.ad
//

var version = "2.1.1";

const EXTENDED_CSS_VERSION = (/* unused pure expression or super */ null && (version));
const LEFT_SQUARE_BRACKET = '[';
const RIGHT_SQUARE_BRACKET = ']';
const LEFT_PARENTHESIS = '(';
const RIGHT_PARENTHESIS = ')';
const LEFT_CURLY_BRACKET = '{';
const RIGHT_CURLY_BRACKET = '}';
const BRACKET = {
  SQUARE: {
    LEFT: LEFT_SQUARE_BRACKET,
    RIGHT: RIGHT_SQUARE_BRACKET
  },
  PARENTHESES: {
    LEFT: LEFT_PARENTHESIS,
    RIGHT: RIGHT_PARENTHESIS
  },
  CURLY: {
    LEFT: LEFT_CURLY_BRACKET,
    RIGHT: RIGHT_CURLY_BRACKET
  }
};
const SLASH = '/';
const BACKSLASH = '\\';
const SPACE = ' ';
const COMMA = ',';
const DOT = '.';
const SEMICOLON = ';';
const COLON = ':';
const SINGLE_QUOTE = '\'';
const DOUBLE_QUOTE = '"'; // do not consider hyphen `-` as separated mark
// to avoid pseudo-class names splitting
// e.g. 'matches-css' or 'if-not'

const CARET = '^';
const DOLLAR_SIGN = '$';
const EQUAL_SIGN = '=';
const TAB = '\t';
const CARRIAGE_RETURN = '\r';
const LINE_FEED = '\n';
const FORM_FEED = '\f';
const WHITE_SPACE_CHARACTERS = [SPACE, TAB, CARRIAGE_RETURN, LINE_FEED, FORM_FEED]; // for universal selector and attributes

const ASTERISK = '*';
const ID_MARKER = '#';
const CLASS_MARKER = DOT;
const DESCENDANT_COMBINATOR = SPACE;
const CHILD_COMBINATOR = '>';
const NEXT_SIBLING_COMBINATOR = '+';
const SUBSEQUENT_SIBLING_COMBINATOR = '~';
const COMBINATORS = [DESCENDANT_COMBINATOR, CHILD_COMBINATOR, NEXT_SIBLING_COMBINATOR, SUBSEQUENT_SIBLING_COMBINATOR];
const SUPPORTED_SELECTOR_MARKS = [LEFT_SQUARE_BRACKET, RIGHT_SQUARE_BRACKET, LEFT_PARENTHESIS, RIGHT_PARENTHESIS, LEFT_CURLY_BRACKET, RIGHT_CURLY_BRACKET, SLASH, BACKSLASH, SEMICOLON, COLON, COMMA, SINGLE_QUOTE, DOUBLE_QUOTE, CARET, DOLLAR_SIGN, ASTERISK, ID_MARKER, CLASS_MARKER, DESCENDANT_COMBINATOR, CHILD_COMBINATOR, NEXT_SIBLING_COMBINATOR, SUBSEQUENT_SIBLING_COMBINATOR, TAB, CARRIAGE_RETURN, LINE_FEED, FORM_FEED];
const SUPPORTED_STYLE_DECLARATION_MARKS = [// divider between property and value in declaration
COLON, // divider between declarations
SEMICOLON, // sometimes is needed for value wrapping
// e.g. 'content: "-"'
SINGLE_QUOTE, DOUBLE_QUOTE, // needed for quote escaping inside the same-type quotes
BACKSLASH, // whitespaces
SPACE, TAB, CARRIAGE_RETURN, LINE_FEED, FORM_FEED]; // absolute:

const CONTAINS_PSEUDO = 'contains';
const HAS_TEXT_PSEUDO = 'has-text';
const ABP_CONTAINS_PSEUDO = '-abp-contains';
const MATCHES_CSS_PSEUDO = 'matches-css';
const MATCHES_CSS_BEFORE_PSEUDO = 'matches-css-before';
const MATCHES_CSS_AFTER_PSEUDO = 'matches-css-after';
const MATCHES_ATTR_PSEUDO_CLASS_MARKER = 'matches-attr';
const MATCHES_PROPERTY_PSEUDO_CLASS_MARKER = 'matches-property';
const XPATH_PSEUDO_CLASS_MARKER = 'xpath';
const NTH_ANCESTOR_PSEUDO_CLASS_MARKER = 'nth-ancestor';
const CONTAINS_PSEUDO_NAMES = [CONTAINS_PSEUDO, HAS_TEXT_PSEUDO, ABP_CONTAINS_PSEUDO];
/**
 * Pseudo-class :upward() can get number or selector arg
 * and if the arg is selector it should be standard, not extended
 * so :upward pseudo-class is always absolute.
 */

const UPWARD_PSEUDO_CLASS_MARKER = 'upward';
/**
 * Pseudo-class `:remove()` and pseudo-property `remove`
 * are used for element actions, not for element selecting.
 *
 * Selector text should not contain the pseudo-class
 * so selector parser should consider it as invalid
 * and both are handled by stylesheet parser.
 */

const REMOVE_PSEUDO_MARKER = 'remove'; // relative:

const HAS_PSEUDO_CLASS_MARKER = 'has';
const ABP_HAS_PSEUDO_CLASS_MARKER = '-abp-has';
const HAS_PSEUDO_CLASS_MARKERS = [HAS_PSEUDO_CLASS_MARKER, ABP_HAS_PSEUDO_CLASS_MARKER];
const IS_PSEUDO_CLASS_MARKER = 'is';
const NOT_PSEUDO_CLASS_MARKER = 'not';
const ABSOLUTE_PSEUDO_CLASSES = [CONTAINS_PSEUDO, HAS_TEXT_PSEUDO, ABP_CONTAINS_PSEUDO, MATCHES_CSS_PSEUDO, MATCHES_CSS_BEFORE_PSEUDO, MATCHES_CSS_AFTER_PSEUDO, MATCHES_ATTR_PSEUDO_CLASS_MARKER, MATCHES_PROPERTY_PSEUDO_CLASS_MARKER, XPATH_PSEUDO_CLASS_MARKER, NTH_ANCESTOR_PSEUDO_CLASS_MARKER, UPWARD_PSEUDO_CLASS_MARKER];
const RELATIVE_PSEUDO_CLASSES = [...HAS_PSEUDO_CLASS_MARKERS, IS_PSEUDO_CLASS_MARKER, NOT_PSEUDO_CLASS_MARKER];
const SUPPORTED_PSEUDO_CLASSES = [...ABSOLUTE_PSEUDO_CLASSES, ...RELATIVE_PSEUDO_CLASSES]; // these pseudo-classes should be part of RegularSelector value
// if its arg does not contain extended selectors.
// the ast will be checked after the selector is completely parsed

const OPTIMIZATION_PSEUDO_CLASSES = [NOT_PSEUDO_CLASS_MARKER, IS_PSEUDO_CLASS_MARKER];
/**
 * ':scope' is used for extended pseudo-class :has(), if-not(), :is() and :not().
 */

const SCOPE_CSS_PSEUDO_CLASS = ':scope';
/**
 * ':after' and ':before' are needed for :matches-css() pseudo-class
 * all other are needed for :has() limitation after regular pseudo-elements.
 *
 * @see {@link https://bugs.chromium.org/p/chromium/issues/detail?id=669058#c54} [case 3]
 */

const REGULAR_PSEUDO_ELEMENTS = {
  AFTER: 'after',
  BACKDROP: 'backdrop',
  BEFORE: 'before',
  CUE: 'cue',
  CUE_REGION: 'cue-region',
  FIRST_LETTER: 'first-letter',
  FIRST_LINE: 'first-line',
  FILE_SELECTION_BUTTON: 'file-selector-button',
  GRAMMAR_ERROR: 'grammar-error',
  MARKER: 'marker',
  PART: 'part',
  PLACEHOLDER: 'placeholder',
  SELECTION: 'selection',
  SLOTTED: 'slotted',
  SPELLING_ERROR: 'spelling-error',
  TARGET_TEXT: 'target-text'
}; // ExtendedCss does not support at-rules
// https://developer.mozilla.org/en-US/docs/Web/CSS/At-rule

const AT_RULE_MARKER = '@';
const CONTENT_CSS_PROPERTY = 'content';
const PSEUDO_PROPERTY_POSITIVE_VALUE = 'true';
const DEBUG_PSEUDO_PROPERTY_GLOBAL_VALUE = 'global';
const NO_SELECTOR_ERROR_PREFIX = 'Selector should be defined';
const STYLE_ERROR_PREFIX = {
  NO_STYLE: 'No style declaration found',
  NO_SELECTOR: `${NO_SELECTOR_ERROR_PREFIX} before style declaration in stylesheet`,
  INVALID_STYLE: 'Invalid style declaration',
  UNCLOSED_STYLE: 'Unclosed style declaration',
  NO_PROPERTY: 'Missing style property in declaration',
  NO_VALUE: 'Missing style value in declaration',
  NO_STYLE_OR_REMOVE: 'Style should be declared or :remove() pseudo-class should used',
  NO_COMMENT: 'Comments are not supported'
};
const NO_AT_RULE_ERROR_PREFIX = 'At-rules are not supported';
const REMOVE_ERROR_PREFIX = {
  INVALID_REMOVE: 'Invalid :remove() pseudo-class in selector',
  NO_TARGET_SELECTOR: `${NO_SELECTOR_ERROR_PREFIX} before :remove() pseudo-class`,
  MULTIPLE_USAGE: 'Pseudo-class :remove() appears more than once in selector',
  INVALID_POSITION: 'Pseudo-class :remove() should be at the end of selector'
};
const MATCHING_ELEMENT_ERROR_PREFIX = 'Error while matching element';
const MAX_STYLE_PROTECTION_COUNT = 50;

/**
 * Regexp that matches backward compatible syntaxes.
 */

const REGEXP_VALID_OLD_SYNTAX = /\[-(?:ext)-([a-z-_]+)=(["'])((?:(?=(\\?))\4.)*?)\2\]/g;
/**
 * Marker for checking invalid selector after old-syntax normalizing by selector converter.
 */

const INVALID_OLD_SYNTAX_MARKER = '[-ext-';
/**
 * Complex replacement function.
 * Undo quote escaping inside of an extended selector.
 *
 * @param match     Whole matched string.
 * @param name      Group 1.
 * @param quoteChar Group 2.
 * @param rawValue  Group 3.
 *
 * @returns Converted string.
 */

const evaluateMatch = (match, name, quoteChar, rawValue) => {
  // Unescape quotes
  const re = new RegExp(`([^\\\\]|^)\\\\${quoteChar}`, 'g');
  const value = rawValue.replace(re, `$1${quoteChar}`);
  return `:${name}(${value})`;
}; // ':scope' pseudo may be at start of :has() argument
// but ExtCssDocument.querySelectorAll() already use it for selecting exact element descendants


const SCOPE_MARKER_REGEXP = /\(:scope >/g;
const SCOPE_REPLACER = '(>';
const MATCHES_CSS_PSEUDO_ELEMENT_REGEXP = /(:matches-css)-(before|after)\(/g;

const convertMatchesCss = (match, extendedPseudoClass, regularPseudoElement) => {
  // ':matches-css-before('  -->  ':matches-css(before, '
  // ':matches-css-after('   -->  ':matches-css(after, '
  return `${extendedPseudoClass}${BRACKET.PARENTHESES.LEFT}${regularPseudoElement}${COMMA}`;
};
/**
 * Handles old syntax and :scope inside :has().
 *
 * @param selector Trimmed selector to normalize.
 *
 * @returns Normalized selector.
 * @throws An error on invalid old extended syntax selector.
 */


const normalize = selector => {
  const normalizedSelector = selector.replace(REGEXP_VALID_OLD_SYNTAX, evaluateMatch).replace(SCOPE_MARKER_REGEXP, SCOPE_REPLACER).replace(MATCHES_CSS_PSEUDO_ELEMENT_REGEXP, convertMatchesCss); // validate old syntax after normalizing
  // e.g. '[-ext-matches-css-before=\'content:  /^[A-Z][a-z]'

  if (normalizedSelector.includes(INVALID_OLD_SYNTAX_MARKER)) {
    throw new Error(`Invalid extended-css old syntax selector: '${selector}'`);
  }

  return normalizedSelector;
};
/**
 * Prepares the rawSelector before tokenization:
 * 1. Trims it.
 * 2. Converts old syntax `[-ext-pseudo-class="..."]` to new one `:pseudo-class(...)`.
 * 3. Handles :scope pseudo inside :has() pseudo-class arg.
 *
 * @param rawSelector Selector with no style declaration.
 * @returns Prepared selector with no style declaration.
 */


const convert = rawSelector => {
  const trimmedSelector = rawSelector.trim();
  return normalize(trimmedSelector);
};

/**
 * Possible token types.
 *
 * IMPORTANT: it is used as 'const' instead of 'enum' to avoid side effects
 * during ExtendedCss import into other libraries.
 */
const TOKEN_TYPE = {
  MARK: 'mark',
  WORD: 'word'
};

/**
 * Splits `input` string into tokens.
 *
 * @param input Input string to tokenize.
 * @param supportedMarks Array of supported marks to considered as `TOKEN_TYPE.MARK`;
 * all other will be considered as `TOKEN_TYPE.WORD`.
 *
 * @returns Array of tokens.
 */
const tokenize = (input, supportedMarks) => {
  // buffer is needed for words collecting while iterating
  let wordBuffer = ''; // result collection

  const tokens = [];
  const selectorSymbols = input.split(''); // iterate through selector chars and collect tokens

  selectorSymbols.forEach(symbol => {
    if (supportedMarks.includes(symbol)) {
      // if anything was collected to the buffer before
      if (wordBuffer.length > 0) {
        // now it is time to stop buffer collecting and save is as "word"
        tokens.push({
          type: TOKEN_TYPE.WORD,
          value: wordBuffer
        }); // reset the buffer

        wordBuffer = '';
      } // save current symbol as "mark"


      tokens.push({
        type: TOKEN_TYPE.MARK,
        value: symbol
      });
      return;
    } // otherwise collect symbol to the buffer


    wordBuffer += symbol;
  }); // save the last collected word

  if (wordBuffer.length > 0) {
    tokens.push({
      type: TOKEN_TYPE.WORD,
      value: wordBuffer
    });
  }

  return tokens;
};

/**
 * Prepares `rawSelector` and splits it into tokens.
 *
 * @param rawSelector Raw css selector.
 *
 * @returns Array of tokens supported for selector.
 */

const tokenizeSelector = rawSelector => {
  const selector = convert(rawSelector);
  return tokenize(selector, SUPPORTED_SELECTOR_MARKS);
};
/**
 * Splits `attribute` into tokens.
 *
 * @param attribute Input attribute.
 *
 * @returns Array of tokens supported for attribute.
 */

const tokenizeAttribute = attribute => {
  // equal sigh `=` in attribute is considered as `TOKEN_TYPE.MARK`
  return tokenize(attribute, [...SUPPORTED_SELECTOR_MARKS, EQUAL_SIGN]);
};

/**
 * Some browsers do not support Array.prototype.flat()
 * e.g. Opera 42 which is used for browserstack tests.
 *
 * @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/flat}
 *
 * @param input Array needed to be flatten.
 *
 * @returns Flatten array.
 * @throws An error if array cannot be flatten.
 */
const flatten = input => {
  const stack = [];
  input.forEach(el => stack.push(el));
  const res = [];

  while (stack.length) {
    // pop value from stack
    const next = stack.pop();

    if (!next) {
      throw new Error('Unable to make array flat');
    }

    if (Array.isArray(next)) {
      // push back array items, won't modify the original input
      next.forEach(el => stack.push(el));
    } else {
      res.push(next);
    }
  } // reverse to restore input order


  return res.reverse();
};
/**
 * Returns first item from `array`.
 *
 * @param array Input array.
 *
 * @returns First array item, or `undefined` if there is no such item.
 */

const getFirst = array => {
  return array[0];
};
/**
 * Returns last item from array.
 *
 * @param array Input array.
 *
 * @returns Last array item, or `undefined` if there is no such item.
 */

const getLast = array => {
  return array[array.length - 1];
};
/**
 * Returns array item which is previous to the last one
 * e.g. for `[5, 6, 7, 8]` returns `7`.
 *
 * @param array Input array.
 *
 * @returns Previous to last array item, or `undefined` if there is no such item.
 */

const getPrevToLast = array => {
  return array[array.length - 2];
};
/**
 * Takes array of ast node `children` and returns the child by the `index`.
 *
 * @param array Array of ast node children.
 * @param index Index of needed child in the array.
 * @param errorMessage Optional error message to throw.
 *
 * @returns Array item at `index` position.
 * @throws An error if there is no child with specified `index` in array.
 */

const getItemByIndex = (array, index, errorMessage) => {
  const indexChild = array[index];

  if (!indexChild) {
    throw new Error(errorMessage || `No array item found by index ${index}`);
  }

  return indexChild;
};

const NO_REGULAR_SELECTOR_ERROR = 'At least one of Selector node children should be RegularSelector';
/**
 * Checks whether the type of `astNode` is SelectorList.
 *
 * @param astNode Ast node.
 *
 * @returns True if astNode.type === SelectorList.
 */

const isSelectorListNode = astNode => {
  return (astNode === null || astNode === void 0 ? void 0 : astNode.type) === NODE.SELECTOR_LIST;
};
/**
 * Checks whether the type of `astNode` is Selector.
 *
 * @param astNode Ast node.
 *
 * @returns True if astNode.type === Selector.
 */

const isSelectorNode = astNode => {
  return (astNode === null || astNode === void 0 ? void 0 : astNode.type) === NODE.SELECTOR;
};
/**
 * Checks whether the type of `astNode` is RegularSelector.
 *
 * @param astNode Ast node.
 *
 * @returns True if astNode.type === RegularSelector.
 */

const isRegularSelectorNode = astNode => {
  return (astNode === null || astNode === void 0 ? void 0 : astNode.type) === NODE.REGULAR_SELECTOR;
};
/**
 * Checks whether the type of `astNode` is ExtendedSelector.
 *
 * @param astNode Ast node.
 *
 * @returns True if astNode.type === ExtendedSelector.
 */

const isExtendedSelectorNode = astNode => {
  return astNode.type === NODE.EXTENDED_SELECTOR;
};
/**
 * Checks whether the type of `astNode` is AbsolutePseudoClass.
 *
 * @param astNode Ast node.
 *
 * @returns True if astNode.type === AbsolutePseudoClass.
 */

const isAbsolutePseudoClassNode = astNode => {
  return (astNode === null || astNode === void 0 ? void 0 : astNode.type) === NODE.ABSOLUTE_PSEUDO_CLASS;
};
/**
 * Checks whether the type of `astNode` is RelativePseudoClass.
 *
 * @param astNode Ast node.
 *
 * @returns True if astNode.type === RelativePseudoClass.
 */

const isRelativePseudoClassNode = astNode => {
  return (astNode === null || astNode === void 0 ? void 0 : astNode.type) === NODE.RELATIVE_PSEUDO_CLASS;
};
/**
 * Returns name of `astNode`.
 *
 * @param astNode AbsolutePseudoClass or RelativePseudoClass node.
 *
 * @returns Name of `astNode`.
 * @throws An error on unsupported ast node or no name found.
 */

const getNodeName = astNode => {
  if (astNode === null) {
    throw new Error('Ast node should be defined');
  }

  if (!isAbsolutePseudoClassNode(astNode) && !isRelativePseudoClassNode(astNode)) {
    throw new Error('Only AbsolutePseudoClass or RelativePseudoClass ast node can have a name');
  }

  if (!astNode.name) {
    throw new Error('Extended pseudo-class should have a name');
  }

  return astNode.name;
};
/**
 * Returns value of `astNode`.
 *
 * @param astNode RegularSelector or AbsolutePseudoClass node.
 * @param errorMessage Optional error message if no value found.
 *
 * @returns Value of `astNode`.
 * @throws An error on unsupported ast node or no value found.
 */

const getNodeValue = (astNode, errorMessage) => {
  if (astNode === null) {
    throw new Error('Ast node should be defined');
  }

  if (!isRegularSelectorNode(astNode) && !isAbsolutePseudoClassNode(astNode)) {
    throw new Error('Only RegularSelector ot AbsolutePseudoClass ast node can have a value');
  }

  if (!astNode.value) {
    throw new Error(errorMessage || 'Ast RegularSelector ot AbsolutePseudoClass node should have a value');
  }

  return astNode.value;
};
/**
 * Returns only RegularSelector nodes from `children`.
 *
 * @param children Array of ast node children.
 *
 * @returns Array of RegularSelector nodes.
 */

const getRegularSelectorNodes = children => {
  return children.filter(isRegularSelectorNode);
};
/**
 * Returns the first RegularSelector node from `children`.
 *
 * @param children Array of ast node children.
 * @param errorMessage Optional error message if no value found.
 *
 * @returns Ast RegularSelector node.
 * @throws An error if no RegularSelector node found.
 */


const getFirstRegularChild = (children, errorMessage) => {
  const regularSelectorNodes = getRegularSelectorNodes(children);
  const firstRegularSelectorNode = getFirst(regularSelectorNodes);

  if (!firstRegularSelectorNode) {
    throw new Error(errorMessage || NO_REGULAR_SELECTOR_ERROR);
  }

  return firstRegularSelectorNode;
};
/**
 * Returns the last RegularSelector node from `children`.
 *
 * @param children Array of ast node children.
 *
 * @returns Ast RegularSelector node.
 * @throws An error if no RegularSelector node found.
 */

const getLastRegularChild = children => {
  const regularSelectorNodes = getRegularSelectorNodes(children);
  const lastRegularSelectorNode = getLast(regularSelectorNodes);

  if (!lastRegularSelectorNode) {
    throw new Error(NO_REGULAR_SELECTOR_ERROR);
  }

  return lastRegularSelectorNode;
};
/**
 * Returns the only child of `node`.
 *
 * @param node Ast node.
 * @param errorMessage Error message.
 *
 * @returns The only child of ast node.
 * @throws An error if none or more than one child found.
 */

const getNodeOnlyChild = (node, errorMessage) => {
  if (node.children.length !== 1) {
    throw new Error(errorMessage);
  }

  const onlyChild = getFirst(node.children);

  if (!onlyChild) {
    throw new Error(errorMessage);
  }

  return onlyChild;
};
/**
 * Takes ExtendedSelector node and returns its only child.
 *
 * @param extendedSelectorNode ExtendedSelector ast node.
 *
 * @returns AbsolutePseudoClass or RelativePseudoClass.
 * @throws An error if there is no specific pseudo-class ast node.
 */

const getPseudoClassNode = extendedSelectorNode => {
  return getNodeOnlyChild(extendedSelectorNode, 'Extended selector should be specified');
};
/**
 * Takes RelativePseudoClass node and returns its only child
 * which is relative SelectorList node.
 *
 * @param pseudoClassNode RelativePseudoClass.
 *
 * @returns Relative SelectorList node.
 * @throws An error if no selector list found.
 */

const getRelativeSelectorListNode = pseudoClassNode => {
  if (!isRelativePseudoClassNode(pseudoClassNode)) {
    throw new Error('Only RelativePseudoClass node can have relative SelectorList node as child');
  }

  return getNodeOnlyChild(pseudoClassNode, `Missing arg for :${getNodeName(pseudoClassNode)}() pseudo-class`);
};

const ATTRIBUTE_CASE_INSENSITIVE_FLAG = 'i';
/**
 * Limited list of available symbols before slash `/`
 * to check whether it is valid regexp pattern opening.
 */

const POSSIBLE_MARKS_BEFORE_REGEXP = {
  COMMON: [// e.g. ':matches-attr(/data-/)'
  BRACKET.PARENTHESES.LEFT, // e.g. `:matches-attr('/data-/')`
  SINGLE_QUOTE, // e.g. ':matches-attr("/data-/")'
  DOUBLE_QUOTE, // e.g. ':matches-attr(check=/data-v-/)'
  EQUAL_SIGN, // e.g. ':matches-property(inner./_test/=null)'
  DOT, // e.g. ':matches-css(height:/20px/)'
  COLON, // ':matches-css-after( content  :   /(\\d+\\s)*me/  )'
  SPACE],
  CONTAINS: [// e.g. ':contains(/text/)'
  BRACKET.PARENTHESES.LEFT, // e.g. `:contains('/text/')`
  SINGLE_QUOTE, // e.g. ':contains("/text/")'
  DOUBLE_QUOTE]
};
/**
 * Checks whether the passed token is supported extended pseudo-class.
 *
 * @param tokenValue Token value to check.
 *
 * @returns True if `tokenValue` is one of supported extended pseudo-class names.
 */

const isSupportedPseudoClass = tokenValue => {
  return SUPPORTED_PSEUDO_CLASSES.includes(tokenValue);
};
/**
 * Checks whether the passed pseudo-class `name` should be optimized,
 * i.e. :not() and :is().
 *
 * @param name Pseudo-class name.
 *
 * @returns True if `name` is one if pseudo-class which should be optimized.
 */

const isOptimizationPseudoClass = name => {
  return OPTIMIZATION_PSEUDO_CLASSES.includes(name);
};
/**
 * Checks whether next to "space" token is a continuation of regular selector being processed.
 *
 * @param nextTokenType Type of token next to current one.
 * @param nextTokenValue Value of token next to current one.
 *
 * @returns True if next token seems to be a part of current regular selector.
 */

const doesRegularContinueAfterSpace = (nextTokenType, nextTokenValue) => {
  // regular selector does not continues after the current token
  if (!nextTokenType || !nextTokenValue) {
    return false;
  }

  return COMBINATORS.includes(nextTokenValue) || nextTokenType === TOKEN_TYPE.WORD // e.g. '#main *:has(> .ad)'
  || nextTokenValue === ASTERISK || nextTokenValue === ID_MARKER || nextTokenValue === CLASS_MARKER // e.g. 'div :where(.content)'
  || nextTokenValue === COLON // e.g. "div[class*=' ']"
  || nextTokenValue === SINGLE_QUOTE // e.g. 'div[class*=" "]'
  || nextTokenValue === DOUBLE_QUOTE || nextTokenValue === BRACKET.SQUARE.LEFT;
};
/**
 * Checks whether the regexp pattern for pseudo-class arg starts.
 * Needed for `context.isRegexpOpen` flag.
 *
 * @param context Selector parser context.
 * @param prevTokenValue Value of previous token.
 * @param bufferNodeValue Value of bufferNode.
 *
 * @returns True if current token seems to be a start of regexp pseudo-class arg pattern.
 * @throws An error on invalid regexp pattern.
 */

const isRegexpOpening = (context, prevTokenValue, bufferNodeValue) => {
  const lastExtendedPseudoClassName = getLast(context.extendedPseudoNamesStack);

  if (!lastExtendedPseudoClassName) {
    throw new Error('Regexp pattern allowed only in arg of extended pseudo-class');
  } // for regexp pattens the slash should not be escaped
  // const isRegexpPatternSlash = prevTokenValue !== BACKSLASH;
  // regexp pattern can be set as arg of pseudo-class
  // which means limited list of available symbols before slash `/`;
  // for :contains() pseudo-class regexp pattern should be at the beginning of arg


  if (CONTAINS_PSEUDO_NAMES.includes(lastExtendedPseudoClassName)) {
    return POSSIBLE_MARKS_BEFORE_REGEXP.CONTAINS.includes(prevTokenValue);
  }

  if (prevTokenValue === SLASH && lastExtendedPseudoClassName !== XPATH_PSEUDO_CLASS_MARKER) {
    const rawArgDesc = bufferNodeValue ? `in arg part: '${bufferNodeValue}'` : 'arg';
    throw new Error(`Invalid regexp pattern for :${lastExtendedPseudoClassName}() pseudo-class ${rawArgDesc}`);
  } // for other pseudo-classes regexp pattern can be either the whole arg or its part


  return POSSIBLE_MARKS_BEFORE_REGEXP.COMMON.includes(prevTokenValue);
};
/**
 * Checks whether the attribute starts.
 *
 * @param tokenValue Value of current token.
 * @param prevTokenValue Previous token value.
 *
 * @returns True if combination of current and previous token seems to be **a start** of attribute.
 */

const isAttributeOpening = (tokenValue, prevTokenValue) => {
  return tokenValue === BRACKET.SQUARE.LEFT && prevTokenValue !== BACKSLASH;
};
/**
 * Checks whether the attribute ends.
 *
 * @param context Selector parser context.
 *
 * @returns True if combination of current and previous token seems to be **an end** of attribute.
 * @throws An error on invalid attribute.
 */

const isAttributeClosing = context => {
  var _getPrevToLast;

  if (!context.isAttributeBracketsOpen) {
    return false;
  } // valid attributes may have extra spaces inside.
  // we get rid of them just to simplify the checking and they are skipped only here:
  //   - spaces will be collected to the ast with spaces as they were declared is selector
  //   - extra spaces in attribute are not relevant to attribute syntax validity
  //     e.g. 'a[ title ]' is the same as 'a[title]'
  //          'div[style *= "MARGIN" i]' is the same as 'div[style*="MARGIN"i]'


  const noSpaceAttr = context.attributeBuffer.split(SPACE).join(''); // tokenize the prepared attribute string

  const attrTokens = tokenizeAttribute(noSpaceAttr);
  const firstAttrToken = getFirst(attrTokens);
  const firstAttrTokenType = firstAttrToken === null || firstAttrToken === void 0 ? void 0 : firstAttrToken.type;
  const firstAttrTokenValue = firstAttrToken === null || firstAttrToken === void 0 ? void 0 : firstAttrToken.value; // signal an error on any mark-type token except backslash
  // e.g. '[="margin"]'

  if (firstAttrTokenType === TOKEN_TYPE.MARK // backslash is allowed at start of attribute
  // e.g. '[\\:data-service-slot]'
  && firstAttrTokenValue !== BACKSLASH) {
    // eslint-disable-next-line max-len
    throw new Error(`'[${context.attributeBuffer}]' is not a valid attribute due to '${firstAttrTokenValue}' at start of it`);
  }

  const lastAttrToken = getLast(attrTokens);
  const lastAttrTokenType = lastAttrToken === null || lastAttrToken === void 0 ? void 0 : lastAttrToken.type;
  const lastAttrTokenValue = lastAttrToken === null || lastAttrToken === void 0 ? void 0 : lastAttrToken.value;

  if (lastAttrTokenValue === EQUAL_SIGN) {
    // e.g. '[style=]'
    throw new Error(`'[${context.attributeBuffer}]' is not a valid attribute due to '${EQUAL_SIGN}'`);
  }

  const equalSignIndex = attrTokens.findIndex(token => {
    return token.type === TOKEN_TYPE.MARK && token.value === EQUAL_SIGN;
  });
  const prevToLastAttrTokenValue = (_getPrevToLast = getPrevToLast(attrTokens)) === null || _getPrevToLast === void 0 ? void 0 : _getPrevToLast.value;

  if (equalSignIndex === -1) {
    // if there is no '=' inside attribute,
    // it must be just attribute name which means the word-type token before closing bracket
    // e.g. 'div[style]'
    if (lastAttrTokenType === TOKEN_TYPE.WORD) {
      return true;
    }

    return prevToLastAttrTokenValue === BACKSLASH // some weird attribute are valid too
    // e.g. '[class\\"ads-article\\"]'
    && (lastAttrTokenValue === DOUBLE_QUOTE // e.g. "[class\\'ads-article\\']"
    || lastAttrTokenValue === SINGLE_QUOTE);
  } // get the value of token next to `=`


  const nextToEqualSignToken = getItemByIndex(attrTokens, equalSignIndex + 1);
  const nextToEqualSignTokenValue = nextToEqualSignToken.value; // check whether the attribute value wrapper in quotes

  const isAttrValueQuote = nextToEqualSignTokenValue === SINGLE_QUOTE || nextToEqualSignTokenValue === DOUBLE_QUOTE; // for no quotes after `=` the last token before `]` should be a word-type one
  // e.g. 'div[style*=margin]'
  //      'div[style*=MARGIN i]'

  if (!isAttrValueQuote) {
    if (lastAttrTokenType === TOKEN_TYPE.WORD) {
      return true;
    } // otherwise signal an error
    // e.g. 'table[style*=border: 0px"]'


    throw new Error(`'[${context.attributeBuffer}]' is not a valid attribute`);
  } // otherwise if quotes for value are present
  // the last token before `]` can still be word-type token
  // e.g. 'div[style*="MARGIN" i]'


  if (lastAttrTokenType === TOKEN_TYPE.WORD && (lastAttrTokenValue === null || lastAttrTokenValue === void 0 ? void 0 : lastAttrTokenValue.toLocaleLowerCase()) === ATTRIBUTE_CASE_INSENSITIVE_FLAG) {
    return prevToLastAttrTokenValue === nextToEqualSignTokenValue;
  } // eventually if there is quotes for attribute value and last token is not a word,
  // the closing mark should be the same quote as opening one


  return lastAttrTokenValue === nextToEqualSignTokenValue;
};
/**
 * Checks whether the `tokenValue` is a whitespace character.
 *
 * @param tokenValue Token value.
 *
 * @returns True if `tokenValue` is a whitespace character.
 */

const isWhiteSpaceChar = tokenValue => {
  if (!tokenValue) {
    return false;
  }

  return WHITE_SPACE_CHARACTERS.includes(tokenValue);
};

/**
 * Checks whether the passed `str` is a name of supported absolute extended pseudo-class,
 * e.g. :contains(), :matches-css() etc.
 *
 * @param str Token value to check.
 *
 * @returns True if `str` is one of absolute extended pseudo-class names.
 */

const isAbsolutePseudoClass = str => {
  return ABSOLUTE_PSEUDO_CLASSES.includes(str);
};
/**
 * Checks whether the passed `str` is a name of supported relative extended pseudo-class,
 * e.g. :has(), :not() etc.
 *
 * @param str Token value to check.
 *
 * @returns True if `str` is one of relative extended pseudo-class names.
 */

const isRelativePseudoClass = str => {
  return RELATIVE_PSEUDO_CLASSES.includes(str);
};

/**
 * Returns the node which is being collected
 * or null if there is no such one.
 *
 * @param context Selector parser context.
 *
 * @returns Buffer node or null.
 */

const getBufferNode = context => {
  if (context.pathToBufferNode.length === 0) {
    return null;
  } // buffer node is always the last in the pathToBufferNode stack


  return getLast(context.pathToBufferNode) || null;
};
/**
 * Returns the parent node to the 'buffer node' — which is the one being collected —
 * or null if there is no such one.
 *
 * @param context Selector parser context.
 *
 * @returns Parent node of buffer node or null.
 */

const getBufferNodeParent = context => {
  // at least two nodes should exist — the buffer node and its parent
  // otherwise return null
  if (context.pathToBufferNode.length < 2) {
    return null;
  } // since the buffer node is always the last in the pathToBufferNode stack
  // its parent is previous to it in the stack


  return getPrevToLast(context.pathToBufferNode) || null;
};
/**
 * Returns last RegularSelector ast node.
 * Needed for parsing of the complex selector with extended pseudo-class inside it.
 *
 * @param context Selector parser context.
 *
 * @returns Ast RegularSelector node.
 * @throws An error if:
 * - bufferNode is absent;
 * - type of bufferNode is unsupported;
 * - no RegularSelector in bufferNode.
 */

const getContextLastRegularSelectorNode = context => {
  const bufferNode = getBufferNode(context);

  if (!bufferNode) {
    throw new Error('No bufferNode found');
  }

  if (!isSelectorNode(bufferNode)) {
    throw new Error('Unsupported bufferNode type');
  }

  const lastRegularSelectorNode = getLastRegularChild(bufferNode.children);
  context.pathToBufferNode.push(lastRegularSelectorNode);
  return lastRegularSelectorNode;
};
/**
 * Updates needed buffer node value while tokens iterating.
 * For RegularSelector also collects token values to context.attributeBuffer
 * for proper attribute parsing.
 *
 * @param context Selector parser context.
 * @param tokenValue Value of current token.
 *
 * @throws An error if:
 * - no bufferNode;
 * - bufferNode.type is not RegularSelector or AbsolutePseudoClass.
 */

const updateBufferNode = (context, tokenValue) => {
  const bufferNode = getBufferNode(context);

  if (bufferNode === null) {
    throw new Error('No bufferNode to update');
  }

  if (isAbsolutePseudoClassNode(bufferNode)) {
    bufferNode.value += tokenValue;
  } else if (isRegularSelectorNode(bufferNode)) {
    bufferNode.value += tokenValue;

    if (context.isAttributeBracketsOpen) {
      context.attributeBuffer += tokenValue;
    }
  } else {
    // eslint-disable-next-line max-len
    throw new Error(`${bufferNode.type} node cannot be updated. Only RegularSelector and AbsolutePseudoClass are supported`);
  }
};
/**
 * Adds SelectorList node to context.ast at the start of ast collecting.
 *
 * @param context Selector parser context.
 */

const addSelectorListNode = context => {
  const selectorListNode = new AnySelectorNode(NODE.SELECTOR_LIST);
  context.ast = selectorListNode;
  context.pathToBufferNode.push(selectorListNode);
};
/**
 * Adds new node to buffer node children.
 * New added node will be considered as buffer node after it.
 *
 * @param context Selector parser context.
 * @param type Type of node to add.
 * @param tokenValue Optional, defaults to `''`, value of processing token.
 *
 * @throws An error if no bufferNode.
 */

const addAstNodeByType = function (context, type) {
  let tokenValue = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
  const bufferNode = getBufferNode(context);

  if (bufferNode === null) {
    throw new Error('No buffer node');
  }

  let node;

  if (type === NODE.REGULAR_SELECTOR) {
    node = new RegularSelectorNode(tokenValue);
  } else if (type === NODE.ABSOLUTE_PSEUDO_CLASS) {
    node = new AbsolutePseudoClassNode(tokenValue);
  } else if (type === NODE.RELATIVE_PSEUDO_CLASS) {
    node = new RelativePseudoClassNode(tokenValue);
  } else {
    // SelectorList || Selector || ExtendedSelector
    node = new AnySelectorNode(type);
  }

  bufferNode.addChild(node);
  context.pathToBufferNode.push(node);
};
/**
 * The very beginning of ast collecting.
 *
 * @param context Selector parser context.
 * @param tokenValue Value of regular selector.
 */

const initAst = (context, tokenValue) => {
  addSelectorListNode(context);
  addAstNodeByType(context, NODE.SELECTOR); // RegularSelector node is always the first child of Selector node

  addAstNodeByType(context, NODE.REGULAR_SELECTOR, tokenValue);
};
/**
 * Inits selector list subtree for relative extended pseudo-classes, e.g. :has(), :not().
 *
 * @param context Selector parser context.
 * @param tokenValue Optional, defaults to `''`, value of inner regular selector.
 */

const initRelativeSubtree = function (context) {
  let tokenValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
  addAstNodeByType(context, NODE.SELECTOR_LIST);
  addAstNodeByType(context, NODE.SELECTOR);
  addAstNodeByType(context, NODE.REGULAR_SELECTOR, tokenValue);
};
/**
 * Goes to closest parent specified by type.
 * Actually updates path to buffer node for proper ast collecting of selectors while parsing.
 *
 * @param context Selector parser context.
 * @param parentType Type of needed parent node in ast.
 */

const upToClosest = (context, parentType) => {
  for (let i = context.pathToBufferNode.length - 1; i >= 0; i -= 1) {
    var _context$pathToBuffer;

    if (((_context$pathToBuffer = context.pathToBufferNode[i]) === null || _context$pathToBuffer === void 0 ? void 0 : _context$pathToBuffer.type) === parentType) {
      context.pathToBufferNode = context.pathToBufferNode.slice(0, i + 1);
      break;
    }
  }
};
/**
 * Returns needed buffer node updated due to complex selector parsing.
 *
 * @param context Selector parser context.
 *
 * @returns Ast node for following selector parsing.
 * @throws An error if there is no upper SelectorNode is ast.
 */

const getUpdatedBufferNode = context => {
  // it may happen during the parsing of selector list
  // which is an argument of relative pseudo-class
  // e.g. '.banner:has(~span, ~p)'
  // parser position is here  ↑
  // so if after the comma the buffer node type is SelectorList and parent type is RelativePseudoClass
  // we should simply return the current buffer node
  const bufferNode = getBufferNode(context);

  if (bufferNode && isSelectorListNode(bufferNode) && isRelativePseudoClassNode(getBufferNodeParent(context))) {
    return bufferNode;
  }

  upToClosest(context, NODE.SELECTOR);
  const selectorNode = getBufferNode(context);

  if (!selectorNode) {
    throw new Error('No SelectorNode, impossible to continue selector parsing by ExtendedCss');
  }

  const lastSelectorNodeChild = getLast(selectorNode.children);
  const hasExtended = lastSelectorNodeChild && isExtendedSelectorNode(lastSelectorNodeChild) // parser position might be inside standard pseudo-class brackets which has space
  // e.g. 'div:contains(/а/):nth-child(100n + 2)'
  && context.standardPseudoBracketsStack.length === 0;
  const supposedPseudoClassNode = hasExtended && getFirst(lastSelectorNodeChild.children);
  let newNeededBufferNode = selectorNode;

  if (supposedPseudoClassNode) {
    // name of pseudo-class for last extended-node child for Selector node
    const lastExtendedPseudoName = hasExtended && supposedPseudoClassNode.name;
    const isLastExtendedNameRelative = lastExtendedPseudoName && isRelativePseudoClass(lastExtendedPseudoName);
    const isLastExtendedNameAbsolute = lastExtendedPseudoName && isAbsolutePseudoClass(lastExtendedPseudoName);
    const hasRelativeExtended = isLastExtendedNameRelative && context.extendedPseudoBracketsStack.length > 0 && context.extendedPseudoBracketsStack.length === context.extendedPseudoNamesStack.length;
    const hasAbsoluteExtended = isLastExtendedNameAbsolute && lastExtendedPseudoName === getLast(context.extendedPseudoNamesStack);

    if (hasRelativeExtended) {
      // return relative selector node to update later
      context.pathToBufferNode.push(lastSelectorNodeChild);
      newNeededBufferNode = supposedPseudoClassNode;
    } else if (hasAbsoluteExtended) {
      // return absolute selector node to update later
      context.pathToBufferNode.push(lastSelectorNodeChild);
      newNeededBufferNode = supposedPseudoClassNode;
    }
  } else if (hasExtended) {
    // return selector node to add new regular selector node later
    newNeededBufferNode = selectorNode;
  } else {
    // otherwise return last regular selector node to update later
    newNeededBufferNode = getContextLastRegularSelectorNode(context);
  } // update the path to buffer node properly


  context.pathToBufferNode.push(newNeededBufferNode);
  return newNeededBufferNode;
};
/**
 * Checks values of few next tokens on colon token `:` and:
 *  - updates buffer node for following standard pseudo-class;
 *  - adds extended selector ast node for following extended pseudo-class;
 *  - validates some cases of `:remove()` and `:has()` usage.
 *
 * @param context Selector parser context.
 * @param selector Selector.
 * @param tokenValue Value of current token.
 * @param nextTokenValue Value of token next to current one.
 * @param nextToNextTokenValue Value of token next to next to current one.
 *
 * @throws An error on :remove() pseudo-class in selector
 * or :has() inside regular pseudo limitation.
 */

const handleNextTokenOnColon = (context, selector, tokenValue, nextTokenValue, nextToNextTokenValue) => {
  if (!nextTokenValue) {
    throw new Error(`Invalid colon ':' at the end of selector: '${selector}'`);
  }

  if (!isSupportedPseudoClass(nextTokenValue.toLowerCase())) {
    if (nextTokenValue.toLowerCase() === REMOVE_PSEUDO_MARKER) {
      // :remove() pseudo-class should be handled before
      // as it is not about element selecting but actions with elements
      // e.g. 'body > div:empty:remove()'
      throw new Error(`${REMOVE_ERROR_PREFIX.INVALID_REMOVE}: '${selector}'`);
    } // if following token is not an extended pseudo
    // the colon should be collected to value of RegularSelector
    // e.g. '.entry_text:nth-child(2)'


    updateBufferNode(context, tokenValue); // check the token after the pseudo and do balance parentheses later
    // only if it is functional pseudo-class (standard with brackets, e.g. ':lang()').
    // no brackets balance needed for such case,
    // parser position is on first colon after the 'div':
    // e.g. 'div:last-child:has(button.privacy-policy__btn)'

    if (nextToNextTokenValue && nextToNextTokenValue === BRACKET.PARENTHESES.LEFT // no brackets balance needed for parentheses inside attribute value
    // e.g. 'a[href="javascript:void(0)"]'   <-- parser position is on colon `:`
    // before `void`           ↑
    && !context.isAttributeBracketsOpen) {
      context.standardPseudoNamesStack.push(nextTokenValue);
    }
  } else {
    // it is supported extended pseudo-class.
    // Disallow :has() inside the pseudos accepting only compound selectors
    // https://bugs.chromium.org/p/chromium/issues/detail?id=669058#c54 [2]
    if (HAS_PSEUDO_CLASS_MARKERS.includes(nextTokenValue) && context.standardPseudoNamesStack.length > 0) {
      // eslint-disable-next-line max-len
      throw new Error(`Usage of :${nextTokenValue}() pseudo-class is not allowed inside regular pseudo: '${getLast(context.standardPseudoNamesStack)}'`);
    } else {
      // stop RegularSelector value collecting
      upToClosest(context, NODE.SELECTOR); // add ExtendedSelector to Selector children

      addAstNodeByType(context, NODE.EXTENDED_SELECTOR);
    }
  }
};

// e.g. ':is(.page, .main) > .banner' or '*:not(span):not(p)'

const IS_OR_NOT_PSEUDO_SELECTING_ROOT = `html ${ASTERISK}`;
/**
 * Checks if there are any ExtendedSelector node in selector list.
 *
 * @param selectorList Ast SelectorList node.
 *
 * @returns True if `selectorList` has any inner ExtendedSelector node.
 */

const hasExtendedSelector = selectorList => {
  return selectorList.children.some(selectorNode => {
    return selectorNode.children.some(selectorNodeChild => {
      return isExtendedSelectorNode(selectorNodeChild);
    });
  });
};
/**
 * Converts selector list of RegularSelector nodes to string.
 *
 * @param selectorList Ast SelectorList node.
 *
 * @returns String representation for selector list of regular selectors.
 */


const selectorListOfRegularsToString = selectorList => {
  // if there is no ExtendedSelector in relative SelectorList
  // it means that each Selector node has single child — RegularSelector node
  // and their values should be combined to string
  const standardCssSelectors = selectorList.children.map(selectorNode => {
    const selectorOnlyChild = getNodeOnlyChild(selectorNode, 'Ast Selector node should have RegularSelector node');
    return getNodeValue(selectorOnlyChild);
  });
  return standardCssSelectors.join(`${COMMA}${SPACE}`);
};
/**
 * Updates children of `node` replacing them with `newChildren`.
 * Important: modifies input `node` which is passed by reference.
 *
 * @param node Ast node to update.
 * @param newChildren Array of new children for ast node.
 *
 * @returns Updated ast node.
 */


const updateNodeChildren = (node, newChildren) => {
  node.children = newChildren;
  return node;
};
/**
 * Recursively checks whether the ExtendedSelector node should be optimized.
 * It has to be recursive because RelativePseudoClass has inner SelectorList node.
 *
 * @param currExtendedSelectorNode Ast ExtendedSelector node.
 *
 * @returns True is ExtendedSelector should be optimized.
 */


const shouldOptimizeExtendedSelector = currExtendedSelectorNode => {
  if (currExtendedSelectorNode === null) {
    return false;
  }

  const extendedPseudoClassNode = getPseudoClassNode(currExtendedSelectorNode);
  const pseudoName = getNodeName(extendedPseudoClassNode);

  if (isAbsolutePseudoClass(pseudoName)) {
    return false;
  }

  const relativeSelectorList = getRelativeSelectorListNode(extendedPseudoClassNode);
  const innerSelectorNodes = relativeSelectorList.children; // simple checking for standard selectors in arg of :not() or :is() pseudo-class
  // e.g. 'div > *:is(div, a, span)'

  if (isOptimizationPseudoClass(pseudoName)) {
    const areAllSelectorNodeChildrenRegular = innerSelectorNodes.every(selectorNode => {
      try {
        const selectorOnlyChild = getNodeOnlyChild(selectorNode, 'Selector node should have RegularSelector'); // it means that the only child is RegularSelector and it can be optimized

        return isRegularSelectorNode(selectorOnlyChild);
      } catch (e) {
        return false;
      }
    });

    if (areAllSelectorNodeChildrenRegular) {
      return true;
    }
  } // for other extended pseudo-classes than :not() and :is()


  return innerSelectorNodes.some(selectorNode => {
    return selectorNode.children.some(selectorNodeChild => {
      if (!isExtendedSelectorNode(selectorNodeChild)) {
        return false;
      } // check inner ExtendedSelector recursively
      // e.g. 'div:has(*:not(.header))'


      return shouldOptimizeExtendedSelector(selectorNodeChild);
    });
  });
};
/**
 * Returns optimized ExtendedSelector node if it can be optimized
 * or null if ExtendedSelector is fully optimized while function execution
 * which means that value of `prevRegularSelectorNode` is updated.
 *
 * @param currExtendedSelectorNode Current ExtendedSelector node to optimize.
 * @param prevRegularSelectorNode Previous RegularSelector node.
 *
 * @returns Ast node or null.
 */


const getOptimizedExtendedSelector = (currExtendedSelectorNode, prevRegularSelectorNode) => {
  if (!currExtendedSelectorNode) {
    return null;
  }

  const extendedPseudoClassNode = getPseudoClassNode(currExtendedSelectorNode);
  const relativeSelectorList = getRelativeSelectorListNode(extendedPseudoClassNode);
  const hasInnerExtendedSelector = hasExtendedSelector(relativeSelectorList);

  if (!hasInnerExtendedSelector) {
    // if there is no extended selectors for :not() or :is()
    // e.g. 'div:not(.content, .main)'
    const relativeSelectorListStr = selectorListOfRegularsToString(relativeSelectorList);
    const pseudoName = getNodeName(extendedPseudoClassNode); // eslint-disable-next-line max-len

    const optimizedExtendedStr = `${COLON}${pseudoName}${BRACKET.PARENTHESES.LEFT}${relativeSelectorListStr}${BRACKET.PARENTHESES.RIGHT}`;
    prevRegularSelectorNode.value = `${getNodeValue(prevRegularSelectorNode)}${optimizedExtendedStr}`;
    return null;
  } // eslint-disable-next-line @typescript-eslint/no-use-before-define


  const optimizedRelativeSelectorList = optimizeSelectorListNode(relativeSelectorList);
  const optimizedExtendedPseudoClassNode = updateNodeChildren(extendedPseudoClassNode, [optimizedRelativeSelectorList]);
  return updateNodeChildren(currExtendedSelectorNode, [optimizedExtendedPseudoClassNode]);
};
/**
 * Combines values of `previous` and `current` RegularSelector nodes.
 * It may happen during the optimization when ExtendedSelector between RegularSelector node was optimized.
 *
 * @param current Current RegularSelector node.
 * @param previous Previous RegularSelector node.
 */


const optimizeCurrentRegularSelector = (current, previous) => {
  previous.value = `${getNodeValue(previous)}${SPACE}${getNodeValue(current)}`;
};
/**
 * Optimizes ast Selector node.
 *
 * @param selectorNode Ast Selector node.
 *
 * @returns Optimized ast node.
 * @throws An error while collecting optimized nodes.
 */


const optimizeSelectorNode = selectorNode => {
  // non-optimized list of SelectorNode children
  const rawSelectorNodeChildren = selectorNode.children; // for collecting optimized children list

  const optimizedChildrenList = [];
  let currentIndex = 0; // iterate through all children in non-optimized ast Selector node

  while (currentIndex < rawSelectorNodeChildren.length) {
    const currentChild = getItemByIndex(rawSelectorNodeChildren, currentIndex, 'currentChild should be specified'); // no need to optimize the very first child which is always RegularSelector node

    if (currentIndex === 0) {
      optimizedChildrenList.push(currentChild);
    } else {
      const prevRegularChild = getLastRegularChild(optimizedChildrenList);

      if (isExtendedSelectorNode(currentChild)) {
        // start checking with point is null
        let optimizedExtendedSelector = null; // check whether the optimization is needed

        let isOptimizationNeeded = shouldOptimizeExtendedSelector(currentChild); // update optimizedExtendedSelector so it can be optimized recursively
        // i.e. `getOptimizedExtendedSelector(optimizedExtendedSelector)` below

        optimizedExtendedSelector = currentChild;

        while (isOptimizationNeeded) {
          // recursively optimize ExtendedSelector until no optimization needed
          // e.g. div > *:is(.banner:not(.block))
          optimizedExtendedSelector = getOptimizedExtendedSelector(optimizedExtendedSelector, prevRegularChild);
          isOptimizationNeeded = shouldOptimizeExtendedSelector(optimizedExtendedSelector);
        } // if it was simple :not() of :is() with standard selector arg
        // e.g. 'div:not([class][id])'
        // or   '.main > *:is([data-loaded], .banner)'
        // after the optimization the ExtendedSelector node become part of RegularSelector
        // so nothing to save eventually
        // otherwise the optimized ExtendedSelector should be saved
        // e.g. 'div:has(:not([class]))'


        if (optimizedExtendedSelector !== null) {
          optimizedChildrenList.push(optimizedExtendedSelector); // if optimization is not needed

          const optimizedPseudoClass = getPseudoClassNode(optimizedExtendedSelector);
          const optimizedPseudoName = getNodeName(optimizedPseudoClass); // parent element checking is used to apply :is() and :not() pseudo-classes as extended.
          // as there is no parentNode for root element (html)
          // so element selection should be limited to it's children
          // e.g. '*:is(:has(.page))' -> 'html *:is(has(.page))'
          // or   '*:not(:has(span))' -> 'html *:not(:has(span))'

          if (getNodeValue(prevRegularChild) === ASTERISK && isOptimizationPseudoClass(optimizedPseudoName)) {
            prevRegularChild.value = IS_OR_NOT_PSEUDO_SELECTING_ROOT;
          }
        }
      } else if (isRegularSelectorNode(currentChild)) {
        // in non-optimized ast, RegularSelector node may follow ExtendedSelector which should be optimized
        // for example, for 'div:not(.content) > .banner' schematically it looks like
        // non-optimized ast: [
        //   1. RegularSelector: 'div'
        //   2. ExtendedSelector: 'not(.content)'
        //   3. RegularSelector: '> .banner'
        // ]
        // which after the ExtendedSelector looks like
        // partly optimized ast: [
        //   1. RegularSelector: 'div:not(.content)'
        //   2. RegularSelector: '> .banner'
        // ]
        // so second RegularSelector value should be combined with first one
        // optimized ast: [
        //   1. RegularSelector: 'div:not(.content) > .banner'
        // ]
        // here we check **children of selectorNode** after previous optimization if it was
        const lastOptimizedChild = getLast(optimizedChildrenList) || null;

        if (isRegularSelectorNode(lastOptimizedChild)) {
          optimizeCurrentRegularSelector(currentChild, prevRegularChild);
        }
      }
    }

    currentIndex += 1;
  }

  return updateNodeChildren(selectorNode, optimizedChildrenList);
};
/**
 * Optimizes ast SelectorList node.
 *
 * @param selectorListNode SelectorList node.
 *
 * @returns Optimized ast node.
 */


const optimizeSelectorListNode = selectorListNode => {
  return updateNodeChildren(selectorListNode, selectorListNode.children.map(s => optimizeSelectorNode(s)));
};
/**
 * Optimizes ast:
 * If arg of :not() and :is() pseudo-classes does not contain extended selectors,
 * native Document.querySelectorAll() can be used to query elements.
 * It means that ExtendedSelector ast nodes can be removed
 * and value of relevant RegularSelector node should be updated accordingly.
 *
 * @param ast Non-optimized ast.
 *
 * @returns Optimized ast.
 */


const optimizeAst = ast => {
  // ast is basically the selector list of selectors
  return optimizeSelectorListNode(ast);
};

// https://github.com/AdguardTeam/ExtendedCss/issues/115

const XPATH_PSEUDO_SELECTING_ROOT = 'body';
const NO_WHITESPACE_ERROR_PREFIX = 'No white space is allowed before or after extended pseudo-class name in selector';
/**
 * Parses selector into ast for following element selection.
 *
 * @param selector Selector to parse.
 *
 * @returns Parsed ast.
 * @throws An error on invalid selector.
 */

const parse = selector => {
  const tokens = tokenizeSelector(selector);
  const context = {
    ast: null,
    pathToBufferNode: [],
    extendedPseudoNamesStack: [],
    extendedPseudoBracketsStack: [],
    standardPseudoNamesStack: [],
    standardPseudoBracketsStack: [],
    isAttributeBracketsOpen: false,
    attributeBuffer: '',
    isRegexpOpen: false,
    shouldOptimize: false
  };
  let i = 0;

  while (i < tokens.length) {
    const token = tokens[i];

    if (!token) {
      break;
    } // Token to process


    const {
      type: tokenType,
      value: tokenValue
    } = token; // needed for SPACE and COLON tokens checking

    const nextToken = tokens[i + 1];
    const nextTokenType = nextToken === null || nextToken === void 0 ? void 0 : nextToken.type;
    const nextTokenValue = nextToken === null || nextToken === void 0 ? void 0 : nextToken.value; // needed for limitations
    // - :not() and :is() root element
    // - :has() usage
    // - white space before and after pseudo-class name

    const nextToNextToken = tokens[i + 2];
    const nextToNextTokenValue = nextToNextToken === null || nextToNextToken === void 0 ? void 0 : nextToNextToken.value; // needed for COLON token checking for none-specified regular selector before extended one
    // e.g. 'p, :hover'
    // or   '.banner, :contains(ads)'

    const previousToken = tokens[i - 1];
    const prevTokenType = previousToken === null || previousToken === void 0 ? void 0 : previousToken.type;
    const prevTokenValue = previousToken === null || previousToken === void 0 ? void 0 : previousToken.value; // needed for proper parsing of regexp pattern arg
    // e.g. ':matches-css(background-image: /^url\(https:\/\/example\.org\//)'

    const previousToPreviousToken = tokens[i - 2];
    const prevToPrevTokenValue = previousToPreviousToken === null || previousToPreviousToken === void 0 ? void 0 : previousToPreviousToken.value;
    let bufferNode = getBufferNode(context);

    switch (tokenType) {
      case TOKEN_TYPE.WORD:
        if (bufferNode === null) {
          // there is no buffer node only in one case — no ast collecting has been started
          initAst(context, tokenValue);
        } else if (isSelectorListNode(bufferNode)) {
          // add new selector to selector list
          addAstNodeByType(context, NODE.SELECTOR);
          addAstNodeByType(context, NODE.REGULAR_SELECTOR, tokenValue);
        } else if (isRegularSelectorNode(bufferNode)) {
          updateBufferNode(context, tokenValue);
        } else if (isExtendedSelectorNode(bufferNode)) {
          // No white space is allowed between the name of extended pseudo-class
          // and its opening parenthesis
          // https://www.w3.org/TR/selectors-4/#pseudo-classes
          // e.g. 'span:contains (text)'
          if (isWhiteSpaceChar(nextTokenValue) && nextToNextTokenValue === BRACKET.PARENTHESES.LEFT) {
            throw new Error(`${NO_WHITESPACE_ERROR_PREFIX}: '${selector}'`);
          }

          const lowerCaseTokenValue = tokenValue.toLowerCase(); // save pseudo-class name for brackets balance checking

          context.extendedPseudoNamesStack.push(lowerCaseTokenValue); // extended pseudo-class name are parsed in lower case
          // as they should be case-insensitive
          // https://www.w3.org/TR/selectors-4/#pseudo-classes

          if (isAbsolutePseudoClass(lowerCaseTokenValue)) {
            addAstNodeByType(context, NODE.ABSOLUTE_PSEUDO_CLASS, lowerCaseTokenValue);
          } else {
            // if it is not absolute pseudo-class, it must be relative one
            // add RelativePseudoClass with tokenValue as pseudo-class name to ExtendedSelector children
            addAstNodeByType(context, NODE.RELATIVE_PSEUDO_CLASS, lowerCaseTokenValue); // for :not() and :is() pseudo-classes parsed ast should be optimized later

            if (isOptimizationPseudoClass(lowerCaseTokenValue)) {
              context.shouldOptimize = true;
            }
          }
        } else if (isAbsolutePseudoClassNode(bufferNode)) {
          // collect absolute pseudo-class arg
          updateBufferNode(context, tokenValue);
        } else if (isRelativePseudoClassNode(bufferNode)) {
          initRelativeSubtree(context, tokenValue);
        }

        break;

      case TOKEN_TYPE.MARK:
        switch (tokenValue) {
          case COMMA:
            if (!bufferNode || typeof bufferNode !== 'undefined' && !nextTokenValue) {
              // consider the selector is invalid if there is no bufferNode yet (e.g. ', a')
              // or there is nothing after the comma while bufferNode is defined (e.g. 'div, ')
              throw new Error(`'${selector}' is not a valid selector`);
            } else if (isRegularSelectorNode(bufferNode)) {
              if (context.isAttributeBracketsOpen) {
                // the comma might be inside element attribute value
                // e.g. 'div[data-comma="0,1"]'
                updateBufferNode(context, tokenValue);
              } else {
                // new Selector should be collected to upper SelectorList
                upToClosest(context, NODE.SELECTOR_LIST);
              }
            } else if (isAbsolutePseudoClassNode(bufferNode)) {
              // the comma inside arg of absolute extended pseudo
              // e.g. 'div:xpath(//h3[contains(text(),"Share it!")]/..)'
              updateBufferNode(context, tokenValue);
            } else if (isSelectorNode(bufferNode)) {
              // new Selector should be collected to upper SelectorList
              // if parser position is on Selector node
              upToClosest(context, NODE.SELECTOR_LIST);
            }

            break;

          case SPACE:
            // it might be complex selector with extended pseudo-class inside it
            // and the space is between that complex selector and following regular selector
            // parser position is on ` ` before `span` now:
            // e.g. 'div:has(img).banner span'
            // so we need to check whether the new ast node should be added (example above)
            // or previous regular selector node should be updated
            if (isRegularSelectorNode(bufferNode) // no need to update the buffer node if attribute value is being parsed
            // e.g. 'div:not([id])[style="position: absolute; z-index: 10000;"]'
            // parser position inside attribute    ↑
            && !context.isAttributeBracketsOpen) {
              bufferNode = getUpdatedBufferNode(context);
            }

            if (isRegularSelectorNode(bufferNode)) {
              // standard selectors with white space between colon and name of pseudo
              // are invalid for native document.querySelectorAll() anyway,
              // so throwing the error here is better
              // than proper parsing of invalid selector and passing it further.
              // first of all do not check attributes
              // e.g. div[style="text-align: center"]
              if (!context.isAttributeBracketsOpen // check the space after the colon and before the pseudo
              // e.g. '.block: nth-child(2)
              && (prevTokenValue === COLON && nextTokenType === TOKEN_TYPE.WORD // or after the pseudo and before the opening parenthesis
              // e.g. '.block:nth-child (2)
              || prevTokenType === TOKEN_TYPE.WORD && nextTokenValue === BRACKET.PARENTHESES.LEFT)) {
                throw new Error(`'${selector}' is not a valid selector`);
              } // collect current tokenValue to value of RegularSelector
              // if it is the last token or standard selector continues after the space.
              // otherwise it will be skipped


              if (!nextTokenValue || doesRegularContinueAfterSpace(nextTokenType, nextTokenValue) // we also should collect space inside attribute value
              // e.g. `[onclick^="window.open ('https://example.com/share?url="]`
              // parser position             ↑
              || context.isAttributeBracketsOpen) {
                updateBufferNode(context, tokenValue);
              }
            }

            if (isAbsolutePseudoClassNode(bufferNode)) {
              // space inside extended pseudo-class arg
              // e.g. 'span:contains(some text)'
              updateBufferNode(context, tokenValue);
            }

            if (isRelativePseudoClassNode(bufferNode)) {
              // init with empty value RegularSelector
              // as the space is not needed for selector value
              // e.g. 'p:not( .content )'
              initRelativeSubtree(context);
            }

            if (isSelectorNode(bufferNode)) {
              // do NOT add RegularSelector if parser position on space BEFORE the comma in selector list
              // e.g. '.block:has(> img) , .banner)'
              if (doesRegularContinueAfterSpace(nextTokenType, nextTokenValue)) {
                // regular selector might be after the extended one.
                // extra space before combinator or selector should not be collected
                // e.g. '.banner:upward(2) .block'
                //      '.banner:upward(2) > .block'
                // so no tokenValue passed to addAnySelectorNode()
                addAstNodeByType(context, NODE.REGULAR_SELECTOR);
              }
            }

            break;

          case DESCENDANT_COMBINATOR:
          case CHILD_COMBINATOR:
          case NEXT_SIBLING_COMBINATOR:
          case SUBSEQUENT_SIBLING_COMBINATOR:
          case SEMICOLON:
          case SLASH:
          case BACKSLASH:
          case SINGLE_QUOTE:
          case DOUBLE_QUOTE:
          case CARET:
          case DOLLAR_SIGN:
          case BRACKET.CURLY.LEFT:
          case BRACKET.CURLY.RIGHT:
          case ASTERISK:
          case ID_MARKER:
          case CLASS_MARKER:
          case BRACKET.SQUARE.LEFT:
            // it might be complex selector with extended pseudo-class inside it
            // and the space is between that complex selector and following regular selector
            // e.g. 'div:has(img).banner'   // parser position is on `.` before `banner` now
            //      'div:has(img)[attr]'    // parser position is on `[` before `attr` now
            // so we need to check whether the new ast node should be added (example above)
            // or previous regular selector node should be updated
            if (COMBINATORS.includes(tokenValue)) {
              if (bufferNode === null) {
                // cases where combinator at very beginning of a selector
                // e.g. '> div'
                // or   '~ .banner'
                // or even '+js(overlay-buster)' which not a selector at all
                // but may be validated by FilterCompiler so error message should be appropriate
                throw new Error(`'${selector}' is not a valid selector`);
              }

              bufferNode = getUpdatedBufferNode(context);
            }

            if (bufferNode === null) {
              // no ast collecting has been started
              // e.g. '.banner > p'
              // or   '#top > div.ad'
              // or   '[class][style][attr]'
              // or   '*:not(span)'
              initAst(context, tokenValue);

              if (isAttributeOpening(tokenValue, prevTokenValue)) {
                // e.g. '[class^="banner-"]'
                context.isAttributeBracketsOpen = true;
              }
            } else if (isRegularSelectorNode(bufferNode)) {
              if (tokenValue === BRACKET.CURLY.LEFT && !(context.isAttributeBracketsOpen || context.isRegexpOpen)) {
                // e.g. 'div { content: "'
                throw new Error(`'${selector}' is not a valid selector`);
              } // collect the mark to the value of RegularSelector node


              updateBufferNode(context, tokenValue);

              if (isAttributeOpening(tokenValue, prevTokenValue)) {
                // needed for proper handling element attribute value with comma
                // e.g. 'div[data-comma="0,1"]'
                context.isAttributeBracketsOpen = true;
              }
            } else if (isAbsolutePseudoClassNode(bufferNode)) {
              // collect the mark to the arg of AbsolutePseudoClass node
              updateBufferNode(context, tokenValue); // 'isRegexpOpen' flag is needed for brackets balancing inside extended pseudo-class arg

              if (tokenValue === SLASH && context.extendedPseudoNamesStack.length > 0) {
                if (prevTokenValue === SLASH && prevToPrevTokenValue === BACKSLASH) {
                  // it may be specific url regexp pattern in arg of pseudo-class
                  // e.g. ':matches-css(background-image: /^url\(https:\/\/example\.org\//)'
                  // parser position is on final slash before `)`                        ↑
                  context.isRegexpOpen = false;
                } else if (prevTokenValue && prevTokenValue !== BACKSLASH) {
                  if (isRegexpOpening(context, prevTokenValue, getNodeValue(bufferNode))) {
                    context.isRegexpOpen = !context.isRegexpOpen;
                  } else {
                    // otherwise force `isRegexpOpen` flag to `false`
                    context.isRegexpOpen = false;
                  }
                }
              }
            } else if (isRelativePseudoClassNode(bufferNode)) {
              // add SelectorList to children of RelativePseudoClass node
              initRelativeSubtree(context, tokenValue);

              if (isAttributeOpening(tokenValue, prevTokenValue)) {
                // besides of creating the relative subtree
                // opening square bracket means start of attribute
                // e.g. 'div:not([class="content"])'
                //      'div:not([href*="window.print()"])'
                context.isAttributeBracketsOpen = true;
              }
            } else if (isSelectorNode(bufferNode)) {
              // after the extended pseudo closing parentheses
              // parser position is on Selector node
              // and regular selector can be after the extended one
              // e.g. '.banner:upward(2)> .block'
              // or   '.inner:nth-ancestor(1)~ .banner'
              if (COMBINATORS.includes(tokenValue)) {
                addAstNodeByType(context, NODE.REGULAR_SELECTOR, tokenValue);
              } else if (!context.isRegexpOpen) {
                // it might be complex selector with extended pseudo-class inside it.
                // parser position is on `.` now:
                // e.g. 'div:has(img).banner'
                // so we need to get last regular selector node and update its value
                bufferNode = getContextLastRegularSelectorNode(context);
                updateBufferNode(context, tokenValue);

                if (isAttributeOpening(tokenValue, prevTokenValue)) {
                  // handle attribute in compound selector after extended pseudo-class
                  // e.g. 'div:not(.top)[style="z-index: 10000;"]'
                  // parser position    ↑
                  context.isAttributeBracketsOpen = true;
                }
              }
            } else if (isSelectorListNode(bufferNode)) {
              // add Selector to SelectorList
              addAstNodeByType(context, NODE.SELECTOR); // and RegularSelector as it is always the first child of Selector

              addAstNodeByType(context, NODE.REGULAR_SELECTOR, tokenValue);

              if (isAttributeOpening(tokenValue, prevTokenValue)) {
                // handle simple attribute selector in selector list
                // e.g. '.banner, [class^="ad-"]'
                context.isAttributeBracketsOpen = true;
              }
            }

            break;

          case BRACKET.SQUARE.RIGHT:
            if (isRegularSelectorNode(bufferNode)) {
              // unescaped `]` in regular selector allowed only inside attribute value
              if (!context.isAttributeBracketsOpen && prevTokenValue !== BACKSLASH) {
                // e.g. 'div]'
                // eslint-disable-next-line max-len
                throw new Error(`'${selector}' is not a valid selector due to '${tokenValue}' after '${getNodeValue(bufferNode)}'`);
              } // needed for proper parsing regular selectors after the attributes with comma
              // e.g. 'div[data-comma="0,1"] > img'


              if (isAttributeClosing(context)) {
                context.isAttributeBracketsOpen = false; // reset attribute buffer on closing `]`

                context.attributeBuffer = '';
              } // collect the bracket to the value of RegularSelector node


              updateBufferNode(context, tokenValue);
            }

            if (isAbsolutePseudoClassNode(bufferNode)) {
              // :xpath() expended pseudo-class arg might contain square bracket
              // so it should be collected
              // e.g. 'div:xpath(//h3[contains(text(),"Share it!")]/..)'
              updateBufferNode(context, tokenValue);
            }

            break;

          case COLON:
            // No white space is allowed between the colon and the following name of the pseudo-class
            // https://www.w3.org/TR/selectors-4/#pseudo-classes
            // e.g. 'span: contains(text)'
            if (isWhiteSpaceChar(nextTokenValue) && nextToNextTokenValue && SUPPORTED_PSEUDO_CLASSES.includes(nextToNextTokenValue)) {
              throw new Error(`${NO_WHITESPACE_ERROR_PREFIX}: '${selector}'`);
            }

            if (bufferNode === null) {
              // no ast collecting has been started
              if (nextTokenValue === XPATH_PSEUDO_CLASS_MARKER) {
                // limit applying of "naked" :xpath pseudo-class
                // https://github.com/AdguardTeam/ExtendedCss/issues/115
                initAst(context, XPATH_PSEUDO_SELECTING_ROOT);
              } else if (nextTokenValue === UPWARD_PSEUDO_CLASS_MARKER || nextTokenValue === NTH_ANCESTOR_PSEUDO_CLASS_MARKER) {
                // selector should be specified before :nth-ancestor() or :upward()
                // e.g. ':nth-ancestor(3)'
                // or   ':upward(span)'
                throw new Error(`${NO_SELECTOR_ERROR_PREFIX} before :${nextTokenValue}() pseudo-class`);
              } else {
                // make it more obvious if selector starts with pseudo with no tag specified
                // e.g. ':has(a)' -> '*:has(a)'
                // or   ':empty'  -> '*:empty'
                initAst(context, ASTERISK);
              } // bufferNode should be updated for following checking


              bufferNode = getBufferNode(context);
            }

            if (isSelectorListNode(bufferNode)) {
              // bufferNode is SelectorList after comma has been parsed.
              // parser position is on colon now:
              // e.g. 'img,:not(.content)'
              addAstNodeByType(context, NODE.SELECTOR); // add empty value RegularSelector anyway as any selector should start with it
              // and check previous token on the next step

              addAstNodeByType(context, NODE.REGULAR_SELECTOR); // bufferNode should be updated for following checking

              bufferNode = getBufferNode(context);
            }

            if (isRegularSelectorNode(bufferNode)) {
              // it can be extended or standard pseudo
              // e.g. '#share, :contains(share it)'
              // or   'div,:hover'
              // of   'div:has(+:contains(text))'  // position is after '+'
              if (prevTokenValue && COMBINATORS.includes(prevTokenValue) || prevTokenValue === COMMA) {
                // case with colon at the start of string - e.g. ':contains(text)'
                // is covered by 'bufferNode === null' above at start of COLON checking
                updateBufferNode(context, ASTERISK);
              }

              handleNextTokenOnColon(context, selector, tokenValue, nextTokenValue, nextToNextTokenValue);
            }

            if (isSelectorNode(bufferNode)) {
              // e.g. 'div:contains(text):'
              if (!nextTokenValue) {
                throw new Error(`Invalid colon ':' at the end of selector: '${selector}'`);
              } // after the extended pseudo closing parentheses
              // parser position is on Selector node
              // and there is might be another extended selector.
              // parser position is on colon before 'upward':
              // e.g. 'p:contains(PR):upward(2)'


              if (isSupportedPseudoClass(nextTokenValue.toLowerCase())) {
                // if supported extended pseudo-class is next to colon
                // add ExtendedSelector to Selector children
                addAstNodeByType(context, NODE.EXTENDED_SELECTOR);
              } else if (nextTokenValue.toLowerCase() === REMOVE_PSEUDO_MARKER) {
                // :remove() pseudo-class should be handled before
                // as it is not about element selecting but actions with elements
                // e.g. '#banner:upward(2):remove()'
                throw new Error(`${REMOVE_ERROR_PREFIX.INVALID_REMOVE}: '${selector}'`);
              } else {
                // otherwise it is standard pseudo after extended pseudo-class in complex selector
                // and colon should be collected to value of previous RegularSelector
                // e.g. 'body *:not(input)::selection'
                //      'input:matches-css(padding: 10):checked'
                bufferNode = getContextLastRegularSelectorNode(context);
                handleNextTokenOnColon(context, selector, tokenValue, nextTokenType, nextToNextTokenValue);
              }
            }

            if (isAbsolutePseudoClassNode(bufferNode)) {
              // :xpath() pseudo-class should be the last of extended pseudo-classes
              if (getNodeName(bufferNode) === XPATH_PSEUDO_CLASS_MARKER && nextTokenValue && SUPPORTED_PSEUDO_CLASSES.includes(nextTokenValue) && nextToNextTokenValue === BRACKET.PARENTHESES.LEFT) {
                throw new Error(`:xpath() pseudo-class should be the last in selector: '${selector}'`);
              } // collecting arg for absolute pseudo-class
              // e.g. 'div:matches-css(width:400px)'


              updateBufferNode(context, tokenValue);
            }

            if (isRelativePseudoClassNode(bufferNode)) {
              if (!nextTokenValue) {
                // e.g. 'div:has(:'
                throw new Error(`Invalid pseudo-class arg at the end of selector: '${selector}'`);
              } // make it more obvious if selector starts with pseudo with no tag specified
              // parser position is on colon inside :has() arg
              // e.g. 'div:has(:contains(text))'
              // or   'div:not(:empty)'


              initRelativeSubtree(context, ASTERISK);

              if (!isSupportedPseudoClass(nextTokenValue.toLowerCase())) {
                // collect the colon to value of RegularSelector
                // e.g. 'div:not(:empty)'
                updateBufferNode(context, tokenValue); // parentheses should be balanced only for functional pseudo-classes
                // e.g. '.yellow:not(:nth-child(3))'

                if (nextToNextTokenValue === BRACKET.PARENTHESES.LEFT) {
                  context.standardPseudoNamesStack.push(nextTokenValue);
                }
              } else {
                // add ExtendedSelector to Selector children
                // e.g. 'div:has(:contains(text))'
                upToClosest(context, NODE.SELECTOR);
                addAstNodeByType(context, NODE.EXTENDED_SELECTOR);
              }
            }

            break;

          case BRACKET.PARENTHESES.LEFT:
            // start of pseudo-class arg
            if (isAbsolutePseudoClassNode(bufferNode)) {
              // no brackets balancing needed inside
              // 1. :xpath() extended pseudo-class arg
              // 2. regexp arg for other extended pseudo-classes
              if (getNodeName(bufferNode) !== XPATH_PSEUDO_CLASS_MARKER && context.isRegexpOpen) {
                // if the parentheses is escaped it should be part of regexp
                // collect it to arg of AbsolutePseudoClass
                // e.g. 'div:matches-css(background-image: /^url\\("data:image\\/gif;base64.+/)'
                updateBufferNode(context, tokenValue);
              } else {
                // otherwise brackets should be balanced
                // e.g. 'div:xpath(//h3[contains(text(),"Share it!")]/..)'
                context.extendedPseudoBracketsStack.push(tokenValue); // eslint-disable-next-line max-len

                if (context.extendedPseudoBracketsStack.length > context.extendedPseudoNamesStack.length) {
                  updateBufferNode(context, tokenValue);
                }
              }
            }

            if (isRegularSelectorNode(bufferNode)) {
              // continue RegularSelector value collecting for standard pseudo-classes
              // e.g. '.banner:where(div)'
              if (context.standardPseudoNamesStack.length > 0) {
                updateBufferNode(context, tokenValue);
                context.standardPseudoBracketsStack.push(tokenValue);
              } // parentheses inside attribute value should be part of RegularSelector value
              // e.g. 'div:not([href*="window.print()"])'   <-- parser position
              // is on the `(` after `print`       ↑


              if (context.isAttributeBracketsOpen) {
                updateBufferNode(context, tokenValue);
              }
            }

            if (isRelativePseudoClassNode(bufferNode)) {
              // save opening bracket for balancing
              // e.g. 'div:not()'  // position is on `(`
              context.extendedPseudoBracketsStack.push(tokenValue);
            }

            break;

          case BRACKET.PARENTHESES.RIGHT:
            if (isAbsolutePseudoClassNode(bufferNode)) {
              // no brackets balancing needed inside
              // 1. :xpath() extended pseudo-class arg
              // 2. regexp arg for other extended pseudo-classes
              if (getNodeName(bufferNode) !== XPATH_PSEUDO_CLASS_MARKER && context.isRegexpOpen) {
                // if closing bracket is part of regexp
                // simply save it to pseudo-class arg
                updateBufferNode(context, tokenValue);
              } else {
                // remove stacked open parentheses for brackets balance
                // e.g. 'h3:contains((Ads))'
                // or   'div:xpath(//h3[contains(text(),"Share it!")]/..)'
                context.extendedPseudoBracketsStack.pop();

                if (getNodeName(bufferNode) !== XPATH_PSEUDO_CLASS_MARKER) {
                  // for all other absolute pseudo-classes except :xpath()
                  // remove stacked name of extended pseudo-class
                  context.extendedPseudoNamesStack.pop(); // eslint-disable-next-line max-len

                  if (context.extendedPseudoBracketsStack.length > context.extendedPseudoNamesStack.length) {
                    // if brackets stack is not empty yet,
                    // save tokenValue to arg of AbsolutePseudoClass
                    // parser position on first closing bracket after 'Ads':
                    // e.g. 'h3:contains((Ads))'
                    updateBufferNode(context, tokenValue);
                  } else if (context.extendedPseudoBracketsStack.length >= 0 && context.extendedPseudoNamesStack.length >= 0) {
                    // assume it is combined extended pseudo-classes
                    // parser position on first closing bracket after 'advert':
                    // e.g. 'div:has(.banner, :contains(advert))'
                    upToClosest(context, NODE.SELECTOR);
                  }
                } else {
                  // for :xpath()
                  // eslint-disable-next-line max-len
                  if (context.extendedPseudoBracketsStack.length < context.extendedPseudoNamesStack.length) {
                    // remove stacked name of extended pseudo-class
                    // if there are less brackets than pseudo-class names
                    // with means last removes bracket was closing for pseudo-class
                    context.extendedPseudoNamesStack.pop();
                  } else {
                    // otherwise the bracket is part of arg
                    updateBufferNode(context, tokenValue);
                  }
                }
              }
            }

            if (isRegularSelectorNode(bufferNode)) {
              if (context.isAttributeBracketsOpen) {
                // parentheses inside attribute value should be part of RegularSelector value
                // e.g. 'div:not([href*="window.print()"])'   <-- parser position
                // is on the `)` after `print(`       ↑
                updateBufferNode(context, tokenValue);
              } else if (context.standardPseudoNamesStack.length > 0 && context.standardPseudoBracketsStack.length > 0) {
                // standard pseudo-class was processing.
                // collect the closing bracket to value of RegularSelector
                // parser position is on bracket after 'class' now:
                // e.g. 'div:where(.class)'
                updateBufferNode(context, tokenValue); // remove bracket and pseudo name from stacks

                context.standardPseudoBracketsStack.pop();
                const lastStandardPseudo = context.standardPseudoNamesStack.pop();

                if (!lastStandardPseudo) {
                  // standard pseudo should be in standardPseudoNamesStack
                  // as related to standardPseudoBracketsStack
                  throw new Error(`Parsing error. Invalid selector: ${selector}`);
                } // Disallow :has() after regular pseudo-elements
                // https://bugs.chromium.org/p/chromium/issues/detail?id=669058#c54 [3]


                if (Object.values(REGULAR_PSEUDO_ELEMENTS).includes(lastStandardPseudo) // check token which is next to closing parentheses and token after it
                // parser position is on bracket after 'foo' now:
                // e.g. '::part(foo):has(.a)'
                && nextTokenValue === COLON && nextToNextTokenValue && HAS_PSEUDO_CLASS_MARKERS.includes(nextToNextTokenValue)) {
                  // eslint-disable-next-line max-len
                  throw new Error(`Usage of :${nextToNextTokenValue}() pseudo-class is not allowed after any regular pseudo-element: '${lastStandardPseudo}'`);
                }
              } else {
                // extended pseudo-class was processing.
                // e.g. 'div:has(h3)'
                // remove bracket and pseudo name from stacks
                context.extendedPseudoBracketsStack.pop();
                context.extendedPseudoNamesStack.pop();
                upToClosest(context, NODE.EXTENDED_SELECTOR); // go to upper selector for possible selector continuation after extended pseudo-class
                // e.g. 'div:has(h3) > img'

                upToClosest(context, NODE.SELECTOR);
              }
            }

            if (isSelectorNode(bufferNode)) {
              // after inner extended pseudo-class bufferNode is Selector.
              // parser position is on last bracket now:
              // e.g. 'div:has(.banner, :contains(ads))'
              context.extendedPseudoBracketsStack.pop();
              context.extendedPseudoNamesStack.pop();
              upToClosest(context, NODE.EXTENDED_SELECTOR);
              upToClosest(context, NODE.SELECTOR);
            }

            if (isRelativePseudoClassNode(bufferNode)) {
              // save opening bracket for balancing
              // e.g. 'div:not()'  // position is on `)`
              // context.extendedPseudoBracketsStack.push(tokenValue);
              if (context.extendedPseudoNamesStack.length > 0 && context.extendedPseudoBracketsStack.length > 0) {
                context.extendedPseudoBracketsStack.pop();
                context.extendedPseudoNamesStack.pop();
              }
            }

            break;

          case LINE_FEED:
          case FORM_FEED:
          case CARRIAGE_RETURN:
            // such characters at start and end of selector should be trimmed
            // so is there is one them among tokens, it is not valid selector
            throw new Error(`'${selector}' is not a valid selector`);

          case TAB:
            // allow tab only inside attribute value
            // as there are such valid rules in filter lists
            // e.g. 'div[style^="margin-right: auto;	text-align: left;',
            // parser position                      ↑
            if (isRegularSelectorNode(bufferNode) && context.isAttributeBracketsOpen) {
              updateBufferNode(context, tokenValue);
            } else {
              // otherwise not valid
              throw new Error(`'${selector}' is not a valid selector`);
            }

        }

        break;
      // no default statement for Marks as they are limited to SUPPORTED_SELECTOR_MARKS
      // and all other symbol combinations are tokenized as Word
      // so error for invalid Word will be thrown later while element selecting by parsed ast

      default:
        throw new Error(`Unknown type of token: '${tokenValue}'`);
    }

    i += 1;
  }

  if (context.ast === null) {
    throw new Error(`'${selector}' is not a valid selector`);
  }

  if (context.extendedPseudoNamesStack.length > 0 || context.extendedPseudoBracketsStack.length > 0) {
    // eslint-disable-next-line max-len
    throw new Error(`Unbalanced brackets for extended pseudo-class: '${getLast(context.extendedPseudoNamesStack)}'`);
  }

  if (context.isAttributeBracketsOpen) {
    throw new Error(`Unbalanced attribute brackets in selector: '${selector}'`);
  }

  return context.shouldOptimize ? optimizeAst(context.ast) : context.ast;
};

const natives = {
  MutationObserver: window.MutationObserver || window.WebKitMutationObserver
};
/**
 * Class NativeTextContent is needed to intercept and save the native Node textContent getter
 * for proper work of :contains() pseudo-class as it may be mocked.
 *
 * @see {@link https://github.com/AdguardTeam/ExtendedCss/issues/127}
 */

class NativeTextContent {
  /**
   * Native Node.
   */

  /**
   * Native Node textContent getter.
   */

  /**
   * Stores native node.
   */
  constructor() {
    this.nativeNode = window.Node || Node;
  }
  /**
   * Sets native Node textContext getter to `getter` class field.
   */


  setGetter() {
    var _Object$getOwnPropert;

    this.getter = (_Object$getOwnPropert = Object.getOwnPropertyDescriptor(this.nativeNode.prototype, 'textContent')) === null || _Object$getOwnPropert === void 0 ? void 0 : _Object$getOwnPropert.get;
  }

}
const nativeTextContent = new NativeTextContent();

/**
 * Returns textContent of passed domElement.
 *
 * @param domElement DOM element.
 *
 * @returns DOM element textContent.
 */

const getNodeTextContent = domElement => {
  if (nativeTextContent.getter) {
    return nativeTextContent.getter.apply(domElement);
  } // if ExtendedCss.init() has not been executed and there is no nodeTextContentGetter,
  // use simple approach, especially when init() is not really needed, e.g. local tests


  return domElement.textContent || '';
};
/**
 * Returns element selector text based on it's tagName and attributes.
 *
 * @param element DOM element.
 *
 * @returns String representation of `element`.
 */

const getElementSelectorDesc = element => {
  let selectorText = element.tagName.toLowerCase();
  selectorText += Array.from(element.attributes).map(attr => {
    return `[${attr.name}="${element.getAttribute(attr.name)}"]`;
  }).join('');
  return selectorText;
};
/**
 * Returns path to a DOM element as a selector string.
 *
 * @param inputEl Input element.
 *
 * @returns String path to a DOM element.
 * @throws An error if `inputEl` in not instance of `Element`.
 */

const getElementSelectorPath = inputEl => {
  if (!(inputEl instanceof Element)) {
    throw new Error('Function received argument with wrong type');
  }

  let el;
  el = inputEl;
  const path = []; // we need to check '!!el' first because it is possible
  // that some ancestor of the inputEl was removed before it

  while (!!el && el.nodeType === Node.ELEMENT_NODE) {
    let selector = el.nodeName.toLowerCase();

    if (el.id && typeof el.id === 'string') {
      selector += `#${el.id}`;
      path.unshift(selector);
      break;
    }

    let sibling = el;
    let nth = 1;

    while (sibling.previousElementSibling) {
      sibling = sibling.previousElementSibling;

      if (sibling.nodeType === Node.ELEMENT_NODE && sibling.nodeName.toLowerCase() === selector) {
        nth += 1;
      }
    }

    if (nth !== 1) {
      selector += `:nth-of-type(${nth})`;
    }

    path.unshift(selector);
    el = el.parentElement;
  }

  return path.join(' > ');
};
/**
 * Checks whether the element is instance of HTMLElement.
 *
 * @param element Element to check.
 *
 * @returns True if `element` is HTMLElement.
 */

const isHtmlElement = element => {
  return element instanceof HTMLElement;
};
/**
 * Takes `element` and returns its parent element.
 *
 * @param element Element.
 * @param errorMessage Optional error message to throw.
 *
 * @returns Parent of `element`.
 * @throws An error if element has no parent element.
 */

const getParent = (element, errorMessage) => {
  const {
    parentElement
  } = element;

  if (!parentElement) {
    throw new Error(errorMessage || 'Element does no have parent element');
  }

  return parentElement;
};

/**
 * Checks whether the `error` has `message` property which type is string.
 *
 * @param error Error object.
 *
 * @returns True if `error` has message.
 */
const isErrorWithMessage = error => {
  return typeof error === 'object' && error !== null && 'message' in error && typeof error.message === 'string';
};
/**
 * Converts `maybeError` to error object with message.
 *
 * @param maybeError Possible error.
 *
 * @returns Error object with defined `message` property.
 */


const toErrorWithMessage = maybeError => {
  if (isErrorWithMessage(maybeError)) {
    return maybeError;
  }

  try {
    return new Error(JSON.stringify(maybeError));
  } catch {
    // fallback in case if there is an error happened during the maybeError stringifying
    // like with circular references for example
    return new Error(String(maybeError));
  }
};
/**
 * Returns error message from `error`.
 * May be helpful to handle caught errors.
 *
 * @param error Error object.
 *
 * @returns Message of `error`.
 */


const getErrorMessage = error => {
  return toErrorWithMessage(error).message;
};

const logger = {
  /**
   * Safe console.error version.
   */
  error: typeof console !== 'undefined' && console.error && console.error.bind ? console.error.bind(window.console) : console.error,

  /**
   * Safe console.info version.
   */
  info: typeof console !== 'undefined' && console.info && console.info.bind ? console.info.bind(window.console) : console.info
};

/**
 * Returns string without suffix.
 *
 * @param str Input string.
 * @param suffix Needed to remove.
 *
 * @returns String without suffix.
 */

const removeSuffix = (str, suffix) => {
  const index = str.indexOf(suffix, str.length - suffix.length);

  if (index >= 0) {
    return str.substring(0, index);
  }

  return str;
};
/**
 * Replaces all `pattern`s with `replacement` in `input` string.
 * String.replaceAll() polyfill because it is not supported by old browsers, e.g. Chrome 55.
 *
 * @see {@link https://caniuse.com/?search=String.replaceAll}
 *
 * @param input Input string to process.
 * @param pattern Find in the input string.
 * @param replacement Replace the pattern with.
 *
 * @returns Modified string.
 */

const replaceAll = (input, pattern, replacement) => {
  if (!input) {
    return input;
  }

  return input.split(pattern).join(replacement);
};
/**
 * Converts string pattern to regular expression.
 *
 * @param str String to convert.
 *
 * @returns Regular expression converted from pattern `str`.
 */

const toRegExp = str => {
  if (str.startsWith(SLASH) && str.endsWith(SLASH)) {
    return new RegExp(str.slice(1, -1));
  }

  const escaped = str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
  return new RegExp(escaped);
};
/**
 * Converts any simple type value to string type,
 * e.g. `undefined` -> `'undefined'`.
 *
 * @param value Any type value.
 *
 * @returns String representation of `value`.
 */

const convertTypeIntoString = value => {
  let output;

  switch (value) {
    case undefined:
      output = 'undefined';
      break;

    case null:
      output = 'null';
      break;

    default:
      output = value.toString();
  }

  return output;
};
/**
 * Converts instance of string value into other simple types,
 * e.g. `'null'` -> `null`, `'true'` -> `true`.
 *
 * @param value String-type value.
 *
 * @returns Its own type representation of string-type `value`.
 */

const convertTypeFromString = value => {
  const numValue = Number(value);
  let output;

  if (!Number.isNaN(numValue)) {
    output = numValue;
  } else {
    switch (value) {
      case 'undefined':
        output = undefined;
        break;

      case 'null':
        output = null;
        break;

      case 'true':
        output = true;
        break;

      case 'false':
        output = false;
        break;

      default:
        output = value;
    }
  }

  return output;
};

const SAFARI_USER_AGENT_REGEXP = /\sVersion\/(\d{2}\.\d)(.+\s|\s)(Safari)\//;
const isSafariBrowser = SAFARI_USER_AGENT_REGEXP.test(navigator.userAgent);
/**
 * Checks whether the browser userAgent is supported.
 *
 * @param userAgent User agent of browser.
 *
 * @returns False only for Internet Explorer.
 */

const isUserAgentSupported = userAgent => {
  // do not support Internet Explorer
  if (userAgent.includes('MSIE') || userAgent.includes('Trident/')) {
    return false;
  }

  return true;
};
/**
 * Checks whether the current browser is supported.
 *
 * @returns False for Internet Explorer, otherwise true.
 */

const isBrowserSupported = () => {
  return isUserAgentSupported(navigator.userAgent);
};

/**
 * CSS_PROPERTY is needed for style values normalization.
 *
 * IMPORTANT: it is used as 'const' instead of 'enum' to avoid side effects
 * during ExtendedCss import into other libraries.
 */

const CSS_PROPERTY = {
  BACKGROUND: 'background',
  BACKGROUND_IMAGE: 'background-image',
  CONTENT: 'content',
  OPACITY: 'opacity'
};
const REGEXP_ANY_SYMBOL = '.*';
const REGEXP_WITH_FLAGS_REGEXP = /^\s*\/.*\/[gmisuy]*\s*$/;

/**
 * Removes quotes for specified content value.
 *
 * For example, content style declaration with `::before` can be set as '-' (e.g. unordered list)
 * which displayed as simple dash `-` with no quotes.
 * But CSSStyleDeclaration.getPropertyValue('content') will return value
 * wrapped into quotes, e.g. '"-"', which should be removed
 * because filters maintainers does not use any quotes in real rules.
 *
 * @param str Input string.
 *
 * @returns String with no quotes for content value.
 */
const removeContentQuotes = str => {
  return str.replace(/^(["'])([\s\S]*)\1$/, '$2');
};
/**
 * Adds quotes for specified background url value.
 *
 * If background-image is specified **without** quotes:
 * e.g. 'background: url(data:image/gif;base64,R0lGODlhAQA7)'.
 *
 * CSSStyleDeclaration.getPropertyValue('background-image') may return value **with** quotes:
 * e.g. 'background: url("data:image/gif;base64,R0lGODlhAQA7")'.
 *
 * So we add quotes for compatibility since filters maintainers might use quotes in real rules.
 *
 * @param str Input string.
 *
 * @returns String with unified quotes for background url value.
 */


const addUrlPropertyQuotes = str => {
  if (!str.includes('url("')) {
    const re = /url\((.*?)\)/g;
    return str.replace(re, 'url("$1")');
  }

  return str;
};
/**
 * Adds quotes to url arg for consistent property value matching.
 */


const addUrlQuotesTo = {
  regexpArg: str => {
    // e.g. /^url\\([a-z]{4}:[a-z]{5}/
    // or /^url\\(data\\:\\image\\/gif;base64.+/
    const re = /(\^)?url(\\)?\\\((\w|\[\w)/g;
    return str.replace(re, '$1url$2\\(\\"?$3');
  },
  noneRegexpArg: addUrlPropertyQuotes
};
/**
 * Escapes regular expression string.
 *
 * @see {@link https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/regexp}
 *
 * @param str Input string.
 *
 * @returns Escaped regular expression string.
 */

const escapeRegExp = str => {
  // should be escaped . * + ? ^ $ { } ( ) | [ ] / \
  // except of * | ^
  const specials = ['.', '+', '?', '$', '{', '}', '(', ')', '[', ']', '\\', '/'];
  const specialsRegex = new RegExp(`[${specials.join('\\')}]`, 'g');
  return str.replace(specialsRegex, '\\$&');
};
/**
 * Converts :matches-css() arg property value match to regexp.
 *
 * @param rawValue Style match value pattern.
 *
 * @returns Arg of :matches-css() converted to regular expression.
 */


const convertStyleMatchValueToRegexp = rawValue => {
  let value;

  if (rawValue.startsWith(SLASH) && rawValue.endsWith(SLASH)) {
    // For regex patterns double quotes `"` and backslashes `\` should be escaped
    value = addUrlQuotesTo.regexpArg(rawValue);
    value = value.slice(1, -1);
  } else {
    // For non-regex patterns parentheses `(` `)` and square brackets `[` `]`
    // should be unescaped, because their escaping in filter rules is required
    value = addUrlQuotesTo.noneRegexpArg(rawValue);
    value = value.replace(/\\([\\()[\]"])/g, '$1');
    value = escapeRegExp(value); // e.g. div:matches-css(background-image: url(data:*))

    value = replaceAll(value, ASTERISK, REGEXP_ANY_SYMBOL);
  }

  return new RegExp(value, 'i');
};
/**
 * Makes some properties values compatible.
 *
 * @param propertyName Name of style property.
 * @param propertyValue Value of style property.
 *
 * @returns Normalized values for some CSS properties.
 */


const normalizePropertyValue = (propertyName, propertyValue) => {
  let normalized = '';

  switch (propertyName) {
    case CSS_PROPERTY.BACKGROUND:
    case CSS_PROPERTY.BACKGROUND_IMAGE:
      // sometimes url property does not have quotes
      // so we add them for consistent matching
      normalized = addUrlPropertyQuotes(propertyValue);
      break;

    case CSS_PROPERTY.CONTENT:
      normalized = removeContentQuotes(propertyValue);
      break;

    case CSS_PROPERTY.OPACITY:
      // https://bugs.webkit.org/show_bug.cgi?id=93445
      normalized = isSafariBrowser ? (Math.round(parseFloat(propertyValue) * 100) / 100).toString() : propertyValue;
      break;

    default:
      normalized = propertyValue;
  }

  return normalized;
};
/**
 * Returns domElement style property value
 * by css property name and standard pseudo-element.
 *
 * @param domElement DOM element.
 * @param propertyName CSS property name.
 * @param regularPseudoElement Standard pseudo-element — '::before', '::after' etc.
 *
 * @returns String containing the value of a specified CSS property.
 */


const getComputedStylePropertyValue = (domElement, propertyName, regularPseudoElement) => {
  const style = window.getComputedStyle(domElement, regularPseudoElement);
  const propertyValue = style.getPropertyValue(propertyName);
  return normalizePropertyValue(propertyName, propertyValue);
};

/**
 * Parses arg of absolute pseudo-class into 'name' and 'value' if set.
 *
 * Used for :matches-css() - with COLON as separator,
 * for :matches-attr() and :matches-property() - with EQUAL_SIGN as separator.
 *
 * @param pseudoArg Arg of pseudo-class.
 * @param separator Divider symbol.
 *
 * @returns Parsed 'matches' pseudo-class arg data.
 */
const getPseudoArgData = (pseudoArg, separator) => {
  const index = pseudoArg.indexOf(separator);
  let name;
  let value;

  if (index > -1) {
    name = pseudoArg.substring(0, index).trim();
    value = pseudoArg.substring(index + 1).trim();
  } else {
    name = pseudoArg;
  }

  return {
    name,
    value
  };
};

/**
 * Parses :matches-css() pseudo-class arg
 * where regular pseudo-element can be a part of arg
 * e.g. 'div:matches-css(before, color: rgb(255, 255, 255))'    <-- obsolete `:matches-css-before()`.
 *
 * @param pseudoName Pseudo-class name.
 * @param rawArg Pseudo-class arg.
 *
 * @returns Parsed :matches-css() pseudo-class arg data.
 * @throws An error on invalid `rawArg`.
 */
const parseStyleMatchArg = (pseudoName, rawArg) => {
  const {
    name,
    value
  } = getPseudoArgData(rawArg, COMMA);
  let regularPseudoElement = name;
  let styleMatchArg = value; // check whether the string part before the separator is valid regular pseudo-element,
  // otherwise `regularPseudoElement` is null, and `styleMatchArg` is rawArg

  if (!Object.values(REGULAR_PSEUDO_ELEMENTS).includes(name)) {
    regularPseudoElement = null;
    styleMatchArg = rawArg;
  }

  if (!styleMatchArg) {
    throw new Error(`Required style property argument part is missing in :${pseudoName}() arg: '${rawArg}'`);
  } // if regularPseudoElement is not `null`


  if (regularPseudoElement) {
    // pseudo-element should have two colon marks for Window.getComputedStyle() due to the syntax:
    // https://www.w3.org/TR/selectors-4/#pseudo-element-syntax
    // ':matches-css(before, content: ads)' ->> '::before'
    regularPseudoElement = `${COLON}${COLON}${regularPseudoElement}`;
  }

  return {
    regularPseudoElement,
    styleMatchArg
  };
};
/**
 * Checks whether the domElement is matched by :matches-css() arg.
 *
 * @param argsData Pseudo-class name, arg, and dom element to check.
 *
 @returns True if DOM element is matched.
 * @throws An error on invalid pseudo-class arg.
 */


const isStyleMatched = argsData => {
  const {
    pseudoName,
    pseudoArg,
    domElement
  } = argsData;
  const {
    regularPseudoElement,
    styleMatchArg
  } = parseStyleMatchArg(pseudoName, pseudoArg);
  const {
    name: matchName,
    value: matchValue
  } = getPseudoArgData(styleMatchArg, COLON);

  if (!matchName || !matchValue) {
    throw new Error(`Required property name or value is missing in :${pseudoName}() arg: '${styleMatchArg}'`);
  }

  let valueRegexp;

  try {
    valueRegexp = convertStyleMatchValueToRegexp(matchValue);
  } catch (e) {
    logger.error(getErrorMessage(e));
    throw new Error(`Invalid argument of :${pseudoName}() pseudo-class: '${styleMatchArg}'`);
  }

  const value = getComputedStylePropertyValue(domElement, matchName, regularPseudoElement);
  return valueRegexp && valueRegexp.test(value);
};
/**
 * Validates string arg for :matches-attr() and :matches-property().
 *
 * @param arg Pseudo-class arg.
 *
 * @returns True if 'matches' pseudo-class string arg is valid.
 */

const validateStrMatcherArg = arg => {
  if (arg.includes(SLASH)) {
    return false;
  }

  if (!/^[\w-]+$/.test(arg)) {
    return false;
  }

  return true;
};
/**
 * Returns valid arg for :matches-attr() and :matcher-property().
 *
 * @param rawArg Arg pattern.
 * @param [isWildcardAllowed=false] Flag for wildcard (`*`) using as pseudo-class arg.
 *
 * @returns Valid arg for :matches-attr() and :matcher-property().
 * @throws An error on invalid `rawArg`.
 */


const getValidMatcherArg = function (rawArg) {
  let isWildcardAllowed = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  // if rawArg is missing for pseudo-class
  // e.g. :matches-attr()
  // error will be thrown before getValidMatcherArg() is called:
  // name or arg is missing in AbsolutePseudoClass
  let arg;

  if (rawArg.length > 1 && rawArg.startsWith(DOUBLE_QUOTE) && rawArg.endsWith(DOUBLE_QUOTE)) {
    rawArg = rawArg.slice(1, -1);
  }

  if (rawArg === '') {
    // e.g. :matches-property("")
    throw new Error('Argument should be specified. Empty arg is invalid.');
  }

  if (rawArg.startsWith(SLASH) && rawArg.endsWith(SLASH)) {
    // e.g. :matches-property("//")
    if (rawArg.length > 2) {
      arg = toRegExp(rawArg);
    } else {
      throw new Error(`Invalid regexp: '${rawArg}'`);
    }
  } else if (rawArg.includes(ASTERISK)) {
    if (rawArg === ASTERISK && !isWildcardAllowed) {
      // e.g. :matches-attr(*)
      throw new Error(`Argument should be more specific than ${rawArg}`);
    }

    arg = replaceAll(rawArg, ASTERISK, REGEXP_ANY_SYMBOL);
    arg = new RegExp(arg);
  } else {
    if (!validateStrMatcherArg(rawArg)) {
      throw new Error(`Invalid argument: '${rawArg}'`);
    }

    arg = rawArg;
  }

  return arg;
};

/**
 * Parses pseudo-class argument and returns parsed data.
 *
 * @param pseudoName Extended pseudo-class name.
 * @param pseudoArg Extended pseudo-class argument.
 *
 * @returns Parsed pseudo-class argument data.
 * @throws An error if attribute name is missing in pseudo-class arg.
 */
const getRawMatchingData = (pseudoName, pseudoArg) => {
  const {
    name: rawName,
    value: rawValue
  } = getPseudoArgData(pseudoArg, EQUAL_SIGN);

  if (!rawName) {
    throw new Error(`Required attribute name is missing in :${pseudoName} arg: ${pseudoArg}`);
  }

  return {
    rawName,
    rawValue
  };
};
/**
 * Checks whether the domElement is matched by :matches-attr() arg.
 *
 * @param argsData Pseudo-class name, arg, and dom element to check.
 *
 @returns True if DOM element is matched.
 * @throws An error on invalid arg of pseudo-class.
 */

const isAttributeMatched = argsData => {
  const {
    pseudoName,
    pseudoArg,
    domElement
  } = argsData;
  const elementAttributes = domElement.attributes; // no match if dom element has no attributes

  if (elementAttributes.length === 0) {
    return false;
  }

  const {
    rawName: rawAttrName,
    rawValue: rawAttrValue
  } = getRawMatchingData(pseudoName, pseudoArg);
  let attrNameMatch;

  try {
    attrNameMatch = getValidMatcherArg(rawAttrName);
  } catch (e) {
    const errorMessage = getErrorMessage(e);
    logger.error(errorMessage);
    throw new SyntaxError(errorMessage);
  }

  let isMatched = false;
  let i = 0;

  while (i < elementAttributes.length && !isMatched) {
    const attr = elementAttributes[i];

    if (!attr) {
      break;
    }

    const isNameMatched = attrNameMatch instanceof RegExp ? attrNameMatch.test(attr.name) : attrNameMatch === attr.name;

    if (!rawAttrValue) {
      // for rules with no attribute value specified
      // e.g. :matches-attr("/regex/") or :matches-attr("attr-name")
      isMatched = isNameMatched;
    } else {
      let attrValueMatch;

      try {
        attrValueMatch = getValidMatcherArg(rawAttrValue);
      } catch (e) {
        const errorMessage = getErrorMessage(e);
        logger.error(errorMessage);
        throw new SyntaxError(errorMessage);
      }

      const isValueMatched = attrValueMatch instanceof RegExp ? attrValueMatch.test(attr.value) : attrValueMatch === attr.value;
      isMatched = isNameMatched && isValueMatched;
    }

    i += 1;
  }

  return isMatched;
};
/**
 * Parses raw :matches-property() arg which may be chain of properties.
 *
 * @param input Argument of :matches-property().
 *
 * @returns Arg of :matches-property() as array of strings or regular expressions.
 * @throws An error on invalid chain.
 */

const parseRawPropChain = input => {
  if (input.length > 1 && input.startsWith(DOUBLE_QUOTE) && input.endsWith(DOUBLE_QUOTE)) {
    input = input.slice(1, -1);
  }

  const chainChunks = input.split(DOT);
  const chainPatterns = [];
  let patternBuffer = '';
  let isRegexpPattern = false;
  let i = 0;

  while (i < chainChunks.length) {
    const chunk = getItemByIndex(chainChunks, i, `Invalid pseudo-class arg: '${input}'`);

    if (chunk.startsWith(SLASH) && chunk.endsWith(SLASH) && chunk.length > 2) {
      // regexp pattern with no dot in it, e.g. /propName/
      chainPatterns.push(chunk);
    } else if (chunk.startsWith(SLASH)) {
      // if chunk is a start of regexp pattern
      isRegexpPattern = true;
      patternBuffer += chunk;
    } else if (chunk.endsWith(SLASH)) {
      isRegexpPattern = false; // restore dot removed while splitting
      // e.g. testProp./.{1,5}/

      patternBuffer += `.${chunk}`;
      chainPatterns.push(patternBuffer);
      patternBuffer = '';
    } else {
      // if there are few dots in regexp pattern
      // so chunk might be in the middle of it
      if (isRegexpPattern) {
        patternBuffer += chunk;
      } else {
        // otherwise it is string pattern
        chainPatterns.push(chunk);
      }
    }

    i += 1;
  }

  if (patternBuffer.length > 0) {
    throw new Error(`Invalid regexp property pattern '${input}'`);
  }

  const chainMatchPatterns = chainPatterns.map(pattern => {
    if (pattern.length === 0) {
      // e.g. '.prop.id' or 'nested..test'
      throw new Error(`Empty pattern '${pattern}' is invalid in chain '${input}'`);
    }

    let validPattern;

    try {
      validPattern = getValidMatcherArg(pattern, true);
    } catch (e) {
      logger.error(getErrorMessage(e));
      throw new Error(`Invalid property pattern '${pattern}' in property chain '${input}'`);
    }

    return validPattern;
  });
  return chainMatchPatterns;
};

/**
 * Checks if the property exists in the base object (recursively).
 *
 * @param base Element to check.
 * @param chain Array of objects - parsed string property chain.
 * @param [output=[]] Result acc.
 *
 * @returns Array of parsed data — representation of `base`-related `chain`.
 */
const filterRootsByRegexpChain = function (base, chain) {
  let output = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
  const tempProp = getFirst(chain);

  if (chain.length === 1) {
    let key;

    for (key in base) {
      if (tempProp instanceof RegExp) {
        if (tempProp.test(key)) {
          output.push({
            base,
            prop: key,
            value: base[key]
          });
        }
      } else if (tempProp === key) {
        output.push({
          base,
          prop: tempProp,
          value: base[key]
        });
      }
    }

    return output;
  } // if there is a regexp prop in input chain
  // e.g. 'unit./^ad.+/.src' for 'unit.ad-1gf2.src unit.ad-fgd34.src'),
  // every base keys should be tested by regexp and it can be more that one results


  if (tempProp instanceof RegExp) {
    const nextProp = chain.slice(1);
    const baseKeys = [];

    for (const key in base) {
      if (tempProp.test(key)) {
        baseKeys.push(key);
      }
    }

    baseKeys.forEach(key => {
      var _Object$getOwnPropert;

      const item = (_Object$getOwnPropert = Object.getOwnPropertyDescriptor(base, key)) === null || _Object$getOwnPropert === void 0 ? void 0 : _Object$getOwnPropert.value;
      filterRootsByRegexpChain(item, nextProp, output);
    });
  }

  if (base && typeof tempProp === 'string') {
    var _Object$getOwnPropert2;

    const nextBase = (_Object$getOwnPropert2 = Object.getOwnPropertyDescriptor(base, tempProp)) === null || _Object$getOwnPropert2 === void 0 ? void 0 : _Object$getOwnPropert2.value;
    chain = chain.slice(1);

    if (nextBase !== undefined) {
      filterRootsByRegexpChain(nextBase, chain, output);
    }
  }

  return output;
};
/**
 * Checks whether the domElement is matched by :matches-property() arg.
 *
 * @param argsData Pseudo-class name, arg, and dom element to check.
 *
 @returns True if DOM element is matched.
 * @throws An error on invalid prop in chain.
 */


const isPropertyMatched = argsData => {
  const {
    pseudoName,
    pseudoArg,
    domElement
  } = argsData;
  const {
    rawName: rawPropertyName,
    rawValue: rawPropertyValue
  } = getRawMatchingData(pseudoName, pseudoArg); // chained property name cannot include '/' or '.'
  // so regex prop names with such escaped characters are invalid

  if (rawPropertyName.includes('\\/') || rawPropertyName.includes('\\.')) {
    throw new Error(`Invalid :${pseudoName} name pattern: ${rawPropertyName}`);
  }

  let propChainMatches;

  try {
    propChainMatches = parseRawPropChain(rawPropertyName);
  } catch (e) {
    const errorMessage = getErrorMessage(e);
    logger.error(errorMessage);
    throw new SyntaxError(errorMessage);
  }

  const ownerObjArr = filterRootsByRegexpChain(domElement, propChainMatches);

  if (ownerObjArr.length === 0) {
    return false;
  }

  let isMatched = true;

  if (rawPropertyValue) {
    let propValueMatch;

    try {
      propValueMatch = getValidMatcherArg(rawPropertyValue);
    } catch (e) {
      const errorMessage = getErrorMessage(e);
      logger.error(errorMessage);
      throw new SyntaxError(errorMessage);
    }

    if (propValueMatch) {
      for (let i = 0; i < ownerObjArr.length; i += 1) {
        var _ownerObjArr$i;

        const realValue = (_ownerObjArr$i = ownerObjArr[i]) === null || _ownerObjArr$i === void 0 ? void 0 : _ownerObjArr$i.value;

        if (propValueMatch instanceof RegExp) {
          isMatched = propValueMatch.test(convertTypeIntoString(realValue));
        } else {
          // handle 'null' and 'undefined' property values set as string
          if (realValue === 'null' || realValue === 'undefined') {
            isMatched = propValueMatch === realValue;
            break;
          }

          isMatched = convertTypeFromString(propValueMatch) === realValue;
        }

        if (isMatched) {
          break;
        }
      }
    }
  }

  return isMatched;
};
/**
 * Checks whether the textContent is matched by :contains arg.
 *
 * @param argsData Pseudo-class name, arg, and dom element to check.
 *
 @returns True if DOM element is matched.
 * @throws An error on invalid arg of pseudo-class.
 */

const isTextMatched = argsData => {
  const {
    pseudoName,
    pseudoArg,
    domElement
  } = argsData;
  const textContent = getNodeTextContent(domElement);
  let isTextContentMatched;
  let pseudoArgToMatch = pseudoArg;

  if (pseudoArgToMatch.startsWith(SLASH) && REGEXP_WITH_FLAGS_REGEXP.test(pseudoArgToMatch)) {
    // regexp arg
    const flagsIndex = pseudoArgToMatch.lastIndexOf('/');
    const flagsStr = pseudoArgToMatch.substring(flagsIndex + 1);
    pseudoArgToMatch = pseudoArgToMatch.substring(0, flagsIndex + 1).slice(1, -1).replace(/\\([\\"])/g, '$1');
    let regex;

    try {
      regex = new RegExp(pseudoArgToMatch, flagsStr);
    } catch (e) {
      throw new Error(`Invalid argument of :${pseudoName}() pseudo-class: ${pseudoArg}`);
    }

    isTextContentMatched = regex.test(textContent);
  } else {
    // none-regexp arg
    pseudoArgToMatch = pseudoArgToMatch.replace(/\\([\\()[\]"])/g, '$1');
    isTextContentMatched = textContent.includes(pseudoArgToMatch);
  }

  return isTextContentMatched;
};

/**
 * Validates number arg for :nth-ancestor() and :upward() pseudo-classes.
 *
 * @param rawArg Raw arg of pseudo-class.
 * @param pseudoName Pseudo-class name.
 *
 * @returns Valid number arg for :nth-ancestor() and :upward().
 * @throws An error on invalid `rawArg`.
 */
const getValidNumberAncestorArg = (rawArg, pseudoName) => {
  const deep = Number(rawArg);

  if (Number.isNaN(deep) || deep < 1 || deep >= 256) {
    throw new Error(`Invalid argument of :${pseudoName} pseudo-class: '${rawArg}'`);
  }

  return deep;
};
/**
 * Returns nth ancestor by 'deep' number arg OR undefined if ancestor range limit exceeded.
 *
 * @param domElement DOM element to find ancestor for.
 * @param nth Depth up to needed ancestor.
 * @param pseudoName Pseudo-class name.
 *
 * @returns Ancestor element found in DOM, or null if not found.
 * @throws An error on invalid `nth` arg.
 */

const getNthAncestor = (domElement, nth, pseudoName) => {
  let ancestor = null;
  let i = 0;

  while (i < nth) {
    ancestor = domElement.parentElement;

    if (!ancestor) {
      throw new Error(`Out of DOM: Argument of :${pseudoName}() pseudo-class is too big — '${nth}'.`);
    }

    domElement = ancestor;
    i += 1;
  }

  return ancestor;
};
/**
 * Validates standard CSS selector.
 *
 * @param selector Standard selector.
 *
 * @returns True if standard CSS selector is valid.
 */

const validateStandardSelector = selector => {
  let isValid;

  try {
    document.querySelectorAll(selector);
    isValid = true;
  } catch (e) {
    isValid = false;
  }

  return isValid;
};

/**
 * Wrapper to run matcher `callback` with `args`
 * and throw error with `errorMessage` if `callback` run fails.
 *
 * @param callback Matcher callback.
 * @param argsData Args needed for matcher callback.
 * @param errorMessage Error message.
 *
 * @returns True if `callback` returns true.
 * @throws An error if `callback` fails.
 */
const matcherWrapper = (callback, argsData, errorMessage) => {
  let isMatched;

  try {
    isMatched = callback(argsData);
  } catch (e) {
    logger.error(getErrorMessage(e));
    throw new Error(errorMessage);
  }

  return isMatched;
};
/**
 * Generates common error message to throw while matching element `propDesc`.
 *
 * @param propDesc Text to describe what element 'prop' pseudo-class is trying to match.
 * @param pseudoName Pseudo-class name.
 * @param pseudoArg Pseudo-class arg.
 *
 * @returns Generated error message string.
 */


const getAbsolutePseudoError = (propDesc, pseudoName, pseudoArg) => {
  // eslint-disable-next-line max-len
  return `${MATCHING_ELEMENT_ERROR_PREFIX} ${propDesc}, may be invalid :${pseudoName}() pseudo-class arg: '${pseudoArg}'`;
};
/**
 * Checks whether the domElement is matched by absolute extended pseudo-class argument.
 *
 * @param domElement Page element.
 * @param pseudoName Pseudo-class name.
 * @param pseudoArg Pseudo-class arg.
 *
 * @returns True if `domElement` is matched by absolute pseudo-class.
 * @throws An error on unknown absolute pseudo-class.
 */


const isMatchedByAbsolutePseudo = (domElement, pseudoName, pseudoArg) => {
  let argsData;
  let errorMessage;
  let callback;

  switch (pseudoName) {
    case CONTAINS_PSEUDO:
    case HAS_TEXT_PSEUDO:
    case ABP_CONTAINS_PSEUDO:
      callback = isTextMatched;
      argsData = {
        pseudoName,
        pseudoArg,
        domElement
      };
      errorMessage = getAbsolutePseudoError('text content', pseudoName, pseudoArg);
      break;

    case MATCHES_CSS_PSEUDO:
    case MATCHES_CSS_AFTER_PSEUDO:
    case MATCHES_CSS_BEFORE_PSEUDO:
      callback = isStyleMatched;
      argsData = {
        pseudoName,
        pseudoArg,
        domElement
      };
      errorMessage = getAbsolutePseudoError('style', pseudoName, pseudoArg);
      break;

    case MATCHES_ATTR_PSEUDO_CLASS_MARKER:
      callback = isAttributeMatched;
      argsData = {
        domElement,
        pseudoName,
        pseudoArg
      };
      errorMessage = getAbsolutePseudoError('attributes', pseudoName, pseudoArg);
      break;

    case MATCHES_PROPERTY_PSEUDO_CLASS_MARKER:
      callback = isPropertyMatched;
      argsData = {
        domElement,
        pseudoName,
        pseudoArg
      };
      errorMessage = getAbsolutePseudoError('properties', pseudoName, pseudoArg);
      break;

    default:
      throw new Error(`Unknown absolute pseudo-class :${pseudoName}()`);
  }

  return matcherWrapper(callback, argsData, errorMessage);
};
const findByAbsolutePseudoPseudo = {
  /**
   * Returns list of nth ancestors relative to every dom node from domElements list.
   *
   * @param domElements DOM elements.
   * @param rawPseudoArg Number arg of :nth-ancestor() or :upward() pseudo-class.
   * @param pseudoName Pseudo-class name.
   *
   * @returns Array of ancestor DOM elements.
   */
  nthAncestor: (domElements, rawPseudoArg, pseudoName) => {
    const deep = getValidNumberAncestorArg(rawPseudoArg, pseudoName);
    const ancestors = domElements.map(domElement => {
      let ancestor = null;

      try {
        ancestor = getNthAncestor(domElement, deep, pseudoName);
      } catch (e) {
        logger.error(getErrorMessage(e));
      }

      return ancestor;
    }).filter(isHtmlElement);
    return ancestors;
  },

  /**
   * Returns list of elements by xpath expression, evaluated on every dom node from domElements list.
   *
   * @param domElements DOM elements.
   * @param rawPseudoArg Arg of :xpath() pseudo-class.
   *
   * @returns Array of DOM elements matched by xpath expression.
   */
  xpath: (domElements, rawPseudoArg) => {
    const foundElements = domElements.map(domElement => {
      const result = [];
      let xpathResult;

      try {
        xpathResult = document.evaluate(rawPseudoArg, domElement, null, window.XPathResult.UNORDERED_NODE_ITERATOR_TYPE, null);
      } catch (e) {
        logger.error(getErrorMessage(e));
        throw new Error(`Invalid argument of :xpath() pseudo-class: '${rawPseudoArg}'`);
      }

      let node = xpathResult.iterateNext();

      while (node) {
        if (isHtmlElement(node)) {
          result.push(node);
        }

        node = xpathResult.iterateNext();
      }

      return result;
    });
    return flatten(foundElements);
  },

  /**
   * Returns list of closest ancestors relative to every dom node from domElements list.
   *
   * @param domElements DOM elements.
   * @param rawPseudoArg Standard selector arg of :upward() pseudo-class.
   *
   * @returns Array of closest ancestor DOM elements.
   * @throws An error if `rawPseudoArg` is not a valid standard selector.
   */
  upward: (domElements, rawPseudoArg) => {
    if (!validateStandardSelector(rawPseudoArg)) {
      throw new Error(`Invalid argument of :upward pseudo-class: '${rawPseudoArg}'`);
    }

    const closestAncestors = domElements.map(domElement => {
      // closest to parent element should be found
      // otherwise `.base:upward(.base)` will return itself too, not only ancestor
      const parent = domElement.parentElement;

      if (!parent) {
        return null;
      }

      return parent.closest(rawPseudoArg);
    }).filter(isHtmlElement);
    return closestAncestors;
  }
};

/**
 * Calculated selector text which is needed to :has(), :is() and :not() pseudo-classes.
 * Contains calculated part (depends on the processed element)
 * and value of RegularSelector which is next to selector by.
 *
 * Native Document.querySelectorAll() does not select exact descendant elements
 * but match all page elements satisfying the selector,
 * so extra specification is needed for proper descendants selection
 * e.g. 'div:has(> img)'.
 *
 * Its calculation depends on extended selector.
 */

/**
 * Combined `:scope` pseudo-class and **child** combinator — `:scope>`.
 */
const scopeDirectChildren = `${SCOPE_CSS_PSEUDO_CLASS}${CHILD_COMBINATOR}`;
/**
 * Combined `:scope` pseudo-class and **descendant** combinator — `:scope `.
 */

const scopeAnyChildren = `${SCOPE_CSS_PSEUDO_CLASS}${DESCENDANT_COMBINATOR}`;
/**
 * Type for relative pseudo-class helpers args.
 */

/**
 * Returns the first of RegularSelector child node for `selectorNode`.
 *
 * @param selectorNode Ast Selector node.
 * @param pseudoName Name of relative pseudo-class.
 *
 * @returns Ast RegularSelector node.
 */
const getFirstInnerRegularChild = (selectorNode, pseudoName) => {
  return getFirstRegularChild(selectorNode.children, `RegularSelector is missing for :${pseudoName}() pseudo-class`);
}; // TODO: fix for <forgiving-relative-selector-list>
// https://github.com/AdguardTeam/ExtendedCss/issues/154

/**
 * Checks whether the element has all relative elements specified by pseudo-class arg.
 * Used for :has() pseudo-class.
 *
 * @param argsData Relative pseudo-class helpers args data.
 *
 * @returns True if **all selectors** from argsData.relativeSelectorList is **matched** for argsData.element.
 */


const hasRelativesBySelectorList = argsData => {
  const {
    element,
    relativeSelectorList,
    pseudoName
  } = argsData;
  return relativeSelectorList.children // Array.every() is used here as each Selector node from SelectorList should exist on page
  .every(selectorNode => {
    // selectorList.children always starts with regular selector as any selector generally
    const relativeRegularSelector = getFirstInnerRegularChild(selectorNode, pseudoName);
    let specifiedSelector = '';
    let rootElement = null;
    const regularSelector = getNodeValue(relativeRegularSelector);

    if (regularSelector.startsWith(NEXT_SIBLING_COMBINATOR) || regularSelector.startsWith(SUBSEQUENT_SIBLING_COMBINATOR)) {
      /**
       * For matching the element by "element:has(+ next-sibling)" and "element:has(~ sibling)"
       * we check whether the element's parentElement has specific direct child combination,
       * e.g. 'h1:has(+ .share)' -> `h1Node.parentElement.querySelectorAll(':scope > h1 + .share')`.
       *
       * @see {@link https://www.w3.org/TR/selectors-4/#relational}
       */
      rootElement = element.parentElement;
      const elementSelectorText = getElementSelectorDesc(element);
      specifiedSelector = `${scopeDirectChildren}${elementSelectorText}${regularSelector}`;
    } else if (regularSelector === ASTERISK) {
      /**
       * :scope specification is needed for proper descendants selection
       * as native element.querySelectorAll() does not select exact element descendants
       * e.g. 'a:has(> img)' -> `aNode.querySelectorAll(':scope > img')`.
       *
       * For 'any selector' as arg of relative simplicity should be set for all inner elements
       * e.g. 'div:has(*)' -> `divNode.querySelectorAll(':scope *')`
       * which means empty div with no child element.
       */
      rootElement = element;
      specifiedSelector = `${scopeAnyChildren}${ASTERISK}`;
    } else {
      /**
       * As it described above, inner elements should be found using `:scope` pseudo-class
       * e.g. 'a:has(> img)' -> `aNode.querySelectorAll(':scope > img')`
       * OR '.block(div > span)' -> `blockClassNode.querySelectorAll(':scope div > span')`.
       */
      specifiedSelector = `${scopeAnyChildren}${regularSelector}`;
      rootElement = element;
    }

    if (!rootElement) {
      throw new Error(`Selection by :${pseudoName}() pseudo-class is not possible`);
    }

    let relativeElements;

    try {
      // eslint-disable-next-line @typescript-eslint/no-use-before-define
      relativeElements = getElementsForSelectorNode(selectorNode, rootElement, specifiedSelector);
    } catch (e) {
      logger.error(getErrorMessage(e)); // fail for invalid selector

      throw new Error(`Invalid selector for :${pseudoName}() pseudo-class: '${regularSelector}'`);
    }

    return relativeElements.length > 0;
  });
};
/**
 * Checks whether the element is an any element specified by pseudo-class arg.
 * Used for :is() pseudo-class.
 *
 * @param argsData Relative pseudo-class helpers args data.
 *
 * @returns True if **any selector** from argsData.relativeSelectorList is **matched** for argsData.element.
 */


const isAnyElementBySelectorList = argsData => {
  const {
    element,
    relativeSelectorList,
    pseudoName
  } = argsData;
  return relativeSelectorList.children // Array.some() is used here as any selector from selector list should exist on page
  .some(selectorNode => {
    // selectorList.children always starts with regular selector
    const relativeRegularSelector = getFirstInnerRegularChild(selectorNode, pseudoName);
    /**
     * For checking the element by 'div:is(.banner)'
     * we check whether the element's parentElement has any specific direct child.
     */

    const rootElement = getParent(element, `Selection by :${pseudoName}() pseudo-class is not possible`);
    /**
     * So we calculate the element "description" by it's tagname and attributes for targeting
     * and use it to specify the selection
     * e.g. `div:is(.banner)` --> `divNode.parentElement.querySelectorAll(':scope > .banner')`.
     */

    const specifiedSelector = `${scopeDirectChildren}${getNodeValue(relativeRegularSelector)}`;
    let anyElements;

    try {
      // eslint-disable-next-line @typescript-eslint/no-use-before-define
      anyElements = getElementsForSelectorNode(selectorNode, rootElement, specifiedSelector);
    } catch (e) {
      // do not fail on invalid selectors for :is()
      return false;
    } // TODO: figure out how to handle complex selectors with extended pseudo-classes
    // (check readme - extended-css-is-limitations)
    // because `element` and `anyElements` may be from different DOM levels


    return anyElements.includes(element);
  });
};
/**
 * Checks whether the element is not an element specified by pseudo-class arg.
 * Used for :not() pseudo-class.
 *
 * @param argsData Relative pseudo-class helpers args data.
 *
 * @returns True if **any selector** from argsData.relativeSelectorList is **not matched** for argsData.element.
 */


const notElementBySelectorList = argsData => {
  const {
    element,
    relativeSelectorList,
    pseudoName
  } = argsData;
  return relativeSelectorList.children // Array.every() is used here as element should not be selected by any selector from selector list
  .every(selectorNode => {
    // selectorList.children always starts with regular selector
    const relativeRegularSelector = getFirstInnerRegularChild(selectorNode, pseudoName);
    /**
     * For checking the element by 'div:not([data="content"])
     * we check whether the element's parentElement has any specific direct child.
     */

    const rootElement = getParent(element, `Selection by :${pseudoName}() pseudo-class is not possible`);
    /**
     * So we calculate the element "description" by it's tagname and attributes for targeting
     * and use it to specify the selection
     * e.g. `div:not(.banner)` --> `divNode.parentElement.querySelectorAll(':scope > .banner')`.
     */

    const specifiedSelector = `${scopeDirectChildren}${getNodeValue(relativeRegularSelector)}`;
    let anyElements;

    try {
      // eslint-disable-next-line @typescript-eslint/no-use-before-define
      anyElements = getElementsForSelectorNode(selectorNode, rootElement, specifiedSelector);
    } catch (e) {
      // fail on invalid selectors for :not()
      logger.error(getErrorMessage(e)); // eslint-disable-next-line max-len

      throw new Error(`Invalid selector for :${pseudoName}() pseudo-class: '${getNodeValue(relativeRegularSelector)}'`);
    } // TODO: figure out how to handle up-looking pseudo-classes inside :not()
    // (check readme - extended-css-not-limitations)
    // because `element` and `anyElements` may be from different DOM levels


    return !anyElements.includes(element);
  });
};
/**
 * Selects dom elements by value of RegularSelector.
 *
 * @param regularSelectorNode RegularSelector node.
 * @param root Root DOM element.
 * @param specifiedSelector @see {@link SpecifiedSelector}.
 *
 * @returns Array of DOM elements.
 * @throws An error if RegularSelector node value is an invalid selector.
 */


const getByRegularSelector = (regularSelectorNode, root, specifiedSelector) => {
  const selectorText = specifiedSelector ? specifiedSelector : getNodeValue(regularSelectorNode);
  let selectedElements = [];

  try {
    selectedElements = Array.from(root.querySelectorAll(selectorText));
  } catch (e) {
    throw new Error(`Error: unable to select by '${selectorText}' — ${getErrorMessage(e)}`);
  }

  return selectedElements;
};
/**
 * Returns list of dom elements filtered or selected by ExtendedSelector node.
 *
 * @param domElements Array of DOM elements.
 * @param extendedSelectorNode ExtendedSelector node.
 *
 * @returns Array of DOM elements.
 * @throws An error on unknown pseudo-class,
 * absent or invalid arg of extended pseudo-class, etc.
 */

const getByExtendedSelector = (domElements, extendedSelectorNode) => {
  let foundElements = [];
  const extendedPseudoClassNode = getPseudoClassNode(extendedSelectorNode);
  const pseudoName = getNodeName(extendedPseudoClassNode);

  if (isAbsolutePseudoClass(pseudoName)) {
    // absolute extended pseudo-classes should have an argument
    const absolutePseudoArg = getNodeValue(extendedPseudoClassNode, `Missing arg for :${pseudoName}() pseudo-class`);

    if (pseudoName === NTH_ANCESTOR_PSEUDO_CLASS_MARKER) {
      // :nth-ancestor()
      foundElements = findByAbsolutePseudoPseudo.nthAncestor(domElements, absolutePseudoArg, pseudoName);
    } else if (pseudoName === XPATH_PSEUDO_CLASS_MARKER) {
      // :xpath()
      try {
        document.createExpression(absolutePseudoArg, null);
      } catch (e) {
        throw new Error(`Invalid argument of :${pseudoName}() pseudo-class: '${absolutePseudoArg}'`);
      }

      foundElements = findByAbsolutePseudoPseudo.xpath(domElements, absolutePseudoArg);
    } else if (pseudoName === UPWARD_PSEUDO_CLASS_MARKER) {
      // :upward()
      if (Number.isNaN(Number(absolutePseudoArg))) {
        // so arg is selector, not a number
        foundElements = findByAbsolutePseudoPseudo.upward(domElements, absolutePseudoArg);
      } else {
        foundElements = findByAbsolutePseudoPseudo.nthAncestor(domElements, absolutePseudoArg, pseudoName);
      }
    } else {
      // all other absolute extended pseudo-classes
      // e.g. contains, matches-attr, etc.
      foundElements = domElements.filter(element => {
        return isMatchedByAbsolutePseudo(element, pseudoName, absolutePseudoArg);
      });
    }
  } else if (isRelativePseudoClass(pseudoName)) {
    const relativeSelectorList = getRelativeSelectorListNode(extendedPseudoClassNode);
    let relativePredicate;

    switch (pseudoName) {
      case HAS_PSEUDO_CLASS_MARKER:
      case ABP_HAS_PSEUDO_CLASS_MARKER:
        relativePredicate = element => hasRelativesBySelectorList({
          element,
          relativeSelectorList,
          pseudoName
        });

        break;

      case IS_PSEUDO_CLASS_MARKER:
        relativePredicate = element => isAnyElementBySelectorList({
          element,
          relativeSelectorList,
          pseudoName
        });

        break;

      case NOT_PSEUDO_CLASS_MARKER:
        relativePredicate = element => notElementBySelectorList({
          element,
          relativeSelectorList,
          pseudoName
        });

        break;

      default:
        throw new Error(`Unknown relative pseudo-class: '${pseudoName}'`);
    }

    foundElements = domElements.filter(relativePredicate);
  } else {
    // extra check is parser missed something
    throw new Error(`Unknown extended pseudo-class: '${pseudoName}'`);
  }

  return foundElements;
};
/**
 * Returns list of dom elements which is selected by RegularSelector value.
 *
 * @param domElements Array of DOM elements.
 * @param regularSelectorNode RegularSelector node.
 *
 * @returns Array of DOM elements.
 * @throws An error if RegularSelector has not value.
 */

const getByFollowingRegularSelector = (domElements, regularSelectorNode) => {
  // array of arrays because of Array.map() later
  let foundElements = [];
  const value = getNodeValue(regularSelectorNode);

  if (value.startsWith(CHILD_COMBINATOR)) {
    // e.g. div:has(> img) > .banner
    foundElements = domElements.map(root => {
      const specifiedSelector = `${SCOPE_CSS_PSEUDO_CLASS}${value}`;
      return getByRegularSelector(regularSelectorNode, root, specifiedSelector);
    });
  } else if (value.startsWith(NEXT_SIBLING_COMBINATOR) || value.startsWith(SUBSEQUENT_SIBLING_COMBINATOR)) {
    // e.g. div:has(> img) + .banner
    // or   div:has(> img) ~ .banner
    foundElements = domElements.map(element => {
      const rootElement = element.parentElement;

      if (!rootElement) {
        // do not throw error if there in no parent for element
        // e.g. '*:contains(text)' selects `html` which has no parentElement
        return [];
      }

      const elementSelectorText = getElementSelectorDesc(element);
      const specifiedSelector = `${scopeDirectChildren}${elementSelectorText}${value}`;
      const selected = getByRegularSelector(regularSelectorNode, rootElement, specifiedSelector);
      return selected;
    });
  } else {
    // space-separated regular selector after extended one
    // e.g. div:has(> img) .banner
    foundElements = domElements.map(root => {
      const specifiedSelector = `${scopeAnyChildren}${getNodeValue(regularSelectorNode)}`;
      return getByRegularSelector(regularSelectorNode, root, specifiedSelector);
    });
  } // foundElements should be flattened
  // as getByRegularSelector() returns elements array, and Array.map() collects them to array


  return flatten(foundElements);
};
/**
 * Returns elements nodes for Selector node.
 * As far as any selector always starts with regular part,
 * it selects by RegularSelector first and checks found elements later.
 *
 * Relative pseudo-classes has it's own subtree so getElementsForSelectorNode is called recursively.
 *
 * 'specifiedSelector' is needed for :has(), :is(), and :not() pseudo-classes
 * as native querySelectorAll() does not select exact element descendants even if it is called on 'div'
 * e.g. ':scope' specification is needed for proper descendants selection for 'div:has(> img)'.
 * So we check `divNode.querySelectorAll(':scope > img').length > 0`.
 *
 * @param selectorNode Selector node.
 * @param root Root DOM element.
 * @param specifiedSelector Needed element specification.
 *
 * @returns Array of DOM elements.
 * @throws An error if there is no selectorNodeChild.
 */

const getElementsForSelectorNode = (selectorNode, root, specifiedSelector) => {
  let selectedElements = [];
  let i = 0;

  while (i < selectorNode.children.length) {
    const selectorNodeChild = getItemByIndex(selectorNode.children, i, 'selectorNodeChild should be specified');

    if (i === 0) {
      // any selector always starts with regular selector
      selectedElements = getByRegularSelector(selectorNodeChild, root, specifiedSelector);
    } else if (isExtendedSelectorNode(selectorNodeChild)) {
      // filter previously selected elements by next selector nodes
      selectedElements = getByExtendedSelector(selectedElements, selectorNodeChild);
    } else if (isRegularSelectorNode(selectorNodeChild)) {
      selectedElements = getByFollowingRegularSelector(selectedElements, selectorNodeChild);
    }

    i += 1;
  }

  return selectedElements;
};

/**
 * Selects elements by ast.
 *
 * @param ast Ast of parsed selector.
 * @param doc Document.
 *
 * @returns Array of DOM elements.
 */

const selectElementsByAst = function (ast) {
  let doc = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : document;
  const selectedElements = []; // ast root is SelectorList node;
  // it has Selector nodes as children which should be processed separately

  ast.children.forEach(selectorNode => {
    selectedElements.push(...getElementsForSelectorNode(selectorNode, doc));
  }); // selectedElements should be flattened as it is array of arrays with elements

  const uniqueElements = [...new Set(flatten(selectedElements))];
  return uniqueElements;
};
/**
 * Class of ExtCssDocument is needed for caching.
 * For making cache related to each new instance of class, not global.
 */

class ExtCssDocument {
  /**
   * Cache with selectors and their AST parsing results.
   */

  /**
   * Creates new ExtCssDocument and inits new `astCache`.
   */
  constructor() {
    this.astCache = new Map();
  }
  /**
   * Saves selector and it's ast to cache.
   *
   * @param selector Standard or extended selector.
   * @param ast Selector ast.
   */


  saveAstToCache(selector, ast) {
    this.astCache.set(selector, ast);
  }
  /**
   * Returns ast from cache for given selector.
   *
   * @param selector Standard or extended selector.
   *
   * @returns Previously parsed ast found in cache, or null if not found.
   */


  getAstFromCache(selector) {
    const cachedAst = this.astCache.get(selector) || null;
    return cachedAst;
  }
  /**
   * Returns selector ast:
   * - if cached ast exists — returns it;
   * - if no cached ast — saves newly parsed ast to cache and returns it.
   *
   * @param selector Standard or extended selector.
   *
   * @returns Ast for `selector`.
   */


  getSelectorAst(selector) {
    let ast = this.getAstFromCache(selector);

    if (!ast) {
      ast = parse(selector);
    }

    this.saveAstToCache(selector, ast);
    return ast;
  }
  /**
   * Selects elements by selector.
   *
   * @param selector Standard or extended selector.
   *
   * @returns Array of DOM elements.
   */


  querySelectorAll(selector) {
    const ast = this.getSelectorAst(selector);
    return selectElementsByAst(ast);
  }

}
const extCssDocument = new ExtCssDocument();

/**
 * Converts array of `entries` to object.
 * Object.fromEntries() polyfill because it is not supported by old browsers, e.g. Chrome 55.
 * Only first two elements of `entries` array matter, other will be skipped silently.
 *
 * @see {@link https://caniuse.com/?search=Object.fromEntries}
 *
 * @param entries Array of pairs.
 *
 * @returns Object converted from `entries`.
 */
const getObjectFromEntries = entries => {
  const object = {};
  entries.forEach(el => {
    const [key, value] = el;
    object[key] = value;
  });
  return object;
};

const DEBUG_PSEUDO_PROPERTY_KEY = 'debug';
/**
 * Checks the presence of :remove() pseudo-class and validates it while parsing the selector part of css rule.
 *
 * @param rawSelector Selector which may contain :remove() pseudo-class.
 *
 * @returns Parsed selector data with selector and styles.
 * @throws An error on invalid :remove() position.
 */

const parseRemoveSelector = rawSelector => {
  /**
   * No error will be thrown on invalid selector as it will be validated later
   * so it's better to explicitly specify 'any' selector for :remove() pseudo-class by '*',
   * e.g. '.banner > *:remove()' instead of '.banner > :remove()'.
   */
  // ':remove()'
  // eslint-disable-next-line max-len
  const VALID_REMOVE_MARKER = `${COLON}${REMOVE_PSEUDO_MARKER}${BRACKET.PARENTHESES.LEFT}${BRACKET.PARENTHESES.RIGHT}`; // ':remove(' - needed for validation rules like 'div:remove(2)'

  const INVALID_REMOVE_MARKER = `${COLON}${REMOVE_PSEUDO_MARKER}${BRACKET.PARENTHESES.LEFT}`;
  let selector;
  let shouldRemove = false;
  const firstIndex = rawSelector.indexOf(VALID_REMOVE_MARKER);

  if (firstIndex === 0) {
    // e.g. ':remove()'
    throw new Error(`${REMOVE_ERROR_PREFIX.NO_TARGET_SELECTOR}: '${rawSelector}'`);
  } else if (firstIndex > 0) {
    if (firstIndex !== rawSelector.lastIndexOf(VALID_REMOVE_MARKER)) {
      // rule with more than one :remove() pseudo-class is invalid
      // e.g. '.block:remove() > .banner:remove()'
      throw new Error(`${REMOVE_ERROR_PREFIX.MULTIPLE_USAGE}: '${rawSelector}'`);
    } else if (firstIndex + VALID_REMOVE_MARKER.length < rawSelector.length) {
      // remove pseudo-class should be last in the rule
      // e.g. '.block:remove():upward(2)'
      throw new Error(`${REMOVE_ERROR_PREFIX.INVALID_POSITION}: '${rawSelector}'`);
    } else {
      // valid :remove() pseudo-class position
      selector = rawSelector.substring(0, firstIndex);
      shouldRemove = true;
    }
  } else if (rawSelector.includes(INVALID_REMOVE_MARKER)) {
    // it is not valid if ':remove()' is absent in rule but just ':remove(' is present
    // e.g. 'div:remove(0)'
    throw new Error(`${REMOVE_ERROR_PREFIX.INVALID_REMOVE}: '${rawSelector}'`);
  } else {
    // there is no :remove() pseudo-class in rule
    selector = rawSelector;
  }

  const stylesOfSelector = shouldRemove ? [{
    property: REMOVE_PSEUDO_MARKER,
    value: PSEUDO_PROPERTY_POSITIVE_VALUE
  }] : [];
  return {
    selector,
    stylesOfSelector
  };
};
/**
 * Parses cropped selector part found before `{`.
 *
 * @param selectorBuffer Buffered selector to parse.
 * @param extCssDoc Needed for caching of selector ast.
 *
 * @returns Parsed validation data for cropped part of stylesheet which may be a selector.
 * @throws An error on unsupported CSS features, e.g. at-rules.
 */

const parseSelectorRulePart = (selectorBuffer, extCssDoc) => {
  let selector = selectorBuffer.trim();

  if (selector.startsWith(AT_RULE_MARKER)) {
    throw new Error(`${NO_AT_RULE_ERROR_PREFIX}: '${selector}'.`);
  }

  let removeSelectorData;

  try {
    removeSelectorData = parseRemoveSelector(selector);
  } catch (e) {
    logger.error(getErrorMessage(e));
    throw new Error(`${REMOVE_ERROR_PREFIX.INVALID_REMOVE}: '${selector}'`);
  }

  let stylesOfSelector = [];
  let success = false;
  let ast;

  try {
    selector = removeSelectorData.selector;
    stylesOfSelector = removeSelectorData.stylesOfSelector; // validate found selector by parsing it to ast
    // so if it is invalid error will be thrown

    ast = extCssDoc.getSelectorAst(selector);
    success = true;
  } catch (e) {
    success = false;
  }

  return {
    success,
    selector,
    ast,
    stylesOfSelector
  };
};
/**
 * Creates a map for storing raw results of css rules parsing.
 * Used for merging styles for same selector.
 *
 * @returns Map where **key** is `selector`
 * and **value** is object with `ast` and `styles`.
 */

const createRawResultsMap = () => {
  return new Map();
};
/**
 * Saves rules data for unique selectors.
 *
 * @param rawResults Previously collected results of parsing.
 * @param rawRuleData Parsed rule data.
 *
 * @throws An error if there is no rawRuleData.styles or rawRuleData.ast.
 */

const saveToRawResults = (rawResults, rawRuleData) => {
  const {
    selector,
    ast,
    rawStyles
  } = rawRuleData;

  if (!rawStyles) {
    throw new Error(`No style declaration for selector: '${selector}'`);
  }

  if (!ast) {
    throw new Error(`No ast parsed for selector: '${selector}'`);
  }

  const storedRuleData = rawResults.get(selector);

  if (!storedRuleData) {
    rawResults.set(selector, {
      ast,
      styles: rawStyles
    });
  } else {
    storedRuleData.styles.push(...rawStyles);
  }
};
/**
 * Checks whether the 'remove' property positively set in styles
 * with only one positive value - 'true'.
 *
 * @param styles Array of styles.
 *
 * @returns True if there is 'remove' property with 'true' value in `styles`.
 */

const isRemoveSetInStyles = styles => {
  return styles.some(s => {
    return s.property === REMOVE_PSEUDO_MARKER && s.value === PSEUDO_PROPERTY_POSITIVE_VALUE;
  });
};
/**
 * Returns 'debug' property value which is set in styles.
 *
 * @param styles Array of styles.
 *
 * @returns Value of 'debug' property if it is set in `styles`,
 * or `undefined` if the property is not found.
 */


const getDebugStyleValue = styles => {
  const debugStyle = styles.find(s => {
    return s.property === DEBUG_PSEUDO_PROPERTY_KEY;
  });
  return debugStyle === null || debugStyle === void 0 ? void 0 : debugStyle.value;
};
/**
 * Prepares final RuleData.
 * Handles `debug` and `remove` in raw rule data styles.
 *
 * @param rawRuleData Raw data of selector css rule parsing.
 *
 * @returns Parsed ExtendedCss rule data.
 * @throws An error if rawRuleData.ast or rawRuleData.rawStyles not defined.
 */


const prepareRuleData = rawRuleData => {
  const {
    selector,
    ast,
    rawStyles
  } = rawRuleData;

  if (!ast) {
    throw new Error(`AST should be parsed for selector: '${selector}'`);
  }

  if (!rawStyles) {
    throw new Error(`Styles should be parsed for selector: '${selector}'`);
  }

  const ruleData = {
    selector,
    ast
  };
  const debugValue = getDebugStyleValue(rawStyles);
  const shouldRemove = isRemoveSetInStyles(rawStyles);
  let styles = rawStyles;

  if (debugValue) {
    // get rid of 'debug' from styles
    styles = rawStyles.filter(s => s.property !== DEBUG_PSEUDO_PROPERTY_KEY); // and set it as separate property only if its value is valid
    // which is 'true' or 'global'

    if (debugValue === PSEUDO_PROPERTY_POSITIVE_VALUE || debugValue === DEBUG_PSEUDO_PROPERTY_GLOBAL_VALUE) {
      ruleData.debug = debugValue;
    }
  }

  if (shouldRemove) {
    // no other styles are needed to apply if 'remove' is set
    ruleData.style = {
      [REMOVE_PSEUDO_MARKER]: PSEUDO_PROPERTY_POSITIVE_VALUE
    };
    /**
     * 'content' property is needed for ExtCssConfiguration.beforeStyleApplied().
     *
     * @see {@link BeforeStyleAppliedCallback}
     */

    const contentStyle = styles.find(s => s.property === CONTENT_CSS_PROPERTY);

    if (contentStyle) {
      ruleData.style[CONTENT_CSS_PROPERTY] = contentStyle.value;
    }
  } else {
    // otherwise all styles should be applied.
    // every style property will be unique because of their converting into object
    if (styles.length > 0) {
      const stylesAsEntries = styles.map(style => {
        const {
          property,
          value
        } = style;
        return [property, value];
      });
      const preparedStyleData = getObjectFromEntries(stylesAsEntries);
      ruleData.style = preparedStyleData;
    }
  }

  return ruleData;
};
/**
 * Combines previously parsed css rules data objects
 * into rules which are ready to apply.
 *
 * @param rawResults Previously parsed css rules data objects.
 *
 * @returns Parsed ExtendedCss rule data.
 */

const combineRulesData = rawResults => {
  const results = [];
  rawResults.forEach((value, key) => {
    const selector = key;
    const {
      ast,
      styles: rawStyles
    } = value;
    results.push(prepareRuleData({
      selector,
      ast,
      rawStyles
    }));
  });
  return results;
};

/**
 * Trims `rawStyle` and splits it into tokens.
 *
 * @param rawStyle Style declaration block content inside curly bracket — `{` and `}` —
 * can be a single style declaration or a list of declarations.
 *
 * @returns Array of tokens supported for style declaration block.
 */

const tokenizeStyleBlock = rawStyle => {
  const styleDeclaration = rawStyle.trim();
  return tokenize(styleDeclaration, SUPPORTED_STYLE_DECLARATION_MARKS);
};

/**
 * Describes possible style declaration parts.
 *
 * IMPORTANT: it is used as 'const' instead of 'enum' to avoid side effects
 * during ExtendedCss import into other libraries.
 */

const DECLARATION_PART = {
  PROPERTY: 'property',
  VALUE: 'value'
};

/**
 * Checks whether the quotes has been opened for style value.
 *
 * @param context Style block parser context.
 *
 * @returns True if style value has already opened quotes.
 */
const isValueQuotesOpen = context => {
  return context.bufferValue !== '' && context.valueQuoteMark !== null;
};
/**
 * Saves parsed property and value to collection of parsed styles.
 * Prunes context buffers for property and value.
 *
 * @param context Style block parser context.
 */


const collectStyle = context => {
  context.styles.push({
    property: context.bufferProperty.trim(),
    value: context.bufferValue.trim()
  }); // reset buffers

  context.bufferProperty = '';
  context.bufferValue = '';
};
/**
 * Handles token which is supposed to be a part of style **property**.
 *
 * @param context Style block parser context.
 * @param styleBlock Whole style block which is being parsed.
 * @param token Current token.
 *
 * @throws An error on invalid token.
 */


const processPropertyToken = (context, styleBlock, token) => {
  const {
    value: tokenValue
  } = token;

  switch (token.type) {
    case TOKEN_TYPE.WORD:
      if (context.bufferProperty.length > 0) {
        // e.g. 'padding top: 0;' - current tokenValue is 'top' which is not valid
        throw new Error(`Invalid style property in style block: '${styleBlock}'`);
      }

      context.bufferProperty += tokenValue;
      break;

    case TOKEN_TYPE.MARK:
      // only colon and whitespaces are allowed while style property parsing
      if (tokenValue === COLON) {
        if (context.bufferProperty.trim().length === 0) {
          // e.g. such style block: '{ : none; }'
          throw new Error(`Missing style property before ':' in style block: '${styleBlock}'`);
        } // the property successfully collected


        context.bufferProperty = context.bufferProperty.trim(); // prepare for value collecting

        context.processing = DECLARATION_PART.VALUE; // the property buffer shall be reset after the value is successfully collected
      } else if (WHITE_SPACE_CHARACTERS.includes(tokenValue)) ; else {
        // if after the property there is anything other than ':' except whitespace, this is a parse error
        // https://www.w3.org/TR/css-syntax-3/#consume-declaration
        throw new Error(`Invalid style declaration in style block: '${styleBlock}'`);
      }

      break;

    default:
      throw new Error(`Unsupported style property character: '${tokenValue}' in style block: '${styleBlock}'`);
  }
};
/**
 * Handles token which is supposed to be a part of style **value**.
 *
 * @param context Style block parser context.
 * @param styleBlock Whole style block which is being parsed.
 * @param token Current token.
 *
 * @throws An error on invalid token.
 */


const processValueToken = (context, styleBlock, token) => {
  const {
    value: tokenValue
  } = token;

  if (token.type === TOKEN_TYPE.WORD) {
    // simply collect to buffer
    context.bufferValue += tokenValue;
  } else {
    // otherwise check the mark
    switch (tokenValue) {
      case COLON:
        // the ':' character inside of the value should be inside of quotes
        // otherwise the value is not valid
        // e.g. 'content: display: none'
        // parser is here        ↑
        if (!isValueQuotesOpen(context)) {
          // eslint-disable-next-line max-len
          throw new Error(`Invalid style value for property '${context.bufferProperty}' in style block: '${styleBlock}'`);
        } // collect the colon inside quotes
        // e.g. 'content: "test:123"'
        // parser is here      ↑


        context.bufferValue += tokenValue;
        break;

      case SEMICOLON:
        if (isValueQuotesOpen(context)) {
          // ';' inside quotes is part of style value
          // e.g. 'content: "test;"'
          context.bufferValue += tokenValue;
        } else {
          // otherwise the value is successfully collected
          // save parsed style
          collectStyle(context); // prepare for value collecting

          context.processing = DECLARATION_PART.PROPERTY;
        }

        break;

      case SINGLE_QUOTE:
      case DOUBLE_QUOTE:
        // if quotes are not open
        if (context.valueQuoteMark === null) {
          // save the opening quote mark for later comparison
          context.valueQuoteMark = tokenValue;
        } else if (!context.bufferValue.endsWith(BACKSLASH) // otherwise a quote appeared in the value earlier,
        // and non-escaped quote should be checked whether it is a closing quote
        && context.valueQuoteMark === tokenValue) {
          context.valueQuoteMark = null;
        } // always save the quote to the buffer
        // but after the context.bufferValue is checked for BACKSLASH above
        // e.g. 'content: "test:123"'
        //      'content: "\""'


        context.bufferValue += tokenValue;
        break;

      case BACKSLASH:
        if (!isValueQuotesOpen(context)) {
          // eslint-disable-next-line max-len
          throw new Error(`Invalid style value for property '${context.bufferProperty}' in style block: '${styleBlock}'`);
        } // collect the backslash inside quotes
        // e.g. ' content: "\"" '
        // parser is here   ↑


        context.bufferValue += tokenValue;
        break;

      case SPACE:
      case TAB:
      case CARRIAGE_RETURN:
      case LINE_FEED:
      case FORM_FEED:
        // whitespace should be collected only if the value collecting started
        // which means inside of the value
        // e.g. 'width: 100% !important'
        // parser is here   ↑
        if (context.bufferValue.length > 0) {
          context.bufferValue += tokenValue;
        } // otherwise it can be omitted
        // e.g. 'width:  100% !important'
        // here        ↑


        break;

      default:
        throw new Error(`Unknown style declaration token: '${tokenValue}'`);
    }
  }
};
/**
 * Parses css rule style block.
 *
 * @param rawStyleBlock Style block to parse.
 *
 * @returns Array of style declarations.
 * @throws An error on invalid style block.
 */


const parseStyleBlock = rawStyleBlock => {
  const styleBlock = rawStyleBlock.trim();
  const tokens = tokenizeStyleBlock(styleBlock);
  const context = {
    // style declaration parsing always starts with 'property'
    processing: DECLARATION_PART.PROPERTY,
    styles: [],
    bufferProperty: '',
    bufferValue: '',
    valueQuoteMark: null
  };
  let i = 0;

  while (i < tokens.length) {
    const token = tokens[i];

    if (!token) {
      break;
    }

    if (context.processing === DECLARATION_PART.PROPERTY) {
      processPropertyToken(context, styleBlock, token);
    } else if (context.processing === DECLARATION_PART.VALUE) {
      processValueToken(context, styleBlock, token);
    } else {
      throw new Error('Style declaration parsing failed');
    }

    i += 1;
  } // unbalanced value quotes
  // e.g. 'content: "test} '


  if (isValueQuotesOpen(context)) {
    throw new Error(`Unbalanced style declaration quotes in style block: '${styleBlock}'`);
  } // collected property and value have not been saved to styles;
  // it is possible for style block with no semicolon at the end
  // e.g. such style block: '{ display: none }'


  if (context.bufferProperty.length > 0) {
    if (context.bufferValue.length === 0) {
      // e.g. such style blocks:
      //   '{ display:  }'
      //   '{ remove }'
      // eslint-disable-next-line max-len
      throw new Error(`Missing style value for property '${context.bufferProperty}' in style block '${styleBlock}'`);
    }

    collectStyle(context);
  } // rule with empty style block
  // e.g. 'div { }'


  if (context.styles.length === 0) {
    throw new Error(STYLE_ERROR_PREFIX.NO_STYLE);
  }

  return context.styles;
};

/**
 * Returns array of positions of `{` in `cssRule`.
 *
 * @param cssRule CSS rule.
 *
 * @returns Array of left curly bracket indexes.
 */

const getLeftCurlyBracketIndexes = cssRule => {
  const indexes = [];

  for (let i = 0; i < cssRule.length; i += 1) {
    if (cssRule[i] === BRACKET.CURLY.LEFT) {
      indexes.push(i);
    }
  }

  return indexes;
}; // TODO: use `extCssDoc` for caching of style block parser results

/**
 * Parses CSS rule into rules data object:
 * 1. Find the last `{` mark in the rule
 *    which supposed to be a divider between selector and style block.
 * 2. Validates found string part before the `{` via selector parser; and if:
 *  - parsing failed – get the previous `{` in the rule,
 *    and validates a new rule part again [2];
 *  - parsing successful — saves a found rule part as selector and parses the style block.
 *
 * @param rawCssRule Single CSS rule to parse.
 * @param extCssDoc ExtCssDocument which is used for selector ast caching.
 *
 * @returns Array of rules data which contains:
 *   - selector as string;
 *   - ast to query elements by;
 *   - map of styles to apply.
 * @throws An error on invalid css rule syntax:
 *   - unsupported CSS features – comments and at-rules
 *   - invalid selector or style block.
 */


const parseRule = (rawCssRule, extCssDoc) => {
  var _rawRuleData$selector;

  const cssRule = rawCssRule.trim();

  if (cssRule.includes(`${SLASH}${ASTERISK}`) && cssRule.includes(`${ASTERISK}${SLASH}`)) {
    throw new Error(STYLE_ERROR_PREFIX.NO_COMMENT);
  }

  const leftCurlyBracketIndexes = getLeftCurlyBracketIndexes(cssRule); // rule with style block but no selector
  // e.g. '{ display: none; }'

  if (getFirst(leftCurlyBracketIndexes) === 0) {
    throw new Error(NO_SELECTOR_ERROR_PREFIX);
  }

  let selectorData; // if rule has `{` but there is no `}`

  if (leftCurlyBracketIndexes.length > 0 && !cssRule.includes(BRACKET.CURLY.RIGHT)) {
    throw new Error(`${STYLE_ERROR_PREFIX.NO_STYLE} OR ${STYLE_ERROR_PREFIX.UNCLOSED_STYLE}`);
  }

  if ( // if rule has no `{`
  leftCurlyBracketIndexes.length === 0 // or `}`
  || !cssRule.includes(BRACKET.CURLY.RIGHT)) {
    try {
      // the whole css rule considered as "selector part"
      // which may contain :remove() pseudo-class
      selectorData = parseSelectorRulePart(cssRule, extCssDoc);

      if (selectorData.success) {
        var _selectorData$stylesO;

        // rule with no style block has valid :remove() pseudo-class
        // which is parsed into "styles"
        // e.g. 'div:remove()'
        // but also it can be just selector with no styles
        // e.g. 'div'
        // which should not be considered as valid css rule
        if (((_selectorData$stylesO = selectorData.stylesOfSelector) === null || _selectorData$stylesO === void 0 ? void 0 : _selectorData$stylesO.length) === 0) {
          throw new Error(STYLE_ERROR_PREFIX.NO_STYLE_OR_REMOVE);
        }

        return {
          selector: selectorData.selector.trim(),
          ast: selectorData.ast,
          rawStyles: selectorData.stylesOfSelector
        };
      } else {
        // not valid selector
        throw new Error('Invalid selector');
      }
    } catch (e) {
      throw new Error(getErrorMessage(e));
    }
  }

  let selectorBuffer;
  let styleBlockBuffer;
  const rawRuleData = {
    selector: ''
  }; // css rule should be parsed from its end

  for (let i = leftCurlyBracketIndexes.length - 1; i > -1; i -= 1) {
    const index = leftCurlyBracketIndexes[i];

    if (!index) {
      throw new Error(`Impossible to continue, no '{' to process for rule: '${cssRule}'`);
    } // selector is before `{`, style block is after it


    selectorBuffer = cssRule.slice(0, index); // skip curly brackets

    styleBlockBuffer = cssRule.slice(index + 1, cssRule.length - 1);
    selectorData = parseSelectorRulePart(selectorBuffer, extCssDoc);

    if (selectorData.success) {
      var _rawRuleData$rawStyle;

      // selector successfully parsed
      rawRuleData.selector = selectorData.selector.trim();
      rawRuleData.ast = selectorData.ast;
      rawRuleData.rawStyles = selectorData.stylesOfSelector; // style block should be parsed
      // TODO: add cache for style block parsing

      const parsedStyles = parseStyleBlock(styleBlockBuffer);
      (_rawRuleData$rawStyle = rawRuleData.rawStyles) === null || _rawRuleData$rawStyle === void 0 ? void 0 : _rawRuleData$rawStyle.push(...parsedStyles); // stop rule parsing

      break;
    } else {
      // if selector was not parsed successfully
      // continue with next index of `{`
      continue;
    }
  }

  if (((_rawRuleData$selector = rawRuleData.selector) === null || _rawRuleData$selector === void 0 ? void 0 : _rawRuleData$selector.length) === 0) {
    // skip the rule as selector
    throw new Error('Selector in not valid');
  }

  return rawRuleData;
};
/**
 * Parses array of CSS rules into array of rules data objects.
 * Invalid rules are skipped and not applied,
 * and the errors are logged.
 *
 * @param rawCssRules Array of rules to parse.
 * @param extCssDoc Needed for selector ast caching.
 *
 * @returns Array of parsed valid rules data.
 */

const parseRules = (rawCssRules, extCssDoc) => {
  const rawResults = createRawResultsMap();
  const warnings = []; // trim all rules and find unique ones

  const uniqueRules = [...new Set(rawCssRules.map(r => r.trim()))];
  uniqueRules.forEach(rule => {
    try {
      saveToRawResults(rawResults, parseRule(rule, extCssDoc));
    } catch (e) {
      // skip the invalid rule
      const errorMessage = getErrorMessage(e);
      warnings.push(`'${rule}' - error: '${errorMessage}'`);
    }
  }); // log info about skipped invalid rules

  if (warnings.length > 0) {
    logger.info(`Invalid rules:\n  ${warnings.join('\n  ')}`);
  }

  return combineRulesData(rawResults);
};

const REGEXP_DECLARATION_END = /[;}]/g;
const REGEXP_DECLARATION_DIVIDER = /[;:}]/g;
const REGEXP_NON_WHITESPACE = /\S/g;
/**
 * Interface for stylesheet parser context.
 */

/**
 * Resets rule data buffer to init value after rule successfully collected.
 *
 * @param context Stylesheet parser context.
 */
const restoreRuleAcc = context => {
  context.rawRuleData = {
    selector: ''
  };
};
/**
 * Parses cropped selector part found before `{` previously.
 *
 * @param context Stylesheet parser context.
 * @param extCssDoc Needed for caching of selector ast.
 *
 * @returns Parsed validation data for cropped part of stylesheet which may be a selector.
 * @throws An error on unsupported CSS features, e.g. at-rules.
 */


const parseSelectorPart = (context, extCssDoc) => {
  let selector = context.selectorBuffer.trim();

  if (selector.startsWith(AT_RULE_MARKER)) {
    throw new Error(`${NO_AT_RULE_ERROR_PREFIX}: '${selector}'.`);
  }

  let removeSelectorData;

  try {
    removeSelectorData = parseRemoveSelector(selector);
  } catch (e) {
    logger.error(getErrorMessage(e));
    throw new Error(`${REMOVE_ERROR_PREFIX.INVALID_REMOVE}: '${selector}'`);
  }

  if (context.nextIndex === -1) {
    if (selector === removeSelectorData.selector) {
      // rule should have style or pseudo-class :remove()
      throw new Error(`${STYLE_ERROR_PREFIX.NO_STYLE_OR_REMOVE}: '${context.cssToParse}'`);
    } // stop parsing as there is no style declaration and selector parsed fine


    context.cssToParse = '';
  }

  let stylesOfSelector = [];
  let success = false;
  let ast;

  try {
    selector = removeSelectorData.selector;
    stylesOfSelector = removeSelectorData.stylesOfSelector; // validate found selector by parsing it to ast
    // so if it is invalid error will be thrown

    ast = extCssDoc.getSelectorAst(selector);
    success = true;
  } catch (e) {
    success = false;
  }

  if (context.nextIndex > 0) {
    // slice found valid selector part off
    // and parse rest of stylesheet later
    context.cssToParse = context.cssToParse.slice(context.nextIndex);
  }

  return {
    success,
    selector,
    ast,
    stylesOfSelector
  };
};
/**
 * Recursively parses style declaration string into `Style`s.
 *
 * @param context Stylesheet parser context.
 * @param styles Array of styles.
 *
 * @throws An error on invalid style declaration.
 * @returns A number index of the next `}` in `this.cssToParse`.
 */


const parseUntilClosingBracket = (context, styles) => {
  // Expects ":", ";", and "}".
  REGEXP_DECLARATION_DIVIDER.lastIndex = context.nextIndex;
  let match = REGEXP_DECLARATION_DIVIDER.exec(context.cssToParse);

  if (match === null) {
    throw new Error(`${STYLE_ERROR_PREFIX.INVALID_STYLE}: '${context.cssToParse}'`);
  }

  let matchPos = match.index;
  let matched = match[0];

  if (matched === BRACKET.CURLY.RIGHT) {
    const declarationChunk = context.cssToParse.slice(context.nextIndex, matchPos);

    if (declarationChunk.trim().length === 0) {
      // empty style declaration
      // e.g. 'div { }'
      if (styles.length === 0) {
        throw new Error(`${STYLE_ERROR_PREFIX.NO_STYLE}: '${context.cssToParse}'`);
      } // else valid style parsed before it
      // e.g. '{ display: none; }' -- position is after ';'

    } else {
      // closing curly bracket '}' is matched before colon ':'
      // trimmed declarationChunk is not a space, between ';' and '}',
      // e.g. 'visible }' in style '{ display: none; visible }' after part before ';' is parsed
      throw new Error(`${STYLE_ERROR_PREFIX.INVALID_STYLE}: '${context.cssToParse}'`);
    }

    return matchPos;
  }

  if (matched === COLON) {
    const colonIndex = matchPos; // Expects ";" and "}".

    REGEXP_DECLARATION_END.lastIndex = colonIndex;
    match = REGEXP_DECLARATION_END.exec(context.cssToParse);

    if (match === null) {
      throw new Error(`${STYLE_ERROR_PREFIX.UNCLOSED_STYLE}: '${context.cssToParse}'`);
    }

    matchPos = match.index;
    matched = match[0]; // Populates the `styleMap` key-value map.

    const property = context.cssToParse.slice(context.nextIndex, colonIndex).trim();

    if (property.length === 0) {
      throw new Error(`${STYLE_ERROR_PREFIX.NO_PROPERTY}: '${context.cssToParse}'`);
    }

    const value = context.cssToParse.slice(colonIndex + 1, matchPos).trim();

    if (value.length === 0) {
      throw new Error(`${STYLE_ERROR_PREFIX.NO_VALUE}: '${context.cssToParse}'`);
    }

    styles.push({
      property,
      value
    }); // finish style parsing if '}' is found
    // e.g. '{ display: none }' -- no ';' at the end of declaration

    if (matched === BRACKET.CURLY.RIGHT) {
      return matchPos;
    }
  } // matchPos is the position of the next ';'
  // crop 'cssToParse' and re-run the loop


  context.cssToParse = context.cssToParse.slice(matchPos + 1);
  context.nextIndex = 0;
  return parseUntilClosingBracket(context, styles); // Should be a subject of tail-call optimization.
};
/**
 * Parses next style declaration part in stylesheet.
 *
 * @param context Stylesheet parser context.
 *
 * @returns Array of style data objects.
 */


const parseNextStyle = context => {
  const styles = [];
  const styleEndPos = parseUntilClosingBracket(context, styles); // find next rule after the style declaration

  REGEXP_NON_WHITESPACE.lastIndex = styleEndPos + 1;
  const match = REGEXP_NON_WHITESPACE.exec(context.cssToParse);

  if (match === null) {
    context.cssToParse = '';
    return styles;
  }

  const matchPos = match.index; // cut out matched style declaration for previous selector

  context.cssToParse = context.cssToParse.slice(matchPos);
  return styles;
};
/**
 * Parses stylesheet of rules into rules data objects (non-recursively):
 * 1. Iterates through stylesheet string.
 * 2. Finds first `{` which can be style declaration start or part of selector.
 * 3. Validates found string part via selector parser; and if:
 *  - it throws error — saves string part to buffer as part of selector,
 *    slice next stylesheet part to `{` [2] and validates again [3];
 *  - no error — saves found string part as selector and starts to parse styles (recursively).
 *
 * @param rawStylesheet Raw stylesheet as string.
 * @param extCssDoc ExtCssDocument which uses cache while selectors parsing.
 * @throws An error on unsupported CSS features, e.g. comments or invalid stylesheet syntax.
 * @returns Array of rules data which contains:
 * - selector as string;
 * - ast to query elements by;
 * - map of styles to apply.
 */


const parseStylesheet = (rawStylesheet, extCssDoc) => {
  const stylesheet = rawStylesheet.trim();

  if (stylesheet.includes(`${SLASH}${ASTERISK}`) && stylesheet.includes(`${ASTERISK}${SLASH}`)) {
    throw new Error(`${STYLE_ERROR_PREFIX.NO_COMMENT} in stylesheet: '${stylesheet}'`);
  }

  const context = {
    // any stylesheet should start with selector
    isSelector: true,
    // init value of parser position
    nextIndex: 0,
    // init value of cssToParse
    cssToParse: stylesheet,
    // buffer for collecting selector part
    selectorBuffer: '',
    // accumulator for rules
    rawRuleData: {
      selector: ''
    }
  };
  const rawResults = createRawResultsMap();
  let selectorData; // context.cssToParse is going to be cropped while its parsing

  while (context.cssToParse) {
    if (context.isSelector) {
      // find index of first opening curly bracket
      // which may mean start of style part and end of selector one
      context.nextIndex = context.cssToParse.indexOf(BRACKET.CURLY.LEFT); // rule should not start with style, selector is required
      // e.g. '{ display: none; }'

      if (context.selectorBuffer.length === 0 && context.nextIndex === 0) {
        throw new Error(`${STYLE_ERROR_PREFIX.NO_SELECTOR}: '${context.cssToParse}'`);
      }

      if (context.nextIndex === -1) {
        // no style declaration in rule
        // but rule still may contain :remove() pseudo-class
        context.selectorBuffer = context.cssToParse;
      } else {
        // collect string parts before opening curly bracket
        // until valid selector collected
        context.selectorBuffer += context.cssToParse.slice(0, context.nextIndex);
      }

      selectorData = parseSelectorPart(context, extCssDoc);

      if (selectorData.success) {
        // selector successfully parsed
        context.rawRuleData.selector = selectorData.selector.trim();
        context.rawRuleData.ast = selectorData.ast;
        context.rawRuleData.rawStyles = selectorData.stylesOfSelector;
        context.isSelector = false; // save rule data if there is no style declaration

        if (context.nextIndex === -1) {
          saveToRawResults(rawResults, context.rawRuleData); // clean up ruleContext

          restoreRuleAcc(context);
        } else {
          // skip the opening curly bracket at the start of style declaration part
          context.nextIndex = 1;
          context.selectorBuffer = '';
        }
      } else {
        // if selector was not successfully parsed parseSelectorPart(), continue stylesheet parsing:
        // save the found bracket to buffer and proceed to next loop iteration
        context.selectorBuffer += BRACKET.CURLY.LEFT; // delete `{` from cssToParse

        context.cssToParse = context.cssToParse.slice(1);
      }
    } else {
      var _context$rawRuleData$;

      // style declaration should be parsed
      const parsedStyles = parseNextStyle(context); // styles can be parsed from selector part if it has :remove() pseudo-class
      // e.g. '.banner:remove() { debug: true; }'

      (_context$rawRuleData$ = context.rawRuleData.rawStyles) === null || _context$rawRuleData$ === void 0 ? void 0 : _context$rawRuleData$.push(...parsedStyles); // save rule data to results

      saveToRawResults(rawResults, context.rawRuleData);
      context.nextIndex = 0; // clean up ruleContext

      restoreRuleAcc(context); // parse next rule selector after style successfully parsed

      context.isSelector = true;
    }
  }

  return combineRulesData(rawResults);
};

/**
 * Checks whether passed `arg` is number type.
 *
 * @param arg Value to check.
 *
 * @returns True if `arg` is number and not NaN.
 */
const isNumber = arg => {
  return typeof arg === 'number' && !Number.isNaN(arg);
};

/**
 * The purpose of ThrottleWrapper is to throttle calls of the function
 * that applies ExtendedCss rules. The reasoning here is that the function calls
 * are triggered by MutationObserver and there may be many mutations in a short period of time.
 * We do not want to apply rules on every mutation so we use this helper to make sure
 * that there is only one call in the given amount of time.
 */

class ThrottleWrapper {
  /**
   * Creates new ThrottleWrapper.
   * The {@link callback} should be executed not more often than {@link ThrottleWrapper.THROTTLE_DELAY_MS}.
   *
   * @param callback The callback.
   */
  constructor(callback) {
    this.callback = callback;
    this.executeCallback = this.executeCallback.bind(this);
  }
  /**
   * Calls the {@link callback} function and update bounded throttle wrapper properties.
   */


  executeCallback() {
    this.lastRunTime = performance.now();

    if (isNumber(this.timerId)) {
      clearTimeout(this.timerId);
      delete this.timerId;
    }

    this.callback();
  }
  /**
   * Schedules the {@link executeCallback} function execution via setTimeout.
   * It may triggered by MutationObserver job which may occur too ofter, so we limit the function execution:
   *
   * 1. If {@link timerId} is set, ignore the call, because the function is already scheduled to be executed;
   *
   * 2. If {@link lastRunTime} is set, we need to check the time elapsed time since the last call. If it is
   * less than {@link ThrottleWrapper.THROTTLE_DELAY_MS}, we schedule the function execution after the remaining time.
   * 
   * Otherwise, we execute the function asynchronously to ensure that it is executed 
   * in the correct order with respect to DOM events, by deferring its execution until after 
   * those tasks have completed.
   */


  run() {
    if (isNumber(this.timerId)) {
      // there is a pending execution scheduled
      return;
    }

    if (isNumber(this.lastRunTime)) {
      const elapsedTime = performance.now() - this.lastRunTime;

      if (elapsedTime < ThrottleWrapper.THROTTLE_DELAY_MS) {
        this.timerId = window.setTimeout(this.executeCallback, ThrottleWrapper.THROTTLE_DELAY_MS - elapsedTime);
        return;
      }
    }
    /**
     * We use `setTimeout` instead `requestAnimationFrame`
     * here because requestAnimationFrame can be delayed for a long time
     * when the browser saves battery or the engine is heavily loaded.
     */


    this.timerId = window.setTimeout(this.executeCallback);
  }

}

_defineProperty(ThrottleWrapper, "THROTTLE_DELAY_MS", 150);

const LAST_EVENT_TIMEOUT_MS = 10;
const IGNORED_EVENTS = ['mouseover', 'mouseleave', 'mouseenter', 'mouseout'];
const SUPPORTED_EVENTS = [// keyboard events
'keydown', 'keypress', 'keyup', // mouse events
'auxclick', 'click', 'contextmenu', 'dblclick', 'mousedown', 'mouseenter', 'mouseleave', 'mousemove', 'mouseover', 'mouseout', 'mouseup', 'pointerlockchange', 'pointerlockerror', 'select', 'wheel']; // 'wheel' event makes scrolling in Safari twitchy
// https://github.com/AdguardTeam/ExtendedCss/issues/120

const SAFARI_PROBLEMATIC_EVENTS = ['wheel'];
/**
 * We use EventTracker to track the event that is likely to cause the mutation.
 * The problem is that we cannot use `window.event` directly from the mutation observer call
 * as we're not in the event handler context anymore.
 */

class EventTracker {
  /**
   * Creates new EventTracker.
   */
  constructor() {
    _defineProperty(this, "getLastEventType", () => this.lastEventType);

    _defineProperty(this, "getTimeSinceLastEvent", () => {
      if (!this.lastEventTime) {
        return null;
      }

      return Date.now() - this.lastEventTime;
    });

    this.trackedEvents = isSafariBrowser ? SUPPORTED_EVENTS.filter(event => !SAFARI_PROBLEMATIC_EVENTS.includes(event)) : SUPPORTED_EVENTS;
    this.trackedEvents.forEach(eventName => {
      document.documentElement.addEventListener(eventName, this.trackEvent, true);
    });
  }
  /**
   * Callback for event listener for events tracking.
   *
   * @param event Any event.
   */


  trackEvent(event) {
    this.lastEventType = event.type;
    this.lastEventTime = Date.now();
  }

  /**
   * Checks whether the last caught event should be ignored.
   *
   * @returns True if event should be ignored.
   */
  isIgnoredEventType() {
    const lastEventType = this.getLastEventType();
    const sinceLastEventTime = this.getTimeSinceLastEvent();
    return !!lastEventType && IGNORED_EVENTS.includes(lastEventType) && !!sinceLastEventTime && sinceLastEventTime < LAST_EVENT_TIMEOUT_MS;
  }
  /**
   * Stops event tracking by removing event listener.
   */


  stopTracking() {
    this.trackedEvents.forEach(eventName => {
      document.documentElement.removeEventListener(eventName, this.trackEvent, true);
    });
  }

}

/**
 * We are trying to limit the number of callback calls by not calling it on all kind of "hover" events.
 * The rationale behind this is that "hover" events often cause attributes modification,
 * but re-applying extCSS rules will be useless as these attribute changes are usually transient.
 *
 * @param mutations DOM elements mutation records.
 * @returns True if all mutations are about attributes changes, otherwise false.
 */

function shouldIgnoreMutations(mutations) {
  // ignore if all mutations are about attributes changes
  return !mutations.some(m => m.type !== 'attributes');
}
/**
 * Adds new {@link context.domMutationObserver} instance and connect it to document.
 * 
 * @param context ExtendedCss context.
 */


function observeDocument(context) {
  if (context.isDomObserved) {
    return;
  } // enable dynamically added elements handling


  context.isDomObserved = true;
  context.domMutationObserver = new natives.MutationObserver(mutations => {
    if (!mutations || mutations.length === 0) {
      return;
    }

    const eventTracker = new EventTracker();

    if (eventTracker.isIgnoredEventType() && shouldIgnoreMutations(mutations)) {
      return;
    } // save instance of EventTracker to context
    // for removing its event listeners on disconnectDocument() while mainDisconnect()


    context.eventTracker = eventTracker;
    context.scheduler.run();
  });
  context.domMutationObserver.observe(document, {
    childList: true,
    subtree: true,
    attributes: true,
    attributeFilter: ['id', 'class']
  });
}
/**
 * Disconnect from {@link context.domMutationObserver}.
 * 
 * @param context ExtendedCss context.
 */

function disconnectDocument(context) {
  if (!context.isDomObserved) {
    return;
  } // disable dynamically added elements handling


  context.isDomObserved = false;

  if (context.domMutationObserver) {
    context.domMutationObserver.disconnect();
  } // clean up event listeners


  if (context.eventTracker) {
    context.eventTracker.stopTracking();
  }
}

const CONTENT_ATTR_PREFIX_REGEXP = /^("|')adguard.+?/;
/**
 * Removes affectedElement.node from DOM.
 *
 * @param context ExtendedCss context.
 * @param affectedElement Affected element.
 */

const removeElement = (context, affectedElement) => {
  const {
    node
  } = affectedElement;
  affectedElement.removed = true;
  const elementSelector = getElementSelectorPath(node); // check if the element has been already removed earlier

  const elementRemovalsCounter = context.removalsStatistic[elementSelector] || 0; // if removals attempts happened more than specified we do not try to remove node again

  if (elementRemovalsCounter > MAX_STYLE_PROTECTION_COUNT) {
    logger.error(`ExtendedCss: infinite loop protection for selector: '${elementSelector}'`);
    return;
  }

  if (node.parentElement) {
    node.parentElement.removeChild(node);
    context.removalsStatistic[elementSelector] = elementRemovalsCounter + 1;
  }
};
/**
 * Sets style to the specified DOM node.
 *
 * @param node DOM element.
 * @param style Style to set.
 */


const setStyleToElement = (node, style) => {
  if (!(node instanceof HTMLElement)) {
    return;
  }

  Object.keys(style).forEach(prop => {
    // Apply this style only to existing properties
    // We cannot use hasOwnProperty here (does not work in FF)
    if (typeof node.style.getPropertyValue(prop.toString()) !== 'undefined') {
      let value = style[prop];

      if (!value) {
        return;
      } // do not apply 'content' style given by tsurlfilter
      // which is needed only for BeforeStyleAppliedCallback


      if (prop === CONTENT_CSS_PROPERTY && value.match(CONTENT_ATTR_PREFIX_REGEXP)) {
        return;
      } // First we should remove !important attribute (or it won't be applied')


      value = removeSuffix(value.trim(), '!important').trim();
      node.style.setProperty(prop, value, 'important');
    }
  });
};
/**
 * Checks the required properties of `affectedElement`
 * **before** `beforeStyleApplied()` execution.
 *
 * @param affectedElement Affected element.
 *
 * @returns False if there is no `node` or `rules`
 * or `rules` is not an array.
 */

const isIAffectedElement = affectedElement => {
  return 'node' in affectedElement && 'rules' in affectedElement && affectedElement.rules instanceof Array;
};
/**
 * Checks the required properties of `affectedElement`
 * **after** `beforeStyleApplied()` execution.
 * These properties are needed for proper internal usage.
 *
 * @param affectedElement Affected element.
 *
 * @returns False if there is no `node` or `rules`
 * or `rules` is not an array.
 */


const isAffectedElement = affectedElement => {
  return 'node' in affectedElement && 'originalStyle' in affectedElement && 'rules' in affectedElement && affectedElement.rules instanceof Array;
};
/**
 * Applies style to the specified DOM node.
 *
 * @param context ExtendedCss context.
 * @param rawAffectedElement Object containing DOM node and rule to be applied.
 *
 * @throws An error if affectedElement has no style to apply.
 */


const applyStyle = (context, rawAffectedElement) => {
  if (rawAffectedElement.protectionObserver) {
    // style is already applied and protected by the observer
    return;
  }

  let affectedElement;

  if (context.beforeStyleApplied) {
    if (!isIAffectedElement(rawAffectedElement)) {
      throw new Error("Returned IAffectedElement should have 'node' and 'rules' properties");
    }

    affectedElement = context.beforeStyleApplied(rawAffectedElement);

    if (!affectedElement) {
      throw new Error("Callback 'beforeStyleApplied' should return IAffectedElement");
    }
  } else {
    affectedElement = rawAffectedElement;
  }

  if (!isAffectedElement(affectedElement)) {
    throw new Error("Returned IAffectedElement should have 'node' and 'rules' properties");
  }

  const {
    node,
    rules
  } = affectedElement;

  for (let i = 0; i < rules.length; i += 1) {
    const rule = rules[i];
    const selector = rule === null || rule === void 0 ? void 0 : rule.selector;
    const style = rule === null || rule === void 0 ? void 0 : rule.style;
    const debug = rule === null || rule === void 0 ? void 0 : rule.debug; // rule may not have style to apply
    // e.g. 'div:has(> a) { debug: true }' -> means no style to apply, and enable debug mode

    if (style) {
      if (style[REMOVE_PSEUDO_MARKER] === PSEUDO_PROPERTY_POSITIVE_VALUE) {
        removeElement(context, affectedElement);
        return;
      }

      setStyleToElement(node, style);
    } else if (!debug) {
      // but rule should not have both style and debug properties
      throw new Error(`No style declaration in rule for selector: '${selector}'`);
    }
  }
};
/**
 * Reverts style for the affected object.
 *
 * @param affectedElement Affected element.
 */

const revertStyle = affectedElement => {
  if (affectedElement.protectionObserver) {
    affectedElement.protectionObserver.disconnect();
  }

  affectedElement.node.style.cssText = affectedElement.originalStyle;
};

/**
 * ExtMutationObserver is a wrapper over regular MutationObserver with one additional function:
 * it keeps track of the number of times we called the "ProtectionCallback".
 *
 * We use an instance of this to monitor styles added by ExtendedCss
 * and to make sure these styles are recovered if the page script attempts to modify them.
 *
 * However, we want to avoid endless loops of modification if the page script repeatedly modifies the styles.
 * So we keep track of the number of calls and observe() makes a decision
 * whether to continue recovering the styles or not.
 */

class ExtMutationObserver {
  /**
   * Extra property for keeping 'style fix counts'.
   */

  /**
   * Creates new ExtMutationObserver.
   *
   * @param protectionCallback Callback which execution should be counted.
   */
  constructor(protectionCallback) {
    this.styleProtectionCount = 0;
    this.observer = new natives.MutationObserver(mutations => {
      if (!mutations.length) {
        return;
      }

      this.styleProtectionCount += 1;
      protectionCallback(mutations, this);
    });
  }
  /**
   * Starts to observe target element,
   * prevents infinite loop of observing due to the limited number of times of callback runs.
   *
   * @param target Target to observe.
   * @param options Mutation observer options.
   */


  observe(target, options) {
    if (this.styleProtectionCount < MAX_STYLE_PROTECTION_COUNT) {
      this.observer.observe(target, options);
    } else {
      logger.error('ExtendedCss: infinite loop protection for style');
    }
  }
  /**
   * Stops ExtMutationObserver from observing any mutations.
   * Until the `observe()` is used again, `protectionCallback` will not be invoked.
   */


  disconnect() {
    this.observer.disconnect();
  }

}

const PROTECTION_OBSERVER_OPTIONS = {
  attributes: true,
  attributeOldValue: true,
  attributeFilter: ['style']
};
/**
 * Creates MutationObserver protection callback.
 *
 * @param styles Styles data object.
 *
 * @returns Callback for styles protection.
 */

const createProtectionCallback = styles => {
  const protectionCallback = (mutations, extObserver) => {
    if (!mutations[0]) {
      return;
    }

    const {
      target
    } = mutations[0];
    extObserver.disconnect();
    styles.forEach(style => {
      setStyleToElement(target, style);
    });
    extObserver.observe(target, PROTECTION_OBSERVER_OPTIONS);
  };

  return protectionCallback;
};
/**
 * Sets up a MutationObserver which protects style attributes from changes.
 *
 * @param node DOM node.
 * @param rules Rule data objects.
 * @returns Mutation observer used to protect attribute or null if there's nothing to protect.
 */


const protectStyleAttribute = (node, rules) => {
  if (!natives.MutationObserver) {
    return null;
  }

  const styles = [];
  rules.forEach(ruleData => {
    const {
      style
    } = ruleData; // some rules might have only debug property in style declaration
    // e.g. 'div:has(> a) { debug: true }' -> parsed to boolean `ruleData.debug`
    // so no style is fine, and here we should collect only valid styles to protect

    if (style) {
      styles.push(style);
    }
  });
  const protectionObserver = new ExtMutationObserver(createProtectionCallback(styles));
  protectionObserver.observe(node, PROTECTION_OBSERVER_OPTIONS);
  return protectionObserver;
};

const STATS_DECIMAL_DIGITS_COUNT = 4;

/**
 * A helper class for applied rule stats.
 */
class TimingStats {
  /**
   * Creates new TimingStats.
   */
  constructor() {
    this.appliesTimings = [];
    this.appliesCount = 0;
    this.timingsSum = 0;
    this.meanTiming = 0;
    this.squaredSum = 0;
    this.standardDeviation = 0;
  }
  /**
   * Observe target element and mark observer as active.
   *
   * @param elapsedTimeMs Time in ms.
   */


  push(elapsedTimeMs) {
    this.appliesTimings.push(elapsedTimeMs);
    this.appliesCount += 1;
    this.timingsSum += elapsedTimeMs;
    this.meanTiming = this.timingsSum / this.appliesCount;
    this.squaredSum += elapsedTimeMs * elapsedTimeMs;
    this.standardDeviation = Math.sqrt(this.squaredSum / this.appliesCount - Math.pow(this.meanTiming, 2));
  }

}

/**
 * Makes the timestamps more readable.
 *
 * @param timestamp Raw timestamp.
 *
 * @returns Fine-looking timestamps.
 */
const beautifyTimingNumber = timestamp => {
  return Number(timestamp.toFixed(STATS_DECIMAL_DIGITS_COUNT));
};
/**
 * Improves timing stats readability.
 *
 * @param rawTimings Collected timings with raw timestamp.
 *
 * @returns Fine-looking timing stats.
 */


const beautifyTimings = rawTimings => {
  return {
    appliesTimings: rawTimings.appliesTimings.map(t => beautifyTimingNumber(t)),
    appliesCount: beautifyTimingNumber(rawTimings.appliesCount),
    timingsSum: beautifyTimingNumber(rawTimings.timingsSum),
    meanTiming: beautifyTimingNumber(rawTimings.meanTiming),
    standardDeviation: beautifyTimingNumber(rawTimings.standardDeviation)
  };
};
/**
 * Prints timing information if debugging mode is enabled.
 *
 * @param context ExtendedCss context.
 */


const printTimingInfo = context => {
  if (context.areTimingsPrinted) {
    return;
  }

  context.areTimingsPrinted = true;
  const timingsLogData = {};
  context.parsedRules.forEach(ruleData => {
    if (ruleData.timingStats) {
      const {
        selector,
        style,
        debug,
        matchedElements
      } = ruleData; // style declaration for some rules is parsed to debug property and no style to apply
      // e.g. 'div:has(> a) { debug: true }'

      if (!style && !debug) {
        throw new Error(`Rule should have style declaration for selector: '${selector}'`);
      }

      const selectorData = {
        selectorParsed: selector,
        timings: beautifyTimings(ruleData.timingStats)
      }; // `ruleData.style` may contain `remove` pseudo-property
      // and make logs look better

      if (style && style[REMOVE_PSEUDO_MARKER] === PSEUDO_PROPERTY_POSITIVE_VALUE) {
        selectorData.removed = true; // no matchedElements for such case as they are removed after ExtendedCss applied
      } else {
        selectorData.styleApplied = style || null;
        selectorData.matchedElements = matchedElements;
      }

      timingsLogData[selector] = selectorData;
    }
  });

  if (Object.keys(timingsLogData).length === 0) {
    return;
  } // add location.href to the message to distinguish frames


  logger.info('[ExtendedCss] Timings in milliseconds for %o:\n%o', window.location.href, timingsLogData);
};

/**
 * Finds affectedElement object for the specified DOM node.
 *
 * @param affElements Array of affected elements — context.affectedElements.
 * @param domNode DOM node.
 * @returns Found affectedElement or undefined.
 */

const findAffectedElement = (affElements, domNode) => {
  return affElements.find(affEl => affEl.node === domNode);
};
/**
 * Applies specified rule and returns list of elements affected.
 *
 * @param context ExtendedCss context.
 * @param ruleData Rule to apply.
 * @returns List of elements affected by the rule.
 */


const applyRule = (context, ruleData) => {
  // debugging mode can be enabled in two ways:
  // 1. for separate rules - by `{ debug: true; }`
  // 2. for all rules simultaneously by:
  //   - `{ debug: global; }` in any rule
  //   - positive `debug` property in ExtCssConfiguration
  const isDebuggingMode = !!ruleData.debug || context.debug;
  let startTime;

  if (isDebuggingMode) {
    startTime = performance.now();
  }

  const {
    ast
  } = ruleData;
  const nodes = []; // selector can be successfully parser into ast with no error
  // but its applying by native Document.querySelectorAll() still may throw an error
  // e.g. 'div[..banner]'

  try {
    nodes.push(...selectElementsByAst(ast));
  } catch (e) {
    // log the error only in debug mode
    if (context.debug) {
      logger.error(getErrorMessage(e));
    }
  }

  nodes.forEach(node => {
    let affectedElement = findAffectedElement(context.affectedElements, node);

    if (affectedElement) {
      affectedElement.rules.push(ruleData);
      applyStyle(context, affectedElement);
    } else {
      // Applying style first time
      const originalStyle = node.style.cssText;
      affectedElement = {
        node,
        // affected DOM node
        rules: [ruleData],
        // rule to be applied
        originalStyle,
        // original node style
        protectionObserver: null // style attribute observer

      };
      applyStyle(context, affectedElement);
      context.affectedElements.push(affectedElement);
    }
  });

  if (isDebuggingMode && startTime) {
    const elapsedTimeMs = performance.now() - startTime;

    if (!ruleData.timingStats) {
      ruleData.timingStats = new TimingStats();
    }

    ruleData.timingStats.push(elapsedTimeMs);
  }

  return nodes;
};
/**
 * Applies filtering rules.
 *
 * @param context ExtendedCss context.
 */


const applyRules = context => {
  const newSelectedElements = []; // some rules could make call - selector.querySelectorAll() temporarily to change node id attribute
  // this caused MutationObserver to call recursively
  // https://github.com/AdguardTeam/ExtendedCss/issues/81

  disconnectDocument(context);
  context.parsedRules.forEach(ruleData => {
    const nodes = applyRule(context, ruleData);
    Array.prototype.push.apply(newSelectedElements, nodes); // save matched elements to ruleData as linked to applied rule
    // only for debugging purposes

    if (ruleData.debug) {
      ruleData.matchedElements = nodes;
    }
  }); // Now revert styles for elements which are no more affected

  let affLength = context.affectedElements.length; // do nothing if there is no elements to process

  while (affLength) {
    const affectedElement = context.affectedElements[affLength - 1];

    if (!affectedElement) {
      break;
    }

    if (!newSelectedElements.includes(affectedElement.node)) {
      // Time to revert style
      revertStyle(affectedElement);
      context.affectedElements.splice(affLength - 1, 1);
    } else if (!affectedElement.removed) {
      // Add style protection observer
      // Protect "style" attribute from changes
      if (!affectedElement.protectionObserver) {
        affectedElement.protectionObserver = protectStyleAttribute(affectedElement.node, affectedElement.rules);
      }
    }

    affLength -= 1;
  } // After styles are applied we can start observe again


  observeDocument(context);
  printTimingInfo(context);
};

/**
 * Result of selector validation.
 */

/**
 * Main class of ExtendedCss lib.
 *
 * Parses css stylesheet with any selectors (passed to its argument as styleSheet),
 * and guarantee its applying as mutation observer is used to prevent the restyling of needed elements by other scripts.
 * This style protection is limited to 50 times to avoid infinite loop (MAX_STYLE_PROTECTION_COUNT).
 * Our own ThrottleWrapper is used for styles applying to avoid too often lib reactions on page mutations.
 *
 * Constructor creates the instance of class which should be run be `apply()` method to apply the rules,
 * and the applying can be stopped by `dispose()`.
 *
 * Can be used to select page elements by selector with `query()` method (similar to `Document.querySelectorAll()`),
 * which does not require instance creating.
 */
class ExtendedCss {
  /**
   * Creates new ExtendedCss.
   *
   * @param configuration ExtendedCss configuration.
   */
  constructor(configuration) {
    if (!configuration) {
      throw new Error('ExtendedCss configuration should be provided.');
    }

    this.applyRulesCallbackListener = this.applyRulesCallbackListener.bind(this);
    this.context = {
      beforeStyleApplied: configuration.beforeStyleApplied,
      debug: false,
      affectedElements: [],
      isDomObserved: false,
      removalsStatistic: {},
      parsedRules: [],
      scheduler: new ThrottleWrapper(this.applyRulesCallbackListener)
    }; // TODO: throw an error instead of logging and handle it in related products.

    if (!isBrowserSupported()) {
      logger.error('Browser is not supported by ExtendedCss');
      return;
    } // at least 'styleSheet' or 'cssRules' should be provided


    if (!configuration.styleSheet && !configuration.cssRules) {
      throw new Error("ExtendedCss configuration should have 'styleSheet' or 'cssRules' defined.");
    } // 'styleSheet' and 'cssRules' are optional
    // and both can be provided at the same time
    // so both should be parsed and applied in such case


    if (configuration.styleSheet) {
      // stylesheet parsing can fail on some invalid selectors
      try {
        this.context.parsedRules.push(...parseStylesheet(configuration.styleSheet, extCssDocument));
      } catch (e) {
        // eslint-disable-next-line max-len
        throw new Error(`Pass the rules as configuration.cssRules since configuration.styleSheet cannot be parsed because of: '${getErrorMessage(e)}'`);
      }
    }

    if (configuration.cssRules) {
      this.context.parsedRules.push(...parseRules(configuration.cssRules, extCssDocument));
    } // true if set in configuration
    // or any rule in styleSheet has `debug: global`


    this.context.debug = configuration.debug || this.context.parsedRules.some(ruleData => {
      return ruleData.debug === DEBUG_PSEUDO_PROPERTY_GLOBAL_VALUE;
    });

    if (this.context.beforeStyleApplied && typeof this.context.beforeStyleApplied !== 'function') {
      // eslint-disable-next-line max-len
      throw new Error(`Invalid configuration. Type of 'beforeStyleApplied' should be a function, received: '${typeof this.context.beforeStyleApplied}'`);
    }
  }
  /**
   * Invokes {@link applyRules} function with current app context.
   * 
   * This method is bound to the class instance in the constructor because it is called
   * in {@link ThrottleWrapper} and on the DOMContentLoaded event.
   */


  applyRulesCallbackListener() {
    applyRules(this.context);
  }
  /**
   * Initializes ExtendedCss.
   *
   * Should be executed on page ASAP,
   * otherwise the :contains() pseudo-class may work incorrectly.
   */


  init() {
    /**
     * Native Node textContent getter must be intercepted as soon as possible,
     * and stored as it is needed for proper work of :contains() pseudo-class
     * because DOM Node prototype 'textContent' property may be mocked.
     *
     * @see {@link https://github.com/AdguardTeam/ExtendedCss/issues/127}
     */
    nativeTextContent.setGetter();
  }
  /**
   * Applies stylesheet rules on page.
   */


  apply() {
    applyRules(this.context);

    if (document.readyState !== 'complete') {
      document.addEventListener('DOMContentLoaded', this.applyRulesCallbackListener, false);
    }
  }
  /**
   * Disposes ExtendedCss and removes our styles from matched elements.
   */


  dispose() {
    disconnectDocument(this.context);
    this.context.affectedElements.forEach(el => {
      revertStyle(el);
    });
    document.removeEventListener('DOMContentLoaded', this.applyRulesCallbackListener, false);
  }
  /**
   * Exposed for testing purposes only.
   *
   * @returns Array of AffectedElement data objects.
   */


  getAffectedElements() {
    return this.context.affectedElements;
  }
  /**
   * Returns a list of the document's elements that match the specified selector.
   * Uses ExtCssDocument.querySelectorAll().
   *
   * @param selector Selector text.
   * @param [noTiming=true] If true — do not print the timings to the console.
   *
   * @throws An error if selector is not valid.
   * @returns A list of elements that match the selector.
   */


  static query(selector) {
    let noTiming = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;

    if (typeof selector !== 'string') {
      throw new Error('Selector should be defined as a string.');
    }

    const start = performance.now();

    try {
      return extCssDocument.querySelectorAll(selector);
    } finally {
      const end = performance.now();

      if (!noTiming) {
        logger.info(`[ExtendedCss] Elapsed: ${Math.round((end - start) * 1000)} μs.`);
      }
    }
  }
  /**
   * Validates selector.
   *
   * @param inputSelector Selector text to validate.
   *
   * @returns Result of selector validation.
   */


  static validate(inputSelector) {
    try {
      // ExtendedCss in general supports :remove() in selector
      // but ExtendedCss.query() does not support it as it should be parsed by stylesheet parser.
      // so for validation we have to handle selectors with `:remove()` in it
      const {
        selector
      } = parseRemoveSelector(inputSelector);
      ExtendedCss.query(selector);
      return {
        ok: true,
        error: null
      };
    } catch (e) {
      // not valid input `selector` should be logged eventually
      const error = `Error: Invalid selector: '${inputSelector}' -- ${getErrorMessage(e)}`;
      return {
        ok: false,
        error
      };
    }
  }

}



;// CONCATENATED MODULE: ./node_modules/.pnpm/@adguard+tswebextension@2.4.0-alpha.11_@adguard+re2-wasm@1.2.0/node_modules/@adguard/tswebextension/dist/content-script.mv3.js




/**
 * @file
 * This file contains constants for communication between background and content scripts.
 * This constants are separated from message.ts to reduce bundle size,
 * because rollup cannot tree-shake tswebextension library code.
 */
/**
 * Name of the message handler.
 * It is needed for determining specific tswebextension message from other messages.
 */
const MESSAGE_HANDLER_NAME = 'tsWebExtension';
/**
 * Message types for communication between background and content scripts.
 */
var MessageType;
(function (MessageType) {
    MessageType["ProcessShouldCollapse"] = "processShouldCollapse";
    MessageType["GetCosmeticData"] = "getCosmeticData";
    MessageType["GetCookieRules"] = "getCookieRules";
    MessageType["SaveCookieLogEvent"] = "saveCookieLogEvent";
    MessageType["InitAssistant"] = "initAssistant";
    MessageType["CloseAssistant"] = "closeAssistant";
    MessageType["AssistantCreateRule"] = "assistantCreateRule";
    MessageType["SaveCssHitsStats"] = "saveCssHitsStats";
})(MessageType || (MessageType = {}));

// TODO check if we can return typed message here
/**
 * Sends message to the background page.
 *
 * @param message Message to send.
 * @param message.payload Payload of the message.
 * @param message.type Message type.
 *
 * @returns Promise resolved with response from the background page.
 */
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const sendAppMessage = async (message) => {
    return browser_polyfill_default().runtime.sendMessage({ handlerName: MESSAGE_HANDLER_NAME, ...message });
};

/**
 * This class applies cookie rules in page context.
 *
 * - Removes cookies matching rules
 * - Listens to new cookies, then tries to apply rules to them.
 */
let CookieController$1 = class CookieController {
    /**
     * Default cookie polling interval.
     */
    DEFAULT_COOKIE_POLLING_INTERVAL_MS = 1000;
    /**
     * On rule applied callback.
     */
    onRuleAppliedCallback;
    /**
     * Is current context third-party.
     */
    isThirdPartyContext = false;
    /**
     * Constructor.
     *
     * @param callback On rule applied callback.
     */
    constructor(callback) {
        this.onRuleAppliedCallback = callback;
        this.isThirdPartyContext = this.isThirdPartyFrame();
    }
    /**
     * Applies rules.
     *
     * @param rules Rules to apply.
     */
    apply(rules) {
        this.applyRules(rules);
        let lastCookie = document.cookie;
        this.listenCookieChange((oldValue, newValue) => {
            if (newValue === lastCookie) {
                // Skip changes made by this class
                return;
            }
            this.applyRules(rules);
            lastCookie = document.cookie;
        });
        window.addEventListener('beforeunload', () => {
            this.applyRules(rules);
        });
    }
    /**
     * Polling document cookie.
     *
     * @param callback Callback to be called periodically.
     * @param interval Polling interval.
     */
    listenCookieChange(callback, interval = this.DEFAULT_COOKIE_POLLING_INTERVAL_MS) {
        let lastCookie = document.cookie;
        setInterval(() => {
            const { cookie } = document;
            if (cookie !== lastCookie) {
                try {
                    callback(lastCookie, cookie);
                }
                finally {
                    lastCookie = cookie;
                }
            }
        }, interval);
    }
    /**
     * Checks if current context is third-party.
     *
     * @returns True if current context is third-party.
     */
    // eslint-disable-next-line class-methods-use-this
    isThirdPartyFrame() {
        try {
            return window.self !== window.top && document.location.hostname !== window.parent.location.hostname;
        }
        catch (e) {
            return true;
        }
    }
    /**
     * Applies rules to document cookies.
     *
     * @param rules Rules to apply.
     *
     * Inspired by remove-cookie scriptlet.
     * @see {@link https://github.com/AdguardTeam/Scriptlets/blob/master/src/scriptlets/remove-cookie.js}
     */
    applyRules(rules) {
        document.cookie.split(';').forEach((cookieStr) => {
            const pos = cookieStr.indexOf('=');
            if (pos === -1) {
                return;
            }
            const cookieName = cookieStr.slice(0, pos).trim();
            const cookieValue = cookieStr.slice(pos + 1).trim();
            const matchingRules = rules.filter((r) => {
                if (this.isThirdPartyContext !== r.isThirdParty) {
                    return false;
                }
                const regex = r.match ? CookieController.toRegExp(r.match) : CookieController.toRegExp('/.?/');
                return regex.test(cookieName);
            });
            const importantRules = matchingRules.filter((r) => r.isImportant);
            if (importantRules.length > 0) {
                importantRules.forEach((rule) => {
                    this.applyRule(rule, cookieName, cookieValue);
                });
            }
            else {
                const allowlistRules = matchingRules.filter((r) => r.isAllowlist);
                if (allowlistRules.length > 0) {
                    allowlistRules.forEach((rule) => {
                        this.applyRule(rule, cookieName, cookieValue);
                    });
                }
                else {
                    matchingRules.forEach((rule) => {
                        this.applyRule(rule, cookieName, cookieValue);
                    });
                }
            }
        });
    }
    /**
     * Applies rule.
     *
     * @param rule Rule to apply.
     * @param cookieName Cookie name.
     * @param cookieValue Cookie value.
     */
    applyRule(rule, cookieName, cookieValue) {
        if (!rule.isAllowlist) {
            const hostParts = document.location.hostname.split('.');
            for (let i = 0; i <= hostParts.length - 1; i += 1) {
                const hostName = hostParts.slice(i).join('.');
                if (hostName) {
                    CookieController.removeCookieFromHost(cookieName, hostName);
                }
            }
        }
        this.onRuleAppliedCallback({
            cookieName,
            cookieValue,
            cookieDomain: document.location.hostname,
            thirdParty: rule.isThirdParty,
            filterId: rule.filterId,
            ruleIndex: rule.ruleIndex,
            isAllowlist: rule.isAllowlist,
            isImportant: rule.isImportant,
            isDocumentLevel: rule.isDocumentLevel,
            isCsp: false,
            isCookie: true,
            advancedModifier: null,
        });
    }
    /**
     * Removes cookie for host.
     *
     * @param cookieName Cookie name.
     * @param hostName Host name.
     */
    static removeCookieFromHost(cookieName, hostName) {
        const cookieSpec = `${cookieName}=`;
        const domain1 = `; domain=${hostName}`;
        const domain2 = `; domain=.${hostName}`;
        const path = '; path=/';
        const expiration = '; expires=Thu, 01 Jan 1970 00:00:00 GMT';
        document.cookie = cookieSpec + expiration;
        document.cookie = cookieSpec + domain1 + expiration;
        document.cookie = cookieSpec + domain2 + expiration;
        document.cookie = cookieSpec + path + expiration;
        document.cookie = cookieSpec + domain1 + path + expiration;
        document.cookie = cookieSpec + domain2 + path + expiration;
    }
    /**
     * Converts cookie rule match to regular expression.
     *
     * @param str String to convert.
     * @returns Regular expression.
     */
    static toRegExp(str) {
        if (str[0] === '/' && str[str.length - 1] === '/') {
            return new RegExp(str.slice(1, -1));
        }
        const escaped = str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
        return new RegExp(`^${escaped}$`);
    }
};

/**
 * This class applies cookie rules in page context.
 *
 * Steps:
 * - content script requests matching cookie rules for the frame
 *   (in which this script is executed)
 * - service returns matching set of rules data to content script
 * - the rules are applied with {@link CookieController}
 * - filtering log receives callback with applied rules data.
 *
 * The important point is: there is no way to run cookie controller script via
 * browser.tabs.executeScript cause one only could be executed for all frames or
 * main frame only. But it's not correct cause there should be different rules
 * for each frame.
 */
class CookieController {
    /**
     * Retry timeout for {@link MessageType.GetCookieRules} request to background in milliseconds.
     */
    static GET_COOKIE_RULES_RETRY_TIMEOUT_MS = 100;
    /**
     * Max {@link MessageType.GetCookieRules} request limit.
     */
    static MAX_GET_COOKIE_RULES_TRIES = 200;
    /**
     * Number of {@link MessageType.GetCookieRules} requests.
     */
    tries = 0;
    /**
     * Creates new {@link CookieController} instance.
     */
    constructor() {
        this.process = this.process.bind(this);
    }
    /**
     * Init cookie rules processing.
     */
    init() {
        this.process();
    }
    /**
     * Sends {@link MessageType.GetCosmeticData} message to background and process response.
     */
    async process() {
        const response = await sendAppMessage({
            type: MessageType.GetCookieRules,
            payload: {
                documentUrl: document.location.href,
            },
        });
        if (response) {
            this.applyCookieRules(response);
        }
    }
    /**
     * Process {@link MessageType.ContentScriptCookieRulesData} response from background.
     *
     * If {@link response.isAppStarted} is false, retry
     * request after {@link GET_COOKIE_RULES_RETRY_TIMEOUT_MS} milliseconds.
     * Else apply cookie rules from {@link response.cookieRules}.
     *
     * @param response Response cookie rules data from background.
     */
    applyCookieRules = async (response) => {
        const { isAppStarted, cookieRules } = response;
        if (!isAppStarted && this.tries <= CookieController.MAX_GET_COOKIE_RULES_TRIES) {
            this.tries += 1;
            setTimeout(this.process, CookieController.GET_COOKIE_RULES_RETRY_TIMEOUT_MS);
            return;
        }
        if (!response || cookieRules === undefined || cookieRules.length === 0) {
            return;
        }
        try {
            const onRuleApplied = (data) => {
                sendAppMessage({
                    type: MessageType.SaveCookieLogEvent,
                    payload: data,
                });
            };
            const cookieController = new CookieController$1(onRuleApplied);
            cookieController.apply(cookieRules);
        }
        catch (e) {
            // eslint-disable-next-line no-console
            console.error(e);
            /**
             * Content script injected on in every frame, but document cookie API in
             * iframes can be blocked by website CSP policy. We ignore this cases.
             * Content script matching defined in browser extension.
             * TODO: move error handling to it.
             */
        }
    };
}

function content_script_mv3_isErrorWithMessage(error) {
    return (typeof error === 'object'
        && error !== null
        && 'message' in error
        && typeof error.message === 'string');
}
function content_script_mv3_toErrorWithMessage(maybeError) {
    if (content_script_mv3_isErrorWithMessage(maybeError)) {
        return maybeError;
    }
    try {
        return new Error(JSON.stringify(maybeError));
    }
    catch {
        return new Error(String(maybeError));
    }
}
function content_script_mv3_getErrorMessage(error) {
    return content_script_mv3_toErrorWithMessage(error).message;
}
const pad = (num, size = 2) => {
    return num.toString().padStart(size, '0');
};
const formatTime = (date) => {
    const d = (date instanceof Date) ? date : new Date(date);
    const year = d.getFullYear();
    const month = pad(d.getMonth() + 1);
    const day = pad(d.getDate());
    const hour = pad(d.getHours());
    const minute = pad(d.getMinutes());
    const second = pad(d.getSeconds());
    const millisecond = pad(d.getMilliseconds(), 3);
    return `${year}-${month}-${day}T${hour}:${minute}:${second}:${millisecond}`;
};
var LogLevel;
(function (LogLevel) {
    LogLevel["Error"] = "error";
    LogLevel["Warn"] = "warn";
    LogLevel["Info"] = "info";
    LogLevel["Debug"] = "debug";
    LogLevel["Trace"] = "trace";
})(LogLevel || (LogLevel = {}));
const levelMapNumToString = {
    [1 ]: LogLevel.Error,
    [2 ]: LogLevel.Warn,
    [3 ]: LogLevel.Info,
    [4 ]: LogLevel.Debug,
    [5 ]: LogLevel.Trace,
};
const levelMapStringToNum = Object.entries(levelMapNumToString)
    .reduce((acc, [key, value]) => {
    const numericKey = Number(key);
    if (!Number.isNaN(numericKey)) {
        acc[value] = numericKey;
    }
    return acc;
}, {});
class Logger {
    currentLevelValue = 3 ;
    writer;
    constructor(writer = console) {
        this.writer = writer;
        this.debug = this.debug.bind(this);
        this.info = this.info.bind(this);
        this.warn = this.warn.bind(this);
        this.error = this.error.bind(this);
    }
    debug(...args) {
        this.print(4 , "log" , args);
    }
    info(...args) {
        this.print(3 , "info" , args);
    }
    warn(...args) {
        this.print(2 , "info" , args);
    }
    error(...args) {
        this.print(1 , "error" , args);
    }
    get currentLevel() {
        return levelMapNumToString[this.currentLevelValue];
    }
    set currentLevel(logLevel) {
        const level = levelMapStringToNum[logLevel];
        if (level === undefined) {
            throw new Error(`Logger supports only the following levels: ${[Object.values(LogLevel).join(', ')]}`);
        }
        this.currentLevelValue = level;
    }
    static errorToString(error) {
        const message = content_script_mv3_getErrorMessage(error);
        return `${message}\nStack trace:\n${error.stack}`;
    }
    print(level, method, args) {
        if (this.currentLevelValue < level) {
            return;
        }
        if (!args || args.length === 0 || !args[0]) {
            return;
        }
        const formattedArgs = args.map((value) => {
            if (value instanceof Error) {
                return Logger.errorToString(value);
            }
            if (value && typeof value.message === 'string') {
                return value.message;
            }
            if (typeof value === 'object' && value !== null) {
                return JSON.stringify(value);
            }
            return String(value);
        });
        const formattedTime = `${formatTime(new Date())}:`;
        if (method === "error"
            || this.currentLevelValue < levelMapStringToNum[LogLevel.Trace]
            || !this.writer.trace) {
            this.writer[method](formattedTime, ...formattedArgs);
            return;
        }
        if (!this.writer.groupCollapsed || !this.writer.groupEnd) {
            this.writer.trace(formattedTime, ...formattedArgs);
            return;
        }
        this.writer.groupCollapsed(formattedTime, ...formattedArgs);
        this.writer.trace();
        this.writer.groupEnd();
    }
}

/**
 * Export logger implementation.
 */
const content_script_mv3_logger = new Logger(console);

// Simple type guard for message object with 'type' field.
// Added to no bring here huge zod library.
const hasTypeField = (message) => {
    return typeof message === 'object' && message !== null && 'type' in message;
};
/**
 * Initializes assistant object.
 */
const initAssistant = () => {
    // Check, that script executed in the top frame
    if (window.top !== window || !(document.documentElement instanceof HTMLElement)) {
        return;
    }
    let assistant;
    browser_polyfill_default().runtime.onMessage.addListener((message, sender, sendResponse) => {
        if (!hasTypeField(message)) {
            return;
        }
        switch (message.type) {
            case MessageType.InitAssistant: {
                if (typeof assistant === 'undefined') {
                    assistant = (0,dist_assistant.adguardAssistant)();
                }
                else {
                    assistant.close();
                }
                assistant.start(null, async (ruleText) => {
                    const res = await sendAppMessage({
                        type: MessageType.AssistantCreateRule,
                        payload: { ruleText },
                    });
                    if (!res) {
                        content_script_mv3_logger.debug(`[tswebextension.initAssistant]: rule '${ruleText}' has not been applied.`);
                    }
                });
                sendResponse(true);
                break;
            }
            case MessageType.CloseAssistant: {
                if (assistant) {
                    assistant.close();
                    sendResponse(true);
                }
                break;
            }
            default: {
                content_script_mv3_logger.debug(`[tswebextension.initAssistant]: not found handler for message type '${message.type}'`);
                sendResponse(false);
            }
        }
    });
};

// TODO remove the comment turning off the rule
/* eslint-disable @typescript-eslint/no-explicit-any */
/**
 * This storage is used to keep track of counted rules received from node elements.
 */
class HitsStorage {
    /**
     * Start count number.
     */
    counter = 0;
    /**
     * Storage random identificator.
     */
    randomKey = HitsStorage.generateRandomKey();
    /**
     * Map storage.
     */
    map = new Map();
    /**
     * Checks if element is counted.
     *
     * @param element Html element.
     * @param rule Rule text.
     *
     * @returns True if element is counted.
     */
    isCounted(element, rule) {
        const hitAddress = element[this.randomKey];
        if (hitAddress) {
            const countedHit = this.map.get(hitAddress);
            if (countedHit) {
                return countedHit.element === element && countedHit.rule === rule;
            }
        }
        return false;
    }
    /**
     * Stores rule-element info in storage.
     *
     * @param element Html element.
     * @param rule Rule text.
     */
    setCounted(element, rule) {
        const counter = this.getCounter();
        // eslint-disable-next-line no-param-reassign
        element[this.randomKey] = counter;
        this.map.set(counter, { element, rule });
    }
    /**
     * Returns current counter value and increments it.
     *
     * @returns Count number.
     */
    getCounter() {
        this.counter += 1;
        return this.counter;
    }
    // TODO replace with nanoid
    /**
     * Random id generator.
     *
     * @returns Random key with 10 characters length.
     */
    static generateRandomKey() {
        const keyLength = 10;
        const possibleValues = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
        let result = '';
        for (let i = 0; i < keyLength; i += 1) {
            result += possibleValues.charAt(Math.floor(Math.random() * possibleValues.length));
        }
        return result;
    }
}

/**
 * Utils class.
 */
class ElementUtils {
    /**
     * Serialize HTML element.
     *
     * @param element Element to serialize.
     *
     * @returns String representation of the element.
     */
    static elementToString(element) {
        const s = [];
        s.push('<');
        s.push(element.localName);
        const { attributes } = element;
        for (let i = 0; i < attributes.length; i += 1) {
            const attr = attributes[i];
            s.push(' ');
            s.push(attr.name);
            s.push('="');
            const value = attr.value === null ? '' : attr.value.replace(/"/g, '\\"');
            s.push(value);
            s.push('"');
        }
        s.push('>');
        return s.join('');
    }
    /**
     * Appends node children to the array.
     *
     * @param node Element whose children we would like to add.
     * @param arrayWithNodes Array where we add children.
     */
    static appendChildren(node, arrayWithNodes) {
        const children = node.querySelectorAll('*');
        if (children && children.length > 0) {
            for (let i = 0; i < children.length; i += 1) {
                arrayWithNodes.push(children[i]);
            }
        }
    }
    /**
     * Adds elements into array if they are not in the array yet.
     *
     * @param targetArray Array where we add elements.
     * @param sourceArray Array with elements.
     */
    static addUnique(targetArray, sourceArray) {
        if (sourceArray.length > 0) {
            for (let i = 0; i < sourceArray.length; i += 1) {
                const sourceElement = sourceArray[i];
                if (targetArray.indexOf(sourceElement) === -1) {
                    targetArray.push(sourceElement);
                }
            }
        }
    }
    /**
     * Removes all elements in array.
     *
     * @param elements Array with elements.
     */
    static removeElements(elements) {
        for (let i = 0; i < elements.length; i += 1) {
            const element = elements[i];
            element.remove();
        }
    }
    /**
     * Parses hits info from style content.
     *
     * @param content Style content.
     * @param attributeMarker Attribute marker.
     *
     * @returns Rule info or null.
     */
    static parseInfo(content, attributeMarker) {
        if (!content || content.indexOf(attributeMarker) < 0) {
            return null;
        }
        let filterIdAndRuleText = decodeURIComponent(content);
        // 'content' value may include open and close quotes.
        filterIdAndRuleText = ElementUtils.removeQuotes(filterIdAndRuleText);
        // Remove prefix
        filterIdAndRuleText = filterIdAndRuleText.substring(attributeMarker.length);
        // Attribute 'content' in css looks like: {content: 'adguard{filterId};{ruleIndex}'}
        const index = filterIdAndRuleText.indexOf(';');
        if (index < 0) {
            return null;
        }
        const filterId = Number.parseInt(filterIdAndRuleText.slice(0, index), 10);
        if (Number.isNaN(filterId)) {
            return null;
        }
        const ruleIndex = Number.parseInt(filterIdAndRuleText.slice(index + 1), 10);
        if (Number.isNaN(ruleIndex)) {
            return null;
        }
        return { filterId, ruleIndex };
    }
    /**
     * Parses hits info from style content.
     *
     * @param content Style.
     * @param attributeMarker Attribute marker.
     *
     * @returns Rule info or null.
     */
    static parseExtendedStyleInfo(content, attributeMarker) {
        const important = '!important';
        const indexOfImportant = content.lastIndexOf(important);
        if (indexOfImportant === -1) {
            return ElementUtils.parseInfo(content, attributeMarker);
        }
        const contentWithoutImportant = content.substring(0, indexOfImportant).trim();
        return ElementUtils.parseInfo(contentWithoutImportant, attributeMarker);
    }
    /**
     * Unquotes specified value.
     *
     * @param value Value to unquote.
     *
     * @returns Unquoted value.
     */
    static removeQuotes(value) {
        if (value.length > 1
            && ((value[0] === '"' && value[value.length - 1] === '"')
                || (value[0] === '\'' && value[value.length - 1] === '\''))) {
            // Remove double-quotes or single-quotes
            return value.substring(1, value.length - 1);
        }
        return value;
    }
}

const DEFAULT_ELEMENT_TO_STRING = true;
/**
 * Class represents collecting css style hits process.
 *
 * During applying css styles to element we add special 'content:' attribute
 *  e.g.: ".selector -> .selector { content: 'adguard{filterId};{ruleText} !important;}".
 * After the style is applied we parse this "content" attribute and call provided via constructor callback function.
 */
class CssHitsCounter {
    /**
     * We split CSS hits counting into smaller batches of elements and schedule them one by one using setTimeout.
     */
    static COUNT_CSS_HITS_BATCH_DELAY = 5;
    /**
     * Size of small batches of elements we count.
     */
    static CSS_HITS_BATCH_SIZE = 25;
    /**
     * In order to find elements hidden by AdGuard we look for a `:content` pseudo-class
     * with values starting with this prefix. Filter information will be
     * encoded in this value as well.
     */
    static CONTENT_ATTR_PREFIX = 'adguard';
    /**
     * We delay countAllCssHits function if it was called too frequently from mutationObserver.
     */
    static COUNT_ALL_CSS_HITS_TIMEOUT_MS = 500;
    /**
     * Callback function for counted css hits handling.
     */
    onCssHitsFoundCallback;
    /**
     * Hits storage.
     */
    hitsStorage = new HitsStorage();
    /**
     * Mutation observer.
     */
    observer = null;
    /**
     * Counting on process flag.
     */
    countIsWorking = false;
    /**
     * Flag determining if we should convert elements to string, or not.
     * @private
     */
    elementToString = DEFAULT_ELEMENT_TO_STRING;
    /**
     * This function prepares calculation of css hits.
     * We are waiting for 'load' event and start calculation.
     *
     * @param callback Which receives {@link ICountedElement} and handles counted css hits.
     * @param options CssHitsCounter options.
     */
    constructor(callback, options) {
        if (options) {
            const { elementToString } = options;
            this.elementToString = elementToString;
        }
        this.onCssHitsFoundCallback = callback;
        if (document.readyState === 'complete'
            || document.readyState === 'interactive') {
            this.countCssHits();
        }
        else {
            document.addEventListener('readystatechange', this.startCounter.bind(this));
        }
    }
    /**
     * Stops css hits counting process.
     */
    stop() {
        this.onCssHitsFoundCallback = () => { };
        if (this.observer) {
            this.observer.disconnect();
        }
    }
    /**
     * Callback used to collect statistics of elements affected by extended css rules.
     *
     * @param affectedEl Affected element.
     * @returns Affected element.
     */
    countAffectedByExtendedCss(affectedEl) {
        if (affectedEl && affectedEl.rules && affectedEl.rules.length > 0) {
            const result = [];
            for (const rule of affectedEl.rules) {
                if (rule.style && rule.style.content) {
                    const ruleInfo = ElementUtils.parseExtendedStyleInfo(rule.style.content, CssHitsCounter.CONTENT_ATTR_PREFIX);
                    if (ruleInfo === null) {
                        continue;
                    }
                    const { filterId, ruleIndex } = ruleInfo;
                    if (filterId !== undefined && ruleIndex !== undefined) {
                        const element = this.elementToString
                            ? ElementUtils.elementToString(affectedEl.node)
                            : affectedEl.node;
                        result.push({
                            filterId,
                            ruleIndex,
                            element,
                        });
                        // clear style content to avoid duplicate counting
                        rule.style.content = '';
                    }
                }
            }
            this.onCssHitsFoundCallback(result);
        }
        return affectedEl;
    }
    /**
     * Starts counting process.
     */
    startCounter() {
        if (document.readyState === 'interactive'
            || document.readyState === 'complete') {
            this.countCssHits();
            document.removeEventListener('readystatechange', this.startCounter);
        }
    }
    /**
     * Counts css hits.
     */
    countCssHits() {
        this.countAllCssHits();
        this.countCssHitsForMutations();
    }
    /**
     * Counts css hits for already affected elements.
     */
    countAllCssHits() {
        // we don't start counting again all css hits till previous count process wasn't finished
        if (this.countIsWorking) {
            return;
        }
        this.countIsWorking = true;
        const elements = document.querySelectorAll('*');
        this.countCssHitsBatch(elements, 0, CssHitsCounter.CSS_HITS_BATCH_SIZE, CssHitsCounter.CSS_HITS_BATCH_SIZE, [], (result) => {
            if (result.length > 0) {
                this.onCssHitsFoundCallback(result);
            }
            this.countIsWorking = false;
        });
    }
    /**
     * Main calculation function.
     * 1. Selects sub collection from elements.
     * 2. For each element from sub collection: retrieves calculated css 'content'
     * attribute and if it contains 'adguard'
     * marker then retrieves rule text and filter identifier.
     * 3. Starts next task with some delay.
     *
     * @param elements Collection of all elements.
     * @param start Start of batch.
     * @param end End of batch.
     * @param step Size of batch.
     * @param result Collection for save result.
     * @param callback Finish callback.
     */
    // eslint-disable-next-line max-len
    countCssHitsBatch(elements, start, end, step, result, callback) {
        const length = Math.min(end, elements.length);
        result = result.concat(this.countCssHitsForElements(elements, start, length));
        if (length === elements.length) {
            callback(result);
            return;
        }
        start = end;
        end += step;
        // Start next task with some delay
        window.setTimeout(() => {
            this.countCssHitsBatch(elements, start, end, step, result, callback);
        }, CssHitsCounter.COUNT_CSS_HITS_BATCH_DELAY);
    }
    /**
     * Counts css hits for array of elements.
     *
     * @param elements Array of elements.
     * @param start Start of batch.
     * @param length Length of batch.
     *
     * @returns Data with information about rule and element.
     */
    countCssHitsForElements(elements, start, length) {
        const RULE_FILTER_SEPARATOR = ';';
        start = start || 0;
        length = length || elements.length;
        const result = [];
        for (let i = start; i < length; i += 1) {
            const element = elements[i];
            const cssHitData = CssHitsCounter.getCssHitData(element);
            if (!cssHitData) {
                continue;
            }
            const { filterId, ruleIndex } = cssHitData;
            const ruleAndFilterString = filterId + RULE_FILTER_SEPARATOR + ruleIndex;
            if (this.hitsStorage.isCounted(element, ruleAndFilterString)) {
                continue;
            }
            this.hitsStorage.setCounted(element, ruleAndFilterString);
            result.push({
                filterId,
                ruleIndex,
                element: this.elementToString ? ElementUtils.elementToString(element) : element,
            });
        }
        return result;
    }
    /**
     * Counts css hits for mutations.
     */
    countCssHitsForMutations() {
        // eslint-disable-next-line prefer-destructuring
        const MutationObserver = window.MutationObserver;
        if (!MutationObserver) {
            return;
        }
        if (this.observer) {
            this.observer.disconnect();
        }
        /**
         * To avoid cases where two css hits counters try to append and remove the
         * same elements one after the other, we do not append already met nodes.
         */
        const probesWeakSet = new WeakSet();
        let timeoutId = null;
        this.observer = new MutationObserver(((mutationRecords) => {
            // Collect probe elements, count them, then remove from their targets
            const probeElements = [];
            const childrenOfProbeElements = [];
            const potentialProbeElements = [];
            mutationRecords.forEach((mutationRecord) => {
                if (mutationRecord.addedNodes.length === 0) {
                    return;
                }
                for (let i = 0; i < mutationRecord.addedNodes.length; i += 1) {
                    const node = mutationRecord.addedNodes[i];
                    if (!(node instanceof Element) || CssHitsCounter.isIgnoredNodeTag(node.tagName)) {
                        continue;
                    }
                    const { target } = mutationRecord;
                    if (!node.parentNode && target) {
                        // If this node has been appended to the DOM and counted once, do not add
                        // it again.
                        if (probesWeakSet.has(node)) {
                            return;
                        }
                        // Most likely this is a "probe" element that was added and then
                        // immediately removed from DOM.
                        // We re-add it and check if any rule matched it
                        probeElements.push(node);
                        // To ensure that this "probe" node has only been added once to the DOM,
                        // we add it to the weak set.
                        probesWeakSet.add(node);
                        // CSS rules could be applied to the nodes inside probe element
                        // that's why we get all child elements of added node
                        ElementUtils.appendChildren(node, childrenOfProbeElements);
                        if (this.observer) {
                            this.observer.disconnect();
                        }
                        mutationRecord.target.appendChild(node);
                    }
                    else if (node.parentNode && target) {
                        // Sometimes probe elements are appended to the DOM
                        potentialProbeElements.push(node);
                        ElementUtils.appendChildren(node, potentialProbeElements);
                    }
                }
            });
            // If the list of potential probe elements is relatively small,
            // we can count CSS hits immediately
            if (potentialProbeElements.length > 0
                && potentialProbeElements.length <= CssHitsCounter.CSS_HITS_BATCH_SIZE) {
                const result = this.countCssHitsForElements(potentialProbeElements, 0, null);
                if (result.length > 0) {
                    this.onCssHitsFoundCallback(result);
                }
            }
            const allProbeElements = [];
            ElementUtils.addUnique(allProbeElements, childrenOfProbeElements);
            ElementUtils.addUnique(allProbeElements, probeElements);
            if (allProbeElements.length > 0) {
                const result = this.countCssHitsForElements(allProbeElements, 0, null);
                if (result.length > 0) {
                    this.onCssHitsFoundCallback(result);
                }
                /**
                 * Don't remove child elements of probe elements
                 * https://github.com/AdguardTeam/AdguardBrowserExtension/issues/1096.
                 */
                ElementUtils.removeElements(probeElements);
                this.startObserver();
            }
            // debounce counting all css hits when mutation record fires
            if (timeoutId) {
                window.clearTimeout(timeoutId);
            }
            timeoutId = window.setTimeout(() => {
                this.countAllCssHits();
                window.clearTimeout(timeoutId);
            }, CssHitsCounter.COUNT_ALL_CSS_HITS_TIMEOUT_MS);
        }));
        this.startObserver();
    }
    /**
     * Starts mutation observer.
     */
    startObserver() {
        if (this.observer) {
            // TODO: Check, maybe we should observer for 'characterData' and
            // 'characterDataOldValue' like it was in the old extension code
            this.observer.observe(document.documentElement, {
                childList: true,
                subtree: true,
                attributes: true,
            });
        }
    }
    /**
     * Function retrieves css hits data from element style content attribute contains data injected with AdGuard.
     *
     * @param element Element to check.
     * @returns Rule info or null.
     */
    static getCssHitData(element) {
        const style = getComputedStyle(element);
        return ElementUtils.parseInfo(style.content, CssHitsCounter.CONTENT_ATTR_PREFIX);
    }
    /**
     * Checks if tag is ignored.
     *
     * @param nodeTag Tag name to check.
     * @returns True if tag is ignored.
     */
    static isIgnoredNodeTag(nodeTag) {
        const ignoredTags = ['script'];
        return ignoredTags.includes(nodeTag.toLowerCase());
    }
}

/**
 * This class applies cosmetic rules in page context.
 */
class CosmeticController {
    /**
     * Retry timeout for {@link MessageType.GetCosmeticData} request to background in milliseconds.
     */
    static GET_COSMETIC_DATA_RETRY_TIMEOUT_MS = 100;
    /**
     * Max {@link MessageType.GetCosmeticData} request limit.
     */
    static MAX_GET_COSMETIC_DATA_TRIES = 200;
    /**
     * Number of {@link MessageType.GetCosmeticData} requests.
     */
    tries = 0;
    /**
     * Module that collects statistics about the usage of CSS rules.
     */
    cssHitsCounter;
    /**
     * Creates new {@link CosmeticController} instance.
     */
    constructor() {
        this.process = this.process.bind(this);
        this.beforeStyleApplied = this.beforeStyleApplied.bind(this);
    }
    /**
     * Init cosmetic processing.
     */
    init() {
        this.process();
    }
    /**
     * Sends {@link MessageType.GetCosmeticData} message to background and process response.
     */
    async process() {
        const res = await sendAppMessage({
            type: MessageType.GetCosmeticData,
            payload: {
                documentUrl: window.location.href,
            },
        });
        if (res) {
            this.applyExtendedCss(res);
        }
    }
    /**
     * Process {@link MessageType.GetCosmeticData} response from background.
     *
     * If {@link cosmeticData.isAppStarted} is false, retry
     * request after {@link GET_COSMETIC_DATA_RETRY_TIMEOUT_MS} milliseconds.
     * Else apply extended css rules from {@link cosmeticData.extCssText}
     * and enable {@link CssHitsCounter} if {@link cosmeticData.areHitsStatsCollected} is true.
     *
     * @param cosmeticData Response cosmetic data from background.
     */
    applyExtendedCss(cosmeticData) {
        const { isAppStarted, extCssRules, areHitsStatsCollected, } = cosmeticData;
        if (!isAppStarted
            && this.tries <= CosmeticController.MAX_GET_COSMETIC_DATA_TRIES) {
            this.tries += 1;
            setTimeout(this.process, CosmeticController.GET_COSMETIC_DATA_RETRY_TIMEOUT_MS);
            return;
        }
        if (areHitsStatsCollected) {
            this.cssHitsCounter = CosmeticController.createCssHitsCounter();
        }
        if (!extCssRules || extCssRules.length === 0) {
            return;
        }
        const extendedCssConfig = {
            cssRules: extCssRules,
        };
        if (areHitsStatsCollected) {
            extendedCssConfig.beforeStyleApplied = this.beforeStyleApplied;
        }
        const extendedCss = new ExtendedCss(extendedCssConfig);
        extendedCss.apply();
    }
    /**
     * Preprocess {@link IAffectedElement} for {@link ExtendedCss} instance.
     *
     * @param el Record with required 'content' style property in rules.
     * @returns Affected element record.
     */
    beforeStyleApplied(el) {
        if (!this.cssHitsCounter) {
            return el;
        }
        return this.cssHitsCounter.countAffectedByExtendedCss(el);
    }
    /**
     * Create new {@link CssHitsCounter} instance.
     *
     * @returns CssHitsCounter instance.
     */
    static createCssHitsCounter() {
        return new CssHitsCounter((stats) => {
            sendAppMessage({
                type: MessageType.SaveCssHitsStats,
                payload: stats,
            });
        });
    }
}

const cosmeticController = new CosmeticController();
cosmeticController.init();
const cookieController = new CookieController();
cookieController.init();
// Init assistant only once
if (!__webpack_require__.g.isAssistantInitiated) {
    initAssistant();
    __webpack_require__.g.isAssistantInitiated = true;
}

;// CONCATENATED MODULE: ./Extension/src/common/messages/constants.ts
/**
 * @file
 * This file is part of AdGuard Browser Extension (https://github.com/AdguardTeam/AdguardBrowserExtension).
 *
 * AdGuard Browser Extension is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * AdGuard Browser Extension is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with AdGuard Browser Extension. If not, see <http://www.gnu.org/licenses/>.
 */ /**
 * Message types used for message passing between extension contexts
 * (popup, filtering log, content scripts, background)
 */ const constants_APP_MESSAGE_HANDLER_NAME = 'app';
var constants_MessageType = /*#__PURE__*/ function(MessageType) {
    MessageType["CreateEventListener"] = "createEventListener";
    MessageType["RemoveListener"] = "removeListener";
    MessageType["OpenExtensionStore"] = "openExtensionStore";
    MessageType["AddAndEnableFilter"] = "addAndEnableFilter";
    MessageType["ApplySettingsJson"] = "applySettingsJson";
    MessageType["OpenFilteringLog"] = "openFilteringLog";
    MessageType["OpenFullscreenUserRules"] = "openFullscreenUserRules";
    MessageType["UpdateFullscreenUserRulesTheme"] = "updateFullscreenUserRulesTheme";
    MessageType["ResetBlockedAdsCount"] = "resetBlockedAdsCount";
    MessageType["ResetSettings"] = "resetSettings";
    MessageType["GetUserRules"] = "getUserRules";
    MessageType["SaveUserRules"] = "saveUserRules";
    MessageType["GetAllowlistDomains"] = "getAllowlistDomains";
    MessageType["SaveAllowlistDomains"] = "saveAllowlistDomains";
    MessageType["CheckFiltersUpdate"] = "checkFiltersUpdate";
    MessageType["DisableFiltersGroup"] = "disableFiltersGroup";
    MessageType["DisableFilter"] = "disableFilter";
    MessageType["LoadCustomFilterInfo"] = "loadCustomFilterInfo";
    MessageType["SubscribeToCustomFilter"] = "subscribeToCustomFilter";
    MessageType["RemoveAntiBannerFilter"] = "removeAntiBannerFilter";
    MessageType["GetIsEngineStarted"] = "getIsEngineStarted";
    MessageType["GetTabInfoForPopup"] = "getTabInfoForPopup";
    MessageType["ChangeApplicationFilteringPaused"] = "changeApplicationFilteringPaused";
    MessageType["OpenRulesLimitsTab"] = "openRulesLimitsTab";
    MessageType["OpenSettingsTab"] = "openSettingsTab";
    MessageType["OpenAssistant"] = "openAssistant";
    MessageType["OpenAbuseTab"] = "openAbuseTab";
    MessageType["OpenSiteReportTab"] = "openSiteReportTab";
    MessageType["OpenComparePage"] = "openComparePage";
    MessageType["ResetUserRulesForPage"] = "resetUserRulesForPage";
    MessageType["RemoveAllowlistDomain"] = "removeAllowlistDomain";
    MessageType["AddAllowlistDomain"] = "addAllowlistDomain";
    MessageType["OnOpenFilteringLogPage"] = "onOpenFilteringLogPage";
    MessageType["GetFilteringLogData"] = "getFilteringLogData";
    MessageType["InitializeFrameScript"] = "initializeFrameScript";
    MessageType["OnCloseFilteringLogPage"] = "onCloseFilteringLogPage";
    MessageType["GetFilteringInfoByTabId"] = "getFilteringInfoByTabId";
    MessageType["SynchronizeOpenTabs"] = "synchronizeOpenTabs";
    MessageType["ClearEventsByTabId"] = "clearEventsByTabId";
    MessageType["RefreshPage"] = "refreshPage";
    MessageType["AddUserRule"] = "addUserRule";
    MessageType["RemoveUserRule"] = "removeUserRule";
    MessageType["EnableFiltersGroup"] = "enableFiltersGroup";
    MessageType["NotifyListeners"] = "notifyListeners";
    MessageType["AddLongLivedConnection"] = "addLongLivedConnection";
    MessageType["GetOptionsData"] = "getOptionsData";
    MessageType["ChangeUserSettings"] = "changeUserSetting";
    MessageType["CheckRequestFilterReady"] = "checkRequestFilterReady";
    MessageType["OpenThankyouPage"] = "openThankYouPage";
    MessageType["OpenSafebrowsingTrusted"] = "openSafebrowsingTrusted";
    MessageType["GetSelectorsAndScripts"] = "getSelectorsAndScripts";
    MessageType["CheckPageScriptWrapperRequest"] = "checkPageScriptWrapperRequest";
    MessageType["ProcessShouldCollapse"] = "processShouldCollapse";
    MessageType["ProcessShouldCollapseMany"] = "processShouldCollapseMany";
    MessageType["AddFilteringSubscription"] = "addFilterSubscription";
    MessageType["SetNotificationViewed"] = "setNotificationViewed";
    MessageType["SaveCssHitsStats"] = "saveCssHitStats";
    MessageType["GetCookieRules"] = "getCookieRules";
    MessageType["SaveCookieLogEvent"] = "saveCookieRuleEvent";
    MessageType["LoadSettingsJson"] = "loadSettingsJson";
    MessageType["AddUrlToTrusted"] = "addUrlToTrusted";
    MessageType["SetPreserveLogState"] = "setPreserveLogState";
    MessageType["GetUserRulesEditorData"] = "getUserRulesEditorData";
    MessageType["GetEditorStorageContent"] = "getEditorStorageContent";
    MessageType["SetEditorStorageContent"] = "setEditorStorageContent";
    MessageType["SetFilteringLogWindowState"] = "setFilteringLogWindowState";
    MessageType["AppInitialized"] = "appInitialized";
    MessageType["UpdateTotalBlocked"] = "updateTotalBlocked";
    MessageType["ScriptletCloseWindow"] = "scriptletCloseWindow";
    MessageType["ShowRuleLimitsAlert"] = "showRuleLimitsAlert";
    MessageType["ShowAlertPopup"] = "showAlertPopup";
    MessageType["ShowVersionUpdatedPopup"] = "showVersionUpdatedPopup";
    MessageType["UpdateListeners"] = "updateListeners";
    MessageType["SetConsentedFilters"] = "setConsentedFilters";
    MessageType["GetIsConsentedFilter"] = "getIsConsentedFilter";
    MessageType["GetRulesLimitsCountersMv3"] = "getRulesLimitsCountersMv3";
    MessageType["CanEnableStaticFilterMv3"] = "canEnableStaticFilterMv3";
    MessageType["CanEnableStaticGroupMv3"] = "canEnableStaticGroupMv3";
    MessageType["ClearRulesLimitsWarningMv3"] = "clearRulesLimitsWarningMv3";
    MessageType["RestoreFiltersMv3"] = "restoreFiltersMv3";
    MessageType["CurrentLimitsMv3"] = "currentLimitsMv3";
    return MessageType;
}({});

;// CONCATENATED MODULE: ./Extension/src/common/messages/send-message.ts
/**
 * @file
 * This file is part of AdGuard Browser Extension (https://github.com/AdguardTeam/AdguardBrowserExtension).
 *
 * AdGuard Browser Extension is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * AdGuard Browser Extension is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with AdGuard Browser Extension. If not, see <http://www.gnu.org/licenses/>.
 */ 

/**
 * TODO: Consider moving this file to the background folder, because all messages
 * from the UI should be send via methods of Messenger class instead of using
 * directly sendMessage to proper types checking.
 *
 * {@link sendMessage} sends app message via {@link browser.runtime.sendMessage} and
 * gets response from another extension page message handler
 *
 * @param message - partial {@link Message} record without {@link Message.handlerName} field
 *
 * @returns message handler response
 */ async function sendMessage(message) {
    try {
        return await browser_polyfill_default().runtime.sendMessage({
            handlerName: constants_APP_MESSAGE_HANDLER_NAME,
            ...message
        });
    } catch (e) {
    // do nothing
    }
}
/**
 * {@link sendTabMessage} sends message to specified tab via {@link browser.tabs.sendMessage} and
 * gets response from it
 *
 * @param tabId - tab id
 * @param message - partial {@link Message} record without {@link Message.handlerName} field
 *
 * @returns tab message handler response
 */ async function sendTabMessage(tabId, message) {
    return browser.tabs.sendMessage(tabId, {
        handlerName: APP_MESSAGE_HANDLER_NAME,
        ...message
    });
}

// EXTERNAL MODULE: ./node_modules/.pnpm/core-js@3.32.0/node_modules/core-js/modules/es.error.cause.js
var es_error_cause = __webpack_require__(82514);
;// CONCATENATED MODULE: ./Extension/src/common/messages/message-handler.ts
/**
 * @file
 * This file is part of AdGuard Browser Extension (https://github.com/AdguardTeam/AdguardBrowserExtension).
 *
 * AdGuard Browser Extension is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * AdGuard Browser Extension is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with AdGuard Browser Extension. If not, see <http://www.gnu.org/licenses/>.
 */ function _define_property(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;
}



/**
 * Type guard for messages that have a 'type' field with possible {@link MessageType}.
 * @note Added to no bring here huge zod library.
 *
 * @param message Unknown message.
 *
 * @returns True if message has 'type' field with possible {@link MessageType}.
 */ const messageHasTypeField = (message)=>{
    return typeof message === 'object' && message !== null && 'type' in message;
};
/**
 * Type guard for messages that have a 'type' field and 'data' field and looks like {@link Message}.
 * @note Added to no bring here huge zod library.
 *
 * @param message Unknown message.
 *
 * @returns True if message has 'type' and 'data' fields and looks like {@link Message}.
 */ const messageHasTypeAndDataFields = (message)=>{
    return messageHasTypeField(message) && 'data' in message;
};
/**
 * API for handling Messages via {@link browser.runtime.onMessage}
 */ class MessageHandler {
    init() {
        browser_polyfill_default().runtime.onMessage.addListener(this.handleMessage);
    }
    /**
     * Add message listener.
     * Listeners limited to 1 per message type to prevent race
     * condition while response processing.
     *
     * TODO: implement listeners priority execution strategy
     *
     * @param type - {@link ValidMessageTypes}
     * @param listener - {@link MessageListener}
     * @throws error, if message listener already added
     */ addListener(type, listener) {
        if (this.listeners.has(type)) {
            throw new Error(`Message handler: ${type} listener has already been registered`);
        }
        // Cast through unknown to help TS understand that the listener is of
        // the correct type. It will check types at compile time.
        this.listeners.set(type, listener);
    }
    /**
     * Removes message listener.
     *
     * @param type - {@link ValidMessageTypes}
     */ removeListener(type) {
        this.listeners.delete(type);
    }
    /**
     * Removes all listeners
     */ removeListeners() {
        this.listeners.clear();
    }
    /**
     * Check if the message is of type {@link Message}.
     *
     * @param message Message of basic type {@link Message} or {@link EngineMessage}.
     *
     * @returns True if the message is of type {@link Message}.
     */ static isValidMessageType(message) {
        return message.handlerName === constants_APP_MESSAGE_HANDLER_NAME && 'type' in message;
    }
    constructor(){
        _define_property(this, "listeners", new Map());
        this.handleMessage = this.handleMessage.bind(this);
    }
}

;// CONCATENATED MODULE: ./Extension/src/common/messages/index.ts
/**
 * @file
 * This file is part of AdGuard Browser Extension (https://github.com/AdguardTeam/AdguardBrowserExtension).
 *
 * AdGuard Browser Extension is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * AdGuard Browser Extension is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with AdGuard Browser Extension. If not, see <http://www.gnu.org/licenses/>.
 */ 



// EXTERNAL MODULE: ./node_modules/.pnpm/core-js@3.32.0/node_modules/core-js/modules/web.self.js
var web_self = __webpack_require__(44088);
;// CONCATENATED MODULE: ./node_modules/.pnpm/@adguard+logger@1.1.1/node_modules/@adguard/logger/dist/es/index.mjs
/**
 * Checks if error has message.
 *
 * @param error Error object.
 * @returns True if error has message.
 */
function es_isErrorWithMessage(error) {
    return (typeof error === 'object'
        && error !== null
        && 'message' in error
        && typeof error.message === 'string');
}
/**
 * Converts error to the error with a message.
 *
 * @param maybeError Possible error.
 * @returns Error with a message.
 */
function es_toErrorWithMessage(maybeError) {
    if (es_isErrorWithMessage(maybeError)) {
        return maybeError;
    }
    try {
        return new Error(JSON.stringify(maybeError));
    }
    catch {
        // fallback in case there's an error stringifying the maybeError
        // like with circular references, for example.
        return new Error(String(maybeError));
    }
}
/**
 * Converts an error object to an error with a message. This method might be helpful to handle thrown errors.
 *
 * @param error Error object.
 *
 * @returns Message of the error.
 */
function es_getErrorMessage(error) {
    return es_toErrorWithMessage(error).message;
}

/**
 * Pads a number with leading zeros.
 * @param num The number to pad.
 * @param size The number of digits to pad to.
 * @returns The padded number.
 */
const es_pad = (num, size = 2) => {
    return num.toString().padStart(size, '0');
};
/**
 * Formats a date into an ISO 8601-like string with milliseconds.
 *
 * @param {Date|number} date The date object or timestamp to format.
 * @returns {string} The formatted date string.
 */
const es_formatTime = (date) => {
    const d = (date instanceof Date) ? date : new Date(date);
    const year = d.getFullYear();
    const month = es_pad(d.getMonth() + 1); // Months are 0-based
    const day = es_pad(d.getDate());
    const hour = es_pad(d.getHours());
    const minute = es_pad(d.getMinutes());
    const second = es_pad(d.getSeconds());
    const millisecond = es_pad(d.getMilliseconds(), 3); // Milliseconds are 3 digits
    return `${year}-${month}-${day}T${hour}:${minute}:${second}:${millisecond}`;
};

/**
 * String presentation of log levels, for convenient users usage.
 */
var es_LogLevel;
(function (LogLevel) {
    LogLevel["Error"] = "error";
    LogLevel["Warn"] = "warn";
    LogLevel["Info"] = "info";
    LogLevel["Debug"] = "debug";
    LogLevel["Trace"] = "trace";
})(es_LogLevel || (es_LogLevel = {}));
/**
 * Log levels map, which maps number level to string level.
 */
const es_levelMapNumToString = {
    [1 /* LogLevelNumeric.Error */]: es_LogLevel.Error,
    [2 /* LogLevelNumeric.Warn */]: es_LogLevel.Warn,
    [3 /* LogLevelNumeric.Info */]: es_LogLevel.Info,
    [4 /* LogLevelNumeric.Debug */]: es_LogLevel.Debug,
    [5 /* LogLevelNumeric.Trace */]: es_LogLevel.Trace,
};
/**
 * Log levels map, which maps string level to number level.
 */
const es_levelMapStringToNum = Object.entries(es_levelMapNumToString)
    .reduce((acc, [key, value]) => {
    // Here, key is originally a string since Object.entries() returns [string, string][].
    // We need to cast the key to LogLevelNumeric correctly without causing type mismatches.
    const numericKey = Number(key);
    if (!Number.isNaN(numericKey)) {
        acc[value] = numericKey;
    }
    return acc;
}, {});
/**
 * Simple logger with log levels.
 */
class es_Logger {
    currentLevelValue = 3 /* LogLevelNumeric.Info */;
    writer;
    /**
     * Constructor.
     * @param writer Writer object.
     */
    constructor(writer = console) {
        this.writer = writer;
        // bind the logging methods to avoid losing context
        this.debug = this.debug.bind(this);
        this.info = this.info.bind(this);
        this.warn = this.warn.bind(this);
        this.error = this.error.bind(this);
    }
    /**
     * Print debug messages. Usually used for technical information.
     * Will be printed in 'log' channel.
     *
     * @param args Printed arguments.
     */
    debug(...args) {
        this.print(4 /* LogLevelNumeric.Debug */, "log" /* LogMethod.Log */, args);
    }
    /**
     * Print messages you want to disclose to users.
     *
     * @param args Printed arguments.
     */
    info(...args) {
        this.print(3 /* LogLevelNumeric.Info */, "info" /* LogMethod.Info */, args);
    }
    /**
     * Print warn messages.
     * NOTE: We do not use 'warn' channel, since in the extensions warn is
     * counted as error. Instead of this we use 'info' channel.
     *
     * @param args Printed arguments.
     */
    warn(...args) {
        this.print(2 /* LogLevelNumeric.Warn */, "info" /* LogMethod.Info */, args);
    }
    /**
     * Print error messages.
     *
     * @param args Printed arguments.
     */
    error(...args) {
        this.print(1 /* LogLevelNumeric.Error */, "error" /* LogMethod.Error */, args);
    }
    /**
     * Getter for log level.
     * @returns Logger level.
     */
    get currentLevel() {
        return es_levelMapNumToString[this.currentLevelValue];
    }
    /**
     * Setter for log level. With this method log level can be updated dynamically.
     *
     * @param logLevel Logger level.
     * @throws Error if log level is not supported.
     */
    set currentLevel(logLevel) {
        const level = es_levelMapStringToNum[logLevel];
        if (level === undefined) {
            throw new Error(`Logger supports only the following levels: ${[Object.values(es_LogLevel).join(', ')]}`);
        }
        this.currentLevelValue = level;
    }
    /**
     * Converts error to string, and adds stack trace.
     *
     * @param error Error to print.
     * @private
     * @returns Error message.
     */
    static errorToString(error) {
        const message = es_getErrorMessage(error);
        return `${message}\nStack trace:\n${error.stack}`;
    }
    /**
     * Wrapper over log methods.
     *
     * @param level Logger level.
     * @param method Logger method.
     * @param args Printed arguments.
     * @private
     */
    print(level, method, args) {
        // skip writing if the basic conditions are not met
        if (this.currentLevelValue < level) {
            return;
        }
        if (!args || args.length === 0 || !args[0]) {
            return;
        }
        const formattedArgs = args.map((value) => {
            if (value instanceof Error) {
                return es_Logger.errorToString(value);
            }
            if (value && typeof value.message === 'string') {
                return value.message;
            }
            if (typeof value === 'object' && value !== null) {
                return JSON.stringify(value);
            }
            return String(value);
        });
        const formattedTime = `${es_formatTime(new Date())}:`;
        /**
         * Conditions in which trace can happen:
         * 1. Method is not error (because console.error provides call stack trace)
         * 2. Log level is equal or higher that `LogLevel.Trace`.
         * 3. Writer has `trace` method.
         */
        if (method === "error" /* LogMethod.Error */
            || this.currentLevelValue < es_levelMapStringToNum[es_LogLevel.Trace]
            || !this.writer.trace) {
            // Print with regular method
            this.writer[method](formattedTime, ...formattedArgs);
            return;
        }
        if (!this.writer.groupCollapsed || !this.writer.groupEnd) {
            // Print expanded trace
            this.writer.trace(formattedTime, ...formattedArgs);
            return;
        }
        // Print collapsed trace
        this.writer.groupCollapsed(formattedTime, ...formattedArgs);
        this.writer.trace();
        this.writer.groupEnd();
    }
}



;// CONCATENATED MODULE: ./Extension/src/common/logger.ts
/**
 * @file
 *
 * This file is part of AdGuard Browser Extension (https://github.com/AdguardTeam/AdguardBrowserExtension).
 *
 * AdGuard Browser Extension is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * AdGuard Browser Extension is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with AdGuard Browser Extension. If not, see <http://www.gnu.org/licenses/>.
 */ 

class ExtendedLogger extends es_Logger {
    isVerbose() {
        return this.currentLevel === es_LogLevel.Debug;
    }
}
const logger_logger = new ExtendedLogger();
logger_logger.currentLevel =  true ? es_LogLevel.Info : 0;
// Expose logger to the window object,
// to have possibility to switch log level from the console.
// Example: adguard.logger.currentLevel = 'debug'
// eslint-disable-next-line no-restricted-globals
Object.assign(self, {
    adguard: {
        ...self.adguard,
        logger: logger_logger
    }
});


;// CONCATENATED MODULE: ./Extension/src/content-script/content-utils/message-handler.ts
/**
 * @file
 * This file is part of AdGuard Browser Extension (https://github.com/AdguardTeam/AdguardBrowserExtension).
 *
 * AdGuard Browser Extension is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * AdGuard Browser Extension is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with AdGuard Browser Extension. If not, see <http://www.gnu.org/licenses/>.
 */ 

class ContentScriptMessageHandler extends MessageHandler {
    handleMessage(message, sender) {
        // Check type
        if (!ContentScriptMessageHandler.isValidMessageType(message)) {
            logger_logger.error('Invalid message in ContentScriptMessageHandler:', message);
            return;
        }
        const listener = this.listeners.get(message.type);
        if (listener) {
            return Promise.resolve(listener(message, sender));
        }
    }
}
const messageHandler = new ContentScriptMessageHandler();

;// CONCATENATED MODULE: ./node_modules/.pnpm/zod@3.23.8/node_modules/zod/lib/index.mjs
var util;
(function (util) {
    util.assertEqual = (val) => val;
    function assertIs(_arg) { }
    util.assertIs = assertIs;
    function assertNever(_x) {
        throw new Error();
    }
    util.assertNever = assertNever;
    util.arrayToEnum = (items) => {
        const obj = {};
        for (const item of items) {
            obj[item] = item;
        }
        return obj;
    };
    util.getValidEnumValues = (obj) => {
        const validKeys = util.objectKeys(obj).filter((k) => typeof obj[obj[k]] !== "number");
        const filtered = {};
        for (const k of validKeys) {
            filtered[k] = obj[k];
        }
        return util.objectValues(filtered);
    };
    util.objectValues = (obj) => {
        return util.objectKeys(obj).map(function (e) {
            return obj[e];
        });
    };
    util.objectKeys = typeof Object.keys === "function" // eslint-disable-line ban/ban
        ? (obj) => Object.keys(obj) // eslint-disable-line ban/ban
        : (object) => {
            const keys = [];
            for (const key in object) {
                if (Object.prototype.hasOwnProperty.call(object, key)) {
                    keys.push(key);
                }
            }
            return keys;
        };
    util.find = (arr, checker) => {
        for (const item of arr) {
            if (checker(item))
                return item;
        }
        return undefined;
    };
    util.isInteger = typeof Number.isInteger === "function"
        ? (val) => Number.isInteger(val) // eslint-disable-line ban/ban
        : (val) => typeof val === "number" && isFinite(val) && Math.floor(val) === val;
    function joinValues(array, separator = " | ") {
        return array
            .map((val) => (typeof val === "string" ? `'${val}'` : val))
            .join(separator);
    }
    util.joinValues = joinValues;
    util.jsonStringifyReplacer = (_, value) => {
        if (typeof value === "bigint") {
            return value.toString();
        }
        return value;
    };
})(util || (util = {}));
var objectUtil;
(function (objectUtil) {
    objectUtil.mergeShapes = (first, second) => {
        return {
            ...first,
            ...second, // second overwrites first
        };
    };
})(objectUtil || (objectUtil = {}));
const ZodParsedType = util.arrayToEnum([
    "string",
    "nan",
    "number",
    "integer",
    "float",
    "boolean",
    "date",
    "bigint",
    "symbol",
    "function",
    "undefined",
    "null",
    "array",
    "object",
    "unknown",
    "promise",
    "void",
    "never",
    "map",
    "set",
]);
const getParsedType = (data) => {
    const t = typeof data;
    switch (t) {
        case "undefined":
            return ZodParsedType.undefined;
        case "string":
            return ZodParsedType.string;
        case "number":
            return isNaN(data) ? ZodParsedType.nan : ZodParsedType.number;
        case "boolean":
            return ZodParsedType.boolean;
        case "function":
            return ZodParsedType.function;
        case "bigint":
            return ZodParsedType.bigint;
        case "symbol":
            return ZodParsedType.symbol;
        case "object":
            if (Array.isArray(data)) {
                return ZodParsedType.array;
            }
            if (data === null) {
                return ZodParsedType.null;
            }
            if (data.then &&
                typeof data.then === "function" &&
                data.catch &&
                typeof data.catch === "function") {
                return ZodParsedType.promise;
            }
            if (typeof Map !== "undefined" && data instanceof Map) {
                return ZodParsedType.map;
            }
            if (typeof Set !== "undefined" && data instanceof Set) {
                return ZodParsedType.set;
            }
            if (typeof Date !== "undefined" && data instanceof Date) {
                return ZodParsedType.date;
            }
            return ZodParsedType.object;
        default:
            return ZodParsedType.unknown;
    }
};

const ZodIssueCode = util.arrayToEnum([
    "invalid_type",
    "invalid_literal",
    "custom",
    "invalid_union",
    "invalid_union_discriminator",
    "invalid_enum_value",
    "unrecognized_keys",
    "invalid_arguments",
    "invalid_return_type",
    "invalid_date",
    "invalid_string",
    "too_small",
    "too_big",
    "invalid_intersection_types",
    "not_multiple_of",
    "not_finite",
]);
const quotelessJson = (obj) => {
    const json = JSON.stringify(obj, null, 2);
    return json.replace(/"([^"]+)":/g, "$1:");
};
class ZodError extends Error {
    constructor(issues) {
        super();
        this.issues = [];
        this.addIssue = (sub) => {
            this.issues = [...this.issues, sub];
        };
        this.addIssues = (subs = []) => {
            this.issues = [...this.issues, ...subs];
        };
        const actualProto = new.target.prototype;
        if (Object.setPrototypeOf) {
            // eslint-disable-next-line ban/ban
            Object.setPrototypeOf(this, actualProto);
        }
        else {
            this.__proto__ = actualProto;
        }
        this.name = "ZodError";
        this.issues = issues;
    }
    get errors() {
        return this.issues;
    }
    format(_mapper) {
        const mapper = _mapper ||
            function (issue) {
                return issue.message;
            };
        const fieldErrors = { _errors: [] };
        const processError = (error) => {
            for (const issue of error.issues) {
                if (issue.code === "invalid_union") {
                    issue.unionErrors.map(processError);
                }
                else if (issue.code === "invalid_return_type") {
                    processError(issue.returnTypeError);
                }
                else if (issue.code === "invalid_arguments") {
                    processError(issue.argumentsError);
                }
                else if (issue.path.length === 0) {
                    fieldErrors._errors.push(mapper(issue));
                }
                else {
                    let curr = fieldErrors;
                    let i = 0;
                    while (i < issue.path.length) {
                        const el = issue.path[i];
                        const terminal = i === issue.path.length - 1;
                        if (!terminal) {
                            curr[el] = curr[el] || { _errors: [] };
                            // if (typeof el === "string") {
                            //   curr[el] = curr[el] || { _errors: [] };
                            // } else if (typeof el === "number") {
                            //   const errorArray: any = [];
                            //   errorArray._errors = [];
                            //   curr[el] = curr[el] || errorArray;
                            // }
                        }
                        else {
                            curr[el] = curr[el] || { _errors: [] };
                            curr[el]._errors.push(mapper(issue));
                        }
                        curr = curr[el];
                        i++;
                    }
                }
            }
        };
        processError(this);
        return fieldErrors;
    }
    static assert(value) {
        if (!(value instanceof ZodError)) {
            throw new Error(`Not a ZodError: ${value}`);
        }
    }
    toString() {
        return this.message;
    }
    get message() {
        return JSON.stringify(this.issues, util.jsonStringifyReplacer, 2);
    }
    get isEmpty() {
        return this.issues.length === 0;
    }
    flatten(mapper = (issue) => issue.message) {
        const fieldErrors = {};
        const formErrors = [];
        for (const sub of this.issues) {
            if (sub.path.length > 0) {
                fieldErrors[sub.path[0]] = fieldErrors[sub.path[0]] || [];
                fieldErrors[sub.path[0]].push(mapper(sub));
            }
            else {
                formErrors.push(mapper(sub));
            }
        }
        return { formErrors, fieldErrors };
    }
    get formErrors() {
        return this.flatten();
    }
}
ZodError.create = (issues) => {
    const error = new ZodError(issues);
    return error;
};

const errorMap = (issue, _ctx) => {
    let message;
    switch (issue.code) {
        case ZodIssueCode.invalid_type:
            if (issue.received === ZodParsedType.undefined) {
                message = "Required";
            }
            else {
                message = `Expected ${issue.expected}, received ${issue.received}`;
            }
            break;
        case ZodIssueCode.invalid_literal:
            message = `Invalid literal value, expected ${JSON.stringify(issue.expected, util.jsonStringifyReplacer)}`;
            break;
        case ZodIssueCode.unrecognized_keys:
            message = `Unrecognized key(s) in object: ${util.joinValues(issue.keys, ", ")}`;
            break;
        case ZodIssueCode.invalid_union:
            message = `Invalid input`;
            break;
        case ZodIssueCode.invalid_union_discriminator:
            message = `Invalid discriminator value. Expected ${util.joinValues(issue.options)}`;
            break;
        case ZodIssueCode.invalid_enum_value:
            message = `Invalid enum value. Expected ${util.joinValues(issue.options)}, received '${issue.received}'`;
            break;
        case ZodIssueCode.invalid_arguments:
            message = `Invalid function arguments`;
            break;
        case ZodIssueCode.invalid_return_type:
            message = `Invalid function return type`;
            break;
        case ZodIssueCode.invalid_date:
            message = `Invalid date`;
            break;
        case ZodIssueCode.invalid_string:
            if (typeof issue.validation === "object") {
                if ("includes" in issue.validation) {
                    message = `Invalid input: must include "${issue.validation.includes}"`;
                    if (typeof issue.validation.position === "number") {
                        message = `${message} at one or more positions greater than or equal to ${issue.validation.position}`;
                    }
                }
                else if ("startsWith" in issue.validation) {
                    message = `Invalid input: must start with "${issue.validation.startsWith}"`;
                }
                else if ("endsWith" in issue.validation) {
                    message = `Invalid input: must end with "${issue.validation.endsWith}"`;
                }
                else {
                    util.assertNever(issue.validation);
                }
            }
            else if (issue.validation !== "regex") {
                message = `Invalid ${issue.validation}`;
            }
            else {
                message = "Invalid";
            }
            break;
        case ZodIssueCode.too_small:
            if (issue.type === "array")
                message = `Array must contain ${issue.exact ? "exactly" : issue.inclusive ? `at least` : `more than`} ${issue.minimum} element(s)`;
            else if (issue.type === "string")
                message = `String must contain ${issue.exact ? "exactly" : issue.inclusive ? `at least` : `over`} ${issue.minimum} character(s)`;
            else if (issue.type === "number")
                message = `Number must be ${issue.exact
                    ? `exactly equal to `
                    : issue.inclusive
                        ? `greater than or equal to `
                        : `greater than `}${issue.minimum}`;
            else if (issue.type === "date")
                message = `Date must be ${issue.exact
                    ? `exactly equal to `
                    : issue.inclusive
                        ? `greater than or equal to `
                        : `greater than `}${new Date(Number(issue.minimum))}`;
            else
                message = "Invalid input";
            break;
        case ZodIssueCode.too_big:
            if (issue.type === "array")
                message = `Array must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `less than`} ${issue.maximum} element(s)`;
            else if (issue.type === "string")
                message = `String must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `under`} ${issue.maximum} character(s)`;
            else if (issue.type === "number")
                message = `Number must be ${issue.exact
                    ? `exactly`
                    : issue.inclusive
                        ? `less than or equal to`
                        : `less than`} ${issue.maximum}`;
            else if (issue.type === "bigint")
                message = `BigInt must be ${issue.exact
                    ? `exactly`
                    : issue.inclusive
                        ? `less than or equal to`
                        : `less than`} ${issue.maximum}`;
            else if (issue.type === "date")
                message = `Date must be ${issue.exact
                    ? `exactly`
                    : issue.inclusive
                        ? `smaller than or equal to`
                        : `smaller than`} ${new Date(Number(issue.maximum))}`;
            else
                message = "Invalid input";
            break;
        case ZodIssueCode.custom:
            message = `Invalid input`;
            break;
        case ZodIssueCode.invalid_intersection_types:
            message = `Intersection results could not be merged`;
            break;
        case ZodIssueCode.not_multiple_of:
            message = `Number must be a multiple of ${issue.multipleOf}`;
            break;
        case ZodIssueCode.not_finite:
            message = "Number must be finite";
            break;
        default:
            message = _ctx.defaultError;
            util.assertNever(issue);
    }
    return { message };
};

let overrideErrorMap = errorMap;
function setErrorMap(map) {
    overrideErrorMap = map;
}
function getErrorMap() {
    return overrideErrorMap;
}

const makeIssue = (params) => {
    const { data, path, errorMaps, issueData } = params;
    const fullPath = [...path, ...(issueData.path || [])];
    const fullIssue = {
        ...issueData,
        path: fullPath,
    };
    if (issueData.message !== undefined) {
        return {
            ...issueData,
            path: fullPath,
            message: issueData.message,
        };
    }
    let errorMessage = "";
    const maps = errorMaps
        .filter((m) => !!m)
        .slice()
        .reverse();
    for (const map of maps) {
        errorMessage = map(fullIssue, { data, defaultError: errorMessage }).message;
    }
    return {
        ...issueData,
        path: fullPath,
        message: errorMessage,
    };
};
const EMPTY_PATH = [];
function addIssueToContext(ctx, issueData) {
    const overrideMap = getErrorMap();
    const issue = makeIssue({
        issueData: issueData,
        data: ctx.data,
        path: ctx.path,
        errorMaps: [
            ctx.common.contextualErrorMap,
            ctx.schemaErrorMap,
            overrideMap,
            overrideMap === errorMap ? undefined : errorMap, // then global default map
        ].filter((x) => !!x),
    });
    ctx.common.issues.push(issue);
}
class ParseStatus {
    constructor() {
        this.value = "valid";
    }
    dirty() {
        if (this.value === "valid")
            this.value = "dirty";
    }
    abort() {
        if (this.value !== "aborted")
            this.value = "aborted";
    }
    static mergeArray(status, results) {
        const arrayValue = [];
        for (const s of results) {
            if (s.status === "aborted")
                return INVALID;
            if (s.status === "dirty")
                status.dirty();
            arrayValue.push(s.value);
        }
        return { status: status.value, value: arrayValue };
    }
    static async mergeObjectAsync(status, pairs) {
        const syncPairs = [];
        for (const pair of pairs) {
            const key = await pair.key;
            const value = await pair.value;
            syncPairs.push({
                key,
                value,
            });
        }
        return ParseStatus.mergeObjectSync(status, syncPairs);
    }
    static mergeObjectSync(status, pairs) {
        const finalObject = {};
        for (const pair of pairs) {
            const { key, value } = pair;
            if (key.status === "aborted")
                return INVALID;
            if (value.status === "aborted")
                return INVALID;
            if (key.status === "dirty")
                status.dirty();
            if (value.status === "dirty")
                status.dirty();
            if (key.value !== "__proto__" &&
                (typeof value.value !== "undefined" || pair.alwaysSet)) {
                finalObject[key.value] = value.value;
            }
        }
        return { status: status.value, value: finalObject };
    }
}
const INVALID = Object.freeze({
    status: "aborted",
});
const DIRTY = (value) => ({ status: "dirty", value });
const OK = (value) => ({ status: "valid", value });
const isAborted = (x) => x.status === "aborted";
const isDirty = (x) => x.status === "dirty";
const isValid = (x) => x.status === "valid";
const isAsync = (x) => typeof Promise !== "undefined" && x instanceof Promise;

/******************************************************************************
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.
***************************************************************************** */

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

typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
    var e = new Error(message);
    return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
};

var errorUtil;
(function (errorUtil) {
    errorUtil.errToObj = (message) => typeof message === "string" ? { message } : message || {};
    errorUtil.toString = (message) => typeof message === "string" ? message : message === null || message === void 0 ? void 0 : message.message;
})(errorUtil || (errorUtil = {}));

var _ZodEnum_cache, _ZodNativeEnum_cache;
class ParseInputLazyPath {
    constructor(parent, value, path, key) {
        this._cachedPath = [];
        this.parent = parent;
        this.data = value;
        this._path = path;
        this._key = key;
    }
    get path() {
        if (!this._cachedPath.length) {
            if (this._key instanceof Array) {
                this._cachedPath.push(...this._path, ...this._key);
            }
            else {
                this._cachedPath.push(...this._path, this._key);
            }
        }
        return this._cachedPath;
    }
}
const handleResult = (ctx, result) => {
    if (isValid(result)) {
        return { success: true, data: result.value };
    }
    else {
        if (!ctx.common.issues.length) {
            throw new Error("Validation failed but no issues detected.");
        }
        return {
            success: false,
            get error() {
                if (this._error)
                    return this._error;
                const error = new ZodError(ctx.common.issues);
                this._error = error;
                return this._error;
            },
        };
    }
};
function processCreateParams(params) {
    if (!params)
        return {};
    const { errorMap, invalid_type_error, required_error, description } = params;
    if (errorMap && (invalid_type_error || required_error)) {
        throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);
    }
    if (errorMap)
        return { errorMap: errorMap, description };
    const customMap = (iss, ctx) => {
        var _a, _b;
        const { message } = params;
        if (iss.code === "invalid_enum_value") {
            return { message: message !== null && message !== void 0 ? message : ctx.defaultError };
        }
        if (typeof ctx.data === "undefined") {
            return { message: (_a = message !== null && message !== void 0 ? message : required_error) !== null && _a !== void 0 ? _a : ctx.defaultError };
        }
        if (iss.code !== "invalid_type")
            return { message: ctx.defaultError };
        return { message: (_b = message !== null && message !== void 0 ? message : invalid_type_error) !== null && _b !== void 0 ? _b : ctx.defaultError };
    };
    return { errorMap: customMap, description };
}
class ZodType {
    constructor(def) {
        /** Alias of safeParseAsync */
        this.spa = this.safeParseAsync;
        this._def = def;
        this.parse = this.parse.bind(this);
        this.safeParse = this.safeParse.bind(this);
        this.parseAsync = this.parseAsync.bind(this);
        this.safeParseAsync = this.safeParseAsync.bind(this);
        this.spa = this.spa.bind(this);
        this.refine = this.refine.bind(this);
        this.refinement = this.refinement.bind(this);
        this.superRefine = this.superRefine.bind(this);
        this.optional = this.optional.bind(this);
        this.nullable = this.nullable.bind(this);
        this.nullish = this.nullish.bind(this);
        this.array = this.array.bind(this);
        this.promise = this.promise.bind(this);
        this.or = this.or.bind(this);
        this.and = this.and.bind(this);
        this.transform = this.transform.bind(this);
        this.brand = this.brand.bind(this);
        this.default = this.default.bind(this);
        this.catch = this.catch.bind(this);
        this.describe = this.describe.bind(this);
        this.pipe = this.pipe.bind(this);
        this.readonly = this.readonly.bind(this);
        this.isNullable = this.isNullable.bind(this);
        this.isOptional = this.isOptional.bind(this);
    }
    get description() {
        return this._def.description;
    }
    _getType(input) {
        return getParsedType(input.data);
    }
    _getOrReturnCtx(input, ctx) {
        return (ctx || {
            common: input.parent.common,
            data: input.data,
            parsedType: getParsedType(input.data),
            schemaErrorMap: this._def.errorMap,
            path: input.path,
            parent: input.parent,
        });
    }
    _processInputParams(input) {
        return {
            status: new ParseStatus(),
            ctx: {
                common: input.parent.common,
                data: input.data,
                parsedType: getParsedType(input.data),
                schemaErrorMap: this._def.errorMap,
                path: input.path,
                parent: input.parent,
            },
        };
    }
    _parseSync(input) {
        const result = this._parse(input);
        if (isAsync(result)) {
            throw new Error("Synchronous parse encountered promise.");
        }
        return result;
    }
    _parseAsync(input) {
        const result = this._parse(input);
        return Promise.resolve(result);
    }
    parse(data, params) {
        const result = this.safeParse(data, params);
        if (result.success)
            return result.data;
        throw result.error;
    }
    safeParse(data, params) {
        var _a;
        const ctx = {
            common: {
                issues: [],
                async: (_a = params === null || params === void 0 ? void 0 : params.async) !== null && _a !== void 0 ? _a : false,
                contextualErrorMap: params === null || params === void 0 ? void 0 : params.errorMap,
            },
            path: (params === null || params === void 0 ? void 0 : params.path) || [],
            schemaErrorMap: this._def.errorMap,
            parent: null,
            data,
            parsedType: getParsedType(data),
        };
        const result = this._parseSync({ data, path: ctx.path, parent: ctx });
        return handleResult(ctx, result);
    }
    async parseAsync(data, params) {
        const result = await this.safeParseAsync(data, params);
        if (result.success)
            return result.data;
        throw result.error;
    }
    async safeParseAsync(data, params) {
        const ctx = {
            common: {
                issues: [],
                contextualErrorMap: params === null || params === void 0 ? void 0 : params.errorMap,
                async: true,
            },
            path: (params === null || params === void 0 ? void 0 : params.path) || [],
            schemaErrorMap: this._def.errorMap,
            parent: null,
            data,
            parsedType: getParsedType(data),
        };
        const maybeAsyncResult = this._parse({ data, path: ctx.path, parent: ctx });
        const result = await (isAsync(maybeAsyncResult)
            ? maybeAsyncResult
            : Promise.resolve(maybeAsyncResult));
        return handleResult(ctx, result);
    }
    refine(check, message) {
        const getIssueProperties = (val) => {
            if (typeof message === "string" || typeof message === "undefined") {
                return { message };
            }
            else if (typeof message === "function") {
                return message(val);
            }
            else {
                return message;
            }
        };
        return this._refinement((val, ctx) => {
            const result = check(val);
            const setError = () => ctx.addIssue({
                code: ZodIssueCode.custom,
                ...getIssueProperties(val),
            });
            if (typeof Promise !== "undefined" && result instanceof Promise) {
                return result.then((data) => {
                    if (!data) {
                        setError();
                        return false;
                    }
                    else {
                        return true;
                    }
                });
            }
            if (!result) {
                setError();
                return false;
            }
            else {
                return true;
            }
        });
    }
    refinement(check, refinementData) {
        return this._refinement((val, ctx) => {
            if (!check(val)) {
                ctx.addIssue(typeof refinementData === "function"
                    ? refinementData(val, ctx)
                    : refinementData);
                return false;
            }
            else {
                return true;
            }
        });
    }
    _refinement(refinement) {
        return new ZodEffects({
            schema: this,
            typeName: ZodFirstPartyTypeKind.ZodEffects,
            effect: { type: "refinement", refinement },
        });
    }
    superRefine(refinement) {
        return this._refinement(refinement);
    }
    optional() {
        return ZodOptional.create(this, this._def);
    }
    nullable() {
        return ZodNullable.create(this, this._def);
    }
    nullish() {
        return this.nullable().optional();
    }
    array() {
        return ZodArray.create(this, this._def);
    }
    promise() {
        return ZodPromise.create(this, this._def);
    }
    or(option) {
        return ZodUnion.create([this, option], this._def);
    }
    and(incoming) {
        return ZodIntersection.create(this, incoming, this._def);
    }
    transform(transform) {
        return new ZodEffects({
            ...processCreateParams(this._def),
            schema: this,
            typeName: ZodFirstPartyTypeKind.ZodEffects,
            effect: { type: "transform", transform },
        });
    }
    default(def) {
        const defaultValueFunc = typeof def === "function" ? def : () => def;
        return new ZodDefault({
            ...processCreateParams(this._def),
            innerType: this,
            defaultValue: defaultValueFunc,
            typeName: ZodFirstPartyTypeKind.ZodDefault,
        });
    }
    brand() {
        return new ZodBranded({
            typeName: ZodFirstPartyTypeKind.ZodBranded,
            type: this,
            ...processCreateParams(this._def),
        });
    }
    catch(def) {
        const catchValueFunc = typeof def === "function" ? def : () => def;
        return new ZodCatch({
            ...processCreateParams(this._def),
            innerType: this,
            catchValue: catchValueFunc,
            typeName: ZodFirstPartyTypeKind.ZodCatch,
        });
    }
    describe(description) {
        const This = this.constructor;
        return new This({
            ...this._def,
            description,
        });
    }
    pipe(target) {
        return ZodPipeline.create(this, target);
    }
    readonly() {
        return ZodReadonly.create(this);
    }
    isOptional() {
        return this.safeParse(undefined).success;
    }
    isNullable() {
        return this.safeParse(null).success;
    }
}
const cuidRegex = /^c[^\s-]{8,}$/i;
const cuid2Regex = /^[0-9a-z]+$/;
const ulidRegex = /^[0-9A-HJKMNP-TV-Z]{26}$/;
// const uuidRegex =
//   /^([a-f0-9]{8}-[a-f0-9]{4}-[1-5][a-f0-9]{3}-[a-f0-9]{4}-[a-f0-9]{12}|00000000-0000-0000-0000-000000000000)$/i;
const uuidRegex = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i;
const nanoidRegex = /^[a-z0-9_-]{21}$/i;
const durationRegex = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/;
// from https://stackoverflow.com/a/46181/1550155
// old version: too slow, didn't support unicode
// const emailRegex = /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i;
//old email regex
// const emailRegex = /^(([^<>()[\].,;:\s@"]+(\.[^<>()[\].,;:\s@"]+)*)|(".+"))@((?!-)([^<>()[\].,;:\s@"]+\.)+[^<>()[\].,;:\s@"]{1,})[^-<>()[\].,;:\s@"]$/i;
// eslint-disable-next-line
// const emailRegex =
//   /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\])|(\[IPv6:(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))\])|([A-Za-z0-9]([A-Za-z0-9-]*[A-Za-z0-9])*(\.[A-Za-z]{2,})+))$/;
// const emailRegex =
//   /^[a-zA-Z0-9\.\!\#\$\%\&\'\*\+\/\=\?\^\_\`\{\|\}\~\-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;
// const emailRegex =
//   /^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$/i;
const emailRegex = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;
// const emailRegex =
//   /^[a-z0-9.!#$%&’*+/=?^_`{|}~-]+@[a-z0-9-]+(?:\.[a-z0-9\-]+)*$/i;
// from https://thekevinscott.com/emojis-in-javascript/#writing-a-regular-expression
const _emojiRegex = `^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;
let emojiRegex;
// faster, simpler, safer
const ipv4Regex = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/;
const ipv6Regex = /^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/;
// https://stackoverflow.com/questions/7860392/determine-if-string-is-in-base64-using-javascript
const base64Regex = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/;
// simple
// const dateRegexSource = `\\d{4}-\\d{2}-\\d{2}`;
// no leap year validation
// const dateRegexSource = `\\d{4}-((0[13578]|10|12)-31|(0[13-9]|1[0-2])-30|(0[1-9]|1[0-2])-(0[1-9]|1\\d|2\\d))`;
// with leap year validation
const dateRegexSource = `((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))`;
const dateRegex = new RegExp(`^${dateRegexSource}$`);
function timeRegexSource(args) {
    // let regex = `\\d{2}:\\d{2}:\\d{2}`;
    let regex = `([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d`;
    if (args.precision) {
        regex = `${regex}\\.\\d{${args.precision}}`;
    }
    else if (args.precision == null) {
        regex = `${regex}(\\.\\d+)?`;
    }
    return regex;
}
function timeRegex(args) {
    return new RegExp(`^${timeRegexSource(args)}$`);
}
// Adapted from https://stackoverflow.com/a/3143231
function datetimeRegex(args) {
    let regex = `${dateRegexSource}T${timeRegexSource(args)}`;
    const opts = [];
    opts.push(args.local ? `Z?` : `Z`);
    if (args.offset)
        opts.push(`([+-]\\d{2}:?\\d{2})`);
    regex = `${regex}(${opts.join("|")})`;
    return new RegExp(`^${regex}$`);
}
function isValidIP(ip, version) {
    if ((version === "v4" || !version) && ipv4Regex.test(ip)) {
        return true;
    }
    if ((version === "v6" || !version) && ipv6Regex.test(ip)) {
        return true;
    }
    return false;
}
class ZodString extends ZodType {
    _parse(input) {
        if (this._def.coerce) {
            input.data = String(input.data);
        }
        const parsedType = this._getType(input);
        if (parsedType !== ZodParsedType.string) {
            const ctx = this._getOrReturnCtx(input);
            addIssueToContext(ctx, {
                code: ZodIssueCode.invalid_type,
                expected: ZodParsedType.string,
                received: ctx.parsedType,
            });
            return INVALID;
        }
        const status = new ParseStatus();
        let ctx = undefined;
        for (const check of this._def.checks) {
            if (check.kind === "min") {
                if (input.data.length < check.value) {
                    ctx = this._getOrReturnCtx(input, ctx);
                    addIssueToContext(ctx, {
                        code: ZodIssueCode.too_small,
                        minimum: check.value,
                        type: "string",
                        inclusive: true,
                        exact: false,
                        message: check.message,
                    });
                    status.dirty();
                }
            }
            else if (check.kind === "max") {
                if (input.data.length > check.value) {
                    ctx = this._getOrReturnCtx(input, ctx);
                    addIssueToContext(ctx, {
                        code: ZodIssueCode.too_big,
                        maximum: check.value,
                        type: "string",
                        inclusive: true,
                        exact: false,
                        message: check.message,
                    });
                    status.dirty();
                }
            }
            else if (check.kind === "length") {
                const tooBig = input.data.length > check.value;
                const tooSmall = input.data.length < check.value;
                if (tooBig || tooSmall) {
                    ctx = this._getOrReturnCtx(input, ctx);
                    if (tooBig) {
                        addIssueToContext(ctx, {
                            code: ZodIssueCode.too_big,
                            maximum: check.value,
                            type: "string",
                            inclusive: true,
                            exact: true,
                            message: check.message,
                        });
                    }
                    else if (tooSmall) {
                        addIssueToContext(ctx, {
                            code: ZodIssueCode.too_small,
                            minimum: check.value,
                            type: "string",
                            inclusive: true,
                            exact: true,
                            message: check.message,
                        });
                    }
                    status.dirty();
                }
            }
            else if (check.kind === "email") {
                if (!emailRegex.test(input.data)) {
                    ctx = this._getOrReturnCtx(input, ctx);
                    addIssueToContext(ctx, {
                        validation: "email",
                        code: ZodIssueCode.invalid_string,
                        message: check.message,
                    });
                    status.dirty();
                }
            }
            else if (check.kind === "emoji") {
                if (!emojiRegex) {
                    emojiRegex = new RegExp(_emojiRegex, "u");
                }
                if (!emojiRegex.test(input.data)) {
                    ctx = this._getOrReturnCtx(input, ctx);
                    addIssueToContext(ctx, {
                        validation: "emoji",
                        code: ZodIssueCode.invalid_string,
                        message: check.message,
                    });
                    status.dirty();
                }
            }
            else if (check.kind === "uuid") {
                if (!uuidRegex.test(input.data)) {
                    ctx = this._getOrReturnCtx(input, ctx);
                    addIssueToContext(ctx, {
                        validation: "uuid",
                        code: ZodIssueCode.invalid_string,
                        message: check.message,
                    });
                    status.dirty();
                }
            }
            else if (check.kind === "nanoid") {
                if (!nanoidRegex.test(input.data)) {
                    ctx = this._getOrReturnCtx(input, ctx);
                    addIssueToContext(ctx, {
                        validation: "nanoid",
                        code: ZodIssueCode.invalid_string,
                        message: check.message,
                    });
                    status.dirty();
                }
            }
            else if (check.kind === "cuid") {
                if (!cuidRegex.test(input.data)) {
                    ctx = this._getOrReturnCtx(input, ctx);
                    addIssueToContext(ctx, {
                        validation: "cuid",
                        code: ZodIssueCode.invalid_string,
                        message: check.message,
                    });
                    status.dirty();
                }
            }
            else if (check.kind === "cuid2") {
                if (!cuid2Regex.test(input.data)) {
                    ctx = this._getOrReturnCtx(input, ctx);
                    addIssueToContext(ctx, {
                        validation: "cuid2",
                        code: ZodIssueCode.invalid_string,
                        message: check.message,
                    });
                    status.dirty();
                }
            }
            else if (check.kind === "ulid") {
                if (!ulidRegex.test(input.data)) {
                    ctx = this._getOrReturnCtx(input, ctx);
                    addIssueToContext(ctx, {
                        validation: "ulid",
                        code: ZodIssueCode.invalid_string,
                        message: check.message,
                    });
                    status.dirty();
                }
            }
            else if (check.kind === "url") {
                try {
                    new URL(input.data);
                }
                catch (_a) {
                    ctx = this._getOrReturnCtx(input, ctx);
                    addIssueToContext(ctx, {
                        validation: "url",
                        code: ZodIssueCode.invalid_string,
                        message: check.message,
                    });
                    status.dirty();
                }
            }
            else if (check.kind === "regex") {
                check.regex.lastIndex = 0;
                const testResult = check.regex.test(input.data);
                if (!testResult) {
                    ctx = this._getOrReturnCtx(input, ctx);
                    addIssueToContext(ctx, {
                        validation: "regex",
                        code: ZodIssueCode.invalid_string,
                        message: check.message,
                    });
                    status.dirty();
                }
            }
            else if (check.kind === "trim") {
                input.data = input.data.trim();
            }
            else if (check.kind === "includes") {
                if (!input.data.includes(check.value, check.position)) {
                    ctx = this._getOrReturnCtx(input, ctx);
                    addIssueToContext(ctx, {
                        code: ZodIssueCode.invalid_string,
                        validation: { includes: check.value, position: check.position },
                        message: check.message,
                    });
                    status.dirty();
                }
            }
            else if (check.kind === "toLowerCase") {
                input.data = input.data.toLowerCase();
            }
            else if (check.kind === "toUpperCase") {
                input.data = input.data.toUpperCase();
            }
            else if (check.kind === "startsWith") {
                if (!input.data.startsWith(check.value)) {
                    ctx = this._getOrReturnCtx(input, ctx);
                    addIssueToContext(ctx, {
                        code: ZodIssueCode.invalid_string,
                        validation: { startsWith: check.value },
                        message: check.message,
                    });
                    status.dirty();
                }
            }
            else if (check.kind === "endsWith") {
                if (!input.data.endsWith(check.value)) {
                    ctx = this._getOrReturnCtx(input, ctx);
                    addIssueToContext(ctx, {
                        code: ZodIssueCode.invalid_string,
                        validation: { endsWith: check.value },
                        message: check.message,
                    });
                    status.dirty();
                }
            }
            else if (check.kind === "datetime") {
                const regex = datetimeRegex(check);
                if (!regex.test(input.data)) {
                    ctx = this._getOrReturnCtx(input, ctx);
                    addIssueToContext(ctx, {
                        code: ZodIssueCode.invalid_string,
                        validation: "datetime",
                        message: check.message,
                    });
                    status.dirty();
                }
            }
            else if (check.kind === "date") {
                const regex = dateRegex;
                if (!regex.test(input.data)) {
                    ctx = this._getOrReturnCtx(input, ctx);
                    addIssueToContext(ctx, {
                        code: ZodIssueCode.invalid_string,
                        validation: "date",
                        message: check.message,
                    });
                    status.dirty();
                }
            }
            else if (check.kind === "time") {
                const regex = timeRegex(check);
                if (!regex.test(input.data)) {
                    ctx = this._getOrReturnCtx(input, ctx);
                    addIssueToContext(ctx, {
                        code: ZodIssueCode.invalid_string,
                        validation: "time",
                        message: check.message,
                    });
                    status.dirty();
                }
            }
            else if (check.kind === "duration") {
                if (!durationRegex.test(input.data)) {
                    ctx = this._getOrReturnCtx(input, ctx);
                    addIssueToContext(ctx, {
                        validation: "duration",
                        code: ZodIssueCode.invalid_string,
                        message: check.message,
                    });
                    status.dirty();
                }
            }
            else if (check.kind === "ip") {
                if (!isValidIP(input.data, check.version)) {
                    ctx = this._getOrReturnCtx(input, ctx);
                    addIssueToContext(ctx, {
                        validation: "ip",
                        code: ZodIssueCode.invalid_string,
                        message: check.message,
                    });
                    status.dirty();
                }
            }
            else if (check.kind === "base64") {
                if (!base64Regex.test(input.data)) {
                    ctx = this._getOrReturnCtx(input, ctx);
                    addIssueToContext(ctx, {
                        validation: "base64",
                        code: ZodIssueCode.invalid_string,
                        message: check.message,
                    });
                    status.dirty();
                }
            }
            else {
                util.assertNever(check);
            }
        }
        return { status: status.value, value: input.data };
    }
    _regex(regex, validation, message) {
        return this.refinement((data) => regex.test(data), {
            validation,
            code: ZodIssueCode.invalid_string,
            ...errorUtil.errToObj(message),
        });
    }
    _addCheck(check) {
        return new ZodString({
            ...this._def,
            checks: [...this._def.checks, check],
        });
    }
    email(message) {
        return this._addCheck({ kind: "email", ...errorUtil.errToObj(message) });
    }
    url(message) {
        return this._addCheck({ kind: "url", ...errorUtil.errToObj(message) });
    }
    emoji(message) {
        return this._addCheck({ kind: "emoji", ...errorUtil.errToObj(message) });
    }
    uuid(message) {
        return this._addCheck({ kind: "uuid", ...errorUtil.errToObj(message) });
    }
    nanoid(message) {
        return this._addCheck({ kind: "nanoid", ...errorUtil.errToObj(message) });
    }
    cuid(message) {
        return this._addCheck({ kind: "cuid", ...errorUtil.errToObj(message) });
    }
    cuid2(message) {
        return this._addCheck({ kind: "cuid2", ...errorUtil.errToObj(message) });
    }
    ulid(message) {
        return this._addCheck({ kind: "ulid", ...errorUtil.errToObj(message) });
    }
    base64(message) {
        return this._addCheck({ kind: "base64", ...errorUtil.errToObj(message) });
    }
    ip(options) {
        return this._addCheck({ kind: "ip", ...errorUtil.errToObj(options) });
    }
    datetime(options) {
        var _a, _b;
        if (typeof options === "string") {
            return this._addCheck({
                kind: "datetime",
                precision: null,
                offset: false,
                local: false,
                message: options,
            });
        }
        return this._addCheck({
            kind: "datetime",
            precision: typeof (options === null || options === void 0 ? void 0 : options.precision) === "undefined" ? null : options === null || options === void 0 ? void 0 : options.precision,
            offset: (_a = options === null || options === void 0 ? void 0 : options.offset) !== null && _a !== void 0 ? _a : false,
            local: (_b = options === null || options === void 0 ? void 0 : options.local) !== null && _b !== void 0 ? _b : false,
            ...errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message),
        });
    }
    date(message) {
        return this._addCheck({ kind: "date", message });
    }
    time(options) {
        if (typeof options === "string") {
            return this._addCheck({
                kind: "time",
                precision: null,
                message: options,
            });
        }
        return this._addCheck({
            kind: "time",
            precision: typeof (options === null || options === void 0 ? void 0 : options.precision) === "undefined" ? null : options === null || options === void 0 ? void 0 : options.precision,
            ...errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message),
        });
    }
    duration(message) {
        return this._addCheck({ kind: "duration", ...errorUtil.errToObj(message) });
    }
    regex(regex, message) {
        return this._addCheck({
            kind: "regex",
            regex: regex,
            ...errorUtil.errToObj(message),
        });
    }
    includes(value, options) {
        return this._addCheck({
            kind: "includes",
            value: value,
            position: options === null || options === void 0 ? void 0 : options.position,
            ...errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message),
        });
    }
    startsWith(value, message) {
        return this._addCheck({
            kind: "startsWith",
            value: value,
            ...errorUtil.errToObj(message),
        });
    }
    endsWith(value, message) {
        return this._addCheck({
            kind: "endsWith",
            value: value,
            ...errorUtil.errToObj(message),
        });
    }
    min(minLength, message) {
        return this._addCheck({
            kind: "min",
            value: minLength,
            ...errorUtil.errToObj(message),
        });
    }
    max(maxLength, message) {
        return this._addCheck({
            kind: "max",
            value: maxLength,
            ...errorUtil.errToObj(message),
        });
    }
    length(len, message) {
        return this._addCheck({
            kind: "length",
            value: len,
            ...errorUtil.errToObj(message),
        });
    }
    /**
     * @deprecated Use z.string().min(1) instead.
     * @see {@link ZodString.min}
     */
    nonempty(message) {
        return this.min(1, errorUtil.errToObj(message));
    }
    trim() {
        return new ZodString({
            ...this._def,
            checks: [...this._def.checks, { kind: "trim" }],
        });
    }
    toLowerCase() {
        return new ZodString({
            ...this._def,
            checks: [...this._def.checks, { kind: "toLowerCase" }],
        });
    }
    toUpperCase() {
        return new ZodString({
            ...this._def,
            checks: [...this._def.checks, { kind: "toUpperCase" }],
        });
    }
    get isDatetime() {
        return !!this._def.checks.find((ch) => ch.kind === "datetime");
    }
    get isDate() {
        return !!this._def.checks.find((ch) => ch.kind === "date");
    }
    get isTime() {
        return !!this._def.checks.find((ch) => ch.kind === "time");
    }
    get isDuration() {
        return !!this._def.checks.find((ch) => ch.kind === "duration");
    }
    get isEmail() {
        return !!this._def.checks.find((ch) => ch.kind === "email");
    }
    get isURL() {
        return !!this._def.checks.find((ch) => ch.kind === "url");
    }
    get isEmoji() {
        return !!this._def.checks.find((ch) => ch.kind === "emoji");
    }
    get isUUID() {
        return !!this._def.checks.find((ch) => ch.kind === "uuid");
    }
    get isNANOID() {
        return !!this._def.checks.find((ch) => ch.kind === "nanoid");
    }
    get isCUID() {
        return !!this._def.checks.find((ch) => ch.kind === "cuid");
    }
    get isCUID2() {
        return !!this._def.checks.find((ch) => ch.kind === "cuid2");
    }
    get isULID() {
        return !!this._def.checks.find((ch) => ch.kind === "ulid");
    }
    get isIP() {
        return !!this._def.checks.find((ch) => ch.kind === "ip");
    }
    get isBase64() {
        return !!this._def.checks.find((ch) => ch.kind === "base64");
    }
    get minLength() {
        let min = null;
        for (const ch of this._def.checks) {
            if (ch.kind === "min") {
                if (min === null || ch.value > min)
                    min = ch.value;
            }
        }
        return min;
    }
    get maxLength() {
        let max = null;
        for (const ch of this._def.checks) {
            if (ch.kind === "max") {
                if (max === null || ch.value < max)
                    max = ch.value;
            }
        }
        return max;
    }
}
ZodString.create = (params) => {
    var _a;
    return new ZodString({
        checks: [],
        typeName: ZodFirstPartyTypeKind.ZodString,
        coerce: (_a = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a !== void 0 ? _a : false,
        ...processCreateParams(params),
    });
};
// https://stackoverflow.com/questions/3966484/why-does-modulus-operator-return-fractional-number-in-javascript/31711034#31711034
function floatSafeRemainder(val, step) {
    const valDecCount = (val.toString().split(".")[1] || "").length;
    const stepDecCount = (step.toString().split(".")[1] || "").length;
    const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount;
    const valInt = parseInt(val.toFixed(decCount).replace(".", ""));
    const stepInt = parseInt(step.toFixed(decCount).replace(".", ""));
    return (valInt % stepInt) / Math.pow(10, decCount);
}
class ZodNumber extends ZodType {
    constructor() {
        super(...arguments);
        this.min = this.gte;
        this.max = this.lte;
        this.step = this.multipleOf;
    }
    _parse(input) {
        if (this._def.coerce) {
            input.data = Number(input.data);
        }
        const parsedType = this._getType(input);
        if (parsedType !== ZodParsedType.number) {
            const ctx = this._getOrReturnCtx(input);
            addIssueToContext(ctx, {
                code: ZodIssueCode.invalid_type,
                expected: ZodParsedType.number,
                received: ctx.parsedType,
            });
            return INVALID;
        }
        let ctx = undefined;
        const status = new ParseStatus();
        for (const check of this._def.checks) {
            if (check.kind === "int") {
                if (!util.isInteger(input.data)) {
                    ctx = this._getOrReturnCtx(input, ctx);
                    addIssueToContext(ctx, {
                        code: ZodIssueCode.invalid_type,
                        expected: "integer",
                        received: "float",
                        message: check.message,
                    });
                    status.dirty();
                }
            }
            else if (check.kind === "min") {
                const tooSmall = check.inclusive
                    ? input.data < check.value
                    : input.data <= check.value;
                if (tooSmall) {
                    ctx = this._getOrReturnCtx(input, ctx);
                    addIssueToContext(ctx, {
                        code: ZodIssueCode.too_small,
                        minimum: check.value,
                        type: "number",
                        inclusive: check.inclusive,
                        exact: false,
                        message: check.message,
                    });
                    status.dirty();
                }
            }
            else if (check.kind === "max") {
                const tooBig = check.inclusive
                    ? input.data > check.value
                    : input.data >= check.value;
                if (tooBig) {
                    ctx = this._getOrReturnCtx(input, ctx);
                    addIssueToContext(ctx, {
                        code: ZodIssueCode.too_big,
                        maximum: check.value,
                        type: "number",
                        inclusive: check.inclusive,
                        exact: false,
                        message: check.message,
                    });
                    status.dirty();
                }
            }
            else if (check.kind === "multipleOf") {
                if (floatSafeRemainder(input.data, check.value) !== 0) {
                    ctx = this._getOrReturnCtx(input, ctx);
                    addIssueToContext(ctx, {
                        code: ZodIssueCode.not_multiple_of,
                        multipleOf: check.value,
                        message: check.message,
                    });
                    status.dirty();
                }
            }
            else if (check.kind === "finite") {
                if (!Number.isFinite(input.data)) {
                    ctx = this._getOrReturnCtx(input, ctx);
                    addIssueToContext(ctx, {
                        code: ZodIssueCode.not_finite,
                        message: check.message,
                    });
                    status.dirty();
                }
            }
            else {
                util.assertNever(check);
            }
        }
        return { status: status.value, value: input.data };
    }
    gte(value, message) {
        return this.setLimit("min", value, true, errorUtil.toString(message));
    }
    gt(value, message) {
        return this.setLimit("min", value, false, errorUtil.toString(message));
    }
    lte(value, message) {
        return this.setLimit("max", value, true, errorUtil.toString(message));
    }
    lt(value, message) {
        return this.setLimit("max", value, false, errorUtil.toString(message));
    }
    setLimit(kind, value, inclusive, message) {
        return new ZodNumber({
            ...this._def,
            checks: [
                ...this._def.checks,
                {
                    kind,
                    value,
                    inclusive,
                    message: errorUtil.toString(message),
                },
            ],
        });
    }
    _addCheck(check) {
        return new ZodNumber({
            ...this._def,
            checks: [...this._def.checks, check],
        });
    }
    int(message) {
        return this._addCheck({
            kind: "int",
            message: errorUtil.toString(message),
        });
    }
    positive(message) {
        return this._addCheck({
            kind: "min",
            value: 0,
            inclusive: false,
            message: errorUtil.toString(message),
        });
    }
    negative(message) {
        return this._addCheck({
            kind: "max",
            value: 0,
            inclusive: false,
            message: errorUtil.toString(message),
        });
    }
    nonpositive(message) {
        return this._addCheck({
            kind: "max",
            value: 0,
            inclusive: true,
            message: errorUtil.toString(message),
        });
    }
    nonnegative(message) {
        return this._addCheck({
            kind: "min",
            value: 0,
            inclusive: true,
            message: errorUtil.toString(message),
        });
    }
    multipleOf(value, message) {
        return this._addCheck({
            kind: "multipleOf",
            value: value,
            message: errorUtil.toString(message),
        });
    }
    finite(message) {
        return this._addCheck({
            kind: "finite",
            message: errorUtil.toString(message),
        });
    }
    safe(message) {
        return this._addCheck({
            kind: "min",
            inclusive: true,
            value: Number.MIN_SAFE_INTEGER,
            message: errorUtil.toString(message),
        })._addCheck({
            kind: "max",
            inclusive: true,
            value: Number.MAX_SAFE_INTEGER,
            message: errorUtil.toString(message),
        });
    }
    get minValue() {
        let min = null;
        for (const ch of this._def.checks) {
            if (ch.kind === "min") {
                if (min === null || ch.value > min)
                    min = ch.value;
            }
        }
        return min;
    }
    get maxValue() {
        let max = null;
        for (const ch of this._def.checks) {
            if (ch.kind === "max") {
                if (max === null || ch.value < max)
                    max = ch.value;
            }
        }
        return max;
    }
    get isInt() {
        return !!this._def.checks.find((ch) => ch.kind === "int" ||
            (ch.kind === "multipleOf" && util.isInteger(ch.value)));
    }
    get isFinite() {
        let max = null, min = null;
        for (const ch of this._def.checks) {
            if (ch.kind === "finite" ||
                ch.kind === "int" ||
                ch.kind === "multipleOf") {
                return true;
            }
            else if (ch.kind === "min") {
                if (min === null || ch.value > min)
                    min = ch.value;
            }
            else if (ch.kind === "max") {
                if (max === null || ch.value < max)
                    max = ch.value;
            }
        }
        return Number.isFinite(min) && Number.isFinite(max);
    }
}
ZodNumber.create = (params) => {
    return new ZodNumber({
        checks: [],
        typeName: ZodFirstPartyTypeKind.ZodNumber,
        coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false,
        ...processCreateParams(params),
    });
};
class ZodBigInt extends ZodType {
    constructor() {
        super(...arguments);
        this.min = this.gte;
        this.max = this.lte;
    }
    _parse(input) {
        if (this._def.coerce) {
            input.data = BigInt(input.data);
        }
        const parsedType = this._getType(input);
        if (parsedType !== ZodParsedType.bigint) {
            const ctx = this._getOrReturnCtx(input);
            addIssueToContext(ctx, {
                code: ZodIssueCode.invalid_type,
                expected: ZodParsedType.bigint,
                received: ctx.parsedType,
            });
            return INVALID;
        }
        let ctx = undefined;
        const status = new ParseStatus();
        for (const check of this._def.checks) {
            if (check.kind === "min") {
                const tooSmall = check.inclusive
                    ? input.data < check.value
                    : input.data <= check.value;
                if (tooSmall) {
                    ctx = this._getOrReturnCtx(input, ctx);
                    addIssueToContext(ctx, {
                        code: ZodIssueCode.too_small,
                        type: "bigint",
                        minimum: check.value,
                        inclusive: check.inclusive,
                        message: check.message,
                    });
                    status.dirty();
                }
            }
            else if (check.kind === "max") {
                const tooBig = check.inclusive
                    ? input.data > check.value
                    : input.data >= check.value;
                if (tooBig) {
                    ctx = this._getOrReturnCtx(input, ctx);
                    addIssueToContext(ctx, {
                        code: ZodIssueCode.too_big,
                        type: "bigint",
                        maximum: check.value,
                        inclusive: check.inclusive,
                        message: check.message,
                    });
                    status.dirty();
                }
            }
            else if (check.kind === "multipleOf") {
                if (input.data % check.value !== BigInt(0)) {
                    ctx = this._getOrReturnCtx(input, ctx);
                    addIssueToContext(ctx, {
                        code: ZodIssueCode.not_multiple_of,
                        multipleOf: check.value,
                        message: check.message,
                    });
                    status.dirty();
                }
            }
            else {
                util.assertNever(check);
            }
        }
        return { status: status.value, value: input.data };
    }
    gte(value, message) {
        return this.setLimit("min", value, true, errorUtil.toString(message));
    }
    gt(value, message) {
        return this.setLimit("min", value, false, errorUtil.toString(message));
    }
    lte(value, message) {
        return this.setLimit("max", value, true, errorUtil.toString(message));
    }
    lt(value, message) {
        return this.setLimit("max", value, false, errorUtil.toString(message));
    }
    setLimit(kind, value, inclusive, message) {
        return new ZodBigInt({
            ...this._def,
            checks: [
                ...this._def.checks,
                {
                    kind,
                    value,
                    inclusive,
                    message: errorUtil.toString(message),
                },
            ],
        });
    }
    _addCheck(check) {
        return new ZodBigInt({
            ...this._def,
            checks: [...this._def.checks, check],
        });
    }
    positive(message) {
        return this._addCheck({
            kind: "min",
            value: BigInt(0),
            inclusive: false,
            message: errorUtil.toString(message),
        });
    }
    negative(message) {
        return this._addCheck({
            kind: "max",
            value: BigInt(0),
            inclusive: false,
            message: errorUtil.toString(message),
        });
    }
    nonpositive(message) {
        return this._addCheck({
            kind: "max",
            value: BigInt(0),
            inclusive: true,
            message: errorUtil.toString(message),
        });
    }
    nonnegative(message) {
        return this._addCheck({
            kind: "min",
            value: BigInt(0),
            inclusive: true,
            message: errorUtil.toString(message),
        });
    }
    multipleOf(value, message) {
        return this._addCheck({
            kind: "multipleOf",
            value,
            message: errorUtil.toString(message),
        });
    }
    get minValue() {
        let min = null;
        for (const ch of this._def.checks) {
            if (ch.kind === "min") {
                if (min === null || ch.value > min)
                    min = ch.value;
            }
        }
        return min;
    }
    get maxValue() {
        let max = null;
        for (const ch of this._def.checks) {
            if (ch.kind === "max") {
                if (max === null || ch.value < max)
                    max = ch.value;
            }
        }
        return max;
    }
}
ZodBigInt.create = (params) => {
    var _a;
    return new ZodBigInt({
        checks: [],
        typeName: ZodFirstPartyTypeKind.ZodBigInt,
        coerce: (_a = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a !== void 0 ? _a : false,
        ...processCreateParams(params),
    });
};
class ZodBoolean extends ZodType {
    _parse(input) {
        if (this._def.coerce) {
            input.data = Boolean(input.data);
        }
        const parsedType = this._getType(input);
        if (parsedType !== ZodParsedType.boolean) {
            const ctx = this._getOrReturnCtx(input);
            addIssueToContext(ctx, {
                code: ZodIssueCode.invalid_type,
                expected: ZodParsedType.boolean,
                received: ctx.parsedType,
            });
            return INVALID;
        }
        return OK(input.data);
    }
}
ZodBoolean.create = (params) => {
    return new ZodBoolean({
        typeName: ZodFirstPartyTypeKind.ZodBoolean,
        coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false,
        ...processCreateParams(params),
    });
};
class ZodDate extends ZodType {
    _parse(input) {
        if (this._def.coerce) {
            input.data = new Date(input.data);
        }
        const parsedType = this._getType(input);
        if (parsedType !== ZodParsedType.date) {
            const ctx = this._getOrReturnCtx(input);
            addIssueToContext(ctx, {
                code: ZodIssueCode.invalid_type,
                expected: ZodParsedType.date,
                received: ctx.parsedType,
            });
            return INVALID;
        }
        if (isNaN(input.data.getTime())) {
            const ctx = this._getOrReturnCtx(input);
            addIssueToContext(ctx, {
                code: ZodIssueCode.invalid_date,
            });
            return INVALID;
        }
        const status = new ParseStatus();
        let ctx = undefined;
        for (const check of this._def.checks) {
            if (check.kind === "min") {
                if (input.data.getTime() < check.value) {
                    ctx = this._getOrReturnCtx(input, ctx);
                    addIssueToContext(ctx, {
                        code: ZodIssueCode.too_small,
                        message: check.message,
                        inclusive: true,
                        exact: false,
                        minimum: check.value,
                        type: "date",
                    });
                    status.dirty();
                }
            }
            else if (check.kind === "max") {
                if (input.data.getTime() > check.value) {
                    ctx = this._getOrReturnCtx(input, ctx);
                    addIssueToContext(ctx, {
                        code: ZodIssueCode.too_big,
                        message: check.message,
                        inclusive: true,
                        exact: false,
                        maximum: check.value,
                        type: "date",
                    });
                    status.dirty();
                }
            }
            else {
                util.assertNever(check);
            }
        }
        return {
            status: status.value,
            value: new Date(input.data.getTime()),
        };
    }
    _addCheck(check) {
        return new ZodDate({
            ...this._def,
            checks: [...this._def.checks, check],
        });
    }
    min(minDate, message) {
        return this._addCheck({
            kind: "min",
            value: minDate.getTime(),
            message: errorUtil.toString(message),
        });
    }
    max(maxDate, message) {
        return this._addCheck({
            kind: "max",
            value: maxDate.getTime(),
            message: errorUtil.toString(message),
        });
    }
    get minDate() {
        let min = null;
        for (const ch of this._def.checks) {
            if (ch.kind === "min") {
                if (min === null || ch.value > min)
                    min = ch.value;
            }
        }
        return min != null ? new Date(min) : null;
    }
    get maxDate() {
        let max = null;
        for (const ch of this._def.checks) {
            if (ch.kind === "max") {
                if (max === null || ch.value < max)
                    max = ch.value;
            }
        }
        return max != null ? new Date(max) : null;
    }
}
ZodDate.create = (params) => {
    return new ZodDate({
        checks: [],
        coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false,
        typeName: ZodFirstPartyTypeKind.ZodDate,
        ...processCreateParams(params),
    });
};
class ZodSymbol extends ZodType {
    _parse(input) {
        const parsedType = this._getType(input);
        if (parsedType !== ZodParsedType.symbol) {
            const ctx = this._getOrReturnCtx(input);
            addIssueToContext(ctx, {
                code: ZodIssueCode.invalid_type,
                expected: ZodParsedType.symbol,
                received: ctx.parsedType,
            });
            return INVALID;
        }
        return OK(input.data);
    }
}
ZodSymbol.create = (params) => {
    return new ZodSymbol({
        typeName: ZodFirstPartyTypeKind.ZodSymbol,
        ...processCreateParams(params),
    });
};
class ZodUndefined extends ZodType {
    _parse(input) {
        const parsedType = this._getType(input);
        if (parsedType !== ZodParsedType.undefined) {
            const ctx = this._getOrReturnCtx(input);
            addIssueToContext(ctx, {
                code: ZodIssueCode.invalid_type,
                expected: ZodParsedType.undefined,
                received: ctx.parsedType,
            });
            return INVALID;
        }
        return OK(input.data);
    }
}
ZodUndefined.create = (params) => {
    return new ZodUndefined({
        typeName: ZodFirstPartyTypeKind.ZodUndefined,
        ...processCreateParams(params),
    });
};
class ZodNull extends ZodType {
    _parse(input) {
        const parsedType = this._getType(input);
        if (parsedType !== ZodParsedType.null) {
            const ctx = this._getOrReturnCtx(input);
            addIssueToContext(ctx, {
                code: ZodIssueCode.invalid_type,
                expected: ZodParsedType.null,
                received: ctx.parsedType,
            });
            return INVALID;
        }
        return OK(input.data);
    }
}
ZodNull.create = (params) => {
    return new ZodNull({
        typeName: ZodFirstPartyTypeKind.ZodNull,
        ...processCreateParams(params),
    });
};
class ZodAny extends ZodType {
    constructor() {
        super(...arguments);
        // to prevent instances of other classes from extending ZodAny. this causes issues with catchall in ZodObject.
        this._any = true;
    }
    _parse(input) {
        return OK(input.data);
    }
}
ZodAny.create = (params) => {
    return new ZodAny({
        typeName: ZodFirstPartyTypeKind.ZodAny,
        ...processCreateParams(params),
    });
};
class ZodUnknown extends ZodType {
    constructor() {
        super(...arguments);
        // required
        this._unknown = true;
    }
    _parse(input) {
        return OK(input.data);
    }
}
ZodUnknown.create = (params) => {
    return new ZodUnknown({
        typeName: ZodFirstPartyTypeKind.ZodUnknown,
        ...processCreateParams(params),
    });
};
class ZodNever extends ZodType {
    _parse(input) {
        const ctx = this._getOrReturnCtx(input);
        addIssueToContext(ctx, {
            code: ZodIssueCode.invalid_type,
            expected: ZodParsedType.never,
            received: ctx.parsedType,
        });
        return INVALID;
    }
}
ZodNever.create = (params) => {
    return new ZodNever({
        typeName: ZodFirstPartyTypeKind.ZodNever,
        ...processCreateParams(params),
    });
};
class ZodVoid extends ZodType {
    _parse(input) {
        const parsedType = this._getType(input);
        if (parsedType !== ZodParsedType.undefined) {
            const ctx = this._getOrReturnCtx(input);
            addIssueToContext(ctx, {
                code: ZodIssueCode.invalid_type,
                expected: ZodParsedType.void,
                received: ctx.parsedType,
            });
            return INVALID;
        }
        return OK(input.data);
    }
}
ZodVoid.create = (params) => {
    return new ZodVoid({
        typeName: ZodFirstPartyTypeKind.ZodVoid,
        ...processCreateParams(params),
    });
};
class ZodArray extends ZodType {
    _parse(input) {
        const { ctx, status } = this._processInputParams(input);
        const def = this._def;
        if (ctx.parsedType !== ZodParsedType.array) {
            addIssueToContext(ctx, {
                code: ZodIssueCode.invalid_type,
                expected: ZodParsedType.array,
                received: ctx.parsedType,
            });
            return INVALID;
        }
        if (def.exactLength !== null) {
            const tooBig = ctx.data.length > def.exactLength.value;
            const tooSmall = ctx.data.length < def.exactLength.value;
            if (tooBig || tooSmall) {
                addIssueToContext(ctx, {
                    code: tooBig ? ZodIssueCode.too_big : ZodIssueCode.too_small,
                    minimum: (tooSmall ? def.exactLength.value : undefined),
                    maximum: (tooBig ? def.exactLength.value : undefined),
                    type: "array",
                    inclusive: true,
                    exact: true,
                    message: def.exactLength.message,
                });
                status.dirty();
            }
        }
        if (def.minLength !== null) {
            if (ctx.data.length < def.minLength.value) {
                addIssueToContext(ctx, {
                    code: ZodIssueCode.too_small,
                    minimum: def.minLength.value,
                    type: "array",
                    inclusive: true,
                    exact: false,
                    message: def.minLength.message,
                });
                status.dirty();
            }
        }
        if (def.maxLength !== null) {
            if (ctx.data.length > def.maxLength.value) {
                addIssueToContext(ctx, {
                    code: ZodIssueCode.too_big,
                    maximum: def.maxLength.value,
                    type: "array",
                    inclusive: true,
                    exact: false,
                    message: def.maxLength.message,
                });
                status.dirty();
            }
        }
        if (ctx.common.async) {
            return Promise.all([...ctx.data].map((item, i) => {
                return def.type._parseAsync(new ParseInputLazyPath(ctx, item, ctx.path, i));
            })).then((result) => {
                return ParseStatus.mergeArray(status, result);
            });
        }
        const result = [...ctx.data].map((item, i) => {
            return def.type._parseSync(new ParseInputLazyPath(ctx, item, ctx.path, i));
        });
        return ParseStatus.mergeArray(status, result);
    }
    get element() {
        return this._def.type;
    }
    min(minLength, message) {
        return new ZodArray({
            ...this._def,
            minLength: { value: minLength, message: errorUtil.toString(message) },
        });
    }
    max(maxLength, message) {
        return new ZodArray({
            ...this._def,
            maxLength: { value: maxLength, message: errorUtil.toString(message) },
        });
    }
    length(len, message) {
        return new ZodArray({
            ...this._def,
            exactLength: { value: len, message: errorUtil.toString(message) },
        });
    }
    nonempty(message) {
        return this.min(1, message);
    }
}
ZodArray.create = (schema, params) => {
    return new ZodArray({
        type: schema,
        minLength: null,
        maxLength: null,
        exactLength: null,
        typeName: ZodFirstPartyTypeKind.ZodArray,
        ...processCreateParams(params),
    });
};
function deepPartialify(schema) {
    if (schema instanceof ZodObject) {
        const newShape = {};
        for (const key in schema.shape) {
            const fieldSchema = schema.shape[key];
            newShape[key] = ZodOptional.create(deepPartialify(fieldSchema));
        }
        return new ZodObject({
            ...schema._def,
            shape: () => newShape,
        });
    }
    else if (schema instanceof ZodArray) {
        return new ZodArray({
            ...schema._def,
            type: deepPartialify(schema.element),
        });
    }
    else if (schema instanceof ZodOptional) {
        return ZodOptional.create(deepPartialify(schema.unwrap()));
    }
    else if (schema instanceof ZodNullable) {
        return ZodNullable.create(deepPartialify(schema.unwrap()));
    }
    else if (schema instanceof ZodTuple) {
        return ZodTuple.create(schema.items.map((item) => deepPartialify(item)));
    }
    else {
        return schema;
    }
}
class ZodObject extends ZodType {
    constructor() {
        super(...arguments);
        this._cached = null;
        /**
         * @deprecated In most cases, this is no longer needed - unknown properties are now silently stripped.
         * If you want to pass through unknown properties, use `.passthrough()` instead.
         */
        this.nonstrict = this.passthrough;
        // extend<
        //   Augmentation extends ZodRawShape,
        //   NewOutput extends util.flatten<{
        //     [k in keyof Augmentation | keyof Output]: k extends keyof Augmentation
        //       ? Augmentation[k]["_output"]
        //       : k extends keyof Output
        //       ? Output[k]
        //       : never;
        //   }>,
        //   NewInput extends util.flatten<{
        //     [k in keyof Augmentation | keyof Input]: k extends keyof Augmentation
        //       ? Augmentation[k]["_input"]
        //       : k extends keyof Input
        //       ? Input[k]
        //       : never;
        //   }>
        // >(
        //   augmentation: Augmentation
        // ): ZodObject<
        //   extendShape<T, Augmentation>,
        //   UnknownKeys,
        //   Catchall,
        //   NewOutput,
        //   NewInput
        // > {
        //   return new ZodObject({
        //     ...this._def,
        //     shape: () => ({
        //       ...this._def.shape(),
        //       ...augmentation,
        //     }),
        //   }) as any;
        // }
        /**
         * @deprecated Use `.extend` instead
         *  */
        this.augment = this.extend;
    }
    _getCached() {
        if (this._cached !== null)
            return this._cached;
        const shape = this._def.shape();
        const keys = util.objectKeys(shape);
        return (this._cached = { shape, keys });
    }
    _parse(input) {
        const parsedType = this._getType(input);
        if (parsedType !== ZodParsedType.object) {
            const ctx = this._getOrReturnCtx(input);
            addIssueToContext(ctx, {
                code: ZodIssueCode.invalid_type,
                expected: ZodParsedType.object,
                received: ctx.parsedType,
            });
            return INVALID;
        }
        const { status, ctx } = this._processInputParams(input);
        const { shape, keys: shapeKeys } = this._getCached();
        const extraKeys = [];
        if (!(this._def.catchall instanceof ZodNever &&
            this._def.unknownKeys === "strip")) {
            for (const key in ctx.data) {
                if (!shapeKeys.includes(key)) {
                    extraKeys.push(key);
                }
            }
        }
        const pairs = [];
        for (const key of shapeKeys) {
            const keyValidator = shape[key];
            const value = ctx.data[key];
            pairs.push({
                key: { status: "valid", value: key },
                value: keyValidator._parse(new ParseInputLazyPath(ctx, value, ctx.path, key)),
                alwaysSet: key in ctx.data,
            });
        }
        if (this._def.catchall instanceof ZodNever) {
            const unknownKeys = this._def.unknownKeys;
            if (unknownKeys === "passthrough") {
                for (const key of extraKeys) {
                    pairs.push({
                        key: { status: "valid", value: key },
                        value: { status: "valid", value: ctx.data[key] },
                    });
                }
            }
            else if (unknownKeys === "strict") {
                if (extraKeys.length > 0) {
                    addIssueToContext(ctx, {
                        code: ZodIssueCode.unrecognized_keys,
                        keys: extraKeys,
                    });
                    status.dirty();
                }
            }
            else if (unknownKeys === "strip") ;
            else {
                throw new Error(`Internal ZodObject error: invalid unknownKeys value.`);
            }
        }
        else {
            // run catchall validation
            const catchall = this._def.catchall;
            for (const key of extraKeys) {
                const value = ctx.data[key];
                pairs.push({
                    key: { status: "valid", value: key },
                    value: catchall._parse(new ParseInputLazyPath(ctx, value, ctx.path, key) //, ctx.child(key), value, getParsedType(value)
                    ),
                    alwaysSet: key in ctx.data,
                });
            }
        }
        if (ctx.common.async) {
            return Promise.resolve()
                .then(async () => {
                const syncPairs = [];
                for (const pair of pairs) {
                    const key = await pair.key;
                    const value = await pair.value;
                    syncPairs.push({
                        key,
                        value,
                        alwaysSet: pair.alwaysSet,
                    });
                }
                return syncPairs;
            })
                .then((syncPairs) => {
                return ParseStatus.mergeObjectSync(status, syncPairs);
            });
        }
        else {
            return ParseStatus.mergeObjectSync(status, pairs);
        }
    }
    get shape() {
        return this._def.shape();
    }
    strict(message) {
        errorUtil.errToObj;
        return new ZodObject({
            ...this._def,
            unknownKeys: "strict",
            ...(message !== undefined
                ? {
                    errorMap: (issue, ctx) => {
                        var _a, _b, _c, _d;
                        const defaultError = (_c = (_b = (_a = this._def).errorMap) === null || _b === void 0 ? void 0 : _b.call(_a, issue, ctx).message) !== null && _c !== void 0 ? _c : ctx.defaultError;
                        if (issue.code === "unrecognized_keys")
                            return {
                                message: (_d = errorUtil.errToObj(message).message) !== null && _d !== void 0 ? _d : defaultError,
                            };
                        return {
                            message: defaultError,
                        };
                    },
                }
                : {}),
        });
    }
    strip() {
        return new ZodObject({
            ...this._def,
            unknownKeys: "strip",
        });
    }
    passthrough() {
        return new ZodObject({
            ...this._def,
            unknownKeys: "passthrough",
        });
    }
    // const AugmentFactory =
    //   <Def extends ZodObjectDef>(def: Def) =>
    //   <Augmentation extends ZodRawShape>(
    //     augmentation: Augmentation
    //   ): ZodObject<
    //     extendShape<ReturnType<Def["shape"]>, Augmentation>,
    //     Def["unknownKeys"],
    //     Def["catchall"]
    //   > => {
    //     return new ZodObject({
    //       ...def,
    //       shape: () => ({
    //         ...def.shape(),
    //         ...augmentation,
    //       }),
    //     }) as any;
    //   };
    extend(augmentation) {
        return new ZodObject({
            ...this._def,
            shape: () => ({
                ...this._def.shape(),
                ...augmentation,
            }),
        });
    }
    /**
     * Prior to zod@1.0.12 there was a bug in the
     * inferred type of merged objects. Please
     * upgrade if you are experiencing issues.
     */
    merge(merging) {
        const merged = new ZodObject({
            unknownKeys: merging._def.unknownKeys,
            catchall: merging._def.catchall,
            shape: () => ({
                ...this._def.shape(),
                ...merging._def.shape(),
            }),
            typeName: ZodFirstPartyTypeKind.ZodObject,
        });
        return merged;
    }
    // merge<
    //   Incoming extends AnyZodObject,
    //   Augmentation extends Incoming["shape"],
    //   NewOutput extends {
    //     [k in keyof Augmentation | keyof Output]: k extends keyof Augmentation
    //       ? Augmentation[k]["_output"]
    //       : k extends keyof Output
    //       ? Output[k]
    //       : never;
    //   },
    //   NewInput extends {
    //     [k in keyof Augmentation | keyof Input]: k extends keyof Augmentation
    //       ? Augmentation[k]["_input"]
    //       : k extends keyof Input
    //       ? Input[k]
    //       : never;
    //   }
    // >(
    //   merging: Incoming
    // ): ZodObject<
    //   extendShape<T, ReturnType<Incoming["_def"]["shape"]>>,
    //   Incoming["_def"]["unknownKeys"],
    //   Incoming["_def"]["catchall"],
    //   NewOutput,
    //   NewInput
    // > {
    //   const merged: any = new ZodObject({
    //     unknownKeys: merging._def.unknownKeys,
    //     catchall: merging._def.catchall,
    //     shape: () =>
    //       objectUtil.mergeShapes(this._def.shape(), merging._def.shape()),
    //     typeName: ZodFirstPartyTypeKind.ZodObject,
    //   }) as any;
    //   return merged;
    // }
    setKey(key, schema) {
        return this.augment({ [key]: schema });
    }
    // merge<Incoming extends AnyZodObject>(
    //   merging: Incoming
    // ): //ZodObject<T & Incoming["_shape"], UnknownKeys, Catchall> = (merging) => {
    // ZodObject<
    //   extendShape<T, ReturnType<Incoming["_def"]["shape"]>>,
    //   Incoming["_def"]["unknownKeys"],
    //   Incoming["_def"]["catchall"]
    // > {
    //   // const mergedShape = objectUtil.mergeShapes(
    //   //   this._def.shape(),
    //   //   merging._def.shape()
    //   // );
    //   const merged: any = new ZodObject({
    //     unknownKeys: merging._def.unknownKeys,
    //     catchall: merging._def.catchall,
    //     shape: () =>
    //       objectUtil.mergeShapes(this._def.shape(), merging._def.shape()),
    //     typeName: ZodFirstPartyTypeKind.ZodObject,
    //   }) as any;
    //   return merged;
    // }
    catchall(index) {
        return new ZodObject({
            ...this._def,
            catchall: index,
        });
    }
    pick(mask) {
        const shape = {};
        util.objectKeys(mask).forEach((key) => {
            if (mask[key] && this.shape[key]) {
                shape[key] = this.shape[key];
            }
        });
        return new ZodObject({
            ...this._def,
            shape: () => shape,
        });
    }
    omit(mask) {
        const shape = {};
        util.objectKeys(this.shape).forEach((key) => {
            if (!mask[key]) {
                shape[key] = this.shape[key];
            }
        });
        return new ZodObject({
            ...this._def,
            shape: () => shape,
        });
    }
    /**
     * @deprecated
     */
    deepPartial() {
        return deepPartialify(this);
    }
    partial(mask) {
        const newShape = {};
        util.objectKeys(this.shape).forEach((key) => {
            const fieldSchema = this.shape[key];
            if (mask && !mask[key]) {
                newShape[key] = fieldSchema;
            }
            else {
                newShape[key] = fieldSchema.optional();
            }
        });
        return new ZodObject({
            ...this._def,
            shape: () => newShape,
        });
    }
    required(mask) {
        const newShape = {};
        util.objectKeys(this.shape).forEach((key) => {
            if (mask && !mask[key]) {
                newShape[key] = this.shape[key];
            }
            else {
                const fieldSchema = this.shape[key];
                let newField = fieldSchema;
                while (newField instanceof ZodOptional) {
                    newField = newField._def.innerType;
                }
                newShape[key] = newField;
            }
        });
        return new ZodObject({
            ...this._def,
            shape: () => newShape,
        });
    }
    keyof() {
        return createZodEnum(util.objectKeys(this.shape));
    }
}
ZodObject.create = (shape, params) => {
    return new ZodObject({
        shape: () => shape,
        unknownKeys: "strip",
        catchall: ZodNever.create(),
        typeName: ZodFirstPartyTypeKind.ZodObject,
        ...processCreateParams(params),
    });
};
ZodObject.strictCreate = (shape, params) => {
    return new ZodObject({
        shape: () => shape,
        unknownKeys: "strict",
        catchall: ZodNever.create(),
        typeName: ZodFirstPartyTypeKind.ZodObject,
        ...processCreateParams(params),
    });
};
ZodObject.lazycreate = (shape, params) => {
    return new ZodObject({
        shape,
        unknownKeys: "strip",
        catchall: ZodNever.create(),
        typeName: ZodFirstPartyTypeKind.ZodObject,
        ...processCreateParams(params),
    });
};
class ZodUnion extends ZodType {
    _parse(input) {
        const { ctx } = this._processInputParams(input);
        const options = this._def.options;
        function handleResults(results) {
            // return first issue-free validation if it exists
            for (const result of results) {
                if (result.result.status === "valid") {
                    return result.result;
                }
            }
            for (const result of results) {
                if (result.result.status === "dirty") {
                    // add issues from dirty option
                    ctx.common.issues.push(...result.ctx.common.issues);
                    return result.result;
                }
            }
            // return invalid
            const unionErrors = results.map((result) => new ZodError(result.ctx.common.issues));
            addIssueToContext(ctx, {
                code: ZodIssueCode.invalid_union,
                unionErrors,
            });
            return INVALID;
        }
        if (ctx.common.async) {
            return Promise.all(options.map(async (option) => {
                const childCtx = {
                    ...ctx,
                    common: {
                        ...ctx.common,
                        issues: [],
                    },
                    parent: null,
                };
                return {
                    result: await option._parseAsync({
                        data: ctx.data,
                        path: ctx.path,
                        parent: childCtx,
                    }),
                    ctx: childCtx,
                };
            })).then(handleResults);
        }
        else {
            let dirty = undefined;
            const issues = [];
            for (const option of options) {
                const childCtx = {
                    ...ctx,
                    common: {
                        ...ctx.common,
                        issues: [],
                    },
                    parent: null,
                };
                const result = option._parseSync({
                    data: ctx.data,
                    path: ctx.path,
                    parent: childCtx,
                });
                if (result.status === "valid") {
                    return result;
                }
                else if (result.status === "dirty" && !dirty) {
                    dirty = { result, ctx: childCtx };
                }
                if (childCtx.common.issues.length) {
                    issues.push(childCtx.common.issues);
                }
            }
            if (dirty) {
                ctx.common.issues.push(...dirty.ctx.common.issues);
                return dirty.result;
            }
            const unionErrors = issues.map((issues) => new ZodError(issues));
            addIssueToContext(ctx, {
                code: ZodIssueCode.invalid_union,
                unionErrors,
            });
            return INVALID;
        }
    }
    get options() {
        return this._def.options;
    }
}
ZodUnion.create = (types, params) => {
    return new ZodUnion({
        options: types,
        typeName: ZodFirstPartyTypeKind.ZodUnion,
        ...processCreateParams(params),
    });
};
/////////////////////////////////////////////////////
/////////////////////////////////////////////////////
//////////                                 //////////
//////////      ZodDiscriminatedUnion      //////////
//////////                                 //////////
/////////////////////////////////////////////////////
/////////////////////////////////////////////////////
const getDiscriminator = (type) => {
    if (type instanceof ZodLazy) {
        return getDiscriminator(type.schema);
    }
    else if (type instanceof ZodEffects) {
        return getDiscriminator(type.innerType());
    }
    else if (type instanceof ZodLiteral) {
        return [type.value];
    }
    else if (type instanceof ZodEnum) {
        return type.options;
    }
    else if (type instanceof ZodNativeEnum) {
        // eslint-disable-next-line ban/ban
        return util.objectValues(type.enum);
    }
    else if (type instanceof ZodDefault) {
        return getDiscriminator(type._def.innerType);
    }
    else if (type instanceof ZodUndefined) {
        return [undefined];
    }
    else if (type instanceof ZodNull) {
        return [null];
    }
    else if (type instanceof ZodOptional) {
        return [undefined, ...getDiscriminator(type.unwrap())];
    }
    else if (type instanceof ZodNullable) {
        return [null, ...getDiscriminator(type.unwrap())];
    }
    else if (type instanceof ZodBranded) {
        return getDiscriminator(type.unwrap());
    }
    else if (type instanceof ZodReadonly) {
        return getDiscriminator(type.unwrap());
    }
    else if (type instanceof ZodCatch) {
        return getDiscriminator(type._def.innerType);
    }
    else {
        return [];
    }
};
class ZodDiscriminatedUnion extends ZodType {
    _parse(input) {
        const { ctx } = this._processInputParams(input);
        if (ctx.parsedType !== ZodParsedType.object) {
            addIssueToContext(ctx, {
                code: ZodIssueCode.invalid_type,
                expected: ZodParsedType.object,
                received: ctx.parsedType,
            });
            return INVALID;
        }
        const discriminator = this.discriminator;
        const discriminatorValue = ctx.data[discriminator];
        const option = this.optionsMap.get(discriminatorValue);
        if (!option) {
            addIssueToContext(ctx, {
                code: ZodIssueCode.invalid_union_discriminator,
                options: Array.from(this.optionsMap.keys()),
                path: [discriminator],
            });
            return INVALID;
        }
        if (ctx.common.async) {
            return option._parseAsync({
                data: ctx.data,
                path: ctx.path,
                parent: ctx,
            });
        }
        else {
            return option._parseSync({
                data: ctx.data,
                path: ctx.path,
                parent: ctx,
            });
        }
    }
    get discriminator() {
        return this._def.discriminator;
    }
    get options() {
        return this._def.options;
    }
    get optionsMap() {
        return this._def.optionsMap;
    }
    /**
     * The constructor of the discriminated union schema. Its behaviour is very similar to that of the normal z.union() constructor.
     * However, it only allows a union of objects, all of which need to share a discriminator property. This property must
     * have a different value for each object in the union.
     * @param discriminator the name of the discriminator property
     * @param types an array of object schemas
     * @param params
     */
    static create(discriminator, options, params) {
        // Get all the valid discriminator values
        const optionsMap = new Map();
        // try {
        for (const type of options) {
            const discriminatorValues = getDiscriminator(type.shape[discriminator]);
            if (!discriminatorValues.length) {
                throw new Error(`A discriminator value for key \`${discriminator}\` could not be extracted from all schema options`);
            }
            for (const value of discriminatorValues) {
                if (optionsMap.has(value)) {
                    throw new Error(`Discriminator property ${String(discriminator)} has duplicate value ${String(value)}`);
                }
                optionsMap.set(value, type);
            }
        }
        return new ZodDiscriminatedUnion({
            typeName: ZodFirstPartyTypeKind.ZodDiscriminatedUnion,
            discriminator,
            options,
            optionsMap,
            ...processCreateParams(params),
        });
    }
}
function mergeValues(a, b) {
    const aType = getParsedType(a);
    const bType = getParsedType(b);
    if (a === b) {
        return { valid: true, data: a };
    }
    else if (aType === ZodParsedType.object && bType === ZodParsedType.object) {
        const bKeys = util.objectKeys(b);
        const sharedKeys = util
            .objectKeys(a)
            .filter((key) => bKeys.indexOf(key) !== -1);
        const newObj = { ...a, ...b };
        for (const key of sharedKeys) {
            const sharedValue = mergeValues(a[key], b[key]);
            if (!sharedValue.valid) {
                return { valid: false };
            }
            newObj[key] = sharedValue.data;
        }
        return { valid: true, data: newObj };
    }
    else if (aType === ZodParsedType.array && bType === ZodParsedType.array) {
        if (a.length !== b.length) {
            return { valid: false };
        }
        const newArray = [];
        for (let index = 0; index < a.length; index++) {
            const itemA = a[index];
            const itemB = b[index];
            const sharedValue = mergeValues(itemA, itemB);
            if (!sharedValue.valid) {
                return { valid: false };
            }
            newArray.push(sharedValue.data);
        }
        return { valid: true, data: newArray };
    }
    else if (aType === ZodParsedType.date &&
        bType === ZodParsedType.date &&
        +a === +b) {
        return { valid: true, data: a };
    }
    else {
        return { valid: false };
    }
}
class ZodIntersection extends ZodType {
    _parse(input) {
        const { status, ctx } = this._processInputParams(input);
        const handleParsed = (parsedLeft, parsedRight) => {
            if (isAborted(parsedLeft) || isAborted(parsedRight)) {
                return INVALID;
            }
            const merged = mergeValues(parsedLeft.value, parsedRight.value);
            if (!merged.valid) {
                addIssueToContext(ctx, {
                    code: ZodIssueCode.invalid_intersection_types,
                });
                return INVALID;
            }
            if (isDirty(parsedLeft) || isDirty(parsedRight)) {
                status.dirty();
            }
            return { status: status.value, value: merged.data };
        };
        if (ctx.common.async) {
            return Promise.all([
                this._def.left._parseAsync({
                    data: ctx.data,
                    path: ctx.path,
                    parent: ctx,
                }),
                this._def.right._parseAsync({
                    data: ctx.data,
                    path: ctx.path,
                    parent: ctx,
                }),
            ]).then(([left, right]) => handleParsed(left, right));
        }
        else {
            return handleParsed(this._def.left._parseSync({
                data: ctx.data,
                path: ctx.path,
                parent: ctx,
            }), this._def.right._parseSync({
                data: ctx.data,
                path: ctx.path,
                parent: ctx,
            }));
        }
    }
}
ZodIntersection.create = (left, right, params) => {
    return new ZodIntersection({
        left: left,
        right: right,
        typeName: ZodFirstPartyTypeKind.ZodIntersection,
        ...processCreateParams(params),
    });
};
class ZodTuple extends ZodType {
    _parse(input) {
        const { status, ctx } = this._processInputParams(input);
        if (ctx.parsedType !== ZodParsedType.array) {
            addIssueToContext(ctx, {
                code: ZodIssueCode.invalid_type,
                expected: ZodParsedType.array,
                received: ctx.parsedType,
            });
            return INVALID;
        }
        if (ctx.data.length < this._def.items.length) {
            addIssueToContext(ctx, {
                code: ZodIssueCode.too_small,
                minimum: this._def.items.length,
                inclusive: true,
                exact: false,
                type: "array",
            });
            return INVALID;
        }
        const rest = this._def.rest;
        if (!rest && ctx.data.length > this._def.items.length) {
            addIssueToContext(ctx, {
                code: ZodIssueCode.too_big,
                maximum: this._def.items.length,
                inclusive: true,
                exact: false,
                type: "array",
            });
            status.dirty();
        }
        const items = [...ctx.data]
            .map((item, itemIndex) => {
            const schema = this._def.items[itemIndex] || this._def.rest;
            if (!schema)
                return null;
            return schema._parse(new ParseInputLazyPath(ctx, item, ctx.path, itemIndex));
        })
            .filter((x) => !!x); // filter nulls
        if (ctx.common.async) {
            return Promise.all(items).then((results) => {
                return ParseStatus.mergeArray(status, results);
            });
        }
        else {
            return ParseStatus.mergeArray(status, items);
        }
    }
    get items() {
        return this._def.items;
    }
    rest(rest) {
        return new ZodTuple({
            ...this._def,
            rest,
        });
    }
}
ZodTuple.create = (schemas, params) => {
    if (!Array.isArray(schemas)) {
        throw new Error("You must pass an array of schemas to z.tuple([ ... ])");
    }
    return new ZodTuple({
        items: schemas,
        typeName: ZodFirstPartyTypeKind.ZodTuple,
        rest: null,
        ...processCreateParams(params),
    });
};
class ZodRecord extends ZodType {
    get keySchema() {
        return this._def.keyType;
    }
    get valueSchema() {
        return this._def.valueType;
    }
    _parse(input) {
        const { status, ctx } = this._processInputParams(input);
        if (ctx.parsedType !== ZodParsedType.object) {
            addIssueToContext(ctx, {
                code: ZodIssueCode.invalid_type,
                expected: ZodParsedType.object,
                received: ctx.parsedType,
            });
            return INVALID;
        }
        const pairs = [];
        const keyType = this._def.keyType;
        const valueType = this._def.valueType;
        for (const key in ctx.data) {
            pairs.push({
                key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, key)),
                value: valueType._parse(new ParseInputLazyPath(ctx, ctx.data[key], ctx.path, key)),
                alwaysSet: key in ctx.data,
            });
        }
        if (ctx.common.async) {
            return ParseStatus.mergeObjectAsync(status, pairs);
        }
        else {
            return ParseStatus.mergeObjectSync(status, pairs);
        }
    }
    get element() {
        return this._def.valueType;
    }
    static create(first, second, third) {
        if (second instanceof ZodType) {
            return new ZodRecord({
                keyType: first,
                valueType: second,
                typeName: ZodFirstPartyTypeKind.ZodRecord,
                ...processCreateParams(third),
            });
        }
        return new ZodRecord({
            keyType: ZodString.create(),
            valueType: first,
            typeName: ZodFirstPartyTypeKind.ZodRecord,
            ...processCreateParams(second),
        });
    }
}
class ZodMap extends ZodType {
    get keySchema() {
        return this._def.keyType;
    }
    get valueSchema() {
        return this._def.valueType;
    }
    _parse(input) {
        const { status, ctx } = this._processInputParams(input);
        if (ctx.parsedType !== ZodParsedType.map) {
            addIssueToContext(ctx, {
                code: ZodIssueCode.invalid_type,
                expected: ZodParsedType.map,
                received: ctx.parsedType,
            });
            return INVALID;
        }
        const keyType = this._def.keyType;
        const valueType = this._def.valueType;
        const pairs = [...ctx.data.entries()].map(([key, value], index) => {
            return {
                key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, [index, "key"])),
                value: valueType._parse(new ParseInputLazyPath(ctx, value, ctx.path, [index, "value"])),
            };
        });
        if (ctx.common.async) {
            const finalMap = new Map();
            return Promise.resolve().then(async () => {
                for (const pair of pairs) {
                    const key = await pair.key;
                    const value = await pair.value;
                    if (key.status === "aborted" || value.status === "aborted") {
                        return INVALID;
                    }
                    if (key.status === "dirty" || value.status === "dirty") {
                        status.dirty();
                    }
                    finalMap.set(key.value, value.value);
                }
                return { status: status.value, value: finalMap };
            });
        }
        else {
            const finalMap = new Map();
            for (const pair of pairs) {
                const key = pair.key;
                const value = pair.value;
                if (key.status === "aborted" || value.status === "aborted") {
                    return INVALID;
                }
                if (key.status === "dirty" || value.status === "dirty") {
                    status.dirty();
                }
                finalMap.set(key.value, value.value);
            }
            return { status: status.value, value: finalMap };
        }
    }
}
ZodMap.create = (keyType, valueType, params) => {
    return new ZodMap({
        valueType,
        keyType,
        typeName: ZodFirstPartyTypeKind.ZodMap,
        ...processCreateParams(params),
    });
};
class ZodSet extends ZodType {
    _parse(input) {
        const { status, ctx } = this._processInputParams(input);
        if (ctx.parsedType !== ZodParsedType.set) {
            addIssueToContext(ctx, {
                code: ZodIssueCode.invalid_type,
                expected: ZodParsedType.set,
                received: ctx.parsedType,
            });
            return INVALID;
        }
        const def = this._def;
        if (def.minSize !== null) {
            if (ctx.data.size < def.minSize.value) {
                addIssueToContext(ctx, {
                    code: ZodIssueCode.too_small,
                    minimum: def.minSize.value,
                    type: "set",
                    inclusive: true,
                    exact: false,
                    message: def.minSize.message,
                });
                status.dirty();
            }
        }
        if (def.maxSize !== null) {
            if (ctx.data.size > def.maxSize.value) {
                addIssueToContext(ctx, {
                    code: ZodIssueCode.too_big,
                    maximum: def.maxSize.value,
                    type: "set",
                    inclusive: true,
                    exact: false,
                    message: def.maxSize.message,
                });
                status.dirty();
            }
        }
        const valueType = this._def.valueType;
        function finalizeSet(elements) {
            const parsedSet = new Set();
            for (const element of elements) {
                if (element.status === "aborted")
                    return INVALID;
                if (element.status === "dirty")
                    status.dirty();
                parsedSet.add(element.value);
            }
            return { status: status.value, value: parsedSet };
        }
        const elements = [...ctx.data.values()].map((item, i) => valueType._parse(new ParseInputLazyPath(ctx, item, ctx.path, i)));
        if (ctx.common.async) {
            return Promise.all(elements).then((elements) => finalizeSet(elements));
        }
        else {
            return finalizeSet(elements);
        }
    }
    min(minSize, message) {
        return new ZodSet({
            ...this._def,
            minSize: { value: minSize, message: errorUtil.toString(message) },
        });
    }
    max(maxSize, message) {
        return new ZodSet({
            ...this._def,
            maxSize: { value: maxSize, message: errorUtil.toString(message) },
        });
    }
    size(size, message) {
        return this.min(size, message).max(size, message);
    }
    nonempty(message) {
        return this.min(1, message);
    }
}
ZodSet.create = (valueType, params) => {
    return new ZodSet({
        valueType,
        minSize: null,
        maxSize: null,
        typeName: ZodFirstPartyTypeKind.ZodSet,
        ...processCreateParams(params),
    });
};
class ZodFunction extends ZodType {
    constructor() {
        super(...arguments);
        this.validate = this.implement;
    }
    _parse(input) {
        const { ctx } = this._processInputParams(input);
        if (ctx.parsedType !== ZodParsedType.function) {
            addIssueToContext(ctx, {
                code: ZodIssueCode.invalid_type,
                expected: ZodParsedType.function,
                received: ctx.parsedType,
            });
            return INVALID;
        }
        function makeArgsIssue(args, error) {
            return makeIssue({
                data: args,
                path: ctx.path,
                errorMaps: [
                    ctx.common.contextualErrorMap,
                    ctx.schemaErrorMap,
                    getErrorMap(),
                    errorMap,
                ].filter((x) => !!x),
                issueData: {
                    code: ZodIssueCode.invalid_arguments,
                    argumentsError: error,
                },
            });
        }
        function makeReturnsIssue(returns, error) {
            return makeIssue({
                data: returns,
                path: ctx.path,
                errorMaps: [
                    ctx.common.contextualErrorMap,
                    ctx.schemaErrorMap,
                    getErrorMap(),
                    errorMap,
                ].filter((x) => !!x),
                issueData: {
                    code: ZodIssueCode.invalid_return_type,
                    returnTypeError: error,
                },
            });
        }
        const params = { errorMap: ctx.common.contextualErrorMap };
        const fn = ctx.data;
        if (this._def.returns instanceof ZodPromise) {
            // Would love a way to avoid disabling this rule, but we need
            // an alias (using an arrow function was what caused 2651).
            // eslint-disable-next-line @typescript-eslint/no-this-alias
            const me = this;
            return OK(async function (...args) {
                const error = new ZodError([]);
                const parsedArgs = await me._def.args
                    .parseAsync(args, params)
                    .catch((e) => {
                    error.addIssue(makeArgsIssue(args, e));
                    throw error;
                });
                const result = await Reflect.apply(fn, this, parsedArgs);
                const parsedReturns = await me._def.returns._def.type
                    .parseAsync(result, params)
                    .catch((e) => {
                    error.addIssue(makeReturnsIssue(result, e));
                    throw error;
                });
                return parsedReturns;
            });
        }
        else {
            // Would love a way to avoid disabling this rule, but we need
            // an alias (using an arrow function was what caused 2651).
            // eslint-disable-next-line @typescript-eslint/no-this-alias
            const me = this;
            return OK(function (...args) {
                const parsedArgs = me._def.args.safeParse(args, params);
                if (!parsedArgs.success) {
                    throw new ZodError([makeArgsIssue(args, parsedArgs.error)]);
                }
                const result = Reflect.apply(fn, this, parsedArgs.data);
                const parsedReturns = me._def.returns.safeParse(result, params);
                if (!parsedReturns.success) {
                    throw new ZodError([makeReturnsIssue(result, parsedReturns.error)]);
                }
                return parsedReturns.data;
            });
        }
    }
    parameters() {
        return this._def.args;
    }
    returnType() {
        return this._def.returns;
    }
    args(...items) {
        return new ZodFunction({
            ...this._def,
            args: ZodTuple.create(items).rest(ZodUnknown.create()),
        });
    }
    returns(returnType) {
        return new ZodFunction({
            ...this._def,
            returns: returnType,
        });
    }
    implement(func) {
        const validatedFunc = this.parse(func);
        return validatedFunc;
    }
    strictImplement(func) {
        const validatedFunc = this.parse(func);
        return validatedFunc;
    }
    static create(args, returns, params) {
        return new ZodFunction({
            args: (args
                ? args
                : ZodTuple.create([]).rest(ZodUnknown.create())),
            returns: returns || ZodUnknown.create(),
            typeName: ZodFirstPartyTypeKind.ZodFunction,
            ...processCreateParams(params),
        });
    }
}
class ZodLazy extends ZodType {
    get schema() {
        return this._def.getter();
    }
    _parse(input) {
        const { ctx } = this._processInputParams(input);
        const lazySchema = this._def.getter();
        return lazySchema._parse({ data: ctx.data, path: ctx.path, parent: ctx });
    }
}
ZodLazy.create = (getter, params) => {
    return new ZodLazy({
        getter: getter,
        typeName: ZodFirstPartyTypeKind.ZodLazy,
        ...processCreateParams(params),
    });
};
class ZodLiteral extends ZodType {
    _parse(input) {
        if (input.data !== this._def.value) {
            const ctx = this._getOrReturnCtx(input);
            addIssueToContext(ctx, {
                received: ctx.data,
                code: ZodIssueCode.invalid_literal,
                expected: this._def.value,
            });
            return INVALID;
        }
        return { status: "valid", value: input.data };
    }
    get value() {
        return this._def.value;
    }
}
ZodLiteral.create = (value, params) => {
    return new ZodLiteral({
        value: value,
        typeName: ZodFirstPartyTypeKind.ZodLiteral,
        ...processCreateParams(params),
    });
};
function createZodEnum(values, params) {
    return new ZodEnum({
        values,
        typeName: ZodFirstPartyTypeKind.ZodEnum,
        ...processCreateParams(params),
    });
}
class ZodEnum extends ZodType {
    constructor() {
        super(...arguments);
        _ZodEnum_cache.set(this, void 0);
    }
    _parse(input) {
        if (typeof input.data !== "string") {
            const ctx = this._getOrReturnCtx(input);
            const expectedValues = this._def.values;
            addIssueToContext(ctx, {
                expected: util.joinValues(expectedValues),
                received: ctx.parsedType,
                code: ZodIssueCode.invalid_type,
            });
            return INVALID;
        }
        if (!__classPrivateFieldGet(this, _ZodEnum_cache, "f")) {
            __classPrivateFieldSet(this, _ZodEnum_cache, new Set(this._def.values), "f");
        }
        if (!__classPrivateFieldGet(this, _ZodEnum_cache, "f").has(input.data)) {
            const ctx = this._getOrReturnCtx(input);
            const expectedValues = this._def.values;
            addIssueToContext(ctx, {
                received: ctx.data,
                code: ZodIssueCode.invalid_enum_value,
                options: expectedValues,
            });
            return INVALID;
        }
        return OK(input.data);
    }
    get options() {
        return this._def.values;
    }
    get enum() {
        const enumValues = {};
        for (const val of this._def.values) {
            enumValues[val] = val;
        }
        return enumValues;
    }
    get Values() {
        const enumValues = {};
        for (const val of this._def.values) {
            enumValues[val] = val;
        }
        return enumValues;
    }
    get Enum() {
        const enumValues = {};
        for (const val of this._def.values) {
            enumValues[val] = val;
        }
        return enumValues;
    }
    extract(values, newDef = this._def) {
        return ZodEnum.create(values, {
            ...this._def,
            ...newDef,
        });
    }
    exclude(values, newDef = this._def) {
        return ZodEnum.create(this.options.filter((opt) => !values.includes(opt)), {
            ...this._def,
            ...newDef,
        });
    }
}
_ZodEnum_cache = new WeakMap();
ZodEnum.create = createZodEnum;
class ZodNativeEnum extends ZodType {
    constructor() {
        super(...arguments);
        _ZodNativeEnum_cache.set(this, void 0);
    }
    _parse(input) {
        const nativeEnumValues = util.getValidEnumValues(this._def.values);
        const ctx = this._getOrReturnCtx(input);
        if (ctx.parsedType !== ZodParsedType.string &&
            ctx.parsedType !== ZodParsedType.number) {
            const expectedValues = util.objectValues(nativeEnumValues);
            addIssueToContext(ctx, {
                expected: util.joinValues(expectedValues),
                received: ctx.parsedType,
                code: ZodIssueCode.invalid_type,
            });
            return INVALID;
        }
        if (!__classPrivateFieldGet(this, _ZodNativeEnum_cache, "f")) {
            __classPrivateFieldSet(this, _ZodNativeEnum_cache, new Set(util.getValidEnumValues(this._def.values)), "f");
        }
        if (!__classPrivateFieldGet(this, _ZodNativeEnum_cache, "f").has(input.data)) {
            const expectedValues = util.objectValues(nativeEnumValues);
            addIssueToContext(ctx, {
                received: ctx.data,
                code: ZodIssueCode.invalid_enum_value,
                options: expectedValues,
            });
            return INVALID;
        }
        return OK(input.data);
    }
    get enum() {
        return this._def.values;
    }
}
_ZodNativeEnum_cache = new WeakMap();
ZodNativeEnum.create = (values, params) => {
    return new ZodNativeEnum({
        values: values,
        typeName: ZodFirstPartyTypeKind.ZodNativeEnum,
        ...processCreateParams(params),
    });
};
class ZodPromise extends ZodType {
    unwrap() {
        return this._def.type;
    }
    _parse(input) {
        const { ctx } = this._processInputParams(input);
        if (ctx.parsedType !== ZodParsedType.promise &&
            ctx.common.async === false) {
            addIssueToContext(ctx, {
                code: ZodIssueCode.invalid_type,
                expected: ZodParsedType.promise,
                received: ctx.parsedType,
            });
            return INVALID;
        }
        const promisified = ctx.parsedType === ZodParsedType.promise
            ? ctx.data
            : Promise.resolve(ctx.data);
        return OK(promisified.then((data) => {
            return this._def.type.parseAsync(data, {
                path: ctx.path,
                errorMap: ctx.common.contextualErrorMap,
            });
        }));
    }
}
ZodPromise.create = (schema, params) => {
    return new ZodPromise({
        type: schema,
        typeName: ZodFirstPartyTypeKind.ZodPromise,
        ...processCreateParams(params),
    });
};
class ZodEffects extends ZodType {
    innerType() {
        return this._def.schema;
    }
    sourceType() {
        return this._def.schema._def.typeName === ZodFirstPartyTypeKind.ZodEffects
            ? this._def.schema.sourceType()
            : this._def.schema;
    }
    _parse(input) {
        const { status, ctx } = this._processInputParams(input);
        const effect = this._def.effect || null;
        const checkCtx = {
            addIssue: (arg) => {
                addIssueToContext(ctx, arg);
                if (arg.fatal) {
                    status.abort();
                }
                else {
                    status.dirty();
                }
            },
            get path() {
                return ctx.path;
            },
        };
        checkCtx.addIssue = checkCtx.addIssue.bind(checkCtx);
        if (effect.type === "preprocess") {
            const processed = effect.transform(ctx.data, checkCtx);
            if (ctx.common.async) {
                return Promise.resolve(processed).then(async (processed) => {
                    if (status.value === "aborted")
                        return INVALID;
                    const result = await this._def.schema._parseAsync({
                        data: processed,
                        path: ctx.path,
                        parent: ctx,
                    });
                    if (result.status === "aborted")
                        return INVALID;
                    if (result.status === "dirty")
                        return DIRTY(result.value);
                    if (status.value === "dirty")
                        return DIRTY(result.value);
                    return result;
                });
            }
            else {
                if (status.value === "aborted")
                    return INVALID;
                const result = this._def.schema._parseSync({
                    data: processed,
                    path: ctx.path,
                    parent: ctx,
                });
                if (result.status === "aborted")
                    return INVALID;
                if (result.status === "dirty")
                    return DIRTY(result.value);
                if (status.value === "dirty")
                    return DIRTY(result.value);
                return result;
            }
        }
        if (effect.type === "refinement") {
            const executeRefinement = (acc) => {
                const result = effect.refinement(acc, checkCtx);
                if (ctx.common.async) {
                    return Promise.resolve(result);
                }
                if (result instanceof Promise) {
                    throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");
                }
                return acc;
            };
            if (ctx.common.async === false) {
                const inner = this._def.schema._parseSync({
                    data: ctx.data,
                    path: ctx.path,
                    parent: ctx,
                });
                if (inner.status === "aborted")
                    return INVALID;
                if (inner.status === "dirty")
                    status.dirty();
                // return value is ignored
                executeRefinement(inner.value);
                return { status: status.value, value: inner.value };
            }
            else {
                return this._def.schema
                    ._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx })
                    .then((inner) => {
                    if (inner.status === "aborted")
                        return INVALID;
                    if (inner.status === "dirty")
                        status.dirty();
                    return executeRefinement(inner.value).then(() => {
                        return { status: status.value, value: inner.value };
                    });
                });
            }
        }
        if (effect.type === "transform") {
            if (ctx.common.async === false) {
                const base = this._def.schema._parseSync({
                    data: ctx.data,
                    path: ctx.path,
                    parent: ctx,
                });
                if (!isValid(base))
                    return base;
                const result = effect.transform(base.value, checkCtx);
                if (result instanceof Promise) {
                    throw new Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`);
                }
                return { status: status.value, value: result };
            }
            else {
                return this._def.schema
                    ._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx })
                    .then((base) => {
                    if (!isValid(base))
                        return base;
                    return Promise.resolve(effect.transform(base.value, checkCtx)).then((result) => ({ status: status.value, value: result }));
                });
            }
        }
        util.assertNever(effect);
    }
}
ZodEffects.create = (schema, effect, params) => {
    return new ZodEffects({
        schema,
        typeName: ZodFirstPartyTypeKind.ZodEffects,
        effect,
        ...processCreateParams(params),
    });
};
ZodEffects.createWithPreprocess = (preprocess, schema, params) => {
    return new ZodEffects({
        schema,
        effect: { type: "preprocess", transform: preprocess },
        typeName: ZodFirstPartyTypeKind.ZodEffects,
        ...processCreateParams(params),
    });
};
class ZodOptional extends ZodType {
    _parse(input) {
        const parsedType = this._getType(input);
        if (parsedType === ZodParsedType.undefined) {
            return OK(undefined);
        }
        return this._def.innerType._parse(input);
    }
    unwrap() {
        return this._def.innerType;
    }
}
ZodOptional.create = (type, params) => {
    return new ZodOptional({
        innerType: type,
        typeName: ZodFirstPartyTypeKind.ZodOptional,
        ...processCreateParams(params),
    });
};
class ZodNullable extends ZodType {
    _parse(input) {
        const parsedType = this._getType(input);
        if (parsedType === ZodParsedType.null) {
            return OK(null);
        }
        return this._def.innerType._parse(input);
    }
    unwrap() {
        return this._def.innerType;
    }
}
ZodNullable.create = (type, params) => {
    return new ZodNullable({
        innerType: type,
        typeName: ZodFirstPartyTypeKind.ZodNullable,
        ...processCreateParams(params),
    });
};
class ZodDefault extends ZodType {
    _parse(input) {
        const { ctx } = this._processInputParams(input);
        let data = ctx.data;
        if (ctx.parsedType === ZodParsedType.undefined) {
            data = this._def.defaultValue();
        }
        return this._def.innerType._parse({
            data,
            path: ctx.path,
            parent: ctx,
        });
    }
    removeDefault() {
        return this._def.innerType;
    }
}
ZodDefault.create = (type, params) => {
    return new ZodDefault({
        innerType: type,
        typeName: ZodFirstPartyTypeKind.ZodDefault,
        defaultValue: typeof params.default === "function"
            ? params.default
            : () => params.default,
        ...processCreateParams(params),
    });
};
class ZodCatch extends ZodType {
    _parse(input) {
        const { ctx } = this._processInputParams(input);
        // newCtx is used to not collect issues from inner types in ctx
        const newCtx = {
            ...ctx,
            common: {
                ...ctx.common,
                issues: [],
            },
        };
        const result = this._def.innerType._parse({
            data: newCtx.data,
            path: newCtx.path,
            parent: {
                ...newCtx,
            },
        });
        if (isAsync(result)) {
            return result.then((result) => {
                return {
                    status: "valid",
                    value: result.status === "valid"
                        ? result.value
                        : this._def.catchValue({
                            get error() {
                                return new ZodError(newCtx.common.issues);
                            },
                            input: newCtx.data,
                        }),
                };
            });
        }
        else {
            return {
                status: "valid",
                value: result.status === "valid"
                    ? result.value
                    : this._def.catchValue({
                        get error() {
                            return new ZodError(newCtx.common.issues);
                        },
                        input: newCtx.data,
                    }),
            };
        }
    }
    removeCatch() {
        return this._def.innerType;
    }
}
ZodCatch.create = (type, params) => {
    return new ZodCatch({
        innerType: type,
        typeName: ZodFirstPartyTypeKind.ZodCatch,
        catchValue: typeof params.catch === "function" ? params.catch : () => params.catch,
        ...processCreateParams(params),
    });
};
class ZodNaN extends ZodType {
    _parse(input) {
        const parsedType = this._getType(input);
        if (parsedType !== ZodParsedType.nan) {
            const ctx = this._getOrReturnCtx(input);
            addIssueToContext(ctx, {
                code: ZodIssueCode.invalid_type,
                expected: ZodParsedType.nan,
                received: ctx.parsedType,
            });
            return INVALID;
        }
        return { status: "valid", value: input.data };
    }
}
ZodNaN.create = (params) => {
    return new ZodNaN({
        typeName: ZodFirstPartyTypeKind.ZodNaN,
        ...processCreateParams(params),
    });
};
const BRAND = Symbol("zod_brand");
class ZodBranded extends ZodType {
    _parse(input) {
        const { ctx } = this._processInputParams(input);
        const data = ctx.data;
        return this._def.type._parse({
            data,
            path: ctx.path,
            parent: ctx,
        });
    }
    unwrap() {
        return this._def.type;
    }
}
class ZodPipeline extends ZodType {
    _parse(input) {
        const { status, ctx } = this._processInputParams(input);
        if (ctx.common.async) {
            const handleAsync = async () => {
                const inResult = await this._def.in._parseAsync({
                    data: ctx.data,
                    path: ctx.path,
                    parent: ctx,
                });
                if (inResult.status === "aborted")
                    return INVALID;
                if (inResult.status === "dirty") {
                    status.dirty();
                    return DIRTY(inResult.value);
                }
                else {
                    return this._def.out._parseAsync({
                        data: inResult.value,
                        path: ctx.path,
                        parent: ctx,
                    });
                }
            };
            return handleAsync();
        }
        else {
            const inResult = this._def.in._parseSync({
                data: ctx.data,
                path: ctx.path,
                parent: ctx,
            });
            if (inResult.status === "aborted")
                return INVALID;
            if (inResult.status === "dirty") {
                status.dirty();
                return {
                    status: "dirty",
                    value: inResult.value,
                };
            }
            else {
                return this._def.out._parseSync({
                    data: inResult.value,
                    path: ctx.path,
                    parent: ctx,
                });
            }
        }
    }
    static create(a, b) {
        return new ZodPipeline({
            in: a,
            out: b,
            typeName: ZodFirstPartyTypeKind.ZodPipeline,
        });
    }
}
class ZodReadonly extends ZodType {
    _parse(input) {
        const result = this._def.innerType._parse(input);
        const freeze = (data) => {
            if (isValid(data)) {
                data.value = Object.freeze(data.value);
            }
            return data;
        };
        return isAsync(result)
            ? result.then((data) => freeze(data))
            : freeze(result);
    }
    unwrap() {
        return this._def.innerType;
    }
}
ZodReadonly.create = (type, params) => {
    return new ZodReadonly({
        innerType: type,
        typeName: ZodFirstPartyTypeKind.ZodReadonly,
        ...processCreateParams(params),
    });
};
function custom(check, params = {}, 
/**
 * @deprecated
 *
 * Pass `fatal` into the params object instead:
 *
 * ```ts
 * z.string().custom((val) => val.length > 5, { fatal: false })
 * ```
 *
 */
fatal) {
    if (check)
        return ZodAny.create().superRefine((data, ctx) => {
            var _a, _b;
            if (!check(data)) {
                const p = typeof params === "function"
                    ? params(data)
                    : typeof params === "string"
                        ? { message: params }
                        : params;
                const _fatal = (_b = (_a = p.fatal) !== null && _a !== void 0 ? _a : fatal) !== null && _b !== void 0 ? _b : true;
                const p2 = typeof p === "string" ? { message: p } : p;
                ctx.addIssue({ code: "custom", ...p2, fatal: _fatal });
            }
        });
    return ZodAny.create();
}
const late = {
    object: ZodObject.lazycreate,
};
var ZodFirstPartyTypeKind;
(function (ZodFirstPartyTypeKind) {
    ZodFirstPartyTypeKind["ZodString"] = "ZodString";
    ZodFirstPartyTypeKind["ZodNumber"] = "ZodNumber";
    ZodFirstPartyTypeKind["ZodNaN"] = "ZodNaN";
    ZodFirstPartyTypeKind["ZodBigInt"] = "ZodBigInt";
    ZodFirstPartyTypeKind["ZodBoolean"] = "ZodBoolean";
    ZodFirstPartyTypeKind["ZodDate"] = "ZodDate";
    ZodFirstPartyTypeKind["ZodSymbol"] = "ZodSymbol";
    ZodFirstPartyTypeKind["ZodUndefined"] = "ZodUndefined";
    ZodFirstPartyTypeKind["ZodNull"] = "ZodNull";
    ZodFirstPartyTypeKind["ZodAny"] = "ZodAny";
    ZodFirstPartyTypeKind["ZodUnknown"] = "ZodUnknown";
    ZodFirstPartyTypeKind["ZodNever"] = "ZodNever";
    ZodFirstPartyTypeKind["ZodVoid"] = "ZodVoid";
    ZodFirstPartyTypeKind["ZodArray"] = "ZodArray";
    ZodFirstPartyTypeKind["ZodObject"] = "ZodObject";
    ZodFirstPartyTypeKind["ZodUnion"] = "ZodUnion";
    ZodFirstPartyTypeKind["ZodDiscriminatedUnion"] = "ZodDiscriminatedUnion";
    ZodFirstPartyTypeKind["ZodIntersection"] = "ZodIntersection";
    ZodFirstPartyTypeKind["ZodTuple"] = "ZodTuple";
    ZodFirstPartyTypeKind["ZodRecord"] = "ZodRecord";
    ZodFirstPartyTypeKind["ZodMap"] = "ZodMap";
    ZodFirstPartyTypeKind["ZodSet"] = "ZodSet";
    ZodFirstPartyTypeKind["ZodFunction"] = "ZodFunction";
    ZodFirstPartyTypeKind["ZodLazy"] = "ZodLazy";
    ZodFirstPartyTypeKind["ZodLiteral"] = "ZodLiteral";
    ZodFirstPartyTypeKind["ZodEnum"] = "ZodEnum";
    ZodFirstPartyTypeKind["ZodEffects"] = "ZodEffects";
    ZodFirstPartyTypeKind["ZodNativeEnum"] = "ZodNativeEnum";
    ZodFirstPartyTypeKind["ZodOptional"] = "ZodOptional";
    ZodFirstPartyTypeKind["ZodNullable"] = "ZodNullable";
    ZodFirstPartyTypeKind["ZodDefault"] = "ZodDefault";
    ZodFirstPartyTypeKind["ZodCatch"] = "ZodCatch";
    ZodFirstPartyTypeKind["ZodPromise"] = "ZodPromise";
    ZodFirstPartyTypeKind["ZodBranded"] = "ZodBranded";
    ZodFirstPartyTypeKind["ZodPipeline"] = "ZodPipeline";
    ZodFirstPartyTypeKind["ZodReadonly"] = "ZodReadonly";
})(ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {}));
const instanceOfType = (
// const instanceOfType = <T extends new (...args: any[]) => any>(
cls, params = {
    message: `Input not instance of ${cls.name}`,
}) => custom((data) => data instanceof cls, params);
const stringType = ZodString.create;
const numberType = ZodNumber.create;
const nanType = ZodNaN.create;
const bigIntType = ZodBigInt.create;
const booleanType = ZodBoolean.create;
const dateType = ZodDate.create;
const symbolType = ZodSymbol.create;
const undefinedType = ZodUndefined.create;
const nullType = ZodNull.create;
const anyType = ZodAny.create;
const unknownType = ZodUnknown.create;
const neverType = ZodNever.create;
const voidType = ZodVoid.create;
const arrayType = ZodArray.create;
const objectType = ZodObject.create;
const strictObjectType = ZodObject.strictCreate;
const unionType = ZodUnion.create;
const discriminatedUnionType = ZodDiscriminatedUnion.create;
const intersectionType = ZodIntersection.create;
const tupleType = ZodTuple.create;
const recordType = ZodRecord.create;
const mapType = ZodMap.create;
const setType = ZodSet.create;
const functionType = ZodFunction.create;
const lazyType = ZodLazy.create;
const literalType = ZodLiteral.create;
const enumType = ZodEnum.create;
const nativeEnumType = ZodNativeEnum.create;
const promiseType = ZodPromise.create;
const effectsType = ZodEffects.create;
const optionalType = ZodOptional.create;
const nullableType = ZodNullable.create;
const preprocessType = ZodEffects.createWithPreprocess;
const pipelineType = ZodPipeline.create;
const ostring = () => stringType().optional();
const onumber = () => numberType().optional();
const oboolean = () => booleanType().optional();
const coerce = {
    string: ((arg) => ZodString.create({ ...arg, coerce: true })),
    number: ((arg) => ZodNumber.create({ ...arg, coerce: true })),
    boolean: ((arg) => ZodBoolean.create({
        ...arg,
        coerce: true,
    })),
    bigint: ((arg) => ZodBigInt.create({ ...arg, coerce: true })),
    date: ((arg) => ZodDate.create({ ...arg, coerce: true })),
};
const NEVER = INVALID;

var z = /*#__PURE__*/Object.freeze({
    __proto__: null,
    defaultErrorMap: errorMap,
    setErrorMap: setErrorMap,
    getErrorMap: getErrorMap,
    makeIssue: makeIssue,
    EMPTY_PATH: EMPTY_PATH,
    addIssueToContext: addIssueToContext,
    ParseStatus: ParseStatus,
    INVALID: INVALID,
    DIRTY: DIRTY,
    OK: OK,
    isAborted: isAborted,
    isDirty: isDirty,
    isValid: isValid,
    isAsync: isAsync,
    get util () { return util; },
    get objectUtil () { return objectUtil; },
    ZodParsedType: ZodParsedType,
    getParsedType: getParsedType,
    ZodType: ZodType,
    datetimeRegex: datetimeRegex,
    ZodString: ZodString,
    ZodNumber: ZodNumber,
    ZodBigInt: ZodBigInt,
    ZodBoolean: ZodBoolean,
    ZodDate: ZodDate,
    ZodSymbol: ZodSymbol,
    ZodUndefined: ZodUndefined,
    ZodNull: ZodNull,
    ZodAny: ZodAny,
    ZodUnknown: ZodUnknown,
    ZodNever: ZodNever,
    ZodVoid: ZodVoid,
    ZodArray: ZodArray,
    ZodObject: ZodObject,
    ZodUnion: ZodUnion,
    ZodDiscriminatedUnion: ZodDiscriminatedUnion,
    ZodIntersection: ZodIntersection,
    ZodTuple: ZodTuple,
    ZodRecord: ZodRecord,
    ZodMap: ZodMap,
    ZodSet: ZodSet,
    ZodFunction: ZodFunction,
    ZodLazy: ZodLazy,
    ZodLiteral: ZodLiteral,
    ZodEnum: ZodEnum,
    ZodNativeEnum: ZodNativeEnum,
    ZodPromise: ZodPromise,
    ZodEffects: ZodEffects,
    ZodTransformer: ZodEffects,
    ZodOptional: ZodOptional,
    ZodNullable: ZodNullable,
    ZodDefault: ZodDefault,
    ZodCatch: ZodCatch,
    ZodNaN: ZodNaN,
    BRAND: BRAND,
    ZodBranded: ZodBranded,
    ZodPipeline: ZodPipeline,
    ZodReadonly: ZodReadonly,
    custom: custom,
    Schema: ZodType,
    ZodSchema: ZodType,
    late: late,
    get ZodFirstPartyTypeKind () { return ZodFirstPartyTypeKind; },
    coerce: coerce,
    any: anyType,
    array: arrayType,
    bigint: bigIntType,
    boolean: booleanType,
    date: dateType,
    discriminatedUnion: discriminatedUnionType,
    effect: effectsType,
    'enum': enumType,
    'function': functionType,
    'instanceof': instanceOfType,
    intersection: intersectionType,
    lazy: lazyType,
    literal: literalType,
    map: mapType,
    nan: nanType,
    nativeEnum: nativeEnumType,
    never: neverType,
    'null': nullType,
    nullable: nullableType,
    number: numberType,
    object: objectType,
    oboolean: oboolean,
    onumber: onumber,
    optional: optionalType,
    ostring: ostring,
    pipeline: pipelineType,
    preprocess: preprocessType,
    promise: promiseType,
    record: recordType,
    set: setType,
    strictObject: strictObjectType,
    string: stringType,
    symbol: symbolType,
    transformer: effectsType,
    tuple: tupleType,
    'undefined': undefinedType,
    union: unionType,
    unknown: unknownType,
    'void': voidType,
    NEVER: NEVER,
    ZodIssueCode: ZodIssueCode,
    quotelessJson: quotelessJson,
    ZodError: ZodError
});



;// CONCATENATED MODULE: ./Extension/src/background/schema/preprocessor.ts
/**
 * @file
 * This file is part of AdGuard Browser Extension (https://github.com/AdguardTeam/AdguardBrowserExtension).
 *
 * AdGuard Browser Extension is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * AdGuard Browser Extension is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with AdGuard Browser Extension. If not, see <http://www.gnu.org/licenses/>.
 */ function preprocessor_define_property(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;
}

/**
 * In some cases we want to preprocessing input before validation
 * For example, cast loaded filter metadata item id field from string to number before validation:
 *
 * { filterId: "1", ... } -> { filterId: 1, ... }.
 */ class SchemaPreprocessor {
    /**
     * If {@link value} is string, cast it to number, else returns original value.
     *
     * @param value Preprocessed value.
     * @returns Number value, if string passed, else returns original value.
     */ static castStringToNumber(value) {
        if (typeof value === 'string') {
            return Number(JSON.parse(value));
        }
        return value;
    }
    /**
     * If {@link value} is string, cast it to boolean, else returns original value.
     *
     * @param value Preprocessed value.
     * @returns Boolean value, if string passed, else returns original value.
     */ static castStringToBoolean(value) {
        if (typeof value === 'string') {
            try {
                return Boolean(JSON.parse(value));
            } catch (e) {
                return value;
            }
        }
        return value;
    }
}
/**
     * Runtime {@link zod} validator with {@link SchemaPreprocessor.castStringToBoolean} preprocessor.
     */ preprocessor_define_property(SchemaPreprocessor, "booleanValidator", z.preprocess(SchemaPreprocessor.castStringToBoolean, z.boolean()));
/**
     * Runtime {@link zod} validator with {@link SchemaPreprocessor.castStringToNumber} preprocessor.
     */ preprocessor_define_property(SchemaPreprocessor, "numberValidator", z.preprocess(SchemaPreprocessor.castStringToNumber, z.number()));

;// CONCATENATED MODULE: ./Extension/src/background/schema/settings/main.ts
/**
 * @file
 * This file is part of AdGuard Browser Extension (https://github.com/AdguardTeam/AdguardBrowserExtension).
 *
 * AdGuard Browser Extension is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * AdGuard Browser Extension is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with AdGuard Browser Extension. If not, see <http://www.gnu.org/licenses/>.
 */ 

var SettingOption = /*#__PURE__*/ function(SettingOption) {
    // General settings.
    SettingOption["AppearanceTheme"] = "appearance-theme";
    SettingOption["DisableShowPageStats"] = "disable-show-page-statistic";
    SettingOption["DisableDetectFilters"] = "detect-filters-disabled";
    SettingOption["DisableSafebrowsing"] = "safebrowsing-disabled";
    SettingOption["FiltersUpdatePeriod"] = "filters-update-period";
    // Is filtering disabled or not.
    SettingOption["DisableFiltering"] = "adguard-disabled";
    // Extension specific settings.
    SettingOption["UseOptimizedFilters"] = "use-optimized-filters";
    SettingOption["DisableCollectHits"] = "hits-count-disabled";
    SettingOption["DisableShowContextMenu"] = "context-menu-disabled";
    // Flag used to show link to comparison of desktop and browser extension versions.
    SettingOption["DisableShowAdguardPromoInfo"] = "show-info-about-adguard-disabled";
    SettingOption["DisableShowAppUpdatedNotification"] = "show-app-updated-disabled";
    SettingOption["HideRateBlock"] = "hide-rate-block";
    SettingOption["UserRulesEditorWrap"] = "user-rules-editor-wrap";
    // Allowlist section.
    SettingOption["AllowlistDomains"] = "allowlist-domains";
    SettingOption["InvertedAllowlistDomains"] = "block-list-domains";
    SettingOption["AllowlistEnabled"] = "allowlist-enabled";
    SettingOption["DefaultAllowlistMode"] = "default-allowlist-mode";
    // Tracking protection (formerly Stealth mode).
    SettingOption["DisableStealthMode"] = "stealth-disable-stealth-mode";
    SettingOption["HideReferrer"] = "stealth-hide-referrer";
    SettingOption["HideSearchQueries"] = "stealth-hide-search-queries";
    SettingOption["SendDoNotTrack"] = "stealth-send-do-not-track";
    SettingOption["RemoveXClientData"] = "stealth-remove-x-client";
    SettingOption["BlockWebRTC"] = "stealth-block-webrtc";
    SettingOption["SelfDestructThirdPartyCookies"] = "stealth-block-third-party-cookies";
    SettingOption["SelfDestructThirdPartyCookiesTime"] = "stealth-block-third-party-cookies-time";
    SettingOption["SelfDestructFirstPartyCookies"] = "stealth-block-first-party-cookies";
    SettingOption["SelfDestructFirstPartyCookiesTime"] = "stealth-block-first-party-cookies-time";
    // Filters' statuses and states.
    SettingOption["FiltersState"] = "filters-state";
    SettingOption["FiltersVersion"] = "filters-version";
    SettingOption["GroupsState"] = "groups-state";
    SettingOption["UserFilterEnabled"] = "user-filter-enabled";
    // Filters metadata.
    SettingOption["Metadata"] = "filters-metadata";
    SettingOption["I18nMetadata"] = "filters-i18n-metadata";
    SettingOption["CustomFilters"] = "custom-filters";
    return SettingOption;
}({});
const appearanceValidator = z["enum"]([
    'system',
    'dark',
    'light'
]);
// Setting options may be stringified, use preprocessors for correct type casting
const settingsValidator = z.object({
    // ----- General settings section -----
    /**
     * See {@link GeneralSettingsConfig[GeneralSettingsOption.AppearanceTheme]}.
     */ ["appearance-theme"]: appearanceValidator,
    /**
     * See {@link GeneralSettingsConfig[GeneralSettingsOption.ShowBlockedAdsCount]}.
     */ ["disable-show-page-statistic"]: SchemaPreprocessor.booleanValidator,
    /**
     * See {@link GeneralSettingsConfig[GeneralSettingsOption.AutodetectFilters]}.
     */ ["detect-filters-disabled"]: SchemaPreprocessor.booleanValidator,
    /**
     * See {@link GeneralSettingsConfig[GeneralSettingsOption.SafebrowsingEnabled]}.
     */ ["safebrowsing-disabled"]: SchemaPreprocessor.booleanValidator,
    /**
     * See {@link GeneralSettingsConfig[GeneralSettingsOption.FiltersUpdatePeriod]}.
     */ ["filters-update-period"]: SchemaPreprocessor.numberValidator,
    // ----- General settings section -----
    // ----- Extension specific settings section -----
    /**
     * See {@link ExtensionSpecificSettingsConfig[ExtensionSpecificSettingsOption.UseOptimizedFilters]}.
     */ ["use-optimized-filters"]: SchemaPreprocessor.booleanValidator,
    /**
     * See {@link ExtensionSpecificSettingsConfig[ExtensionSpecificSettingsOption.CollectHitsCount]}.
     */ ["hits-count-disabled"]: SchemaPreprocessor.booleanValidator,
    /**
     * See {@link ExtensionSpecificSettingsConfig[ExtensionSpecificSettingsOption.ShowContextMenu]}.
     */ ["context-menu-disabled"]: SchemaPreprocessor.booleanValidator,
    /**
     * See {@link ExtensionSpecificSettingsConfig[ExtensionSpecificSettingsOption.ShowInfoAboutAdguard]}.
     */ ["show-info-about-adguard-disabled"]: SchemaPreprocessor.booleanValidator,
    /**
     * See {@link ExtensionSpecificSettingsConfig[ExtensionSpecificSettingsOption.ShowAppUpdatedInfo]}.
     */ ["show-app-updated-disabled"]: SchemaPreprocessor.booleanValidator,
    /**
     * See {@link ExtensionSpecificSettingsConfig[ExtensionSpecificSettingsOption.HideRateAdguard]}.
     */ ["hide-rate-block"]: SchemaPreprocessor.booleanValidator,
    /**
     * See {@link ExtensionSpecificSettingsConfig[ExtensionSpecificSettingsOption.UserRulesEditorWrap]}.
     */ ["user-rules-editor-wrap"]: SchemaPreprocessor.booleanValidator,
    // ----- Extension specific settings section -----
    // ----- Allowlist section -----
    /**
     * See {@link AllowlistConfig[AllowlistOption.Domains]}.
     */ ["allowlist-domains"]: z.string(),
    /**
     * See {@link AllowlistConfig[AllowlistOption.InvertedDomains]}.
     */ ["block-list-domains"]: z.string(),
    /**
     * See {@link AllowlistConfig[AllowlistOption.Enabled]}.
     */ ["allowlist-enabled"]: SchemaPreprocessor.booleanValidator,
    /**
     * See {@link AllowlistConfig[AllowlistOption.Inverted]}.
     */ ["default-allowlist-mode"]: SchemaPreprocessor.booleanValidator,
    // ----- Allowlist section -----
    // ----- Stealth section -----
    /**
     * See {@link StealthConfig[StealthOption.DisableStealthMode]}.
     */ ["stealth-disable-stealth-mode"]: SchemaPreprocessor.booleanValidator,
    /**
     * See {@link StealthConfig[StealthOption.HideReferrer]}.
     */ ["stealth-hide-referrer"]: SchemaPreprocessor.booleanValidator,
    /**
     * See {@link StealthConfig[StealthOption.HideSearchQueries]}.
     */ ["stealth-hide-search-queries"]: SchemaPreprocessor.booleanValidator,
    /**
     * See {@link StealthConfig[StealthOption.SendDoNotTrack]}.
     */ ["stealth-send-do-not-track"]: SchemaPreprocessor.booleanValidator,
    /**
     * See {@link StealthConfig[StealthOption.BlockWebRTC]}.
     */ ["stealth-block-webrtc"]: SchemaPreprocessor.booleanValidator,
    /**
     * See {@link StealthConfig[StealthOption.RemoveXClientData]}.
     */ ["stealth-remove-x-client"]: SchemaPreprocessor.booleanValidator,
    /**
     * See {@link StealthConfig[StealthOption.SelfDestructThirdPartyCookies]}.
     */ ["stealth-block-third-party-cookies"]: SchemaPreprocessor.booleanValidator,
    /**
     * See {@link StealthConfig[StealthOption.SelfDestructThirdPartyCookiesTime]}.
     */ ["stealth-block-third-party-cookies-time"]: z.number(),
    /**
     * See {@link StealthConfig[StealthOption.SelfDestructFirstPartyCookies]}.
     */ ["stealth-block-first-party-cookies"]: SchemaPreprocessor.booleanValidator,
    /**
     * See {@link StealthConfig[StealthOption.SelfDestructFirstPartyCookiesTime]}.
     */ ["stealth-block-first-party-cookies-time"]: z.number(),
    // ----- Stealth section -----
    // ----- Statuses section -----
    /**
     * See {@link UserFilterConfig[UserFilterOption.Enabled]}.
     */ ["user-filter-enabled"]: SchemaPreprocessor.booleanValidator,
    /**
     * See {@link FilterStateStorageData}.
     */ ["filters-state"]: z.string().optional(),
    /**
     * See {@link FilterVersionStorageData}.
     */ ["filters-version"]: z.string().optional(),
    /**
     * See {@link GroupStateStorageData}.
     */ ["groups-state"]: z.string().optional(),
    // ----- Statuses section -----
    // ----- Metadata section -----
    /**
     * See {@link Metadata}.
     */ ["filters-metadata"]: z.string().optional(),
    /**
     * See {@link I18nMetadata}.
     */ ["filters-i18n-metadata"]: z.string().optional(),
    /**
     * See {@link CustomFilterMetadataStorageData}.
     */ ["custom-filters"]: z.string().optional(),
    // ----- Metadata section -----
    /**
     * Is filtering enabled or not. Is needed for fast toggling filtering
     * without reload entire extension.
     */ ["adguard-disabled"]: SchemaPreprocessor.booleanValidator
});

;// CONCATENATED MODULE: ./Extension/src/background/schema/settings/index.ts
/**
 * @file
 * This file is part of AdGuard Browser Extension (https://github.com/AdguardTeam/AdguardBrowserExtension).
 *
 * AdGuard Browser Extension is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * AdGuard Browser Extension is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with AdGuard Browser Extension. If not, see <http://www.gnu.org/licenses/>.
 */ 

;// CONCATENATED MODULE: ./Extension/src/content-script/content-utils/elements.ts
/**
 * @file
 * This file is part of AdGuard Browser Extension (https://github.com/AdguardTeam/AdguardBrowserExtension).
 *
 * AdGuard Browser Extension is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * AdGuard Browser Extension is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with AdGuard Browser Extension. If not, see <http://www.gnu.org/licenses/>.
 */ /**
 * Max zIndex value
 * https://www.w3.org/TR/CSS21/visuren.html#z-index
 */ const MAX_Z_INDEX = '2147483647';
/**
 * Helper class for creating and injecting html elements
 */ class Elements {
    /**
     * Create style element with provided css.
     *
     * @param css - css text
     */ static createStyleElement(css) {
        const styleElement = document.createElement('style');
        styleElement.appendChild(document.createTextNode(css));
        return styleElement;
    }
    /**
     * Creates iframe and appends it after target open tag.
     *
     * @param props - {@link AppendIframeProps}
     * @param props.target - Node where to append iframe with html
     * @param props.html - html string to write inside iframe
     * @param props.styles - iframe styles text
     * @returns iframe element
     */ static appendIframe({ target, html, styles }) {
        const styleElement = Elements.createStyleElement(styles);
        const prependedHtml = `${styleElement.outerHTML}\n${html}`;
        const iframe = document.createElement('iframe');
        iframe.src = 'about:blank';
        iframe.style.position = 'fixed';
        iframe.style.zIndex = MAX_Z_INDEX;
        iframe.srcdoc = prependedHtml;
        target.insertAdjacentElement('afterbegin', iframe);
        return iframe;
    }
    /**
     * Creates div and appends it to the page.
     *
     * @param props - {@link AppendDivProps}
     * @param props.target - Node where to append div with html
     * @param props.html - Html string to write inside div
     * @returns div element
     */ static appendDiv({ target, html }) {
        const div = document.createElement('div');
        div.innerHTML = html;
        target.insertAdjacentElement('afterbegin', div);
        div.style.zIndex = MAX_Z_INDEX;
        return div;
    }
}

;// CONCATENATED MODULE: ./Extension/src/content-script/content-utils/alerts.ts
/**
 * @file
 * This file is part of AdGuard Browser Extension (https://github.com/AdguardTeam/AdguardBrowserExtension).
 *
 * AdGuard Browser Extension is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * AdGuard Browser Extension is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with AdGuard Browser Extension. If not, see <http://www.gnu.org/licenses/>.
 */ 
/**
 * Helper class for creating and injecting alerts
 */ class Alerts {
    /**
     * If {@link isAdguardTab}, append div, else we append iframe
     *
     * @param props - {@link AppendAlertElementProps}
     * @returns {HTMLElement}
     */ static appendAlertElement(props) {
        const { target, html, isAdguardTab, alertStyles, alertContainerStyles } = props;
        const alertContainerElement = Elements.createStyleElement(alertContainerStyles);
        document.body.insertAdjacentElement('afterbegin', alertContainerElement);
        if (isAdguardTab) {
            return Elements.appendDiv({
                target,
                html
            });
        }
        return Elements.appendIframe({
            target,
            html,
            styles: alertStyles
        });
    }
    /**
     * Generates alert html.
     *
     * @param props - {@link GenAlertHtmlProps}
     * @returns html string
     */ static genAlertHtml(props) {
        const { title, text } = props;
        let descBlock = '';
        if (text && text.length > 0) {
            descBlock = `<div class="adguard-popup-alert__desc">
                            ${text}
                        </div>`;
        }
        // don't show description text if it is same as title or if it is equal to undefined
        if (title === text || text === 'undefined') {
            descBlock = '';
        }
        let titleBlock = '';
        if (title && title.length > 0) {
            titleBlock = `<div class="adguard-popup-alert__title">
                            ${title}
                        </div>`;
        }
        return `<div class="adguard-popup-alert">
                    ${titleBlock}
                    ${descBlock}
                </div>`;
    }
}

;// CONCATENATED MODULE: ./Extension/src/content-script/content-utils/popups.ts
/**
 * @file
 * This file is part of AdGuard Browser Extension (https://github.com/AdguardTeam/AdguardBrowserExtension).
 *
 * AdGuard Browser Extension is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * AdGuard Browser Extension is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with AdGuard Browser Extension. If not, see <http://www.gnu.org/licenses/>.
 */ function popups_define_property(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;
}




/**
 * Helper class for creating and injecting info popups
 */ class Popups {
    /**
     * Shows alert popup.
     * Popup content is added right to the page content.
     *
     * @param message - {@link ShowAlertPopupMessage}
     * @param message.data - {@link ShowAlertPopupMessage} payload
     */ static showAlertPopup({ data }) {
        const { text, title, isAdguardTab, alertStyles, alertContainerStyles } = data;
        if (!title && !text) {
            return;
        }
        let messages = [];
        if (Array.isArray(text)) {
            messages = text;
        } else {
            messages = [
                text
            ];
        }
        let fullText = '';
        for(let i = 0; i < messages.length; i += 1){
            if (i > 0) {
                fullText += ', ';
            }
            fullText += messages[i];
        }
        const html = Alerts.genAlertHtml({
            title,
            text: fullText
        });
        Popups.appendAlertPopup(0, {
            html,
            isAdguardTab,
            alertStyles,
            alertContainerStyles
        });
    }
    /**
     * Shows version updated popup.
     * Popup content is added right to the page content.
     *
     * @param message - {@link ShowVersionUpdatedPopupMessage}
     * @param message.data - {@link ShowVersionUpdatedPopupMessage} payload
     *
     * @returns execution flag
     */ static showVersionUpdatedPopup({ data }) {
        const { title, offer, offerBgImage, description, isAdguardTab, changelogHref, changelogText, offerButtonHref, offerButtonText, showPromoNotification, disableNotificationText, alertStyles, iframeStyles } = data;
        const offerStyle = offerBgImage ? `background-image: url('${offerBgImage}')` : '';
        /* eslint-disable max-len */ const iframeHtml = `
            <div id="adguard-new-version-popup" class="adguard-update-popup adguard-update-popup--active${showPromoNotification ? ' adguard-update-popup--promo' : ''}">
                <div id="adguard-new-version-popup-close" class="adguard-update-popup__close close-iframe"></div>
                <div class="adguard-update-popup__logo"></div>
                <div class="adguard-update-popup__title">
                    ${title}
                </div>
                <div class="adguard-update-popup__desc">
                    ${description}
                </div>
                <div class="adguard-update-popup__links">
                    <a href="${changelogHref}" class="adguard-update-popup__link close-iframe" target="_blank">
                        ${changelogText}
                    </a>
                    <a href="#" class="adguard-update-popup__link adguard-update-popup__link--disable close-iframe disable-notifications">
                        ${disableNotificationText}
                    </a>
                </div>
                <div
                    class="adguard-update-popup__offer${showPromoNotification ? ' adguard-update-popup__offer--show' : ''}"
                    style="${offerStyle}"
                >
                    <div class="adguard-update-popup__offer-close close-iframe set-notification-viewed"></div>
                    <div class="adguard-update-popup__offer-content">
                        <div class="adguard-update-popup__offer-title">
                            ${offer}
                        </div>
                        <a href="${offerButtonHref}" class="adguard-update-popup__btn close-iframe set-notification-viewed${showPromoNotification ? ' adguard-update-popup__btn--promo' : ''}" target="_blank">
                            ${offerButtonText}
                        </a>
                    </div>
                </div>
            </div>
        `;
        /* eslint-enable max-len */ Popups.appendPopup(0, {
            iframeHtml,
            iframeStyles,
            iframeClassName: 'adguard-update-iframe',
            alertStyles,
            isAdguardTab,
            showPromoNotification
        });
        return true;
    }
    /**
     * Shows rules limits exceeded message.
     *
     * @param message - {@link ShowRuleLimitsAlertMessage}
     * @param message.data - {@link ShowRuleLimitsAlertMessage} payload
     *
     * @returns execution flag
     */ static showRuleLimitsAlert({ data }) {
        const { isAdguardTab, mainText, linkText, alertStyles, alertContainerStyles } = data;
        const iframeHtml = `
            <div id="adguard-rules-limits-exceeded-popup" class="adguard-rules-limits-exceeded-popup">
                <div class="adguard-rules-limits-exceeded-popup__info-icon"></div>
                <div class="adguard-rules-limits-exceeded-popup__content">
                    <p> ${mainText} </p>
                    <button id="open-rule-limits-link" type="button"> ${linkText} </button>
                </div>
                <button
                    aria-label="close"
                    type="button"
                    class="adguard-rules-limits-exceeded-popup__close close-iframe"
                ></button>
            </div>
        `;
        Popups.appendPopup(0, {
            iframeHtml,
            iframeStyles: alertContainerStyles,
            iframeClassName: 'adguard-rules-limits-exceeded-iframe',
            alertStyles,
            isAdguardTab,
            showPromoNotification: false,
            onIframeInjected: (iframe)=>{
                const isListening = Popups.handleOpenRulesLimitsPage(iframe);
                if (!isListening) {
                    iframe.addEventListener('load', ()=>{
                        Popups.handleOpenRulesLimitsPage(iframe);
                    });
                }
                // iframe should be hidden after some time
                const removeTimeout = setTimeout(()=>{
                    var _iframe_parentNode;
                    (_iframe_parentNode = iframe.parentNode) === null || _iframe_parentNode === void 0 ? void 0 : _iframe_parentNode.removeChild(iframe);
                }, Popups.HIDE_TIMEOUT_MS);
                /**
                 * Mouseover event listener:
                 * - clear timeout to prevent iframe from closing if user hovers over the iframe;
                 * - remove event listener after first hover.
                 */ const focusListener = ()=>{
                    clearTimeout(removeTimeout);
                    iframe.removeEventListener('mouseover', focusListener);
                };
                iframe.addEventListener('mouseover', focusListener);
            }
        });
        return true;
    }
    /**
     * Appends alert popup to page.
     *
     * @param count - try count
     * @param props - {@link AppendAlertElementProps} with omitted target property
     */ static appendAlertPopup(count, props) {
        if (count >= Popups.triesCount) {
            return;
        }
        if (document.body) {
            const alertElement = Alerts.appendAlertElement({
                ...props,
                target: document.body
            });
            alertElement.classList.add('adguard-alert-iframe');
            alertElement.onload = ()=>{
                alertElement.style.visibility = 'visible';
            };
            setTimeout(()=>{
                if (alertElement && alertElement.parentNode) {
                    alertElement.parentNode.removeChild(alertElement);
                }
            }, Popups.HIDE_TIMEOUT_MS);
        } else {
            setTimeout(()=>{
                Popups.appendAlertPopup(count + 1, props);
            }, Popups.retryTimeoutMs);
        }
    }
    /**
     * Appends version update popup to page.
     *
     * @param count - try count
     * @param props - {@link AppendVersionUpdatedPopupProps}
     */ static appendPopup(count, props) {
        if (count >= Popups.triesCount) {
            return;
        }
        const { isAdguardTab, showPromoNotification, iframeStyles, iframeClassName, iframeHtml, alertStyles, onIframeInjected } = props;
        if (document.body && !isAdguardTab) {
            const iframeCss = Elements.createStyleElement(iframeStyles);
            document.body.insertAdjacentElement('afterbegin', iframeCss);
            const iframe = Elements.appendIframe({
                target: document.body,
                html: iframeHtml,
                styles: alertStyles
            });
            iframe.classList.add(iframeClassName);
            const isListening = Popups.handleCloseIframe(iframe, showPromoNotification);
            if (!isListening) {
                iframe.addEventListener('load', ()=>{
                    Popups.handleCloseIframe(iframe, showPromoNotification);
                });
            }
            if (onIframeInjected) {
                onIframeInjected(iframe);
            }
        } else {
            setTimeout(()=>{
                Popups.appendPopup(count + 1, props);
            }, 500);
        }
    }
    /**
     * Handle manual close of iframe popup.
     *
     * @param iframe - iframe element
     * @param showPromoNotification - notification show flag
     *
     * @returns True if registered click listener, false otherwise.
     */ static handleCloseIframe(iframe, showPromoNotification) {
        var _iframe_contentWindow;
        const iframeDocument = iframe.contentDocument || ((_iframe_contentWindow = iframe.contentWindow) === null || _iframe_contentWindow === void 0 ? void 0 : _iframe_contentWindow.document);
        if (!iframeDocument) {
            return false;
        }
        const closeElements = iframeDocument.querySelectorAll('.close-iframe');
        if (closeElements.length === 0) {
            return false;
        }
        closeElements.forEach((element)=>{
            element.addEventListener('click', ()=>{
                if (element.classList.contains('disable-notifications')) {
                    // disable update notifications
                    sendMessage({
                        type: constants_MessageType.ChangeUserSettings,
                        data: {
                            key: SettingOption.DisableShowAppUpdatedNotification,
                            value: true
                        }
                    });
                }
                if (showPromoNotification && element.classList.contains('set-notification-viewed')) {
                    sendMessage({
                        type: constants_MessageType.SetNotificationViewed,
                        data: {
                            withDelay: false
                        }
                    });
                    // close only promo notification, not whole iframe
                    const promoNotification = iframeDocument.querySelector('.adguard-update-popup__offer');
                    if (promoNotification) {
                        var _promoNotification_parentNode;
                        (_promoNotification_parentNode = promoNotification.parentNode) === null || _promoNotification_parentNode === void 0 ? void 0 : _promoNotification_parentNode.removeChild(promoNotification);
                        // eslint-disable-next-line max-len
                        const versionPopup = iframeDocument.getElementById('adguard-new-version-popup');
                        if (versionPopup) {
                            // fix height of the frame
                            versionPopup.style.minHeight = '300px';
                        }
                    }
                    return;
                }
                setTimeout(()=>{
                    var _iframe_parentNode;
                    (_iframe_parentNode = iframe.parentNode) === null || _iframe_parentNode === void 0 ? void 0 : _iframe_parentNode.removeChild(iframe);
                }, Popups.removeFrameTimeoutMs);
            });
        });
        return true;
    }
    /**
     * Handle open rules limits settings page.
     *
     * @param iframe - iframe element
     *
     * @returns True if registered click listener, false otherwise.
     */ static handleOpenRulesLimitsPage(iframe) {
        var _iframe_contentWindow;
        const iframeDocument = iframe.contentDocument || ((_iframe_contentWindow = iframe.contentWindow) === null || _iframe_contentWindow === void 0 ? void 0 : _iframe_contentWindow.document);
        if (!iframeDocument) {
            return false;
        }
        const link = iframeDocument.querySelector('#open-rule-limits-link');
        if (!link) {
            return false;
        }
        const clickHandler = ()=>{
            // Open rules limits settings page.
            sendMessage({
                type: constants_MessageType.OpenRulesLimitsTab
            });
            // After redirect to settings page, close iframe.
            const removeTimeout = setTimeout(()=>{
                var _iframe_parentNode;
                (_iframe_parentNode = iframe.parentNode) === null || _iframe_parentNode === void 0 ? void 0 : _iframe_parentNode.removeChild(iframe);
                clearTimeout(removeTimeout);
            }, Popups.removeFrameTimeoutMs);
            link.removeEventListener('click', clickHandler);
        };
        link.addEventListener('click', clickHandler);
        return true;
    }
}
popups_define_property(Popups, "triesCount", 10);
/**
     * Time to live for alert popup.
     */ popups_define_property(Popups, "HIDE_TIMEOUT_MS", 1000 * 4);
popups_define_property(Popups, "retryTimeoutMs", 500);
// Remove iframe after click event fire on link
// NOTICE: if here is used value equal to 0,
// then iframe is closed early than link is clicked
popups_define_property(Popups, "removeFrameTimeoutMs", 10);

;// CONCATENATED MODULE: ./Extension/src/content-script/content-utils/main.ts
/**
 * @file
 * This file is part of AdGuard Browser Extension (https://github.com/AdguardTeam/AdguardBrowserExtension).
 *
 * AdGuard Browser Extension is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * AdGuard Browser Extension is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with AdGuard Browser Extension. If not, see <http://www.gnu.org/licenses/>.
 */ 


class ContentUtils {
    static init() {
        if (window !== window.top) {
            return;
        }
        if (!(document instanceof Document)) {
            return;
        }
        messageHandler.init();
        messageHandler.addListener(constants_MessageType.ShowAlertPopup, Popups.showAlertPopup);
        messageHandler.addListener(constants_MessageType.ShowVersionUpdatedPopup, Popups.showVersionUpdatedPopup);
        messageHandler.addListener(constants_MessageType.ShowRuleLimitsAlert, Popups.showRuleLimitsAlert);
    }
}

;// CONCATENATED MODULE: ./Extension/src/content-script/content-utils/index.ts
/**
 * @file
 * This file is part of AdGuard Browser Extension (https://github.com/AdguardTeam/AdguardBrowserExtension).
 *
 * AdGuard Browser Extension is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * AdGuard Browser Extension is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with AdGuard Browser Extension. If not, see <http://www.gnu.org/licenses/>.
 */ // Content script entry point


;// CONCATENATED MODULE: ./Extension/src/content-script/subscribe-to-scriptlets.ts
/**
 * @file
 * This file is part of AdGuard Browser Extension (https://github.com/AdguardTeam/AdguardBrowserExtension).
 *
 * AdGuard Browser Extension is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * AdGuard Browser Extension is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with AdGuard Browser Extension. If not, see <http://www.gnu.org/licenses/>.
 */ function subscribe_to_scriptlets_define_property(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;
}

/**
 * Script used to subscribe to scriptlets dispatched events
 * Loaded on content script start to ensure the fastest load
 */ class SubscribeToScriptlets {
    /**
     * Initializing content script
     */ static init() {
        SubscribeToScriptlets.subscribeToCloseWindow();
    }
    /**
     * Subscribe to close-window scriptlet's event
     * window.close() usage is restricted in Chrome so we use tabs API to do that
     * https://github.com/AdguardTeam/Scriptlets/issues/170
     */ static subscribeToCloseWindow() {
        // Events may be passed differently in MV3
        window.addEventListener(SubscribeToScriptlets.closeWindowEventName, SubscribeToScriptlets.closeWindowHandler);
        setTimeout(()=>{
            window.removeEventListener(SubscribeToScriptlets.closeWindowEventName, SubscribeToScriptlets.closeWindowHandler);
        }, SubscribeToScriptlets.removeListenerTimeoutMs);
        // Scriptlet is loaded first so we notify it that content script is ready
        dispatchEvent(new Event(SubscribeToScriptlets.subscribedToCloseWindowEventName));
    }
    /**
     * Send {@link MessageType.ScriptletCloseWindow} to background
     */ static closeWindowHandler() {
        sendMessage({
            type: constants_MessageType.ScriptletCloseWindow
        });
    }
}
subscribe_to_scriptlets_define_property(SubscribeToScriptlets, "removeListenerTimeoutMs", 1000);
subscribe_to_scriptlets_define_property(SubscribeToScriptlets, "closeWindowEventName", 'adguard:scriptlet-close-window');
subscribe_to_scriptlets_define_property(SubscribeToScriptlets, "subscribedToCloseWindowEventName", 'adguard:subscribed-to-close-window');

;// CONCATENATED MODULE: ./Extension/pages/content-script-start/mv3.ts
/**
 * @file
 * This file is part of AdGuard Browser Extension (https://github.com/AdguardTeam/AdguardBrowserExtension).
 *
 * AdGuard Browser Extension is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * AdGuard Browser Extension is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with AdGuard Browser Extension. If not, see <http://www.gnu.org/licenses/>.
 */ 


ContentUtils.init();
SubscribeToScriptlets.init();

})();

/******/ })()
;