mirror-rhinstaller-node-cache/axe-core/axe.js

38651 lines
No EOL
1.4 MiB

/*! axe v4.14.0
* Copyright (c) 2015 - 2026 Deque Systems, Inc.
*
* Your use of 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/.
*
* This entire copyright notice must appear in every copy of this file you
* distribute or in any file that contains substantial portions of this source
* code.
*/
(function axeFunction(window) {
var global = window;
var document = window.document;
'use strict';
function _typeof(o) {
'@babel/helpers - typeof';
return _typeof = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function(o) {
return typeof o;
} : function(o) {
return o && 'function' == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? 'symbol' : typeof o;
}, _typeof(o);
}
var axe = axe || {};
axe.version = '4.14.0';
if (typeof define === 'function' && define.amd) {
define('axe-core', [], function() {
return axe;
});
}
if ((typeof module === 'undefined' ? 'undefined' : _typeof(module)) === 'object' && module.exports && typeof axeFunction.toString === 'function') {
axe.source = '(' + axeFunction.toString() + ')(typeof window === "object" ? window : this);';
module.exports = axe;
}
if (typeof window.getComputedStyle === 'function') {
window.axe = axe;
}
var commons;
'use strict';
var _excluded = [ 'cssProperty', 'element' ], _excluded2 = [ 'space', 'supports' ], _excluded3 = [ 'algorithm' ], _excluded4 = [ 'method' ], _excluded5 = [ 'maxDeltaE', 'deltaEMethod', 'steps', 'maxSteps' ], _excluded6 = [ 'node' ], _excluded7 = [ 'relatedNodes' ], _excluded8 = [ 'node' ], _excluded9 = [ 'variant' ], _excluded0 = [ 'matches' ], _excluded1 = [ 'chromium' ], _excluded10 = [ 'noImplicit' ], _excluded11 = [ 'noPresentational' ], _excluded12 = [ 'node' ], _excluded13 = [ 'environmentData' ], _excluded14 = [ 'environmentData' ], _excluded15 = [ 'environmentData' ], _excluded16 = [ 'environmentData' ], _excluded17 = [ 'environmentData' ];
function _regenerator() {
var e, t, r = 'function' == typeof Symbol ? Symbol : {}, n = r.iterator || '@@iterator', o = r.toStringTag || '@@toStringTag';
function i(r, n, o, i) {
var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype);
return _regeneratorDefine2(u, '_invoke', function(r, n, o) {
var i, c, u, f = 0, p = o || [], y = !1, G = {
p: 0,
n: 0,
v: e,
a: d,
f: d.bind(e, 4),
d: function d(t, r) {
return i = t, c = 0, u = e, G.n = r, a;
}
};
function d(r, n) {
for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) {
var o, i = p[t], d = G.p, l = i[2];
r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0,
G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r,
i[5] = n, G.n = l, c = 0));
}
if (o || r > 1) {
return a;
}
throw y = !0, n;
}
return function(o, p, l) {
if (f > 1) {
throw TypeError('Generator is already running');
}
for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y; ) {
i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u);
try {
if (f = 2, i) {
if (c || (o = 'next'), t = i[o]) {
if (!(t = t.call(i, u))) {
throw TypeError('iterator result is not an object');
}
if (!t.done) {
return t;
}
u = t.value, c < 2 && (c = 0);
} else {
1 === c && (t = i['return']) && t.call(i), c < 2 && (u = TypeError('The iterator does not provide a \'' + o + '\' method'),
c = 1);
}
i = e;
} else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) {
break;
}
} catch (t) {
i = e, c = 1, u = t;
} finally {
f = 1;
}
}
return {
value: t,
done: y
};
};
}(r, o, i), !0), u;
}
var a = {};
function Generator() {}
function GeneratorFunction() {}
function GeneratorFunctionPrototype() {}
t = Object.getPrototypeOf;
var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function() {
return this;
}), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c);
function f(e) {
return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype,
_regeneratorDefine2(e, o, 'GeneratorFunction')), e.prototype = Object.create(u),
e;
}
return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, 'constructor', GeneratorFunctionPrototype),
_regeneratorDefine2(GeneratorFunctionPrototype, 'constructor', GeneratorFunction),
GeneratorFunction.displayName = 'GeneratorFunction', _regeneratorDefine2(GeneratorFunctionPrototype, o, 'GeneratorFunction'),
_regeneratorDefine2(u), _regeneratorDefine2(u, o, 'Generator'), _regeneratorDefine2(u, n, function() {
return this;
}), _regeneratorDefine2(u, 'toString', function() {
return '[object Generator]';
}), (_regenerator = function _regenerator() {
return {
w: i,
m: f
};
})();
}
function _regeneratorDefine2(e, r, n, t) {
var i = Object.defineProperty;
try {
i({}, '', {});
} catch (e) {
i = 0;
}
_regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) {
function o(r, n) {
_regeneratorDefine2(e, r, function(e) {
return this._invoke(r, n, e);
});
}
r ? i ? i(e, r, {
value: n,
enumerable: !t,
configurable: !t,
writable: !t
}) : e[r] = n : (o('next', 0), o('throw', 1), o('return', 2));
}, _regeneratorDefine2(e, r, n, t);
}
function asyncGeneratorStep(n, t, e, r, o, a, c) {
try {
var i = n[a](c), u = i.value;
} catch (n) {
return void e(n);
}
i.done ? t(u) : Promise.resolve(u).then(r, o);
}
function _asyncToGenerator(n) {
return function() {
var t = this, e = arguments;
return new Promise(function(r, o) {
var a = n.apply(t, e);
function _next(n) {
asyncGeneratorStep(a, r, o, _next, _throw, 'next', n);
}
function _throw(n) {
asyncGeneratorStep(a, r, o, _next, _throw, 'throw', n);
}
_next(void 0);
});
};
}
function _toArray(r) {
return _arrayWithHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableRest();
}
function _wrapNativeSuper(t) {
var r = 'function' == typeof Map ? new Map() : void 0;
return _wrapNativeSuper = function _wrapNativeSuper(t) {
if (null === t || !_isNativeFunction(t)) {
return t;
}
if ('function' != typeof t) {
throw new TypeError('Super expression must either be null or a function');
}
if (void 0 !== r) {
if (r.has(t)) {
return r.get(t);
}
r.set(t, Wrapper);
}
function Wrapper() {
return _construct(t, arguments, _getPrototypeOf(this).constructor);
}
return Wrapper.prototype = Object.create(t.prototype, {
constructor: {
value: Wrapper,
enumerable: !1,
writable: !0,
configurable: !0
}
}), _setPrototypeOf(Wrapper, t);
}, _wrapNativeSuper(t);
}
function _isNativeFunction(t) {
try {
return -1 !== Function.toString.call(t).indexOf('[native code]');
} catch (n) {
return 'function' == typeof t;
}
}
function _objectWithoutProperties(e, t) {
if (null == e) {
return {};
}
var o, r, i = _objectWithoutPropertiesLoose(e, t);
if (Object.getOwnPropertySymbols) {
var n = Object.getOwnPropertySymbols(e);
for (r = 0; r < n.length; r++) {
o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
}
}
return i;
}
function _objectWithoutPropertiesLoose(r, e) {
if (null == r) {
return {};
}
var t = {};
for (var n in r) {
if ({}.hasOwnProperty.call(r, n)) {
if (-1 !== e.indexOf(n)) {
continue;
}
t[n] = r[n];
}
}
return t;
}
function _callSuper(t, o, e) {
return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
}
function _possibleConstructorReturn(t, e) {
if (e && ('object' == _typeof(e) || 'function' == typeof e)) {
return e;
}
if (void 0 !== e) {
throw new TypeError('Derived constructors may only return object or undefined');
}
return _assertThisInitialized(t);
}
function _assertThisInitialized(e) {
if (void 0 === e) {
throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
}
return e;
}
function _getPrototypeOf(t) {
return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(t) {
return t.__proto__ || Object.getPrototypeOf(t);
}, _getPrototypeOf(t);
}
function _toConsumableArray(r) {
return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();
}
function _nonIterableSpread() {
throw new TypeError('Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.');
}
function _iterableToArray(r) {
if ('undefined' != typeof Symbol && null != r[Symbol.iterator] || null != r['@@iterator']) {
return Array.from(r);
}
}
function _arrayWithoutHoles(r) {
if (Array.isArray(r)) {
return _arrayLikeToArray(r);
}
}
function _extends() {
return _extends = Object.assign ? Object.assign.bind() : function(n) {
for (var e = 1; e < arguments.length; e++) {
var t = arguments[e];
for (var r in t) {
({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
}
}
return n;
}, _extends.apply(null, arguments);
}
function _construct(t, e, r) {
if (_isNativeReflectConstruct()) {
return Reflect.construct.apply(null, arguments);
}
var o = [ null ];
o.push.apply(o, e);
var p = new (t.bind.apply(t, o))();
return r && _setPrototypeOf(p, r.prototype), p;
}
function _isNativeReflectConstruct() {
try {
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
} catch (t) {}
return (_isNativeReflectConstruct = function _isNativeReflectConstruct() {
return !!t;
})();
}
function _wrapRegExp() {
_wrapRegExp = function _wrapRegExp(e, r) {
return new BabelRegExp(e, void 0, r);
};
var e = RegExp.prototype, r = new WeakMap();
function BabelRegExp(e, t, p) {
var o = RegExp(e, t);
return r.set(o, p || r.get(e)), _setPrototypeOf(o, BabelRegExp.prototype);
}
function buildGroups(e, t) {
var p = r.get(t);
return Object.keys(p).reduce(function(r, t) {
var o = p[t];
if ('number' == typeof o) {
r[t] = e[o];
} else {
for (var i = 0; void 0 === e[o[i]] && i + 1 < o.length; ) {
i++;
}
r[t] = e[o[i]];
}
return r;
}, Object.create(null));
}
return _inherits(BabelRegExp, RegExp), BabelRegExp.prototype.exec = function(r) {
var t = e.exec.call(this, r);
if (t) {
t.groups = buildGroups(t, this);
var p = t.indices;
p && (p.groups = buildGroups(p, this));
}
return t;
}, BabelRegExp.prototype[Symbol.replace] = function(t, p) {
if ('string' == typeof p) {
var o = r.get(this);
return e[Symbol.replace].call(this, t, p.replace(/\$<([^>]+)(>|$)/g, function(e, r, t) {
if ('' === t) {
return e;
}
var p = o[r];
return Array.isArray(p) ? '$' + p.join('$') : 'number' == typeof p ? '$' + p : '';
}));
}
if ('function' == typeof p) {
var i = this;
return e[Symbol.replace].call(this, t, function() {
var e = arguments;
return 'object' != _typeof(e[e.length - 1]) && (e = [].slice.call(e)).push(buildGroups(e, i)),
p.apply(this, e);
});
}
return e[Symbol.replace].call(this, t, p);
}, _wrapRegExp.apply(this, arguments);
}
function _inherits(t, e) {
if ('function' != typeof e && null !== e) {
throw new TypeError('Super expression must either be null or a function');
}
t.prototype = Object.create(e && e.prototype, {
constructor: {
value: t,
writable: !0,
configurable: !0
}
}), Object.defineProperty(t, 'prototype', {
writable: !1
}), e && _setPrototypeOf(t, e);
}
function _setPrototypeOf(t, e) {
return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t, e) {
return t.__proto__ = e, t;
}, _setPrototypeOf(t, e);
}
function _defineProperty(e, r, t) {
return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
value: t,
enumerable: !0,
configurable: !0,
writable: !0
}) : e[r] = t, e;
}
function _slicedToArray(r, e) {
return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _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(r, l) {
var t = null == r ? null : 'undefined' != typeof Symbol && r[Symbol.iterator] || r['@@iterator'];
if (null != t) {
var e, n, i, u, a = [], f = !0, o = !1;
try {
if (i = (t = t.call(r)).next, 0 === l) {
if (Object(t) !== t) {
return;
}
f = !1;
} else {
for (;!(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0) {}
}
} catch (r) {
o = !0, n = r;
} finally {
try {
if (!f && null != t['return'] && (u = t['return'](), Object(u) !== u)) {
return;
}
} finally {
if (o) {
throw n;
}
}
}
return a;
}
}
function _arrayWithHoles(r) {
if (Array.isArray(r)) {
return r;
}
}
function _classCallCheck(a, n) {
if (!(a instanceof n)) {
throw new TypeError('Cannot call a class as a function');
}
}
function _defineProperties(e, r) {
for (var t = 0; t < r.length; t++) {
var o = r[t];
o.enumerable = o.enumerable || !1, o.configurable = !0, 'value' in o && (o.writable = !0),
Object.defineProperty(e, _toPropertyKey(o.key), o);
}
}
function _createClass(e, r, t) {
return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t),
Object.defineProperty(e, 'prototype', {
writable: !1
}), e;
}
function _toPropertyKey(t) {
var i = _toPrimitive(t, 'string');
return 'symbol' == _typeof(i) ? i : i + '';
}
function _toPrimitive(t, r) {
if ('object' != _typeof(t) || !t) {
return t;
}
var e = t[Symbol.toPrimitive];
if (void 0 !== e) {
var i = e.call(t, r || 'default');
if ('object' != _typeof(i)) {
return i;
}
throw new TypeError('@@toPrimitive must return a primitive value.');
}
return ('string' === r ? String : Number)(t);
}
function _createForOfIteratorHelper(r, e) {
var t = 'undefined' != typeof Symbol && r[Symbol.iterator] || r['@@iterator'];
if (!t) {
if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && 'number' == typeof r.length) {
t && (r = t);
var _n = 0, F = function F() {};
return {
s: F,
n: function n() {
return _n >= r.length ? {
done: !0
} : {
done: !1,
value: r[_n++]
};
},
e: function e(r) {
throw r;
},
f: F
};
}
throw new TypeError('Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.');
}
var o, a = !0, u = !1;
return {
s: function s() {
t = t.call(r);
},
n: function n() {
var r = t.next();
return a = r.done, r;
},
e: function e(r) {
u = !0, o = r;
},
f: function f() {
try {
a || null == t['return'] || t['return']();
} finally {
if (u) {
throw o;
}
}
}
};
}
function _unsupportedIterableToArray(r, a) {
if (r) {
if ('string' == typeof r) {
return _arrayLikeToArray(r, a);
}
var t = {}.toString.call(r).slice(8, -1);
return 'Object' === t && r.constructor && (t = r.constructor.name), 'Map' === t || 'Set' === t ? Array.from(r) : 'Arguments' === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
}
}
function _arrayLikeToArray(r, a) {
(null == a || a > r.length) && (a = r.length);
for (var e = 0, n = Array(a); e < a; e++) {
n[e] = r[e];
}
return n;
}
function _typeof(o) {
'@babel/helpers - typeof';
return _typeof = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function(o) {
return typeof o;
} : function(o) {
return o && 'function' == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? 'symbol' : typeof o;
}, _typeof(o);
}
(function(_globalThis$process, _CSS, _window$Intl) {
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __defNormalProp = function __defNormalProp(obj, key, value) {
return key in obj ? __defProp(obj, key, {
enumerable: true,
configurable: true,
writable: true,
value: value
}) : obj[key] = value;
};
var __markAsModule = function __markAsModule(target) {
return __defProp(target, '__esModule', {
value: true
});
};
var __commonJS = function __commonJS(cb, mod) {
return function() {
return mod || cb((mod = {
exports: {}
}).exports, mod), mod.exports;
};
};
var __export = function __export(target, all) {
for (var name in all) {
__defProp(target, name, {
get: all[name],
enumerable: true
});
}
};
var __exportStar = function __exportStar(target, module, desc) {
if (module && _typeof(module) === 'object' || typeof module === 'function') {
var _iterator = _createForOfIteratorHelper(__getOwnPropNames(module)), _step;
try {
var _loop = function _loop() {
var key = _step.value;
if (!__hasOwnProp.call(target, key) && key !== 'default') {
__defProp(target, key, {
get: function get() {
return module[key];
},
enumerable: !(desc = __getOwnPropDesc(module, key)) || desc.enumerable
});
}
};
for (_iterator.s(); !(_step = _iterator.n()).done; ) {
_loop();
}
} catch (err) {
_iterator.e(err);
} finally {
_iterator.f();
}
}
return target;
};
var __toModule = function __toModule(module) {
return __exportStar(__markAsModule(__defProp(module != null ? __create(__getProtoOf(module)) : {}, 'default', module && module.__esModule && 'default' in module ? {
get: function get() {
return module['default'];
},
enumerable: true
} : {
value: module,
enumerable: true
})), module);
};
var __publicField = function __publicField(obj, key, value) {
__defNormalProp(obj, _typeof(key) !== 'symbol' ? key + '' : key, value);
return value;
};
var require_es6_promise = __commonJS(function(exports, module) {
(function(global2, factory) {
_typeof(exports) === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : global2.ES6Promise = factory();
})(exports, function() {
'use strict';
function objectOrFunction(x) {
var type2 = _typeof(x);
return x !== null && (type2 === 'object' || type2 === 'function');
}
function isFunction(x) {
return typeof x === 'function';
}
var _isArray = void 0;
if (Array.isArray) {
_isArray = Array.isArray;
} else {
_isArray = function _isArray(x) {
return Object.prototype.toString.call(x) === '[object Array]';
};
}
var isArray = _isArray;
var len = 0;
var vertxNext = void 0;
var customSchedulerFn = void 0;
var asap = function asap2(callback, arg) {
queue2[len] = callback;
queue2[len + 1] = arg;
len += 2;
if (len === 2) {
if (customSchedulerFn) {
customSchedulerFn(flush);
} else {
scheduleFlush();
}
}
};
function setScheduler(scheduleFn) {
customSchedulerFn = scheduleFn;
}
function setAsap(asapFn) {
asap = asapFn;
}
var browserWindow = typeof window !== 'undefined' ? window : void 0;
var browserGlobal = browserWindow || {};
var BrowserMutationObserver = browserGlobal.MutationObserver || browserGlobal.WebKitMutationObserver;
var isNode2 = typeof self === 'undefined' && typeof process !== 'undefined' && {}.toString.call(process) === '[object process]';
var isWorker = typeof Uint8ClampedArray !== 'undefined' && typeof importScripts !== 'undefined' && typeof MessageChannel !== 'undefined';
function useNextTick() {
return function() {
return process.nextTick(flush);
};
}
function useVertxTimer() {
if (typeof vertxNext !== 'undefined') {
return function() {
vertxNext(flush);
};
}
return useSetTimeout();
}
function useMutationObserver() {
var iterations = 0;
var observer = new BrowserMutationObserver(flush);
var node = document.createTextNode('');
observer.observe(node, {
characterData: true
});
return function() {
node.data = iterations = ++iterations % 2;
};
}
function useMessageChannel() {
var channel = new MessageChannel();
channel.port1.onmessage = flush;
return function() {
return channel.port2.postMessage(0);
};
}
function useSetTimeout() {
var globalSetTimeout = setTimeout;
return function() {
return globalSetTimeout(flush, 1);
};
}
var queue2 = new Array(1e3);
function flush() {
for (var i = 0; i < len; i += 2) {
var callback = queue2[i];
var arg = queue2[i + 1];
callback(arg);
queue2[i] = void 0;
queue2[i + 1] = void 0;
}
len = 0;
}
function attemptVertx() {
try {
var vertx = Function('return this')().require('vertx');
vertxNext = vertx.runOnLoop || vertx.runOnContext;
return useVertxTimer();
} catch (e) {
return useSetTimeout();
}
}
var scheduleFlush = void 0;
if (isNode2) {
scheduleFlush = useNextTick();
} else if (BrowserMutationObserver) {
scheduleFlush = useMutationObserver();
} else if (isWorker) {
scheduleFlush = useMessageChannel();
} else if (browserWindow === void 0 && true) {
scheduleFlush = attemptVertx();
} else {
scheduleFlush = useSetTimeout();
}
function then(onFulfillment, onRejection) {
var parent = this;
var child = new this.constructor(noop3);
if (child[PROMISE_ID] === void 0) {
makePromise(child);
}
var _state = parent._state;
if (_state) {
var callback = arguments[_state - 1];
asap(function() {
return invokeCallback(_state, child, callback, parent._result);
});
} else {
subscribe2(parent, child, onFulfillment, onRejection);
}
return child;
}
function resolve$1(object) {
var Constructor = this;
if (object && _typeof(object) === 'object' && object.constructor === Constructor) {
return object;
}
var promise = new Constructor(noop3);
resolve(promise, object);
return promise;
}
var PROMISE_ID = Math.random().toString(36).substring(2);
function noop3() {}
var PENDING = void 0;
var FULFILLED = 1;
var REJECTED = 2;
function selfFulfillment() {
return new TypeError('You cannot resolve a promise with itself');
}
function cannotReturnOwn() {
return new TypeError('A promises callback cannot return that same promise.');
}
function tryThen(then$$1, value, fulfillmentHandler, rejectionHandler) {
try {
then$$1.call(value, fulfillmentHandler, rejectionHandler);
} catch (e) {
return e;
}
}
function handleForeignThenable(promise, thenable, then$$1) {
asap(function(promise2) {
var sealed = false;
var error = tryThen(then$$1, thenable, function(value) {
if (sealed) {
return;
}
sealed = true;
if (thenable !== value) {
resolve(promise2, value);
} else {
fulfill(promise2, value);
}
}, function(reason) {
if (sealed) {
return;
}
sealed = true;
reject(promise2, reason);
}, 'Settle: ' + (promise2._label || ' unknown promise'));
if (!sealed && error) {
sealed = true;
reject(promise2, error);
}
}, promise);
}
function handleOwnThenable(promise, thenable) {
if (thenable._state === FULFILLED) {
fulfill(promise, thenable._result);
} else if (thenable._state === REJECTED) {
reject(promise, thenable._result);
} else {
subscribe2(thenable, void 0, function(value) {
return resolve(promise, value);
}, function(reason) {
return reject(promise, reason);
});
}
}
function handleMaybeThenable(promise, maybeThenable, then$$1) {
if (maybeThenable.constructor === promise.constructor && then$$1 === then && maybeThenable.constructor.resolve === resolve$1) {
handleOwnThenable(promise, maybeThenable);
} else {
if (then$$1 === void 0) {
fulfill(promise, maybeThenable);
} else if (isFunction(then$$1)) {
handleForeignThenable(promise, maybeThenable, then$$1);
} else {
fulfill(promise, maybeThenable);
}
}
}
function resolve(promise, value) {
if (promise === value) {
reject(promise, selfFulfillment());
} else if (objectOrFunction(value)) {
var then$$1 = void 0;
try {
then$$1 = value.then;
} catch (error) {
reject(promise, error);
return;
}
handleMaybeThenable(promise, value, then$$1);
} else {
fulfill(promise, value);
}
}
function publishRejection(promise) {
if (promise._onerror) {
promise._onerror(promise._result);
}
publish(promise);
}
function fulfill(promise, value) {
if (promise._state !== PENDING) {
return;
}
promise._result = value;
promise._state = FULFILLED;
if (promise._subscribers.length !== 0) {
asap(publish, promise);
}
}
function reject(promise, reason) {
if (promise._state !== PENDING) {
return;
}
promise._state = REJECTED;
promise._result = reason;
asap(publishRejection, promise);
}
function subscribe2(parent, child, onFulfillment, onRejection) {
var _subscribers = parent._subscribers;
var length = _subscribers.length;
parent._onerror = null;
_subscribers[length] = child;
_subscribers[length + FULFILLED] = onFulfillment;
_subscribers[length + REJECTED] = onRejection;
if (length === 0 && parent._state) {
asap(publish, parent);
}
}
function publish(promise) {
var subscribers = promise._subscribers;
var settled = promise._state;
if (subscribers.length === 0) {
return;
}
var child = void 0, callback = void 0, detail = promise._result;
for (var i = 0; i < subscribers.length; i += 3) {
child = subscribers[i];
callback = subscribers[i + settled];
if (child) {
invokeCallback(settled, child, callback, detail);
} else {
callback(detail);
}
}
promise._subscribers.length = 0;
}
function invokeCallback(settled, promise, callback, detail) {
var hasCallback = isFunction(callback), value = void 0, error = void 0, succeeded = true;
if (hasCallback) {
try {
value = callback(detail);
} catch (e) {
succeeded = false;
error = e;
}
if (promise === value) {
reject(promise, cannotReturnOwn());
return;
}
} else {
value = detail;
}
if (promise._state !== PENDING) {} else if (hasCallback && succeeded) {
resolve(promise, value);
} else if (succeeded === false) {
reject(promise, error);
} else if (settled === FULFILLED) {
fulfill(promise, value);
} else if (settled === REJECTED) {
reject(promise, value);
}
}
function initializePromise(promise, resolver) {
try {
resolver(function resolvePromise(value) {
resolve(promise, value);
}, function rejectPromise(reason) {
reject(promise, reason);
});
} catch (e) {
reject(promise, e);
}
}
var id = 0;
function nextId() {
return id++;
}
function makePromise(promise) {
promise[PROMISE_ID] = id++;
promise._state = void 0;
promise._result = void 0;
promise._subscribers = [];
}
function validationError() {
return new Error('Array Methods must be provided an Array');
}
var Enumerator = function() {
function Enumerator2(Constructor, input) {
this._instanceConstructor = Constructor;
this.promise = new Constructor(noop3);
if (!this.promise[PROMISE_ID]) {
makePromise(this.promise);
}
if (isArray(input)) {
this.length = input.length;
this._remaining = input.length;
this._result = new Array(this.length);
if (this.length === 0) {
fulfill(this.promise, this._result);
} else {
this.length = this.length || 0;
this._enumerate(input);
if (this._remaining === 0) {
fulfill(this.promise, this._result);
}
}
} else {
reject(this.promise, validationError());
}
}
Enumerator2.prototype._enumerate = function _enumerate(input) {
for (var i = 0; this._state === PENDING && i < input.length; i++) {
this._eachEntry(input[i], i);
}
};
Enumerator2.prototype._eachEntry = function _eachEntry(entry, i) {
var c4 = this._instanceConstructor;
var resolve$$1 = c4.resolve;
if (resolve$$1 === resolve$1) {
var _then = void 0;
var error = void 0;
var didError = false;
try {
_then = entry.then;
} catch (e) {
didError = true;
error = e;
}
if (_then === then && entry._state !== PENDING) {
this._settledAt(entry._state, i, entry._result);
} else if (typeof _then !== 'function') {
this._remaining--;
this._result[i] = entry;
} else if (c4 === Promise$1) {
var promise = new c4(noop3);
if (didError) {
reject(promise, error);
} else {
handleMaybeThenable(promise, entry, _then);
}
this._willSettleAt(promise, i);
} else {
this._willSettleAt(new c4(function(resolve$$12) {
return resolve$$12(entry);
}), i);
}
} else {
this._willSettleAt(resolve$$1(entry), i);
}
};
Enumerator2.prototype._settledAt = function _settledAt(state, i, value) {
var promise = this.promise;
if (promise._state === PENDING) {
this._remaining--;
if (state === REJECTED) {
reject(promise, value);
} else {
this._result[i] = value;
}
}
if (this._remaining === 0) {
fulfill(promise, this._result);
}
};
Enumerator2.prototype._willSettleAt = function _willSettleAt(promise, i) {
var enumerator = this;
subscribe2(promise, void 0, function(value) {
return enumerator._settledAt(FULFILLED, i, value);
}, function(reason) {
return enumerator._settledAt(REJECTED, i, reason);
});
};
return Enumerator2;
}();
function all(entries2) {
return new Enumerator(this, entries2).promise;
}
function race(entries2) {
var Constructor = this;
if (!isArray(entries2)) {
return new Constructor(function(_, reject2) {
return reject2(new TypeError('You must pass an array to race.'));
});
} else {
return new Constructor(function(resolve2, reject2) {
var length = entries2.length;
for (var i = 0; i < length; i++) {
Constructor.resolve(entries2[i]).then(resolve2, reject2);
}
});
}
}
function reject$1(reason) {
var Constructor = this;
var promise = new Constructor(noop3);
reject(promise, reason);
return promise;
}
function needsResolver() {
throw new TypeError('You must pass a resolver function as the first argument to the promise constructor');
}
function needsNew() {
throw new TypeError('Failed to construct \'Promise\': Please use the \'new\' operator, this object constructor cannot be called as a function.');
}
var Promise$1 = function() {
function Promise2(resolver) {
this[PROMISE_ID] = nextId();
this._result = this._state = void 0;
this._subscribers = [];
if (noop3 !== resolver) {
typeof resolver !== 'function' && needsResolver();
this instanceof Promise2 ? initializePromise(this, resolver) : needsNew();
}
}
Promise2.prototype['catch'] = function _catch(onRejection) {
return this.then(null, onRejection);
};
Promise2.prototype['finally'] = function _finally(callback) {
var promise = this;
var constructor = promise.constructor;
if (isFunction(callback)) {
return promise.then(function(value) {
return constructor.resolve(callback()).then(function() {
return value;
});
}, function(reason) {
return constructor.resolve(callback()).then(function() {
throw reason;
});
});
}
return promise.then(callback, callback);
};
return Promise2;
}();
Promise$1.prototype.then = then;
Promise$1.all = all;
Promise$1.race = race;
Promise$1.resolve = resolve$1;
Promise$1.reject = reject$1;
Promise$1._setScheduler = setScheduler;
Promise$1._setAsap = setAsap;
Promise$1._asap = asap;
function polyfill() {
var local = void 0;
if (typeof global !== 'undefined') {
local = global;
} else if (typeof self !== 'undefined') {
local = self;
} else {
try {
local = Function('return this')();
} catch (e) {
throw new Error('polyfill failed because global object is unavailable in this environment');
}
}
var P = local.Promise;
if (P) {
var promiseToString = null;
try {
promiseToString = Object.prototype.toString.call(P.resolve());
} catch (e) {}
if (promiseToString === '[object Promise]' && !P.cast) {
return;
}
}
local.Promise = Promise$1;
}
Promise$1.polyfill = polyfill;
Promise$1.Promise = Promise$1;
return Promise$1;
});
});
var require_typedarray = __commonJS(function(exports) {
var MAX_ARRAY_LENGTH = 1e5;
var ECMAScript = function() {
var opts = Object.prototype.toString;
var ophop = Object.prototype.hasOwnProperty;
return {
Class: function Class(v) {
return opts.call(v).replace(/^\[object *|\]$/g, '');
},
HasProperty: function HasProperty(o, p3) {
return p3 in o;
},
HasOwnProperty: function HasOwnProperty(o, p3) {
return ophop.call(o, p3);
},
IsCallable: function IsCallable(o) {
return typeof o === 'function';
},
ToInt32: function ToInt32(v) {
return v >> 0;
},
ToUint32: function ToUint32(v) {
return v >>> 0;
}
};
}();
var LN2 = Math.LN2;
var abs2 = Math.abs;
var floor = Math.floor;
var log2 = Math.log;
var min = Math.min;
var pow2 = Math.pow;
var round = Math.round;
function clamp4(v, minimum, max2) {
return v < minimum ? minimum : v > max2 ? max2 : v;
}
var getOwnPropNames = Object.getOwnPropertyNames || function(o) {
if (o !== Object(o)) {
throw new TypeError('Object.getOwnPropertyNames called on non-object');
}
var props = [], p3;
for (p3 in o) {
if (ECMAScript.HasOwnProperty(o, p3)) {
props.push(p3);
}
}
return props;
};
var defineProp;
if (Object.defineProperty && function() {
try {
Object.defineProperty({}, 'x', {});
return true;
} catch (e) {
return false;
}
}()) {
defineProp = Object.defineProperty;
} else {
defineProp = function defineProp(o, p3, desc) {
if (!o === Object(o)) {
throw new TypeError('Object.defineProperty called on non-object');
}
if (ECMAScript.HasProperty(desc, 'get') && Object.prototype.__defineGetter__) {
Object.prototype.__defineGetter__.call(o, p3, desc.get);
}
if (ECMAScript.HasProperty(desc, 'set') && Object.prototype.__defineSetter__) {
Object.prototype.__defineSetter__.call(o, p3, desc.set);
}
if (ECMAScript.HasProperty(desc, 'value')) {
o[p3] = desc.value;
}
return o;
};
}
function configureProperties(obj) {
if (getOwnPropNames && defineProp) {
var props = getOwnPropNames(obj), i;
for (i = 0; i < props.length; i += 1) {
defineProp(obj, props[i], {
value: obj[props[i]],
writable: false,
enumerable: false,
configurable: false
});
}
}
}
function makeArrayAccessors(obj) {
if (!defineProp) {
return;
}
if (obj.length > MAX_ARRAY_LENGTH) {
throw new RangeError('Array too large for polyfill');
}
function makeArrayAccessor(index) {
defineProp(obj, index, {
get: function get() {
return obj._getter(index);
},
set: function set(v) {
obj._setter(index, v);
},
enumerable: true,
configurable: false
});
}
var i;
for (i = 0; i < obj.length; i += 1) {
makeArrayAccessor(i);
}
}
function as_signed(value, bits) {
var s = 32 - bits;
return value << s >> s;
}
function as_unsigned(value, bits) {
var s = 32 - bits;
return value << s >>> s;
}
function packI8(n3) {
return [ n3 & 255 ];
}
function unpackI8(bytes) {
return as_signed(bytes[0], 8);
}
function packU8(n3) {
return [ n3 & 255 ];
}
function unpackU8(bytes) {
return as_unsigned(bytes[0], 8);
}
function packU8Clamped(n3) {
n3 = round(Number(n3));
return [ n3 < 0 ? 0 : n3 > 255 ? 255 : n3 & 255 ];
}
function packI16(n3) {
return [ n3 >> 8 & 255, n3 & 255 ];
}
function unpackI16(bytes) {
return as_signed(bytes[0] << 8 | bytes[1], 16);
}
function packU16(n3) {
return [ n3 >> 8 & 255, n3 & 255 ];
}
function unpackU16(bytes) {
return as_unsigned(bytes[0] << 8 | bytes[1], 16);
}
function packI32(n3) {
return [ n3 >> 24 & 255, n3 >> 16 & 255, n3 >> 8 & 255, n3 & 255 ];
}
function unpackI32(bytes) {
return as_signed(bytes[0] << 24 | bytes[1] << 16 | bytes[2] << 8 | bytes[3], 32);
}
function packU32(n3) {
return [ n3 >> 24 & 255, n3 >> 16 & 255, n3 >> 8 & 255, n3 & 255 ];
}
function unpackU32(bytes) {
return as_unsigned(bytes[0] << 24 | bytes[1] << 16 | bytes[2] << 8 | bytes[3], 32);
}
function packIEEE754(v, ebits, fbits) {
var bias = (1 << ebits - 1) - 1;
var s, e, f, i, bits, str, bytes;
function roundToEven(n3) {
var w = floor(n3);
var fl = n3 - w;
if (fl < .5) {
return w;
}
if (fl > .5) {
return w + 1;
}
return w % 2 ? w + 1 : w;
}
if (v !== v) {
e = (1 << ebits) - 1;
f = pow2(2, fbits - 1);
s = 0;
} else if (v === Infinity || v === -Infinity) {
e = (1 << ebits) - 1;
f = 0;
s = v < 0 ? 1 : 0;
} else if (v === 0) {
e = 0;
f = 0;
s = 1 / v === -Infinity ? 1 : 0;
} else {
s = v < 0;
v = abs2(v);
if (v >= pow2(2, 1 - bias)) {
e = min(floor(log2(v) / LN2), 1023);
f = roundToEven(v / pow2(2, e) * pow2(2, fbits));
if (f / pow2(2, fbits) >= 2) {
e = e + 1;
f = 1;
}
if (e > bias) {
e = (1 << ebits) - 1;
f = 0;
} else {
e = e + bias;
f = f - pow2(2, fbits);
}
} else {
e = 0;
f = roundToEven(v / pow2(2, 1 - bias - fbits));
}
}
bits = [];
for (i = fbits; i; i -= 1) {
bits.push(f % 2 ? 1 : 0);
f = floor(f / 2);
}
for (i = ebits; i; i -= 1) {
bits.push(e % 2 ? 1 : 0);
e = floor(e / 2);
}
bits.push(s ? 1 : 0);
bits.reverse();
str = bits.join('');
bytes = [];
while (str.length) {
bytes.push(parseInt(str.substring(0, 8), 2));
str = str.substring(8);
}
return bytes;
}
function unpackIEEE754(bytes, ebits, fbits) {
var bits = [], i, j, b3, str, bias, s, e, f;
for (i = bytes.length; i; i -= 1) {
b3 = bytes[i - 1];
for (j = 8; j; j -= 1) {
bits.push(b3 % 2 ? 1 : 0);
b3 = b3 >> 1;
}
}
bits.reverse();
str = bits.join('');
bias = (1 << ebits - 1) - 1;
s = parseInt(str.substring(0, 1), 2) ? -1 : 1;
e = parseInt(str.substring(1, 1 + ebits), 2);
f = parseInt(str.substring(1 + ebits), 2);
if (e === (1 << ebits) - 1) {
return f === 0 ? s * Infinity : NaN;
} else if (e > 0) {
return s * pow2(2, e - bias) * (1 + f / pow2(2, fbits));
} else if (f !== 0) {
return s * pow2(2, -(bias - 1)) * (f / pow2(2, fbits));
}
return s < 0 ? -0 : 0;
}
function unpackF64(b3) {
return unpackIEEE754(b3, 11, 52);
}
function packF64(v) {
return packIEEE754(v, 11, 52);
}
function unpackF32(b3) {
return unpackIEEE754(b3, 8, 23);
}
function packF32(v) {
return packIEEE754(v, 8, 23);
}
(function() {
function ArrayBuffer(length) {
length = ECMAScript.ToInt32(length);
if (length < 0) {
throw new RangeError('ArrayBuffer size is not a small enough positive integer');
}
this.byteLength = length;
this._bytes = [];
this._bytes.length = length;
var i;
for (i = 0; i < this.byteLength; i += 1) {
this._bytes[i] = 0;
}
configureProperties(this);
}
exports.ArrayBuffer = exports.ArrayBuffer || ArrayBuffer;
function ArrayBufferView() {}
function makeConstructor(bytesPerElement, pack, unpack) {
var _ctor;
_ctor = function ctor(buffer, byteOffset, length) {
var array, sequence, i, s;
if (!arguments.length || typeof arguments[0] === 'number') {
this.length = ECMAScript.ToInt32(arguments[0]);
if (length < 0) {
throw new RangeError('ArrayBufferView size is not a small enough positive integer');
}
this.byteLength = this.length * this.BYTES_PER_ELEMENT;
this.buffer = new ArrayBuffer(this.byteLength);
this.byteOffset = 0;
} else if (_typeof(arguments[0]) === 'object' && arguments[0].constructor === _ctor) {
array = arguments[0];
this.length = array.length;
this.byteLength = this.length * this.BYTES_PER_ELEMENT;
this.buffer = new ArrayBuffer(this.byteLength);
this.byteOffset = 0;
for (i = 0; i < this.length; i += 1) {
this._setter(i, array._getter(i));
}
} else if (_typeof(arguments[0]) === 'object' && !(arguments[0] instanceof ArrayBuffer || ECMAScript.Class(arguments[0]) === 'ArrayBuffer')) {
sequence = arguments[0];
this.length = ECMAScript.ToUint32(sequence.length);
this.byteLength = this.length * this.BYTES_PER_ELEMENT;
this.buffer = new ArrayBuffer(this.byteLength);
this.byteOffset = 0;
for (i = 0; i < this.length; i += 1) {
s = sequence[i];
this._setter(i, Number(s));
}
} else if (_typeof(arguments[0]) === 'object' && (arguments[0] instanceof ArrayBuffer || ECMAScript.Class(arguments[0]) === 'ArrayBuffer')) {
this.buffer = buffer;
this.byteOffset = ECMAScript.ToUint32(byteOffset);
if (this.byteOffset > this.buffer.byteLength) {
throw new RangeError('byteOffset out of range');
}
if (this.byteOffset % this.BYTES_PER_ELEMENT) {
throw new RangeError('ArrayBuffer length minus the byteOffset is not a multiple of the element size.');
}
if (arguments.length < 3) {
this.byteLength = this.buffer.byteLength - this.byteOffset;
if (this.byteLength % this.BYTES_PER_ELEMENT) {
throw new RangeError('length of buffer minus byteOffset not a multiple of the element size');
}
this.length = this.byteLength / this.BYTES_PER_ELEMENT;
} else {
this.length = ECMAScript.ToUint32(length);
this.byteLength = this.length * this.BYTES_PER_ELEMENT;
}
if (this.byteOffset + this.byteLength > this.buffer.byteLength) {
throw new RangeError('byteOffset and length reference an area beyond the end of the buffer');
}
} else {
throw new TypeError('Unexpected argument type(s)');
}
this.constructor = _ctor;
configureProperties(this);
makeArrayAccessors(this);
};
_ctor.prototype = new ArrayBufferView();
_ctor.prototype.BYTES_PER_ELEMENT = bytesPerElement;
_ctor.prototype._pack = pack;
_ctor.prototype._unpack = unpack;
_ctor.BYTES_PER_ELEMENT = bytesPerElement;
_ctor.prototype._getter = function(index) {
if (arguments.length < 1) {
throw new SyntaxError('Not enough arguments');
}
index = ECMAScript.ToUint32(index);
if (index >= this.length) {
return void 0;
}
var bytes = [];
for (var i = 0, o = this.byteOffset + index * this.BYTES_PER_ELEMENT; i < this.BYTES_PER_ELEMENT; i += 1,
o += 1) {
bytes.push(this.buffer._bytes[o]);
}
return this._unpack(bytes);
};
_ctor.prototype.get = _ctor.prototype._getter;
_ctor.prototype._setter = function(index, value) {
if (arguments.length < 2) {
throw new SyntaxError('Not enough arguments');
}
index = ECMAScript.ToUint32(index);
if (index < this.length) {
var bytes = this._pack(value);
var i;
var o;
for (i = 0, o = this.byteOffset + index * this.BYTES_PER_ELEMENT; i < this.BYTES_PER_ELEMENT; i += 1,
o += 1) {
this.buffer._bytes[o] = bytes[i];
}
}
};
_ctor.prototype.set = function(index, value) {
if (arguments.length < 1) {
throw new SyntaxError('Not enough arguments');
}
var array, sequence, offset, len, i, s, d2, byteOffset, byteLength, tmp;
if (_typeof(arguments[0]) === 'object' && arguments[0].constructor === this.constructor) {
array = arguments[0];
offset = ECMAScript.ToUint32(arguments[1]);
if (offset + array.length > this.length) {
throw new RangeError('Offset plus length of array is out of range');
}
byteOffset = this.byteOffset + offset * this.BYTES_PER_ELEMENT;
byteLength = array.length * this.BYTES_PER_ELEMENT;
if (array.buffer === this.buffer) {
tmp = [];
for (i = 0, s = array.byteOffset; i < byteLength; i += 1, s += 1) {
tmp[i] = array.buffer._bytes[s];
}
for (i = 0, d2 = byteOffset; i < byteLength; i += 1, d2 += 1) {
this.buffer._bytes[d2] = tmp[i];
}
} else {
for (i = 0, s = array.byteOffset, d2 = byteOffset; i < byteLength; i += 1,
s += 1, d2 += 1) {
this.buffer._bytes[d2] = array.buffer._bytes[s];
}
}
} else if (_typeof(arguments[0]) === 'object' && typeof arguments[0].length !== 'undefined') {
sequence = arguments[0];
len = ECMAScript.ToUint32(sequence.length);
offset = ECMAScript.ToUint32(arguments[1]);
if (offset + len > this.length) {
throw new RangeError('Offset plus length of array is out of range');
}
for (i = 0; i < len; i += 1) {
s = sequence[i];
this._setter(offset + i, Number(s));
}
} else {
throw new TypeError('Unexpected argument type(s)');
}
};
_ctor.prototype.subarray = function(start, end) {
start = ECMAScript.ToInt32(start);
end = ECMAScript.ToInt32(end);
if (arguments.length < 1) {
start = 0;
}
if (arguments.length < 2) {
end = this.length;
}
if (start < 0) {
start = this.length + start;
}
if (end < 0) {
end = this.length + end;
}
start = clamp4(start, 0, this.length);
end = clamp4(end, 0, this.length);
var len = end - start;
if (len < 0) {
len = 0;
}
return new this.constructor(this.buffer, this.byteOffset + start * this.BYTES_PER_ELEMENT, len);
};
return _ctor;
}
var Int8Array = makeConstructor(1, packI8, unpackI8);
var Uint8Array2 = makeConstructor(1, packU8, unpackU8);
var Uint8ClampedArray2 = makeConstructor(1, packU8Clamped, unpackU8);
var Int16Array = makeConstructor(2, packI16, unpackI16);
var Uint16Array = makeConstructor(2, packU16, unpackU16);
var Int32Array2 = makeConstructor(4, packI32, unpackI32);
var Uint32Array3 = makeConstructor(4, packU32, unpackU32);
var Float32Array = makeConstructor(4, packF32, unpackF32);
var Float64Array = makeConstructor(8, packF64, unpackF64);
exports.Int8Array = exports.Int8Array || Int8Array;
exports.Uint8Array = exports.Uint8Array || Uint8Array2;
exports.Uint8ClampedArray = exports.Uint8ClampedArray || Uint8ClampedArray2;
exports.Int16Array = exports.Int16Array || Int16Array;
exports.Uint16Array = exports.Uint16Array || Uint16Array;
exports.Int32Array = exports.Int32Array || Int32Array2;
exports.Uint32Array = exports.Uint32Array || Uint32Array3;
exports.Float32Array = exports.Float32Array || Float32Array;
exports.Float64Array = exports.Float64Array || Float64Array;
})();
(function() {
function r(array, index) {
return ECMAScript.IsCallable(array.get) ? array.get(index) : array[index];
}
var IS_BIG_ENDIAN = function() {
var u16array = new exports.Uint16Array([ 4660 ]), u8array = new exports.Uint8Array(u16array.buffer);
return r(u8array, 0) === 18;
}();
function DataView(buffer, byteOffset, byteLength) {
if (arguments.length === 0) {
buffer = new exports.ArrayBuffer(0);
} else if (!(buffer instanceof exports.ArrayBuffer || ECMAScript.Class(buffer) === 'ArrayBuffer')) {
throw new TypeError('TypeError');
}
this.buffer = buffer || new exports.ArrayBuffer(0);
this.byteOffset = ECMAScript.ToUint32(byteOffset);
if (this.byteOffset > this.buffer.byteLength) {
throw new RangeError('byteOffset out of range');
}
if (arguments.length < 3) {
this.byteLength = this.buffer.byteLength - this.byteOffset;
} else {
this.byteLength = ECMAScript.ToUint32(byteLength);
}
if (this.byteOffset + this.byteLength > this.buffer.byteLength) {
throw new RangeError('byteOffset and length reference an area beyond the end of the buffer');
}
configureProperties(this);
}
function makeGetter(arrayType) {
return function(byteOffset, littleEndian) {
byteOffset = ECMAScript.ToUint32(byteOffset);
if (byteOffset + arrayType.BYTES_PER_ELEMENT > this.byteLength) {
throw new RangeError('Array index out of range');
}
byteOffset += this.byteOffset;
var uint8Array = new exports.Uint8Array(this.buffer, byteOffset, arrayType.BYTES_PER_ELEMENT), bytes = [], i;
for (i = 0; i < arrayType.BYTES_PER_ELEMENT; i += 1) {
bytes.push(r(uint8Array, i));
}
if (Boolean(littleEndian) === Boolean(IS_BIG_ENDIAN)) {
bytes.reverse();
}
return r(new arrayType(new exports.Uint8Array(bytes).buffer), 0);
};
}
DataView.prototype.getUint8 = makeGetter(exports.Uint8Array);
DataView.prototype.getInt8 = makeGetter(exports.Int8Array);
DataView.prototype.getUint16 = makeGetter(exports.Uint16Array);
DataView.prototype.getInt16 = makeGetter(exports.Int16Array);
DataView.prototype.getUint32 = makeGetter(exports.Uint32Array);
DataView.prototype.getInt32 = makeGetter(exports.Int32Array);
DataView.prototype.getFloat32 = makeGetter(exports.Float32Array);
DataView.prototype.getFloat64 = makeGetter(exports.Float64Array);
function makeSetter(arrayType) {
return function(byteOffset, value, littleEndian) {
byteOffset = ECMAScript.ToUint32(byteOffset);
if (byteOffset + arrayType.BYTES_PER_ELEMENT > this.byteLength) {
throw new RangeError('Array index out of range');
}
var typeArray = new arrayType([ value ]), byteArray = new exports.Uint8Array(typeArray.buffer), bytes = [], i, byteView;
for (i = 0; i < arrayType.BYTES_PER_ELEMENT; i += 1) {
bytes.push(r(byteArray, i));
}
if (Boolean(littleEndian) === Boolean(IS_BIG_ENDIAN)) {
bytes.reverse();
}
byteView = new exports.Uint8Array(this.buffer, byteOffset, arrayType.BYTES_PER_ELEMENT);
byteView.set(bytes);
};
}
DataView.prototype.setUint8 = makeSetter(exports.Uint8Array);
DataView.prototype.setInt8 = makeSetter(exports.Int8Array);
DataView.prototype.setUint16 = makeSetter(exports.Uint16Array);
DataView.prototype.setInt16 = makeSetter(exports.Int16Array);
DataView.prototype.setUint32 = makeSetter(exports.Uint32Array);
DataView.prototype.setInt32 = makeSetter(exports.Int32Array);
DataView.prototype.setFloat32 = makeSetter(exports.Float32Array);
DataView.prototype.setFloat64 = makeSetter(exports.Float64Array);
exports.DataView = exports.DataView || DataView;
})();
});
var require_weakmap_polyfill = __commonJS(function(exports) {
(function(self2) {
'use strict';
if (self2.WeakMap) {
return;
}
var hasOwnProperty2 = Object.prototype.hasOwnProperty;
var hasDefine = Object.defineProperty && function() {
try {
return Object.defineProperty({}, 'x', {
value: 1
}).x === 1;
} catch (e) {}
}();
var defineProperty = function defineProperty(object, name, value) {
if (hasDefine) {
Object.defineProperty(object, name, {
configurable: true,
writable: true,
value: value
});
} else {
object[name] = value;
}
};
self2.WeakMap = function() {
function WeakMap2() {
if (this === void 0) {
throw new TypeError('Constructor WeakMap requires \'new\'');
}
defineProperty(this, '_id', genId('_WeakMap'));
if (arguments.length > 0) {
throw new TypeError('WeakMap iterable is not supported');
}
}
defineProperty(WeakMap2.prototype, 'delete', function(key) {
checkInstance(this, 'delete');
if (!isObject(key)) {
return false;
}
var entry = key[this._id];
if (entry && entry[0] === key) {
delete key[this._id];
return true;
}
return false;
});
defineProperty(WeakMap2.prototype, 'get', function(key) {
checkInstance(this, 'get');
if (!isObject(key)) {
return void 0;
}
var entry = key[this._id];
if (entry && entry[0] === key) {
return entry[1];
}
return void 0;
});
defineProperty(WeakMap2.prototype, 'has', function(key) {
checkInstance(this, 'has');
if (!isObject(key)) {
return false;
}
var entry = key[this._id];
if (entry && entry[0] === key) {
return true;
}
return false;
});
defineProperty(WeakMap2.prototype, 'set', function(key, value) {
checkInstance(this, 'set');
if (!isObject(key)) {
throw new TypeError('Invalid value used as weak map key');
}
var entry = key[this._id];
if (entry && entry[0] === key) {
entry[1] = value;
return this;
}
defineProperty(key, this._id, [ key, value ]);
return this;
});
function checkInstance(x, methodName) {
if (!isObject(x) || !hasOwnProperty2.call(x, '_id')) {
throw new TypeError(methodName + ' method called on incompatible receiver ' + _typeof(x));
}
}
function genId(prefix) {
return prefix + '_' + rand() + '.' + rand();
}
function rand() {
return Math.random().toString().substring(2);
}
defineProperty(WeakMap2, '_polyfill', true);
return WeakMap2;
}();
function isObject(x) {
return Object(x) === x;
}
})(typeof globalThis !== 'undefined' ? globalThis : typeof self !== 'undefined' ? self : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : exports);
});
var require_global_this = __commonJS(function(exports, module) {
'use strict';
var check = function check(it) {
return it && it.Math === Math && it;
};
module.exports = check((typeof globalThis === 'undefined' ? 'undefined' : _typeof(globalThis)) == 'object' && globalThis) || check((typeof window === 'undefined' ? 'undefined' : _typeof(window)) == 'object' && window) || check((typeof self === 'undefined' ? 'undefined' : _typeof(self)) == 'object' && self) || check((typeof global === 'undefined' ? 'undefined' : _typeof(global)) == 'object' && global) || check(_typeof(exports) == 'object' && exports) || function() {
return this;
}() || Function('return this')();
});
var require_fails = __commonJS(function(exports, module) {
'use strict';
module.exports = function(exec) {
try {
return !!exec();
} catch (error) {
return true;
}
};
});
var require_function_bind_native = __commonJS(function(exports, module) {
'use strict';
var fails = require_fails();
module.exports = !fails(function() {
var test = function() {}.bind();
return typeof test != 'function' || test.hasOwnProperty('prototype');
});
});
var require_function_apply = __commonJS(function(exports, module) {
'use strict';
var NATIVE_BIND = require_function_bind_native();
var FunctionPrototype = Function.prototype;
var apply = FunctionPrototype.apply;
var call = FunctionPrototype.call;
module.exports = (typeof Reflect === 'undefined' ? 'undefined' : _typeof(Reflect)) == 'object' && Reflect.apply || (NATIVE_BIND ? call.bind(apply) : function() {
return call.apply(apply, arguments);
});
});
var require_function_uncurry_this = __commonJS(function(exports, module) {
'use strict';
var NATIVE_BIND = require_function_bind_native();
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);
};
};
});
var require_classof_raw = __commonJS(function(exports, module) {
'use strict';
var uncurryThis = require_function_uncurry_this();
var toString = uncurryThis({}.toString);
var stringSlice = uncurryThis(''.slice);
module.exports = function(it) {
return stringSlice(toString(it), 8, -1);
};
});
var require_function_uncurry_this_clause = __commonJS(function(exports, module) {
'use strict';
var classofRaw = require_classof_raw();
var uncurryThis = require_function_uncurry_this();
module.exports = function(fn) {
if (classofRaw(fn) === 'Function') {
return uncurryThis(fn);
}
};
});
var require_is_callable = __commonJS(function(exports, module) {
'use strict';
var documentAll = (typeof document === 'undefined' ? 'undefined' : _typeof(document)) == 'object' && document.all;
module.exports = typeof documentAll == 'undefined' && documentAll !== void 0 ? function(argument) {
return typeof argument == 'function' || argument === documentAll;
} : function(argument) {
return typeof argument == 'function';
};
});
var require_descriptors = __commonJS(function(exports, module) {
'use strict';
var fails = require_fails();
module.exports = !fails(function() {
return Object.defineProperty({}, 1, {
get: function get() {
return 7;
}
})[1] !== 7;
});
});
var require_function_call = __commonJS(function(exports, module) {
'use strict';
var NATIVE_BIND = require_function_bind_native();
var call = Function.prototype.call;
module.exports = NATIVE_BIND ? call.bind(call) : function() {
return call.apply(call, arguments);
};
});
var require_object_property_is_enumerable = __commonJS(function(exports) {
'use strict';
var $propertyIsEnumerable = {}.propertyIsEnumerable;
var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
var NASHORN_BUG = getOwnPropertyDescriptor && !$propertyIsEnumerable.call({
1: 2
}, 1);
exports.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
var descriptor = getOwnPropertyDescriptor(this, V);
return !!descriptor && descriptor.enumerable;
} : $propertyIsEnumerable;
});
var require_create_property_descriptor = __commonJS(function(exports, module) {
'use strict';
module.exports = function(bitmap, value) {
return {
enumerable: !(bitmap & 1),
configurable: !(bitmap & 2),
writable: !(bitmap & 4),
value: value
};
};
});
var require_indexed_object = __commonJS(function(exports, module) {
'use strict';
var uncurryThis = require_function_uncurry_this();
var fails = require_fails();
var classof = require_classof_raw();
var $Object = Object;
var split = uncurryThis(''.split);
module.exports = fails(function() {
return !$Object('z').propertyIsEnumerable(0);
}) ? function(it) {
return classof(it) === 'String' ? split(it, '') : $Object(it);
} : $Object;
});
var require_is_null_or_undefined = __commonJS(function(exports, module) {
'use strict';
module.exports = function(it) {
return it === null || it === void 0;
};
});
var require_require_object_coercible = __commonJS(function(exports, module) {
'use strict';
var isNullOrUndefined = require_is_null_or_undefined();
var $TypeError = TypeError;
module.exports = function(it) {
if (isNullOrUndefined(it)) {
throw new $TypeError('Can\'t call method on ' + it);
}
return it;
};
});
var require_to_indexed_object = __commonJS(function(exports, module) {
'use strict';
var IndexedObject = require_indexed_object();
var requireObjectCoercible = require_require_object_coercible();
module.exports = function(it) {
return IndexedObject(requireObjectCoercible(it));
};
});
var require_is_object = __commonJS(function(exports, module) {
'use strict';
var isCallable = require_is_callable();
module.exports = function(it) {
return _typeof(it) == 'object' ? it !== null : isCallable(it);
};
});
var require_path = __commonJS(function(exports, module) {
'use strict';
module.exports = {};
});
var require_get_built_in = __commonJS(function(exports, module) {
'use strict';
var path = require_path();
var globalThis2 = require_global_this();
var isCallable = require_is_callable();
var aFunction = function aFunction(variable) {
return isCallable(variable) ? variable : void 0;
};
module.exports = function(namespace, method) {
return arguments.length < 2 ? aFunction(path[namespace]) || aFunction(globalThis2[namespace]) : path[namespace] && path[namespace][method] || globalThis2[namespace] && globalThis2[namespace][method];
};
});
var require_object_is_prototype_of = __commonJS(function(exports, module) {
'use strict';
var uncurryThis = require_function_uncurry_this();
module.exports = uncurryThis({}.isPrototypeOf);
});
var require_environment_user_agent = __commonJS(function(exports, module) {
'use strict';
var globalThis2 = require_global_this();
var navigator = globalThis2.navigator;
var userAgent = navigator && navigator.userAgent;
module.exports = userAgent ? String(userAgent) : '';
});
var require_environment_v8_version = __commonJS(function(exports, module) {
'use strict';
var globalThis2 = require_global_this();
var userAgent = require_environment_user_agent();
var process2 = globalThis2.process;
var Deno = globalThis2.Deno;
var versions = process2 && process2.versions || Deno && Deno.version;
var v8 = versions && versions.v8;
var match;
var version;
if (v8) {
match = v8.split('.');
version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
}
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;
});
var require_symbol_constructor_detection = __commonJS(function(exports, module) {
'use strict';
var V8_VERSION = require_environment_v8_version();
var fails = require_fails();
var globalThis2 = require_global_this();
var $String = globalThis2.String;
module.exports = !!Object.getOwnPropertySymbols && !fails(function() {
var symbol = Symbol('symbol detection');
return !$String(symbol) || !(Object(symbol) instanceof Symbol) || !Symbol.sham && V8_VERSION && V8_VERSION < 41;
});
});
var require_use_symbol_as_uid = __commonJS(function(exports, module) {
'use strict';
var NATIVE_SYMBOL = require_symbol_constructor_detection();
module.exports = NATIVE_SYMBOL && !Symbol.sham && _typeof(Symbol.iterator) == 'symbol';
});
var require_is_symbol = __commonJS(function(exports, module) {
'use strict';
var getBuiltIn = require_get_built_in();
var isCallable = require_is_callable();
var isPrototypeOf = require_object_is_prototype_of();
var USE_SYMBOL_AS_UID = require_use_symbol_as_uid();
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));
};
});
var require_try_to_string = __commonJS(function(exports, module) {
'use strict';
var $String = String;
module.exports = function(argument) {
try {
return $String(argument);
} catch (error) {
return 'Object';
}
};
});
var require_a_callable = __commonJS(function(exports, module) {
'use strict';
var isCallable = require_is_callable();
var tryToString = require_try_to_string();
var $TypeError = TypeError;
module.exports = function(argument) {
if (isCallable(argument)) {
return argument;
}
throw new $TypeError(tryToString(argument) + ' is not a function');
};
});
var require_get_method = __commonJS(function(exports, module) {
'use strict';
var aCallable = require_a_callable();
var isNullOrUndefined = require_is_null_or_undefined();
module.exports = function(V, P) {
var func = V[P];
return isNullOrUndefined(func) ? void 0 : aCallable(func);
};
});
var require_ordinary_to_primitive = __commonJS(function(exports, module) {
'use strict';
var call = require_function_call();
var isCallable = require_is_callable();
var isObject = require_is_object();
var $TypeError = TypeError;
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 new $TypeError('Can\'t convert object to primitive value');
};
});
var require_is_pure = __commonJS(function(exports, module) {
'use strict';
module.exports = true;
});
var require_define_global_property = __commonJS(function(exports, module) {
'use strict';
var globalThis2 = require_global_this();
var defineProperty = Object.defineProperty;
module.exports = function(key, value) {
try {
defineProperty(globalThis2, key, {
value: value,
configurable: true,
writable: true
});
} catch (error) {
globalThis2[key] = value;
}
return value;
};
});
var require_shared_store = __commonJS(function(exports, module) {
'use strict';
var IS_PURE = require_is_pure();
var globalThis2 = require_global_this();
var defineGlobalProperty = require_define_global_property();
var SHARED = '__core-js_shared__';
var store = module.exports = globalThis2[SHARED] || defineGlobalProperty(SHARED, {});
(store.versions || (store.versions = [])).push({
version: '3.50.0',
mode: IS_PURE ? 'pure' : 'global',
copyright: '\xa9 2013\u20132025 Denis Pushkarev (zloirock.ru), 2025\u20132026 CoreJS Company (core-js.io). All rights reserved.',
license: 'https://github.com/zloirock/core-js/blob/v3.50.0/LICENSE',
source: 'https://github.com/zloirock/core-js'
});
});
var require_shared = __commonJS(function(exports, module) {
'use strict';
var store = require_shared_store();
var create = Object.create || Object;
module.exports = function(key, value) {
return store[key] || (store[key] = value || create(null));
};
});
var require_to_object = __commonJS(function(exports, module) {
'use strict';
var requireObjectCoercible = require_require_object_coercible();
var $Object = Object;
module.exports = function(argument) {
return $Object(requireObjectCoercible(argument));
};
});
var require_has_own_property = __commonJS(function(exports, module) {
'use strict';
var uncurryThis = require_function_uncurry_this();
var toObject = require_to_object();
var hasOwnProperty2 = uncurryThis({}.hasOwnProperty);
module.exports = Object.hasOwn || function hasOwn2(it, key) {
return hasOwnProperty2(toObject(it), key);
};
});
var require_uid = __commonJS(function(exports, module) {
'use strict';
var uncurryThis = require_function_uncurry_this();
var id = 0;
var postfix = Math.random();
var toString = uncurryThis(1.1.toString);
module.exports = function(key) {
return 'Symbol(' + (key === void 0 ? '' : key) + ')_' + toString(++id + postfix, 36);
};
});
var require_well_known_symbol = __commonJS(function(exports, module) {
'use strict';
var globalThis2 = require_global_this();
var shared = require_shared();
var hasOwn2 = require_has_own_property();
var uid2 = require_uid();
var NATIVE_SYMBOL = require_symbol_constructor_detection();
var USE_SYMBOL_AS_UID = require_use_symbol_as_uid();
var Symbol2 = globalThis2.Symbol;
var WellKnownSymbolsStore = shared('wks');
var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol2['for'] || Symbol2 : Symbol2 && Symbol2.withoutSetter || uid2;
module.exports = function(name) {
if (!hasOwn2(WellKnownSymbolsStore, name)) {
WellKnownSymbolsStore[name] = NATIVE_SYMBOL && hasOwn2(Symbol2, name) ? Symbol2[name] : createWellKnownSymbol('Symbol.' + name);
}
return WellKnownSymbolsStore[name];
};
});
var require_to_primitive = __commonJS(function(exports, module) {
'use strict';
var call = require_function_call();
var isObject = require_is_object();
var isSymbol = require_is_symbol();
var getMethod = require_get_method();
var ordinaryToPrimitive = require_ordinary_to_primitive();
var wellKnownSymbol = require_well_known_symbol();
var $TypeError = TypeError;
var TO_PRIMITIVE = wellKnownSymbol('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 === void 0) {
pref = 'default';
}
result = call(exoticToPrim, input, pref);
if (!isObject(result) || isSymbol(result)) {
return result;
}
throw new $TypeError('Can\'t convert object to primitive value');
}
if (pref === void 0) {
pref = 'number';
}
return ordinaryToPrimitive(input, pref);
};
});
var require_to_property_key = __commonJS(function(exports, module) {
'use strict';
var toPrimitive = require_to_primitive();
var isSymbol = require_is_symbol();
module.exports = function(argument) {
var key = toPrimitive(argument, 'string');
return isSymbol(key) ? key : key + '';
};
});
var require_document_create_element = __commonJS(function(exports, module) {
'use strict';
var globalThis2 = require_global_this();
var isObject = require_is_object();
var document2 = globalThis2.document;
var EXISTS = isObject(document2) && isObject(document2.createElement);
module.exports = function(it) {
return EXISTS ? document2.createElement(it) : {};
};
});
var require_ie8_dom_define = __commonJS(function(exports, module) {
'use strict';
var DESCRIPTORS = require_descriptors();
var fails = require_fails();
var createElement = require_document_create_element();
module.exports = !DESCRIPTORS && !fails(function() {
return Object.defineProperty(createElement('div'), 'a', {
get: function get() {
return 7;
}
}).a !== 7;
});
});
var require_object_get_own_property_descriptor = __commonJS(function(exports) {
'use strict';
var DESCRIPTORS = require_descriptors();
var call = require_function_call();
var propertyIsEnumerableModule = require_object_property_is_enumerable();
var createPropertyDescriptor = require_create_property_descriptor();
var toIndexedObject = require_to_indexed_object();
var toPropertyKey = require_to_property_key();
var hasOwn2 = require_has_own_property();
var IE8_DOM_DEFINE = require_ie8_dom_define();
var $getOwnPropertyDescriptor = 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) {}
}
if (hasOwn2(O, P)) {
return createPropertyDescriptor(!call(propertyIsEnumerableModule.f, O, P), O[P]);
}
};
});
var require_is_forced = __commonJS(function(exports, module) {
'use strict';
var fails = require_fails();
var isCallable = require_is_callable();
var replacement = /#|\.prototype\./;
var isForced = function isForced(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;
});
var require_function_bind_context = __commonJS(function(exports, module) {
'use strict';
var uncurryThis = require_function_uncurry_this_clause();
var aCallable = require_a_callable();
var NATIVE_BIND = require_function_bind_native();
var bind = uncurryThis(uncurryThis.bind);
module.exports = function(fn, that) {
aCallable(fn);
return that === void 0 ? fn : NATIVE_BIND ? bind(fn, that) : function() {
return fn.apply(that, arguments);
};
};
});
var require_v8_prototype_define_bug = __commonJS(function(exports, module) {
'use strict';
var DESCRIPTORS = require_descriptors();
var fails = require_fails();
module.exports = DESCRIPTORS && fails(function() {
return Object.defineProperty(function() {}, 'prototype', {
value: 42,
writable: false
}).prototype !== 42;
});
});
var require_an_object = __commonJS(function(exports, module) {
'use strict';
var isObject = require_is_object();
var $String = String;
var $TypeError = TypeError;
module.exports = function(argument) {
if (isObject(argument)) {
return argument;
}
throw new $TypeError($String(argument) + ' is not an object');
};
});
var require_object_define_property = __commonJS(function(exports) {
'use strict';
var DESCRIPTORS = require_descriptors();
var IE8_DOM_DEFINE = require_ie8_dom_define();
var V8_PROTOTYPE_DEFINE_BUG = require_v8_prototype_define_bug();
var anObject = require_an_object();
var toPropertyKey = require_to_property_key();
var $TypeError = TypeError;
var $defineProperty = Object.defineProperty;
var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
var ENUMERABLE = 'enumerable';
var CONFIGURABLE = 'configurable';
var WRITABLE = 'writable';
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) {}
}
if ('get' in Attributes || 'set' in Attributes) {
throw new $TypeError('Accessors not supported');
}
if ('value' in Attributes) {
O[P] = Attributes.value;
}
return O;
};
});
var require_create_non_enumerable_property = __commonJS(function(exports, module) {
'use strict';
var DESCRIPTORS = require_descriptors();
var definePropertyModule = require_object_define_property();
var createPropertyDescriptor = require_create_property_descriptor();
module.exports = DESCRIPTORS ? function(object, key, value) {
return definePropertyModule.f(object, key, createPropertyDescriptor(1, value));
} : function(object, key, value) {
object[key] = value;
return object;
};
});
var require_export = __commonJS(function(exports, module) {
'use strict';
var globalThis2 = require_global_this();
var apply = require_function_apply();
var uncurryThis = require_function_uncurry_this_clause();
var isCallable = require_is_callable();
var getOwnPropertyDescriptor = require_object_get_own_property_descriptor().f;
var isForced = require_is_forced();
var path = require_path();
var bind = require_function_bind_context();
var createNonEnumerableProperty = require_create_non_enumerable_property();
var hasOwn2 = require_has_own_property();
require_shared_store();
var wrapConstructor = function wrapConstructor(NativeConstructor) {
var _Wrapper = function Wrapper(a2, b3, c4) {
if (this instanceof _Wrapper) {
switch (arguments.length) {
case 0:
return new NativeConstructor();
case 1:
return new NativeConstructor(a2);
case 2:
return new NativeConstructor(a2, b3);
}
return new NativeConstructor(a2, b3, c4);
}
return apply(NativeConstructor, this, arguments);
};
_Wrapper.prototype = NativeConstructor.prototype;
return _Wrapper;
};
module.exports = function(options, source) {
var TARGET = options.target;
var GLOBAL = options.global;
var STATIC = options.stat;
var PROTO = options.proto;
var nativeSource = GLOBAL ? globalThis2 : STATIC ? globalThis2[TARGET] : globalThis2[TARGET] && globalThis2[TARGET].prototype;
var target = GLOBAL ? path : path[TARGET] || createNonEnumerableProperty(path, TARGET, {})[TARGET];
var targetPrototype = target.prototype;
var FORCED, USE_NATIVE, VIRTUAL_PROTOTYPE;
var key, sourceProperty, targetProperty, nativeProperty, resultProperty, descriptor;
for (key in source) {
FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
USE_NATIVE = !FORCED && nativeSource && hasOwn2(nativeSource, key);
targetProperty = target[key];
if (USE_NATIVE) {
if (options.dontCallGetSet) {
descriptor = getOwnPropertyDescriptor(nativeSource, key);
nativeProperty = descriptor && descriptor.value;
} else {
nativeProperty = nativeSource[key];
}
}
sourceProperty = USE_NATIVE && nativeProperty ? nativeProperty : source[key];
if (!FORCED && !PROTO && _typeof(targetProperty) == _typeof(sourceProperty)) {
continue;
}
if (options.bind && USE_NATIVE) {
resultProperty = bind(sourceProperty, globalThis2);
} else if (options.wrap && USE_NATIVE) {
resultProperty = wrapConstructor(sourceProperty);
} else if (PROTO && isCallable(sourceProperty)) {
resultProperty = uncurryThis(sourceProperty);
} else {
resultProperty = sourceProperty;
}
if (options.sham || sourceProperty && sourceProperty.sham || targetProperty && targetProperty.sham) {
createNonEnumerableProperty(resultProperty, 'sham', true);
}
createNonEnumerableProperty(target, key, resultProperty);
if (PROTO) {
VIRTUAL_PROTOTYPE = TARGET + 'Prototype';
if (!hasOwn2(path, VIRTUAL_PROTOTYPE)) {
createNonEnumerableProperty(path, VIRTUAL_PROTOTYPE, {});
}
createNonEnumerableProperty(path[VIRTUAL_PROTOTYPE], key, sourceProperty);
if (options.real && targetPrototype && (FORCED || !targetPrototype[key])) {
createNonEnumerableProperty(targetPrototype, key, sourceProperty);
}
}
}
};
});
var require_es_object_has_own = __commonJS(function() {
'use strict';
var $ = require_export();
var hasOwn2 = require_has_own_property();
$({
target: 'Object',
stat: true
}, {
hasOwn: hasOwn2
});
});
var require_has_own = __commonJS(function(exports, module) {
'use strict';
require_es_object_has_own();
var path = require_path();
module.exports = path.Object.hasOwn;
});
var require_has_own2 = __commonJS(function(exports, module) {
'use strict';
var parent = require_has_own();
module.exports = parent;
});
var require_has_own3 = __commonJS(function(exports, module) {
'use strict';
var parent = require_has_own2();
module.exports = parent;
});
var require_shared_key = __commonJS(function(exports, module) {
'use strict';
var shared = require_shared();
var uid2 = require_uid();
var keys = shared('keys');
module.exports = function(key) {
return keys[key] || (keys[key] = uid2(key));
};
});
var require_correct_prototype_getter = __commonJS(function(exports, module) {
'use strict';
var fails = require_fails();
module.exports = !fails(function() {
function F() {}
F.prototype.constructor = null;
return Object.getPrototypeOf(new F()) !== F.prototype;
});
});
var require_object_get_prototype_of = __commonJS(function(exports, module) {
'use strict';
var hasOwn2 = require_has_own_property();
var isCallable = require_is_callable();
var toObject = require_to_object();
var sharedKey = require_shared_key();
var CORRECT_PROTOTYPE_GETTER = require_correct_prototype_getter();
var IE_PROTO = sharedKey('IE_PROTO');
var $Object = Object;
var ObjectPrototype = $Object.prototype;
module.exports = CORRECT_PROTOTYPE_GETTER ? $Object.getPrototypeOf : function(O) {
var object = toObject(O);
if (hasOwn2(object, IE_PROTO)) {
return object[IE_PROTO];
}
var constructor = object.constructor;
if (isCallable(constructor) && object instanceof constructor) {
return constructor.prototype;
}
return object instanceof $Object ? ObjectPrototype : null;
};
});
var require_math_trunc = __commonJS(function(exports, module) {
'use strict';
var ceil = Math.ceil;
var floor = Math.floor;
module.exports = Math.trunc || function trunc(x) {
var n3 = +x;
return (n3 > 0 ? floor : ceil)(n3);
};
});
var require_to_integer_or_infinity = __commonJS(function(exports, module) {
'use strict';
var trunc = require_math_trunc();
module.exports = function(argument) {
var number = +argument;
return number !== number || number === 0 ? 0 : trunc(number);
};
});
var require_to_absolute_index = __commonJS(function(exports, module) {
'use strict';
var toIntegerOrInfinity = require_to_integer_or_infinity();
var max2 = Math.max;
var min = Math.min;
module.exports = function(index, length) {
var integer = toIntegerOrInfinity(index);
return integer < 0 ? max2(integer + length, 0) : min(integer, length);
};
});
var require_to_length = __commonJS(function(exports, module) {
'use strict';
var toIntegerOrInfinity = require_to_integer_or_infinity();
var min = Math.min;
module.exports = function(argument) {
var len = toIntegerOrInfinity(argument);
return len > 0 ? min(len, 9007199254740991) : 0;
};
});
var require_length_of_array_like = __commonJS(function(exports, module) {
'use strict';
var toLength = require_to_length();
module.exports = function(obj) {
return toLength(obj.length);
};
});
var require_array_includes = __commonJS(function(exports, module) {
'use strict';
var toIndexedObject = require_to_indexed_object();
var toAbsoluteIndex = require_to_absolute_index();
var lengthOfArrayLike = require_length_of_array_like();
var createMethod = function createMethod(IS_INCLUDES) {
return function($this, el, fromIndex) {
var O = toIndexedObject($this);
var length = lengthOfArrayLike(O);
if (length === 0) {
return !IS_INCLUDES && -1;
}
var index = toAbsoluteIndex(fromIndex, length);
var value;
if (IS_INCLUDES && el !== el) {
while (length > index) {
value = O[index++];
if (value !== value) {
return true;
}
}
} 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 = {
includes: createMethod(true),
indexOf: createMethod(false)
};
});
var require_hidden_keys = __commonJS(function(exports, module) {
'use strict';
module.exports = {};
});
var require_object_keys_internal = __commonJS(function(exports, module) {
'use strict';
var uncurryThis = require_function_uncurry_this();
var hasOwn2 = require_has_own_property();
var toIndexedObject = require_to_indexed_object();
var indexOf = require_array_includes().indexOf;
var hiddenKeys = require_hidden_keys();
var push = uncurryThis([].push);
module.exports = function(object, names) {
var O = toIndexedObject(object);
var i = 0;
var result = [];
var key;
for (key in O) {
!hasOwn2(hiddenKeys, key) && hasOwn2(O, key) && push(result, key);
}
while (names.length > i) {
if (hasOwn2(O, key = names[i++])) {
~indexOf(result, key) || push(result, key);
}
}
return result;
};
});
var require_enum_bug_keys = __commonJS(function(exports, module) {
'use strict';
module.exports = [ 'constructor', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'toLocaleString', 'toString', 'valueOf' ];
});
var require_object_keys = __commonJS(function(exports, module) {
'use strict';
var internalObjectKeys = require_object_keys_internal();
var enumBugKeys = require_enum_bug_keys();
module.exports = Object.keys || function keys(O) {
return internalObjectKeys(O, enumBugKeys);
};
});
var require_object_to_array = __commonJS(function(exports, module) {
'use strict';
var DESCRIPTORS = require_descriptors();
var fails = require_fails();
var uncurryThis = require_function_uncurry_this();
var objectGetPrototypeOf = require_object_get_prototype_of();
var objectKeys = require_object_keys();
var toIndexedObject = require_to_indexed_object();
var $propertyIsEnumerable = require_object_property_is_enumerable().f;
var propertyIsEnumerable = uncurryThis($propertyIsEnumerable);
var push = uncurryThis([].push);
var IE_BUG = DESCRIPTORS && fails(function() {
var O = Object.create(null);
O[2] = 2;
return !propertyIsEnumerable(O, 2);
});
var createMethod = function createMethod(TO_ENTRIES) {
return function(it) {
var O = toIndexedObject(it);
var keys = objectKeys(O);
var IE_WORKAROUND = IE_BUG && objectGetPrototypeOf(O) === null;
var length = keys.length;
var i = 0;
var result = [];
var key;
while (length > i) {
key = keys[i++];
if (!DESCRIPTORS || (IE_WORKAROUND ? key in O : propertyIsEnumerable(O, key))) {
push(result, TO_ENTRIES ? [ key, O[key] ] : O[key]);
}
}
return result;
};
};
module.exports = {
entries: createMethod(true),
values: createMethod(false)
};
});
var require_es_object_values = __commonJS(function() {
'use strict';
var $ = require_export();
var $values = require_object_to_array().values;
$({
target: 'Object',
stat: true
}, {
values: function values2(O) {
return $values(O);
}
});
});
var require_values = __commonJS(function(exports, module) {
'use strict';
require_es_object_values();
var path = require_path();
module.exports = path.Object.values;
});
var require_values2 = __commonJS(function(exports, module) {
'use strict';
var parent = require_values();
module.exports = parent;
});
var require_values3 = __commonJS(function(exports, module) {
'use strict';
var parent = require_values2();
module.exports = parent;
});
var require_es_object_entries = __commonJS(function() {
'use strict';
var $ = require_export();
var $entries = require_object_to_array().entries;
$({
target: 'Object',
stat: true
}, {
entries: function entries2(O) {
return $entries(O);
}
});
});
var require_entries = __commonJS(function(exports, module) {
'use strict';
require_es_object_entries();
var path = require_path();
module.exports = path.Object.entries;
});
var require_entries2 = __commonJS(function(exports, module) {
'use strict';
var parent = require_entries();
module.exports = parent;
});
var require_entries3 = __commonJS(function(exports, module) {
'use strict';
var parent = require_entries2();
module.exports = parent;
});
var require_add_to_unscopables = __commonJS(function(exports, module) {
'use strict';
module.exports = function() {};
});
var require_iterators = __commonJS(function(exports, module) {
'use strict';
module.exports = Object.create ? Object.create(null) : {};
});
var require_weak_map_basic_detection = __commonJS(function(exports, module) {
'use strict';
var globalThis2 = require_global_this();
var isCallable = require_is_callable();
var WeakMap2 = globalThis2.WeakMap;
module.exports = isCallable(WeakMap2) && /native code/.test(String(WeakMap2));
});
var require_internal_state = __commonJS(function(exports, module) {
'use strict';
var NATIVE_WEAK_MAP = require_weak_map_basic_detection();
var globalThis2 = require_global_this();
var isObject = require_is_object();
var createNonEnumerableProperty = require_create_non_enumerable_property();
var hasOwn2 = require_has_own_property();
var shared = require_shared_store();
var sharedKey = require_shared_key();
var hiddenKeys = require_hidden_keys();
var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
var TypeError2 = globalThis2.TypeError;
var WeakMap2 = globalThis2.WeakMap;
var set2;
var get2;
var has;
var enforce = function enforce(it) {
return has(it) ? get2(it) : set2(it, {});
};
var getterFor = function getterFor(TYPE) {
return function(it) {
var state;
if (!isObject(it) || (state = get2(it)).type !== TYPE) {
throw new TypeError2('Incompatible receiver, ' + TYPE + ' required');
}
return state;
};
};
if (NATIVE_WEAK_MAP || shared.state) {
store = shared.state || (shared.state = new WeakMap2());
store.get = store.get;
store.has = store.has;
store.set = store.set;
set2 = function set2(it, metadata) {
if (store.has(it)) {
throw new TypeError2(OBJECT_ALREADY_INITIALIZED);
}
metadata.facade = it;
store.set(it, metadata);
return metadata;
};
get2 = function get2(it) {
return store.get(it) || {};
};
has = function has(it) {
return store.has(it);
};
} else {
STATE = sharedKey('state');
hiddenKeys[STATE] = true;
set2 = function set2(it, metadata) {
if (hasOwn2(it, STATE)) {
throw new TypeError2(OBJECT_ALREADY_INITIALIZED);
}
metadata.facade = it;
createNonEnumerableProperty(it, STATE, metadata);
return metadata;
};
get2 = function get2(it) {
return hasOwn2(it, STATE) ? it[STATE] : {};
};
has = function has(it) {
return hasOwn2(it, STATE);
};
}
var store;
var STATE;
module.exports = {
set: set2,
get: get2,
has: has,
enforce: enforce,
getterFor: getterFor
};
});
var require_function_name = __commonJS(function(exports, module) {
'use strict';
var DESCRIPTORS = require_descriptors();
var hasOwn2 = require_has_own_property();
var FunctionPrototype = Function.prototype;
var getDescriptor = DESCRIPTORS && Object.getOwnPropertyDescriptor;
var EXISTS = hasOwn2(FunctionPrototype, 'name');
var PROPER = EXISTS && function something() {}.name === 'something';
var CONFIGURABLE = EXISTS && (!DESCRIPTORS || DESCRIPTORS && getDescriptor(FunctionPrototype, 'name').configurable);
module.exports = {
EXISTS: EXISTS,
PROPER: PROPER,
CONFIGURABLE: CONFIGURABLE
};
});
var require_object_define_properties = __commonJS(function(exports) {
'use strict';
var DESCRIPTORS = require_descriptors();
var V8_PROTOTYPE_DEFINE_BUG = require_v8_prototype_define_bug();
var definePropertyModule = require_object_define_property();
var anObject = require_an_object();
var toIndexedObject = require_to_indexed_object();
var objectKeys = require_object_keys();
exports.f = DESCRIPTORS && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) {
anObject(O);
var props = toIndexedObject(Properties);
var keys = objectKeys(Properties);
var length = keys.length;
var index = 0;
var key;
while (length > index) {
definePropertyModule.f(O, key = keys[index++], props[key]);
}
return O;
};
});
var require_html = __commonJS(function(exports, module) {
'use strict';
var getBuiltIn = require_get_built_in();
module.exports = getBuiltIn('document', 'documentElement');
});
var require_object_create = __commonJS(function(exports, module) {
'use strict';
var anObject = require_an_object();
var definePropertiesModule = require_object_define_properties();
var enumBugKeys = require_enum_bug_keys();
var hiddenKeys = require_hidden_keys();
var html = require_html();
var documentCreateElement = require_document_create_element();
var sharedKey = require_shared_key();
var GT = '>';
var LT = '<';
var PROTOTYPE = 'prototype';
var SCRIPT = 'script';
var IE_PROTO = sharedKey('IE_PROTO');
var EmptyConstructor = function EmptyConstructor() {};
var scriptTag = function scriptTag(content) {
return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
};
var NullProtoObjectViaActiveX = function NullProtoObjectViaActiveX(activeXDocument2) {
activeXDocument2.write(scriptTag(''));
activeXDocument2.close();
var temp = activeXDocument2.parentWindow.Object;
activeXDocument2 = null;
return temp;
};
var NullProtoObjectViaIFrame = function NullProtoObjectViaIFrame() {
var iframe = documentCreateElement('iframe');
var JS = 'java' + SCRIPT + ':';
var iframeDocument;
iframe.style.display = 'none';
html.appendChild(iframe);
iframe.src = String(JS);
iframeDocument = iframe.contentWindow.document;
iframeDocument.open();
iframeDocument.write(scriptTag('document.F=Object'));
iframeDocument.close();
return iframeDocument.F;
};
var activeXDocument;
var _NullProtoObject = function NullProtoObject() {
try {
activeXDocument = new ActiveXObject('htmlfile');
} catch (error) {}
_NullProtoObject = typeof document != 'undefined' ? document.domain && activeXDocument ? NullProtoObjectViaActiveX(activeXDocument) : NullProtoObjectViaIFrame() : NullProtoObjectViaActiveX(activeXDocument);
var length = enumBugKeys.length;
while (length--) {
delete _NullProtoObject[PROTOTYPE][enumBugKeys[length]];
}
return _NullProtoObject();
};
hiddenKeys[IE_PROTO] = true;
module.exports = Object.create || function create(O, Properties) {
var result;
if (O !== null) {
EmptyConstructor[PROTOTYPE] = anObject(O);
result = new EmptyConstructor();
EmptyConstructor[PROTOTYPE] = null;
result[IE_PROTO] = O;
} else {
result = _NullProtoObject();
}
return Properties === void 0 ? result : definePropertiesModule.f(result, Properties);
};
});
var require_define_built_in = __commonJS(function(exports, module) {
'use strict';
var createNonEnumerableProperty = require_create_non_enumerable_property();
module.exports = function(target, key, value, options) {
if (options && options.enumerable) {
target[key] = value;
} else {
createNonEnumerableProperty(target, key, value);
}
return target;
};
});
var require_iterators_core = __commonJS(function(exports, module) {
'use strict';
var fails = require_fails();
var isCallable = require_is_callable();
var isObject = require_is_object();
var create = require_object_create();
var getPrototypeOf = require_object_get_prototype_of();
var defineBuiltIn = require_define_built_in();
var wellKnownSymbol = require_well_known_symbol();
var IS_PURE = require_is_pure();
var ITERATOR = wellKnownSymbol('iterator');
var BUGGY_SAFARI_ITERATORS = false;
var IteratorPrototype;
var PrototypeOfArrayIteratorPrototype;
var arrayIterator;
if ([].keys) {
arrayIterator = [].keys();
if (!('next' in arrayIterator)) {
BUGGY_SAFARI_ITERATORS = true;
} else {
PrototypeOfArrayIteratorPrototype = getPrototypeOf(getPrototypeOf(arrayIterator));
if (PrototypeOfArrayIteratorPrototype !== Object.prototype) {
IteratorPrototype = PrototypeOfArrayIteratorPrototype;
}
}
}
var NEW_ITERATOR_PROTOTYPE = !isObject(IteratorPrototype) || fails(function() {
var test = {};
return IteratorPrototype[ITERATOR].call(test) !== test;
});
if (NEW_ITERATOR_PROTOTYPE) {
IteratorPrototype = {};
} else if (IS_PURE) {
IteratorPrototype = create(IteratorPrototype);
}
if (!isCallable(IteratorPrototype[ITERATOR])) {
defineBuiltIn(IteratorPrototype, ITERATOR, function() {
return this;
});
}
module.exports = {
IteratorPrototype: IteratorPrototype,
BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS
};
});
var require_to_string_tag_support = __commonJS(function(exports, module) {
'use strict';
var wellKnownSymbol = require_well_known_symbol();
var TO_STRING_TAG = wellKnownSymbol('toStringTag');
var test = {};
test[TO_STRING_TAG] = 'z';
module.exports = String(test) === '[object z]';
});
var require_classof = __commonJS(function(exports, module) {
'use strict';
var TO_STRING_TAG_SUPPORT = require_to_string_tag_support();
var isCallable = require_is_callable();
var classofRaw = require_classof_raw();
var wellKnownSymbol = require_well_known_symbol();
var TO_STRING_TAG = wellKnownSymbol('toStringTag');
var $Object = Object;
var CORRECT_ARGUMENTS = classofRaw(function() {
return arguments;
}()) === 'Arguments';
var tryGet = function tryGet(it, key) {
try {
return it[key];
} catch (error) {}
};
module.exports = TO_STRING_TAG_SUPPORT ? classofRaw : function(it) {
var O, tag, result;
return it === void 0 ? 'Undefined' : it === null ? 'Null' : typeof (tag = tryGet(O = $Object(it), TO_STRING_TAG)) == 'string' ? tag : CORRECT_ARGUMENTS ? classofRaw(O) : (result = classofRaw(O)) === 'Object' && isCallable(O.callee) ? 'Arguments' : result;
};
});
var require_object_to_string = __commonJS(function(exports, module) {
'use strict';
var TO_STRING_TAG_SUPPORT = require_to_string_tag_support();
var classof = require_classof();
module.exports = TO_STRING_TAG_SUPPORT ? {}.toString : function toString() {
return '[object ' + classof(this) + ']';
};
});
var require_set_to_string_tag = __commonJS(function(exports, module) {
'use strict';
var TO_STRING_TAG_SUPPORT = require_to_string_tag_support();
var defineProperty = require_object_define_property().f;
var createNonEnumerableProperty = require_create_non_enumerable_property();
var hasOwn2 = require_has_own_property();
var toString = require_object_to_string();
var wellKnownSymbol = require_well_known_symbol();
var TO_STRING_TAG = wellKnownSymbol('toStringTag');
module.exports = function(it, TAG, STATIC, SET_METHOD) {
var target = STATIC ? it : it && it.prototype;
if (target) {
if (!hasOwn2(target, TO_STRING_TAG)) {
defineProperty(target, TO_STRING_TAG, {
configurable: true,
value: TAG
});
}
if (SET_METHOD && !TO_STRING_TAG_SUPPORT) {
createNonEnumerableProperty(target, 'toString', toString);
}
}
};
});
var require_iterator_create_constructor = __commonJS(function(exports, module) {
'use strict';
var IteratorPrototype = require_iterators_core().IteratorPrototype;
var create = require_object_create();
var createPropertyDescriptor = require_create_property_descriptor();
var setToStringTag = require_set_to_string_tag();
var Iterators = require_iterators();
var returnThis = function returnThis() {
return this;
};
module.exports = function(IteratorConstructor, NAME, next, ENUMERABLE_NEXT) {
var TO_STRING_TAG = NAME + ' Iterator';
IteratorConstructor.prototype = create(IteratorPrototype, {
next: createPropertyDescriptor(+!ENUMERABLE_NEXT, next)
});
setToStringTag(IteratorConstructor, TO_STRING_TAG, false, true);
Iterators[TO_STRING_TAG] = returnThis;
return IteratorConstructor;
};
});
var require_function_uncurry_this_accessor = __commonJS(function(exports, module) {
'use strict';
var uncurryThis = require_function_uncurry_this();
var aCallable = require_a_callable();
module.exports = function(object, key, method) {
try {
return uncurryThis(aCallable(Object.getOwnPropertyDescriptor(object, key)[method]));
} catch (error) {}
};
});
var require_is_possible_prototype = __commonJS(function(exports, module) {
'use strict';
var isObject = require_is_object();
module.exports = function(argument) {
return isObject(argument) || argument === null;
};
});
var require_a_possible_prototype = __commonJS(function(exports, module) {
'use strict';
var isPossiblePrototype = require_is_possible_prototype();
var $String = String;
var $TypeError = TypeError;
module.exports = function(argument) {
if (isPossiblePrototype(argument)) {
return argument;
}
throw new $TypeError('Can\'t set ' + $String(argument) + ' as a prototype');
};
});
var require_object_set_prototype_of = __commonJS(function(exports, module) {
'use strict';
var uncurryThisAccessor = require_function_uncurry_this_accessor();
var isObject = require_is_object();
var requireObjectCoercible = require_require_object_coercible();
var aPossiblePrototype = require_a_possible_prototype();
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) {}
return function setPrototypeOf(O, proto) {
requireObjectCoercible(O);
aPossiblePrototype(proto);
if (!isObject(O)) {
return O;
}
if (CORRECT_SETTER) {
setter(O, proto);
} else {
O.__proto__ = proto;
}
return O;
};
}() : void 0);
});
var require_iterator_define = __commonJS(function(exports, module) {
'use strict';
var $ = require_export();
var call = require_function_call();
var IS_PURE = require_is_pure();
var FunctionName = require_function_name();
var isCallable = require_is_callable();
var createIteratorConstructor = require_iterator_create_constructor();
var getPrototypeOf = require_object_get_prototype_of();
var setPrototypeOf = require_object_set_prototype_of();
var setToStringTag = require_set_to_string_tag();
var createNonEnumerableProperty = require_create_non_enumerable_property();
var defineBuiltIn = require_define_built_in();
var wellKnownSymbol = require_well_known_symbol();
var Iterators = require_iterators();
var IteratorsCore = require_iterators_core();
var PROPER_FUNCTION_NAME = FunctionName.PROPER;
var CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE;
var IteratorPrototype = IteratorsCore.IteratorPrototype;
var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;
var ITERATOR = wellKnownSymbol('iterator');
var KEYS = 'keys';
var VALUES = 'values';
var ENTRIES = 'entries';
var returnThis = function returnThis() {
return this;
};
module.exports = function(Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {
createIteratorConstructor(IteratorConstructor, NAME, next);
var getIterationMethod = function getIterationMethod(KIND) {
if (KIND === DEFAULT && defaultIterator) {
return defaultIterator;
}
if (!BUGGY_SAFARI_ITERATORS && KIND && KIND in IterablePrototype) {
return IterablePrototype[KIND];
}
switch (KIND) {
case KEYS:
return function keys() {
return new IteratorConstructor(this, KIND);
};
case VALUES:
return function values2() {
return new IteratorConstructor(this, KIND);
};
case ENTRIES:
return function entries2() {
return new IteratorConstructor(this, KIND);
};
}
return function() {
return new IteratorConstructor(this);
};
};
var TO_STRING_TAG = NAME + ' Iterator';
var INCORRECT_VALUES_NAME = false;
var IterablePrototype = Iterable.prototype;
var nativeIterator = IterablePrototype[ITERATOR] || IterablePrototype['@@iterator'] || DEFAULT && IterablePrototype[DEFAULT];
var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT);
var anyNativeIterator = NAME === 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator;
var CurrentIteratorPrototype, methods, KEY;
if (anyNativeIterator) {
CurrentIteratorPrototype = getPrototypeOf(anyNativeIterator.call(new Iterable()));
if (CurrentIteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) {
if (!IS_PURE && getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) {
if (setPrototypeOf) {
setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype);
} else if (!isCallable(CurrentIteratorPrototype[ITERATOR])) {
defineBuiltIn(CurrentIteratorPrototype, ITERATOR, returnThis);
}
}
setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true, true);
if (IS_PURE) {
Iterators[TO_STRING_TAG] = returnThis;
}
}
}
if (PROPER_FUNCTION_NAME && DEFAULT === VALUES && nativeIterator && nativeIterator.name !== VALUES) {
if (!IS_PURE && CONFIGURABLE_FUNCTION_NAME) {
createNonEnumerableProperty(IterablePrototype, 'name', VALUES);
} else {
INCORRECT_VALUES_NAME = true;
defaultIterator = function values2() {
return call(nativeIterator, this);
};
}
}
if (DEFAULT) {
methods = {
values: getIterationMethod(VALUES),
keys: IS_SET ? defaultIterator : getIterationMethod(KEYS),
entries: getIterationMethod(ENTRIES)
};
if (FORCED) {
for (KEY in methods) {
if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
defineBuiltIn(IterablePrototype, KEY, methods[KEY]);
}
}
} else {
$({
target: NAME,
proto: true,
forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME
}, methods);
}
}
if ((!IS_PURE || FORCED) && IterablePrototype[ITERATOR] !== defaultIterator) {
defineBuiltIn(IterablePrototype, ITERATOR, defaultIterator, {
name: DEFAULT
});
}
Iterators[NAME] = defaultIterator;
return methods;
};
});
var require_create_iter_result_object = __commonJS(function(exports, module) {
'use strict';
module.exports = function(value, done) {
return {
value: value,
done: done
};
};
});
var require_es_array_iterator = __commonJS(function(exports, module) {
'use strict';
var toIndexedObject = require_to_indexed_object();
var addToUnscopables = require_add_to_unscopables();
var Iterators = require_iterators();
var InternalStateModule = require_internal_state();
var defineProperty = require_object_define_property().f;
var defineIterator = require_iterator_define();
var createIterResultObject = require_create_iter_result_object();
var IS_PURE = require_is_pure();
var DESCRIPTORS = require_descriptors();
var ARRAY_ITERATOR = 'Array Iterator';
var setInternalState = InternalStateModule.set;
var getInternalState = InternalStateModule.getterFor(ARRAY_ITERATOR);
module.exports = defineIterator(Array, 'Array', function(iterated, kind) {
setInternalState(this, {
type: ARRAY_ITERATOR,
target: toIndexedObject(iterated),
index: 0,
kind: kind
});
}, function() {
var state = getInternalState(this);
var target = state.target;
var index = state.index++;
if (!target || index >= target.length) {
state.target = null;
return createIterResultObject(void 0, true);
}
switch (state.kind) {
case 'keys':
return createIterResultObject(index, false);
case 'values':
return createIterResultObject(target[index], false);
}
return createIterResultObject([ index, target[index] ], false);
}, 'values');
var values2 = Iterators.Arguments = Iterators.Array;
addToUnscopables('keys');
addToUnscopables('values');
addToUnscopables('entries');
if (!IS_PURE && DESCRIPTORS && values2.name !== 'values') {
try {
defineProperty(values2, 'name', {
value: 'values'
});
} catch (error) {}
}
});
var require_is_array_iterator_method = __commonJS(function(exports, module) {
'use strict';
var wellKnownSymbol = require_well_known_symbol();
var Iterators = require_iterators();
var ITERATOR = wellKnownSymbol('iterator');
var ArrayPrototype = Array.prototype;
module.exports = function(it) {
return it !== void 0 && (Iterators.Array === it || ArrayPrototype[ITERATOR] === it);
};
});
var require_get_internal_iterator = __commonJS(function(exports, module) {
'use strict';
var classof = require_classof();
var hasOwn2 = require_has_own_property();
var Iterators = require_iterators();
module.exports = function(it) {
var klass = classof(it);
if (klass === 'Arguments') {
klass = 'Array';
}
return hasOwn2(Iterators, klass) ? Iterators[klass] : void 0;
};
});
var require_get_iterator_method_internal = __commonJS(function(exports, module) {
'use strict';
var getMethod = require_get_method();
var isNullOrUndefined = require_is_null_or_undefined();
var getInternalIterator = require_get_internal_iterator();
var wellKnownSymbol = require_well_known_symbol();
var ITERATOR = wellKnownSymbol('iterator');
module.exports = function(it) {
if (!isNullOrUndefined(it)) {
return getMethod(it, ITERATOR) || getMethod(it, '@@iterator') || getInternalIterator(it);
}
};
});
var require_get_iterator_internal = __commonJS(function(exports, module) {
'use strict';
var call = require_function_call();
var isCallable = require_is_callable();
var anObject = require_an_object();
var tryToString = require_try_to_string();
var getIteratorMethod = require_get_iterator_method_internal();
var $TypeError = TypeError;
module.exports = function(argument, usingIterator) {
var iteratorMethod = arguments.length < 2 ? getIteratorMethod(argument) : usingIterator;
if (isCallable(iteratorMethod)) {
return anObject(call(iteratorMethod, argument));
}
throw new $TypeError(tryToString(argument) + ' is not iterable');
};
});
var require_iterator_close = __commonJS(function(exports, module) {
'use strict';
var call = require_function_call();
var anObject = require_an_object();
var getMethod = require_get_method();
module.exports = function(iterator, kind, value) {
var innerResult, innerError;
anObject(iterator);
try {
innerResult = getMethod(iterator, 'return');
if (!innerResult) {
if (kind === 'throw') {
throw value;
}
return value;
}
innerResult = call(innerResult, iterator);
} catch (error) {
innerError = true;
innerResult = error;
}
if (kind === 'throw') {
throw value;
}
if (innerError) {
throw innerResult;
}
anObject(innerResult);
return value;
};
});
var require_iterate = __commonJS(function(exports, module) {
'use strict';
var bind = require_function_bind_context();
var call = require_function_call();
var anObject = require_an_object();
var tryToString = require_try_to_string();
var isArrayIteratorMethod = require_is_array_iterator_method();
var lengthOfArrayLike = require_length_of_array_like();
var isPrototypeOf = require_object_is_prototype_of();
var getIterator = require_get_iterator_internal();
var getIteratorMethod = require_get_iterator_method_internal();
var iteratorClose = require_iterator_close();
var $TypeError = TypeError;
var Result = function Result(stopped, result) {
this.stopped = stopped;
this.result = result;
};
var ResultPrototype = Result.prototype;
module.exports = function(iterable, unboundFunction, options) {
var that = options && options.that;
var AS_ENTRIES = !!(options && options.AS_ENTRIES);
var IS_RECORD = !!(options && options.IS_RECORD);
var IS_ITERATOR = !!(options && options.IS_ITERATOR);
var INTERRUPTED = !!(options && options.INTERRUPTED);
var fn = bind(unboundFunction, that);
var iterator, iterFn, index, length, result, next, step;
var stop = function stop(condition2) {
var $iterator = iterator;
iterator = void 0;
if ($iterator) {
iteratorClose($iterator, 'normal');
}
return new Result(true, condition2);
};
var callFn = function callFn(value2) {
if (AS_ENTRIES) {
anObject(value2);
return INTERRUPTED ? fn(value2[0], value2[1], stop) : fn(value2[0], value2[1]);
}
return INTERRUPTED ? fn(value2, stop) : fn(value2);
};
if (IS_RECORD) {
iterator = iterable.iterator;
} else if (IS_ITERATOR) {
iterator = iterable;
} else {
iterFn = getIteratorMethod(iterable);
if (!iterFn) {
throw new $TypeError(tryToString(iterable) + ' is not iterable');
}
if (isArrayIteratorMethod(iterFn)) {
for (index = 0, length = lengthOfArrayLike(iterable); length > index; index++) {
result = callFn(iterable[index]);
if (result && isPrototypeOf(ResultPrototype, result)) {
return result;
}
}
return new Result(false);
}
iterator = getIterator(iterable, iterFn);
}
next = IS_RECORD ? iterable.next : iterator.next;
while (!(step = call(next, iterator)).done) {
var value = step.value;
try {
result = callFn(value);
} catch (error) {
if (iterator) {
iteratorClose(iterator, 'throw', error);
} else {
throw error;
}
}
if (_typeof(result) == 'object' && result && isPrototypeOf(ResultPrototype, result)) {
return result;
}
}
return new Result(false);
};
});
var require_create_property = __commonJS(function(exports, module) {
'use strict';
var DESCRIPTORS = require_descriptors();
var definePropertyModule = require_object_define_property();
var createPropertyDescriptor = require_create_property_descriptor();
module.exports = function(object, key, value) {
if (DESCRIPTORS) {
definePropertyModule.f(object, key, createPropertyDescriptor(0, value));
} else {
object[key] = value;
}
};
});
var require_es_object_from_entries = __commonJS(function() {
'use strict';
var $ = require_export();
var iterate = require_iterate();
var createProperty = require_create_property();
$({
target: 'Object',
stat: true
}, {
fromEntries: function fromEntries2(iterable) {
var obj = {};
iterate(iterable, function(k, v) {
createProperty(obj, k, v);
}, {
AS_ENTRIES: true
});
return obj;
}
});
});
var require_from_entries = __commonJS(function(exports, module) {
'use strict';
require_es_array_iterator();
require_es_object_from_entries();
var path = require_path();
module.exports = path.Object.fromEntries;
});
var require_dom_iterables = __commonJS(function(exports, module) {
'use strict';
module.exports = {
CSSRuleList: 0,
CSSStyleDeclaration: 0,
CSSValueList: 0,
ClientRectList: 0,
DOMRectList: 0,
DOMStringList: 0,
DOMTokenList: 1,
DataTransferItemList: 0,
FileList: 0,
HTMLAllCollection: 0,
HTMLCollection: 0,
HTMLFormElement: 0,
HTMLSelectElement: 0,
MediaList: 0,
MimeTypeArray: 0,
NamedNodeMap: 0,
NodeList: 1,
PaintRequestList: 0,
Plugin: 0,
PluginArray: 0,
SVGLengthList: 0,
SVGNumberList: 0,
SVGPathSegList: 0,
SVGPointList: 0,
SVGStringList: 0,
SVGTransformList: 0,
SourceBufferList: 0,
StyleSheetList: 0,
TextTrackCueList: 0,
TextTrackList: 0,
TouchList: 0
};
});
var require_web_dom_collections_iterator = __commonJS(function() {
'use strict';
require_es_array_iterator();
var DOMIterables = require_dom_iterables();
var globalThis2 = require_global_this();
var setToStringTag = require_set_to_string_tag();
var Iterators = require_iterators();
for (var COLLECTION_NAME in DOMIterables) {
setToStringTag(globalThis2[COLLECTION_NAME], COLLECTION_NAME);
Iterators[COLLECTION_NAME] = Iterators.Array;
}
});
var require_from_entries2 = __commonJS(function(exports, module) {
'use strict';
var parent = require_from_entries();
require_web_dom_collections_iterator();
module.exports = parent;
});
var require_from_entries3 = __commonJS(function(exports, module) {
'use strict';
var parent = require_from_entries2();
module.exports = parent;
});
var require_to_string = __commonJS(function(exports, module) {
'use strict';
var classof = require_classof();
var $String = String;
module.exports = function(argument) {
if (classof(argument) === 'Symbol') {
throw new TypeError('Cannot convert a Symbol value to a string');
}
return $String(argument);
};
});
var require_string_multibyte = __commonJS(function(exports, module) {
'use strict';
var uncurryThis = require_function_uncurry_this();
var toIntegerOrInfinity = require_to_integer_or_infinity();
var toString = require_to_string();
var requireObjectCoercible = require_require_object_coercible();
var charAt = uncurryThis(''.charAt);
var charCodeAt = uncurryThis(''.charCodeAt);
var stringSlice = uncurryThis(''.slice);
var createMethod = function createMethod(CONVERT_TO_STRING) {
return function($this, pos) {
var S2 = toString(requireObjectCoercible($this));
var position = toIntegerOrInfinity(pos);
var size = S2.length;
var first, second;
if (position < 0 || position >= size) {
return CONVERT_TO_STRING ? '' : void 0;
}
first = charCodeAt(S2, position);
return first < 55296 || first > 56319 || position + 1 === size || (second = charCodeAt(S2, position + 1)) < 56320 || second > 57343 ? CONVERT_TO_STRING ? charAt(S2, position) : first : CONVERT_TO_STRING ? stringSlice(S2, position, position + 2) : (first - 55296 << 10) + (second - 56320) + 65536;
};
};
module.exports = {
codeAt: createMethod(false),
charAt: createMethod(true)
};
});
var require_es_string_iterator = __commonJS(function() {
'use strict';
var charAt = require_string_multibyte().charAt;
var toString = require_to_string();
var InternalStateModule = require_internal_state();
var defineIterator = require_iterator_define();
var createIterResultObject = require_create_iter_result_object();
var STRING_ITERATOR = 'String Iterator';
var setInternalState = InternalStateModule.set;
var getInternalState = InternalStateModule.getterFor(STRING_ITERATOR);
defineIterator(String, 'String', function(iterated) {
setInternalState(this, {
type: STRING_ITERATOR,
string: toString(iterated),
index: 0
});
}, function next() {
var state = getInternalState(this);
var string = state.string;
var index = state.index;
var point;
if (index >= string.length) {
return createIterResultObject(void 0, true);
}
point = charAt(string, index);
state.index += point.length;
return createIterResultObject(point, false);
});
});
var require_call_with_safe_iteration_closing = __commonJS(function(exports, module) {
'use strict';
var anObject = require_an_object();
var iteratorClose = require_iterator_close();
module.exports = function(iterator, fn, value, ENTRIES) {
try {
return ENTRIES ? fn(anObject(value)[0], value[1]) : fn(value);
} catch (error) {
iteratorClose(iterator, 'throw', error);
}
};
});
var require_inspect_source = __commonJS(function(exports, module) {
'use strict';
var uncurryThis = require_function_uncurry_this();
var isCallable = require_is_callable();
var store = require_shared_store();
var functionToString = uncurryThis(Function.toString);
if (!isCallable(store.inspectSource)) {
store.inspectSource = function(it) {
return functionToString(it);
};
}
module.exports = store.inspectSource;
});
var require_is_constructor = __commonJS(function(exports, module) {
'use strict';
var uncurryThis = require_function_uncurry_this();
var fails = require_fails();
var isCallable = require_is_callable();
var classof = require_classof();
var getBuiltIn = require_get_built_in();
var inspectSource = require_inspect_source();
var noop3 = function noop3() {};
var construct = getBuiltIn('Reflect', 'construct');
var constructorRegExp = /^\s*(?:class|function)\b/;
var exec = uncurryThis(constructorRegExp.exec);
var INCORRECT_TO_STRING = !constructorRegExp.test(noop3);
var isConstructorModern = function isConstructor(argument) {
if (!isCallable(argument)) {
return false;
}
try {
construct(noop3, [], argument);
return true;
} catch (error) {
return false;
}
};
var isConstructorLegacy = function isConstructor(argument) {
if (!isCallable(argument)) {
return false;
}
switch (classof(argument)) {
case 'AsyncFunction':
case 'GeneratorFunction':
case 'AsyncGeneratorFunction':
return false;
}
try {
return INCORRECT_TO_STRING || !!exec(constructorRegExp, inspectSource(argument));
} catch (error) {
return true;
}
};
isConstructorLegacy.sham = true;
module.exports = !construct || fails(function() {
var called;
return isConstructorModern(isConstructorModern.call) || !isConstructorModern(Object) || !isConstructorModern(function() {
called = true;
}) || called;
}) ? isConstructorLegacy : isConstructorModern;
});
var require_is_array = __commonJS(function(exports, module) {
'use strict';
var classof = require_classof_raw();
module.exports = Array.isArray || function isArray(argument) {
return classof(argument) === 'Array';
};
});
var require_array_set_length = __commonJS(function(exports, module) {
'use strict';
var DESCRIPTORS = require_descriptors();
var isArray = require_is_array();
var $TypeError = TypeError;
var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
var SILENT_ON_NON_WRITABLE_LENGTH_SET = DESCRIPTORS && !function() {
if (this !== void 0) {
return true;
}
try {
Object.defineProperty([], 'length', {
writable: false
}).length = 1;
} catch (error) {
return error instanceof TypeError;
}
}();
module.exports = SILENT_ON_NON_WRITABLE_LENGTH_SET ? function(O, length) {
if (isArray(O) && !getOwnPropertyDescriptor(O, 'length').writable) {
throw new $TypeError('Cannot set read only .length');
}
return O.length = length;
} : function(O, length) {
return O.length = length;
};
});
var require_does_not_exceed_safe_integer = __commonJS(function(exports, module) {
'use strict';
var $TypeError = TypeError;
var MAX_SAFE_INTEGER = 9007199254740991;
module.exports = function(it) {
if (it > MAX_SAFE_INTEGER) {
throw new $TypeError('Maximum allowed index exceeded');
}
return it;
};
});
var require_array_from = __commonJS(function(exports, module) {
'use strict';
var bind = require_function_bind_context();
var call = require_function_call();
var toObject = require_to_object();
var callWithSafeIterationClosing = require_call_with_safe_iteration_closing();
var isArrayIteratorMethod = require_is_array_iterator_method();
var isConstructor = require_is_constructor();
var lengthOfArrayLike = require_length_of_array_like();
var createProperty = require_create_property();
var setArrayLength = require_array_set_length();
var getIterator = require_get_iterator_internal();
var getIteratorMethod = require_get_iterator_method_internal();
var iteratorClose = require_iterator_close();
var doesNotExceedSafeInteger = require_does_not_exceed_safe_integer();
var $Array = Array;
module.exports = function from(arrayLike) {
var IS_CONSTRUCTOR = isConstructor(this);
var argumentsLength = arguments.length;
var mapfn = argumentsLength > 1 ? arguments[1] : void 0;
var mapping = mapfn !== void 0;
if (mapping) {
mapfn = bind(mapfn, argumentsLength > 2 ? arguments[2] : void 0);
}
var O = toObject(arrayLike);
var iteratorMethod = getIteratorMethod(O);
var index = 0;
var length, result, step, iterator, next, value;
if (iteratorMethod && !(this === $Array && isArrayIteratorMethod(iteratorMethod))) {
result = IS_CONSTRUCTOR ? new this() : [];
iterator = getIterator(O, iteratorMethod);
next = iterator.next;
for (;!(step = call(next, iterator)).done; index++) {
try {
doesNotExceedSafeInteger(index);
} catch (error) {
iteratorClose(iterator, 'throw', error);
}
value = mapping ? callWithSafeIterationClosing(iterator, mapfn, [ step.value, index ], true) : step.value;
try {
createProperty(result, index, value);
} catch (error) {
iteratorClose(iterator, 'throw', error);
}
}
} else {
length = lengthOfArrayLike(O);
result = IS_CONSTRUCTOR ? new this(length) : $Array(length);
for (;length > index; index++) {
value = mapping ? mapfn(O[index], index) : O[index];
createProperty(result, index, value);
}
}
setArrayLength(result, index);
return result;
};
});
var require_check_correctness_of_iteration = __commonJS(function(exports, module) {
'use strict';
var wellKnownSymbol = require_well_known_symbol();
var ITERATOR = wellKnownSymbol('iterator');
var SAFE_CLOSING = false;
try {
called = 0;
iteratorWithReturn = {
next: function next() {
return {
done: !!called++
};
},
return: function _return() {
SAFE_CLOSING = true;
}
};
iteratorWithReturn[ITERATOR] = function() {
return this;
};
Array.from(iteratorWithReturn, function() {
throw 2;
});
} catch (error) {}
var called;
var iteratorWithReturn;
module.exports = function(exec, SKIP_CLOSING) {
try {
if (!SKIP_CLOSING && !SAFE_CLOSING) {
return false;
}
} catch (error) {
return false;
}
var ITERATION_SUPPORT = false;
try {
var object = {};
object[ITERATOR] = function() {
return {
next: function next() {
return {
done: ITERATION_SUPPORT = true
};
}
};
};
exec(object);
} catch (error) {}
return ITERATION_SUPPORT;
};
});
var require_es_array_from = __commonJS(function() {
'use strict';
var $ = require_export();
var from = require_array_from();
var checkCorrectnessOfIteration = require_check_correctness_of_iteration();
var INCORRECT_ITERATION = !checkCorrectnessOfIteration(function(iterable) {
Array.from(iterable);
});
$({
target: 'Array',
stat: true,
forced: INCORRECT_ITERATION
}, {
from: from
});
});
var require_from = __commonJS(function(exports, module) {
'use strict';
require_es_string_iterator();
require_es_array_from();
var path = require_path();
module.exports = path.Array.from;
});
var require_from2 = __commonJS(function(exports, module) {
'use strict';
var parent = require_from();
module.exports = parent;
});
var require_from3 = __commonJS(function(exports, module) {
'use strict';
var parent = require_from2();
module.exports = parent;
});
var require_utils = __commonJS(function(exports) {
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
function isIdentStart(c4) {
return c4 >= 'a' && c4 <= 'z' || c4 >= 'A' && c4 <= 'Z' || c4 === '-' || c4 === '_';
}
exports.isIdentStart = isIdentStart;
function isIdent(c4) {
return c4 >= 'a' && c4 <= 'z' || c4 >= 'A' && c4 <= 'Z' || c4 >= '0' && c4 <= '9' || c4 === '-' || c4 === '_';
}
exports.isIdent = isIdent;
function isHex(c4) {
return c4 >= 'a' && c4 <= 'f' || c4 >= 'A' && c4 <= 'F' || c4 >= '0' && c4 <= '9';
}
exports.isHex = isHex;
function escapeIdentifier(s) {
var len = s.length;
var result = '';
var i = 0;
while (i < len) {
var chr = s.charAt(i);
if (exports.identSpecialChars[chr]) {
result += '\\' + chr;
} else {
if (!(chr === '_' || chr === '-' || chr >= 'A' && chr <= 'Z' || chr >= 'a' && chr <= 'z' || i !== 0 && chr >= '0' && chr <= '9')) {
var charCode = chr.charCodeAt(0);
if ((charCode & 63488) === 55296) {
var extraCharCode = s.charCodeAt(i++);
if ((charCode & 64512) !== 55296 || (extraCharCode & 64512) !== 56320) {
throw Error('UCS-2(decode): illegal sequence');
}
charCode = ((charCode & 1023) << 10) + (extraCharCode & 1023) + 65536;
}
result += '\\' + charCode.toString(16) + ' ';
} else {
result += chr;
}
}
i++;
}
return result;
}
exports.escapeIdentifier = escapeIdentifier;
function escapeStr(s) {
var len = s.length;
var result = '';
var i = 0;
var replacement;
while (i < len) {
var chr = s.charAt(i);
if (chr === '"') {
chr = '\\"';
} else if (chr === '\\') {
chr = '\\\\';
} else if ((replacement = exports.strReplacementsRev[chr]) !== void 0) {
chr = replacement;
}
result += chr;
i++;
}
return '"' + result + '"';
}
exports.escapeStr = escapeStr;
exports.identSpecialChars = {
'!': true,
'"': true,
'#': true,
$: true,
'%': true,
'&': true,
'\'': true,
'(': true,
')': true,
'*': true,
'+': true,
',': true,
'.': true,
'/': true,
';': true,
'<': true,
'=': true,
'>': true,
'?': true,
'@': true,
'[': true,
'\\': true,
']': true,
'^': true,
'`': true,
'{': true,
'|': true,
'}': true,
'~': true
};
exports.strReplacementsRev = {
'\n': '\\n',
'\r': '\\r',
'\t': '\\t',
'\f': '\\f',
'\v': '\\v'
};
exports.singleQuoteEscapeChars = {
n: '\n',
r: '\r',
t: '\t',
f: '\f',
'\\': '\\',
'\'': '\''
};
exports.doubleQuotesEscapeChars = {
n: '\n',
r: '\r',
t: '\t',
f: '\f',
'\\': '\\',
'"': '"'
};
});
var require_parser_context = __commonJS(function(exports) {
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
var utils_1 = require_utils();
function parseCssSelector(str, pos, pseudos, attrEqualityMods, ruleNestingOperators, substitutesEnabled) {
var l = str.length;
var chr = '';
function getStr(quote, escapeTable) {
var result = '';
pos++;
chr = str.charAt(pos);
while (pos < l) {
if (chr === quote) {
pos++;
return result;
} else if (chr === '\\') {
pos++;
chr = str.charAt(pos);
var esc = void 0;
if (chr === quote) {
result += quote;
} else if ((esc = escapeTable[chr]) !== void 0) {
result += esc;
} else if (utils_1.isHex(chr)) {
var hex = chr;
pos++;
chr = str.charAt(pos);
while (utils_1.isHex(chr)) {
hex += chr;
pos++;
chr = str.charAt(pos);
}
if (chr === ' ') {
pos++;
chr = str.charAt(pos);
}
result += String.fromCharCode(parseInt(hex, 16));
continue;
} else {
result += chr;
}
} else {
result += chr;
}
pos++;
chr = str.charAt(pos);
}
return result;
}
function getIdent() {
var result = '';
chr = str.charAt(pos);
while (pos < l) {
if (utils_1.isIdent(chr)) {
result += chr;
} else if (chr === '\\') {
pos++;
if (pos >= l) {
throw Error('Expected symbol but end of file reached.');
}
chr = str.charAt(pos);
if (utils_1.identSpecialChars[chr]) {
result += chr;
} else if (utils_1.isHex(chr)) {
var hex = chr;
pos++;
chr = str.charAt(pos);
while (utils_1.isHex(chr)) {
hex += chr;
pos++;
chr = str.charAt(pos);
}
if (chr === ' ') {
pos++;
chr = str.charAt(pos);
}
result += String.fromCharCode(parseInt(hex, 16));
continue;
} else {
result += chr;
}
} else {
return result;
}
pos++;
chr = str.charAt(pos);
}
return result;
}
function skipWhitespace() {
chr = str.charAt(pos);
var result = false;
while (chr === ' ' || chr === '\t' || chr === '\n' || chr === '\r' || chr === '\f') {
result = true;
pos++;
chr = str.charAt(pos);
}
return result;
}
function parse3() {
var res = parseSelector();
if (pos < l) {
throw Error('Rule expected but "' + str.charAt(pos) + '" found.');
}
return res;
}
function parseSelector() {
var selector = parseSingleSelector();
if (!selector) {
return null;
}
var res = selector;
chr = str.charAt(pos);
while (chr === ',') {
pos++;
skipWhitespace();
if (res.type !== 'selectors') {
res = {
type: 'selectors',
selectors: [ selector ]
};
}
selector = parseSingleSelector();
if (!selector) {
throw Error('Rule expected after ",".');
}
res.selectors.push(selector);
}
return res;
}
function parseSingleSelector() {
skipWhitespace();
var selector = {
type: 'ruleSet'
};
var rule = parseRule();
if (!rule) {
return null;
}
var currentRule = selector;
while (rule) {
rule.type = 'rule';
currentRule.rule = rule;
currentRule = rule;
skipWhitespace();
chr = str.charAt(pos);
if (pos >= l || chr === ',' || chr === ')') {
break;
}
if (ruleNestingOperators[chr]) {
var op = chr;
pos++;
skipWhitespace();
rule = parseRule();
if (!rule) {
throw Error('Rule expected after "' + op + '".');
}
rule.nestingOperator = op;
} else {
rule = parseRule();
if (rule) {
rule.nestingOperator = null;
}
}
}
return selector;
}
function parseRule() {
var rule = null;
while (pos < l) {
chr = str.charAt(pos);
if (chr === '*') {
pos++;
(rule = rule || {}).tagName = '*';
} else if (utils_1.isIdentStart(chr) || chr === '\\') {
(rule = rule || {}).tagName = getIdent();
} else if (chr === '.') {
pos++;
rule = rule || {};
(rule.classNames = rule.classNames || []).push(getIdent());
} else if (chr === '#') {
pos++;
(rule = rule || {}).id = getIdent();
} else if (chr === '[') {
pos++;
skipWhitespace();
var attr = {
name: getIdent()
};
skipWhitespace();
if (chr === ']') {
pos++;
} else {
var operator = '';
if (attrEqualityMods[chr]) {
operator = chr;
pos++;
chr = str.charAt(pos);
}
if (pos >= l) {
throw Error('Expected "=" but end of file reached.');
}
if (chr !== '=') {
throw Error('Expected "=" but "' + chr + '" found.');
}
attr.operator = operator + '=';
pos++;
skipWhitespace();
var attrValue = '';
attr.valueType = 'string';
if (chr === '"') {
attrValue = getStr('"', utils_1.doubleQuotesEscapeChars);
} else if (chr === '\'') {
attrValue = getStr('\'', utils_1.singleQuoteEscapeChars);
} else if (substitutesEnabled && chr === '$') {
pos++;
attrValue = getIdent();
attr.valueType = 'substitute';
} else {
while (pos < l) {
if (chr === ']') {
break;
}
attrValue += chr;
pos++;
chr = str.charAt(pos);
}
attrValue = attrValue.trim();
}
skipWhitespace();
if (pos >= l) {
throw Error('Expected "]" but end of file reached.');
}
if (chr !== ']') {
throw Error('Expected "]" but "' + chr + '" found.');
}
pos++;
attr.value = attrValue;
}
rule = rule || {};
(rule.attrs = rule.attrs || []).push(attr);
} else if (chr === ':') {
pos++;
var pseudoName = getIdent();
var pseudo = {
name: pseudoName
};
if (chr === '(') {
pos++;
var value = '';
skipWhitespace();
if (pseudos[pseudoName] === 'selector') {
pseudo.valueType = 'selector';
value = parseSelector();
} else {
pseudo.valueType = pseudos[pseudoName] || 'string';
if (chr === '"') {
value = getStr('"', utils_1.doubleQuotesEscapeChars);
} else if (chr === '\'') {
value = getStr('\'', utils_1.singleQuoteEscapeChars);
} else if (substitutesEnabled && chr === '$') {
pos++;
value = getIdent();
pseudo.valueType = 'substitute';
} else {
while (pos < l) {
if (chr === ')') {
break;
}
value += chr;
pos++;
chr = str.charAt(pos);
}
value = value.trim();
}
skipWhitespace();
}
if (pos >= l) {
throw Error('Expected ")" but end of file reached.');
}
if (chr !== ')') {
throw Error('Expected ")" but "' + chr + '" found.');
}
pos++;
pseudo.value = value;
}
rule = rule || {};
(rule.pseudos = rule.pseudos || []).push(pseudo);
} else {
break;
}
}
return rule;
}
return parse3();
}
exports.parseCssSelector = parseCssSelector;
});
var require_render = __commonJS(function(exports) {
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
var utils_1 = require_utils();
function renderEntity(entity) {
var res = '';
switch (entity.type) {
case 'ruleSet':
var currentEntity = entity.rule;
var parts = [];
while (currentEntity) {
if (currentEntity.nestingOperator) {
parts.push(currentEntity.nestingOperator);
}
parts.push(renderEntity(currentEntity));
currentEntity = currentEntity.rule;
}
res = parts.join(' ');
break;
case 'selectors':
res = entity.selectors.map(renderEntity).join(', ');
break;
case 'rule':
if (entity.tagName) {
if (entity.tagName === '*') {
res = '*';
} else {
res = utils_1.escapeIdentifier(entity.tagName);
}
}
if (entity.id) {
res += '#' + utils_1.escapeIdentifier(entity.id);
}
if (entity.classNames) {
res += entity.classNames.map(function(cn) {
return '.' + utils_1.escapeIdentifier(cn);
}).join('');
}
if (entity.attrs) {
res += entity.attrs.map(function(attr) {
if ('operator' in attr) {
if (attr.valueType === 'substitute') {
return '[' + utils_1.escapeIdentifier(attr.name) + attr.operator + '$' + attr.value + ']';
} else {
return '[' + utils_1.escapeIdentifier(attr.name) + attr.operator + utils_1.escapeStr(attr.value) + ']';
}
} else {
return '[' + utils_1.escapeIdentifier(attr.name) + ']';
}
}).join('');
}
if (entity.pseudos) {
res += entity.pseudos.map(function(pseudo) {
if (pseudo.valueType) {
if (pseudo.valueType === 'selector') {
return ':' + utils_1.escapeIdentifier(pseudo.name) + '(' + renderEntity(pseudo.value) + ')';
} else if (pseudo.valueType === 'substitute') {
return ':' + utils_1.escapeIdentifier(pseudo.name) + '($' + pseudo.value + ')';
} else if (pseudo.valueType === 'numeric') {
return ':' + utils_1.escapeIdentifier(pseudo.name) + '(' + pseudo.value + ')';
} else {
return ':' + utils_1.escapeIdentifier(pseudo.name) + '(' + utils_1.escapeIdentifier(pseudo.value) + ')';
}
} else {
return ':' + utils_1.escapeIdentifier(pseudo.name);
}
}).join('');
}
break;
default:
throw Error('Unknown entity type: "' + entity.type + '".');
}
return res;
}
exports.renderEntity = renderEntity;
});
var require_lib = __commonJS(function(exports) {
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
var parser_context_1 = require_parser_context();
var render_1 = require_render();
var CssSelectorParser2 = function() {
function CssSelectorParser3() {
this.pseudos = {};
this.attrEqualityMods = {};
this.ruleNestingOperators = {};
this.substitutesEnabled = false;
}
CssSelectorParser3.prototype.registerSelectorPseudos = function() {
var pseudos = [];
for (var _i = 0; _i < arguments.length; _i++) {
pseudos[_i] = arguments[_i];
}
for (var _a = 0, pseudos_1 = pseudos; _a < pseudos_1.length; _a++) {
var pseudo = pseudos_1[_a];
this.pseudos[pseudo] = 'selector';
}
return this;
};
CssSelectorParser3.prototype.unregisterSelectorPseudos = function() {
var pseudos = [];
for (var _i = 0; _i < arguments.length; _i++) {
pseudos[_i] = arguments[_i];
}
for (var _a = 0, pseudos_2 = pseudos; _a < pseudos_2.length; _a++) {
var pseudo = pseudos_2[_a];
delete this.pseudos[pseudo];
}
return this;
};
CssSelectorParser3.prototype.registerNumericPseudos = function() {
var pseudos = [];
for (var _i = 0; _i < arguments.length; _i++) {
pseudos[_i] = arguments[_i];
}
for (var _a = 0, pseudos_3 = pseudos; _a < pseudos_3.length; _a++) {
var pseudo = pseudos_3[_a];
this.pseudos[pseudo] = 'numeric';
}
return this;
};
CssSelectorParser3.prototype.unregisterNumericPseudos = function() {
var pseudos = [];
for (var _i = 0; _i < arguments.length; _i++) {
pseudos[_i] = arguments[_i];
}
for (var _a = 0, pseudos_4 = pseudos; _a < pseudos_4.length; _a++) {
var pseudo = pseudos_4[_a];
delete this.pseudos[pseudo];
}
return this;
};
CssSelectorParser3.prototype.registerNestingOperators = function() {
var operators = [];
for (var _i = 0; _i < arguments.length; _i++) {
operators[_i] = arguments[_i];
}
for (var _a = 0, operators_1 = operators; _a < operators_1.length; _a++) {
var operator = operators_1[_a];
this.ruleNestingOperators[operator] = true;
}
return this;
};
CssSelectorParser3.prototype.unregisterNestingOperators = function() {
var operators = [];
for (var _i = 0; _i < arguments.length; _i++) {
operators[_i] = arguments[_i];
}
for (var _a = 0, operators_2 = operators; _a < operators_2.length; _a++) {
var operator = operators_2[_a];
delete this.ruleNestingOperators[operator];
}
return this;
};
CssSelectorParser3.prototype.registerAttrEqualityMods = function() {
var mods = [];
for (var _i = 0; _i < arguments.length; _i++) {
mods[_i] = arguments[_i];
}
for (var _a = 0, mods_1 = mods; _a < mods_1.length; _a++) {
var mod = mods_1[_a];
this.attrEqualityMods[mod] = true;
}
return this;
};
CssSelectorParser3.prototype.unregisterAttrEqualityMods = function() {
var mods = [];
for (var _i = 0; _i < arguments.length; _i++) {
mods[_i] = arguments[_i];
}
for (var _a = 0, mods_2 = mods; _a < mods_2.length; _a++) {
var mod = mods_2[_a];
delete this.attrEqualityMods[mod];
}
return this;
};
CssSelectorParser3.prototype.enableSubstitutes = function() {
this.substitutesEnabled = true;
return this;
};
CssSelectorParser3.prototype.disableSubstitutes = function() {
this.substitutesEnabled = false;
return this;
};
CssSelectorParser3.prototype.parse = function(str) {
return parser_context_1.parseCssSelector(str, 0, this.pseudos, this.attrEqualityMods, this.ruleNestingOperators, this.substitutesEnabled);
};
CssSelectorParser3.prototype.render = function(path) {
return render_1.renderEntity(path).trim();
};
return CssSelectorParser3;
}();
exports.CssSelectorParser = CssSelectorParser2;
});
var require_doT = __commonJS(function(exports, module) {
(function() {
'use strict';
var doT2 = {
name: 'doT',
version: '1.1.1',
templateSettings: {
evaluate: /\{\{([\s\S]+?(\}?)+)\}\}/g,
interpolate: /\{\{=([\s\S]+?)\}\}/g,
encode: /\{\{!([\s\S]+?)\}\}/g,
use: /\{\{#([\s\S]+?)\}\}/g,
useParams: /(^|[^\w$])def(?:\.|\[[\'\"])([\w$\.]+)(?:[\'\"]\])?\s*\:\s*([\w$\.]+|\"[^\"]+\"|\'[^\']+\'|\{[^\}]+\})/g,
define: /\{\{##\s*([\w\.$]+)\s*(\:|=)([\s\S]+?)#\}\}/g,
defineParams: /^\s*([\w$]+):([\s\S]+)/,
conditional: /\{\{\?(\?)?\s*([\s\S]*?)\s*\}\}/g,
iterate: /\{\{~\s*(?:\}\}|([\s\S]+?)\s*\:\s*([\w$]+)\s*(?:\:\s*([\w$]+))?\s*\}\})/g,
varname: 'it',
strip: true,
append: true,
selfcontained: false,
doNotSkipEncoded: false
},
template: void 0,
compile: void 0,
log: true
};
(function() {
if ((typeof globalThis === 'undefined' ? 'undefined' : _typeof(globalThis)) === 'object') {
return;
}
try {
Object.defineProperty(Object.prototype, '__magic__', {
get: function get() {
return this;
},
configurable: true
});
__magic__.globalThis = __magic__;
delete Object.prototype.__magic__;
} catch (e) {
window.globalThis = function() {
if (typeof self !== 'undefined') {
return self;
}
if (typeof window !== 'undefined') {
return window;
}
if (typeof global !== 'undefined') {
return global;
}
if (typeof this !== 'undefined') {
return this;
}
throw new Error('Unable to locate global `this`');
}();
}
})();
doT2.encodeHTMLSource = function(doNotSkipEncoded) {
var encodeHTMLRules = {
'&': '&#38;',
'<': '&#60;',
'>': '&#62;',
'"': '&#34;',
'\'': '&#39;',
'/': '&#47;'
}, matchHTML = doNotSkipEncoded ? /[&<>"'\/]/g : /&(?!#?\w+;)|<|>|"|'|\//g;
return function(code) {
return code ? code.toString().replace(matchHTML, function(m3) {
return encodeHTMLRules[m3] || m3;
}) : '';
};
};
if (typeof module !== 'undefined' && module.exports) {
module.exports = doT2;
} else if (typeof define === 'function' && define.amd) {
define(function() {
return doT2;
});
} else {
globalThis.doT = doT2;
}
var startend = {
append: {
start: '\'+(',
end: ')+\'',
startencode: '\'+encodeHTML('
},
split: {
start: '\';out+=(',
end: ');out+=\'',
startencode: '\';out+=encodeHTML('
}
}, skip = /$^/;
function resolveDefs(c4, block, def) {
return (typeof block === 'string' ? block : block.toString()).replace(c4.define || skip, function(m3, code, assign, value) {
if (code.indexOf('def.') === 0) {
code = code.substring(4);
}
if (!(code in def)) {
if (assign === ':') {
if (c4.defineParams) {
value.replace(c4.defineParams, function(m4, param, v) {
def[code] = {
arg: param,
text: v
};
});
}
if (!(code in def)) {
def[code] = value;
}
} else {
new Function('def', 'def[\'' + code + '\']=' + value)(def);
}
}
return '';
}).replace(c4.use || skip, function(m3, code) {
if (c4.useParams) {
code = code.replace(c4.useParams, function(m4, s, d2, param) {
if (def[d2] && def[d2].arg && param) {
var rw = (d2 + ':' + param).replace(/'|\\/g, '_');
def.__exp = def.__exp || {};
def.__exp[rw] = def[d2].text.replace(new RegExp('(^|[^\\w$])' + def[d2].arg + '([^\\w$])', 'g'), '$1' + param + '$2');
return s + 'def.__exp[\'' + rw + '\']';
}
});
}
var v = new Function('def', 'return ' + code)(def);
return v ? resolveDefs(c4, v, def) : v;
});
}
function unescape(code) {
return code.replace(/\\('|\\)/g, '$1').replace(/[\r\t\n]/g, ' ');
}
doT2.template = function(tmpl, c4, def) {
c4 = c4 || doT2.templateSettings;
var cse = c4.append ? startend.append : startend.split, needhtmlencode, sid = 0, indv, str = c4.use || c4.define ? resolveDefs(c4, tmpl, def || {}) : tmpl;
str = ('var out=\'' + (c4.strip ? str.replace(/(^|\r|\n)\t* +| +\t*(\r|\n|$)/g, ' ').replace(/\r|\n|\t|\/\*[\s\S]*?\*\//g, '') : str).replace(/'|\\/g, '\\$&').replace(c4.interpolate || skip, function(m3, code) {
return cse.start + unescape(code) + cse.end;
}).replace(c4.encode || skip, function(m3, code) {
needhtmlencode = true;
return cse.startencode + unescape(code) + cse.end;
}).replace(c4.conditional || skip, function(m3, elsecase, code) {
return elsecase ? code ? '\';}else if(' + unescape(code) + '){out+=\'' : '\';}else{out+=\'' : code ? '\';if(' + unescape(code) + '){out+=\'' : '\';}out+=\'';
}).replace(c4.iterate || skip, function(m3, iterate, vname, iname) {
if (!iterate) {
return '\';} } out+=\'';
}
sid += 1;
indv = iname || 'i' + sid;
iterate = unescape(iterate);
return '\';var arr' + sid + '=' + iterate + ';if(arr' + sid + '){var ' + vname + ',' + indv + '=-1,l' + sid + '=arr' + sid + '.length-1;while(' + indv + '<l' + sid + '){' + vname + '=arr' + sid + '[' + indv + '+=1];out+=\'';
}).replace(c4.evaluate || skip, function(m3, code) {
return '\';' + unescape(code) + 'out+=\'';
}) + '\';return out;').replace(/\n/g, '\\n').replace(/\t/g, '\\t').replace(/\r/g, '\\r').replace(/(\s|;|\}|^|\{)out\+='';/g, '$1').replace(/\+''/g, '');
if (needhtmlencode) {
if (!c4.selfcontained && globalThis && !globalThis._encodeHTML) {
globalThis._encodeHTML = doT2.encodeHTMLSource(c4.doNotSkipEncoded);
}
str = 'var encodeHTML = typeof _encodeHTML !== \'undefined\' ? _encodeHTML : (' + doT2.encodeHTMLSource.toString() + '(' + (c4.doNotSkipEncoded || '') + '));' + str;
}
try {
return new Function(c4.varname, str);
} catch (e) {
if (typeof console !== 'undefined') {
console.log('Could not create a template function: ' + str);
}
throw e;
}
};
doT2.compile = function(tmpl, def) {
return doT2.template(tmpl, null, def);
};
})();
});
var require_noop = __commonJS(function(exports, module) {
'use strict';
module.exports = function() {};
});
var require_is_value = __commonJS(function(exports, module) {
'use strict';
var _undefined = require_noop()();
module.exports = function(val) {
return val !== _undefined && val !== null;
};
});
var require_normalize_options = __commonJS(function(exports, module) {
'use strict';
var isValue = require_is_value();
var forEach = Array.prototype.forEach;
var create = Object.create;
var process2 = function process2(src, obj) {
var key;
for (key in src) {
obj[key] = src[key];
}
};
module.exports = function(opts1) {
var result = create(null);
forEach.call(arguments, function(options) {
if (!isValue(options)) {
return;
}
process2(Object(options), result);
});
return result;
};
});
var require_is_implemented = __commonJS(function(exports, module) {
'use strict';
module.exports = function() {
var sign = Math.sign;
if (typeof sign !== 'function') {
return false;
}
return sign(10) === 1 && sign(-20) === -1;
};
});
var require_shim = __commonJS(function(exports, module) {
'use strict';
module.exports = function(value) {
value = Number(value);
if (isNaN(value) || value === 0) {
return value;
}
return value > 0 ? 1 : -1;
};
});
var require_sign = __commonJS(function(exports, module) {
'use strict';
module.exports = require_is_implemented()() ? Math.sign : require_shim();
});
var require_to_integer = __commonJS(function(exports, module) {
'use strict';
var sign = require_sign();
var abs2 = Math.abs;
var floor = Math.floor;
module.exports = function(value) {
if (isNaN(value)) {
return 0;
}
value = Number(value);
if (value === 0 || !isFinite(value)) {
return value;
}
return sign(value) * floor(abs2(value));
};
});
var require_to_pos_integer = __commonJS(function(exports, module) {
'use strict';
var toInteger = require_to_integer();
var max2 = Math.max;
module.exports = function(value) {
return max2(0, toInteger(value));
};
});
var require_resolve_length = __commonJS(function(exports, module) {
'use strict';
var toPosInt = require_to_pos_integer();
module.exports = function(optsLength, fnLength, isAsync) {
var length;
if (isNaN(optsLength)) {
length = fnLength;
if (!(length >= 0)) {
return 1;
}
if (isAsync && length) {
return length - 1;
}
return length;
}
if (optsLength === false) {
return false;
}
return toPosInt(optsLength);
};
});
var require_valid_callable = __commonJS(function(exports, module) {
'use strict';
module.exports = function(fn) {
if (typeof fn !== 'function') {
throw new TypeError(fn + ' is not a function');
}
return fn;
};
});
var require_valid_value = __commonJS(function(exports, module) {
'use strict';
var isValue = require_is_value();
module.exports = function(value) {
if (!isValue(value)) {
throw new TypeError('Cannot use null or undefined');
}
return value;
};
});
var require_iterate2 = __commonJS(function(exports, module) {
'use strict';
var callable = require_valid_callable();
var value = require_valid_value();
var bind = Function.prototype.bind;
var call = Function.prototype.call;
var keys = Object.keys;
var objPropertyIsEnumerable = Object.prototype.propertyIsEnumerable;
module.exports = function(method, defVal) {
return function(obj, cb) {
var list, thisArg = arguments[2], compareFn = arguments[3];
obj = Object(value(obj));
callable(cb);
list = keys(obj);
if (compareFn) {
list.sort(typeof compareFn === 'function' ? bind.call(compareFn, obj) : void 0);
}
if (typeof method !== 'function') {
method = list[method];
}
return call.call(method, list, function(key, index) {
if (!objPropertyIsEnumerable.call(obj, key)) {
return defVal;
}
return call.call(cb, thisArg, obj[key], key, obj, index);
});
};
};
});
var require_for_each = __commonJS(function(exports, module) {
'use strict';
module.exports = require_iterate2()('forEach');
});
var require_registered_extensions = __commonJS(function() {
'use strict';
});
var require_is_implemented2 = __commonJS(function(exports, module) {
'use strict';
module.exports = function() {
var assign = Object.assign, obj;
if (typeof assign !== 'function') {
return false;
}
obj = {
foo: 'raz'
};
assign(obj, {
bar: 'dwa'
}, {
trzy: 'trzy'
});
return obj.foo + obj.bar + obj.trzy === 'razdwatrzy';
};
});
var require_is_implemented3 = __commonJS(function(exports, module) {
'use strict';
module.exports = function() {
try {
Object.keys('primitive');
return true;
} catch (e) {
return false;
}
};
});
var require_shim2 = __commonJS(function(exports, module) {
'use strict';
var isValue = require_is_value();
var keys = Object.keys;
module.exports = function(object) {
return keys(isValue(object) ? Object(object) : object);
};
});
var require_keys = __commonJS(function(exports, module) {
'use strict';
module.exports = require_is_implemented3()() ? Object.keys : require_shim2();
});
var require_shim3 = __commonJS(function(exports, module) {
'use strict';
var keys = require_keys();
var value = require_valid_value();
var max2 = Math.max;
module.exports = function(dest, src) {
var error, i, length = max2(arguments.length, 2), assign;
dest = Object(value(dest));
assign = function assign(key) {
try {
dest[key] = src[key];
} catch (e) {
if (!error) {
error = e;
}
}
};
for (i = 1; i < length; ++i) {
src = arguments[i];
keys(src).forEach(assign);
}
if (error !== void 0) {
throw error;
}
return dest;
};
});
var require_assign = __commonJS(function(exports, module) {
'use strict';
module.exports = require_is_implemented2()() ? Object.assign : require_shim3();
});
var require_is_object2 = __commonJS(function(exports, module) {
'use strict';
var isValue = require_is_value();
var map = {
function: true,
object: true
};
module.exports = function(value) {
return isValue(value) && map[_typeof(value)] || false;
};
});
var require_custom = __commonJS(function(exports, module) {
'use strict';
var assign = require_assign();
var isObject = require_is_object2();
var isValue = require_is_value();
var captureStackTrace = Error.captureStackTrace;
module.exports = function(message) {
var err2 = new Error(message), code = arguments[1], ext = arguments[2];
if (!isValue(ext)) {
if (isObject(code)) {
ext = code;
code = null;
}
}
if (isValue(ext)) {
assign(err2, ext);
}
if (isValue(code)) {
err2.code = code;
}
if (captureStackTrace) {
captureStackTrace(err2, module.exports);
}
return err2;
};
});
var require_mixin = __commonJS(function(exports, module) {
'use strict';
var value = require_valid_value();
var defineProperty = Object.defineProperty;
var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
var getOwnPropertyNames = Object.getOwnPropertyNames;
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
module.exports = function(target, source) {
var error, sourceObject = Object(value(source));
target = Object(value(target));
getOwnPropertyNames(sourceObject).forEach(function(name) {
try {
defineProperty(target, name, getOwnPropertyDescriptor(source, name));
} catch (e) {
error = e;
}
});
if (typeof getOwnPropertySymbols === 'function') {
getOwnPropertySymbols(sourceObject).forEach(function(symbol) {
try {
defineProperty(target, symbol, getOwnPropertyDescriptor(source, symbol));
} catch (e) {
error = e;
}
});
}
if (error !== void 0) {
throw error;
}
return target;
};
});
var require_define_length = __commonJS(function(exports, module) {
'use strict';
var toPosInt = require_to_pos_integer();
var test = function test(arg1, arg2) {
return arg2;
};
var desc;
var defineProperty;
var generate;
var mixin;
try {
Object.defineProperty(test, 'length', {
configurable: true,
writable: false,
enumerable: false,
value: 1
});
} catch (ignore) {}
if (test.length === 1) {
desc = {
configurable: true,
writable: false,
enumerable: false
};
defineProperty = Object.defineProperty;
module.exports = function(fn, length) {
length = toPosInt(length);
if (fn.length === length) {
return fn;
}
desc.value = length;
return defineProperty(fn, 'length', desc);
};
} else {
mixin = require_mixin();
generate = function() {
var cache2 = [];
return function(length) {
var args, i = 0;
if (cache2[length]) {
return cache2[length];
}
args = [];
while (length--) {
args.push('a' + (++i).toString(36));
}
return new Function('fn', 'return function (' + args.join(', ') + ') { return fn.apply(this, arguments); };');
};
}();
module.exports = function(src, length) {
var target;
length = toPosInt(length);
if (src.length === length) {
return src;
}
target = generate(length)(src);
try {
mixin(target, src);
} catch (ignore) {}
return target;
};
}
});
var require_is = __commonJS(function(exports, module) {
'use strict';
var _undefined = void 0;
module.exports = function(value) {
return value !== _undefined && value !== null;
};
});
var require_is2 = __commonJS(function(exports, module) {
'use strict';
var isValue = require_is();
var possibleTypes = {
object: true,
function: true,
undefined: true
};
module.exports = function(value) {
if (!isValue(value)) {
return false;
}
return hasOwnProperty.call(possibleTypes, _typeof(value));
};
});
var require_is3 = __commonJS(function(exports, module) {
'use strict';
var isObject = require_is2();
module.exports = function(value) {
if (!isObject(value)) {
return false;
}
try {
if (!value.constructor) {
return false;
}
return value.constructor.prototype === value;
} catch (error) {
return false;
}
};
});
var require_is4 = __commonJS(function(exports, module) {
'use strict';
var isPrototype = require_is3();
module.exports = function(value) {
if (typeof value !== 'function') {
return false;
}
if (!hasOwnProperty.call(value, 'length')) {
return false;
}
try {
if (typeof value.length !== 'number') {
return false;
}
if (typeof value.call !== 'function') {
return false;
}
if (typeof value.apply !== 'function') {
return false;
}
} catch (error) {
return false;
}
return !isPrototype(value);
};
});
var require_is5 = __commonJS(function(exports, module) {
'use strict';
var isFunction = require_is4();
var classRe = /^\s*class[\s{/}]/;
var functionToString = Function.prototype.toString;
module.exports = function(value) {
if (!isFunction(value)) {
return false;
}
if (classRe.test(functionToString.call(value))) {
return false;
}
return true;
};
});
var require_is_implemented4 = __commonJS(function(exports, module) {
'use strict';
var str = 'razdwatrzy';
module.exports = function() {
if (typeof str.contains !== 'function') {
return false;
}
return str.contains('dwa') === true && str.contains('foo') === false;
};
});
var require_shim4 = __commonJS(function(exports, module) {
'use strict';
var indexOf = String.prototype.indexOf;
module.exports = function(searchString) {
return indexOf.call(this, searchString, arguments[1]) > -1;
};
});
var require_contains = __commonJS(function(exports, module) {
'use strict';
module.exports = require_is_implemented4()() ? String.prototype.contains : require_shim4();
});
var require_d = __commonJS(function(exports, module) {
'use strict';
var isValue = require_is();
var isPlainFunction = require_is5();
var assign = require_assign();
var normalizeOpts = require_normalize_options();
var contains3 = require_contains();
var d2 = module.exports = function(dscr, value) {
var c4, e, w, options, desc;
if (arguments.length < 2 || typeof dscr !== 'string') {
options = value;
value = dscr;
dscr = null;
} else {
options = arguments[2];
}
if (isValue(dscr)) {
c4 = contains3.call(dscr, 'c');
e = contains3.call(dscr, 'e');
w = contains3.call(dscr, 'w');
} else {
c4 = w = true;
e = false;
}
desc = {
value: value,
configurable: c4,
enumerable: e,
writable: w
};
return !options ? desc : assign(normalizeOpts(options), desc);
};
d2.gs = function(dscr, get2, set2) {
var c4, e, options, desc;
if (typeof dscr !== 'string') {
options = set2;
set2 = get2;
get2 = dscr;
dscr = null;
} else {
options = arguments[3];
}
if (!isValue(get2)) {
get2 = void 0;
} else if (!isPlainFunction(get2)) {
options = get2;
get2 = set2 = void 0;
} else if (!isValue(set2)) {
set2 = void 0;
} else if (!isPlainFunction(set2)) {
options = set2;
set2 = void 0;
}
if (isValue(dscr)) {
c4 = contains3.call(dscr, 'c');
e = contains3.call(dscr, 'e');
} else {
c4 = true;
e = false;
}
desc = {
get: get2,
set: set2,
configurable: c4,
enumerable: e
};
return !options ? desc : assign(normalizeOpts(options), desc);
};
});
var require_event_emitter = __commonJS(function(exports, module) {
'use strict';
var d2 = require_d();
var callable = require_valid_callable();
var apply = Function.prototype.apply;
var call = Function.prototype.call;
var create = Object.create;
var defineProperty = Object.defineProperty;
var defineProperties = Object.defineProperties;
var hasOwnProperty2 = Object.prototype.hasOwnProperty;
var descriptor = {
configurable: true,
enumerable: false,
writable: true
};
var on;
var once;
var off;
var emit;
var methods;
var descriptors;
var base;
on = function on(type2, listener) {
var data;
callable(listener);
if (!hasOwnProperty2.call(this, '__ee__')) {
data = descriptor.value = create(null);
defineProperty(this, '__ee__', descriptor);
descriptor.value = null;
} else {
data = this.__ee__;
}
if (!data[type2]) {
data[type2] = listener;
} else if (_typeof(data[type2]) === 'object') {
data[type2].push(listener);
} else {
data[type2] = [ data[type2], listener ];
}
return this;
};
once = function once(type2, listener) {
var _once, self2;
callable(listener);
self2 = this;
on.call(this, type2, _once = function once2() {
off.call(self2, type2, _once);
apply.call(listener, this, arguments);
});
_once.__eeOnceListener__ = listener;
return this;
};
off = function off(type2, listener) {
var data, listeners, candidate, i;
callable(listener);
if (!hasOwnProperty2.call(this, '__ee__')) {
return this;
}
data = this.__ee__;
if (!data[type2]) {
return this;
}
listeners = data[type2];
if (_typeof(listeners) === 'object') {
for (i = 0; candidate = listeners[i]; ++i) {
if (candidate === listener || candidate.__eeOnceListener__ === listener) {
if (listeners.length === 2) {
data[type2] = listeners[i ? 0 : 1];
} else {
listeners.splice(i, 1);
}
}
}
} else {
if (listeners === listener || listeners.__eeOnceListener__ === listener) {
delete data[type2];
}
}
return this;
};
emit = function emit(type2) {
var i, l, listener, listeners, args;
if (!hasOwnProperty2.call(this, '__ee__')) {
return;
}
listeners = this.__ee__[type2];
if (!listeners) {
return;
}
if (_typeof(listeners) === 'object') {
l = arguments.length;
args = new Array(l - 1);
for (i = 1; i < l; ++i) {
args[i - 1] = arguments[i];
}
listeners = listeners.slice();
for (i = 0; listener = listeners[i]; ++i) {
apply.call(listener, this, args);
}
} else {
switch (arguments.length) {
case 1:
call.call(listeners, this);
break;
case 2:
call.call(listeners, this, arguments[1]);
break;
case 3:
call.call(listeners, this, arguments[1], arguments[2]);
break;
default:
l = arguments.length;
args = new Array(l - 1);
for (i = 1; i < l; ++i) {
args[i - 1] = arguments[i];
}
apply.call(listeners, this, args);
}
}
};
methods = {
on: on,
once: once,
off: off,
emit: emit
};
descriptors = {
on: d2(on),
once: d2(once),
off: d2(off),
emit: d2(emit)
};
base = defineProperties({}, descriptors);
module.exports = exports = function exports(o) {
return o == null ? create(base) : defineProperties(Object(o), descriptors);
};
exports.methods = methods;
});
var require_is_implemented5 = __commonJS(function(exports, module) {
'use strict';
module.exports = function() {
var from = Array.from, arr, result;
if (typeof from !== 'function') {
return false;
}
arr = [ 'raz', 'dwa' ];
result = from(arr);
return Boolean(result && result !== arr && result[1] === 'dwa');
};
});
var require_is_implemented6 = __commonJS(function(exports, module) {
'use strict';
module.exports = function() {
if ((typeof globalThis === 'undefined' ? 'undefined' : _typeof(globalThis)) !== 'object') {
return false;
}
if (!globalThis) {
return false;
}
return globalThis.Array === Array;
};
});
var require_implementation = __commonJS(function(exports, module) {
var naiveFallback = function naiveFallback() {
if ((typeof self === 'undefined' ? 'undefined' : _typeof(self)) === 'object' && self) {
return self;
}
if ((typeof window === 'undefined' ? 'undefined' : _typeof(window)) === 'object' && window) {
return window;
}
throw new Error('Unable to resolve global `this`');
};
module.exports = function() {
if (this) {
return this;
}
try {
Object.defineProperty(Object.prototype, '__global__', {
get: function get() {
return this;
},
configurable: true
});
} catch (error) {
return naiveFallback();
}
try {
if (!__global__) {
return naiveFallback();
}
return __global__;
} finally {
delete Object.prototype.__global__;
}
}();
});
var require_global_this2 = __commonJS(function(exports, module) {
'use strict';
module.exports = require_is_implemented6()() ? globalThis : require_implementation();
});
var require_is_implemented7 = __commonJS(function(exports, module) {
'use strict';
var global2 = require_global_this2();
var validTypes = {
object: true,
symbol: true
};
module.exports = function() {
var Symbol2 = global2.Symbol;
var symbol;
if (typeof Symbol2 !== 'function') {
return false;
}
symbol = Symbol2('test symbol');
try {
String(symbol);
} catch (e) {
return false;
}
if (!validTypes[_typeof(Symbol2.iterator)]) {
return false;
}
if (!validTypes[_typeof(Symbol2.toPrimitive)]) {
return false;
}
if (!validTypes[_typeof(Symbol2.toStringTag)]) {
return false;
}
return true;
};
});
var require_is_symbol2 = __commonJS(function(exports, module) {
'use strict';
module.exports = function(value) {
if (!value) {
return false;
}
if (_typeof(value) === 'symbol') {
return true;
}
if (!value.constructor) {
return false;
}
if (value.constructor.name !== 'Symbol') {
return false;
}
return value[value.constructor.toStringTag] === 'Symbol';
};
});
var require_validate_symbol = __commonJS(function(exports, module) {
'use strict';
var isSymbol = require_is_symbol2();
module.exports = function(value) {
if (!isSymbol(value)) {
throw new TypeError(value + ' is not a symbol');
}
return value;
};
});
var require_generate_name = __commonJS(function(exports, module) {
'use strict';
var d2 = require_d();
var create = Object.create;
var defineProperty = Object.defineProperty;
var objPrototype = Object.prototype;
var created = create(null);
module.exports = function(desc) {
var postfix = 0, name, ie11BugWorkaround;
while (created[desc + (postfix || '')]) {
++postfix;
}
desc += postfix || '';
created[desc] = true;
name = '@@' + desc;
defineProperty(objPrototype, name, d2.gs(null, function(value) {
if (ie11BugWorkaround) {
return;
}
ie11BugWorkaround = true;
defineProperty(this, name, d2(value));
ie11BugWorkaround = false;
}));
return name;
};
});
var require_standard_symbols = __commonJS(function(exports, module) {
'use strict';
var d2 = require_d();
var NativeSymbol = require_global_this2().Symbol;
module.exports = function(SymbolPolyfill) {
return Object.defineProperties(SymbolPolyfill, {
hasInstance: d2('', NativeSymbol && NativeSymbol.hasInstance || SymbolPolyfill('hasInstance')),
isConcatSpreadable: d2('', NativeSymbol && NativeSymbol.isConcatSpreadable || SymbolPolyfill('isConcatSpreadable')),
iterator: d2('', NativeSymbol && NativeSymbol.iterator || SymbolPolyfill('iterator')),
match: d2('', NativeSymbol && NativeSymbol.match || SymbolPolyfill('match')),
replace: d2('', NativeSymbol && NativeSymbol.replace || SymbolPolyfill('replace')),
search: d2('', NativeSymbol && NativeSymbol.search || SymbolPolyfill('search')),
species: d2('', NativeSymbol && NativeSymbol.species || SymbolPolyfill('species')),
split: d2('', NativeSymbol && NativeSymbol.split || SymbolPolyfill('split')),
toPrimitive: d2('', NativeSymbol && NativeSymbol.toPrimitive || SymbolPolyfill('toPrimitive')),
toStringTag: d2('', NativeSymbol && NativeSymbol.toStringTag || SymbolPolyfill('toStringTag')),
unscopables: d2('', NativeSymbol && NativeSymbol.unscopables || SymbolPolyfill('unscopables'))
});
};
});
var require_symbol_registry = __commonJS(function(exports, module) {
'use strict';
var d2 = require_d();
var validateSymbol = require_validate_symbol();
var registry = Object.create(null);
module.exports = function(SymbolPolyfill) {
return Object.defineProperties(SymbolPolyfill, {
for: d2(function(key) {
if (registry[key]) {
return registry[key];
}
return registry[key] = SymbolPolyfill(String(key));
}),
keyFor: d2(function(symbol) {
var key;
validateSymbol(symbol);
for (key in registry) {
if (registry[key] === symbol) {
return key;
}
}
return void 0;
})
});
};
});
var require_polyfill = __commonJS(function(exports, module) {
'use strict';
var d2 = require_d();
var validateSymbol = require_validate_symbol();
var NativeSymbol = require_global_this2().Symbol;
var generateName = require_generate_name();
var setupStandardSymbols = require_standard_symbols();
var setupSymbolRegistry = require_symbol_registry();
var create = Object.create;
var defineProperties = Object.defineProperties;
var defineProperty = Object.defineProperty;
var SymbolPolyfill;
var HiddenSymbol;
var isNativeSafe;
if (typeof NativeSymbol === 'function') {
try {
String(NativeSymbol());
isNativeSafe = true;
} catch (ignore) {}
} else {
NativeSymbol = null;
}
HiddenSymbol = function Symbol2(description) {
if (this instanceof HiddenSymbol) {
throw new TypeError('Symbol is not a constructor');
}
return SymbolPolyfill(description);
};
module.exports = SymbolPolyfill = function Symbol2(description) {
var symbol;
if (this instanceof Symbol2) {
throw new TypeError('Symbol is not a constructor');
}
if (isNativeSafe) {
return NativeSymbol(description);
}
symbol = create(HiddenSymbol.prototype);
description = description === void 0 ? '' : String(description);
return defineProperties(symbol, {
__description__: d2('', description),
__name__: d2('', generateName(description))
});
};
setupStandardSymbols(SymbolPolyfill);
setupSymbolRegistry(SymbolPolyfill);
defineProperties(HiddenSymbol.prototype, {
constructor: d2(SymbolPolyfill),
toString: d2('', function() {
return this.__name__;
})
});
defineProperties(SymbolPolyfill.prototype, {
toString: d2(function() {
return 'Symbol (' + validateSymbol(this).__description__ + ')';
}),
valueOf: d2(function() {
return validateSymbol(this);
})
});
defineProperty(SymbolPolyfill.prototype, SymbolPolyfill.toPrimitive, d2('', function() {
var symbol = validateSymbol(this);
if (_typeof(symbol) === 'symbol') {
return symbol;
}
return symbol.toString();
}));
defineProperty(SymbolPolyfill.prototype, SymbolPolyfill.toStringTag, d2('c', 'Symbol'));
defineProperty(HiddenSymbol.prototype, SymbolPolyfill.toStringTag, d2('c', SymbolPolyfill.prototype[SymbolPolyfill.toStringTag]));
defineProperty(HiddenSymbol.prototype, SymbolPolyfill.toPrimitive, d2('c', SymbolPolyfill.prototype[SymbolPolyfill.toPrimitive]));
});
var require_es6_symbol = __commonJS(function(exports, module) {
'use strict';
module.exports = require_is_implemented7()() ? require_global_this2().Symbol : require_polyfill();
});
var require_is_arguments = __commonJS(function(exports, module) {
'use strict';
var objToString = Object.prototype.toString;
var id = objToString.call(function() {
return arguments;
}());
module.exports = function(value) {
return objToString.call(value) === id;
};
});
var require_is_function = __commonJS(function(exports, module) {
'use strict';
var objToString = Object.prototype.toString;
var isFunctionStringTag = RegExp.prototype.test.bind(/^[object [A-Za-z0-9]*Function]$/);
module.exports = function(value) {
return typeof value === 'function' && isFunctionStringTag(objToString.call(value));
};
});
var require_is_string = __commonJS(function(exports, module) {
'use strict';
var objToString = Object.prototype.toString;
var id = objToString.call('');
module.exports = function(value) {
return typeof value === 'string' || value && _typeof(value) === 'object' && (value instanceof String || objToString.call(value) === id) || false;
};
});
var require_shim5 = __commonJS(function(exports, module) {
'use strict';
var iteratorSymbol = require_es6_symbol().iterator;
var isArguments = require_is_arguments();
var isFunction = require_is_function();
var toPosInt = require_to_pos_integer();
var callable = require_valid_callable();
var validValue = require_valid_value();
var isValue = require_is_value();
var isString2 = require_is_string();
var isArray = Array.isArray;
var call = Function.prototype.call;
var desc = {
configurable: true,
enumerable: true,
writable: true,
value: null
};
var defineProperty = Object.defineProperty;
module.exports = function(arrayLike) {
var mapFn = arguments[1], thisArg = arguments[2], Context2, i, j, arr, length, code, iterator, result, getIterator, value;
arrayLike = Object(validValue(arrayLike));
if (isValue(mapFn)) {
callable(mapFn);
}
if (!this || this === Array || !isFunction(this)) {
if (!mapFn) {
if (isArguments(arrayLike)) {
length = arrayLike.length;
if (length !== 1) {
return Array.apply(null, arrayLike);
}
arr = new Array(1);
arr[0] = arrayLike[0];
return arr;
}
if (isArray(arrayLike)) {
arr = new Array(length = arrayLike.length);
for (i = 0; i < length; ++i) {
arr[i] = arrayLike[i];
}
return arr;
}
}
arr = [];
} else {
Context2 = this;
}
if (!isArray(arrayLike)) {
if ((getIterator = arrayLike[iteratorSymbol]) !== void 0) {
iterator = callable(getIterator).call(arrayLike);
if (Context2) {
arr = new Context2();
}
result = iterator.next();
i = 0;
while (!result.done) {
value = mapFn ? call.call(mapFn, thisArg, result.value, i) : result.value;
if (Context2) {
desc.value = value;
defineProperty(arr, i, desc);
} else {
arr[i] = value;
}
result = iterator.next();
++i;
}
length = i;
} else if (isString2(arrayLike)) {
length = arrayLike.length;
if (Context2) {
arr = new Context2();
}
for (i = 0, j = 0; i < length; ++i) {
value = arrayLike[i];
if (i + 1 < length) {
code = value.charCodeAt(0);
if (code >= 55296 && code <= 56319) {
value += arrayLike[++i];
}
}
value = mapFn ? call.call(mapFn, thisArg, value, j) : value;
if (Context2) {
desc.value = value;
defineProperty(arr, j, desc);
} else {
arr[j] = value;
}
++j;
}
length = j;
}
}
if (length === void 0) {
length = toPosInt(arrayLike.length);
if (Context2) {
arr = new Context2(length);
}
for (i = 0; i < length; ++i) {
value = mapFn ? call.call(mapFn, thisArg, arrayLike[i], i) : arrayLike[i];
if (Context2) {
desc.value = value;
defineProperty(arr, i, desc);
} else {
arr[i] = value;
}
}
}
if (Context2) {
desc.value = null;
arr.length = length;
}
return arr;
};
});
var require_from4 = __commonJS(function(exports, module) {
'use strict';
module.exports = require_is_implemented5()() ? Array.from : require_shim5();
});
var require_to_array = __commonJS(function(exports, module) {
'use strict';
var from = require_from4();
var isArray = Array.isArray;
module.exports = function(arrayLike) {
return isArray(arrayLike) ? arrayLike : from(arrayLike);
};
});
var require_resolve_resolve = __commonJS(function(exports, module) {
'use strict';
var toArray2 = require_to_array();
var isValue = require_is_value();
var callable = require_valid_callable();
var slice = Array.prototype.slice;
var resolveArgs;
resolveArgs = function resolveArgs(args) {
return this.map(function(resolve, i) {
return resolve ? resolve(args[i]) : args[i];
}).concat(slice.call(args, this.length));
};
module.exports = function(resolvers) {
resolvers = toArray2(resolvers);
resolvers.forEach(function(resolve) {
if (isValue(resolve)) {
callable(resolve);
}
});
return resolveArgs.bind(resolvers);
};
});
var require_resolve_normalize = __commonJS(function(exports, module) {
'use strict';
var callable = require_valid_callable();
module.exports = function(userNormalizer) {
var normalizer;
if (typeof userNormalizer === 'function') {
return {
set: userNormalizer,
get: userNormalizer
};
}
normalizer = {
get: callable(userNormalizer.get)
};
if (userNormalizer.set !== void 0) {
normalizer.set = callable(userNormalizer.set);
if (userNormalizer['delete']) {
normalizer['delete'] = callable(userNormalizer['delete']);
}
if (userNormalizer.clear) {
normalizer.clear = callable(userNormalizer.clear);
}
return normalizer;
}
normalizer.set = normalizer.get;
return normalizer;
};
});
var require_configure_map = __commonJS(function(exports, module) {
'use strict';
var customError = require_custom();
var defineLength = require_define_length();
var d2 = require_d();
var ee = require_event_emitter().methods;
var resolveResolve = require_resolve_resolve();
var resolveNormalize = require_resolve_normalize();
var apply = Function.prototype.apply;
var call = Function.prototype.call;
var create = Object.create;
var defineProperties = Object.defineProperties;
var _on = ee.on;
var emit = ee.emit;
module.exports = function(original, length, options) {
var cache2 = create(null), conf, memLength, get2, set2, del, _clear, extDel, extGet, extHas, normalizer, getListeners, setListeners, deleteListeners, memoized, resolve;
if (length !== false) {
memLength = length;
} else if (isNaN(original.length)) {
memLength = 1;
} else {
memLength = original.length;
}
if (options.normalizer) {
normalizer = resolveNormalize(options.normalizer);
get2 = normalizer.get;
set2 = normalizer.set;
del = normalizer['delete'];
_clear = normalizer.clear;
}
if (options.resolvers != null) {
resolve = resolveResolve(options.resolvers);
}
if (get2) {
memoized = defineLength(function(arg) {
var id, result, args = arguments;
if (resolve) {
args = resolve(args);
}
id = get2(args);
if (id !== null) {
if (hasOwnProperty.call(cache2, id)) {
if (getListeners) {
conf.emit('get', id, args, this);
}
return cache2[id];
}
}
if (args.length === 1) {
result = call.call(original, this, args[0]);
} else {
result = apply.call(original, this, args);
}
if (id === null) {
id = get2(args);
if (id !== null) {
throw customError('Circular invocation', 'CIRCULAR_INVOCATION');
}
id = set2(args);
} else if (hasOwnProperty.call(cache2, id)) {
throw customError('Circular invocation', 'CIRCULAR_INVOCATION');
}
cache2[id] = result;
if (setListeners) {
conf.emit('set', id, null, result);
}
return result;
}, memLength);
} else if (length === 0) {
memoized = function memoized() {
var result;
if (hasOwnProperty.call(cache2, 'data')) {
if (getListeners) {
conf.emit('get', 'data', arguments, this);
}
return cache2.data;
}
if (arguments.length) {
result = apply.call(original, this, arguments);
} else {
result = call.call(original, this);
}
if (hasOwnProperty.call(cache2, 'data')) {
throw customError('Circular invocation', 'CIRCULAR_INVOCATION');
}
cache2.data = result;
if (setListeners) {
conf.emit('set', 'data', null, result);
}
return result;
};
} else {
memoized = function memoized(arg) {
var result, args = arguments, id;
if (resolve) {
args = resolve(arguments);
}
id = String(args[0]);
if (hasOwnProperty.call(cache2, id)) {
if (getListeners) {
conf.emit('get', id, args, this);
}
return cache2[id];
}
if (args.length === 1) {
result = call.call(original, this, args[0]);
} else {
result = apply.call(original, this, args);
}
if (hasOwnProperty.call(cache2, id)) {
throw customError('Circular invocation', 'CIRCULAR_INVOCATION');
}
cache2[id] = result;
if (setListeners) {
conf.emit('set', id, null, result);
}
return result;
};
}
conf = {
original: original,
memoized: memoized,
profileName: options.profileName,
get: function get(args) {
if (resolve) {
args = resolve(args);
}
if (get2) {
return get2(args);
}
return String(args[0]);
},
has: function has(id) {
return hasOwnProperty.call(cache2, id);
},
delete: function _delete(id) {
var result;
if (!hasOwnProperty.call(cache2, id)) {
return;
}
if (del) {
del(id);
}
result = cache2[id];
delete cache2[id];
if (deleteListeners) {
conf.emit('delete', id, result);
}
},
clear: function clear() {
var oldCache = cache2;
if (_clear) {
_clear();
}
cache2 = create(null);
conf.emit('clear', oldCache);
},
on: function on(type2, listener) {
if (type2 === 'get') {
getListeners = true;
} else if (type2 === 'set') {
setListeners = true;
} else if (type2 === 'delete') {
deleteListeners = true;
}
return _on.call(this, type2, listener);
},
emit: emit,
updateEnv: function updateEnv() {
original = conf.original;
}
};
if (get2) {
extDel = defineLength(function(arg) {
var id, args = arguments;
if (resolve) {
args = resolve(args);
}
id = get2(args);
if (id === null) {
return;
}
conf['delete'](id);
}, memLength);
} else if (length === 0) {
extDel = function extDel() {
return conf['delete']('data');
};
} else {
extDel = function extDel(arg) {
if (resolve) {
arg = resolve(arguments)[0];
}
return conf['delete'](arg);
};
}
extGet = defineLength(function() {
var id, args = arguments;
if (length === 0) {
return cache2.data;
}
if (resolve) {
args = resolve(args);
}
if (get2) {
id = get2(args);
} else {
id = String(args[0]);
}
return cache2[id];
});
extHas = defineLength(function() {
var id, args = arguments;
if (length === 0) {
return conf.has('data');
}
if (resolve) {
args = resolve(args);
}
if (get2) {
id = get2(args);
} else {
id = String(args[0]);
}
if (id === null) {
return false;
}
return conf.has(id);
});
defineProperties(memoized, {
__memoized__: d2(true),
delete: d2(extDel),
clear: d2(conf.clear),
_get: d2(extGet),
_has: d2(extHas)
});
return conf;
};
});
var require_plain = __commonJS(function(exports, module) {
'use strict';
var callable = require_valid_callable();
var forEach = require_for_each();
var extensions = require_registered_extensions();
var configure4 = require_configure_map();
var resolveLength = require_resolve_length();
module.exports = function self2(fn) {
var options, length, conf;
callable(fn);
options = Object(arguments[1]);
if (options.async && options.promise) {
throw new Error('Options \'async\' and \'promise\' cannot be used together');
}
if (hasOwnProperty.call(fn, '__memoized__') && !options.force) {
return fn;
}
length = resolveLength(options.length, fn.length, options.async && extensions.async);
conf = configure4(fn, length, options);
forEach(extensions, function(extFn, name) {
if (options[name]) {
extFn(options[name], conf, options);
}
});
if (self2.__profiler__) {
self2.__profiler__(conf);
}
conf.updateEnv();
return conf.memoized;
};
});
var require_primitive = __commonJS(function(exports, module) {
'use strict';
module.exports = function(args) {
var id, i, length = args.length;
if (!length) {
return '\x02';
}
id = String(args[i = 0]);
while (--length) {
id += '\x01' + args[++i];
}
return id;
};
});
var require_get_primitive_fixed = __commonJS(function(exports, module) {
'use strict';
module.exports = function(length) {
if (!length) {
return function() {
return '';
};
}
return function(args) {
var id = String(args[0]), i = 0, currentLength = length;
while (--currentLength) {
id += '\x01' + args[++i];
}
return id;
};
};
});
var require_is_implemented8 = __commonJS(function(exports, module) {
'use strict';
module.exports = function() {
var numberIsNaN = Number.isNaN;
if (typeof numberIsNaN !== 'function') {
return false;
}
return !numberIsNaN({}) && numberIsNaN(NaN) && !numberIsNaN(34);
};
});
var require_shim6 = __commonJS(function(exports, module) {
'use strict';
module.exports = function(value) {
return value !== value;
};
});
var require_is_nan = __commonJS(function(exports, module) {
'use strict';
module.exports = require_is_implemented8()() ? Number.isNaN : require_shim6();
});
var require_e_index_of = __commonJS(function(exports, module) {
'use strict';
var numberIsNaN = require_is_nan();
var toPosInt = require_to_pos_integer();
var value = require_valid_value();
var indexOf = Array.prototype.indexOf;
var objHasOwnProperty = Object.prototype.hasOwnProperty;
var abs2 = Math.abs;
var floor = Math.floor;
module.exports = function(searchElement) {
var i, length, fromIndex, val;
if (!numberIsNaN(searchElement)) {
return indexOf.apply(this, arguments);
}
length = toPosInt(value(this).length);
fromIndex = arguments[1];
if (isNaN(fromIndex)) {
fromIndex = 0;
} else if (fromIndex >= 0) {
fromIndex = floor(fromIndex);
} else {
fromIndex = toPosInt(this.length) - floor(abs2(fromIndex));
}
for (i = fromIndex; i < length; ++i) {
if (objHasOwnProperty.call(this, i)) {
val = this[i];
if (numberIsNaN(val)) {
return i;
}
}
}
return -1;
};
});
var require_get = __commonJS(function(exports, module) {
'use strict';
var indexOf = require_e_index_of();
var create = Object.create;
module.exports = function() {
var lastId = 0, map = [], cache2 = create(null);
return {
get: function get(args) {
var index = 0, set2 = map, i, length = args.length;
if (length === 0) {
return set2[length] || null;
}
if (set2 = set2[length]) {
while (index < length - 1) {
i = indexOf.call(set2[0], args[index]);
if (i === -1) {
return null;
}
set2 = set2[1][i];
++index;
}
i = indexOf.call(set2[0], args[index]);
if (i === -1) {
return null;
}
return set2[1][i] || null;
}
return null;
},
set: function set(args) {
var index = 0, set2 = map, i, length = args.length;
if (length === 0) {
set2[length] = ++lastId;
} else {
if (!set2[length]) {
set2[length] = [ [], [] ];
}
set2 = set2[length];
while (index < length - 1) {
i = indexOf.call(set2[0], args[index]);
if (i === -1) {
i = set2[0].push(args[index]) - 1;
set2[1].push([ [], [] ]);
}
set2 = set2[1][i];
++index;
}
i = indexOf.call(set2[0], args[index]);
if (i === -1) {
i = set2[0].push(args[index]) - 1;
}
set2[1][i] = ++lastId;
}
cache2[lastId] = args;
return lastId;
},
delete: function _delete(id) {
var index = 0, set2 = map, i, args = cache2[id], length = args.length, path = [];
if (length === 0) {
delete set2[length];
} else if (set2 = set2[length]) {
while (index < length - 1) {
i = indexOf.call(set2[0], args[index]);
if (i === -1) {
return;
}
path.push(set2, i);
set2 = set2[1][i];
++index;
}
i = indexOf.call(set2[0], args[index]);
if (i === -1) {
return;
}
id = set2[1][i];
set2[0].splice(i, 1);
set2[1].splice(i, 1);
while (!set2[0].length && path.length) {
i = path.pop();
set2 = path.pop();
set2[0].splice(i, 1);
set2[1].splice(i, 1);
}
}
delete cache2[id];
},
clear: function clear() {
map = [];
cache2 = create(null);
}
};
};
});
var require_get_1 = __commonJS(function(exports, module) {
'use strict';
var indexOf = require_e_index_of();
module.exports = function() {
var lastId = 0, argsMap = [], cache2 = [];
return {
get: function get(args) {
var index = indexOf.call(argsMap, args[0]);
return index === -1 ? null : cache2[index];
},
set: function set(args) {
argsMap.push(args[0]);
cache2.push(++lastId);
return lastId;
},
delete: function _delete(id) {
var index = indexOf.call(cache2, id);
if (index !== -1) {
argsMap.splice(index, 1);
cache2.splice(index, 1);
}
},
clear: function clear() {
argsMap = [];
cache2 = [];
}
};
};
});
var require_get_fixed = __commonJS(function(exports, module) {
'use strict';
var indexOf = require_e_index_of();
var create = Object.create;
module.exports = function(length) {
var lastId = 0, map = [ [], [] ], cache2 = create(null);
return {
get: function get(args) {
var index = 0, set2 = map, i;
while (index < length - 1) {
i = indexOf.call(set2[0], args[index]);
if (i === -1) {
return null;
}
set2 = set2[1][i];
++index;
}
i = indexOf.call(set2[0], args[index]);
if (i === -1) {
return null;
}
return set2[1][i] || null;
},
set: function set(args) {
var index = 0, set2 = map, i;
while (index < length - 1) {
i = indexOf.call(set2[0], args[index]);
if (i === -1) {
i = set2[0].push(args[index]) - 1;
set2[1].push([ [], [] ]);
}
set2 = set2[1][i];
++index;
}
i = indexOf.call(set2[0], args[index]);
if (i === -1) {
i = set2[0].push(args[index]) - 1;
}
set2[1][i] = ++lastId;
cache2[lastId] = args;
return lastId;
},
delete: function _delete(id) {
var index = 0, set2 = map, i, path = [], args = cache2[id];
while (index < length - 1) {
i = indexOf.call(set2[0], args[index]);
if (i === -1) {
return;
}
path.push(set2, i);
set2 = set2[1][i];
++index;
}
i = indexOf.call(set2[0], args[index]);
if (i === -1) {
return;
}
id = set2[1][i];
set2[0].splice(i, 1);
set2[1].splice(i, 1);
while (!set2[0].length && path.length) {
i = path.pop();
set2 = path.pop();
set2[0].splice(i, 1);
set2[1].splice(i, 1);
}
delete cache2[id];
},
clear: function clear() {
map = [ [], [] ];
cache2 = create(null);
}
};
};
});
var require_map = __commonJS(function(exports, module) {
'use strict';
var callable = require_valid_callable();
var forEach = require_for_each();
var call = Function.prototype.call;
module.exports = function(obj, cb) {
var result = {}, thisArg = arguments[2];
callable(cb);
forEach(obj, function(value, key, targetObj, index) {
result[key] = call.call(cb, thisArg, value, key, targetObj, index);
});
return result;
};
});
var require_next_tick = __commonJS(function(exports, module) {
'use strict';
var ensureCallable = function ensureCallable(fn) {
if (typeof fn !== 'function') {
throw new TypeError(fn + ' is not a function');
}
return fn;
};
var byObserver = function byObserver(Observer) {
var node = document.createTextNode(''), queue2, currentQueue, i = 0;
new Observer(function() {
var callback;
if (!queue2) {
if (!currentQueue) {
return;
}
queue2 = currentQueue;
} else if (currentQueue) {
queue2 = currentQueue.concat(queue2);
}
currentQueue = queue2;
queue2 = null;
if (typeof currentQueue === 'function') {
callback = currentQueue;
currentQueue = null;
callback();
return;
}
node.data = i = ++i % 2;
while (currentQueue) {
callback = currentQueue.shift();
if (!currentQueue.length) {
currentQueue = null;
}
callback();
}
}).observe(node, {
characterData: true
});
return function(fn) {
ensureCallable(fn);
if (queue2) {
if (typeof queue2 === 'function') {
queue2 = [ queue2, fn ];
} else {
queue2.push(fn);
}
return;
}
queue2 = fn;
node.data = i = ++i % 2;
};
};
module.exports = function() {
if ((typeof process === 'undefined' ? 'undefined' : _typeof(process)) === 'object' && process && typeof process.nextTick === 'function') {
return process.nextTick;
}
if (typeof queueMicrotask === 'function') {
return function(cb) {
queueMicrotask(ensureCallable(cb));
};
}
if ((typeof document === 'undefined' ? 'undefined' : _typeof(document)) === 'object' && document) {
if (typeof MutationObserver === 'function') {
return byObserver(MutationObserver);
}
if (typeof WebKitMutationObserver === 'function') {
return byObserver(WebKitMutationObserver);
}
}
if (typeof setImmediate === 'function') {
return function(cb) {
setImmediate(ensureCallable(cb));
};
}
if (typeof setTimeout === 'function' || (typeof setTimeout === 'undefined' ? 'undefined' : _typeof(setTimeout)) === 'object') {
return function(cb) {
setTimeout(ensureCallable(cb), 0);
};
}
return null;
}();
});
var require_async = __commonJS(function() {
'use strict';
var aFrom = require_from4();
var objectMap = require_map();
var mixin = require_mixin();
var defineLength = require_define_length();
var nextTick = require_next_tick();
var slice = Array.prototype.slice;
var apply = Function.prototype.apply;
var create = Object.create;
require_registered_extensions().async = function(tbi, conf) {
var waiting = create(null), cache2 = create(null), base = conf.memoized, original = conf.original, currentCallback, currentContext, currentArgs;
conf.memoized = defineLength(function(arg) {
var args = arguments, last = args[args.length - 1];
if (typeof last === 'function') {
currentCallback = last;
args = slice.call(args, 0, -1);
}
return base.apply(currentContext = this, currentArgs = args);
}, base);
try {
mixin(conf.memoized, base);
} catch (ignore) {}
conf.on('get', function(id) {
var cb, context, args;
if (!currentCallback) {
return;
}
if (waiting[id]) {
if (typeof waiting[id] === 'function') {
waiting[id] = [ waiting[id], currentCallback ];
} else {
waiting[id].push(currentCallback);
}
currentCallback = null;
return;
}
cb = currentCallback;
context = currentContext;
args = currentArgs;
currentCallback = currentContext = currentArgs = null;
nextTick(function() {
var data;
if (hasOwnProperty.call(cache2, id)) {
data = cache2[id];
conf.emit('getasync', id, args, context);
apply.call(cb, data.context, data.args);
} else {
currentCallback = cb;
currentContext = context;
currentArgs = args;
base.apply(context, args);
}
});
});
conf.original = function() {
var args, cb, origCb, result;
if (!currentCallback) {
return apply.call(original, this, arguments);
}
args = aFrom(arguments);
cb = function self2(err2) {
var cb2, args2, id = self2.id;
if (id == null) {
nextTick(apply.bind(self2, this, arguments));
return void 0;
}
delete self2.id;
cb2 = waiting[id];
delete waiting[id];
if (!cb2) {
return void 0;
}
args2 = aFrom(arguments);
if (conf.has(id)) {
if (err2) {
conf['delete'](id);
} else {
cache2[id] = {
context: this,
args: args2
};
conf.emit('setasync', id, typeof cb2 === 'function' ? 1 : cb2.length);
}
}
if (typeof cb2 === 'function') {
result = apply.call(cb2, this, args2);
} else {
cb2.forEach(function(cb3) {
result = apply.call(cb3, this, args2);
}, this);
}
return result;
};
origCb = currentCallback;
currentCallback = currentContext = currentArgs = null;
args.push(cb);
result = apply.call(original, this, args);
cb.cb = origCb;
currentCallback = cb;
return result;
};
conf.on('set', function(id) {
if (!currentCallback) {
conf['delete'](id);
return;
}
if (waiting[id]) {
if (typeof waiting[id] === 'function') {
waiting[id] = [ waiting[id], currentCallback.cb ];
} else {
waiting[id].push(currentCallback.cb);
}
} else {
waiting[id] = currentCallback.cb;
}
delete currentCallback.cb;
currentCallback.id = id;
currentCallback = null;
});
conf.on('delete', function(id) {
var result;
if (hasOwnProperty.call(waiting, id)) {
return;
}
if (!cache2[id]) {
return;
}
result = cache2[id];
delete cache2[id];
conf.emit('deleteasync', id, slice.call(result.args, 1));
});
conf.on('clear', function() {
var oldCache = cache2;
cache2 = create(null);
conf.emit('clearasync', objectMap(oldCache, function(data) {
return slice.call(data.args, 1);
}));
});
};
});
var require_primitive_set = __commonJS(function(exports, module) {
'use strict';
var forEach = Array.prototype.forEach;
var create = Object.create;
module.exports = function(arg) {
var set2 = create(null);
forEach.call(arguments, function(name) {
set2[name] = true;
});
return set2;
};
});
var require_is_callable2 = __commonJS(function(exports, module) {
'use strict';
module.exports = function(obj) {
return typeof obj === 'function';
};
});
var require_validate_stringifiable = __commonJS(function(exports, module) {
'use strict';
var isCallable = require_is_callable2();
module.exports = function(stringifiable) {
try {
if (stringifiable && isCallable(stringifiable.toString)) {
return stringifiable.toString();
}
return String(stringifiable);
} catch (e) {
throw new TypeError('Passed argument cannot be stringifed');
}
};
});
var require_validate_stringifiable_value = __commonJS(function(exports, module) {
'use strict';
var ensureValue = require_valid_value();
var stringifiable = require_validate_stringifiable();
module.exports = function(value) {
return stringifiable(ensureValue(value));
};
});
var require_safe_to_string = __commonJS(function(exports, module) {
'use strict';
var isCallable = require_is_callable2();
module.exports = function(value) {
try {
if (value && isCallable(value.toString)) {
return value.toString();
}
return String(value);
} catch (e) {
return '<Non-coercible to string value>';
}
};
});
var require_to_short_string_representation = __commonJS(function(exports, module) {
'use strict';
var safeToString = require_safe_to_string();
var reNewLine = /[\n\r\u2028\u2029]/g;
module.exports = function(value) {
var string = safeToString(value);
if (string.length > 100) {
string = string.slice(0, 99) + '\u2026';
}
string = string.replace(reNewLine, function(_char) {
return JSON.stringify(_char).slice(1, -1);
});
return string;
};
});
var require_is_promise = __commonJS(function(exports, module) {
module.exports = isPromise;
module.exports['default'] = isPromise;
function isPromise(obj) {
return !!obj && (_typeof(obj) === 'object' || typeof obj === 'function') && typeof obj.then === 'function';
}
});
var require_promise = __commonJS(function() {
'use strict';
var objectMap = require_map();
var primitiveSet = require_primitive_set();
var ensureString = require_validate_stringifiable_value();
var toShortString = require_to_short_string_representation();
var isPromise = require_is_promise();
var nextTick = require_next_tick();
var create = Object.create;
var supportedModes = primitiveSet('then', 'then:finally', 'done', 'done:finally');
require_registered_extensions().promise = function(mode, conf) {
var waiting = create(null), cache2 = create(null), promises = create(null);
if (mode === true) {
mode = null;
} else {
mode = ensureString(mode);
if (!supportedModes[mode]) {
throw new TypeError('\'' + toShortString(mode) + '\' is not valid promise mode');
}
}
conf.on('set', function(id, ignore, promise) {
var isFailed = false;
if (!isPromise(promise)) {
cache2[id] = promise;
conf.emit('setasync', id, 1);
return;
}
waiting[id] = 1;
promises[id] = promise;
var onSuccess = function onSuccess(result) {
var count = waiting[id];
if (isFailed) {
throw new Error('Memoizee error: Detected unordered then|done & finally resolution, which in turn makes proper detection of success/failure impossible (when in \'done:finally\' mode)\nConsider to rely on \'then\' or \'done\' mode instead.');
}
if (!count) {
return;
}
delete waiting[id];
cache2[id] = result;
conf.emit('setasync', id, count);
};
var onFailure = function onFailure() {
isFailed = true;
if (!waiting[id]) {
return;
}
delete waiting[id];
delete promises[id];
conf['delete'](id);
};
var resolvedMode = mode;
if (!resolvedMode) {
resolvedMode = 'then';
}
if (resolvedMode === 'then') {
var nextTickFailure = function nextTickFailure() {
nextTick(onFailure);
};
promise = promise.then(function(result) {
nextTick(onSuccess.bind(this, result));
}, nextTickFailure);
if (typeof promise['finally'] === 'function') {
promise['finally'](nextTickFailure);
}
} else if (resolvedMode === 'done') {
if (typeof promise.done !== 'function') {
throw new Error('Memoizee error: Retrieved promise does not implement \'done\' in \'done\' mode');
}
promise.done(onSuccess, onFailure);
} else if (resolvedMode === 'done:finally') {
if (typeof promise.done !== 'function') {
throw new Error('Memoizee error: Retrieved promise does not implement \'done\' in \'done:finally\' mode');
}
if (typeof promise['finally'] !== 'function') {
throw new Error('Memoizee error: Retrieved promise does not implement \'finally\' in \'done:finally\' mode');
}
promise.done(onSuccess);
promise['finally'](onFailure);
}
});
conf.on('get', function(id, args, context) {
var promise;
if (waiting[id]) {
++waiting[id];
return;
}
promise = promises[id];
var emit = function emit() {
conf.emit('getasync', id, args, context);
};
if (isPromise(promise)) {
if (typeof promise.done === 'function') {
promise.done(emit);
} else {
promise.then(function() {
nextTick(emit);
});
}
} else {
emit();
}
});
conf.on('delete', function(id) {
delete promises[id];
if (waiting[id]) {
delete waiting[id];
return;
}
if (!hasOwnProperty.call(cache2, id)) {
return;
}
var result = cache2[id];
delete cache2[id];
conf.emit('deleteasync', id, [ result ]);
});
conf.on('clear', function() {
var oldCache = cache2;
cache2 = create(null);
waiting = create(null);
promises = create(null);
conf.emit('clearasync', objectMap(oldCache, function(data) {
return [ data ];
}));
});
};
});
var require_dispose = __commonJS(function() {
'use strict';
var callable = require_valid_callable();
var forEach = require_for_each();
var extensions = require_registered_extensions();
var apply = Function.prototype.apply;
extensions.dispose = function(dispose, conf, options) {
var del;
callable(dispose);
if (options.async && extensions.async || options.promise && extensions.promise) {
conf.on('deleteasync', del = function del(id, resultArray) {
apply.call(dispose, null, resultArray);
});
conf.on('clearasync', function(cache2) {
forEach(cache2, function(result, id) {
del(id, result);
});
});
return;
}
conf.on('delete', del = function del(id, result) {
dispose(result);
});
conf.on('clear', function(cache2) {
forEach(cache2, function(result, id) {
del(id, result);
});
});
};
});
var require_max_timeout = __commonJS(function(exports, module) {
'use strict';
module.exports = 2147483647;
});
var require_valid_timeout = __commonJS(function(exports, module) {
'use strict';
var toPosInt = require_to_pos_integer();
var maxTimeout = require_max_timeout();
module.exports = function(value) {
value = toPosInt(value);
if (value > maxTimeout) {
throw new TypeError(value + ' exceeds maximum possible timeout');
}
return value;
};
});
var require_max_age = __commonJS(function() {
'use strict';
var aFrom = require_from4();
var forEach = require_for_each();
var nextTick = require_next_tick();
var isPromise = require_is_promise();
var timeout = require_valid_timeout();
var extensions = require_registered_extensions();
var noop3 = Function.prototype;
var max2 = Math.max;
var min = Math.min;
var create = Object.create;
extensions.maxAge = function(maxAge, conf, options) {
var timeouts, postfix, preFetchAge, preFetchTimeouts;
maxAge = timeout(maxAge);
if (!maxAge) {
return;
}
timeouts = create(null);
postfix = options.async && extensions.async || options.promise && extensions.promise ? 'async' : '';
conf.on('set' + postfix, function(id) {
timeouts[id] = setTimeout(function() {
conf['delete'](id);
}, maxAge);
if (typeof timeouts[id].unref === 'function') {
timeouts[id].unref();
}
if (!preFetchTimeouts) {
return;
}
if (preFetchTimeouts[id]) {
if (preFetchTimeouts[id] !== 'nextTick') {
clearTimeout(preFetchTimeouts[id]);
}
}
preFetchTimeouts[id] = setTimeout(function() {
delete preFetchTimeouts[id];
}, preFetchAge);
if (typeof preFetchTimeouts[id].unref === 'function') {
preFetchTimeouts[id].unref();
}
});
conf.on('delete' + postfix, function(id) {
clearTimeout(timeouts[id]);
delete timeouts[id];
if (!preFetchTimeouts) {
return;
}
if (preFetchTimeouts[id] !== 'nextTick') {
clearTimeout(preFetchTimeouts[id]);
}
delete preFetchTimeouts[id];
});
if (options.preFetch) {
if (options.preFetch === true || isNaN(options.preFetch)) {
preFetchAge = .333;
} else {
preFetchAge = max2(min(Number(options.preFetch), 1), 0);
}
if (preFetchAge) {
preFetchTimeouts = {};
preFetchAge = (1 - preFetchAge) * maxAge;
conf.on('get' + postfix, function(id, args, context) {
if (!preFetchTimeouts[id]) {
preFetchTimeouts[id] = 'nextTick';
nextTick(function() {
var result;
if (preFetchTimeouts[id] !== 'nextTick') {
return;
}
delete preFetchTimeouts[id];
conf['delete'](id);
if (options.async) {
args = aFrom(args);
args.push(noop3);
}
result = conf.memoized.apply(context, args);
if (options.promise) {
if (isPromise(result)) {
if (typeof result.done === 'function') {
result.done(noop3, noop3);
} else {
result.then(noop3, noop3);
}
}
}
});
}
});
}
}
conf.on('clear' + postfix, function() {
forEach(timeouts, function(id) {
clearTimeout(id);
});
timeouts = {};
if (preFetchTimeouts) {
forEach(preFetchTimeouts, function(id) {
if (id !== 'nextTick') {
clearTimeout(id);
}
});
preFetchTimeouts = {};
}
});
};
});
var require_lru_queue = __commonJS(function(exports, module) {
'use strict';
var toPosInt = require_to_pos_integer();
var create = Object.create;
var hasOwnProperty2 = Object.prototype.hasOwnProperty;
module.exports = function(limit) {
var size = 0, base = 1, queue2 = create(null), map = create(null), index = 0, del;
limit = toPosInt(limit);
return {
hit: function hit(id) {
var oldIndex = map[id], nuIndex = ++index;
queue2[nuIndex] = id;
map[id] = nuIndex;
if (!oldIndex) {
++size;
if (size <= limit) {
return;
}
id = queue2[base];
del(id);
return id;
}
delete queue2[oldIndex];
if (base !== oldIndex) {
return;
}
while (!hasOwnProperty2.call(queue2, ++base)) {
continue;
}
},
delete: del = function del(id) {
var oldIndex = map[id];
if (!oldIndex) {
return;
}
delete queue2[oldIndex];
delete map[id];
--size;
if (base !== oldIndex) {
return;
}
if (!size) {
index = 0;
base = 1;
return;
}
while (!hasOwnProperty2.call(queue2, ++base)) {
continue;
}
},
clear: function clear() {
size = 0;
base = 1;
queue2 = create(null);
map = create(null);
index = 0;
}
};
};
});
var require_max = __commonJS(function() {
'use strict';
var toPosInteger = require_to_pos_integer();
var lruQueue = require_lru_queue();
var extensions = require_registered_extensions();
extensions.max = function(max2, conf, options) {
var postfix, queue2, hit;
max2 = toPosInteger(max2);
if (!max2) {
return;
}
queue2 = lruQueue(max2);
postfix = options.async && extensions.async || options.promise && extensions.promise ? 'async' : '';
conf.on('set' + postfix, hit = function hit(id) {
id = queue2.hit(id);
if (id === void 0) {
return;
}
conf['delete'](id);
});
conf.on('get' + postfix, hit);
conf.on('delete' + postfix, queue2['delete']);
conf.on('clear' + postfix, queue2.clear);
};
});
var require_ref_counter = __commonJS(function() {
'use strict';
var d2 = require_d();
var extensions = require_registered_extensions();
var create = Object.create;
var defineProperties = Object.defineProperties;
extensions.refCounter = function(ignore, conf, options) {
var cache2, postfix;
cache2 = create(null);
postfix = options.async && extensions.async || options.promise && extensions.promise ? 'async' : '';
conf.on('set' + postfix, function(id, length) {
cache2[id] = length || 1;
});
conf.on('get' + postfix, function(id) {
++cache2[id];
});
conf.on('delete' + postfix, function(id) {
delete cache2[id];
});
conf.on('clear' + postfix, function() {
cache2 = {};
});
defineProperties(conf.memoized, {
deleteRef: d2(function() {
var id = conf.get(arguments);
if (id === null) {
return null;
}
if (!cache2[id]) {
return null;
}
if (!--cache2[id]) {
conf['delete'](id);
return true;
}
return false;
}),
getRefCount: d2(function() {
var id = conf.get(arguments);
if (id === null) {
return 0;
}
if (!cache2[id]) {
return 0;
}
return cache2[id];
})
});
};
});
var require_memoizee = __commonJS(function(exports, module) {
'use strict';
var normalizeOpts = require_normalize_options();
var resolveLength = require_resolve_length();
var plain = require_plain();
module.exports = function(fn) {
var options = normalizeOpts(arguments[1]), length;
if (!options.normalizer) {
length = options.length = resolveLength(options.length, fn.length, options.async);
if (length !== 0) {
if (options.primitive) {
if (length === false) {
options.normalizer = require_primitive();
} else if (length > 1) {
options.normalizer = require_get_primitive_fixed()(length);
}
} else if (length === false) {
options.normalizer = require_get()();
} else if (length === 1) {
options.normalizer = require_get_1()();
} else {
options.normalizer = require_get_fixed()(length);
}
}
}
if (options.async) {
require_async();
}
if (options.promise) {
require_promise();
}
if (options.dispose) {
require_dispose();
}
if (options.maxAge) {
require_max_age();
}
if (options.max) {
require_max();
}
if (options.refCounter) {
require_ref_counter();
}
return plain(fn, options);
};
});
var definitions = [ {
name: 'NA',
value: 'inapplicable',
priority: 0,
group: 'inapplicable'
}, {
name: 'PASS',
value: 'passed',
priority: 1,
group: 'passes'
}, {
name: 'CANTTELL',
value: 'cantTell',
priority: 2,
group: 'incomplete'
}, {
name: 'FAIL',
value: 'failed',
priority: 3,
group: 'violations'
} ];
var constants = {
helpUrlBase: 'https://dequeuniversity.com/rules/',
gridSize: 200,
selectorSimilarFilterLimit: 700,
results: [],
resultGroups: [],
resultGroupMap: {},
impact: Object.freeze([ 'minor', 'moderate', 'serious', 'critical' ]),
preload: Object.freeze({
assets: [ 'cssom', 'media' ],
timeout: 1e4
}),
allOrigins: '<unsafe_all_origins>',
sameOrigin: '<same_origin>',
serializableErrorProps: Object.freeze([ 'message', 'stack', 'name', 'code', 'ruleId', 'method' ])
};
definitions.forEach(function(definition) {
var name = definition.name;
var value = definition.value;
var priority = definition.priority;
var group = definition.group;
constants[name] = value;
constants[name + '_PRIO'] = priority;
constants[name + '_GROUP'] = group;
constants.results[priority] = value;
constants.resultGroups[priority] = group;
constants.resultGroupMap[value] = group;
});
Object.freeze(constants.results);
Object.freeze(constants.resultGroups);
Object.freeze(constants.resultGroupMap);
Object.freeze(constants);
var constants_default = constants;
var logger;
function log() {
if (logger) {
logger.apply(void 0, arguments);
} else if ((typeof console === 'undefined' ? 'undefined' : _typeof(console)) === 'object' && console.log) {
var _console;
(_console = console).log.apply(_console, arguments);
}
}
function setLogger(fn) {
logger = fn;
}
var whitespaceRegex = /[\t\r\n\f]/g;
var uid = 0;
var AbstractVirtualNode = function() {
function AbstractVirtualNode() {
_classCallCheck(this, AbstractVirtualNode);
this.parent = void 0;
this._uid = String(uid++);
}
return _createClass(AbstractVirtualNode, [ {
key: 'toString',
value: function toString() {
return this._uid;
}
}, {
key: 'props',
get: function get() {
throw new Error('VirtualNode class must have a "props" object consisting of "nodeType" and "nodeName" properties');
}
}, {
key: 'attrNames',
get: function get() {
throw new Error('VirtualNode class must have an "attrNames" property');
}
}, {
key: 'attr',
value: function attr() {
throw new Error('VirtualNode class must have an "attr" function');
}
}, {
key: 'hasAttr',
value: function hasAttr() {
throw new Error('VirtualNode class must have a "hasAttr" function');
}
}, {
key: 'hasClass',
value: function hasClass(className) {
var classAttr = this.attr('class');
if (!classAttr) {
return false;
}
var selector = ' ' + className + ' ';
return (' ' + classAttr + ' ').replace(whitespaceRegex, ' ').indexOf(selector) >= 0;
}
} ]);
}();
var abstract_virtual_node_default = AbstractVirtualNode;
var utils_exports = {};
__export(utils_exports, {
DqElement: function DqElement() {
return dq_element_default;
},
RuleError: function RuleError() {
return rule_error_default;
},
aggregate: function aggregate() {
return aggregate_default;
},
aggregateChecks: function aggregateChecks() {
return aggregate_checks_default;
},
aggregateNodeResults: function aggregateNodeResults() {
return aggregate_node_results_default;
},
aggregateResult: function aggregateResult() {
return aggregate_result_default;
},
areStylesSet: function areStylesSet() {
return are_styles_set_default;
},
assert: function assert() {
return assert_default;
},
checkHelper: function checkHelper() {
return check_helper_default;
},
clone: function clone() {
return clone2;
},
closest: function closest() {
return closest_default;
},
collectResultsFromFrames: function collectResultsFromFrames() {
return _collectResultsFromFrames;
},
contains: function contains() {
return _contains;
},
convertSelector: function convertSelector() {
return _convertSelector;
},
cssParser: function cssParser() {
return css_parser_default;
},
deepMerge: function deepMerge() {
return deep_merge_default;
},
escapeSelector: function escapeSelector() {
return escape_selector_default;
},
extendMetaData: function extendMetaData() {
return extend_meta_data_default;
},
filterHtmlAttrs: function filterHtmlAttrs() {
return _filterHtmlAttrs;
},
finalizeRuleResult: function finalizeRuleResult() {
return _finalizeRuleResult;
},
findBy: function findBy() {
return find_by_default;
},
getAllChecks: function getAllChecks() {
return get_all_checks_default;
},
getAncestry: function getAncestry() {
return _getAncestry;
},
getBaseLang: function getBaseLang() {
return get_base_lang_default;
},
getCheckMessage: function getCheckMessage() {
return get_check_message_default;
},
getCheckOption: function getCheckOption() {
return get_check_option_default;
},
getElementInternals: function getElementInternals() {
return _getElementInternals;
},
getElementSource: function getElementSource() {
return _getElementSource;
},
getEnvironmentData: function getEnvironmentData() {
return _getEnvironmentData;
},
getFlattenedTree: function getFlattenedTree() {
return _getFlattenedTree;
},
getFrameContexts: function getFrameContexts() {
return _getFrameContexts;
},
getFriendlyUriEnd: function getFriendlyUriEnd() {
return get_friendly_uri_end_default;
},
getNodeAttributes: function getNodeAttributes() {
return get_node_attributes_default;
},
getNodeFromTree: function getNodeFromTree() {
return get_node_from_tree_default;
},
getPreloadConfig: function getPreloadConfig() {
return _getPreloadConfig;
},
getRootNode: function getRootNode() {
return get_root_node_default;
},
getRule: function getRule() {
return _getRule;
},
getScroll: function getScroll() {
return _getScroll;
},
getScrollState: function getScrollState() {
return get_scroll_state_default;
},
getSelector: function getSelector() {
return _getSelector;
},
getSelectorData: function getSelectorData() {
return _getSelectorData;
},
getShadowSelector: function getShadowSelector() {
return _getShadowSelector;
},
getStandards: function getStandards() {
return _getStandards;
},
getStyleSheetFactory: function getStyleSheetFactory() {
return get_stylesheet_factory_default;
},
getXpath: function getXpath() {
return get_xpath_default;
},
injectStyle: function injectStyle() {
return inject_style_default;
},
isArrayLike: function isArrayLike() {
return _isArrayLike;
},
isContextObject: function isContextObject() {
return _isContextObject;
},
isContextProp: function isContextProp() {
return _isContextProp;
},
isContextSpec: function isContextSpec() {
return _isContextSpec;
},
isHidden: function isHidden() {
return is_hidden_default;
},
isHtmlElement: function isHtmlElement() {
return _isHtmlElement;
},
isLabelledFramesSelector: function isLabelledFramesSelector() {
return _isLabelledFramesSelector;
},
isLabelledShadowDomSelector: function isLabelledShadowDomSelector() {
return _isLabelledShadowDomSelector;
},
isNodeInContext: function isNodeInContext() {
return _isNodeInContext;
},
isShadowRoot: function isShadowRoot() {
return is_shadow_root_default;
},
isValidCustomElementName: function isValidCustomElementName() {
return _isValidCustomElementName;
},
isValidLang: function isValidLang() {
return valid_langs_default;
},
isXHTML: function isXHTML() {
return is_xhtml_default;
},
matchAncestry: function matchAncestry() {
return _matchAncestry;
},
matches: function matches() {
return _matches;
},
matchesExpression: function matchesExpression() {
return _matchesExpression;
},
matchesSelector: function matchesSelector() {
return element_matches_default;
},
memoize: function memoize() {
return memoize_default;
},
mergeResults: function mergeResults() {
return merge_results_default;
},
nodeLookup: function nodeLookup() {
return _nodeLookup;
},
nodeSerializer: function nodeSerializer() {
return node_serializer_default;
},
nodeSorter: function nodeSorter() {
return node_sorter_default;
},
normalizeRunOptions: function normalizeRunOptions() {
return _normalizeRunOptions;
},
objectHasOwn: function objectHasOwn() {
return _objectHasOwn;
},
parseCrossOriginStylesheet: function parseCrossOriginStylesheet() {
return parse_crossorigin_stylesheet_default;
},
parseSameOriginStylesheet: function parseSameOriginStylesheet() {
return parse_sameorigin_stylesheet_default;
},
parseStylesheet: function parseStylesheet() {
return parse_stylesheet_default;
},
parseTabindex: function parseTabindex() {
return parse_tabindex_default;
},
performanceTimer: function performanceTimer() {
return performance_timer_default;
},
pollyfillElementsFromPoint: function pollyfillElementsFromPoint() {
return _pollyfillElementsFromPoint;
},
preload: function preload() {
return _preload;
},
preloadCssom: function preloadCssom() {
return preload_cssom_default;
},
preloadMedia: function preloadMedia() {
return preload_media_default;
},
processMessage: function processMessage() {
return process_message_default;
},
publishMetaData: function publishMetaData() {
return _publishMetaData;
},
querySelectorAll: function querySelectorAll() {
return query_selector_all_default;
},
querySelectorAllFilter: function querySelectorAllFilter() {
return query_selector_all_filter_default;
},
queue: function queue() {
return queue_default;
},
respondable: function respondable() {
return _respondable;
},
ruleShouldRun: function ruleShouldRun() {
return rule_should_run_default;
},
select: function select() {
return _select;
},
sendCommandToFrame: function sendCommandToFrame() {
return _sendCommandToFrame;
},
serializeError: function serializeError() {
return _serializeError;
},
setScrollState: function setScrollState() {
return set_scroll_state_default;
},
shadowSelect: function shadowSelect() {
return _shadowSelect;
},
shadowSelectAll: function shadowSelectAll() {
return _shadowSelectAll;
},
shouldPreload: function shouldPreload() {
return _shouldPreload;
},
toArray: function toArray() {
return to_array_default;
},
tokenList: function tokenList() {
return token_list_default;
},
uniqueArray: function uniqueArray() {
return unique_array_default;
},
uuid: function uuid() {
return uuid_default;
},
validInputTypes: function validInputTypes() {
return valid_input_type_default;
},
validLangs: function validLangs() {
return _validLangs;
}
});
function aggregate(map, values2, initial) {
values2 = values2.slice();
if (initial) {
values2.push(initial);
}
var sorting = values2.map(function(val) {
return map.indexOf(val);
}).sort();
return map[sorting.pop()];
}
var aggregate_default = aggregate;
var CANTTELL_PRIO = constants_default.CANTTELL_PRIO, FAIL_PRIO = constants_default.FAIL_PRIO;
var checkMap = [];
checkMap[constants_default.PASS_PRIO] = true;
checkMap[constants_default.CANTTELL_PRIO] = null;
checkMap[constants_default.FAIL_PRIO] = false;
var checkTypes = [ 'any', 'all', 'none' ];
function anyAllNone(obj, functor) {
return checkTypes.reduce(function(out, type2) {
out[type2] = (obj[type2] || []).map(function(val) {
return functor(val, type2);
});
return out;
}, {});
}
function aggregateChecks(nodeResOriginal) {
var nodeResult = Object.assign({}, nodeResOriginal);
anyAllNone(nodeResult, function(check, type2) {
var i = typeof check.result === 'undefined' ? -1 : checkMap.indexOf(check.result);
check.priority = i !== -1 ? i : constants_default.CANTTELL_PRIO;
if (type2 === 'none') {
if (check.priority === constants_default.PASS_PRIO) {
check.priority = constants_default.FAIL_PRIO;
} else if (check.priority === constants_default.FAIL_PRIO) {
check.priority = constants_default.PASS_PRIO;
}
}
});
var priorities = {
all: nodeResult.all.reduce(function(a2, b3) {
return Math.max(a2, b3.priority);
}, 0),
none: nodeResult.none.reduce(function(a2, b3) {
return Math.max(a2, b3.priority);
}, 0),
any: nodeResult.any.reduce(function(a2, b3) {
return Math.min(a2, b3.priority);
}, 4) % 4
};
nodeResult.priority = Math.max(priorities.all, priorities.none, priorities.any);
var impacts = [];
checkTypes.forEach(function(type2) {
nodeResult[type2] = nodeResult[type2].filter(function(check) {
return check.priority === nodeResult.priority && check.priority === priorities[type2];
});
nodeResult[type2].forEach(function(check) {
return impacts.push(check.impact);
});
});
if ([ CANTTELL_PRIO, FAIL_PRIO ].includes(nodeResult.priority)) {
nodeResult.impact = aggregate_default(constants_default.impact, impacts);
} else {
nodeResult.impact = null;
}
anyAllNone(nodeResult, function(c4) {
delete c4.result;
delete c4.priority;
});
nodeResult.result = constants_default.results[nodeResult.priority];
delete nodeResult.priority;
return nodeResult;
}
var aggregate_checks_default = aggregateChecks;
function _finalizeRuleResult(ruleResult) {
var rule = axe._audit.rules.find(function(_ref) {
var id = _ref.id;
return id === ruleResult.id;
});
if (rule && rule.impact) {
ruleResult.nodes.forEach(function(node) {
[ 'any', 'all', 'none' ].forEach(function(checkType) {
(node[checkType] || []).forEach(function(checkResult) {
checkResult.impact = rule.impact;
});
});
});
}
Object.assign(ruleResult, aggregate_node_results_default(ruleResult.nodes));
delete ruleResult.nodes;
return ruleResult;
}
function aggregateNodeResults(nodeResults) {
var ruleResult = {};
nodeResults = nodeResults.map(function(nodeResult) {
if (nodeResult.any && nodeResult.all && nodeResult.none) {
return aggregate_checks_default(nodeResult);
} else if (Array.isArray(nodeResult.node)) {
return _finalizeRuleResult(nodeResult);
} else {
throw new TypeError('Invalid Result type');
}
});
if (nodeResults && nodeResults.length) {
var resultList = nodeResults.map(function(node) {
return node.result;
});
ruleResult.result = aggregate_default(constants_default.results, resultList, ruleResult.result);
} else {
ruleResult.result = 'inapplicable';
}
constants_default.resultGroups.forEach(function(group) {
return ruleResult[group] = [];
});
nodeResults.forEach(function(nodeResult) {
var groupName = constants_default.resultGroupMap[nodeResult.result];
ruleResult[groupName].push(nodeResult);
});
var impactGroup = constants_default.FAIL_GROUP;
if (ruleResult[impactGroup].length === 0) {
impactGroup = constants_default.CANTTELL_GROUP;
}
if (ruleResult[impactGroup].length > 0) {
var impactList = ruleResult[impactGroup].map(function(failure) {
return failure.impact;
});
ruleResult.impact = aggregate_default(constants_default.impact, impactList) || null;
} else {
ruleResult.impact = null;
}
return ruleResult;
}
var aggregate_node_results_default = aggregateNodeResults;
function copyToGroup(resultObject, subResult, group) {
var resultCopy = Object.assign({}, subResult);
resultCopy.nodes = (resultCopy[group] || []).concat();
constants_default.resultGroups.forEach(function(resultGroup) {
delete resultCopy[resultGroup];
});
resultObject[group].push(resultCopy);
}
function aggregateResult(results) {
var resultObject = {};
constants_default.resultGroups.forEach(function(groupName) {
return resultObject[groupName] = [];
});
results.forEach(function(subResult) {
if (subResult.error) {
copyToGroup(resultObject, subResult, constants_default.CANTTELL_GROUP);
} else if (subResult.result === constants_default.NA) {
copyToGroup(resultObject, subResult, constants_default.NA_GROUP);
} else {
constants_default.resultGroups.forEach(function(group) {
if (Array.isArray(subResult[group]) && subResult[group].length > 0) {
copyToGroup(resultObject, subResult, group);
}
});
}
});
return resultObject;
}
var aggregate_result_default = aggregateResult;
function areStylesSet(el, styles, stopAt) {
var styl = window.getComputedStyle(el, null);
if (!styl) {
return false;
}
for (var i = 0; i < styles.length; ++i) {
var att = styles[i];
if (styl.getPropertyValue(att.property) === att.value) {
return true;
}
}
if (!el.parentNode || el.nodeName.toUpperCase() === stopAt.toUpperCase()) {
return false;
}
return areStylesSet(el.parentNode, styles, stopAt);
}
var are_styles_set_default = areStylesSet;
function assert(bool, message) {
if (!bool) {
throw new Error(message);
}
}
var assert_default = assert;
function _getShadowSelector(generateSelector2, elm) {
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
if (!elm) {
return '';
}
var doc = elm.getRootNode && elm.getRootNode() || document;
if (doc.nodeType !== 11) {
return generateSelector2(elm, options, doc);
}
var stack = [];
while (doc.nodeType === 11) {
if (!doc.host) {
return '';
}
stack.unshift({
elm: elm,
doc: doc
});
elm = doc.host;
doc = elm.getRootNode();
}
stack.unshift({
elm: elm,
doc: doc
});
return stack.map(function(item) {
return generateSelector2(item.elm, options, item.doc);
});
}
function escapeSelector(value) {
var string = String(value);
var length = string.length;
var index = -1;
var codeUnit;
var result = '';
var firstCodeUnit = string.charCodeAt(0);
while (++index < length) {
codeUnit = string.charCodeAt(index);
if (codeUnit == 0) {
result += '\ufffd';
continue;
}
if (codeUnit >= 1 && codeUnit <= 31 || codeUnit == 127 || index == 0 && codeUnit >= 48 && codeUnit <= 57 || index == 1 && codeUnit >= 48 && codeUnit <= 57 && firstCodeUnit == 45) {
result += '\\' + codeUnit.toString(16) + ' ';
continue;
}
if (index == 0 && length == 1 && codeUnit == 45) {
result += '\\' + string.charAt(index);
continue;
}
if (codeUnit >= 128 || codeUnit == 45 || codeUnit == 95 || codeUnit >= 48 && codeUnit <= 57 || codeUnit >= 65 && codeUnit <= 90 || codeUnit >= 97 && codeUnit <= 122) {
result += string.charAt(index);
continue;
}
result += '\\' + string.charAt(index);
}
return result;
}
var escape_selector_default = escapeSelector;
function getNodeAttributes(node) {
if (node.attributes instanceof window.NamedNodeMap) {
return node.attributes;
}
return node.cloneNode(false).attributes;
}
var get_node_attributes_default = getNodeAttributes;
function isMostlyNumbers() {
var str = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
return str.length !== 0 && (str.match(/[0-9]/g) || '').length >= str.length / 2;
}
function splitString(str, splitIndex) {
return [ str.substring(0, splitIndex), str.substring(splitIndex) ];
}
function trimRight(str) {
return str.replace(/\s+$/, '');
}
function uriParser(url) {
var original = url;
var protocol = '', domain = '', port = '', path = '', query = '', hash = '';
if (url.includes('#')) {
var _splitString = splitString(url, url.indexOf('#'));
var _splitString2 = _slicedToArray(_splitString, 2);
url = _splitString2[0];
hash = _splitString2[1];
}
if (url.includes('?')) {
var _splitString3 = splitString(url, url.indexOf('?'));
var _splitString4 = _slicedToArray(_splitString3, 2);
url = _splitString4[0];
query = _splitString4[1];
}
if (url.includes('://')) {
var _url$split = url.split('://');
var _url$split2 = _slicedToArray(_url$split, 2);
protocol = _url$split2[0];
url = _url$split2[1];
var _splitString5 = splitString(url, url.indexOf('/'));
var _splitString6 = _slicedToArray(_splitString5, 2);
domain = _splitString6[0];
url = _splitString6[1];
} else if (url.substr(0, 2) === '//') {
url = url.substr(2);
var _splitString7 = splitString(url, url.indexOf('/'));
var _splitString8 = _slicedToArray(_splitString7, 2);
domain = _splitString8[0];
url = _splitString8[1];
}
if (domain.substr(0, 4) === 'www.') {
domain = domain.substr(4);
}
if (domain && domain.includes(':')) {
var _splitString9 = splitString(domain, domain.indexOf(':'));
var _splitString0 = _slicedToArray(_splitString9, 2);
domain = _splitString0[0];
port = _splitString0[1];
}
path = url;
return {
original: original,
protocol: protocol,
domain: domain,
port: port,
path: path,
query: query,
hash: hash
};
}
function getFriendlyUriEnd() {
var uri = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
if (uri.length <= 1 || uri.substr(0, 5) === 'data:' || uri.substr(0, 11) === 'javascript:' || uri.includes('?')) {
return;
}
var currentDomain = options.currentDomain, _options$maxLength = options.maxLength, maxLength = _options$maxLength === void 0 ? 25 : _options$maxLength;
var _uriParser = uriParser(uri), path = _uriParser.path, domain = _uriParser.domain, hash = _uriParser.hash;
var pathEnd = path.substr(path.substr(0, path.length - 2).lastIndexOf('/') + 1);
if (hash) {
if (pathEnd && (pathEnd + hash).length <= maxLength) {
return trimRight(pathEnd + hash);
} else if (pathEnd.length < 2 && hash.length > 2 && hash.length <= maxLength) {
return trimRight(hash);
} else {
return;
}
} else if (domain && domain.length < maxLength && path.length <= 1) {
return trimRight(domain + path);
}
if (path === '/' + pathEnd && domain && currentDomain && domain !== currentDomain && (domain + path).length <= maxLength) {
return trimRight(domain + path);
}
var lastDotIndex = pathEnd.lastIndexOf('.');
if ((lastDotIndex === -1 || lastDotIndex > 1) && (lastDotIndex !== -1 || pathEnd.length > 2) && pathEnd.length <= maxLength && !pathEnd.match(/index(\.[a-zA-Z]{2-4})?/) && !isMostlyNumbers(pathEnd)) {
return trimRight(pathEnd);
}
}
var get_friendly_uri_end_default = getFriendlyUriEnd;
var ignoredAttributes = [ 'class', 'style', 'id', 'selected', 'checked', 'disabled', 'tabindex', 'aria-checked', 'aria-selected', 'aria-invalid', 'aria-activedescendant', 'aria-busy', 'aria-disabled', 'aria-expanded', 'aria-grabbed', 'aria-pressed', 'aria-valuenow', 'xmlns' ];
var MAXATTRIBUTELENGTH = 31;
var attrCharsRegex = /([\\"])/g;
var controlCharsRegex = /[\u0000-\u001f\u007f]/g;
function escapeAttribute(str) {
return str.replace(attrCharsRegex, '\\$1').replace(controlCharsRegex, function(_char2) {
return '\\' + _char2.charCodeAt(0).toString(16) + ' ';
});
}
function getAttributeNameValue(node, attr) {
var name = attr.name;
var escName = escape_selector_default(name);
if (name.indexOf('href') !== -1 || name.indexOf('src') !== -1) {
var friendly = get_friendly_uri_end_default(node.getAttribute(name));
if (friendly) {
return {
atnv: escName + '$="' + escapeAttribute(friendly) + '"',
isSuffix: true,
rawName: name,
suffix: friendly
};
}
return {
atnv: escName + '="' + escapeAttribute(node.getAttribute(name)) + '"',
isSuffix: false,
rawName: name
};
}
return {
atnv: escName + '="' + escapeAttribute(attr.value) + '"',
isSuffix: false,
rawName: name
};
}
function filterAttributes(attr) {
return !ignoredAttributes.includes(attr.name) && attr.name.indexOf(':') === -1 && (!attr.value || attr.value.length < MAXATTRIBUTELENGTH);
}
var imports_exports = {};
__export(imports_exports, {
ArrayFrom: function ArrayFrom() {
return import_from2['default'];
},
Colorjs: function Colorjs() {
return src_default;
},
CssSelectorParser: function CssSelectorParser() {
return import_css_selector_parser.CssSelectorParser;
},
doT: function doT() {
return import_dot['default'];
},
emojiRegexText: function emojiRegexText() {
return emoji_regex_default;
},
memoize: function memoize() {
return import_memoizee['default'];
}
});
var import_es6_promise = __toModule(require_es6_promise());
var import_typedarray = __toModule(require_typedarray());
var import_weakmap_polyfill = __toModule(require_weakmap_polyfill());
var import_has_own = __toModule(require_has_own3());
var import_values = __toModule(require_values3());
var import_entries = __toModule(require_entries3());
var import_from_entries = __toModule(require_from_entries3());
var import_from = __toModule(require_from3());
if (!('hasOwn' in Object)) {
Object.hasOwn = import_has_own['default'];
}
if (!('values' in Object)) {
Object.values = import_values['default'];
}
if (!('entries' in Object)) {
Object.entries = import_entries['default'];
}
if (!('fromEntries' in Object)) {
Object.fromEntries = import_from_entries['default'];
}
if (!('Promise' in window)) {
import_es6_promise['default'].polyfill();
}
if (!('Uint32Array' in window)) {
window.Uint32Array = import_typedarray.Uint32Array;
}
if (window.Uint32Array) {
if (!('some' in window.Uint32Array.prototype)) {
Object.defineProperty(window.Uint32Array.prototype, 'some', {
value: Array.prototype.some
});
}
if (!('reduce' in window.Uint32Array.prototype)) {
Object.defineProperty(window.Uint32Array.prototype, 'reduce', {
value: Array.prototype.reduce
});
}
}
if (typeof Object.assign !== 'function') {
(function() {
Object.assign = function(target) {
if (target === void 0 || target === null) {
throw new TypeError('Cannot convert undefined or null to object');
}
var output = Object(target);
for (var index = 1; index < arguments.length; index++) {
var source = arguments[index];
if (source !== void 0 && source !== null) {
for (var nextKey in source) {
if (source.hasOwnProperty(nextKey)) {
output[nextKey] = source[nextKey];
}
}
}
}
return output;
};
})();
}
if (!Array.prototype.find) {
Object.defineProperty(Array.prototype, 'find', {
value: function value(predicate) {
if (this === null) {
throw new TypeError('Array.prototype.find called on null or undefined');
}
if (typeof predicate !== 'function') {
throw new TypeError('predicate must be a function');
}
var list = Object(this);
var length = list.length >>> 0;
var thisArg = arguments[1];
var value;
for (var i = 0; i < length; i++) {
value = list[i];
if (predicate.call(thisArg, value, i, list)) {
return value;
}
}
return void 0;
}
});
}
if (!Array.prototype.findIndex) {
Object.defineProperty(Array.prototype, 'findIndex', {
value: function value(predicate, thisArg) {
if (this === null) {
throw new TypeError('Array.prototype.find called on null or undefined');
}
if (typeof predicate !== 'function') {
throw new TypeError('predicate must be a function');
}
var list = Object(this);
var length = list.length >>> 0;
var value;
for (var i = 0; i < length; i++) {
value = list[i];
if (predicate.call(thisArg, value, i, list)) {
return i;
}
}
return -1;
}
});
}
if (!Array.prototype.includes) {
Object.defineProperty(Array.prototype, 'includes', {
value: function value(searchElement) {
var O = Object(this);
var len = parseInt(O.length, 10) || 0;
if (len === 0) {
return false;
}
var n3 = parseInt(arguments[1], 10) || 0;
var k;
if (n3 >= 0) {
k = n3;
} else {
k = len + n3;
if (k < 0) {
k = 0;
}
}
var currentElement;
while (k < len) {
currentElement = O[k];
if (searchElement === currentElement || searchElement !== searchElement && currentElement !== currentElement) {
return true;
}
k++;
}
return false;
}
});
}
if (!Array.prototype.some) {
Object.defineProperty(Array.prototype, 'some', {
value: function value(fun) {
if (this == null) {
throw new TypeError('Array.prototype.some called on null or undefined');
}
if (typeof fun !== 'function') {
throw new TypeError();
}
var t = Object(this);
var len = t.length >>> 0;
var thisArg = arguments.length >= 2 ? arguments[1] : void 0;
for (var i = 0; i < len; i++) {
if (i in t && fun.call(thisArg, t[i], i, t)) {
return true;
}
}
return false;
}
});
}
if (!Array.from) {
Array.from = import_from['default'];
}
if (!String.prototype.includes) {
String.prototype.includes = function(search, start) {
if (typeof start !== 'number') {
start = 0;
}
if (start + search.length > this.length) {
return false;
} else {
return this.indexOf(search, start) !== -1;
}
};
}
if (!Array.prototype.flat) {
Object.defineProperty(Array.prototype, 'flat', {
configurable: true,
value: function flat() {
var depth = isNaN(arguments[0]) ? 1 : Number(arguments[0]);
return depth ? Array.prototype.reduce.call(this, function(acc, cur) {
if (Array.isArray(cur)) {
acc.push.apply(acc, flat.call(cur, depth - 1));
} else {
acc.push(cur);
}
return acc;
}, []) : Array.prototype.slice.call(this);
},
writable: true
});
}
if (window.Node && !('isConnected' in window.Node.prototype)) {
Object.defineProperty(window.Node.prototype, 'isConnected', {
get: function get() {
return !this.ownerDocument || !(this.ownerDocument.compareDocumentPosition(this) & this.DOCUMENT_POSITION_DISCONNECTED);
}
});
}
var import_css_selector_parser = __toModule(require_lib());
var import_dot = __toModule(require_doT());
var emoji_regex_default = function emoji_regex_default() {
return /[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E-\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED9\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEFA](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3C-\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDEC2\uDEC6\uDEC8\uDECC-\uDEDD\uDEDF-\uDEEB\uDEEF]|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g;
};
var import_memoizee = __toModule(require_memoizee());
var util_exports = {};
__export(util_exports, {
bisectLeft: function bisectLeft() {
return _bisectLeft;
},
clamp: function clamp() {
return _clamp;
},
copySign: function copySign() {
return _copySign;
},
diag: function diag() {
return _diag;
},
interpolate: function interpolate() {
return _interpolate;
},
interpolateInv: function interpolateInv() {
return _interpolateInv;
},
inv: function inv() {
return _inv;
},
isInstance: function isInstance() {
return _isInstance;
},
isNone: function isNone() {
return _isNone;
},
isString: function isString() {
return _isString;
},
lu: function lu() {
return _lu;
},
mapRange: function mapRange() {
return _mapRange;
},
multiplyMatrices: function multiplyMatrices() {
return _multiplyMatrices;
},
multiply_v3_m3x3: function multiply_v3_m3x3() {
return _multiply_v3_m3x;
},
serializeNumber: function serializeNumber() {
return _serializeNumber;
},
skipNone: function skipNone() {
return _skipNone;
},
solve: function solve() {
return _solve;
},
spow: function spow() {
return _spow;
},
toPrecision: function toPrecision() {
return _toPrecision;
},
type: function type() {
return _type;
},
zdiv: function zdiv() {
return _zdiv;
}
});
function _multiplyMatrices(A, B) {
var m3 = A.length;
var AM;
var BM;
var aVec = false;
var bVec = false;
if (!Array.isArray(A[0])) {
AM = [ A ];
m3 = AM.length;
aVec = true;
} else {
AM = A;
}
if (!Array.isArray(B[0])) {
BM = B.length > 0 ? B.map(function(x) {
return [ x ];
}) : [ [] ];
bVec = true;
} else {
BM = B;
}
var p3 = BM[0].length;
var BM_cols = BM[0].map(function(_, i) {
return BM.map(function(x) {
return x[i];
});
});
var product = AM.map(function(row) {
return BM_cols.map(function(col) {
var ret = 0;
if (!Array.isArray(row)) {
var _iterator2 = _createForOfIteratorHelper(col), _step2;
try {
for (_iterator2.s(); !(_step2 = _iterator2.n()).done; ) {
var c4 = _step2.value;
ret += row * c4;
}
} catch (err) {
_iterator2.e(err);
} finally {
_iterator2.f();
}
return ret;
}
for (var i = 0; i < row.length; i++) {
ret += row[i] * (col[i] || 0);
}
return ret;
});
});
if (m3 === 1 && aVec) {
product = product[0];
}
if (p3 === 1 && bVec) {
if (m3 === 1 && aVec) {
return product[0];
} else {
return product.map(function(x) {
return x[0];
});
}
}
return product;
}
function dot3(a2, b3) {
return a2[0] * b3[0] + a2[1] * b3[1] + a2[2] * b3[2];
}
function _multiply_v3_m3x(input, matrix) {
var out = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [ 0, 0, 0 ];
var x = dot3(input, matrix[0]);
var y = dot3(input, matrix[1]);
var z = dot3(input, matrix[2]);
out[0] = x;
out[1] = y;
out[2] = z;
return out;
}
function _isString(str) {
return _type(str) === 'string';
}
function _type(o) {
var str = Object.prototype.toString.call(o);
return (str.match(/^\[object\s+(.*?)\]$/)[1] || '').toLowerCase();
}
function _serializeNumber(n3, _ref2) {
var _ref2$precision = _ref2.precision, precision = _ref2$precision === void 0 ? 16 : _ref2$precision, unit = _ref2.unit;
if (_isNone(n3)) {
return 'none';
}
n3 = +_toPrecision(n3, precision);
return n3 + (unit !== null && unit !== void 0 ? unit : '');
}
function _isNone(n3) {
return n3 === null;
}
function _skipNone(n3) {
return _isNone(n3) ? 0 : n3;
}
function _toPrecision(n3, precision) {
if (n3 === 0) {
return 0;
}
var integer = ~~n3;
var digits = 0;
if (integer && precision) {
digits = ~~Math.log10(Math.abs(integer)) + 1;
}
var multiplier = Math.pow(10, precision - digits);
return Math.floor(n3 * multiplier + .5) / multiplier;
}
function _interpolate(start, end, p3) {
if (_isNone(start) || isNaN(start)) {
return end;
}
if (_isNone(end) || isNaN(end)) {
return start;
}
return start + (end - start) * p3;
}
function _interpolateInv(start, end, value) {
return (value - start) / (end - start);
}
function _mapRange(from, to2, value) {
if (!from || !to2 || from === to2 || from[0] === to2[0] && from[1] === to2[1] || isNaN(value) || value === null) {
return value;
}
return _interpolate(to2[0], to2[1], _interpolateInv(from[0], from[1], value));
}
function _clamp(min, val, max2) {
return Math.max(Math.min(max2, val), min);
}
function _copySign(to2, from) {
return Math.sign(to2) === Math.sign(from) ? to2 : -to2;
}
function _spow(base, exp2) {
return _copySign(Math.pow(Math.abs(base), exp2), base);
}
function _zdiv(n3, d2) {
return d2 === 0 ? 0 : n3 / d2;
}
function _bisectLeft(arr, value) {
var lo = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
var hi = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : arr.length;
while (lo < hi) {
var mid = lo + hi >> 1;
if (arr[mid] < value) {
lo = mid + 1;
} else {
hi = mid;
}
}
return lo;
}
function _isInstance(arg, constructor) {
if (arg instanceof constructor) {
return true;
}
var targetName = constructor.name;
while (arg) {
var _proto$constructor;
var proto = Object.getPrototypeOf(arg);
var constructorName = proto === null || proto === void 0 || (_proto$constructor = proto.constructor) === null || _proto$constructor === void 0 ? void 0 : _proto$constructor.name;
if (constructorName === targetName) {
return true;
}
if (!constructorName || constructorName === 'Object') {
return false;
}
arg = proto;
}
return false;
}
function _diag(values2) {
var n3 = values2.length;
var matrix = [];
for (var i = 0; i < n3; i++) {
matrix[i] = [];
for (var j = 0; j < n3; j++) {
matrix[i][j] = i === j ? values2[i] : 0;
}
}
return matrix;
}
function _lu(matrix) {
var _ref3 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, _ref3$pIndices = _ref3.pIndices, pIndices = _ref3$pIndices === void 0 ? false : _ref3$pIndices;
var p1, p22, l, u;
var n3 = matrix.length;
if (pIndices) {
p1 = Array.from({
length: n3
}, function(_, index) {
return index;
});
l = _diag(new Array(n3).fill(1));
} else {
p22 = _diag(new Array(n3).fill(1));
l = structuredClone(p22);
}
u = structuredClone(matrix);
for (var i = 0; i < n3 - 1; i++) {
var j = i;
var maximum = Math.abs(u[i][i]);
for (var k = i + 1; k < n3; k++) {
var a2 = Math.abs(u[k][i]);
if (a2 > maximum) {
j = k;
maximum = a2;
}
}
if (j != i) {
var _ref4 = [ u[j], u[i] ];
u[i] = _ref4[0];
u[j] = _ref4[1];
if (pIndices) {
var _ref5 = [ p1[j], p1[i] ];
p1[i] = _ref5[0];
p1[j] = _ref5[1];
} else {
var _ref6 = [ p22[j], p22[i] ];
p22[i] = _ref6[0];
p22[j] = _ref6[1];
}
if (i) {
for (var _k = 0; _k < i; _k++) {
var _ref7 = [ l[j][_k], l[i][_k] ];
l[i][_k] = _ref7[0];
l[j][_k] = _ref7[1];
}
}
} else if (!maximum) {
continue;
}
for (var j2 = i + 1; j2 < n3; j2++) {
var scalar = u[j2][i] / u[i][i];
for (var _k2 = i; _k2 < n3; _k2++) {
u[j2][_k2] += -u[i][_k2] * scalar;
l[j2][_k2] += l[i][_k2] * scalar;
}
}
}
if (pIndices) {
return [ p1, l, u ];
}
return [ p22, l, u ];
}
function forwardSubMatrix(a2, b3, n3) {
for (var i = 0; i < n3; i++) {
var v = b3[i];
for (var j = 0; j < i; j++) {
for (var k = 0; k < n3; k++) {
v[k] -= a2[i][j] * b3[j][k];
}
}
for (var _j = 0; _j < n3; _j++) {
v[_j] /= a2[i][i];
}
}
return b3;
}
function backSubMatrix(a2, b3, n3) {
for (var i = n3 - 1; i > -1; i--) {
var v = b3[i];
for (var j = i + 1; j < n3; j++) {
for (var k = 0; k < n3; k++) {
v[k] -= a2[i][j] * b3[j][k];
}
}
for (var _j2 = 0; _j2 < n3; _j2++) {
b3[i][_j2] /= a2[i][i];
}
}
return b3;
}
function forwardSubVector(a2, b3, n3) {
for (var i = 0; i < n3; i++) {
var v = b3[i];
for (var j = 0; j < i; j++) {
v -= a2[i][j] * b3[j];
}
b3[i] = v / a2[i][i];
}
return b3;
}
function backSubVector(a2, b3, n3) {
for (var i = n3 - 1; i > -1; i--) {
var v = b3[i];
for (var j = i + 1; j < n3; j++) {
v -= a2[i][j] * b3[j];
}
b3[i] = v / a2[i][i];
}
return b3;
}
function _inv(matrix) {
var _lu2 = _lu(matrix), _lu3 = _slicedToArray(_lu2, 3), p3 = _lu3[0], l = _lu3[1], u = _lu3[2];
var n3 = l.length;
if (l.map(function(row, i) {
return row[i] * u[i][i];
}).reduce(function(acc, val) {
return acc * val;
}, 1) === 0) {
throw new Error('Matrix is singular');
}
return backSubMatrix(u, forwardSubMatrix(l, p3, n3), n3);
}
function _solve(matrix, vector) {
var _lu4 = _lu(matrix, {
pIndices: true
}), _lu5 = _slicedToArray(_lu4, 3), p3 = _lu5[0], l = _lu5[1], u = _lu5[2];
var n3 = l.length;
if (l.map(function(row, i) {
return row[i] * u[i][i];
}).reduce(function(acc, val) {
return acc * val;
}, 1) === 0) {
throw new Error('Matrix is singular');
}
return backSubVector(u, forwardSubVector(l, p3.map(function(i) {
return vector[i];
}), n3), n3);
}
var Hooks = function() {
function Hooks() {
_classCallCheck(this, Hooks);
}
return _createClass(Hooks, [ {
key: 'add',
value: function add(name, callback, first) {
if (typeof arguments[0] != 'string') {
for (var name in arguments[0]) {
this.add(name, arguments[0][name], arguments[1]);
}
return;
}
(Array.isArray(name) ? name : [ name ]).forEach(function(name2) {
this[name2] = this[name2] || [];
if (callback) {
this[name2][first ? 'unshift' : 'push'](callback);
}
}, this);
}
}, {
key: 'run',
value: function run(name, env) {
this[name] = this[name] || [];
this[name].forEach(function(callback) {
callback.call(env && env.context ? env.context : env, env);
});
}
} ]);
}();
var hooks = new Hooks();
var hooks_default = hooks;
var defaults_default = {
gamut_mapping: 'css',
precision: 5,
deltaE: '76',
verbose: (globalThis === null || globalThis === void 0 || (_globalThis$process = globalThis.process) === null || _globalThis$process === void 0 || (_globalThis$process = _globalThis$process.env) === null || _globalThis$process === void 0 || (_globalThis$process = _globalThis$process.NODE_ENV) === null || _globalThis$process === void 0 ? void 0 : _globalThis$process.toLowerCase()) !== 'test',
warn: function warn(msg) {
if (this.verbose) {
var _globalThis$console, _globalThis$console$w;
globalThis === null || globalThis === void 0 || (_globalThis$console = globalThis.console) === null || _globalThis$console === void 0 || (_globalThis$console$w = _globalThis$console.warn) === null || _globalThis$console$w === void 0 || _globalThis$console$w.call(_globalThis$console, msg);
}
}
};
var Type = function() {
function Type(type2, coordMeta) {
_classCallCheck(this, Type);
_defineProperty(this, 'type', void 0);
_defineProperty(this, 'coordMeta', void 0);
_defineProperty(this, 'coordRange', void 0);
_defineProperty(this, 'range', void 0);
if (_typeof(type2) === 'object') {
this.coordMeta = type2;
}
if (coordMeta) {
var _coordMeta$range;
this.coordMeta = coordMeta;
this.coordRange = (_coordMeta$range = coordMeta.range) !== null && _coordMeta$range !== void 0 ? _coordMeta$range : coordMeta.refRange;
}
if (typeof type2 === 'string') {
var params = type2.trim().match(_wrapRegExp(/^(<[a-z]+>)(\[(-?[.\d]+),\s*(-?[.\d]+)\])?$/, {
type: 1,
min: 3,
max: 4
}));
if (!params) {
throw new TypeError('Cannot parse '.concat(type2, ' as a type definition.'));
}
this.type = params.groups.type;
var _params$groups = params.groups, min = _params$groups.min, max2 = _params$groups.max;
if (min || max2) {
this.range = [ +min, +max2 ];
}
}
}
return _createClass(Type, [ {
key: 'computedRange',
get: function get() {
if (this.range) {
return this.range;
}
if (this.type === '<percentage>') {
return this.percentageRange();
} else if (this.type === '<angle>') {
return [ 0, 360 ];
}
return null;
}
}, {
key: 'unit',
get: function get() {
if (this.type === '<percentage>') {
return '%';
} else if (this.type === '<angle>') {
return 'deg';
}
return '';
}
}, {
key: 'resolve',
value: function resolve(number) {
if (this.type === '<angle>') {
return number;
}
var fromRange = this.computedRange;
var toRange = this.coordRange;
if (this.type === '<percentage>') {
toRange !== null && toRange !== void 0 ? toRange : toRange = this.percentageRange();
}
return _mapRange(fromRange, toRange, number);
}
}, {
key: 'serialize',
value: function serialize(number, precision) {
var toRange = this.type === '<percentage>' ? this.percentageRange(100) : this.computedRange;
var unit = this.unit;
number = _mapRange(this.coordRange, toRange, number);
return _serializeNumber(number, {
unit: unit,
precision: precision
});
}
}, {
key: 'toString',
value: function toString() {
var ret = this.type;
if (this.range) {
var _this$range = _slicedToArray(this.range, 2), _this$range$ = _this$range[0], min = _this$range$ === void 0 ? '' : _this$range$, _this$range$2 = _this$range[1], max2 = _this$range$2 === void 0 ? '' : _this$range$2;
ret += '['.concat(min, ',').concat(max2, ']');
}
return ret;
}
}, {
key: 'percentageRange',
value: function percentageRange() {
var scale2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;
var range2;
if (this.coordMeta && this.coordMeta.range || this.coordRange && this.coordRange[0] >= 0) {
range2 = [ 0, 1 ];
} else {
range2 = [ -1, 1 ];
}
return [ range2[0] * scale2, range2[1] * scale2 ];
}
} ], [ {
key: 'get',
value: function get(type2, coordMeta) {
if (_isInstance(type2, this)) {
return type2;
}
return new this(type2, coordMeta);
}
} ]);
}();
var Type_default = Type;
var instance = Symbol('instance');
var _Format = function() {
function Format(format) {
var _this = this;
var space = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : format.space;
_classCallCheck(this, Format);
_defineProperty(this, 'type', void 0);
_defineProperty(this, 'name', void 0);
_defineProperty(this, 'spaceCoords', void 0);
_defineProperty(this, 'coords', void 0);
_defineProperty(this, 'id', void 0);
_defineProperty(this, 'alpha', void 0);
format[instance] = this;
this.type = 'function';
this.name = 'color';
Object.assign(this, format);
this.space = space;
if (this.type === 'custom') {
return;
}
this.spaceCoords = Object.values(space.coords);
if (!this.coords) {
this.coords = this.spaceCoords.map(function(coordMeta) {
var ret = [ '<number>', '<percentage>' ];
if (coordMeta.type === 'angle') {
ret.push('<angle>');
}
return ret;
});
}
this.coords = this.coords.map(function(types, i) {
var coordMeta = _this.spaceCoords[i];
if (typeof types === 'string') {
types = types.trim().split(/\s*\|\s*/);
}
return types.map(function(type2) {
return Type_default.get(type2, coordMeta);
});
});
}
return _createClass(Format, [ {
key: 'serializeCoords',
value: function serializeCoords(coords, precision, types) {
var _this2 = this;
types = coords.map(function(_, i) {
var _types$i, _types;
return Type_default.get((_types$i = (_types = types) === null || _types === void 0 ? void 0 : _types[i]) !== null && _types$i !== void 0 ? _types$i : _this2.coords[i][0], _this2.spaceCoords[i]);
});
return coords.map(function(c4, i) {
return types[i].serialize(c4, precision);
});
}
}, {
key: 'coerceCoords',
value: function coerceCoords(coords, types) {
var _this3 = this;
return Object.entries(this.space.coords).map(function(_ref8, i) {
var _ref9 = _slicedToArray(_ref8, 2), id = _ref9[0], coordMeta = _ref9[1];
var arg = coords[i];
if (_isNone(arg) || isNaN(arg)) {
return arg;
}
var providedType = types[i];
var type2 = _this3.coords[i].find(function(c4) {
return c4.type == providedType;
});
if (!type2) {
var _ref0, _arg;
var coordName = coordMeta.name || id;
throw new TypeError(''.concat((_ref0 = providedType !== null && providedType !== void 0 ? providedType : (_arg = arg) === null || _arg === void 0 ? void 0 : _arg.raw) !== null && _ref0 !== void 0 ? _ref0 : arg, ' not allowed for ').concat(coordName, ' in ').concat(_this3.name, '()'));
}
arg = type2.resolve(arg);
if (type2.range) {
types[i] = type2.toString();
}
return arg;
});
}
}, {
key: 'canSerialize',
value: function canSerialize() {
return this.type === 'function' || this.serialize;
}
}, {
key: 'parse',
value: function parse(str) {
return null;
}
} ], [ {
key: 'get',
value: function get(format) {
if (!format || _isInstance(format, this)) {
return format;
}
if (format[instance]) {
return format[instance];
}
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
args[_key - 1] = arguments[_key];
}
return _construct(_Format, [ format ].concat(args));
}
} ]);
}();
var Format_default = _Format;
var WHITES = {
D50: [ .3457 / .3585, 1, (1 - .3457 - .3585) / .3585 ],
D65: [ .3127 / .329, 1, (1 - .3127 - .329) / .329 ]
};
function getWhite(name) {
if (Array.isArray(name)) {
return name;
}
return WHITES[name];
}
function adapt(W1, W2, XYZ) {
var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
W1 = getWhite(W1);
W2 = getWhite(W2);
if (!W1 || !W2) {
throw new TypeError('Missing white point to convert '.concat(!W1 ? 'from' : '').concat(!W1 && !W2 ? '/' : '').concat(!W2 ? 'to' : ''));
}
if (W1 === W2) {
return XYZ;
}
var env = {
W1: W1,
W2: W2,
XYZ: XYZ,
options: options
};
hooks_default.run('chromatic-adaptation-start', env);
if (!env.M) {
if (env.W1 === WHITES.D65 && env.W2 === WHITES.D50) {
env.M = [ [ 1.0479297925449969, .022946870601609652, -.05019226628920524 ], [ .02962780877005599, .9904344267538799, -.017073799063418826 ], [ -.009243040646204504, .015055191490298152, .7518742814281371 ] ];
} else if (env.W1 === WHITES.D50 && env.W2 === WHITES.D65) {
env.M = [ [ .955473421488075, -.02309845494876471, .06325924320057072 ], [ -.0283697093338637, 1.0099953980813041, .021041441191917323 ], [ .012314014864481998, -.020507649298898964, 1.330365926242124 ] ];
}
}
hooks_default.run('chromatic-adaptation-end', env);
if (env.M) {
return _multiply_v3_m3x(env.XYZ, env.M);
} else {
throw new TypeError('Only Bradford CAT with white points D50 and D65 supported for now.');
}
}
function parse(str, options) {
var _String, _env$options$parseMet;
var env = {
str: (_String = String(str)) === null || _String === void 0 ? void 0 : _String.trim(),
options: options
};
hooks_default.run('parse-start', env);
if (env.color) {
return env.color;
}
env.parsed = parseFunction(env.str);
var ret;
var meta = env.options ? (_env$options$parseMet = env.options.parseMeta) !== null && _env$options$parseMet !== void 0 ? _env$options$parseMet : env.options.meta : null;
if (env.parsed) {
var name = env.parsed.name;
var format;
var space;
var coords = env.parsed.args;
var types = coords.map(function(c4, i) {
var _env$parsed$argMeta$i;
return (_env$parsed$argMeta$i = env.parsed.argMeta[i]) === null || _env$parsed$argMeta$i === void 0 ? void 0 : _env$parsed$argMeta$i.type;
});
if (name === 'color') {
var id = coords.shift();
types.shift();
var alternateId = id.startsWith('--') ? id.substring(2) : '--'.concat(id);
var ids = [ id, alternateId ];
format = ColorSpace_default.findFormat({
name: name,
id: ids,
type: 'function'
});
if (!format) {
var didYouMean;
var registryId = id in ColorSpace_default.registry ? id : alternateId;
if (registryId in ColorSpace_default.registry) {
var _ColorSpace_default$r;
var cssId = (_ColorSpace_default$r = ColorSpace_default.registry[registryId].formats) === null || _ColorSpace_default$r === void 0 || (_ColorSpace_default$r = _ColorSpace_default$r.color) === null || _ColorSpace_default$r === void 0 ? void 0 : _ColorSpace_default$r.id;
if (cssId) {
var altColor = str.replace('color(' + id, 'color(' + cssId);
didYouMean = 'Did you mean '.concat(altColor, '?');
}
}
throw new TypeError('Cannot parse '.concat(env.str, '. ') + (didYouMean !== null && didYouMean !== void 0 ? didYouMean : 'Missing a plugin?'));
}
space = format.space;
if (format.id.startsWith('--') && !id.startsWith('--')) {
defaults_default.warn(''.concat(space.name, ' is a non-standard space and not currently supported in the CSS spec. Use prefixed color(').concat(format.id, ') instead of color(').concat(id, ').'));
}
if (id.startsWith('--') && !format.id.startsWith('--')) {
defaults_default.warn(''.concat(space.name, ' is a standard space and supported in the CSS spec. Use color(').concat(format.id, ') instead of prefixed color(').concat(id, ').'));
}
} else {
format = ColorSpace_default.findFormat({
name: name,
type: 'function'
});
space = format.space;
}
if (meta) {
Object.assign(meta, {
format: format,
formatId: format.name,
types: types,
commas: env.parsed.commas
});
}
var alpha = 1;
if (env.parsed.lastAlpha) {
alpha = env.parsed.args.pop();
if (meta) {
meta.alphaType = types.pop();
}
}
var coordCount = format.coords.length;
if (coords.length !== coordCount) {
throw new TypeError('Expected '.concat(coordCount, ' coordinates for ').concat(space.id, ' in ').concat(env.str, '), got ').concat(coords.length));
}
coords = format.coerceCoords(coords, types);
ret = {
spaceId: space.id,
coords: coords,
alpha: alpha
};
} else {
var _iterator3 = _createForOfIteratorHelper(ColorSpace_default.all), _step3;
try {
spaceloop: for (_iterator3.s(); !(_step3 = _iterator3.n()).done; ) {
var _space = _step3.value;
for (var formatId in _space.formats) {
var _format = _space.formats[formatId];
if (_format.type !== 'custom') {
continue;
}
if (_format.test && !_format.test(env.str)) {
continue;
}
var formatObject = _space.getFormat(_format);
var color = formatObject.parse(env.str);
if (color) {
if (meta) {
Object.assign(meta, {
format: formatObject,
formatId: formatId
});
}
ret = color;
break spaceloop;
}
}
}
} catch (err) {
_iterator3.e(err);
} finally {
_iterator3.f();
}
}
if (!ret) {
throw new TypeError('Could not parse '.concat(str, ' as a color. Missing a plugin?'));
}
ret.alpha = _isNone(ret.alpha) ? ret.alpha : ret.alpha === void 0 ? 1 : _clamp(0, ret.alpha, 1);
return ret;
}
var units = {
'%': .01,
deg: 1,
grad: .9,
rad: 180 / Math.PI,
turn: 360
};
var regex = {
function: /^([a-z]+)\(((?:calc\(NaN\)|.)+?)\)$/i,
number: /^([-+]?(?:[0-9]*\.)?[0-9]+(e[-+]?[0-9]+)?)$/i,
unitValue: RegExp('('.concat(Object.keys(units).join('|'), ')$')),
singleArgument: /\/?\s*(none|NaN|calc\(NaN\)|[-+\w.]+(?:%|deg|g?rad|turn)?)/g
};
function parseArgument(rawArg) {
var _rawArg$match;
var meta = {};
var unit = (_rawArg$match = rawArg.match(regex.unitValue)) === null || _rawArg$match === void 0 ? void 0 : _rawArg$match[0];
var value = meta.raw = rawArg;
if (unit) {
meta.type = unit === '%' ? '<percentage>' : '<angle>';
meta.unit = unit;
meta.unitless = Number(value.slice(0, -unit.length));
value = meta.unitless * units[unit];
} else if (regex.number.test(value)) {
value = Number(value);
meta.type = '<number>';
} else if (value === 'none') {
value = null;
} else if (value === 'NaN' || value === 'calc(NaN)') {
value = NaN;
meta.type = '<number>';
} else {
meta.type = '<ident>';
}
return {
value: value,
meta: meta
};
}
function parseFunction(str) {
if (!str) {
return;
}
str = str.trim();
var parts = str.match(regex['function']);
if (parts) {
var args = [];
var argMeta = [];
var lastAlpha = false;
var name = parts[1].toLowerCase();
var separators = parts[2].replace(regex.singleArgument, function($0, rawArg) {
var _parseArgument = parseArgument(rawArg), value = _parseArgument.value, meta = _parseArgument.meta;
if ($0.startsWith('/') || name !== 'color' && args.length === 3) {
lastAlpha = true;
}
args.push(value);
argMeta.push(meta);
return '';
});
return {
name: name,
args: args,
argMeta: argMeta,
lastAlpha: lastAlpha,
commas: separators.includes(','),
rawName: parts[1],
rawArgs: parts[2]
};
}
}
function getColor(color, options) {
if (Array.isArray(color)) {
return color.map(function(c4) {
return getColor(c4, options);
});
}
if (!color) {
throw new TypeError('Empty color reference');
}
if (_isString(color)) {
color = parse(color, options);
}
var space = color.space || color.spaceId;
if (typeof space === 'string') {
color.space = ColorSpace_default.get(space);
}
if (color.alpha === void 0) {
color.alpha = 1;
}
return color;
}
var \u03b5 = 75e-6;
var _ColorSpace2 = function() {
function _ColorSpace(options) {
var _options$displaySpace, _options$coords, _ref1, _options$white, _options$formats, _this$formats$color, _options$M;
_classCallCheck(this, _ColorSpace);
this.id = options.id;
this.name = options.name;
this.base = options.base ? _ColorSpace2.get(options.base) : null;
this.aliases = options.aliases;
this.displaySpaces = (_options$displaySpace = options.displaySpaces) === null || _options$displaySpace === void 0 ? void 0 : _options$displaySpace.map(function(space) {
return _ColorSpace2.get(space);
});
this.bases = [];
for (var base = this.base; base; base = base.base) {
this.bases.push(base);
}
if (options.rgbGamut) {
this.rgbGamut = options.rgbGamut;
}
if (options.linearGamut) {
this.linearGamut = options.linearGamut;
}
if (this.base) {
if (options.fromBase) {
this.fromBase = options.fromBase;
}
if (options.toBase) {
this.toBase = options.toBase;
}
}
var coords = (_options$coords = options.coords) !== null && _options$coords !== void 0 ? _options$coords : this.base.coords;
for (var name in coords) {
if (!('name' in coords[name])) {
coords[name].name = name;
}
}
this.coords = coords;
var white6 = (_ref1 = (_options$white = options.white) !== null && _options$white !== void 0 ? _options$white : this.base.white) !== null && _ref1 !== void 0 ? _ref1 : 'D65';
this.white = getWhite(white6);
this.formats = (_options$formats = options.formats) !== null && _options$formats !== void 0 ? _options$formats : {};
for (var _name in this.formats) {
var format = this.formats[_name];
format.type || (format.type = 'function');
format.name || (format.name = _name);
}
if (!((_this$formats$color = this.formats.color) !== null && _this$formats$color !== void 0 && _this$formats$color.id)) {
var _this$formats$color2;
this.formats.color = _extends({}, (_this$formats$color2 = this.formats.color) !== null && _this$formats$color2 !== void 0 ? _this$formats$color2 : {}, {
id: options.cssId || this.id
});
}
if (options.gamutSpace) {
this.gamutSpace = options.gamutSpace === 'self' ? this : _ColorSpace2.get(options.gamutSpace);
} else {
if (this.isPolar) {
this.gamutSpace = this.base;
} else {
this.gamutSpace = this;
}
}
if (this.gamutSpace.isUnbounded) {
this.inGamut = function(coords2, options2) {
return true;
};
}
this.M = (_options$M = options.M) !== null && _options$M !== void 0 ? _options$M : {};
this.referred = options.referred;
Object.defineProperty(this, 'path', {
value: getPath(this).reverse(),
writable: false,
enumerable: true,
configurable: true
});
hooks_default.run('colorspace-init-end', this);
}
return _createClass(_ColorSpace, [ {
key: 'inGamut',
value: function inGamut(coords) {
var _ref10 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, _ref10$epsilon = _ref10.epsilon, epsilon = _ref10$epsilon === void 0 ? \u03b5 : _ref10$epsilon;
if (!this.equals(this.gamutSpace)) {
coords = this.to(this.gamutSpace, coords);
return this.gamutSpace.inGamut(coords, {
epsilon: epsilon
});
}
var coordMeta = Object.values(this.coords);
return coords.every(function(c4, i) {
var meta = coordMeta[i];
if (meta.type !== 'angle' && meta.range) {
if (_isNone(c4)) {
return true;
}
var _meta$range = _slicedToArray(meta.range, 2), min = _meta$range[0], max2 = _meta$range[1];
return (min === void 0 || c4 >= min - epsilon) && (max2 === void 0 || c4 <= max2 + epsilon);
}
return true;
});
}
}, {
key: 'isUnbounded',
get: function get() {
return Object.values(this.coords).every(function(coord) {
return !('range' in coord);
});
}
}, {
key: 'cssId',
get: function get() {
var _this$formats;
return ((_this$formats = this.formats) === null || _this$formats === void 0 || (_this$formats = _this$formats.color) === null || _this$formats === void 0 ? void 0 : _this$formats.id) || this.id;
}
}, {
key: 'hueId',
get: function get() {
for (var id in this.coords) {
if (this.coords[id].type === 'angle') {
return id;
}
}
return null;
}
}, {
key: 'hueIndex',
get: function get() {
var _this4 = this;
return Object.keys(this.coords).findIndex(function(id) {
return _this4.coords[id].type === 'angle';
});
}
}, {
key: 'isPolar',
get: function get() {
return this.hueId !== null;
}
}, {
key: 'getFormat',
value: function getFormat(format) {
if (!format) {
return null;
}
if (format === 'default') {
format = Object.values(this.formats)[0];
} else if (typeof format === 'string') {
format = this.formats[format];
}
var ret = Format_default.get(format, this);
if (ret !== format && format.name in this.formats) {
this.formats[format.name] = ret;
}
return ret;
}
}, {
key: 'equals',
value: function equals(space) {
if (!space) {
return false;
}
return this === space || this.id === space || this.id === space.id;
}
}, {
key: 'to',
value: function to(space, coords) {
if (arguments.length === 1) {
var color = getColor(space);
var _ref11 = [ color.space, color.coords ];
space = _ref11[0];
coords = _ref11[1];
}
space = _ColorSpace2.get(space);
if (this.equals(space)) {
return coords;
}
coords = coords.map(function(c4) {
return _isNone(c4) ? 0 : c4;
});
var myPath = this.path;
var otherPath = space.path;
var connectionSpace, connectionSpaceIndex;
for (var i = 0; i < myPath.length; i++) {
if (myPath[i].equals(otherPath[i])) {
connectionSpace = myPath[i];
connectionSpaceIndex = i;
} else {
break;
}
}
if (!connectionSpace) {
throw new Error('Cannot convert between color spaces '.concat(this, ' and ').concat(space, ': no connection space was found'));
}
for (var _i2 = myPath.length - 1; _i2 > connectionSpaceIndex; _i2--) {
coords = myPath[_i2].toBase(coords);
}
for (var _i3 = connectionSpaceIndex + 1; _i3 < otherPath.length; _i3++) {
coords = otherPath[_i3].fromBase(coords);
}
return coords;
}
}, {
key: 'from',
value: function from(space, coords) {
if (arguments.length === 1) {
var color = getColor(space);
var _ref12 = [ color.space, color.coords ];
space = _ref12[0];
coords = _ref12[1];
}
space = _ColorSpace2.get(space);
return space.to(this, coords);
}
}, {
key: 'toString',
value: function toString() {
return ''.concat(this.name, ' (').concat(this.id, ')');
}
}, {
key: 'getMinCoords',
value: function getMinCoords() {
var ret = [];
for (var id in this.coords) {
var _range2$min;
var meta = this.coords[id];
var range2 = meta.range || meta.refRange;
ret.push((_range2$min = range2 === null || range2 === void 0 ? void 0 : range2.min) !== null && _range2$min !== void 0 ? _range2$min : 0);
}
return ret;
}
} ], [ {
key: 'all',
get: function get() {
return _toConsumableArray(new Set(Object.values(_ColorSpace2.registry)));
}
}, {
key: 'register',
value: function register(id, space) {
if (arguments.length === 1) {
space = arguments[0];
id = space.id;
}
space = this.get(space);
if (this.registry[id] && this.registry[id] !== space) {
throw new Error('Duplicate color space registration: \''.concat(id, '\''));
}
this.registry[id] = space;
if (arguments.length === 1 && space.aliases) {
var _iterator4 = _createForOfIteratorHelper(space.aliases), _step4;
try {
for (_iterator4.s(); !(_step4 = _iterator4.n()).done; ) {
var alias = _step4.value;
this.register(alias, space);
}
} catch (err) {
_iterator4.e(err);
} finally {
_iterator4.f();
}
}
return space;
}
}, {
key: 'get',
value: function get(space) {
if (!space || _isInstance(space, this)) {
return space;
}
var argType = _type(space);
if (argType === 'string') {
var ret = _ColorSpace2.registry[space.toLowerCase()];
if (!ret) {
throw new TypeError('No color space found with id = "'.concat(space, '"'));
}
return ret;
}
for (var _len2 = arguments.length, alternatives = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
alternatives[_key2 - 1] = arguments[_key2];
}
if (alternatives.length) {
return _ColorSpace2.get.apply(_ColorSpace2, alternatives);
}
throw new TypeError(''.concat(space, ' is not a valid color space'));
}
}, {
key: 'findFormat',
value: function findFormat(filters) {
var spaces = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _ColorSpace2.all;
if (!filters) {
return null;
}
if (typeof filters === 'string') {
filters = {
name: filters
};
}
var _iterator5 = _createForOfIteratorHelper(spaces), _step5;
try {
for (_iterator5.s(); !(_step5 = _iterator5.n()).done; ) {
var space = _step5.value;
var _loop2 = function _loop2() {
var _format$name, _format$type;
var _Object$entries$_i = _slicedToArray(_Object$entries[_i4], 2), name = _Object$entries$_i[0], format = _Object$entries$_i[1];
(_format$name = format.name) !== null && _format$name !== void 0 ? _format$name : format.name = name;
(_format$type = format.type) !== null && _format$type !== void 0 ? _format$type : format.type = 'function';
var matches4 = (!filters.name || format.name === filters.name) && (!filters.type || format.type === filters.type);
if (filters.id) {
var ids = format.ids || [ format.id ];
var filterIds = Array.isArray(filters.id) ? filters.id : [ filters.id ];
matches4 && (matches4 = filterIds.some(function(id) {
return ids.includes(id);
}));
}
if (matches4) {
var ret = Format_default.get(format, space);
if (ret !== format) {
space.formats[format.name] = ret;
}
return {
v: ret
};
}
}, _ret;
for (var _i4 = 0, _Object$entries = Object.entries(space.formats); _i4 < _Object$entries.length; _i4++) {
_ret = _loop2();
if (_ret) {
return _ret.v;
}
}
}
} catch (err) {
_iterator5.e(err);
} finally {
_iterator5.f();
}
return null;
}
}, {
key: 'resolveCoord',
value: function resolveCoord(ref, workingSpace) {
var coordType = _type(ref);
var space, coord;
if (coordType === 'string') {
if (ref.includes('.')) {
var _ref$split = ref.split('.');
var _ref$split2 = _slicedToArray(_ref$split, 2);
space = _ref$split2[0];
coord = _ref$split2[1];
} else {
space = void 0;
coord = ref;
}
} else if (Array.isArray(ref)) {
var _ref13 = _slicedToArray(ref, 2);
space = _ref13[0];
coord = _ref13[1];
} else {
space = ref.space;
coord = ref.coordId;
}
space = _ColorSpace2.get(space);
if (!space) {
space = workingSpace;
}
if (!space) {
throw new TypeError('Cannot resolve coordinate reference '.concat(ref, ': No color space specified and relative references are not allowed here'));
}
coordType = _type(coord);
if (coordType === 'number' || coordType === 'string' && coord >= 0) {
var meta = Object.entries(space.coords)[coord];
if (meta) {
return _extends({
space: space,
id: meta[0],
index: coord
}, meta[1]);
}
}
space = _ColorSpace2.get(space);
var normalizedCoord = coord.toLowerCase();
var i = 0;
for (var id in space.coords) {
var _meta$name;
var _meta = space.coords[id];
if (id.toLowerCase() === normalizedCoord || ((_meta$name = _meta.name) === null || _meta$name === void 0 ? void 0 : _meta$name.toLowerCase()) === normalizedCoord) {
return _extends({
space: space,
id: id,
index: i
}, _meta);
}
i++;
}
throw new TypeError('No "'.concat(coord, '" coordinate found in ').concat(space.name, '. Its coordinates are: ').concat(Object.keys(space.coords).join(', ')));
}
} ]);
}();
var ColorSpace = _ColorSpace2;
__publicField(ColorSpace, 'registry', {});
__publicField(ColorSpace, 'DEFAULT_FORMAT', {
type: 'functions',
name: 'color'
});
var ColorSpace_default = ColorSpace;
function getPath(space) {
var ret = [ space ];
for (var s = space; s = s.base; ) {
ret.push(s);
}
return ret;
}
var xyz_d65_default = new ColorSpace_default({
id: 'xyz-d65',
name: 'XYZ D65',
coords: {
x: {
refRange: [ 0, 1 ],
name: 'X'
},
y: {
refRange: [ 0, 1 ],
name: 'Y'
},
z: {
refRange: [ 0, 1 ],
name: 'Z'
}
},
white: 'D65',
formats: {
color: {
ids: [ 'xyz-d65', 'xyz' ]
}
},
aliases: [ 'xyz' ]
});
var RGBColorSpace = function(_ColorSpace_default) {
function RGBColorSpace(options) {
var _options$toXYZ_M, _options$M2, _options$fromXYZ_M, _options$M3, _options$referred;
var _this5;
_classCallCheck(this, RGBColorSpace);
if (!options.coords) {
options.coords = {
r: {
range: [ 0, 1 ],
name: 'Red'
},
g: {
range: [ 0, 1 ],
name: 'Green'
},
b: {
range: [ 0, 1 ],
name: 'Blue'
}
};
}
if (!options.base) {
options.base = xyz_d65_default;
}
var toXYZ2 = (_options$toXYZ_M = options.toXYZ_M) !== null && _options$toXYZ_M !== void 0 ? _options$toXYZ_M : (_options$M2 = options.M) === null || _options$M2 === void 0 ? void 0 : _options$M2.toXYZ;
var fromXYZ2 = (_options$fromXYZ_M = options.fromXYZ_M) !== null && _options$fromXYZ_M !== void 0 ? _options$fromXYZ_M : (_options$M3 = options.M) === null || _options$M3 === void 0 ? void 0 : _options$M3.fromXYZ;
(_options$referred = options.referred) !== null && _options$referred !== void 0 ? _options$referred : options.referred = 'display';
_this5 = _callSuper(this, RGBColorSpace, [ options ]);
if (toXYZ2 && fromXYZ2) {
_this5.M.toXYZ = toXYZ2;
_this5.M.fromXYZ = fromXYZ2;
}
return _this5;
}
_inherits(RGBColorSpace, _ColorSpace_default);
return _createClass(RGBColorSpace, [ {
key: 'toBase',
value: function toBase(rgb) {
var xyz = _multiply_v3_m3x(rgb, this.M.toXYZ);
if (this.white !== this.base.white) {
xyz = adapt(this.white, this.base.white, xyz);
}
return xyz;
}
}, {
key: 'fromBase',
value: function fromBase(xyz) {
xyz = adapt(this.base.white, this.white, xyz);
return _multiply_v3_m3x(xyz, this.M.fromXYZ);
}
} ]);
}(ColorSpace_default);
var RGBColorSpace_default = RGBColorSpace;
var xyz_d50_default = new ColorSpace_default({
id: 'xyz-d50',
name: 'XYZ D50',
white: 'D50',
base: xyz_d65_default,
fromBase: function fromBase(coords) {
return adapt(xyz_d65_default.white, 'D50', coords);
},
toBase: function toBase(coords) {
return adapt('D50', xyz_d65_default.white, coords);
}
});
var \u03b52 = 216 / 24389;
var \u03b53 = 24 / 116;
var \u03ba = 24389 / 27;
var white = WHITES.D50;
var lab_default = new ColorSpace_default({
id: 'lab',
name: 'Lab',
coords: {
l: {
refRange: [ 0, 100 ],
name: 'Lightness'
},
a: {
refRange: [ -125, 125 ]
},
b: {
refRange: [ -125, 125 ]
}
},
white: white,
base: xyz_d50_default,
fromBase: function fromBase(XYZ) {
var xyz = XYZ.map(function(value, i) {
return value / white[i];
});
var f = xyz.map(function(value) {
return value > \u03b52 ? Math.cbrt(value) : (\u03ba * value + 16) / 116;
});
var L = 116 * f[1] - 16;
var a2 = 500 * (f[0] - f[1]);
var b3 = 200 * (f[1] - f[2]);
return [ L, a2, b3 ];
},
toBase: function toBase(Lab) {
var _Lab = _slicedToArray(Lab, 3), L = _Lab[0], a2 = _Lab[1], b3 = _Lab[2];
var f = [];
f[1] = (L + 16) / 116;
f[0] = a2 / 500 + f[1];
f[2] = f[1] - b3 / 200;
var xyz = [ f[0] > \u03b53 ? Math.pow(f[0], 3) : (116 * f[0] - 16) / \u03ba, Lab[0] > 8 ? Math.pow((Lab[0] + 16) / 116, 3) : Lab[0] / \u03ba, f[2] > \u03b53 ? Math.pow(f[2], 3) : (116 * f[2] - 16) / \u03ba ];
return xyz.map(function(value, i) {
return value * white[i];
});
},
formats: {
lab: {
coords: [ '<percentage> | <number>', '<number> | <percentage>', '<number> | <percentage>' ]
}
}
});
function constrain(angle) {
if (typeof angle !== 'number') {
return angle;
}
return (angle % 360 + 360) % 360;
}
function adjust(arc, angles2) {
var _angles = _slicedToArray(angles2, 2), a1 = _angles[0], a2 = _angles[1];
var none1 = _isNone(a1);
var none2 = _isNone(a2);
if (none1 && none2) {
return [ a1, a2 ];
} else if (none1) {
a1 = a2;
} else if (none2) {
a2 = a1;
}
if (arc === 'raw') {
return angles2;
}
a1 = constrain(a1);
a2 = constrain(a2);
var angleDiff = a2 - a1;
if (arc === 'increasing') {
if (angleDiff < 0) {
a2 += 360;
}
} else if (arc === 'decreasing') {
if (angleDiff > 0) {
a1 += 360;
}
} else if (arc === 'longer') {
if (-180 < angleDiff && angleDiff < 180) {
if (angleDiff > 0) {
a1 += 360;
} else {
a2 += 360;
}
}
} else if (arc === 'shorter') {
if (angleDiff > 180) {
a1 += 360;
} else if (angleDiff < -180) {
a2 += 360;
}
}
return [ a1, a2 ];
}
var lch_default = new ColorSpace_default({
id: 'lch',
name: 'LCH',
coords: {
l: {
refRange: [ 0, 100 ],
name: 'Lightness'
},
c: {
refRange: [ 0, 150 ],
name: 'Chroma'
},
h: {
refRange: [ 0, 360 ],
type: 'angle',
name: 'Hue'
}
},
base: lab_default,
fromBase: function fromBase(Lab) {
if (this.\u03b5 === void 0) {
var range2 = Object.values(this.base.coords)[1].refRange;
var extent = range2[1] - range2[0];
this.\u03b5 = extent / 1e5;
}
var _Lab2 = _slicedToArray(Lab, 3), L = _Lab2[0], a2 = _Lab2[1], b3 = _Lab2[2];
var isAchromatic = Math.abs(a2) < this.\u03b5 && Math.abs(b3) < this.\u03b5;
var h = isAchromatic ? null : constrain(Math.atan2(b3, a2) * 180 / Math.PI);
var C = isAchromatic ? 0 : Math.sqrt(Math.pow(a2, 2) + Math.pow(b3, 2));
return [ L, C, h ];
},
toBase: function toBase(lch) {
var _lch = _slicedToArray(lch, 3), L = _lch[0], C = _lch[1], h = _lch[2];
var a2 = null, b3 = null;
if (!_isNone(h)) {
C = C < 0 ? 0 : C;
a2 = C * Math.cos(h * Math.PI / 180);
b3 = C * Math.sin(h * Math.PI / 180);
}
return [ L, a2, b3 ];
},
formats: {
lch: {
coords: [ '<percentage> | <number>', '<number> | <percentage>', '<number> | <angle>' ]
}
}
});
var Gfactor = Math.pow(25, 7);
var \u03c0 = Math.PI;
var r2d = 180 / \u03c0;
var d2r = \u03c0 / 180;
function pow7(x) {
var x2 = x * x;
var x7 = x2 * x2 * x2 * x;
return x7;
}
function deltaE2000_default(color, sample) {
var _ref14 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}, _ref14$kL = _ref14.kL, kL = _ref14$kL === void 0 ? 1 : _ref14$kL, _ref14$kC = _ref14.kC, kC = _ref14$kC === void 0 ? 1 : _ref14$kC, _ref14$kH = _ref14.kH, kH = _ref14$kH === void 0 ? 1 : _ref14$kH;
var _getColor = getColor([ color, sample ]);
var _getColor2 = _slicedToArray(_getColor, 2);
color = _getColor2[0];
sample = _getColor2[1];
var _lab_default$from = lab_default.from(color), _lab_default$from2 = _slicedToArray(_lab_default$from, 3), L1 = _lab_default$from2[0], a1 = _lab_default$from2[1], b1 = _lab_default$from2[2];
var C1 = lch_default.from(lab_default, [ L1, a1, b1 ])[1];
var _lab_default$from3 = lab_default.from(sample), _lab_default$from4 = _slicedToArray(_lab_default$from3, 3), L2 = _lab_default$from4[0], a2 = _lab_default$from4[1], b22 = _lab_default$from4[2];
var C2 = lch_default.from(lab_default, [ L2, a2, b22 ])[1];
if (C1 < 0) {
C1 = 0;
}
if (C2 < 0) {
C2 = 0;
}
var Cbar = (C1 + C2) / 2;
var C7 = pow7(Cbar);
var G = .5 * (1 - Math.sqrt(C7 / (C7 + Gfactor)));
var adash1 = (1 + G) * a1;
var adash2 = (1 + G) * a2;
var Cdash1 = Math.sqrt(Math.pow(adash1, 2) + Math.pow(b1, 2));
var Cdash2 = Math.sqrt(Math.pow(adash2, 2) + Math.pow(b22, 2));
var h1 = adash1 === 0 && b1 === 0 ? 0 : Math.atan2(b1, adash1);
var h2 = adash2 === 0 && b22 === 0 ? 0 : Math.atan2(b22, adash2);
if (h1 < 0) {
h1 += 2 * \u03c0;
}
if (h2 < 0) {
h2 += 2 * \u03c0;
}
h1 *= r2d;
h2 *= r2d;
var \u0394L = L2 - L1;
var \u0394C = Cdash2 - Cdash1;
var hdiff = h2 - h1;
var hsum = h1 + h2;
var habs = Math.abs(hdiff);
var \u0394h;
if (Cdash1 * Cdash2 === 0) {
\u0394h = 0;
} else if (habs <= 180) {
\u0394h = hdiff;
} else if (hdiff > 180) {
\u0394h = hdiff - 360;
} else if (hdiff < -180) {
\u0394h = hdiff + 360;
} else {
defaults_default.warn('the unthinkable has happened');
}
var \u0394H = 2 * Math.sqrt(Cdash2 * Cdash1) * Math.sin(\u0394h * d2r / 2);
var Ldash = (L1 + L2) / 2;
var Cdash = (Cdash1 + Cdash2) / 2;
var Cdash7 = pow7(Cdash);
var hdash;
if (Cdash1 * Cdash2 === 0) {
hdash = hsum;
} else if (habs <= 180) {
hdash = hsum / 2;
} else if (hsum < 360) {
hdash = (hsum + 360) / 2;
} else {
hdash = (hsum - 360) / 2;
}
var lsq = Math.pow(Ldash - 50, 2);
var SL = 1 + .015 * lsq / Math.sqrt(20 + lsq);
var SC = 1 + .045 * Cdash;
var T = 1;
T -= .17 * Math.cos((hdash - 30) * d2r);
T += .24 * Math.cos(2 * hdash * d2r);
T += .32 * Math.cos((3 * hdash + 6) * d2r);
T -= .2 * Math.cos((4 * hdash - 63) * d2r);
var SH = 1 + .015 * Cdash * T;
var \u0394\u03b8 = 30 * Math.exp(-1 * Math.pow((hdash - 275) / 25, 2));
var RC = 2 * Math.sqrt(Cdash7 / (Cdash7 + Gfactor));
var RT = -1 * Math.sin(2 * \u0394\u03b8 * d2r) * RC;
var dE = Math.pow(\u0394L / (kL * SL), 2);
dE += Math.pow(\u0394C / (kC * SC), 2);
dE += Math.pow(\u0394H / (kH * SH), 2);
dE += RT * (\u0394C / (kC * SC)) * (\u0394H / (kH * SH));
return Math.sqrt(dE);
}
var M = {
XYZtoLMS: [ [ .819022437996703, .3619062600528904, -.1288737815209879 ], [ .0329836539323885, .9292868615863434, .0361446663506424 ], [ .0481771893596242, .2642395317527308, .6335478284694309 ] ],
LMStoXYZ: [ [ 1.2268798758459243, -.5578149944602171, .2813910456659647 ], [ -.0405757452148008, 1.112286803280317, -.0717110580655164 ], [ -.0763729366746601, -.4214933324022432, 1.5869240198367816 ] ],
LMStoLab: [ [ .210454268309314, .7936177747023054, -.0040720430116193 ], [ 1.9779985324311684, -2.42859224204858, .450593709617411 ], [ .0259040424655478, .7827717124575296, -.8086757549230774 ] ],
LabtoLMS: [ [ 1, .3963377773761749, .2158037573099136 ], [ 1, -.1055613458156586, -.0638541728258133 ], [ 1, -.0894841775298119, -1.2914855480194092 ] ]
};
var oklab_default = new ColorSpace_default({
id: 'oklab',
name: 'Oklab',
coords: {
l: {
refRange: [ 0, 1 ],
name: 'Lightness'
},
a: {
refRange: [ -.4, .4 ]
},
b: {
refRange: [ -.4, .4 ]
}
},
white: 'D65',
base: xyz_d65_default,
M: M,
fromBase: function fromBase(XYZ) {
var LMS = _multiply_v3_m3x(XYZ, M.XYZtoLMS);
LMS[0] = Math.cbrt(LMS[0]);
LMS[1] = Math.cbrt(LMS[1]);
LMS[2] = Math.cbrt(LMS[2]);
return _multiply_v3_m3x(LMS, M.LMStoLab, LMS);
},
toBase: function toBase(OKLab) {
var LMSg = _multiply_v3_m3x(OKLab, M.LabtoLMS);
LMSg[0] = Math.pow(LMSg[0], 3);
LMSg[1] = Math.pow(LMSg[1], 3);
LMSg[2] = Math.pow(LMSg[2], 3);
return _multiply_v3_m3x(LMSg, M.LMStoXYZ, LMSg);
},
formats: {
oklab: {
coords: [ '<percentage> | <number>', '<number> | <percentage>', '<number> | <percentage>' ]
}
}
});
function deltaEOK_default(color, sample) {
var _getColor3 = getColor([ color, sample ]);
var _getColor4 = _slicedToArray(_getColor3, 2);
color = _getColor4[0];
sample = _getColor4[1];
var _oklab_default$from = oklab_default.from(color), _oklab_default$from2 = _slicedToArray(_oklab_default$from, 3), L1 = _oklab_default$from2[0], a1 = _oklab_default$from2[1], b1 = _oklab_default$from2[2];
var _oklab_default$from3 = oklab_default.from(sample), _oklab_default$from4 = _slicedToArray(_oklab_default$from3, 3), L2 = _oklab_default$from4[0], a2 = _oklab_default$from4[1], b22 = _oklab_default$from4[2];
var \u0394L = L1 - L2;
var \u0394a = a1 - a2;
var \u0394b = b1 - b22;
return Math.sqrt(Math.pow(\u0394L, 2) + Math.pow(\u0394a, 2) + Math.pow(\u0394b, 2));
}
var \u03b54 = 75e-6;
function inGamut(color, space) {
var _ref15 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}, _ref15$epsilon = _ref15.epsilon, epsilon = _ref15$epsilon === void 0 ? \u03b54 : _ref15$epsilon;
color = getColor(color);
if (!space) {
space = color.space;
}
space = ColorSpace_default.get(space);
var coords = color.coords;
if (space !== color.space) {
coords = space.from(color);
}
return space.inGamut(coords, {
epsilon: epsilon
});
}
function to(color, space) {
var _ref16 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}, inGamut2 = _ref16.inGamut;
color = getColor(color);
space = ColorSpace_default.get(space);
var coords = space.from(color);
var ret = {
space: space,
coords: coords,
alpha: color.alpha
};
if (inGamut2) {
ret = toGamut(ret, inGamut2 === true ? void 0 : inGamut2);
}
return ret;
}
to.returns = 'color';
function getAll(color, options) {
color = getColor(color);
var space = ColorSpace_default.get(options, options === null || options === void 0 ? void 0 : options.space);
var precision = options === null || options === void 0 ? void 0 : options.precision;
var coords;
if (!space || color.space.equals(space)) {
coords = color.coords.slice();
} else {
coords = space.from(color);
}
return precision === void 0 ? coords : coords.map(function(coord) {
return _toPrecision(coord, precision);
});
}
function get(color, prop) {
color = getColor(color);
if (prop === 'alpha') {
var _color$alpha;
return (_color$alpha = color.alpha) !== null && _color$alpha !== void 0 ? _color$alpha : 1;
}
var _ColorSpace_default$r2 = ColorSpace_default.resolveCoord(prop, color.space), space = _ColorSpace_default$r2.space, index = _ColorSpace_default$r2.index;
var coords = getAll(color, space);
return coords[index];
}
var oklch_default = new ColorSpace_default({
id: 'oklch',
name: 'OkLCh',
coords: {
l: {
refRange: [ 0, 1 ],
name: 'Lightness'
},
c: {
refRange: [ 0, .4 ],
name: 'Chroma'
},
h: {
refRange: [ 0, 360 ],
type: 'angle',
name: 'Hue'
}
},
white: 'D65',
base: oklab_default,
fromBase: lch_default.fromBase,
toBase: lch_default.toBase,
formats: {
oklch: {
coords: [ '<percentage> | <number>', '<number> | <percentage>', '<number> | <angle>' ]
}
}
});
function setAll(color, space, coords, alpha) {
color = getColor(color);
if (Array.isArray(space)) {
var _ref17 = [ color.space, space, coords ];
space = _ref17[0];
coords = _ref17[1];
alpha = _ref17[2];
}
space = ColorSpace_default.get(space);
color.coords = space === color.space ? coords.slice() : space.to(color.space, coords);
if (alpha !== void 0) {
color.alpha = alpha;
}
return color;
}
setAll.returns = 'color';
function set(color, prop, value) {
color = getColor(color);
if (arguments.length === 2 && _type(arguments[1]) === 'object') {
var object = arguments[1];
for (var p3 in object) {
set(color, p3, object[p3]);
}
} else {
if (typeof value === 'function') {
value = value(get(color, prop));
}
if (prop === 'alpha') {
color.alpha = value;
} else {
var _ColorSpace_default$r3 = ColorSpace_default.resolveCoord(prop, color.space), space = _ColorSpace_default$r3.space, index = _ColorSpace_default$r3.index;
var coords = getAll(color, space);
coords[index] = value;
setAll(color, space, coords);
}
}
return color;
}
set.returns = 'color';
function clone(color) {
return {
space: color.space,
coords: color.coords.slice(),
alpha: color.alpha
};
}
function distance(color1, color2) {
var space = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'lab';
space = ColorSpace_default.get(space);
var coords1 = space.from(color1);
var coords2 = space.from(color2);
return Math.sqrt(coords1.reduce(function(acc, c14, i) {
var c24 = coords2[i];
if (_isNone(c14) || _isNone(c24)) {
return acc;
}
return acc + Math.pow(c24 - c14, 2);
}, 0));
}
function deltaE76(color, sample) {
return distance(color, sample, 'lab');
}
var \u03c02 = Math.PI;
var d2r2 = \u03c02 / 180;
function deltaECMC_default(color, sample) {
var _ref18 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}, _ref18$l = _ref18.l, l = _ref18$l === void 0 ? 2 : _ref18$l, _ref18$c = _ref18.c, c4 = _ref18$c === void 0 ? 1 : _ref18$c;
var _getColor5 = getColor([ color, sample ]);
var _getColor6 = _slicedToArray(_getColor5, 2);
color = _getColor6[0];
sample = _getColor6[1];
var _lab_default$from5 = lab_default.from(color), _lab_default$from6 = _slicedToArray(_lab_default$from5, 3), L1 = _lab_default$from6[0], a1 = _lab_default$from6[1], b1 = _lab_default$from6[2];
var _lch_default$from = lch_default.from(lab_default, [ L1, a1, b1 ]), _lch_default$from2 = _slicedToArray(_lch_default$from, 3), C1 = _lch_default$from2[1], H1 = _lch_default$from2[2];
var _lab_default$from7 = lab_default.from(sample), _lab_default$from8 = _slicedToArray(_lab_default$from7, 3), L2 = _lab_default$from8[0], a2 = _lab_default$from8[1], b22 = _lab_default$from8[2];
var C2 = lch_default.from(lab_default, [ L2, a2, b22 ])[1];
if (C1 < 0) {
C1 = 0;
}
if (C2 < 0) {
C2 = 0;
}
var \u0394L = L1 - L2;
var \u0394C = C1 - C2;
var \u0394a = a1 - a2;
var \u0394b = b1 - b22;
var H2 = Math.pow(\u0394a, 2) + Math.pow(\u0394b, 2) - Math.pow(\u0394C, 2);
var SL = .511;
if (L1 >= 16) {
SL = .040975 * L1 / (1 + .01765 * L1);
}
var SC = .0638 * C1 / (1 + .0131 * C1) + .638;
var T;
if (_isNone(H1)) {
H1 = 0;
}
if (H1 >= 164 && H1 <= 345) {
T = .56 + Math.abs(.2 * Math.cos((H1 + 168) * d2r2));
} else {
T = .36 + Math.abs(.4 * Math.cos((H1 + 35) * d2r2));
}
var C4 = Math.pow(C1, 4);
var F = Math.sqrt(C4 / (C4 + 1900));
var SH = SC * (F * T + 1 - F);
var dE = Math.pow(\u0394L / (l * SL), 2);
dE += Math.pow(\u0394C / (c4 * SC), 2);
dE += H2 / Math.pow(SH, 2);
return Math.sqrt(dE);
}
var Yw = 203;
var xyz_abs_d65_default = new ColorSpace_default({
id: 'xyz-abs-d65',
cssId: '--xyz-abs-d65',
name: 'Absolute XYZ D65',
coords: {
x: {
refRange: [ 0, 9504.7 ],
name: 'Xa'
},
y: {
refRange: [ 0, 1e4 ],
name: 'Ya'
},
z: {
refRange: [ 0, 10888.3 ],
name: 'Za'
}
},
base: xyz_d65_default,
fromBase: function fromBase(XYZ) {
return XYZ.map(function(v) {
return v * Yw;
});
},
toBase: function toBase(AbsXYZ) {
return AbsXYZ.map(function(v) {
return v / Yw;
});
}
});
var b = 1.15;
var g = .66;
var n = 2610 / Math.pow(2, 14);
var ninv = Math.pow(2, 14) / 2610;
var c1 = 3424 / Math.pow(2, 12);
var c2 = 2413 / Math.pow(2, 7);
var c3 = 2392 / Math.pow(2, 7);
var p = 1.7 * 2523 / Math.pow(2, 5);
var pinv = Math.pow(2, 5) / (1.7 * 2523);
var d = -.56;
var d0 = 16295499532821565e-27;
var M2 = {
XYZtoCone: [ [ .41478972, .579999, .014648 ], [ -.20151, 1.120649, .0531008 ], [ -.0166008, .2648, .6684799 ] ],
ConetoXYZ: [ [ 1.9242264357876067, -1.0047923125953657, .037651404030618 ], [ .35031676209499907, .7264811939316552, -.06538442294808501 ], [ -.09098281098284752, -.3127282905230739, 1.5227665613052603 ] ],
ConetoIab: [ [ .5, .5, 0 ], [ 3.524, -4.066708, .542708 ], [ .199076, 1.096799, -1.295875 ] ],
IabtoCone: [ [ 1, .13860504327153927, .05804731615611883 ], [ 1, -.1386050432715393, -.058047316156118904 ], [ 1, -.09601924202631895, -.811891896056039 ] ]
};
var jzazbz_default = new ColorSpace_default({
id: 'jzazbz',
name: 'Jzazbz',
coords: {
jz: {
refRange: [ 0, 1 ],
name: 'Jz'
},
az: {
refRange: [ -.21, .21 ]
},
bz: {
refRange: [ -.21, .21 ]
}
},
base: xyz_abs_d65_default,
M: M2,
fromBase: function fromBase(XYZ) {
var _XYZ = _slicedToArray(XYZ, 3), Xa = _XYZ[0], Ya = _XYZ[1], Za = _XYZ[2];
var Xm = b * Xa - (b - 1) * Za;
var Ym = g * Ya - (g - 1) * Xa;
var LMS = _multiply_v3_m3x([ Xm, Ym, Za ], M2.XYZtoCone);
var PQLMS = LMS.map(function(val) {
var num = c1 + c2 * _spow(val / 1e4, n);
var denom = 1 + c3 * _spow(val / 1e4, n);
return _spow(num / denom, p);
});
var _multiply_v3_m3x2 = _multiply_v3_m3x(PQLMS, M2.ConetoIab), _multiply_v3_m3x3 = _slicedToArray(_multiply_v3_m3x2, 3), Iz = _multiply_v3_m3x3[0], az = _multiply_v3_m3x3[1], bz = _multiply_v3_m3x3[2];
var Jz = (1 + d) * Iz / (1 + d * Iz) - d0;
return [ Jz, az, bz ];
},
toBase: function toBase(Jzazbz) {
var _Jzazbz = _slicedToArray(Jzazbz, 3), Jz = _Jzazbz[0], az = _Jzazbz[1], bz = _Jzazbz[2];
var Iz = (Jz + d0) / (1 + d - d * (Jz + d0));
var PQLMS = _multiply_v3_m3x([ Iz, az, bz ], M2.IabtoCone);
var LMS = PQLMS.map(function(val) {
var num = c1 - _spow(val, pinv);
var denom = c3 * _spow(val, pinv) - c2;
var x = 1e4 * _spow(num / denom, ninv);
return x;
});
var _multiply_v3_m3x4 = _multiply_v3_m3x(LMS, M2.ConetoXYZ), _multiply_v3_m3x5 = _slicedToArray(_multiply_v3_m3x4, 3), Xm = _multiply_v3_m3x5[0], Ym = _multiply_v3_m3x5[1], Za = _multiply_v3_m3x5[2];
var Xa = (Xm + (b - 1) * Za) / b;
var Ya = (Ym + (g - 1) * Xa) / g;
return [ Xa, Ya, Za ];
},
formats: {
jzazbz: {
coords: [ '<percentage> | <number>', '<number> | <percentage>', '<number> | <percentage>' ]
}
}
});
var jzczhz_default = new ColorSpace_default({
id: 'jzczhz',
name: 'JzCzHz',
coords: {
jz: {
refRange: [ 0, 1 ],
name: 'Jz'
},
cz: {
refRange: [ 0, .26 ],
name: 'Chroma'
},
hz: {
refRange: [ 0, 360 ],
type: 'angle',
name: 'Hue'
}
},
base: jzazbz_default,
fromBase: lch_default.fromBase,
toBase: lch_default.toBase,
formats: {
jzczhz: {
coords: [ '<percentage> | <number>', '<number> | <percentage>', '<number> | <angle>' ]
}
}
});
function deltaEJz_default(color, sample) {
var _getColor7 = getColor([ color, sample ]);
var _getColor8 = _slicedToArray(_getColor7, 2);
color = _getColor8[0];
sample = _getColor8[1];
var _jzczhz_default$from = jzczhz_default.from(color), _jzczhz_default$from2 = _slicedToArray(_jzczhz_default$from, 3), Jz1 = _jzczhz_default$from2[0], Cz1 = _jzczhz_default$from2[1], Hz1 = _jzczhz_default$from2[2];
var _jzczhz_default$from3 = jzczhz_default.from(sample), _jzczhz_default$from4 = _slicedToArray(_jzczhz_default$from3, 3), Jz2 = _jzczhz_default$from4[0], Cz2 = _jzczhz_default$from4[1], Hz2 = _jzczhz_default$from4[2];
var \u0394J = Jz1 - Jz2;
var \u0394C = Cz1 - Cz2;
if (_isNone(Hz1) && _isNone(Hz2)) {
Hz1 = 0;
Hz2 = 0;
} else if (_isNone(Hz1)) {
Hz1 = Hz2;
} else if (_isNone(Hz2)) {
Hz2 = Hz1;
}
var \u0394h = Hz1 - Hz2;
var \u0394H = 2 * Math.sqrt(Cz1 * Cz2) * Math.sin(\u0394h / 2 * (Math.PI / 180));
return Math.sqrt(Math.pow(\u0394J, 2) + Math.pow(\u0394C, 2) + Math.pow(\u0394H, 2));
}
var c12 = 3424 / 4096;
var c22 = 2413 / 128;
var c32 = 2392 / 128;
var m1 = 2610 / 16384;
var m2 = 2523 / 32;
var im1 = 16384 / 2610;
var im2 = 32 / 2523;
var M3 = {
XYZtoLMS: [ [ .3592832590121217, .6976051147779502, -.035891593232029 ], [ -.1920808463704993, 1.100476797037432, .0753748658519118 ], [ .0070797844607479, .0748396662186362, .8433265453898765 ] ],
LMStoIPT: [ [ 2048 / 4096, 2048 / 4096, 0 ], [ 6610 / 4096, -13613 / 4096, 7003 / 4096 ], [ 17933 / 4096, -17390 / 4096, -543 / 4096 ] ],
IPTtoLMS: [ [ .9999999999999998, .0086090370379328, .111029625003026 ], [ .9999999999999998, -.0086090370379328, -.1110296250030259 ], [ .9999999999999998, .5600313357106791, -.3206271749873188 ] ],
LMStoXYZ: [ [ 2.0701522183894223, -1.3263473389671563, .2066510476294053 ], [ .3647385209748072, .6805660249472273, -.0453045459220347 ], [ -.0497472075358123, -.0492609666966131, 1.1880659249923042 ] ]
};
var ictcp_default = new ColorSpace_default({
id: 'ictcp',
name: 'ICTCP',
coords: {
i: {
refRange: [ 0, 1 ],
name: 'I'
},
ct: {
refRange: [ -.5, .5 ],
name: 'CT'
},
cp: {
refRange: [ -.5, .5 ],
name: 'CP'
}
},
base: xyz_abs_d65_default,
M: M3,
fromBase: function fromBase(XYZ) {
var LMS = _multiply_v3_m3x(XYZ, M3.XYZtoLMS);
return LMStoICtCp(LMS);
},
toBase: function toBase(ICtCp) {
var LMS = ICtCptoLMS(ICtCp);
return _multiply_v3_m3x(LMS, M3.LMStoXYZ);
},
formats: {
ictcp: {
coords: [ '<percentage> | <number>', '<number> | <percentage>', '<number> | <percentage>' ]
}
}
});
function LMStoICtCp(LMS) {
var PQLMS = LMS.map(function(val) {
var num = c12 + c22 * Math.pow(val / 1e4, m1);
var denom = 1 + c32 * Math.pow(val / 1e4, m1);
return Math.pow(num / denom, m2);
});
return _multiply_v3_m3x(PQLMS, M3.LMStoIPT);
}
function ICtCptoLMS(ICtCp) {
var PQLMS = _multiply_v3_m3x(ICtCp, M3.IPTtoLMS);
var LMS = PQLMS.map(function(val) {
var num = Math.max(Math.pow(val, im2) - c12, 0);
var denom = c22 - c32 * Math.pow(val, im2);
return 1e4 * Math.pow(num / denom, im1);
});
return LMS;
}
function deltaEITP_default(color, sample) {
var _getColor9 = getColor([ color, sample ]);
var _getColor0 = _slicedToArray(_getColor9, 2);
color = _getColor0[0];
sample = _getColor0[1];
var _ictcp_default$from = ictcp_default.from(color), _ictcp_default$from2 = _slicedToArray(_ictcp_default$from, 3), I1 = _ictcp_default$from2[0], T1 = _ictcp_default$from2[1], P1 = _ictcp_default$from2[2];
var _ictcp_default$from3 = ictcp_default.from(sample), _ictcp_default$from4 = _slicedToArray(_ictcp_default$from3, 3), I2 = _ictcp_default$from4[0], T2 = _ictcp_default$from4[1], P2 = _ictcp_default$from4[2];
return 720 * Math.sqrt(Math.pow(I1 - I2, 2) + .25 * Math.pow(T1 - T2, 2) + Math.pow(P1 - P2, 2));
}
function deltaEOK2_default(color, sample) {
var _getColor1 = getColor([ color, sample ]);
var _getColor10 = _slicedToArray(_getColor1, 2);
color = _getColor10[0];
sample = _getColor10[1];
var abscale = 2;
var _oklab_default$from5 = oklab_default.from(color), _oklab_default$from6 = _slicedToArray(_oklab_default$from5, 3), L1 = _oklab_default$from6[0], a1 = _oklab_default$from6[1], b1 = _oklab_default$from6[2];
var _oklab_default$from7 = oklab_default.from(sample), _oklab_default$from8 = _slicedToArray(_oklab_default$from7, 3), L2 = _oklab_default$from8[0], a2 = _oklab_default$from8[1], b22 = _oklab_default$from8[2];
var \u0394L = L1 - L2;
var \u0394a = abscale * (a1 - a2);
var \u0394b = abscale * (b1 - b22);
return Math.sqrt(Math.pow(\u0394L, 2) + Math.pow(\u0394a, 2) + Math.pow(\u0394b, 2));
}
var white2 = WHITES.D65;
var adaptedCoef = .42;
var adaptedCoefInv = 1 / adaptedCoef;
var tau = 2 * Math.PI;
var M4 = {
cat16: [ [ .401288, .650173, -.051461 ], [ -.250268, 1.204414, .045854 ], [ -.002079, .048952, .953127 ] ],
cat16Inv: [ [ 1.8620678550872327, -1.0112546305316843, .14918677544445175 ], [ .38752654323613717, .6214474419314753, -.008973985167612518 ], [ -.015841498849333856, -.03412293802851557, 1.0499644368778496 ] ],
m1: [ [ 460, 451, 288 ], [ 460, -891, -261 ], [ 460, -220, -6300 ] ]
};
var surroundMap = {
dark: [ .8, .525, .8 ],
dim: [ .9, .59, .9 ],
average: [ 1, .69, 1 ]
};
var hueQuadMap = {
h: [ 20.14, 90, 164.25, 237.53, 380.14 ],
e: [ .8, .7, 1, 1.2, .8 ],
H: [ 0, 100, 200, 300, 400 ]
};
var rad2deg = 180 / Math.PI;
var deg2rad = Math.PI / 180;
function adapt2(coords, fl) {
var temp = coords.map(function(c4) {
var x = _spow(fl * Math.abs(c4) * .01, adaptedCoef);
return 400 * _copySign(x, c4) / (x + 27.13);
});
return temp;
}
function unadapt(adapted, fl) {
var constant = 100 / fl * Math.pow(27.13, adaptedCoefInv);
return adapted.map(function(c4) {
var cabs = Math.abs(c4);
return _copySign(constant * _spow(cabs / (400 - cabs), adaptedCoefInv), c4);
});
}
function hueQuadrature(h) {
var hp = constrain(h);
if (hp <= hueQuadMap.h[0]) {
hp += 360;
}
var i = _bisectLeft(hueQuadMap.h, hp) - 1;
var _hueQuadMap$h$slice = hueQuadMap.h.slice(i, i + 2), _hueQuadMap$h$slice2 = _slicedToArray(_hueQuadMap$h$slice, 2), hi = _hueQuadMap$h$slice2[0], hii = _hueQuadMap$h$slice2[1];
var _hueQuadMap$e$slice = hueQuadMap.e.slice(i, i + 2), _hueQuadMap$e$slice2 = _slicedToArray(_hueQuadMap$e$slice, 2), ei = _hueQuadMap$e$slice2[0], eii = _hueQuadMap$e$slice2[1];
var Hi = hueQuadMap.H[i];
var t = (hp - hi) / ei;
return Hi + 100 * t / (t + (hii - hp) / eii);
}
function invHueQuadrature(H) {
var Hp = (H % 400 + 400) % 400;
var i = Math.floor(.01 * Hp);
Hp = Hp % 100;
var _hueQuadMap$h$slice3 = hueQuadMap.h.slice(i, i + 2), _hueQuadMap$h$slice4 = _slicedToArray(_hueQuadMap$h$slice3, 2), hi = _hueQuadMap$h$slice4[0], hii = _hueQuadMap$h$slice4[1];
var _hueQuadMap$e$slice3 = hueQuadMap.e.slice(i, i + 2), _hueQuadMap$e$slice4 = _slicedToArray(_hueQuadMap$e$slice3, 2), ei = _hueQuadMap$e$slice4[0], eii = _hueQuadMap$e$slice4[1];
return constrain((Hp * (eii * hi - ei * hii) - 100 * hi * eii) / (Hp * (eii - ei) - 100 * eii));
}
function environment(refWhite, adaptingLuminance, backgroundLuminance, surround, discounting) {
var env = {};
env.discounting = discounting;
env.refWhite = refWhite;
env.surround = surround;
var xyzW = refWhite.map(function(c4) {
return c4 * 100;
});
env.la = adaptingLuminance;
env.yb = backgroundLuminance;
var yw = xyzW[1];
var rgbW = _multiply_v3_m3x(xyzW, M4.cat16);
var values2 = surroundMap[env.surround];
var f = values2[0];
env.c = values2[1];
env.nc = values2[2];
var k = 1 / (5 * env.la + 1);
var k4 = Math.pow(k, 4);
env.fl = k4 * env.la + .1 * (1 - k4) * (1 - k4) * Math.cbrt(5 * env.la);
env.flRoot = Math.pow(env.fl, .25);
env.n = env.yb / yw;
env.z = 1.48 + Math.sqrt(env.n);
env.nbb = .725 * Math.pow(env.n, -.2);
env.ncb = env.nbb;
var d2 = discounting ? 1 : Math.max(Math.min(f * (1 - 1 / 3.6 * Math.exp((-env.la - 42) / 92)), 1), 0);
env.dRgb = rgbW.map(function(c4) {
return _interpolate(1, yw / c4, d2);
});
env.dRgbInv = env.dRgb.map(function(c4) {
return 1 / c4;
});
var rgbCW = rgbW.map(function(c4, i) {
return c4 * env.dRgb[i];
});
var rgbAW = adapt2(rgbCW, env.fl);
env.aW = env.nbb * (2 * rgbAW[0] + rgbAW[1] + .05 * rgbAW[2]);
return env;
}
var viewingConditions = environment(white2, 64 / Math.PI * .2, 20, 'average', false);
function fromCam16(cam16, env) {
if (!(cam16.J !== void 0 ^ cam16.Q !== void 0)) {
throw new Error('Conversion requires one and only one: \'J\' or \'Q\'');
}
if (!(cam16.C !== void 0 ^ cam16.M !== void 0 ^ cam16.s !== void 0)) {
throw new Error('Conversion requires one and only one: \'C\', \'M\' or \'s\'');
}
if (!(cam16.h !== void 0 ^ cam16.H !== void 0)) {
throw new Error('Conversion requires one and only one: \'h\' or \'H\'');
}
if (cam16.J === 0 || cam16.Q === 0) {
return [ 0, 0, 0 ];
}
var hRad = 0;
if (cam16.h !== void 0) {
hRad = constrain(cam16.h) * deg2rad;
} else {
hRad = invHueQuadrature(cam16.H) * deg2rad;
}
var cosh = Math.cos(hRad);
var sinh = Math.sin(hRad);
var Jroot = 0;
if (cam16.J !== void 0) {
Jroot = _spow(cam16.J, 1 / 2) * .1;
} else if (cam16.Q !== void 0) {
Jroot = .25 * env.c * cam16.Q / ((env.aW + 4) * env.flRoot);
}
var alpha = 0;
if (cam16.C !== void 0) {
alpha = cam16.C / Jroot;
} else if (cam16.M !== void 0) {
alpha = cam16.M / env.flRoot / Jroot;
} else if (cam16.s !== void 0) {
alpha = 4e-4 * Math.pow(cam16.s, 2) * (env.aW + 4) / env.c;
}
var t = _spow(alpha * Math.pow(1.64 - Math.pow(.29, env.n), -.73), 10 / 9);
var et = .25 * (Math.cos(hRad + 2) + 3.8);
var A = env.aW * _spow(Jroot, 2 / env.c / env.z);
var p1 = 5e4 / 13 * env.nc * env.ncb * et;
var p22 = A / env.nbb;
var r = 23 * (p22 + .305) * _zdiv(t, 23 * p1 + t * (11 * cosh + 108 * sinh));
var a2 = r * cosh;
var b3 = r * sinh;
var rgb_c = unadapt(_multiply_v3_m3x([ p22, a2, b3 ], M4.m1).map(function(c4) {
return c4 * 1 / 1403;
}), env.fl);
return _multiply_v3_m3x(rgb_c.map(function(c4, i) {
return c4 * env.dRgbInv[i];
}), M4.cat16Inv).map(function(c4) {
return c4 / 100;
});
}
function toCam16(xyzd65, env) {
var xyz100 = xyzd65.map(function(c4) {
return c4 * 100;
});
var rgbA = adapt2(_multiply_v3_m3x(xyz100, M4.cat16).map(function(c4, i) {
return c4 * env.dRgb[i];
}), env.fl);
var a2 = rgbA[0] + (-12 * rgbA[1] + rgbA[2]) / 11;
var b3 = (rgbA[0] + rgbA[1] - 2 * rgbA[2]) / 9;
var hRad = (Math.atan2(b3, a2) % tau + tau) % tau;
var et = .25 * (Math.cos(hRad + 2) + 3.8);
var t = 5e4 / 13 * env.nc * env.ncb * _zdiv(et * Math.sqrt(Math.pow(a2, 2) + Math.pow(b3, 2)), rgbA[0] + rgbA[1] + 1.05 * rgbA[2] + .305);
var alpha = _spow(t, .9) * Math.pow(1.64 - Math.pow(.29, env.n), .73);
var A = env.nbb * (2 * rgbA[0] + rgbA[1] + .05 * rgbA[2]);
var Jroot = _spow(A / env.aW, .5 * env.c * env.z);
var J = 100 * _spow(Jroot, 2);
var Q = 4 / env.c * Jroot * (env.aW + 4) * env.flRoot;
var C = alpha * Jroot;
var colorfulness = C * env.flRoot;
var h = constrain(hRad * rad2deg);
var H = hueQuadrature(h);
var s = 50 * _spow(env.c * alpha / (env.aW + 4), 1 / 2);
return {
J: J,
C: C,
h: h,
s: s,
Q: Q,
M: colorfulness,
H: H
};
}
var cam16_default = new ColorSpace_default({
id: 'cam16-jmh',
cssId: '--cam16-jmh',
name: 'CAM16-JMh',
coords: {
j: {
refRange: [ 0, 100 ],
name: 'J'
},
m: {
refRange: [ 0, 105 ],
name: 'Colorfulness'
},
h: {
refRange: [ 0, 360 ],
type: 'angle',
name: 'Hue'
}
},
base: xyz_d65_default,
M: M4,
fromBase: function fromBase(xyz) {
if (this.\u03b5 === void 0) {
this.\u03b5 = Object.values(this.coords)[1].refRange[1] / 1e5;
}
var cam16 = toCam16(xyz, viewingConditions);
var isAchromatic = Math.abs(cam16.M) < this.\u03b5;
return [ cam16.J, isAchromatic ? 0 : cam16.M, isAchromatic ? null : cam16.h ];
},
toBase: function toBase(cam16) {
return fromCam16({
J: cam16[0],
M: cam16[1],
h: cam16[2]
}, viewingConditions);
}
});
var white3 = WHITES.D65;
var \u03b55 = 216 / 24389;
var \u03ba2 = 24389 / 27;
function toLstar(y) {
var fy = y > \u03b55 ? Math.cbrt(y) : (\u03ba2 * y + 16) / 116;
return 116 * fy - 16;
}
function fromLstar(lstar) {
return lstar > 8 ? Math.pow((lstar + 16) / 116, 3) : lstar / \u03ba2;
}
function fromHct(coords, env) {
var _coords = _slicedToArray(coords, 3), h = _coords[0], c4 = _coords[1], t = _coords[2];
var xyz = [];
var j = 0;
if (t === 0) {
return [ 0, 0, 0 ];
}
var y = fromLstar(t);
if (t > 0) {
j = .00379058511492914 * Math.pow(t, 2) + .608983189401032 * t + .9155088574762233;
} else {
j = 9514440756550361e-21 * Math.pow(t, 2) + .08693057439788597 * t - 21.928975842194614;
}
var threshold = 2e-12;
var max_attempts = 15;
var attempt = 0;
var last = Infinity;
var best = [ 0, 0, 0 ];
while (attempt <= max_attempts) {
xyz = fromCam16({
J: j,
C: c4,
h: h
}, env);
var delta = Math.abs(xyz[1] - y);
if (delta < last) {
if (delta <= threshold) {
return xyz;
}
best = xyz;
last = delta;
}
j = j - (xyz[1] - y) * j / (2 * xyz[1]);
attempt += 1;
}
return best;
}
function toHct(xyz, env) {
var t = toLstar(xyz[1]);
if (t === 0) {
return [ 0, 0, 0 ];
}
var cam16 = toCam16(xyz, viewingConditions2);
return [ constrain(cam16.h), cam16.C, t ];
}
var viewingConditions2 = environment(white3, 200 / Math.PI * fromLstar(50), fromLstar(50) * 100, 'average', false);
var hct_default = new ColorSpace_default({
id: 'hct',
name: 'HCT',
coords: {
h: {
refRange: [ 0, 360 ],
type: 'angle',
name: 'Hue'
},
c: {
refRange: [ 0, 145 ],
name: 'Colorfulness'
},
t: {
refRange: [ 0, 100 ],
name: 'Tone'
}
},
base: xyz_d65_default,
fromBase: function fromBase(xyz) {
if (this.\u03b5 === void 0) {
this.\u03b5 = Object.values(this.coords)[1].refRange[1] / 1e5;
}
var hct = toHct(xyz, viewingConditions2);
if (hct[1] < this.\u03b5) {
hct[1] = 0;
hct[0] = null;
}
return hct;
},
toBase: function toBase(hct) {
return fromHct(hct, viewingConditions2);
},
formats: {
color: {
id: '--hct',
coords: [ '<number> | <angle>', '<percentage> | <number>', '<percentage> | <number>' ]
}
}
});
var rad2deg2 = 180 / Math.PI;
var deg2rad2 = Math.PI / 180;
var ucsCoeff = [ 1, .007, .0228 ];
function convertUcsAb(coords) {
if (coords[1] < 0) {
coords = hct_default.fromBase(hct_default.toBase(coords));
}
var M15 = Math.log(Math.max(1 + ucsCoeff[2] * coords[1] * viewingConditions2.flRoot, 1)) / ucsCoeff[2];
var hrad = coords[0] * deg2rad2;
var a2 = M15 * Math.cos(hrad);
var b3 = M15 * Math.sin(hrad);
return [ coords[2], a2, b3 ];
}
function deltaEHCT_default(color, sample) {
var _getColor11 = getColor([ color, sample ]);
var _getColor12 = _slicedToArray(_getColor11, 2);
color = _getColor12[0];
sample = _getColor12[1];
var _convertUcsAb = convertUcsAb(hct_default.from(color)), _convertUcsAb2 = _slicedToArray(_convertUcsAb, 3), t1 = _convertUcsAb2[0], a1 = _convertUcsAb2[1], b1 = _convertUcsAb2[2];
var _convertUcsAb3 = convertUcsAb(hct_default.from(sample)), _convertUcsAb4 = _slicedToArray(_convertUcsAb3, 3), t2 = _convertUcsAb4[0], a2 = _convertUcsAb4[1], b22 = _convertUcsAb4[2];
return Math.sqrt(Math.pow(t1 - t2, 2) + Math.pow(a1 - a2, 2) + Math.pow(b1 - b22, 2));
}
var cos = Math.cos, sin = Math.sin, sqrt = Math.sqrt, atan2 = Math.atan2, exp = Math.exp, abs = Math.abs, pow = Math.pow, PI = Math.PI;
var CAT_TO_HELM = [ [ 1.000042977349746, 20718877053183e-18, -4361018085669474e-20 ], [ 26946201090235744e-21, .9999906145080147, -14898828405401079e-21 ], [ -7941753620756204e-21, 12875204405137254e-21, .9997859822609763 ] ];
var CAT_FROM_HELM = [ [ .9999570254019492, -2071874272730964e-20, 4361733292468361e-20 ], [ -2694517763358666e-20, 1.000009385946497, 1490098223546482e-20 ], [ 7943459292954202e-21, -1287824596735154e-20, 1.000214063706999 ] ];
var M1 = [ [ .7212986433113499, .45344826541531813, -.19288975751942616 ], [ -.788211869495579, 1.795241376757236, .0876172451181785 ], [ -.0917700599912156, .45765588659459255, 1.2922045513917677 ] ];
var M1_INV = [ [ 1.065107295808859, -.3150044075301121, .1803492381741039 ], [ .4721107713837796, .4271995765962455, .04150680489380985 ], [ -.09156391926309541, -.1736709363194979, .7719790382558294 ] ];
var GAMMA = [ .47229813098762524, .5149184096354483, .5113233386366979 ];
var INV_GAMMA = [ 2.1173067060606283, 1.9420552485353544, 1.9557096741686448 ];
var M22 = [ [ -.26355622180094096, .4168322883703174, .4926763141656403 ], [ 1.8897570508777322, -3.1212232034205774, 1.0421666921060384 ], [ .3585108617962056, 1.7694028193790368, -1.4120626067695372 ] ];
var M2_INV = [ [ .9183897822815021, .5232051237088666, .7065804598090856 ], [ 1.0899090574433026, .07005324849041904, .4319776874787044 ], [ 1.598895729264209, .22061850068770233, .012506037355220951 ] ];
var M5 = {
CAT_TO_HELM: CAT_TO_HELM,
CAT_FROM_HELM: CAT_FROM_HELM,
M1: M1,
M1_INV: M1_INV,
M2: M22,
M2_INV: M2_INV
};
var hue_cos1 = -.02833024015436984;
var hue_sin1 = -.21131429516166544;
var hue_cos2 = .2189784817615645;
var hue_sin2 = -.06871898981942523;
var hue_cos3 = .005506053349515315;
var hue_sin3 = -.0641329861299175;
var hue_cos4 = -.053592461436994296;
var hue_sin4 = -.00954137464208059;
var hk_weight = .2676231133101982;
var hk_power = .8934892185255707;
var hk_hue_mod = .7173169828841472;
var hk_sin1 = .6915224124600773;
var hk_cos2 = .48647127559605596;
var hk_sin2 = .9853124591201782;
var L_corr_p1 = .5385456675962418;
var L_corr_p2 = .12508858146241716;
var L_corr_p3 = .6768950256217603;
var Lh_cos1 = -.4963251525324449;
var Lh_sin1 = -.09564696283240552;
var lp_dark = -.029053748937210654;
var lp_dark_hcos = 1.3346761652952872;
var lp_dark_hsin = -.1698908144723919;
var cs_cos1 = -.195370576218515;
var cs_sin1 = .5330819227283227;
var cs_cos2 = .08863325582067766;
var cs_sin2 = .9365540137751136;
var cs_cos3 = .13789738139719568;
var cs_sin3 = .061650260197979936;
var cs_cos4 = .0641970862504494;
var cs_sin4 = -.027401052793571013;
var cp_cos1 = -.09900209889026965;
var cp_sin1 = .059635520647228726;
var cp_cos2 = -.013586499967803128;
var cp_sin2 = .2253393118474472;
var lc1 = -1.5239477450767043;
var lc2 = -1.751157310240011;
var hlc_cos1 = -.43576378069144767;
var hlc_sin1 = 1.060094063845983;
var hlc_cos2 = .47931193034584496;
var hlc_sin2 = -.2622579649434462;
var hl_cos1 = .13610794232685908;
var hl_sin1 = .1168702235362288;
var hl_cos2 = -.01617739641422492;
var hl_sin2 = .038145638815030566;
var PHI = -28.2 * PI / 180;
var ROT_COS = cos(PHI);
var ROT_SIN = sin(PHI);
function hueDelta(h) {
return hue_cos1 * cos(h) + hue_sin1 * sin(h) + hue_cos2 * cos(2 * h) + hue_sin2 * sin(2 * h) + hue_cos3 * cos(3 * h) + hue_sin3 * sin(3 * h) + hue_cos4 * cos(4 * h) + hue_sin4 * sin(4 * h);
}
function hueDeltaDeriv(h) {
return -hue_cos1 * sin(h) + hue_sin1 * cos(h) + -2 * hue_cos2 * sin(2 * h) + 2 * hue_sin2 * cos(2 * h) + -3 * hue_cos3 * sin(3 * h) + 3 * hue_sin3 * cos(3 * h) + -4 * hue_cos4 * sin(4 * h) + 4 * hue_sin4 * cos(4 * h);
}
function chromaScaleH(h) {
var logS = cs_cos1 * cos(h) + cs_sin1 * sin(h) + cs_cos2 * cos(2 * h) + cs_sin2 * sin(2 * h) + cs_cos3 * cos(3 * h) + cs_sin3 * sin(3 * h) + cs_cos4 * cos(4 * h) + cs_sin4 * sin(4 * h);
return exp(logS);
}
function lChromaScale(L) {
var dL = L - .5;
return exp(_clamp(-30, lc1 * dL + lc2 * dL * dL, 30));
}
function hlcScale(h, L) {
var hueFactor = hlc_cos1 * cos(h) + hlc_sin1 * sin(h) + hlc_cos2 * cos(2 * h) + hlc_sin2 * sin(2 * h);
return exp(_clamp(-30, (L - .5) * hueFactor, 30));
}
function hueLightnessScale(h) {
var logS = hl_cos1 * cos(h) + hl_sin1 * sin(h) + hl_cos2 * cos(2 * h) + hl_sin2 * sin(2 * h);
return exp(logS);
}
function chromaPowerH(h) {
return 1 + cp_cos1 * cos(h) + cp_sin1 * sin(h) + cp_cos2 * cos(2 * h) + cp_sin2 * sin(2 * h);
}
function lCorrectFwd(L, h) {
var t = L * (1 - L);
var result = L + L_corr_p1 * t + L_corr_p2 * t * (.5 - L) + L_corr_p3 * t * t;
result += t * (Lh_cos1 * cos(h) + Lh_sin1 * sin(h));
return result;
}
function lCorrectInv(L1, h) {
var Lh = Lh_cos1 * cos(h) + Lh_sin1 * sin(h);
var L = L1;
for (var i = 0; i < 15; i++) {
var t = L * (1 - L);
var dt = 1 - 2 * L;
var f = L + (L_corr_p1 + Lh) * t + L_corr_p2 * t * (.5 - L) + L_corr_p3 * t * t - L1;
var dfdL = 1 + (L_corr_p1 + Lh) * dt + L_corr_p2 * (dt * (.5 - L) - t) + L_corr_p3 * 2 * t * dt;
if (abs(dfdL) < 1e-10) {
dfdL = 1;
}
L -= f / dfdL;
}
return L;
}
function darkLFwd(L, h) {
var coeff = lp_dark + lp_dark_hcos * cos(h) + lp_dark_hsin * sin(h);
var oml = L < 1 ? 1 - L : 0;
var g2 = coeff * L * oml * oml;
return L * exp(_clamp(-30, g2, 30));
}
function darkLInv(Ln, h) {
var coeff = lp_dark + lp_dark_hcos * cos(h) + lp_dark_hsin * sin(h);
var L = Ln;
for (var i = 0; i < 12; i++) {
var oml = L < 1 ? 1 - L : 0;
var g2 = coeff * L * oml * oml;
var eg = exp(_clamp(-30, g2, 30));
var f = L * eg - Ln;
var gp = coeff * oml * (1 - 3 * L);
var fp = eg * (1 + L * gp);
if (abs(fp) < 1e-10) {
fp = 1;
}
L -= f / fp;
}
return L;
}
var fromXYZ = function fromXYZ(xyz) {
var adapted = _multiply_v3_m3x(xyz, M5.CAT_TO_HELM);
var _multiply_v3_m3x6 = _multiply_v3_m3x(adapted, M5.M1), _multiply_v3_m3x7 = _slicedToArray(_multiply_v3_m3x6, 3), lms0 = _multiply_v3_m3x7[0], lms1 = _multiply_v3_m3x7[1], lms2 = _multiply_v3_m3x7[2];
var c0 = _spow(lms0, GAMMA[0]);
var c14 = _spow(lms1, GAMMA[1]);
var c24 = _spow(lms2, GAMMA[2]);
var _multiply_v3_m3x8 = _multiply_v3_m3x([ c0, c14, c24 ], M5.M2), _multiply_v3_m3x9 = _slicedToArray(_multiply_v3_m3x8, 3), L = _multiply_v3_m3x9[0], a2 = _multiply_v3_m3x9[1], b3 = _multiply_v3_m3x9[2];
var h = atan2(b3, a2);
var C = sqrt(a2 * a2 + b3 * b3);
var delta = hueDelta(h);
var hNew = h + delta;
a2 = C * cos(hNew);
b3 = C * sin(hNew);
var Cr = sqrt(a2 * a2 + b3 * b3);
var hkBoost = hk_weight * pow(Cr, _clamp(.01, hk_power, 10));
var hr = atan2(b3, a2);
var factor = 1 + hk_hue_mod * cos(hr) + hk_sin1 * sin(hr) + hk_cos2 * cos(2 * hr) + hk_sin2 * sin(2 * hr);
L += hkBoost * factor;
h = atan2(b3, a2);
L = lCorrectFwd(L, h);
h = atan2(b3, a2);
L = darkLFwd(L, h);
h = atan2(b3, a2);
var cs = chromaScaleH(h);
a2 *= cs;
b3 *= cs;
h = atan2(b3, a2);
C = sqrt(a2 * a2 + b3 * b3);
var p3 = chromaPowerH(h);
var Cn = C > 0 ? pow(C, p3) : 0;
a2 = Cn * cos(h);
b3 = Cn * sin(h);
var T = lChromaScale(L);
a2 *= T;
b3 *= T;
h = atan2(b3, a2);
var hlcS = hlcScale(h, L);
a2 *= hlcS;
b3 *= hlcS;
h = atan2(b3, a2);
L *= hueLightnessScale(h);
var aRot = a2 * ROT_COS - b3 * ROT_SIN;
var bRot = a2 * ROT_SIN + b3 * ROT_COS;
return [ L, aRot, bRot ];
};
var toXYZ = function toXYZ(lab) {
var _lab = _slicedToArray(lab, 3), L = _lab[0], a2 = _lab[1], b3 = _lab[2];
var aUn = a2 * ROT_COS + b3 * ROT_SIN;
var bUn = -a2 * ROT_SIN + b3 * ROT_COS;
a2 = aUn;
b3 = bUn;
var h = atan2(b3, a2);
L /= hueLightnessScale(h);
h = atan2(b3, a2);
var hlcS = hlcScale(h, L);
a2 /= hlcS;
b3 /= hlcS;
var T = lChromaScale(L);
a2 /= T;
b3 /= T;
h = atan2(b3, a2);
var C = sqrt(a2 * a2 + b3 * b3);
var p3 = chromaPowerH(h);
var Co = C > 0 ? pow(C, 1 / p3) : 0;
a2 = Co * cos(h);
b3 = Co * sin(h);
h = atan2(b3, a2);
var cs = chromaScaleH(h);
a2 /= cs;
b3 /= cs;
h = atan2(b3, a2);
L = darkLInv(L, h);
h = atan2(b3, a2);
L = lCorrectInv(L, h);
var Cr = sqrt(a2 * a2 + b3 * b3);
var hkBoost = hk_weight * pow(Cr, _clamp(.01, hk_power, 10));
var hr = atan2(b3, a2);
var factor = 1 + hk_hue_mod * cos(hr) + hk_sin1 * sin(hr) + hk_cos2 * cos(2 * hr) + hk_sin2 * sin(2 * hr);
L -= hkBoost * factor;
var hOut = atan2(b3, a2);
C = sqrt(a2 * a2 + b3 * b3);
var hRaw = hOut;
for (var i = 0; i < 8; i++) {
var f = hRaw + hueDelta(hRaw) - hOut;
var fp = 1 + hueDeltaDeriv(hRaw);
if (abs(fp) < 1e-10) {
fp = 1;
}
hRaw -= f / fp;
}
a2 = C * cos(hRaw);
b3 = C * sin(hRaw);
var _multiply_v3_m3x0 = _multiply_v3_m3x([ L, a2, b3 ], M5.M2_INV), _multiply_v3_m3x1 = _slicedToArray(_multiply_v3_m3x0, 3), lc0 = _multiply_v3_m3x1[0], lc12 = _multiply_v3_m3x1[1], lc22 = _multiply_v3_m3x1[2];
var l0 = _spow(lc0, INV_GAMMA[0]);
var l1 = _spow(lc12, INV_GAMMA[1]);
var l2 = _spow(lc22, INV_GAMMA[2]);
var xyz = _multiply_v3_m3x([ l0, l1, l2 ], M5.M1_INV);
return _multiply_v3_m3x(xyz, M5.CAT_FROM_HELM);
};
var helmlab_default = new ColorSpace_default({
id: 'helmlab-metric',
name: 'Helmlab MetricSpace',
cssId: '--helmlab-metric',
coords: {
l: {
refRange: [ 0, 1.6 ],
name: 'Lightness'
},
a: {
refRange: [ -1.5, 1.5 ]
},
b: {
refRange: [ -1.5, 1.5 ]
}
},
white: 'D65',
base: xyz_d65_default,
M: M5,
fromBase: function fromBase(xyz) {
return fromXYZ(xyz);
},
toBase: function toBase(lab) {
return toXYZ(lab);
}
});
var sl = -.9155125151657894;
var sc = 2.9268353744941558;
var wC = 3.966003089807536;
var p2 = 1.9737081170404969;
var compress = 52.473130649294724;
var q = .47897301074925214;
function deltaEHelmlab_default(color, sample) {
var _getColor13 = getColor([ color, sample ]);
var _getColor14 = _slicedToArray(_getColor13, 2);
color = _getColor14[0];
sample = _getColor14[1];
var _helmlab_default$from = helmlab_default.from(color), _helmlab_default$from2 = _slicedToArray(_helmlab_default$from, 3), L1 = _helmlab_default$from2[0], a1 = _helmlab_default$from2[1], b1 = _helmlab_default$from2[2];
var _helmlab_default$from3 = helmlab_default.from(sample), _helmlab_default$from4 = _slicedToArray(_helmlab_default$from3, 3), L2 = _helmlab_default$from4[0], a2 = _helmlab_default$from4[1], b22 = _helmlab_default$from4[2];
var \u0394L = L1 - L2;
var \u0394a = a1 - a2;
var \u0394b = b1 - b22;
var Lavg = (L1 + L2) * .5;
var SL = 1 + sl * Math.pow(Lavg - .5, 2);
var C1 = Math.sqrt(Math.pow(a1, 2) + Math.pow(b1, 2));
var C2 = Math.sqrt(Math.pow(a2, 2) + Math.pow(b22, 2));
var Cavg = (C1 + C2) * .5;
var SC = 1 + sc * Cavg;
var raw = Math.pow(Math.pow(\u0394L, 2) / Math.pow(SL, 2) + wC * (Math.pow(\u0394a, 2) + Math.pow(\u0394b, 2)) / Math.pow(SC, 2), p2 / 2);
var compressed = raw / (1 + compress * raw);
return Math.pow(compressed, q);
}
var deltaE_default = {
deltaE76: deltaE76,
deltaECMC: deltaECMC_default,
deltaE2000: deltaE2000_default,
deltaEJz: deltaEJz_default,
deltaEITP: deltaEITP_default,
deltaEOK: deltaEOK_default,
deltaEOK2: deltaEOK2_default,
deltaEHCT: deltaEHCT_default,
deltaEHelmlab: deltaEHelmlab_default
};
function calcEpsilon(jnd) {
var order = !jnd ? 0 : Math.floor(Math.log10(Math.abs(jnd)));
return Math.max(parseFloat('1e'.concat(order - 2)), 1e-6);
}
var GMAPPRESET = {
hct: {
method: 'hct.c',
jnd: 2,
deltaEMethod: 'hct',
blackWhiteClamp: {}
},
'hct-tonal': {
method: 'hct.c',
jnd: 0,
deltaEMethod: 'hct',
blackWhiteClamp: {
channel: 'hct.t',
min: 0,
max: 100
}
}
};
function toGamut(color) {
var _ref19 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, _ref19$method = _ref19.method, method = _ref19$method === void 0 ? defaults_default.gamut_mapping : _ref19$method, _ref19$space = _ref19.space, space = _ref19$space === void 0 ? void 0 : _ref19$space, _ref19$deltaEMethod = _ref19.deltaEMethod, deltaEMethod = _ref19$deltaEMethod === void 0 ? '' : _ref19$deltaEMethod, _ref19$jnd = _ref19.jnd, jnd = _ref19$jnd === void 0 ? 2 : _ref19$jnd, _ref19$blackWhiteClam = _ref19.blackWhiteClamp, blackWhiteClamp = _ref19$blackWhiteClam === void 0 ? void 0 : _ref19$blackWhiteClam;
color = getColor(color);
if (_isString(arguments[1])) {
space = arguments[1];
} else if (!space) {
space = color.space;
}
space = ColorSpace_default.get(space);
if (inGamut(color, space, {
epsilon: 0
})) {
return color;
}
var spaceColor;
if (method === 'css') {
spaceColor = toGamutCSS(color, {
space: space
});
} else if (method === 'raytrace') {
spaceColor = toGamutRayTrace(color, {
space: space
});
} else {
if (method !== 'clip') {
if (Object.prototype.hasOwnProperty.call(GMAPPRESET, method)) {
var _GMAPPRESET$method = GMAPPRESET[method];
method = _GMAPPRESET$method.method;
jnd = _GMAPPRESET$method.jnd;
deltaEMethod = _GMAPPRESET$method.deltaEMethod;
blackWhiteClamp = _GMAPPRESET$method.blackWhiteClamp;
}
var de = deltaE2000_default;
if (deltaEMethod !== '') {
for (var m3 in deltaE_default) {
if ('deltae' + deltaEMethod.toLowerCase() === m3.toLowerCase()) {
de = deltaE_default[m3];
break;
}
}
}
if (jnd === 0) {
jnd = 1e-16;
}
var clipped = toGamut(to(color, space), {
method: 'clip',
space: space
});
if (de(color, clipped) > jnd) {
if (blackWhiteClamp && Object.keys(blackWhiteClamp).length === 3) {
var channelMeta = ColorSpace_default.resolveCoord(blackWhiteClamp.channel);
var channel = get(to(color, channelMeta.space), channelMeta.id);
if (_isNone(channel)) {
channel = 0;
}
if (channel >= blackWhiteClamp.max) {
return to({
space: 'xyz-d65',
coords: WHITES['D65']
}, color.space);
} else if (channel <= blackWhiteClamp.min) {
return to({
space: 'xyz-d65',
coords: [ 0, 0, 0 ]
}, color.space);
}
}
var coordMeta = ColorSpace_default.resolveCoord(method);
var mapSpace = coordMeta.space;
var coordId = coordMeta.id;
var mappedColor = to(color, mapSpace);
mappedColor.coords.forEach(function(c4, i) {
if (_isNone(c4)) {
mappedColor.coords[i] = 0;
}
});
var bounds = coordMeta.range || coordMeta.refRange;
var min = bounds[0];
var \u03b511 = calcEpsilon(jnd);
var low = min;
var high = get(mappedColor, coordId);
while (high - low > \u03b511) {
var clipped2 = clone(mappedColor);
clipped2 = toGamut(clipped2, {
space: space,
method: 'clip'
});
var deltaE2 = de(mappedColor, clipped2);
if (deltaE2 - jnd < \u03b511) {
low = get(mappedColor, coordId);
} else {
high = get(mappedColor, coordId);
}
set(mappedColor, coordId, (low + high) / 2);
}
spaceColor = to(mappedColor, space);
} else {
spaceColor = clipped;
}
} else {
spaceColor = to(color, space);
}
if (method === 'clip' || !inGamut(spaceColor, space, {
epsilon: 0
})) {
var _bounds = Object.values(space.coords).map(function(c4) {
return c4.range || [];
});
spaceColor.coords = spaceColor.coords.map(function(c4, i) {
var _bounds$i = _slicedToArray(_bounds[i], 2), min = _bounds$i[0], max2 = _bounds$i[1];
if (min !== void 0) {
c4 = Math.max(min, c4);
}
if (max2 !== void 0) {
c4 = Math.min(c4, max2);
}
return c4;
});
}
}
if (space !== color.space) {
spaceColor = to(spaceColor, color.space);
}
color.coords = spaceColor.coords;
return color;
}
toGamut.returns = 'color';
var COLORS = {
WHITE: {
space: oklab_default,
coords: [ 1, 0, 0 ],
alpha: 1
},
BLACK: {
space: oklab_default,
coords: [ 0, 0, 0 ],
alpha: 1
}
};
function toGamutCSS(origin) {
var _ref20 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, space = _ref20.space;
var JND = .02;
var \u03b511 = 1e-4;
origin = getColor(origin);
if (!space) {
space = origin.space;
}
space = ColorSpace_default.get(space);
if (space.isUnbounded) {
return to(origin, space);
}
var origin_OKLCH = to(origin, oklch_default);
var L = origin_OKLCH.coords[0];
if (L >= 1) {
var white6 = to(COLORS.WHITE, space);
white6.alpha = origin.alpha;
return to(white6, space);
}
if (L <= 0) {
var black = to(COLORS.BLACK, space);
black.alpha = origin.alpha;
return to(black, space);
}
if (inGamut(origin_OKLCH, space, {
epsilon: 0
})) {
return to(origin_OKLCH, space);
}
function clip(_color) {
var destColor = to(_color, space);
var spaceCoords = Object.values(space.coords);
destColor.coords = destColor.coords.map(function(coord, index) {
if ('range' in spaceCoords[index]) {
var _spaceCoords$index$ra = _slicedToArray(spaceCoords[index].range, 2), min2 = _spaceCoords$index$ra[0], max3 = _spaceCoords$index$ra[1];
return _clamp(min2, coord, max3);
}
return coord;
});
return destColor;
}
var min = 0;
var max2 = origin_OKLCH.coords[1];
var min_inGamut = true;
var current = clone(origin_OKLCH);
var clipped = clip(current);
var E = deltaEOK_default(clipped, current);
if (E < JND) {
return clipped;
}
while (max2 - min > \u03b511) {
var chroma = (min + max2) / 2;
current.coords[1] = chroma;
if (min_inGamut && inGamut(current, space, {
epsilon: 0
})) {
min = chroma;
} else {
clipped = clip(current);
E = deltaEOK_default(clipped, current);
if (E < JND) {
if (JND - E < \u03b511) {
break;
} else {
min_inGamut = false;
min = chroma;
}
} else {
max2 = chroma;
}
}
}
return clipped;
}
function raytrace_box(start, end) {
var bmin = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [ 0, 0, 0 ];
var bmax = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [ 1, 1, 1 ];
var tfar = Infinity;
var tnear = -Infinity;
var direction = [];
for (var i = 0; i < 3; i++) {
var a2 = start[i];
var b3 = end[i];
var d2 = b3 - a2;
var bn = bmin[i];
var bx = bmax[i];
direction.push(d2);
if (Math.abs(d2) > 1e-12) {
var inv_d = 1 / d2;
var t1 = (bn - a2) * inv_d;
var t2 = (bx - a2) * inv_d;
tnear = Math.max(Math.min(t1, t2), tnear);
tfar = Math.min(Math.max(t1, t2), tfar);
} else if (a2 < bn || a2 > bx) {
return [];
}
}
if (tnear > tfar || tfar < 0) {
return [];
}
if (tnear < 0) {
tnear = tfar;
}
if (!isFinite(tnear)) {
return [];
}
return [ start[0] + direction[0] * tnear, start[1] + direction[1] * tnear, start[2] + direction[2] * tnear ];
}
function toGamutRayTrace(origin) {
var _ref21 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, space = _ref21.space;
origin = getColor(origin);
if (!space) {
space = origin.space;
}
space = ColorSpace_default.get(space);
if (space.isUnbounded) {
return to(origin, space);
}
var oklchOrigin = to(origin, oklch_default);
var _oklchOrigin$coords = _slicedToArray(oklchOrigin.coords, 3), lightness = _oklchOrigin$coords[0], chroma = _oklchOrigin$coords[1], hue = _oklchOrigin$coords[2];
if (lightness >= 1) {
var white6 = to(COLORS.WHITE, space);
white6.alpha = origin.alpha;
return to(white6, space);
} else if (lightness <= 0) {
var black = to(COLORS.BLACK, space);
black.alpha = origin.alpha;
return to(black, space);
}
var originSpace = space;
var rGamut = space.rgbGamut;
if (rGamut !== void 0) {
space = rGamut;
}
if (!_isInstance(space, RGBColorSpace_default)) {
throw Error('An RGB gamut is required');
}
var _Object$values$0$rang = _slicedToArray(Object.values(space.coords)[0].range, 2), mn = _Object$values$0$rang[0], mx = _Object$values$0$rang[1];
var max2 = [ mx, mx, mx ];
var lGamut = space.linearGamut;
if (lGamut !== void 0) {
var temp = to({
space: space,
coords: max2,
alpha: origin.alpha
}, lGamut);
mx = temp.coords[0];
max2 = [ mx, mx, mx ];
space = lGamut;
mn = Object.values(space.coords)[0].range[0];
}
var min = [ mn, mn, mn ];
var rgbOrigin = to(oklchOrigin, space);
if (!rgbOrigin.coords.every(function(x) {
return mn <= x && x <= mx;
})) {
var anchor = to({
space: oklch_default,
coords: [ lightness, 0, hue ]
}, space).coords;
var low = mn + 1e-12;
var high = mx - 1e-12;
var last = rgbOrigin.coords;
for (var i = 0; i < 4; i++) {
if (i) {
var oklchColor = to(rgbOrigin, oklch_default);
oklchColor.coords[0] = lightness;
oklchColor.coords[2] = hue;
rgbOrigin = to(oklchColor, space);
}
var intersection = raytrace_box(anchor, rgbOrigin.coords, min, max2);
if (intersection.length === 0) {
rgbOrigin.coords = _toConsumableArray(last);
break;
}
if (i && rgbOrigin.coords.every(function(x) {
return low < x && x < high;
})) {
anchor = _toConsumableArray(rgbOrigin.coords);
}
last = intersection;
rgbOrigin.coords = _toConsumableArray(intersection);
}
}
rgbOrigin = to(rgbOrigin, originSpace);
var spaceCoords = Object.values(originSpace.coords);
rgbOrigin.coords = rgbOrigin.coords.map(function(coord, index) {
if ('range' in spaceCoords[index]) {
var _spaceCoords$index$ra2 = _slicedToArray(spaceCoords[index].range, 2), lower = _spaceCoords$index$ra2[0], upper = _spaceCoords$index$ra2[1];
return _clamp(lower, coord, upper);
}
return coord;
});
return rgbOrigin;
}
var GamutRelativeColorSpace = function(_ColorSpace_default2) {
function GamutRelativeColorSpace(options) {
var _options$chroma, _options$coords2, _options$formats2;
var _this6;
_classCallCheck(this, GamutRelativeColorSpace);
var base = ColorSpace_default.get(options.base);
var chroma = (_options$chroma = options.chroma) !== null && _options$chroma !== void 0 ? _options$chroma : 'c';
var ids = Object.keys(base.coords);
var chromaIndex = ids.indexOf(chroma);
if (chromaIndex === -1) {
throw new TypeError('GamutRelativeColorSpace needs a "'.concat(chroma, '" coordinate, got ').concat(base.id));
}
var coords = Object.fromEntries(Object.entries(base.coords).map(function(_ref22) {
var _ref23 = _slicedToArray(_ref22, 2), id = _ref23[0], meta = _ref23[1];
return [ id, _extends({}, meta) ];
}));
coords[chroma].range = [ 0, 1 ];
delete coords[chroma].refRange;
(_options$coords2 = options.coords) !== null && _options$coords2 !== void 0 ? _options$coords2 : options.coords = coords;
(_options$formats2 = options.formats) !== null && _options$formats2 !== void 0 ? _options$formats2 : options.formats = {
color: {
coords: ids.map(function(id) {
var _ref26, _base$coords$id$range;
if (base.coords[id].type === 'angle') {
return '<number> | <angle>';
}
var _ref24 = (_ref26 = (_base$coords$id$range = base.coords[id].range) !== null && _base$coords$id$range !== void 0 ? _base$coords$id$range : base.coords[id].refRange) !== null && _ref26 !== void 0 ? _ref26 : [], _ref25 = _slicedToArray(_ref24, 2), min = _ref25[0], max2 = _ref25[1];
var pctFirst = id === chroma || min === 0 && max2 === 1;
return pctFirst ? '<percentage> | <number>' : '<number> | <percentage>';
})
}
};
_this6 = _callSuper(this, GamutRelativeColorSpace, [ options ]);
_this6.chromaIndex = chromaIndex;
_this6.method = ''.concat(base.id, '.').concat(chroma);
var corners = [ [ 0, 0, 1 ], [ 0, 1, 0 ], [ 0, 1, 1 ], [ 1, 0, 0 ], [ 1, 0, 1 ], [ 1, 1, 0 ] ];
_this6.oogChroma = 1.01 * Math.max.apply(Math, _toConsumableArray(corners.map(function(rgb) {
return base.from(_this6.gamutSpace, rgb)[_this6.chromaIndex] || 0;
})));
return _this6;
}
_inherits(GamutRelativeColorSpace, _ColorSpace_default2);
return _createClass(GamutRelativeColorSpace, [ {
key: 'maxChroma',
value: function maxChroma(coords) {
var seed = _toConsumableArray(coords);
seed[this.chromaIndex] = this.oogChroma;
return toGamut({
space: this.base,
coords: seed
}, {
space: this.gamutSpace,
method: this.method,
deltaEMethod: 'OK',
jnd: 0
}).coords[this.chromaIndex];
}
}, {
key: 'toBase',
value: function toBase(coords) {
var _this7 = this;
coords = _toConsumableArray(coords);
if (coords.some(function(c4, i) {
return i !== _this7.chromaIndex && _isNone(c4);
})) {
if (coords[this.chromaIndex] !== 0) {
coords[this.chromaIndex] = null;
}
} else if (!_isNone(coords[this.chromaIndex])) {
coords[this.chromaIndex] *= this.maxChroma(coords);
}
return coords;
}
}, {
key: 'fromBase',
value: function fromBase(coords) {
var _this8 = this;
coords = _toConsumableArray(coords);
if (coords.some(function(c4, i) {
return i !== _this8.chromaIndex && _isNone(c4);
})) {
if (coords[this.chromaIndex] !== 0) {
coords[this.chromaIndex] = null;
}
} else if (!_isNone(coords[this.chromaIndex])) {
var cMax = this.maxChroma(coords);
coords[this.chromaIndex] = cMax ? coords[this.chromaIndex] / cMax : 0;
}
return coords;
}
} ]);
}(ColorSpace_default);
var GamutRelativeColorSpace_default = GamutRelativeColorSpace;
function tryColor(color) {
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
if (Array.isArray(color)) {
return color.map(function(c4) {
return tryColor(c4, options);
});
}
var _options$cssProperty = options.cssProperty, cssProperty = _options$cssProperty === void 0 ? 'background-color' : _options$cssProperty, element = options.element, getColorOptions = _objectWithoutProperties(options, _excluded);
var error = null;
try {
return getColor(color, getColorOptions);
} catch (e) {
error = e;
}
var CSS2 = globalThis.CSS, getComputedStyle = globalThis.getComputedStyle;
if (_isString(color) && element && CSS2 && getComputedStyle) {
if (CSS2.supports(cssProperty, color)) {
var previousValue = element.style[cssProperty];
if (color !== previousValue) {
element.style[cssProperty] = color;
}
var computedColor = getComputedStyle(element).getPropertyValue(cssProperty);
if (color !== previousValue) {
element.style[cssProperty] = previousValue;
}
if (computedColor !== color) {
try {
return getColor(computedColor, getColorOptions);
} catch (e) {
error = e;
}
} else {
error = {
message: 'Color value is a valid CSS color, but it could not be resolved :('
};
}
}
}
if (options.errorMeta) {
options.errorMeta.error = error;
}
return null;
}
function serialize(color) {
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var _options$precision = options.precision, precision = _options$precision === void 0 ? defaults_default.precision : _options$precision, format = options.format, _options$inGamut = options.inGamut, inGamut2 = _options$inGamut === void 0 ? true : _options$inGamut, coordFormat = options.coords, alphaFormat = options.alpha, commas = options.commas;
var ret;
var colorWithMeta = getColor(color);
var formatId = format;
var parseMeta = colorWithMeta.parseMeta;
if (parseMeta && !format) {
if (parseMeta.format.canSerialize()) {
format = parseMeta.format;
formatId = parseMeta.formatId;
}
coordFormat !== null && coordFormat !== void 0 ? coordFormat : coordFormat = parseMeta.types;
alphaFormat !== null && alphaFormat !== void 0 ? alphaFormat : alphaFormat = parseMeta.alphaType;
commas !== null && commas !== void 0 ? commas : commas = parseMeta.commas;
}
if (formatId) {
var _colorWithMeta$space$;
format = (_colorWithMeta$space$ = colorWithMeta.space.getFormat(format)) !== null && _colorWithMeta$space$ !== void 0 ? _colorWithMeta$space$ : ColorSpace_default.findFormat(formatId);
}
if (!format) {
var _colorWithMeta$space$2;
format = (_colorWithMeta$space$2 = colorWithMeta.space.getFormat('default')) !== null && _colorWithMeta$space$2 !== void 0 ? _colorWithMeta$space$2 : ColorSpace_default.DEFAULT_FORMAT;
formatId = format.name;
}
if (format && format.space && format.space !== colorWithMeta.space) {
colorWithMeta = to(colorWithMeta, format.space);
}
var coords = colorWithMeta.coords.slice();
inGamut2 || (inGamut2 = format.toGamut);
if (inGamut2 && !inGamut(colorWithMeta)) {
coords = toGamut(clone(colorWithMeta), inGamut2 === true ? void 0 : inGamut2).coords;
}
if (format.type === 'custom') {
if (format.serialize) {
ret = format.serialize(coords, colorWithMeta.alpha, options);
} else {
throw new TypeError('format '.concat(formatId, ' can only be used to parse colors, not for serialization'));
}
} else {
var _alphaFormat$type, _alphaFormat, _alphaFormat2, _alphaFormat3;
var name = format.name || 'color';
var args = format.serializeCoords(coords, precision, coordFormat);
if (name === 'color') {
var _format$ids;
var cssId = format.id || ((_format$ids = format.ids) === null || _format$ids === void 0 ? void 0 : _format$ids[0]) || colorWithMeta.space.cssId || colorWithMeta.space.id;
args.unshift(cssId);
}
var alpha = colorWithMeta.alpha;
if (alphaFormat !== void 0 && !(_typeof(alphaFormat) === 'object')) {
alphaFormat = typeof alphaFormat === 'string' ? {
type: alphaFormat
} : {
include: alphaFormat
};
}
var alphaType = (_alphaFormat$type = (_alphaFormat = alphaFormat) === null || _alphaFormat === void 0 ? void 0 : _alphaFormat.type) !== null && _alphaFormat$type !== void 0 ? _alphaFormat$type : '<number>';
var serializeAlpha = ((_alphaFormat2 = alphaFormat) === null || _alphaFormat2 === void 0 ? void 0 : _alphaFormat2.include) === true || format.alpha === true || ((_alphaFormat3 = alphaFormat) === null || _alphaFormat3 === void 0 ? void 0 : _alphaFormat3.include) !== false && format.alpha !== false && alpha < 1;
var strAlpha = '';
commas !== null && commas !== void 0 ? commas : commas = format.commas;
if (serializeAlpha) {
if (precision !== null) {
var unit;
if (alphaType === '<percentage>') {
unit = '%';
alpha *= 100;
}
alpha = _serializeNumber(alpha, {
precision: precision,
unit: unit
});
}
strAlpha = ''.concat(commas ? ',' : ' /', ' ').concat(alpha);
}
ret = ''.concat(name, '(').concat(args.join(commas ? ', ' : ' ')).concat(strAlpha, ')');
}
return ret;
}
var M6 = {
toXYZ: [ [ .6369580483012914, .14461690358620832, .1688809751641721 ], [ .2627002120112671, .6779980715188708, .05930171646986196 ], [ 0, .028072693049087428, 1.060985057710791 ] ],
fromXYZ: [ [ 1.716651187971268, -.355670783776392, -.25336628137366 ], [ -.666684351832489, 1.616481236634939, .0157685458139111 ], [ .017639857445311, -.042770613257809, .942103121235474 ] ]
};
var rec2020_linear_default = new RGBColorSpace_default({
id: 'rec2020-linear',
cssId: '--rec2020-linear',
name: 'Linear REC.2020',
white: 'D65',
M: M6
});
var rec2020_default = new RGBColorSpace_default({
id: 'rec2020',
name: 'REC.2020',
base: rec2020_linear_default,
linearGamut: rec2020_linear_default,
toBase: function toBase(RGB) {
return RGB.map(function(val) {
var sign = val < 0 ? -1 : 1;
var abs2 = val * sign;
return sign * Math.pow(abs2, 2.4);
});
},
fromBase: function fromBase(RGB) {
return RGB.map(function(val) {
var sign = val < 0 ? -1 : 1;
var abs2 = val * sign;
return sign * Math.pow(abs2, 1 / 2.4);
});
}
});
var M7 = {
toXYZ: [ [ .4865709486482162, .26566769316909306, .1982172852343625 ], [ .2289745640697488, .6917385218365064, .079286914093745 ], [ 0, .04511338185890264, 1.043944368900976 ] ],
fromXYZ: [ [ 2.493496911941425, -.9313836179191239, -.40271078445071684 ], [ -.8294889695615747, 1.7626640603183463, .023624685841943577 ], [ .03584583024378447, -.07617238926804182, .9568845240076872 ] ]
};
var p3_linear_default = new RGBColorSpace_default({
id: 'p3-linear',
cssId: 'display-p3-linear',
name: 'Linear P3',
white: 'D65',
M: M7
});
var M8 = {
toXYZ: [ [ .41239079926595934, .357584339383878, .1804807884018343 ], [ .21263900587151027, .715168678767756, .07219231536073371 ], [ .01933081871559182, .11919477979462598, .9505321522496607 ] ],
fromXYZ: [ [ 3.2409699419045226, -1.537383177570094, -.4986107602930034 ], [ -.9692436362808796, 1.8759675015077202, .04155505740717559 ], [ .05563007969699366, -.20397695888897652, 1.0569715142428786 ] ]
};
var srgb_linear_default = new RGBColorSpace_default({
id: 'srgb-linear',
name: 'Linear sRGB',
white: 'D65',
M: M8
});
var keywords_default = {
aliceblue: [ 240 / 255, 248 / 255, 1 ],
antiquewhite: [ 250 / 255, 235 / 255, 215 / 255 ],
aqua: [ 0, 1, 1 ],
aquamarine: [ 127 / 255, 1, 212 / 255 ],
azure: [ 240 / 255, 1, 1 ],
beige: [ 245 / 255, 245 / 255, 220 / 255 ],
bisque: [ 1, 228 / 255, 196 / 255 ],
black: [ 0, 0, 0 ],
blanchedalmond: [ 1, 235 / 255, 205 / 255 ],
blue: [ 0, 0, 1 ],
blueviolet: [ 138 / 255, 43 / 255, 226 / 255 ],
brown: [ 165 / 255, 42 / 255, 42 / 255 ],
burlywood: [ 222 / 255, 184 / 255, 135 / 255 ],
cadetblue: [ 95 / 255, 158 / 255, 160 / 255 ],
chartreuse: [ 127 / 255, 1, 0 ],
chocolate: [ 210 / 255, 105 / 255, 30 / 255 ],
coral: [ 1, 127 / 255, 80 / 255 ],
cornflowerblue: [ 100 / 255, 149 / 255, 237 / 255 ],
cornsilk: [ 1, 248 / 255, 220 / 255 ],
crimson: [ 220 / 255, 20 / 255, 60 / 255 ],
cyan: [ 0, 1, 1 ],
darkblue: [ 0, 0, 139 / 255 ],
darkcyan: [ 0, 139 / 255, 139 / 255 ],
darkgoldenrod: [ 184 / 255, 134 / 255, 11 / 255 ],
darkgray: [ 169 / 255, 169 / 255, 169 / 255 ],
darkgreen: [ 0, 100 / 255, 0 ],
darkgrey: [ 169 / 255, 169 / 255, 169 / 255 ],
darkkhaki: [ 189 / 255, 183 / 255, 107 / 255 ],
darkmagenta: [ 139 / 255, 0, 139 / 255 ],
darkolivegreen: [ 85 / 255, 107 / 255, 47 / 255 ],
darkorange: [ 1, 140 / 255, 0 ],
darkorchid: [ 153 / 255, 50 / 255, 204 / 255 ],
darkred: [ 139 / 255, 0, 0 ],
darksalmon: [ 233 / 255, 150 / 255, 122 / 255 ],
darkseagreen: [ 143 / 255, 188 / 255, 143 / 255 ],
darkslateblue: [ 72 / 255, 61 / 255, 139 / 255 ],
darkslategray: [ 47 / 255, 79 / 255, 79 / 255 ],
darkslategrey: [ 47 / 255, 79 / 255, 79 / 255 ],
darkturquoise: [ 0, 206 / 255, 209 / 255 ],
darkviolet: [ 148 / 255, 0, 211 / 255 ],
deeppink: [ 1, 20 / 255, 147 / 255 ],
deepskyblue: [ 0, 191 / 255, 1 ],
dimgray: [ 105 / 255, 105 / 255, 105 / 255 ],
dimgrey: [ 105 / 255, 105 / 255, 105 / 255 ],
dodgerblue: [ 30 / 255, 144 / 255, 1 ],
firebrick: [ 178 / 255, 34 / 255, 34 / 255 ],
floralwhite: [ 1, 250 / 255, 240 / 255 ],
forestgreen: [ 34 / 255, 139 / 255, 34 / 255 ],
fuchsia: [ 1, 0, 1 ],
gainsboro: [ 220 / 255, 220 / 255, 220 / 255 ],
ghostwhite: [ 248 / 255, 248 / 255, 1 ],
gold: [ 1, 215 / 255, 0 ],
goldenrod: [ 218 / 255, 165 / 255, 32 / 255 ],
gray: [ 128 / 255, 128 / 255, 128 / 255 ],
green: [ 0, 128 / 255, 0 ],
greenyellow: [ 173 / 255, 1, 47 / 255 ],
grey: [ 128 / 255, 128 / 255, 128 / 255 ],
honeydew: [ 240 / 255, 1, 240 / 255 ],
hotpink: [ 1, 105 / 255, 180 / 255 ],
indianred: [ 205 / 255, 92 / 255, 92 / 255 ],
indigo: [ 75 / 255, 0, 130 / 255 ],
ivory: [ 1, 1, 240 / 255 ],
khaki: [ 240 / 255, 230 / 255, 140 / 255 ],
lavender: [ 230 / 255, 230 / 255, 250 / 255 ],
lavenderblush: [ 1, 240 / 255, 245 / 255 ],
lawngreen: [ 124 / 255, 252 / 255, 0 ],
lemonchiffon: [ 1, 250 / 255, 205 / 255 ],
lightblue: [ 173 / 255, 216 / 255, 230 / 255 ],
lightcoral: [ 240 / 255, 128 / 255, 128 / 255 ],
lightcyan: [ 224 / 255, 1, 1 ],
lightgoldenrodyellow: [ 250 / 255, 250 / 255, 210 / 255 ],
lightgray: [ 211 / 255, 211 / 255, 211 / 255 ],
lightgreen: [ 144 / 255, 238 / 255, 144 / 255 ],
lightgrey: [ 211 / 255, 211 / 255, 211 / 255 ],
lightpink: [ 1, 182 / 255, 193 / 255 ],
lightsalmon: [ 1, 160 / 255, 122 / 255 ],
lightseagreen: [ 32 / 255, 178 / 255, 170 / 255 ],
lightskyblue: [ 135 / 255, 206 / 255, 250 / 255 ],
lightslategray: [ 119 / 255, 136 / 255, 153 / 255 ],
lightslategrey: [ 119 / 255, 136 / 255, 153 / 255 ],
lightsteelblue: [ 176 / 255, 196 / 255, 222 / 255 ],
lightyellow: [ 1, 1, 224 / 255 ],
lime: [ 0, 1, 0 ],
limegreen: [ 50 / 255, 205 / 255, 50 / 255 ],
linen: [ 250 / 255, 240 / 255, 230 / 255 ],
magenta: [ 1, 0, 1 ],
maroon: [ 128 / 255, 0, 0 ],
mediumaquamarine: [ 102 / 255, 205 / 255, 170 / 255 ],
mediumblue: [ 0, 0, 205 / 255 ],
mediumorchid: [ 186 / 255, 85 / 255, 211 / 255 ],
mediumpurple: [ 147 / 255, 112 / 255, 219 / 255 ],
mediumseagreen: [ 60 / 255, 179 / 255, 113 / 255 ],
mediumslateblue: [ 123 / 255, 104 / 255, 238 / 255 ],
mediumspringgreen: [ 0, 250 / 255, 154 / 255 ],
mediumturquoise: [ 72 / 255, 209 / 255, 204 / 255 ],
mediumvioletred: [ 199 / 255, 21 / 255, 133 / 255 ],
midnightblue: [ 25 / 255, 25 / 255, 112 / 255 ],
mintcream: [ 245 / 255, 1, 250 / 255 ],
mistyrose: [ 1, 228 / 255, 225 / 255 ],
moccasin: [ 1, 228 / 255, 181 / 255 ],
navajowhite: [ 1, 222 / 255, 173 / 255 ],
navy: [ 0, 0, 128 / 255 ],
oldlace: [ 253 / 255, 245 / 255, 230 / 255 ],
olive: [ 128 / 255, 128 / 255, 0 ],
olivedrab: [ 107 / 255, 142 / 255, 35 / 255 ],
orange: [ 1, 165 / 255, 0 ],
orangered: [ 1, 69 / 255, 0 ],
orchid: [ 218 / 255, 112 / 255, 214 / 255 ],
palegoldenrod: [ 238 / 255, 232 / 255, 170 / 255 ],
palegreen: [ 152 / 255, 251 / 255, 152 / 255 ],
paleturquoise: [ 175 / 255, 238 / 255, 238 / 255 ],
palevioletred: [ 219 / 255, 112 / 255, 147 / 255 ],
papayawhip: [ 1, 239 / 255, 213 / 255 ],
peachpuff: [ 1, 218 / 255, 185 / 255 ],
peru: [ 205 / 255, 133 / 255, 63 / 255 ],
pink: [ 1, 192 / 255, 203 / 255 ],
plum: [ 221 / 255, 160 / 255, 221 / 255 ],
powderblue: [ 176 / 255, 224 / 255, 230 / 255 ],
purple: [ 128 / 255, 0, 128 / 255 ],
rebeccapurple: [ 102 / 255, 51 / 255, 153 / 255 ],
red: [ 1, 0, 0 ],
rosybrown: [ 188 / 255, 143 / 255, 143 / 255 ],
royalblue: [ 65 / 255, 105 / 255, 225 / 255 ],
saddlebrown: [ 139 / 255, 69 / 255, 19 / 255 ],
salmon: [ 250 / 255, 128 / 255, 114 / 255 ],
sandybrown: [ 244 / 255, 164 / 255, 96 / 255 ],
seagreen: [ 46 / 255, 139 / 255, 87 / 255 ],
seashell: [ 1, 245 / 255, 238 / 255 ],
sienna: [ 160 / 255, 82 / 255, 45 / 255 ],
silver: [ 192 / 255, 192 / 255, 192 / 255 ],
skyblue: [ 135 / 255, 206 / 255, 235 / 255 ],
slateblue: [ 106 / 255, 90 / 255, 205 / 255 ],
slategray: [ 112 / 255, 128 / 255, 144 / 255 ],
slategrey: [ 112 / 255, 128 / 255, 144 / 255 ],
snow: [ 1, 250 / 255, 250 / 255 ],
springgreen: [ 0, 1, 127 / 255 ],
steelblue: [ 70 / 255, 130 / 255, 180 / 255 ],
tan: [ 210 / 255, 180 / 255, 140 / 255 ],
teal: [ 0, 128 / 255, 128 / 255 ],
thistle: [ 216 / 255, 191 / 255, 216 / 255 ],
tomato: [ 1, 99 / 255, 71 / 255 ],
turquoise: [ 64 / 255, 224 / 255, 208 / 255 ],
violet: [ 238 / 255, 130 / 255, 238 / 255 ],
wheat: [ 245 / 255, 222 / 255, 179 / 255 ],
white: [ 1, 1, 1 ],
whitesmoke: [ 245 / 255, 245 / 255, 245 / 255 ],
yellow: [ 1, 1, 0 ],
yellowgreen: [ 154 / 255, 205 / 255, 50 / 255 ]
};
var coordGrammar = Array(3).fill('<percentage> | <number>[0, 255]');
var coordGrammarNumber = Array(3).fill('<number>[0, 255]');
var srgb_default = new RGBColorSpace_default({
id: 'srgb',
name: 'sRGB',
base: srgb_linear_default,
linearGamut: srgb_linear_default,
fromBase: function fromBase(rgb) {
return rgb.map(function(val) {
var sign = val < 0 ? -1 : 1;
var abs2 = val * sign;
if (abs2 > .0031308) {
return sign * (1.055 * Math.pow(abs2, 1 / 2.4) - .055);
}
return 12.92 * val;
});
},
toBase: function toBase(rgb) {
return rgb.map(function(val) {
var sign = val < 0 ? -1 : 1;
var abs2 = val * sign;
if (abs2 <= .04045) {
return val / 12.92;
}
return sign * Math.pow((abs2 + .055) / 1.055, 2.4);
});
},
formats: {
rgb: {
coords: coordGrammar
},
rgb_number: {
name: 'rgb',
commas: true,
coords: coordGrammarNumber,
alpha: false
},
color: {},
rgba: {
coords: coordGrammar,
commas: true,
alpha: true
},
rgba_number: {
name: 'rgba',
commas: true,
coords: coordGrammarNumber
},
hex: {
type: 'custom',
toGamut: true,
test: function test(str) {
return /^#(([a-f0-9]{2}){3,4}|[a-f0-9]{3,4})$/i.test(str);
},
parse: function parse(str) {
if (str.length <= 5) {
str = str.replace(/[a-f0-9]/gi, '$&$&');
}
var rgba = [];
str.replace(/[a-f0-9]{2}/gi, function(component) {
rgba.push(parseInt(component, 16) / 255);
});
return {
spaceId: 'srgb',
coords: rgba.slice(0, 3),
alpha: rgba.slice(3)[0]
};
},
serialize: function serialize(coords, alpha) {
var _ref27 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}, _ref27$collapse = _ref27.collapse, collapse = _ref27$collapse === void 0 ? true : _ref27$collapse, alphaFormat = _ref27.alpha;
if (alphaFormat !== false && alpha < 1 || alphaFormat === true) {
coords.push(alpha);
}
coords = coords.map(function(c4) {
return Math.round(c4 * 255);
});
var collapsible = collapse && coords.every(function(c4) {
return c4 % 17 === 0;
});
var hex = coords.map(function(c4) {
if (collapsible) {
return (c4 / 17).toString(16);
}
return c4.toString(16).padStart(2, '0');
}).join('');
return '#' + hex;
}
},
keyword: {
type: 'custom',
test: function test(str) {
return /^[a-z]+$/i.test(str);
},
parse: function parse(str) {
str = str.toLowerCase();
var ret = {
spaceId: 'srgb',
coords: null,
alpha: 1
};
if (str === 'transparent') {
ret.coords = keywords_default.black;
ret.alpha = 0;
} else {
ret.coords = keywords_default[str];
}
if (ret.coords) {
return ret;
}
}
}
}
});
var p3_default = new RGBColorSpace_default({
id: 'p3',
cssId: 'display-p3',
name: 'P3',
base: p3_linear_default,
linearGamut: p3_linear_default,
fromBase: srgb_default.fromBase,
toBase: srgb_default.toBase
});
defaults_default.display_space = srgb_default;
var supportsNone;
if (typeof CSS !== 'undefined' && (_CSS = CSS) !== null && _CSS !== void 0 && _CSS.supports) {
for (var _i5 = 0, _arr = [ lab_default, rec2020_default, p3_default ]; _i5 < _arr.length; _i5++) {
var space = _arr[_i5];
var coords = space.getMinCoords();
var color = {
space: space,
coords: coords,
alpha: 1
};
var str = serialize(color);
if (CSS.supports('color', str)) {
defaults_default.display_space = space;
break;
}
}
}
function _display(color) {
var _globalThis$CSS;
var _ref28 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var space = _ref28.space, _ref28$supports = _ref28.supports, supports = _ref28$supports === void 0 ? (_globalThis$CSS = globalThis.CSS) === null || _globalThis$CSS === void 0 ? void 0 : _globalThis$CSS.supports : _ref28$supports, options = _objectWithoutProperties(_ref28, _excluded2);
color = getColor(color);
var ret = serialize(color, options);
if (!supports || supports('color', ret) || !defaults_default.display_space) {
ret = new String(ret);
ret.color = color;
} else {
var fallbackColor = color;
var hasNone = color.coords.some(_isNone) || _isNone(color.alpha);
if (hasNone) {
if (!(supportsNone !== null && supportsNone !== void 0 ? supportsNone : supportsNone = supports('color', 'hsl(none 50% 50%)'))) {
fallbackColor = clone(color);
fallbackColor.coords = fallbackColor.coords.map(_skipNone);
fallbackColor.alpha = _skipNone(fallbackColor.alpha);
ret = serialize(fallbackColor, options);
if (supports('color', ret)) {
ret = new String(ret);
ret.color = fallbackColor;
return ret;
}
}
}
if (space === void 0) {
var _space$displaySpaces;
space = fallbackColor.space;
var candidates = (_space$displaySpaces = space.displaySpaces) !== null && _space$displaySpaces !== void 0 ? _space$displaySpaces : space.bases;
if (!space.displaySpaces && !space.id.startsWith('xyz-')) {
candidates = candidates.filter(function(space2) {
return !space2.id.startsWith('xyz-');
});
}
var _iterator6 = _createForOfIteratorHelper(candidates), _step6;
try {
for (_iterator6.s(); !(_step6 = _iterator6.n()).done; ) {
var candidate = _step6.value;
var candidateColor = to(fallbackColor, candidate);
var _str = serialize(candidateColor, options);
if (supports('color', _str)) {
ret = new String(_str);
ret.color = candidateColor;
return ret;
}
}
} catch (err) {
_iterator6.e(err);
} finally {
_iterator6.f();
}
space = defaults_default.display_space;
}
fallbackColor = to(fallbackColor, space);
ret = new String(serialize(fallbackColor, options));
ret.color = fallbackColor;
}
return ret;
}
function deltas(c14, c24) {
var _ref29 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}, space = _ref29.space, _ref29$hue = _ref29.hue, hue = _ref29$hue === void 0 ? 'shorter' : _ref29$hue;
c14 = getColor(c14);
space || (space = c14.space);
space = ColorSpace_default.get(space);
var spaceCoords = Object.values(space.coords);
var _map = [ c14, c24 ].map(function(c4) {
return to(c4, space);
});
var _map2 = _slicedToArray(_map, 2);
c14 = _map2[0];
c24 = _map2[1];
var _map3 = [ c14, c24 ].map(function(c4) {
return c4.coords;
}), _map4 = _slicedToArray(_map3, 2), coords1 = _map4[0], coords2 = _map4[1];
var coords = coords1.map(function(coord1, i) {
var coordMeta = spaceCoords[i];
var coord2 = coords2[i];
if (coordMeta.type === 'angle') {
var _adjust = adjust(hue, [ coord1, coord2 ]);
var _adjust2 = _slicedToArray(_adjust, 2);
coord1 = _adjust2[0];
coord2 = _adjust2[1];
}
return subtractCoords(coord1, coord2);
});
var alpha = subtractCoords(c14.alpha, c24.alpha);
return {
space: space,
coords: coords,
alpha: alpha
};
}
function subtractCoords(c14, c24) {
if (_isNone(c14) || _isNone(c24)) {
return c14 === c24 ? null : 0;
}
return c14 - c24;
}
function equals(color1, color2) {
color1 = getColor(color1);
color2 = getColor(color2);
return color1.space === color2.space && color1.alpha === color2.alpha && color1.coords.every(function(c4, i) {
return c4 === color2.coords[i];
});
}
var contrast_exports = {};
__export(contrast_exports, {
contrastAPCA: function contrastAPCA() {
return _contrastAPCA;
},
contrastDeltaPhi: function contrastDeltaPhi() {
return _contrastDeltaPhi;
},
contrastLstar: function contrastLstar() {
return _contrastLstar;
},
contrastMichelson: function contrastMichelson() {
return _contrastMichelson;
},
contrastWCAG21: function contrastWCAG21() {
return _contrastWCAG;
},
contrastWeber: function contrastWeber() {
return _contrastWeber;
}
});
var luminance_exports = {};
__export(luminance_exports, {
getLuminance: function getLuminance() {
return _getLuminance;
},
register: function register() {
return _register;
},
setLuminance: function setLuminance() {
return _setLuminance;
}
});
function _getLuminance(color) {
return get(color, [ xyz_d65_default, 'y' ]);
}
function _setLuminance(color, value) {
set(color, [ xyz_d65_default, 'y' ], value);
}
function _register(Color3) {
Object.defineProperty(Color3.prototype, 'luminance', {
get: function get() {
return _getLuminance(this);
},
set: function set(value) {
_setLuminance(this, value);
}
});
}
function _contrastWCAG(color1, color2) {
color1 = getColor(color1);
color2 = getColor(color2);
var Y1 = Math.max(_getLuminance(color1), 0);
var Y2 = Math.max(_getLuminance(color2), 0);
if (Y2 > Y1) {
var _ref30 = [ Y2, Y1 ];
Y1 = _ref30[0];
Y2 = _ref30[1];
}
return (Y1 + .05) / (Y2 + .05);
}
var normBG = .56;
var normTXT = .57;
var revTXT = .62;
var revBG = .65;
var blkThrs = .022;
var blkClmp = 1.414;
var loClip = .1;
var deltaYmin = 5e-4;
var scaleBoW = 1.14;
var loBoWoffset = .027;
var scaleWoB = 1.14;
function fclamp(Y) {
if (Y >= blkThrs) {
return Y;
}
return Y + Math.pow(blkThrs - Y, blkClmp);
}
function linearize(val) {
var sign = val < 0 ? -1 : 1;
var abs2 = Math.abs(val);
return sign * Math.pow(abs2, 2.4);
}
function _contrastAPCA(background, foreground) {
foreground = getColor(foreground);
background = getColor(background);
var S2;
var C;
var Sapc;
var R, G, B;
foreground = to(foreground, 'srgb');
var _foreground$coords$ma = foreground.coords.map(function(c4) {
return _isNone(c4) ? 0 : c4;
});
var _foreground$coords$ma2 = _slicedToArray(_foreground$coords$ma, 3);
R = _foreground$coords$ma2[0];
G = _foreground$coords$ma2[1];
B = _foreground$coords$ma2[2];
var lumTxt = linearize(R) * .2126729 + linearize(G) * .7151522 + linearize(B) * .072175;
background = to(background, 'srgb');
var _background$coords$ma = background.coords.map(function(c4) {
return _isNone(c4) ? 0 : c4;
});
var _background$coords$ma2 = _slicedToArray(_background$coords$ma, 3);
R = _background$coords$ma2[0];
G = _background$coords$ma2[1];
B = _background$coords$ma2[2];
var lumBg = linearize(R) * .2126729 + linearize(G) * .7151522 + linearize(B) * .072175;
var Ytxt = fclamp(lumTxt);
var Ybg = fclamp(lumBg);
var BoW = Ybg > Ytxt;
if (Math.abs(Ybg - Ytxt) < deltaYmin) {
C = 0;
} else {
if (BoW) {
S2 = Math.pow(Ybg, normBG) - Math.pow(Ytxt, normTXT);
C = S2 * scaleBoW;
} else {
S2 = Math.pow(Ybg, revBG) - Math.pow(Ytxt, revTXT);
C = S2 * scaleWoB;
}
}
if (Math.abs(C) < loClip) {
Sapc = 0;
} else if (C > 0) {
Sapc = C - loBoWoffset;
} else {
Sapc = C + loBoWoffset;
}
return Sapc * 100;
}
function _contrastMichelson(color1, color2) {
color1 = getColor(color1);
color2 = getColor(color2);
var Y1 = Math.max(_getLuminance(color1), 0);
var Y2 = Math.max(_getLuminance(color2), 0);
if (Y2 > Y1) {
var _ref31 = [ Y2, Y1 ];
Y1 = _ref31[0];
Y2 = _ref31[1];
}
var denom = Y1 + Y2;
return denom === 0 ? 0 : (Y1 - Y2) / denom;
}
var max = 5e4;
function _contrastWeber(color1, color2) {
color1 = getColor(color1);
color2 = getColor(color2);
var Y1 = Math.max(_getLuminance(color1), 0);
var Y2 = Math.max(_getLuminance(color2), 0);
if (Y2 > Y1) {
var _ref32 = [ Y2, Y1 ];
Y1 = _ref32[0];
Y2 = _ref32[1];
}
return Y2 === 0 ? max : (Y1 - Y2) / Y2;
}
function _contrastLstar(color1, color2) {
color1 = getColor(color1);
color2 = getColor(color2);
var L1 = get(color1, [ lab_default, 'l' ]);
var L2 = get(color2, [ lab_default, 'l' ]);
return Math.abs(L1 - L2);
}
var \u03b56 = 216 / 24389;
var \u03b532 = 24 / 116;
var \u03ba3 = 24389 / 27;
var white4 = WHITES.D65;
var lab_d65_default = new ColorSpace_default({
id: 'lab-d65',
name: 'Lab D65',
coords: {
l: {
refRange: [ 0, 100 ],
name: 'Lightness'
},
a: {
refRange: [ -125, 125 ]
},
b: {
refRange: [ -125, 125 ]
}
},
white: white4,
base: xyz_d65_default,
fromBase: function fromBase(XYZ) {
var xyz = XYZ.map(function(value, i) {
return value / white4[i];
});
var f = xyz.map(function(value) {
return value > \u03b56 ? Math.cbrt(value) : (\u03ba3 * value + 16) / 116;
});
return [ 116 * f[1] - 16, 500 * (f[0] - f[1]), 200 * (f[1] - f[2]) ];
},
toBase: function toBase(Lab) {
var f = [];
f[1] = (Lab[0] + 16) / 116;
f[0] = Lab[1] / 500 + f[1];
f[2] = f[1] - Lab[2] / 200;
var xyz = [ f[0] > \u03b532 ? Math.pow(f[0], 3) : (116 * f[0] - 16) / \u03ba3, Lab[0] > 8 ? Math.pow((Lab[0] + 16) / 116, 3) : Lab[0] / \u03ba3, f[2] > \u03b532 ? Math.pow(f[2], 3) : (116 * f[2] - 16) / \u03ba3 ];
return xyz.map(function(value, i) {
return value * white4[i];
});
},
formats: {
'lab-d65': {
coords: [ '<number> | <percentage>', '<number> | <percentage>', '<number> | <percentage>' ]
}
}
});
var phi = Math.pow(5, .5) * .5 + .5;
function _contrastDeltaPhi(color1, color2) {
color1 = getColor(color1);
color2 = getColor(color2);
var Lstr1 = get(color1, [ lab_d65_default, 'l' ]);
var Lstr2 = get(color2, [ lab_d65_default, 'l' ]);
var deltaPhiStar = Math.abs(Math.pow(Lstr1, phi) - Math.pow(Lstr2, phi));
var contrast2 = Math.pow(deltaPhiStar, 1 / phi) * Math.SQRT2 - 40;
return contrast2 < 7.5 ? 0 : contrast2;
}
function contrast(background, foreground, o) {
if (_isString(o)) {
o = {
algorithm: o
};
}
var _ref33 = o || {}, algorithm = _ref33.algorithm, rest = _objectWithoutProperties(_ref33, _excluded3);
if (!algorithm) {
var algorithms = Object.keys(contrast_exports).map(function(a2) {
return a2.replace(/^contrast/, '');
}).join(', ');
throw new TypeError('contrast() function needs a contrast algorithm. Please specify one of: '.concat(algorithms));
}
background = getColor(background);
foreground = getColor(foreground);
for (var a2 in contrast_exports) {
if ('contrast' + algorithm.toLowerCase() === a2.toLowerCase()) {
return contrast_exports[a2](background, foreground, rest);
}
}
throw new TypeError('Unknown contrast algorithm: '.concat(algorithm));
}
var chromaticity_exports = {};
__export(chromaticity_exports, {
register: function register() {
return register2;
},
uv: function uv() {
return _uv;
},
xy: function xy() {
return _xy;
}
});
function _uv(color) {
var _getAll = getAll(color, xyz_d65_default), _getAll2 = _slicedToArray(_getAll, 3), X = _getAll2[0], Y = _getAll2[1], Z = _getAll2[2];
var denom = X + 15 * Y + 3 * Z;
return [ 4 * X / denom, 9 * Y / denom ];
}
function _xy(color) {
var _getAll3 = getAll(color, xyz_d65_default), _getAll4 = _slicedToArray(_getAll3, 3), X = _getAll4[0], Y = _getAll4[1], Z = _getAll4[2];
var sum = X + Y + Z;
return [ X / sum, Y / sum ];
}
function register2(Color3) {
Object.defineProperty(Color3.prototype, 'uv', {
get: function get() {
return _uv(this);
}
});
Object.defineProperty(Color3.prototype, 'xy', {
get: function get() {
return _xy(this);
}
});
}
function deltaE(c14, c24) {
var o = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
if (_isString(o)) {
o = {
method: o
};
}
var _o = o, _o$method = _o.method, method = _o$method === void 0 ? defaults_default.deltaE : _o$method, rest = _objectWithoutProperties(_o, _excluded4);
for (var m3 in deltaE_default) {
if ('deltae' + method.toLowerCase() === m3.toLowerCase()) {
return deltaE_default[m3](c14, c24, rest);
}
}
throw new TypeError('Unknown deltaE method: '.concat(method));
}
var variations_exports = {};
__export(variations_exports, {
darken: function darken() {
return _darken;
},
lighten: function lighten() {
return _lighten;
}
});
function _lighten(color) {
var amount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : .25;
var space = ColorSpace_default.get('oklch', 'lch');
var lightness = [ space, 'l' ];
return set(color, lightness, function(l) {
return l * (1 + amount);
});
}
function _darken(color) {
var amount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : .25;
var space = ColorSpace_default.get('oklch', 'lch');
var lightness = [ space, 'l' ];
return set(color, lightness, function(l) {
return l * (1 - amount);
});
}
_lighten.returns = 'color';
_darken.returns = 'color';
var interpolation_exports = {};
__export(interpolation_exports, {
isRange: function isRange() {
return _isRange;
},
mix: function mix() {
return _mix;
},
range: function range() {
return _range;
},
register: function register() {
return register3;
},
steps: function steps() {
return _steps;
}
});
function _mix(c14, c24, p3) {
var o = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
var _ref34 = [ getColor(c14), getColor(c24) ];
c14 = _ref34[0];
c24 = _ref34[1];
if (_type(p3) === 'object') {
var _ref35 = [ .5, p3 ];
p3 = _ref35[0];
o = _ref35[1];
}
var r = _range(c14, c24, o);
return r(p3 !== null && p3 !== void 0 ? p3 : .5);
}
function _steps(c14, c24) {
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
var colorRange;
if (_isRange(c14)) {
colorRange = c14;
options = c24;
var _colorRange$rangeArgs = _slicedToArray(colorRange.rangeArgs.colors, 2);
c14 = _colorRange$rangeArgs[0];
c24 = _colorRange$rangeArgs[1];
}
var _options = options, maxDeltaE = _options.maxDeltaE, deltaEMethod = _options.deltaEMethod, _options$steps = _options.steps, steps2 = _options$steps === void 0 ? 2 : _options$steps, _options$maxSteps = _options.maxSteps, maxSteps = _options$maxSteps === void 0 ? 1e3 : _options$maxSteps, rangeOptions = _objectWithoutProperties(_options, _excluded5);
if (!colorRange) {
var _ref36 = [ getColor(c14), getColor(c24) ];
c14 = _ref36[0];
c24 = _ref36[1];
colorRange = _range(c14, c24, rangeOptions);
}
var totalDelta = deltaE(c14, c24, deltaEMethod);
var actualSteps = maxDeltaE > 0 ? Math.max(steps2, Math.ceil(totalDelta / maxDeltaE) + 1) : steps2;
var ret = [];
if (maxSteps !== void 0) {
actualSteps = Math.min(actualSteps, maxSteps);
}
if (actualSteps === 1) {
ret = [ {
p: .5,
color: colorRange(.5)
} ];
} else {
var step = 1 / (actualSteps - 1);
ret = Array.from({
length: actualSteps
}, function(_, i) {
var p3 = i * step;
return {
p: p3,
color: colorRange(p3)
};
});
}
if (maxDeltaE > 0) {
var maxDelta = ret.reduce(function(acc, cur, i) {
if (i === 0) {
return 0;
}
var \u0394\u0395 = deltaE(cur.color, ret[i - 1].color, deltaEMethod);
return Math.max(acc, \u0394\u0395);
}, 0);
while (maxDelta > maxDeltaE) {
maxDelta = 0;
for (var i = 1; i < ret.length && ret.length < maxSteps; i++) {
var prev = ret[i - 1];
var cur = ret[i];
var p3 = (cur.p + prev.p) / 2;
var _color2 = colorRange(p3);
maxDelta = Math.max(maxDelta, deltaE(_color2, prev.color, deltaEMethod), deltaE(_color2, cur.color, deltaEMethod));
ret.splice(i, 0, {
p: p3,
color: colorRange(p3)
});
i++;
}
}
}
ret = ret.map(function(a2) {
return a2.color;
});
return ret;
}
function _range(color1, color2) {
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
if (_isRange(color1)) {
var r = color1, options2 = color2;
return _range.apply(void 0, _toConsumableArray(r.rangeArgs.colors).concat([ _extends({}, r.rangeArgs.options, options2) ]));
}
var space = options.space, outputSpace = options.outputSpace, progression = options.progression, premultiplied = options.premultiplied;
color1 = getColor(color1);
color2 = getColor(color2);
color1 = clone(color1);
color2 = clone(color2);
var rangeArgs = {
colors: [ color1, color2 ],
options: options
};
if (space) {
space = ColorSpace_default.get(space);
} else {
space = ColorSpace_default.registry[defaults_default.interpolationSpace] || color1.space;
}
outputSpace = outputSpace ? ColorSpace_default.get(outputSpace) : space;
color1 = to(color1, space);
color2 = to(color2, space);
color1 = toGamut(color1);
color2 = toGamut(color2);
var hueId = space.hueId;
var hueIndex = space.hueIndex;
if (hueId) {
var arc = options.hue = options.hue || 'shorter';
var hue = [ space, hueId ];
var _ref37 = [ get(color1, hue), get(color2, hue) ], \u03b81 = _ref37[0], \u03b82 = _ref37[1];
if (_isNone(\u03b81) && !_isNone(\u03b82)) {
\u03b81 = \u03b82;
} else if (_isNone(\u03b82) && !_isNone(\u03b81)) {
\u03b82 = \u03b81;
}
var _adjust3 = adjust(arc, [ \u03b81, \u03b82 ]);
var _adjust4 = _slicedToArray(_adjust3, 2);
\u03b81 = _adjust4[0];
\u03b82 = _adjust4[1];
set(color1, hue, \u03b81);
set(color2, hue, \u03b82);
}
if (_isNone(color1.alpha) && !_isNone(color2.alpha)) {
color1.alpha = color2.alpha;
} else if (_isNone(color2.alpha) && !_isNone(color1.alpha)) {
color2.alpha = color1.alpha;
}
if (premultiplied) {
color1.coords = premultiply(color1.coords, color1.alpha, hueIndex);
color2.coords = premultiply(color2.coords, color2.alpha, hueIndex);
}
return Object.assign(function(p3) {
p3 = progression ? progression(p3) : p3;
var coords = color1.coords.map(function(start, i) {
var end = color2.coords[i];
return _interpolate(start, end, p3);
});
var alpha = _interpolate(color1.alpha, color2.alpha, p3);
var ret = {
space: space,
coords: coords,
alpha: alpha
};
if (premultiplied) {
ret.coords = premultiply(ret.coords, alpha, hueIndex, true);
}
if (outputSpace !== space) {
ret = to(ret, outputSpace);
}
return ret;
}, {
rangeArgs: rangeArgs
});
}
function premultiply(coords, alpha, hueIndex) {
var undo = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
if (_isNone(alpha) || undo && alpha === 0) {
return coords;
}
return coords.map(function(c4, i) {
if (i === hueIndex || _isNone(c4)) {
return c4;
}
return undo ? c4 / alpha : c4 * alpha;
});
}
function _isRange(val) {
return _type(val) === 'function' && !!val.rangeArgs;
}
defaults_default.interpolationSpace = 'lab';
function register3(Color3) {
Color3.defineFunction('mix', _mix, {
returns: 'color'
});
Color3.defineFunction('range', _range, {
returns: 'function<color>'
});
Color3.defineFunction('steps', _steps, {
returns: 'array<color>'
});
}
var index_fn_exports = {};
__export(index_fn_exports, {
A98RGB: function A98RGB() {
return a98rgb_default;
},
A98RGB_Linear: function A98RGB_Linear() {
return a98rgb_linear_default;
},
ACEScc: function ACEScc() {
return acescc_default;
},
ACEScg: function ACEScg() {
return acescg_default;
},
CAM16_JMh: function CAM16_JMh() {
return cam16_default;
},
HCT: function HCT() {
return hct_default;
},
HPLuv: function HPLuv() {
return hpluv_default;
},
HSL: function HSL() {
return hsl_default;
},
HSL_P3: function HSL_P3() {
return hsl_p3_default;
},
HSL_REC2020: function HSL_REC2020() {
return hsl_rec2020_default;
},
HSLuv: function HSLuv() {
return hsluv_default;
},
HSV: function HSV() {
return hsv_default;
},
HWB: function HWB() {
return hwb_default;
},
HelmGen: function HelmGen() {
return helmgen_default;
},
HelmGenLCh: function HelmGenLCh() {
return helmgenlch_default;
},
Helmlab: function Helmlab() {
return helmlab_default;
},
ICTCP: function ICTCP() {
return ictcp_default;
},
JzCzHz: function JzCzHz() {
return jzczhz_default;
},
Jzazbz: function Jzazbz() {
return jzazbz_default;
},
LCH: function LCH() {
return lch_default;
},
LCH_P3: function LCH_P3() {
return lch_p3_default;
},
LCH_REC_2020: function LCH_REC_2020() {
return lch_rec2020_default;
},
LCH_sRGB: function LCH_sRGB() {
return lch_srgb_default;
},
LCHuv: function LCHuv() {
return lchuv_default;
},
Lab: function Lab() {
return lab_default;
},
Lab_D65: function Lab_D65() {
return lab_d65_default;
},
Luv: function Luv() {
return luv_default;
},
OKLCH: function OKLCH() {
return oklch_default;
},
OKLCH_P3: function OKLCH_P3() {
return oklch_p3_default;
},
OKLCH_REC_2020: function OKLCH_REC_2020() {
return oklch_rec2020_default;
},
OKLCH_sRGB: function OKLCH_sRGB() {
return oklch_srgb_default;
},
OKLab: function OKLab() {
return oklab_default;
},
OKLrCH: function OKLrCH() {
return oklrch_default;
},
OKLrab: function OKLrab() {
return oklrab_default;
},
Okhsl: function Okhsl() {
return okhsl_default;
},
Okhsv: function Okhsv() {
return okhsv_default;
},
P3: function P3() {
return p3_default;
},
P3_Linear: function P3_Linear() {
return p3_linear_default;
},
ProPhoto: function ProPhoto() {
return prophoto_default;
},
ProPhoto_Linear: function ProPhoto_Linear() {
return prophoto_linear_default;
},
REC_2020: function REC_2020() {
return rec2020_default;
},
REC_2020_Linear: function REC_2020_Linear() {
return rec2020_linear_default;
},
REC_2020_Scene_Referred: function REC_2020_Scene_Referred() {
return rec2020_oetf_default;
},
REC_2100_HLG: function REC_2100_HLG() {
return rec2100_hlg_default;
},
REC_2100_Linear: function REC_2100_Linear() {
return rec2100_linear_default;
},
REC_2100_PQ: function REC_2100_PQ() {
return rec2100_pq_default;
},
XYZ_ABS_D65: function XYZ_ABS_D65() {
return xyz_abs_d65_default;
},
XYZ_D50: function XYZ_D50() {
return xyz_d50_default;
},
XYZ_D65: function XYZ_D65() {
return xyz_d65_default;
},
sRGB: function sRGB() {
return srgb_default;
},
sRGB_Linear: function sRGB_Linear() {
return srgb_linear_default;
}
});
var hsl_default = new ColorSpace_default({
id: 'hsl',
name: 'HSL',
coords: {
h: {
refRange: [ 0, 360 ],
type: 'angle',
name: 'Hue'
},
s: {
range: [ 0, 100 ],
name: 'Saturation'
},
l: {
range: [ 0, 100 ],
name: 'Lightness'
}
},
base: srgb_default,
rgbGamut: srgb_default,
fromBase: function fromBase(rgb) {
var max2 = Math.max.apply(Math, _toConsumableArray(rgb));
var min = Math.min.apply(Math, _toConsumableArray(rgb));
var _rgb = _slicedToArray(rgb, 3), r = _rgb[0], g2 = _rgb[1], b3 = _rgb[2];
var h = null, s = 0, l = (min + max2) / 2;
var d2 = max2 - min;
if (d2 !== 0) {
s = l === 0 || l === 1 ? 0 : (max2 - l) / Math.min(l, 1 - l);
switch (max2) {
case r:
h = (g2 - b3) / d2 + (g2 < b3 ? 6 : 0);
break;
case g2:
h = (b3 - r) / d2 + 2;
break;
case b3:
h = (r - g2) / d2 + 4;
}
h = h * 60;
}
if (s < 0) {
h += 180;
s = Math.abs(s);
}
if (h >= 360) {
h -= 360;
}
return [ h, s * 100, l * 100 ];
},
toBase: function toBase(hsl) {
var _hsl = _slicedToArray(hsl, 3), h = _hsl[0], s = _hsl[1], l = _hsl[2];
h = h % 360;
if (h < 0) {
h += 360;
}
s /= 100;
l /= 100;
function f(n3) {
var k = (n3 + h / 30) % 12;
var a2 = s * Math.min(l, 1 - l);
return l - a2 * Math.max(-1, Math.min(k - 3, 9 - k, 1));
}
return [ f(0), f(8), f(4) ];
},
formats: {
hsl: {
coords: [ '<number> | <angle>', '<percentage> | <number>', '<percentage> | <number>' ]
},
hsla: {
coords: [ '<number> | <angle>', '<percentage> | <number>', '<percentage> | <number>' ],
commas: true,
alpha: true
}
}
});
var hsl_p3_default = new ColorSpace_default({
id: 'hsl-p3',
cssId: '--hsl-p3',
name: 'HSL P3',
coords: {
h: {
refRange: [ 0, 360 ],
type: 'angle',
name: 'Hue'
},
s: {
range: [ 0, 100 ],
name: 'Saturation'
},
l: {
range: [ 0, 100 ],
name: 'Lightness'
}
},
base: p3_default,
rgbGamut: p3_default,
fromBase: hsl_default.fromBase,
toBase: hsl_default.toBase
});
var hsl_rec2020_default = new ColorSpace_default({
id: 'hsl-rec2020',
cssId: '--hsl-rec2020',
name: 'HSL Rec.2020',
coords: {
h: {
refRange: [ 0, 360 ],
type: 'angle',
name: 'Hue'
},
s: {
range: [ 0, 100 ],
name: 'Saturation'
},
l: {
range: [ 0, 100 ],
name: 'Lightness'
}
},
base: rec2020_default,
rgbGamut: rec2020_default,
fromBase: hsl_default.fromBase,
toBase: hsl_default.toBase
});
var hsv_default = new ColorSpace_default({
id: 'hsv',
name: 'HSV',
coords: {
h: {
refRange: [ 0, 360 ],
type: 'angle',
name: 'Hue'
},
s: {
range: [ 0, 100 ],
name: 'Saturation'
},
v: {
range: [ 0, 100 ],
name: 'Value'
}
},
base: srgb_default,
rgbGamut: srgb_default,
fromBase: function fromBase(rgb) {
var max2 = Math.max.apply(Math, _toConsumableArray(rgb));
var min = Math.min.apply(Math, _toConsumableArray(rgb));
var _rgb2 = _slicedToArray(rgb, 3), r = _rgb2[0], g2 = _rgb2[1], b3 = _rgb2[2];
var h = null, s = 0, v = max2;
var d2 = max2 - min;
if (d2 !== 0) {
switch (max2) {
case r:
h = (g2 - b3) / d2 + (g2 < b3 ? 6 : 0);
break;
case g2:
h = (b3 - r) / d2 + 2;
break;
case b3:
h = (r - g2) / d2 + 4;
}
h = h * 60;
}
if (v) {
s = d2 / v;
}
if (h >= 360) {
h -= 360;
}
return [ h, s * 100, v * 100 ];
},
toBase: function toBase(hsv) {
var _hsv = _slicedToArray(hsv, 3), h = _hsv[0], s = _hsv[1], v = _hsv[2];
h = h % 360;
if (h < 0) {
h += 360;
}
s /= 100;
v /= 100;
function f(n3) {
var k = (n3 + h / 60) % 6;
return v - v * s * Math.max(0, Math.min(k, 4 - k, 1));
}
return [ f(5), f(3), f(1) ];
},
formats: {
color: {
id: '--hsv',
coords: [ '<number> | <angle>', '<percentage> | <number>', '<percentage> | <number>' ]
}
}
});
var hwb_default = new ColorSpace_default({
id: 'hwb',
name: 'HWB',
coords: {
h: {
refRange: [ 0, 360 ],
type: 'angle',
name: 'Hue'
},
w: {
range: [ 0, 100 ],
name: 'Whiteness'
},
b: {
range: [ 0, 100 ],
name: 'Blackness'
}
},
base: hsv_default,
rgbGamut: srgb_default,
fromBase: function fromBase(hsv) {
var _hsv2 = _slicedToArray(hsv, 3), h = _hsv2[0], s = _hsv2[1], v = _hsv2[2];
return [ h, v * (100 - s) / 100, 100 - v ];
},
toBase: function toBase(hwb) {
var _hwb = _slicedToArray(hwb, 3), h = _hwb[0], w = _hwb[1], b3 = _hwb[2];
w /= 100;
b3 /= 100;
var sum = w + b3;
if (sum >= 1) {
var gray = w / sum;
return [ h, 0, gray * 100 ];
}
var v = 1 - b3;
var s = v === 0 ? 0 : 1 - w / v;
return [ h, s * 100, v * 100 ];
},
formats: {
hwb: {
coords: [ '<number> | <angle>', '<percentage> | <number>', '<percentage> | <number>' ]
}
}
});
var M9 = {
toXYZ: [ [ .5766690429101305, .1855582379065463, .1882286462349947 ], [ .29734497525053605, .6273635662554661, .07529145849399788 ], [ .02703136138641234, .07068885253582723, .9913375368376388 ] ],
fromXYZ: [ [ 2.0415879038107465, -.5650069742788596, -.34473135077832956 ], [ -.9692436362808795, 1.8759675015077202, .04155505740717557 ], [ .013444280632031142, -.11836239223101838, 1.0151749943912054 ] ]
};
var a98rgb_linear_default = new RGBColorSpace_default({
id: 'a98rgb-linear',
cssId: '--a98-rgb-linear',
name: 'Linear Adobe\xae 98 RGB compatible',
white: 'D65',
M: M9
});
var a98rgb_default = new RGBColorSpace_default({
id: 'a98rgb',
cssId: 'a98-rgb',
name: 'Adobe\xae 98 RGB compatible',
base: a98rgb_linear_default,
linearGamut: a98rgb_linear_default,
toBase: function toBase(RGB) {
return RGB.map(function(val) {
return Math.pow(Math.abs(val), 563 / 256) * Math.sign(val);
});
},
fromBase: function fromBase(RGB) {
return RGB.map(function(val) {
return Math.pow(Math.abs(val), 256 / 563) * Math.sign(val);
});
}
});
var M10 = {
toXYZ: [ [ .7977666449006423, .13518129740053308, .0313477341283922 ], [ .2880748288194013, .711835234241873, 8993693872564e-17 ], [ 0, 0, .8251046025104602 ] ],
fromXYZ: [ [ 1.3457868816471583, -.25557208737979464, -.05110186497554526 ], [ -.5446307051249019, 1.5082477428451468, .02052744743642139 ], [ 0, 0, 1.2119675456389452 ] ]
};
var prophoto_linear_default = new RGBColorSpace_default({
id: 'prophoto-linear',
cssId: '--prophoto-rgb-linear',
name: 'Linear ProPhoto',
white: 'D50',
base: xyz_d50_default,
M: M10
});
var Et = 1 / 512;
var Et2 = 16 / 512;
var prophoto_default = new RGBColorSpace_default({
id: 'prophoto',
cssId: 'prophoto-rgb',
name: 'ProPhoto',
base: prophoto_linear_default,
linearGamut: prophoto_linear_default,
toBase: function toBase(RGB) {
return RGB.map(function(v) {
var sign = v < 0 ? -1 : 1;
var abs2 = v * sign;
if (abs2 < Et2) {
return v / 16;
}
return sign * Math.pow(abs2, 1.8);
});
},
fromBase: function fromBase(RGB) {
return RGB.map(function(v) {
var sign = v < 0 ? -1 : 1;
var abs2 = v * sign;
if (abs2 >= Et) {
return sign * Math.pow(abs2, 1 / 1.8);
}
return 16 * v;
});
}
});
var \u03b1 = 1.09929682680944;
var \u03b2 = .018053968510807;
var rec2020_oetf_default = new RGBColorSpace_default({
id: '--rec2020-oetf',
name: 'REC.2020_Scene_Referred',
base: rec2020_linear_default,
linearGamut: rec2020_linear_default,
referred: 'scene',
toBase: function toBase(RGB) {
return RGB.map(function(val) {
var sign = val < 0 ? -1 : 1;
var abs2 = val * sign;
if (abs2 < \u03b2 * 4.5) {
return val / 4.5;
}
return sign * Math.pow((abs2 + \u03b1 - 1) / \u03b1, 1 / .45);
});
},
fromBase: function fromBase(RGB) {
return RGB.map(function(val) {
var sign = val < 0 ? -1 : 1;
var abs2 = val * sign;
if (abs2 >= \u03b2) {
return sign * (\u03b1 * Math.pow(abs2, .45) - (\u03b1 - 1));
}
return 4.5 * val;
});
}
});
var oklch_p3_default = new GamutRelativeColorSpace_default({
id: 'oklch-p3',
cssId: '--oklch-p3',
name: 'OKLCh P3',
base: oklch_default,
gamutSpace: p3_default
});
var oklch_srgb_default = new GamutRelativeColorSpace_default({
id: 'oklch-srgb',
cssId: '--oklch-srgb',
name: 'OKLCh sRGB',
base: oklch_default,
gamutSpace: srgb_default
});
var oklch_rec2020_default = new GamutRelativeColorSpace_default({
id: 'oklch-rec2020',
cssId: '--oklch-rec2020',
name: 'OKLCh Rec.2020',
base: oklch_default,
gamutSpace: rec2020_default
});
var lch_p3_default = new GamutRelativeColorSpace_default({
id: 'lch-p3',
cssId: '--lch-p3',
name: 'LCH P3',
base: lch_default,
gamutSpace: p3_default
});
var lch_srgb_default = new GamutRelativeColorSpace_default({
id: 'lch-srgb',
cssId: '--lch-srgb',
name: 'LCH sRGB',
base: lch_default,
gamutSpace: srgb_default
});
var lch_rec2020_default = new GamutRelativeColorSpace_default({
id: 'lch-rec2020',
cssId: '--lch-rec2020',
name: 'LCH Rec.2020',
base: lch_default,
gamutSpace: rec2020_default
});
var tau2 = 2 * Math.PI;
var M11 = _extends({}, oklab_default.M, {
toLMS: [ [ .4122214694707629, .5363325372617349, .0514459932675022 ], [ .2119034958178251, .6806995506452344, .1073969535369405 ], [ .0883024591900564, .2817188391361215, .6299787016738222 ] ],
toSRGBLinear: [ [ 4.076741636075958, -3.307711539258063, .2309699031821043 ], [ -1.2684379732850315, 2.609757349287688, -.341319376002657 ], [ -.0041960761386756, -.7034186179359362, 1.7076146940746117 ] ]
});
var RGBCoeff = [ [ [ -1.8817031, -.80936501 ], [ 1.19086277, 1.76576728, .59662641, .75515197, .56771245 ] ], [ [ 1.8144408, -1.19445267 ], [ .73956515, -.45954404, .08285427, .12541073, -.14503204 ] ], [ [ .13110758, 1.81333971 ], [ 1.35733652, -.00915799, -1.1513021, -.50559606, .00692167 ] ] ];
var floatMax = Number.MAX_VALUE;
var K1 = .206;
var K2 = .03;
var K3 = (1 + K1) / (1 + K2);
function vdot(a2, b3) {
var l = a2.length;
if (l !== b3.length) {
throw new Error('Vectors of size '.concat(l, ' and ').concat(b3.length, ' are not aligned'));
}
var s = 0;
a2.forEach(function(c4, i) {
s += c4 * b3[i];
});
return s;
}
function toe(x) {
return .5 * (K3 * x - K1 + Math.sqrt((K3 * x - K1) * (K3 * x - K1) + 4 * K2 * K3 * x));
}
function toeInv(x) {
return (Math.pow(x, 2) + K1 * x) / (K3 * (x + K2));
}
function toSt(cusp) {
var _cusp = _slicedToArray(cusp, 2), l = _cusp[0], c4 = _cusp[1];
return [ c4 / l, c4 / (1 - l) ];
}
function getStMid(a2, b3) {
var s = .11516993 + 1 / (7.4477897 + 4.1590124 * b3 + a2 * (-2.19557347 + 1.75198401 * b3 + a2 * (-2.13704948 - 10.02301043 * b3 + a2 * (-4.24894561 + 5.38770819 * b3 + 4.69891013 * a2))));
var t = .11239642 + 1 / (1.6132032 - .68124379 * b3 + a2 * (.40370612 + .90148123 * b3 + a2 * (-.27087943 + .6122399 * b3 + a2 * (.00299215 - .45399568 * b3 - .14661872 * a2))));
return [ s, t ];
}
function oklabToLinearRGB(lab, lmsToRgb) {
var lms = _multiply_v3_m3x(lab, M11.LabtoLMS);
lms[0] = Math.pow(lms[0], 3);
lms[1] = Math.pow(lms[1], 3);
lms[2] = Math.pow(lms[2], 3);
return _multiply_v3_m3x(lms, lmsToRgb, lms);
}
function findCusp(a2, b3, lmsToRgb, okCoeff) {
var sCusp = computeMaxSaturation(a2, b3, lmsToRgb, okCoeff);
var rgb = oklabToLinearRGB([ 1, sCusp * a2, sCusp * b3 ], lmsToRgb);
var lCusp = _spow(1 / Math.max.apply(Math, _toConsumableArray(rgb)), 1 / 3);
var cCusp = lCusp * sCusp;
return [ lCusp, cCusp ];
}
function findGamutIntersection(a2, b3, l1, c14, l0, lmsToRgb, okCoeff, cusp) {
var t;
if (cusp === void 0) {
cusp = findCusp(a2, b3, lmsToRgb, okCoeff);
}
if ((l1 - l0) * cusp[1] - (cusp[0] - l0) * c14 <= 0) {
t = cusp[1] * l0 / (c14 * cusp[0] + cusp[1] * (l0 - l1));
} else {
t = cusp[1] * (l0 - 1) / (c14 * (cusp[0] - 1) + cusp[1] * (l0 - l1));
var dl = l1 - l0;
var dc = c14;
var kl = vdot(M11.LabtoLMS[0].slice(1), [ a2, b3 ]);
var km = vdot(M11.LabtoLMS[1].slice(1), [ a2, b3 ]);
var ks = vdot(M11.LabtoLMS[2].slice(1), [ a2, b3 ]);
var ldt_ = dl + dc * kl;
var mdt_ = dl + dc * km;
var sdt_ = dl + dc * ks;
var L = l0 * (1 - t) + t * l1;
var C = t * c14;
var l_ = L + C * kl;
var m_ = L + C * km;
var s_ = L + C * ks;
var l = Math.pow(l_, 3);
var m3 = Math.pow(m_, 3);
var s = Math.pow(s_, 3);
var ldt = 3 * ldt_ * Math.pow(l_, 2);
var mdt = 3 * mdt_ * Math.pow(m_, 2);
var sdt = 3 * sdt_ * Math.pow(s_, 2);
var ldt2 = 6 * Math.pow(ldt_, 2) * l_;
var mdt2 = 6 * Math.pow(mdt_, 2) * m_;
var sdt2 = 6 * Math.pow(sdt_, 2) * s_;
var r_ = vdot(lmsToRgb[0], [ l, m3, s ]) - 1;
var r1 = vdot(lmsToRgb[0], [ ldt, mdt, sdt ]);
var r2 = vdot(lmsToRgb[0], [ ldt2, mdt2, sdt2 ]);
var ur = r1 / (r1 * r1 - .5 * r_ * r2);
var tr = -r_ * ur;
var g_ = vdot(lmsToRgb[1], [ l, m3, s ]) - 1;
var g1 = vdot(lmsToRgb[1], [ ldt, mdt, sdt ]);
var g2 = vdot(lmsToRgb[1], [ ldt2, mdt2, sdt2 ]);
var ug = g1 / (g1 * g1 - .5 * g_ * g2);
var tg = -g_ * ug;
var b_ = vdot(lmsToRgb[2], [ l, m3, s ]) - 1;
var b1 = vdot(lmsToRgb[2], [ ldt, mdt, sdt ]);
var b22 = vdot(lmsToRgb[2], [ ldt2, mdt2, sdt2 ]);
var ub = b1 / (b1 * b1 - .5 * b_ * b22);
var tb = -b_ * ub;
tr = ur >= 0 ? tr : floatMax;
tg = ug >= 0 ? tg : floatMax;
tb = ub >= 0 ? tb : floatMax;
t += Math.min(tr, Math.min(tg, tb));
}
return t;
}
function getCs(lab, lmsToRgb, okCoeff) {
var _lab2 = _slicedToArray(lab, 3), l = _lab2[0], a2 = _lab2[1], b3 = _lab2[2];
var cusp = findCusp(a2, b3, lmsToRgb, okCoeff);
var cMax = findGamutIntersection(a2, b3, l, 1, l, lmsToRgb, okCoeff, cusp);
var stMax = toSt(cusp);
var k = cMax / Math.min(l * stMax[0], (1 - l) * stMax[1]);
var stMid = getStMid(a2, b3);
var ca = l * stMid[0];
var cb = (1 - l) * stMid[1];
var cMid = .9 * k * Math.sqrt(Math.sqrt(1 / (1 / Math.pow(ca, 4) + 1 / Math.pow(cb, 4))));
ca = l * .4;
cb = (1 - l) * .8;
var c0 = Math.sqrt(1 / (1 / Math.pow(ca, 2) + 1 / Math.pow(cb, 2)));
return [ c0, cMid, cMax ];
}
function computeMaxSaturation(a2, b3, lmsToRgb, okCoeff) {
var k0, k1, k2, k3, k4, wl, wm, ws;
if (vdot(okCoeff[0][0], [ a2, b3 ]) > 1) {
var _okCoeff$0$ = _slicedToArray(okCoeff[0][1], 5);
k0 = _okCoeff$0$[0];
k1 = _okCoeff$0$[1];
k2 = _okCoeff$0$[2];
k3 = _okCoeff$0$[3];
k4 = _okCoeff$0$[4];
var _lmsToRgb$ = _slicedToArray(lmsToRgb[0], 3);
wl = _lmsToRgb$[0];
wm = _lmsToRgb$[1];
ws = _lmsToRgb$[2];
} else if (vdot(okCoeff[1][0], [ a2, b3 ]) > 1) {
var _okCoeff$1$ = _slicedToArray(okCoeff[1][1], 5);
k0 = _okCoeff$1$[0];
k1 = _okCoeff$1$[1];
k2 = _okCoeff$1$[2];
k3 = _okCoeff$1$[3];
k4 = _okCoeff$1$[4];
var _lmsToRgb$2 = _slicedToArray(lmsToRgb[1], 3);
wl = _lmsToRgb$2[0];
wm = _lmsToRgb$2[1];
ws = _lmsToRgb$2[2];
} else {
var _okCoeff$2$ = _slicedToArray(okCoeff[2][1], 5);
k0 = _okCoeff$2$[0];
k1 = _okCoeff$2$[1];
k2 = _okCoeff$2$[2];
k3 = _okCoeff$2$[3];
k4 = _okCoeff$2$[4];
var _lmsToRgb$3 = _slicedToArray(lmsToRgb[2], 3);
wl = _lmsToRgb$3[0];
wm = _lmsToRgb$3[1];
ws = _lmsToRgb$3[2];
}
var sat = k0 + k1 * a2 + k2 * b3 + k3 * Math.pow(a2, 2) + k4 * a2 * b3;
var kl = vdot(M11.LabtoLMS[0].slice(1), [ a2, b3 ]);
var km = vdot(M11.LabtoLMS[1].slice(1), [ a2, b3 ]);
var ks = vdot(M11.LabtoLMS[2].slice(1), [ a2, b3 ]);
var l_ = 1 + sat * kl;
var m_ = 1 + sat * km;
var s_ = 1 + sat * ks;
var l = Math.pow(l_, 3);
var m3 = Math.pow(m_, 3);
var s = Math.pow(s_, 3);
var lds = 3 * kl * Math.pow(l_, 2);
var mds = 3 * km * Math.pow(m_, 2);
var sds = 3 * ks * Math.pow(s_, 2);
var lds2 = 6 * Math.pow(kl, 2) * l_;
var mds2 = 6 * Math.pow(km, 2) * m_;
var sds2 = 6 * Math.pow(ks, 2) * s_;
var f = wl * l + wm * m3 + ws * s;
var f1 = wl * lds + wm * mds + ws * sds;
var f2 = wl * lds2 + wm * mds2 + ws * sds2;
sat = sat - f * f1 / (Math.pow(f1, 2) - .5 * f * f2);
return sat;
}
function okhslToOklab(hsl, lmsToRgb, okCoeff) {
var _hsl2 = _slicedToArray(hsl, 3), h = _hsl2[0], s = _hsl2[1], l = _hsl2[2];
var L = toeInv(l);
var a2 = null;
var b3 = null;
h = constrain(h) / 360;
if (L !== 0 && L !== 1 && s !== 0) {
var a_ = Math.cos(tau2 * h);
var b_ = Math.sin(tau2 * h);
var _getCs = getCs([ L, a_, b_ ], lmsToRgb, okCoeff), _getCs2 = _slicedToArray(_getCs, 3), c0 = _getCs2[0], cMid = _getCs2[1], cMax = _getCs2[2];
var mid = .8;
var midInv = 1.25;
var t, k0, k1, k2;
if (s < mid) {
t = midInv * s;
k0 = 0;
k1 = mid * c0;
k2 = 1 - k1 / cMid;
} else {
t = 5 * (s - .8);
k0 = cMid;
k1 = .2 * Math.pow(cMid, 2) * Math.pow(1.25, 2) / c0;
k2 = 1 - k1 / (cMax - cMid);
}
var c4 = k0 + t * k1 / (1 - k2 * t);
a2 = c4 * a_;
b3 = c4 * b_;
}
return [ L, a2, b3 ];
}
function oklabToOkhsl(lab, lmsToRgb, okCoeff) {
var \u03b5L = 1e-7;
var \u03b5S = 1e-4;
var L = lab[0];
var s = 0;
var l = toe(L);
var c4 = Math.sqrt(Math.pow(lab[1], 2) + Math.pow(lab[2], 2));
var h = .5 + Math.atan2(-lab[2], -lab[1]) / tau2;
if (l !== 0 && l !== 1 && c4 !== 0) {
var a_ = lab[1] / c4;
var b_ = lab[2] / c4;
var _getCs3 = getCs([ L, a_, b_ ], lmsToRgb, okCoeff), _getCs4 = _slicedToArray(_getCs3, 3), c0 = _getCs4[0], cMid = _getCs4[1], cMax = _getCs4[2];
var mid = .8;
var midInv = 1.25;
var k0, k1, k2, t;
if (c4 < cMid) {
k1 = mid * c0;
k2 = 1 - k1 / cMid;
t = c4 / (k1 + k2 * c4);
s = t * mid;
} else {
k0 = cMid;
k1 = .2 * Math.pow(cMid, 2) * Math.pow(midInv, 2) / c0;
k2 = 1 - k1 / (cMax - cMid);
t = (c4 - k0) / (k1 + k2 * (c4 - k0));
s = mid + .2 * t;
}
}
var achromatic = Math.abs(s) < \u03b5S;
if (achromatic || l === 0 || Math.abs(1 - l) < \u03b5L) {
h = null;
if (!achromatic) {
s = 0;
}
} else {
h = constrain(h * 360);
}
return [ h, s, l ];
}
var Okhsl = new ColorSpace_default({
id: 'okhsl',
name: 'Okhsl',
coords: {
h: {
refRange: [ 0, 360 ],
type: 'angle',
name: 'Hue'
},
s: {
range: [ 0, 1 ],
name: 'Saturation'
},
l: {
range: [ 0, 1 ],
name: 'Lightness'
}
},
base: oklab_default,
gamutSpace: 'self',
M: M11,
fromBase: function fromBase(lab) {
return oklabToOkhsl(lab, M11.toSRGBLinear, RGBCoeff);
},
toBase: function toBase(hsl) {
return okhslToOklab(hsl, M11.toSRGBLinear, RGBCoeff);
},
formats: {
color: {
id: '--okhsl',
coords: [ '<number> | <angle>', '<percentage> | <number>', '<percentage> | <number>' ]
}
}
});
Okhsl.rgbGamut = new RGBColorSpace_default({
id: 'okhsl-prism',
cssId: '--okhsl-prism',
name: 'Okhsl Prism',
base: Okhsl,
fromBase: function fromBase(hsl) {
return hsl_default.toBase([ hsl[0], hsl[1] * 100, hsl[2] * 100 ]);
},
toBase: function toBase(rgb) {
var hsl = hsl_default.fromBase(rgb);
hsl[1] /= 100;
hsl[2] /= 100;
return hsl;
}
});
var okhsl_default = Okhsl;
var oklrab_default = new ColorSpace_default({
id: 'oklrab',
name: 'Oklrab',
coords: {
l: {
refRange: [ 0, 1 ],
name: 'Lightness'
},
a: {
refRange: [ -.4, .4 ]
},
b: {
refRange: [ -.4, .4 ]
}
},
white: 'D65',
base: oklab_default,
fromBase: function fromBase(oklab) {
return [ toe(oklab[0]), oklab[1], oklab[2] ];
},
toBase: function toBase(oklrab) {
return [ toeInv(oklrab[0]), oklrab[1], oklrab[2] ];
},
formats: {
color: {
coords: [ '<percentage> | <number>', '<number> | <percentage>[-1,1]', '<number> | <percentage>[-1,1]' ]
}
}
});
var oklrch_default = new ColorSpace_default({
id: 'oklrch',
name: 'Oklrch',
coords: {
l: {
refRange: [ 0, 1 ],
name: 'Lightness'
},
c: {
refRange: [ 0, .4 ],
name: 'Chroma'
},
h: {
refRange: [ 0, 360 ],
type: 'angle',
name: 'Hue'
}
},
white: 'D65',
base: oklrab_default,
fromBase: lch_default.fromBase,
toBase: lch_default.toBase,
formats: {
color: {
coords: [ '<percentage> | <number>', '<number> | <percentage>[0,1]', '<number> | <angle>' ]
}
}
});
var M12 = {
toSRGBLinear: okhsl_default.M.toSRGBLinear
};
function okhsvToOklab(hsv, lmsToRgb, okCoeff) {
var _hsv3 = _slicedToArray(hsv, 3), h = _hsv3[0], s = _hsv3[1], v = _hsv3[2];
h = constrain(h) / 360;
var l = toeInv(v);
var a2 = null;
var b3 = null;
if (l !== 0 && s !== 0) {
var a_ = Math.cos(tau2 * h);
var b_ = Math.sin(tau2 * h);
var cusp = findCusp(a_, b_, lmsToRgb, okCoeff);
var _toSt = toSt(cusp), _toSt2 = _slicedToArray(_toSt, 2), sMax = _toSt2[0], tMax = _toSt2[1];
var s0 = .5;
var k = 1 - s0 / sMax;
var lv = 1 - s * s0 / (s0 + tMax - tMax * k * s);
var cv = s * tMax * s0 / (s0 + tMax - tMax * k * s);
l = v * lv;
var c4 = v * cv;
var lvt = toeInv(lv);
var cvt = cv * lvt / lv;
var lNew = toeInv(l);
c4 = c4 * lNew / l;
l = lNew;
var _oklabToLinearRGB = oklabToLinearRGB([ lvt, a_ * cvt, b_ * cvt ], lmsToRgb), _oklabToLinearRGB2 = _slicedToArray(_oklabToLinearRGB, 3), rs = _oklabToLinearRGB2[0], gs = _oklabToLinearRGB2[1], bs = _oklabToLinearRGB2[2];
var scaleL = _spow(1 / Math.max(Math.max(rs, gs), Math.max(bs, 0)), 1 / 3);
l = l * scaleL;
c4 = c4 * scaleL;
a2 = c4 * a_;
b3 = c4 * b_;
}
return [ l, a2, b3 ];
}
function oklabToOkhsv(lab, lmsToRgb, okCoeff) {
var \u03b511 = 1e-4;
var l = lab[0];
var s = 0;
var v = toe(l);
var c4 = Math.sqrt(Math.pow(lab[1], 2) + Math.pow(lab[2], 2));
var h = .5 + Math.atan2(-lab[2], -lab[1]) / tau2;
if (l !== 0 && l !== 1 && c4 !== 0) {
var a_ = lab[1] / c4;
var b_ = lab[2] / c4;
var cusp = findCusp(a_, b_, lmsToRgb, okCoeff);
var _toSt3 = toSt(cusp), _toSt4 = _slicedToArray(_toSt3, 2), sMax = _toSt4[0], tMax = _toSt4[1];
var s0 = .5;
var k = 1 - s0 / sMax;
var t = tMax / (c4 + l * tMax);
var lv = t * l;
var cv = t * c4;
var lvt = toeInv(lv);
var cvt = cv * lvt / lv;
var _oklabToLinearRGB3 = oklabToLinearRGB([ lvt, a_ * cvt, b_ * cvt ], lmsToRgb), _oklabToLinearRGB4 = _slicedToArray(_oklabToLinearRGB3, 3), rs = _oklabToLinearRGB4[0], gs = _oklabToLinearRGB4[1], bs = _oklabToLinearRGB4[2];
var scaleL = _spow(1 / Math.max(Math.max(rs, gs), Math.max(bs, 0)), 1 / 3);
l = l / scaleL;
c4 = c4 / scaleL;
c4 = c4 * toe(l) / l;
l = toe(l);
v = l / lv;
s = (s0 + tMax) * cv / (tMax * s0 + tMax * k * cv);
}
if (Math.abs(s) < \u03b511 || v === 0) {
h = null;
} else {
h = constrain(h * 360);
}
return [ h, s, v ];
}
var Okhsv = new ColorSpace_default({
id: 'okhsv',
name: 'Okhsv',
coords: {
h: {
refRange: [ 0, 360 ],
type: 'angle',
name: 'Hue'
},
s: {
range: [ 0, 1 ],
name: 'Saturation'
},
v: {
range: [ 0, 1 ],
name: 'Value'
}
},
base: oklab_default,
gamutSpace: 'self',
M: M12,
fromBase: function fromBase(lab) {
return oklabToOkhsv(lab, M12.toSRGBLinear, RGBCoeff);
},
toBase: function toBase(hsl) {
return okhsvToOklab(hsl, M12.toSRGBLinear, RGBCoeff);
},
formats: {
color: {
id: '--okhsv',
coords: [ '<number> | <angle>', '<percentage> | <number>', '<percentage> | <number>' ]
}
}
});
Okhsv.rgbGamut = new RGBColorSpace_default({
id: 'okhsv-prism',
cssId: '--okhsv-prism',
name: 'Okhsv Prism',
base: Okhsv,
fromBase: function fromBase(hsl) {
return hsl_default.toBase([ hsl[0], hsl[1] * 100, hsl[2] * 100 ]);
},
toBase: function toBase(rgb) {
var hsl = hsl_default.fromBase(rgb);
hsl[1] /= 100;
hsl[2] /= 100;
return hsl;
}
});
var okhsv_default = Okhsv;
var white5 = WHITES.D65;
var \u03b57 = 216 / 24389;
var \u03ba4 = 24389 / 27;
var _uv2 = _uv({
space: xyz_d65_default,
coords: white5
}), _uv3 = _slicedToArray(_uv2, 2), U_PRIME_WHITE = _uv3[0], V_PRIME_WHITE = _uv3[1];
var luv_default = new ColorSpace_default({
id: 'luv',
name: 'Luv',
coords: {
l: {
refRange: [ 0, 100 ],
name: 'Lightness'
},
u: {
refRange: [ -215, 215 ]
},
v: {
refRange: [ -215, 215 ]
}
},
white: white5,
base: xyz_d65_default,
fromBase: function fromBase(XYZ) {
var xyz = [ _skipNone(XYZ[0]), _skipNone(XYZ[1]), _skipNone(XYZ[2]) ];
var y = xyz[1];
var _uv4 = _uv({
space: xyz_d65_default,
coords: xyz
}), _uv5 = _slicedToArray(_uv4, 2), up = _uv5[0], vp = _uv5[1];
if (!Number.isFinite(up) || !Number.isFinite(vp)) {
return [ 0, 0, 0 ];
}
var L = y <= \u03b57 ? \u03ba4 * y : 116 * Math.cbrt(y) - 16;
return [ L, 13 * L * (up - U_PRIME_WHITE), 13 * L * (vp - V_PRIME_WHITE) ];
},
toBase: function toBase(Luv) {
var _Luv = _slicedToArray(Luv, 3), L = _Luv[0], u = _Luv[1], v = _Luv[2];
if (L === 0 || _isNone(L)) {
return [ 0, 0, 0 ];
}
u = _skipNone(u);
v = _skipNone(v);
var up = u / (13 * L) + U_PRIME_WHITE;
var vp = v / (13 * L) + V_PRIME_WHITE;
var y = L <= 8 ? L / \u03ba4 : Math.pow((L + 16) / 116, 3);
return [ y * (9 * up / (4 * vp)), y, y * ((12 - 3 * up - 20 * vp) / (4 * vp)) ];
},
formats: {
color: {
id: '--luv',
coords: [ '<number> | <percentage>', '<number> | <percentage>', '<number> | <percentage>' ]
}
}
});
var lchuv_default = new ColorSpace_default({
id: 'lchuv',
name: 'LChuv',
coords: {
l: {
refRange: [ 0, 100 ],
name: 'Lightness'
},
c: {
refRange: [ 0, 220 ],
name: 'Chroma'
},
h: {
refRange: [ 0, 360 ],
type: 'angle',
name: 'Hue'
}
},
base: luv_default,
fromBase: lch_default.fromBase,
toBase: lch_default.toBase,
formats: {
color: {
id: '--lchuv',
coords: [ '<number> | <percentage>', '<number> | <percentage>', '<number> | <angle>' ]
}
}
});
var \u03b58 = 216 / 24389;
var \u03ba5 = 24389 / 27;
var fromXYZ_M = M8.fromXYZ;
var m_r0 = fromXYZ_M[0][0];
var m_r1 = fromXYZ_M[0][1];
var m_r2 = fromXYZ_M[0][2];
var m_g0 = fromXYZ_M[1][0];
var m_g1 = fromXYZ_M[1][1];
var m_g2 = fromXYZ_M[1][2];
var m_b0 = fromXYZ_M[2][0];
var m_b1 = fromXYZ_M[2][1];
var m_b2 = fromXYZ_M[2][2];
function distanceFromOriginAngle(slope, intercept, angle) {
var d2 = intercept / (Math.sin(angle) - slope * Math.cos(angle));
return d2 < 0 ? Infinity : d2;
}
function calculateBoundingLines(l) {
var sub1 = Math.pow(l + 16, 3) / 1560896;
var sub2 = sub1 > \u03b58 ? sub1 : l / \u03ba5;
var s1r = sub2 * (284517 * m_r0 - 94839 * m_r2);
var s2r = sub2 * (838422 * m_r2 + 769860 * m_r1 + 731718 * m_r0);
var s3r = sub2 * (632260 * m_r2 - 126452 * m_r1);
var s1g = sub2 * (284517 * m_g0 - 94839 * m_g2);
var s2g = sub2 * (838422 * m_g2 + 769860 * m_g1 + 731718 * m_g0);
var s3g = sub2 * (632260 * m_g2 - 126452 * m_g1);
var s1b = sub2 * (284517 * m_b0 - 94839 * m_b2);
var s2b = sub2 * (838422 * m_b2 + 769860 * m_b1 + 731718 * m_b0);
var s3b = sub2 * (632260 * m_b2 - 126452 * m_b1);
return {
r0s: s1r / s3r,
r0i: s2r * l / s3r,
r1s: s1r / (s3r + 126452),
r1i: (s2r - 769860) * l / (s3r + 126452),
g0s: s1g / s3g,
g0i: s2g * l / s3g,
g1s: s1g / (s3g + 126452),
g1i: (s2g - 769860) * l / (s3g + 126452),
b0s: s1b / s3b,
b0i: s2b * l / s3b,
b1s: s1b / (s3b + 126452),
b1i: (s2b - 769860) * l / (s3b + 126452)
};
}
function calcMaxChromaHsluv(lines, h) {
var hueRad = h / 360 * Math.PI * 2;
var r0 = distanceFromOriginAngle(lines.r0s, lines.r0i, hueRad);
var r1 = distanceFromOriginAngle(lines.r1s, lines.r1i, hueRad);
var g0 = distanceFromOriginAngle(lines.g0s, lines.g0i, hueRad);
var g1 = distanceFromOriginAngle(lines.g1s, lines.g1i, hueRad);
var b0 = distanceFromOriginAngle(lines.b0s, lines.b0i, hueRad);
var b1 = distanceFromOriginAngle(lines.b1s, lines.b1i, hueRad);
return Math.min(r0, r1, g0, g1, b0, b1);
}
var hsluv_default = new ColorSpace_default({
id: 'hsluv',
name: 'HSLuv',
coords: {
h: {
refRange: [ 0, 360 ],
type: 'angle',
name: 'Hue'
},
s: {
range: [ 0, 100 ],
name: 'Saturation'
},
l: {
range: [ 0, 100 ],
name: 'Lightness'
}
},
base: lchuv_default,
gamutSpace: srgb_default,
rgbGamut: srgb_default,
fromBase: function fromBase(lch) {
var _ref38 = [ _skipNone(lch[0]), _skipNone(lch[1]), _skipNone(lch[2]) ], l = _ref38[0], c4 = _ref38[1], h = _ref38[2];
var s;
if (l > 99.9999999) {
s = 0;
l = 100;
} else if (l < 1e-8) {
s = 0;
l = 0;
} else {
var lines = calculateBoundingLines(l);
var max2 = calcMaxChromaHsluv(lines, h);
s = c4 / max2 * 100;
}
return [ h, s, l ];
},
toBase: function toBase(hsl) {
var _ref39 = [ _skipNone(hsl[0]), _skipNone(hsl[1]), _skipNone(hsl[2]) ], h = _ref39[0], s = _ref39[1], l = _ref39[2];
var c4;
if (l > 99.9999999) {
l = 100;
c4 = 0;
} else if (l < 1e-8) {
l = 0;
c4 = 0;
} else {
var lines = calculateBoundingLines(l);
var max2 = calcMaxChromaHsluv(lines, h);
c4 = max2 / 100 * s;
}
return [ l, c4, h ];
},
formats: {
color: {
id: '--hsluv',
coords: [ '<number> | <angle>', '<percentage> | <number>', '<percentage> | <number>' ]
}
}
});
var \u03b59 = 216 / 24389;
var \u03ba6 = 24389 / 27;
var fromXYZ_M2 = M8.fromXYZ;
var m_r02 = fromXYZ_M2[0][0];
var m_r12 = fromXYZ_M2[0][1];
var m_r22 = fromXYZ_M2[0][2];
var m_g02 = fromXYZ_M2[1][0];
var m_g12 = fromXYZ_M2[1][1];
var m_g22 = fromXYZ_M2[1][2];
var m_b02 = fromXYZ_M2[2][0];
var m_b12 = fromXYZ_M2[2][1];
var m_b22 = fromXYZ_M2[2][2];
function distanceFromOrigin(slope, intercept) {
return Math.abs(intercept) / Math.sqrt(Math.pow(slope, 2) + 1);
}
function calcMaxChromaHpluv(lines) {
var r0 = distanceFromOrigin(lines.r0s, lines.r0i);
var r1 = distanceFromOrigin(lines.r1s, lines.r1i);
var g0 = distanceFromOrigin(lines.g0s, lines.g0i);
var g1 = distanceFromOrigin(lines.g1s, lines.g1i);
var b0 = distanceFromOrigin(lines.b0s, lines.b0i);
var b1 = distanceFromOrigin(lines.b1s, lines.b1i);
return Math.min(r0, r1, g0, g1, b0, b1);
}
var HPLuv = new ColorSpace_default({
id: 'hpluv',
name: 'HPLuv',
coords: {
h: {
refRange: [ 0, 360 ],
type: 'angle',
name: 'Hue'
},
s: {
range: [ 0, 100 ],
name: 'Saturation'
},
l: {
range: [ 0, 100 ],
name: 'Lightness'
}
},
base: lchuv_default,
gamutSpace: 'self',
fromBase: function fromBase(lch) {
var _ref40 = [ _skipNone(lch[0]), _skipNone(lch[1]), _skipNone(lch[2]) ], l = _ref40[0], c4 = _ref40[1], h = _ref40[2];
var s;
if (l > 99.9999999) {
s = 0;
l = 100;
} else if (l < 1e-8) {
s = 0;
l = 0;
} else {
var lines = calculateBoundingLines(l);
var max2 = calcMaxChromaHpluv(lines);
s = c4 / max2 * 100;
}
return [ h, s, l ];
},
toBase: function toBase(hsl) {
var _ref41 = [ _skipNone(hsl[0]), _skipNone(hsl[1]), _skipNone(hsl[2]) ], h = _ref41[0], s = _ref41[1], l = _ref41[2];
var c4;
if (l > 99.9999999) {
l = 100;
c4 = 0;
} else if (l < 1e-8) {
l = 0;
c4 = 0;
} else {
var lines = calculateBoundingLines(l);
var max2 = calcMaxChromaHpluv(lines);
c4 = max2 / 100 * s;
}
return [ l, c4, h ];
},
formats: {
color: {
id: '--hpluv',
coords: [ '<number> | <angle>', '<percentage> | <number>', '<percentage> | <number>' ]
}
}
});
HPLuv.rgbGamut = new RGBColorSpace_default({
id: 'hpluv-prism',
cssId: '--hpluv-prism',
name: 'HPLuv Prism',
base: HPLuv,
fromBase: function fromBase(hsl) {
return hsl_default.toBase(hsl);
},
toBase: function toBase(rgb) {
return hsl_default.fromBase(rgb);
}
});
var hpluv_default = HPLuv;
var ALPHA = .021;
var S = Math.sqrt(ALPHA / 3);
var S3 = S * S * S;
var CP = .978;
var ENR_AMP = .058;
var ENR_CENTER = 264.5 * Math.PI / 180;
var ENR_SIGMA = .7;
var ENR_LLO = .37;
var ENR_LHI = 1;
var M13 = {
M1: [ [ .8154832155941288, .36033406153856506, -.12434135574228214 ], [ .03301008352745078, .9292865057066169, .03612192716575443 ], [ .04818827356456861, .2642841575338424, .6334971784195534 ] ],
M1_INV: [ [ 1.2325947975032656, -.5557590239287523, .2736201534771583 ], [ -.040801327874216024, 1.112228863738653, -.07142753586443781 ], [ -.07673825928337766, -.42172784577108585, 1.5875238558143416 ] ],
M2: [ [ .21193779684470104, .7992121834263127, -.00410075161564345 ], [ 2.4672018828033475, -2.9877348024830788, .520532919679731 ], [ -.11390787868068575, 1.3932982808117473, -1.279390402131062 ] ],
M2_INV: [ [ .9930001151336143, .32599327253052285, .1294508563171392 ], [ .9930001151336139, -.08708353111074627, -.03861361743004929 ], [ .9930001151336136, -.12386097008215022, -.8351991365871061 ] ]
};
var PW_L_IN = [ 0, .05, .1, .15, .2, .25, .3, .35, .4, .45, .5, .55, .6, .65, .7, .75, .8, .85, .9, .95, 1 ];
var PW_L_OUT = [ 0, .009494013522189627, .02564569838030986, .055259661658689105, .10574901531227408, .16055853320726027, .21405964892993756, .26786230508811226, .3220435246104499, .3739052098520243, .43020997780918835, .4835465162128873, .5399824670411353, .5956710081330342, .6542161666450478, .7115380216519989, .7702762412711669, .8293313467712837, .889406386197059, .9462829573474728, 1 ];
var PW_N = PW_L_IN.length;
function depcubicFwd(x) {
var t = x / (2 * S3);
var y = 2 * S * Math.sinh(Math.asinh(t) / 3);
var f = y * y * y + ALPHA * y - x;
var fp = 3 * y * y + ALPHA;
var fpp = 6 * y;
var denom = 2 * fp * fp - f * fpp;
if (Math.abs(denom) > 1e-30) {
y -= 2 * f * fp / denom;
}
return y;
}
function depcubicInv(y) {
return y * y * y + ALPHA * y;
}
function enrichGate(L) {
var t = Math.max(0, Math.min(1, (L - ENR_LLO) / (ENR_LHI - ENR_LLO)));
return Math.pow(Math.sin(Math.PI * t), 2);
}
function enrichFwd(L, a2, b3) {
var C = Math.sqrt(a2 * a2 + b3 * b3);
if (C < 1e-12) {
return [ a2, b3 ];
}
var gate = enrichGate(L);
if (gate < 1e-12) {
return [ a2, b3 ];
}
var h = Math.atan2(b3, a2);
var dh = h - ENR_CENTER;
dh = dh - Math.round(dh / (2 * Math.PI)) * 2 * Math.PI;
var gauss = Math.exp(-.5 * Math.pow(dh / ENR_SIGMA, 2));
var hNew = h + ENR_AMP * gate * gauss;
return [ C * Math.cos(hNew), C * Math.sin(hNew) ];
}
function enrichInv(L, a2, b3) {
var C = Math.sqrt(a2 * a2 + b3 * b3);
if (C < 1e-12) {
return [ a2, b3 ];
}
var gate = enrichGate(L);
if (gate < 1e-12) {
return [ a2, b3 ];
}
var hTarget = Math.atan2(b3, a2);
var sig2 = ENR_SIGMA * ENR_SIGMA;
var ag = ENR_AMP * gate;
var h = hTarget;
for (var i = 0; i < 8; i++) {
var dh = h - ENR_CENTER;
dh = dh - Math.round(dh / (2 * Math.PI)) * 2 * Math.PI;
var gauss = Math.exp(-.5 * dh * dh / sig2);
var F = h + ag * gauss - hTarget;
var Fp = 1 + ag * gauss * (-dh / sig2);
var Fpp = ag * gauss * (-1 / sig2 + dh * dh / (sig2 * sig2));
var den = 2 * Fp * Fp - F * Fpp;
if (Math.abs(den) > 1e-30) {
h -= 2 * F * Fp / den;
}
}
return [ C * Math.cos(h), C * Math.sin(h) ];
}
function pwLForward(L) {
if (L <= 0 || L >= 1) {
return L;
}
var lo = 0, hi = PW_N - 1;
while (hi - lo > 1) {
var mid = lo + hi >> 1;
if (PW_L_IN[mid] <= L) {
lo = mid;
} else {
hi = mid;
}
}
var t = (L - PW_L_IN[lo]) / (PW_L_IN[hi] - PW_L_IN[lo]);
return PW_L_OUT[lo] + t * (PW_L_OUT[hi] - PW_L_OUT[lo]);
}
function pwLInverse(L) {
if (L <= PW_L_OUT[0] || L >= PW_L_OUT[PW_N - 1]) {
return L;
}
var lo = 0, hi = PW_N - 1;
while (hi - lo > 1) {
var mid = lo + hi >> 1;
if (PW_L_OUT[mid] <= L) {
lo = mid;
} else {
hi = mid;
}
}
var t = (L - PW_L_OUT[lo]) / (PW_L_OUT[hi] - PW_L_OUT[lo]);
return PW_L_IN[lo] + t * (PW_L_IN[hi] - PW_L_IN[lo]);
}
var helmgen_default = new ColorSpace_default({
id: 'helmgen',
name: 'HelmGen',
cssId: '--helmgen',
coords: {
l: {
refRange: [ 0, 1 ],
name: 'Lightness'
},
a: {
refRange: [ -.6, .6 ]
},
b: {
refRange: [ -.6, .6 ]
}
},
white: 'D65',
base: xyz_d65_default,
M: M13,
fromBase: function fromBase(xyz) {
var lms = _multiply_v3_m3x(xyz, M13.M1);
var c0 = depcubicFwd(Math.max(lms[0], 0));
var c14 = depcubicFwd(Math.max(lms[1], 0));
var c24 = depcubicFwd(Math.max(lms[2], 0));
{
var mean = (c0 + c14 + c24) / 3;
var mx = Math.max(c0, c14, c24);
var mn = Math.min(c0, c14, c24);
var spread = (mx - mn) / Math.max(Math.abs(mean), 1e-30);
var w = Math.exp(-Math.pow(spread / 1e-5, 2));
c0 += w * (mean - c0);
c14 += w * (mean - c14);
c24 += w * (mean - c24);
}
var _multiply_v3_m3x10 = _multiply_v3_m3x([ c0, c14, c24 ], M13.M2), _multiply_v3_m3x11 = _slicedToArray(_multiply_v3_m3x10, 3), L = _multiply_v3_m3x11[0], a2 = _multiply_v3_m3x11[1], b3 = _multiply_v3_m3x11[2];
{
var C = Math.sqrt(a2 * a2 + b3 * b3);
if (C > 1e-12) {
var Cnew = Math.pow(C, CP);
var s = Cnew / C;
a2 *= s;
b3 *= s;
}
}
L = pwLForward(L);
var _enrichFwd = enrichFwd(L, a2, b3);
var _enrichFwd2 = _slicedToArray(_enrichFwd, 2);
a2 = _enrichFwd2[0];
b3 = _enrichFwd2[1];
return [ L, a2, b3 ];
},
toBase: function toBase(lab) {
var _lab3 = _slicedToArray(lab, 3), L = _lab3[0], a2 = _lab3[1], b3 = _lab3[2];
var _enrichInv = enrichInv(L, a2, b3);
var _enrichInv2 = _slicedToArray(_enrichInv, 2);
a2 = _enrichInv2[0];
b3 = _enrichInv2[1];
L = pwLInverse(L);
{
var C = Math.sqrt(a2 * a2 + b3 * b3);
if (C > 1e-12) {
var Corig = Math.pow(C, 1 / CP);
var s = Corig / C;
a2 *= s;
b3 *= s;
}
}
var _multiply_v3_m3x12 = _multiply_v3_m3x([ L, a2, b3 ], M13.M2_INV), _multiply_v3_m3x13 = _slicedToArray(_multiply_v3_m3x12, 3), lc0 = _multiply_v3_m3x13[0], lc12 = _multiply_v3_m3x13[1], lc22 = _multiply_v3_m3x13[2];
{
var mean = (lc0 + lc12 + lc22) / 3;
var mx = Math.max(lc0, lc12, lc22);
var mn = Math.min(lc0, lc12, lc22);
var spread = (mx - mn) / Math.max(Math.abs(mean), 1e-30);
var w = Math.exp(-Math.pow(spread / 1e-5, 2));
lc0 += w * (mean - lc0);
lc12 += w * (mean - lc12);
lc22 += w * (mean - lc22);
}
var l0 = depcubicInv(lc0);
var l1 = depcubicInv(lc12);
var l2 = depcubicInv(lc22);
return _multiply_v3_m3x([ l0, l1, l2 ], M13.M1_INV);
}
});
var helmgenlch_default = new ColorSpace_default({
id: 'helmgenlch',
name: 'HelmGenLCh',
cssId: '--helmgenlch',
coords: {
l: {
refRange: [ 0, 1 ],
name: 'Lightness'
},
c: {
refRange: [ 0, .65 ],
name: 'Chroma'
},
h: {
refRange: [ 0, 360 ],
type: 'angle',
name: 'Hue'
}
},
white: 'D65',
base: helmgen_default,
fromBase: lch_default.fromBase,
toBase: lch_default.toBase
});
var rec2100_linear_default = new RGBColorSpace_default({
id: 'rec2100-linear',
name: 'Linear REC.2100',
white: 'D65',
M: M6
});
var Yw2 = 203;
var n2 = 2610 / Math.pow(2, 14);
var ninv2 = Math.pow(2, 14) / 2610;
var m = 2523 / Math.pow(2, 5);
var minv = Math.pow(2, 5) / 2523;
var c13 = 3424 / Math.pow(2, 12);
var c23 = 2413 / Math.pow(2, 7);
var c33 = 2392 / Math.pow(2, 7);
var rec2100_pq_default = new RGBColorSpace_default({
id: 'rec2100pq',
cssId: 'rec2100-pq',
name: 'REC.2100-PQ',
base: rec2100_linear_default,
linearGamut: rec2100_linear_default,
toBase: function toBase(RGB) {
return RGB.map(function(val) {
var x = Math.pow(Math.max(Math.pow(val, minv) - c13, 0) / (c23 - c33 * Math.pow(val, minv)), ninv2);
return x * 1e4 / Yw2;
});
},
fromBase: function fromBase(RGB) {
return RGB.map(function(val) {
var x = Math.max(val * Yw2 / 1e4, 0);
var num = c13 + c23 * Math.pow(x, n2);
var denom = 1 + c33 * Math.pow(x, n2);
return Math.pow(num / denom, m);
});
}
});
var a = .17883277;
var b2 = .28466892;
var c = .55991073;
var scale = 3.7743;
var rec2100_hlg_default = new RGBColorSpace_default({
id: 'rec2100hlg',
cssId: 'rec2100-hlg',
name: 'REC.2100-HLG',
referred: 'scene',
base: rec2100_linear_default,
linearGamut: rec2100_linear_default,
toBase: function toBase(RGB) {
return RGB.map(function(val) {
if (val <= .5) {
return Math.pow(val, 2) / 3 * scale;
}
return (Math.exp((val - c) / a) + b2) / 12 * scale;
});
},
fromBase: function fromBase(RGB) {
return RGB.map(function(val) {
val /= scale;
if (val <= 1 / 12) {
return _spow(3 * val, .5);
}
return a * Math.log(12 * val - b2) + c;
});
}
});
var CATs = {};
hooks_default.add('chromatic-adaptation-start', function(env) {
if (env.options.method) {
env.M = adapt3(env.W1, env.W2, env.options.method);
}
});
hooks_default.add('chromatic-adaptation-end', function(env) {
if (!env.M) {
env.M = adapt3(env.W1, env.W2, env.options.method);
}
});
function defineCAT(_ref42) {
var id = _ref42.id, toCone_M = _ref42.toCone_M, fromCone_M = _ref42.fromCone_M;
CATs[id] = arguments[0];
}
function adapt3(W1, W2) {
var id = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'Bradford';
var method = CATs[id];
var _multiplyMatrices2 = _multiplyMatrices(method.toCone_M, W1), _multiplyMatrices3 = _slicedToArray(_multiplyMatrices2, 3), \u03c1s = _multiplyMatrices3[0], \u03b3s = _multiplyMatrices3[1], \u03b2s = _multiplyMatrices3[2];
var _multiplyMatrices4 = _multiplyMatrices(method.toCone_M, W2), _multiplyMatrices5 = _slicedToArray(_multiplyMatrices4, 3), \u03c1d = _multiplyMatrices5[0], \u03b3d = _multiplyMatrices5[1], \u03b2d = _multiplyMatrices5[2];
var scale2 = [ [ \u03c1d / \u03c1s, 0, 0 ], [ 0, \u03b3d / \u03b3s, 0 ], [ 0, 0, \u03b2d / \u03b2s ] ];
var scaled_cone_M = _multiplyMatrices(scale2, method.toCone_M);
var adapt_M = _multiplyMatrices(method.fromCone_M, scaled_cone_M);
return adapt_M;
}
defineCAT({
id: 'von Kries',
toCone_M: [ [ .40024, .7076, -.08081 ], [ -.2263, 1.16532, .0457 ], [ 0, 0, .91822 ] ],
fromCone_M: [ [ 1.8599363874558397, -1.1293816185800916, .21989740959619328 ], [ .3611914362417676, .6388124632850422, -6370596838649899e-21 ], [ 0, 0, 1.0890636230968613 ] ]
});
defineCAT({
id: 'Bradford',
toCone_M: [ [ .8951, .2664, -.1614 ], [ -.7502, 1.7135, .0367 ], [ .0389, -.0685, 1.0296 ] ],
fromCone_M: [ [ .9869929054667121, -.14705425642099013, .15996265166373122 ], [ .4323052697233945, .5183602715367774, .049291228212855594 ], [ -.00852866457517732, .04004282165408486, .96848669578755 ] ]
});
defineCAT({
id: 'CAT02',
toCone_M: [ [ .7328, .4296, -.1624 ], [ -.7036, 1.6975, .0061 ], [ .003, .0136, .9834 ] ],
fromCone_M: [ [ 1.0961238208355142, -.27886900021828726, .18274517938277307 ], [ .4543690419753592, .4735331543074117, .07209780371722911 ], [ -.009627608738429355, -.00569803121611342, 1.0153256399545427 ] ]
});
defineCAT({
id: 'CAT16',
toCone_M: [ [ .401288, .650173, -.051461 ], [ -.250268, 1.204414, .045854 ], [ -.002079, .048952, .953127 ] ],
fromCone_M: [ [ 1.862067855087233, -1.0112546305316845, .14918677544445172 ], [ .3875265432361372, .6214474419314753, -.008973985167612521 ], [ -.01584149884933386, -.03412293802851557, 1.0499644368778496 ] ]
});
Object.assign(WHITES, {
A: [ 1.0985, 1, .35585 ],
C: [ .98074, 1, 1.18232 ],
D55: [ .95682, 1, .92149 ],
D75: [ .94972, 1, 1.22638 ],
E: [ 1, 1, 1 ],
F2: [ .99186, 1, .67393 ],
F7: [ .95041, 1, 1.08747 ],
F11: [ 1.00962, 1, .6435 ]
});
WHITES.ACES = [ .32168 / .33767, 1, (1 - .32168 - .33767) / .33767 ];
var M14 = {
toXYZ: [ [ .6624541811085053, .13400420645643313, .1561876870049078 ], [ .27222871678091454, .6740817658111484, .05368951740793705 ], [ -.005574649490394108, .004060733528982826, 1.0103391003129971 ] ],
fromXYZ: [ [ 1.6410233796943257, -.32480329418479, -.23642469523761225 ], [ -.6636628587229829, 1.6153315916573379, .016756347685530137 ], [ .011721894328375376, -.008284441996237409, .9883948585390215 ] ]
};
var acescg_default = new RGBColorSpace_default({
id: 'acescg',
cssId: '--acescg',
name: 'ACEScg',
coords: {
r: {
range: [ 0, 65504 ],
name: 'Red'
},
g: {
range: [ 0, 65504 ],
name: 'Green'
},
b: {
range: [ 0, 65504 ],
name: 'Blue'
}
},
referred: 'scene',
white: WHITES.ACES,
M: M14
});
var \u03b510 = Math.pow(2, -16);
var ACES_min_nonzero = -.35828683;
var ACES_cc_max = (Math.log2(65504) + 9.72) / 17.52;
var acescc_default = new RGBColorSpace_default({
id: 'acescc',
cssId: '--acescc',
name: 'ACEScc',
coords: {
r: {
range: [ ACES_min_nonzero, ACES_cc_max ],
name: 'Red'
},
g: {
range: [ ACES_min_nonzero, ACES_cc_max ],
name: 'Green'
},
b: {
range: [ ACES_min_nonzero, ACES_cc_max ],
name: 'Blue'
}
},
referred: 'scene',
base: acescg_default,
linearGamut: acescg_default,
toBase: function toBase(RGB) {
var low = (9.72 - 15) / 17.52;
return RGB.map(function(val) {
if (val <= low) {
return (Math.pow(2, val * 17.52 - 9.72) - \u03b510) * 2;
} else if (val < ACES_cc_max) {
return Math.pow(2, val * 17.52 - 9.72);
} else {
return 65504;
}
});
},
fromBase: function fromBase(RGB) {
return RGB.map(function(val) {
if (val <= 0) {
return (Math.log2(\u03b510) + 9.72) / 17.52;
} else if (val < \u03b510) {
return (Math.log2(\u03b510 + val * .5) + 9.72) / 17.52;
} else {
return (Math.log2(val) + 9.72) / 17.52;
}
});
}
});
var _Color = function() {
function Color() {
var _this9 = this;
_classCallCheck(this, Color);
var color;
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
args[_key3] = arguments[_key3];
}
if (args.length === 1) {
var parseMeta = {};
if (_typeof(args[0]) === 'object' && Object.getPrototypeOf(args[0]).constructor === Object) {
args[0] = _extends({}, args[0]);
}
color = getColor(args[0], {
parseMeta: parseMeta
});
if (parseMeta.format) {
this.parseMeta = parseMeta;
}
}
var space, coords, alpha;
if (color) {
space = color.space || color.spaceId;
coords = color.coords;
alpha = color.alpha;
} else {
space = args[0];
coords = args[1];
alpha = args[2];
}
Object.defineProperty(this, 'space', {
value: ColorSpace_default.get(space),
writable: false,
enumerable: true,
configurable: true
});
this.coords = coords ? coords.slice() : [ 0, 0, 0 ];
this.alpha = _isNone(alpha) ? alpha : alpha === void 0 ? 1 : _clamp(0, alpha, 1);
var _loop3 = function _loop3(id) {
Object.defineProperty(_this9, id, {
get: function get() {
return _this9.get(id);
},
set: function set(value) {
return _this9.set(id, value);
}
});
};
for (var id in this.space.coords) {
_loop3(id);
}
}
return _createClass(Color, [ {
key: 'spaceId',
get: function get() {
return this.space.id;
}
}, {
key: 'clone',
value: function clone() {
return new _Color(this.space, this.coords, this.alpha);
}
}, {
key: 'toJSON',
value: function toJSON() {
return {
spaceId: this.spaceId,
coords: this.coords,
alpha: this.alpha
};
}
}, {
key: 'display',
value: function display() {
for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
args[_key4] = arguments[_key4];
}
var ret = _display.apply(void 0, [ this ].concat(args));
ret.color = new _Color(ret.color);
return ret;
}
} ], [ {
key: 'get',
value: function get(color) {
if (_isInstance(color, this)) {
return color;
}
for (var _len5 = arguments.length, args = new Array(_len5 > 1 ? _len5 - 1 : 0), _key5 = 1; _key5 < _len5; _key5++) {
args[_key5 - 1] = arguments[_key5];
}
return _construct(_Color, [ color ].concat(args));
}
}, {
key: 'try',
value: function _try(color, options) {
if (_isInstance(color, this)) {
return color;
}
var ret = tryColor(color, options);
if (ret) {
return new _Color(ret);
}
return null;
}
}, {
key: 'defineFunction',
value: function defineFunction(name, code) {
var o = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : code;
var _o$instance = o.instance, instance2 = _o$instance === void 0 ? true : _o$instance, returns = o.returns;
var func = function func() {
var ret = code.apply(void 0, arguments);
if (returns === 'color') {
ret = _Color.get(ret);
} else if (returns === 'function<color>') {
var f = ret;
ret = function ret() {
var ret2 = f.apply(void 0, arguments);
return _Color.get(ret2);
};
Object.assign(ret, f);
} else if (returns === 'array<color>') {
ret = ret.map(function(c4) {
return _Color.get(c4);
});
}
return ret;
};
if (!(name in _Color)) {
_Color[name] = func;
}
if (instance2) {
_Color.prototype[name] = function() {
for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {
args[_key6] = arguments[_key6];
}
return func.apply(void 0, [ this ].concat(args));
};
}
}
}, {
key: 'defineFunctions',
value: function defineFunctions(o) {
for (var name in o) {
_Color.defineFunction(name, o[name], o[name]);
}
}
}, {
key: 'extend',
value: function extend(exports) {
if (exports.register) {
exports.register(_Color);
} else {
for (var name in exports) {
_Color.defineFunction(name, exports[name]);
}
}
}
} ]);
}();
var color_default = _Color;
_Color.defineFunctions({
get: get,
getAll: getAll,
set: set,
setAll: setAll,
to: to,
equals: equals,
inGamut: inGamut,
toGamut: toGamut,
distance: distance,
deltas: deltas,
toString: serialize
});
Object.assign(_Color, {
util: util_exports,
hooks: hooks_default,
WHITES: WHITES,
Space: ColorSpace_default,
spaces: ColorSpace_default.registry,
parse: parse,
defaults: defaults_default
});
for (var _i6 = 0, _Object$keys = Object.keys(index_fn_exports); _i6 < _Object$keys.length; _i6++) {
var key = _Object$keys[_i6];
ColorSpace_default.register(index_fn_exports[key]);
}
for (var id in ColorSpace_default.registry) {
addSpaceAccessors(id, ColorSpace_default.registry[id]);
}
hooks_default.add('colorspace-init-end', function(space) {
var _space$aliases;
addSpaceAccessors(space.id, space);
(_space$aliases = space.aliases) === null || _space$aliases === void 0 || _space$aliases.forEach(function(alias) {
addSpaceAccessors(alias, space);
});
});
function addSpaceAccessors(id, space) {
var propId = id.replace(/-/g, '_');
Object.defineProperty(color_default.prototype, propId, {
get: function get() {
var _this0 = this;
var ret = this.getAll(id);
if (typeof Proxy === 'undefined') {
return ret;
}
var proxy = new Proxy(ret, {
has: function has(obj, property) {
try {
ColorSpace_default.resolveCoord([ space, property ]);
return true;
} catch (e) {}
return Reflect.has(obj, property);
},
get: function get(obj, property, receiver) {
if (property && _typeof(property) !== 'symbol' && !(property in obj) && property in proxy) {
var _ColorSpace_default$r4 = ColorSpace_default.resolveCoord([ space, property ]), index = _ColorSpace_default$r4.index;
if (index >= 0) {
return obj[index];
}
}
return Reflect.get(obj, property, receiver);
},
set: function set(obj, property, value, receiver) {
if (property && _typeof(property) !== 'symbol' && !(property in obj) || Number(property) >= 0) {
var _ColorSpace_default$r5 = ColorSpace_default.resolveCoord([ space, property ]), index = _ColorSpace_default$r5.index;
if (index >= 0) {
obj[index] = value;
_this0.setAll(id, obj);
return true;
}
}
return Reflect.set(obj, property, value, receiver);
}
});
return proxy;
},
set: function set(coords) {
this.setAll(id, coords);
},
configurable: true,
enumerable: true
});
}
color_default.extend(deltaE_default);
color_default.extend({
deltaE: deltaE
});
Object.assign(color_default, {
deltaEMethods: deltaE_default
});
color_default.extend(variations_exports);
color_default.extend({
contrast: contrast
});
color_default.extend(chromaticity_exports);
color_default.extend(luminance_exports);
color_default.extend(interpolation_exports);
color_default.extend(contrast_exports);
var src_default = color_default;
var import_from2 = __toModule(require_from3());
import_dot['default'].templateSettings.strip = false;
axe._memoizedFns = [];
function memoizeImplementation(fn, options) {
var memoized = (0, import_memoizee['default'])(fn, options);
axe._memoizedFns.push(memoized);
return memoized;
}
var memoize_default = memoizeImplementation;
var isXHTML = memoize_default(function(doc) {
if (!(doc !== null && doc !== void 0 && doc.createElement)) {
return false;
}
return doc.createElement('A').localName === 'A';
});
var is_xhtml_default = isXHTML;
function countSort(a2, b3) {
return a2.count < b3.count ? -1 : a2.count === b3.count ? 0 : 1;
}
function getBaseSelector(elm) {
var xhtml = is_xhtml_default(document);
return escape_selector_default(xhtml ? elm.localName : elm.nodeName.toLowerCase());
}
function uncommonClasses(node, selectorData) {
var features = [];
var nodeIdx = selectorData._elmToIdx.get(node);
if (nodeIdx === void 0) {
return features;
}
var nodeRecord = selectorData._nodeRecords[nodeIdx];
var tagCount = selectorData.tags[nodeRecord.nodeName];
for (var i = 0; i < nodeRecord.classes.length; i++) {
var name = nodeRecord.classes[i];
var count = selectorData.classes[name];
if (count < tagCount) {
features.push({
name: name,
count: count,
kind: 'class'
});
}
}
return features.sort(countSort);
}
function uncommonAttributes(node, selectorData) {
var features = [];
var nodeIdx = selectorData._elmToIdx.get(node);
if (nodeIdx === void 0) {
return features;
}
var nodeRecord = selectorData._nodeRecords[nodeIdx];
var attrCounts = selectorData.attributes;
var tagCount = selectorData.tags[nodeRecord.nodeName];
for (var i = 0; i < nodeRecord.featureAttrs.length; i++) {
var name = nodeRecord.featureAttrs[i];
var count = attrCounts[name];
if (count < tagCount) {
features.push({
name: name,
count: count,
kind: 'attribute'
});
}
}
return features.sort(countSort);
}
function getElmId(elm) {
var id = idSelector(elm);
if (!id) {
return;
}
var selectorData = axe._selectorData;
var root = elm.getRootNode && elm.getRootNode() || document;
var rootId = selectorData._rootMap.get(root);
var nodeIdx = selectorData._elmToIdx.get(elm);
if (rootId === void 0 || nodeIdx === void 0) {
return root.querySelectorAll(id).length === 1 ? id : void 0;
}
return selectorData._idToIdx[rootId][id] === nodeIdx ? id : void 0;
}
function idSelector(elm) {
var rawId = elm.getAttribute && elm.getAttribute('id');
if (!rawId) {
return;
}
var id = '#' + escape_selector_default(rawId);
if (id.match(/player_uid_/)) {
return;
}
return id;
}
function getThreeLeastCommonFeatures(elm, selectorData) {
var features;
var hasTag = false;
var classFeatures = uncommonClasses(elm, selectorData);
var attrFeatures = uncommonAttributes(elm, selectorData);
if (classFeatures.length && classFeatures[0].count === 1) {
features = [ classFeatures[0] ];
} else if (attrFeatures.length && attrFeatures[0].count === 1) {
features = [ attrFeatures[0] ];
hasTag = true;
} else {
features = classFeatures.concat(attrFeatures).sort(countSort).slice(0, 3);
if (!features.some(function(feature) {
return feature.kind === 'class';
})) {
hasTag = true;
} else {
features.sort(function(a2, b3) {
return a2.kind !== b3.kind && a2.kind === 'class' ? -1 : a2.kind === b3.kind ? 0 : 1;
});
}
}
var tag = hasTag ? getBaseSelector(elm) : null;
var selectorString = tag || '';
var _iterator7 = _createForOfIteratorHelper(features), _step7;
try {
for (_iterator7.s(); !(_step7 = _iterator7.n()).done; ) {
var feature = _step7.value;
selectorString += feature.kind === 'class' ? '.' + feature.name : '[' + feature.name + ']';
}
} catch (err) {
_iterator7.e(err);
} finally {
_iterator7.f();
}
return {
selectorString: selectorString,
tag: tag,
features: features
};
}
function listToBits(nodeIdxs, wordCount) {
var bits = new Uint32Array(wordCount);
for (var i = 0; i < nodeIdxs.length; i++) {
var nodeIdx = nodeIdxs[i];
bits[nodeIdx >>> 5] |= 1 << (nodeIdx & 31);
}
return bits;
}
function matchesSuffixAttrs(nodeRecord, suffixAttrs) {
var urlAttrs = nodeRecord.urlAttrs;
if (!urlAttrs) {
return false;
}
for (var i = 0; i < suffixAttrs.length; i++) {
var rawUrl = urlAttrs[suffixAttrs[i].rawName];
if (typeof rawUrl !== 'string' || !rawUrl.endsWith(suffixAttrs[i].suffix)) {
return false;
}
}
return true;
}
function fragmentMatchesIdx(fragment, nodeIdx, nodeRecords) {
var nodeRecord = nodeRecords[nodeIdx];
if (fragment.id) {
return nodeRecord.id === fragment.id;
}
if (fragment.tag && nodeRecord.tag !== fragment.tag) {
return false;
}
if (fragment.classes) {
for (var i = 0; i < fragment.classes.length; i++) {
if (nodeRecord.classes.indexOf(fragment.classes[i]) === -1) {
return false;
}
}
}
if (fragment.exactAttrs) {
for (var _i7 = 0; _i7 < fragment.exactAttrs.length; _i7++) {
if (nodeRecord.exactAttrs.indexOf(fragment.exactAttrs[_i7]) === -1) {
return false;
}
}
}
if (fragment.suffixAttrs && !matchesSuffixAttrs(nodeRecord, fragment.suffixAttrs)) {
return false;
}
if (fragment.nthChild !== void 0 && nodeRecord.nthChild !== fragment.nthChild) {
return false;
}
return true;
}
function getCachedMatch(selectorData, rootId, fragment) {
var _selectorData$_matchC, _cache2$rootId, _rootCache$key;
(_selectorData$_matchC = selectorData._matchCache) !== null && _selectorData$_matchC !== void 0 ? _selectorData$_matchC : selectorData._matchCache = [];
var cache2 = selectorData._matchCache;
(_cache2$rootId = cache2[rootId]) !== null && _cache2$rootId !== void 0 ? _cache2$rootId : cache2[rootId] = Object.create(null);
var rootCache = cache2[rootId];
var key = fragment.selectorString;
(_rootCache$key = rootCache[key]) !== null && _rootCache$key !== void 0 ? _rootCache$key : rootCache[key] = {};
return rootCache[key];
}
function bitsForFragment(fragment, selectorData, rootId) {
var cachedMatch = getCachedMatch(selectorData, rootId, fragment);
if ('bits' in cachedMatch) {
return cachedMatch.bits;
}
var nodeRecords = selectorData._nodeRecords;
var wordCount = selectorData._wordCount;
if (fragment.id) {
var nodeIdx = selectorData._idToIdx[rootId][fragment.id];
if (nodeIdx === void 0) {
cachedMatch.bits = null;
return null;
}
var bits2 = new Uint32Array(wordCount);
bits2[nodeIdx >>> 5] |= 1 << (nodeIdx & 31);
cachedMatch.bits = bits2;
return bits2;
}
var bits = new Uint32Array(wordCount);
var isSeeded = false;
var applyBits = function applyBits(featureBits) {
if (!isSeeded) {
bits.set(featureBits);
isSeeded = true;
} else {
for (var w = 0; w < wordCount; w++) {
bits[w] &= featureBits[w];
}
}
};
if (fragment.tag) {
var tagBits = selectorData._tagBits[fragment.tag];
if (!tagBits) {
cachedMatch.bits = null;
return null;
}
applyBits(tagBits);
}
if (fragment.classes) {
for (var i = 0; i < fragment.classes.length; i++) {
var classBits = selectorData._classBits[fragment.classes[i]];
if (!classBits) {
cachedMatch.bits = null;
return null;
}
applyBits(classBits);
}
}
if (fragment.exactAttrs) {
for (var _i8 = 0; _i8 < fragment.exactAttrs.length; _i8++) {
var attrBits = selectorData._attrBits[fragment.exactAttrs[_i8]];
if (!attrBits) {
cachedMatch.bits = null;
return null;
}
applyBits(attrBits);
}
}
var rootBits = selectorData._rootBits[rootId];
if (rootBits) {
applyBits(rootBits);
}
if (!isSeeded) {
cachedMatch.bits = null;
return null;
}
var nthChild = fragment.nthChild, suffixAttrs = fragment.suffixAttrs;
if (nthChild !== void 0 || suffixAttrs) {
for (var w = 0; w < wordCount; w++) {
var word = bits[w];
var keep = 0;
while (word !== 0) {
var lsb = word & -word;
var bitIdx = 31 - Math.clz32(lsb);
var _nodeIdx = (w << 5) + bitIdx;
var nodeRecord = nodeRecords[_nodeIdx];
var matchesNth = nthChild === void 0 || nodeRecord.nthChild === nthChild;
var matchesSuffix = !suffixAttrs || matchesSuffixAttrs(nodeRecord, suffixAttrs);
if (matchesNth && matchesSuffix) {
keep |= lsb;
}
word ^= lsb;
}
bits[w] = keep;
}
}
cachedMatch.bits = bits;
return bits;
}
function enumerateBits(bits, wordCount) {
var nodeIdxs = [];
if (!bits) {
return nodeIdxs;
}
for (var w = 0; w < wordCount; w++) {
var word = bits[w];
while (word !== 0) {
var lsb = word & -word;
var bitIdx = 31 - Math.clz32(lsb);
nodeIdxs.push((w << 5) + bitIdx);
word ^= lsb;
}
}
return nodeIdxs;
}
function indicesForFragment(fragment, selectorData, rootId) {
var cachedMatch = getCachedMatch(selectorData, rootId, fragment);
if ('indices' in cachedMatch) {
return cachedMatch.indices;
}
var bits = bitsForFragment(fragment, selectorData, rootId);
cachedMatch.indices = enumerateBits(bits, selectorData._wordCount);
return cachedMatch.indices;
}
function matchingParents(candidateIdxs, parentFragment, selectorData, rootId) {
var parentBits = bitsForFragment(parentFragment, selectorData, rootId);
if (!parentBits) {
return [];
}
var parentOf = selectorData._parentOf;
var count = candidateIdxs.length;
var dest = selectorData._candidateBuf;
if (!dest || dest.length < count) {
dest = selectorData._candidateBuf = new Int32Array(count);
}
var write = 0;
for (var i = 0; i < count; i++) {
var parent = parentOf[candidateIdxs[i]];
if (parent < 0) {
continue;
}
if (parentBits[parent >>> 5] & 1 << (parent & 31)) {
dest[write++] = parent;
}
}
return dest.subarray(0, write);
}
function _getSelectorData(domTree) {
var state = createIndexState();
walkFlatTree(domTree, state);
seedPhantomsFromRoots(state);
repairMissingParents(state);
buildIndexes(state);
return state.selectorData;
}
function createIndexState() {
return {
selectorData: {
classes: {},
tags: {},
attributes: {},
_nodeRecords: [],
_elmToIdx: new WeakMap(),
_tagBits: {},
_classBits: {},
_attrBits: {},
_rootMap: new Map(),
_rootBits: [],
_idCounts: [],
_idToIdx: [],
_suffixInfo: new Map(),
_wordCount: 0
},
tagLists: new Map(),
classLists: new Map(),
attrLists: new Map(),
rootLists: [],
nthIndexCache: new Map()
};
}
function walkFlatTree(domTree, state) {
var roots = Array.isArray(domTree) ? domTree : [ domTree ];
var currentLevel = roots.slice();
var stack = [];
while (currentLevel.length) {
var current = currentLevel.pop();
var node = current.actualNode;
if (node.querySelectorAll) {
recordFlatTreeElement(node, state);
}
if (current.children.length) {
stack.push(currentLevel);
currentLevel = current.children.slice();
}
while (!currentLevel.length && stack.length) {
currentLevel = stack.pop();
}
}
}
function recordFlatTreeElement(node, state) {
var selectorData = state.selectorData;
var nodeIdx = selectorData._nodeRecords.length;
var parentIdx = parentIdxOf(node, state);
var rootId = ensureRoot(node, state);
selectorData._elmToIdx.set(node, nodeIdx);
selectorData._nodeRecords.push(indexElement(node, nodeIdx, {
parentIdx: parentIdx,
rootId: rootId,
countFeatures: true
}, state));
if (node.shadowRoot) {
rootIdFor(node.shadowRoot, state);
}
}
function parentIdxOf(node, state) {
var domParent = node.parentNode;
if (!domParent) {
return -1;
}
var parentIdx = state.selectorData._elmToIdx.get(domParent);
return parentIdx !== void 0 ? parentIdx : -1;
}
function ensureRoot(node, state) {
var root = typeof node.getRootNode === 'function' ? node.getRootNode() : document;
return rootIdFor(root, state);
}
function rootIdFor(root, state) {
var selectorData = state.selectorData, rootLists = state.rootLists;
var rootId = selectorData._rootMap.get(root);
if (rootId !== void 0) {
return rootId;
}
rootId = selectorData._rootMap.size;
selectorData._rootMap.set(root, rootId);
rootLists[rootId] = [];
selectorData._idCounts[rootId] = {};
selectorData._idToIdx[rootId] = {};
return rootId;
}
function indexElement(node, nodeIdx, _ref43, state) {
var parentIdx = _ref43.parentIdx, rootId = _ref43.rootId, countFeatures = _ref43.countFeatures;
var selectorData = state.selectorData, tagLists = state.tagLists, rootLists = state.rootLists, nthIndexCache = state.nthIndexCache;
var nodeName2 = node.nodeName;
if (countFeatures) {
selectorData.tags[nodeName2] = (selectorData.tags[nodeName2] || 0) + 1;
}
var tag = getBaseSelector(node);
pushToList(tagLists, tag, nodeIdx);
var classes = collectNodeClasses(node, nodeIdx, countFeatures, state);
var _collectNodeAttrs = collectNodeAttrs(node, nodeIdx, countFeatures, state), urlAttrs = _collectNodeAttrs.urlAttrs, featureAttrs = _collectNodeAttrs.featureAttrs, exactAttrs = _collectNodeAttrs.exactAttrs;
var id = null;
var rawId = node.getAttribute && node.getAttribute('id');
if (rawId) {
id = '#' + escape_selector_default(rawId);
var rootIds = selectorData._idCounts[rootId];
rootIds[id] = (rootIds[id] || 0) + 1;
selectorData._idToIdx[rootId][id] = nodeIdx;
}
rootLists[rootId].push(nodeIdx);
var nthChild = 0;
var domParent = node.parentNode;
if (domParent && domParent.children) {
nthChild = nthChildMap(domParent, nthIndexCache).get(node) || 0;
}
return {
elm: node,
nodeName: nodeName2,
tag: tag,
id: id,
classes: classes,
featureAttrs: featureAttrs,
exactAttrs: exactAttrs,
urlAttrs: urlAttrs,
nthChild: nthChild,
parentIdx: parentIdx,
rootId: rootId
};
}
function collectNodeClasses(node, nodeIdx, countFeatures, state) {
var classesForNode = [];
if (!node.classList) {
return classesForNode;
}
var selectorData = state.selectorData, classLists = state.classLists;
var _iterator8 = _createForOfIteratorHelper(node.classList), _step8;
try {
for (_iterator8.s(); !(_step8 = _iterator8.n()).done; ) {
var rawClass = _step8.value;
var className = escape_selector_default(rawClass);
if (countFeatures) {
selectorData.classes[className] = (selectorData.classes[className] || 0) + 1;
}
classesForNode.push(className);
pushToList(classLists, className, nodeIdx);
}
} catch (err) {
_iterator8.e(err);
} finally {
_iterator8.f();
}
return classesForNode;
}
function collectNodeAttrs(node, nodeIdx, countFeatures, state) {
var featureAttrs = [];
var exactAttrs = [];
var urlAttrs = null;
if (!node.hasAttributes()) {
return {
urlAttrs: urlAttrs,
featureAttrs: featureAttrs,
exactAttrs: exactAttrs
};
}
var selectorData = state.selectorData, attrLists = state.attrLists;
var rawAttrs = get_node_attributes_default(node);
for (var i = 0; i < rawAttrs.length; i++) {
var attr = rawAttrs[i];
var attrSelector = getAttributeNameValue(node, attr);
if (!attrSelector) {
continue;
}
var atnv = attrSelector.atnv, isSuffix = attrSelector.isSuffix, rawName = attrSelector.rawName, suffix = attrSelector.suffix;
if (isSuffix) {
if (!urlAttrs) {
urlAttrs = {};
}
urlAttrs[rawName] = attr.value;
if (!selectorData._suffixInfo.has(atnv)) {
selectorData._suffixInfo.set(atnv, {
rawName: rawName,
suffix: suffix
});
}
}
if (filterAttributes(attr)) {
if (countFeatures) {
selectorData.attributes[atnv] = (selectorData.attributes[atnv] || 0) + 1;
}
featureAttrs.push(atnv);
if (!isSuffix) {
exactAttrs.push(atnv);
pushToList(attrLists, atnv, nodeIdx);
}
}
}
return {
urlAttrs: urlAttrs,
featureAttrs: featureAttrs,
exactAttrs: exactAttrs
};
}
function pushToList(map, key, nodeIdx) {
var list = map.get(key);
if (!list) {
list = [];
map.set(key, list);
}
list.push(nodeIdx);
}
function nthChildMap(domParent, cache2) {
var nthMap = cache2.get(domParent);
if (!nthMap) {
nthMap = new Map();
var children = domParent.children;
for (var i = 0; i < children.length; i++) {
nthMap.set(children[i], i + 1);
}
cache2.set(domParent, nthMap);
}
return nthMap;
}
function parentIdxArray(nodeRecords) {
var parentOf = new Int32Array(nodeRecords.length);
for (var i = 0; i < nodeRecords.length; i++) {
parentOf[i] = nodeRecords[i].parentIdx;
}
return parentOf;
}
function pruneDuplicateIds(selectorData) {
for (var rootId = 0; rootId < selectorData._idToIdx.length; rootId++) {
var counts = selectorData._idCounts[rootId];
var idToIdx = selectorData._idToIdx[rootId];
for (var idSel in idToIdx) {
if (counts[idSel] !== 1) {
delete idToIdx[idSel];
}
}
}
}
function seedPhantomsFromRoots(state) {
var selectorData = state.selectorData;
var _iterator9 = _createForOfIteratorHelper(selectorData._rootMap), _step9;
try {
for (_iterator9.s(); !(_step9 = _iterator9.n()).done; ) {
var _step9$value = _slicedToArray(_step9.value, 2), rootNode = _step9$value[0], rootId = _step9$value[1];
if (!rootNode.querySelectorAll) {
continue;
}
var elms = rootNode.querySelectorAll('*');
for (var i = 0; i < elms.length; i++) {
var elm = elms[i];
if (selectorData._elmToIdx.has(elm)) {
continue;
}
var nodeIdx = selectorData._nodeRecords.length;
var parentIdx = phantomParentIdx(elm, rootNode, state);
selectorData._elmToIdx.set(elm, nodeIdx);
selectorData._nodeRecords.push(indexElement(elm, nodeIdx, {
parentIdx: parentIdx,
rootId: rootId,
countFeatures: false
}, state));
}
}
} catch (err) {
_iterator9.e(err);
} finally {
_iterator9.f();
}
}
function phantomParentIdx(elm, rootNode, state) {
var selectorData = state.selectorData;
var domParent = elm.parentNode;
if (!domParent) {
return -1;
}
var parentIdx = selectorData._elmToIdx.get(domParent);
if (parentIdx !== void 0) {
return parentIdx;
}
if (domParent === rootNode && rootNode.host) {
var hostIdx = selectorData._elmToIdx.get(rootNode.host);
if (hostIdx !== void 0) {
return hostIdx;
}
}
return -1;
}
function repairMissingParents(state) {
var selectorData = state.selectorData;
var nodeRecords = selectorData._nodeRecords;
for (var i = 0; i < nodeRecords.length; i++) {
var record = nodeRecords[i];
if (record.parentIdx !== -1) {
continue;
}
var domParent = record.elm.parentNode;
if (!domParent) {
continue;
}
var parentIdx = selectorData._elmToIdx.get(domParent);
if (parentIdx !== void 0) {
record.parentIdx = parentIdx;
}
}
}
function buildIndexes(state) {
var selectorData = state.selectorData, tagLists = state.tagLists, classLists = state.classLists, attrLists = state.attrLists, rootLists = state.rootLists;
var nodeCount = selectorData._nodeRecords.length;
var wordCount = Math.max(1, Math.ceil(nodeCount / 32));
selectorData._wordCount = wordCount;
selectorData._tagBits = bitmapsByKey(tagLists, wordCount);
selectorData._classBits = bitmapsByKey(classLists, wordCount);
selectorData._attrBits = bitmapsByKey(attrLists, wordCount);
selectorData._rootBits = [];
for (var rootId = 0; rootId < rootLists.length; rootId++) {
selectorData._rootBits[rootId] = listToBits(rootLists[rootId] || [], wordCount);
}
selectorData._parentOf = parentIdxArray(selectorData._nodeRecords);
pruneDuplicateIds(selectorData);
}
function bitmapsByKey(nodeIdxsByKey, wordCount) {
var bitmaps = {};
var _iterator0 = _createForOfIteratorHelper(nodeIdxsByKey), _step0;
try {
for (_iterator0.s(); !(_step0 = _iterator0.n()).done; ) {
var _step0$value = _slicedToArray(_step0.value, 2), _key7 = _step0$value[0], nodeIdxs = _step0$value[1];
bitmaps[_key7] = listToBits(nodeIdxs, wordCount);
}
} catch (err) {
_iterator0.e(err);
} finally {
_iterator0.f();
}
return bitmaps;
}
function generateSelector(elm) {
var _ref44 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, _ref44$toRoot = _ref44.toRoot, toRoot = _ref44$toRoot === void 0 ? false : _ref44$toRoot;
if (!axe._selectorData) {
throw new Error('Expect axe._selectorData to be set up');
}
var selectorData = axe._selectorData;
var elmToIdx = selectorData._elmToIdx;
var targetIdx = elmToIdx.get(elm);
if (targetIdx === void 0) {
return getElmId(elm) || getBaseSelector(elm);
}
var rootId = selectorData._nodeRecords[targetIdx].rootId;
var candidates = null;
var selector = '';
var curElm = elm;
do {
var fragment = computeFragment(curElm, selectorData);
selector = fragment.selectorString + (selector ? ' > ' + selector : '');
candidates = candidatesForChain(selector, fragment, candidates, selectorData, rootId);
curElm = curElm.parentElement;
} while ((candidates.length > 1 || toRoot) && curElm);
if (candidates.length !== 1) {
return getRootSelector(selector);
}
return selector;
}
function computeFragment(elm, selectorData) {
var cache2 = selectorData._computeFragmentCache;
if (!cache2) {
cache2 = selectorData._computeFragmentCache = [];
}
var nodeIdx = selectorData._elmToIdx.get(elm);
if (nodeIdx !== void 0) {
var cached = cache2[nodeIdx];
if (cached) {
return cached;
}
}
var fragment = buildFragment(elm, selectorData);
if (nodeIdx !== void 0) {
cache2[nodeIdx] = fragment;
}
return fragment;
}
function buildFragment(elm, selectorData) {
var id = getElmId(elm);
if (id) {
return {
id: id,
selectorString: id
};
}
var _getThreeLeastCommonF = getThreeLeastCommonFeatures(elm, selectorData), selectorString = _getThreeLeastCommonF.selectorString, tag = _getThreeLeastCommonF.tag, features = _getThreeLeastCommonF.features;
var _classifyFeatures = classifyFeatures(features, selectorData._suffixInfo), classes = _classifyFeatures.classes, exactAttrs = _classifyFeatures.exactAttrs, suffixAttrs = _classifyFeatures.suffixAttrs;
return withNthChildIfNeeded(elm, {
selectorString: selectorString,
tag: tag,
classes: classes,
exactAttrs: exactAttrs,
suffixAttrs: suffixAttrs
}, selectorData);
}
function classifyFeatures(features, suffixInfo) {
var classes = [];
var exactAttrs = null;
var suffixAttrs = null;
for (var i = 0; i < features.length; i++) {
var feature = features[i];
if (feature.kind === 'class') {
classes.push(feature.name);
continue;
}
var suffixAttr = suffixInfo.get(feature.name);
if (suffixAttr) {
if (!suffixAttrs) {
suffixAttrs = [];
}
suffixAttrs.push(suffixAttr);
} else {
if (!exactAttrs) {
exactAttrs = [];
}
exactAttrs.push(feature.name);
}
}
return {
classes: classes,
exactAttrs: exactAttrs,
suffixAttrs: suffixAttrs
};
}
function withNthChildIfNeeded(elm, fragment, selectorData) {
var elmIdx = selectorData._elmToIdx.get(elm);
var siblings = elm.parentNode && elm.parentNode.children || null;
if (!siblings || siblings.length < 2) {
return fragment;
}
var selectorString = fragment.selectorString;
for (var i = 0; i < siblings.length; i++) {
var sibling = siblings[i];
if (sibling === elm) {
continue;
}
var siblingIdx = selectorData._elmToIdx.get(sibling);
if (siblingIdx !== void 0 && fragmentMatchesIdx(fragment, siblingIdx, selectorData._nodeRecords)) {
var ownNth = selectorData._nodeRecords[elmIdx].nthChild;
return _extends({}, fragment, {
selectorString: selectorString + ':nth-child(' + ownNth + ')',
nthChild: ownNth
});
}
}
return fragment;
}
function candidatesForChain(selector, fragment, prevCandidates, selectorData, rootId) {
var rootChain = getRootChainCache(selectorData, rootId);
var cached = rootChain.get(selector);
if (cached !== void 0) {
return cached;
}
if (!prevCandidates) {
var nextCandidates2 = indicesForFragment(fragment, selectorData, rootId);
rootChain.set(selector, nextCandidates2);
return nextCandidates2;
}
var nextCandidates = matchingParents(prevCandidates, fragment, selectorData, rootId);
rootChain.set(selector, nextCandidates.slice());
return nextCandidates;
}
function getRootChainCache(selectorData, rootId) {
var chainCache = selectorData._chainCache;
if (!chainCache) {
chainCache = selectorData._chainCache = [];
}
var rootChain = chainCache[rootId];
if (!rootChain) {
rootChain = chainCache[rootId] = new Map();
}
return rootChain;
}
function getRootSelector(selector) {
var childPos = selector.indexOf(' > ');
if (childPos !== -1) {
return ':root' + selector.substring(childPos);
}
return ':root';
}
function _getSelector(elm, options) {
return _getShadowSelector(generateSelector, elm, options);
}
function generateAncestry(node) {
var nodeName2 = escape_selector_default(node.nodeName.toLowerCase());
var parentElement = node.parentElement;
var parentNode = node.parentNode;
var nthChild = '';
if (nodeName2 !== 'head' && nodeName2 !== 'body' && (parentNode === null || parentNode === void 0 ? void 0 : parentNode.children.length) > 1) {
var index = Array.prototype.indexOf.call(parentNode.children, node) + 1;
nthChild = ':nth-child('.concat(index, ')');
}
if (!parentElement) {
return nodeName2 + nthChild;
}
return generateAncestry(parentElement) + ' > ' + nodeName2 + nthChild;
}
function _getAncestry(elm, options) {
return _getShadowSelector(generateAncestry, elm, options);
}
function getXPathArray(node, path) {
var sibling, count;
if (!node) {
return [];
}
if (!path && node.nodeType === 9) {
path = [ {
str: 'html'
} ];
return path;
}
path = path || [];
if (node.parentNode && node.parentNode !== node) {
path = getXPathArray(node.parentNode, path);
}
if (node.previousSibling) {
count = 1;
sibling = node.previousSibling;
do {
if (sibling.nodeType === 1 && sibling.nodeName === node.nodeName) {
count++;
}
sibling = sibling.previousSibling;
} while (sibling);
if (count === 1) {
count = null;
}
} else if (node.nextSibling) {
sibling = node.nextSibling;
do {
if (sibling.nodeType === 1 && sibling.nodeName === node.nodeName) {
count = 1;
sibling = null;
} else {
count = null;
sibling = sibling.previousSibling;
}
} while (sibling);
}
if (node.nodeType === 1) {
var element = {};
element.str = node.nodeName.toLowerCase();
var _id = node.getAttribute && escape_selector_default(node.getAttribute('id'));
if (_id && node.ownerDocument.querySelectorAll('#' + _id).length === 1) {
element.id = node.getAttribute('id');
}
if (count > 1) {
element.count = count;
}
path.push(element);
}
return path;
}
function xpathToString(xpathArray) {
return xpathArray.reduce(function(str, elm) {
if (elm.id) {
return '//'.concat(elm.str, '[@id=\'').concat(elm.id, '\']');
} else {
return str + '/'.concat(elm.str) + (elm.count > 0 ? '['.concat(elm.count, ']') : '');
}
}, '');
}
function getXpath(node) {
var xpathArray = getXPathArray(node);
return xpathToString(xpathArray);
}
var get_xpath_default = getXpath;
var _cache = {};
var cache = {
set: function set(key, value) {
validateKey(key);
_cache[key] = value;
},
get: function get(key, creator) {
validateCreator(creator);
if (key in _cache) {
return _cache[key];
}
if (typeof creator === 'function') {
var value = creator();
assert_default(value !== void 0, 'Cache creator function should not return undefined');
this.set(key, value);
return _cache[key];
}
},
clear: function clear() {
_cache = {};
}
};
function validateKey(key) {
assert_default(typeof key === 'string', 'key must be a string, ' + _typeof(key) + ' given');
assert_default(key !== '', 'key must not be empty');
}
function validateCreator(creator) {
assert_default(typeof creator === 'function' || typeof creator === 'undefined', 'creator must be a function or undefined, ' + _typeof(creator) + ' given');
}
var cache_default = cache;
function getNodeFromTree(vNode, node) {
var el = node || vNode;
return cache_default.get('nodeMap') ? cache_default.get('nodeMap').get(el) : null;
}
var get_node_from_tree_default = getNodeFromTree;
function _getElementSource(node) {
var _ref45 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, _ref45$maxLength = _ref45.maxLength, maxLength = _ref45$maxLength === void 0 ? 300 : _ref45$maxLength, _ref45$attrLimit = _ref45.attrLimit, attrLimit = _ref45$attrLimit === void 0 ? 20 : _ref45$attrLimit;
if (!node) {
return '';
}
if (node.nodeType !== 1) {
var _node$nodeValue;
var value = (_node$nodeValue = node.nodeValue) !== null && _node$nodeValue !== void 0 ? _node$nodeValue : '';
return truncate(value, maxLength);
}
var deepStr = getOuterHtml(node);
if (deepStr.length > maxLength) {
return getTruncatedElementSource(node, {
maxLength: maxLength,
attrLimit: attrLimit
});
}
return deepStr;
}
function getOuterHtml(element) {
var source = element.outerHTML;
if (!source && typeof window.XMLSerializer === 'function') {
source = new window.XMLSerializer().serializeToString(element);
}
return source || '';
}
function getTruncatedElementSource(elm, _ref46) {
var maxLength = _ref46.maxLength, attrLimit = _ref46.attrLimit;
var nodeName2 = is_xhtml_default(elm.ownerDocument || document) ? elm.nodeName : elm.nodeName.toLowerCase();
var nodeAttrs = Array.from(get_node_attributes_default(elm)).map(function(_ref47) {
var name = _ref47.name, value = _ref47.value;
return {
name: name,
value: value
};
});
var attrsLength = nodeAttrs.reduce(function(acc, _ref48) {
var name = _ref48.name, value = _ref48.value;
return acc + name.length + value.length + 4;
}, 0);
if (2 + nodeName2.length + attrsLength > maxLength) {
nodeAttrs.forEach(function(attr) {
attr.name = truncate(attr.name, attrLimit);
attr.value = truncate(attr.value, attrLimit);
});
}
var source = '<'.concat(nodeName2);
var tagEnd = '>';
var truncateEnd = ' ...>';
var _iterator1 = _createForOfIteratorHelper(nodeAttrs), _step1;
try {
for (_iterator1.s(); !(_step1 = _iterator1.n()).done; ) {
var attr = _step1.value;
var attrStr = ' '.concat(attr.name, '="').concat(attr.value, '"');
if (source.length + attrStr.length > maxLength - truncateEnd.length) {
tagEnd = truncateEnd;
continue;
}
source += attrStr;
}
} catch (err) {
_iterator1.e(err);
} finally {
_iterator1.f();
}
return source + tagEnd;
}
function truncate(str, attrLimit) {
return str.length <= attrLimit ? str : str.substring(0, attrLimit) + '...';
}
var CACHE_KEY = 'DqElm.RunOptions';
var DqElement = function DqElement2(elm, options, spec) {
var _this$spec$selector, _this$_virtualNode;
var dqElementCache = cache_default.get('DqElementCache', function() {
return new WeakMap();
});
var isCacheable = !options && !spec && elm !== null && _typeof(elm) === 'object';
if (isCacheable) {
var cachedDqElement = dqElementCache.get(elm);
if (cachedDqElement) {
return cachedDqElement;
}
}
options !== null && options !== void 0 ? options : options = null;
spec !== null && spec !== void 0 ? spec : spec = {};
if (!options) {
var _cache_default$get;
options = (_cache_default$get = cache_default.get(CACHE_KEY)) !== null && _cache_default$get !== void 0 ? _cache_default$get : {};
}
this.spec = spec;
if (elm instanceof abstract_virtual_node_default) {
this._virtualNode = elm;
this._element = elm.actualNode;
} else {
this._element = elm;
this._virtualNode = get_node_from_tree_default(elm);
}
this.fromFrame = ((_this$spec$selector = this.spec.selector) === null || _this$spec$selector === void 0 ? void 0 : _this$spec$selector.length) > 1;
this._includeElementInJson = options.elementRef;
if (options.absolutePaths) {
this._options = {
toRoot: true
};
}
this.nodeIndexes = [];
if (Array.isArray(this.spec.nodeIndexes)) {
this.nodeIndexes = this.spec.nodeIndexes;
} else if (typeof ((_this$_virtualNode = this._virtualNode) === null || _this$_virtualNode === void 0 ? void 0 : _this$_virtualNode.nodeIndex) === 'number') {
this.nodeIndexes = [ this._virtualNode.nodeIndex ];
}
this.source = null;
if (!axe._audit.noHtml) {
var _this$spec$source;
this.source = (_this$spec$source = this.spec.source) !== null && _this$spec$source !== void 0 ? _this$spec$source : _getElementSource(this._element);
}
if (isCacheable) {
dqElementCache.set(elm, this);
}
return this;
};
DqElement.prototype = {
get selector() {
return this.spec.selector || [ _getSelector(this.element, this._options) ];
},
get ancestry() {
return this.spec.ancestry || [ _getAncestry(this.element) ];
},
get xpath() {
return this.spec.xpath || [ get_xpath_default(this.element) ];
},
get element() {
return this._element;
},
toJSON: function toJSON() {
var spec = {
selector: this.selector,
source: this.source,
xpath: this.xpath,
ancestry: this.ancestry,
nodeIndexes: this.nodeIndexes,
fromFrame: this.fromFrame
};
if (this._includeElementInJson) {
spec.element = this._element;
}
return spec;
}
};
DqElement.fromFrame = function fromFrame(node, options, frame) {
var spec = DqElement.mergeSpecs(node, frame);
return new DqElement(frame.element, options, spec);
};
DqElement.mergeSpecs = function mergeSpecs(child, parentFrame) {
return _extends({}, child, {
selector: [].concat(_toConsumableArray(parentFrame.selector), _toConsumableArray(child.selector)),
ancestry: [].concat(_toConsumableArray(parentFrame.ancestry), _toConsumableArray(child.ancestry)),
xpath: [].concat(_toConsumableArray(parentFrame.xpath), _toConsumableArray(child.xpath)),
nodeIndexes: [].concat(_toConsumableArray(parentFrame.nodeIndexes), _toConsumableArray(child.nodeIndexes)),
fromFrame: true
});
};
DqElement.setRunOptions = function setRunOptions(_ref49) {
var elementRef = _ref49.elementRef, absolutePaths = _ref49.absolutePaths;
cache_default.set(CACHE_KEY, {
elementRef: elementRef,
absolutePaths: absolutePaths
});
};
var dq_element_default = DqElement;
function checkHelper(checkResult, options, resolve, reject) {
return {
isAsync: false,
async: function async() {
this.isAsync = true;
return function(result) {
if (result instanceof Error === false) {
checkResult.result = result;
resolve(checkResult);
} else {
reject(result);
}
};
},
data: function data(_data) {
checkResult.data = _data;
},
relatedNodes: function relatedNodes(nodes) {
if (!window.Node) {
return;
}
if (nodes instanceof window.Node || nodes instanceof abstract_virtual_node_default) {
nodes = [ nodes ];
}
checkResult.relatedNodes = [];
for (var i = 0; i < nodes.length; i++) {
var node = nodes[i];
if (node instanceof abstract_virtual_node_default) {
node = node.actualNode;
}
if (node instanceof window.Node) {
checkResult.relatedNodes.push(new dq_element_default(node));
}
}
}
};
}
var check_helper_default = checkHelper;
function clone2(obj) {
return cloneRecused(obj, new Map());
}
function cloneRecused(obj, seen) {
var _window, _window2;
if (obj === null || _typeof(obj) !== 'object') {
return obj;
}
if ((_window = window) !== null && _window !== void 0 && _window.Node && obj instanceof window.Node || (_window2 = window) !== null && _window2 !== void 0 && _window2.HTMLCollection && obj instanceof window.HTMLCollection || 'nodeName' in obj && 'nodeType' in obj && 'ownerDocument' in obj) {
return obj;
}
if (seen.has(obj)) {
return seen.get(obj);
}
if (Array.isArray(obj)) {
var out2 = [];
seen.set(obj, out2);
obj.forEach(function(value) {
out2.push(cloneRecused(value, seen));
});
return out2;
}
var out = {};
seen.set(obj, out);
for (var _key8 in obj) {
out[_key8] = cloneRecused(obj[_key8], seen);
}
return out;
}
var parser = new import_css_selector_parser.CssSelectorParser();
parser.registerSelectorPseudos('not');
parser.registerSelectorPseudos('is');
parser.registerNestingOperators('>');
parser.registerAttrEqualityMods('^', '$', '*', '~');
var css_parser_default = parser;
function _matches(vNode, selector) {
var expressions = _convertSelector(selector);
return expressions.some(function(expression) {
return _matchesExpression(vNode, expression);
});
}
function matchesTag(vNode, exp2) {
return vNode.props.nodeType === 1 && (exp2.tag === '*' || vNode.props.nodeName === exp2.tag);
}
function matchesClasses(vNode, exp2) {
return !exp2.classes || exp2.classes.every(function(cl) {
return vNode.hasClass(cl.value);
});
}
function matchesAttributes(vNode, exp2) {
return !exp2.attributes || exp2.attributes.every(function(att) {
var nodeAtt = vNode.attr(att.key);
return nodeAtt !== null && att.test(nodeAtt);
});
}
function matchesId(vNode, exp2) {
return !exp2.id || vNode.props.id === exp2.id;
}
function matchesPseudos(target, exp2) {
if (!exp2.pseudos || exp2.pseudos.every(function(pseudo) {
if (pseudo.name === 'not') {
return !pseudo.expressions.some(function(expression) {
return _matchesExpression(target, expression);
});
} else if (pseudo.name === 'is') {
return pseudo.expressions.some(function(expression) {
return _matchesExpression(target, expression);
});
}
throw new Error('the pseudo selector ' + pseudo.name + ' has not yet been implemented');
})) {
return true;
}
return false;
}
function matchExpression(vNode, expression) {
return matchesTag(vNode, expression) && matchesClasses(vNode, expression) && matchesAttributes(vNode, expression) && matchesId(vNode, expression) && matchesPseudos(vNode, expression);
}
var escapeRegExp = function() {
var from = /(?=[\-\[\]{}()*+?.\\\^$|,#\s])/g;
var to2 = '\\';
return function(string) {
return string.replace(from, to2);
};
}();
var reUnescape = /\\/g;
function convertAttributes(atts) {
if (!atts) {
return;
}
return atts.map(function(att) {
var attributeKey = att.name.replace(reUnescape, '');
var attributeValue = (att.value || '').replace(reUnescape, '');
var test, regexp;
switch (att.operator) {
case '^=':
regexp = new RegExp('^' + escapeRegExp(attributeValue));
break;
case '$=':
regexp = new RegExp(escapeRegExp(attributeValue) + '$');
break;
case '~=':
regexp = new RegExp('(^|\\s)' + escapeRegExp(attributeValue) + '(\\s|$)');
break;
case '|=':
regexp = new RegExp('^' + escapeRegExp(attributeValue) + '(-|$)');
break;
case '=':
test = function test(value) {
return attributeValue === value;
};
break;
case '*=':
test = function test(value) {
return value && value.includes(attributeValue);
};
break;
case '!=':
test = function test(value) {
return attributeValue !== value;
};
break;
default:
test = function test(value) {
return value !== null;
};
}
if (attributeValue === '' && /^[*$^]=$/.test(att.operator)) {
test = function test() {
return false;
};
}
if (!test) {
test = function test(value) {
return value && regexp.test(value);
};
}
return {
key: attributeKey,
value: attributeValue,
type: typeof att.value === 'undefined' ? 'attrExist' : 'attrValue',
test: test
};
});
}
function convertClasses(classes) {
if (!classes) {
return;
}
return classes.map(function(className) {
className = className.replace(reUnescape, '');
return {
value: className,
regexp: new RegExp('(^|\\s)' + escapeRegExp(className) + '(\\s|$)')
};
});
}
function convertPseudos(pseudos) {
if (!pseudos) {
return;
}
return pseudos.map(function(p3) {
var expressions;
if ([ 'is', 'not' ].includes(p3.name)) {
expressions = p3.value;
expressions = expressions.selectors ? expressions.selectors : [ expressions ];
expressions = convertExpressions(expressions);
}
return {
name: p3.name,
expressions: expressions,
value: p3.value
};
});
}
function convertExpressions(expressions) {
return expressions.map(function(exp2) {
var newExp = [];
var rule = exp2.rule;
while (rule) {
newExp.push({
tag: rule.tagName ? rule.tagName.toLowerCase() : '*',
combinator: rule.nestingOperator ? rule.nestingOperator : ' ',
id: rule.id,
attributes: convertAttributes(rule.attrs),
classes: convertClasses(rule.classNames),
pseudos: convertPseudos(rule.pseudos)
});
rule = rule.rule;
}
return newExp;
});
}
function _convertSelector(selector) {
var expressions = css_parser_default.parse(selector);
expressions = expressions.selectors ? expressions.selectors : [ expressions ];
return convertExpressions(expressions);
}
function optimizedMatchesExpression(vNode, expressions, index, matchAnyParent) {
if (!vNode) {
return false;
}
var isArray = Array.isArray(expressions);
var expression = isArray ? expressions[index] : expressions;
var machedExpression = matchExpression(vNode, expression);
while (!machedExpression && matchAnyParent && vNode.parent) {
vNode = vNode.parent;
machedExpression = matchExpression(vNode, expression);
}
if (index > 0) {
if ([ ' ', '>' ].includes(expression.combinator) === false) {
throw new Error('axe.utils.matchesExpression does not support the combinator: ' + expression.combinator);
}
machedExpression = machedExpression && optimizedMatchesExpression(vNode.parent, expressions, index - 1, expression.combinator === ' ');
}
return machedExpression;
}
function _matchesExpression(vNode, expressions, matchAnyParent) {
return optimizedMatchesExpression(vNode, expressions, expressions.length - 1, matchAnyParent);
}
function closest(vNode, selector) {
while (vNode) {
if (_matches(vNode, selector)) {
return vNode;
}
if (typeof vNode.parent === 'undefined') {
throw new TypeError('Cannot resolve parent for non-DOM nodes');
}
vNode = vNode.parent;
}
return null;
}
var closest_default = closest;
function noop() {}
function funcGuard(f) {
if (typeof f !== 'function') {
throw new TypeError('Queue methods require functions as arguments');
}
}
function queue() {
var tasks = [];
var started = 0;
var remaining = 0;
var completeQueue = noop;
var complete = false;
var err2;
var defaultFail = function defaultFail(e) {
err2 = e;
setTimeout(function() {
if (err2 !== void 0 && err2 !== null) {
log('Uncaught error (of queue)', err2);
}
}, 1);
};
var failed = defaultFail;
function createResolve(i) {
return function(r) {
tasks[i] = r;
remaining -= 1;
if (!remaining && completeQueue !== noop) {
complete = true;
completeQueue(tasks);
}
};
}
function abort(msg) {
completeQueue = noop;
failed(msg);
return tasks;
}
function pop() {
var length = tasks.length;
for (;started < length; started++) {
var task = tasks[started];
try {
task.call(null, createResolve(started), abort);
} catch (e) {
abort(e);
}
}
}
var q2 = {
defer: function defer(fn) {
if (_typeof(fn) === 'object' && fn.then && fn['catch']) {
var defer = fn;
fn = function fn(resolve, reject) {
defer.then(resolve)['catch'](reject);
};
}
funcGuard(fn);
if (err2 !== void 0) {
return;
} else if (complete) {
throw new Error('Queue already completed');
}
tasks.push(fn);
++remaining;
pop();
return q2;
},
then: function then(fn) {
funcGuard(fn);
if (completeQueue !== noop) {
throw new Error('queue `then` already set');
}
if (!err2) {
completeQueue = fn;
if (!remaining) {
complete = true;
completeQueue(tasks);
}
}
return q2;
},
catch: function _catch(fn) {
funcGuard(fn);
if (failed !== defaultFail) {
throw new Error('queue `catch` already set');
}
if (!err2) {
failed = fn;
} else {
fn(err2);
err2 = null;
}
return q2;
},
abort: abort
};
return q2;
}
var queue_default = queue;
var uuid;
var _rng;
var _crypto = window.crypto || window.msCrypto;
if (!_rng && _crypto && _crypto.getRandomValues) {
var _rnds8 = new Uint8Array(16);
_rng = function whatwgRNG() {
_crypto.getRandomValues(_rnds8);
return _rnds8;
};
}
if (!_rng) {
var _rnds = new Array(16);
_rng = function _rng() {
for (var i = 0, r; i < 16; i++) {
if ((i & 3) === 0) {
r = Math.random() * 4294967296;
}
_rnds[i] = r >>> ((i & 3) << 3) & 255;
}
return _rnds;
};
}
var BufferClass = typeof window.Buffer == 'function' ? window.Buffer : Array;
var _byteToHex = [];
var _hexToByte = {};
for (var i = 0; i < 256; i++) {
_byteToHex[i] = (i + 256).toString(16).substr(1);
_hexToByte[_byteToHex[i]] = i;
}
function parse2(s, buf, offset) {
var i = buf && offset || 0, ii = 0;
buf = buf || [];
s.toLowerCase().replace(/[0-9a-f]{2}/g, function(oct) {
if (ii < 16) {
buf[i + ii++] = _hexToByte[oct];
}
});
while (ii < 16) {
buf[i + ii++] = 0;
}
return buf;
}
function unparse(buf, offset) {
var i = offset || 0, bth = _byteToHex;
return bth[buf[i++]] + bth[buf[i++]] + bth[buf[i++]] + bth[buf[i++]] + '-' + bth[buf[i++]] + bth[buf[i++]] + '-' + bth[buf[i++]] + bth[buf[i++]] + '-' + bth[buf[i++]] + bth[buf[i++]] + '-' + bth[buf[i++]] + bth[buf[i++]] + bth[buf[i++]] + bth[buf[i++]] + bth[buf[i++]] + bth[buf[i++]];
}
var _seedBytes = _rng();
var _nodeId = [ _seedBytes[0] | 1, _seedBytes[1], _seedBytes[2], _seedBytes[3], _seedBytes[4], _seedBytes[5] ];
var _clockseq = (_seedBytes[6] << 8 | _seedBytes[7]) & 16383;
var _lastMSecs = 0;
var _lastNSecs = 0;
function v1(options, buf, offset) {
var i = buf && offset || 0;
var b3 = buf || [];
options = options || {};
var clockseq = options.clockseq != null ? options.clockseq : _clockseq;
var msecs = options.msecs != null ? options.msecs : new Date().getTime();
var nsecs = options.nsecs != null ? options.nsecs : _lastNSecs + 1;
var dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 1e4;
if (dt < 0 && options.clockseq == null) {
clockseq = clockseq + 1 & 16383;
}
if ((dt < 0 || msecs > _lastMSecs) && options.nsecs == null) {
nsecs = 0;
}
if (nsecs >= 1e4) {
throw new Error('uuid.v1(): Can\'t create more than 10M uuids/sec');
}
_lastMSecs = msecs;
_lastNSecs = nsecs;
_clockseq = clockseq;
msecs += 122192928e5;
var tl = ((msecs & 268435455) * 1e4 + nsecs) % 4294967296;
b3[i++] = tl >>> 24 & 255;
b3[i++] = tl >>> 16 & 255;
b3[i++] = tl >>> 8 & 255;
b3[i++] = tl & 255;
var tmh = msecs / 4294967296 * 1e4 & 268435455;
b3[i++] = tmh >>> 8 & 255;
b3[i++] = tmh & 255;
b3[i++] = tmh >>> 24 & 15 | 16;
b3[i++] = tmh >>> 16 & 255;
b3[i++] = clockseq >>> 8 | 128;
b3[i++] = clockseq & 255;
var node = options.node || _nodeId;
for (var n3 = 0; n3 < 6; n3++) {
b3[i + n3] = node[n3];
}
return buf ? buf : unparse(b3);
}
function v4(options, buf, offset) {
var i = buf && offset || 0;
if (typeof options == 'string') {
buf = options == 'binary' ? new BufferClass(16) : null;
options = null;
}
options = options || {};
var rnds = options.random || (options.rng || _rng)();
rnds[6] = rnds[6] & 15 | 64;
rnds[8] = rnds[8] & 63 | 128;
if (buf) {
for (var ii = 0; ii < 16; ii++) {
buf[i + ii] = rnds[ii];
}
}
return buf || unparse(rnds);
}
uuid = v4;
uuid.v1 = v1;
uuid.v4 = v4;
uuid.parse = parse2;
uuid.unparse = unparse;
uuid.BufferClass = BufferClass;
axe._uuid = v1();
var uuid_default = v4;
var errorTypes = Object.freeze([ 'EvalError', 'RangeError', 'ReferenceError', 'SyntaxError', 'TypeError', 'URIError' ]);
function stringifyMessage(_ref50) {
var topic = _ref50.topic, channelId = _ref50.channelId, message = _ref50.message, messageId = _ref50.messageId, keepalive = _ref50.keepalive;
var data = {
channelId: channelId,
topic: topic,
messageId: messageId,
keepalive: !!keepalive,
source: getSource()
};
if (message instanceof Error) {
data.error = {
name: message.name,
message: message.message,
stack: message.stack
};
} else {
data.payload = message;
}
return JSON.stringify(data);
}
function parseMessage(dataString) {
var data;
try {
data = JSON.parse(dataString);
} catch (_unused) {
return;
}
if (!isRespondableMessage(data)) {
return;
}
var _data2 = data, topic = _data2.topic, channelId = _data2.channelId, messageId = _data2.messageId, keepalive = _data2.keepalive;
var message = _typeof(data.error) === 'object' ? buildErrorObject(data.error) : data.payload;
return {
topic: topic,
message: message,
messageId: messageId,
channelId: channelId,
keepalive: !!keepalive
};
}
function isRespondableMessage(postedMessage) {
return postedMessage !== null && _typeof(postedMessage) === 'object' && typeof postedMessage.channelId === 'string' && postedMessage.source === getSource();
}
function buildErrorObject(error) {
var msg = error.message || 'Unknown error occurred';
var errorName = errorTypes.includes(error.name) ? error.name : 'Error';
var ErrConstructor = window[errorName] || Error;
if (error.stack) {
msg += '\n' + error.stack.replace(error.message, '');
}
return new ErrConstructor(msg);
}
function getSource() {
var application = 'axeAPI';
var version = '';
if (typeof axe !== 'undefined' && axe._audit && axe._audit.application) {
application = axe._audit.application;
}
if (typeof axe !== 'undefined') {
version = axe.version;
}
return application + '.' + version;
}
function assertIsParentWindow(win) {
assetNotGlobalWindow(win);
assert_default(window.parent === win, 'Source of the response must be the parent window.');
}
function assertIsFrameWindow(win) {
assetNotGlobalWindow(win);
assert_default(win.parent === window, 'Respondable target must be a frame in the current window');
}
function assetNotGlobalWindow(win) {
assert_default(window !== win, 'Messages can not be sent to the same window.');
}
var channels = {};
function storeReplyHandler(channelId, replyHandler) {
var sendToParent = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
assert_default(!Object.prototype.hasOwnProperty.call(channels, channelId), 'A replyHandler already exists for this message channel.');
channels[channelId] = {
replyHandler: replyHandler,
sendToParent: sendToParent
};
}
function getReplyHandler(channelId) {
return Object.prototype.hasOwnProperty.call(channels, channelId) ? channels[channelId] : void 0;
}
function deleteReplyHandler(channelId) {
delete channels[channelId];
}
var messageIds = [];
function createMessageId() {
var uuid2 = ''.concat(v4(), ':').concat(v4());
if (messageIds.includes(uuid2)) {
return createMessageId();
}
messageIds.push(uuid2);
return uuid2;
}
function isNewMessage(uuid2) {
if (messageIds.includes(uuid2)) {
return false;
}
messageIds.push(uuid2);
return true;
}
function postMessage(win, data, sendToParent, replyHandler) {
sendToParent ? assertIsParentWindow(win) : assertIsFrameWindow(win);
if (data.message instanceof Error && !sendToParent) {
axe.log(data.message);
return false;
}
var dataString = stringifyMessage(_extends({
messageId: createMessageId()
}, data));
var allowedOrigins = axe._audit.allowedOrigins;
if (!allowedOrigins || !allowedOrigins.length) {
return false;
}
if (typeof replyHandler === 'function') {
storeReplyHandler(data.channelId, replyHandler, sendToParent);
}
allowedOrigins.forEach(function(origin) {
try {
win.postMessage(dataString, origin);
} catch (err2) {
if (err2 instanceof win.DOMException) {
throw new Error('allowedOrigins value "'.concat(origin, '" is not a valid origin'));
}
throw err2;
}
});
return true;
}
function processError(win, error, channelId) {
if (!win.parent !== window) {
return axe.log(error);
}
try {
postMessage(win, {
topic: null,
channelId: channelId,
message: error,
messageId: createMessageId(),
keepalive: true
}, true);
} catch (err2) {
return axe.log(err2);
}
}
function createResponder(win, channelId) {
var sendToParent = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
return function respond(message, keepalive, replyHandler) {
var data = {
channelId: channelId,
message: message,
keepalive: keepalive
};
postMessage(win, data, sendToParent, replyHandler);
};
}
function originIsAllowed(origin) {
var allowedOrigins = axe._audit.allowedOrigins;
return allowedOrigins && allowedOrigins.includes('*') || allowedOrigins.includes(origin);
}
function messageHandler(_ref51, topicHandler) {
var origin = _ref51.origin, dataString = _ref51.data, win = _ref51.source;
try {
var data = parseMessage(dataString) || {};
var channelId = data.channelId, message = data.message, messageId = data.messageId;
if (!originIsAllowed(origin) || !isNewMessage(messageId)) {
return;
}
if (message instanceof Error && win.parent !== window) {
axe.log(message);
return false;
}
try {
if (data.topic) {
var responder = createResponder(win, channelId);
assertIsParentWindow(win);
topicHandler(data, responder);
} else {
callReplyHandler(win, data);
}
} catch (error) {
processError(win, error, channelId);
}
} catch (error) {
axe.log(error);
return false;
}
}
function callReplyHandler(win, data) {
var channelId = data.channelId, message = data.message, keepalive = data.keepalive;
var _ref52 = getReplyHandler(channelId) || {}, replyHandler = _ref52.replyHandler, sendToParent = _ref52.sendToParent;
if (!replyHandler) {
return;
}
sendToParent ? assertIsParentWindow(win) : assertIsFrameWindow(win);
var responder = createResponder(win, channelId, sendToParent);
if (!keepalive && channelId) {
deleteReplyHandler(channelId);
}
try {
replyHandler(message, keepalive, responder);
} catch (error) {
axe.log(error);
responder(error, keepalive);
}
}
var frameMessenger = {
open: function open(topicHandler) {
if (typeof window.addEventListener !== 'function') {
return;
}
var handler = function handler(messageEvent) {
messageHandler(messageEvent, topicHandler);
};
window.addEventListener('message', handler, false);
return function() {
window.removeEventListener('message', handler, false);
};
},
post: function post(win, data, replyHandler) {
if (typeof window.addEventListener !== 'function') {
return false;
}
return postMessage(win, data, false, replyHandler);
}
};
function setDefaultFrameMessenger(respondable2) {
respondable2.updateMessenger(frameMessenger);
}
var closeHandler;
var postMessage2;
var topicHandlers = {};
function _respondable(win, topic, message, keepalive, replyHandler) {
var data = {
topic: topic,
message: message,
channelId: ''.concat(v4(), ':').concat(v4()),
keepalive: keepalive
};
return postMessage2(win, data, replyHandler);
}
function messageListener(data, responder) {
var topic = data.topic, message = data.message, keepalive = data.keepalive;
var topicHandler = Object.prototype.hasOwnProperty.call(topicHandlers, topic) ? topicHandlers[topic] : void 0;
if (!topicHandler) {
return;
}
try {
topicHandler(message, keepalive, responder);
} catch (error) {
axe.log(error);
responder(error, keepalive);
}
}
_respondable.updateMessenger = function updateMessenger(_ref53) {
var open = _ref53.open, post = _ref53.post;
assert_default(typeof open === 'function', 'open callback must be a function');
assert_default(typeof post === 'function', 'post callback must be a function');
if (closeHandler) {
closeHandler();
}
var close = open(messageListener);
if (close) {
assert_default(typeof close === 'function', 'open callback must return a cleanup function');
closeHandler = close;
} else {
closeHandler = null;
}
postMessage2 = post;
};
_respondable.subscribe = function subscribe(topic, topicHandler) {
assert_default(typeof topicHandler === 'function', 'Subscriber callback must be a function');
assert_default(!Object.prototype.hasOwnProperty.call(topicHandlers, topic), 'Topic '.concat(topic, ' is already registered to.'));
topicHandlers[topic] = topicHandler;
};
_respondable.isInFrame = function isInFrame() {
var win = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : window;
return !!win.frameElement;
};
setDefaultFrameMessenger(_respondable);
function _sendCommandToFrame(node, parameters, resolve, reject) {
var _parameters$options$p, _parameters$options;
var win = node.contentWindow;
var pingWaitTime = (_parameters$options$p = (_parameters$options = parameters.options) === null || _parameters$options === void 0 ? void 0 : _parameters$options.pingWaitTime) !== null && _parameters$options$p !== void 0 ? _parameters$options$p : 500;
if (!win) {
log('Frame does not have a content window', node);
resolve(null);
return;
}
if (pingWaitTime === 0) {
callAxeStart(node, parameters, resolve, reject);
return;
}
var timeout = setTimeout(function() {
timeout = setTimeout(function() {
if (!parameters.debug) {
resolve(null);
} else {
reject(err('No response from frame', node));
}
}, 0);
}, pingWaitTime);
_respondable(win, 'axe.ping', null, void 0, function() {
clearTimeout(timeout);
callAxeStart(node, parameters, resolve, reject);
});
}
function callAxeStart(node, parameters, resolve, reject) {
var _parameters$options$f, _parameters$options2;
var frameWaitTime = (_parameters$options$f = (_parameters$options2 = parameters.options) === null || _parameters$options2 === void 0 ? void 0 : _parameters$options2.frameWaitTime) !== null && _parameters$options$f !== void 0 ? _parameters$options$f : 6e4;
var win = node.contentWindow;
var timeout = setTimeout(function collectResultFramesTimeout() {
reject(err('Axe in frame timed out', node));
}, frameWaitTime);
_respondable(win, 'axe.start', parameters, void 0, function(data) {
clearTimeout(timeout);
if (data instanceof Error === false) {
resolve(data);
} else {
reject(data);
}
});
}
function err(message, node) {
var selector;
if (axe._tree) {
selector = _getSelector(node);
}
return new Error(message + ': ' + (selector || node));
}
var customSerializer = null;
var nodeSerializer = {
update: function update(serializer) {
assert_default(_typeof(serializer) === 'object', 'serializer must be an object');
customSerializer = serializer;
},
toSpec: function toSpec(node) {
return nodeSerializer.dqElmToSpec(new dq_element_default(node));
},
dqElmToSpec: function dqElmToSpec(dqElm, runOptions) {
var _customSerializer;
if (dqElm instanceof dq_element_default === false) {
return dqElm;
}
if (runOptions) {
dqElm = cloneLimitedDqElement(dqElm, runOptions);
}
if (typeof ((_customSerializer = customSerializer) === null || _customSerializer === void 0 ? void 0 : _customSerializer.toSpec) === 'function') {
return customSerializer.toSpec(dqElm);
}
return dqElm.toJSON();
},
mergeSpecs: function mergeSpecs(nodeSpec, parentFrameSpec) {
var _customSerializer2;
if (typeof ((_customSerializer2 = customSerializer) === null || _customSerializer2 === void 0 ? void 0 : _customSerializer2.mergeSpecs) === 'function') {
return customSerializer.mergeSpecs(nodeSpec, parentFrameSpec);
}
return dq_element_default.mergeSpecs(nodeSpec, parentFrameSpec);
},
mapRawResults: function mapRawResults(rawResults) {
return rawResults.map(function(rawResult) {
return _extends({}, rawResult, {
nodes: nodeSerializer.mapRawNodeResults(rawResult.nodes)
});
});
},
mapRawNodeResults: function mapRawNodeResults(nodeResults) {
return nodeResults === null || nodeResults === void 0 ? void 0 : nodeResults.map(function(_ref54) {
var node = _ref54.node, nodeResult = _objectWithoutProperties(_ref54, _excluded6);
nodeResult.node = nodeSerializer.dqElmToSpec(node);
for (var _i9 = 0, _arr2 = [ 'any', 'all', 'none' ]; _i9 < _arr2.length; _i9++) {
var type2 = _arr2[_i9];
nodeResult[type2] = nodeResult[type2].map(function(_ref55) {
var relatedNodes = _ref55.relatedNodes, checkResult = _objectWithoutProperties(_ref55, _excluded7);
checkResult.relatedNodes = relatedNodes.map(nodeSerializer.dqElmToSpec);
return checkResult;
});
}
return nodeResult;
});
}
};
var node_serializer_default = nodeSerializer;
function cloneLimitedDqElement(dqElm, runOptions) {
var fromFrame2 = dqElm.fromFrame;
var hasAncestry = runOptions.ancestry, hasXpath = runOptions.xpath;
var hasSelectors = runOptions.selectors !== false || fromFrame2;
dqElm = new dq_element_default(dqElm.element, runOptions, {
source: dqElm.source,
nodeIndexes: dqElm.nodeIndexes,
selector: hasSelectors ? dqElm.selector : [ ':root' ],
ancestry: hasAncestry ? dqElm.ancestry : [ ':root' ],
xpath: hasXpath ? dqElm.xpath : '/'
});
dqElm.fromFrame = fromFrame2;
return dqElm;
}
function getAllChecks(object) {
var result = [];
return result.concat(object.any || []).concat(object.all || []).concat(object.none || []);
}
var get_all_checks_default = getAllChecks;
function findBy(array, key, value) {
if (Array.isArray(array)) {
return array.find(function(obj) {
return obj !== null && _typeof(obj) === 'object' && Object.hasOwn(obj, key) && obj[key] === value;
});
}
}
var find_by_default = findBy;
function pushFrame(resultSet, options, frameSpec) {
resultSet.forEach(function(res) {
res.node = node_serializer_default.mergeSpecs(res.node, frameSpec);
var checks = get_all_checks_default(res);
checks.forEach(function(check) {
check.relatedNodes = check.relatedNodes.map(function(node) {
return node_serializer_default.mergeSpecs(node, frameSpec);
});
});
});
}
function spliceNodes(target, to2) {
var firstFromFrame = to2[0].node;
var node;
for (var _i0 = 0; _i0 < target.length; _i0++) {
node = target[_i0].node;
var resultSort = nodeIndexSort(node.nodeIndexes, firstFromFrame.nodeIndexes);
if (resultSort > 0 || resultSort === 0 && firstFromFrame.selector.length < node.selector.length) {
target.splice.apply(target, [ _i0, 0 ].concat(_toConsumableArray(to2)));
return;
}
}
target.push.apply(target, _toConsumableArray(to2));
}
function normalizeResult(result) {
if (!result || !result.results) {
return null;
}
if (!Array.isArray(result.results)) {
return [ result.results ];
}
if (!result.results.length) {
return null;
}
return result.results;
}
function mergeResults(frameResults, options) {
var mergedResult = [];
frameResults.forEach(function(frameResult) {
var results = normalizeResult(frameResult);
if (!results || !results.length) {
return;
}
var frameSpec = getFrameSpec(frameResult);
results.forEach(function(ruleResult) {
if (ruleResult.nodes && frameSpec) {
pushFrame(ruleResult.nodes, options, frameSpec);
}
var res = find_by_default(mergedResult, 'id', ruleResult.id);
if (!res) {
mergedResult.push(ruleResult);
} else {
if (ruleResult.nodes.length) {
spliceNodes(res.nodes, ruleResult.nodes);
}
if (ruleResult.error) {
var _res$error;
(_res$error = res.error) !== null && _res$error !== void 0 ? _res$error : res.error = ruleResult.error;
}
}
});
});
mergedResult.forEach(function(result) {
if (result.nodes) {
result.nodes.sort(function(nodeA, nodeB) {
return nodeIndexSort(nodeA.node.nodeIndexes, nodeB.node.nodeIndexes);
});
}
});
return mergedResult;
}
function nodeIndexSort() {
var nodeIndexesA = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
var nodeIndexesB = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
var length = Math.max(nodeIndexesA === null || nodeIndexesA === void 0 ? void 0 : nodeIndexesA.length, nodeIndexesB === null || nodeIndexesB === void 0 ? void 0 : nodeIndexesB.length);
for (var _i1 = 0; _i1 < length; _i1++) {
var indexA = nodeIndexesA === null || nodeIndexesA === void 0 ? void 0 : nodeIndexesA[_i1];
var indexB = nodeIndexesB === null || nodeIndexesB === void 0 ? void 0 : nodeIndexesB[_i1];
if (typeof indexA !== 'number' || isNaN(indexA)) {
return _i1 === 0 ? 1 : -1;
}
if (typeof indexB !== 'number' || isNaN(indexB)) {
return _i1 === 0 ? -1 : 1;
}
if (indexA !== indexB) {
return indexA - indexB;
}
}
return 0;
}
var merge_results_default = mergeResults;
function getFrameSpec(frameResult) {
if (frameResult.frameElement) {
return node_serializer_default.toSpec(frameResult.frameElement);
} else if (frameResult.frameSpec) {
return frameResult.frameSpec;
}
return null;
}
function _collectResultsFromFrames(parentContent, options, command, parameter, resolve, reject) {
options = _extends({}, options, {
elementRef: false
});
var q2 = queue_default();
var frames = parentContent.frames;
frames.forEach(function(_ref56) {
var frameElement = _ref56.node, context = _objectWithoutProperties(_ref56, _excluded8);
q2.defer(function(res, rej) {
var params = {
options: options,
command: command,
parameter: parameter,
context: context
};
function callback(results) {
if (!results) {
return res(null);
}
return res({
results: results,
frameElement: frameElement
});
}
_sendCommandToFrame(frameElement, params, callback, rej);
});
});
q2.then(function(data) {
resolve(merge_results_default(data, options));
})['catch'](reject);
}
function _contains(vNode, otherVNode) {
if (!vNode.shadowId && !otherVNode.shadowId && vNode.actualNode && typeof vNode.actualNode.contains === 'function') {
return vNode.actualNode.contains(otherVNode.actualNode);
}
do {
if (vNode === otherVNode) {
return true;
} else if (otherVNode.nodeIndex < vNode.nodeIndex) {
return false;
}
otherVNode = otherVNode.parent;
} while (otherVNode);
return false;
}
function deepMerge() {
var target = {};
for (var _len7 = arguments.length, sources2 = new Array(_len7), _key9 = 0; _key9 < _len7; _key9++) {
sources2[_key9] = arguments[_key9];
}
sources2.forEach(function(source) {
if (!source || _typeof(source) !== 'object' || Array.isArray(source)) {
return;
}
for (var _i10 = 0, _Object$keys2 = Object.keys(source); _i10 < _Object$keys2.length; _i10++) {
var _key0 = _Object$keys2[_i10];
if (!target.hasOwnProperty(_key0) || _typeof(source[_key0]) !== 'object' || Array.isArray(target[_key0])) {
target[_key0] = source[_key0];
} else {
target[_key0] = deepMerge(target[_key0], source[_key0]);
}
}
});
return target;
}
var deep_merge_default = deepMerge;
var matchesSelector = function() {
var method;
function getMethod(node) {
var candidates = [ 'matches', 'matchesSelector', 'mozMatchesSelector', 'webkitMatchesSelector', 'msMatchesSelector' ];
var length = candidates.length;
var index, candidate;
for (index = 0; index < length; index++) {
candidate = candidates[index];
if (node[candidate]) {
return candidate;
}
}
}
return function(node, selector) {
if (!method || !node[method]) {
method = getMethod(node);
}
if (node[method]) {
return node[method](selector);
}
return false;
};
}();
var element_matches_default = matchesSelector;
function extendMetaData(to2, from) {
Object.assign(to2, from);
Object.keys(from).filter(function(prop) {
return typeof from[prop] === 'function';
}).forEach(function(prop) {
to2[prop] = null;
try {
to2[prop] = from[prop](to2);
} catch (_unused2) {}
});
}
var extend_meta_data_default = extendMetaData;
var reservedNames = [ 'annotation-xml', 'color-profile', 'font-face', 'font-face-src', 'font-face-uri', 'font-face-format', 'font-face-name', 'missing-glyph' ];
var validLocalNameRegex = /^(?:[A-Za-z](?:[\x01-\x08\x0B\x0E-\x1F!-\.0-=\?-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*|(?:[:_\x80-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF])(?:[\x2D\.0-:A-Z_a-z\x80-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF])*)$/;
var alphaLowerRegex = /[a-z]/;
var alphaUpperRegex = /[A-Z]/;
function _isValidCustomElementName(nodeName2) {
return !reservedNames.includes(nodeName2) && validLocalNameRegex.test(nodeName2) && alphaLowerRegex.test(nodeName2[0]) && !alphaUpperRegex.test(nodeName2) && nodeName2.includes('-');
}
var possibleShadowRoots = [ 'article', 'aside', 'blockquote', 'body', 'div', 'footer', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'header', 'main', 'nav', 'p', 'section', 'span' ];
function isShadowRoot(node) {
if (node.shadowRoot) {
var nodeName2 = node.nodeName.toLowerCase();
if (possibleShadowRoots.includes(nodeName2) || _isValidCustomElementName(nodeName2)) {
return true;
}
}
return false;
}
var is_shadow_root_default = isShadowRoot;
var dom_exports = {};
__export(dom_exports, {
createGrid: function createGrid() {
return _createGrid;
},
findElmsInContext: function findElmsInContext() {
return find_elms_in_context_default;
},
findNearbyElms: function findNearbyElms() {
return _findNearbyElms;
},
findUp: function findUp() {
return find_up_default;
},
findUpVirtual: function findUpVirtual() {
return find_up_virtual_default;
},
focusDisabled: function focusDisabled() {
return focus_disabled_default;
},
getComposedParent: function getComposedParent() {
return get_composed_parent_default;
},
getElementByReference: function getElementByReference() {
return _getElementByReference;
},
getElementCoordinates: function getElementCoordinates() {
return get_element_coordinates_default;
},
getElementStack: function getElementStack() {
return get_element_stack_default;
},
getModalDialog: function getModalDialog() {
return get_modal_dialog_default;
},
getNodeGrid: function getNodeGrid() {
return _getNodeGrid;
},
getOverflowHiddenAncestors: function getOverflowHiddenAncestors() {
return get_overflow_hidden_ancestors_default;
},
getResolvedRefs: function getResolvedRefs() {
return _getResolvedRefs;
},
getRootNode: function getRootNode() {
return get_root_node_default2;
},
getScrollOffset: function getScrollOffset() {
return get_scroll_offset_default;
},
getTabbableElements: function getTabbableElements() {
return _getTabbableElements;
},
getTargetRects: function getTargetRects() {
return get_target_rects_default;
},
getTargetSize: function getTargetSize() {
return get_target_size_default;
},
getTextElementStack: function getTextElementStack() {
return get_text_element_stack_default;
},
getViewportSize: function getViewportSize() {
return get_viewport_size_default;
},
getVisibleChildTextRects: function getVisibleChildTextRects() {
return get_visible_child_text_rects_default;
},
hasContent: function hasContent() {
return has_content_default;
},
hasContentVirtual: function hasContentVirtual() {
return has_content_virtual_default;
},
hasLangText: function hasLangText() {
return _hasLangText;
},
hasSameDestination: function hasSameDestination() {
return _hasSameDestination;
},
idrefs: function idrefs() {
return idrefs_default;
},
insertedIntoFocusOrder: function insertedIntoFocusOrder() {
return _insertedIntoFocusOrder;
},
isCurrentPageLink: function isCurrentPageLink() {
return _isCurrentPageLink;
},
isFixedPosition: function isFixedPosition() {
return _isFixedPosition;
},
isFocusable: function isFocusable() {
return _isFocusable;
},
isHTML5: function isHTML5() {
return is_html5_default;
},
isHiddenForEveryone: function isHiddenForEveryone() {
return _isHiddenForEveryone;
},
isHiddenWithCSS: function isHiddenWithCSS() {
return is_hidden_with_css_default;
},
isInTabOrder: function isInTabOrder() {
return _isInTabOrder;
},
isInTextBlock: function isInTextBlock() {
return is_in_text_block_default;
},
isInert: function isInert() {
return _isInert;
},
isModalOpen: function isModalOpen() {
return is_modal_open_default;
},
isMultiline: function isMultiline() {
return _isMultiline;
},
isNativelyFocusable: function isNativelyFocusable() {
return is_natively_focusable_default;
},
isNode: function isNode() {
return is_node_default;
},
isOffscreen: function isOffscreen() {
return is_offscreen_default;
},
isOpaque: function isOpaque() {
return is_opaque_default;
},
isSeparateTarget: function isSeparateTarget() {
return _isSeparateTarget;
},
isSkipLink: function isSkipLink() {
return _isSkipLink;
},
isVisible: function isVisible() {
return is_visible_default;
},
isVisibleOnScreen: function isVisibleOnScreen() {
return _isVisibleOnScreen;
},
isVisibleToScreenReaders: function isVisibleToScreenReaders() {
return _isVisibleToScreenReaders;
},
isVisualContent: function isVisualContent() {
return is_visual_content_default;
},
reduceToElementsBelowFloating: function reduceToElementsBelowFloating() {
return reduce_to_elements_below_floating_default;
},
shadowElementsFromPoint: function shadowElementsFromPoint() {
return shadow_elements_from_point_default;
},
urlPropsFromAttribute: function urlPropsFromAttribute() {
return url_props_from_attribute_default;
},
visuallyContains: function visuallyContains() {
return _visuallyContains;
},
visuallyOverlaps: function visuallyOverlaps() {
return visually_overlaps_default;
},
visuallySort: function visuallySort() {
return _visuallySort;
}
});
function getRootNode(node) {
var doc = node.getRootNode && node.getRootNode() || document;
if (doc === node) {
doc = document;
}
return doc;
}
var get_root_node_default = getRootNode;
var get_root_node_default2 = get_root_node_default;
function findElmsInContext(_ref57) {
var context = _ref57.context, value = _ref57.value, attr = _ref57.attr, _ref57$elm = _ref57.elm, elm = _ref57$elm === void 0 ? '' : _ref57$elm;
var root;
var escapedValue = escape_selector_default(value);
if (context.nodeType === 9 || context.nodeType === 11) {
root = context;
} else {
root = get_root_node_default2(context);
}
return Array.from(root.querySelectorAll(elm + '[' + attr + '=' + escapedValue + ']'));
}
var find_elms_in_context_default = findElmsInContext;
function findUpVirtual(element, target) {
var parent;
parent = element.actualNode;
if (!element.shadowId && typeof element.actualNode.closest === 'function') {
var match = element.actualNode.closest(target);
if (match) {
return match;
}
return null;
}
do {
parent = parent.assignedSlot ? parent.assignedSlot : parent.parentNode;
if (parent && parent.nodeType === 11) {
parent = parent.host;
}
} while (parent && !element_matches_default(parent, target) && parent !== document.documentElement);
if (!parent) {
return null;
}
if (!element_matches_default(parent, target)) {
return null;
}
return parent;
}
var find_up_virtual_default = findUpVirtual;
function findUp(element, target) {
return find_up_virtual_default(get_node_from_tree_default(element), target);
}
var find_up_default = findUp;
function _rectsOverlap(rect1, rect2) {
return (rect1.left | 0) < (rect2.right | 0) && (rect1.right | 0) > (rect2.left | 0) && (rect1.top | 0) < (rect2.bottom | 0) && (rect1.bottom | 0) > (rect2.top | 0);
}
var getOverflowHiddenAncestors = memoize_default(function getOverflowHiddenAncestorsMemoized(vNode) {
var ancestors = [];
if (!vNode) {
return ancestors;
}
var overflow = vNode.getComputedStylePropertyValue('overflow');
if (overflow === 'hidden') {
ancestors.push(vNode);
}
return ancestors.concat(getOverflowHiddenAncestors(vNode.parent));
}, {
primitive: true
});
var get_overflow_hidden_ancestors_default = getOverflowHiddenAncestors;
var ariaAttrs = {
'aria-actions': {
type: 'idrefs',
prop: 'ariaActionsElements',
allowEmpty: true,
global: true
},
'aria-activedescendant': {
type: 'idref',
prop: 'ariaActiveDescendantElement',
allowEmpty: true
},
'aria-atomic': {
type: 'boolean',
prop: 'ariaAtomic',
global: true,
caseInsensitive: true
},
'aria-autocomplete': {
type: 'nmtoken',
prop: 'ariaAutoComplete',
values: [ 'inline', 'list', 'both', 'none' ],
caseInsensitive: true
},
'aria-braillelabel': {
type: 'string',
prop: 'ariaBrailleLabel',
allowEmpty: true,
global: true
},
'aria-brailleroledescription': {
type: 'string',
prop: 'ariaBrailleRoleDescription',
allowEmpty: true,
global: true
},
'aria-busy': {
type: 'boolean',
prop: 'ariaBusy',
global: true,
defaultValue: 'false',
caseInsensitive: false
},
'aria-checked': {
type: 'nmtoken',
prop: 'ariaChecked',
values: [ 'false', 'mixed', 'true', 'undefined' ],
defaultValue: 'undefined',
caseInsensitive: false
},
'aria-colcount': {
type: 'int',
prop: 'ariaColCount',
minValue: -1
},
'aria-colindex': {
type: 'int',
prop: 'ariaColIndex',
minValue: 1
},
'aria-colspan': {
type: 'int',
prop: 'ariaColSpan',
minValue: 1
},
'aria-controls': {
type: 'idrefs',
prop: 'ariaControlsElements',
allowEmpty: true,
global: true
},
'aria-current': {
type: 'nmtoken',
prop: 'ariaCurrent',
allowEmpty: true,
values: [ 'page', 'step', 'location', 'date', 'time', 'true', 'false' ],
global: true,
defaultValue: 'false',
caseInsensitive: false
},
'aria-describedby': {
type: 'idrefs',
prop: 'ariaDescribedByElements',
allowEmpty: true,
global: true
},
'aria-description': {
type: 'string',
prop: 'ariaDescription',
allowEmpty: true,
global: true
},
'aria-details': {
type: 'idrefs',
prop: 'ariaDetailsElements',
allowEmpty: true,
global: true
},
'aria-disabled': {
type: 'boolean',
prop: 'ariaDisabled',
global: true,
caseInsensitive: true
},
'aria-dropeffect': {
type: 'nmtokens',
values: [ 'copy', 'execute', 'link', 'move', 'none', 'popup' ],
global: true,
caseInsensitive: true,
deprecated: true
},
'aria-errormessage': {
type: 'idrefs',
prop: 'ariaErrorMessageElements',
allowEmpty: true,
global: true
},
'aria-expanded': {
type: 'nmtoken',
prop: 'ariaExpanded',
values: [ 'true', 'false', 'undefined' ],
caseInsensitive: true
},
'aria-flowto': {
type: 'idrefs',
prop: 'ariaFlowToElements',
allowEmpty: true,
global: true
},
'aria-grabbed': {
type: 'nmtoken',
values: [ 'true', 'false', 'undefined' ],
global: true,
caseInsensitive: true,
deprecated: true
},
'aria-haspopup': {
type: 'nmtoken',
prop: 'ariaHasPopup',
allowEmpty: true,
values: [ 'true', 'false', 'menu', 'listbox', 'tree', 'grid', 'dialog' ],
global: true,
caseInsensitive: true
},
'aria-hidden': {
type: 'nmtoken',
prop: 'ariaHidden',
values: [ 'true', 'false', 'undefined' ],
global: true,
caseInsensitive: true
},
'aria-invalid': {
type: 'nmtoken',
prop: 'ariaInvalid',
values: [ 'grammar', 'false', 'spelling', 'true' ],
global: true,
caseInsensitive: true
},
'aria-keyshortcuts': {
type: 'string',
prop: 'ariaKeyShortcuts',
allowEmpty: true,
global: true
},
'aria-label': {
type: 'string',
prop: 'ariaLabel',
allowEmpty: true,
global: true
},
'aria-labelledby': {
type: 'idrefs',
prop: 'ariaLabelledByElements',
allowEmpty: true,
global: true
},
'aria-level': {
type: 'int',
prop: 'ariaLevel',
minValue: 1
},
'aria-live': {
type: 'nmtoken',
prop: 'ariaLive',
values: [ 'assertive', 'off', 'polite' ],
global: true,
caseInsensitive: true
},
'aria-modal': {
type: 'boolean',
prop: 'ariaModal',
caseInsensitive: true
},
'aria-multiline': {
type: 'boolean',
prop: 'ariaMultiline',
defaultValue: 'false',
caseInsensitive: false
},
'aria-multiselectable': {
type: 'boolean',
prop: 'ariaMultiSelectable',
caseInsensitive: true
},
'aria-orientation': {
type: 'nmtoken',
prop: 'ariaOrientation',
values: [ 'horizontal', 'undefined', 'vertical' ],
caseInsensitive: true
},
'aria-owns': {
type: 'idrefs',
prop: 'ariaOwnsElements',
allowEmpty: true,
global: true
},
'aria-placeholder': {
type: 'string',
prop: 'ariaPlaceholder',
allowEmpty: true
},
'aria-posinset': {
type: 'int',
prop: 'ariaPosInSet',
minValue: 1
},
'aria-pressed': {
type: 'nmtoken',
prop: 'ariaPressed',
values: [ 'false', 'mixed', 'true', 'undefined' ],
defaultValue: 'undefined',
caseInsensitive: false
},
'aria-readonly': {
type: 'boolean',
prop: 'ariaReadOnly',
defaultValue: 'false',
caseInsensitive: false
},
'aria-relevant': {
type: 'nmtokens',
prop: 'ariaRelevant',
values: [ 'additions', 'all', 'removals', 'text' ],
global: true,
defaultValue: 'additions text',
caseInsensitive: false
},
'aria-required': {
type: 'boolean',
prop: 'ariaRequired',
defaultValue: 'false',
caseInsensitive: false
},
'aria-roledescription': {
type: 'string',
prop: 'ariaRoleDescription',
allowEmpty: true,
global: true
},
'aria-rowcount': {
type: 'int',
prop: 'ariaRowCount',
minValue: -1
},
'aria-rowindex': {
type: 'int',
prop: 'ariaRowIndex',
minValue: 1
},
'aria-rowspan': {
type: 'int',
prop: 'ariaRowSpan',
minValue: 0
},
'aria-selected': {
type: 'nmtoken',
prop: 'ariaSelected',
values: [ 'false', 'true', 'undefined' ],
caseInsensitive: true
},
'aria-setsize': {
type: 'int',
prop: 'ariaSetSize',
minValue: -1
},
'aria-sort': {
type: 'nmtoken',
prop: 'ariaSort',
values: [ 'ascending', 'descending', 'none', 'other' ],
defaultValue: 'none',
caseInsensitive: false
},
'aria-valuemax': {
type: 'decimal',
prop: 'ariaValueMax'
},
'aria-valuemin': {
type: 'decimal',
prop: 'ariaValueMin'
},
'aria-valuenow': {
type: 'decimal',
prop: 'ariaValueNow'
},
'aria-valuetext': {
type: 'string',
prop: 'ariaValueText',
allowEmpty: true
}
};
var aria_attrs_default = ariaAttrs;
var imgRole = {
type: 'structure',
allowedAttrs: [ 'aria-expanded' ],
superclassRole: [ 'section' ],
accessibleNameRequired: true,
childrenPresentational: true
};
var noneRole = {
type: 'structure',
superclassRole: [ 'structure' ],
prohibitedAttrs: [ 'aria-label', 'aria-labelledby' ]
};
var ariaRoles = {
alert: {
type: 'structure',
allowedAttrs: [ 'aria-expanded' ],
superclassRole: [ 'section' ]
},
alertdialog: {
type: 'window',
allowedAttrs: [ 'aria-expanded', 'aria-modal' ],
superclassRole: [ 'alert', 'dialog' ],
accessibleNameRequired: true
},
application: {
type: 'landmark',
allowedAttrs: [ 'aria-activedescendant', 'aria-expanded' ],
superclassRole: [ 'structure' ],
accessibleNameRequired: true
},
article: {
type: 'structure',
allowedAttrs: [ 'aria-posinset', 'aria-setsize', 'aria-expanded' ],
superclassRole: [ 'document' ]
},
banner: {
type: 'landmark',
allowedAttrs: [ 'aria-expanded' ],
superclassRole: [ 'landmark' ]
},
blockquote: {
type: 'structure',
superclassRole: [ 'section' ]
},
button: {
type: 'widget',
allowedAttrs: [ 'aria-expanded', 'aria-pressed' ],
superclassRole: [ 'command' ],
accessibleNameRequired: true,
nameFromContent: true,
childrenPresentational: true
},
caption: {
type: 'structure',
requiredContext: [ 'figure', 'table', 'grid', 'treegrid' ],
superclassRole: [ 'section' ],
prohibitedAttrs: [ 'aria-actions', 'aria-label', 'aria-labelledby' ]
},
cell: {
type: 'structure',
requiredContext: [ 'row' ],
allowedAttrs: [ 'aria-colindex', 'aria-colspan', 'aria-rowindex', 'aria-rowspan', 'aria-expanded' ],
superclassRole: [ 'section' ],
nameFromContent: true
},
checkbox: {
type: 'widget',
requiredAttrs: [ 'aria-checked' ],
allowedAttrs: [ 'aria-readonly', 'aria-expanded', 'aria-required' ],
superclassRole: [ 'input' ],
accessibleNameRequired: true,
nameFromContent: true,
childrenPresentational: true
},
code: {
type: 'structure',
superclassRole: [ 'section' ],
prohibitedAttrs: [ 'aria-actions', 'aria-label', 'aria-labelledby' ]
},
columnheader: {
type: 'structure',
requiredContext: [ 'row' ],
allowedAttrs: [ 'aria-sort', 'aria-colindex', 'aria-colspan', 'aria-expanded', 'aria-readonly', 'aria-required', 'aria-rowindex', 'aria-rowspan', 'aria-selected' ],
superclassRole: [ 'cell', 'gridcell', 'sectionhead' ],
accessibleNameRequired: false,
nameFromContent: true
},
combobox: {
type: 'widget',
requiredAttrs: [ 'aria-expanded', 'aria-controls' ],
allowedAttrs: [ 'aria-owns', 'aria-autocomplete', 'aria-readonly', 'aria-required', 'aria-activedescendant', 'aria-orientation' ],
superclassRole: [ 'select' ],
accessibleNameRequired: true
},
command: {
type: 'abstract',
superclassRole: [ 'widget' ]
},
complementary: {
type: 'landmark',
allowedAttrs: [ 'aria-expanded' ],
superclassRole: [ 'landmark' ]
},
composite: {
type: 'abstract',
superclassRole: [ 'widget' ]
},
contentinfo: {
type: 'landmark',
allowedAttrs: [ 'aria-expanded' ],
superclassRole: [ 'landmark' ]
},
comment: {
type: 'structure',
allowedAttrs: [ 'aria-level', 'aria-posinset', 'aria-setsize' ],
superclassRole: [ 'article' ]
},
definition: {
type: 'structure',
allowedAttrs: [ 'aria-expanded' ],
superclassRole: [ 'section' ]
},
deletion: {
type: 'structure',
superclassRole: [ 'section' ],
prohibitedAttrs: [ 'aria-actions', 'aria-label', 'aria-labelledby' ]
},
dialog: {
type: 'window',
allowedAttrs: [ 'aria-expanded', 'aria-modal' ],
superclassRole: [ 'window' ],
accessibleNameRequired: true
},
directory: {
type: 'structure',
deprecated: true,
allowedAttrs: [ 'aria-expanded' ],
superclassRole: [ 'list' ],
nameFromContent: true
},
document: {
type: 'structure',
allowedAttrs: [ 'aria-expanded' ],
superclassRole: [ 'structure' ]
},
emphasis: {
type: 'structure',
superclassRole: [ 'section' ],
prohibitedAttrs: [ 'aria-actions', 'aria-label', 'aria-labelledby' ]
},
feed: {
type: 'structure',
requiredOwned: [ 'article' ],
allowedAttrs: [ 'aria-expanded' ],
superclassRole: [ 'list' ]
},
figure: {
type: 'structure',
allowedAttrs: [ 'aria-expanded' ],
superclassRole: [ 'section' ],
nameFromContent: true
},
form: {
type: 'landmark',
allowedAttrs: [ 'aria-expanded' ],
superclassRole: [ 'landmark' ]
},
grid: {
type: 'composite',
requiredOwned: [ 'rowgroup', 'row' ],
allowedAttrs: [ 'aria-level', 'aria-multiselectable', 'aria-readonly', 'aria-activedescendant', 'aria-colcount', 'aria-expanded', 'aria-rowcount' ],
superclassRole: [ 'composite', 'table' ],
accessibleNameRequired: false
},
gridcell: {
type: 'widget',
requiredContext: [ 'row' ],
allowedAttrs: [ 'aria-readonly', 'aria-required', 'aria-selected', 'aria-colindex', 'aria-colspan', 'aria-expanded', 'aria-rowindex', 'aria-rowspan' ],
superclassRole: [ 'cell', 'widget' ],
nameFromContent: true
},
group: {
type: 'structure',
allowedAttrs: [ 'aria-activedescendant', 'aria-expanded' ],
superclassRole: [ 'section' ]
},
heading: {
type: 'structure',
requiredAttrs: [ 'aria-level' ],
allowedAttrs: [ 'aria-expanded' ],
superclassRole: [ 'sectionhead' ],
accessibleNameRequired: false,
nameFromContent: true
},
image: _extends({}, imgRole),
img: _extends({}, imgRole),
input: {
type: 'abstract',
superclassRole: [ 'widget' ]
},
insertion: {
type: 'structure',
superclassRole: [ 'section' ],
prohibitedAttrs: [ 'aria-actions', 'aria-label', 'aria-labelledby' ]
},
landmark: {
type: 'abstract',
superclassRole: [ 'section' ]
},
link: {
type: 'widget',
allowedAttrs: [ 'aria-expanded' ],
superclassRole: [ 'command' ],
accessibleNameRequired: true,
nameFromContent: true
},
list: {
type: 'structure',
requiredOwned: [ 'listitem' ],
allowedAttrs: [ 'aria-expanded' ],
superclassRole: [ 'section' ]
},
listbox: {
type: 'widget',
requiredOwned: [ 'group', 'option' ],
allowedAttrs: [ 'aria-multiselectable', 'aria-readonly', 'aria-required', 'aria-activedescendant', 'aria-expanded', 'aria-orientation' ],
superclassRole: [ 'select' ],
accessibleNameRequired: true
},
listitem: {
type: 'structure',
requiredContext: [ 'list' ],
allowedAttrs: [ 'aria-level', 'aria-posinset', 'aria-setsize', 'aria-expanded' ],
superclassRole: [ 'section' ],
nameFromContent: true
},
log: {
type: 'structure',
allowedAttrs: [ 'aria-expanded' ],
superclassRole: [ 'section' ]
},
main: {
type: 'landmark',
allowedAttrs: [ 'aria-expanded' ],
superclassRole: [ 'landmark' ]
},
marquee: {
type: 'structure',
allowedAttrs: [ 'aria-expanded' ],
superclassRole: [ 'section' ]
},
math: {
type: 'structure',
allowedAttrs: [ 'aria-expanded' ],
superclassRole: [ 'section' ],
childrenPresentational: true
},
menu: {
type: 'composite',
requiredOwned: [ 'group', 'menuitemradio', 'menuitem', 'menuitemcheckbox', 'menu', 'separator' ],
allowedAttrs: [ 'aria-activedescendant', 'aria-expanded', 'aria-orientation' ],
superclassRole: [ 'select' ]
},
menubar: {
type: 'composite',
requiredOwned: [ 'group', 'menuitemradio', 'menuitem', 'menuitemcheckbox', 'menu', 'separator' ],
allowedAttrs: [ 'aria-activedescendant', 'aria-expanded', 'aria-orientation' ],
superclassRole: [ 'menu' ]
},
menuitem: {
type: 'widget',
requiredContext: [ 'menu', 'menubar', 'group' ],
allowedAttrs: [ 'aria-posinset', 'aria-setsize', 'aria-expanded' ],
superclassRole: [ 'command' ],
accessibleNameRequired: true,
nameFromContent: true
},
menuitemcheckbox: {
type: 'widget',
requiredContext: [ 'menu', 'menubar', 'group' ],
requiredAttrs: [ 'aria-checked' ],
allowedAttrs: [ 'aria-expanded', 'aria-posinset', 'aria-readonly', 'aria-setsize' ],
superclassRole: [ 'checkbox', 'menuitem' ],
accessibleNameRequired: true,
nameFromContent: true,
childrenPresentational: true
},
menuitemradio: {
type: 'widget',
requiredContext: [ 'menu', 'menubar', 'group' ],
requiredAttrs: [ 'aria-checked' ],
allowedAttrs: [ 'aria-expanded', 'aria-posinset', 'aria-readonly', 'aria-setsize' ],
superclassRole: [ 'menuitemcheckbox', 'radio' ],
accessibleNameRequired: true,
nameFromContent: true,
childrenPresentational: true
},
meter: {
type: 'structure',
requiredAttrs: [ 'aria-valuenow' ],
allowedAttrs: [ 'aria-valuemax', 'aria-valuemin', 'aria-valuetext' ],
superclassRole: [ 'range' ],
accessibleNameRequired: true,
childrenPresentational: true
},
mark: {
type: 'structure',
superclassRole: [ 'section' ],
prohibitedAttrs: [ 'aria-actions', 'aria-label', 'aria-labelledby' ]
},
navigation: {
type: 'landmark',
allowedAttrs: [ 'aria-expanded' ],
superclassRole: [ 'landmark' ]
},
none: _extends({}, noneRole),
note: {
type: 'structure',
allowedAttrs: [ 'aria-expanded' ],
superclassRole: [ 'section' ]
},
option: {
type: 'widget',
requiredContext: [ 'group', 'listbox' ],
allowedAttrs: [ 'aria-selected', 'aria-checked', 'aria-posinset', 'aria-setsize' ],
superclassRole: [ 'input' ],
accessibleNameRequired: true,
nameFromContent: true,
childrenPresentational: true
},
paragraph: {
type: 'structure',
superclassRole: [ 'section' ],
prohibitedAttrs: [ 'aria-actions', 'aria-label', 'aria-labelledby' ]
},
presentation: _extends({}, noneRole),
progressbar: {
type: 'widget',
allowedAttrs: [ 'aria-expanded', 'aria-valuemax', 'aria-valuemin', 'aria-valuenow', 'aria-valuetext' ],
superclassRole: [ 'range' ],
accessibleNameRequired: true,
childrenPresentational: true
},
radio: {
type: 'widget',
requiredAttrs: [ 'aria-checked' ],
allowedAttrs: [ 'aria-posinset', 'aria-setsize', 'aria-required' ],
superclassRole: [ 'input' ],
accessibleNameRequired: true,
nameFromContent: true,
childrenPresentational: true
},
radiogroup: {
type: 'composite',
allowedAttrs: [ 'aria-readonly', 'aria-required', 'aria-activedescendant', 'aria-expanded', 'aria-orientation' ],
superclassRole: [ 'select' ],
accessibleNameRequired: false
},
range: {
type: 'abstract',
superclassRole: [ 'widget' ]
},
region: {
type: 'landmark',
allowedAttrs: [ 'aria-expanded' ],
superclassRole: [ 'landmark' ],
accessibleNameRequired: false
},
roletype: {
type: 'abstract',
superclassRole: []
},
row: {
type: 'structure',
requiredContext: [ 'grid', 'rowgroup', 'table', 'treegrid' ],
requiredOwned: [ 'cell', 'columnheader', 'gridcell', 'rowheader' ],
allowedAttrs: [ 'aria-colindex', 'aria-level', 'aria-rowindex', 'aria-selected', 'aria-activedescendant', 'aria-expanded', 'aria-posinset', 'aria-setsize' ],
superclassRole: [ 'group', 'widget' ],
nameFromContent: true
},
rowgroup: {
type: 'structure',
requiredContext: [ 'grid', 'table', 'treegrid' ],
requiredOwned: [ 'row' ],
superclassRole: [ 'structure' ],
nameFromContent: true
},
rowheader: {
type: 'structure',
requiredContext: [ 'row' ],
allowedAttrs: [ 'aria-sort', 'aria-colindex', 'aria-colspan', 'aria-expanded', 'aria-readonly', 'aria-required', 'aria-rowindex', 'aria-rowspan', 'aria-selected' ],
superclassRole: [ 'cell', 'gridcell', 'sectionhead' ],
accessibleNameRequired: false,
nameFromContent: true
},
scrollbar: {
type: 'widget',
requiredAttrs: [ 'aria-valuenow' ],
allowedAttrs: [ 'aria-controls', 'aria-orientation', 'aria-valuemax', 'aria-valuemin', 'aria-valuetext' ],
superclassRole: [ 'range' ],
childrenPresentational: true
},
search: {
type: 'landmark',
allowedAttrs: [ 'aria-expanded' ],
superclassRole: [ 'landmark' ]
},
searchbox: {
type: 'widget',
allowedAttrs: [ 'aria-activedescendant', 'aria-autocomplete', 'aria-multiline', 'aria-placeholder', 'aria-readonly', 'aria-required' ],
superclassRole: [ 'textbox' ],
accessibleNameRequired: true
},
section: {
type: 'abstract',
superclassRole: [ 'structure' ],
nameFromContent: true
},
sectionfooter: {
type: 'structure',
superclassRole: [ 'section' ]
},
sectionhead: {
type: 'abstract',
superclassRole: [ 'structure' ],
nameFromContent: true
},
sectionheader: {
type: 'structure',
superclassRole: [ 'section' ]
},
select: {
type: 'abstract',
superclassRole: [ 'composite', 'group' ]
},
separator: {
type: 'structure',
requiredAttrs: [ 'aria-valuenow' ],
allowedAttrs: [ 'aria-valuemax', 'aria-valuemin', 'aria-orientation', 'aria-valuetext' ],
superclassRole: [ 'structure', 'widget' ],
childrenPresentational: true
},
slider: {
type: 'widget',
requiredAttrs: [ 'aria-valuenow' ],
allowedAttrs: [ 'aria-valuemax', 'aria-valuemin', 'aria-orientation', 'aria-readonly', 'aria-required', 'aria-valuetext' ],
superclassRole: [ 'input', 'range' ],
accessibleNameRequired: true,
childrenPresentational: true
},
spinbutton: {
type: 'widget',
allowedAttrs: [ 'aria-valuemax', 'aria-valuemin', 'aria-readonly', 'aria-required', 'aria-activedescendant', 'aria-valuetext', 'aria-valuenow' ],
superclassRole: [ 'composite', 'input', 'range' ],
accessibleNameRequired: true
},
status: {
type: 'structure',
allowedAttrs: [ 'aria-expanded' ],
superclassRole: [ 'section' ]
},
strong: {
type: 'structure',
superclassRole: [ 'section' ],
prohibitedAttrs: [ 'aria-actions', 'aria-label', 'aria-labelledby' ]
},
structure: {
type: 'abstract',
superclassRole: [ 'roletype' ]
},
subscript: {
type: 'structure',
superclassRole: [ 'section' ],
prohibitedAttrs: [ 'aria-actions', 'aria-label', 'aria-labelledby' ]
},
superscript: {
type: 'structure',
superclassRole: [ 'section' ],
prohibitedAttrs: [ 'aria-actions', 'aria-label', 'aria-labelledby' ]
},
switch: {
type: 'widget',
requiredAttrs: [ 'aria-checked' ],
allowedAttrs: [ 'aria-expanded', 'aria-readonly', 'aria-required' ],
superclassRole: [ 'checkbox' ],
accessibleNameRequired: true,
nameFromContent: true,
childrenPresentational: true
},
suggestion: {
type: 'structure',
requiredOwned: [ 'insertion', 'deletion' ],
superclassRole: [ 'section' ],
prohibitedAttrs: [ 'aria-actions', 'aria-label', 'aria-labelledby' ]
},
tab: {
type: 'widget',
requiredContext: [ 'tablist' ],
allowedAttrs: [ 'aria-posinset', 'aria-selected', 'aria-setsize', 'aria-expanded' ],
superclassRole: [ 'sectionhead', 'widget' ],
nameFromContent: true,
childrenPresentational: true
},
table: {
type: 'structure',
requiredOwned: [ 'rowgroup', 'row' ],
allowedAttrs: [ 'aria-colcount', 'aria-rowcount', 'aria-expanded' ],
superclassRole: [ 'section' ],
accessibleNameRequired: false,
nameFromContent: true
},
tablist: {
type: 'composite',
requiredOwned: [ 'tab' ],
allowedAttrs: [ 'aria-level', 'aria-multiselectable', 'aria-orientation', 'aria-activedescendant', 'aria-expanded' ],
superclassRole: [ 'composite' ]
},
tabpanel: {
type: 'structure',
allowedAttrs: [ 'aria-expanded' ],
superclassRole: [ 'section' ],
accessibleNameRequired: false
},
term: {
type: 'structure',
allowedAttrs: [ 'aria-expanded' ],
superclassRole: [ 'section' ],
nameFromContent: true
},
text: {
type: 'structure',
superclassRole: [ 'section' ],
nameFromContent: true
},
textbox: {
type: 'widget',
allowedAttrs: [ 'aria-activedescendant', 'aria-autocomplete', 'aria-multiline', 'aria-placeholder', 'aria-readonly', 'aria-required' ],
superclassRole: [ 'input' ],
accessibleNameRequired: true
},
time: {
type: 'structure',
superclassRole: [ 'section' ]
},
timer: {
type: 'structure',
allowedAttrs: [ 'aria-expanded' ],
superclassRole: [ 'status' ]
},
toolbar: {
type: 'structure',
allowedAttrs: [ 'aria-orientation', 'aria-activedescendant', 'aria-expanded' ],
superclassRole: [ 'group' ],
accessibleNameRequired: true
},
tooltip: {
type: 'structure',
allowedAttrs: [ 'aria-expanded' ],
superclassRole: [ 'section' ],
nameFromContent: true
},
tree: {
type: 'composite',
requiredOwned: [ 'group', 'treeitem' ],
allowedAttrs: [ 'aria-multiselectable', 'aria-required', 'aria-activedescendant', 'aria-expanded', 'aria-orientation' ],
superclassRole: [ 'select' ],
accessibleNameRequired: false
},
treegrid: {
type: 'composite',
requiredOwned: [ 'rowgroup', 'row' ],
allowedAttrs: [ 'aria-activedescendant', 'aria-colcount', 'aria-expanded', 'aria-level', 'aria-multiselectable', 'aria-orientation', 'aria-readonly', 'aria-required', 'aria-rowcount' ],
superclassRole: [ 'grid', 'tree' ],
accessibleNameRequired: false
},
treeitem: {
type: 'widget',
requiredContext: [ 'group', 'tree' ],
allowedAttrs: [ 'aria-checked', 'aria-expanded', 'aria-level', 'aria-posinset', 'aria-selected', 'aria-setsize' ],
superclassRole: [ 'listitem', 'option' ],
accessibleNameRequired: true,
nameFromContent: true
},
widget: {
type: 'abstract',
superclassRole: [ 'roletype' ]
},
window: {
type: 'abstract',
superclassRole: [ 'roletype' ]
}
};
var aria_roles_default = ariaRoles;
var dpubRoles = {
'doc-abstract': {
type: 'section',
allowedAttrs: [ 'aria-expanded' ],
superclassRole: [ 'section' ]
},
'doc-acknowledgments': {
type: 'landmark',
allowedAttrs: [ 'aria-expanded' ],
superclassRole: [ 'landmark' ]
},
'doc-afterword': {
type: 'landmark',
allowedAttrs: [ 'aria-expanded' ],
superclassRole: [ 'landmark' ]
},
'doc-appendix': {
type: 'landmark',
allowedAttrs: [ 'aria-expanded' ],
superclassRole: [ 'landmark' ]
},
'doc-backlink': {
type: 'link',
allowedAttrs: [ 'aria-expanded' ],
nameFromContent: true,
superclassRole: [ 'link' ]
},
'doc-biblioentry': {
type: 'listitem',
allowedAttrs: [ 'aria-expanded', 'aria-level', 'aria-posinset', 'aria-setsize' ],
superclassRole: [ 'listitem' ],
deprecated: true
},
'doc-bibliography': {
type: 'landmark',
allowedAttrs: [ 'aria-expanded' ],
superclassRole: [ 'landmark' ]
},
'doc-biblioref': {
type: 'link',
allowedAttrs: [ 'aria-expanded' ],
nameFromContent: true,
superclassRole: [ 'link' ]
},
'doc-chapter': {
type: 'landmark',
allowedAttrs: [ 'aria-expanded' ],
superclassRole: [ 'landmark' ]
},
'doc-colophon': {
type: 'section',
allowedAttrs: [ 'aria-expanded' ],
superclassRole: [ 'section' ]
},
'doc-conclusion': {
type: 'landmark',
allowedAttrs: [ 'aria-expanded' ],
superclassRole: [ 'landmark' ]
},
'doc-cover': {
type: 'img',
allowedAttrs: [ 'aria-expanded' ],
superclassRole: [ 'img' ]
},
'doc-credit': {
type: 'section',
allowedAttrs: [ 'aria-expanded' ],
superclassRole: [ 'section' ]
},
'doc-credits': {
type: 'landmark',
allowedAttrs: [ 'aria-expanded' ],
superclassRole: [ 'landmark' ]
},
'doc-dedication': {
type: 'section',
allowedAttrs: [ 'aria-expanded' ],
superclassRole: [ 'section' ]
},
'doc-endnote': {
type: 'listitem',
allowedAttrs: [ 'aria-expanded', 'aria-level', 'aria-posinset', 'aria-setsize' ],
superclassRole: [ 'listitem' ],
deprecated: true
},
'doc-endnotes': {
type: 'landmark',
allowedAttrs: [ 'aria-expanded' ],
superclassRole: [ 'landmark' ]
},
'doc-epigraph': {
type: 'section',
allowedAttrs: [ 'aria-expanded' ],
superclassRole: [ 'section' ]
},
'doc-epilogue': {
type: 'landmark',
allowedAttrs: [ 'aria-expanded' ],
superclassRole: [ 'landmark' ]
},
'doc-errata': {
type: 'landmark',
allowedAttrs: [ 'aria-expanded' ],
superclassRole: [ 'landmark' ]
},
'doc-example': {
type: 'section',
allowedAttrs: [ 'aria-expanded' ],
superclassRole: [ 'section' ]
},
'doc-footnote': {
type: 'section',
allowedAttrs: [ 'aria-expanded' ],
superclassRole: [ 'section' ]
},
'doc-foreword': {
type: 'landmark',
allowedAttrs: [ 'aria-expanded' ],
superclassRole: [ 'landmark' ]
},
'doc-glossary': {
type: 'landmark',
allowedAttrs: [ 'aria-expanded' ],
superclassRole: [ 'landmark' ]
},
'doc-glossref': {
type: 'link',
allowedAttrs: [ 'aria-expanded' ],
nameFromContent: true,
superclassRole: [ 'link' ]
},
'doc-index': {
type: 'navigation',
allowedAttrs: [ 'aria-expanded' ],
superclassRole: [ 'navigation' ]
},
'doc-introduction': {
type: 'landmark',
allowedAttrs: [ 'aria-expanded' ],
superclassRole: [ 'landmark' ]
},
'doc-noteref': {
type: 'link',
allowedAttrs: [ 'aria-expanded' ],
nameFromContent: true,
superclassRole: [ 'link' ]
},
'doc-notice': {
type: 'note',
allowedAttrs: [ 'aria-expanded' ],
superclassRole: [ 'note' ]
},
'doc-pagebreak': {
type: 'separator',
allowedAttrs: [ 'aria-expanded', 'aria-orientation' ],
superclassRole: [ 'separator' ],
childrenPresentational: true
},
'doc-pagelist': {
type: 'navigation',
allowedAttrs: [ 'aria-expanded' ],
superclassRole: [ 'navigation' ]
},
'doc-part': {
type: 'landmark',
allowedAttrs: [ 'aria-expanded' ],
superclassRole: [ 'landmark' ]
},
'doc-preface': {
type: 'landmark',
allowedAttrs: [ 'aria-expanded' ],
superclassRole: [ 'landmark' ]
},
'doc-prologue': {
type: 'landmark',
allowedAttrs: [ 'aria-expanded' ],
superclassRole: [ 'landmark' ]
},
'doc-pullquote': {
type: 'none',
superclassRole: [ 'none' ]
},
'doc-qna': {
type: 'section',
allowedAttrs: [ 'aria-expanded' ],
superclassRole: [ 'section' ]
},
'doc-subtitle': {
type: 'sectionhead',
allowedAttrs: [ 'aria-expanded' ],
superclassRole: [ 'sectionhead' ]
},
'doc-tip': {
type: 'note',
allowedAttrs: [ 'aria-expanded' ],
superclassRole: [ 'note' ]
},
'doc-toc': {
type: 'navigation',
allowedAttrs: [ 'aria-expanded' ],
superclassRole: [ 'navigation' ]
}
};
var dpub_roles_default = dpubRoles;
var graphicsRoles = {
'graphics-document': {
type: 'structure',
superclassRole: [ 'document' ],
accessibleNameRequired: true
},
'graphics-object': {
type: 'structure',
superclassRole: [ 'group' ],
nameFromContent: true
},
'graphics-symbol': {
type: 'structure',
superclassRole: [ 'img' ],
accessibleNameRequired: true,
childrenPresentational: true
}
};
var graphics_roles_default = graphicsRoles;
var htmlElms = {
a: {
variant: {
href: {
matches: '[href]',
contentTypes: [ 'interactive', 'phrasing', 'flow' ],
allowedRoles: [ 'button', 'checkbox', 'menuitem', 'menuitemcheckbox', 'menuitemradio', 'option', 'radio', 'switch', 'tab', 'treeitem', 'doc-backlink', 'doc-biblioref', 'doc-glossref', 'doc-noteref' ],
namingMethods: [ 'subtreeText' ]
},
default: {
contentTypes: [ 'phrasing', 'flow' ],
allowedRoles: true,
namingProhibited: true
}
}
},
abbr: {
contentTypes: [ 'phrasing', 'flow' ],
allowedRoles: true,
namingProhibited: true
},
address: {
contentTypes: [ 'flow' ],
allowedRoles: true
},
area: {
variant: {
href: {
matches: '[href]',
allowedRoles: false
},
default: {
allowedRoles: [ 'button', 'link' ],
namingProhibited: true
}
},
contentTypes: [ 'phrasing', 'flow' ],
namingMethods: [ 'altText' ]
},
article: {
contentTypes: [ 'sectioning', 'flow' ],
allowedRoles: [ 'feed', 'presentation', 'none', 'document', 'application', 'main', 'region' ],
shadowRoot: true
},
aside: {
contentTypes: [ 'sectioning', 'flow' ],
allowedRoles: [ 'feed', 'note', 'presentation', 'none', 'region', 'search', 'doc-dedication', 'doc-example', 'doc-footnote', 'doc-glossary', 'doc-pullquote', 'doc-tip' ]
},
audio: {
variant: {
controls: {
matches: '[controls]',
contentTypes: [ 'interactive', 'embedded', 'phrasing', 'flow' ]
},
default: {
contentTypes: [ 'embedded', 'phrasing', 'flow' ]
}
},
allowedRoles: [ 'application' ],
chromiumRole: 'Audio'
},
b: {
contentTypes: [ 'phrasing', 'flow' ],
allowedRoles: true,
namingProhibited: true
},
base: {
allowedRoles: false,
allowedAriaAttrs: []
},
bdi: {
contentTypes: [ 'phrasing', 'flow' ],
allowedRoles: true,
namingProhibited: true
},
bdo: {
contentTypes: [ 'phrasing', 'flow' ],
allowedRoles: true,
namingProhibited: true
},
blockquote: {
contentTypes: [ 'flow' ],
allowedRoles: true,
shadowRoot: true
},
body: {
allowedRoles: false,
shadowRoot: true,
namingProhibited: true
},
br: {
contentTypes: [ 'phrasing', 'flow' ],
allowedRoles: [ 'presentation', 'none' ],
namingMethods: [ 'titleText', 'singleSpace' ],
allowedAriaAttrs: [ 'aria-hidden' ]
},
button: {
contentTypes: [ 'interactive', 'phrasing', 'flow' ],
allowedRoles: [ 'checkbox', 'combobox', 'gridcell', 'link', 'menuitem', 'menuitemcheckbox', 'menuitemradio', 'option', 'radio', 'separator', 'slider', 'switch', 'tab', 'treeitem' ],
namingMethods: [ 'subtreeText' ]
},
canvas: {
allowedRoles: true,
contentTypes: [ 'embedded', 'phrasing', 'flow' ],
chromiumRole: 'Canvas'
},
caption: {
allowedRoles: false,
namingProhibited: true
},
cite: {
contentTypes: [ 'phrasing', 'flow' ],
allowedRoles: true,
namingProhibited: true
},
code: {
contentTypes: [ 'phrasing', 'flow' ],
allowedRoles: true,
namingProhibited: true
},
col: {
allowedRoles: false,
allowedAriaAttrs: []
},
colgroup: {
allowedRoles: false,
allowedAriaAttrs: []
},
data: {
contentTypes: [ 'phrasing', 'flow' ],
allowedRoles: true,
namingProhibited: true
},
datalist: {
contentTypes: [ 'phrasing', 'flow' ],
allowedRoles: false,
allowedAriaAttrs: [],
implicitAttrs: {
'aria-multiselectable': 'false'
}
},
dd: {
allowedRoles: false,
namingProhibited: true
},
del: {
contentTypes: [ 'phrasing', 'flow' ],
allowedRoles: true,
namingProhibited: true
},
dfn: {
contentTypes: [ 'phrasing', 'flow' ],
allowedRoles: true
},
details: {
contentTypes: [ 'interactive', 'flow' ],
allowedRoles: false
},
dialog: {
contentTypes: [ 'flow' ],
allowedRoles: [ 'alertdialog' ]
},
div: {
contentTypes: [ 'flow' ],
allowedRoles: true,
shadowRoot: true,
namingProhibited: true
},
dl: {
contentTypes: [ 'flow' ],
allowedRoles: [ 'group', 'list', 'presentation', 'none' ],
chromiumRole: 'DescriptionList'
},
dt: {
allowedRoles: [ 'listitem' ]
},
em: {
contentTypes: [ 'phrasing', 'flow' ],
allowedRoles: true,
namingProhibited: true
},
embed: {
contentTypes: [ 'interactive', 'embedded', 'phrasing', 'flow' ],
allowedRoles: [ 'application', 'document', 'img', 'image', 'presentation', 'none' ],
chromiumRole: 'EmbeddedObject'
},
fieldset: {
contentTypes: [ 'flow' ],
allowedRoles: [ 'none', 'presentation', 'radiogroup' ],
namingMethods: [ 'fieldsetLegendText' ]
},
figcaption: {
allowedRoles: [ 'group', 'none', 'presentation' ],
namingProhibited: true
},
figure: {
variant: {
figcaption: {
matches: {
hasChild: 'figcaption'
},
allowedRoles: [ 'doc-example' ]
},
default: {
allowedRoles: true
}
},
contentTypes: [ 'flow' ],
namingMethods: [ 'figureText', 'titleText' ]
},
footer: {
contentTypes: [ 'flow' ],
allowedRoles: [ 'group', 'none', 'presentation', 'doc-footnote' ],
shadowRoot: true
},
form: {
contentTypes: [ 'flow' ],
allowedRoles: [ 'form', 'search', 'none', 'presentation' ]
},
h1: {
contentTypes: [ 'heading', 'flow' ],
allowedRoles: [ 'none', 'presentation', 'tab', 'doc-subtitle' ],
shadowRoot: true,
implicitAttrs: {
'aria-level': '1'
}
},
h2: {
contentTypes: [ 'heading', 'flow' ],
allowedRoles: [ 'none', 'presentation', 'tab', 'doc-subtitle' ],
shadowRoot: true,
implicitAttrs: {
'aria-level': '2'
}
},
h3: {
contentTypes: [ 'heading', 'flow' ],
allowedRoles: [ 'none', 'presentation', 'tab', 'doc-subtitle' ],
shadowRoot: true,
implicitAttrs: {
'aria-level': '3'
}
},
h4: {
contentTypes: [ 'heading', 'flow' ],
allowedRoles: [ 'none', 'presentation', 'tab', 'doc-subtitle' ],
shadowRoot: true,
implicitAttrs: {
'aria-level': '4'
}
},
h5: {
contentTypes: [ 'heading', 'flow' ],
allowedRoles: [ 'none', 'presentation', 'tab', 'doc-subtitle' ],
shadowRoot: true,
implicitAttrs: {
'aria-level': '5'
}
},
h6: {
contentTypes: [ 'heading', 'flow' ],
allowedRoles: [ 'none', 'presentation', 'tab', 'doc-subtitle' ],
shadowRoot: true,
implicitAttrs: {
'aria-level': '6'
}
},
head: {
allowedRoles: false,
allowedAriaAttrs: []
},
header: {
contentTypes: [ 'flow' ],
allowedRoles: [ 'group', 'none', 'presentation', 'doc-footnote' ],
shadowRoot: true
},
hgroup: {
contentTypes: [ 'heading', 'flow' ],
allowedRoles: true
},
hr: {
contentTypes: [ 'flow' ],
allowedRoles: [ 'none', 'presentation', 'doc-pagebreak' ],
namingMethods: [ 'titleText', 'singleSpace' ]
},
html: {
allowedRoles: false,
allowedAriaAttrs: []
},
i: {
contentTypes: [ 'phrasing', 'flow' ],
allowedRoles: true,
namingProhibited: true
},
iframe: {
contentTypes: [ 'interactive', 'embedded', 'phrasing', 'flow' ],
allowedRoles: [ 'application', 'document', 'img', 'image', 'none', 'presentation' ],
chromiumRole: 'Iframe'
},
img: {
variant: {
nonEmptyAlt: {
matches: [ {
attributes: {
alt: '/.+/'
}
}, {
hasAccessibleName: true
} ],
allowedRoles: [ 'button', 'checkbox', 'link', 'math', 'menuitem', 'menuitemcheckbox', 'menuitemradio', 'meter', 'option', 'progressbar', 'radio', 'scrollbar', 'separator', 'slider', 'switch', 'tab', 'treeitem', 'doc-cover' ]
},
usemap: {
matches: '[usemap]',
contentTypes: [ 'interactive', 'embedded', 'flow' ]
},
default: {
allowedRoles: [ 'presentation', 'none' ],
contentTypes: [ 'embedded', 'flow' ]
}
},
namingMethods: [ 'altText' ]
},
input: {
variant: {
button: {
matches: {
properties: {
type: 'button'
}
},
allowedRoles: [ 'checkbox', 'combobox', 'link', 'menuitem', 'menuitemcheckbox', 'menuitemradio', 'option', 'radio', 'switch', 'tab' ]
},
buttonType: {
matches: {
properties: {
type: [ 'button', 'submit', 'reset' ]
}
},
namingMethods: [ 'valueText', 'titleText', 'buttonDefaultText' ]
},
checkboxPressed: {
matches: {
properties: {
type: 'checkbox'
},
attributes: {
'aria-pressed': '/.*/'
}
},
allowedRoles: [ 'button', 'menuitemcheckbox', 'option', 'switch' ],
implicitAttrs: {
'aria-checked': 'false'
}
},
checkbox: {
matches: {
properties: {
type: 'checkbox'
},
attributes: {
'aria-pressed': null
}
},
allowedRoles: [ 'menuitemcheckbox', 'option', 'switch' ],
implicitAttrs: {
'aria-checked': 'false'
}
},
noRoles: {
matches: {
properties: {
type: [ 'color', 'date', 'datetime-local', 'file', 'month', 'number', 'password', 'range', 'reset', 'submit', 'time', 'week' ]
}
},
allowedRoles: false
},
hidden: {
matches: {
properties: {
type: 'hidden'
}
},
contentTypes: [ 'flow' ],
allowedRoles: false,
allowedAriaAttrs: []
},
image: {
matches: {
properties: {
type: 'image'
}
},
allowedRoles: [ 'link', 'menuitem', 'menuitemcheckbox', 'menuitemradio', 'radio', 'switch' ],
namingMethods: [ 'altText', 'valueText', 'labelText', 'titleText', 'buttonDefaultText' ]
},
radio: {
matches: {
properties: {
type: 'radio'
}
},
allowedRoles: [ 'menuitemradio' ],
implicitAttrs: {
'aria-checked': 'false'
}
},
textWithList: {
matches: {
properties: {
type: 'text'
},
attributes: {
list: '/.*/'
}
},
allowedRoles: false
},
default: {
contentTypes: [ 'interactive', 'flow' ],
allowedRoles: [ 'combobox', 'searchbox', 'spinbutton' ],
implicitAttrs: {
'aria-valuenow': ''
},
namingMethods: [ 'labelText', 'placeholderText' ]
}
}
},
ins: {
contentTypes: [ 'phrasing', 'flow' ],
allowedRoles: true,
namingProhibited: true
},
kbd: {
contentTypes: [ 'phrasing', 'flow' ],
allowedRoles: true,
namingProhibited: true
},
label: {
contentTypes: [ 'interactive', 'phrasing', 'flow' ],
allowedRoles: false,
chromiumRole: 'Label',
namingProhibited: true
},
legend: {
allowedRoles: false,
namingProhibited: true
},
li: {
allowedRoles: [ 'menuitem', 'menuitemcheckbox', 'menuitemradio', 'option', 'none', 'presentation', 'radio', 'separator', 'tab', 'treeitem', 'doc-biblioentry', 'doc-endnote' ],
implicitAttrs: {
'aria-setsize': '1',
'aria-posinset': '1'
}
},
link: {
contentTypes: [ 'phrasing', 'flow' ],
allowedRoles: false,
allowedAriaAttrs: []
},
main: {
contentTypes: [ 'flow' ],
allowedRoles: false,
shadowRoot: true
},
map: {
contentTypes: [ 'phrasing', 'flow' ],
allowedRoles: false,
allowedAriaAttrs: []
},
math: {
contentTypes: [ 'embedded', 'phrasing', 'flow' ],
allowedRoles: false
},
mark: {
contentTypes: [ 'phrasing', 'flow' ],
allowedRoles: true,
namingProhibited: true
},
menu: {
contentTypes: [ 'flow' ],
allowedRoles: [ 'directory', 'group', 'listbox', 'menu', 'menubar', 'none', 'presentation', 'radiogroup', 'tablist', 'toolbar', 'tree' ]
},
meta: {
variant: {
itemprop: {
matches: '[itemprop]',
contentTypes: [ 'phrasing', 'flow' ]
}
},
allowedRoles: false,
allowedAriaAttrs: []
},
meter: {
contentTypes: [ 'phrasing', 'flow' ],
allowedRoles: false,
chromiumRole: 'progressbar'
},
nav: {
contentTypes: [ 'sectioning', 'flow' ],
allowedRoles: [ 'doc-index', 'doc-pagelist', 'doc-toc', 'menu', 'menubar', 'none', 'presentation', 'tablist' ],
shadowRoot: true
},
noscript: {
contentTypes: [ 'phrasing', 'flow' ],
allowedRoles: false,
allowedAriaAttrs: []
},
object: {
variant: {
usemap: {
matches: '[usemap]',
contentTypes: [ 'interactive', 'embedded', 'phrasing', 'flow' ]
},
default: {
contentTypes: [ 'embedded', 'phrasing', 'flow' ]
}
},
allowedRoles: [ 'application', 'document', 'img', 'image' ],
chromiumRole: 'PluginObject'
},
ol: {
contentTypes: [ 'flow' ],
allowedRoles: [ 'directory', 'group', 'listbox', 'menu', 'menubar', 'none', 'presentation', 'radiogroup', 'tablist', 'toolbar', 'tree' ]
},
optgroup: {
allowedRoles: false
},
option: {
allowedRoles: false,
implicitAttrs: {
'aria-selected': 'false'
}
},
output: {
contentTypes: [ 'phrasing', 'flow' ],
allowedRoles: true,
namingMethods: [ 'subtreeText' ]
},
p: {
contentTypes: [ 'flow' ],
allowedRoles: true,
shadowRoot: true,
namingProhibited: true
},
param: {
allowedRoles: false,
allowedAriaAttrs: []
},
picture: {
contentTypes: [ 'phrasing', 'flow' ],
allowedRoles: false,
allowedAriaAttrs: [ 'aria-hidden' ]
},
pre: {
contentTypes: [ 'flow' ],
allowedRoles: true,
namingProhibited: true
},
progress: {
contentTypes: [ 'phrasing', 'flow' ],
allowedRoles: false,
implicitAttrs: {
'aria-valuemax': '100',
'aria-valuemin': '0',
'aria-valuenow': '0'
}
},
q: {
contentTypes: [ 'phrasing', 'flow' ],
allowedRoles: true,
namingProhibited: true
},
rp: {
allowedRoles: true,
namingProhibited: true
},
rt: {
allowedRoles: true,
namingProhibited: true
},
ruby: {
contentTypes: [ 'phrasing', 'flow' ],
allowedRoles: true
},
s: {
contentTypes: [ 'phrasing', 'flow' ],
allowedRoles: true,
namingProhibited: true
},
samp: {
contentTypes: [ 'phrasing', 'flow' ],
allowedRoles: true,
namingProhibited: true
},
script: {
contentTypes: [ 'phrasing', 'flow' ],
allowedRoles: false,
allowedAriaAttrs: []
},
search: {
contentTypes: [ 'flow' ],
allowedRoles: [ 'form', 'group', 'none', 'presentation', 'region', 'search' ]
},
section: {
contentTypes: [ 'sectioning', 'flow' ],
allowedRoles: [ 'alert', 'alertdialog', 'application', 'banner', 'complementary', 'contentinfo', 'dialog', 'document', 'feed', 'group', 'log', 'main', 'marquee', 'navigation', 'none', 'note', 'presentation', 'search', 'status', 'tabpanel', 'doc-abstract', 'doc-acknowledgments', 'doc-afterword', 'doc-appendix', 'doc-bibliography', 'doc-chapter', 'doc-colophon', 'doc-conclusion', 'doc-credit', 'doc-credits', 'doc-dedication', 'doc-endnotes', 'doc-epigraph', 'doc-epilogue', 'doc-errata', 'doc-example', 'doc-foreword', 'doc-glossary', 'doc-index', 'doc-introduction', 'doc-notice', 'doc-pagelist', 'doc-part', 'doc-preface', 'doc-prologue', 'doc-pullquote', 'doc-qna', 'doc-toc' ],
shadowRoot: true
},
select: {
variant: {
combobox: {
matches: {
attributes: {
multiple: null,
size: [ null, '1' ]
}
},
allowedRoles: [ 'menu' ]
},
default: {
allowedRoles: false
}
},
contentTypes: [ 'interactive', 'phrasing', 'flow' ],
implicitAttrs: {
'aria-valuenow': ''
},
namingMethods: [ 'labelText' ]
},
slot: {
contentTypes: [ 'phrasing', 'flow' ],
allowedRoles: false,
allowedAriaAttrs: []
},
small: {
contentTypes: [ 'phrasing', 'flow' ],
allowedRoles: true,
namingProhibited: true
},
source: {
allowedRoles: false,
allowedAriaAttrs: []
},
span: {
contentTypes: [ 'phrasing', 'flow' ],
allowedRoles: true,
shadowRoot: true,
namingProhibited: true
},
strong: {
contentTypes: [ 'phrasing', 'flow' ],
allowedRoles: true,
namingProhibited: true
},
style: {
allowedRoles: false,
allowedAriaAttrs: []
},
svg: {
contentTypes: [ 'embedded', 'phrasing', 'flow' ],
allowedRoles: true,
chromiumRole: 'SVGRoot',
namingMethods: [ 'svgTitleText' ]
},
sub: {
contentTypes: [ 'phrasing', 'flow' ],
allowedRoles: true,
namingProhibited: true
},
summary: {
variant: {
summaryForDetails: {
matches: {
isSummaryForDetails: true
},
allowedRoles: false
},
default: {
allowedRoles: true
}
},
namingMethods: [ 'subtreeText' ]
},
sup: {
contentTypes: [ 'phrasing', 'flow' ],
allowedRoles: true,
namingProhibited: true
},
table: {
contentTypes: [ 'flow' ],
allowedRoles: true,
namingMethods: [ 'tableCaptionText', 'tableSummaryText' ]
},
tbody: {
allowedRoles: true
},
template: {
contentTypes: [ 'phrasing', 'flow' ],
allowedRoles: false,
allowedAriaAttrs: []
},
textarea: {
contentTypes: [ 'interactive', 'phrasing', 'flow' ],
allowedRoles: false,
implicitAttrs: {
'aria-valuenow': '',
'aria-multiline': 'true'
},
namingMethods: [ 'labelText', 'placeholderText' ]
},
tfoot: {
allowedRoles: true
},
thead: {
allowedRoles: true
},
time: {
contentTypes: [ 'phrasing', 'flow' ],
allowedRoles: true,
namingProhibited: true
},
title: {
allowedRoles: false,
allowedAriaAttrs: []
},
td: {
allowedRoles: true
},
th: {
allowedRoles: true
},
tr: {
allowedRoles: true
},
track: {
allowedRoles: false,
allowedAriaAttrs: []
},
u: {
contentTypes: [ 'phrasing', 'flow' ],
allowedRoles: true,
namingProhibited: true
},
ul: {
contentTypes: [ 'flow' ],
allowedRoles: [ 'directory', 'group', 'listbox', 'menu', 'menubar', 'none', 'presentation', 'radiogroup', 'tablist', 'toolbar', 'tree' ]
},
var: {
contentTypes: [ 'phrasing', 'flow' ],
allowedRoles: true,
namingProhibited: true
},
video: {
variant: {
controls: {
matches: '[controls]',
contentTypes: [ 'interactive', 'embedded', 'phrasing', 'flow' ]
},
default: {
contentTypes: [ 'embedded', 'phrasing', 'flow' ]
}
},
allowedRoles: [ 'application' ],
chromiumRole: 'video'
},
wbr: {
contentTypes: [ 'phrasing', 'flow' ],
allowedRoles: [ 'presentation', 'none' ],
allowedAriaAttrs: [ 'aria-hidden' ]
}
};
var html_elms_default = htmlElms;
var cssColors = {
aliceblue: [ 240, 248, 255 ],
antiquewhite: [ 250, 235, 215 ],
aqua: [ 0, 255, 255 ],
aquamarine: [ 127, 255, 212 ],
azure: [ 240, 255, 255 ],
beige: [ 245, 245, 220 ],
bisque: [ 255, 228, 196 ],
black: [ 0, 0, 0 ],
blanchedalmond: [ 255, 235, 205 ],
blue: [ 0, 0, 255 ],
blueviolet: [ 138, 43, 226 ],
brown: [ 165, 42, 42 ],
burlywood: [ 222, 184, 135 ],
cadetblue: [ 95, 158, 160 ],
chartreuse: [ 127, 255, 0 ],
chocolate: [ 210, 105, 30 ],
coral: [ 255, 127, 80 ],
cornflowerblue: [ 100, 149, 237 ],
cornsilk: [ 255, 248, 220 ],
crimson: [ 220, 20, 60 ],
cyan: [ 0, 255, 255 ],
darkblue: [ 0, 0, 139 ],
darkcyan: [ 0, 139, 139 ],
darkgoldenrod: [ 184, 134, 11 ],
darkgray: [ 169, 169, 169 ],
darkgreen: [ 0, 100, 0 ],
darkgrey: [ 169, 169, 169 ],
darkkhaki: [ 189, 183, 107 ],
darkmagenta: [ 139, 0, 139 ],
darkolivegreen: [ 85, 107, 47 ],
darkorange: [ 255, 140, 0 ],
darkorchid: [ 153, 50, 204 ],
darkred: [ 139, 0, 0 ],
darksalmon: [ 233, 150, 122 ],
darkseagreen: [ 143, 188, 143 ],
darkslateblue: [ 72, 61, 139 ],
darkslategray: [ 47, 79, 79 ],
darkslategrey: [ 47, 79, 79 ],
darkturquoise: [ 0, 206, 209 ],
darkviolet: [ 148, 0, 211 ],
deeppink: [ 255, 20, 147 ],
deepskyblue: [ 0, 191, 255 ],
dimgray: [ 105, 105, 105 ],
dimgrey: [ 105, 105, 105 ],
dodgerblue: [ 30, 144, 255 ],
firebrick: [ 178, 34, 34 ],
floralwhite: [ 255, 250, 240 ],
forestgreen: [ 34, 139, 34 ],
fuchsia: [ 255, 0, 255 ],
gainsboro: [ 220, 220, 220 ],
ghostwhite: [ 248, 248, 255 ],
gold: [ 255, 215, 0 ],
goldenrod: [ 218, 165, 32 ],
gray: [ 128, 128, 128 ],
green: [ 0, 128, 0 ],
greenyellow: [ 173, 255, 47 ],
grey: [ 128, 128, 128 ],
honeydew: [ 240, 255, 240 ],
hotpink: [ 255, 105, 180 ],
indianred: [ 205, 92, 92 ],
indigo: [ 75, 0, 130 ],
ivory: [ 255, 255, 240 ],
khaki: [ 240, 230, 140 ],
lavender: [ 230, 230, 250 ],
lavenderblush: [ 255, 240, 245 ],
lawngreen: [ 124, 252, 0 ],
lemonchiffon: [ 255, 250, 205 ],
lightblue: [ 173, 216, 230 ],
lightcoral: [ 240, 128, 128 ],
lightcyan: [ 224, 255, 255 ],
lightgoldenrodyellow: [ 250, 250, 210 ],
lightgray: [ 211, 211, 211 ],
lightgreen: [ 144, 238, 144 ],
lightgrey: [ 211, 211, 211 ],
lightpink: [ 255, 182, 193 ],
lightsalmon: [ 255, 160, 122 ],
lightseagreen: [ 32, 178, 170 ],
lightskyblue: [ 135, 206, 250 ],
lightslategray: [ 119, 136, 153 ],
lightslategrey: [ 119, 136, 153 ],
lightsteelblue: [ 176, 196, 222 ],
lightyellow: [ 255, 255, 224 ],
lime: [ 0, 255, 0 ],
limegreen: [ 50, 205, 50 ],
linen: [ 250, 240, 230 ],
magenta: [ 255, 0, 255 ],
maroon: [ 128, 0, 0 ],
mediumaquamarine: [ 102, 205, 170 ],
mediumblue: [ 0, 0, 205 ],
mediumorchid: [ 186, 85, 211 ],
mediumpurple: [ 147, 112, 219 ],
mediumseagreen: [ 60, 179, 113 ],
mediumslateblue: [ 123, 104, 238 ],
mediumspringgreen: [ 0, 250, 154 ],
mediumturquoise: [ 72, 209, 204 ],
mediumvioletred: [ 199, 21, 133 ],
midnightblue: [ 25, 25, 112 ],
mintcream: [ 245, 255, 250 ],
mistyrose: [ 255, 228, 225 ],
moccasin: [ 255, 228, 181 ],
navajowhite: [ 255, 222, 173 ],
navy: [ 0, 0, 128 ],
oldlace: [ 253, 245, 230 ],
olive: [ 128, 128, 0 ],
olivedrab: [ 107, 142, 35 ],
orange: [ 255, 165, 0 ],
orangered: [ 255, 69, 0 ],
orchid: [ 218, 112, 214 ],
palegoldenrod: [ 238, 232, 170 ],
palegreen: [ 152, 251, 152 ],
paleturquoise: [ 175, 238, 238 ],
palevioletred: [ 219, 112, 147 ],
papayawhip: [ 255, 239, 213 ],
peachpuff: [ 255, 218, 185 ],
peru: [ 205, 133, 63 ],
pink: [ 255, 192, 203 ],
plum: [ 221, 160, 221 ],
powderblue: [ 176, 224, 230 ],
purple: [ 128, 0, 128 ],
rebeccapurple: [ 102, 51, 153 ],
red: [ 255, 0, 0 ],
rosybrown: [ 188, 143, 143 ],
royalblue: [ 65, 105, 225 ],
saddlebrown: [ 139, 69, 19 ],
salmon: [ 250, 128, 114 ],
sandybrown: [ 244, 164, 96 ],
seagreen: [ 46, 139, 87 ],
seashell: [ 255, 245, 238 ],
sienna: [ 160, 82, 45 ],
silver: [ 192, 192, 192 ],
skyblue: [ 135, 206, 235 ],
slateblue: [ 106, 90, 205 ],
slategray: [ 112, 128, 144 ],
slategrey: [ 112, 128, 144 ],
snow: [ 255, 250, 250 ],
springgreen: [ 0, 255, 127 ],
steelblue: [ 70, 130, 180 ],
tan: [ 210, 180, 140 ],
teal: [ 0, 128, 128 ],
thistle: [ 216, 191, 216 ],
tomato: [ 255, 99, 71 ],
turquoise: [ 64, 224, 208 ],
violet: [ 238, 130, 238 ],
wheat: [ 245, 222, 179 ],
white: [ 255, 255, 255 ],
whitesmoke: [ 245, 245, 245 ],
yellow: [ 255, 255, 0 ],
yellowgreen: [ 154, 205, 50 ]
};
var css_colors_default = cssColors;
var originals = {
ariaAttrs: aria_attrs_default,
ariaRoles: _extends({}, aria_roles_default, dpub_roles_default, graphics_roles_default),
htmlElms: html_elms_default,
cssColors: css_colors_default
};
var standards = _extends({}, originals);
function configureStandards(config) {
Object.keys(standards).forEach(function(propName) {
if (config[propName]) {
standards[propName] = deep_merge_default(standards[propName], config[propName]);
}
});
}
function resetStandards() {
Object.keys(standards).forEach(function(propName) {
standards[propName] = originals[propName];
});
}
var standards_default = standards;
var idrefTypes = [ 'idref', 'idrefs' ];
var sources = [ {
source: 'attribute',
getValue: getAttributeValue
}, {
source: 'property',
getValue: getPropertyValue
}, {
source: 'internals',
getValue: getInternalValue
} ];
function _getAriaValue(node, attrName) {
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
var attrStandard = standards_default.ariaAttrs[attrName];
if (!attrStandard) {
return {
value: null,
source: null
};
}
var type2 = attrStandard.type;
var _nodeLookup2 = _nodeLookup(node), vNode = _nodeLookup2.vNode;
var lowercase = options.lowercase;
var _iterator10 = _createForOfIteratorHelper(sources), _step10;
try {
for (_iterator10.s(); !(_step10 = _iterator10.n()).done; ) {
var _step10$value = _step10.value, source = _step10$value.source, getValue = _step10$value.getValue;
var value = getValue(vNode, attrStandard, attrName);
if (value === null || value === void 0) {
continue;
}
if (typeof value === 'string') {
if (type2 !== 'string') {
value = value.trim();
}
value = lowercase || attrStandard.caseInsensitive ? value.toLowerCase() : value;
} else if (value instanceof window.Node) {
value = value.nodeName;
} else {
value = '[' + Array.from(value).map(function(n3) {
return n3.nodeName;
}).join(',') + ']';
}
return {
value: value,
source: source
};
}
} catch (err) {
_iterator10.e(err);
} finally {
_iterator10.f();
}
return {
value: null,
source: null
};
}
function getAttributeValue(vNode, attrStandard, attrName) {
var type2 = attrStandard.type;
var value = vNode.attr(attrName);
if (!idrefTypes.includes(type2)) {
return value;
}
if (!!value) {
return value;
}
var propValue = getPropertyValue(vNode, attrStandard);
var propEmpty = Array.isArray(propValue) ? propValue.length : !!propValue;
return propEmpty ? null : value;
}
function getPropertyValue(vNode, attrStandard) {
var prop = attrStandard.prop;
return prop && vNode.actualNode ? vNode.actualNode[prop] : null;
}
function getInternalValue(vNode, attrStandard) {
var prop = attrStandard.prop;
return prop && vNode.elementInternals ? vNode.elementInternals[prop] : null;
}
var clipRegex = /rect\s*\(([0-9]+)px,?\s*([0-9]+)px,?\s*([0-9]+)px,?\s*([0-9]+)px\s*\)/;
var clipPathRegex = /(\w+)\((\d+)/;
function nativelyHidden(vNode) {
return [ 'style', 'script', 'noscript', 'template' ].includes(vNode.props.nodeName);
}
function displayHidden(vNode) {
if (vNode.props.nodeName === 'area') {
return false;
}
return vNode.getComputedStylePropertyValue('display') === 'none';
}
function visibilityHidden(vNode) {
var _ref58 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, isAncestor = _ref58.isAncestor;
return !isAncestor && [ 'hidden', 'collapse' ].includes(vNode.getComputedStylePropertyValue('visibility'));
}
function contentVisibiltyHidden(vNode) {
var _ref59 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, isAncestor = _ref59.isAncestor;
return !!isAncestor && vNode.getComputedStylePropertyValue('content-visibility') === 'hidden';
}
function ariaHidden(vNode) {
return _getAriaValue(vNode, 'aria-hidden').value === 'true';
}
function opacityHidden(vNode) {
return vNode.getComputedStylePropertyValue('opacity') === '0';
}
function scrollHidden(vNode) {
var scroll = _getScroll(vNode.actualNode);
var elHeight = parseInt(vNode.getComputedStylePropertyValue('height'));
var elWidth = parseInt(vNode.getComputedStylePropertyValue('width'));
return !!scroll && (elHeight === 0 || elWidth === 0);
}
function overflowHidden(vNode) {
var _ref60 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, isAncestor = _ref60.isAncestor;
if (isAncestor) {
return false;
}
var position = vNode.getComputedStylePropertyValue('position');
if (position === 'fixed') {
return false;
}
var nodes = get_overflow_hidden_ancestors_default(vNode);
if (!nodes.length) {
return false;
}
var rect = vNode.boundingClientRect;
return nodes.some(function(node) {
if (position === 'absolute' && !hasPositionedAncestorBetween(vNode, node) && node.getComputedStylePropertyValue('position') === 'static') {
return false;
}
var nodeRect = node.boundingClientRect;
if (nodeRect.width < 2 || nodeRect.height < 2) {
return true;
}
return !_rectsOverlap(rect, nodeRect);
});
}
function clipHidden(vNode) {
var matchesClip = vNode.getComputedStylePropertyValue('clip').match(clipRegex);
var matchesClipPath = vNode.getComputedStylePropertyValue('clip-path').match(clipPathRegex);
if (matchesClip && matchesClip.length === 5) {
var position = vNode.getComputedStylePropertyValue('position');
if ([ 'fixed', 'absolute' ].includes(position)) {
return matchesClip[3] - matchesClip[1] <= 0 && matchesClip[2] - matchesClip[4] <= 0;
}
}
if (matchesClipPath) {
var type2 = matchesClipPath[1];
var value = parseInt(matchesClipPath[2], 10);
switch (type2) {
case 'inset':
return value >= 50;
case 'circle':
return value === 0;
default:
}
}
return false;
}
function areaHidden(vNode, visibleFunction) {
var mapEl = closest_default(vNode, 'map');
if (!mapEl) {
return true;
}
var mapElName = mapEl.attr('name');
if (!mapElName) {
return true;
}
var mapElRootNode = get_root_node_default(vNode.actualNode);
if (!mapElRootNode || mapElRootNode.nodeType !== 9) {
return true;
}
var refs = query_selector_all_default(axe._tree, 'img[usemap="#'.concat(escape_selector_default(mapElName), '"]'));
if (!refs || !refs.length) {
return true;
}
return refs.some(function(ref) {
return !visibleFunction(ref);
});
}
function detailsHidden(vNode) {
var _vNode$parent;
if (((_vNode$parent = vNode.parent) === null || _vNode$parent === void 0 ? void 0 : _vNode$parent.props.nodeName) !== 'details') {
return false;
}
if (vNode.props.nodeName === 'summary') {
var firstSummary = vNode.parent.children.find(function(node) {
return node.props.nodeName === 'summary';
});
if (firstSummary === vNode) {
return false;
}
}
return !vNode.parent.hasAttr('open');
}
function hasPositionedAncestorBetween(child, ancestor) {
var node = child.parent;
while (node && node !== ancestor) {
if ([ 'relative', 'sticky' ].includes(node.getComputedStylePropertyValue('position'))) {
return true;
}
node = node.parent;
}
return false;
}
var hiddenMethods = [ displayHidden, visibilityHidden, contentVisibiltyHidden, detailsHidden ];
function _isHiddenForEveryone(vNode) {
var _ref61 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, skipAncestors = _ref61.skipAncestors, _ref61$isAncestor = _ref61.isAncestor, isAncestor = _ref61$isAncestor === void 0 ? false : _ref61$isAncestor;
vNode = _nodeLookup(vNode).vNode;
if (skipAncestors) {
return isHiddenSelf(vNode, isAncestor);
}
return isHiddenAncestors(vNode, isAncestor);
}
var isHiddenSelf = memoize_default(function isHiddenSelfMemoized(vNode, isAncestor) {
if (nativelyHidden(vNode)) {
return true;
}
if (!vNode.actualNode) {
return false;
}
if (hiddenMethods.some(function(method) {
return method(vNode, {
isAncestor: isAncestor
});
})) {
return true;
}
if (!vNode.actualNode.isConnected) {
return true;
}
return false;
}, {
primitive: true
});
var isHiddenAncestors = memoize_default(function isHiddenAncestorsMemoized(vNode, isAncestor) {
if (isHiddenSelf(vNode, isAncestor)) {
return true;
}
if (!vNode.parent) {
return false;
}
return isHiddenAncestors(vNode.parent, true);
}, {
primitive: true
});
function getComposedParent(element) {
if (element.assignedSlot) {
return getComposedParent(element.assignedSlot);
} else if (element.parentNode) {
var parentNode = element.parentNode;
if (parentNode.nodeType === 1) {
return parentNode;
} else if (parentNode.host) {
return parentNode.host;
}
}
return null;
}
var get_composed_parent_default = getComposedParent;
function getScrollOffset(element) {
if (!element.nodeType && element.document) {
element = element.document;
}
if (element.nodeType === 9) {
var docElement = element.documentElement, body = element.body;
return {
left: docElement && docElement.scrollLeft || body && body.scrollLeft || 0,
top: docElement && docElement.scrollTop || body && body.scrollTop || 0
};
}
return {
left: element.scrollLeft,
top: element.scrollTop
};
}
var get_scroll_offset_default = getScrollOffset;
function getElementCoordinates(element) {
var scrollOffset = get_scroll_offset_default(document), xOffset = scrollOffset.left, yOffset = scrollOffset.top, coords = element.getBoundingClientRect();
return {
top: coords.top + yOffset,
right: coords.right + xOffset,
bottom: coords.bottom + yOffset,
left: coords.left + xOffset,
width: coords.right - coords.left,
height: coords.bottom - coords.top
};
}
var get_element_coordinates_default = getElementCoordinates;
function getViewportSize(win) {
var doc = win.document;
var docElement = doc.documentElement;
if (win.innerWidth) {
return {
width: win.innerWidth,
height: win.innerHeight
};
}
if (docElement) {
return {
width: docElement.clientWidth,
height: docElement.clientHeight
};
}
var body = doc.body;
return {
width: body.clientWidth,
height: body.clientHeight
};
}
var get_viewport_size_default = getViewportSize;
function _isFixedPosition(node) {
var _ref62 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, skipAncestors = _ref62.skipAncestors;
var _nodeLookup3 = _nodeLookup(node), vNode = _nodeLookup3.vNode;
if (!vNode) {
return false;
}
if (skipAncestors) {
return isFixedSelf(vNode);
}
return isFixedAncestors(vNode);
}
var isFixedSelf = memoize_default(function isFixedSelfMemoized(vNode) {
return vNode.getComputedStylePropertyValue('position') === 'fixed';
}, {
primitive: true
});
var isFixedAncestors = memoize_default(function isFixedAncestorsMemoized(vNode) {
if (isFixedSelf(vNode)) {
return true;
}
if (!vNode.parent) {
return false;
}
return isFixedAncestors(vNode.parent);
}, {
primitive: true
});
function noParentScrolled(element, offset) {
element = get_composed_parent_default(element);
while (element && element.nodeName.toLowerCase() !== 'html') {
if (element.scrollTop) {
offset += element.scrollTop;
if (offset >= 0) {
return false;
}
}
element = get_composed_parent_default(element);
}
return true;
}
function isOffscreen(element) {
var _ref63 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, isAncestor = _ref63.isAncestor;
if (isAncestor) {
return false;
}
var _nodeLookup4 = _nodeLookup(element), domNode = _nodeLookup4.domNode;
if (!domNode) {
return void 0;
}
var docElement = document.documentElement;
var styl = window.getComputedStyle(domNode);
var dir = window.getComputedStyle(document.body || docElement).getPropertyValue('direction');
var isFixed = _isFixedPosition(domNode);
var coords = isFixed ? domNode.getBoundingClientRect() : get_element_coordinates_default(domNode);
if (coords.top === 0 && coords.bottom === 0) {
return false;
}
if (coords.left === 0 && coords.right === 0) {
return false;
}
if (coords.bottom <= 0 && (noParentScrolled(domNode, coords.bottom) || styl.position === 'absolute')) {
return true;
}
var viewportSize = get_viewport_size_default(window);
if (isFixed && coords.top >= viewportSize.height) {
return true;
}
var rightEdge = Math.max(docElement.scrollWidth, viewportSize.width);
if ((isFixed || dir === 'rtl') && coords.left >= rightEdge) {
return true;
}
if ((isFixed || dir === 'ltr') && coords.right <= 0) {
return true;
}
return false;
}
var is_offscreen_default = isOffscreen;
var hiddenMethods2 = [ opacityHidden, scrollHidden, overflowHidden, clipHidden, is_offscreen_default ];
function _isVisibleOnScreen(vNode) {
vNode = _nodeLookup(vNode).vNode;
return isVisibleOnScreenVirtual(vNode);
}
var isVisibleOnScreenVirtual = memoize_default(function isVisibleOnScreenMemoized(vNode, isAncestor) {
if (vNode.actualNode && vNode.props.nodeName === 'area') {
return !areaHidden(vNode, isVisibleOnScreenVirtual);
}
if (_isHiddenForEveryone(vNode, {
skipAncestors: true,
isAncestor: isAncestor
})) {
return false;
}
if (vNode.actualNode && hiddenMethods2.some(function(method) {
return method(vNode, {
isAncestor: isAncestor
});
})) {
return false;
}
if (!vNode.parent) {
return true;
}
return isVisibleOnScreenVirtual(vNode.parent, true);
}, {
primitive: true
});
function _getBoundingRect(rectA, rectB) {
var top = Math.min(rectA.top, rectB.top);
var right = Math.max(rectA.right, rectB.right);
var bottom = Math.max(rectA.bottom, rectB.bottom);
var left = Math.min(rectA.left, rectB.left);
return new window.DOMRect(left, top, right - left, bottom - top);
}
function _isPointInRect(_ref64, _ref65) {
var x = _ref64.x, y = _ref64.y;
var top = _ref65.top, right = _ref65.right, bottom = _ref65.bottom, left = _ref65.left;
return y >= top && x <= right && y <= bottom && x >= left;
}
var math_exports = {};
__export(math_exports, {
getBoundingRect: function getBoundingRect() {
return _getBoundingRect;
},
getIntersectionRect: function getIntersectionRect() {
return _getIntersectionRect;
},
getOffset: function getOffset() {
return _getOffset;
},
getRectCenter: function getRectCenter() {
return _getRectCenter;
},
hasVisualOverlap: function hasVisualOverlap() {
return _hasVisualOverlap;
},
isPointInRect: function isPointInRect() {
return _isPointInRect;
},
rectHasMinimumSize: function rectHasMinimumSize() {
return _rectHasMinimumSize;
},
rectsOverlap: function rectsOverlap() {
return _rectsOverlap;
},
splitRects: function splitRects() {
return _splitRects;
}
});
function _getIntersectionRect(rect1, rect2) {
var leftX = Math.max(rect1.left, rect2.left);
var rightX = Math.min(rect1.right, rect2.right);
var topY = Math.max(rect1.top, rect2.top);
var bottomY = Math.min(rect1.bottom, rect2.bottom);
if (leftX >= rightX || topY >= bottomY) {
return null;
}
return new window.DOMRect(leftX, topY, rightX - leftX, bottomY - topY);
}
function _getRectCenter(_ref66) {
var left = _ref66.left, top = _ref66.top, width = _ref66.width, height = _ref66.height;
return new window.DOMPoint(left + width / 2, top + height / 2);
}
var roundingMargin = .05;
function _rectHasMinimumSize(minSize, _ref67) {
var width = _ref67.width, height = _ref67.height;
return width + roundingMargin >= minSize && height + roundingMargin >= minSize;
}
function _getOffset(vTarget, vNeighbor) {
var minRadiusNeighbour = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 12;
var targetRects = get_target_rects_default(vTarget);
var neighborRects = get_target_rects_default(vNeighbor);
if (!targetRects.length || !neighborRects.length) {
return null;
}
return targetRects.reduce(function(minDistance, targetRect) {
var targetCenter = _getRectCenter(targetRect);
var _iterator11 = _createForOfIteratorHelper(neighborRects), _step11;
try {
for (_iterator11.s(); !(_step11 = _iterator11.n()).done; ) {
var rect = _step11.value;
if (_isPointInRect(targetCenter, rect)) {
return 0;
}
var closestPoint = getClosestPoint(targetCenter, rect);
var distance2 = pointDistance(targetCenter, closestPoint);
minDistance = Math.min(minDistance, distance2);
}
} catch (err) {
_iterator11.e(err);
} finally {
_iterator11.f();
}
var neighborTargetSize = get_target_size_default(vNeighbor);
if (_rectHasMinimumSize(minRadiusNeighbour * 2, neighborTargetSize)) {
return minDistance;
}
var neighborBoundingBox = neighborRects.reduce(_getBoundingRect);
var neighborCenter = _getRectCenter(neighborBoundingBox);
var centerDistance = pointDistance(targetCenter, neighborCenter) - minRadiusNeighbour;
return Math.max(0, Math.min(minDistance, centerDistance));
}, Infinity);
}
function getClosestPoint(point, rect) {
var x;
var y;
if (point.x < rect.left) {
x = rect.left;
} else if (point.x > rect.right) {
x = rect.right;
} else {
x = point.x;
}
if (point.y < rect.top) {
y = rect.top;
} else if (point.y > rect.bottom) {
y = rect.bottom;
} else {
y = point.y;
}
return {
x: x,
y: y
};
}
function pointDistance(pointA, pointB) {
return Math.hypot(pointA.x - pointB.x, pointA.y - pointB.y);
}
function _hasVisualOverlap(vNodeA, vNodeB) {
var rectA = vNodeA.boundingClientRect;
var rectB = vNodeB.boundingClientRect;
if (rectA.left >= rectB.right || rectA.right <= rectB.left || rectA.top >= rectB.bottom || rectA.bottom <= rectB.top) {
return false;
}
return _visuallySort(vNodeA, vNodeB) > 0;
}
function _splitRects(outerRect, overlapRects) {
var uniqueRects = Array.isArray(outerRect) ? outerRect : [ outerRect ];
var _iterator12 = _createForOfIteratorHelper(overlapRects), _step12;
try {
var _loop4 = function _loop4() {
var overlapRect = _step12.value;
uniqueRects = uniqueRects.reduce(function(rects, inputRect) {
return rects.concat(splitRect(inputRect, overlapRect));
}, []);
if (uniqueRects.length > 4e3) {
throw new Error('splitRects: Too many rects');
}
};
for (_iterator12.s(); !(_step12 = _iterator12.n()).done; ) {
_loop4();
}
} catch (err) {
_iterator12.e(err);
} finally {
_iterator12.f();
}
return uniqueRects;
}
function splitRect(inputRect, clipRect) {
var top = inputRect.top, left = inputRect.left, bottom = inputRect.bottom, right = inputRect.right;
var yAligned = top < clipRect.bottom && bottom > clipRect.top;
var xAligned = left < clipRect.right && right > clipRect.left;
var rects = [];
if (between(clipRect.top, top, bottom) && xAligned) {
rects.push({
top: top,
left: left,
bottom: clipRect.top,
right: right
});
}
if (between(clipRect.right, left, right) && yAligned) {
rects.push({
top: top,
left: clipRect.right,
bottom: bottom,
right: right
});
}
if (between(clipRect.bottom, top, bottom) && xAligned) {
rects.push({
top: clipRect.bottom,
right: right,
bottom: bottom,
left: left
});
}
if (between(clipRect.left, left, right) && yAligned) {
rects.push({
top: top,
left: left,
bottom: bottom,
right: clipRect.left
});
}
if (rects.length === 0) {
if (isEnclosedRect(inputRect, clipRect)) {
return [];
}
rects.push(inputRect);
}
return rects.map(computeRect);
}
var between = function between(num, min, max2) {
return num > min && num < max2;
};
function computeRect(baseRect) {
return new window.DOMRect(baseRect.left, baseRect.top, baseRect.right - baseRect.left, baseRect.bottom - baseRect.top);
}
function isEnclosedRect(rectA, rectB) {
return rectA.top >= rectB.top && rectA.left >= rectB.left && rectA.bottom <= rectB.bottom && rectA.right <= rectB.right;
}
var ROOT_LEVEL = 0;
var FLOAT_LEVEL = .1;
var DEFAULT_LEVEL = .2;
var nodeIndex = 0;
function _createGrid() {
var root = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : document.body;
var rootGrid = arguments.length > 1 ? arguments[1] : undefined;
var parentVNode = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
if (cache_default.get('gridCreated') && !parentVNode) {
return constants_default.gridSize;
}
cache_default.set('gridCreated', true);
if (!parentVNode) {
var vNode = get_node_from_tree_default(document.documentElement);
if (!vNode) {
vNode = new virtual_node_default(document.documentElement);
}
nodeIndex = 0;
vNode._stackingOrder = [ createStackingContext(ROOT_LEVEL, true, nodeIndex++, null) ];
rootGrid !== null && rootGrid !== void 0 ? rootGrid : rootGrid = new Grid();
addNodeToGrid(rootGrid, vNode);
if (_getScroll(vNode.actualNode)) {
var subGrid = new Grid(vNode);
vNode._subGrid = subGrid;
}
}
var treeWalker = document.createTreeWalker(root, window.NodeFilter.SHOW_ELEMENT, null, false);
var node = parentVNode ? treeWalker.nextNode() : treeWalker.currentNode;
while (node) {
var _vNode = get_node_from_tree_default(node);
if (_vNode && _vNode.parent) {
parentVNode = _vNode.parent;
} else if (node.assignedSlot) {
parentVNode = get_node_from_tree_default(node.assignedSlot);
} else if (node.parentElement) {
parentVNode = get_node_from_tree_default(node.parentElement);
} else if (node.parentNode && get_node_from_tree_default(node.parentNode)) {
parentVNode = get_node_from_tree_default(node.parentNode);
}
if (!_vNode) {
_vNode = new axe.VirtualNode(node, parentVNode);
}
_vNode._stackingOrder = createStackingOrder(_vNode, parentVNode, nodeIndex++);
var scrollRegionParent = findScrollRegionParent(parentVNode);
var grid = scrollRegionParent ? scrollRegionParent._subGrid : rootGrid;
if (_getScroll(_vNode.actualNode)) {
var _subGrid = new Grid(_vNode);
_vNode._subGrid = _subGrid;
}
var rect = _vNode.boundingClientRect;
if (rect.width !== 0 && rect.height !== 0 && _isVisibleOnScreen(node)) {
addNodeToGrid(grid, _vNode);
}
if (is_shadow_root_default(node)) {
_createGrid(node.shadowRoot, grid, _vNode);
}
node = treeWalker.nextNode();
}
return constants_default.gridSize;
}
function isStackingContext(vNode, parentVNode) {
var position = vNode.getComputedStylePropertyValue('position');
var zIndex = vNode.getComputedStylePropertyValue('z-index');
if (position === 'fixed' || position === 'sticky') {
return true;
}
if (zIndex !== 'auto' && position !== 'static') {
return true;
}
if (vNode.getComputedStylePropertyValue('opacity') !== '1') {
return true;
}
var transform = vNode.getComputedStylePropertyValue('-webkit-transform') || vNode.getComputedStylePropertyValue('-ms-transform') || vNode.getComputedStylePropertyValue('transform') || 'none';
if (transform !== 'none') {
return true;
}
var mixBlendMode = vNode.getComputedStylePropertyValue('mix-blend-mode');
if (mixBlendMode && mixBlendMode !== 'normal') {
return true;
}
var filter = vNode.getComputedStylePropertyValue('filter');
if (filter && filter !== 'none') {
return true;
}
var perspective = vNode.getComputedStylePropertyValue('perspective');
if (perspective && perspective !== 'none') {
return true;
}
var clipPath = vNode.getComputedStylePropertyValue('clip-path');
if (clipPath && clipPath !== 'none') {
return true;
}
var mask = vNode.getComputedStylePropertyValue('-webkit-mask') || vNode.getComputedStylePropertyValue('mask') || 'none';
if (mask !== 'none') {
return true;
}
var maskImage = vNode.getComputedStylePropertyValue('-webkit-mask-image') || vNode.getComputedStylePropertyValue('mask-image') || 'none';
if (maskImage !== 'none') {
return true;
}
var maskBorder = vNode.getComputedStylePropertyValue('-webkit-mask-border') || vNode.getComputedStylePropertyValue('mask-border') || 'none';
if (maskBorder !== 'none') {
return true;
}
if (vNode.getComputedStylePropertyValue('isolation') === 'isolate') {
return true;
}
var willChange = vNode.getComputedStylePropertyValue('will-change');
if (willChange === 'transform' || willChange === 'opacity') {
return true;
}
if (vNode.getComputedStylePropertyValue('-webkit-overflow-scrolling') === 'touch') {
return true;
}
var contain = vNode.getComputedStylePropertyValue('contain');
if ([ 'layout', 'paint', 'strict', 'content' ].includes(contain)) {
return true;
}
if (zIndex !== 'auto' && isFlexOrGridContainer(parentVNode)) {
return true;
}
return false;
}
function isFlexOrGridContainer(vNode) {
if (!vNode) {
return false;
}
var display2 = vNode.getComputedStylePropertyValue('display');
return [ 'flex', 'inline-flex', 'grid', 'inline-grid' ].includes(display2);
}
function createStackingOrder(vNode, parentVNode, treeOrder) {
var stackingOrder = parentVNode._stackingOrder.slice();
var isRealStack = isStackingContext(vNode, parentVNode);
var isPositioned = vNode.getComputedStylePropertyValue('position') !== 'static';
if (isRealStack || isPositioned) {
var firstPseudo = stackingOrder.findIndex(function(_ref68) {
var pseudo = _ref68.pseudo;
return !!pseudo;
});
if (firstPseudo !== -1) {
stackingOrder.splice(firstPseudo);
}
}
var stackLevel = getStackLevel(vNode, parentVNode);
if (stackLevel !== null) {
stackingOrder.push(createStackingContext(stackLevel, !isRealStack, treeOrder, vNode));
}
return stackingOrder;
}
function createStackingContext(stackLevel, pseudo, treeOrder, vNode) {
return {
stackLevel: stackLevel,
pseudo: pseudo,
treeOrder: treeOrder,
vNode: vNode
};
}
function getStackLevel(vNode, parentVNode) {
var zIndex = getRealZIndex(vNode, parentVNode);
if (![ 'auto', '0' ].includes(zIndex)) {
return parseInt(zIndex);
}
if (vNode.getComputedStylePropertyValue('float') !== 'none') {
return FLOAT_LEVEL;
}
var isRealStack = isStackingContext(vNode, parentVNode);
var isPseudoStack = vNode.getComputedStylePropertyValue('position') !== 'static';
if (isRealStack || isPseudoStack) {
return DEFAULT_LEVEL;
}
return null;
}
function getRealZIndex(vNode, parentVNode) {
var position = vNode.getComputedStylePropertyValue('position');
if (position === 'static' && !isFlexOrGridContainer(parentVNode)) {
return 'auto';
}
return vNode.getComputedStylePropertyValue('z-index');
}
var findScrollRegionParent = memoize_default(function findScrollRegionParentMemoized(parentVNode) {
if (!parentVNode) {
return null;
}
if (_getScroll(parentVNode.actualNode)) {
return parentVNode;
}
return findScrollRegionParent(get_node_from_tree_default(parentVNode.actualNode.parentElement || parentVNode.actualNode.parentNode));
}, {
primitive: true
});
function addNodeToGrid(grid, vNode) {
var overflowHiddenNodes = get_overflow_hidden_ancestors_default(vNode);
vNode.clientRects.forEach(function(clientRect) {
var _vNode$_grid;
var visibleRect = overflowHiddenNodes.reduce(function(rect, overflowNode) {
return rect && _getIntersectionRect(rect, overflowNode.boundingClientRect);
}, clientRect);
if (!visibleRect) {
return;
}
(_vNode$_grid = vNode._grid) !== null && _vNode$_grid !== void 0 ? _vNode$_grid : vNode._grid = grid;
var gridRect = grid.getGridPositionOfRect(visibleRect);
grid.loopGridPosition(gridRect, function(gridCell) {
if (!gridCell.includes(vNode)) {
gridCell.push(vNode);
}
});
});
}
var Grid = function() {
function Grid() {
var container = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
_classCallCheck(this, Grid);
this.container = container;
this.cells = [];
}
return _createClass(Grid, [ {
key: 'toGridIndex',
value: function toGridIndex(num) {
return Math.floor(num / constants_default.gridSize);
}
}, {
key: 'getCellFromPoint',
value: function getCellFromPoint(_ref69) {
var _this$cells, _row;
var x = _ref69.x, y = _ref69.y;
assert_default(this.boundaries, 'Grid does not have cells added');
var rowIndex = this.toGridIndex(y);
var colIndex = this.toGridIndex(x);
assert_default(_isPointInRect({
y: rowIndex,
x: colIndex
}, this.boundaries), 'Element midpoint exceeds the grid bounds');
var row = (_this$cells = this.cells[rowIndex - this.cells._negativeIndex]) !== null && _this$cells !== void 0 ? _this$cells : [];
return (_row = row[colIndex - row._negativeIndex]) !== null && _row !== void 0 ? _row : [];
}
}, {
key: 'loopGridPosition',
value: function loopGridPosition(gridPosition, callback) {
var _gridPosition = gridPosition, left = _gridPosition.left, right = _gridPosition.right, top = _gridPosition.top, bottom = _gridPosition.bottom;
if (this.boundaries) {
gridPosition = _getBoundingRect(this.boundaries, gridPosition);
}
this.boundaries = gridPosition;
loopNegativeIndexMatrix(this.cells, top, bottom, function(gridRow, row) {
loopNegativeIndexMatrix(gridRow, left, right, function(gridCell, col) {
callback(gridCell, {
row: row,
col: col
});
});
});
}
}, {
key: 'getGridPositionOfRect',
value: function getGridPositionOfRect(_ref70) {
var top = _ref70.top, right = _ref70.right, bottom = _ref70.bottom, left = _ref70.left;
var margin = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
top = this.toGridIndex(top - margin);
right = this.toGridIndex(right + margin - 1);
bottom = this.toGridIndex(bottom + margin - 1);
left = this.toGridIndex(left - margin);
return new window.DOMRect(left, top, right - left, bottom - top);
}
} ]);
}();
function loopNegativeIndexMatrix(matrix, start, end, callback) {
var _matrix$_negativeInde;
(_matrix$_negativeInde = matrix._negativeIndex) !== null && _matrix$_negativeInde !== void 0 ? _matrix$_negativeInde : matrix._negativeIndex = 0;
if (start < matrix._negativeIndex) {
for (var _i11 = 0; _i11 < matrix._negativeIndex - start; _i11++) {
matrix.splice(0, 0, []);
}
matrix._negativeIndex = start;
}
var startOffset = start - matrix._negativeIndex;
var endOffset = end - matrix._negativeIndex;
for (var index = startOffset; index <= endOffset; index++) {
var _index, _matrix$_index;
(_matrix$_index = matrix[_index = index]) !== null && _matrix$_index !== void 0 ? _matrix$_index : matrix[_index] = [];
callback(matrix[index], index + matrix._negativeIndex);
}
}
function _getNodeGrid(node) {
_createGrid();
var _nodeLookup5 = _nodeLookup(node), vNode = _nodeLookup5.vNode;
return vNode._grid;
}
function _findNearbyElms(vNode) {
var _grid$cells;
var margin = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
var _ref71 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}, _ref71$withinMargin = _ref71.withinMargin, withinMargin = _ref71$withinMargin === void 0 ? false : _ref71$withinMargin;
var grid = _getNodeGrid(vNode);
if (!(grid !== null && grid !== void 0 && (_grid$cells = grid.cells) !== null && _grid$cells !== void 0 && _grid$cells.length)) {
return [];
}
var rect = vNode.boundingClientRect;
var selfIsFixed = _isFixedPosition(vNode);
var gridPosition = grid.getGridPositionOfRect(rect, margin);
var marginRect = withinMargin ? new window.DOMRect(rect.left - margin, rect.top - margin, rect.width + margin * 2, rect.height + margin * 2) : null;
var neighbors = [];
grid.loopGridPosition(gridPosition, function(vNeighbors) {
var _iterator13 = _createForOfIteratorHelper(vNeighbors), _step13;
try {
for (_iterator13.s(); !(_step13 = _iterator13.n()).done; ) {
var vNeighbor = _step13.value;
if (vNeighbor && vNeighbor !== vNode && (!marginRect || _getIntersectionRect(marginRect, vNeighbor.boundingClientRect)) && !neighbors.includes(vNeighbor) && selfIsFixed === _isFixedPosition(vNeighbor)) {
neighbors.push(vNeighbor);
}
}
} catch (err) {
_iterator13.e(err);
} finally {
_iterator13.f();
}
});
return neighbors;
}
var getModalDialog = memoize_default(function getModalDialogMemoized() {
var _dialogs$find;
if (!axe._tree) {
return null;
}
if (typeof document.elementsFromPoint !== 'function' || typeof document.elementFromPoint !== 'function') {
return null;
}
var dialogs = query_selector_all_filter_default(axe._tree[0], 'dialog[open]', function(vNode) {
var rect = vNode.boundingClientRect;
var stack = document.elementsFromPoint(rect.left + 1, rect.top + 1);
return stack.includes(vNode.actualNode) && _isVisibleOnScreen(vNode);
});
if (!dialogs.length) {
return null;
}
var modalDialog = dialogs.find(function(dialog) {
var rect = dialog.boundingClientRect;
var stack = document.elementsFromPoint(rect.left - 10, rect.top - 10);
return stack.includes(dialog.actualNode);
});
if (modalDialog) {
return modalDialog;
}
return (_dialogs$find = dialogs.find(function(dialog) {
var _getNodeFromGrid;
var _ref72 = (_getNodeFromGrid = getNodeFromGrid(dialog)) !== null && _getNodeFromGrid !== void 0 ? _getNodeFromGrid : {}, vNode = _ref72.vNode, rect = _ref72.rect;
if (!vNode) {
return false;
}
var stack = document.elementsFromPoint(rect.left + 1, rect.top + 1);
return !stack.includes(vNode.actualNode);
})) !== null && _dialogs$find !== void 0 ? _dialogs$find : null;
});
var get_modal_dialog_default = getModalDialog;
function getNodeFromGrid(dialog) {
_createGrid();
var grid = axe._tree[0]._grid;
var viewRect = new window.DOMRect(0, 0, window.innerWidth, window.innerHeight);
if (!grid) {
return;
}
for (var row = 0; row < grid.cells.length; row++) {
var cols = grid.cells[row];
if (!cols) {
continue;
}
for (var col = 0; col < cols.length; col++) {
var cells = cols[col];
if (!cells) {
continue;
}
for (var _i12 = 0; _i12 < cells.length; _i12++) {
var vNode = cells[_i12];
var rect = vNode.boundingClientRect;
var intersection = _getIntersectionRect(rect, viewRect);
if (vNode.props.nodeName !== 'html' && vNode !== dialog && vNode.getComputedStylePropertyValue('pointer-events') !== 'none' && intersection) {
return {
vNode: vNode,
rect: intersection
};
}
}
}
}
}
function _isInert(vNode) {
var _ref73 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, skipAncestors = _ref73.skipAncestors, isAncestor = _ref73.isAncestor;
if (skipAncestors) {
return isInertSelf(vNode, isAncestor);
}
return isInertAncestors(vNode, isAncestor);
}
var isInertSelf = memoize_default(function isInertSelfMemoized(vNode, isAncestor) {
if (vNode.hasAttr('inert')) {
return true;
}
if (!isAncestor && vNode.actualNode) {
var modalDialog = get_modal_dialog_default();
if (modalDialog && !_contains(modalDialog, vNode)) {
return true;
}
}
return false;
}, {
primitive: true
});
var isInertAncestors = memoize_default(function isInertAncestorsMemoized(vNode, isAncestor) {
if (isInertSelf(vNode, isAncestor)) {
return true;
}
if (!vNode.parent) {
return false;
}
return isInertAncestors(vNode.parent, true);
}, {
primitive: true
});
var allowedDisabledNodeNames = [ 'button', 'command', 'fieldset', 'keygen', 'optgroup', 'option', 'select', 'textarea', 'input' ];
function isDisabledAttrAllowed(nodeName2) {
return allowedDisabledNodeNames.includes(nodeName2);
}
function focusDisabled(el) {
var _nodeLookup6 = _nodeLookup(el), vNode = _nodeLookup6.vNode;
if (isDisabledAttrAllowed(vNode.props.nodeName) && vNode.hasAttr('disabled') || _isInert(vNode)) {
return true;
}
var parentNode = vNode.parent;
var ancestors = [];
var fieldsetDisabled = false;
while (parentNode && parentNode.shadowId === vNode.shadowId && !fieldsetDisabled) {
ancestors.push(parentNode);
if (parentNode.props.nodeName === 'legend') {
break;
}
if (parentNode._inDisabledFieldset !== void 0) {
fieldsetDisabled = parentNode._inDisabledFieldset;
break;
}
if (parentNode.props.nodeName === 'fieldset' && parentNode.hasAttr('disabled')) {
fieldsetDisabled = true;
}
parentNode = parentNode.parent;
}
ancestors.forEach(function(ancestor) {
return ancestor._inDisabledFieldset = fieldsetDisabled;
});
if (fieldsetDisabled) {
return true;
}
if (vNode.props.nodeName !== 'area') {
if (!vNode.actualNode) {
return false;
}
return _isHiddenForEveryone(vNode);
}
return false;
}
var focus_disabled_default = focusDisabled;
var angularSkipLinkRegex = /^\/\#/;
var angularRouterLinkRegex = /^#[!/]/;
function _isCurrentPageLink(anchor) {
var _window$location;
var href = anchor.getAttribute('href');
if (!href || href === '#') {
return false;
}
if (angularSkipLinkRegex.test(href)) {
return true;
}
var hash = anchor.hash, protocol = anchor.protocol, hostname = anchor.hostname, port = anchor.port, pathname = anchor.pathname;
if (angularRouterLinkRegex.test(hash)) {
return false;
}
if (href.charAt(0) === '#') {
return true;
}
if (typeof ((_window$location = window.location) === null || _window$location === void 0 ? void 0 : _window$location.origin) !== 'string' || window.location.origin.indexOf('://') === -1) {
return null;
}
var currentPageUrl = window.location.origin + window.location.pathname;
var url;
if (!hostname) {
url = window.location.origin;
} else {
url = ''.concat(protocol, '//').concat(hostname).concat(port ? ':'.concat(port) : '');
}
if (!pathname) {
url += window.location.pathname;
} else {
url += (pathname[0] !== '/' ? '/' : '') + pathname;
}
return url === currentPageUrl;
}
function _getElementByReference(node, attr) {
var _nodeLookup7 = _nodeLookup(node), vNode = _nodeLookup7.vNode;
var fragment = vNode.attr(attr);
if (!fragment) {
return null;
}
if (attr === 'href' && !_isCurrentPageLink(node)) {
return null;
}
if (fragment.indexOf('#') !== -1) {
fragment = decodeURIComponent(fragment.substr(fragment.indexOf('#') + 1));
}
var candidate = document.getElementById(fragment);
if (candidate) {
return candidate;
}
candidate = document.getElementsByName(fragment);
if (candidate.length) {
return candidate[0];
}
return null;
}
function _visuallySort(a2, b3) {
_createGrid();
var length = Math.max(a2._stackingOrder.length, b3._stackingOrder.length);
for (var _i13 = 0; _i13 < length; _i13++) {
if (typeof b3._stackingOrder[_i13] === 'undefined') {
return -1;
} else if (typeof a2._stackingOrder[_i13] === 'undefined') {
return 1;
}
if (b3._stackingOrder[_i13].stackLevel > a2._stackingOrder[_i13].stackLevel) {
return 1;
}
if (b3._stackingOrder[_i13].stackLevel < a2._stackingOrder[_i13].stackLevel) {
return -1;
}
if (b3._stackingOrder[_i13].treeOrder !== a2._stackingOrder[_i13].treeOrder) {
return b3._stackingOrder[_i13].treeOrder - a2._stackingOrder[_i13].treeOrder;
}
}
var aNode = a2.actualNode;
var bNode = b3.actualNode;
if (aNode.getRootNode && aNode.getRootNode() !== bNode.getRootNode()) {
var boundaries = [];
while (aNode) {
boundaries.push({
root: aNode.getRootNode(),
node: aNode
});
aNode = aNode.getRootNode().host;
}
while (bNode && !boundaries.find(function(boundary) {
return boundary.root === bNode.getRootNode();
})) {
bNode = bNode.getRootNode().host;
}
aNode = boundaries.find(function(boundary) {
return boundary.root === bNode.getRootNode();
}).node;
if (aNode === bNode) {
return a2.actualNode.getRootNode() !== aNode.getRootNode() ? -1 : 1;
}
}
var _window$Node = window.Node, DOCUMENT_POSITION_FOLLOWING = _window$Node.DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_CONTAINS = _window$Node.DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_CONTAINED_BY = _window$Node.DOCUMENT_POSITION_CONTAINED_BY;
var docPosition = aNode.compareDocumentPosition(bNode);
var DOMOrder = docPosition & DOCUMENT_POSITION_FOLLOWING ? 1 : -1;
var isDescendant = docPosition & DOCUMENT_POSITION_CONTAINS || docPosition & DOCUMENT_POSITION_CONTAINED_BY;
var aPosition = getPositionOrder(a2);
var bPosition = getPositionOrder(b3);
if (aPosition === bPosition || isDescendant) {
return DOMOrder;
}
return bPosition - aPosition;
}
function getPositionOrder(vNode) {
if (vNode.getComputedStylePropertyValue('display').indexOf('inline') !== -1) {
return 2;
}
if (isFloated(vNode)) {
return 1;
}
return 0;
}
function isFloated(vNode) {
if (!vNode) {
return false;
}
if (vNode._isFloated !== void 0) {
return vNode._isFloated;
}
var floatStyle = vNode.getComputedStylePropertyValue('float');
if (floatStyle !== 'none') {
vNode._isFloated = true;
return true;
}
var floated = isFloated(vNode.parent);
vNode._isFloated = floated;
return floated;
}
function getRectStack(grid, rect) {
var recursed = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
var center = _getRectCenter(rect);
var gridCell = grid.getCellFromPoint(center) || [];
var floorX = Math.floor(center.x);
var floorY = Math.floor(center.y);
var stack = gridCell.filter(function(gridCellNode) {
return gridCellNode.clientRects.some(function(clientRect) {
var rectX = clientRect.left;
var rectY = clientRect.top;
return floorX < Math.floor(rectX + clientRect.width) && floorX >= Math.floor(rectX) && floorY < Math.floor(rectY + clientRect.height) && floorY >= Math.floor(rectY);
});
});
var gridContainer = grid.container;
if (gridContainer) {
stack = getRectStack(gridContainer._grid, gridContainer.boundingClientRect, true).concat(stack);
}
if (!recursed) {
stack = stack.sort(_visuallySort).map(function(vNode) {
return vNode.actualNode;
}).concat(document.documentElement).filter(function(node, index, array) {
return array.indexOf(node) === index;
});
}
return stack;
}
function getElementStack(node) {
var grid = _getNodeGrid(node);
if (!grid) {
return [];
}
var rect = get_node_from_tree_default(node).boundingClientRect;
return getRectStack(grid, rect);
}
var get_element_stack_default = getElementStack;
function _getTabbableElements(virtualNode) {
var nodeAndDescendents = query_selector_all_default(virtualNode, '*');
var tabbableElements = nodeAndDescendents.filter(function(vNode) {
var isFocusable2 = vNode.isFocusable;
var tabIndex = parse_tabindex_default(vNode.attr('tabindex'));
return tabIndex !== null ? isFocusable2 && tabIndex >= 0 : isFocusable2;
});
return tabbableElements;
}
function isNativelyFocusable(el) {
var _nodeLookup8 = _nodeLookup(el), vNode = _nodeLookup8.vNode;
if (!vNode || focus_disabled_default(vNode)) {
return false;
}
switch (vNode.props.nodeName) {
case 'a':
case 'area':
if (vNode.hasAttr('href')) {
return true;
}
break;
case 'input':
return vNode.props.type !== 'hidden';
case 'textarea':
case 'select':
case 'summary':
case 'button':
return true;
case 'details':
return !query_selector_all_default(vNode, 'summary').length;
}
return false;
}
var is_natively_focusable_default = isNativelyFocusable;
function _isFocusable(el) {
var _nodeLookup9 = _nodeLookup(el), vNode = _nodeLookup9.vNode;
if (vNode.props.nodeType !== 1) {
return false;
}
if (focus_disabled_default(vNode)) {
return false;
} else if (is_natively_focusable_default(vNode)) {
return true;
}
var tabindex = parse_tabindex_default(vNode.attr('tabindex'));
return tabindex !== null;
}
function _isInTabOrder(el) {
var _nodeLookup0 = _nodeLookup(el), vNode = _nodeLookup0.vNode;
if (vNode.props.nodeType !== 1) {
return false;
}
var tabindex = parse_tabindex_default(vNode.attr('tabindex'));
if (tabindex <= -1) {
return false;
}
return _isFocusable(vNode);
}
var get_target_rects_default = memoize_default(getTargetRects, {
primitive: true
});
function getTargetRects(vNode) {
var display2 = vNode.getComputedStylePropertyValue('display');
var nodeRects = display2 === 'inline' ? vNode.clientRects : [ vNode.boundingClientRect ];
var overlappingVNodes = _findNearbyElms(vNode).filter(function(vNeighbor) {
return _hasVisualOverlap(vNode, vNeighbor) && vNeighbor.getComputedStylePropertyValue('pointer-events') !== 'none' && !isDescendantNotInTabOrder(vNode, vNeighbor);
});
if (!overlappingVNodes.length) {
return nodeRects;
}
var obscuringRects = overlappingVNodes.map(function(overlappingVNode) {
var overlappingDisplay = overlappingVNode.getComputedStylePropertyValue('display');
return overlappingDisplay === 'inline' ? overlappingVNode.clientRects : overlappingVNode.boundingClientRect;
}).flat(Infinity);
return _splitRects(nodeRects, obscuringRects);
}
function isDescendantNotInTabOrder(vAncestor, vNode) {
return _contains(vAncestor, vNode) && !_isInTabOrder(vNode);
}
function _getResolvedRefs(node, attr) {
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
var _options$self = options.self, self2 = _options$self === void 0 ? true : _options$self;
var _nodeLookup1 = _nodeLookup(node), vNode = _nodeLookup1.vNode, domNode = _nodeLookup1.domNode;
try {
var attrValue = getIdrefsValue(vNode, attr);
if (!attrValue) {
return [];
}
var refs;
if (typeof attrValue === 'string') {
var doc = get_root_node_default2(domNode);
refs = token_list_default(attrValue).map(function(value) {
return doc.getElementById(value);
});
} else {
refs = Array.from(attrValue);
}
if (!self2) {
refs = refs.filter(function(n3) {
return n3 !== domNode;
});
}
return refs.map(function(n3) {
var virtualNode = get_node_from_tree_default(n3);
return virtualNode ? virtualNode : null;
});
} catch (cause) {
throw new TypeError('Cannot resolve id references for non-DOM nodes', {
cause: cause
});
}
}
function getIdrefsValue(vNode, attr) {
var _standards_default$ar;
var _ref74 = (_standards_default$ar = standards_default.ariaAttrs[attr]) !== null && _standards_default$ar !== void 0 ? _standards_default$ar : {}, prop = _ref74.prop;
if (prop && vNode.actualNode) {
var propValue = vNode.actualNode[prop];
if (propValue !== null && propValue !== void 0) {
return propValue;
}
}
var attrValue = vNode.attr(attr);
if (attrValue !== null) {
return attrValue;
}
if (prop && vNode.elementInternals) {
var internalsValue = vNode.elementInternals[prop];
if (internalsValue !== null && internalsValue !== void 0) {
return internalsValue;
}
}
return null;
}
var get_target_size_default = memoize_default(getTargetSize, {
primitive: true
});
function getTargetSize(vNode, minSize) {
var rects = get_target_rects_default(vNode);
return getLargestRect(rects, minSize);
}
function getLargestRect(rects, minSize) {
return rects.reduce(function(rectA, rectB) {
var rectAisMinimum = _rectHasMinimumSize(minSize, rectA);
var rectBisMinimum = _rectHasMinimumSize(minSize, rectB);
if (rectAisMinimum !== rectBisMinimum) {
return rectAisMinimum ? rectA : rectB;
}
var areaA = rectA.width * rectA.height;
var areaB = rectB.width * rectB.height;
return areaA > areaB ? rectA : rectB;
});
}
var text_exports = {};
__export(text_exports, {
accessibleText: function accessibleText() {
return accessible_text_default;
},
accessibleTextVirtual: function accessibleTextVirtual() {
return _accessibleTextVirtual;
},
autocomplete: function autocomplete() {
return _autocomplete;
},
formControlValue: function formControlValue() {
return form_control_value_default;
},
formControlValueMethods: function formControlValueMethods() {
return _formControlValueMethods;
},
hasUnicode: function hasUnicode() {
return has_unicode_default;
},
isHumanInterpretable: function isHumanInterpretable() {
return is_human_interpretable_default;
},
isIconLigature: function isIconLigature() {
return _isIconLigature;
},
isValidAutocomplete: function isValidAutocomplete() {
return is_valid_autocomplete_default;
},
label: function label() {
return label_default;
},
labelText: function labelText() {
return label_text_default;
},
labelVirtual: function labelVirtual() {
return label_virtual_default2;
},
nativeElementType: function nativeElementType() {
return native_element_type_default;
},
nativeTextAlternative: function nativeTextAlternative() {
return _nativeTextAlternative;
},
nativeTextMethods: function nativeTextMethods() {
return native_text_methods_default;
},
removeUnicode: function removeUnicode() {
return remove_unicode_default;
},
sanitize: function sanitize() {
return sanitize_default;
},
subtreeText: function subtreeText() {
return subtree_text_default;
},
titleText: function titleText() {
return title_text_default;
},
unsupported: function unsupported() {
return unsupported_default;
},
visible: function visible() {
return visible_default;
},
visibleTextNodes: function visibleTextNodes() {
return visible_text_nodes_default;
},
visibleVirtual: function visibleVirtual() {
return visible_virtual_default;
}
});
function _hasAriaValue(node, attrName) {
var attrStandard = standards_default.ariaAttrs[attrName];
if (!attrStandard) {
throw new TypeError('Attribute '.concat(attrName, ' is not an ARIA attribute'));
}
var _nodeLookup10 = _nodeLookup(node), vNode = _nodeLookup10.vNode;
return hasAttributeValue(vNode, attrName) || hasPropertyValue(vNode, attrStandard) || hasInternalValue(vNode, attrStandard);
}
function hasAttributeValue(vNode, attrName) {
return vNode.hasAttr(attrName);
}
function hasPropertyValue(vNode, attrStandard) {
var prop = attrStandard.prop;
if (prop && vNode.actualNode) {
var propValue = vNode.actualNode[prop];
return propValue !== null && propValue !== void 0;
}
return false;
}
function hasInternalValue(vNode, attrStandard) {
var prop = attrStandard.prop;
if (prop && vNode.elementInternals) {
var internalsValue = vNode.elementInternals[prop];
return internalsValue !== null && internalsValue !== void 0;
}
return false;
}
function arialabelledbyText(element) {
var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var _nodeLookup11 = _nodeLookup(element), vNode = _nodeLookup11.vNode;
if ((vNode === null || vNode === void 0 ? void 0 : vNode.props.nodeType) !== 1) {
return '';
}
if (vNode.props.nodeType !== 1 || context.inLabelledByContext || context.inControlContext || !_hasAriaValue(vNode, 'aria-labelledby')) {
return '';
}
var refs = _getResolvedRefs(vNode, 'aria-labelledby').filter(function(elm) {
return elm;
});
return refs.reduce(function(accessibleName, elm) {
var accessibleNameAdd = _accessibleTextVirtual(elm, _extends({
inLabelledByContext: true,
startNode: context.startNode || vNode
}, context));
if (!accessibleName) {
return accessibleNameAdd;
} else {
return ''.concat(accessibleName, ' ').concat(accessibleNameAdd);
}
}, '');
}
var arialabelledby_text_default = arialabelledbyText;
function _arialabelText(element) {
var _nodeLookup12 = _nodeLookup(element), vNode = _nodeLookup12.vNode;
if ((vNode === null || vNode === void 0 ? void 0 : vNode.props.nodeType) !== 1) {
return '';
}
return _getAriaValue(vNode, 'aria-label').value || '';
}
function isUnsupportedRole(role) {
var roleDefinition = standards_default.ariaRoles[role];
return roleDefinition ? !!roleDefinition.unsupported : false;
}
var is_unsupported_role_default = isUnsupportedRole;
function isValidRole(role) {
var _ref75 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, allowAbstract = _ref75.allowAbstract, _ref75$flagUnsupporte = _ref75.flagUnsupported, flagUnsupported = _ref75$flagUnsupporte === void 0 ? false : _ref75$flagUnsupporte;
var roleDefinition = standards_default.ariaRoles[role];
var isRoleUnsupported = is_unsupported_role_default(role);
if (!roleDefinition || flagUnsupported && isRoleUnsupported) {
return false;
}
return allowAbstract ? true : roleDefinition.type !== 'abstract';
}
var is_valid_role_default = isValidRole;
function getExplicitRole(vNode) {
var _ref76 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, fallback = _ref76.fallback, abstracts = _ref76.abstracts, dpub = _ref76.dpub;
vNode = vNode instanceof abstract_virtual_node_default ? vNode : get_node_from_tree_default(vNode);
if (vNode.props.nodeType !== 1) {
return null;
}
var roleAttr = (vNode.attr('role') || '').trim().toLowerCase();
var roleList = fallback ? token_list_default(roleAttr) : [ roleAttr ];
var firstValidRole = roleList.find(function(role) {
if (!dpub && role.substr(0, 4) === 'doc-') {
return false;
}
return is_valid_role_default(role, {
allowAbstract: abstracts
});
});
return firstValidRole || null;
}
var get_explicit_role_default = getExplicitRole;
function getElementsByContentType(type2) {
return Object.keys(standards_default.htmlElms).filter(function(nodeName2) {
var elm = standards_default.htmlElms[nodeName2];
if (elm.contentTypes) {
return elm.contentTypes.includes(type2);
}
if (!elm.variant) {
return false;
}
if (elm.variant['default'] && elm.variant['default'].contentTypes) {
return elm.variant['default'].contentTypes.includes(type2);
}
return false;
});
}
var get_elements_by_content_type_default = getElementsByContentType;
function getGlobalAriaAttrs() {
return cache_default.get('globalAriaAttrs', function() {
return Object.keys(standards_default.ariaAttrs).filter(function(attrName) {
return standards_default.ariaAttrs[attrName].global;
});
});
}
var get_global_aria_attrs_default = getGlobalAriaAttrs;
function idrefs(node, attr) {
node = node.actualNode || node;
try {
var doc = get_root_node_default2(node);
var result = [];
var attrValue = node.getAttribute(attr);
if (attrValue) {
attrValue = token_list_default(attrValue);
for (var index = 0; index < attrValue.length; index++) {
result.push(doc.getElementById(attrValue[index]));
}
}
return result;
} catch (_unused3) {
throw new TypeError('Cannot resolve id references for non-DOM nodes');
}
}
var idrefs_default = idrefs;
function toGrid(node) {
return toGridVirtual(get_node_from_tree_default(node));
}
function toGridMemoized(vNode) {
var node = vNode.actualNode;
var table = [];
var rows = node.rows;
for (var _i14 = 0, rowLength = rows.length; _i14 < rowLength; _i14++) {
var cells = rows[_i14].cells;
table[_i14] = table[_i14] || [];
var columnIndex = 0;
for (var j = 0, cellLength = cells.length; j < cellLength; j++) {
for (var colSpan = 0; colSpan < cells[j].colSpan; colSpan++) {
var rowspanAttr = cells[j].getAttribute('rowspan');
var rowspanValue = parseInt(rowspanAttr) === 0 || cells[j].rowspan === 0 ? rows.length : cells[j].rowSpan;
for (var rowSpan = 0; rowSpan < rowspanValue; rowSpan++) {
table[_i14 + rowSpan] = table[_i14 + rowSpan] || [];
while (table[_i14 + rowSpan][columnIndex]) {
columnIndex++;
}
table[_i14 + rowSpan][columnIndex] = cells[j];
}
columnIndex++;
}
}
}
return table;
}
var toGridVirtual = memoize_default(toGridMemoized, {
primitive: true
});
var to_grid_default = toGrid;
function getCellPosition(cell, tableGrid) {
var rowIndex, index;
if (!tableGrid) {
tableGrid = to_grid_default(find_up_default(cell, 'table'));
}
for (rowIndex = 0; rowIndex < tableGrid.length; rowIndex++) {
if (tableGrid[rowIndex]) {
index = tableGrid[rowIndex].indexOf(cell);
if (index !== -1) {
return {
x: index,
y: rowIndex
};
}
}
}
}
var get_cell_position_default = memoize_default(getCellPosition);
function _getScope(el) {
var _nodeLookup13 = _nodeLookup(el), vNode = _nodeLookup13.vNode, cell = _nodeLookup13.domNode;
var scope = vNode.attr('scope');
var role = get_explicit_role_default(vNode);
if (![ 'td', 'th' ].includes(vNode.props.nodeName)) {
throw new TypeError('Expected TD or TH element');
}
if (role === 'columnheader') {
return 'col';
} else if (role === 'rowheader') {
return 'row';
} else if (scope === 'col' || scope === 'row') {
return scope;
} else if (vNode.props.nodeName !== 'th') {
return false;
} else if (!vNode.actualNode) {
return 'auto';
}
var tableGrid = to_grid_default(find_up_default(cell, 'table'));
var pos = get_cell_position_default(cell, tableGrid);
var headerRow = tableGrid[pos.y].every(function(node) {
return node.nodeName.toUpperCase() === 'TH';
});
if (headerRow) {
return 'col';
}
var headerCol = tableGrid.map(function(col) {
return col[pos.x];
}).every(function(node) {
return node && node.nodeName.toUpperCase() === 'TH';
});
if (headerCol) {
return 'row';
}
return 'auto';
}
function isColumnHeader(element) {
return [ 'col', 'auto' ].indexOf(_getScope(element)) !== -1;
}
var is_column_header_default = isColumnHeader;
function isRowHeader(cell) {
return [ 'row', 'auto' ].includes(_getScope(cell));
}
var is_row_header_default = isRowHeader;
function sanitize(str) {
if (!str) {
return '';
}
return str.replace(/\r\n/g, '\n').replace(/\u00A0/g, ' ').replace(/[\s]{2,}/g, ' ').trim();
}
var sanitize_default = sanitize;
var getSectioningContentSelector = function getSectioningContentSelector() {
return cache_default.get('sectioningContentSelector', function() {
return get_elements_by_content_type_default('sectioning').map(function(nodeName2) {
return ''.concat(nodeName2, ':not([role])');
}).join(', ') + ' , [role=article], [role=complementary], [role=navigation], [role=region]';
});
};
var getSectioningContentPlusMainSelector = function getSectioningContentPlusMainSelector() {
return cache_default.get('sectioningContentPlusMainSelector', function() {
return getSectioningContentSelector() + ' , main:not([role]), [role=main]';
});
};
function hasAccessibleName(vNode) {
var _ref77 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, _ref77$checkTitle = _ref77.checkTitle, checkTitle = _ref77$checkTitle === void 0 ? false : _ref77$checkTitle;
return !!(sanitize_default(arialabelledby_text_default(vNode)) || sanitize_default(_arialabelText(vNode)) || checkTitle && (vNode === null || vNode === void 0 ? void 0 : vNode.props.nodeType) === 1 && sanitize_default(vNode.attr('title')));
}
var implicitHtmlRoles = {
a: function a(vNode) {
return vNode.hasAttr('href') ? 'link' : null;
},
area: function area(vNode) {
return vNode.hasAttr('href') ? 'link' : null;
},
article: 'article',
aside: function aside(vNode) {
if (closest_default(vNode.parent, getSectioningContentSelector()) && !hasAccessibleName(vNode, {
checkTitle: true
})) {
return null;
}
return 'complementary';
},
body: 'document',
button: 'button',
datalist: 'listbox',
dd: 'definition',
dfn: 'term',
details: 'group',
dialog: 'dialog',
dt: 'term',
fieldset: 'group',
figure: 'figure',
footer: function footer(vNode) {
var sectioningElement = closest_default(vNode, getSectioningContentPlusMainSelector());
return !sectioningElement ? 'contentinfo' : null;
},
form: function form(vNode) {
return hasAccessibleName(vNode) ? 'form' : null;
},
h1: 'heading',
h2: 'heading',
h3: 'heading',
h4: 'heading',
h5: 'heading',
h6: 'heading',
header: function header(vNode) {
var sectioningElement = closest_default(vNode, getSectioningContentPlusMainSelector());
return !sectioningElement ? 'banner' : null;
},
hr: 'separator',
img: function img(vNode) {
var emptyAlt = vNode.hasAttr('alt') && !vNode.attr('alt');
var hasGlobalAria = get_global_aria_attrs_default().find(function(attr) {
return vNode.hasAttr(attr);
});
return emptyAlt && !hasGlobalAria && !_isFocusable(vNode) ? 'presentation' : 'img';
},
input: function input(vNode) {
var suggestionsSourceElement;
if (vNode.hasAttr('list')) {
var listElement = idrefs_default(vNode.actualNode, 'list').filter(function(node) {
return !!node;
})[0];
suggestionsSourceElement = listElement && listElement.nodeName.toLowerCase() === 'datalist';
}
switch (vNode.props.type) {
case 'checkbox':
return 'checkbox';
case 'number':
return 'spinbutton';
case 'radio':
return 'radio';
case 'range':
return 'slider';
case 'search':
return !suggestionsSourceElement ? 'searchbox' : 'combobox';
case 'button':
case 'image':
case 'reset':
case 'submit':
return 'button';
case 'text':
case 'tel':
case 'url':
case 'email':
case '':
return !suggestionsSourceElement ? 'textbox' : 'combobox';
default:
return 'textbox';
}
},
li: 'listitem',
main: 'main',
math: 'math',
menu: 'list',
meter: 'meter',
nav: 'navigation',
ol: 'list',
optgroup: 'group',
option: 'option',
output: 'status',
progress: 'progressbar',
search: 'search',
section: function section(vNode) {
return hasAccessibleName(vNode) ? 'region' : null;
},
select: function select(vNode) {
return vNode.hasAttr('multiple') || parseInt(vNode.attr('size')) > 1 ? 'listbox' : 'combobox';
},
summary: 'button',
table: 'table',
tbody: 'rowgroup',
td: function td(vNode) {
var table = closest_default(vNode, 'table');
var role = get_explicit_role_default(table);
return [ 'grid', 'treegrid' ].includes(role) ? 'gridcell' : 'cell';
},
textarea: 'textbox',
tfoot: 'rowgroup',
th: function th(vNode) {
if (is_column_header_default(vNode)) {
return 'columnheader';
}
if (is_row_header_default(vNode)) {
return 'rowheader';
}
},
thead: 'rowgroup',
tr: 'row',
ul: 'list'
};
var implicit_html_roles_default = implicitHtmlRoles;
function fromPrimitive(someString, matcher) {
var matcherType = _typeof(matcher);
if (Array.isArray(matcher) && typeof someString !== 'undefined') {
return matcher.includes(someString);
}
if (matcherType === 'function') {
return !!matcher(someString);
}
if (someString !== null && someString !== void 0) {
if (matcher instanceof RegExp) {
return matcher.test(someString);
}
if (/^\/.*\/$/.test(matcher)) {
var pattern = matcher.substring(1, matcher.length - 1);
return new RegExp(pattern).test(someString);
}
}
return matcher === someString;
}
function fromPrimative(someString, matcher) {
return fromPrimitive(someString, matcher);
}
function fromFunction(getValue, matcher) {
var matcherType = _typeof(matcher);
if (matcherType !== 'object' || Array.isArray(matcher) || matcher instanceof RegExp) {
throw new Error('Expect matcher to be an object');
}
return Object.keys(matcher).every(function(propName) {
return fromPrimative(getValue(propName), matcher[propName]);
});
}
var from_function_default = fromFunction;
function attributes(vNode, matcher) {
vNode = _nodeLookup(vNode).vNode;
return from_function_default(function(attrName) {
return vNode.attr(attrName);
}, matcher);
}
var attributes_default = attributes;
function condition(arg, matcher) {
return !!matcher(arg);
}
function explicitRole(vNode, matcher) {
return fromPrimative(get_explicit_role_default(vNode), matcher);
}
var explicit_role_default = explicitRole;
function hasAccessibleName2(vNode, matcher) {
return fromPrimative(!!_accessibleTextVirtual(vNode), matcher);
}
var has_accessible_name_default = hasAccessibleName2;
function hasChild(vNode, selector) {
return vNode.children.some(function(node) {
return _matches(node, selector);
});
}
function implicitRole(vNode, matcher) {
return fromPrimative(implicit_role_default(vNode), matcher);
}
var implicit_role_default2 = implicitRole;
var sectioningRoles = [ 'article', 'complementary', 'main', 'navigation', 'region' ];
function inSectioningContent(vNode, matcher) {
var sectioningElms = cache_default.get('sectioningElms', function() {
return get_elements_by_content_type_default('sectioning').concat('main');
});
if (typeof vNode.parent === 'undefined') {
throw new TypeError('Cannot resolve parent for non-DOM nodes');
}
vNode = vNode.parent;
while (vNode) {
var _vNode$elementInterna;
var nodeName2 = vNode.props.nodeName;
var role = get_explicit_role_default(vNode);
if ([ 'presentation', 'none' ].includes(role) && hasConflictResolution(vNode)) {
role = null;
}
if (!role && (_vNode$elementInterna = vNode.elementInternals) !== null && _vNode$elementInterna !== void 0 && _vNode$elementInterna.role) {
role = vNode.elementInternals.role;
}
if (!role && sectioningElms.includes(nodeName2) || sectioningRoles.includes(role)) {
return fromPrimative(true, matcher);
}
if (typeof vNode.parent === 'undefined') {
throw new TypeError('Cannot resolve parent for non-DOM nodes');
}
vNode = vNode.parent;
}
return fromPrimative(false, matcher);
}
function isSummaryForDetails(vNode, matcher) {
if (typeof vNode.parent === 'undefined') {
throw new TypeError('Cannot resolve parent for non-DOM nodes');
}
if (!vNode.parent || vNode.parent.props.nodeName !== 'details') {
return fromPrimative(false, matcher);
}
var firstMatch = vNode.parent.children.find(function(node) {
return node.props.nodeName === 'summary';
});
return fromPrimative(firstMatch === vNode, matcher);
}
function nodeName(vNode, matcher) {
vNode = _nodeLookup(vNode).vNode;
return fromPrimative(vNode.props.nodeName, matcher);
}
var node_name_default = nodeName;
function properties(vNode, matcher) {
vNode = _nodeLookup(vNode).vNode;
return from_function_default(function(propName) {
return vNode.props[propName];
}, matcher);
}
var properties_default = properties;
function semanticRole(vNode, matcher) {
return fromPrimative(get_role_default(vNode), matcher);
}
var semantic_role_default = semanticRole;
var matchers = {
attributes: attributes_default,
condition: condition,
explicitRole: explicit_role_default,
hasAccessibleName: has_accessible_name_default,
hasChild: hasChild,
implicitRole: implicit_role_default2,
inSectioningContent: inSectioningContent,
isSummaryForDetails: isSummaryForDetails,
nodeName: node_name_default,
properties: properties_default,
semanticRole: semantic_role_default
};
function fromDefinition(vNode, definition) {
vNode = _nodeLookup(vNode).vNode;
if (Array.isArray(definition)) {
return definition.some(function(definitionItem) {
return fromDefinition(vNode, definitionItem);
});
}
if (typeof definition === 'string') {
return _matches(vNode, definition);
}
return Object.keys(definition).every(function(matcherName) {
if (!matchers[matcherName]) {
throw new Error('Unknown matcher type "'.concat(matcherName, '"'));
}
var matchMethod = matchers[matcherName];
var matcher = definition[matcherName];
return matchMethod(vNode, matcher);
});
}
var from_definition_default = fromDefinition;
function matches2(vNode, definition) {
return from_definition_default(vNode, definition);
}
var matches_default = matches2;
matches_default.attributes = attributes_default;
matches_default.condition = condition;
matches_default.explicitRole = explicit_role_default;
matches_default.fromDefinition = from_definition_default;
matches_default.fromFunction = from_function_default;
matches_default.fromPrimative = fromPrimative;
matches_default.fromPrimitive = fromPrimitive;
matches_default.hasAccessibleName = has_accessible_name_default;
matches_default.hasChild = hasChild;
matches_default.implicitRole = implicit_role_default2;
matches_default.inSectioningContent = inSectioningContent;
matches_default.isSummaryForDetails = isSummaryForDetails;
matches_default.nodeName = node_name_default;
matches_default.properties = properties_default;
matches_default.semanticRole = semantic_role_default;
var matches_default2 = matches_default;
function getElementSpec(vNode) {
var _ref78 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, _ref78$noMatchAccessi = _ref78.noMatchAccessibleName, noMatchAccessibleName = _ref78$noMatchAccessi === void 0 ? false : _ref78$noMatchAccessi;
var standard = standards_default.htmlElms[vNode.props.nodeName];
if (!standard) {
return {};
}
if (!standard.variant) {
return standard;
}
var variant = standard.variant, spec = _objectWithoutProperties(standard, _excluded9);
for (var variantName in variant) {
if (!variant.hasOwnProperty(variantName) || variantName === 'default') {
continue;
}
var _variant$variantName = variant[variantName], matches4 = _variant$variantName.matches, props = _objectWithoutProperties(_variant$variantName, _excluded0);
var matchProperties = Array.isArray(matches4) ? matches4 : [ matches4 ];
for (var _i15 = 0; _i15 < matchProperties.length && noMatchAccessibleName; _i15++) {
if (matchProperties[_i15].hasOwnProperty('hasAccessibleName')) {
return standard;
}
}
if (matches_default2(vNode, matches4)) {
for (var propName in props) {
if (props.hasOwnProperty(propName)) {
spec[propName] = props[propName];
}
}
}
}
for (var _propName in variant['default']) {
if (variant['default'].hasOwnProperty(_propName) && typeof spec[_propName] === 'undefined') {
spec[_propName] = variant['default'][_propName];
}
}
return spec;
}
var get_element_spec_default = getElementSpec;
function implicitRole2(node) {
var _vNode$elementInterna2;
var _ref79 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, chromium = _ref79.chromium;
var _nodeLookup14 = _nodeLookup(node), vNode = _nodeLookup14.vNode;
if (!vNode) {
throw new ReferenceError('Cannot get implicit role of a node outside the current scope.');
}
if ((_vNode$elementInterna2 = vNode.elementInternals) !== null && _vNode$elementInterna2 !== void 0 && _vNode$elementInterna2.role) {
return vNode.elementInternals.role;
}
var nodeName2 = vNode.props.nodeName;
var role = implicit_html_roles_default[nodeName2];
if (!role && chromium) {
var _get_element_spec_def = get_element_spec_default(vNode), chromiumRole = _get_element_spec_def.chromiumRole;
return chromiumRole || null;
}
if (typeof role === 'function') {
return role(vNode);
}
return role || null;
}
var implicit_role_default = implicitRole2;
var inheritsPresentationChain = {
td: [ 'tr' ],
th: [ 'tr' ],
tr: [ 'thead', 'tbody', 'tfoot', 'table' ],
thead: [ 'table' ],
tbody: [ 'table' ],
tfoot: [ 'table' ],
li: [ 'ol', 'ul' ],
dt: [ 'dl', 'div' ],
dd: [ 'dl', 'div' ],
div: [ 'dl' ]
};
function getInheritedRole(vNode, explicitRoleOptions) {
var parentNodeNames = inheritsPresentationChain[vNode.props.nodeName];
if (!parentNodeNames) {
return null;
}
if (!vNode.parent) {
if (!vNode.actualNode) {
return null;
}
throw new ReferenceError('Cannot determine role presentational inheritance of a required parent outside the current scope.');
}
if (!parentNodeNames.includes(vNode.parent.props.nodeName)) {
return null;
}
var parentRole = get_explicit_role_default(vNode.parent, explicitRoleOptions);
if ([ 'none', 'presentation' ].includes(parentRole) && !hasConflictResolution(vNode.parent)) {
return parentRole;
}
if (parentRole) {
return null;
}
return getInheritedRole(vNode.parent, explicitRoleOptions);
}
function resolveImplicitRole(vNode, _ref80) {
var chromium = _ref80.chromium, explicitRoleOptions = _objectWithoutProperties(_ref80, _excluded1);
var implicitRole3 = implicit_role_default(vNode, {
chromium: chromium
});
if (!implicitRole3) {
return null;
}
var presentationalRole = getInheritedRole(vNode, explicitRoleOptions);
if (presentationalRole) {
return presentationalRole;
}
return implicitRole3;
}
function hasConflictResolution(vNode) {
var hasGlobalAria = get_global_aria_attrs_default().some(function(attr) {
return vNode.hasAttr(attr);
});
return hasGlobalAria || _isFocusable(vNode);
}
function resolveRole(node) {
var _ref81 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var noImplicit = _ref81.noImplicit, roleOptions = _objectWithoutProperties(_ref81, _excluded10);
var _nodeLookup15 = _nodeLookup(node), vNode = _nodeLookup15.vNode;
if (vNode.props.nodeType !== 1) {
return null;
}
var explicitRole2 = get_explicit_role_default(vNode, roleOptions);
if (!explicitRole2) {
return noImplicit ? null : resolveImplicitRole(vNode, roleOptions);
}
if (![ 'presentation', 'none' ].includes(explicitRole2)) {
return explicitRole2;
}
if (hasConflictResolution(vNode)) {
if (_isValidCustomElementName(vNode.props.nodeName)) {
return null;
}
return noImplicit ? null : resolveImplicitRole(vNode, roleOptions);
}
return explicitRole2;
}
function getRole(node) {
var _ref82 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var noPresentational = _ref82.noPresentational, options = _objectWithoutProperties(_ref82, _excluded11);
var role = resolveRole(node, options);
if (noPresentational && [ 'presentation', 'none' ].includes(role)) {
return null;
}
return role;
}
var get_role_default = getRole;
var alwaysTitleElements = [ 'iframe' ];
function titleText(node) {
var _nodeLookup16 = _nodeLookup(node), vNode = _nodeLookup16.vNode;
if (vNode.props.nodeType !== 1 || !node.hasAttr('title')) {
return '';
}
if (!matches_default(vNode, alwaysTitleElements) && [ 'none', 'presentation' ].includes(get_role_default(vNode))) {
return '';
}
return vNode.attr('title');
}
var title_text_default = titleText;
function namedFromContents(vNode) {
var _ref83 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, strict = _ref83.strict;
vNode = vNode instanceof abstract_virtual_node_default ? vNode : get_node_from_tree_default(vNode);
if (vNode.props.nodeType !== 1) {
return false;
}
var role = get_role_default(vNode);
var roleDef = standards_default.ariaRoles[role];
if (roleDef && roleDef.nameFromContent) {
return true;
}
if (strict) {
return false;
}
return !roleDef || [ 'presentation', 'none' ].includes(role);
}
var named_from_contents_default = namedFromContents;
function getOwnedVirtual(virtualNode) {
var children = virtualNode.children;
if (!children) {
throw new Error('getOwnedVirtual requires a virtual node');
}
if (_hasAriaValue(virtualNode, 'aria-owns')) {
var owns = _getResolvedRefs(virtualNode, 'aria-owns').filter(function(vNode) {
return !!vNode;
});
var uniqueOwns = owns.filter(function(own, index) {
return owns.indexOf(own) === index;
});
var nativeChildren = children.filter(function(child) {
return !uniqueOwns.includes(child);
});
return [].concat(_toConsumableArray(nativeChildren), _toConsumableArray(uniqueOwns));
}
return _toConsumableArray(children);
}
var get_owned_virtual_default = getOwnedVirtual;
var unsupported_default = {
accessibleNameFromFieldValue: [ 'progressbar' ]
};
function _isVisibleToScreenReaders(vNode) {
vNode = _nodeLookup(vNode).vNode;
return isVisibleToScreenReadersVirtual(vNode);
}
var isVisibleToScreenReadersVirtual = memoize_default(function isVisibleToScreenReadersMemoized(vNode, isAncestor) {
if (ariaHidden(vNode) || _isInert(vNode, {
skipAncestors: true,
isAncestor: isAncestor
})) {
return false;
}
if (vNode.actualNode && vNode.props.nodeName === 'area') {
return !areaHidden(vNode, isVisibleToScreenReadersVirtual);
}
if (_isHiddenForEveryone(vNode, {
skipAncestors: true,
isAncestor: isAncestor
})) {
return false;
}
if (!vNode.parent) {
return true;
}
return isVisibleToScreenReadersVirtual(vNode.parent, true);
}, {
primitive: true
});
function getUnicodeNonBmpRegExp() {
return /[\u1D00-\u1D7F\u1D80-\u1DBF\u1DC0-\u1DFF\u20A0-\u20CF\u20D0-\u20FF\u2100-\u214F\u2150-\u218F\u2190-\u21FF\u2200-\u22FF\u2300-\u23FF\u2400-\u243F\u2440-\u245F\u2460-\u24FF\u2500-\u257F\u2580-\u259F\u25A0-\u25FF\u2600-\u26FF\u2700-\u27BF\uE000-\uF8FF]/g;
}
function getPunctuationRegExp() {
return /[\u2000-\u206F\u2E00-\u2E7F\u3000-\u3004\u3008-\u3020\u3030\u3036-\u3037\u303D-\u303F\u30FB\uFE10-\uFE1F\uFE30-\uFE4F\uFE50-\uFE6F\uFF01-\uFF0F\uFF1A-\uFF20\uFF3B-\uFF40\uFF5B-\uFF65\\'!"#$%&\xa3\xa2\xa5\xa7\u20ac()*+,\-.\/:;<=>?@\[\]^_`{|}~\xb1]/g;
}
function getSupplementaryPrivateUseRegExp() {
return /[\uDB80-\uDBBF][\uDC00-\uDFFF]/g;
}
function getVariationSelectorRegExp() {
return /[\u180B-\u180D\u180F\uFE00-\uFE0F]|\uDB40[\uDD00-\uDDEF]/g;
}
function getCategoryFormatRegExp() {
return /[\xAD\u0600-\u0605\u061C\u06DD\u070F\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC38]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/g;
}
function hasUnicode(str, options) {
var emoji = options.emoji, nonBmp = options.nonBmp, punctuations = options.punctuations;
var value = false;
if (emoji) {
value || (value = emoji_regex_default().test(str));
}
if (nonBmp) {
value || (value = getUnicodeNonBmpRegExp().test(str) || getSupplementaryPrivateUseRegExp().test(str) || getCategoryFormatRegExp().test(str));
}
if (punctuations) {
value || (value = getPunctuationRegExp().test(str));
}
return value;
}
var has_unicode_default = hasUnicode;
function _isIconLigature(textVNode) {
var differenceThreshold = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : .15;
var occurrenceThreshold = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 3;
var nodeValue = textVNode.actualNode.nodeValue.trim();
if (!sanitize_default(nodeValue) || has_unicode_default(nodeValue, {
emoji: true,
nonBmp: true
})) {
return false;
}
var canvasContext = cache_default.get('canvasContext', function() {
return document.createElement('canvas').getContext('2d', {
willReadFrequently: true
});
});
var canvas = canvasContext.canvas;
var fonts = cache_default.get('fonts', function() {
return {};
});
var style = window.getComputedStyle(textVNode.parent.actualNode);
var fontFamily = style.getPropertyValue('font-family');
if (!fonts[fontFamily]) {
fonts[fontFamily] = {
occurrences: 0,
numLigatures: 0
};
}
var font = fonts[fontFamily];
if (font.occurrences >= occurrenceThreshold) {
if (font.numLigatures / font.occurrences === 1) {
return true;
} else if (font.numLigatures === 0) {
return false;
}
}
font.occurrences++;
var fontSize = 30;
var fontStyle = ''.concat(fontSize, 'px ').concat(fontFamily);
canvasContext.font = fontStyle;
var firstChar = nodeValue.charAt(0);
var width = canvasContext.measureText(firstChar).width;
if (width === 0) {
font.numLigatures++;
return true;
}
if (width < 30) {
var diff = 30 / width;
width *= diff;
fontSize *= diff;
fontStyle = ''.concat(fontSize, 'px ').concat(fontFamily);
}
canvas.width = width;
canvas.height = fontSize;
canvasContext.font = fontStyle;
canvasContext.textAlign = 'left';
canvasContext.textBaseline = 'top';
canvasContext.fillText(firstChar, 0, 0);
var compareData = new Uint32Array(canvasContext.getImageData(0, 0, width, fontSize).data.buffer);
if (!compareData.some(function(pixel) {
return pixel;
})) {
font.numLigatures++;
return true;
}
canvasContext.clearRect(0, 0, width, fontSize);
canvasContext.fillText(nodeValue, 0, 0);
var compareWith = new Uint32Array(canvasContext.getImageData(0, 0, width, fontSize).data.buffer);
var differences = compareData.reduce(function(diff, pixel, i) {
if (pixel === 0 && compareWith[i] === 0) {
return diff;
}
if (pixel !== 0 && compareWith[i] !== 0) {
return diff;
}
return ++diff;
}, 0);
var expectedWidth = nodeValue.split('').reduce(function(totalWidth, _char3) {
return totalWidth + canvasContext.measureText(_char3).width;
}, 0);
var actualWidth = canvasContext.measureText(nodeValue).width;
var pixelDifference = differences / compareData.length;
var sizeDifference = 1 - actualWidth / expectedWidth;
if (pixelDifference >= differenceThreshold && sizeDifference >= differenceThreshold) {
font.numLigatures++;
return true;
}
return false;
}
function visibleVirtual(element, screenReader, noRecursing) {
var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
var _nodeLookup17 = _nodeLookup(element), vNode = _nodeLookup17.vNode;
var visibleMethod = screenReader ? _isVisibleToScreenReaders : _isVisibleOnScreen;
var visible2 = !element.actualNode || element.actualNode && visibleMethod(element);
var ignoreIconLigature = options.ignoreIconLigature, pixelThreshold = options.pixelThreshold, occurrenceThreshold = options.occurrenceThreshold, skipSanitize = options.skipSanitize;
var result = vNode.children.map(function(child) {
var _child$props = child.props, nodeType = _child$props.nodeType, nodeValue = _child$props.nodeValue, nodeName2 = _child$props.nodeName;
if (nodeType === 3) {
if (!nodeValue || !visible2) {
return '';
}
if (ignoreIconLigature && _isIconLigature(child, pixelThreshold, occurrenceThreshold)) {
return '';
}
return nodeValue;
}
if (nodeName2 === 'br') {
return ' ';
}
if (!noRecursing) {
return visibleVirtual(child, screenReader, false, _extends({}, options, {
skipSanitize: true
}));
}
}).join('');
return skipSanitize ? result : sanitize_default(result);
}
var visible_virtual_default = visibleVirtual;
var nonTextInputTypes = [ 'button', 'checkbox', 'color', 'file', 'hidden', 'image', 'password', 'radio', 'reset', 'submit' ];
function isNativeTextbox(node) {
node = node instanceof abstract_virtual_node_default ? node : get_node_from_tree_default(node);
var nodeName2 = node.props.nodeName;
return nodeName2 === 'textarea' || nodeName2 === 'input' && !nonTextInputTypes.includes((node.attr('type') || '').toLowerCase());
}
var is_native_textbox_default = isNativeTextbox;
function isNativeSelect(node) {
node = node instanceof abstract_virtual_node_default ? node : get_node_from_tree_default(node);
var nodeName2 = node.props.nodeName;
return nodeName2 === 'select';
}
var is_native_select_default = isNativeSelect;
function isAriaTextbox(node) {
var role = get_explicit_role_default(node);
return role === 'textbox';
}
var is_aria_textbox_default = isAriaTextbox;
function isAriaListbox(node) {
var role = get_explicit_role_default(node);
return role === 'listbox';
}
var is_aria_listbox_default = isAriaListbox;
function isAriaCombobox(node) {
var role = get_explicit_role_default(node);
return role === 'combobox';
}
var is_aria_combobox_default = isAriaCombobox;
var rangeRoles = [ 'progressbar', 'scrollbar', 'slider', 'spinbutton' ];
function isAriaRange(node) {
var role = get_explicit_role_default(node);
return rangeRoles.includes(role);
}
var is_aria_range_default = isAriaRange;
var controlValueRoles = [ 'textbox', 'progressbar', 'scrollbar', 'slider', 'spinbutton', 'combobox', 'listbox' ];
var _formControlValueMethods = {
nativeTextboxValue: nativeTextboxValue,
nativeSelectValue: nativeSelectValue,
ariaTextboxValue: ariaTextboxValue,
ariaListboxValue: ariaListboxValue,
ariaComboboxValue: ariaComboboxValue,
ariaRangeValue: ariaRangeValue
};
function formControlValue(virtualNode) {
var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var actualNode = virtualNode.actualNode;
var unsupportedRoles = unsupported_default.accessibleNameFromFieldValue || [];
var role = get_role_default(virtualNode);
if (context.startNode === virtualNode || !controlValueRoles.includes(role) || unsupportedRoles.includes(role)) {
return '';
}
var valueMethods = Object.keys(_formControlValueMethods).map(function(name) {
return _formControlValueMethods[name];
});
var valueString = valueMethods.reduce(function(accName, step) {
return accName || step(virtualNode, context);
}, '');
if (context.debug) {
log(valueString || '{empty-value}', actualNode, context);
}
return valueString;
}
function nativeTextboxValue(node) {
var _nodeLookup18 = _nodeLookup(node), vNode = _nodeLookup18.vNode;
if (is_native_textbox_default(vNode)) {
return vNode.props.value || '';
}
return '';
}
function nativeSelectValue(node) {
var _nodeLookup19 = _nodeLookup(node), vNode = _nodeLookup19.vNode;
if (!is_native_select_default(vNode)) {
return '';
}
var options = query_selector_all_default(vNode, 'option');
var selectedOptions = options.filter(function(option) {
return option.props.selected;
});
if (!selectedOptions.length) {
selectedOptions.push(options[0]);
}
return selectedOptions.map(function(option) {
return visible_virtual_default(option);
}).join(' ') || '';
}
function ariaTextboxValue(node) {
var _nodeLookup20 = _nodeLookup(node), vNode = _nodeLookup20.vNode, domNode = _nodeLookup20.domNode;
if (!is_aria_textbox_default(vNode)) {
return '';
}
if (!domNode || domNode && !_isHiddenForEveryone(domNode)) {
return visible_virtual_default(vNode, true);
} else {
return domNode.textContent;
}
}
function ariaListboxValue(node, context) {
var _nodeLookup21 = _nodeLookup(node), vNode = _nodeLookup21.vNode;
if (!is_aria_listbox_default(vNode)) {
return '';
}
var selected = get_owned_virtual_default(vNode).filter(function(owned) {
return get_role_default(owned) === 'option' && _getAriaValue(owned, 'aria-selected').value === 'true';
});
if (selected.length === 0) {
return '';
}
return _accessibleTextVirtual(selected[0], context);
}
function ariaComboboxValue(node, context) {
var _nodeLookup22 = _nodeLookup(node), vNode = _nodeLookup22.vNode;
if (!is_aria_combobox_default(vNode)) {
return '';
}
var listbox = get_owned_virtual_default(vNode).filter(function(elm) {
return get_role_default(elm) === 'listbox';
})[0];
return listbox ? ariaListboxValue(listbox, context) : '';
}
function ariaRangeValue(node) {
var _nodeLookup23 = _nodeLookup(node), vNode = _nodeLookup23.vNode;
if (!is_aria_range_default(vNode) || !_hasAriaValue(vNode, 'aria-valuenow')) {
return '';
}
var valueNow = +_getAriaValue(vNode, 'aria-valuenow').value;
return !isNaN(valueNow) ? String(valueNow) : '0';
}
var form_control_value_default = formControlValue;
function subtreeText(virtualNode) {
var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var alreadyProcessed2 = _accessibleTextVirtual.alreadyProcessed;
context.startNode = context.startNode || virtualNode;
var _context = context, strict = _context.strict, inControlContext = _context.inControlContext, inLabelledByContext = _context.inLabelledByContext;
var role = get_role_default(virtualNode);
var _get_element_spec_def2 = get_element_spec_default(virtualNode, {
noMatchAccessibleName: true
}), contentTypes = _get_element_spec_def2.contentTypes;
if (alreadyProcessed2(virtualNode, context) || virtualNode.props.nodeType !== 1 || contentTypes !== null && contentTypes !== void 0 && contentTypes.includes('embedded') || controlValueRoles.includes(role)) {
return '';
}
if (!context.subtreeDescendant && !context.inLabelledByContext && !named_from_contents_default(virtualNode, {
strict: strict
})) {
return '';
}
if (!strict) {
var subtreeDescendant = !inControlContext && !inLabelledByContext;
context = _extends({
subtreeDescendant: subtreeDescendant
}, context);
}
return get_owned_virtual_default(virtualNode).reduce(function(contentText, child) {
return appendAccessibleText(contentText, child, context);
}, '');
}
var phrasingElements = get_elements_by_content_type_default('phrasing').concat([ '#text' ]);
function appendAccessibleText(contentText, virtualNode, context) {
var nodeName2 = virtualNode.props.nodeName;
var contentTextAdd = _accessibleTextVirtual(virtualNode, context);
if (!contentTextAdd) {
return contentText;
}
if (!phrasingElements.includes(nodeName2)) {
if (contentTextAdd[0] !== ' ') {
contentTextAdd += ' ';
}
if (contentText && contentText[contentText.length - 1] !== ' ') {
contentTextAdd = ' ' + contentTextAdd;
}
}
return contentText + contentTextAdd;
}
var subtree_text_default = subtreeText;
function accessibleText(element, context) {
var virtualNode = get_node_from_tree_default(element);
return _accessibleTextVirtual(virtualNode, context);
}
var accessible_text_default = accessibleText;
function labelText(virtualNode) {
var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var alreadyProcessed2 = _accessibleTextVirtual.alreadyProcessed;
if (context.inControlContext || context.inLabelledByContext || alreadyProcessed2(virtualNode, context)) {
return '';
}
if (!context.startNode) {
context.startNode = virtualNode;
}
var labelContext = _extends({
inControlContext: true
}, context);
var internals = virtualNode.elementInternals;
if (internals) {
try {
var internalLabels = Array.from(internals.labels);
return internalLabels.map(function(label3) {
return accessible_text_default(label3, labelContext);
}).filter(function(text) {
return text !== '';
}).join(' ');
} catch (_unused4) {}
}
var explicitLabels = getExplicitLabels(virtualNode);
var implicitLabel = closest_default(virtualNode, 'label');
var labels;
if (implicitLabel) {
labels = [].concat(_toConsumableArray(explicitLabels), [ implicitLabel.actualNode ]);
labels.sort(node_sorter_default);
} else {
labels = explicitLabels;
}
return labels.map(function(label3) {
return accessible_text_default(label3, labelContext);
}).filter(function(text) {
return text !== '';
}).join(' ');
}
function getExplicitLabels(virtualNode) {
if (!virtualNode.attr('id')) {
return [];
}
if (!virtualNode.actualNode) {
throw new TypeError('Cannot resolve explicit label reference for non-DOM nodes');
}
return find_elms_in_context_default({
elm: 'label',
attr: 'for',
value: virtualNode.attr('id'),
context: virtualNode.actualNode
});
}
var label_text_default = labelText;
var defaultButtonValues = {
submit: 'Submit',
image: 'Submit',
reset: 'Reset',
button: ''
};
var nativeTextMethods = {
valueText: function valueText(vNode) {
return vNode.props.value || '';
},
buttonDefaultText: function buttonDefaultText(vNode) {
return defaultButtonValues[vNode.props.type] || '';
},
tableCaptionText: descendantText.bind(null, 'caption'),
figureText: descendantText.bind(null, 'figcaption'),
svgTitleText: descendantText.bind(null, 'title'),
fieldsetLegendText: descendantText.bind(null, 'legend'),
altText: attrText.bind(null, 'alt'),
tableSummaryText: attrText.bind(null, 'summary'),
titleText: title_text_default,
subtreeText: subtree_text_default,
labelText: label_text_default,
singleSpace: function singleSpace() {
return ' ';
},
placeholderText: attrText.bind(null, 'placeholder')
};
function attrText(attr, vNode) {
return vNode.attr(attr) || '';
}
function descendantText(nodeName2, _ref84, context) {
var actualNode = _ref84.actualNode;
nodeName2 = nodeName2.toLowerCase();
var nodeNames2 = [ nodeName2, actualNode.nodeName.toLowerCase() ].join(',');
var candidate = actualNode.querySelector(nodeNames2);
if (!candidate || candidate.nodeName.toLowerCase() !== nodeName2) {
return '';
}
return accessible_text_default(candidate, context);
}
var native_text_methods_default = nativeTextMethods;
function _nativeTextAlternative(virtualNode) {
var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var actualNode = virtualNode.actualNode;
if (virtualNode.props.nodeType !== 1 || [ 'presentation', 'none' ].includes(get_role_default(virtualNode))) {
return '';
}
var textMethods = findTextMethods(virtualNode);
var accessibleName = textMethods.reduce(function(accName, step) {
return accName || step(virtualNode, context);
}, '');
if (context.debug) {
axe.log(accessibleName || '{empty-value}', actualNode, context);
}
return accessibleName;
}
function findTextMethods(virtualNode) {
var elmSpec = get_element_spec_default(virtualNode, {
noMatchAccessibleName: true
});
var methods = elmSpec.namingMethods || [];
var textMethods = methods.map(function(methodName) {
return native_text_methods_default[methodName];
});
var internals = virtualNode.elementInternals;
if (internals && !methods.includes('labelText')) {
try {
if (internals.labels) {
textMethods.push(native_text_methods_default.labelText);
}
} catch (_unused5) {}
}
return textMethods;
}
function _accessibleTextVirtual(virtualNode) {
var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
context = prepareContext(virtualNode, context);
if (shouldIgnoreHidden(virtualNode, context)) {
return '';
}
if (shouldIgnoreIconLigature(virtualNode, context)) {
return '';
}
var computationSteps = [ arialabelledby_text_default, _arialabelText, _nativeTextAlternative, form_control_value_default, subtree_text_default, textNodeValue, title_text_default ];
var accessibleName = computationSteps.reduce(function(accName, step) {
if (context.startNode === virtualNode) {
accName = sanitize_default(accName);
}
if (accName !== '') {
return accName;
}
return step(virtualNode, context);
}, '');
if (context.debug) {
axe.log(accessibleName || '{empty-value}', virtualNode.actualNode, context);
}
return accessibleName;
}
function textNodeValue(virtualNode) {
if (virtualNode.props.nodeType !== 3) {
return '';
}
return virtualNode.props.nodeValue;
}
function shouldIgnoreHidden(virtualNode, context) {
if (!virtualNode) {
return false;
}
if (context.includeHidden && !nativelyHidden(virtualNode)) {
return false;
}
if (virtualNode.props.nodeType !== 1) {
return false;
}
return !_isVisibleToScreenReaders(virtualNode);
}
function shouldIgnoreIconLigature(virtualNode, context) {
var _context$occurrenceTh;
var ignoreIconLigature = context.ignoreIconLigature, pixelThreshold = context.pixelThreshold;
var occurrenceThreshold = (_context$occurrenceTh = context.occurrenceThreshold) !== null && _context$occurrenceTh !== void 0 ? _context$occurrenceTh : context.occuranceThreshold;
if (virtualNode.props.nodeType !== 3 || !ignoreIconLigature) {
return false;
}
return _isIconLigature(virtualNode, pixelThreshold, occurrenceThreshold);
}
function prepareContext(virtualNode, context) {
if (!context.startNode) {
context = _extends({
startNode: virtualNode
}, context);
}
if (virtualNode.props.nodeType === 1 && context.inLabelledByContext && context.includeHidden === void 0) {
context = _extends({
includeHidden: !_isVisibleToScreenReaders(virtualNode)
}, context);
}
return context;
}
_accessibleTextVirtual.alreadyProcessed = function alreadyProcessed(virtualnode, context) {
context.processed = context.processed || [];
if (context.processed.includes(virtualnode)) {
return true;
}
context.processed.push(virtualnode);
return false;
};
function removeUnicode(str, options) {
var emoji = options.emoji, nonBmp = options.nonBmp, punctuations = options.punctuations, _options$replaceWith = options.replaceWith, replaceWith = _options$replaceWith === void 0 ? '' : _options$replaceWith;
var replacer = function replacer() {
return replaceWith;
};
if (emoji) {
str = str.replace(emoji_regex_default(), replacer);
}
if (nonBmp) {
str = str.replace(getUnicodeNonBmpRegExp(), replacer).replace(getSupplementaryPrivateUseRegExp(), replacer).replace(getCategoryFormatRegExp(), replacer).replace(getVariationSelectorRegExp(), replacer);
}
if (punctuations) {
str = str.replace(getPunctuationRegExp(), replacer);
}
return str;
}
var remove_unicode_default = removeUnicode;
function isHumanInterpretable(str) {
if (isEmpty(str) || isNonDigitCharacter(str) || isSymbolicText(str) || isUnicodeOrPunctuation(str)) {
return 0;
}
return 1;
}
function isEmpty(str) {
return sanitize_default(str).length === 0;
}
function isNonDigitCharacter(str) {
return str.length === 1 && str.match(/\D/);
}
function isSymbolicText(str) {
var symbolicText = [ 'aa', 'abc' ];
return symbolicText.includes(str.toLowerCase());
}
function isUnicodeOrPunctuation(str) {
var noUnicodeStr = remove_unicode_default(str, {
emoji: true,
nonBmp: true,
punctuations: true
});
return !sanitize_default(noUnicodeStr);
}
var is_human_interpretable_default = isHumanInterpretable;
var _autocomplete = {
stateTerms: [ 'on', 'off' ],
standaloneTerms: [ 'name', 'honorific-prefix', 'given-name', 'additional-name', 'family-name', 'honorific-suffix', 'nickname', 'username', 'new-password', 'current-password', 'organization-title', 'organization', 'street-address', 'address-line1', 'address-line2', 'address-line3', 'address-level4', 'address-level3', 'address-level2', 'address-level1', 'country', 'country-name', 'postal-code', 'cc-name', 'cc-given-name', 'cc-additional-name', 'cc-family-name', 'cc-number', 'cc-exp', 'cc-exp-month', 'cc-exp-year', 'cc-csc', 'cc-type', 'transaction-currency', 'transaction-amount', 'language', 'bday', 'bday-day', 'bday-month', 'bday-year', 'sex', 'url', 'photo', 'one-time-code' ],
qualifiers: [ 'home', 'work', 'mobile', 'fax', 'pager' ],
qualifiedTerms: [ 'tel', 'tel-country-code', 'tel-national', 'tel-area-code', 'tel-local', 'tel-local-prefix', 'tel-local-suffix', 'tel-extension', 'email', 'impp' ],
locations: [ 'billing', 'shipping' ]
};
function isValidAutocomplete(autocompleteValue) {
var _ref85 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, _ref85$looseTyped = _ref85.looseTyped, looseTyped = _ref85$looseTyped === void 0 ? false : _ref85$looseTyped, _ref85$stateTerms = _ref85.stateTerms, stateTerms = _ref85$stateTerms === void 0 ? [] : _ref85$stateTerms, _ref85$locations = _ref85.locations, locations = _ref85$locations === void 0 ? [] : _ref85$locations, _ref85$qualifiers = _ref85.qualifiers, qualifiers = _ref85$qualifiers === void 0 ? [] : _ref85$qualifiers, _ref85$standaloneTerm = _ref85.standaloneTerms, standaloneTerms = _ref85$standaloneTerm === void 0 ? [] : _ref85$standaloneTerm, _ref85$qualifiedTerms = _ref85.qualifiedTerms, qualifiedTerms = _ref85$qualifiedTerms === void 0 ? [] : _ref85$qualifiedTerms, _ref85$ignoredValues = _ref85.ignoredValues, ignoredValues = _ref85$ignoredValues === void 0 ? [] : _ref85$ignoredValues;
autocompleteValue = autocompleteValue.toLowerCase().trim();
stateTerms = stateTerms.concat(_autocomplete.stateTerms);
if (stateTerms.includes(autocompleteValue) || autocompleteValue === '') {
return true;
}
qualifiers = qualifiers.concat(_autocomplete.qualifiers);
locations = locations.concat(_autocomplete.locations);
standaloneTerms = standaloneTerms.concat(_autocomplete.standaloneTerms);
qualifiedTerms = qualifiedTerms.concat(_autocomplete.qualifiedTerms);
var autocompleteTerms = autocompleteValue.split(/\s+/g);
if (autocompleteTerms[autocompleteTerms.length - 1] === 'webauthn') {
autocompleteTerms.pop();
if (autocompleteTerms.length === 0) {
return false;
}
}
if (!looseTyped) {
if (autocompleteTerms[0].length > 8 && autocompleteTerms[0].substr(0, 8) === 'section-') {
autocompleteTerms.shift();
}
if (locations.includes(autocompleteTerms[0])) {
autocompleteTerms.shift();
}
if (qualifiers.includes(autocompleteTerms[0])) {
autocompleteTerms.shift();
standaloneTerms = [];
}
if (autocompleteTerms.length !== 1) {
return false;
}
}
var purposeTerm = autocompleteTerms[autocompleteTerms.length - 1];
if (ignoredValues.includes(purposeTerm)) {
return void 0;
}
return standaloneTerms.includes(purposeTerm) || qualifiedTerms.includes(purposeTerm);
}
var is_valid_autocomplete_default = isValidAutocomplete;
function labelVirtual(virtualNode) {
var ref, candidate;
if (_hasAriaValue(virtualNode, 'aria-labelledby')) {
ref = _getResolvedRefs(virtualNode, 'aria-labelledby');
candidate = ref.map(function(vNode) {
return vNode ? visible_virtual_default(vNode) : '';
}).join(' ').trim();
if (candidate) {
return candidate;
}
}
candidate = _getAriaValue(virtualNode, 'aria-label').value;
if (candidate) {
candidate = sanitize_default(candidate);
if (candidate) {
return candidate;
}
}
return null;
}
var label_virtual_default = labelVirtual;
function visible(element, screenReader, noRecursing) {
element = get_node_from_tree_default(element);
return visible_virtual_default(element, screenReader, noRecursing);
}
var visible_default = visible;
function labelVirtual2(virtualNode) {
var ref, candidate, doc;
candidate = label_virtual_default(virtualNode);
if (candidate) {
return candidate;
}
if (virtualNode.attr('id')) {
if (!virtualNode.actualNode) {
throw new TypeError('Cannot resolve explicit label reference for non-DOM nodes');
}
var _id2 = escape_selector_default(virtualNode.attr('id'));
doc = get_root_node_default2(virtualNode.actualNode);
ref = doc.querySelector('label[for="' + _id2 + '"]');
candidate = ref && visible_default(ref, true);
if (candidate) {
return candidate;
}
}
ref = closest_default(virtualNode, 'label');
candidate = ref && visible_virtual_default(ref, true);
if (candidate) {
return candidate;
}
return null;
}
var label_virtual_default2 = labelVirtual2;
function label(node) {
node = get_node_from_tree_default(node);
return label_virtual_default2(node);
}
var label_default = label;
var nativeElementType = [ {
matches: [ {
nodeName: 'textarea'
}, {
nodeName: 'input',
properties: {
type: [ 'text', 'password', 'search', 'tel', 'email', 'url' ]
}
} ],
namingMethods: 'labelText'
}, {
matches: {
nodeName: 'input',
properties: {
type: [ 'button', 'submit', 'reset' ]
}
},
namingMethods: [ 'valueText', 'titleText', 'buttonDefaultText' ]
}, {
matches: {
nodeName: 'input',
properties: {
type: 'image'
}
},
namingMethods: [ 'altText', 'valueText', 'labelText', 'titleText', 'buttonDefaultText' ]
}, {
matches: 'button',
namingMethods: 'subtreeText'
}, {
matches: 'fieldset',
namingMethods: 'fieldsetLegendText'
}, {
matches: 'OUTPUT',
namingMethods: 'subtreeText'
}, {
matches: [ {
nodeName: 'select'
}, {
nodeName: 'input',
properties: {
type: /^(?!text|password|search|tel|email|url|button|submit|reset)/
}
} ],
namingMethods: 'labelText'
}, {
matches: 'summary',
namingMethods: 'subtreeText'
}, {
matches: 'figure',
namingMethods: [ 'figureText', 'titleText' ]
}, {
matches: 'img',
namingMethods: 'altText'
}, {
matches: 'table',
namingMethods: [ 'tableCaptionText', 'tableSummaryText' ]
}, {
matches: [ 'hr', 'br' ],
namingMethods: [ 'titleText', 'singleSpace' ]
} ];
var native_element_type_default = nativeElementType;
function visibleTextNodes(vNode) {
var parentVisible = _isVisibleOnScreen(vNode);
var nodes = [];
vNode.children.forEach(function(child) {
if (child.actualNode.nodeType === 3) {
if (parentVisible) {
nodes.push(child);
}
} else {
nodes = nodes.concat(visibleTextNodes(child));
}
});
return nodes;
}
var visible_text_nodes_default = visibleTextNodes;
function getVisibleChildTextRects(node) {
return getVisibleChildTextRectsVirtual(get_node_from_tree_default(node));
}
var getVisibleChildTextRectsVirtual = memoize_default(function getVisibleChildTextRectsMemoized(vNode) {
var node = vNode.actualNode;
var nodeRect = vNode.boundingClientRect;
var clientRects = [];
var overflowHiddenNodes = get_overflow_hidden_ancestors_default(vNode);
node.childNodes.forEach(function(textNode) {
if (textNode.nodeType !== 3 || sanitize_default(textNode.nodeValue) === '') {
return;
}
var contentRects = getContentRects(textNode);
if (isOutsideNodeBounds(contentRects, nodeRect)) {
return;
}
clientRects.push.apply(clientRects, _toConsumableArray(filterHiddenRects(contentRects, overflowHiddenNodes)));
});
return clientRects.length ? clientRects : filterHiddenRects([ nodeRect ], overflowHiddenNodes);
}, {
primitive: true
});
var get_visible_child_text_rects_default = getVisibleChildTextRects;
function getContentRects(node) {
var range2 = document.createRange();
range2.selectNodeContents(node);
return Array.from(range2.getClientRects());
}
function isOutsideNodeBounds(rects, nodeRect) {
return rects.some(function(rect) {
var centerPoint = _getRectCenter(rect);
return !_isPointInRect(centerPoint, nodeRect);
});
}
function filterHiddenRects(contentRects, overflowHiddenNodes) {
var visibleRects = [];
contentRects.forEach(function(contentRect) {
if (contentRect.width < 1 || contentRect.height < 1) {
return;
}
var visibleRect = overflowHiddenNodes.reduce(function(rect, overflowNode) {
return rect && _getIntersectionRect(rect, overflowNode.boundingClientRect);
}, contentRect);
if (visibleRect) {
visibleRects.push(visibleRect);
}
});
return visibleRects;
}
function getTextElementStack(node) {
var grid = _getNodeGrid(node);
if (!grid) {
return [];
}
var clientRects = get_visible_child_text_rects_default(node);
return clientRects.map(function(rect) {
return getRectStack(grid, rect);
});
}
var get_text_element_stack_default = getTextElementStack;
var visualRoles = [ 'checkbox', 'img', 'meter', 'progressbar', 'scrollbar', 'radio', 'slider', 'spinbutton', 'textbox' ];
function isVisualContent(el) {
var _nodeLookup24 = _nodeLookup(el), vNode = _nodeLookup24.vNode;
var role = axe.commons.aria.getExplicitRole(vNode);
if (role) {
return visualRoles.indexOf(role) !== -1;
}
switch (vNode.props.nodeName) {
case 'img':
case 'iframe':
case 'object':
case 'video':
case 'audio':
case 'canvas':
case 'svg':
case 'math':
case 'button':
case 'select':
case 'textarea':
case 'keygen':
case 'progress':
case 'meter':
return true;
case 'input':
return vNode.props.type !== 'hidden';
default:
return false;
}
}
var is_visual_content_default = isVisualContent;
var hiddenTextElms = [ 'head', 'title', 'template', 'script', 'style', 'iframe', 'object', 'video', 'audio', 'noscript' ];
function hasChildTextNodes(elm) {
if (hiddenTextElms.includes(elm.props.nodeName)) {
return false;
}
return elm.children.some(function(_ref86) {
var props = _ref86.props;
return props.nodeType === 3 && props.nodeValue.trim();
});
}
function hasContentVirtual(elm, noRecursion, ignoreAria) {
return hasChildTextNodes(elm) || is_visual_content_default(elm.actualNode) || !ignoreAria && !!label_virtual_default(elm) || !noRecursion && elm.children.some(function(child) {
return child.actualNode.nodeType === 1 && hasContentVirtual(child);
});
}
var has_content_virtual_default = hasContentVirtual;
function hasContent(elm, noRecursion, ignoreAria) {
elm = get_node_from_tree_default(elm);
return has_content_virtual_default(elm, noRecursion, ignoreAria);
}
var has_content_default = hasContent;
function _hasLangText(virtualNode) {
if (typeof virtualNode.children === 'undefined' || hasChildTextNodes(virtualNode)) {
return true;
}
if (virtualNode.props.nodeType === 1 && is_visual_content_default(virtualNode)) {
return !!axe.commons.text.accessibleTextVirtual(virtualNode);
}
return virtualNode.children.some(function(child) {
return !child.attr('lang') && _hasLangText(child) && !_isHiddenForEveryone(child);
});
}
function _hasSameDestination(vNodeA, vNodeB) {
var destination = getDestination(vNodeA);
return !!destination && destination === getDestination(vNodeB);
}
function getDestination(vNode) {
if (![ 'a', 'area' ].includes(vNode.props.nodeName) || !vNode.hasAttr('href')) {
return null;
}
var href = vNode.attr('href').trim();
var url;
try {
url = new window.URL(href, document.baseURI);
} catch (_unused6) {
return null;
}
if (href === '' || url.protocol === 'javascript:' || url.href.endsWith('#')) {
return null;
}
return url.href;
}
function _insertedIntoFocusOrder(node) {
var _nodeLookup25 = _nodeLookup(node), vNode = _nodeLookup25.vNode;
var tabIndex = parse_tabindex_default(vNode.attr('tabindex'));
return tabIndex > -1 && _isFocusable(node) && !is_natively_focusable_default(node);
}
function isHiddenWithCSS(el, descendentVisibilityValue) {
var _nodeLookup26 = _nodeLookup(el), vNode = _nodeLookup26.vNode, domNode = _nodeLookup26.domNode;
if (!vNode) {
return _isHiddenWithCSS(domNode, descendentVisibilityValue);
}
if (vNode._isHiddenWithCSS === void 0) {
vNode._isHiddenWithCSS = _isHiddenWithCSS(domNode, descendentVisibilityValue);
}
return vNode._isHiddenWithCSS;
}
function _isHiddenWithCSS(el, descendentVisibilityValue) {
if (el.nodeType === 9) {
return false;
}
if (el.nodeType === 11) {
el = el.host;
}
if ([ 'STYLE', 'SCRIPT' ].includes(el.nodeName.toUpperCase())) {
return false;
}
var style = window.getComputedStyle(el, null);
if (!style) {
throw new Error('Style does not exist for the given element.');
}
var displayValue = style.getPropertyValue('display');
if (displayValue === 'none') {
return true;
}
var HIDDEN_VISIBILITY_VALUES = [ 'hidden', 'collapse' ];
var visibilityValue = style.getPropertyValue('visibility');
if (HIDDEN_VISIBILITY_VALUES.includes(visibilityValue) && !descendentVisibilityValue) {
return true;
}
if (HIDDEN_VISIBILITY_VALUES.includes(visibilityValue) && descendentVisibilityValue && HIDDEN_VISIBILITY_VALUES.includes(descendentVisibilityValue)) {
return true;
}
var parent = get_composed_parent_default(el);
if (parent && !HIDDEN_VISIBILITY_VALUES.includes(visibilityValue)) {
return isHiddenWithCSS(parent, visibilityValue);
}
return false;
}
var is_hidden_with_css_default = isHiddenWithCSS;
function isHTML5(doc) {
var node = doc.doctype;
if (node === null) {
return false;
}
return node.name === 'html' && !node.publicId && !node.systemId;
}
var is_html5_default = isHTML5;
function getRoleType(role) {
var _window3;
if (role instanceof abstract_virtual_node_default || (_window3 = window) !== null && _window3 !== void 0 && _window3.Node && role instanceof window.Node) {
role = axe.commons.aria.getRole(role);
}
var roleDef = standards_default.ariaRoles[role];
return (roleDef === null || roleDef === void 0 ? void 0 : roleDef.type) || null;
}
var get_role_type_default = getRoleType;
var blockLike = [ 'block', 'list-item', 'table', 'flex', 'grid' ];
var inlineBlockLike = [ 'inline-block', 'inline-flex', 'inline-grid' ];
function isInTextBlock(node) {
var _ref87 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, noLengthCompare = _ref87.noLengthCompare, _ref87$includeInlineB = _ref87.includeInlineBlock, includeInlineBlock = _ref87$includeInlineB === void 0 ? false : _ref87$includeInlineB;
var _nodeLookup27 = _nodeLookup(node), vNode = _nodeLookup27.vNode, domNode = _nodeLookup27.domNode;
if (isBlock(domNode) || !includeInlineBlock && isInlineBlockLike(vNode)) {
return false;
}
var virtualParent = getBlockParent(domNode);
var parentText = '';
var widgetText = '';
var inBrBlock = 0;
walkDomNode(virtualParent, function(currNode) {
if (currNode === virtualParent.actualNode) {
return true;
}
if (inBrBlock === 2) {
return false;
}
if (currNode.nodeType === 3) {
parentText += currNode.nodeValue;
}
if (currNode.nodeType !== 1) {
return;
}
var nodeName2 = (currNode.nodeName || '').toUpperCase();
if (currNode === domNode) {
inBrBlock = 1;
}
var nodeIsBlock = isBlock(currNode);
if (nodeIsBlock || [ 'BR', 'HR' ].includes(nodeName2)) {
if (inBrBlock === 0) {
parentText = '';
widgetText = '';
} else {
inBrBlock = 2;
}
}
if (nodeIsBlock || currNode.style.display === 'none' || currNode.style.overflow === 'hidden' || ![ '', null, 'none' ].includes(currNode.style['float']) || ![ '', null, 'relative' ].includes(currNode.style.position)) {
return false;
} else if (get_role_type_default(currNode) === 'widget') {
widgetText += currNode.textContent;
return false;
}
});
parentText = sanitize_default(parentText);
if (noLengthCompare) {
return parentText.length !== 0;
}
widgetText = sanitize_default(widgetText);
return parentText.length > widgetText.length;
}
var is_in_text_block_default = isInTextBlock;
function isBlock(node) {
var _nodeLookup28 = _nodeLookup(node), vNode = _nodeLookup28.vNode;
var display2 = vNode.getComputedStylePropertyValue('display');
return blockLike.includes(display2) || display2.substr(0, 6) === 'table-';
}
function isInlineBlockLike(vNode) {
var display2 = vNode.getComputedStylePropertyValue('display');
return inlineBlockLike.includes(display2);
}
function walkDomNode(node, functor) {
if (functor(node.actualNode) !== false) {
node.children.forEach(function(child) {
return walkDomNode(child, functor);
});
}
}
function getBlockParent(node) {
var parentBlock = get_composed_parent_default(node);
while (parentBlock && !isBlock(parentBlock)) {
parentBlock = get_composed_parent_default(parentBlock);
}
return get_node_from_tree_default(parentBlock);
}
function isModalOpen(options) {
options = options || {};
var modalPercent = options.modalPercent || .75;
if (cache_default.get('isModalOpen')) {
return cache_default.get('isModalOpen');
}
var definiteModals = query_selector_all_filter_default(axe._tree[0], 'dialog, [role=dialog], [aria-modal=true]', _isVisibleOnScreen);
if (definiteModals.length) {
cache_default.set('isModalOpen', true);
return true;
}
var viewport = get_viewport_size_default(window);
var percentWidth = viewport.width * modalPercent;
var percentHeight = viewport.height * modalPercent;
var x = (viewport.width - percentWidth) / 2;
var y = (viewport.height - percentHeight) / 2;
var points = [ {
x: x,
y: y
}, {
x: viewport.width - x,
y: y
}, {
x: viewport.width / 2,
y: viewport.height / 2
}, {
x: x,
y: viewport.height - y
}, {
x: viewport.width - x,
y: viewport.height - y
} ];
var stacks = points.map(function(point) {
return Array.from(document.elementsFromPoint(point.x, point.y));
});
var _loop5 = function _loop5() {
var modalElement = stacks[_i16].find(function(elm) {
var style = window.getComputedStyle(elm);
return parseInt(style.width, 10) >= percentWidth && parseInt(style.height, 10) >= percentHeight && style.getPropertyValue('pointer-events') !== 'none' && (style.position === 'absolute' || style.position === 'fixed');
});
if (modalElement && stacks.every(function(stack) {
return stack.includes(modalElement);
})) {
cache_default.set('isModalOpen', true);
return {
v: true
};
}
}, _ret2;
for (var _i16 = 0; _i16 < stacks.length; _i16++) {
_ret2 = _loop5();
if (_ret2) {
return _ret2.v;
}
}
cache_default.set('isModalOpen', void 0);
return void 0;
}
var is_modal_open_default = isModalOpen;
function _isMultiline(domNode) {
var margin = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;
var range2 = domNode.ownerDocument.createRange();
range2.setStart(domNode, 0);
range2.setEnd(domNode, domNode.childNodes.length);
var lastLineEnd = 0;
var lineCount = 0;
var _iterator14 = _createForOfIteratorHelper(range2.getClientRects()), _step14;
try {
for (_iterator14.s(); !(_step14 = _iterator14.n()).done; ) {
var rect = _step14.value;
if (rect.height <= margin) {
continue;
}
if (lastLineEnd > rect.top + margin) {
lastLineEnd = Math.max(lastLineEnd, rect.bottom);
} else if (lineCount === 0) {
lastLineEnd = rect.bottom;
lineCount++;
} else {
return true;
}
}
} catch (err) {
_iterator14.e(err);
} finally {
_iterator14.f();
}
return false;
}
function isNode(element) {
return element instanceof window.Node;
}
var is_node_default = isNode;
var cacheKey = 'color.incompleteData';
var incompleteData = {
set: function set(key, reason) {
if (typeof key !== 'string') {
throw new Error('Incomplete data: key must be a string');
}
var data = cache_default.get(cacheKey, function() {
return {};
});
if (reason) {
data[key] = reason;
}
return data[key];
},
get: function get(key) {
var data = cache_default.get(cacheKey);
return data === null || data === void 0 ? void 0 : data[key];
},
clear: function clear() {
cache_default.set(cacheKey, {});
}
};
var incomplete_data_default = incompleteData;
function elementHasImage(elm, style) {
var graphicNodes = [ 'IMG', 'CANVAS', 'OBJECT', 'IFRAME', 'VIDEO', 'SVG' ];
var nodeName2 = elm.nodeName.toUpperCase();
if (graphicNodes.includes(nodeName2)) {
incomplete_data_default.set('bgColor', 'imgNode');
return true;
}
style = style || window.getComputedStyle(elm);
var bgImageStyle = style.getPropertyValue('background-image');
var hasBgImage = bgImageStyle !== 'none';
if (hasBgImage) {
var hasGradient = /gradient/.test(bgImageStyle);
incomplete_data_default.set('bgColor', hasGradient ? 'bgGradient' : 'bgImage');
}
return hasBgImage;
}
var element_has_image_default = elementHasImage;
var hexRegex = /^#[0-9a-f]{3,8}$/i;
var _Color2 = function() {
function Color2(red, green, blue) {
var alpha = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1;
_classCallCheck(this, Color2);
if (red instanceof _Color2) {
var r = red.r, g2 = red.g, b3 = red.b;
this.r = r;
this.g = g2;
this.b = b3;
this.alpha = red.alpha;
return;
}
this.red = red;
this.green = green;
this.blue = blue;
this.alpha = alpha;
}
return _createClass(Color2, [ {
key: 'r',
get: function get() {
return this._r;
},
set: function set(value) {
this._r = value;
this._red = Math.round(clamp2(value, 0, 1) * 255);
}
}, {
key: 'g',
get: function get() {
return this._g;
},
set: function set(value) {
this._g = value;
this._green = Math.round(clamp2(value, 0, 1) * 255);
}
}, {
key: 'b',
get: function get() {
return this._b;
},
set: function set(value) {
this._b = value;
this._blue = Math.round(clamp2(value, 0, 1) * 255);
}
}, {
key: 'red',
get: function get() {
return this._red;
},
set: function set(value) {
this._r = value / 255;
this._red = clamp2(value, 0, 255);
}
}, {
key: 'green',
get: function get() {
return this._green;
},
set: function set(value) {
this._g = value / 255;
this._green = clamp2(value, 0, 255);
}
}, {
key: 'blue',
get: function get() {
return this._blue;
},
set: function set(value) {
this._b = value / 255;
this._blue = clamp2(value, 0, 255);
}
}, {
key: 'toHexString',
value: function toHexString() {
var redString = Math.round(this.red).toString(16);
var greenString = Math.round(this.green).toString(16);
var blueString = Math.round(this.blue).toString(16);
return '#' + (this.red > 15.5 ? redString : '0' + redString) + (this.green > 15.5 ? greenString : '0' + greenString) + (this.blue > 15.5 ? blueString : '0' + blueString);
}
}, {
key: 'toJSON',
value: function toJSON() {
var red = this.red, green = this.green, blue = this.blue, alpha = this.alpha;
return {
red: red,
green: green,
blue: blue,
alpha: alpha
};
}
}, {
key: 'parseString',
value: function parseString(colorString) {
var _color$alpha2;
var parsedColors = cache_default.get('parsedColors', function() {
return {};
});
var color = parsedColors[colorString];
if (!color) {
var cacheKey2 = colorString;
try {
var prototypeArrayFrom;
if ('Prototype' in window && 'Version' in window.Prototype) {
prototypeArrayFrom = Array.from;
Array.from = import_from2['default'];
}
color = new src_default(colorString).toGamut({
space: 'srgb',
method: 'clip'
}).to('srgb');
if (prototypeArrayFrom) {
Array.from = prototypeArrayFrom;
prototypeArrayFrom = null;
}
} catch (_unused7) {
incomplete_data_default.set('colorParse', colorString);
throw new Error('Unable to parse color "'.concat(colorString, '"'));
}
parsedColors[cacheKey2] = color;
}
this.r = color.r;
this.g = color.g;
this.b = color.b;
this.alpha = +((_color$alpha2 = color.alpha) !== null && _color$alpha2 !== void 0 ? _color$alpha2 : 0);
return this;
}
}, {
key: 'parseRgbString',
value: function parseRgbString(colorString) {
this.parseString(colorString);
}
}, {
key: 'parseHexString',
value: function parseHexString(colorString) {
if (!colorString.match(hexRegex) || [ 6, 8 ].includes(colorString.length)) {
return;
}
this.parseString(colorString);
}
}, {
key: 'parseColorFnString',
value: function parseColorFnString(colorString) {
this.parseString(colorString);
}
}, {
key: 'getRelativeLuminance',
value: function getRelativeLuminance() {
var rSRGB = this.r, gSRGB = this.g, bSRGB = this.b;
var r = rSRGB <= .04045 ? rSRGB / 12.92 : Math.pow((rSRGB + .055) / 1.055, 2.4);
var g2 = gSRGB <= .04045 ? gSRGB / 12.92 : Math.pow((gSRGB + .055) / 1.055, 2.4);
var b3 = bSRGB <= .04045 ? bSRGB / 12.92 : Math.pow((bSRGB + .055) / 1.055, 2.4);
return .2126 * r + .7152 * g2 + .0722 * b3;
}
}, {
key: 'getLuminosity',
value: function getLuminosity() {
return .3 * this.r + .59 * this.g + .11 * this.b;
}
}, {
key: 'setLuminosity',
value: function setLuminosity(L) {
var d2 = L - this.getLuminosity();
return addToChannels(this, d2).clip();
}
}, {
key: 'getSaturation',
value: function getSaturation() {
return Math.max(this.r, this.g, this.b) - Math.min(this.r, this.g, this.b);
}
}, {
key: 'setSaturation',
value: function setSaturation(s) {
var C = new _Color2(this);
var colorEntires = [ {
name: 'r',
value: C.r
}, {
name: 'g',
value: C.g
}, {
name: 'b',
value: C.b
} ];
var _colorEntires$sort = colorEntires.sort(function(a2, b3) {
return a2.value - b3.value;
}), _colorEntires$sort2 = _slicedToArray(_colorEntires$sort, 3), Cmin = _colorEntires$sort2[0], Cmid = _colorEntires$sort2[1], Cmax = _colorEntires$sort2[2];
if (Cmax.value > Cmin.value) {
Cmid.value = (Cmid.value - Cmin.value) * s / (Cmax.value - Cmin.value);
Cmax.value = s;
} else {
Cmid.value = Cmax.value = 0;
}
Cmin.value = 0;
C[Cmax.name] = Cmax.value;
C[Cmin.name] = Cmin.value;
C[Cmid.name] = Cmid.value;
return C;
}
}, {
key: 'clip',
value: function clip() {
var C = new _Color2(this);
var L = C.getLuminosity();
var n3 = Math.min(C.r, C.g, C.b);
var x = Math.max(C.r, C.g, C.b);
if (n3 < 0) {
C.r = L + (C.r - L) * L / (L - n3);
C.g = L + (C.g - L) * L / (L - n3);
C.b = L + (C.b - L) * L / (L - n3);
}
if (x > 1) {
C.r = L + (C.r - L) * (1 - L) / (x - L);
C.g = L + (C.g - L) * (1 - L) / (x - L);
C.b = L + (C.b - L) * (1 - L) / (x - L);
}
return C;
}
} ]);
}();
var color_default2 = _Color2;
function clamp2(value, min, max2) {
return Math.min(Math.max(min, value), max2);
}
function addToChannels(color, value) {
var C = new _Color2(color);
C.r += value;
C.g += value;
C.b += value;
return C;
}
function getOwnBackgroundColor(elmStyle) {
var bgColor = new color_default2();
bgColor.parseString(elmStyle.getPropertyValue('background-color'));
if (bgColor.alpha !== 0) {
var opacity = elmStyle.getPropertyValue('opacity');
bgColor.alpha = bgColor.alpha * opacity;
}
return bgColor;
}
var get_own_background_color_default = getOwnBackgroundColor;
function isOpaque(node) {
var style = window.getComputedStyle(node);
return element_has_image_default(node, style) || get_own_background_color_default(style).alpha === 1;
}
var is_opaque_default = isOpaque;
function _isSeparateTarget(vNode, vOther) {
return get_role_type_default(vOther) === 'widget' && _isFocusable(vOther) && !_hasSameDestination(vNode, vOther);
}
function _isSkipLink(element) {
if (!element.href) {
return false;
}
var firstPageLink = cache_default.get('firstPageLink', generateFirstPageLink);
if (!firstPageLink) {
return true;
}
return element.compareDocumentPosition(firstPageLink.actualNode) === element.DOCUMENT_POSITION_FOLLOWING;
}
function generateFirstPageLink() {
var firstPageLink;
if (!window.location.origin) {
firstPageLink = query_selector_all_default(axe._tree, 'a:not([href^="#"]):not([href^="/#"]):not([href^="javascript:"])')[0];
} else {
firstPageLink = query_selector_all_default(axe._tree, 'a[href]:not([href^="javascript:"])').find(function(link) {
return !_isCurrentPageLink(link.actualNode);
});
}
return firstPageLink || null;
}
var clipRegex2 = /rect\s*\(([0-9]+)px,?\s*([0-9]+)px,?\s*([0-9]+)px,?\s*([0-9]+)px\s*\)/;
var clipPathRegex2 = /(\w+)\((\d+)/;
function isClipped(style) {
var matchesClip = style.getPropertyValue('clip').match(clipRegex2);
var matchesClipPath = style.getPropertyValue('clip-path').match(clipPathRegex2);
if (matchesClip && matchesClip.length === 5) {
var position = style.getPropertyValue('position');
if ([ 'fixed', 'absolute' ].includes(position)) {
return matchesClip[3] - matchesClip[1] <= 0 && matchesClip[2] - matchesClip[4] <= 0;
}
}
if (matchesClipPath) {
var type2 = matchesClipPath[1];
var value = parseInt(matchesClipPath[2], 10);
switch (type2) {
case 'inset':
return value >= 50;
case 'circle':
return value === 0;
default:
}
}
return false;
}
function isAreaVisible(el, screenReader, recursed) {
var mapEl = find_up_default(el, 'map');
if (!mapEl) {
return false;
}
var mapElName = mapEl.getAttribute('name');
if (!mapElName) {
return false;
}
var mapElRootNode = get_root_node_default2(el);
if (!mapElRootNode || mapElRootNode.nodeType !== 9) {
return false;
}
var refs = query_selector_all_default(axe._tree, 'img[usemap="#'.concat(escape_selector_default(mapElName), '"]'));
if (!refs || !refs.length) {
return false;
}
return refs.some(function(_ref88) {
var actualNode = _ref88.actualNode;
return isVisible(actualNode, screenReader, recursed);
});
}
function isVisible(el, screenReader, recursed) {
var _window$Node2;
if (!el) {
throw new TypeError('Cannot determine if element is visible for non-DOM nodes');
}
var vNode = el instanceof abstract_virtual_node_default ? el : get_node_from_tree_default(el);
el = vNode ? vNode.actualNode : el;
var cacheName = '_isVisible' + (screenReader ? 'ScreenReader' : '');
var _ref89 = (_window$Node2 = window.Node) !== null && _window$Node2 !== void 0 ? _window$Node2 : {}, DOCUMENT_NODE = _ref89.DOCUMENT_NODE, DOCUMENT_FRAGMENT_NODE = _ref89.DOCUMENT_FRAGMENT_NODE;
var nodeType = vNode ? vNode.props.nodeType : el.nodeType;
var nodeName2 = vNode ? vNode.props.nodeName : el.nodeName.toLowerCase();
if (vNode && typeof vNode[cacheName] !== 'undefined') {
return vNode[cacheName];
}
if (nodeType === DOCUMENT_NODE) {
return true;
}
if ([ 'style', 'script', 'noscript', 'template' ].includes(nodeName2)) {
return false;
}
if (el && nodeType === DOCUMENT_FRAGMENT_NODE) {
el = el.host;
}
if (screenReader) {
var ariaHiddenValue = vNode ? vNode.attr('aria-hidden') : el.getAttribute('aria-hidden');
if (ariaHiddenValue === 'true') {
return false;
}
}
if (!el) {
var parent2 = vNode.parent;
var visible3 = true;
if (parent2) {
visible3 = isVisible(parent2, screenReader, true);
}
if (vNode) {
vNode[cacheName] = visible3;
}
return visible3;
}
var style = window.getComputedStyle(el, null);
if (style === null) {
return false;
}
if (nodeName2 === 'area') {
return isAreaVisible(el, screenReader, recursed);
}
if (style.getPropertyValue('display') === 'none') {
return false;
}
var elHeight = parseInt(style.getPropertyValue('height'));
var elWidth = parseInt(style.getPropertyValue('width'));
var scroll = _getScroll(el);
var scrollableWithZeroHeight = scroll && elHeight === 0;
var scrollableWithZeroWidth = scroll && elWidth === 0;
var posAbsoluteOverflowHiddenAndSmall = style.getPropertyValue('position') === 'absolute' && (elHeight < 2 || elWidth < 2) && style.getPropertyValue('overflow') === 'hidden';
if (!screenReader && (isClipped(style) || style.getPropertyValue('opacity') === '0' || scrollableWithZeroHeight || scrollableWithZeroWidth || posAbsoluteOverflowHiddenAndSmall)) {
return false;
}
if (!recursed && (style.getPropertyValue('visibility') === 'hidden' || !screenReader && is_offscreen_default(el))) {
return false;
}
var parent = el.assignedSlot ? el.assignedSlot : el.parentNode;
var visible2 = false;
if (parent) {
visible2 = isVisible(parent, screenReader, true);
}
if (vNode) {
vNode[cacheName] = visible2;
}
return visible2;
}
var is_visible_default = isVisible;
function reduceToElementsBelowFloating(elements, targetNode) {
var floatingPositions = [ 'fixed', 'sticky' ];
var finalElements = [];
var targetFound = false;
for (var index = 0; index < elements.length; ++index) {
var currentNode = elements[index];
if (currentNode === targetNode) {
targetFound = true;
}
var style = window.getComputedStyle(currentNode);
if (!targetFound && floatingPositions.indexOf(style.position) !== -1) {
finalElements = [];
continue;
}
finalElements.push(currentNode);
}
return finalElements;
}
var reduce_to_elements_below_floating_default = reduceToElementsBelowFloating;
function _visuallyContains(node, parent) {
var parentScrollAncestor = getScrollAncestor(parent);
do {
var nextScrollAncestor = getScrollAncestor(node);
if (nextScrollAncestor === parentScrollAncestor || nextScrollAncestor === parent) {
return contains2(node, parent);
}
node = nextScrollAncestor;
} while (node);
return false;
}
function getScrollAncestor(node) {
var vNode = get_node_from_tree_default(node);
var ancestor = vNode.parent;
while (ancestor) {
if (_getScroll(ancestor.actualNode)) {
return ancestor.actualNode;
}
ancestor = ancestor.parent;
}
}
function contains2(node, parent) {
var style = window.getComputedStyle(parent);
var overflow = style.getPropertyValue('overflow');
if (style.getPropertyValue('display') === 'inline') {
return true;
}
var clientRects = Array.from(node.getClientRects());
var boundingRect = parent.getBoundingClientRect();
var rect = {
left: boundingRect.left,
top: boundingRect.top,
width: boundingRect.width,
height: boundingRect.height
};
if ([ 'scroll', 'auto' ].includes(overflow) || parent instanceof window.HTMLHtmlElement) {
rect.width = parent.scrollWidth;
rect.height = parent.scrollHeight;
}
if (clientRects.length === 1 && overflow === 'hidden' && style.getPropertyValue('white-space') === 'nowrap') {
clientRects[0] = rect;
}
return clientRects.some(function(clientRect) {
return !(Math.ceil(clientRect.left) < Math.floor(rect.left) || Math.ceil(clientRect.top) < Math.floor(rect.top) || Math.floor(clientRect.left + clientRect.width) > Math.ceil(rect.left + rect.width) || Math.floor(clientRect.top + clientRect.height) > Math.ceil(rect.top + rect.height));
});
}
function shadowElementsFromPoint(nodeX, nodeY) {
var root = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : document;
var i = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
if (i > 999) {
throw new Error('Infinite loop detected');
}
return Array.from(root.elementsFromPoint(nodeX, nodeY) || []).filter(function(nodes) {
return get_root_node_default2(nodes) === root;
}).reduce(function(stack, elm) {
if (is_shadow_root_default(elm)) {
var shadowStack = shadowElementsFromPoint(nodeX, nodeY, elm.shadowRoot, i + 1);
stack = stack.concat(shadowStack);
if (stack.length && _visuallyContains(stack[0], elm)) {
stack.push(elm);
}
} else {
stack.push(elm);
}
return stack;
}, []);
}
var shadow_elements_from_point_default = shadowElementsFromPoint;
function urlPropsFromAttribute(node, attribute) {
if (!node.hasAttribute(attribute)) {
return void 0;
}
var nodeName2 = node.nodeName.toUpperCase();
var parser2 = node;
if (![ 'A', 'AREA' ].includes(nodeName2) || node.ownerSVGElement) {
parser2 = document.createElement('a');
parser2.href = node.getAttribute(attribute);
}
var protocol = [ 'https:', 'ftps:' ].includes(parser2.protocol) ? parser2.protocol.replace(/s:$/, ':') : parser2.protocol;
var parserPathname = /^\//.test(parser2.pathname) ? parser2.pathname : '/'.concat(parser2.pathname);
var _getPathnameOrFilenam = getPathnameOrFilename(parserPathname), pathname = _getPathnameOrFilenam.pathname, filename = _getPathnameOrFilenam.filename;
return {
protocol: protocol,
hostname: parser2.hostname,
port: getPort(parser2.port),
pathname: /\/$/.test(pathname) ? pathname : ''.concat(pathname, '/'),
search: getSearchPairs(parser2.search),
hash: getHashRoute(parser2.hash),
filename: filename
};
}
function getPort(port) {
var excludePorts = [ '443', '80' ];
return !excludePorts.includes(port) ? port : '';
}
function getPathnameOrFilename(pathname) {
var filename = pathname.split('/').pop();
if (!filename || filename.indexOf('.') === -1) {
return {
pathname: pathname,
filename: ''
};
}
return {
pathname: pathname.replace(filename, ''),
filename: /index./.test(filename) ? '' : filename
};
}
function getSearchPairs(searchStr) {
var query = {};
if (!searchStr || !searchStr.length) {
return query;
}
var pairs = searchStr.substring(1).split('&');
if (!pairs || !pairs.length) {
return query;
}
for (var index = 0; index < pairs.length; index++) {
var pair = pairs[index];
var _pair$split = pair.split('='), _pair$split2 = _slicedToArray(_pair$split, 2), _key1 = _pair$split2[0], _pair$split2$ = _pair$split2[1], value = _pair$split2$ === void 0 ? '' : _pair$split2$;
query[decodeURIComponent(_key1)] = decodeURIComponent(value);
}
return query;
}
function getHashRoute(hash) {
if (!hash) {
return '';
}
var hashRegex = /#!?\/?/g;
var hasMatch = hash.match(hashRegex);
if (!hasMatch) {
return '';
}
var _hasMatch = _slicedToArray(hasMatch, 1), matchedStr = _hasMatch[0];
if (matchedStr === '#') {
return '';
}
return hash;
}
var url_props_from_attribute_default = urlPropsFromAttribute;
function visuallyOverlaps(rect, parent) {
var parentRect = parent.getBoundingClientRect();
var parentTop = parentRect.top;
var parentLeft = parentRect.left;
var parentScrollArea = {
top: parentTop - parent.scrollTop,
bottom: parentTop - parent.scrollTop + parent.scrollHeight,
left: parentLeft - parent.scrollLeft,
right: parentLeft - parent.scrollLeft + parent.scrollWidth
};
if (rect.left > parentScrollArea.right && rect.left > parentRect.right || rect.top > parentScrollArea.bottom && rect.top > parentRect.bottom || rect.right < parentScrollArea.left && rect.right < parentRect.left || rect.bottom < parentScrollArea.top && rect.bottom < parentRect.top) {
return false;
}
var style = window.getComputedStyle(parent);
if (rect.left > parentRect.right || rect.top > parentRect.bottom) {
return style.overflow === 'scroll' || style.overflow === 'auto' || parent instanceof window.HTMLBodyElement || parent instanceof window.HTMLHtmlElement;
}
return true;
}
var visually_overlaps_default = visuallyOverlaps;
var nodeIndex2 = 0;
var VirtualNode = function(_abstract_virtual_nod) {
function VirtualNode(node, parent, shadowId) {
var _this1;
_classCallCheck(this, VirtualNode);
_this1 = _callSuper(this, VirtualNode);
_this1.shadowId = shadowId;
_this1.children = [];
_this1.actualNode = node;
_this1.parent = parent;
if (!parent) {
nodeIndex2 = 0;
}
_this1.nodeIndex = nodeIndex2++;
_this1._isHidden = null;
_this1._cache = {};
_this1._isXHTML = is_xhtml_default(node.ownerDocument);
if (node.nodeName.toLowerCase() === 'input') {
var type2 = node.getAttribute('type');
type2 = _this1._isXHTML ? type2 : (type2 || '').toLowerCase();
if (!valid_input_type_default().includes(type2)) {
type2 = 'text';
}
_this1._type = type2;
}
if (cache_default.get('nodeMap')) {
cache_default.get('nodeMap').set(node, _this1);
}
return _this1;
}
_inherits(VirtualNode, _abstract_virtual_nod);
return _createClass(VirtualNode, [ {
key: 'props',
get: function get() {
if (!this._cache.hasOwnProperty('props')) {
var _this$actualNode = this.actualNode, nodeType = _this$actualNode.nodeType, nodeName2 = _this$actualNode.nodeName, _id3 = _this$actualNode.id, nodeValue = _this$actualNode.nodeValue;
this._cache.props = {
nodeType: nodeType,
nodeName: this._isXHTML ? nodeName2 : nodeName2.toLowerCase(),
id: _id3,
type: this._type,
nodeValue: nodeValue
};
if (nodeType === 1) {
this._cache.props.multiple = this.actualNode.multiple;
this._cache.props.value = this.actualNode.value;
this._cache.props.selected = this.actualNode.selected;
this._cache.props.checked = this.actualNode.checked;
this._cache.props.indeterminate = this.actualNode.indeterminate;
}
}
return this._cache.props;
}
}, {
key: 'attr',
value: function attr(attrName) {
if (typeof this.actualNode.getAttribute !== 'function') {
return null;
}
return this.actualNode.getAttribute(attrName);
}
}, {
key: 'hasAttr',
value: function hasAttr(attrName) {
if (typeof this.actualNode.hasAttribute !== 'function') {
return false;
}
return this.actualNode.hasAttribute(attrName);
}
}, {
key: 'attrNames',
get: function get() {
if (!this._cache.hasOwnProperty('attrNames')) {
var attrs;
if (this.actualNode.attributes instanceof window.NamedNodeMap) {
attrs = this.actualNode.attributes;
} else {
attrs = this.actualNode.cloneNode(false).attributes;
}
this._cache.attrNames = Array.from(attrs).map(function(attr) {
return attr.name;
});
}
return this._cache.attrNames;
}
}, {
key: 'getComputedStylePropertyValue',
value: function getComputedStylePropertyValue(property) {
var key = 'computedStyle_' + property;
if (!this._cache.hasOwnProperty(key)) {
if (!this._cache.hasOwnProperty('computedStyle')) {
this._cache.computedStyle = window.getComputedStyle(this.actualNode);
}
this._cache[key] = this._cache.computedStyle.getPropertyValue(property);
}
return this._cache[key];
}
}, {
key: 'isFocusable',
get: function get() {
if (!this._cache.hasOwnProperty('isFocusable')) {
this._cache.isFocusable = _isFocusable(this.actualNode);
}
return this._cache.isFocusable;
}
}, {
key: 'tabbableElements',
get: function get() {
if (!this._cache.hasOwnProperty('tabbableElements')) {
this._cache.tabbableElements = _getTabbableElements(this);
}
return this._cache.tabbableElements;
}
}, {
key: 'clientRects',
get: function get() {
if (!this._cache.hasOwnProperty('clientRects')) {
this._cache.clientRects = Array.from(this.actualNode.getClientRects()).filter(function(rect) {
return rect.width > 0;
});
}
return this._cache.clientRects;
}
}, {
key: 'boundingClientRect',
get: function get() {
if (!this._cache.hasOwnProperty('boundingClientRect')) {
this._cache.boundingClientRect = this.actualNode.getBoundingClientRect();
}
return this._cache.boundingClientRect;
}
}, {
key: 'elementInternals',
get: function get() {
if (!this._cache.hasOwnProperty('elementInternals')) {
this._cache.elementInternals = _getElementInternals(this.actualNode);
}
return this._cache.elementInternals;
},
set: function set(value) {
this._cache.elementInternals = value;
}
} ]);
}(abstract_virtual_node_default);
var virtual_node_default = VirtualNode;
function tokenList(str) {
return (str || '').trim().replace(/\s{2,}/g, ' ').split(' ');
}
var token_list_default = tokenList;
var idsKey = ' [idsMap]';
function getNodesMatchingExpression(domTree, expressions, filter) {
var selectorMap = domTree[0]._selectorMap;
if (!selectorMap) {
return;
}
var shadowId = domTree[0].shadowId;
for (var _i17 = 0; _i17 < expressions.length; _i17++) {
if (expressions[_i17].length > 1 && expressions[_i17].some(function(expression) {
return isGlobalSelector(expression);
})) {
return;
}
}
var nodeSet = new Set();
expressions.forEach(function(expression) {
var _matchingNodes$nodes;
var matchingNodes = findMatchingNodes(expression, selectorMap, shadowId);
matchingNodes === null || matchingNodes === void 0 || (_matchingNodes$nodes = matchingNodes.nodes) === null || _matchingNodes$nodes === void 0 || _matchingNodes$nodes.forEach(function(node) {
if (matchingNodes.isComplexSelector && !_matchesExpression(node, expression)) {
return;
}
nodeSet.add(node);
});
});
var matchedNodes = [];
nodeSet.forEach(function(node) {
return matchedNodes.push(node);
});
if (filter) {
matchedNodes = matchedNodes.filter(filter);
}
return matchedNodes.sort(function(a2, b3) {
return a2.nodeIndex - b3.nodeIndex;
});
}
function findMatchingNodes(expression, selectorMap, shadowId) {
var exp2 = expression[expression.length - 1];
var nodes = null;
var isComplexSelector = expression.length > 1 || !!exp2.pseudos || !!exp2.classes;
if (isGlobalSelector(exp2)) {
nodes = selectorMap['*'];
} else {
if (exp2.id) {
var _selectorMap$idsKey$e;
if (!selectorMap[idsKey] || !Object.hasOwn(selectorMap[idsKey], exp2.id) || !((_selectorMap$idsKey$e = selectorMap[idsKey][exp2.id]) !== null && _selectorMap$idsKey$e !== void 0 && _selectorMap$idsKey$e.length)) {
return;
}
nodes = selectorMap[idsKey][exp2.id].filter(function(node) {
return node.shadowId === shadowId;
});
}
if (exp2.tag && exp2.tag !== '*') {
var _selectorMap$exp2$tag;
if (!((_selectorMap$exp2$tag = selectorMap[exp2.tag]) !== null && _selectorMap$exp2$tag !== void 0 && _selectorMap$exp2$tag.length)) {
return;
}
var cachedNodes = selectorMap[exp2.tag];
nodes = nodes ? getSharedValues(cachedNodes, nodes) : cachedNodes;
}
if (exp2.classes) {
var _selectorMap$Class;
if (!((_selectorMap$Class = selectorMap['[class]']) !== null && _selectorMap$Class !== void 0 && _selectorMap$Class.length)) {
return;
}
var _cachedNodes = selectorMap['[class]'];
nodes = nodes ? getSharedValues(_cachedNodes, nodes) : _cachedNodes;
}
if (exp2.attributes) {
for (var _i18 = 0; _i18 < exp2.attributes.length; _i18++) {
var _selectorMap;
var attr = exp2.attributes[_i18];
if (attr.type === 'attrValue') {
isComplexSelector = true;
}
if (!((_selectorMap = selectorMap['['.concat(attr.key, ']')]) !== null && _selectorMap !== void 0 && _selectorMap.length)) {
return;
}
var _cachedNodes2 = selectorMap['['.concat(attr.key, ']')];
nodes = nodes ? getSharedValues(_cachedNodes2, nodes) : _cachedNodes2;
}
}
}
return {
nodes: nodes,
isComplexSelector: isComplexSelector
};
}
function isGlobalSelector(expression) {
return expression.tag === '*' && !expression.attributes && !expression.id && !expression.classes;
}
function getSharedValues(a2, b3) {
return a2.filter(function(node) {
return b3.includes(node);
});
}
function cacheSelector(key, vNode, map) {
if (!Object.hasOwn(map, key)) {
map[key] = [];
}
map[key].push(vNode);
}
function cacheNodeSelectors(vNode, selectorMap) {
if (vNode.props.nodeType !== 1) {
return;
}
cacheSelector(vNode.props.nodeName, vNode, selectorMap);
cacheSelector('*', vNode, selectorMap);
vNode.attrNames.forEach(function(attrName) {
if (attrName === 'id') {
selectorMap[idsKey] = selectorMap[idsKey] || {};
token_list_default(vNode.attr(attrName)).forEach(function(value) {
cacheSelector(value, vNode, selectorMap[idsKey]);
});
}
cacheSelector('['.concat(attrName, ']'), vNode, selectorMap);
});
}
var hasShadowRoot;
function _getFlattenedTree() {
var node = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : document.documentElement;
var shadowId = arguments.length > 1 ? arguments[1] : undefined;
hasShadowRoot = false;
var selectorMap = {};
cache_default.set('nodeMap', new WeakMap());
cache_default.set('selectorMap', selectorMap);
var tree = flattenTree(node, shadowId, null);
tree[0]._selectorMap = selectorMap;
tree[0]._hasShadowRoot = hasShadowRoot;
return tree;
}
function getSlotChildren(node) {
var childNodes = [];
node = node.firstChild;
while (node) {
childNodes.push(node);
node = node.nextSibling;
}
return childNodes;
}
function createNode(node, parent, shadowId) {
var vNode = new virtual_node_default(node, parent, shadowId);
cacheNodeSelectors(vNode, cache_default.get('selectorMap'));
return vNode;
}
function createChildren(childNodes, parent, shadowId) {
var children = [];
childNodes.forEach(function(childNode) {
var child = flattenTree(childNode, shadowId, parent);
if (child) {
children.push.apply(children, _toConsumableArray(child));
}
});
return children;
}
function flattenTree(node, shadowId, parent) {
var vNode, childNodes;
if (node.documentElement) {
node = node.documentElement;
}
var nodeName2 = node.nodeName.toLowerCase();
if (is_shadow_root_default(node)) {
hasShadowRoot = true;
vNode = createNode(node, parent, shadowId);
shadowId = 'a' + Math.random().toString().substring(2);
childNodes = Array.from(node.shadowRoot.childNodes);
vNode.children = createChildren(childNodes, vNode, shadowId);
return [ vNode ];
}
if (nodeName2 === 'content' && typeof node.getDistributedNodes === 'function') {
childNodes = Array.from(node.getDistributedNodes());
return createChildren(childNodes, parent, shadowId);
}
if (nodeName2 === 'slot' && typeof node.assignedNodes === 'function') {
childNodes = Array.from(node.assignedNodes());
if (!childNodes.length) {
childNodes = getSlotChildren(node);
}
var styl = window.getComputedStyle(node);
if (false) {
vNode = createNode(node, parent, shadowId);
vNode.children = createChildren(childNodes, vNode, shadowId);
return [ vNode ];
}
return createChildren(childNodes, parent, shadowId);
}
if (node.nodeType === document.ELEMENT_NODE) {
vNode = createNode(node, parent, shadowId);
childNodes = Array.from(node.childNodes);
vNode.children = createChildren(childNodes, vNode, shadowId);
return [ vNode ];
}
if (node.nodeType === document.TEXT_NODE) {
return [ createNode(node, parent) ];
}
return void 0;
}
function getBaseLang(lang) {
if (!lang) {
return '';
}
return lang.trim().split('-')[0].toLowerCase();
}
var get_base_lang_default = getBaseLang;
function failureSummary(nodeData) {
var failingChecks = {};
failingChecks.none = nodeData.none.concat(nodeData.all);
failingChecks.any = nodeData.any;
return Object.keys(failingChecks).map(function(key) {
if (!failingChecks[key].length) {
return;
}
var sum = axe._audit.data.failureSummaries[key];
if (sum && typeof sum.failureMessage === 'function') {
return sum.failureMessage(failingChecks[key].map(function(check) {
return check.message || '';
}));
}
}).filter(function(i) {
return i !== void 0;
}).join('\n\n');
}
var failure_summary_default = failureSummary;
function incompleteFallbackMessage() {
var message = axe._audit.data.incompleteFallbackMessage;
if (typeof message === 'function') {
message = message();
}
if (typeof message !== 'string') {
return '';
}
return message;
}
var resultKeys = constants_default.resultGroups;
function processAggregate(results, options) {
var resultObject = axe.utils.aggregateResult(results);
resultKeys.forEach(function(key) {
if (options.resultTypes && !options.resultTypes.includes(key)) {
(resultObject[key] || []).forEach(function(ruleResult) {
if (Array.isArray(ruleResult.nodes) && ruleResult.nodes.length > 0) {
ruleResult.nodes = [ ruleResult.nodes[0] ];
}
});
}
resultObject[key] = (resultObject[key] || []).map(function(ruleResult) {
ruleResult = Object.assign({}, ruleResult);
if (Array.isArray(ruleResult.nodes) && ruleResult.nodes.length > 0) {
ruleResult.nodes = ruleResult.nodes.map(function(subResult) {
if (_typeof(subResult.node) === 'object') {
var serialElm = trimElementSpec(subResult.node, options);
Object.assign(subResult, serialElm);
}
delete subResult.result;
delete subResult.node;
normalizeRelatedNodes(subResult, options);
return subResult;
});
}
resultKeys.forEach(function(resultKey) {
return delete ruleResult[resultKey];
});
delete ruleResult.pageLevel;
delete ruleResult.result;
return ruleResult;
});
});
return resultObject;
}
function normalizeRelatedNodes(node, options) {
[ 'any', 'all', 'none' ].forEach(function(type2) {
if (!Array.isArray(node[type2])) {
return;
}
node[type2].filter(function(checkRes) {
return Array.isArray(checkRes.relatedNodes);
}).forEach(function(checkRes) {
checkRes.relatedNodes = checkRes.relatedNodes.map(function(relatedNode) {
return trimElementSpec(relatedNode, options);
});
});
});
}
function trimElementSpec() {
var elmSpec = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var runOptions = arguments.length > 1 ? arguments[1] : undefined;
elmSpec = node_serializer_default.dqElmToSpec(elmSpec, runOptions);
var serialElm = {};
if (axe._audit.noHtml) {
serialElm.html = null;
} else {
var _elmSpec$source;
serialElm.html = (_elmSpec$source = elmSpec.source) !== null && _elmSpec$source !== void 0 ? _elmSpec$source : 'Undefined';
}
if (runOptions.elementRef && !elmSpec.fromFrame) {
var _elmSpec$element;
serialElm.element = (_elmSpec$element = elmSpec.element) !== null && _elmSpec$element !== void 0 ? _elmSpec$element : null;
}
if (runOptions.selectors !== false || elmSpec.fromFrame) {
var _elmSpec$selector;
serialElm.target = (_elmSpec$selector = elmSpec.selector) !== null && _elmSpec$selector !== void 0 ? _elmSpec$selector : [ ':root' ];
}
if (runOptions.ancestry) {
var _elmSpec$ancestry;
serialElm.ancestry = (_elmSpec$ancestry = elmSpec.ancestry) !== null && _elmSpec$ancestry !== void 0 ? _elmSpec$ancestry : [ ':root' ];
}
if (runOptions.xpath) {
var _elmSpec$xpath;
serialElm.xpath = (_elmSpec$xpath = elmSpec.xpath) !== null && _elmSpec$xpath !== void 0 ? _elmSpec$xpath : [ '/' ];
}
return serialElm;
}
var dataRegex = /\$\{\s?data\s?\}/g;
function substitute(str, data) {
if (typeof data === 'string') {
return str.replace(dataRegex, data);
}
for (var prop in data) {
if (data.hasOwnProperty(prop)) {
var regex2 = new RegExp('\\${\\s?data\\.' + prop + '\\s?}', 'g');
str = str.replace(regex2, toMessageString(data[prop]));
}
}
return str;
}
function toMessageString(value) {
if (typeof value === 'undefined') {
return '';
}
if (Array.isArray(value)) {
return value.join(', ');
}
return String(value);
}
function processMessage(message, data) {
if (!message) {
return;
}
if (Array.isArray(data)) {
data.values = data.join(', ');
if (typeof message.singular === 'string' && typeof message.plural === 'string') {
var str2 = data.length === 1 ? message.singular : message.plural;
return substitute(str2, data);
}
return substitute(message, data);
}
if (typeof message === 'string') {
return substitute(message, data);
}
if (typeof data === 'string') {
var _str2 = message[data];
return substitute(_str2, data);
}
var str = message['default'] || incompleteFallbackMessage();
if (data && data.messageKey && message[data.messageKey]) {
str = message[data.messageKey];
}
return processMessage(str, data);
}
var process_message_default = processMessage;
function getCheckMessage(checkId, type2, data) {
var check = axe._audit.data.checks[checkId];
if (!check) {
throw new Error('Cannot get message for unknown check: '.concat(checkId, '.'));
}
if (!check.messages[type2]) {
throw new Error('Check "'.concat(checkId, '"" does not have a "').concat(type2, '" message.'));
}
return process_message_default(check.messages[type2], data);
}
var get_check_message_default = getCheckMessage;
function getCheckOption(check, ruleID, options) {
var ruleCheckOption = ((options.rules && options.rules[ruleID] || {}).checks || {})[check.id];
var checkOption = (options.checks || {})[check.id];
var enabled = check.enabled;
var opts = check.options;
if (checkOption) {
if (checkOption.hasOwnProperty('enabled')) {
enabled = checkOption.enabled;
}
if (checkOption.hasOwnProperty('options')) {
opts = checkOption.options;
}
}
if (ruleCheckOption) {
if (ruleCheckOption.hasOwnProperty('enabled')) {
enabled = ruleCheckOption.enabled;
}
if (ruleCheckOption.hasOwnProperty('options')) {
opts = ruleCheckOption.options;
}
}
return {
enabled: enabled,
options: opts,
absolutePaths: options.absolutePaths
};
}
var get_check_option_default = getCheckOption;
function _getEnvironmentData() {
var _win$location;
var metadata = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
var win = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : window;
if (metadata && _typeof(metadata) === 'object') {
return metadata;
} else if (_typeof(win) !== 'object') {
return {};
}
return {
testEngine: {
name: 'axe-core',
version: axe.version
},
testRunner: {
name: axe._audit.brand
},
testEnvironment: getTestEnvironment(win),
timestamp: new Date().toISOString(),
url: (_win$location = win.location) === null || _win$location === void 0 ? void 0 : _win$location.href
};
}
function getTestEnvironment(win) {
if (!win.navigator || _typeof(win.navigator) !== 'object') {
return {};
}
var navigator = win.navigator, innerHeight = win.innerHeight, innerWidth = win.innerWidth;
var _ref90 = getOrientation(win) || {}, angle = _ref90.angle, type2 = _ref90.type;
return {
userAgent: navigator.userAgent,
windowWidth: innerWidth,
windowHeight: innerHeight,
orientationAngle: angle,
orientationType: type2
};
}
function getOrientation(_ref91) {
var screen = _ref91.screen;
return screen.orientation || screen.msOrientation || screen.mozOrientation;
}
function createFrameContext(frame, _ref92) {
var focusable = _ref92.focusable, page = _ref92.page;
return {
node: frame,
include: [],
exclude: [],
initiator: false,
focusable: focusable && frameFocusable(frame),
size: getBoundingSize(frame),
page: page
};
}
function frameFocusable(frame) {
var tabIndex = parse_tabindex_default(frame.getAttribute('tabindex'));
return tabIndex === null || tabIndex >= 0;
}
function getBoundingSize(domNode) {
var width = parseInt(domNode.getAttribute('width'), 10);
var height = parseInt(domNode.getAttribute('height'), 10);
if (isNaN(width) || isNaN(height)) {
var rect = domNode.getBoundingClientRect();
width = isNaN(width) ? rect.width : width;
height = isNaN(height) ? rect.height : height;
}
return {
width: width,
height: height
};
}
function normalizeContext(contextSpec) {
if (_isContextObject(contextSpec)) {
var msg = ' must be used inside include or exclude. It should not be on the same object.';
assert2(!_objectHasOwn(contextSpec, 'fromFrames'), 'fromFrames' + msg);
assert2(!_objectHasOwn(contextSpec, 'fromShadowDom'), 'fromShadowDom' + msg);
} else if (_isContextProp(contextSpec)) {
contextSpec = {
include: contextSpec,
exclude: []
};
} else {
return {
include: [ document ],
exclude: []
};
}
var include = normalizeContextList(contextSpec.include);
if (include.length === 0) {
include.push(document);
}
var exclude = normalizeContextList(contextSpec.exclude);
return {
include: include,
exclude: exclude
};
}
function normalizeContextList() {
var selectorList = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
var normalizedList = [];
if (!_isArrayLike(selectorList)) {
selectorList = [ selectorList ];
}
for (var _i19 = 0; _i19 < selectorList.length; _i19++) {
var normalizedSelector = normalizeContextSelector(selectorList[_i19]);
if (normalizedSelector) {
normalizedList.push(normalizedSelector);
}
}
return normalizedList;
}
function normalizeContextSelector(selector) {
if (selector instanceof window.Node) {
return selector;
}
if (typeof selector === 'string') {
return [ selector ];
}
if (_isLabelledFramesSelector(selector)) {
assertLabelledFrameSelector(selector);
selector = selector.fromFrames;
} else if (_isLabelledShadowDomSelector(selector)) {
selector = [ selector ];
}
return normalizeFrameSelectors(selector);
}
function normalizeFrameSelectors(frameSelectors) {
if (!Array.isArray(frameSelectors)) {
return;
}
var normalizedSelectors = [];
var _iterator15 = _createForOfIteratorHelper(frameSelectors), _step15;
try {
for (_iterator15.s(); !(_step15 = _iterator15.n()).done; ) {
var selector = _step15.value;
if (_isLabelledShadowDomSelector(selector)) {
assertLabelledShadowDomSelector(selector);
selector = selector.fromShadowDom;
}
if (typeof selector !== 'string' && !isShadowSelector(selector)) {
return;
}
normalizedSelectors.push(selector);
}
} catch (err) {
_iterator15.e(err);
} finally {
_iterator15.f();
}
return normalizedSelectors;
}
function assertLabelledFrameSelector(selector) {
assert2(Array.isArray(selector.fromFrames), 'fromFrames property must be an array');
assert2(selector.fromFrames.every(function(fromFrameSelector) {
return !_objectHasOwn(fromFrameSelector, 'fromFrames');
}), 'Invalid context; fromFrames selector must be appended, rather than nested');
assert2(!_objectHasOwn(selector, 'fromShadowDom'), 'fromFrames and fromShadowDom cannot be used on the same object');
}
function assertLabelledShadowDomSelector(selector) {
assert2(Array.isArray(selector.fromShadowDom), 'fromShadowDom property must be an array');
assert2(selector.fromShadowDom.every(function(fromShadowDomSelector) {
return !_objectHasOwn(fromShadowDomSelector, 'fromFrames');
}), 'shadow selector must be inside fromFrame instead');
assert2(selector.fromShadowDom.every(function(fromShadowDomSelector) {
return !_objectHasOwn(fromShadowDomSelector, 'fromShadowDom');
}), 'fromShadowDom selector must be appended, rather than nested');
}
function isShadowSelector(selector) {
return Array.isArray(selector) && selector.every(function(str) {
return typeof str === 'string';
});
}
function assert2(bool, str) {
assert_default(bool, 'Invalid context; '.concat(str, '\nSee: https://github.com/dequelabs/axe-core/blob/master/doc/context.md'));
}
function parseSelectorArray(context, type2) {
var result = [];
for (var _i20 = 0, l = context[type2].length; _i20 < l; _i20++) {
var item = context[type2][_i20];
if (item instanceof window.Node) {
if (item.documentElement instanceof window.Node) {
result.push(context.flatTree[0]);
} else if (item.host instanceof window.Node) {
var children = Array.from(item.children).map(function(child) {
return get_node_from_tree_default(child);
});
result.push.apply(result, _toConsumableArray(children));
} else {
result.push(get_node_from_tree_default(item));
}
} else if (item && item.length) {
if (item.length > 1) {
pushUniqueFrameSelector(context, type2, item);
} else {
var nodeList = _shadowSelectAll(item[0]);
result.push.apply(result, _toConsumableArray(nodeList.map(function(node) {
return get_node_from_tree_default(node);
})));
}
}
}
return result.filter(function(r) {
return r;
});
}
function pushUniqueFrameSelector(context, type2, selectorArray) {
context.frames = context.frames || [];
var frameSelector = selectorArray.shift();
var frames = _shadowSelectAll(frameSelector);
frames.forEach(function(frame) {
var frameContext = context.frames.find(function(result) {
return result.node === frame;
});
if (!frameContext) {
frameContext = createFrameContext(frame, context);
context.frames.push(frameContext);
}
frameContext[type2].push(selectorArray);
});
}
function Context(spec, flatTree) {
var _spec, _spec2, _spec3, _spec4, _this10 = this;
spec = clone2(spec);
this.frames = [];
this.page = typeof ((_spec = spec) === null || _spec === void 0 ? void 0 : _spec.page) === 'boolean' ? spec.page : void 0;
this.initiator = typeof ((_spec2 = spec) === null || _spec2 === void 0 ? void 0 : _spec2.initiator) === 'boolean' ? spec.initiator : true;
this.focusable = typeof ((_spec3 = spec) === null || _spec3 === void 0 ? void 0 : _spec3.focusable) === 'boolean' ? spec.focusable : true;
this.size = _typeof((_spec4 = spec) === null || _spec4 === void 0 ? void 0 : _spec4.size) === 'object' ? spec.size : {};
spec = normalizeContext(spec);
this.flatTree = flatTree !== null && flatTree !== void 0 ? flatTree : _getFlattenedTree(getRootNode2(spec));
this.exclude = spec.exclude;
this.include = spec.include;
this.include = parseSelectorArray(this, 'include');
this.exclude = parseSelectorArray(this, 'exclude');
_select('frame, iframe', this).forEach(function(frame) {
if (_isNodeInContext(frame, _this10)) {
pushUniqueFrame(_this10, frame.actualNode);
}
});
if (typeof this.page === 'undefined') {
this.page = isPageContext(this);
this.frames.forEach(function(frame) {
frame.page = _this10.page;
});
}
validateContext(this);
if (!Array.isArray(this.include)) {
this.include = Array.from(this.include);
}
this.include.sort(node_sorter_default);
}
function pushUniqueFrame(context, frame) {
if (!_isVisibleToScreenReaders(frame) || find_by_default(context.frames, 'node', frame)) {
return;
}
context.frames.push(createFrameContext(frame, context));
}
function isPageContext(_ref93) {
var include = _ref93.include;
return include.length === 1 && include[0].actualNode === document.documentElement;
}
function validateContext(context) {
if (context.include.length === 0 && context.frames.length === 0) {
var env = _respondable.isInFrame() ? 'frame' : 'page';
throw new Error('No elements found for include in ' + env + ' Context');
}
}
function getRootNode2(_ref94) {
var include = _ref94.include, exclude = _ref94.exclude;
var selectors = Array.from(include).concat(Array.from(exclude));
for (var _i21 = 0; _i21 < selectors.length; _i21++) {
var item = selectors[_i21];
if (item instanceof window.Element) {
return item.ownerDocument.documentElement;
}
if (item instanceof window.Document) {
return item.documentElement;
}
}
return document.documentElement;
}
function _getFrameContexts(context) {
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
if (options.iframes === false) {
return [];
}
var _Context = new Context(context), frames = _Context.frames;
return frames.map(function(_ref95) {
var node = _ref95.node, frameContext = _objectWithoutProperties(_ref95, _excluded12);
frameContext.initiator = false;
var frameSelector = _getAncestry(node);
return {
frameSelector: frameSelector,
frameContext: frameContext
};
});
}
function _getRule(ruleId) {
var rule = axe._audit.rules.find(function(_ref96) {
var id = _ref96.id;
return id === ruleId;
});
if (!rule) {
throw new Error('Cannot find rule by id: '.concat(ruleId));
}
return rule;
}
function _getScroll(elm, buffer) {
buffer !== null && buffer !== void 0 ? buffer : buffer = 0;
var overflowX = elm.scrollWidth > elm.clientWidth + buffer;
var overflowY = elm.scrollHeight > elm.clientHeight + buffer;
if (!(overflowX || overflowY)) {
return;
}
var style = window.getComputedStyle(elm);
var scrollableX = isScrollable(style, 'overflow-x');
var scrollableY = isScrollable(style, 'overflow-y');
if (overflowX && scrollableX || overflowY && scrollableY) {
return {
elm: elm,
top: elm.scrollTop,
left: elm.scrollLeft
};
}
}
function isScrollable(style, prop) {
var overflowProp = style.getPropertyValue(prop);
return [ 'scroll', 'auto' ].includes(overflowProp);
}
function getElmScrollRecursive(root) {
return Array.from(root.children || root.childNodes || []).reduce(function(scrolls, elm) {
var scroll = _getScroll(elm);
if (scroll) {
scrolls.push(scroll);
}
return scrolls.concat(getElmScrollRecursive(elm));
}, []);
}
function getScrollState() {
var win = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : window;
var root = win.document.documentElement;
var windowScroll = [ win.pageXOffset !== void 0 ? {
elm: win,
top: win.pageYOffset,
left: win.pageXOffset
} : {
elm: root,
top: root.scrollTop,
left: root.scrollLeft
} ];
return windowScroll.concat(getElmScrollRecursive(document.body));
}
var get_scroll_state_default = getScrollState;
function _getStandards() {
return clone2(standards_default);
}
function getStyleSheetFactory(dynamicDoc) {
if (!dynamicDoc) {
throw new Error('axe.utils.getStyleSheetFactory should be invoked with an argument');
}
return function(options) {
var data = options.data, _options$isCrossOrigi = options.isCrossOrigin, isCrossOrigin = _options$isCrossOrigi === void 0 ? false : _options$isCrossOrigi, shadowId = options.shadowId, root = options.root, priority = options.priority, _options$isLink = options.isLink, isLink = _options$isLink === void 0 ? false : _options$isLink;
var style = dynamicDoc.createElement('style');
if (isLink) {
var text = dynamicDoc.createTextNode('@import "'.concat(data.href, '"'));
style.appendChild(text);
} else {
style.appendChild(dynamicDoc.createTextNode(data));
}
dynamicDoc.head.appendChild(style);
return {
sheet: style.sheet,
isCrossOrigin: isCrossOrigin,
shadowId: shadowId,
root: root,
priority: priority
};
};
}
var get_stylesheet_factory_default = getStyleSheetFactory;
var propNames = [ '_internals', 'internals', 'internals_' ];
var symbolNames = [ 'internals', 'privateInternals' ];
function _getElementInternals(node) {
var _globalThis$_elementI;
if (!_isValidCustomElementName(node.nodeName.toLowerCase())) {
return;
}
var mapInternals = (_globalThis$_elementI = globalThis._elementInternals) === null || _globalThis$_elementI === void 0 ? void 0 : _globalThis$_elementI.get(node);
if (mapInternals) {
return mapInternals;
}
if (!('ElementInternals' in window)) {
return;
}
var _iterator16 = _createForOfIteratorHelper(propNames), _step16;
try {
for (_iterator16.s(); !(_step16 = _iterator16.n()).done; ) {
var _Object$getOwnPropert;
var propName = _step16.value;
if ((_Object$getOwnPropert = Object.getOwnPropertyDescriptor(node, propName)) !== null && _Object$getOwnPropert !== void 0 && _Object$getOwnPropert.get) {
continue;
}
if (node[propName] instanceof window.ElementInternals) {
return node[propName];
}
}
} catch (err) {
_iterator16.e(err);
} finally {
_iterator16.f();
}
var ownSymbols = Object.getOwnPropertySymbols(node);
if (!ownSymbols.length) {
return;
}
var _iterator17 = _createForOfIteratorHelper(symbolNames), _step17;
try {
var _loop6 = function _loop6() {
var symbolName = _step17.value;
var symbol = ownSymbols.find(function(s) {
return s.description === symbolName;
});
if (symbol) {
var _Object$getOwnPropert2;
if ((_Object$getOwnPropert2 = Object.getOwnPropertyDescriptor(node, symbol)) !== null && _Object$getOwnPropert2 !== void 0 && _Object$getOwnPropert2.get) {
return 0;
}
if (node[symbol] instanceof window.ElementInternals) {
return {
v: node[symbol]
};
}
}
}, _ret3;
for (_iterator17.s(); !(_step17 = _iterator17.n()).done; ) {
_ret3 = _loop6();
if (_ret3 === 0) {
continue;
}
if (_ret3) {
return _ret3.v;
}
}
} catch (err) {
_iterator17.e(err);
} finally {
_iterator17.f();
}
}
var styleSheet;
function injectStyle(style) {
if (styleSheet && styleSheet.parentNode) {
if (styleSheet.styleSheet === void 0) {
styleSheet.appendChild(document.createTextNode(style));
} else {
styleSheet.styleSheet.cssText += style;
}
return styleSheet;
}
if (!style) {
return;
}
var head = document.head || document.getElementsByTagName('head')[0];
styleSheet = document.createElement('style');
styleSheet.type = 'text/css';
if (styleSheet.styleSheet === void 0) {
styleSheet.appendChild(document.createTextNode(style));
} else {
styleSheet.styleSheet.cssText = style;
}
head.appendChild(styleSheet);
return styleSheet;
}
var inject_style_default = injectStyle;
function _isArrayLike(arr) {
return !!arr && _typeof(arr) === 'object' && typeof arr.length === 'number' && arr instanceof window.Node === false;
}
function _objectHasOwn(obj, prop) {
if (!obj || _typeof(obj) !== 'object') {
return false;
}
return Object.prototype.hasOwnProperty.call(obj, prop);
}
function _isContextSpec(contextSpec) {
return _isContextObject(contextSpec) || _isContextProp(contextSpec);
}
function _isContextObject(contextSpec) {
return [ 'include', 'exclude' ].some(function(prop) {
return _objectHasOwn(contextSpec, prop) && _isContextProp(contextSpec[prop]);
});
}
function _isContextProp(contextList) {
return typeof contextList === 'string' || contextList instanceof window.Node || _isLabelledFramesSelector(contextList) || _isLabelledShadowDomSelector(contextList) || _isArrayLike(contextList);
}
function _isLabelledFramesSelector(selector) {
return _objectHasOwn(selector, 'fromFrames');
}
function _isLabelledShadowDomSelector(selector) {
return _objectHasOwn(selector, 'fromShadowDom');
}
function isHidden(el, recursed) {
var node = get_node_from_tree_default(el);
if (el.nodeType === 9) {
return false;
}
if (el.nodeType === 11) {
el = el.host;
}
if (node && node._isHidden !== null) {
return node._isHidden;
}
var style = window.getComputedStyle(el, null);
if (!style || !el.parentNode || style.getPropertyValue('display') === 'none' || !recursed && style.getPropertyValue('visibility') === 'hidden' || el.getAttribute('aria-hidden') === 'true') {
return true;
}
var parent = el.assignedSlot ? el.assignedSlot : el.parentNode;
var hidden = isHidden(parent, true);
if (node) {
node._isHidden = hidden;
}
return hidden;
}
var is_hidden_default = isHidden;
function _isHtmlElement(node) {
var _node$props$nodeName, _node$props;
var nodeName2 = (_node$props$nodeName = (_node$props = node.props) === null || _node$props === void 0 ? void 0 : _node$props.nodeName) !== null && _node$props$nodeName !== void 0 ? _node$props$nodeName : node.nodeName.toLowerCase();
if (node.namespaceURI === 'http://www.w3.org/2000/svg') {
return false;
}
return !!standards_default.htmlElms[nodeName2];
}
function _isNodeInContext(node, _ref97) {
var _ref97$include = _ref97.include, include = _ref97$include === void 0 ? [] : _ref97$include, _ref97$exclude = _ref97.exclude, exclude = _ref97$exclude === void 0 ? [] : _ref97$exclude;
var filterInclude = include.filter(function(candidate) {
return _contains(candidate, node);
});
if (filterInclude.length === 0) {
return false;
}
var filterExcluded = exclude.filter(function(candidate) {
return _contains(candidate, node);
});
if (filterExcluded.length === 0) {
return true;
}
var deepestInclude = getDeepest(filterInclude);
var deepestExclude = getDeepest(filterExcluded);
return _contains(deepestExclude, deepestInclude);
}
function getDeepest(collection) {
var deepest;
var _iterator18 = _createForOfIteratorHelper(collection), _step18;
try {
for (_iterator18.s(); !(_step18 = _iterator18.n()).done; ) {
var node = _step18.value;
if (!deepest || !_contains(node, deepest)) {
deepest = node;
}
}
} catch (err) {
_iterator18.e(err);
} finally {
_iterator18.f();
}
return deepest;
}
function _matchAncestry(ancestryA, ancestryB) {
if (ancestryA.length !== ancestryB.length) {
return false;
}
return ancestryA.every(function(selectorA, ancestorIndex) {
var selectorB = ancestryB[ancestorIndex];
if (!Array.isArray(selectorA)) {
return selectorA === selectorB;
}
if (selectorA.length !== selectorB.length) {
return false;
}
return selectorA.every(function(str, selectorIndex) {
return selectorB[selectorIndex] === str;
});
});
}
function nodeSorter(nodeA, nodeB) {
nodeA = nodeA.actualNode || nodeA;
nodeB = nodeB.actualNode || nodeB;
if (nodeA === nodeB) {
return 0;
}
if (nodeA.compareDocumentPosition(nodeB) & 4) {
return -1;
} else {
return 1;
}
}
var node_sorter_default = nodeSorter;
function _nodeLookup(node) {
if (node instanceof abstract_virtual_node_default) {
return {
vNode: node,
domNode: node.actualNode
};
}
return {
vNode: get_node_from_tree_default(node),
domNode: node
};
}
function parseSameOriginStylesheet(sheet, options, priority, importedUrls) {
var isCrossOrigin = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
var rules = Array.from(sheet.cssRules);
if (!rules) {
return Promise.resolve();
}
var cssImportRules = rules.filter(function(r) {
return r.type === 3;
});
if (!cssImportRules.length) {
return Promise.resolve({
isCrossOrigin: isCrossOrigin,
priority: priority,
root: options.rootNode,
shadowId: options.shadowId,
sheet: sheet
});
}
var cssImportUrlsNotAlreadyImported = cssImportRules.filter(function(rule) {
return rule.href;
}).map(function(rule) {
return resolveImportUrl(rule.href, sheet);
}).filter(function(url) {
return !importedUrls.includes(url);
});
var promises = cssImportUrlsNotAlreadyImported.map(function(importUrl, cssRuleIndex) {
var newPriority = [].concat(_toConsumableArray(priority), [ cssRuleIndex ]);
var isCrossOriginRequest = isCrossOriginUrl(importUrl);
return parse_crossorigin_stylesheet_default(importUrl, options, newPriority, importedUrls, isCrossOriginRequest);
});
var nonImportCSSRules = rules.filter(function(r) {
return r.type !== 3;
});
if (!nonImportCSSRules.length) {
return Promise.all(promises);
}
promises.push(Promise.resolve(options.convertDataToStylesheet({
data: nonImportCSSRules.map(function(rule) {
return rule.cssText;
}).join(),
isCrossOrigin: isCrossOrigin,
priority: priority,
root: options.rootNode,
shadowId: options.shadowId
})));
return Promise.all(promises);
}
function resolveImportUrl(url, sheet) {
var base = sheet.href || document.baseURI;
try {
return new window.URL(url, base).href;
} catch (_unused8) {
return url;
}
}
function isCrossOriginUrl(url) {
try {
return new window.URL(url, window.location.href).origin !== window.location.origin;
} catch (_unused9) {
return /^https?:\/\/|^\/\//i.test(url);
}
}
var parse_sameorigin_stylesheet_default = parseSameOriginStylesheet;
function parseStylesheet(sheet, options, priority, importedUrls) {
var isCrossOrigin = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
var isSameOrigin = isSameOriginStylesheet(sheet);
if (isSameOrigin) {
return parse_sameorigin_stylesheet_default(sheet, options, priority, importedUrls, isCrossOrigin);
}
return parse_crossorigin_stylesheet_default(sheet.href, options, priority, importedUrls, true);
}
function isSameOriginStylesheet(sheet) {
try {
var rules = sheet.cssRules;
if (!rules && sheet.href) {
return false;
}
return true;
} catch (e) {
return false;
}
}
var parse_stylesheet_default = parseStylesheet;
function parseCrossOriginStylesheet(url, options, priority, importedUrls, isCrossOrigin) {
if (url === null || url === void 0) {
return Promise.resolve();
}
importedUrls.push(url);
return new Promise(function(resolve, reject) {
var request = new window.XMLHttpRequest();
request.open('GET', url);
request.timeout = constants_default.preload.timeout;
request.addEventListener('error', reject);
request.addEventListener('timeout', reject);
request.addEventListener('loadend', function(event) {
if (event.loaded && request.responseText) {
return resolve(request.responseText);
}
reject(request.responseText);
});
request.send();
}).then(function(data) {
var result = options.convertDataToStylesheet({
data: data,
isCrossOrigin: isCrossOrigin,
priority: priority,
root: options.rootNode,
shadowId: options.shadowId
});
return parse_stylesheet_default(result.sheet, options, priority, importedUrls, result.isCrossOrigin);
});
}
var parse_crossorigin_stylesheet_default = parseCrossOriginStylesheet;
function parseTabindex(value) {
if (typeof value !== 'string') {
return null;
}
var match = value.trim().match(/^([-+]?\d+)/);
if (match) {
return Number(match[1]);
}
return null;
}
var parse_tabindex_default = parseTabindex;
var performanceTimer = function() {
function now() {
if (window.performance && window.performance) {
return window.performance.now();
}
}
var axeStartTime = now();
var axeStarted = false;
return {
start: function start() {
this.reset();
axeStarted = true;
this.mark('mark_axe_start');
},
end: function end() {
this.mark('mark_axe_end');
this.measure('axe', 'mark_axe_start', 'mark_axe_end', true);
this.logMeasures('axe');
this.clearMark('mark_axe_start', 'mark_axe_end');
axeStarted = false;
},
auditStart: function auditStart() {
if (!axeStarted) {
this.reset();
}
this.mark('mark_audit_start');
},
auditEnd: function auditEnd() {
this.mark('mark_audit_end');
this.measure('audit_start_to_end', 'mark_audit_start', 'mark_audit_end', true);
this.logMeasures();
this.clearMark('mark_audit_start', 'mark_audit_end');
},
mark: function mark(markName) {
var _window$performance;
if ((_window$performance = window.performance) !== null && _window$performance !== void 0 && _window$performance.mark) {
window.performance.mark(markName);
}
},
measure: function measure(measureName, startMark, endMark) {
var _window$performance2;
var keepMarks = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
if (!((_window$performance2 = window.performance) !== null && _window$performance2 !== void 0 && _window$performance2.measure)) {
return;
}
try {
window.performance.measure(measureName, startMark, endMark);
} catch (e) {
this._log(e);
}
if (!keepMarks) {
this.clearMark(startMark, endMark);
}
},
logMeasures: function logMeasures(measureName) {
var _this11 = this, _window$performance3, _window$performance4;
var last = function last(arr) {
return Array.isArray(arr) ? arr[arr.length - 1] : arr;
};
var logMeasure = function logMeasure(req) {
_this11._log('Measure ' + req.name + ' took ' + req.duration + 'ms');
};
if (!((_window$performance3 = window.performance) !== null && _window$performance3 !== void 0 && _window$performance3.getEntriesByType) || !((_window$performance4 = window.performance) !== null && _window$performance4 !== void 0 && _window$performance4.getEntriesByName)) {
return;
}
var axeStart = last(window.performance.getEntriesByName('mark_axe_start')) || last(window.performance.getEntriesByName('mark_audit_start'));
if (!axeStart) {
this._log('Axe must be started before using performanceTimer');
return;
}
var measures = window.performance.getEntriesByType('measure').filter(function(measure) {
return measure.startTime >= axeStart.startTime;
});
for (var _i22 = 0; _i22 < measures.length; ++_i22) {
var req = measures[_i22];
if (req.name === measureName) {
logMeasure(req);
return;
} else if (!measureName) {
logMeasure(req);
}
}
},
timeElapsed: function timeElapsed() {
var currentTime = now();
return currentTime - axeStartTime;
},
clearMark: function clearMark() {
var _window$performance5;
if (!((_window$performance5 = window.performance) !== null && _window$performance5 !== void 0 && _window$performance5.clearMarks)) {
return;
}
for (var _len8 = arguments.length, markNames = new Array(_len8), _key10 = 0; _key10 < _len8; _key10++) {
markNames[_key10] = arguments[_key10];
}
for (var _i23 = 0, _markNames = markNames; _i23 < _markNames.length; _i23++) {
var markName = _markNames[_i23];
window.performance.clearMarks(markName);
}
},
reset: function reset() {
axeStartTime = now();
},
_log: function _log(message) {
log(message);
}
};
}();
var performance_timer_default = performanceTimer;
function _pollyfillElementsFromPoint() {
if (document.elementsFromPoint) {
return document.elementsFromPoint;
}
if (document.msElementsFromPoint) {
return document.msElementsFromPoint;
}
var usePointer = function() {
var element = document.createElement('x');
element.style.cssText = 'pointer-events:auto';
return element.style.pointerEvents === 'auto';
}();
var cssProp = usePointer ? 'pointer-events' : 'visibility';
var cssDisableVal = usePointer ? 'none' : 'hidden';
var style = document.createElement('style');
style.innerHTML = usePointer ? '* { pointer-events: all }' : '* { visibility: visible }';
return function(x, y) {
var current, i, d2;
var elements = [];
var previousPointerEvents = [];
document.head.appendChild(style);
while ((current = document.elementFromPoint(x, y)) && elements.indexOf(current) === -1) {
elements.push(current);
previousPointerEvents.push({
value: current.style.getPropertyValue(cssProp),
priority: current.style.getPropertyPriority(cssProp)
});
current.style.setProperty(cssProp, cssDisableVal, 'important');
}
if (elements.indexOf(document.documentElement) < elements.length - 1) {
elements.splice(elements.indexOf(document.documentElement), 1);
elements.push(document.documentElement);
}
for (i = previousPointerEvents.length; !!(d2 = previousPointerEvents[--i]); ) {
elements[i].style.setProperty(cssProp, d2.value ? d2.value : '', d2.priority);
}
document.head.removeChild(style);
return elements;
};
}
if (typeof window.addEventListener === 'function') {
document.elementsFromPoint = _pollyfillElementsFromPoint();
}
function uniqueArray(arr1, arr2) {
return arr1.concat(arr2).filter(function(elem, pos, arr) {
return arr.indexOf(elem) === pos;
});
}
var unique_array_default = uniqueArray;
function createLocalVariables(vNodes, anyLevel, thisLevel, parentShadowId, recycledLocalVariable) {
var retVal = recycledLocalVariable || {};
retVal.vNodes = vNodes;
retVal.vNodesIndex = 0;
retVal.anyLevel = anyLevel;
retVal.thisLevel = thisLevel;
retVal.parentShadowId = parentShadowId;
return retVal;
}
function matchExpressions(domTree, expressions, filter) {
var recycledLocalVariables = cache_default.get('qsa.recycledLocalVariables', function() {
return [];
});
var stack = [];
var vNodes = Array.isArray(domTree) ? domTree : [ domTree ];
var currentLevel = createLocalVariables(vNodes, expressions, null, domTree[0].shadowId, recycledLocalVariables.pop());
var result = [];
while (currentLevel.vNodesIndex < currentLevel.vNodes.length) {
var _currentLevel$anyLeve, _currentLevel$thisLev;
var vNode = currentLevel.vNodes[currentLevel.vNodesIndex++];
var childOnly = null;
var childAny = null;
var combinedLength = (((_currentLevel$anyLeve = currentLevel.anyLevel) === null || _currentLevel$anyLeve === void 0 ? void 0 : _currentLevel$anyLeve.length) || 0) + (((_currentLevel$thisLev = currentLevel.thisLevel) === null || _currentLevel$thisLev === void 0 ? void 0 : _currentLevel$thisLev.length) || 0);
var added = false;
for (var _i24 = 0; _i24 < combinedLength; _i24++) {
var _currentLevel$anyLeve2, _currentLevel$anyLeve3, _currentLevel$anyLeve4;
var exp2 = _i24 < (((_currentLevel$anyLeve2 = currentLevel.anyLevel) === null || _currentLevel$anyLeve2 === void 0 ? void 0 : _currentLevel$anyLeve2.length) || 0) ? currentLevel.anyLevel[_i24] : currentLevel.thisLevel[_i24 - (((_currentLevel$anyLeve3 = currentLevel.anyLevel) === null || _currentLevel$anyLeve3 === void 0 ? void 0 : _currentLevel$anyLeve3.length) || 0)];
if ((!exp2[0].id || vNode.shadowId === currentLevel.parentShadowId) && _matchesExpression(vNode, exp2[0])) {
if (exp2.length === 1) {
if (!added && (!filter || filter(vNode))) {
result.push(vNode);
added = true;
}
} else {
var rest = exp2.slice(1);
if ([ ' ', '>' ].includes(rest[0].combinator) === false) {
throw new Error('axe.utils.querySelectorAll does not support the combinator: ' + exp2[1].combinator);
}
if (rest[0].combinator === '>') {
(childOnly = childOnly || []).push(rest);
} else {
(childAny = childAny || []).push(rest);
}
}
}
if ((!exp2[0].id || vNode.shadowId === currentLevel.parentShadowId) && (_currentLevel$anyLeve4 = currentLevel.anyLevel) !== null && _currentLevel$anyLeve4 !== void 0 && _currentLevel$anyLeve4.includes(exp2)) {
(childAny = childAny || []).push(exp2);
}
}
if (vNode.children && vNode.children.length) {
stack.push(currentLevel);
currentLevel = createLocalVariables(vNode.children, childAny, childOnly, vNode.shadowId, recycledLocalVariables.pop());
}
while (currentLevel.vNodesIndex === currentLevel.vNodes.length && stack.length) {
recycledLocalVariables.push(currentLevel);
currentLevel = stack.pop();
}
}
return result;
}
function querySelectorAllFilter(domTree, selector, filter) {
domTree = Array.isArray(domTree) ? domTree : [ domTree ];
var expressions = _convertSelector(selector);
var nodes = getNodesMatchingExpression(domTree, expressions, filter);
if (nodes) {
return nodes;
}
return matchExpressions(domTree, expressions, filter);
}
var query_selector_all_filter_default = querySelectorAllFilter;
function preloadCssom(_ref98) {
var _ref98$treeRoot = _ref98.treeRoot, treeRoot = _ref98$treeRoot === void 0 ? axe._tree[0] : _ref98$treeRoot;
var rootNodes = getAllRootNodesInTree(treeRoot);
if (!rootNodes.length) {
return Promise.resolve();
}
var dynamicDoc = document.implementation.createHTMLDocument('Dynamic document for loading cssom');
var convertDataToStylesheet = get_stylesheet_factory_default(dynamicDoc);
return getCssomForAllRootNodes(rootNodes, convertDataToStylesheet).then(function(assets) {
return flattenAssets(assets);
});
}
var preload_cssom_default = preloadCssom;
function getAllRootNodesInTree(tree) {
var ids = [];
var rootNodes = query_selector_all_filter_default(tree, '*', function(node) {
if (ids.includes(node.shadowId)) {
return false;
}
ids.push(node.shadowId);
return true;
}).map(function(node) {
return {
shadowId: node.shadowId,
rootNode: get_root_node_default(node.actualNode)
};
});
return unique_array_default(rootNodes, []);
}
function getCssomForAllRootNodes(rootNodes, convertDataToStylesheet) {
var promises = [];
rootNodes.forEach(function(_ref99, index) {
var rootNode = _ref99.rootNode, shadowId = _ref99.shadowId;
var sheets = getStylesheetsOfRootNode(rootNode, shadowId, convertDataToStylesheet);
if (!sheets) {
return Promise.all(promises);
}
var rootIndex = index + 1;
var parseOptions = {
rootNode: rootNode,
shadowId: shadowId,
convertDataToStylesheet: convertDataToStylesheet,
rootIndex: rootIndex
};
var importedUrls = [];
var p3 = Promise.all(sheets.map(function(sheet, sheetIndex) {
var priority = [ rootIndex, sheetIndex ];
return parse_stylesheet_default(sheet, parseOptions, priority, importedUrls);
}));
promises.push(p3);
});
return Promise.all(promises);
}
function flattenAssets(assets) {
return assets.reduce(function(acc, val) {
return Array.isArray(val) ? acc.concat(flattenAssets(val)) : acc.concat(val);
}, []);
}
function getStylesheetsOfRootNode(rootNode, shadowId, convertDataToStylesheet) {
var sheets;
if (rootNode.nodeType === 11 && shadowId) {
sheets = getStylesheetsFromDocumentFragment(rootNode, convertDataToStylesheet);
} else {
sheets = getStylesheetsFromDocument(rootNode);
}
return filterStylesheetsWithSameHref(sheets);
}
function getStylesheetsFromDocumentFragment(rootNode, convertDataToStylesheet) {
return Array.from(rootNode.children).filter(filerStyleAndLinkAttributesInDocumentFragment).reduce(function(out, node) {
var nodeName2 = node.nodeName.toUpperCase();
var data = nodeName2 === 'STYLE' ? node.textContent : node;
var isLink = nodeName2 === 'LINK';
var stylesheet = convertDataToStylesheet({
data: data,
isLink: isLink,
root: rootNode
});
if (stylesheet.sheet) {
out.push(stylesheet.sheet);
}
return out;
}, []);
}
function getStylesheetsFromDocument(rootNode) {
return Array.from(rootNode.styleSheets).filter(function(sheet) {
if (!sheet.media) {
return false;
}
return filterMediaIsPrint(sheet.media.mediaText);
});
}
function filerStyleAndLinkAttributesInDocumentFragment(node) {
var nodeName2 = node.nodeName.toUpperCase();
var linkHref = node.getAttribute('href');
var linkRel = node.getAttribute('rel');
var isLink = nodeName2 === 'LINK' && linkHref && linkRel && node.rel.toUpperCase().includes('STYLESHEET');
var isStyle = nodeName2 === 'STYLE';
return isStyle || isLink && filterMediaIsPrint(node.media);
}
function filterMediaIsPrint(media) {
if (!media) {
return true;
}
return !media.toUpperCase().includes('PRINT');
}
function filterStylesheetsWithSameHref(sheets) {
var hrefs = [];
return sheets.filter(function(sheet) {
if (!sheet.href) {
return true;
}
if (hrefs.includes(sheet.href)) {
return false;
}
hrefs.push(sheet.href);
return true;
});
}
function preloadMedia(_ref100) {
var _ref100$treeRoot = _ref100.treeRoot, treeRoot = _ref100$treeRoot === void 0 ? axe._tree[0] : _ref100$treeRoot;
var mediaVirtualNodes = query_selector_all_filter_default(treeRoot, 'video[autoplay], audio[autoplay]', function(_ref101) {
var actualNode = _ref101.actualNode;
if (actualNode.preload === 'none' && actualNode.readyState === 0 && actualNode.networkState !== actualNode.NETWORK_LOADING) {
return false;
}
if (actualNode.hasAttribute('paused') || actualNode.hasAttribute('muted')) {
return false;
}
if (actualNode.hasAttribute('src')) {
return !!actualNode.getAttribute('src');
}
var sourceWithSrc = Array.from(actualNode.getElementsByTagName('source')).filter(function(source) {
return !!source.getAttribute('src');
});
if (sourceWithSrc.length <= 0) {
return false;
}
return true;
});
return Promise.all(mediaVirtualNodes.map(function(_ref102) {
var actualNode = _ref102.actualNode;
return isMediaElementReady(actualNode);
}));
}
var preload_media_default = preloadMedia;
function isMediaElementReady(elm) {
return new Promise(function(resolve) {
if (elm.readyState > 0) {
resolve(elm);
}
function onMediaReady() {
elm.removeEventListener('loadedmetadata', onMediaReady);
resolve(elm);
}
elm.addEventListener('loadedmetadata', onMediaReady);
});
}
function _preload(options) {
var preloadFunctionsMap = {
cssom: preload_cssom_default,
media: preload_media_default
};
if (!_shouldPreload(options)) {
return Promise.resolve();
}
return new Promise(function(resolve, reject) {
var _getPreloadConfig2 = _getPreloadConfig(options), assets = _getPreloadConfig2.assets, timeout = _getPreloadConfig2.timeout;
var preloadTimeout = setTimeout(function() {
return reject(new Error('Preload assets timed out.'));
}, timeout);
Promise.all(assets.map(function(asset) {
return preloadFunctionsMap[asset](options).then(function(results) {
return _defineProperty({}, asset, results);
});
})).then(function(results) {
var preloadAssets = results.reduce(function(out, result) {
return _extends({}, out, result);
}, {});
clearTimeout(preloadTimeout);
resolve(preloadAssets);
})['catch'](function(err2) {
clearTimeout(preloadTimeout);
reject(err2);
});
});
}
function isValidPreloadObject(preloadObj) {
return _typeof(preloadObj) === 'object' && Array.isArray(preloadObj.assets);
}
function _shouldPreload(options) {
if (!options || options.preload === void 0 || options.preload === null) {
return true;
}
if (typeof options.preload === 'boolean') {
return options.preload;
}
return isValidPreloadObject(options.preload);
}
function _getPreloadConfig(options) {
var _constants_default$pr = constants_default.preload, assets = _constants_default$pr.assets, timeout = _constants_default$pr.timeout;
var config = {
assets: assets,
timeout: timeout
};
if (!options.preload) {
return config;
}
if (typeof options.preload === 'boolean') {
return config;
}
var areRequestedAssetsValid = options.preload.assets.every(function(a2) {
return assets.includes(a2.toLowerCase());
});
if (!areRequestedAssetsValid) {
throw new Error('Requested assets, not supported. Supported assets are: '.concat(assets.join(', '), '.'));
}
config.assets = unique_array_default(options.preload.assets.map(function(a2) {
return a2.toLowerCase();
}), []);
if (options.preload.timeout && typeof options.preload.timeout === 'number' && !isNaN(options.preload.timeout)) {
config.timeout = options.preload.timeout;
}
return config;
}
function _publishMetaData(ruleResult) {
var checksData = axe._audit.data.checks || {};
var rulesData = axe._audit.data.rules || {};
var rule = find_by_default(axe._audit.rules, 'id', ruleResult.id) || {};
ruleResult.tags = clone2(rule.tags || []);
var shouldBeTrue = extender(checksData, true, rule);
var shouldBeFalse = extender(checksData, false, rule);
ruleResult.nodes.forEach(function(detail) {
detail.any.forEach(shouldBeTrue);
detail.all.forEach(shouldBeTrue);
detail.none.forEach(shouldBeFalse);
});
extend_meta_data_default(ruleResult, clone2(rulesData[ruleResult.id] || {}));
}
function getIncompleteReason(checkData, messages) {
function getDefaultMsg(message) {
if (message.incomplete && message.incomplete['default']) {
return message.incomplete['default'];
} else {
return incompleteFallbackMessage();
}
}
if (checkData && checkData.missingData) {
try {
var msg = messages.incomplete[checkData.missingData[0].reason];
if (!msg) {
throw new Error();
}
return msg;
} catch (_unused0) {
if (typeof checkData.missingData === 'string') {
return messages.incomplete[checkData.missingData];
} else {
return getDefaultMsg(messages);
}
}
} else if (checkData && checkData.messageKey) {
return messages.incomplete[checkData.messageKey];
} else {
return getDefaultMsg(messages);
}
}
function extender(checksData, shouldBeTrue, rule) {
return function(check) {
var sourceData = checksData[check.id] || {};
var messages = sourceData.messages || {};
var data = Object.assign({}, sourceData);
delete data.messages;
if (!rule.reviewOnFail && check.result === void 0) {
if (_typeof(messages.incomplete) === 'object' && !Array.isArray(check.data)) {
data.message = getIncompleteReason(check.data, messages);
}
if (!data.message) {
data.message = messages.incomplete || incompleteFallbackMessage();
}
} else {
data.message = check.result === shouldBeTrue ? messages.pass : messages.fail;
}
if (typeof data.message !== 'function') {
data.message = process_message_default(data.message, check.data);
}
extend_meta_data_default(check, data);
};
}
function querySelectorAll(domTree, selector) {
return query_selector_all_filter_default(domTree, selector);
}
var query_selector_all_default = querySelectorAll;
function matchTags(rule, runOnly) {
var include, exclude;
var defaultExclude = axe._audit && axe._audit.tagExclude ? axe._audit.tagExclude : [];
if (runOnly.hasOwnProperty('include') || runOnly.hasOwnProperty('exclude')) {
include = runOnly.include || [];
include = Array.isArray(include) ? include : [ include ];
exclude = runOnly.exclude || [];
exclude = Array.isArray(exclude) ? exclude : [ exclude ];
exclude = exclude.concat(defaultExclude.filter(function(tag) {
return include.indexOf(tag) === -1;
}));
} else {
include = Array.isArray(runOnly) ? runOnly : [ runOnly ];
exclude = defaultExclude.filter(function(tag) {
return include.indexOf(tag) === -1;
});
}
var matching = include.some(function(tag) {
return rule.tags.indexOf(tag) !== -1;
});
if (matching || include.length === 0 && rule.enabled !== false) {
return exclude.every(function(tag) {
return rule.tags.indexOf(tag) === -1;
});
} else {
return false;
}
}
function ruleShouldRun(rule, context, options) {
var runOnly = options.runOnly || {};
var ruleOptions = (options.rules || {})[rule.id];
if (rule.pageLevel && !context.page) {
return false;
} else if (runOnly.type === 'rule') {
return runOnly.values.indexOf(rule.id) !== -1;
} else if (ruleOptions && typeof ruleOptions.enabled === 'boolean') {
return ruleOptions.enabled;
} else if (runOnly.type === 'tag' && runOnly.values) {
return matchTags(rule, runOnly.values);
} else {
return matchTags(rule, []);
}
}
var rule_should_run_default = ruleShouldRun;
function _filterHtmlAttrs(element, filterAttrs) {
if (!filterAttrs) {
return element;
}
var node = element.cloneNode(false);
var attributes2 = get_node_attributes_default(node);
if (node.nodeType === 1) {
var outerHTML = node.outerHTML;
node = cache_default.get(outerHTML, function() {
return setNodeAttributes(node, attributes2, element, filterAttrs);
});
} else {
node = setNodeAttributes(node, attributes2, element, filterAttrs);
}
Array.from(element.childNodes).forEach(function(child) {
node.appendChild(_filterHtmlAttrs(child, filterAttrs));
});
return node;
}
function setNodeAttributes(node, attributes2, element, filterAttrs) {
if (!attributes2) {
return node;
}
node = document.createElement(node.nodeName);
Array.from(attributes2).forEach(function(attr) {
if (!attributeMatches(element, attr.name, filterAttrs)) {
node.setAttribute(attr.name, attr.value);
}
});
return node;
}
function attributeMatches(node, attrName, filterAttrs) {
if (typeof filterAttrs[attrName] === 'undefined') {
return false;
}
if (filterAttrs[attrName] === true) {
return true;
}
return element_matches_default(node, filterAttrs[attrName]);
}
function _select(selector, context) {
var result = [];
var candidate;
if (axe._selectCache) {
for (var j = 0, l = axe._selectCache.length; j < l; j++) {
var item = axe._selectCache[j];
if (item.selector === selector) {
return item.result;
}
}
}
var outerIncludes = getOuterIncludes(context.include);
var isInContext = getContextFilter(context);
for (var _i25 = 0; _i25 < outerIncludes.length; _i25++) {
candidate = outerIncludes[_i25];
var nodes = query_selector_all_filter_default(candidate, selector, isInContext);
result = mergeArrayUniques(result, nodes);
}
if (axe._selectCache) {
axe._selectCache.push({
selector: selector,
result: result
});
}
return result;
}
function getOuterIncludes(includes) {
return includes.reduce(function(res, el) {
if (!res.length || !_contains(res[res.length - 1], el)) {
res.push(el);
}
return res;
}, []);
}
function getContextFilter(context) {
if (!context.exclude || context.exclude.length === 0) {
return null;
}
return function(node) {
return _isNodeInContext(node, context);
};
}
function mergeArrayUniques(arr1, arr2) {
if (arr1.length === 0) {
return arr2;
}
if (arr1.length < arr2.length) {
var temp = arr1;
arr1 = arr2;
arr2 = temp;
}
for (var _i26 = 0, l = arr2.length; _i26 < l; _i26++) {
if (!arr1.includes(arr2[_i26])) {
arr1.push(arr2[_i26]);
}
}
return arr1;
}
function _serializeError(err2) {
var iteration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
if (_typeof(err2) !== 'object' || err2 === null) {
return {
message: String(err2)
};
}
var serial = {};
var _iterator19 = _createForOfIteratorHelper(constants_default.serializableErrorProps), _step19;
try {
for (_iterator19.s(); !(_step19 = _iterator19.n()).done; ) {
var prop = _step19.value;
if ([ 'string', 'number', 'boolean' ].includes(_typeof(err2[prop]))) {
serial[prop] = err2[prop];
}
}
} catch (err) {
_iterator19.e(err);
} finally {
_iterator19.f();
}
if (err2.cause) {
serial.cause = iteration < 10 ? _serializeError(err2.cause, iteration + 1) : '...';
}
return serial;
}
var RuleError = function(_Error) {
function RuleError(_ref104) {
var _error$name;
var _this12;
var error = _ref104.error, ruleId = _ref104.ruleId, method = _ref104.method, errorNode = _ref104.errorNode;
_classCallCheck(this, RuleError);
_this12 = _callSuper(this, RuleError);
_this12.name = (_error$name = error.name) !== null && _error$name !== void 0 ? _error$name : 'RuleError';
_this12.message = error.message;
_this12.stack = error.stack;
if (error.cause) {
_this12.cause = _serializeError(error.cause);
}
if (ruleId) {
_this12.ruleId = ruleId;
_this12.message += ' Skipping '.concat(_this12.ruleId, ' rule.');
}
if (method) {
_this12.method = method;
}
if (errorNode) {
_this12.errorNode = errorNode;
}
return _this12;
}
_inherits(RuleError, _Error);
return _createClass(RuleError);
}(_wrapNativeSuper(Error));
var rule_error_default = RuleError;
function setScroll(elm, top, left) {
if (elm === window) {
return elm.scroll(left, top);
} else {
elm.scrollTop = top;
elm.scrollLeft = left;
}
}
function setScrollState(scrollState) {
scrollState.forEach(function(_ref105) {
var elm = _ref105.elm, top = _ref105.top, left = _ref105.left;
return setScroll(elm, top, left);
});
}
var set_scroll_state_default = setScrollState;
function _shadowSelect(selectors) {
var selectorArr = Array.isArray(selectors) ? _toConsumableArray(selectors) : [ selectors ];
return selectRecursive(selectorArr, document);
}
function selectRecursive(selectors, doc) {
var selectorStr = selectors.shift();
var elm = selectorStr ? doc.querySelector(selectorStr) : null;
if (selectors.length === 0) {
return elm;
}
if (!(elm !== null && elm !== void 0 && elm.shadowRoot)) {
return null;
}
return selectRecursive(selectors, elm.shadowRoot);
}
function _shadowSelectAll(selectors) {
var doc = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : document;
var selectorArr = Array.isArray(selectors) ? _toConsumableArray(selectors) : [ selectors ];
if (selectors.length === 0) {
return [];
}
return selectAllRecursive(selectorArr, doc);
}
function selectAllRecursive(_ref106, doc) {
var _ref107 = _toArray(_ref106), selectorStr = _ref107[0], restSelector = _arrayLikeToArray(_ref107).slice(1);
var elms = doc.querySelectorAll(selectorStr);
if (restSelector.length === 0) {
return Array.from(elms);
}
var selected = [];
var _iterator20 = _createForOfIteratorHelper(elms), _step20;
try {
for (_iterator20.s(); !(_step20 = _iterator20.n()).done; ) {
var elm = _step20.value;
if (elm !== null && elm !== void 0 && elm.shadowRoot) {
selected.push.apply(selected, _toConsumableArray(selectAllRecursive(restSelector, elm.shadowRoot)));
}
}
} catch (err) {
_iterator20.e(err);
} finally {
_iterator20.f();
}
return selected;
}
function toArray(thing) {
return Array.prototype.slice.call(thing);
}
var to_array_default = toArray;
function validInputTypes() {
return [ 'hidden', 'text', 'search', 'tel', 'url', 'email', 'password', 'date', 'month', 'week', 'time', 'datetime-local', 'number', 'range', 'color', 'checkbox', 'radio', 'file', 'submit', 'image', 'reset', 'button' ];
}
var valid_input_type_default = validInputTypes;
var langs = [ , [ , [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, , 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, , 1, 1, 1, , 1, 1, , 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, , 1, 1, 1, 1, 1, 1, 1, , 1, , 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, , , , , , 1, 1, 1, 1, , , 1, 1, 1, , 1, , 1, , 1, 1 ], [ 1, 1, 1, , 1, 1, , 1, 1, 1, , 1, , , 1, 1, 1, , , 1, 1, 1, , , , , 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, , , , , 1, 1, 1, , 1, 1, 1, 1, 1, 1, , 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , , 1, 1, 1 ], [ , 1, , , , , , 1, , 1, , , , , 1, , 1, , , 1, 1, 1, , 1, , , 1 ], [ 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, , 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , , , 1, 1, 1, 1, , , 1, , 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, , 1, 1, , , 1, , , , 1, 1, 1, 1, , 1, , 1, , 1, , , , , , 1 ], [ 1, , 1, 1, 1, 1, , , 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1 ], [ 1, , 1, , 1, , , , , 1, , 1, 1, 1, 1, 1, , , , 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, , 1, 1, 1, , 1, , 1, 1, 1, , , 1, 1, 1, 1, 1, 1, 1, 1 ], [ , , 1, , , 1, , 1, , , , 1, 1, 1, , , , , , , , , , , 1 ], [ 1, 1, 1, 1, 1, 1, , 1, 1, 1, , 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, , , 1, 1, 1 ], [ 1, 1, 1, 1, 1, , , 1, , , 1, , , 1, 1, 1, , , , , 1, , , , , , 1 ] ], [ , [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, , 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, , , 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, , , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, , 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ] ], [ , [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, , 1, 1, , 1, 1, 1, 1, 1, 1, 1, , 1 ], [ , 1, , 1, 1, 1, , 1, 1, , 1, , 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, , 1, 1, 1, 1, 1, 1, 1, 1, , , 1, 1, 1, , , 1, 1, , , , , , 1, 1 ], [ 1, 1, 1, , , , , 1, , , , 1, 1, , 1, , , , , , 1, , , , , 1 ], [ , 1, , , 1, , , 1, , , , , , 1 ], [ , 1, , 1, , , , 1, , , , 1 ], [ 1, , 1, 1, 1, , 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, , , 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, , , 1, , , 1, , 1, 1, , 1, , 1, , , , , 1, , 1 ], [ , 1, , , , 1, , , 1, 1, , 1, , 1, 1, 1, 1, , 1, 1, , , 1, , , 1 ], [ , 1, 1, , , , , , 1, , , , 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, , 1, 1, 1 ], [ , 1, , 1, 1, 1, , , 1, 1, 1, 1, 1, 1, , 1, , , , 1, 1, 1, , 1, , 1 ], [ , 1, , 1, , 1, , 1, , 1, , 1, 1, 1, 1, 1, , , 1, 1, 1 ], [ , 1, 1, 1, , , , 1, 1, 1, , 1, 1, , , 1, 1, 1, 1, 1, 1, 1, , 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, , , 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, , 1, 1, 1, , 1, , , , , 1, 1, 1, , , 1, , 1, , , 1, 1 ], [ , , , , 1, , , , , , , , , , , , , , , , , 1 ], [ 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, , 1, 1, 1, , 1, 1, , , , 1, 1, 1, 1, 1, , , 1, 1, 1, , , , 1, 1 ], [ 1, 1, 1, 1, , , , 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, , , , , , , 1, , , , , , , 1 ], [ , 1, 1, , 1, 1, , 1, , , , , , , , , , , , , 1 ], [ , , , , , , , , 1 ], [ 1, 1, 1, , , , , , , , , , , , , 1 ], [ , , , , , , , , 1, , , 1, , , 1, 1, , , , , 1 ] ], [ , [ 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1 ], [ , 1, 1, , 1, 1, 1, 1, , 1, 1, , 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, , 1 ], [ , , , 1, , , , , , , , , , , , , , , 1 ], [ , 1, , , 1, 1, , 1, , 1, 1, , , , 1, 1, , , 1, 1, , , , 1 ], [ 1, , , 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, , 1, 1, 1, 1, , , 1, , , , 1 ], , [ , 1, 1, 1, 1, 1, , 1, 1, 1, , 1, 1, , 1, 1, , , 1, 1, 1, 1, , 1, 1, , 1 ], [ , 1, , , 1, , , 1, , 1, , , 1, 1, 1, 1, , , 1, 1, , 1, 1, 1, 1 ], [ , 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, , , 1, 1, 1, 1, 1, 1, 1, , , 1, , , 1, , 1 ], [ , 1, , , , , , 1, , , , 1, 1, , , , , , 1, 1, , , , , 1 ], [ , , , , , , , 1, , , , 1, , 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, , , , 1, 1, 1, 1, 1, , , 1, 1, , 1, 1, 1, 1, 1 ], [ , 1, , , 1, 1, , 1, , 1, 1, 1, , , 1, 1, , , 1, , 1, 1, 1, 1, , 1 ], [ , 1, 1, 1, , 1, 1, , 1, 1, , 1, 1, , 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1 ], [ , , , , , , , , , , , , , , , , 1 ], , [ , 1, 1, 1, 1, 1, , 1, 1, 1, , , 1, , 1, 1, , 1, 1, 1, 1, 1, , 1, , 1 ], [ , , 1, , , 1, , , 1, 1, , 1, 1, , 1, 1, , 1, , , , , , , , , 1 ], [ , 1, 1, , 1, , , , 1, 1, , 1, , 1, 1, 1, 1, , 1, 1, 1, 1, , , , 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1 ], [ 1, 1 ], [ , 1, , , , , , , , , , 1, 1, , , , , , 1, 1, , 1, , 1, , 1, 1 ], , [ , 1, 1, , 1, , , 1, , 1, , , , 1, 1, 1, , , 1, , , 1, , , , 1 ], [ 1, 1, , , 1, 1, , 1, , , , , 1, , 1 ] ], [ , [ , 1 ], [ , , , 1, , , , 1, , , , 1, , , , 1, , , 1, , , 1 ], [ , , , , , , , , , , , , , , , , , , 1, 1, , , , , , 1 ], , [ 1, , , , , 1 ], [ , 1, , , , 1, , , , 1 ], [ , 1, , , , , , , , , , , 1, 1, , 1, , , , , , , , , 1, 1 ], [ , , , , , , , , , , , , , , , , , , , 1, , 1 ], [ , , , , , , , , , , , , , , , , 1, , , , 1, , 1 ], [ , 1 ], [ , 1, , 1, , 1, , 1, , 1, , 1, 1, 1, , 1, 1, , 1, , , , , , , 1 ], [ 1, , , , , 1, , , 1, 1, , 1, , 1, , 1, 1, , , , , 1, , , 1 ], [ , 1, 1, , , 1, , 1, , 1, , 1, , 1, 1, 1, 1, 1, , 1, , 1, , 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, , 1, , 1, , , , 1, 1, 1, 1, , 1, 1, , , 1, 1, 1, 1 ], [ 1, , , , , , , , , , , , , , , , , , , , 1 ], [ , , , , , , , , , 1 ], , [ , 1, , , , , , 1, 1, 1, , 1, , , , 1, , , 1, 1, 1, , , 1 ], [ 1, , , , , 1, , 1, 1, 1, , 1, 1, 1, 1, 1, , 1, , 1, , 1, , , 1, 1 ], [ 1, , 1, 1, , , , , 1, , , , , , 1, 1, , , 1, 1, 1, 1, , , 1, , 1 ], [ 1, , , , 1, , , , , , , , , , , , , 1 ], [ , , , , , 1, , , 1, , , , , , 1 ], [ , , , , , , , , , , , , , , , 1 ], [ , , , , , , , , , , , , , , , , , , , , 1 ], [ , 1, , , , , , , , , , , , , , 1 ], [ , 1, , , , 1 ] ], [ , [ 1, 1, 1, , 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, , 1, , 1, 1, , , 1, 1, 1 ], [ , , , , , , , , , , , , 1 ], [ , , , , , , , , , , , , , , , , , , , 1 ], , [ , , , , , , , , , , , , , , , , , , 1 ], [ 1, , , , , , , , , 1, , , , 1 ], [ , , , , , , , , , , , , , , , , , , 1 ], , [ 1, 1, , , , 1, 1, , , , , , 1, , , , 1, , 1, , 1, 1, , 1 ], [ 1 ], [ , , , , , , , , , , , 1, , , , , , , , , , , 1 ], [ , 1, , , , , , , 1, 1, , , 1, , 1, , , , 1, , , , , , , 1 ], [ , , , , , , , , , , , , , , , , 1, , , , , 1 ], [ , , 1, , , , , 1, , 1 ], [ 1, , , , 1, , , , , 1, , , , 1, 1, , , , 1, 1, , , , , 1 ], [ , , , , , 1 ], [ , , , , , , , , , , , , , , , , , , , 1 ], [ 1, , , 1, 1, , , , , , , 1, , 1, , 1, 1, 1, 1, 1, 1 ], [ , , , , , 1, , , , , , , 1, , , , , , , 1 ], , [ , , 1, 1, 1, 1, 1, , 1, 1, 1, , , 1, 1, , , 1, 1, , 1, 1, 1, , , 1 ], [ , , , , , , , , , , , , , , , , , , 1 ], [ , 1, , , , 1 ], , [ 1 ] ], [ , [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1 ], [ , , , 1, 1, 1, 1, , , , , , 1, , 1, , , , 1, , 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, , , 1 ], [ , 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, , , , 1, , 1, , , 1, 1, 1, 1, 1 ], [ , , , , , , , , , , , 1, , , , , , , , , 1, , , , 1 ], [ , 1, 1, , 1, 1, , 1, , , , 1, 1, , 1, 1, , , 1, , 1, 1, , 1 ], [ , 1, , 1, , 1, , , 1, , , 1, 1, , 1, 1, , , 1, 1, 1 ], [ , 1, 1, 1, 1, 1, , 1, 1, 1, , , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1 ], [ , , , , , , , , , 1, , 1, , 1, 1, , , , 1, , , 1 ], [ , 1, , , 1, 1, , , , , , , , , 1, 1, 1, , , , , 1 ], [ 1, , 1, 1, 1, , , , 1, 1, 1, 1, 1, , , 1, , , 1, , , 1, , 1, , 1 ], [ , 1, 1, , 1, 1, , 1, 1, , , , 1, 1, 1, , , 1, 1, , , 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, , 1, 1, , 1, , , 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, , , , 1, , , , , , , , , 1 ], [ , 1, , , , , , , , 1, , , , , 1, , , , 1, , , 1 ], [ , 1, 1, 1, 1, , , 1, 1, 1, 1, 1, , 1, , 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , , , , , 1, , 1, , , , , 1, 1, 1, 1, 1, , , 1, , , , 1 ], [ , 1, , , , , , , , 1, , , , , , , , , , , , 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1 ], [ 1, 1, , 1, , 1, 1, , , , 1, , 1, 1, 1, 1, 1, , 1, 1, , , , , , 1 ], [ , 1, 1, 1, 1, 1, 1, 1, , 1, 1, , , 1, 1, , , , 1, , 1, 1, , 1, 1 ], [ , , , , , , , , , , , , , , , , , , , , , , , , 1 ], [ , 1, 1, , 1, 1, 1, 1, , 1, , , 1, 1, 1, 1, , , 1, , , , , , , 1, 1 ], [ , 1, , , , , , , , 1, , , , , 1 ] ], [ , [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , , 1, 1, 1, 1, 1 ], [ , 1, 1, , , , , , , , , , , , 1, 1, , , , , , 1 ], [ , 1, , , , , , , 1 ], [ , , , , , , , , , , , , , , 1, , , , , 1, , , , , , 1 ], [ 1, 1, , , 1, , , 1, 1, 1, , , , 1 ], , [ , , , , , , , , , , , , , 1, , , , , , , , , , 1 ], [ , , , , , , , , , 1, , , , , , , , , 1, , , , , , , 1 ], [ 1, 1, 1, , 1, , 1, 1, 1, 1, 1, 1, 1, 1, , 1, , , 1, , 1, , , 1, 1 ], [ , , , , , , , , , 1 ], [ , 1, , , , 1, , , 1, , , 1, , , 1, , , , , 1 ], [ , 1, 1, , 1, 1, , , , , , , , , , , , , , , 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, , , 1, 1, , 1, 1, 1, 1, , , 1, 1, 1, , , , 1, , 1 ], [ 1, 1, 1, 1, 1, 1, , , 1, 1, 1, 1, 1, 1, , 1, 1, , 1, 1, 1, , 1, 1, , 1, 1 ], [ , , , , , , , , , , , , , , , 1, , , , 1 ], , [ 1, 1, , 1, , 1, , , , , , 1, , 1, , 1, 1, , 1, , 1, 1, , 1, 1, , 1 ], [ , , 1, , , , , , 1, , , , 1, , 1, , , , , 1 ], [ 1, , , , , , , , , 1, , , , , , 1, , , , 1, , 1, , , 1 ], [ 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , , , 1, , 1, , , , , , 1, , , 1, , , , , , , , 1 ], [ , 1, , 1, , , , , , , , , , , , 1 ], , [ 1, 1, , , , , , , , , , , , , , , , , , , , , , 1, 1 ], [ 1 ] ], [ , [ 1, , , , , , , , , 1, , , , , 1, , 1, , 1 ], [ , 1, 1, , 1, 1, , 1, 1, 1, , , 1, 1, 1, , , , 1, , , 1, , , , 1 ], [ , 1, , , , , , , 1, , , , 1, , , , , , 1 ], [ 1, 1, 1, 1, 1, 1, , , , 1, , , , , , , , , 1, 1, 1, 1 ], [ 1 ], [ , 1, 1, , , 1, 1, , , , , 1, , 1, , , , , , , , 1, , , , 1 ], [ 1, , 1, , , 1, , 1, , , , , 1, 1, 1, 1, , , , 1, , , , 1 ], [ , , 1, , , , , , , 1, , , , , , , 1, , , , , , , 1 ], [ 1, , , , , , , , , , , , , , 1, , , , 1 ], [ , , , 1, , 1, , , , , 1, , , , 1, 1, , , , 1 ], [ 1, , , , , 1, , , 1, 1, , 1, 1, , , 1, 1, , 1, 1, 1, , 1, 1, 1, , 1 ], [ , 1, 1, , , , , 1, , 1, , 1, 1, 1, , 1, 1, , , 1, , 1, 1, 1 ], [ , 1, , , , 1, , , , 1, , , 1, , 1, 1, , , 1, 1, 1, , , , , 1 ], [ 1, , 1, 1, , 1, , 1, 1, , 1, , 1, 1, 1, 1, 1, , , 1, 1, , , , , , 1 ], [ 1, , , , , , , , , , , , , , , , , , 1, , , 1, , 1 ], [ , , , , , , , , , 1, , , , , , 1 ], [ , , , , , , , , , , , , , , , , , , , , , 1, , 1 ], [ , 1, , , , 1, , , 1, 1, , 1, , , 1, 1, , , 1, , , 1, , , 1, 1 ], [ 1, 1, , 1, 1, 1, , 1, 1, 1, , 1, , 1, 1, 1, , , 1, , 1, 1, 1 ], [ 1, , 1, 1, 1, 1, , , , 1, , 1, 1, 1, , 1, , , 1, 1, 1, , 1, 1, 1, 1, 1 ], [ 1, , , , , , , , , , , , , 1 ], [ , , 1, , , , , , , , , , , , , , , , , , , , 1 ], [ 1, , , , , , , , , , , 1, , 1, , 1, , , , 1 ], [ , , , 1, , , , , , , , , 1 ], [ , 1, , , , , , , , , , , , , , 1, , , , , , , , , 1 ], [ , , , , , , , , 1, 1, , , , 1, , , , , 1, , , , , , , , 1 ] ], [ , [ 1, 1, 1, 1, 1, 1, 1, , 1, , 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, , , 1, 1, 1 ], [ , , , , , 1, , , , 1, 1, 1, , 1, 1, 1, , , 1, , 1, 1, , 1 ], [ , , , , , , , , , , , , , , , , , , , 1, 1 ], [ , 1, , , , , , 1, , , , , , , , , , , , , 1 ], [ , , 1, , , 1, , 1, 1, 1, , 1, 1, , 1, , , , 1, , 1, 1 ], , [ , , 1, , , 1, , , , , , 1, , , , 1 ], [ , , , , , , , , , 1, , , , , , , , , , 1 ], [ 1, 1, 1, 1, 1, 1, , 1, 1, 1, , , 1, 1, , 1, , 1, , , 1, 1, 1, , , 1 ], [ , , , , , 1, , , , , , , , , , , , , 1 ], [ , 1, , , , , , , , , , , , 1, , 1, 1, , 1, 1, , 1 ], [ , , , , , 1, , , , , , , , , , , , , , 1 ], [ , 1, 1, 1, 1, , , , , 1, , , 1, , 1, , , , 1, 1, , , , 1, 1 ], [ , 1, , , 1, , , 1, , 1, 1, , 1, , , , , , , 1 ], [ , , 1, , 1, , , 1, , , , , , , , , , , 1, 1, , , , 1 ], [ , 1, , , , , , , , , , , , , , , , , 1, , , , , , 1 ], [ , , , , , , , , , , , , , , , , , , 1 ], [ , 1, 1, , , , , , , , , , , , , , , , 1, , 1, 1 ], [ , , , , , , , , , , , , 1 ], , [ , 1, 1, 1, 1, , , , 1, 1, , 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, , 1, , 1 ], [ 1, , , , 1, , , , , , , , , , 1 ], [ 1, , , , , , , , , 1 ], , [ , 1, , , , 1, , , , , , , , , , , , , , , , , , , , 1 ] ], [ , [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, , 1, 1, 1, 1, , , , 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, , 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , , 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ] ], [ , [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, , 1, , 1, 1, 1, 1 ], [ 1, 1, 1, 1, , 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , , , 1, 1, 1, 1, , 1, , , , 1, 1, , , 1, 1, , 1 ], [ , 1, 1, , 1, , , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, , , , , , , , , , , , , 1 ], [ 1, 1, 1, , , , , 1, 1, 1, , 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, , , , , 1 ], [ , 1, , , , , , , 1, 1, , , 1, 1, 1, , 1, , , 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , , 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1 ], [ , 1, , , , 1, , , , 1, , , 1, , , , 1, , , , , , , 1, 1 ], [ , 1, 1, 1, 1, 1, , , 1, 1, 1, , 1, 1, 1, 1, , , 1, 1, 1, 1, , , , 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, , 1, , , 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , , 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, , 1, , , 1, 1, 1, 1, , 1, 1, 1, 1, , , , 1, , 1, , 1, , , 1 ], [ 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, , , , 1, , , , , , , , , 1, 1, , , , , , , , , 1 ], [ , , , , , , , , , , , , , , , , , , 1 ], [ , 1, , 1, , 1, , 1, , 1, , 1, 1, 1, 1, 1, , , 1, , 1, , 1, , , , 1 ], [ , 1, 1, 1, 1, 1, , 1, 1, 1, , , 1, 1, 1, 1, 1, , 1, 1, 1, , 1, 1, , 1 ], [ 1, , , 1, , , , 1, 1, 1, , , , , 1, 1, , , , 1, , 1 ], [ 1, 1, , 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1 ], [ 1, 1, , , , , , , , 1, , 1, 1, , , , , , , 1, , 1 ], [ , 1, , , , 1, , 1, 1, , , , 1, 1, , 1, , , , 1, 1, 1, , 1 ], [ , , , , , , , , , , , , , 1 ], [ , 1, , , , , , 1, , , , , , , 1 ], [ , , , , , , , , 1, , , , 1, , 1, , , , , , , , , , , , 1 ] ], [ , [ , 1, 1, , 1, 1, 1, 1, , 1, 1, 1, , 1, 1, , 1, 1, , 1, 1, 1, 1, 1, 1, , 1 ], [ , 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, , 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1 ], [ , 1, 1, , 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ] ], [ , [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , , 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , , 1, , 1 ], [ 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, , , 1, , , , , , , , 1, , , , , , 1, , , 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, , 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, , 1, , , , 1, 1, 1, , 1, 1, 1, 1, , , 1, 1, 1, 1, , , 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1 ], [ 1, 1, , 1, , 1, , 1, , 1, 1, 1, 1, 1, 1, 1, , 1, 1, , , 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, , 1, 1 ], [ , 1, 1, , , , , 1, 1, 1, , , 1, , 1, 1, , , , 1, , 1, , , 1, 1 ], [ , , , , , , , 1, , , , 1, 1, 1, 1, 1, , 1, , , 1, , , , , 1 ], [ 1, 1, 1, 1, , 1, 1, 1, , 1, , 1, 1, 1, 1, , 1, , 1, , 1, 1, , , 1, , 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , , , , 1, 1, , 1, , 1, 1, 1, , 1, , 1, 1, , 1, 1, , 1, , 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, , , , , , , , 1, , , , , 1, , 1 ], [ , 1, 1, 1, , 1, , 1, , 1, , , , 1, , 1, , , 1, , , , , 1, 1, 1 ], [ , 1, , , 1, 1, , 1, , 1, , 1, 1, 1, 1, 1, , 1, 1, , , 1, , , 1 ], [ 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, , 1, , , , , 1, , 1, , 1, , , , , 1, 1, , 1, , , , 1, 1 ] ], [ , [ , 1, , 1, , , , , , , , 1, , , , , , , 1, , , , 1 ], [ , , , , , , , , , 1, , 1, 1, 1, , 1, , , 1, , 1, 1 ], [ 1, 1, , , , , , , 1, , , , , 1, , 1, , , , , , 1 ], [ , 1, , , , , , , , , , 1, , , , , , , , , 1, 1 ], , [ , , , , , , , , , , , , , , , 1, , , , 1, , 1 ], [ , , 1, 1, , 1, , 1, , , , , , , , 1, , , , , , 1 ], [ , , , , , , , , , , , , , , , , , , , , 1, 1 ], [ , 1, , , , 1, , , , , , , , , 1 ], [ 1, , 1, 1, , , , 1, , , , , , , , , 1, , , 1, , , 1, 1 ], [ , 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, , , 1, 1, , 1, 1, , 1, , 1 ], [ , 1, , , 1, 1, , , , , , 1, , 1, , 1, , , 1, , 1, 1 ], [ 1, 1, 1, 1, , 1, , 1, , 1, , 1, 1, , 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1 ], [ , 1, 1, , , 1, , 1, , 1, 1, 1, , , 1, 1, 1, , 1, 1, 1, 1, , 1, 1 ], [ , , , , 1, , , 1, , , , , , , 1, , , , 1, 1 ], [ , 1, , , , , , , , , , 1, , 1, , 1, , , , , 1, , , , , 1 ], , [ 1, 1, , 1, , 1, , 1, 1, , , , , , 1, 1, , , 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, , 1, , , , , , 1, , , , , 1, 1, 1, , , , 1, 1, , , 1 ], [ , 1, 1, , 1, 1, , , , 1, , 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, , 1, 1, 1, 1 ], [ , 1, 1, , , 1, , , , 1, , , , 1, 1 ], [ , , , , 1 ], [ , , , , , , , , , 1, , , 1 ], , [ , , 1, , 1, , , , , , , , , 1, , , , , , , , , , , , 1 ], [ , , , , , , , , , , , , , 1 ] ], [ , [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , , 1, 1, , 1, 1, 1, 1, 1, , , 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, , , 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, , 1, , , , , 1 ], [ , 1, , 1, , , , , , 1, , , , , 1, 1, , , , , 1, 1 ], [ , 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, , 1, , , 1, , 1, 1, 1 ], [ , 1, , , , 1, , , , , , , 1 ], [ , 1, , , 1, , , 1, , 1, , 1, 1, , 1, , , , , 1, , 1, , , , 1, 1 ], [ , 1, , , 1, , , 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, , 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , , , , , , , , , , , , , , , , , , , , 1 ], [ , 1, 1, 1, , , , 1, 1, , , , , , 1, 1, 1, , 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1 ], [ , 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, , 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , , , 1, 1, 1, 1, 1, 1, 1, , 1, , 1, 1, 1, 1, 1, , 1, 1, , 1, 1, 1, 1, 1 ], [ , 1, , , , 1, , , , 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, , , , 1, , , , , , , , 1, , , , , , , , , , 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1 ], [ 1, 1, , 1, 1, 1, , 1, 1, 1, , , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, , 1 ], [ 1, 1, , , , , , , 1, 1, , , , , 1, 1, 1, 1, 1, , 1, 1, 1, 1, , 1 ], [ , 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, , 1, , 1, 1, 1, 1, , 1, 1, , 1, 1, 1, 1 ], , [ , 1, 1, , , , , 1, , 1, , , , 1, 1, 1, , , 1, , , , , 1 ], [ , , , , , , , , , , , , , 1 ], [ , , , , , 1, , , , , , , , 1, 1, , , , , 1, , 1, , , 1, 1 ], [ , , , , , 1, , , 1, , , , , , 1 ] ], [ , [ , 1 ], , , , , , , , , , , , , , , , , , , , [ 1, 1, 1, 1, 1, , 1, 1, 1, 1, , 1, 1, 1, 1, , 1, 1, 1, 1, , , 1, 1, 1, 1, 1 ], [ , 1, , 1, , 1, , , 1, 1, 1, , 1, 1, 1, 1, 1, , , 1, , , , 1, , 1, 1 ], [ , 1, , 1, , 1, , , 1, , , , , 1, , , , , , 1, 1 ], [ , 1, , 1, , , , , 1, , , , 1, , 1, 1, 1, 1, 1, 1, 1, 1, , 1 ], [ , 1, , , , , , , , , , , , , , , 1 ] ], [ , [ , 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , , 1, , , , , , , , , 1, 1, , , , 1 ], [ , , , , , , 1 ], [ , , 1 ], [ , 1, 1, , , 1, , 1, , 1, 1, , 1, 1, 1, , , , 1, 1, 1, , , , , 1 ], , [ , 1, , , , 1, , , , , , 1, , , 1, , , , 1, 1, , 1 ], [ , , , , , , , 1, , , , , , , , , 1 ], [ , 1, 1, , , 1, 1, , , , , , 1, 1, 1, , , , 1, , 1, 1 ], [ , , , , , , , 1, , 1, , , , , , , , , , 1 ], [ , 1, 1, , , , , , 1, 1, , , , 1, , , , , , , 1, , , 1 ], , [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, , 1, , , 1, , , , , 1, , 1, , 1, , 1, , , , , 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, , , , , 1, 1, , 1, 1, , 1, , , 1, , 1 ], [ , , , , , , , , , , , , , , 1, , , , , , 1 ], , [ , , , , , , , , , 1, , , , 1, , 1, , , , , 1 ], [ , , 1, , , , , , , 1, , 1, 1, 1, 1, , , , , , , , , 1 ], [ , , , 1, , , , , 1, , , , , 1, , , , , , 1, , , , 1 ], [ 1, , 1, 1, , 1, 1, 1, 1, 1, , 1, , , , 1, 1, 1, , , 1, 1, , , , 1, 1 ], , [ 1, 1, , , , , , , , , , 1, 1, 1, , 1, , , 1 ], [ , , , , 1, , , , , , , , , , , , , , , , , , , 1 ], [ , , , , , , , , , , , , , , 1, , , , , 1, , 1 ], [ , , , , , , , , 1 ] ], [ , [ 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, , , 1, 1, 1, 1, 1, , 1, 1, , 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, , 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, , 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1 ], [ , , 1, , , 1, , , , , , , , 1, , , , , , 1, , , , 1 ], [ 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, , 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, , 1, , , , 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, , 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, , 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, , 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1 ], [ , , 1, 1, 1, 1, , 1, , 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1 ], [ 1, 1, , , , , , , 1, , 1, 1, , 1, 1, 1, , 1, 1, 1, 1, 1, , , 1 ], [ 1, 1, 1, 1, , 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1 ], [ 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1 ], [ 1, 1, 1, 1, , 1, , 1, , 1, 1, 1, 1, 1, , 1, , 1, 1, 1, 1, , 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, , 1, , , , , , 1, , 1, , , , , 1, 1, , , , , 1 ], [ 1, , 1, 1, , , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , , 1, 1, , 1, , 1, , , , 1, 1, 1, 1, 1, , , 1, 1, , 1, , 1 ], [ , 1, 1, 1, 1, , , , , 1, , 1, 1, 1, 1, 1, , , 1, 1, , , , 1, 1, 1 ], [ , 1, 1, 1, 1, 1, , 1, , , , , 1, , 1, , 1, , , 1, , , 1, 1, , 1 ] ], [ , [ 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, , 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, , 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , , , , , , , , , 1, , , , , 1, 1, , , 1, , 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , , , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, , , 1, 1, 1, 1, , 1, 1, , 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, , , , , , 1, , 1, 1, , 1, 1, 1, 1, 1, , , 1, , 1, , 1 ], [ 1, 1, 1, , 1, 1, 1, 1, , , , 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1 ], [ 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1 ], [ , 1, , 1, , 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1 ], [ , , 1, , , , , , , , , , 1, 1, 1, 1, 1, 1, 1, , 1, 1, , 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, , , 1, 1, , , , 1, , 1, 1, 1, 1, 1, , , , 1, 1, 1, , 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, , , , 1, 1, 1, 1, 1, 1, 1, , 1, 1, , 1, 1, 1 ], [ , 1, 1, 1, , 1, , 1, 1, 1, 1, , , 1, 1, 1, , 1, 1, 1, 1, 1, , , 1, 1 ], [ 1, 1, , , , 1, , , 1, 1, 1, , 1, , 1, , 1, , 1, 1, 1, 1, 1, , 1, 1, 1 ], [ , 1, , , , , , , 1, , 1, , 1, 1, 1, 1, , , , , , , , , 1 ] ], [ , [ , , , , , , , , , , , , , 1, 1, , , , 1 ], [ , 1, , , , , , , , 1, , , 1, , , , , , 1, , , 1, , , , 1 ], , [ , 1, , , , 1, , 1, , 1, 1, , 1, 1, , , , , , , , 1 ], [ , , , , , , , , , , , , , , , , , , , 1 ], [ , , , , , , , , , 1 ], [ 1, 1, 1, , , 1, , , 1, , , , , , 1, 1, , , , , , , , , , 1 ], [ , 1, , , , , , , , , , , , , 1 ], [ , , , , , , , , , , , , , , , , , , , 1, , , 1 ], [ , , , , , , , , , 1 ], [ 1, 1, , , , , , 1, 1, 1, , 1, 1, , , , 1, 1, , 1, , 1, 1, 1, , 1 ], [ , 1, 1, 1, , 1, 1, , , 1, , 1, 1, 1, 1, , , , , , , 1, , 1, , 1 ], [ , 1, 1, 1, 1, , , 1, , 1, , , , 1, 1, 1, 1, , 1, 1, , 1 ], [ , 1, , , 1, 1, , 1, , 1, , 1, , 1, 1, , 1, , 1, , , 1, , , 1, , 1 ], [ , , , , , , , , , , , 1, , , 1 ], [ , , , , , , , , , 1, , , , , , , , , , , , , 1 ], , [ 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, , 1, 1, 1, 1, 1, 1, 1 ], [ , 1, , , , , , , 1, 1, , 1, , , , , 1, , , 1, , 1 ], [ , 1, , , , 1, , , 1, , , , , , , , 1, , 1, , , 1 ], [ , , , , , , , , , , , , , 1, 1, , , , 1, , , 1 ], [ , , , , , 1, , , 1, , , , 1 ], [ , 1 ], , [ , 1 ], [ 1, , , , , , , , , , , , , , 1, , , , , 1 ] ], [ , [ , 1, , , , 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, , 1, 1, , 1, 1, , , 1 ], [ , , 1, , , , , , , , , 1 ], , , [ 1, , , 1, 1, , , , , , , , 1, 1, , 1, 1, , 1 ], , [ , , , , , , , , , , , , , , , , , , 1, , 1 ], , [ 1, , , 1, 1, , 1, 1, , , , , 1, , 1, , , , , 1, 1, , 1 ], [ , , , , , , , , , , , 1 ], [ , 1, , , , , , , , 1, 1, 1, 1, 1, 1, 1, 1, , , , 1, 1, , , , , 1 ], [ , , , , , , , , , , , , , , , , 1, , , 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , , 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1 ], [ , , , , , , , , , , , 1, , 1, , , 1 ], [ 1, , , , , , , , , , , , , , , , , , 1, , 1 ], , , [ , 1, , , , , , , , , , , , , , 1, , , , 1, 1 ], [ , , , , , , , , , 1, , , 1, , 1, , , , , , , , 1 ], [ , , , , , , , , , , , , , , , 1 ], [ , , , , , , , , , , , , , 1, 1, , , , , , 1 ], , [ , 1 ] ], [ , [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, , , 1, 1, , 1, 1, 1, 1, 1, 1, , , 1, 1, 1, 1, 1, , 1, 1 ], [ , 1, , , , , , , , 1 ], [ , , , , 1, , , 1, , , 1, 1, , , , , , , , , 1, 1, , , , 1 ], [ , 1, , 1, 1, , , 1, 1, 1, , , , 1, 1, 1, 1, , 1, 1, 1, 1, , 1 ], [ , , , , , , , 1 ], [ , 1, 1, , , , , 1, , 1, , , , , , 1, , , , , , 1, , 1, , 1 ], [ , 1, , , , , , 1, , , , 1, , , , , , , , , , 1 ], [ , , 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , , , 1, , 1, 1, 1, 1, , 1 ], [ , 1, , , , , , , , 1 ], [ , 1, 1, , 1, , , , , , , , 1, , , , , , 1, , , 1, , 1, , 1 ], [ , 1, , 1, , 1, , 1, 1, 1, , 1, 1, 1, , 1, , , 1, 1, , 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, , 1, 1, 1, , , , 1, 1, 1, , , , 1, 1, , , 1, 1 ], [ , , 1, 1, 1, 1, , 1, , 1, , 1, , 1, 1, 1, 1, , , , , 1, , 1, , 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, , 1, , 1, , 1, 1, 1, , , 1, 1, , , , 1, , 1 ], [ , , , 1 ], , [ , 1, 1, , 1, , , 1, 1, 1, , 1, 1, 1, 1, 1, 1, , 1, 1, , 1, 1, 1, 1, 1, 1 ], [ , 1, , , , , , 1, , 1, , 1, , , , , , , 1, 1, , 1, 1 ], [ , , 1, , , , 1, , 1, 1, , 1, , 1, , , , , , , , , , 1 ], [ , 1, 1, , 1, , , , 1, , , , 1, 1, 1, , , , 1, , 1, 1, 1, , 1, 1 ], , [ , 1, 1, , , , , , , , , , , , , 1, , , 1, , , , , 1 ], [ , 1, , , , , , , , , , , , , , , , , , , , , , 1 ], [ , 1, 1, , , , , , , 1, , , , 1, 1, , , , 1, , , , , , , 1 ] ], [ , [ , 1, 1, 1, 1, 1, , 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1 ], [ , 1, 1, 1, 1, 1, , 1, , 1, 1, , , 1, 1, 1, 1, , 1, , , , , 1, 1, 1 ], [ , , 1, 1, , 1, , 1, 1, , , , 1, 1, 1, 1, , , 1, , 1, 1, 1, 1, , 1 ], [ , 1, , 1, , , , , , , , 1, , 1, , 1, , 1, , , , , , , , 1 ], [ , , 1, , 1, , , 1, , , , , 1, 1, , , 1, , 1, 1, 1, 1 ], [ , 1 ], [ , 1, 1, , 1, , 1, 1, , 1, , , 1, 1, 1, , , , 1, , , 1, , 1 ], [ 1, 1, , 1, 1, 1, , , , , , , , 1, , , , , 1, , 1, 1, 1 ], [ , 1, 1, , , , , , , 1, , , 1, , 1, , 1, , 1, 1, , , 1, , , 1 ], [ , , 1, , , , , , , , , , , , , , , , , , 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, , 1, , 1, , , , , 1, 1, 1, , , 1, , 1, , , , 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, , 1, , , 1, 1, 1, 1, 1, , 1, 1, 1, , 1, 1, 1, 1, 1, , , , 1, 1 ], [ , , , 1, 1, , , 1, , 1, , 1, , 1, 1, 1, 1, , 1, , , , , 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, , , , , , , , , , , , , , , , , , , 1 ], [ , 1, 1, , 1, 1, , 1, , 1, , , , 1, 1, , , 1, 1, , 1, 1, , 1 ], [ , 1, 1, 1, 1, 1, , , 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, , , 1 ], [ , 1, 1, 1, 1, 1, , 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1 ], [ , 1, 1, , 1, , , 1, , , 1, , 1, 1, 1, 1, 1, , 1, , 1, 1 ], [ , , , , , 1, , , , 1, , , , , 1, 1, , , , 1 ], [ , 1, , 1, 1, 1, , 1, , , 1, 1, 1, , , 1, , , 1, , 1, , , 1 ], [ , , 1, , , , , , , , , 1, , 1, , , , , 1, , 1 ], [ , 1, 1, , , , , , , , 1, 1, 1, , , , , , , , 1, , , , , 1 ], [ , , , , , , , , 1, , , , , 1, , , 1 ] ], [ , [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, , 1, 1, , , 1, 1, 1, 1, 1, 1, 1, 1, , , , , , , , , 1, 1 ], [ , , , , , , , , 1, , , , 1, , 1, , 1, , 1 ], [ , 1, , , 1, 1, , 1, , , , 1, , , , , , , , 1 ], [ , 1, , 1, , 1, , , , 1, 1, , 1, , 1, , , , 1, 1, 1, 1, 1, , , 1 ], , [ , 1, , , , , , , , 1, , , 1, 1, , , 1, , 1, 1, , 1, , 1 ], [ , 1, , , 1, , , , , , , , 1, , , , , , , 1 ], [ 1, 1, , , , , 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1 ], , [ , 1, , , , , , 1, 1, 1, , 1, 1, 1, 1, 1, , , 1, , 1, 1, , , , 1 ], [ , 1, 1, , , 1, , 1, , 1, , , 1, 1, 1, 1, , , 1, , , 1, , , , 1 ], [ , 1, 1, 1, 1, 1, , 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , , , 1, , 1 ], [ , 1, 1, , 1, 1, , 1, 1, , , 1, 1, , 1, 1, , 1, , 1, , 1 ], [ 1, , 1, , , , , 1, , 1, , 1, 1, 1, 1, , , , , 1, 1, , , , 1, 1 ], [ , 1, 1, , , , , 1, 1, , , 1, , 1, 1, 1, 1, , , , , , , , , , 1 ], , [ , 1, 1, , , 1, , , , 1, , 1, 1, 1, 1, 1, , , , 1, , , , 1, , 1 ], [ , , , 1, 1, , , 1, , , , , 1, 1, 1, 1, 1, , 1, 1, , , , , , 1 ], [ , 1, , , , , , , , , , , 1, , , , 1, , , , , , , 1, , 1 ], [ , 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, , 1, 1, 1, , 1, 1, , 1, 1, 1, 1 ], [ , 1, , , , , , , , , , , , , , , , , , , 1 ], [ , 1, , , , , , 1, , , , , 1, , 1, , , 1, 1, , 1, 1, , 1 ], [ , 1, , , , , , 1, , , , , 1, 1, , , , , , , , 1, , , , 1 ], [ , , , , , , , , , , , , , , , , , , 1, , , 1, , , , , 1 ], [ , , , , , , , 1, , , , 1 ] ], [ , [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, , 1, , 1, , , , , , , 1, , , , , , , , 1, 1, , 1 ], [ , 1, , , 1, , , , 1 ], [ , , , , , , , , , , 1 ], [ , 1, , , , , , 1, 1, , , , , 1, 1 ], , [ , 1, 1, , , , , , 1, , , , , 1, 1, , , , 1 ], [ 1, , 1, , 1, , , , , 1, , , , , 1, , , , , , , , , 1, 1 ], [ , 1, 1, , , , , , , , , 1, 1, 1, 1, , , , 1, , , , , 1, , , 1 ], , [ , 1, 1, , 1, , , 1, 1, , , 1, , , 1, 1, 1, , 1, , 1, 1, 1, , , , 1 ], [ , 1, , , , 1, , , , , 1, , , 1, 1, , , 1, , 1, , 1, , 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, , , 1, 1, , 1, , , , 1, , , , , , , , 1 ], [ , , , 1, , , , , 1, , , , , 1, , 1, , 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , , , , , 1 ], [ , 1, , , , , , 1, , , , , , , 1, 1, 1, , , 1 ], [ , 1, , , , , , , , , , 1, 1, 1, , , , , 1, , , 1 ], [ , , , , , 1, , 1, , , , , 1, 1, 1, , 1, 1, , 1, 1, 1, , , 1, 1 ], [ 1, 1, , , , , , , 1, , , , , 1, 1, , , , , , , , , , , 1 ], , [ , 1 ], [ , , , , , , , , , , , , , , , , , , , , , , , , 1 ], [ , , 1, , , , , 1, , , 1, , , , 1, , 1 ], [ , 1, , , , , , , , , 1 ] ] ];
function isValidLang(lang) {
var array = langs;
while (lang.length < 3) {
lang += '`';
}
for (var _i27 = 0; _i27 <= lang.length - 1; _i27++) {
var index = lang.charCodeAt(_i27) - 96;
array = array[index];
if (!array) {
return false;
}
}
return true;
}
function _validLangs(langArray) {
langArray = Array.isArray(langArray) ? langArray : langs;
var codes = [];
langArray.forEach(function(lang, index) {
var _char4 = String.fromCharCode(index + 96).replace('`', '');
if (Array.isArray(lang)) {
codes = codes.concat(_validLangs(lang).map(function(newLang) {
return _char4 + newLang;
}));
} else {
codes.push(_char4);
}
});
return codes;
}
var valid_langs_default = isValidLang;
function _normalizeRunOptions() {
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var tags = [];
var ruleIds = [];
axe._audit.rules.forEach(function(rule) {
ruleIds.push(rule.id);
rule.tags.forEach(function(tag) {
if (!tags.includes(tag)) {
tags.push(tag);
}
});
});
if ([ 'object', 'string' ].includes(_typeof(options.runOnly))) {
if (typeof options.runOnly === 'string') {
options.runOnly = [ options.runOnly ];
}
if (Array.isArray(options.runOnly)) {
var hasTag = options.runOnly.find(function(value) {
return tags.includes(value);
});
var hasRule = options.runOnly.find(function(value) {
return ruleIds.includes(value);
});
if (hasTag && hasRule) {
throw new Error('runOnly cannot be both rules and tags');
}
if (hasRule) {
options.runOnly = {
type: 'rule',
values: options.runOnly
};
} else {
options.runOnly = {
type: 'tag',
values: options.runOnly
};
}
}
var only = options.runOnly;
if (only.value && !only.values) {
only.values = only.value;
delete only.value;
}
if (!Array.isArray(only.values) || only.values.length === 0) {
throw new Error('runOnly.values must be a non-empty array');
}
if ([ 'rule', 'rules' ].includes(only.type)) {
only.type = 'rule';
only.values.forEach(function(ruleId) {
if (!ruleIds.includes(ruleId)) {
throw new Error('unknown rule `' + ruleId + '` in options.runOnly');
}
});
} else if ([ 'tag', 'tags', void 0 ].includes(only.type)) {
only.type = 'tag';
var unmatchedTags = only.values.filter(function(tag) {
return !tags.includes(tag) && !/wcag2[1-3]a{1,3}/.test(tag);
});
if (unmatchedTags.length !== 0) {
axe.log('Could not find tags `' + unmatchedTags.join('`, `') + '`');
}
} else {
throw new Error('Unknown runOnly type \''.concat(only.type, '\''));
}
}
if (_typeof(options.rules) === 'object') {
Object.keys(options.rules).forEach(function(ruleId) {
if (!ruleIds.includes(ruleId)) {
throw new Error('unknown rule `' + ruleId + '` in options.rules');
}
});
}
return options;
}
var SerialVirtualNode = function(_abstract_virtual_nod2) {
function SerialVirtualNode(serialNode) {
var _this13;
_classCallCheck(this, SerialVirtualNode);
_this13 = _callSuper(this, SerialVirtualNode);
_this13._props = normaliseProps(serialNode);
_this13._attrs = normaliseAttrs(serialNode);
return _this13;
}
_inherits(SerialVirtualNode, _abstract_virtual_nod2);
return _createClass(SerialVirtualNode, [ {
key: 'props',
get: function get() {
return this._props;
}
}, {
key: 'attr',
value: function attr(attrName) {
var _this$_attrs$attrName;
return (_this$_attrs$attrName = this._attrs[attrName]) !== null && _this$_attrs$attrName !== void 0 ? _this$_attrs$attrName : null;
}
}, {
key: 'hasAttr',
value: function hasAttr(attrName) {
return this._attrs[attrName] !== void 0;
}
}, {
key: 'attrNames',
get: function get() {
return Object.keys(this._attrs);
}
} ]);
}(abstract_virtual_node_default);
var nodeNamesToTypes = {
'#cdata-section': 2,
'#text': 3,
'#comment': 8,
'#document': 9,
'#document-fragment': 11
};
var nodeTypeToName = {};
var nodeNames = Object.keys(nodeNamesToTypes);
nodeNames.forEach(function(nodeName2) {
nodeTypeToName[nodeNamesToTypes[nodeName2]] = nodeName2;
});
function normaliseProps(serialNode) {
var _serialNode$nodeName, _ref108, _serialNode$nodeType;
var nodeName2 = (_serialNode$nodeName = serialNode.nodeName) !== null && _serialNode$nodeName !== void 0 ? _serialNode$nodeName : nodeTypeToName[serialNode.nodeType];
var nodeType = (_ref108 = (_serialNode$nodeType = serialNode.nodeType) !== null && _serialNode$nodeType !== void 0 ? _serialNode$nodeType : nodeNamesToTypes[serialNode.nodeName]) !== null && _ref108 !== void 0 ? _ref108 : 1;
assert_default(typeof nodeType === 'number', 'nodeType has to be a number, got \''.concat(nodeType, '\''));
assert_default(typeof nodeName2 === 'string', 'nodeName has to be a string, got \''.concat(nodeName2, '\''));
nodeName2 = nodeName2.toLowerCase();
var type2 = null;
if (nodeName2 === 'input') {
type2 = (serialNode.type || serialNode.attributes && serialNode.attributes.type || '').toLowerCase();
if (!valid_input_type_default().includes(type2)) {
type2 = 'text';
}
}
var props = _extends({}, serialNode, {
nodeType: nodeType,
nodeName: nodeName2
});
if (type2) {
props.type = type2;
}
delete props.attributes;
return Object.freeze(props);
}
function normaliseAttrs(_ref109) {
var _ref109$attributes = _ref109.attributes, attributes2 = _ref109$attributes === void 0 ? {} : _ref109$attributes;
var attrMap = {
htmlFor: 'for',
className: 'class'
};
return Object.keys(attributes2).reduce(function(attrs, attrName) {
var value = attributes2[attrName];
assert_default(_typeof(value) !== 'object' || value === null, 'expects attributes not to be an object, \''.concat(attrName, '\' was'));
if (value !== void 0) {
var mappedName = attrMap[attrName] || attrName;
attrs[mappedName] = value !== null ? String(value) : null;
}
return attrs;
}, {});
}
var serial_virtual_node_default = SerialVirtualNode;
function cleanup(resolve, reject) {
resolve = resolve || function res() {};
reject = reject || axe.log;
if (!axe._audit) {
throw new Error('No audit configured');
}
var q2 = axe.utils.queue();
var cleanupErrors = [];
Object.keys(axe.plugins).forEach(function(key) {
q2.defer(function(res) {
var rej = function rej2(err2) {
cleanupErrors.push(err2);
res();
};
try {
axe.plugins[key].cleanup(res, rej);
} catch (err2) {
rej(err2);
}
});
});
var flattenedTree = axe.utils.getFlattenedTree(document.body);
axe.utils.querySelectorAll(flattenedTree, 'iframe, frame').forEach(function(node) {
q2.defer(function(res, rej) {
return axe.utils.sendCommandToFrame(node.actualNode, {
command: 'cleanup-plugin'
}, res, rej);
});
});
q2.then(function(results) {
if (cleanupErrors.length === 0) {
resolve(results);
} else {
reject(cleanupErrors);
}
})['catch'](reject);
}
var cleanup_default = cleanup;
var reporters = {};
function hasReporter(reporterName) {
return reporters.hasOwnProperty(reporterName);
}
function getReporter(reporter) {
if (typeof reporter === 'string' && reporters[reporter]) {
return reporters[reporter];
}
if (typeof reporter === 'function') {
return reporter;
}
return reporters.v1;
}
function addReporter(name, cb, isDefault) {
reporters[name] = cb;
if (isDefault) {
configure_default({
reporter: name
});
}
}
function configure(spec) {
var audit = axe._audit;
if (!audit) {
throw new Error('No audit configured');
}
if (spec.axeVersion || spec.ver) {
var specVersion = spec.axeVersion || spec.ver;
if (!/^\d+\.\d+\.\d+(-canary)?/.test(specVersion)) {
throw new Error('Invalid configured version '.concat(specVersion));
}
var _specVersion$split = specVersion.split('-'), _specVersion$split2 = _slicedToArray(_specVersion$split, 2), version = _specVersion$split2[0], canary = _specVersion$split2[1];
var _version$split$map = version.split('.').map(Number), _version$split$map2 = _slicedToArray(_version$split$map, 3), major = _version$split$map2[0], minor = _version$split$map2[1], patch = _version$split$map2[2];
var _axe$version$split = axe.version.split('-'), _axe$version$split2 = _slicedToArray(_axe$version$split, 2), axeVersion = _axe$version$split2[0], axeCanary = _axe$version$split2[1];
var _axeVersion$split$map = axeVersion.split('.').map(Number), _axeVersion$split$map2 = _slicedToArray(_axeVersion$split$map, 3), axeMajor = _axeVersion$split$map2[0], axeMinor = _axeVersion$split$map2[1], axePatch = _axeVersion$split$map2[2];
if (major !== axeMajor || axeMinor < minor || axeMinor === minor && axePatch < patch || major === axeMajor && minor === axeMinor && patch === axePatch && canary && canary !== axeCanary) {
throw new Error('Configured version '.concat(specVersion, ' is not compatible with current axe version ').concat(axe.version));
}
}
if (spec.reporter && (typeof spec.reporter === 'function' || hasReporter(spec.reporter))) {
audit.reporter = spec.reporter;
}
if (spec.checks) {
if (!Array.isArray(spec.checks)) {
throw new TypeError('Checks property must be an array');
}
spec.checks.forEach(function(check) {
if (!check.id) {
throw new TypeError('Configured check '.concat(JSON.stringify(check), ' is invalid. Checks must be an object with at least an id property'));
}
audit.addCheck(check);
});
}
var modifiedRules = [];
if (spec.rules) {
if (!Array.isArray(spec.rules)) {
throw new TypeError('Rules property must be an array');
}
spec.rules.forEach(function(rule) {
if (!rule.id) {
throw new TypeError('Configured rule '.concat(JSON.stringify(rule), ' is invalid. Rules must be an object with at least an id property'));
}
modifiedRules.push(rule.id);
audit.addRule(rule);
});
}
if (spec.disableOtherRules) {
audit.rules.forEach(function(rule) {
if (modifiedRules.includes(rule.id) === false) {
rule.enabled = false;
}
});
}
var previousHelpUrlSettings = {
brand: audit.brand,
application: audit.application,
lang: audit.lang
};
if (typeof spec.branding !== 'undefined') {
audit.setBranding(spec.branding);
}
if (spec.tagExclude) {
audit.tagExclude = spec.tagExclude;
}
if (spec.locale) {
audit.applyLocale(spec.locale);
}
audit._constructHelpUrls(previousHelpUrlSettings);
if (spec.standards) {
configureStandards(spec.standards);
}
if (spec.noHtml) {
audit.noHtml = true;
}
if (spec.allowedOrigins) {
if (!Array.isArray(spec.allowedOrigins)) {
throw new TypeError('Allowed origins property must be an array');
}
if (spec.allowedOrigins.includes('*')) {
throw new Error('"*" is not allowed. Use "'.concat(constants_default.allOrigins, '" instead'));
}
audit.setAllowedOrigins(spec.allowedOrigins);
}
}
var configure_default = configure;
var ELEMENT_INTERNALS_DEFAULT_TIMEOUT = 1e3;
var getElementInternals2;
var elementInternalsTimeout;
function externalAPIs() {
var _ref110 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, internalsTimeout = _ref110.elementInternalsTimeout, getInternals = _ref110.getElementInternals;
if (isNotNullOrUndefined(internalsTimeout)) {
assert_default(typeof internalsTimeout === 'number', 'elementInternalsTimeout must be a number');
elementInternalsTimeout = internalsTimeout;
} else if (internalsTimeout === null) {
elementInternalsTimeout = ELEMENT_INTERNALS_DEFAULT_TIMEOUT;
}
if (isNotNullOrUndefined(getInternals)) {
assert_default(typeof getInternals === 'function', 'getElementInternals must be a function that returns a Promise');
getElementInternals2 = getInternals;
} else if (getInternals === null) {
getElementInternals2 = null;
}
}
function isNotNullOrUndefined(val) {
return val !== void 0 && val !== null;
}
function asyncTimeout(_x) {
return _asyncTimeout.apply(this, arguments);
}
function _asyncTimeout() {
_asyncTimeout = _asyncToGenerator(_regenerator().m(function _callee(ms) {
return _regenerator().w(function(_context2) {
while (1) {
switch (_context2.n) {
case 0:
return _context2.a(2, new Promise(function(res) {
return setTimeout(res, ms, 'timeout');
}));
}
}
}, _callee);
}));
return _asyncTimeout.apply(this, arguments);
}
function loadElementInternals() {
return _loadElementInternals.apply(this, arguments);
}
function _loadElementInternals() {
_loadElementInternals = _asyncToGenerator(_regenerator().m(function _callee2() {
var logger2, promiseValue, internalsMap, _i47, _internalsMap$_i, internals, ancestry, node, vNode, _i48, _Object$entries2, _Object$entries2$_i, _key14, val, type2, value, _args2 = arguments;
return _regenerator().w(function(_context3) {
while (1) {
switch (_context3.n) {
case 0:
logger2 = _args2.length > 0 && _args2[0] !== undefined ? _args2[0] : log;
if (getElementInternals2) {
_context3.n = 1;
break;
}
return _context3.a(2);
case 1:
_context3.n = 2;
return Promise.race([ asyncTimeout(elementInternalsTimeout), getElementInternals2() ]);
case 2:
promiseValue = _context3.v;
assert_default(promiseValue !== 'timeout', 'Timeout called for elementInternals');
internalsMap = clone2(promiseValue);
if (!(!internalsMap || !Array.isArray(internalsMap))) {
_context3.n = 3;
break;
}
logger2('externalAPIs.getElementInternals() did not return an array');
return _context3.a(2);
case 3:
_i47 = 0;
case 4:
if (!(_i47 < internalsMap.length)) {
_context3.n = 14;
break;
}
if (!(!internalsMap[_i47] || _typeof(internalsMap[_i47]) !== 'object')) {
_context3.n = 5;
break;
}
logger2('externalAPIs.getElementInternals()['.concat(_i47, '] is not an object'));
return _context3.a(3, 13);
case 5:
_internalsMap$_i = internalsMap[_i47], internals = _internalsMap$_i.internals,
ancestry = _internalsMap$_i.ancestry;
if (!(!internals || _typeof(internals) !== 'object')) {
_context3.n = 6;
break;
}
logger2('externalAPIs.getElementInternals()['.concat(_i47, '].internals is not an object'));
return _context3.a(3, 13);
case 6:
if (!(!ancestry || !(Array.isArray(ancestry) || typeof ancestry === 'string'))) {
_context3.n = 7;
break;
}
logger2('externalAPIs.getElementInternals()['.concat(_i47, '].ancestry is not a string or an array of strings'));
return _context3.a(3, 13);
case 7:
node = _shadowSelect(ancestry);
vNode = get_node_from_tree_default(node);
if (vNode) {
_context3.n = 8;
break;
}
logger2('Unable to locate node using selector '.concat(ancestry, ' from externalAPIs.getElementInternals()[').concat(_i47, ']'));
return _context3.a(3, 13);
case 8:
_i48 = 0, _Object$entries2 = Object.entries(internals);
case 9:
if (!(_i48 < _Object$entries2.length)) {
_context3.n = 12;
break;
}
_Object$entries2$_i = _slicedToArray(_Object$entries2[_i48], 2), _key14 = _Object$entries2$_i[0],
val = _Object$entries2$_i[1];
if (!(typeof val === 'string')) {
_context3.n = 10;
break;
}
return _context3.a(3, 11);
case 10:
type2 = val.type, value = val.value;
if (!type2) {
logger2('externalAPIs.getElementInternals()['.concat(_i47, '].internals.').concat(_key14, ' is an object but has no "type" property'));
}
if (!value) {
logger2('externalAPIs.getElementInternals()['.concat(_i47, '].internals.').concat(_key14, ' is an object but has no "value" property'));
}
if (type2 === 'HTMLElement') {
setHTMLElement(internals, _key14, value);
} else if (type2 === 'NodeList') {
setNodeList(internals, _key14, value);
}
case 11:
_i48++;
_context3.n = 9;
break;
case 12:
vNode.elementInternals = internals;
case 13:
_i47++;
_context3.n = 4;
break;
case 14:
return _context3.a(2);
}
}
}, _callee2);
}));
return _loadElementInternals.apply(this, arguments);
}
var external = {
loadElementInternals: loadElementInternals
};
function setHTMLElement(internals, key, value) {
var node = _shadowSelect(value);
if (node) {
internals[key] = node;
} else {
Object.defineProperty(internals, key, {
get: function get() {
throw new Error('Unable to locate node using selector: '.concat(value));
}
});
}
}
function setNodeList(internals, key, value) {
var nodes = [];
var errorSelectors = [];
var _iterator21 = _createForOfIteratorHelper(value), _step21;
try {
for (_iterator21.s(); !(_step21 = _iterator21.n()).done; ) {
var selector = _step21.value;
var node = _shadowSelect(selector);
if (node) {
nodes.push(node);
} else {
errorSelectors.push(selector);
}
}
} catch (err) {
_iterator21.e(err);
} finally {
_iterator21.f();
}
if (errorSelectors.length === 0) {
internals[key] = nodes;
} else {
Object.defineProperty(internals, key, {
get: function get() {
throw new Error('Unable to locate nodes using selectors: '.concat(errorSelectors.join(',')));
}
});
}
}
function frameMessenger2(frameHandler) {
_respondable.updateMessenger(frameHandler);
}
function getRules(tags) {
tags = tags || [];
var _axe$_audit = axe._audit, rules = _axe$_audit.rules, data = _axe$_audit.data, tagExclude = _axe$_audit.tagExclude;
var matchingRules = !tags.length ? rules : rules.filter(function(item) {
return !!tags.filter(function(tag) {
return item.tags.indexOf(tag) !== -1;
}).length;
});
var ruleData = data.rules || {};
return matchingRules.map(function(matchingRule) {
var rd = ruleData[matchingRule.id] || {};
return {
ruleId: matchingRule.id,
description: rd.description,
help: rd.help,
helpUrl: rd.helpUrl,
tags: matchingRule.tags,
actIds: matchingRule.actIds,
enabled: matchingRule.enabled && !matchingRule.tags.some(function(tag) {
return tagExclude.includes(tag);
})
};
});
}
var get_rules_default = getRules;
function hiddenContentEvaluate(node, options, virtualNode) {
var allowlist = [ 'SCRIPT', 'HEAD', 'TITLE', 'NOSCRIPT', 'STYLE', 'TEMPLATE' ];
if (!allowlist.includes(node.nodeName.toUpperCase()) && has_content_virtual_default(virtualNode)) {
var styles = window.getComputedStyle(node);
if (styles.getPropertyValue('display') === 'none') {
return void 0;
} else if (styles.getPropertyValue('visibility') === 'hidden') {
var parent = get_composed_parent_default(node);
var parentStyle = parent && window.getComputedStyle(parent);
if (!parentStyle || parentStyle.getPropertyValue('visibility') !== 'hidden') {
return void 0;
}
}
}
return true;
}
var hidden_content_evaluate_default = hiddenContentEvaluate;
var table_exports = {};
__export(table_exports, {
getAllCells: function getAllCells() {
return get_all_cells_default;
},
getCellPosition: function getCellPosition() {
return get_cell_position_default;
},
getHeaders: function getHeaders() {
return get_headers_default;
},
getScope: function getScope() {
return _getScope;
},
isColumnHeader: function isColumnHeader() {
return is_column_header_default;
},
isDataCell: function isDataCell() {
return is_data_cell_default;
},
isDataTable: function isDataTable() {
return is_data_table_default;
},
isHeader: function isHeader() {
return is_header_default;
},
isRowHeader: function isRowHeader() {
return is_row_header_default;
},
toArray: function toArray() {
return to_grid_default;
},
toGrid: function toGrid() {
return to_grid_default;
},
traverse: function traverse() {
return traverse_default;
}
});
function getAllCells(tableElm) {
var rowIndex, cellIndex, rowLength, cellLength;
var cells = [];
for (rowIndex = 0, rowLength = tableElm.rows.length; rowIndex < rowLength; rowIndex++) {
for (cellIndex = 0, cellLength = tableElm.rows[rowIndex].cells.length; cellIndex < cellLength; cellIndex++) {
cells.push(tableElm.rows[rowIndex].cells[cellIndex]);
}
}
return cells;
}
var get_all_cells_default = getAllCells;
function traverseForHeaders(headerType, position, tableGrid) {
var property = headerType === 'row' ? '_rowHeaders' : '_colHeaders';
var predicate = headerType === 'row' ? is_row_header_default : is_column_header_default;
var startCell = tableGrid[position.y][position.x];
var colspan = startCell.colSpan - 1;
var rowspanAttr = startCell.getAttribute('rowspan');
var rowspanValue = parseInt(rowspanAttr) === 0 || startCell.rowspan === 0 ? tableGrid.length : startCell.rowSpan;
var rowspan = rowspanValue - 1;
var rowStart = position.y + rowspan;
var colStart = position.x + colspan;
var rowEnd = headerType === 'row' ? position.y : 0;
var colEnd = headerType === 'row' ? 0 : position.x;
var headers;
var cells = [];
for (var row = rowStart; row >= rowEnd && !headers; row--) {
for (var col = colStart; col >= colEnd; col--) {
var cell = tableGrid[row] ? tableGrid[row][col] : void 0;
if (!cell) {
continue;
}
var vNode = axe.utils.getNodeFromTree(cell);
if (vNode[property]) {
headers = vNode[property];
break;
}
cells.push(cell);
}
}
headers = (headers || []).concat(cells.filter(predicate));
cells.forEach(function(tableCell) {
var vNode = axe.utils.getNodeFromTree(tableCell);
vNode[property] = headers;
});
return headers;
}
function getHeaders(cell, tableGrid) {
if (cell.getAttribute('headers')) {
var headers = idrefs_default(cell, 'headers');
if (headers.filter(function(header) {
return header;
}).length) {
return headers;
}
}
if (!tableGrid) {
tableGrid = to_grid_default(find_up_default(cell, 'table'));
}
var position = get_cell_position_default(cell, tableGrid);
var rowHeaders = traverseForHeaders('row', position, tableGrid);
var colHeaders = traverseForHeaders('col', position, tableGrid);
return [].concat(rowHeaders, colHeaders).reverse();
}
var get_headers_default = getHeaders;
function isDataCell(cell) {
if (!cell.children.length && !cell.textContent.trim()) {
return false;
}
var role = get_explicit_role_default(cell);
if (role) {
return [ 'cell', 'gridcell' ].includes(role);
} else {
return cell.nodeName.toUpperCase() === 'TD';
}
}
var is_data_cell_default = isDataCell;
function isDataTable(node) {
var role = get_explicit_role_default(node);
if ((role === 'presentation' || role === 'none') && !_isFocusable(node)) {
return false;
}
if (node.getAttribute('contenteditable') === 'true' || find_up_default(node, '[contenteditable="true"]')) {
return true;
}
if (role === 'grid' || role === 'treegrid' || role === 'table') {
return true;
}
if (get_role_type_default(role) === 'landmark') {
return true;
}
if (node.getAttribute('datatable') === '0') {
return false;
}
if (node.getAttribute('summary')) {
return true;
}
if (node.tHead || node.tFoot || node.caption) {
return true;
}
for (var childIndex = 0, childLength = node.children.length; childIndex < childLength; childIndex++) {
if (node.children[childIndex].nodeName.toUpperCase() === 'COLGROUP') {
return true;
}
}
var cells = 0;
var rowLength = node.rows.length;
var row, cell;
var hasBorder = false;
for (var rowIndex = 0; rowIndex < rowLength; rowIndex++) {
row = node.rows[rowIndex];
for (var cellIndex = 0, cellLength = row.cells.length; cellIndex < cellLength; cellIndex++) {
cell = row.cells[cellIndex];
if (cell.nodeName.toUpperCase() === 'TH') {
return true;
}
if (!hasBorder && (cell.offsetWidth !== cell.clientWidth || cell.offsetHeight !== cell.clientHeight)) {
hasBorder = true;
}
if (cell.getAttribute('scope') || cell.getAttribute('headers') || cell.getAttribute('abbr')) {
return true;
}
if ([ 'columnheader', 'rowheader' ].includes(get_explicit_role_default(cell))) {
return true;
}
if (cell.children.length === 1 && cell.children[0].nodeName.toUpperCase() === 'ABBR') {
return true;
}
cells++;
}
}
if (node.getElementsByTagName('table').length) {
return false;
}
if (rowLength < 2) {
return false;
}
var sampleRow = node.rows[Math.ceil(rowLength / 2)];
if (sampleRow.cells.length === 1 && sampleRow.cells[0].colSpan === 1) {
return false;
}
if (sampleRow.cells.length >= 5) {
return true;
}
if (hasBorder) {
return true;
}
var bgColor, bgImage;
for (var _rowIndex = 0; _rowIndex < rowLength; _rowIndex++) {
row = node.rows[_rowIndex];
if (bgColor && bgColor !== window.getComputedStyle(row).getPropertyValue('background-color')) {
return true;
} else {
bgColor = window.getComputedStyle(row).getPropertyValue('background-color');
}
if (bgImage && bgImage !== window.getComputedStyle(row).getPropertyValue('background-image')) {
return true;
} else {
bgImage = window.getComputedStyle(row).getPropertyValue('background-image');
}
}
if (rowLength >= 20) {
return true;
}
if (get_element_coordinates_default(node).width > get_viewport_size_default(window).width * .95) {
return false;
}
if (cells < 10) {
return false;
}
if (node.querySelector('object, embed, iframe, applet')) {
return false;
}
return true;
}
var is_data_table_default = isDataTable;
function isHeader(cell) {
if (is_column_header_default(cell) || is_row_header_default(cell)) {
return true;
}
if (cell.getAttribute('id')) {
var _id4 = escape_selector_default(cell.getAttribute('id'));
return !!document.querySelector('[headers~="'.concat(_id4, '"]'));
}
return false;
}
var is_header_default = isHeader;
function traverseTable(dir, position, tableGrid, callback) {
var result;
var cell = tableGrid[position.y] ? tableGrid[position.y][position.x] : void 0;
if (!cell) {
return [];
}
if (typeof callback === 'function') {
result = callback(cell, position, tableGrid);
if (result === true) {
return [ cell ];
}
}
result = traverseTable(dir, {
x: position.x + dir.x,
y: position.y + dir.y
}, tableGrid, callback);
result.unshift(cell);
return result;
}
function traverse(dir, startPos, tableGrid, callback) {
if (Array.isArray(startPos)) {
callback = tableGrid;
tableGrid = startPos;
startPos = {
x: 0,
y: 0
};
}
if (typeof dir === 'string') {
switch (dir) {
case 'left':
dir = {
x: -1,
y: 0
};
break;
case 'up':
dir = {
x: 0,
y: -1
};
break;
case 'right':
dir = {
x: 1,
y: 0
};
break;
case 'down':
dir = {
x: 0,
y: 1
};
break;
}
}
return traverseTable(dir, {
x: startPos.x + dir.x,
y: startPos.y + dir.y
}, tableGrid, callback);
}
var traverse_default = traverse;
var aria_exports = {};
__export(aria_exports, {
allowedAttr: function allowedAttr() {
return allowed_attr_default;
},
arialabelText: function arialabelText() {
return _arialabelText;
},
arialabelledbyText: function arialabelledbyText() {
return arialabelledby_text_default;
},
getAccessibleRefs: function getAccessibleRefs() {
return get_accessible_refs_default;
},
getAriaValue: function getAriaValue() {
return _getAriaValue;
},
getElementUnallowedRoles: function getElementUnallowedRoles() {
return get_element_unallowed_roles_default;
},
getExplicitRole: function getExplicitRole() {
return get_explicit_role_default;
},
getImplicitRole: function getImplicitRole() {
return implicit_role_default;
},
getOwnedVirtual: function getOwnedVirtual() {
return get_owned_virtual_default;
},
getRole: function getRole() {
return get_role_default;
},
getRoleType: function getRoleType() {
return get_role_type_default;
},
getRolesByType: function getRolesByType() {
return get_roles_by_type_default;
},
getRolesWithNameFromContents: function getRolesWithNameFromContents() {
return get_roles_with_name_from_contents_default;
},
hasAriaValue: function hasAriaValue() {
return _hasAriaValue;
},
implicitNodes: function implicitNodes() {
return implicit_nodes_default;
},
implicitRole: function implicitRole() {
return implicit_role_default;
},
isAccessibleRef: function isAccessibleRef() {
return is_accessible_ref_default;
},
isAriaRoleAllowedOnElement: function isAriaRoleAllowedOnElement() {
return is_aria_role_allowed_on_element_default;
},
isComboboxPopup: function isComboboxPopup() {
return _isComboboxPopup;
},
isUnsupportedRole: function isUnsupportedRole() {
return is_unsupported_role_default;
},
isValidRole: function isValidRole() {
return is_valid_role_default;
},
label: function label() {
return label_default2;
},
labelVirtual: function labelVirtual() {
return label_virtual_default;
},
lookupTable: function lookupTable() {
return lookup_table_default;
},
namedFromContents: function namedFromContents() {
return named_from_contents_default;
},
requiredAttr: function requiredAttr() {
return required_attr_default;
},
requiredContext: function requiredContext() {
return required_context_default;
},
requiredOwned: function requiredOwned() {
return required_owned_default;
},
validateAttr: function validateAttr() {
return validate_attr_default;
},
validateAttrValue: function validateAttrValue() {
return validate_attr_value_default;
}
});
function allowedAttr(role) {
var roleDef = standards_default.ariaRoles[role];
var attrs = _toConsumableArray(get_global_aria_attrs_default());
if (!roleDef) {
return attrs;
}
if (roleDef.allowedAttrs) {
attrs.push.apply(attrs, _toConsumableArray(roleDef.allowedAttrs));
}
if (roleDef.requiredAttrs) {
attrs.push.apply(attrs, _toConsumableArray(roleDef.requiredAttrs));
}
return attrs;
}
var allowed_attr_default = allowedAttr;
var idRefsRegex = /^idrefs?$/;
function cacheIdRefs(node, idRefs, refAttrs) {
if (node.hasAttribute) {
if (node.nodeName.toUpperCase() === 'LABEL' && node.hasAttribute('for')) {
var _id5 = node.getAttribute('for');
if (!idRefs.has(_id5)) {
idRefs.set(_id5, [ node ]);
} else {
idRefs.get(_id5).push(node);
}
}
for (var _i28 = 0; _i28 < refAttrs.length; ++_i28) {
var attr = refAttrs[_i28];
var attrValue = sanitize_default(node.getAttribute(attr) || '');
if (!attrValue) {
continue;
}
var _iterator22 = _createForOfIteratorHelper(token_list_default(attrValue)), _step22;
try {
for (_iterator22.s(); !(_step22 = _iterator22.n()).done; ) {
var token = _step22.value;
if (!idRefs.has(token)) {
idRefs.set(token, [ node ]);
} else {
idRefs.get(token).push(node);
}
}
} catch (err) {
_iterator22.e(err);
} finally {
_iterator22.f();
}
}
}
for (var _i29 = 0; _i29 < node.childNodes.length; _i29++) {
if (node.childNodes[_i29].nodeType === 1) {
cacheIdRefs(node.childNodes[_i29], idRefs, refAttrs);
}
}
}
function getAccessibleRefs(node) {
var _idRefs$get;
node = node.actualNode || node;
var root = get_root_node_default2(node);
root = root.documentElement || root;
var idRefsByRoot = cache_default.get('idRefsByRoot', function() {
return new Map();
});
var idRefs = idRefsByRoot.get(root);
if (!idRefs) {
idRefs = new Map();
idRefsByRoot.set(root, idRefs);
var refAttrs = Object.keys(standards_default.ariaAttrs).filter(function(attr) {
var type2 = standards_default.ariaAttrs[attr].type;
return idRefsRegex.test(type2);
});
cacheIdRefs(root, idRefs, refAttrs);
}
return (_idRefs$get = idRefs.get(node.id)) !== null && _idRefs$get !== void 0 ? _idRefs$get : [];
}
var get_accessible_refs_default = getAccessibleRefs;
function isAriaRoleAllowedOnElement(node, role) {
var vNode = node instanceof abstract_virtual_node_default ? node : get_node_from_tree_default(node);
var implicitRole3 = implicit_role_default(vNode);
var spec = get_element_spec_default(vNode);
if (Array.isArray(spec.allowedRoles)) {
return spec.allowedRoles.includes(role);
}
if (role === implicitRole3) {
return false;
}
return !!spec.allowedRoles;
}
var is_aria_role_allowed_on_element_default = isAriaRoleAllowedOnElement;
var dpubRoles2 = [ 'doc-backlink', 'doc-biblioentry', 'doc-biblioref', 'doc-cover', 'doc-endnote', 'doc-glossref', 'doc-noteref' ];
var landmarkRoles = {
header: 'banner',
footer: 'contentinfo'
};
function getRoleSegments(vNode) {
var roles = [];
if (!vNode) {
return roles;
}
if (vNode.hasAttr('role')) {
var nodeRoles = token_list_default(vNode.attr('role').toLowerCase());
roles = roles.concat(nodeRoles);
}
return roles.filter(function(role) {
return is_valid_role_default(role);
});
}
function getElementUnallowedRoles(node) {
var allowImplicit = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
var _nodeLookup29 = _nodeLookup(node), vNode = _nodeLookup29.vNode;
if (!_isHtmlElement(vNode)) {
return [];
}
var nodeName2 = vNode.props.nodeName;
var implicitRole3 = implicit_role_default(vNode) || landmarkRoles[nodeName2];
var roleSegments = getRoleSegments(vNode);
return roleSegments.filter(function(role) {
return !roleIsAllowed(role, vNode, allowImplicit, implicitRole3);
});
}
function roleIsAllowed(role, vNode, allowImplicit, implicitRole3) {
if (allowImplicit && role === implicitRole3) {
return true;
}
if (dpubRoles2.includes(role) && get_role_type_default(role) !== implicitRole3) {
return false;
}
return is_aria_role_allowed_on_element_default(vNode, role);
}
var get_element_unallowed_roles_default = getElementUnallowedRoles;
function getAriaRolesByType(type2) {
return Object.keys(standards_default.ariaRoles).filter(function(roleName) {
return standards_default.ariaRoles[roleName].type === type2;
});
}
var get_aria_roles_by_type_default = getAriaRolesByType;
function getRolesByType(roleType) {
return get_aria_roles_by_type_default(roleType);
}
var get_roles_by_type_default = getRolesByType;
function getAriaRolesSupportingNameFromContent() {
return cache_default.get('ariaRolesNameFromContent', function() {
return Object.keys(standards_default.ariaRoles).filter(function(roleName) {
return standards_default.ariaRoles[roleName].nameFromContent;
});
});
}
var get_aria_roles_supporting_name_from_content_default = getAriaRolesSupportingNameFromContent;
function getRolesWithNameFromContents() {
return get_aria_roles_supporting_name_from_content_default();
}
var get_roles_with_name_from_contents_default = getRolesWithNameFromContents;
var isNull = function isNull(value) {
return value === null;
};
var isNotNull = function isNotNull(value) {
return value !== null;
};
var lookupTable = {};
lookupTable.attributes = {
'aria-activedescendant': {
type: 'idref',
allowEmpty: true,
unsupported: false
},
'aria-atomic': {
type: 'boolean',
values: [ 'true', 'false' ],
unsupported: false
},
'aria-autocomplete': {
type: 'nmtoken',
values: [ 'inline', 'list', 'both', 'none' ],
unsupported: false
},
'aria-busy': {
type: 'boolean',
values: [ 'true', 'false' ],
unsupported: false
},
'aria-checked': {
type: 'nmtoken',
values: [ 'true', 'false', 'mixed', 'undefined' ],
unsupported: false
},
'aria-colcount': {
type: 'int',
unsupported: false
},
'aria-colindex': {
type: 'int',
unsupported: false
},
'aria-colspan': {
type: 'int',
unsupported: false
},
'aria-controls': {
type: 'idrefs',
allowEmpty: true,
unsupported: false
},
'aria-current': {
type: 'nmtoken',
allowEmpty: true,
values: [ 'page', 'step', 'location', 'date', 'time', 'true', 'false' ],
unsupported: false
},
'aria-describedby': {
type: 'idrefs',
allowEmpty: true,
unsupported: false
},
'aria-describedat': {
unsupported: true,
unstandardized: true
},
'aria-details': {
type: 'idref',
allowEmpty: true,
unsupported: false
},
'aria-disabled': {
type: 'boolean',
values: [ 'true', 'false' ],
unsupported: false
},
'aria-dropeffect': {
type: 'nmtokens',
values: [ 'copy', 'move', 'reference', 'execute', 'popup', 'none' ],
unsupported: false
},
'aria-errormessage': {
type: 'idref',
allowEmpty: true,
unsupported: false
},
'aria-expanded': {
type: 'nmtoken',
values: [ 'true', 'false', 'undefined' ],
unsupported: false
},
'aria-flowto': {
type: 'idrefs',
allowEmpty: true,
unsupported: false
},
'aria-grabbed': {
type: 'nmtoken',
values: [ 'true', 'false', 'undefined' ],
unsupported: false
},
'aria-haspopup': {
type: 'nmtoken',
allowEmpty: true,
values: [ 'true', 'false', 'menu', 'listbox', 'tree', 'grid', 'dialog' ],
unsupported: false
},
'aria-hidden': {
type: 'boolean',
values: [ 'true', 'false' ],
unsupported: false
},
'aria-invalid': {
type: 'nmtoken',
allowEmpty: true,
values: [ 'true', 'false', 'spelling', 'grammar' ],
unsupported: false
},
'aria-keyshortcuts': {
type: 'string',
allowEmpty: true,
unsupported: false
},
'aria-label': {
type: 'string',
allowEmpty: true,
unsupported: false
},
'aria-labelledby': {
type: 'idrefs',
allowEmpty: true,
unsupported: false
},
'aria-level': {
type: 'int',
unsupported: false
},
'aria-live': {
type: 'nmtoken',
values: [ 'off', 'polite', 'assertive' ],
unsupported: false
},
'aria-modal': {
type: 'boolean',
values: [ 'true', 'false' ],
unsupported: false
},
'aria-multiline': {
type: 'boolean',
values: [ 'true', 'false' ],
unsupported: false
},
'aria-multiselectable': {
type: 'boolean',
values: [ 'true', 'false' ],
unsupported: false
},
'aria-orientation': {
type: 'nmtoken',
values: [ 'horizontal', 'vertical' ],
unsupported: false
},
'aria-owns': {
type: 'idrefs',
allowEmpty: true,
unsupported: false
},
'aria-placeholder': {
type: 'string',
allowEmpty: true,
unsupported: false
},
'aria-posinset': {
type: 'int',
unsupported: false
},
'aria-pressed': {
type: 'nmtoken',
values: [ 'true', 'false', 'mixed', 'undefined' ],
unsupported: false
},
'aria-readonly': {
type: 'boolean',
values: [ 'true', 'false' ],
unsupported: false
},
'aria-relevant': {
type: 'nmtokens',
values: [ 'additions', 'removals', 'text', 'all' ],
unsupported: false
},
'aria-required': {
type: 'boolean',
values: [ 'true', 'false' ],
unsupported: false
},
'aria-roledescription': {
type: 'string',
allowEmpty: true,
unsupported: false
},
'aria-rowcount': {
type: 'int',
unsupported: false
},
'aria-rowindex': {
type: 'int',
unsupported: false
},
'aria-rowspan': {
type: 'int',
unsupported: false
},
'aria-selected': {
type: 'nmtoken',
values: [ 'true', 'false', 'undefined' ],
unsupported: false
},
'aria-setsize': {
type: 'int',
unsupported: false
},
'aria-sort': {
type: 'nmtoken',
values: [ 'ascending', 'descending', 'other', 'none' ],
unsupported: false
},
'aria-valuemax': {
type: 'decimal',
unsupported: false
},
'aria-valuemin': {
type: 'decimal',
unsupported: false
},
'aria-valuenow': {
type: 'decimal',
unsupported: false
},
'aria-valuetext': {
type: 'string',
unsupported: false
}
};
lookupTable.globalAttributes = [ 'aria-atomic', 'aria-busy', 'aria-controls', 'aria-current', 'aria-describedby', 'aria-details', 'aria-disabled', 'aria-dropeffect', 'aria-flowto', 'aria-grabbed', 'aria-haspopup', 'aria-hidden', 'aria-invalid', 'aria-keyshortcuts', 'aria-label', 'aria-labelledby', 'aria-live', 'aria-owns', 'aria-relevant', 'aria-roledescription' ];
lookupTable.role = {
alert: {
type: 'widget',
attributes: {
allowed: [ 'aria-expanded', 'aria-errormessage' ]
},
owned: null,
nameFrom: [ 'author' ],
context: null,
unsupported: false,
allowedElements: [ 'section' ]
},
alertdialog: {
type: 'widget',
attributes: {
allowed: [ 'aria-expanded', 'aria-modal', 'aria-errormessage' ]
},
owned: null,
nameFrom: [ 'author' ],
context: null,
unsupported: false,
allowedElements: [ 'dialog', 'section' ]
},
application: {
type: 'landmark',
attributes: {
allowed: [ 'aria-expanded', 'aria-errormessage', 'aria-activedescendant' ]
},
owned: null,
nameFrom: [ 'author' ],
context: null,
unsupported: false,
allowedElements: [ 'article', 'audio', 'embed', 'iframe', 'object', 'section', 'svg', 'video' ]
},
article: {
type: 'structure',
attributes: {
allowed: [ 'aria-expanded', 'aria-posinset', 'aria-setsize', 'aria-errormessage' ]
},
owned: null,
nameFrom: [ 'author' ],
context: null,
implicit: [ 'article' ],
unsupported: false
},
banner: {
type: 'landmark',
attributes: {
allowed: [ 'aria-expanded', 'aria-errormessage' ]
},
owned: null,
nameFrom: [ 'author' ],
context: null,
implicit: [ 'header' ],
unsupported: false,
allowedElements: [ 'section' ]
},
button: {
type: 'widget',
attributes: {
allowed: [ 'aria-expanded', 'aria-pressed', 'aria-errormessage' ]
},
owned: null,
nameFrom: [ 'author', 'contents' ],
context: null,
implicit: [ 'button', 'input[type="button"]', 'input[type="image"]', 'input[type="reset"]', 'input[type="submit"]', 'summary' ],
unsupported: false,
allowedElements: [ {
nodeName: 'a',
attributes: {
href: isNotNull
}
} ]
},
cell: {
type: 'structure',
attributes: {
allowed: [ 'aria-colindex', 'aria-colspan', 'aria-rowindex', 'aria-rowspan', 'aria-errormessage' ]
},
owned: null,
nameFrom: [ 'author', 'contents' ],
context: [ 'row' ],
implicit: [ 'td', 'th' ],
unsupported: false
},
checkbox: {
type: 'widget',
attributes: {
allowed: [ 'aria-checked', 'aria-required', 'aria-readonly', 'aria-errormessage' ]
},
owned: null,
nameFrom: [ 'author', 'contents' ],
context: null,
implicit: [ 'input[type="checkbox"]' ],
unsupported: false,
allowedElements: [ 'button' ]
},
columnheader: {
type: 'structure',
attributes: {
allowed: [ 'aria-colindex', 'aria-colspan', 'aria-expanded', 'aria-rowindex', 'aria-rowspan', 'aria-required', 'aria-readonly', 'aria-selected', 'aria-sort', 'aria-errormessage' ]
},
owned: null,
nameFrom: [ 'author', 'contents' ],
context: [ 'row' ],
implicit: [ 'th' ],
unsupported: false
},
combobox: {
type: 'composite',
attributes: {
allowed: [ 'aria-autocomplete', 'aria-required', 'aria-activedescendant', 'aria-orientation', 'aria-errormessage' ],
required: [ 'aria-expanded' ]
},
owned: {
all: [ 'listbox', 'tree', 'grid', 'dialog', 'textbox' ]
},
nameFrom: [ 'author' ],
context: null,
unsupported: false,
allowedElements: [ {
nodeName: 'input',
properties: {
type: [ 'text', 'search', 'tel', 'url', 'email' ]
}
} ]
},
command: {
nameFrom: [ 'author' ],
type: 'abstract',
unsupported: false
},
complementary: {
type: 'landmark',
attributes: {
allowed: [ 'aria-expanded', 'aria-errormessage' ]
},
owned: null,
nameFrom: [ 'author' ],
context: null,
implicit: [ 'aside' ],
unsupported: false,
allowedElements: [ 'section' ]
},
composite: {
nameFrom: [ 'author' ],
type: 'abstract',
unsupported: false
},
contentinfo: {
type: 'landmark',
attributes: {
allowed: [ 'aria-expanded', 'aria-errormessage' ]
},
owned: null,
nameFrom: [ 'author' ],
context: null,
implicit: [ 'footer' ],
unsupported: false,
allowedElements: [ 'section' ]
},
definition: {
type: 'structure',
attributes: {
allowed: [ 'aria-expanded', 'aria-errormessage' ]
},
owned: null,
nameFrom: [ 'author' ],
context: null,
implicit: [ 'dd', 'dfn' ],
unsupported: false
},
dialog: {
type: 'widget',
attributes: {
allowed: [ 'aria-expanded', 'aria-modal', 'aria-errormessage' ]
},
owned: null,
nameFrom: [ 'author' ],
context: null,
implicit: [ 'dialog' ],
unsupported: false,
allowedElements: [ 'section' ]
},
directory: {
type: 'structure',
attributes: {
allowed: [ 'aria-expanded', 'aria-errormessage' ]
},
owned: null,
nameFrom: [ 'author', 'contents' ],
context: null,
unsupported: false,
allowedElements: [ 'ol', 'ul' ]
},
document: {
type: 'structure',
attributes: {
allowed: [ 'aria-expanded', 'aria-errormessage' ]
},
owned: null,
nameFrom: [ 'author' ],
context: null,
implicit: [ 'body' ],
unsupported: false,
allowedElements: [ 'article', 'embed', 'iframe', 'object', 'section', 'svg' ]
},
'doc-abstract': {
type: 'section',
attributes: {
allowed: [ 'aria-expanded', 'aria-errormessage' ]
},
owned: null,
nameFrom: [ 'author' ],
context: null,
unsupported: false,
allowedElements: [ 'section' ]
},
'doc-acknowledgments': {
type: 'landmark',
attributes: {
allowed: [ 'aria-expanded', 'aria-errormessage' ]
},
owned: null,
nameFrom: [ 'author' ],
context: null,
unsupported: false,
allowedElements: [ 'section' ]
},
'doc-afterword': {
type: 'landmark',
attributes: {
allowed: [ 'aria-expanded', 'aria-errormessage' ]
},
owned: null,
nameFrom: [ 'author' ],
context: null,
unsupported: false,
allowedElements: [ 'section' ]
},
'doc-appendix': {
type: 'landmark',
attributes: {
allowed: [ 'aria-expanded', 'aria-errormessage' ]
},
owned: null,
nameFrom: [ 'author' ],
context: null,
unsupported: false,
allowedElements: [ 'section' ]
},
'doc-backlink': {
type: 'link',
attributes: {
allowed: [ 'aria-expanded', 'aria-errormessage' ]
},
owned: null,
nameFrom: [ 'author', 'contents' ],
context: null,
unsupported: false,
allowedElements: [ {
nodeName: 'a',
attributes: {
href: isNotNull
}
} ]
},
'doc-biblioentry': {
type: 'listitem',
attributes: {
allowed: [ 'aria-expanded', 'aria-level', 'aria-posinset', 'aria-setsize', 'aria-errormessage' ]
},
owned: null,
nameFrom: [ 'author' ],
context: [ 'doc-bibliography' ],
unsupported: false,
allowedElements: [ 'li' ]
},
'doc-bibliography': {
type: 'landmark',
attributes: {
allowed: [ 'aria-expanded', 'aria-errormessage' ]
},
owned: {
one: [ 'doc-biblioentry' ]
},
nameFrom: [ 'author' ],
context: null,
unsupported: false,
allowedElements: [ 'section' ]
},
'doc-biblioref': {
type: 'link',
attributes: {
allowed: [ 'aria-expanded', 'aria-errormessage' ]
},
owned: null,
nameFrom: [ 'author', 'contents' ],
context: null,
unsupported: false,
allowedElements: [ {
nodeName: 'a',
attributes: {
href: isNotNull
}
} ]
},
'doc-chapter': {
type: 'landmark',
attributes: {
allowed: [ 'aria-expanded', 'aria-errormessage' ]
},
owned: null,
namefrom: [ 'author' ],
context: null,
unsupported: false,
allowedElements: [ 'section' ]
},
'doc-colophon': {
type: 'section',
attributes: {
allowed: [ 'aria-expanded', 'aria-errormessage' ]
},
owned: null,
namefrom: [ 'author' ],
context: null,
unsupported: false,
allowedElements: [ 'section' ]
},
'doc-conclusion': {
type: 'landmark',
attributes: {
allowed: [ 'aria-expanded', 'aria-errormessage' ]
},
owned: null,
namefrom: [ 'author' ],
context: null,
unsupported: false,
allowedElements: [ 'section' ]
},
'doc-cover': {
type: 'img',
attributes: {
allowed: [ 'aria-expanded', 'aria-errormessage' ]
},
owned: null,
namefrom: [ 'author' ],
context: null,
unsupported: false
},
'doc-credit': {
type: 'section',
attributes: {
allowed: [ 'aria-expanded', 'aria-errormessage' ]
},
owned: null,
namefrom: [ 'author' ],
context: null,
unsupported: false,
allowedElements: [ 'section' ]
},
'doc-credits': {
type: 'landmark',
attributes: {
allowed: [ 'aria-expanded', 'aria-errormessage' ]
},
owned: null,
namefrom: [ 'author' ],
context: null,
unsupported: false,
allowedElements: [ 'section' ]
},
'doc-dedication': {
type: 'section',
attributes: {
allowed: [ 'aria-expanded', 'aria-errormessage' ]
},
owned: null,
namefrom: [ 'author' ],
context: null,
unsupported: false,
allowedElements: [ 'section' ]
},
'doc-endnote': {
type: 'listitem',
attributes: {
allowed: [ 'aria-expanded', 'aria-level', 'aria-posinset', 'aria-setsize', 'aria-errormessage' ]
},
owned: null,
namefrom: [ 'author' ],
context: [ 'doc-endnotes' ],
unsupported: false,
allowedElements: [ 'li' ]
},
'doc-endnotes': {
type: 'landmark',
attributes: {
allowed: [ 'aria-expanded', 'aria-errormessage' ]
},
owned: {
one: [ 'doc-endnote' ]
},
namefrom: [ 'author' ],
context: null,
unsupported: false,
allowedElements: [ 'section' ]
},
'doc-epigraph': {
type: 'section',
attributes: {
allowed: [ 'aria-expanded', 'aria-errormessage' ]
},
owned: null,
namefrom: [ 'author' ],
context: null,
unsupported: false
},
'doc-epilogue': {
type: 'landmark',
attributes: {
allowed: [ 'aria-expanded', 'aria-errormessage' ]
},
owned: null,
namefrom: [ 'author' ],
context: null,
unsupported: false,
allowedElements: [ 'section' ]
},
'doc-errata': {
type: 'landmark',
attributes: {
allowed: [ 'aria-expanded', 'aria-errormessage' ]
},
owned: null,
namefrom: [ 'author' ],
context: null,
unsupported: false,
allowedElements: [ 'section' ]
},
'doc-example': {
type: 'section',
attributes: {
allowed: [ 'aria-expanded', 'aria-errormessage' ]
},
owned: null,
namefrom: [ 'author' ],
context: null,
unsupported: false,
allowedElements: [ 'aside', 'section' ]
},
'doc-footnote': {
type: 'section',
attributes: {
allowed: [ 'aria-expanded', 'aria-errormessage' ]
},
owned: null,
namefrom: [ 'author' ],
context: null,
unsupported: false,
allowedElements: [ 'aside', 'footer', 'header' ]
},
'doc-foreword': {
type: 'landmark',
attributes: {
allowed: [ 'aria-expanded', 'aria-errormessage' ]
},
owned: null,
namefrom: [ 'author' ],
context: null,
unsupported: false,
allowedElements: [ 'section' ]
},
'doc-glossary': {
type: 'landmark',
attributes: {
allowed: [ 'aria-expanded', 'aria-errormessage' ]
},
owned: [ 'term', 'definition' ],
namefrom: [ 'author' ],
context: null,
unsupported: false,
allowedElements: [ 'dl' ]
},
'doc-glossref': {
type: 'link',
attributes: {
allowed: [ 'aria-expanded', 'aria-errormessage' ]
},
owned: null,
namefrom: [ 'author', 'contents' ],
context: null,
unsupported: false,
allowedElements: [ {
nodeName: 'a',
attributes: {
href: isNotNull
}
} ]
},
'doc-index': {
type: 'navigation',
attributes: {
allowed: [ 'aria-expanded', 'aria-errormessage' ]
},
owned: null,
namefrom: [ 'author' ],
context: null,
unsupported: false,
allowedElements: [ 'nav', 'section' ]
},
'doc-introduction': {
type: 'landmark',
attributes: {
allowed: [ 'aria-expanded', 'aria-errormessage' ]
},
owned: null,
namefrom: [ 'author' ],
context: null,
unsupported: false,
allowedElements: [ 'section' ]
},
'doc-noteref': {
type: 'link',
attributes: {
allowed: [ 'aria-expanded' ]
},
owned: null,
namefrom: [ 'author', 'contents' ],
context: null,
unsupported: false,
allowedElements: [ {
nodeName: 'a',
attributes: {
href: isNotNull
}
} ]
},
'doc-notice': {
type: 'note',
attributes: {
allowed: [ 'aria-expanded' ]
},
owned: null,
namefrom: [ 'author' ],
context: null,
unsupported: false,
allowedElements: [ 'section' ]
},
'doc-pagebreak': {
type: 'separator',
attributes: {
allowed: [ 'aria-expanded' ]
},
owned: null,
namefrom: [ 'author' ],
context: null,
unsupported: false,
allowedElements: [ 'hr' ]
},
'doc-pagelist': {
type: 'navigation',
attributes: {
allowed: [ 'aria-expanded' ]
},
owned: null,
namefrom: [ 'author' ],
context: null,
unsupported: false,
allowedElements: [ 'nav', 'section' ]
},
'doc-part': {
type: 'landmark',
attributes: {
allowed: [ 'aria-expanded' ]
},
owned: null,
namefrom: [ 'author' ],
context: null,
unsupported: false,
allowedElements: [ 'section' ]
},
'doc-preface': {
type: 'landmark',
attributes: {
allowed: [ 'aria-expanded' ]
},
owned: null,
namefrom: [ 'author' ],
context: null,
unsupported: false,
allowedElements: [ 'section' ]
},
'doc-prologue': {
type: 'landmark',
attributes: {
allowed: [ 'aria-expanded', 'aria-errormessage' ]
},
owned: null,
namefrom: [ 'author' ],
context: null,
unsupported: false,
allowedElements: [ 'section' ]
},
'doc-pullquote': {
type: 'none',
attributes: {
allowed: [ 'aria-expanded' ]
},
owned: null,
namefrom: [ 'author' ],
context: null,
unsupported: false,
allowedElements: [ 'aside', 'section' ]
},
'doc-qna': {
type: 'section',
attributes: {
allowed: [ 'aria-expanded' ]
},
owned: null,
namefrom: [ 'author' ],
context: null,
unsupported: false,
allowedElements: [ 'section' ]
},
'doc-subtitle': {
type: 'sectionhead',
attributes: {
allowed: [ 'aria-expanded' ]
},
owned: null,
namefrom: [ 'author' ],
context: null,
unsupported: false,
allowedElements: {
nodeName: [ 'h1', 'h2', 'h3', 'h4', 'h5', 'h6' ]
}
},
'doc-tip': {
type: 'note',
attributes: {
allowed: [ 'aria-expanded' ]
},
owned: null,
namefrom: [ 'author' ],
context: null,
unsupported: false,
allowedElements: [ 'aside' ]
},
'doc-toc': {
type: 'navigation',
attributes: {
allowed: [ 'aria-expanded', 'aria-errormessage' ]
},
owned: null,
namefrom: [ 'author' ],
context: null,
unsupported: false,
allowedElements: [ 'nav', 'section' ]
},
feed: {
type: 'structure',
attributes: {
allowed: [ 'aria-expanded', 'aria-errormessage' ]
},
owned: {
one: [ 'article' ]
},
nameFrom: [ 'author' ],
context: null,
unsupported: false,
allowedElements: [ 'article', 'aside', 'section' ]
},
figure: {
type: 'structure',
attributes: {
allowed: [ 'aria-expanded', 'aria-errormessage' ]
},
owned: null,
nameFrom: [ 'author', 'contents' ],
context: null,
implicit: [ 'figure' ],
unsupported: false
},
form: {
type: 'landmark',
attributes: {
allowed: [ 'aria-expanded', 'aria-errormessage' ]
},
owned: null,
nameFrom: [ 'author' ],
context: null,
implicit: [ 'form' ],
unsupported: false
},
grid: {
type: 'composite',
attributes: {
allowed: [ 'aria-activedescendant', 'aria-expanded', 'aria-colcount', 'aria-level', 'aria-multiselectable', 'aria-readonly', 'aria-rowcount', 'aria-errormessage' ]
},
owned: {
one: [ 'rowgroup', 'row' ]
},
nameFrom: [ 'author' ],
context: null,
implicit: [ 'table' ],
unsupported: false
},
gridcell: {
type: 'widget',
attributes: {
allowed: [ 'aria-colindex', 'aria-colspan', 'aria-expanded', 'aria-rowindex', 'aria-rowspan', 'aria-selected', 'aria-readonly', 'aria-required', 'aria-errormessage' ]
},
owned: null,
nameFrom: [ 'author', 'contents' ],
context: [ 'row' ],
implicit: [ 'td', 'th' ],
unsupported: false
},
group: {
type: 'structure',
attributes: {
allowed: [ 'aria-activedescendant', 'aria-expanded', 'aria-errormessage' ]
},
owned: null,
nameFrom: [ 'author' ],
context: null,
implicit: [ 'details', 'optgroup' ],
unsupported: false,
allowedElements: [ 'dl', 'figcaption', 'fieldset', 'figure', 'footer', 'header', 'ol', 'ul' ]
},
heading: {
type: 'structure',
attributes: {
required: [ 'aria-level' ],
allowed: [ 'aria-expanded', 'aria-errormessage' ]
},
owned: null,
nameFrom: [ 'author', 'contents' ],
context: null,
implicit: [ 'h1', 'h2', 'h3', 'h4', 'h5', 'h6' ],
unsupported: false
},
img: {
type: 'structure',
attributes: {
allowed: [ 'aria-expanded', 'aria-errormessage' ]
},
owned: null,
nameFrom: [ 'author' ],
context: null,
implicit: [ 'img' ],
unsupported: false,
allowedElements: [ 'embed', 'iframe', 'object', 'svg' ]
},
input: {
nameFrom: [ 'author' ],
type: 'abstract',
unsupported: false
},
landmark: {
nameFrom: [ 'author' ],
type: 'abstract',
unsupported: false
},
link: {
type: 'widget',
attributes: {
allowed: [ 'aria-expanded', 'aria-errormessage' ]
},
owned: null,
nameFrom: [ 'author', 'contents' ],
context: null,
implicit: [ 'a[href]', 'area[href]' ],
unsupported: false,
allowedElements: [ 'button', {
nodeName: 'input',
properties: {
type: [ 'image', 'button' ]
}
} ]
},
list: {
type: 'structure',
attributes: {
allowed: [ 'aria-expanded', 'aria-errormessage' ]
},
owned: {
all: [ 'listitem' ]
},
nameFrom: [ 'author' ],
context: null,
implicit: [ 'ol', 'ul', 'dl' ],
unsupported: false
},
listbox: {
type: 'composite',
attributes: {
allowed: [ 'aria-activedescendant', 'aria-multiselectable', 'aria-readonly', 'aria-required', 'aria-expanded', 'aria-orientation', 'aria-errormessage' ]
},
owned: {
all: [ 'option' ]
},
nameFrom: [ 'author' ],
context: null,
implicit: [ 'select' ],
unsupported: false,
allowedElements: [ 'ol', 'ul' ]
},
listitem: {
type: 'structure',
attributes: {
allowed: [ 'aria-level', 'aria-posinset', 'aria-setsize', 'aria-expanded', 'aria-errormessage' ]
},
owned: null,
nameFrom: [ 'author', 'contents' ],
context: [ 'list' ],
implicit: [ 'li', 'dt' ],
unsupported: false
},
log: {
type: 'widget',
attributes: {
allowed: [ 'aria-expanded', 'aria-errormessage' ]
},
owned: null,
nameFrom: [ 'author' ],
context: null,
unsupported: false,
allowedElements: [ 'section' ]
},
main: {
type: 'landmark',
attributes: {
allowed: [ 'aria-expanded', 'aria-errormessage' ]
},
owned: null,
nameFrom: [ 'author' ],
context: null,
implicit: [ 'main' ],
unsupported: false,
allowedElements: [ 'article', 'section' ]
},
marquee: {
type: 'widget',
attributes: {
allowed: [ 'aria-expanded', 'aria-errormessage' ]
},
owned: null,
nameFrom: [ 'author' ],
context: null,
unsupported: false,
allowedElements: [ 'section' ]
},
math: {
type: 'structure',
attributes: {
allowed: [ 'aria-expanded', 'aria-errormessage' ]
},
owned: null,
nameFrom: [ 'author' ],
context: null,
implicit: [ 'math' ],
unsupported: false
},
menu: {
type: 'composite',
attributes: {
allowed: [ 'aria-activedescendant', 'aria-expanded', 'aria-orientation', 'aria-errormessage' ]
},
owned: {
one: [ 'menuitem', 'menuitemradio', 'menuitemcheckbox' ]
},
nameFrom: [ 'author' ],
context: null,
implicit: [ 'menu[type="context"]' ],
unsupported: false,
allowedElements: [ 'ol', 'ul' ]
},
menubar: {
type: 'composite',
attributes: {
allowed: [ 'aria-activedescendant', 'aria-expanded', 'aria-orientation', 'aria-errormessage' ]
},
owned: {
one: [ 'menuitem', 'menuitemradio', 'menuitemcheckbox' ]
},
nameFrom: [ 'author' ],
context: null,
unsupported: false,
allowedElements: [ 'ol', 'ul' ]
},
menuitem: {
type: 'widget',
attributes: {
allowed: [ 'aria-posinset', 'aria-setsize', 'aria-expanded', 'aria-errormessage' ]
},
owned: null,
nameFrom: [ 'author', 'contents' ],
context: [ 'menu', 'menubar' ],
implicit: [ 'menuitem[type="command"]' ],
unsupported: false,
allowedElements: [ 'button', 'li', {
nodeName: 'iput',
properties: {
type: [ 'image', 'button' ]
}
}, {
nodeName: 'a',
attributes: {
href: isNotNull
}
} ]
},
menuitemcheckbox: {
type: 'widget',
attributes: {
allowed: [ 'aria-checked', 'aria-posinset', 'aria-setsize', 'aria-errormessage' ]
},
owned: null,
nameFrom: [ 'author', 'contents' ],
context: [ 'menu', 'menubar' ],
implicit: [ 'menuitem[type="checkbox"]' ],
unsupported: false,
allowedElements: [ {
nodeName: [ 'button', 'li' ]
}, {
nodeName: 'input',
properties: {
type: [ 'checkbox', 'image', 'button' ]
}
}, {
nodeName: 'a',
attributes: {
href: isNotNull
}
} ]
},
menuitemradio: {
type: 'widget',
attributes: {
allowed: [ 'aria-checked', 'aria-selected', 'aria-posinset', 'aria-setsize', 'aria-errormessage' ]
},
owned: null,
nameFrom: [ 'author', 'contents' ],
context: [ 'menu', 'menubar' ],
implicit: [ 'menuitem[type="radio"]' ],
unsupported: false,
allowedElements: [ {
nodeName: [ 'button', 'li' ]
}, {
nodeName: 'input',
properties: {
type: [ 'image', 'button', 'radio' ]
}
}, {
nodeName: 'a',
attributes: {
href: isNotNull
}
} ]
},
navigation: {
type: 'landmark',
attributes: {
allowed: [ 'aria-expanded', 'aria-errormessage' ]
},
owned: null,
nameFrom: [ 'author' ],
context: null,
implicit: [ 'nav' ],
unsupported: false,
allowedElements: [ 'section' ]
},
none: {
type: 'structure',
attributes: null,
owned: null,
nameFrom: [ 'author' ],
context: null,
unsupported: false,
allowedElements: [ {
nodeName: [ 'article', 'aside', 'dl', 'embed', 'figcaption', 'fieldset', 'figure', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'header', 'hr', 'iframe', 'li', 'ol', 'section', 'ul' ]
}, {
nodeName: 'img',
attributes: {
alt: isNotNull
}
} ]
},
note: {
type: 'structure',
attributes: {
allowed: [ 'aria-expanded', 'aria-errormessage' ]
},
owned: null,
nameFrom: [ 'author' ],
context: null,
unsupported: false,
allowedElements: [ 'aside' ]
},
option: {
type: 'widget',
attributes: {
allowed: [ 'aria-selected', 'aria-posinset', 'aria-setsize', 'aria-checked', 'aria-errormessage' ]
},
owned: null,
nameFrom: [ 'author', 'contents' ],
context: [ 'listbox' ],
implicit: [ 'option' ],
unsupported: false,
allowedElements: [ {
nodeName: [ 'button', 'li' ]
}, {
nodeName: 'input',
properties: {
type: [ 'checkbox', 'button' ]
}
}, {
nodeName: 'a',
attributes: {
href: isNotNull
}
} ]
},
presentation: {
type: 'structure',
attributes: null,
owned: null,
nameFrom: [ 'author' ],
context: null,
unsupported: false,
allowedElements: [ {
nodeName: [ 'article', 'aside', 'dl', 'embed', 'figcaption', 'fieldset', 'figure', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'header', 'hr', 'iframe', 'li', 'ol', 'section', 'ul' ]
}, {
nodeName: 'img',
attributes: {
alt: isNotNull
}
} ]
},
progressbar: {
type: 'widget',
attributes: {
allowed: [ 'aria-valuetext', 'aria-valuenow', 'aria-valuemax', 'aria-valuemin', 'aria-expanded', 'aria-errormessage' ]
},
owned: null,
nameFrom: [ 'author' ],
context: null,
implicit: [ 'progress' ],
unsupported: false
},
radio: {
type: 'widget',
attributes: {
allowed: [ 'aria-selected', 'aria-posinset', 'aria-setsize', 'aria-required', 'aria-errormessage', 'aria-checked' ]
},
owned: null,
nameFrom: [ 'author', 'contents' ],
context: null,
implicit: [ 'input[type="radio"]' ],
unsupported: false,
allowedElements: [ {
nodeName: [ 'button', 'li' ]
}, {
nodeName: 'input',
properties: {
type: [ 'image', 'button' ]
}
} ]
},
radiogroup: {
type: 'composite',
attributes: {
allowed: [ 'aria-activedescendant', 'aria-required', 'aria-expanded', 'aria-readonly', 'aria-errormessage', 'aria-orientation' ]
},
owned: {
all: [ 'radio' ]
},
nameFrom: [ 'author' ],
context: null,
unsupported: false,
allowedElements: {
nodeName: [ 'ol', 'ul', 'fieldset' ]
}
},
range: {
nameFrom: [ 'author' ],
type: 'abstract',
unsupported: false
},
region: {
type: 'landmark',
attributes: {
allowed: [ 'aria-expanded', 'aria-errormessage' ]
},
owned: null,
nameFrom: [ 'author' ],
context: null,
implicit: [ 'section[aria-label]', 'section[aria-labelledby]', 'section[title]' ],
unsupported: false,
allowedElements: {
nodeName: [ 'article', 'aside' ]
}
},
roletype: {
type: 'abstract',
unsupported: false
},
row: {
type: 'structure',
attributes: {
allowed: [ 'aria-activedescendant', 'aria-colindex', 'aria-expanded', 'aria-level', 'aria-selected', 'aria-rowindex', 'aria-errormessage' ]
},
owned: {
one: [ 'cell', 'columnheader', 'rowheader', 'gridcell' ]
},
nameFrom: [ 'author', 'contents' ],
context: [ 'rowgroup', 'grid', 'treegrid', 'table' ],
implicit: [ 'tr' ],
unsupported: false
},
rowgroup: {
type: 'structure',
attributes: {
allowed: [ 'aria-activedescendant', 'aria-expanded', 'aria-errormessage' ]
},
owned: {
all: [ 'row' ]
},
nameFrom: [ 'author', 'contents' ],
context: [ 'grid', 'table', 'treegrid' ],
implicit: [ 'tbody', 'thead', 'tfoot' ],
unsupported: false
},
rowheader: {
type: 'structure',
attributes: {
allowed: [ 'aria-colindex', 'aria-colspan', 'aria-expanded', 'aria-rowindex', 'aria-rowspan', 'aria-required', 'aria-readonly', 'aria-selected', 'aria-sort', 'aria-errormessage' ]
},
owned: null,
nameFrom: [ 'author', 'contents' ],
context: [ 'row' ],
implicit: [ 'th' ],
unsupported: false
},
scrollbar: {
type: 'widget',
attributes: {
required: [ 'aria-controls', 'aria-valuenow' ],
allowed: [ 'aria-valuetext', 'aria-orientation', 'aria-errormessage', 'aria-valuemax', 'aria-valuemin' ]
},
owned: null,
nameFrom: [ 'author' ],
context: null,
unsupported: false
},
search: {
type: 'landmark',
attributes: {
allowed: [ 'aria-expanded', 'aria-errormessage' ]
},
owned: null,
nameFrom: [ 'author' ],
context: null,
unsupported: false,
allowedElements: {
nodeName: [ 'aside', 'form', 'section' ]
}
},
searchbox: {
type: 'widget',
attributes: {
allowed: [ 'aria-activedescendant', 'aria-autocomplete', 'aria-multiline', 'aria-readonly', 'aria-required', 'aria-placeholder', 'aria-errormessage' ]
},
owned: null,
nameFrom: [ 'author' ],
context: null,
implicit: [ 'input[type="search"]' ],
unsupported: false,
allowedElements: {
nodeName: 'input',
properties: {
type: 'text'
}
}
},
section: {
nameFrom: [ 'author', 'contents' ],
type: 'abstract',
unsupported: false
},
sectionhead: {
nameFrom: [ 'author', 'contents' ],
type: 'abstract',
unsupported: false
},
select: {
nameFrom: [ 'author' ],
type: 'abstract',
unsupported: false
},
separator: {
type: 'structure',
attributes: {
allowed: [ 'aria-expanded', 'aria-orientation', 'aria-valuenow', 'aria-valuemax', 'aria-valuemin', 'aria-valuetext', 'aria-errormessage' ]
},
owned: null,
nameFrom: [ 'author' ],
context: null,
implicit: [ 'hr' ],
unsupported: false,
allowedElements: [ 'li' ]
},
slider: {
type: 'widget',
attributes: {
allowed: [ 'aria-valuetext', 'aria-orientation', 'aria-readonly', 'aria-errormessage', 'aria-valuemax', 'aria-valuemin' ],
required: [ 'aria-valuenow' ]
},
owned: null,
nameFrom: [ 'author' ],
context: null,
implicit: [ 'input[type="range"]' ],
unsupported: false
},
spinbutton: {
type: 'widget',
attributes: {
allowed: [ 'aria-valuetext', 'aria-required', 'aria-readonly', 'aria-errormessage', 'aria-valuemax', 'aria-valuemin' ],
required: [ 'aria-valuenow' ]
},
owned: null,
nameFrom: [ 'author' ],
context: null,
implicit: [ 'input[type="number"]' ],
unsupported: false,
allowedElements: {
nodeName: 'input',
properties: {
type: [ 'text', 'tel' ]
}
}
},
status: {
type: 'widget',
attributes: {
allowed: [ 'aria-expanded', 'aria-errormessage' ]
},
owned: null,
nameFrom: [ 'author' ],
context: null,
implicit: [ 'output' ],
unsupported: false,
allowedElements: [ 'section' ]
},
structure: {
type: 'abstract',
unsupported: false
},
switch: {
type: 'widget',
attributes: {
allowed: [ 'aria-errormessage' ],
required: [ 'aria-checked' ]
},
owned: null,
nameFrom: [ 'author', 'contents' ],
context: null,
unsupported: false,
allowedElements: [ 'button', {
nodeName: 'input',
properties: {
type: [ 'checkbox', 'image', 'button' ]
}
}, {
nodeName: 'a',
attributes: {
href: isNotNull
}
} ]
},
tab: {
type: 'widget',
attributes: {
allowed: [ 'aria-selected', 'aria-expanded', 'aria-setsize', 'aria-posinset', 'aria-errormessage' ]
},
owned: null,
nameFrom: [ 'author', 'contents' ],
context: [ 'tablist' ],
unsupported: false,
allowedElements: [ {
nodeName: [ 'button', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'li' ]
}, {
nodeName: 'input',
properties: {
type: 'button'
}
}, {
nodeName: 'a',
attributes: {
href: isNotNull
}
} ]
},
table: {
type: 'structure',
attributes: {
allowed: [ 'aria-colcount', 'aria-rowcount', 'aria-errormessage' ]
},
owned: {
one: [ 'rowgroup', 'row' ]
},
nameFrom: [ 'author', 'contents' ],
context: null,
implicit: [ 'table' ],
unsupported: false
},
tablist: {
type: 'composite',
attributes: {
allowed: [ 'aria-activedescendant', 'aria-expanded', 'aria-level', 'aria-multiselectable', 'aria-orientation', 'aria-errormessage' ]
},
owned: {
all: [ 'tab' ]
},
nameFrom: [ 'author' ],
context: null,
unsupported: false,
allowedElements: [ 'ol', 'ul' ]
},
tabpanel: {
type: 'widget',
attributes: {
allowed: [ 'aria-expanded', 'aria-errormessage' ]
},
owned: null,
nameFrom: [ 'author' ],
context: null,
unsupported: false,
allowedElements: [ 'section' ]
},
term: {
type: 'structure',
attributes: {
allowed: [ 'aria-expanded', 'aria-errormessage' ]
},
owned: null,
nameFrom: [ 'author', 'contents' ],
context: null,
implicit: [ 'dt' ],
unsupported: false
},
textbox: {
type: 'widget',
attributes: {
allowed: [ 'aria-activedescendant', 'aria-autocomplete', 'aria-multiline', 'aria-readonly', 'aria-required', 'aria-placeholder', 'aria-errormessage' ]
},
owned: null,
nameFrom: [ 'author' ],
context: null,
implicit: [ 'input[type="text"]', 'input[type="email"]', 'input[type="password"]', 'input[type="tel"]', 'input[type="url"]', 'input:not([type])', 'textarea' ],
unsupported: false
},
timer: {
type: 'widget',
attributes: {
allowed: [ 'aria-expanded', 'aria-errormessage' ]
},
owned: null,
nameFrom: [ 'author' ],
context: null,
unsupported: false
},
toolbar: {
type: 'structure',
attributes: {
allowed: [ 'aria-activedescendant', 'aria-expanded', 'aria-orientation', 'aria-errormessage' ]
},
owned: null,
nameFrom: [ 'author' ],
context: null,
implicit: [ 'menu[type="toolbar"]' ],
unsupported: false,
allowedElements: [ 'ol', 'ul' ]
},
tooltip: {
type: 'structure',
attributes: {
allowed: [ 'aria-expanded', 'aria-errormessage' ]
},
owned: null,
nameFrom: [ 'author', 'contents' ],
context: null,
unsupported: false
},
tree: {
type: 'composite',
attributes: {
allowed: [ 'aria-activedescendant', 'aria-multiselectable', 'aria-required', 'aria-expanded', 'aria-orientation', 'aria-errormessage' ]
},
owned: {
all: [ 'treeitem' ]
},
nameFrom: [ 'author' ],
context: null,
unsupported: false,
allowedElements: [ 'ol', 'ul' ]
},
treegrid: {
type: 'composite',
attributes: {
allowed: [ 'aria-activedescendant', 'aria-colcount', 'aria-expanded', 'aria-level', 'aria-multiselectable', 'aria-readonly', 'aria-required', 'aria-rowcount', 'aria-orientation', 'aria-errormessage' ]
},
owned: {
one: [ 'rowgroup', 'row' ]
},
nameFrom: [ 'author' ],
context: null,
unsupported: false
},
treeitem: {
type: 'widget',
attributes: {
allowed: [ 'aria-checked', 'aria-selected', 'aria-expanded', 'aria-level', 'aria-posinset', 'aria-setsize', 'aria-errormessage' ]
},
owned: null,
nameFrom: [ 'author', 'contents' ],
context: [ 'group', 'tree' ],
unsupported: false,
allowedElements: [ 'li', {
nodeName: 'a',
attributes: {
href: isNotNull
}
} ]
},
widget: {
type: 'abstract',
unsupported: false
},
window: {
nameFrom: [ 'author' ],
type: 'abstract',
unsupported: false
}
};
lookupTable.implicitHtmlRole = implicit_html_roles_default;
lookupTable.elementsAllowedNoRole = [ {
nodeName: [ 'base', 'body', 'caption', 'col', 'colgroup', 'datalist', 'dd', 'details', 'dt', 'head', 'html', 'keygen', 'label', 'legend', 'main', 'map', 'math', 'meta', 'meter', 'noscript', 'optgroup', 'param', 'picture', 'progress', 'script', 'source', 'style', 'template', 'textarea', 'title', 'track' ]
}, {
nodeName: 'area',
attributes: {
href: isNotNull
}
}, {
nodeName: 'input',
properties: {
type: [ 'color', 'data', 'datatime', 'file', 'hidden', 'month', 'number', 'password', 'range', 'reset', 'submit', 'time', 'week' ]
}
}, {
nodeName: 'link',
attributes: {
href: isNotNull
}
}, {
nodeName: 'menu',
attributes: {
type: 'context'
}
}, {
nodeName: 'menuitem',
attributes: {
type: [ 'command', 'checkbox', 'radio' ]
}
}, {
nodeName: 'select',
condition: function condition(vNode) {
if (!(vNode instanceof axe.AbstractVirtualNode)) {
vNode = axe.utils.getNodeFromTree(vNode);
}
return Number(vNode.attr('size')) > 1;
},
properties: {
multiple: true
}
}, {
nodeName: [ 'clippath', 'cursor', 'defs', 'desc', 'feblend', 'fecolormatrix', 'fecomponenttransfer', 'fecomposite', 'feconvolvematrix', 'fediffuselighting', 'fedisplacementmap', 'fedistantlight', 'fedropshadow', 'feflood', 'fefunca', 'fefuncb', 'fefuncg', 'fefuncr', 'fegaussianblur', 'feimage', 'femerge', 'femergenode', 'femorphology', 'feoffset', 'fepointlight', 'fespecularlighting', 'fespotlight', 'fetile', 'feturbulence', 'filter', 'hatch', 'hatchpath', 'lineargradient', 'marker', 'mask', 'meshgradient', 'meshpatch', 'meshrow', 'metadata', 'mpath', 'pattern', 'radialgradient', 'solidcolor', 'stop', 'switch', 'view' ]
} ];
lookupTable.elementsAllowedAnyRole = [ {
nodeName: 'a',
attributes: {
href: isNull
}
}, {
nodeName: 'img',
attributes: {
alt: isNull
}
}, {
nodeName: [ 'abbr', 'address', 'canvas', 'div', 'p', 'pre', 'blockquote', 'ins', 'del', 'output', 'span', 'table', 'tbody', 'thead', 'tfoot', 'td', 'em', 'strong', 'small', 's', 'cite', 'q', 'dfn', 'abbr', 'time', 'code', 'var', 'samp', 'kbd', 'sub', 'sup', 'i', 'b', 'u', 'mark', 'ruby', 'rt', 'rp', 'bdi', 'bdo', 'br', 'wbr', 'th', 'tr' ]
} ];
lookupTable.evaluateRoleForElement = {
A: function A(_ref111) {
var node = _ref111.node, out = _ref111.out;
if (node.namespaceURI === 'http://www.w3.org/2000/svg') {
return true;
}
if (node.href.length) {
return out;
}
return true;
},
AREA: function AREA(_ref112) {
var node = _ref112.node;
return !node.href;
},
BUTTON: function BUTTON(_ref113) {
var node = _ref113.node, role = _ref113.role, out = _ref113.out;
if (node.getAttribute('type') === 'menu') {
return role === 'menuitem';
}
return out;
},
IMG: function IMG(_ref114) {
var node = _ref114.node, role = _ref114.role, out = _ref114.out;
switch (node.alt) {
case null:
return out;
case '':
return role === 'presentation' || role === 'none';
default:
return role !== 'presentation' && role !== 'none';
}
},
INPUT: function INPUT(_ref115) {
var node = _ref115.node, role = _ref115.role, out = _ref115.out;
switch (node.type) {
case 'button':
case 'image':
return out;
case 'checkbox':
if (role === 'button' && node.hasAttribute('aria-pressed')) {
return true;
}
return out;
case 'radio':
return role === 'menuitemradio';
case 'text':
return role === 'combobox' || role === 'searchbox' || role === 'spinbutton';
case 'tel':
return role === 'combobox' || role === 'spinbutton';
case 'url':
case 'search':
case 'email':
return role === 'combobox';
default:
return false;
}
},
LI: function LI(_ref116) {
var node = _ref116.node, out = _ref116.out;
var hasImplicitListitemRole = axe.utils.matchesSelector(node, 'ol li, ul li');
if (hasImplicitListitemRole) {
return out;
}
return true;
},
MENU: function MENU(_ref117) {
var node = _ref117.node;
if (node.getAttribute('type') === 'context') {
return false;
}
return true;
},
OPTION: function OPTION(_ref118) {
var node = _ref118.node;
var withinOptionList = axe.utils.matchesSelector(node, 'select > option, datalist > option, optgroup > option');
return !withinOptionList;
},
SELECT: function SELECT(_ref119) {
var node = _ref119.node, role = _ref119.role;
return !node.multiple && node.size <= 1 && role === 'menu';
},
SVG: function SVG(_ref120) {
var node = _ref120.node, out = _ref120.out;
if (node.parentNode && node.parentNode.namespaceURI === 'http://www.w3.org/2000/svg') {
return true;
}
return out;
}
};
lookupTable.rolesOfType = {
widget: [ 'button', 'checkbox', 'dialog', 'gridcell', 'link', 'log', 'marquee', 'menuitem', 'menuitemcheckbox', 'menuitemradio', 'option', 'progressbar', 'radio', 'scrollbar', 'searchbox', 'slider', 'spinbutton', 'status', 'switch', 'tab', 'tabpanel', 'textbox', 'timer', 'tooltip', 'tree', 'treeitem' ]
};
var lookup_table_default = lookupTable;
function implicitNodes(role) {
var implicit = null;
var roles = lookup_table_default.role[role];
if (roles && roles.implicit) {
implicit = clone2(roles.implicit);
}
return implicit;
}
var implicit_nodes_default = implicitNodes;
function isAccessibleRef(node) {
return !!get_accessible_refs_default(node).length;
}
var is_accessible_ref_default = isAccessibleRef;
function _isComboboxPopup(virtualNode) {
var _ref121 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, popupRoles = _ref121.popupRoles;
var role = get_role_default(virtualNode);
popupRoles !== null && popupRoles !== void 0 ? popupRoles : popupRoles = aria_attrs_default['aria-haspopup'].values;
if (!popupRoles.includes(role)) {
return false;
}
var vParent = nearestParentWithRole(virtualNode);
if (isCombobox(vParent)) {
return true;
}
var id = virtualNode.props.id;
if (!id) {
return false;
}
if (!virtualNode.actualNode) {
throw new Error('Unable to determine combobox popup without an actualNode');
}
var root = get_root_node_default(virtualNode.actualNode);
var ownedCombobox = root.querySelectorAll('[aria-owns~="'.concat(id, '"][role~="combobox"]:not(select),\n [aria-controls~="').concat(id, '"][role~="combobox"]:not(select)'));
return Array.from(ownedCombobox).some(isCombobox);
}
var isCombobox = function isCombobox(node) {
return node && get_role_default(node) === 'combobox';
};
function nearestParentWithRole(vNode) {
while (vNode = vNode.parent) {
if (get_role_default(vNode, {
noPresentational: true
}) !== null) {
return vNode;
}
}
return null;
}
function label2(node) {
node = get_node_from_tree_default(node);
return label_virtual_default(node);
}
var label_default2 = label2;
function requiredAttr(role) {
var roleDef = standards_default.ariaRoles[role];
if (!roleDef || !Array.isArray(roleDef.requiredAttrs)) {
return [];
}
return _toConsumableArray(roleDef.requiredAttrs);
}
var required_attr_default = requiredAttr;
function requiredContext(role) {
var roleDef = standards_default.ariaRoles[role];
if (!roleDef || !Array.isArray(roleDef.requiredContext)) {
return null;
}
return _toConsumableArray(roleDef.requiredContext);
}
var required_context_default = requiredContext;
function requiredOwned(role) {
var roleDef = standards_default.ariaRoles[role];
if (!roleDef || !Array.isArray(roleDef.requiredOwned)) {
return null;
}
return _toConsumableArray(roleDef.requiredOwned);
}
var required_owned_default = requiredOwned;
function validateAttrValue(vNode, attr) {
vNode = vNode instanceof abstract_virtual_node_default ? vNode : get_node_from_tree_default(vNode);
var matches4;
var list;
var value = vNode.attr(attr);
var attrInfo = standards_default.ariaAttrs[attr];
if (!attrInfo) {
return true;
}
if (attrInfo.allowEmpty && (!value || value.trim() === '')) {
return true;
}
switch (attrInfo.type) {
case 'boolean':
return [ 'true', 'false' ].includes(value.toLowerCase());
case 'nmtoken':
return typeof value === 'string' && attrInfo.values.includes(value.toLowerCase());
case 'nmtokens':
list = token_list_default(value);
return list.reduce(function(result, token) {
return result && attrInfo.values.includes(token);
}, list.length !== 0);
case 'idref':
try {
var doc = get_root_node_default2(vNode.actualNode);
return !!(value && doc.getElementById(value));
} catch (_unused1) {
throw new TypeError('Cannot resolve id references for partial DOM');
}
case 'idrefs':
return idrefs_default(vNode, attr).some(function(node) {
return !!node;
});
case 'string':
return value.trim() !== '';
case 'decimal':
matches4 = value.match(/^[-+]?([0-9]*)\.?([0-9]*)$/);
return !!(matches4 && (matches4[1] || matches4[2]));
case 'int':
var minValue = typeof attrInfo.minValue !== 'undefined' ? attrInfo.minValue : -Infinity;
return /^[-+]?[0-9]+$/.test(value) && parseInt(value) >= minValue;
}
}
var validate_attr_value_default = validateAttrValue;
function validateAttr(att) {
var attrDefinition = standards_default.ariaAttrs[att];
return !!attrDefinition;
}
var validate_attr_default = validateAttr;
function thHasDataCellsEvaluate(node) {
var cells = get_all_cells_default(node);
var checkResult = this;
var reffedHeaders = [];
cells.forEach(function(cell) {
var headers2 = cell.getAttribute('headers');
if (headers2) {
reffedHeaders = reffedHeaders.concat(headers2.split(/\s+/));
}
var ariaLabel = cell.getAttribute('aria-labelledby');
if (ariaLabel) {
reffedHeaders = reffedHeaders.concat(ariaLabel.split(/\s+/));
}
});
var headers = cells.filter(function(cell) {
if (sanitize_default(cell.textContent) === '') {
return false;
}
return cell.nodeName.toUpperCase() === 'TH' || [ 'rowheader', 'columnheader' ].indexOf(get_explicit_role_default(cell)) !== -1;
});
var tableGrid = to_grid_default(node);
var out = true;
headers.forEach(function(header) {
if (header.getAttribute('id') && reffedHeaders.includes(header.getAttribute('id'))) {
return;
}
var pos = get_cell_position_default(header, tableGrid);
var hasCell = false;
if (is_column_header_default(header)) {
hasCell = traverse_default('down', pos, tableGrid).find(function(cell) {
return !is_column_header_default(cell) && get_headers_default(cell, tableGrid).includes(header);
});
}
if (!hasCell && is_row_header_default(header)) {
hasCell = traverse_default('right', pos, tableGrid).find(function(cell) {
return !is_row_header_default(cell) && get_headers_default(cell, tableGrid).includes(header);
});
}
if (!hasCell) {
checkResult.relatedNodes(header);
}
out = out && hasCell;
});
return out ? true : void 0;
}
var th_has_data_cells_evaluate_default = thHasDataCellsEvaluate;
var messageKeys = [ 'cell-header-not-in-table', 'cell-header-not-th', 'header-refs-self', 'empty-hdrs' ];
var notInTable = messageKeys[0], notTh = messageKeys[1], selfRef = messageKeys[2], emptyHdrs = messageKeys[3];
function tdHeadersAttrEvaluate(node) {
var cells = [];
var cellRoleById = {};
for (var rowIndex = 0; rowIndex < node.rows.length; rowIndex++) {
var row = node.rows[rowIndex];
for (var cellIndex = 0; cellIndex < row.cells.length; cellIndex++) {
var cell = row.cells[cellIndex];
cells.push(cell);
var cellId = cell.getAttribute('id');
if (cellId) {
cellRoleById[cellId] = get_role_default(cell);
}
}
}
var badCells = _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, selfRef, new Set()), notInTable, new Set()), notTh, new Set()), emptyHdrs, new Set());
cells.forEach(function(cell) {
if (!cell.hasAttribute('headers') || !_isVisibleToScreenReaders(cell)) {
return;
}
var headersAttr = cell.getAttribute('headers').trim();
if (!headersAttr) {
badCells[emptyHdrs].add(cell);
return;
}
var cellId = cell.getAttribute('id');
var headers = token_list_default(headersAttr);
headers.forEach(function(headerId) {
if (cellId && headerId === cellId) {
badCells[selfRef].add(cell);
} else if (!cellRoleById[headerId]) {
badCells[notInTable].add(cell);
} else if (![ 'columnheader', 'rowheader' ].includes(cellRoleById[headerId])) {
badCells[notTh].add(cell);
}
});
});
var _iterator23 = _createForOfIteratorHelper(messageKeys), _step23;
try {
for (_iterator23.s(); !(_step23 = _iterator23.n()).done; ) {
var messageKey = _step23.value;
if (badCells[messageKey].size > 0) {
this.relatedNodes(_toConsumableArray(badCells[messageKey]));
if (messageKey === emptyHdrs) {
return void 0;
}
this.data({
messageKey: messageKey
});
return false;
}
}
} catch (err) {
_iterator23.e(err);
} finally {
_iterator23.f();
}
return true;
}
function tdHasHeaderEvaluate(node) {
var badCells = [];
var cells = get_all_cells_default(node);
var tableGrid = to_grid_default(node);
cells.forEach(function(cell) {
if (has_content_default(cell) && is_data_cell_default(cell) && !label_default2(cell)) {
var hasHeaders = get_headers_default(cell, tableGrid).some(function(header) {
return header !== null && !!has_content_default(header);
});
if (!hasHeaders) {
badCells.push(cell);
}
}
});
if (badCells.length) {
this.relatedNodes(badCells);
return false;
}
return true;
}
var td_has_header_evaluate_default = tdHasHeaderEvaluate;
function scopeValueEvaluate(node, options, virtualNode) {
var value = virtualNode.attr('scope').toLowerCase();
return options.values.indexOf(value) !== -1;
}
var scope_value_evaluate_default = scopeValueEvaluate;
var same_caption_summary_evaluate_default = sameCaptionSummaryEvaluate;
function sameCaptionSummaryEvaluate(node, options, virtualNode) {
if (virtualNode.children === void 0) {
return void 0;
}
var summary = virtualNode.attr('summary');
var captionNode = virtualNode.children.find(isCaptionNode);
var caption = captionNode ? sanitize_default(subtree_text_default(captionNode)) : false;
if (!caption || !summary) {
return false;
}
return sanitize_default(summary).toLowerCase() === sanitize_default(caption).toLowerCase();
}
function isCaptionNode(virtualNode) {
return virtualNode.props.nodeName === 'caption';
}
function html5ScopeEvaluate(node) {
if (!is_html5_default(document)) {
return true;
}
return node.nodeName.toUpperCase() === 'TH';
}
var html5_scope_evaluate_default = html5ScopeEvaluate;
function captionFakedEvaluate(node) {
var table = to_grid_default(node);
var firstRow = table[0];
if (table.length <= 1 || firstRow.length <= 1 || node.rows.length <= 1) {
return true;
}
return firstRow.reduce(function(out, curr, i) {
return out || curr !== firstRow[i + 1] && firstRow[i + 1] !== void 0;
}, false);
}
var caption_faked_evaluate_default = captionFakedEvaluate;
function svgNonEmptyTitleEvaluate(node, options, virtualNode) {
if (!virtualNode.children) {
return void 0;
}
var titleNode = virtualNode.children.find(function(_ref122) {
var props = _ref122.props;
return props.nodeName === 'title';
});
if (!titleNode) {
this.data({
messageKey: 'noTitle'
});
return false;
}
try {
var titleText2 = subtree_text_default(titleNode, {
includeHidden: true
}).trim();
if (titleText2 === '') {
this.data({
messageKey: 'emptyTitle'
});
return false;
}
} catch (_unused10) {
return void 0;
}
return true;
}
var svg_non_empty_title_evaluate_default = svgNonEmptyTitleEvaluate;
var standards_exports = {};
__export(standards_exports, {
getAriaRolesByType: function getAriaRolesByType() {
return get_aria_roles_by_type_default;
},
getAriaRolesSupportingNameFromContent: function getAriaRolesSupportingNameFromContent() {
return get_aria_roles_supporting_name_from_content_default;
},
getElementSpec: function getElementSpec() {
return get_element_spec_default;
},
getElementsByContentType: function getElementsByContentType() {
return get_elements_by_content_type_default;
},
getGlobalAriaAttrs: function getGlobalAriaAttrs() {
return get_global_aria_attrs_default;
},
implicitHtmlRoles: function implicitHtmlRoles() {
return implicit_html_roles_default;
}
});
function presentationalRoleEvaluate(node, options, virtualNode) {
var explicitRole2 = get_explicit_role_default(virtualNode);
if ([ 'presentation', 'none' ].includes(explicitRole2) && [ 'iframe', 'frame' ].includes(virtualNode.props.nodeName) && virtualNode.hasAttr('title')) {
this.data({
messageKey: 'iframe',
nodeName: virtualNode.props.nodeName
});
return false;
}
var role = get_role_default(virtualNode);
if ([ 'presentation', 'none' ].includes(role)) {
this.data({
role: role
});
return true;
}
if (![ 'presentation', 'none' ].includes(explicitRole2)) {
return false;
}
var hasGlobalAria = get_global_aria_attrs_default().some(function(attr) {
return virtualNode.hasAttr(attr);
});
var focusable = _isFocusable(virtualNode);
var messageKey;
if (hasGlobalAria && !focusable) {
messageKey = 'globalAria';
} else if (!hasGlobalAria && focusable) {
messageKey = 'focusable';
} else {
messageKey = 'both';
}
this.data({
messageKey: messageKey,
role: role
});
return false;
}
function nonEmptyIfPresentEvaluate(node, options, virtualNode) {
var nodeName2 = virtualNode.props.nodeName;
var type2 = (virtualNode.attr('type') || '').toLowerCase();
var label3 = virtualNode.attr('value');
if (label3) {
this.data({
messageKey: 'has-label'
});
}
if (nodeName2 === 'input' && [ 'submit', 'reset' ].includes(type2)) {
return label3 === null;
}
return false;
}
var non_empty_if_present_evaluate_default = nonEmptyIfPresentEvaluate;
function isOnScreenEvaluate(node) {
return _isVisibleOnScreen(node);
}
var is_on_screen_evaluate_default = isOnScreenEvaluate;
var MAX_RELATED_NODES = 5;
function inlineStyleProperty(node, options, virtualNode) {
var cssProperty = options.cssProperty, absoluteValues = options.absoluteValues, minValue = options.minValue, maxValue = options.maxValue, _options$normalValue = options.normalValue, normalValue = _options$normalValue === void 0 ? 0 : _options$normalValue, noImportant = options.noImportant, multiLineOnly = options.multiLineOnly;
if (!noImportant && node.style.getPropertyPriority(cssProperty) !== 'important') {
return true;
}
var data = {};
if (typeof minValue === 'number') {
data.minValue = minValue;
}
if (typeof maxValue === 'number') {
data.maxValue = maxValue;
}
var declaredPropValue = node.style.getPropertyValue(cssProperty);
if ([ 'inherit', 'unset', 'revert', 'revert-layer' ].includes(declaredPropValue)) {
this.data(_extends({
value: declaredPropValue
}, data));
return true;
}
var firstValue;
var notNumber;
var failedValue;
var related = [];
walkTextContainers(virtualNode, virtualNode, cssProperty, function(container) {
if (multiLineOnly && !_isMultiline(container.actualNode)) {
return false;
}
var value = getNumberValue(container, {
absoluteValues: absoluteValues,
cssProperty: cssProperty,
normalValue: normalValue
});
if (firstValue === void 0) {
firstValue = value;
}
if (typeof value !== 'number') {
notNumber = notNumber === void 0 ? value : notNumber;
return false;
}
if ((typeof minValue !== 'number' || value >= minValue) && (typeof maxValue !== 'number' || value <= maxValue)) {
return false;
}
failedValue = failedValue === void 0 ? value : failedValue;
if (container !== virtualNode) {
related.push(container.actualNode);
}
return related.length > MAX_RELATED_NODES;
});
if (failedValue !== void 0) {
this.data(_extends({
value: failedValue
}, data, related.length > MAX_RELATED_NODES && {
messageKey: 'omitted'
}));
this.relatedNodes(related.slice(0, MAX_RELATED_NODES));
return false;
}
if (firstValue === void 0) {
return true;
}
if (notNumber !== void 0) {
this.data(_extends({
value: notNumber
}, data));
return void 0;
}
this.data(_extends({
value: firstValue
}, data));
return true;
}
function walkTextContainers(vNode, target, cssProperty, callback) {
if (visible_virtual_default(vNode, false, true) !== '') {
if (vNode !== target && !inheritsValue(vNode, target, cssProperty)) {
return false;
}
if (callback(vNode)) {
return true;
}
}
return vNode.children.some(function(child) {
return child.props.nodeType === 1 && !redeclares(child, cssProperty) && walkTextContainers(child, target, cssProperty, callback);
});
}
function inheritsValue(vNode, target, cssProperty) {
var value = vNode.getComputedStylePropertyValue(cssProperty);
if (value === target.getComputedStylePropertyValue(cssProperty)) {
return true;
}
var declared = target.actualNode.style.getPropertyValue(cssProperty);
if (!/^(\d+\.?\d*|\.\d+)$/.test(declared)) {
return false;
}
var fontSize = parseFloat(vNode.getComputedStylePropertyValue('font-size'));
return Math.round(parseFloat(value) / fontSize * 100) === Math.round(parseFloat(declared) * 100);
}
function redeclares(_ref123, cssProperty) {
var actualNode = _ref123.actualNode;
var value = actualNode.style.getPropertyValue(cssProperty);
return value !== '' && value !== 'inherit' && value !== 'unset';
}
function getNumberValue(vNode, _ref124) {
var cssProperty = _ref124.cssProperty, absoluteValues = _ref124.absoluteValues, normalValue = _ref124.normalValue;
var cssPropValue = vNode.getComputedStylePropertyValue(cssProperty);
if (cssPropValue === 'normal') {
return normalValue;
}
var parsedValue = parseFloat(cssPropValue);
if (absoluteValues) {
return parsedValue;
}
var fontSize = parseFloat(vNode.getComputedStylePropertyValue('font-size'));
var value = Math.round(parsedValue / fontSize * 100) / 100;
if (isNaN(value)) {
return cssPropValue;
}
return value;
}
function hasAltEvaluate(node, options, virtualNode) {
var nodeName2 = virtualNode.props.nodeName;
if (![ 'img', 'input', 'area' ].includes(nodeName2)) {
return false;
}
return virtualNode.hasAttr('alt');
}
var has_alt_evaluate_default = hasAltEvaluate;
function existsEvaluate() {
return void 0;
}
var exists_evaluate_default = existsEvaluate;
function docHasTitleEvaluate() {
var title = document.title;
return !!sanitize_default(title);
}
var doc_has_title_evaluate_default = docHasTitleEvaluate;
function avoidInlineSpacingEvaluate(node, options) {
var overriddenProperties = options.cssProperties.filter(function(property) {
if (node.style.getPropertyPriority(property) === 'important') {
return property;
}
});
if (overriddenProperties.length > 0) {
this.data(overriddenProperties);
return false;
}
return true;
}
var avoid_inline_spacing_evaluate_default = avoidInlineSpacingEvaluate;
function ariaLabelledbyEvaluate(node, options, virtualNode) {
try {
return !!sanitize_default(arialabelledby_text_default(virtualNode));
} catch (_unused11) {
return void 0;
}
}
var aria_labelledby_evaluate_default = ariaLabelledbyEvaluate;
function ariaLabelEvaluate(node, options, virtualNode) {
return !!sanitize_default(_arialabelText(virtualNode));
}
var aria_label_evaluate_default = ariaLabelEvaluate;
function duplicateIdEvaluate(node, options, virtualNode) {
var id = virtualNode.attr('id').trim();
if (!id) {
return true;
}
var root = get_root_node_default2(node);
var matchingNodes = Array.from(root.querySelectorAll('[id="'.concat(escape_selector_default(id), '"]'))).filter(function(foundNode) {
return foundNode !== node;
});
if (matchingNodes.length) {
this.relatedNodes(matchingNodes);
}
this.data(id);
return matchingNodes.length === 0;
}
var duplicate_id_evaluate_default = duplicateIdEvaluate;
function duplicateIdAfter(results) {
var uniqueIds = [];
return results.filter(function(r) {
if (uniqueIds.indexOf(r.data) === -1) {
uniqueIds.push(r.data);
return true;
}
return false;
});
}
var duplicate_id_after_default = duplicateIdAfter;
function uniqueFrameTitleEvaluate(node, options, vNode) {
var title = sanitize_default(vNode.attr('title')).toLowerCase();
this.data(title);
return true;
}
var unique_frame_title_evaluate_default = uniqueFrameTitleEvaluate;
function uniqueFrameTitleAfter(results) {
var titles = {};
results.forEach(function(r) {
titles[r.data] = titles[r.data] !== void 0 ? ++titles[r.data] : 0;
});
results.forEach(function(r) {
r.result = !!titles[r.data];
});
return results;
}
var unique_frame_title_after_default = uniqueFrameTitleAfter;
function skipLinkEvaluate(node) {
var target = _getElementByReference(node, 'href');
if (target) {
return _isVisibleToScreenReaders(target) || void 0;
}
return false;
}
var skip_link_evaluate_default = skipLinkEvaluate;
var implicitAriaLiveRoles = [ 'alert', 'log', 'status' ];
function regionEvaluate(node, options, virtualNode) {
this.data({
isIframe: [ 'iframe', 'frame' ].includes(virtualNode.props.nodeName)
});
var regionlessNodes = cache_default.get('regionlessNodes', function() {
return getRegionlessNodes(options);
});
return !regionlessNodes.includes(virtualNode);
}
function getRegionlessNodes(options) {
var regionlessNodes = findRegionlessElms(axe._tree[0], options).map(function(vNode) {
while (vNode.parent && !vNode.parent._hasRegionDescendant && vNode.parent.actualNode !== document.body) {
vNode = vNode.parent;
}
return vNode;
}).filter(function(vNode, index, array) {
return array.indexOf(vNode) === index;
});
return regionlessNodes;
}
function findRegionlessElms(virtualNode, options) {
var node = virtualNode.actualNode;
if (get_role_default(virtualNode) === 'button' || isRegion(virtualNode, options) || [ 'iframe', 'frame' ].includes(virtualNode.props.nodeName) || _isSkipLink(virtualNode.actualNode) && _getElementByReference(virtualNode.actualNode, 'href') || !_isVisibleToScreenReaders(node)) {
var vNode = virtualNode;
while (vNode) {
vNode._hasRegionDescendant = true;
vNode = vNode.parent;
}
if ([ 'iframe', 'frame' ].includes(virtualNode.props.nodeName)) {
return [ virtualNode ];
}
return [];
} else if (node !== document.body && has_content_default(node, true) && !isShallowlyHidden(virtualNode)) {
return [ virtualNode ];
} else {
return virtualNode.children.filter(function(_ref125) {
var actualNode = _ref125.actualNode;
return actualNode.nodeType === 1;
}).map(function(vNode) {
return findRegionlessElms(vNode, options);
}).reduce(function(a2, b3) {
return a2.concat(b3);
}, []);
}
}
function isShallowlyHidden(virtualNode) {
return [ 'none', 'presentation' ].includes(get_role_default(virtualNode)) && !hasChildTextNodes(virtualNode);
}
function isRegion(virtualNode, options) {
var _getAriaValue$value;
var role = get_role_default(virtualNode);
var ariaLive = (_getAriaValue$value = _getAriaValue(virtualNode, 'aria-live').value) !== null && _getAriaValue$value !== void 0 ? _getAriaValue$value : '';
var landmarkRoles2 = get_aria_roles_by_type_default('landmark');
if ([ 'assertive', 'polite' ].includes(ariaLive) || implicitAriaLiveRoles.includes(role)) {
return true;
}
if (landmarkRoles2.includes(role)) {
return true;
}
if (options.regionMatcher && matches_default2(virtualNode, options.regionMatcher)) {
return true;
}
return false;
}
function regionAfter(results) {
var iframeResults = results.filter(function(r) {
return r.data.isIframe;
});
results.forEach(function(r) {
if (r.result || r.node.ancestry.length === 1) {
return;
}
var frameAncestry = r.node.ancestry.slice(0, -1);
var _iterator24 = _createForOfIteratorHelper(iframeResults), _step24;
try {
for (_iterator24.s(); !(_step24 = _iterator24.n()).done; ) {
var iframeResult = _step24.value;
if (_matchAncestry(frameAncestry, iframeResult.node.ancestry)) {
r.result = iframeResult.result;
break;
}
}
} catch (err) {
_iterator24.e(err);
} finally {
_iterator24.f();
}
});
iframeResults.forEach(function(r) {
if (!r.result) {
r.result = true;
}
});
return results;
}
var region_after_default = regionAfter;
function normalizeFontWeight(weight) {
switch (weight) {
case 'lighter':
return 100;
case 'normal':
return 400;
case 'bold':
return 700;
case 'bolder':
return 900;
}
weight = parseInt(weight);
return !isNaN(weight) ? weight : 400;
}
function getTextContainer(elm) {
var nextNode = elm;
var outerText = elm.textContent.trim();
var innerText = outerText;
while (innerText === outerText && nextNode !== void 0) {
var _i30 = -1;
elm = nextNode;
if (elm.children.length === 0) {
return elm;
}
do {
_i30++;
innerText = elm.children[_i30].textContent.trim();
} while (innerText === '' && _i30 + 1 < elm.children.length);
nextNode = elm.children[_i30];
}
return elm;
}
function getStyleValues(node) {
var style = window.getComputedStyle(getTextContainer(node));
return {
fontWeight: normalizeFontWeight(style.getPropertyValue('font-weight')),
fontSize: parseInt(style.getPropertyValue('font-size')),
isItalic: style.getPropertyValue('font-style') === 'italic'
};
}
function isHeaderStyle(styleA, styleB, margins) {
return margins.reduce(function(out, margin) {
return out || (!margin.size || styleA.fontSize / margin.size > styleB.fontSize) && (!margin.weight || styleA.fontWeight - margin.weight > styleB.fontWeight) && (!margin.italic || styleA.isItalic && !styleB.isItalic);
}, false);
}
function pAsHeadingEvaluate(node, options, virtualNode) {
var siblings = Array.from(node.parentNode.children);
var currentIndex = siblings.indexOf(node);
options = options || {};
var margins = options.margins || [];
var nextSibling = siblings.slice(currentIndex + 1).find(function(elm) {
return elm.nodeName.toUpperCase() === 'P';
});
var prevSibling = siblings.slice(0, currentIndex).reverse().find(function(elm) {
return elm.nodeName.toUpperCase() === 'P';
});
var currStyle = getStyleValues(node);
var nextStyle = nextSibling ? getStyleValues(nextSibling) : null;
var prevStyle = prevSibling ? getStyleValues(prevSibling) : null;
var optionsPassLength = options.passLength;
var optionsFailLength = options.failLength;
var headingLength = node.textContent.trim().length;
var paragraphLength = nextSibling === null || nextSibling === void 0 ? void 0 : nextSibling.textContent.trim().length;
if (headingLength > paragraphLength * optionsPassLength) {
return true;
}
if (!nextStyle || !isHeaderStyle(currStyle, nextStyle, margins)) {
return true;
}
var blockquote = find_up_virtual_default(virtualNode, 'blockquote');
if (blockquote && blockquote.nodeName.toUpperCase() === 'BLOCKQUOTE') {
return void 0;
}
if (prevStyle && !isHeaderStyle(currStyle, prevStyle, margins)) {
return void 0;
}
if (headingLength > paragraphLength * optionsFailLength) {
return void 0;
}
return false;
}
var p_as_heading_evaluate_default = pAsHeadingEvaluate;
var separatorRegex = /[;,\s]/;
var validRedirectNumRegex = /^[0-9.]+$/;
function metaRefreshEvaluate(node, options, virtualNode) {
var _ref126 = options || {}, minDelay = _ref126.minDelay, maxDelay = _ref126.maxDelay;
var content = (virtualNode.attr('content') || '').trim();
var _content$split = content.split(separatorRegex), _content$split2 = _slicedToArray(_content$split, 1), redirectStr = _content$split2[0];
if (!redirectStr.match(validRedirectNumRegex)) {
return true;
}
var redirectDelay = parseFloat(redirectStr);
this.data({
redirectDelay: redirectDelay
});
if (typeof minDelay === 'number' && redirectDelay <= options.minDelay) {
return true;
}
if (typeof maxDelay === 'number' && redirectDelay > options.maxDelay) {
return true;
}
return false;
}
function internalLinkPresentEvaluate(node, options, virtualNode) {
var links = query_selector_all_default(virtualNode, 'a[href]');
return links.some(function(vLink) {
return /^#[^/!]/.test(vLink.attr('href'));
});
}
var internal_link_present_evaluate_default = internalLinkPresentEvaluate;
var commons_exports = {};
__export(commons_exports, {
aria: function aria() {
return aria_exports;
},
color: function color() {
return color_exports;
},
dom: function dom() {
return dom_exports;
},
forms: function forms() {
return forms_exports;
},
matches: function matches() {
return matches_default2;
},
math: function math() {
return math_exports;
},
standards: function standards() {
return standards_exports;
},
table: function table() {
return table_exports;
},
text: function text() {
return text_exports;
},
utils: function utils() {
return utils_exports;
}
});
var color_exports = {};
__export(color_exports, {
Color: function Color() {
return color_default2;
},
centerPointOfRect: function centerPointOfRect() {
return center_point_of_rect_default;
},
elementHasImage: function elementHasImage() {
return element_has_image_default;
},
elementIsDistinct: function elementIsDistinct() {
return element_is_distinct_default;
},
filteredRectStack: function filteredRectStack() {
return filtered_rect_stack_default;
},
flattenColors: function flattenColors() {
return _flattenColors;
},
flattenShadowColors: function flattenShadowColors() {
return _flattenShadowColors;
},
getBackgroundColor: function getBackgroundColor() {
return _getBackgroundColor2;
},
getBackgroundStack: function getBackgroundStack() {
return _getBackgroundStack;
},
getContrast: function getContrast() {
return get_contrast_default;
},
getForegroundColor: function getForegroundColor() {
return _getForegroundColor;
},
getOwnBackgroundColor: function getOwnBackgroundColor() {
return get_own_background_color_default;
},
getRectStack: function getRectStack() {
return get_rect_stack_default;
},
getStackingContext: function getStackingContext() {
return _getStackingContext;
},
getStrokeColorsFromShadows: function getStrokeColorsFromShadows() {
return _getStrokeColorsFromShadows;
},
getTextShadowColors: function getTextShadowColors() {
return _getTextShadowColors;
},
hasValidContrastRatio: function hasValidContrastRatio() {
return has_valid_contrast_ratio_default;
},
incompleteData: function incompleteData() {
return incomplete_data_default;
},
parseTextShadows: function parseTextShadows() {
return _parseTextShadows;
},
stackingContextToColor: function stackingContextToColor() {
return _stackingContextToColor;
}
});
function centerPointOfRect(rect) {
if (rect.left > window.innerWidth) {
return void 0;
}
if (rect.top > window.innerHeight) {
return void 0;
}
var x = Math.min(Math.ceil(rect.left + rect.width / 2), window.innerWidth - 1);
var y = Math.min(Math.ceil(rect.top + rect.height / 2), window.innerHeight - 1);
return {
x: x,
y: y
};
}
var center_point_of_rect_default = centerPointOfRect;
function _getFonts(style) {
return style.getPropertyValue('font-family').split(/[,;]/g).map(function(font) {
return font.trim().toLowerCase();
});
}
function elementIsDistinct(node, ancestorNode) {
var nodeStyle = window.getComputedStyle(node);
if (nodeStyle.getPropertyValue('background-image') !== 'none') {
return true;
}
var hasBorder = [ 'border-bottom', 'border-top', 'outline' ].reduce(function(result, edge) {
var borderClr = new color_default2();
borderClr.parseString(nodeStyle.getPropertyValue(edge + '-color'));
return result || nodeStyle.getPropertyValue(edge + '-style') !== 'none' && parseFloat(nodeStyle.getPropertyValue(edge + '-width')) > 0 && borderClr.alpha !== 0;
}, false);
if (hasBorder) {
return true;
}
var parentStyle = window.getComputedStyle(ancestorNode);
if (_getFonts(nodeStyle)[0] !== _getFonts(parentStyle)[0]) {
return true;
}
var hasStyle = [ 'text-decoration-line', 'text-decoration-style', 'font-weight', 'font-style', 'font-size' ].reduce(function(result, cssProp) {
return result || nodeStyle.getPropertyValue(cssProp) !== parentStyle.getPropertyValue(cssProp);
}, false);
var tDec = nodeStyle.getPropertyValue('text-decoration');
if (tDec.split(' ').length < 3) {
hasStyle = hasStyle || tDec !== parentStyle.getPropertyValue('text-decoration');
}
return hasStyle;
}
var element_is_distinct_default = elementIsDistinct;
function getRectStack2(elm) {
var boundingStack = get_element_stack_default(elm);
var filteredArr = get_text_element_stack_default(elm);
if (!filteredArr || filteredArr.length <= 1) {
return [ boundingStack ];
}
if (filteredArr.some(function(stack) {
return stack === void 0;
})) {
return null;
}
filteredArr.splice(0, 0, boundingStack);
return filteredArr;
}
var get_rect_stack_default = getRectStack2;
function filteredRectStack(elm) {
var rectStack = get_rect_stack_default(elm);
if (rectStack && rectStack.length === 1) {
return rectStack[0];
}
if (rectStack && rectStack.length > 1) {
var boundingStack = rectStack.shift();
var isSame;
rectStack.forEach(function(rectList, index) {
if (index === 0) {
return;
}
var rectA = rectStack[index - 1], rectB = rectStack[index];
isSame = rectA.every(function(element, elementIndex) {
return element === rectB[elementIndex];
}) || boundingStack.includes(elm);
});
if (!isSame) {
incomplete_data_default.set('bgColor', 'elmPartiallyObscuring');
return null;
}
return rectStack[0];
}
incomplete_data_default.set('bgColor', 'outsideViewport');
return null;
}
var filtered_rect_stack_default = filteredRectStack;
var nonSeparableBlendModes = [ 'hue', 'saturation', 'color', 'luminosity' ];
var blendFunctions = {
normal: function normal(Cb, Cs) {
return Cs;
},
multiply: function multiply(Cb, Cs) {
return Cs * Cb;
},
screen: function screen(Cb, Cs) {
return Cb + Cs - Cb * Cs;
},
overlay: function overlay(Cb, Cs) {
return this['hard-light'](Cs, Cb);
},
darken: function darken(Cb, Cs) {
return Math.min(Cb, Cs);
},
lighten: function lighten(Cb, Cs) {
return Math.max(Cb, Cs);
},
'color-dodge': function colorDodge(Cb, Cs) {
return Cb === 0 ? 0 : Cs === 1 ? 1 : Math.min(1, Cb / (1 - Cs));
},
'color-burn': function colorBurn(Cb, Cs) {
return Cb === 1 ? 1 : Cs === 0 ? 0 : 1 - Math.min(1, (1 - Cb) / Cs);
},
'hard-light': function hardLight(Cb, Cs) {
return Cs <= .5 ? this.multiply(Cb, 2 * Cs) : this.screen(Cb, 2 * Cs - 1);
},
'soft-light': function softLight(Cb, Cs) {
if (Cs <= .5) {
return Cb - (1 - 2 * Cs) * Cb * (1 - Cb);
} else {
var D = Cb <= .25 ? ((16 * Cb - 12) * Cb + 4) * Cb : Math.sqrt(Cb);
return Cb + (2 * Cs - 1) * (D - Cb);
}
},
difference: function difference(Cb, Cs) {
return Math.abs(Cb - Cs);
},
exclusion: function exclusion(Cb, Cs) {
return Cb + Cs - 2 * Cb * Cs;
},
hue: function hue(Cb, Cs) {
return Cs.setSaturation(Cb.getSaturation()).setLuminosity(Cb.getLuminosity());
},
saturation: function saturation(Cb, Cs) {
return Cb.setSaturation(Cs.getSaturation()).setLuminosity(Cb.getLuminosity());
},
color: function color(Cb, Cs) {
return Cs.setLuminosity(Cb.getLuminosity());
},
luminosity: function luminosity(Cb, Cs) {
return Cb.setLuminosity(Cs.getLuminosity());
}
};
function _flattenColors(sourceColor, backdrop) {
var blendMode = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'normal';
var blendingResult = blend(backdrop, sourceColor, blendMode);
var r = simpleAlphaCompositing(sourceColor.red, sourceColor.alpha, backdrop.red, backdrop.alpha, blendingResult.r * 255);
var g2 = simpleAlphaCompositing(sourceColor.green, sourceColor.alpha, backdrop.green, backdrop.alpha, blendingResult.g * 255);
var b3 = simpleAlphaCompositing(sourceColor.blue, sourceColor.alpha, backdrop.blue, backdrop.alpha, blendingResult.b * 255);
var \u03b1o = clamp3(sourceColor.alpha + backdrop.alpha * (1 - sourceColor.alpha), 0, 1);
if (\u03b1o === 0) {
return new color_default2(r, g2, b3, \u03b1o);
}
var Cr = Math.round(r / \u03b1o);
var Cg = Math.round(g2 / \u03b1o);
var Cb = Math.round(b3 / \u03b1o);
return new color_default2(Cr, Cg, Cb, \u03b1o);
}
function simpleAlphaCompositing(Cs, \u03b1s, Cb, \u03b1b, blendingResult) {
return \u03b1s * (1 - \u03b1b) * Cs + \u03b1s * \u03b1b * blendingResult + (1 - \u03b1s) * \u03b1b * Cb;
}
function clamp3(value, min, max2) {
return Math.min(Math.max(min, value), max2);
}
function blend(Cb, Cs, blendMode) {
if (nonSeparableBlendModes.includes(blendMode)) {
return blendFunctions[blendMode](Cb, Cs);
}
var C = new color_default2();
[ 'r', 'g', 'b' ].forEach(function(channel) {
C[channel] = blendFunctions[blendMode](Cb[channel], Cs[channel]);
});
return C;
}
function _flattenShadowColors(fgColor, bgColor) {
var alpha = fgColor.alpha;
var r = (1 - alpha) * bgColor.red + alpha * fgColor.red;
var g2 = (1 - alpha) * bgColor.green + alpha * fgColor.green;
var b3 = (1 - alpha) * bgColor.blue + alpha * fgColor.blue;
var a2 = fgColor.alpha + bgColor.alpha * (1 - fgColor.alpha);
return new color_default2(r, g2, b3, a2);
}
function _getBackgroundStack(node) {
var stacks = get_text_element_stack_default(node).map(function(stack) {
stack = reduce_to_elements_below_floating_default(stack, node);
stack = sortPageBackground(stack);
return stack;
});
for (var index = 0; index < stacks.length; index++) {
var stack = stacks[index];
if (stack[0] !== node) {
incomplete_data_default.set('bgColor', 'bgOverlap');
return null;
}
if (index !== 0 && !shallowArraysEqual(stack, stacks[0])) {
incomplete_data_default.set('bgColor', 'elmPartiallyObscuring');
return null;
}
}
return stacks[0] || null;
}
function sortPageBackground(elmStack) {
var bodyIndex = elmStack.indexOf(document.body);
var bgNodes = elmStack;
var htmlBgColor = get_own_background_color_default(window.getComputedStyle(document.documentElement));
if (bodyIndex > 1 && htmlBgColor.alpha === 0 && !element_has_image_default(document.documentElement)) {
if (bodyIndex > 1) {
bgNodes.splice(bodyIndex, 1);
bgNodes.push(document.body);
}
var htmlIndex = bgNodes.indexOf(document.documentElement);
if (htmlIndex > 0) {
bgNodes.splice(htmlIndex, 1);
bgNodes.push(document.documentElement);
}
}
return bgNodes;
}
function shallowArraysEqual(a2, b3) {
if (a2 === b3) {
return true;
}
if (a2 === null || b3 === null) {
return false;
}
if (a2.length !== b3.length) {
return false;
}
for (var _i31 = 0; _i31 < a2.length; ++_i31) {
if (a2[_i31] !== b3[_i31]) {
return false;
}
}
return true;
}
var SHADOW_STROKE_ALPHA = .54;
var VISIBLE_SHADOW_MIN_PX = .5;
var OPAQUE_STROKE_OFFSET_MIN_PX = 1.5;
var edges = [ 'top', 'right', 'bottom', 'left' ];
function _getStrokeColorsFromShadows(parsedShadows) {
var _ref127 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, _ref127$ignoreEdgeCou = _ref127.ignoreEdgeCount, ignoreEdgeCount = _ref127$ignoreEdgeCou === void 0 ? false : _ref127$ignoreEdgeCou;
var shadowMap = getShadowColorsMap(parsedShadows);
var shadowsByColor = Object.entries(shadowMap).map(function(_ref128) {
var _ref129 = _slicedToArray(_ref128, 2), colorStr = _ref129[0], sides = _ref129[1];
var edgeCount = edges.filter(function(side) {
return sides[side].length !== 0;
}).length;
return {
colorStr: colorStr,
sides: sides,
edgeCount: edgeCount
};
});
if (!ignoreEdgeCount && shadowsByColor.some(function(_ref130) {
var edgeCount = _ref130.edgeCount;
return edgeCount > 1 && edgeCount < 4;
})) {
return null;
}
return shadowsByColor.map(shadowGroupToColor).filter(function(shadow) {
return shadow !== null;
});
}
function getShadowColorsMap(parsedShadows) {
var colorMap = {};
var _iterator25 = _createForOfIteratorHelper(parsedShadows), _step25;
try {
for (_iterator25.s(); !(_step25 = _iterator25.n()).done; ) {
var _colorMap$colorStr;
var _step25$value = _step25.value, colorStr = _step25$value.colorStr, pixels = _step25$value.pixels;
(_colorMap$colorStr = colorMap[colorStr]) !== null && _colorMap$colorStr !== void 0 ? _colorMap$colorStr : colorMap[colorStr] = {
top: [],
right: [],
bottom: [],
left: []
};
var borders = colorMap[colorStr];
var _pixels = _slicedToArray(pixels, 2), offsetX = _pixels[0], offsetY = _pixels[1];
if (offsetX > VISIBLE_SHADOW_MIN_PX) {
borders.right.push(offsetX);
} else if (-offsetX > VISIBLE_SHADOW_MIN_PX) {
borders.left.push(-offsetX);
}
if (offsetY > VISIBLE_SHADOW_MIN_PX) {
borders.bottom.push(offsetY);
} else if (-offsetY > VISIBLE_SHADOW_MIN_PX) {
borders.top.push(-offsetY);
}
}
} catch (err) {
_iterator25.e(err);
} finally {
_iterator25.f();
}
return colorMap;
}
function shadowGroupToColor(_ref131) {
var colorStr = _ref131.colorStr, sides = _ref131.sides, edgeCount = _ref131.edgeCount;
if (edgeCount !== 4) {
return null;
}
var strokeColor = new color_default2();
strokeColor.parseString(colorStr);
var density = 0;
var isSolid = true;
edges.forEach(function(edge) {
density += sides[edge].length / 4;
isSolid && (isSolid = sides[edge].every(function(offset) {
return offset > OPAQUE_STROKE_OFFSET_MIN_PX;
}));
});
if (!isSolid) {
strokeColor.alpha = 1 - Math.pow(SHADOW_STROKE_ALPHA, density);
}
return strokeColor;
}
function _parseTextShadows(textShadow) {
var current = {
pixels: []
};
var str = textShadow.trim();
var shadows = [ current ];
if (!str) {
return [];
}
while (str) {
var colorMatch = str.match(/^[a-z]+(\([^)]+\))?/i) || str.match(/^#[0-9a-f]+/i);
var pixelMatch = str.match(/^([0-9.-]+)px/i) || str.match(/^(0)/);
if (colorMatch) {
assert_default(!current.colorStr, 'Multiple colors identified in text-shadow: '.concat(textShadow));
str = str.replace(colorMatch[0], '').trim();
current.colorStr = colorMatch[0];
} else if (pixelMatch) {
assert_default(current.pixels.length < 3, 'Too many pixel units in text-shadow: '.concat(textShadow));
str = str.replace(pixelMatch[0], '').trim();
var pixelUnit = parseFloat((pixelMatch[1][0] === '.' ? '0' : '') + pixelMatch[1]);
current.pixels.push(pixelUnit);
} else if (str[0] === ',') {
assert_default(current.pixels.length >= 2, 'Missing pixel value in text-shadow: '.concat(textShadow));
current = {
pixels: []
};
shadows.push(current);
str = str.substr(1).trim();
} else {
throw new Error('Unable to process text-shadows: '.concat(str));
}
}
shadows.forEach(function(_ref132) {
var pixels = _ref132.pixels;
if (pixels.length === 2) {
pixels.push(0);
}
});
return shadows;
}
function _getTextShadowColors(node) {
var _ref133 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, minRatio = _ref133.minRatio, maxRatio = _ref133.maxRatio, ignoreEdgeCount = _ref133.ignoreEdgeCount;
var shadowColors = [];
var style = window.getComputedStyle(node);
var textShadow = style.getPropertyValue('text-shadow');
if (textShadow === 'none') {
return shadowColors;
}
var fontSizeStr = style.getPropertyValue('font-size');
var fontSize = parseInt(fontSizeStr);
assert_default(isNaN(fontSize) === false, 'Unable to determine font-size value '.concat(fontSizeStr));
var thinShadows = [];
var shadows = _parseTextShadows(textShadow);
var _iterator26 = _createForOfIteratorHelper(shadows), _step26;
try {
for (_iterator26.s(); !(_step26 = _iterator26.n()).done; ) {
var shadow = _step26.value;
var colorStr = shadow.colorStr || style.getPropertyValue('color');
var _shadow$pixels = _slicedToArray(shadow.pixels, 3), offsetX = _shadow$pixels[0], offsetY = _shadow$pixels[1], _shadow$pixels$ = _shadow$pixels[2], blurRadius = _shadow$pixels$ === void 0 ? 0 : _shadow$pixels$;
if (maxRatio && blurRadius >= fontSize * maxRatio) {
continue;
}
if (minRatio && blurRadius < fontSize * minRatio) {
thinShadows.push({
colorStr: colorStr,
pixels: shadow.pixels
});
continue;
}
if (thinShadows.length > 0) {
var _strokeColors = _getStrokeColorsFromShadows(thinShadows, {
ignoreEdgeCount: ignoreEdgeCount
});
if (_strokeColors === null) {
return null;
}
shadowColors.push.apply(shadowColors, _toConsumableArray(_strokeColors));
thinShadows.splice(0, thinShadows.length);
}
var _color3 = textShadowColor({
colorStr: colorStr,
offsetX: offsetX,
offsetY: offsetY,
blurRadius: blurRadius,
fontSize: fontSize
});
shadowColors.push(_color3);
}
} catch (err) {
_iterator26.e(err);
} finally {
_iterator26.f();
}
if (thinShadows.length > 0) {
var strokeColors = _getStrokeColorsFromShadows(thinShadows, {
ignoreEdgeCount: ignoreEdgeCount
});
if (strokeColors === null) {
return null;
}
shadowColors.push.apply(shadowColors, _toConsumableArray(strokeColors));
}
return shadowColors;
}
function textShadowColor(_ref134) {
var colorStr = _ref134.colorStr, offsetX = _ref134.offsetX, offsetY = _ref134.offsetY, blurRadius = _ref134.blurRadius, fontSize = _ref134.fontSize;
if (offsetX > blurRadius || offsetY > blurRadius) {
return new color_default2(0, 0, 0, 0);
}
var shadowColor = new color_default2();
shadowColor.parseString(colorStr);
shadowColor.alpha *= blurRadiusToAlpha(blurRadius, fontSize);
return shadowColor;
}
function blurRadiusToAlpha(blurRadius, fontSize) {
if (blurRadius === 0) {
return 1;
}
var relativeBlur = blurRadius / fontSize;
return .185 / (relativeBlur + .4);
}
function _getStackingContext(elm, elmStack) {
var virtualNode = get_node_from_tree_default(elm);
if (virtualNode._stackingContext) {
return virtualNode._stackingContext;
}
var stackingContext = [];
var contextMap = new Map();
elmStack = elmStack !== null && elmStack !== void 0 ? elmStack : _getBackgroundStack(elm);
elmStack.forEach(function(bgElm) {
var _stackingOrder2;
var bgVNode = get_node_from_tree_default(bgElm);
var bgColor = getOwnBackgroundColor2(bgVNode);
var stackingOrder = bgVNode._stackingOrder.filter(function(_ref135) {
var vNode = _ref135.vNode;
return !!vNode;
});
stackingOrder.forEach(function(_ref136, index) {
var _stackingOrder;
var vNode = _ref136.vNode;
var ancestorVNode2 = (_stackingOrder = stackingOrder[index - 1]) === null || _stackingOrder === void 0 ? void 0 : _stackingOrder.vNode;
var context2 = addToStackingContext(contextMap, vNode, ancestorVNode2);
if (index === 0 && !contextMap.get(vNode)) {
stackingContext.unshift(context2);
}
contextMap.set(vNode, context2);
});
var ancestorVNode = (_stackingOrder2 = stackingOrder[stackingOrder.length - 1]) === null || _stackingOrder2 === void 0 ? void 0 : _stackingOrder2.vNode;
var context = addToStackingContext(contextMap, bgVNode, ancestorVNode);
if (!stackingOrder.length) {
stackingContext.unshift(context);
}
context.bgColor = bgColor;
});
virtualNode._stackingContext = stackingContext;
return stackingContext;
}
function _stackingContextToColor(context) {
var _context$descendants;
if (!((_context$descendants = context.descendants) !== null && _context$descendants !== void 0 && _context$descendants.length)) {
var color2 = context.bgColor;
color2.alpha *= context.opacity;
return {
color: color2,
blendMode: context.blendMode
};
}
var sourceColor = context.descendants.reduce(reduceToColor, createStackingContext2());
var color = _flattenColors(sourceColor, context.bgColor, context.descendants[0].blendMode);
color.alpha *= context.opacity;
return {
color: color,
blendMode: context.blendMode
};
}
function reduceToColor(backdropContext, sourceContext) {
var backdrop;
if (backdropContext instanceof color_default2) {
backdrop = backdropContext;
} else {
backdrop = _stackingContextToColor(backdropContext).color;
}
var sourceColor = _stackingContextToColor(sourceContext).color;
return _flattenColors(sourceColor, backdrop, sourceContext.blendMode);
}
function createStackingContext2(vNode, ancestorContext) {
var _vNode$getComputedSty;
return {
vNode: vNode,
ancestor: ancestorContext,
opacity: parseFloat((_vNode$getComputedSty = vNode === null || vNode === void 0 ? void 0 : vNode.getComputedStylePropertyValue('opacity')) !== null && _vNode$getComputedSty !== void 0 ? _vNode$getComputedSty : 1),
bgColor: new color_default2(0, 0, 0, 0),
blendMode: normalizeBlendMode(vNode === null || vNode === void 0 ? void 0 : vNode.getComputedStylePropertyValue('mix-blend-mode')),
descendants: []
};
}
function normalizeBlendMode(blendmode) {
return !!blendmode ? blendmode : void 0;
}
function addToStackingContext(contextMap, vNode, ancestorVNode) {
var _contextMap$get;
var ancestorContext = contextMap.get(ancestorVNode);
var context = (_contextMap$get = contextMap.get(vNode)) !== null && _contextMap$get !== void 0 ? _contextMap$get : createStackingContext2(vNode, ancestorContext);
if (ancestorContext && ancestorVNode !== vNode && !ancestorContext.descendants.includes(context)) {
ancestorContext.descendants.unshift(context);
}
return context;
}
function getOwnBackgroundColor2(vNode) {
var bgColor = new color_default2();
bgColor.parseString(vNode.getComputedStylePropertyValue('background-color'));
return bgColor;
}
function _getBackgroundColor2(elm) {
var bgElms = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
var shadowOutlineEmMax = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : .1;
var vNode = get_node_from_tree_default(elm);
var bgColorCache = vNode._cache.getBackgroundColor;
if (bgColorCache) {
bgElms.push.apply(bgElms, _toConsumableArray(bgColorCache.bgElms));
incomplete_data_default.set('bgColor', bgColorCache.incompleteData);
return bgColorCache.bgColor;
}
var bgColor = _getBackgroundColor(elm, bgElms, shadowOutlineEmMax);
vNode._cache.getBackgroundColor = {
bgColor: bgColor,
bgElms: bgElms,
incompleteData: incomplete_data_default.get('bgColor')
};
return bgColor;
}
function _getBackgroundColor(elm, bgElms, shadowOutlineEmMax) {
var _getTextShadowColors2, _bgColors;
var elmStack = _getBackgroundStack(elm);
if (!elmStack) {
return null;
}
var textRects = get_visible_child_text_rects_default(elm);
var bgColors = (_getTextShadowColors2 = _getTextShadowColors(elm, {
minRatio: shadowOutlineEmMax,
ignoreEdgeCount: true
})) !== null && _getTextShadowColors2 !== void 0 ? _getTextShadowColors2 : [];
if (bgColors.length) {
bgColors = [ {
color: bgColors.reduce(_flattenShadowColors)
} ];
}
for (var _i32 = 0; _i32 < elmStack.length; _i32++) {
var bgElm = elmStack[_i32];
var bgElmStyle = window.getComputedStyle(bgElm);
if (element_has_image_default(bgElm, bgElmStyle)) {
bgElms.push(bgElm);
return null;
}
var bgColor = void 0;
try {
bgColor = get_own_background_color_default(bgElmStyle);
if (bgColor.alpha === 0) {
continue;
}
} catch (error) {
if (error && incomplete_data_default.get('colorParse')) {
return null;
}
throw error;
}
if (bgElmStyle.getPropertyValue('display') !== 'inline' && !fullyEncompasses(bgElm, textRects)) {
bgElms.push(bgElm);
incomplete_data_default.set('bgColor', 'elmPartiallyObscured');
return null;
}
bgElms.push(bgElm);
if (bgColor.alpha === 1) {
break;
}
}
var stackingContext = _getStackingContext(elm, elmStack);
bgColors = stackingContext.map(_stackingContextToColor).concat(bgColors);
var pageBgs = getPageBackgroundColors(elm, elmStack.includes(document.body));
(_bgColors = bgColors).unshift.apply(_bgColors, _toConsumableArray(pageBgs));
if (bgColors.length === 0) {
return new color_default2(255, 255, 255, 1);
}
var blendedColor = bgColors.reduce(function(bgColor, fgColor) {
return _flattenColors(fgColor.color, bgColor.color instanceof color_default2 ? bgColor.color : bgColor, fgColor.blendMode);
});
return _flattenColors(blendedColor.color instanceof color_default2 ? blendedColor.color : blendedColor, new color_default2(255, 255, 255, 1));
}
function fullyEncompasses(node, rects) {
rects = Array.isArray(rects) ? rects : [ rects ];
var nodeRect = node.getBoundingClientRect();
var right = nodeRect.right, bottom = nodeRect.bottom;
var style = window.getComputedStyle(node);
var overflow = style.getPropertyValue('overflow');
var paddingLeft = parseInt(style.getPropertyValue('padding-left'), 10);
var paddingRight = parseInt(style.getPropertyValue('padding-right'), 10);
var paddingTop = parseInt(style.getPropertyValue('padding-top'), 10);
var paddingBottom = parseInt(style.getPropertyValue('padding-bottom'), 10);
if ([ 'scroll', 'auto' ].includes(overflow) || node instanceof window.HTMLHtmlElement) {
right = nodeRect.left + node.scrollWidth + paddingLeft + paddingRight;
bottom = nodeRect.top + node.scrollHeight + paddingTop + paddingBottom;
}
return rects.every(function(rect) {
return rect.top >= nodeRect.top && rect.bottom <= bottom && rect.left >= nodeRect.left && rect.right <= right;
});
}
function normalizeBlendMode2(blendmode) {
return !!blendmode ? blendmode : void 0;
}
function getPageBackgroundColors(elm, stackContainsBody) {
var pageColors = [];
if (!stackContainsBody) {
var html = document.documentElement;
var body = document.body;
var htmlStyle = window.getComputedStyle(html);
var bodyStyle = window.getComputedStyle(body);
var htmlBgColor = get_own_background_color_default(htmlStyle);
var bodyBgColor = get_own_background_color_default(bodyStyle);
var bodyBgColorApplies = bodyBgColor.alpha !== 0 && fullyEncompasses(body, elm.getBoundingClientRect());
if (bodyBgColor.alpha !== 0 && htmlBgColor.alpha === 0 || bodyBgColorApplies && bodyBgColor.alpha !== 1) {
pageColors.unshift({
color: bodyBgColor,
blendMode: normalizeBlendMode2(bodyStyle.getPropertyValue('mix-blend-mode'))
});
}
if (htmlBgColor.alpha !== 0 && (!bodyBgColorApplies || bodyBgColorApplies && bodyBgColor.alpha !== 1)) {
pageColors.unshift({
color: htmlBgColor,
blendMode: normalizeBlendMode2(htmlStyle.getPropertyValue('mix-blend-mode'))
});
}
}
return pageColors;
}
function getContrast(bgColor, fgColor) {
if (!fgColor || !bgColor) {
return null;
}
if (fgColor.alpha < 1) {
fgColor = _flattenColors(fgColor, bgColor);
}
var bL = bgColor.getRelativeLuminance();
var fL = fgColor.getRelativeLuminance();
return (Math.max(fL, bL) + .05) / (Math.min(fL, bL) + .05);
}
var get_contrast_default = getContrast;
function _getForegroundColor(node, _, bgColor) {
var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
var nodeStyle = window.getComputedStyle(node);
var colorStack = [ function() {
return getStrokeColor(nodeStyle, options);
}, function() {
return getTextColor(nodeStyle);
}, function() {
return _getTextShadowColors(node, {
minRatio: 0
});
} ];
var fgColors = [];
try {
for (var _i33 = 0, _colorStack = colorStack; _i33 < _colorStack.length; _i33++) {
var colorFn = _colorStack[_i33];
var _color4 = colorFn();
if (!_color4) {
continue;
}
fgColors = fgColors.concat(_color4);
if (_color4.alpha === 1) {
break;
}
}
} catch (error) {
if (error && incomplete_data_default.get('colorParse')) {
return null;
}
throw error;
}
var fgColor = fgColors.reduce(function(source, backdrop) {
return _flattenColors(source, backdrop);
});
bgColor !== null && bgColor !== void 0 ? bgColor : bgColor = _getBackgroundColor2(node, []);
if (bgColor === null) {
var reason = incomplete_data_default.get('bgColor');
incomplete_data_default.set('fgColor', reason);
return null;
}
var stackingContexts = _getStackingContext(node);
var context = findNodeInContexts(stackingContexts, node);
return _flattenColors(calculateBlendedForegroundColor(fgColor, context, stackingContexts), new color_default2(255, 255, 255, 1));
}
function getTextColor(nodeStyle) {
return new color_default2().parseString(nodeStyle.getPropertyValue('-webkit-text-fill-color') || nodeStyle.getPropertyValue('color'));
}
function getStrokeColor(nodeStyle, _ref137) {
var _ref137$textStrokeEmM = _ref137.textStrokeEmMin, textStrokeEmMin = _ref137$textStrokeEmM === void 0 ? 0 : _ref137$textStrokeEmM;
var strokeWidth = parseFloat(nodeStyle.getPropertyValue('-webkit-text-stroke-width'));
if (strokeWidth === 0) {
return null;
}
var fontSize = nodeStyle.getPropertyValue('font-size');
var relativeStrokeWidth = strokeWidth / parseFloat(fontSize);
if (isNaN(relativeStrokeWidth) || relativeStrokeWidth < textStrokeEmMin) {
return null;
}
var strokeColor = nodeStyle.getPropertyValue('-webkit-text-stroke-color');
return new color_default2().parseString(strokeColor);
}
function calculateBlendedForegroundColor(fgColor, context, stackingContexts) {
while (context) {
var _context$ancestor;
if (context.opacity === 1 && context.ancestor) {
context = context.ancestor;
continue;
}
fgColor.alpha *= context.opacity;
var stack = ((_context$ancestor = context.ancestor) === null || _context$ancestor === void 0 ? void 0 : _context$ancestor.descendants) || stackingContexts;
if (context.opacity !== 1) {
stack = stack.slice(0, stack.indexOf(context));
}
var bgColors = stack.map(_stackingContextToColor);
if (!bgColors.length) {
context = context.ancestor;
continue;
}
var bgColor = bgColors.reduce(function(backdrop, source) {
return _flattenColors(source.color, backdrop.color instanceof color_default2 ? backdrop.color : backdrop);
}, {
color: new color_default2(0, 0, 0, 0),
blendMode: 'normal'
});
fgColor = _flattenColors(fgColor, bgColor);
context = context.ancestor;
}
return fgColor;
}
function findNodeInContexts(contexts, node) {
var _iterator27 = _createForOfIteratorHelper(contexts), _step27;
try {
for (_iterator27.s(); !(_step27 = _iterator27.n()).done; ) {
var _context$vNode;
var context = _step27.value;
if (((_context$vNode = context.vNode) === null || _context$vNode === void 0 ? void 0 : _context$vNode.actualNode) === node) {
return context;
}
var found = findNodeInContexts(context.descendants, node);
if (found) {
return found;
}
}
} catch (err) {
_iterator27.e(err);
} finally {
_iterator27.f();
}
}
function hasValidContrastRatio(bg, fg, fontSize, isBold) {
var contrast2 = get_contrast_default(bg, fg);
var isSmallFont = isBold && Math.ceil(fontSize * 72) / 96 < 14 || !isBold && Math.ceil(fontSize * 72) / 96 < 18;
var expectedContrastRatio = isSmallFont ? 4.5 : 3;
return {
isValid: contrast2 > expectedContrastRatio,
contrastRatio: contrast2,
expectedContrastRatio: expectedContrastRatio
};
}
var has_valid_contrast_ratio_default = hasValidContrastRatio;
var forms_exports = {};
__export(forms_exports, {
isAriaCombobox: function isAriaCombobox() {
return is_aria_combobox_default;
},
isAriaListbox: function isAriaListbox() {
return is_aria_listbox_default;
},
isAriaRange: function isAriaRange() {
return is_aria_range_default;
},
isAriaTextbox: function isAriaTextbox() {
return is_aria_textbox_default;
},
isDisabled: function isDisabled() {
return is_disabled_default;
},
isNativeSelect: function isNativeSelect() {
return is_native_select_default;
},
isNativeTextbox: function isNativeTextbox() {
return is_native_textbox_default;
}
});
var disabledNodeNames = [ 'fieldset', 'button', 'select', 'input', 'textarea' ];
function isDisabled(virtualNode) {
var disabledState = virtualNode._isDisabled;
if (typeof disabledState === 'boolean') {
return disabledState;
}
var nodeName2 = virtualNode.props.nodeName;
var ariaDisabled = _getAriaValue(virtualNode, 'aria-disabled').value;
if (disabledNodeNames.includes(nodeName2) && virtualNode.hasAttr('disabled')) {
disabledState = true;
} else if (ariaDisabled) {
disabledState = ariaDisabled === 'true';
} else if (virtualNode.parent) {
disabledState = isDisabled(virtualNode.parent);
} else {
disabledState = false;
}
virtualNode._isDisabled = disabledState;
return disabledState;
}
var is_disabled_default = isDisabled;
function identicalLinksSamePurposeEvaluate(node, options, virtualNode) {
var accText = text_exports.accessibleTextVirtual(virtualNode);
var name = text_exports.sanitize(text_exports.removeUnicode(accText, {
emoji: true,
nonBmp: true,
punctuations: true
})).toLowerCase();
if (!name) {
return void 0;
}
var afterData = {
name: name,
urlProps: dom_exports.urlPropsFromAttribute(node, 'href')
};
this.data(afterData);
this.relatedNodes([ node ]);
return true;
}
var identical_links_same_purpose_evaluate_default = identicalLinksSamePurposeEvaluate;
function isIdenticalObject(a2, b3) {
if (!a2 || !b3) {
return false;
}
var aProps = Object.getOwnPropertyNames(a2);
var bProps = Object.getOwnPropertyNames(b3);
if (aProps.length !== bProps.length) {
return false;
}
var result = aProps.every(function(propName) {
var aValue = a2[propName];
var bValue = b3[propName];
if (_typeof(aValue) !== _typeof(bValue)) {
return false;
}
if (_typeof(aValue) === 'object' || _typeof(bValue) === 'object') {
return isIdenticalObject(aValue, bValue);
}
return aValue === bValue;
});
return result;
}
function identicalLinksSamePurposeAfter(results) {
if (results.length < 2) {
return results;
}
var incompleteResults = results.filter(function(_ref138) {
var result = _ref138.result;
return result !== void 0;
});
var uniqueResults = [];
var nameMap = {};
var _loop7 = function _loop7(index) {
var _currentResult$relate;
var currentResult = incompleteResults[index];
var _currentResult$data = currentResult.data, name = _currentResult$data.name, urlProps = _currentResult$data.urlProps;
if (nameMap[name]) {
return 1;
}
var sameNameResults = incompleteResults.filter(function(_ref139, resultNum) {
var data = _ref139.data;
return data.name === name && resultNum !== index;
});
var isSameUrl = sameNameResults.every(function(_ref140) {
var data = _ref140.data;
return isIdenticalObject(data.urlProps, urlProps);
});
if (sameNameResults.length && !isSameUrl) {
currentResult.result = void 0;
}
currentResult.relatedNodes = [];
(_currentResult$relate = currentResult.relatedNodes).push.apply(_currentResult$relate, _toConsumableArray(sameNameResults.map(function(node) {
return node.relatedNodes[0];
})));
nameMap[name] = sameNameResults;
uniqueResults.push(currentResult);
};
for (var index = 0; index < incompleteResults.length; index++) {
if (_loop7(index)) {
continue;
}
}
return uniqueResults;
}
var identical_links_same_purpose_after_default = identicalLinksSamePurposeAfter;
function getLevel(vNode) {
var role = get_role_default(vNode);
var headingRole = role && role.includes('heading');
var ariaHeadingLevel = _getAriaValue(vNode, 'aria-level').value;
var ariaLevel = parseInt(ariaHeadingLevel, 10);
var _ref141 = vNode.props.nodeName.match(/h(\d)/) || [], _ref142 = _slicedToArray(_ref141, 2), headingLevel = _ref142[1];
if (!headingRole) {
return -1;
}
if (headingLevel && !ariaHeadingLevel) {
return parseInt(headingLevel, 10);
}
if (isNaN(ariaLevel) || ariaLevel < 1) {
if (headingLevel) {
return parseInt(headingLevel, 10);
}
return 2;
}
if (ariaLevel) {
return ariaLevel;
}
return -1;
}
function headingOrderEvaluate() {
var headingOrder = cache_default.get('headingOrder');
if (headingOrder) {
return true;
}
var selector = 'h1, h2, h3, h4, h5, h6, [role=heading], iframe, frame';
var vNodes = query_selector_all_filter_default(axe._tree[0], selector, _isVisibleToScreenReaders);
headingOrder = vNodes.map(function(vNode) {
return {
ancestry: [ _getAncestry(vNode.actualNode) ],
level: getLevel(vNode)
};
});
this.data({
headingOrder: headingOrder
});
cache_default.set('headingOrder', vNodes);
return true;
}
var heading_order_evaluate_default = headingOrderEvaluate;
function headingOrderAfter(results) {
var headingOrder = getHeadingOrder(results);
results.forEach(function(result) {
result.result = getHeadingOrderOutcome(result, headingOrder);
});
return results;
}
function getHeadingOrderOutcome(result, headingOrder) {
var _headingOrder$index$l, _headingOrder$index, _headingOrder$level, _headingOrder;
var index = findHeadingOrderIndex(headingOrder, result.node.ancestry);
var currLevel = (_headingOrder$index$l = (_headingOrder$index = headingOrder[index]) === null || _headingOrder$index === void 0 ? void 0 : _headingOrder$index.level) !== null && _headingOrder$index$l !== void 0 ? _headingOrder$index$l : -1;
var prevLevel = (_headingOrder$level = (_headingOrder = headingOrder[index - 1]) === null || _headingOrder === void 0 ? void 0 : _headingOrder.level) !== null && _headingOrder$level !== void 0 ? _headingOrder$level : -1;
if (index === 0) {
return true;
}
if (currLevel === -1) {
return void 0;
}
return currLevel - prevLevel <= 1;
}
function getHeadingOrder(results) {
results = _toConsumableArray(results);
results.sort(function(_ref143, _ref144) {
var nodeA = _ref143.node;
var nodeB = _ref144.node;
return nodeA.ancestry.length - nodeB.ancestry.length;
});
var headingOrder = results.reduce(mergeHeadingOrder, []);
return headingOrder.filter(function(_ref145) {
var level = _ref145.level;
return level !== -1;
});
}
function mergeHeadingOrder(mergedHeadingOrder, result) {
var _result$data;
var frameHeadingOrder = (_result$data = result.data) === null || _result$data === void 0 ? void 0 : _result$data.headingOrder;
var frameAncestry = shortenArray(result.node.ancestry, 1);
if (!frameHeadingOrder) {
return mergedHeadingOrder;
}
var normalizedHeadingOrder = frameHeadingOrder.map(function(heading) {
return addFrameToHeadingAncestry(heading, frameAncestry);
});
var index = getFrameIndex(mergedHeadingOrder, frameAncestry);
if (index === -1) {
mergedHeadingOrder.push.apply(mergedHeadingOrder, _toConsumableArray(normalizedHeadingOrder));
} else {
mergedHeadingOrder.splice.apply(mergedHeadingOrder, [ index, 0 ].concat(_toConsumableArray(normalizedHeadingOrder)));
}
return mergedHeadingOrder;
}
function getFrameIndex(headingOrder, frameAncestry) {
while (frameAncestry.length) {
var index = findHeadingOrderIndex(headingOrder, frameAncestry);
if (index !== -1) {
return index;
}
frameAncestry = shortenArray(frameAncestry, 1);
}
return -1;
}
function findHeadingOrderIndex(headingOrder, ancestry) {
return headingOrder.findIndex(function(heading) {
return _matchAncestry(heading.ancestry, ancestry);
});
}
function addFrameToHeadingAncestry(heading, frameAncestry) {
var ancestry = frameAncestry.concat(heading.ancestry);
return _extends({}, heading, {
ancestry: ancestry
});
}
function shortenArray(arr, spliceLength) {
return arr.slice(0, arr.length - spliceLength);
}
function targetSizeEvaluate(node, options, vNode) {
var minSize = (options === null || options === void 0 ? void 0 : options.minSize) || 24;
var nodeRect = vNode.boundingClientRect;
if (_rectHasMinimumSize(minSize * 10, nodeRect)) {
this.data({
messageKey: 'large',
minSize: minSize
});
return true;
}
var hasMinimumSize = _rectHasMinimumSize.bind(null, minSize);
var nearbyElms = _findNearbyElms(vNode);
var overflowingContent = filterOverflowingContent(vNode, nearbyElms);
var _filterByElmsOverlap = filterByElmsOverlap(vNode, nearbyElms), fullyObscuringElms = _filterByElmsOverlap.fullyObscuringElms, partialObscuringElms = _filterByElmsOverlap.partialObscuringElms;
if (overflowingContent.length && (fullyObscuringElms.length || !hasMinimumSize(nodeRect))) {
this.data({
minSize: minSize,
messageKey: 'contentOverflow'
});
this.relatedNodes(mapActualNodes(overflowingContent));
return void 0;
}
if (fullyObscuringElms.length) {
this.relatedNodes(mapActualNodes(fullyObscuringElms));
this.data({
messageKey: 'obscured'
});
return true;
}
var negativeOutcome = _isInTabOrder(vNode) ? false : void 0;
if (!hasMinimumSize(nodeRect)) {
this.data(_extends({
minSize: minSize
}, toDecimalSize(nodeRect)));
return negativeOutcome;
}
var obscuredWidgets = partialObscuringElms.filter(function(vObscurer) {
return _isSeparateTarget(vNode, vObscurer);
});
if (!obscuredWidgets.length) {
this.data(_extends({
minSize: minSize
}, toDecimalSize(nodeRect)));
return true;
}
var largestInnerRect = getLargestUnobscuredArea(vNode, obscuredWidgets, minSize);
if (!largestInnerRect) {
this.data({
minSize: minSize,
messageKey: 'tooManyRects'
});
return void 0;
}
if (!hasMinimumSize(largestInnerRect)) {
if (overflowingContent.length) {
this.data({
minSize: minSize,
messageKey: 'contentOverflow'
});
this.relatedNodes(mapActualNodes(overflowingContent));
return void 0;
}
var allTabbable = obscuredWidgets.every(_isInTabOrder);
var messageKey = 'partiallyObscured'.concat(allTabbable ? '' : 'NonTabbable');
this.data(_extends({
messageKey: messageKey,
minSize: minSize
}, toDecimalSize(largestInnerRect)));
this.relatedNodes(mapActualNodes(obscuredWidgets));
return allTabbable ? negativeOutcome : void 0;
}
this.data(_extends({
minSize: minSize
}, toDecimalSize(largestInnerRect || nodeRect)));
this.relatedNodes(mapActualNodes(obscuredWidgets));
return true;
}
function filterOverflowingContent(vNode, nearbyElms) {
return nearbyElms.filter(function(nearbyElm) {
return !isEnclosedRect2(nearbyElm, vNode) && isDescendantNotInTabOrder2(vNode, nearbyElm);
});
}
function filterByElmsOverlap(vNode, nearbyElms) {
var fullyObscuringElms = [];
var partialObscuringElms = [];
var _iterator28 = _createForOfIteratorHelper(nearbyElms), _step28;
try {
for (_iterator28.s(); !(_step28 = _iterator28.n()).done; ) {
var vNeighbor = _step28.value;
if (!isDescendantNotInTabOrder2(vNode, vNeighbor) && _hasVisualOverlap(vNode, vNeighbor) && getCssPointerEvents(vNeighbor) !== 'none') {
if (isEnclosedRect2(vNode, vNeighbor)) {
fullyObscuringElms.push(vNeighbor);
} else {
partialObscuringElms.push(vNeighbor);
}
}
}
} catch (err) {
_iterator28.e(err);
} finally {
_iterator28.f();
}
return {
fullyObscuringElms: fullyObscuringElms,
partialObscuringElms: partialObscuringElms
};
}
function getLargestUnobscuredArea(vNode, obscuredNodes, minSize) {
var nodeRect = vNode.boundingClientRect;
var obscuringRects = obscuredNodes.map(function(obscuredNode) {
var display2 = obscuredNode.getComputedStylePropertyValue('display');
return display2 === 'inline' ? obscuredNode.clientRects : obscuredNode.boundingClientRect;
}).flat(Infinity);
var unobscuredRects;
try {
unobscuredRects = _splitRects(nodeRect, obscuringRects);
} catch (_unused12) {
return null;
}
return getLargestRect2(unobscuredRects, minSize);
}
function getLargestRect2(rects, minSize) {
return rects.reduce(function(rectA, rectB) {
var rectAisMinimum = _rectHasMinimumSize(minSize, rectA);
var rectBisMinimum = _rectHasMinimumSize(minSize, rectB);
if (rectAisMinimum !== rectBisMinimum) {
return rectAisMinimum ? rectA : rectB;
}
var areaA = rectA.width * rectA.height;
var areaB = rectB.width * rectB.height;
return areaA > areaB ? rectA : rectB;
});
}
function isEnclosedRect2(vNodeA, vNodeB) {
var rectA = vNodeA.boundingClientRect;
var rectB = vNodeB.boundingClientRect;
return rectA.top >= rectB.top && rectA.left >= rectB.left && rectA.bottom <= rectB.bottom && rectA.right <= rectB.right;
}
function getCssPointerEvents(vNode) {
return vNode.getComputedStylePropertyValue('pointer-events');
}
function toDecimalSize(rect) {
return {
width: Math.round(rect.width * 10) / 10,
height: Math.round(rect.height * 10) / 10
};
}
function isDescendantNotInTabOrder2(vAncestor, vNode) {
return _contains(vAncestor, vNode) && !_isInTabOrder(vNode);
}
function mapActualNodes(vNodes) {
return vNodes.map(function(_ref146) {
var actualNode = _ref146.actualNode;
return actualNode;
});
}
var roundingMargin2 = .05;
function targetOffsetEvaluate(node, options, vNode) {
var minOffset = (options === null || options === void 0 ? void 0 : options.minOffset) || 24;
if (_rectHasMinimumSize(minOffset * 10, vNode.boundingClientRect)) {
this.data({
messageKey: 'large',
minOffset: minOffset
});
return true;
}
var closeNeighbors = [];
var closestOffset = minOffset;
var nearbyElms = _findNearbyElms(vNode, minOffset, {
withinMargin: true
});
var _iterator29 = _createForOfIteratorHelper(nearbyElms), _step29;
try {
for (_iterator29.s(); !(_step29 = _iterator29.n()).done; ) {
var vNeighbor = _step29.value;
if (!_isSeparateTarget(vNode, vNeighbor)) {
continue;
}
var offset = null;
try {
offset = _getOffset(vNode, vNeighbor, minOffset / 2);
} catch (err2) {
if (err2.message.startsWith('splitRects')) {
this.data({
messageKey: 'tooManyRects',
closestOffset: 0,
minOffset: minOffset
});
return void 0;
}
throw err2;
}
if (offset === null) {
continue;
}
offset = roundToSingleDecimal(offset) * 2;
if (offset + roundingMargin2 >= minOffset) {
continue;
}
closestOffset = Math.min(closestOffset, offset);
closeNeighbors.push(vNeighbor);
}
} catch (err) {
_iterator29.e(err);
} finally {
_iterator29.f();
}
if (closeNeighbors.length === 0) {
this.data({
closestOffset: closestOffset,
minOffset: minOffset
});
return true;
}
this.relatedNodes(closeNeighbors.map(function(_ref147) {
var actualNode = _ref147.actualNode;
return actualNode;
}));
if (!closeNeighbors.some(_isInTabOrder)) {
this.data({
messageKey: 'nonTabbableNeighbor',
closestOffset: closestOffset,
minOffset: minOffset
});
return void 0;
}
this.data({
closestOffset: closestOffset,
minOffset: minOffset
});
return _isInTabOrder(vNode) ? false : void 0;
}
function roundToSingleDecimal(num) {
return Math.round(num * 10) / 10;
}
function metaViewportScaleEvaluate(node, options, virtualNode) {
var _ref148 = options || {}, _ref148$scaleMinimum = _ref148.scaleMinimum, scaleMinimum = _ref148$scaleMinimum === void 0 ? 2 : _ref148$scaleMinimum, _ref148$lowerBound = _ref148.lowerBound, lowerBound = _ref148$lowerBound === void 0 ? false : _ref148$lowerBound;
var content = virtualNode.attr('content') || '';
if (!content) {
return true;
}
var result = content.split(/[;,]/).reduce(function(out, item) {
var contentValue = item.trim();
if (!contentValue) {
return out;
}
var _contentValue$split = contentValue.split('='), _contentValue$split2 = _slicedToArray(_contentValue$split, 2), key = _contentValue$split2[0], value = _contentValue$split2[1];
if (!key || !value) {
return out;
}
var curatedKey = key.toLowerCase().trim();
var curatedValue = value.toLowerCase().trim();
if (curatedKey === 'maximum-scale' && curatedValue === 'yes') {
curatedValue = 1;
}
if (curatedKey === 'maximum-scale' && parseFloat(curatedValue) < 0) {
return out;
}
out[curatedKey] = curatedValue;
return out;
}, {});
if (lowerBound && result['maximum-scale'] && parseFloat(result['maximum-scale']) < lowerBound) {
return true;
}
if (!lowerBound && result['user-scalable'] === 'no') {
this.data('user-scalable=no');
return false;
}
var userScalableAsFloat = parseFloat(result['user-scalable']);
if (!lowerBound && result['user-scalable'] && (userScalableAsFloat || userScalableAsFloat === 0) && userScalableAsFloat > -1 && userScalableAsFloat < 1) {
this.data('user-scalable');
return false;
}
if (result['maximum-scale'] && parseFloat(result['maximum-scale']) < scaleMinimum) {
this.data('maximum-scale');
return false;
}
return true;
}
var meta_viewport_scale_evaluate_default = metaViewportScaleEvaluate;
function cssOrientationLockEvaluate(node, options, virtualNode, context) {
var _ref149 = context || {}, _ref149$cssom = _ref149.cssom, cssom = _ref149$cssom === void 0 ? void 0 : _ref149$cssom;
var _ref150 = options || {}, _ref150$degreeThresho = _ref150.degreeThreshold, degreeThreshold = _ref150$degreeThresho === void 0 ? 0 : _ref150$degreeThresho;
if (!cssom || !cssom.length) {
return void 0;
}
var isLocked = false;
var relatedElements = [];
var rulesGroupByDocumentFragment = groupCssomByDocument(cssom);
var _loop8 = function _loop8() {
var key = _Object$keys3[_i34];
var _rulesGroupByDocument = rulesGroupByDocumentFragment[key], root = _rulesGroupByDocument.root, rules = _rulesGroupByDocument.rules;
var orientationRules = rules.filter(isMediaRuleWithOrientation);
if (!orientationRules.length) {
return 1;
}
orientationRules.forEach(function(_ref151) {
var cssRules = _ref151.cssRules;
Array.from(cssRules).forEach(function(cssRule) {
var locked = getIsOrientationLocked(cssRule);
if (locked && cssRule.selectorText.toUpperCase() !== 'HTML') {
var elms = Array.from(root.querySelectorAll(cssRule.selectorText)) || [];
relatedElements = relatedElements.concat(elms);
}
isLocked = isLocked || locked;
});
});
};
for (var _i34 = 0, _Object$keys3 = Object.keys(rulesGroupByDocumentFragment); _i34 < _Object$keys3.length; _i34++) {
if (_loop8()) {
continue;
}
}
if (!isLocked) {
return true;
}
if (relatedElements.length) {
this.relatedNodes(relatedElements);
}
return false;
function groupCssomByDocument(cssObjectModel) {
return cssObjectModel.reduce(function(out, _ref152) {
var sheet = _ref152.sheet, root = _ref152.root, shadowId = _ref152.shadowId;
var key = shadowId ? shadowId : 'topDocument';
if (!out[key]) {
out[key] = {
root: root,
rules: []
};
}
if (!sheet || !sheet.cssRules) {
return out;
}
var rules = Array.from(sheet.cssRules);
out[key].rules = out[key].rules.concat(rules);
return out;
}, {});
}
function isMediaRuleWithOrientation(_ref153) {
var type2 = _ref153.type, cssText = _ref153.cssText;
if (type2 !== 4) {
return false;
}
return /orientation:\s*landscape/i.test(cssText) || /orientation:\s*portrait/i.test(cssText);
}
function getIsOrientationLocked(_ref154) {
var selectorText = _ref154.selectorText, style = _ref154.style;
if (!selectorText || style.length <= 0) {
return false;
}
var transformStyle = style.transform || style.webkitTransform || style.msTransform || false;
if (!transformStyle && !style.rotate) {
return false;
}
var transformDegrees = getTransformDegrees(transformStyle);
var rotateDegrees = getRotationInDegrees('rotate', style.rotate);
var degrees = transformDegrees + rotateDegrees;
if (!degrees) {
return false;
}
degrees = Math.abs(degrees);
if (Math.abs(degrees - 180) % 180 <= degreeThreshold) {
return false;
}
return Math.abs(degrees - 90) % 90 <= degreeThreshold;
}
function getTransformDegrees(transformStyle) {
if (!transformStyle) {
return 0;
}
var matches4 = transformStyle.match(/(rotate|rotateZ|rotate3d|matrix|matrix3d)\(([^)]+)\)(?!.*(rotate|rotateZ|rotate3d|matrix|matrix3d))/);
if (!matches4) {
return 0;
}
var _matches2 = _slicedToArray(matches4, 3), transformFn = _matches2[1], transformFnValue = _matches2[2];
return getRotationInDegrees(transformFn, transformFnValue);
}
function getRotationInDegrees(transformFunction, transformFnValue) {
switch (transformFunction) {
case 'rotate':
case 'rotateZ':
return getAngleInDegrees(transformFnValue);
case 'rotate3d':
var _transformFnValue$spl = transformFnValue.split(',').map(function(value) {
return value.trim();
}), _transformFnValue$spl2 = _slicedToArray(_transformFnValue$spl, 4), z = _transformFnValue$spl2[2], angleWithUnit = _transformFnValue$spl2[3];
if (parseInt(z) === 0) {
return;
}
return getAngleInDegrees(angleWithUnit);
case 'matrix':
case 'matrix3d':
return getAngleInDegreesFromMatrixTransform(transformFnValue);
default:
return 0;
}
}
function getAngleInDegrees(angleWithUnit) {
var _ref155 = angleWithUnit.match(/(deg|grad|rad|turn)/) || [], _ref156 = _slicedToArray(_ref155, 1), unit = _ref156[0];
if (!unit) {
return 0;
}
var angle = parseFloat(angleWithUnit.replace(unit, ''));
switch (unit) {
case 'rad':
return convertRadToDeg(angle);
case 'grad':
return convertGradToDeg(angle);
case 'turn':
return convertTurnToDeg(angle);
case 'deg':
default:
return parseInt(angle);
}
}
function getAngleInDegreesFromMatrixTransform(transformFnValue) {
var values2 = transformFnValue.split(',');
if (values2.length <= 6) {
var _values = _slicedToArray(values2, 2), a2 = _values[0], b4 = _values[1];
var radians = Math.atan2(parseFloat(b4), parseFloat(a2));
return convertRadToDeg(radians);
}
var sinB = parseFloat(values2[8]);
var b3 = Math.asin(sinB);
var cosB = Math.cos(b3);
var rotateZRadians = Math.acos(parseFloat(values2[0]) / cosB);
return convertRadToDeg(rotateZRadians);
}
function convertRadToDeg(radians) {
return Math.round(radians * (180 / Math.PI));
}
function convertGradToDeg(grad) {
grad = grad % 400;
if (grad < 0) {
grad += 400;
}
return Math.round(grad / 400 * 360);
}
function convertTurnToDeg(turn) {
return Math.round(360 / (1 / turn));
}
}
var css_orientation_lock_evaluate_default = cssOrientationLockEvaluate;
function noAutoplayAudioEvaluate(node, options) {
var hasControls = node.hasAttribute('controls');
if (node.hasAttribute('loop')) {
return hasControls;
}
if (!node.duration) {
console.warn('axe.utils.preloadMedia did not load metadata');
return void 0;
}
var _options$allowedDurat = options.allowedDuration, allowedDuration = _options$allowedDurat === void 0 ? 3 : _options$allowedDurat;
var playableDuration = getPlayableDuration(node);
if (playableDuration <= allowedDuration) {
return true;
}
if (!hasControls) {
return false;
}
return true;
function getPlayableDuration(elm) {
if (!elm.currentSrc) {
return 0;
}
var playbackRange = getPlaybackRange(elm.currentSrc);
if (!playbackRange) {
return Math.abs(elm.duration - (elm.currentTime || 0));
}
if (playbackRange.length === 1) {
return Math.abs(elm.duration - playbackRange[0]);
}
return Math.abs(playbackRange[1] - playbackRange[0]);
}
function getPlaybackRange(src) {
var match = src.match(/#t=(.*)/);
if (!match) {
return;
}
var _match = _slicedToArray(match, 2), value = _match[1];
var ranges = value.split(',');
return ranges.map(function(range2) {
if (/:/.test(range2)) {
return convertHourMinSecToSeconds(range2);
}
return parseFloat(range2);
});
}
function convertHourMinSecToSeconds(hhMmSs) {
var parts = hhMmSs.split(':');
var secs = 0;
var mins = 1;
while (parts.length > 0) {
secs += mins * parseInt(parts.pop(), 10);
mins *= 60;
}
return parseFloat(secs);
}
}
var no_autoplay_audio_evaluate_default = noAutoplayAudioEvaluate;
function frameTestedEvaluate(node, options) {
return options.isViolation ? false : void 0;
}
var frame_tested_evaluate_default = frameTestedEvaluate;
var joinStr = ' > ';
function frameTestedAfter(results) {
var iframes = {};
return results.filter(function(result) {
var frameResult = result.node.ancestry[result.node.ancestry.length - 1] !== 'html';
if (frameResult) {
var ancestry2 = result.node.ancestry.flat(Infinity).join(joinStr);
iframes[ancestry2] = result;
return true;
}
var ancestry = result.node.ancestry.slice(0, result.node.ancestry.length - 1).flat(Infinity).join(joinStr);
if (iframes[ancestry]) {
iframes[ancestry].result = true;
}
return false;
});
}
var frame_tested_after_default = frameTestedAfter;
function captionEvaluate(node, options, virtualNode) {
var tracks = query_selector_all_default(virtualNode, 'track');
var hasCaptions = tracks.some(function(vNode) {
return (vNode.attr('kind') || '').toLowerCase() === 'captions';
});
return hasCaptions ? false : void 0;
}
var caption_evaluate_default = captionEvaluate;
function structuredDlitemsEvaluate(node, options, virtualNode) {
var children = virtualNode.children;
if (!children || !children.length) {
return false;
}
var hasDt = false, hasDd = false, nodeName2;
for (var _i35 = 0; _i35 < children.length; _i35++) {
nodeName2 = children[_i35].props.nodeName.toUpperCase();
if (nodeName2 === 'DT') {
hasDt = true;
}
if (hasDt && nodeName2 === 'DD') {
return false;
}
if (nodeName2 === 'DD') {
hasDd = true;
}
}
return hasDt || hasDd;
}
var structured_dlitems_evaluate_default = structuredDlitemsEvaluate;
function onlyListitemsEvaluate(node, options, virtualNode) {
var hasNonEmptyTextNode = false;
var atLeastOneListitem = false;
var isEmpty2 = true;
var badNodes = [];
var badRoleNodes = [];
var badRoles = [];
virtualNode.children.forEach(function(vNode) {
var actualNode = vNode.actualNode;
if (actualNode.nodeType === 3 && actualNode.nodeValue.trim() !== '') {
hasNonEmptyTextNode = true;
return;
}
if (actualNode.nodeType !== 1 || !_isVisibleToScreenReaders(actualNode)) {
return;
}
isEmpty2 = false;
var isLi = actualNode.nodeName.toUpperCase() === 'LI';
var role = get_role_default(vNode);
var isListItemRole = role === 'listitem';
if (!isLi && !isListItemRole) {
badNodes.push(actualNode);
}
if (isLi && !isListItemRole) {
badRoleNodes.push(actualNode);
if (!badRoles.includes(role)) {
badRoles.push(role);
}
}
if (isListItemRole) {
atLeastOneListitem = true;
}
});
if (hasNonEmptyTextNode || badNodes.length) {
this.relatedNodes(badNodes);
return true;
}
if (isEmpty2 || atLeastOneListitem) {
return false;
}
this.relatedNodes(badRoleNodes);
this.data({
messageKey: 'roleNotValid',
roles: badRoles.join(', ')
});
return true;
}
var only_listitems_evaluate_default = onlyListitemsEvaluate;
function onlyDlitemsEvaluate(node, options, virtualNode) {
var ALLOWED_ROLES = [ 'definition', 'term', 'list' ];
var base = {
badNodes: [],
hasNonEmptyTextNode: false
};
var content = virtualNode.children.reduce(function(vNodes, child) {
var actualNode = child.actualNode;
if (actualNode.nodeName.toUpperCase() === 'DIV' && get_role_default(actualNode) === null) {
return vNodes.concat(child.children);
}
return vNodes.concat(child);
}, []);
var result = content.reduce(function(out, childNode) {
var actualNode = childNode.actualNode;
var tagName = actualNode.nodeName.toUpperCase();
if (actualNode.nodeType === 1 && _isVisibleToScreenReaders(actualNode)) {
var explicitRole2 = get_explicit_role_default(actualNode);
if (tagName !== 'DT' && tagName !== 'DD' || explicitRole2) {
if (!ALLOWED_ROLES.includes(explicitRole2)) {
out.badNodes.push(actualNode);
}
}
} else if (actualNode.nodeType === 3 && actualNode.nodeValue.trim() !== '') {
out.hasNonEmptyTextNode = true;
}
return out;
}, base);
if (result.badNodes.length) {
this.relatedNodes(result.badNodes);
}
return !!result.badNodes.length || result.hasNonEmptyTextNode;
}
function listitemEvaluate(node, options, virtualNode) {
var parent = virtualNode.parent;
if (!parent) {
return void 0;
}
var parentExplicitRole = get_explicit_role_default(parent);
var parentRole = get_role_default(parent);
if ([ 'presentation', 'none', 'list' ].includes(parentRole)) {
return true;
}
if (parentExplicitRole && is_valid_role_default(parentExplicitRole)) {
this.data({
messageKey: 'roleNotValid'
});
}
return false;
}
function invalidChildrenEvaluate(node) {
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var virtualNode = arguments.length > 2 ? arguments[2] : undefined;
var relatedNodes = [];
var issues = [];
if (!virtualNode.children) {
return void 0;
}
var vChildren = mapWithNested(virtualNode.children);
while (vChildren.length) {
var _vChild$actualNode;
var _vChildren$shift = vChildren.shift(), vChild = _vChildren$shift.vChild, nested = _vChildren$shift.nested;
if (options.divGroups && !nested && isDivGroup(vChild)) {
if (!vChild.children) {
return void 0;
}
var vGrandChildren = mapWithNested(vChild.children, true);
vChildren.push.apply(vChildren, _toConsumableArray(vGrandChildren));
continue;
}
var issue = getInvalidSelector(vChild, nested, options);
if (!issue) {
continue;
}
if (!issues.includes(issue)) {
issues.push(issue);
}
if ((vChild === null || vChild === void 0 || (_vChild$actualNode = vChild.actualNode) === null || _vChild$actualNode === void 0 ? void 0 : _vChild$actualNode.nodeType) === 1) {
relatedNodes.push(vChild.actualNode);
}
}
if (issues.length === 0) {
return false;
}
this.data({
values: issues.join(', ')
});
this.relatedNodes(relatedNodes);
return true;
}
function getInvalidSelector(vChild, nested, _ref157) {
var _ref157$validRoles = _ref157.validRoles, validRoles = _ref157$validRoles === void 0 ? [] : _ref157$validRoles, _ref157$validNodeName = _ref157.validNodeNames, validNodeNames = _ref157$validNodeName === void 0 ? [] : _ref157$validNodeName;
var _vChild$props = vChild.props, nodeName2 = _vChild$props.nodeName, nodeType = _vChild$props.nodeType, nodeValue = _vChild$props.nodeValue;
var selector = nested ? 'div > ' : '';
if (nodeType === 3 && nodeValue.trim() !== '') {
return selector + '#text';
}
if (nodeType !== 1 || !_isVisibleToScreenReaders(vChild)) {
return false;
}
var explicitRole2 = get_explicit_role_default(vChild);
var role = get_role_default(vChild);
if (explicitRole2) {
return validRoles.includes(explicitRole2) ? false : selector + '[role='.concat(role, ']');
} else {
return validNodeNames.includes(nodeName2) || validRoles.includes(role) ? false : selector + nodeName2;
}
}
function isDivGroup(vNode) {
return vNode.props.nodeName === 'div' && get_explicit_role_default(vNode) === null;
}
function mapWithNested(vNodes) {
var nested = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
return vNodes.map(function(vChild) {
return {
vChild: vChild,
nested: nested
};
});
}
function dlitemEvaluate(node) {
var parent = get_composed_parent_default(node);
var parentTagName = parent.nodeName.toUpperCase();
var parentRole = get_explicit_role_default(parent);
if (parentTagName === 'DIV' && [ 'presentation', 'none', null ].includes(parentRole)) {
parent = get_composed_parent_default(parent);
parentTagName = parent.nodeName.toUpperCase();
parentRole = get_explicit_role_default(parent);
}
if (parentTagName !== 'DL') {
return false;
}
if (!parentRole || [ 'presentation', 'none', 'list' ].includes(parentRole)) {
return true;
}
return false;
}
var dlitem_evaluate_default = dlitemEvaluate;
function xmlLangMismatchEvaluate(node, options, vNode) {
var primaryLangValue = get_base_lang_default(vNode.attr('lang'));
var primaryXmlLangValue = get_base_lang_default(vNode.attr('xml:lang'));
return primaryLangValue === primaryXmlLangValue;
}
var xml_lang_mismatch_evaluate_default = xmlLangMismatchEvaluate;
function validLangEvaluate(node, options, virtualNode) {
var invalid = [];
options.attributes.forEach(function(langAttr) {
var langVal = virtualNode.attr(langAttr);
if (typeof langVal !== 'string') {
return;
}
var baselangVal = get_base_lang_default(langVal);
var invalidLang = options.value ? !options.value.map(get_base_lang_default).includes(baselangVal) : !valid_langs_default(baselangVal);
if (baselangVal !== '' && invalidLang || langVal !== '' && !sanitize_default(langVal)) {
invalid.push(langAttr + '="' + virtualNode.attr(langAttr) + '"');
}
});
if (!invalid.length) {
return false;
}
if (virtualNode.props.nodeName !== 'html' && !_hasLangText(virtualNode)) {
return false;
}
this.data(invalid);
return true;
}
var valid_lang_evaluate_default = validLangEvaluate;
function hasValue(value) {
return (value || '').trim() !== '';
}
function hasLangEvaluate(node, options, virtualNode) {
var xhtml = typeof document !== 'undefined' ? is_xhtml_default(document) : false;
if (options.attributes.includes('xml:lang') && options.attributes.includes('lang') && hasValue(virtualNode.attr('xml:lang')) && !hasValue(virtualNode.attr('lang')) && !xhtml) {
this.data({
messageKey: 'noXHTML'
});
return false;
}
var hasLang = options.attributes.some(function(name) {
return hasValue(virtualNode.attr(name));
});
if (!hasLang) {
this.data({
messageKey: 'noLang'
});
return false;
}
return true;
}
var has_lang_evaluate_default = hasLangEvaluate;
function landmarkIsUniqueEvaluate(node, options, virtualNode) {
var role = get_role_default(node);
var accessibleText2 = _accessibleTextVirtual(virtualNode);
accessibleText2 = accessibleText2 ? accessibleText2.toLowerCase() : null;
this.data({
role: role,
accessibleText: accessibleText2
});
this.relatedNodes([ node ]);
return true;
}
var landmark_is_unique_evaluate_default = landmarkIsUniqueEvaluate;
function landmarkIsUniqueAfter(results) {
var uniqueLandmarks = [];
return results.filter(function(currentResult) {
var findMatch = function findMatch(someResult) {
return currentResult.data.role === someResult.data.role && currentResult.data.accessibleText === someResult.data.accessibleText;
};
var matchedResult = uniqueLandmarks.find(findMatch);
if (matchedResult) {
matchedResult.result = false;
matchedResult.relatedNodes.push(currentResult.relatedNodes[0]);
return false;
}
uniqueLandmarks.push(currentResult);
currentResult.relatedNodes = [];
return true;
});
}
var landmark_is_unique_after_default = landmarkIsUniqueAfter;
function titleOnlyEvaluate(node, options, virtualNode) {
var labelText2 = label_virtual_default2(virtualNode);
var title = title_text_default(virtualNode);
var ariaDescribedBy = _getAriaValue(virtualNode, 'aria-describedby').value;
return !labelText2 && !!(title || ariaDescribedBy);
}
var title_only_evaluate_default = titleOnlyEvaluate;
function multipleLabelEvaluate(node, options, virtualNode) {
var id = escape_selector_default(virtualNode.attr('id'));
var parent = node.parentNode;
var root = get_root_node_default2(node);
root = root.documentElement || root;
var labels = Array.from(root.querySelectorAll('label[for="'.concat(id, '"]')));
if (labels.length) {
labels = labels.filter(function(label3) {
return !_isHiddenForEveryone(label3);
});
}
while (parent) {
if (parent.nodeName.toUpperCase() === 'LABEL' && labels.indexOf(parent) === -1) {
labels.push(parent);
}
parent = parent.parentNode;
}
this.relatedNodes(labels);
if (labels.length > 1) {
var ATVisibleLabels = labels.filter(function(label3) {
return _isVisibleToScreenReaders(label3);
});
if (ATVisibleLabels.length > 1) {
return void 0;
}
var labelledby = _getResolvedRefs(node, 'aria-labelledby');
return !labelledby.some(function(ref) {
return (ref === null || ref === void 0 ? void 0 : ref.actualNode) === ATVisibleLabels[0];
}) ? void 0 : false;
}
return false;
}
var multiple_label_evaluate_default = multipleLabelEvaluate;
var NON_LETTER_OR_NUMBER = /(?:[\0-\/:-@\[-`\{-\xA9\xAB-\xB1\xB4\xB6-\xB8\xBB\xBF\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u036F\u0375\u0378\u0379\u037E\u0380-\u0385\u0387\u038B\u038D\u03A2\u03F6\u0482-\u0489\u0530\u0557\u0558\u055A-\u055F\u0589-\u05CF\u05EB-\u05EE\u05F3-\u061F\u064B-\u065F\u066A-\u066D\u0670\u06D4\u06D6-\u06E4\u06E7-\u06ED\u06FD\u06FE\u0700-\u070F\u0711\u0730-\u074C\u07A6-\u07B0\u07B2-\u07BF\u07EB-\u07F3\u07F6-\u07F9\u07FB-\u07FF\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u083F\u0859-\u085F\u086B-\u086F\u0888\u0890-\u089F\u08CA-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962-\u0965\u0970\u0981-\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA-\u09BC\u09BE-\u09CD\u09CF-\u09DB\u09DE\u09E2-\u09E5\u09F2\u09F3\u09FA\u09FB\u09FD-\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A-\u0A58\u0A5D\u0A5F-\u0A65\u0A70\u0A71\u0A75-\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA-\u0ABC\u0ABE-\u0ACF\u0AD1-\u0ADF\u0AE2-\u0AE5\u0AF0-\u0AF8\u0AFA-\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A-\u0B3C\u0B3E-\u0B5B\u0B5E\u0B62-\u0B65\u0B70\u0B78-\u0B82\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BCF\u0BD1-\u0BE5\u0BF3-\u0C04\u0C0D\u0C11\u0C29\u0C3A-\u0C3C\u0C3E-\u0C57\u0C5B\u0C5E\u0C5F\u0C62-\u0C65\u0C70-\u0C77\u0C7F\u0C81-\u0C84\u0C8D\u0C91\u0CA9\u0CB4\u0CBA-\u0CBC\u0CBE-\u0CDB\u0CDF\u0CE2-\u0CE5\u0CF0\u0CF3-\u0D03\u0D0D\u0D11\u0D3B\u0D3C\u0D3E-\u0D4D\u0D4F-\u0D53\u0D57\u0D62-\u0D65\u0D79\u0D80-\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0DE5\u0DF0-\u0E00\u0E31\u0E34-\u0E3F\u0E47-\u0E4F\u0E5A-\u0E80\u0E83\u0E85\u0E8B\u0EA4\u0EA6\u0EB1\u0EB4-\u0EBC\u0EBE\u0EBF\u0EC5\u0EC7-\u0ECF\u0EDA\u0EDB\u0EE0-\u0EFF\u0F01-\u0F1F\u0F34-\u0F3F\u0F48\u0F6D-\u0F87\u0F8D-\u0FFF\u102B-\u103E\u104A-\u104F\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109F\u10C6\u10C8-\u10CC\u10CE\u10CF\u10FB\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B-\u1368\u137D-\u137F\u1390-\u139F\u13F6\u13F7\u13FE-\u1400\u166D\u166E\u1680\u169B-\u169F\u16EB-\u16ED\u16F9-\u16FF\u1712-\u171E\u1732-\u173F\u1752-\u175F\u176D\u1771-\u177F\u17B4-\u17D6\u17D8-\u17DB\u17DD-\u17DF\u17EA-\u17EF\u17FA-\u180F\u181A-\u181F\u1879-\u187F\u1885\u1886\u18A9\u18AB-\u18AF\u18F6-\u18FF\u191F-\u1945\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DB-\u19FF\u1A17-\u1A1F\u1A55-\u1A7F\u1A8A-\u1A8F\u1A9A-\u1AA6\u1AA8-\u1B04\u1B34-\u1B44\u1B4D-\u1B4F\u1B5A-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BFF\u1C24-\u1C3F\u1C4A-\u1C4C\u1C7E\u1C7F\u1C8B-\u1C8F\u1CBB\u1CBC\u1CC0-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1CFB-\u1CFF\u1DC0-\u1DFF\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FBD\u1FBF-\u1FC1\u1FC5\u1FCD-\u1FCF\u1FD4\u1FD5\u1FDC-\u1FDF\u1FED-\u1FF1\u1FF5\u1FFD-\u206F\u2072\u2073\u207A-\u207E\u208A-\u208F\u209D-\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A-\u245F\u249C-\u24E9\u2500-\u2775\u2794-\u2BFF\u2CE5-\u2CEA\u2CEF-\u2CF1\u2CF4-\u2CFC\u2CFE\u2CFF\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D70-\u2D7F\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF-\u2E2E\u2E30-\u3004\u3008-\u3020\u302A-\u3030\u3036\u3037\u303D-\u3040\u3097-\u309C\u30A0\u30FB\u3100-\u3104\u3130\u318F-\u3191\u3196-\u319F\u31C0-\u31EF\u3200-\u321F\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA48D-\uA4CF\uA4FE\uA4FF\uA60D-\uA60F\uA62C-\uA63F\uA66F-\uA67E\uA69E\uA69F\uA6F0-\uA716\uA720\uA721\uA789\uA78A\uA7DD-\uA7F0\uA802\uA806\uA80B\uA823-\uA82F\uA836-\uA83F\uA874-\uA881\uA8B4-\uA8CF\uA8DA-\uA8F1\uA8F8-\uA8FA\uA8FC\uA8FF\uA926-\uA92F\uA947-\uA95F\uA97D-\uA983\uA9B3-\uA9CE\uA9DA-\uA9DF\uA9E5\uA9FF\uAA29-\uAA3F\uAA43\uAA4C-\uAA4F\uAA5A-\uAA5F\uAA77-\uAA79\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAC3-\uAADA\uAADE\uAADF\uAAEB-\uAAF1\uAAF5-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F\uAB5B\uAB6A-\uAB6F\uABE3-\uABEF\uABFA-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uD7FF\uE000-\uF8FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB1E\uFB29\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBB2-\uFBD2\uFD3E-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFC-\uFE6F\uFE75\uFEFD-\uFF0F\uFF1A-\uFF20\uFF3B-\uFF40\uFF5B-\uFF65\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFFF]|\uD800[\uDC0C\uDC27\uDC3B\uDC3E\uDC4E\uDC4F\uDC5E-\uDC7F\uDCFB-\uDD06\uDD34-\uDD3F\uDD79-\uDD89\uDD8C-\uDE7F\uDE9D-\uDE9F\uDED1-\uDEE0\uDEFC-\uDEFF\uDF24-\uDF2C\uDF4B-\uDF4F\uDF76-\uDF7F\uDF9E\uDF9F\uDFC4-\uDFC7\uDFD0\uDFD6-\uDFFF]|\uD801[\uDC9E\uDC9F\uDCAA-\uDCAF\uDCD4-\uDCD7\uDCFC-\uDCFF\uDD28-\uDD2F\uDD64-\uDD6F\uDD7B\uDD8B\uDD93\uDD96\uDDA2\uDDB2\uDDBA\uDDBD-\uDDBF\uDDF4-\uDDFF\uDF37-\uDF3F\uDF56-\uDF5F\uDF68-\uDF7F\uDF86\uDFB1\uDFBB-\uDFFF]|\uD802[\uDC06\uDC07\uDC09\uDC36\uDC39-\uDC3B\uDC3D\uDC3E\uDC56\uDC57\uDC77\uDC78\uDC9F-\uDCA6\uDCB0-\uDCDF\uDCF3\uDCF6-\uDCFA\uDD1C-\uDD1F\uDD3A-\uDD3F\uDD5A-\uDD7F\uDDB8-\uDDBB\uDDD0\uDDD1\uDE01-\uDE0F\uDE14\uDE18\uDE36-\uDE3F\uDE49-\uDE5F\uDE7F\uDEA0-\uDEBF\uDEC8\uDEE5-\uDEEA\uDEF0-\uDEFF\uDF36-\uDF3F\uDF56\uDF57\uDF73-\uDF77\uDF92-\uDFA8\uDFB0-\uDFFF]|\uD803[\uDC49-\uDC7F\uDCB3-\uDCBF\uDCF3-\uDCF9\uDD24-\uDD2F\uDD3A-\uDD3F\uDD66-\uDD6E\uDD86-\uDE5F\uDE7F\uDEAA-\uDEAF\uDEB2-\uDEC1\uDEC8-\uDEFF\uDF28-\uDF2F\uDF46-\uDF50\uDF55-\uDF6F\uDF82-\uDFAF\uDFCC-\uDFDF\uDFF7-\uDFFF]|\uD804[\uDC00-\uDC02\uDC38-\uDC51\uDC70\uDC73\uDC74\uDC76-\uDC82\uDCB0-\uDCCF\uDCE9-\uDCEF\uDCFA-\uDD02\uDD27-\uDD35\uDD40-\uDD43\uDD45\uDD46\uDD48-\uDD4F\uDD73-\uDD75\uDD77-\uDD82\uDDB3-\uDDC0\uDDC5-\uDDCF\uDDDB\uDDDD-\uDDE0\uDDF5-\uDDFF\uDE12\uDE2C-\uDE3E\uDE41-\uDE7F\uDE87\uDE89\uDE8E\uDE9E\uDEA9-\uDEAF\uDEDF-\uDEEF\uDEFA-\uDF04\uDF0D\uDF0E\uDF11\uDF12\uDF29\uDF31\uDF34\uDF3A-\uDF3C\uDF3E-\uDF4F\uDF51-\uDF5C\uDF62-\uDF7F\uDF8A\uDF8C\uDF8D\uDF8F\uDFB6\uDFB8-\uDFD0\uDFD2\uDFD4-\uDFFF]|\uD805[\uDC35-\uDC46\uDC4B-\uDC4F\uDC5A-\uDC5E\uDC62-\uDC7F\uDCB0-\uDCC3\uDCC6\uDCC8-\uDCCF\uDCDA-\uDD7F\uDDAF-\uDDD7\uDDDC-\uDDFF\uDE30-\uDE43\uDE45-\uDE4F\uDE5A-\uDE7F\uDEAB-\uDEB7\uDEB9-\uDEBF\uDECA-\uDECF\uDEE4-\uDEFF\uDF1B-\uDF2F\uDF3C-\uDF3F\uDF47-\uDFFF]|\uD806[\uDC2C-\uDC9F\uDCF3-\uDCFE\uDD07\uDD08\uDD0A\uDD0B\uDD14\uDD17\uDD30-\uDD3E\uDD40\uDD42-\uDD4F\uDD5A-\uDD9F\uDDA8\uDDA9\uDDD1-\uDDE0\uDDE2\uDDE4-\uDDFF\uDE01-\uDE0A\uDE33-\uDE39\uDE3B-\uDE4F\uDE51-\uDE5B\uDE8A-\uDE9C\uDE9E-\uDEAF\uDEF9-\uDFBF\uDFE1-\uDFEF\uDFFA-\uDFFF]|\uD807[\uDC09\uDC2F-\uDC3F\uDC41-\uDC4F\uDC6D-\uDC71\uDC90-\uDCFF\uDD07\uDD0A\uDD31-\uDD45\uDD47-\uDD4F\uDD5A-\uDD5F\uDD66\uDD69\uDD8A-\uDD97\uDD99-\uDD9F\uDDAA-\uDDAF\uDDDC-\uDDDF\uDDEA-\uDEDF\uDEF3-\uDF01\uDF03\uDF11\uDF34-\uDF4F\uDF5A-\uDFAF\uDFB1-\uDFBF\uDFD5-\uDFFF]|\uD808[\uDF9A-\uDFFF]|\uD809[\uDC6F-\uDC7F\uDD44-\uDFFF]|[\uD80A\uD812-\uD817\uD819\uD824-\uD82A\uD82D\uD82E\uD830-\uD832\uD836\uD83D\uD83F\uD87C\uD87D\uD87F\uD88E-\uDBFF][\uDC00-\uDFFF]|\uD80B[\uDC00-\uDF8F\uDFF1-\uDFFF]|\uD80D[\uDC30-\uDC40\uDC47-\uDC5F]|\uD810[\uDFFB-\uDFFF]|\uD811[\uDE47-\uDFFF]|\uD818[\uDC00-\uDCFF\uDD1E-\uDD2F\uDD3A-\uDFFF]|\uD81A[\uDE39-\uDE3F\uDE5F\uDE6A-\uDE6F\uDEBF\uDECA-\uDECF\uDEEE-\uDEFF\uDF30-\uDF3F\uDF44-\uDF4F\uDF5A\uDF62\uDF78-\uDF7C\uDF90-\uDFFF]|\uD81B[\uDC00-\uDD3F\uDD6D-\uDD6F\uDD7A-\uDE3F\uDE97-\uDE9F\uDEB9\uDEBA\uDED4-\uDEFF\uDF4B-\uDF4F\uDF51-\uDF92\uDFA0-\uDFDF\uDFE2\uDFE4-\uDFF1\uDFF7-\uDFFF]|\uD823[\uDCD6-\uDCFE\uDD1F-\uDD7F\uDDF3-\uDFFF]|\uD82B[\uDC00-\uDFEF\uDFF4\uDFFC\uDFFF]|\uD82C[\uDD23-\uDD31\uDD33-\uDD4F\uDD53\uDD54\uDD56-\uDD63\uDD68-\uDD6F\uDEFC-\uDFFF]|\uD82F[\uDC6B-\uDC6F\uDC7D-\uDC7F\uDC89-\uDC8F\uDC9A-\uDFFF]|\uD833[\uDC00-\uDCEF\uDCFA-\uDFFF]|\uD834[\uDC00-\uDEBF\uDED4-\uDEDF\uDEF4-\uDF5F\uDF79-\uDFFF]|\uD835[\uDC55\uDC9D\uDCA0\uDCA1\uDCA3\uDCA4\uDCA7\uDCA8\uDCAD\uDCBA\uDCBC\uDCC4\uDD06\uDD0B\uDD0C\uDD15\uDD1D\uDD3A\uDD3F\uDD45\uDD47-\uDD49\uDD51\uDEA6\uDEA7\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3\uDFCC\uDFCD]|\uD837[\uDC00-\uDEFF\uDF1F-\uDF24\uDF2B-\uDFFF]|\uD838[\uDC00-\uDC2F\uDC6E-\uDCFF\uDD2D-\uDD36\uDD3E\uDD3F\uDD4A-\uDD4D\uDD4F-\uDE8F\uDEAE-\uDEBF\uDEEC-\uDEEF\uDEFA-\uDFFF]|\uD839[\uDC00-\uDCCF\uDCEC-\uDCEF\uDCFA-\uDDCF\uDDEE\uDDEF\uDDFB-\uDEBF\uDEDF\uDEE3\uDEE6\uDEEE\uDEEF\uDEF5-\uDEFD\uDF00-\uDFDF\uDFE7\uDFEC\uDFEF\uDFFF]|\uD83A[\uDCC5\uDCC6\uDCD0-\uDCFF\uDD44-\uDD4A\uDD4C-\uDD4F\uDD5A-\uDFFF]|\uD83B[\uDC00-\uDC70\uDCAC\uDCB0\uDCB5-\uDD00\uDD2E\uDD3E-\uDDFF\uDE04\uDE20\uDE23\uDE25\uDE26\uDE28\uDE33\uDE38\uDE3A\uDE3C-\uDE41\uDE43-\uDE46\uDE48\uDE4A\uDE4C\uDE50\uDE53\uDE55\uDE56\uDE58\uDE5A\uDE5C\uDE5E\uDE60\uDE63\uDE65\uDE66\uDE6B\uDE73\uDE78\uDE7D\uDE7F\uDE8A\uDE9C-\uDEA0\uDEA4\uDEAA\uDEBC-\uDFFF]|\uD83C[\uDC00-\uDCFF\uDD0D-\uDFFF]|\uD83E[\uDC00-\uDFEF\uDFFA-\uDFFF]|\uD869[\uDEE0-\uDEFF]|\uD86E[\uDC1E\uDC1F]|\uD873[\uDEAE\uDEAF]|\uD87A[\uDFE1-\uDFEF]|\uD87B[\uDE5E-\uDFFF]|\uD87E[\uDE1E-\uDFFF]|\uD884[\uDF4B-\uDF4F]|\uD88D[\uDC7A-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/g;
function isLabelContainedInName(label3, name) {
var labelTokens = curateTokens(label3);
if (!labelTokens.length) {
return true;
}
var nameTokens = curateTokens(name);
if (!nameTokens.length) {
return false;
}
return isContiguousSubsequence(nameTokens, labelTokens);
}
function removeParentheticals(str) {
var previous;
do {
previous = str;
str = str.replace(/\([^()]*\)/g, '');
} while (str !== previous);
return str;
}
function curateTokens(str) {
var text = str;
if (typeof text.normalize === 'function') {
text = text.normalize('NFKD');
}
text = removeParentheticals(text);
text = remove_unicode_default(text, {
emoji: true,
replaceWith: ' '
});
text = text.replace(NON_LETTER_OR_NUMBER, ' ');
return splitWords(sanitize_default(text));
}
var WORD_SEGMENTER = typeof ((_window$Intl = window.Intl) === null || _window$Intl === void 0 ? void 0 : _window$Intl.Segmenter) === 'function' ? new Intl.Segmenter(void 0, {
granularity: 'word'
}) : null;
function splitWords(text) {
if (!WORD_SEGMENTER) {
return text.split(/\s+/).filter(Boolean);
}
var words = [];
var _iterator30 = _createForOfIteratorHelper(WORD_SEGMENTER.segment(text)), _step30;
try {
for (_iterator30.s(); !(_step30 = _iterator30.n()).done; ) {
var segment = _step30.value.segment;
var trimmed = segment.trim();
if (trimmed) {
words.push(trimmed);
}
}
} catch (err) {
_iterator30.e(err);
} finally {
_iterator30.f();
}
return words;
}
function isContiguousSubsequence(haystack, needle) {
var _loop9 = function _loop9(_i36) {
if (needle.every(function(word, j) {
return word === haystack[_i36 + j];
})) {
return {
v: true
};
}
}, _ret4;
for (var _i36 = 0; _i36 + needle.length <= haystack.length; _i36++) {
_ret4 = _loop9(_i36);
if (_ret4) {
return _ret4.v;
}
}
return false;
}
function labelContentNameMismatchEvaluate(node, options, virtualNode) {
var _options$occurrenceTh, _options$valueTextRol;
var pixelThreshold = options === null || options === void 0 ? void 0 : options.pixelThreshold;
var occurrenceThreshold = (_options$occurrenceTh = options === null || options === void 0 ? void 0 : options.occurrenceThreshold) !== null && _options$occurrenceTh !== void 0 ? _options$occurrenceTh : options === null || options === void 0 ? void 0 : options.occuranceThreshold;
var accText = accessible_text_default(node).toLowerCase();
var visibleText = visible_virtual_default(virtualNode, false, false, {
ignoreIconLigature: true,
pixelThreshold: pixelThreshold,
occurrenceThreshold: occurrenceThreshold
}).toLowerCase();
if (!visibleText) {
return true;
}
if (is_human_interpretable_default(accText) < 1 || is_human_interpretable_default(visibleText) < 1) {
return void 0;
}
if (isLabelContainedInName(visibleText, accText)) {
return true;
}
var valueTextRoles = (_options$valueTextRol = options === null || options === void 0 ? void 0 : options.valueTextRoles) !== null && _options$valueTextRol !== void 0 ? _options$valueTextRol : [];
if (valueTextRoles.includes(get_role_default(virtualNode))) {
this.data({
messageKey: 'valueText'
});
return void 0;
}
return false;
}
var label_content_name_mismatch_evaluate_default = labelContentNameMismatchEvaluate;
function implicitEvaluate(node, options, virtualNode) {
try {
var label3 = closest_default(virtualNode, 'label');
if (label3) {
var implicitLabel = sanitize_default(_accessibleTextVirtual(label3, {
inControlContext: true,
startNode: virtualNode
}));
if (label3.actualNode) {
this.relatedNodes([ label3.actualNode ]);
}
this.data({
implicitLabel: implicitLabel
});
return !!implicitLabel;
}
return false;
} catch (_unused13) {
return void 0;
}
}
var implicit_evaluate_default = implicitEvaluate;
function hiddenExplicitLabelEvaluate(node, options, virtualNode) {
if (virtualNode.hasAttr('id')) {
if (!virtualNode.actualNode) {
return void 0;
}
var root = get_root_node_default2(node);
var _id6 = escape_selector_default(virtualNode.attr('id'));
var label3 = root.querySelector('label[for="'.concat(_id6, '"]'));
if (label3 && !_isVisibleToScreenReaders(label3)) {
var name;
try {
name = _accessibleTextVirtual(virtualNode).trim();
} catch (_unused14) {
return void 0;
}
var isNameEmpty = name === '';
return isNameEmpty;
}
}
return false;
}
var hidden_explicit_label_evaluate_default = hiddenExplicitLabelEvaluate;
function helpSameAsLabelEvaluate(node, options, virtualNode) {
var labelText2 = label_virtual_default2(virtualNode);
var check = virtualNode.attr('title');
if (!labelText2) {
return false;
}
if (!check) {
check = '';
if (_hasAriaValue(virtualNode, 'aria-describedby')) {
var ref = _getResolvedRefs(virtualNode, 'aria-describedby');
check = ref.map(function(vNode) {
return vNode ? _accessibleTextVirtual(vNode) : '';
}).join('');
}
}
return sanitize_default(check) === sanitize_default(labelText2);
}
var help_same_as_label_evaluate_default = helpSameAsLabelEvaluate;
function explicitEvaluate(node, options, virtualNode) {
var _this14 = this;
if (!virtualNode.attr('id')) {
return false;
}
if (!virtualNode.actualNode) {
return void 0;
}
var root = get_root_node_default2(virtualNode.actualNode);
var id = escape_selector_default(virtualNode.attr('id'));
var labels = Array.from(root.querySelectorAll('label[for="'.concat(id, '"]')));
this.relatedNodes(labels);
if (!labels.length) {
return false;
}
try {
return labels.some(function(label3) {
if (!_isVisibleOnScreen(label3)) {
return true;
} else {
var explicitLabel = sanitize_default(accessible_text_default(label3, {
inControlContext: true,
startNode: virtualNode
}));
_this14.data({
explicitLabel: explicitLabel
});
return !!explicitLabel;
}
});
} catch (_unused15) {
return void 0;
}
}
var explicit_evaluate_default = explicitEvaluate;
function duplicateImgLabelEvaluate(node, options, virtualNode) {
if ([ 'none', 'presentation' ].includes(get_role_default(virtualNode))) {
return false;
}
var parentVNode = closest_default(virtualNode, options.parentSelector);
if (!parentVNode) {
return false;
}
var visibleText = visible_virtual_default(parentVNode, true).toLowerCase();
if (visibleText === '') {
return false;
}
return visibleText === _accessibleTextVirtual(virtualNode).toLowerCase();
}
var duplicate_img_label_evaluate_default = duplicateImgLabelEvaluate;
function altSpaceValueEvaluate(node, options, virtualNode) {
if ([ 'presentation', 'none' ].includes(get_role_default(virtualNode))) {
return false;
}
var alt = virtualNode.attr('alt');
var isOnlySpace = /^\s+$/;
return typeof alt === 'string' && isOnlySpace.test(alt);
}
var alt_space_value_evaluate_default = altSpaceValueEvaluate;
function tabindexEvaluate(node, options, virtualNode) {
var tabIndex = parse_tabindex_default(virtualNode.attr('tabindex'));
return tabIndex === null || tabIndex <= 0;
}
var tabindex_evaluate_default = tabindexEvaluate;
function noFocusableContentEvaluate(node, options, virtualNode) {
if (!virtualNode.children) {
return void 0;
}
try {
var focusableDescendants2 = getFocusableDescendants(virtualNode);
if (!focusableDescendants2.length) {
return true;
}
var notHiddenElements = focusableDescendants2.filter(usesUnreliableHidingStrategy);
if (notHiddenElements.length > 0) {
this.data({
messageKey: 'notHidden'
});
this.relatedNodes(notHiddenElements);
} else {
this.relatedNodes(focusableDescendants2);
}
return false;
} catch (_unused16) {
return void 0;
}
}
function getFocusableDescendants(vNode) {
if (!vNode.children) {
if (vNode.props.nodeType === 1) {
throw new Error('Cannot determine children');
}
return [];
}
var retVal = [];
vNode.children.forEach(function(child) {
if (get_role_type_default(child) === 'widget' && _isFocusable(child)) {
retVal.push(child);
} else {
retVal.push.apply(retVal, _toConsumableArray(getFocusableDescendants(child)));
}
});
return retVal;
}
function usesUnreliableHidingStrategy(vNode) {
var tabIndex = parse_tabindex_default(vNode.attr('tabindex'));
return tabIndex !== null && tabIndex < 0;
}
function landmarkIsTopLevelEvaluate(node) {
var landmarks = get_aria_roles_by_type_default('landmark');
var parent = get_composed_parent_default(node);
var nodeRole = get_role_default(node);
this.data({
role: nodeRole
});
while (parent) {
var role = get_explicit_role_default(parent);
if (!role && parent.nodeName.toUpperCase() !== 'FORM') {
role = implicit_role_default(parent);
}
if (role && landmarks.includes(role) && !(role === 'main' && nodeRole === 'complementary')) {
return false;
}
parent = get_composed_parent_default(parent);
}
return true;
}
var landmark_is_top_level_evaluate_default = landmarkIsTopLevelEvaluate;
function frameFocusableContentEvaluate(node, options, virtualNode) {
if (!virtualNode.children) {
return void 0;
}
try {
return !virtualNode.children.some(function(child) {
return focusableDescendants(child);
});
} catch (_unused17) {
return void 0;
}
}
function focusableDescendants(vNode) {
if (_isInTabOrder(vNode)) {
return true;
}
if (!vNode.children) {
if (vNode.props.nodeType === 1) {
throw new Error('Cannot determine children');
}
return false;
}
return vNode.children.some(function(child) {
return focusableDescendants(child);
});
}
function focusableNotTabbableEvaluate(node, options, virtualNode) {
var elementsThatCanBeDisabled = [ 'button', 'fieldset', 'input', 'select', 'textarea' ];
var tabbableElements = virtualNode.tabbableElements;
if (!tabbableElements || !tabbableElements.length) {
return true;
}
var relatedNodes = tabbableElements.filter(function(vNode) {
return !elementsThatCanBeDisabled.includes(vNode.props.nodeName);
});
this.relatedNodes(relatedNodes.map(function(vNode) {
return vNode.actualNode;
}));
if (relatedNodes.length === 0 || is_modal_open_default()) {
return true;
}
return relatedNodes.every(function(vNode) {
var pointerEvents = vNode.getComputedStylePropertyValue('pointer-events');
var width = parseInt(vNode.getComputedStylePropertyValue('width'));
var height = parseInt(vNode.getComputedStylePropertyValue('height'));
return vNode.actualNode.onfocus || (width === 0 || height === 0) && pointerEvents === 'none';
}) ? void 0 : false;
}
var focusable_not_tabbable_evaluate_default = focusableNotTabbableEvaluate;
function focusableNoNameEvaluate(node, options, virtualNode) {
if (!_isInTabOrder(virtualNode)) {
return false;
}
try {
return !_accessibleTextVirtual(virtualNode);
} catch (_unused18) {
return void 0;
}
}
var focusable_no_name_evaluate_default = focusableNoNameEvaluate;
function focusableModalOpenEvaluate(node, options, virtualNode) {
var tabbableElements = virtualNode.tabbableElements.map(function(_ref158) {
var actualNode = _ref158.actualNode;
return actualNode;
});
if (!tabbableElements || !tabbableElements.length) {
return true;
}
if (is_modal_open_default()) {
this.relatedNodes(tabbableElements);
return void 0;
}
return true;
}
var focusable_modal_open_evaluate_default = focusableModalOpenEvaluate;
function focusableElementEvaluate(node, options, virtualNode) {
if (virtualNode.hasAttr('contenteditable') && isContenteditable(virtualNode)) {
return true;
}
return _isInTabOrder(virtualNode);
function isContenteditable(vNode) {
var contenteditable = vNode.attr('contenteditable');
if (contenteditable === 'true' || contenteditable === '') {
return true;
}
if (contenteditable === 'false') {
return false;
}
var ancestor = closest_default(virtualNode.parent, '[contenteditable]');
if (!ancestor) {
return false;
}
return isContenteditable(ancestor);
}
}
var focusable_element_evaluate_default = focusableElementEvaluate;
function focusableDisabledEvaluate(node, options, virtualNode) {
var elementsThatCanBeDisabled = [ 'button', 'fieldset', 'input', 'select', 'textarea' ];
var tabbableElements = virtualNode.tabbableElements;
if (!tabbableElements || !tabbableElements.length) {
return true;
}
var relatedNodes = tabbableElements.filter(function(vNode) {
return elementsThatCanBeDisabled.includes(vNode.props.nodeName);
});
this.relatedNodes(relatedNodes.map(function(vNode) {
return vNode.actualNode;
}));
if (relatedNodes.length === 0 || is_modal_open_default()) {
return true;
}
return relatedNodes.every(function(vNode) {
var pointerEvents = vNode.getComputedStylePropertyValue('pointer-events');
var width = parseInt(vNode.getComputedStylePropertyValue('width'));
var height = parseInt(vNode.getComputedStylePropertyValue('height'));
return vNode.actualNode.onfocus || (width === 0 || height === 0) && pointerEvents === 'none';
}) ? void 0 : false;
}
var focusable_disabled_evaluate_default = focusableDisabledEvaluate;
function focusableContentEvaluate(node, options, virtualNode) {
var _virtualNode$tabbable;
var tabbableContentElements = ((_virtualNode$tabbable = virtualNode.tabbableElements) !== null && _virtualNode$tabbable !== void 0 ? _virtualNode$tabbable : []).filter(function(el) {
return el !== virtualNode;
});
if (tabbableContentElements.length > 0) {
return true;
}
var tabindexContent = query_selector_all_default(virtualNode, '[tabindex]').filter(function(vNode) {
return vNode !== virtualNode && vNode.isFocusable;
});
if (tabindexContent.length === 0) {
return false;
}
this.relatedNodes(tabindexContent);
return void 0;
}
var focusable_content_evaluate_default = focusableContentEvaluate;
function accesskeysEvaluate(node, options, vNode) {
if (!_isHiddenForEveryone(vNode)) {
this.data(vNode.attr('accesskey'));
this.relatedNodes([ node ]);
}
return true;
}
var accesskeys_evaluate_default = accesskeysEvaluate;
function accesskeysAfter(results) {
var seen = {};
return results.filter(function(r) {
if (!r.data) {
return false;
}
var key = r.data.toUpperCase();
if (!seen[key]) {
seen[key] = r;
r.relatedNodes = [];
return true;
}
seen[key].relatedNodes.push(r.relatedNodes[0]);
return false;
}).map(function(r) {
r.result = !!r.relatedNodes.length;
return r;
});
}
var accesskeys_after_default = accesskeysAfter;
function pageNoDuplicateEvaluate(node, options, virtualNode) {
if (!options || !options.selector || typeof options.selector !== 'string') {
throw new TypeError('page-no-duplicate requires options.selector to be a string');
}
var key = 'page-no-duplicate;' + options.selector;
if (cache_default.get(key)) {
this.data('ignored');
return;
}
cache_default.set(key, true);
var elms = query_selector_all_filter_default(axe._tree[0], options.selector, function(elm) {
return _isVisibleToScreenReaders(elm);
});
if (typeof options.nativeScopeFilter === 'string') {
elms = elms.filter(function(elm) {
return elm.hasAttr('role') || !find_up_virtual_default(elm, options.nativeScopeFilter);
});
}
if (typeof options.role === 'string') {
elms = elms.filter(function(elm) {
return get_role_default(elm) === options.role;
});
}
this.relatedNodes(elms.filter(function(elm) {
return elm !== virtualNode;
}).map(function(elm) {
return elm.actualNode;
}));
return elms.length <= 1;
}
var page_no_duplicate_evaluate_default = pageNoDuplicateEvaluate;
function pageNoDuplicateAfter(results) {
return results.filter(function(checkResult) {
return checkResult.data !== 'ignored';
});
}
var page_no_duplicate_after_default = pageNoDuplicateAfter;
function matchesDefinitionEvaluate(_, options, virtualNode) {
return matches_default2(virtualNode, options.matcher);
}
var matches_definition_evaluate_default = matchesDefinitionEvaluate;
function hasTextContentEvaluate(node, options, virtualNode) {
try {
return sanitize_default(subtree_text_default(virtualNode)) !== '';
} catch (_unused19) {
return void 0;
}
}
function hasDescendant(node, options, virtualNode) {
if (!options || !options.selector || typeof options.selector !== 'string') {
throw new TypeError('has-descendant requires options.selector to be a string');
}
if (options.passForModal && is_modal_open_default()) {
return true;
}
var matchingElms = query_selector_all_filter_default(virtualNode, options.selector, function(vNode) {
return _isVisibleToScreenReaders(vNode);
});
this.relatedNodes(matchingElms.map(function(vNode) {
return vNode.actualNode;
}));
return matchingElms.length > 0;
}
var has_descendant_evaluate_default = hasDescendant;
function pageHasElmAfter(results) {
var elmUsedAnywhere = results.some(function(frameResult) {
return frameResult.result === true;
});
if (elmUsedAnywhere) {
results.forEach(function(result) {
result.result = true;
});
}
return results;
}
var has_descendant_after_default = pageHasElmAfter;
function attrNonSpaceContentEvaluate(node) {
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var vNode = arguments.length > 2 ? arguments[2] : undefined;
if (!options.attribute || typeof options.attribute !== 'string') {
throw new TypeError('attr-non-space-content requires options.attribute to be a string');
}
if (!vNode.hasAttr(options.attribute)) {
this.data({
messageKey: 'noAttr'
});
return false;
}
var attribute = vNode.attr(options.attribute);
var attributeIsEmpty = !sanitize_default(attribute);
if (attributeIsEmpty) {
this.data({
messageKey: 'emptyAttr'
});
return false;
}
return true;
}
var attr_non_space_content_evaluate_default = attrNonSpaceContentEvaluate;
function autocompleteValidEvaluate(_node, options, virtualNode) {
var autocomplete2 = virtualNode.attr('autocomplete') || '';
return is_valid_autocomplete_default(autocomplete2, options);
}
var autocomplete_valid_evaluate_default = autocompleteValidEvaluate;
function autocompleteAppropriateEvaluate(node, options, virtualNode) {
if (virtualNode.props.nodeName !== 'input') {
return true;
}
var number = [ 'text', 'search', 'number', 'tel' ];
var url = [ 'text', 'search', 'url' ];
var allowedTypesMap = {
bday: [ 'text', 'search', 'date' ],
email: [ 'text', 'search', 'email' ],
username: [ 'text', 'search', 'email' ],
'street-address': [ 'text' ],
tel: [ 'text', 'search', 'tel' ],
'tel-country-code': [ 'text', 'search', 'tel' ],
'tel-national': [ 'text', 'search', 'tel' ],
'tel-area-code': [ 'text', 'search', 'tel' ],
'tel-local': [ 'text', 'search', 'tel' ],
'tel-local-prefix': [ 'text', 'search', 'tel' ],
'tel-local-suffix': [ 'text', 'search', 'tel' ],
'tel-extension': [ 'text', 'search', 'tel' ],
'cc-number': number,
'cc-exp': [ 'text', 'search', 'month', 'tel' ],
'cc-exp-month': number,
'cc-exp-year': number,
'cc-csc': number,
'transaction-amount': number,
'bday-day': number,
'bday-month': number,
'bday-year': number,
'new-password': [ 'text', 'search', 'password' ],
'current-password': [ 'text', 'search', 'password' ],
url: url,
photo: url,
impp: url
};
if (_typeof(options) === 'object') {
Object.keys(options).forEach(function(key) {
if (!allowedTypesMap[key]) {
allowedTypesMap[key] = [];
}
allowedTypesMap[key] = allowedTypesMap[key].concat(options[key]);
});
}
var autocompleteAttr = virtualNode.attr('autocomplete');
var autocompleteTerms = autocompleteAttr.split(/\s+/g).map(function(term) {
return term.toLowerCase();
});
var purposeTerm = autocompleteTerms[autocompleteTerms.length - 1];
if (_autocomplete.stateTerms.includes(purposeTerm)) {
return true;
}
var allowedTypes = allowedTypesMap[purposeTerm];
var type2 = virtualNode.hasAttr('type') ? sanitize_default(virtualNode.attr('type')).toLowerCase() : 'text';
type2 = valid_input_type_default().includes(type2) ? type2 : 'text';
if (typeof allowedTypes === 'undefined') {
return type2 === 'text';
}
return allowedTypes.includes(type2);
}
var autocomplete_appropriate_evaluate_default = autocompleteAppropriateEvaluate;
var blockLike2 = [ 'block', 'list-item', 'table', 'flex', 'grid', 'inline-block' ];
function linkInTextBlockStyleEvaluate(node) {
if (isBlock2(node)) {
return false;
}
var parentBlock = get_composed_parent_default(node);
while (parentBlock && parentBlock.nodeType === 1 && !isBlock2(parentBlock)) {
parentBlock = get_composed_parent_default(parentBlock);
}
if (!parentBlock) {
return void 0;
}
this.relatedNodes([ parentBlock ]);
if (element_is_distinct_default(node, parentBlock)) {
return true;
}
if (hasPseudoContent(node)) {
this.data({
messageKey: 'pseudoContent'
});
return void 0;
}
return false;
}
function isBlock2(elm) {
var display2 = window.getComputedStyle(elm).getPropertyValue('display');
return blockLike2.indexOf(display2) !== -1 || display2.substr(0, 6) === 'table-';
}
function hasPseudoContent(node) {
for (var _i37 = 0, _arr3 = [ 'before', 'after' ]; _i37 < _arr3.length; _i37++) {
var pseudo = _arr3[_i37];
var style = window.getComputedStyle(node, ':'.concat(pseudo));
var content = style.getPropertyValue('content');
if (content !== 'none') {
return true;
}
}
return false;
}
function getContrast2(color1, color2) {
var c1lum = color1.getRelativeLuminance();
var c2lum = color2.getRelativeLuminance();
return (Math.max(c1lum, c2lum) + .05) / (Math.min(c1lum, c2lum) + .05);
}
var blockLike3 = [ 'block', 'list-item', 'table', 'flex', 'grid', 'inline-block' ];
function isBlock3(elm) {
var display2 = window.getComputedStyle(elm).getPropertyValue('display');
return blockLike3.indexOf(display2) !== -1 || display2.substr(0, 6) === 'table-';
}
function linkInTextBlockEvaluate(node, options) {
var requiredContrastRatio = options.requiredContrastRatio, allowSameColor = options.allowSameColor;
if (isBlock3(node)) {
return false;
}
var parentBlock = get_composed_parent_default(node);
while (parentBlock && parentBlock.nodeType === 1 && !isBlock3(parentBlock)) {
parentBlock = get_composed_parent_default(parentBlock);
}
if (!parentBlock) {
return void 0;
}
this.relatedNodes([ parentBlock ]);
var nodeColor = _getForegroundColor(node);
var parentColor = _getForegroundColor(parentBlock);
var nodeBackgroundColor = _getBackgroundColor2(node);
var parentBackgroundColor = _getBackgroundColor2(parentBlock);
var textContrast = nodeColor && parentColor ? getContrast2(nodeColor, parentColor) : void 0;
if (textContrast) {
textContrast = Math.floor(textContrast * 100) / 100;
}
if (textContrast && textContrast >= requiredContrastRatio) {
return true;
}
var backgroundContrast = nodeBackgroundColor && parentBackgroundColor ? getContrast2(nodeBackgroundColor, parentBackgroundColor) : void 0;
if (backgroundContrast) {
backgroundContrast = Math.floor(backgroundContrast * 100) / 100;
}
if (backgroundContrast && backgroundContrast >= requiredContrastRatio) {
return true;
}
if (!backgroundContrast) {
var _incomplete_data_defa;
var reason = (_incomplete_data_defa = incomplete_data_default.get('bgColor')) !== null && _incomplete_data_defa !== void 0 ? _incomplete_data_defa : 'bgContrast';
this.data({
messageKey: reason
});
incomplete_data_default.clear();
return void 0;
}
if (!textContrast) {
return void 0;
}
if (allowSameColor && textContrast === 1 && backgroundContrast === 1) {
return true;
}
if (textContrast === 1 && backgroundContrast > 1) {
this.data({
messageKey: 'bgContrast',
contrastRatio: backgroundContrast,
requiredContrastRatio: requiredContrastRatio,
nodeBackgroundColor: nodeBackgroundColor ? nodeBackgroundColor.toHexString() : void 0,
parentBackgroundColor: parentBackgroundColor ? parentBackgroundColor.toHexString() : void 0
});
return false;
}
this.data({
messageKey: 'fgContrast',
contrastRatio: textContrast,
requiredContrastRatio: requiredContrastRatio,
nodeColor: nodeColor ? nodeColor.toHexString() : void 0,
parentColor: parentColor ? parentColor.toHexString() : void 0
});
return false;
}
var link_in_text_block_evaluate_default = linkInTextBlockEvaluate;
function colorContrastEvaluate(node, options, virtualNode) {
var ignoreUnicode = options.ignoreUnicode, ignoreLength = options.ignoreLength, ignorePseudo = options.ignorePseudo, boldValue = options.boldValue, boldTextPt = options.boldTextPt, largeTextPt = options.largeTextPt, contrastRatio = options.contrastRatio, shadowOutlineEmMax = options.shadowOutlineEmMax, pseudoSizeThreshold = options.pseudoSizeThreshold;
if (!_isVisibleOnScreen(node)) {
this.data({
messageKey: 'hidden'
});
return true;
}
var visibleText = visible_virtual_default(virtualNode, false, true);
if (ignoreUnicode && textIsEmojis(visibleText)) {
this.data({
messageKey: 'nonBmp'
});
return void 0;
}
var nodeStyle = window.getComputedStyle(node);
var fontSize = parseFloat(nodeStyle.getPropertyValue('font-size'));
var fontWeight = nodeStyle.getPropertyValue('font-weight');
var bold = parseFloat(fontWeight) >= boldValue || fontWeight === 'bold';
var ptSize = Math.ceil(fontSize * 72) / 96;
var isSmallFont = bold && ptSize < boldTextPt || !bold && ptSize < largeTextPt;
var _ref159 = isSmallFont ? contrastRatio.normal : contrastRatio.large, expected = _ref159.expected, minThreshold = _ref159.minThreshold, maxThreshold = _ref159.maxThreshold;
var pseudoElm = findPseudoElement(virtualNode, {
ignorePseudo: ignorePseudo,
pseudoSizeThreshold: pseudoSizeThreshold
});
if (pseudoElm) {
this.data({
fontSize: ''.concat((fontSize * 72 / 96).toFixed(1), 'pt (').concat(fontSize, 'px)'),
fontWeight: bold ? 'bold' : 'normal',
messageKey: 'pseudoContent',
expectedContrastRatio: expected + ':1'
});
this.relatedNodes(pseudoElm.actualNode);
return void 0;
}
var shadowColors = _getTextShadowColors(node, {
minRatio: .001,
maxRatio: shadowOutlineEmMax
});
if (shadowColors === null) {
this.data({
messageKey: 'complexTextShadows'
});
return void 0;
}
var bgNodes = [];
var bgColor = _getBackgroundColor2(node, bgNodes, shadowOutlineEmMax);
var fgColor = _getForegroundColor(node, false, bgColor, options);
var contrast2 = null;
var contrastContributor = null;
var shadowColor = null;
if (shadowColors.length === 0) {
contrast2 = get_contrast_default(bgColor, fgColor);
} else if (fgColor && bgColor) {
shadowColor = [].concat(_toConsumableArray(shadowColors), [ bgColor ]).reduce(_flattenShadowColors);
var fgBgContrast = get_contrast_default(bgColor, fgColor);
var bgShContrast = get_contrast_default(bgColor, shadowColor);
var fgShContrast = get_contrast_default(shadowColor, fgColor);
contrast2 = Math.max(fgBgContrast, bgShContrast, fgShContrast);
if (contrast2 !== fgBgContrast) {
contrastContributor = bgShContrast > fgShContrast ? 'shadowOnBgColor' : 'fgOnShadowColor';
}
}
var isValid = contrast2 > expected;
if (typeof minThreshold === 'number' && (typeof contrast2 !== 'number' || contrast2 < minThreshold) || typeof maxThreshold === 'number' && (typeof contrast2 !== 'number' || contrast2 > maxThreshold)) {
this.data({
contrastRatio: contrast2
});
return true;
}
var truncatedResult = Math.floor(contrast2 * 100) / 100;
var missing;
var colorParse;
if (bgColor === null) {
if (incomplete_data_default.get('colorParse')) {
missing = 'colorParse';
colorParse = incomplete_data_default.get('colorParse');
} else {
missing = incomplete_data_default.get('bgColor');
}
} else if (!isValid) {
missing = contrastContributor;
}
if (fgColor === null && incomplete_data_default.get('colorParse')) {
missing = 'colorParse';
colorParse = incomplete_data_default.get('colorParse');
}
var equalRatio = truncatedResult === 1;
var shortTextContent = visibleText.length === 1;
var emptyValue = isEmptyTextEntry(virtualNode);
if (equalRatio) {
missing = incomplete_data_default.set('bgColor', 'equalRatio');
} else if (!isValid && shortTextContent && !ignoreLength) {
missing = 'shortTextContent';
} else if (!isValid && emptyValue) {
missing = 'emptyValue';
}
this.data({
fgColor: fgColor ? fgColor.toHexString() : void 0,
bgColor: bgColor ? bgColor.toHexString() : void 0,
contrastRatio: truncatedResult,
fontSize: ''.concat((fontSize * 72 / 96).toFixed(1), 'pt (').concat(fontSize, 'px)'),
fontWeight: bold ? 'bold' : 'normal',
messageKey: missing,
expectedContrastRatio: expected + ':1',
shadowColor: shadowColor ? shadowColor.toHexString() : void 0,
colorParse: colorParse
});
if (fgColor === null || bgColor === null || equalRatio || shortTextContent && !ignoreLength && !isValid || emptyValue && !isValid) {
missing = null;
incomplete_data_default.clear();
this.relatedNodes(bgNodes);
return void 0;
}
if (!isValid) {
this.relatedNodes(bgNodes);
}
return isValid;
}
function findPseudoElement(vNode, _ref160) {
var _ref160$pseudoSizeThr = _ref160.pseudoSizeThreshold, pseudoSizeThreshold = _ref160$pseudoSizeThr === void 0 ? .25 : _ref160$pseudoSizeThr, _ref160$ignorePseudo = _ref160.ignorePseudo, ignorePseudo = _ref160$ignorePseudo === void 0 ? false : _ref160$ignorePseudo;
if (ignorePseudo) {
return;
}
var rect = vNode.boundingClientRect;
var minimumSize = rect.width * rect.height * pseudoSizeThreshold;
do {
var beforeSize = getPseudoElementArea(vNode, ':before');
var afterSize = getPseudoElementArea(vNode, ':after');
if (beforeSize + afterSize > minimumSize) {
return vNode;
}
} while (vNode = vNode.parent);
}
var getPseudoElementArea = memoize_default(function getPseudoElementAreaMemoized(vNode, pseudo) {
var style = window.getComputedStyle(vNode.actualNode, pseudo);
var matchPseudoStyle = function matchPseudoStyle(prop, value) {
return style.getPropertyValue(prop) === value;
};
if (matchPseudoStyle('content', 'none') || matchPseudoStyle('display', 'none') || matchPseudoStyle('visibility', 'hidden') || matchPseudoStyle('position', 'absolute') === false) {
return 0;
}
if (get_own_background_color_default(style).alpha === 0 && matchPseudoStyle('background-image', 'none')) {
return 0;
}
var pseudoWidth = parseUnit(style.getPropertyValue('width'));
var pseudoHeight = parseUnit(style.getPropertyValue('height'));
if (pseudoWidth.unit !== 'px' || pseudoHeight.unit !== 'px') {
return pseudoWidth.value === 0 || pseudoHeight.value === 0 ? 0 : Infinity;
}
return pseudoWidth.value * pseudoHeight.value;
}, {
primitive: true
});
function textIsEmojis(visibleText) {
var options = {
nonBmp: true
};
var hasUnicodeChars = has_unicode_default(visibleText, options);
var hasNonUnicodeChars = sanitize_default(remove_unicode_default(visibleText, options)) === '';
return hasUnicodeChars && hasNonUnicodeChars;
}
function parseUnit(str) {
var unitRegex = /^([0-9.]+)([a-z]+)$/i;
var _ref161 = str.match(unitRegex) || [], _ref162 = _slicedToArray(_ref161, 3), _ref162$ = _ref162[1], value = _ref162$ === void 0 ? '' : _ref162$, _ref162$2 = _ref162[2], unit = _ref162$2 === void 0 ? '' : _ref162$2;
return {
value: parseFloat(value),
unit: unit.toLowerCase()
};
}
function isEmptyTextEntry(virtualNode) {
var _virtualNode$props = virtualNode.props, type2 = _virtualNode$props.type, value = _virtualNode$props.value;
if (!is_native_textbox_default(virtualNode) && type2 !== 'password') {
return false;
}
return sanitize_default(value) === '';
}
var VALID_TAG_NAMES_FOR_SCROLLABLE_REGIONS = {
ARTICLE: true,
ASIDE: true,
NAV: true,
SECTION: true
};
var VALID_ROLES_FOR_SCROLLABLE_REGIONS = {
alert: true,
alertdialog: true,
application: true,
article: true,
banner: false,
complementary: true,
contentinfo: true,
dialog: true,
form: true,
log: true,
main: true,
navigation: true,
region: true,
search: false,
status: true,
tabpanel: true
};
function validScrollableTagName(node) {
var nodeName2 = node.nodeName.toUpperCase();
return VALID_TAG_NAMES_FOR_SCROLLABLE_REGIONS[nodeName2] || false;
}
function validScrollableRole(node, options) {
var role = get_explicit_role_default(node);
if (!role) {
return false;
}
return VALID_ROLES_FOR_SCROLLABLE_REGIONS[role] || options.roles.includes(role) || false;
}
function validScrollableSemanticsEvaluate(node, options) {
return validScrollableRole(node, options) || validScrollableTagName(node);
}
var valid_scrollable_semantics_evaluate_default = validScrollableSemanticsEvaluate;
function unsupportedroleEvaluate(node, options, virtualNode) {
var role = get_role_default(virtualNode, {
dpub: true,
fallback: true
});
var isUnsupported = is_unsupported_role_default(role);
if (isUnsupported) {
this.data(role);
}
return isUnsupported;
}
var unsupportedrole_evaluate_default = unsupportedroleEvaluate;
function noImplicitExplicitLabelEvaluate(node, options, virtualNode) {
var role = get_role_default(virtualNode, {
noImplicit: true
});
this.data(role);
var label3;
var accText;
try {
label3 = sanitize_default(label_text_default(virtualNode)).toLowerCase();
accText = sanitize_default(_accessibleTextVirtual(virtualNode)).toLowerCase();
} catch (_unused20) {
return void 0;
}
if (!accText && !label3) {
return false;
}
if (!accText && label3) {
return void 0;
}
if (!accText.includes(label3)) {
return void 0;
}
return false;
}
var no_implicit_explicit_label_evaluate_default = noImplicitExplicitLabelEvaluate;
function isElementFocusableEvaluate(node, options, virtualNode) {
return _isFocusable(virtualNode);
}
var is_element_focusable_evaluate_default = isElementFocusableEvaluate;
function invalidroleEvaluate(node, options, virtualNode) {
var allRoles = token_list_default(virtualNode.attr('role'));
var allInvalid = allRoles.every(function(role) {
return !is_valid_role_default(role.toLowerCase(), {
allowAbstract: true
});
});
if (allInvalid) {
this.data(allRoles);
return true;
}
return false;
}
var invalidrole_evaluate_default = invalidroleEvaluate;
function hasWidgetRoleEvaluate(node, options, virtualNode) {
var role = get_explicit_role_default(virtualNode);
if (role === null) {
return false;
}
var roleType = get_role_type_default(role);
return roleType === 'widget' || roleType === 'composite';
}
var has_widget_role_evaluate_default = hasWidgetRoleEvaluate;
function hasGlobalAriaAttributeEvaluate(node, options, virtualNode) {
var globalAttrs = get_global_aria_attrs_default().filter(function(attr) {
return virtualNode.hasAttr(attr);
});
this.data(globalAttrs);
return globalAttrs.length > 0;
}
var has_global_aria_attribute_evaluate_default = hasGlobalAriaAttributeEvaluate;
function nonePresentationOnElementWithNoImplicitRole(virtualNode, explicitRoles) {
var hasImplicitRole = implicit_role_default(virtualNode);
return !hasImplicitRole && explicitRoles.length === 2 && explicitRoles.includes('none') && explicitRoles.includes('presentation');
}
function fallbackroleEvaluate(node, options, virtualNode) {
var explicitRoles = token_list_default(virtualNode.attr('role'));
if (explicitRoles.length <= 1) {
return false;
}
return nonePresentationOnElementWithNoImplicitRole(virtualNode, explicitRoles) ? void 0 : true;
}
var fallbackrole_evaluate_default = fallbackroleEvaluate;
function deprecatedroleEvaluate(node, options, virtualNode) {
var role = get_role_default(virtualNode, {
dpub: true,
fallback: true
});
var roleDefinition = standards_default.ariaRoles[role];
if (!(roleDefinition !== null && roleDefinition !== void 0 && roleDefinition.deprecated)) {
return false;
}
this.data(role);
return true;
}
function brailleRoleDescriptionEquivalentEvaluate(node, options, virtualNode) {
var _getAriaValue$value2, _getAriaValue$value3;
var brailleRoleDesc = (_getAriaValue$value2 = _getAriaValue(virtualNode, 'aria-brailleroledescription').value) !== null && _getAriaValue$value2 !== void 0 ? _getAriaValue$value2 : '';
if (sanitize_default(brailleRoleDesc) === '') {
return true;
}
var roleDesc = (_getAriaValue$value3 = _getAriaValue(virtualNode, 'aria-roledescription').value) !== null && _getAriaValue$value3 !== void 0 ? _getAriaValue$value3 : null;
if (typeof roleDesc !== 'string') {
this.data({
messageKey: 'noRoleDescription'
});
return false;
}
if (sanitize_default(roleDesc) === '') {
this.data({
messageKey: 'emptyRoleDescription'
});
return false;
}
return true;
}
function brailleLabelEquivalentEvaluate(node, options, virtualNode) {
var _getAriaValue$value4;
var brailleLabel = (_getAriaValue$value4 = _getAriaValue(virtualNode, 'aria-braillelabel').value) !== null && _getAriaValue$value4 !== void 0 ? _getAriaValue$value4 : '';
if (!brailleLabel.trim()) {
return true;
}
try {
return sanitize_default(_accessibleTextVirtual(virtualNode)) !== '';
} catch (_unused21) {
return void 0;
}
}
function ariaValidAttrValueEvaluate(node, options, virtualNode) {
options = Array.isArray(options.value) ? options.value : [];
var needsReview = '';
var messageKey = '';
var invalid = [];
var aria = /^aria-/;
var skipAttrs = [ 'aria-errormessage' ];
var preChecks = {
'aria-controls': function ariaControls() {
var _getAriaValue$value5;
var hasPopup = ![ 'false', null ].includes((_getAriaValue$value5 = _getAriaValue(virtualNode, 'aria-haspopup').value) !== null && _getAriaValue$value5 !== void 0 ? _getAriaValue$value5 : null);
if (hasPopup) {
needsReview = 'aria-controls="'.concat(_getAriaValue(virtualNode, 'aria-controls').value, '"');
messageKey = 'controlsWithinPopup';
}
return _getAriaValue(virtualNode, 'aria-expanded').value !== 'false' && _getAriaValue(virtualNode, 'aria-selected').value !== 'false' && hasPopup === false;
},
'aria-current': function ariaCurrent(validValue) {
if (!validValue) {
needsReview = 'aria-current="'.concat(_getAriaValue(virtualNode, 'aria-current').value, '"');
messageKey = 'ariaCurrent';
}
return;
},
'aria-owns': function ariaOwns() {
return _getAriaValue(virtualNode, 'aria-expanded').value !== 'false';
},
'aria-describedby': function ariaDescribedby(validValue) {
if (!validValue) {
needsReview = 'aria-describedby="'.concat(_getAriaValue(virtualNode, 'aria-describedby').value, '"');
messageKey = axe._tree && axe._tree[0]._hasShadowRoot ? 'noIdShadow' : 'noId';
}
return;
},
'aria-labelledby': function ariaLabelledby(validValue) {
if (!validValue) {
needsReview = 'aria-labelledby="'.concat(_getAriaValue(virtualNode, 'aria-labelledby').value, '"');
messageKey = axe._tree && axe._tree[0]._hasShadowRoot ? 'noIdShadow' : 'noId';
}
}
};
virtualNode.attrNames.forEach(function(attrName) {
if (skipAttrs.includes(attrName) || options.includes(attrName) || !aria.test(attrName)) {
return;
}
var validValue;
var attrValue = virtualNode.attr(attrName);
try {
validValue = validate_attr_value_default(virtualNode, attrName);
} catch (_unused22) {
needsReview = ''.concat(attrName, '="').concat(attrValue, '"');
messageKey = 'idrefs';
return;
}
if ((preChecks[attrName] ? preChecks[attrName](validValue) : true) && !validValue) {
if (attrValue === '' && !isStringType(attrName)) {
needsReview = attrName;
messageKey = 'empty';
} else {
invalid.push(''.concat(attrName, '="').concat(attrValue, '"'));
}
}
});
if (invalid.length) {
this.data(invalid);
return false;
}
if (needsReview) {
this.data({
messageKey: messageKey,
needsReview: needsReview
});
return void 0;
}
return true;
}
function isStringType(attrName) {
var _standards_default$ar2;
return ((_standards_default$ar2 = standards_default.ariaAttrs[attrName]) === null || _standards_default$ar2 === void 0 ? void 0 : _standards_default$ar2.type) === 'string';
}
function ariaValidAttrEvaluate(node, options, virtualNode) {
options = Array.isArray(options.value) ? options.value : [];
var invalid = [];
var aria = /^aria-/;
virtualNode.attrNames.forEach(function(attr) {
if (options.indexOf(attr) === -1 && aria.test(attr) && !validate_attr_default(attr)) {
invalid.push(attr);
}
});
if (invalid.length) {
this.data(invalid);
return false;
}
return true;
}
var aria_valid_attr_evaluate_default = ariaValidAttrEvaluate;
function ariaUnsupportedAttrEvaluate(node, options, virtualNode) {
var unsupportedAttrs = virtualNode.attrNames.filter(function(name) {
var attribute = standards_default.ariaAttrs[name];
if (!validate_attr_default(name)) {
return false;
}
var unsupported = attribute.unsupported;
if (_typeof(unsupported) !== 'object') {
return !!unsupported;
}
return !matches_default2(node, unsupported.exceptions);
});
if (unsupportedAttrs.length) {
this.data(unsupportedAttrs);
return true;
}
return false;
}
var aria_unsupported_attr_evaluate_default = ariaUnsupportedAttrEvaluate;
function ariaRoledescriptionEvaluate(node) {
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var virtualNode = arguments.length > 2 ? arguments[2] : undefined;
var role = get_role_default(virtualNode);
var supportedRoles = options.supportedRoles || [];
if (supportedRoles.includes(role)) {
return true;
}
if (role && role !== 'presentation' && role !== 'none') {
return void 0;
}
return false;
}
var aria_roledescription_evaluate_default = ariaRoledescriptionEvaluate;
function getMissingContext(virtualNode, ownGroupRoles, reqContext, includeElement) {
var explicitRole2 = get_explicit_role_default(virtualNode);
if (!reqContext) {
reqContext = required_context_default(explicitRole2);
}
if (!reqContext) {
return null;
}
var allowsGroup = reqContext.includes('group');
var vNode = includeElement ? virtualNode : virtualNode.parent;
while (vNode) {
var role = get_role_default(vNode, {
noPresentational: true
});
if (!role) {
vNode = vNode.parent;
} else if (role === 'group' && allowsGroup) {
if (ownGroupRoles.includes(explicitRole2)) {
reqContext.push(explicitRole2);
}
reqContext = reqContext.filter(function(r) {
return r !== 'group';
});
vNode = vNode.parent;
} else if (reqContext.includes(role)) {
return null;
} else {
return reqContext;
}
}
return reqContext;
}
function getAriaOwners(element) {
var owners = [];
var o = null;
while (element) {
if (element.getAttribute('id')) {
var _id7 = escape_selector_default(element.getAttribute('id'));
var doc = get_root_node_default2(element);
o = doc.querySelector('[aria-owns~='.concat(_id7, ']'));
if (o) {
owners.push(o);
}
}
element = element.parentElement;
}
return owners.length ? owners : null;
}
function ariaRequiredParentEvaluate(node, options, virtualNode) {
var ownGroupRoles = options && Array.isArray(options.ownGroupRoles) ? options.ownGroupRoles : [];
var missingParents = getMissingContext(virtualNode, ownGroupRoles);
if (!missingParents) {
return true;
}
var owners = getAriaOwners(node);
if (owners) {
for (var _i38 = 0, l = owners.length; _i38 < l; _i38++) {
missingParents = getMissingContext(get_node_from_tree_default(owners[_i38]), ownGroupRoles, missingParents, true);
if (!missingParents) {
return true;
}
}
}
this.data(missingParents);
return false;
}
var aria_required_parent_evaluate_default = ariaRequiredParentEvaluate;
var PRESENTATIONAL_ROLES = [ 'presentation', 'none' ];
function ariaRequiredChildrenEvaluate(node, options, virtualNode) {
var reviewEmpty = options && Array.isArray(options.reviewEmpty) ? options.reviewEmpty : [];
var explicitRole2 = get_explicit_role_default(virtualNode, {
dpub: true
});
var required = required_owned_default(explicitRole2);
if (required === null) {
return true;
}
var ownedRoles = getOwnedRoles(virtualNode, required);
var unallowed = ownedRoles.filter(function(_ref163) {
var role = _ref163.role, vNode = _ref163.vNode;
return vNode.props.nodeType === 1 && !required.includes(role) && !isAllowedInContext(role, explicitRole2);
});
if (unallowed.length) {
this.relatedNodes(unallowed.map(function(_ref164) {
var vNode = _ref164.vNode;
return vNode;
}));
var messageKey = 'unallowed';
var selectors = unallowed.map(function(_ref165) {
var vNode = _ref165.vNode, attr = _ref165.attr;
return getUnallowedSelector(vNode, attr);
});
if (_getAriaValue(virtualNode, 'aria-busy').value === 'true') {
messageKey = 'aria-busy-fail';
} else if (unallowed.every(isPresentationalConflict)) {
messageKey = 'unallowedPresentational';
selectors = unallowed.map(function(_ref166) {
var attr = _ref166.attr;
return '['.concat(attr, ']');
});
}
this.data({
messageKey: messageKey,
values: selectors.filter(function(selector, index, array) {
return array.indexOf(selector) === index;
}).join(', ')
});
return false;
}
if (hasRequiredChildren(required, ownedRoles)) {
return true;
}
if (_getAriaValue(virtualNode, 'aria-busy').value === 'true') {
this.data({
messageKey: 'aria-busy'
});
return true;
}
this.data(required);
if (reviewEmpty.includes(explicitRole2) && !ownedRoles.some(isContent)) {
return void 0;
}
return false;
}
function getOwnedRoles(virtualNode, required) {
var vNode;
var ownedRoles = [];
var ownedVirtual = get_owned_virtual_default(virtualNode);
var _loop0 = function _loop0() {
if (vNode.props.nodeType === 3) {
ownedRoles.push({
vNode: vNode,
role: null
});
}
if (vNode.props.nodeType !== 1 || !_isVisibleToScreenReaders(vNode)) {
return 1;
}
var role = get_role_default(vNode, {
noPresentational: true
});
var globalAriaAttr = getGlobalAriaAttr(vNode);
var hasGlobalAriaOrFocusable = !!globalAriaAttr || _isFocusable(vNode);
if (!role && !hasGlobalAriaOrFocusable || [ 'group', 'rowgroup' ].includes(role) && required.some(function(requiredRole) {
return requiredRole === role;
})) {
ownedVirtual.push.apply(ownedVirtual, _toConsumableArray(vNode.children));
} else if (role || hasGlobalAriaOrFocusable) {
var attr = globalAriaAttr || (vNode.hasAttr('tabindex') ? 'tabindex' : void 0);
ownedRoles.push({
role: role,
attr: attr,
vNode: vNode
});
}
};
while (vNode = ownedVirtual.shift()) {
if (_loop0()) {
continue;
}
}
return ownedRoles;
}
function isAllowedInContext(role, parentRole) {
var context = required_context_default(role);
return !!context && context.includes(parentRole);
}
function hasRequiredChildren(required, ownedRoles) {
return ownedRoles.some(function(_ref167) {
var role = _ref167.role;
return role && required.includes(role);
});
}
function getGlobalAriaAttr(vNode) {
return get_global_aria_attrs_default().find(function(attr) {
return vNode.hasAttr(attr);
});
}
function isPresentationalConflict(_ref168) {
var vNode = _ref168.vNode, attr = _ref168.attr;
return !!attr && !is_natively_focusable_default(vNode) && PRESENTATIONAL_ROLES.includes(get_explicit_role_default(vNode));
}
function getUnallowedSelector(vNode, attr) {
var _vNode$props = vNode.props, nodeName2 = _vNode$props.nodeName, nodeType = _vNode$props.nodeType;
if (nodeType === 3) {
return '#text';
}
var role = get_explicit_role_default(vNode, {
dpub: true
});
if (role && isPresentationalConflict({
vNode: vNode,
attr: attr
})) {
return '[role='.concat(role, '][').concat(attr, ']');
}
if (role) {
return '[role='.concat(role, ']');
}
if (attr) {
return nodeName2 + '['.concat(attr, ']');
}
return nodeName2;
}
function isContent(_ref169) {
var vNode = _ref169.vNode;
if (vNode.props.nodeType === 3) {
return vNode.props.nodeValue.trim().length > 0;
}
return has_content_virtual_default(vNode, false, true);
}
function ariaRequiredAttrEvaluate(node) {
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var virtualNode = arguments.length > 2 ? arguments[2] : undefined;
var role = get_explicit_role_default(virtualNode);
var attrs = virtualNode.attrNames;
var requiredAttrs = required_attr_default(role);
if (Array.isArray(options[role])) {
requiredAttrs = unique_array_default(options[role], requiredAttrs);
}
if (!role || !attrs.length || !requiredAttrs.length) {
return true;
}
if (isStaticSeparator(virtualNode, role) || isClosedCombobox(virtualNode, role)) {
return true;
}
if (role === 'slider' && _getAriaValue(virtualNode, 'aria-valuetext').value) {
return true;
}
var elmSpec = get_element_spec_default(virtualNode);
var missingAttrs = requiredAttrs.filter(function(requiredAttr2) {
return !_getAriaValue(virtualNode, requiredAttr2).value && !hasImplicitAttr(elmSpec, requiredAttr2);
});
if (missingAttrs.length) {
this.data(missingAttrs);
return false;
}
return true;
}
function isStaticSeparator(vNode, role) {
return role === 'separator' && !_isFocusable(vNode);
}
function hasImplicitAttr(elmSpec, attr) {
var _elmSpec$implicitAttr;
return ((_elmSpec$implicitAttr = elmSpec.implicitAttrs) === null || _elmSpec$implicitAttr === void 0 ? void 0 : _elmSpec$implicitAttr[attr]) !== void 0;
}
function isClosedCombobox(vNode, role) {
return role === 'combobox' && _getAriaValue(vNode, 'aria-expanded').value === 'false';
}
function ariaProhibitedAttrEvaluate(node) {
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var virtualNode = arguments.length > 2 ? arguments[2] : undefined;
var elementsAllowedAriaLabel = (options === null || options === void 0 ? void 0 : options.elementsAllowedAriaLabel) || [];
var nodeName2 = virtualNode.props.nodeName;
var role = get_role_default(virtualNode, {
fallback: true
});
var prohibitedList = listProhibitedAttrs(virtualNode, nodeName2, elementsAllowedAriaLabel);
var prohibited = prohibitedList.filter(function(attrName) {
if (!virtualNode.attrNames.includes(attrName)) {
return false;
}
return sanitize_default(virtualNode.attr(attrName)) !== '';
});
if (prohibited.length === 0) {
return false;
}
var labelledbyReviewKey = getLabelledbyReviewKey(virtualNode, prohibited);
if (labelledbyReviewKey) {
this.data({
role: role,
nodeName: nodeName2,
messageKey: labelledbyReviewKey,
prohibited: prohibited
});
return void 0;
}
var messageKey = role !== null ? 'hasRole' : 'noRole';
messageKey += prohibited.length > 1 ? 'Plural' : 'Singular';
this.data({
role: role,
nodeName: nodeName2,
messageKey: messageKey,
prohibited: prohibited
});
var textContent = subtree_text_default(virtualNode, {
subtreeDescendant: true
});
if (sanitize_default(textContent) !== '') {
return void 0;
}
return true;
}
function getLabelledbyReviewKey(vNode, prohibited) {
if (!vNode.actualNode || !prohibited.includes('aria-labelledby')) {
return null;
}
var otherProhibited = prohibited.filter(function(attr) {
return attr !== 'aria-label' && attr !== 'aria-labelledby';
});
if (otherProhibited.length) {
return null;
}
var hasProhibitedAriaLabel = prohibited.includes('aria-label');
var resolved = _getResolvedRefs(vNode, 'aria-labelledby').filter(Boolean);
if (resolved.length === 0) {
return hasProhibitedAriaLabel ? null : 'unresolvedLabel';
}
if (!resolved.every(function(ref) {
return _isVisibleToScreenReaders(ref);
})) {
return null;
}
if (hasProhibitedAriaLabel && sanitize_default(arialabelledby_text_default(vNode)) === '') {
return null;
}
return prohibited.length > 1 ? 'visibleLabelPlural' : 'visibleLabelSingular';
}
function listProhibitedAttrs(vNode, nodeName2, elementsAllowedAriaLabel) {
var explicitRole2 = get_explicit_role_default(vNode, {
fallback: true
});
if (explicitRole2) {
var roleSpec = standards_default.ariaRoles[explicitRole2];
return (roleSpec === null || roleSpec === void 0 ? void 0 : roleSpec.prohibitedAttrs) || [];
}
if (elementsAllowedAriaLabel.includes(nodeName2) || getClosestAncestorRoleType(vNode) === 'widget' || _isValidCustomElementName(nodeName2)) {
return [];
}
var htmlSpec = get_element_spec_default(vNode);
if (!standards_default.htmlElms[nodeName2] || htmlSpec.namingProhibited) {
return [ 'aria-label', 'aria-labelledby' ];
}
return [];
}
var getClosestAncestorRoleType = memoize_default(function getClosestAncestorRoleTypeMemoized(vNode) {
if (!vNode) {
return;
}
var role = get_role_default(vNode, {
noPresentational: true,
chromium: true
});
if (role) {
return get_role_type_default(role);
}
return getClosestAncestorRoleType(vNode.parent);
}, {
primitive: true
});
function ariaNoDeprecatedAttrEvaluate(node, options, virtualNode) {
var deprecatedAttrs = virtualNode.attrNames.filter(function(attrName) {
var _standards_default$ar3;
return (_standards_default$ar3 = standards_default.ariaAttrs[attrName]) === null || _standards_default$ar3 === void 0 ? void 0 : _standards_default$ar3.deprecated;
});
if (!deprecatedAttrs.length) {
return true;
}
this.data(deprecatedAttrs);
return void 0;
}
function ariaLevelEvaluate(node, options, virtualNode) {
var ariaHeadingLevel = _getAriaValue(virtualNode, 'aria-level').value;
var ariaLevel = parseInt(ariaHeadingLevel, 10);
if (ariaLevel > 6) {
return void 0;
}
return true;
}
var aria_level_evaluate_default = ariaLevelEvaluate;
function ariaHiddenBodyEvaluate(node, options, virtualNode) {
return _getAriaValue(virtualNode, 'aria-hidden').value !== 'true';
}
var aria_hidden_body_evaluate_default = ariaHiddenBodyEvaluate;
function ariaErrormessageEvaluate(node, options, virtualNode) {
options = Array.isArray(options) ? options : [];
var errorMessageAttr = _getAriaValue(virtualNode, 'aria-errormessage').value;
var hasAttr = _hasAriaValue(virtualNode, 'aria-errormessage');
var invaid = _getAriaValue(virtualNode, 'aria-invalid').value;
var hasInvallid = _hasAriaValue(virtualNode, 'aria-invalid');
if (!hasInvallid || invaid === 'false') {
return true;
}
function validateAttrValue2(attr) {
if (attr.trim() === '') {
return standards_default.ariaAttrs['aria-errormessage'].allowEmpty;
}
var errormessageTokens = token_list_default(attr);
if (errormessageTokens.length > 1) {
this.data({
messageKey: 'unsupported',
values: errormessageTokens
});
return false;
}
var idref;
try {
idref = _getResolvedRefs(virtualNode, 'aria-errormessage')[0];
} catch (_unused23) {
this.data({
messageKey: 'idrefs',
values: errormessageTokens
});
return void 0;
}
if (idref) {
var _getAriaValue$value6;
if (!_isVisibleToScreenReaders(idref)) {
this.data({
messageKey: 'hidden',
values: errormessageTokens
});
return false;
}
var describedbyTokens = token_list_default((_getAriaValue$value6 = _getAriaValue(virtualNode, 'aria-describedby').value) !== null && _getAriaValue$value6 !== void 0 ? _getAriaValue$value6 : '');
return get_explicit_role_default(idref) === 'alert' || _getAriaValue(idref, 'aria-live').value === 'assertive' || _getAriaValue(idref, 'aria-live').value === 'polite' || errormessageTokens.some(function(token) {
return describedbyTokens.includes(token);
});
}
return;
}
if (options.indexOf(errorMessageAttr) === -1 && hasAttr) {
this.data(token_list_default(errorMessageAttr));
return validateAttrValue2.call(this, errorMessageAttr);
}
return true;
}
function ariaConditionalRowAttr(node) {
var _invalidTableRowAttrs, _invalidTableRowAttrs2;
var _ref170 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, invalidTableRowAttrs = _ref170.invalidTableRowAttrs;
var virtualNode = arguments.length > 2 ? arguments[2] : undefined;
var invalidAttrs = (_invalidTableRowAttrs = invalidTableRowAttrs === null || invalidTableRowAttrs === void 0 || (_invalidTableRowAttrs2 = invalidTableRowAttrs.filter) === null || _invalidTableRowAttrs2 === void 0 ? void 0 : _invalidTableRowAttrs2.call(invalidTableRowAttrs, function(invalidAttr) {
return virtualNode.hasAttr(invalidAttr);
})) !== null && _invalidTableRowAttrs !== void 0 ? _invalidTableRowAttrs : [];
if (invalidAttrs.length === 0) {
return true;
}
var owner = getRowOwner(virtualNode);
var ownerRole = owner && get_role_default(owner);
if (!ownerRole || ownerRole === 'treegrid') {
return true;
}
var messageKey = 'row'.concat(invalidAttrs.length > 1 ? 'Plural' : 'Singular');
this.data({
messageKey: messageKey,
invalidAttrs: invalidAttrs,
ownerRole: ownerRole
});
return false;
}
function getRowOwner(virtualNode) {
if (!virtualNode.parent) {
return;
}
var rowOwnerQuery = 'table:not([role]), [role~="treegrid"], [role~="table"], [role~="grid"]';
return closest_default(virtualNode, rowOwnerQuery);
}
function ariaConditionalRadioAttr(node, options, virtualNode) {
var _virtualNode$props2 = virtualNode.props, nodeName2 = _virtualNode$props2.nodeName, type2 = _virtualNode$props2.type;
var ariaChecked = normalizeAriaChecked(virtualNode.attr('aria-checked'));
if (nodeName2 !== 'input' || type2 !== 'radio' || !ariaChecked) {
return true;
}
var checkState = getCheckState(virtualNode);
if (ariaChecked === checkState) {
return true;
}
this.data({
messageKey: 'radio',
checkState: checkState
});
return false;
}
function getCheckState(vNode) {
return vNode.props.checked ? 'true' : 'false';
}
function normalizeAriaChecked(ariaCheckedVal) {
if (!ariaCheckedVal) {
return '';
}
ariaCheckedVal = ariaCheckedVal.toLowerCase();
if (ariaCheckedVal === 'true') {
return ariaCheckedVal;
}
return 'false';
}
function ariaConditionalCheckboxAttr(node, options, virtualNode) {
var _virtualNode$props3 = virtualNode.props, nodeName2 = _virtualNode$props3.nodeName, type2 = _virtualNode$props3.type;
var ariaChecked = normalizeAriaChecked2(virtualNode.attr('aria-checked'));
if (nodeName2 !== 'input' || type2 !== 'checkbox' || !ariaChecked) {
return true;
}
var checkState = getCheckState2(virtualNode);
if (ariaChecked === checkState) {
return true;
}
this.data({
messageKey: 'checkbox',
checkState: checkState
});
return false;
}
function getCheckState2(vNode) {
if (vNode.props.indeterminate) {
return 'mixed';
}
return vNode.props.checked ? 'true' : 'false';
}
function normalizeAriaChecked2(ariaCheckedVal) {
if (!ariaCheckedVal) {
return '';
}
ariaCheckedVal = ariaCheckedVal.toLowerCase();
if ([ 'mixed', 'true' ].includes(ariaCheckedVal)) {
return ariaCheckedVal;
}
return 'false';
}
var conditionalRoleMap = {
row: ariaConditionalRowAttr,
checkbox: ariaConditionalCheckboxAttr,
radio: ariaConditionalRadioAttr
};
function ariaConditionalAttrEvaluate(node, options, virtualNode) {
var role = get_role_default(virtualNode);
if (!conditionalRoleMap[role]) {
return true;
}
return conditionalRoleMap[role].call(this, node, options, virtualNode);
}
function ariaBusyEvaluate(node, options, virtualNode) {
return _getAriaValue(virtualNode, 'aria-busy').value === 'true';
}
function ariaAllowedRoleEvaluate(node) {
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var virtualNode = arguments.length > 2 ? arguments[2] : undefined;
var _options$allowImplici = options.allowImplicit, allowImplicit = _options$allowImplici === void 0 ? true : _options$allowImplici, _options$ignoredTags = options.ignoredTags, ignoredTags = _options$ignoredTags === void 0 ? [] : _options$ignoredTags;
var nodeName2 = virtualNode.props.nodeName;
if (ignoredTags.map(function(tag) {
return tag.toLowerCase();
}).includes(nodeName2)) {
return true;
}
var unallowedRoles = get_element_unallowed_roles_default(virtualNode, allowImplicit);
if (unallowedRoles.length) {
this.data(unallowedRoles);
if (!_isVisibleToScreenReaders(virtualNode)) {
return void 0;
}
return false;
}
return true;
}
var aria_allowed_role_evaluate_default = ariaAllowedRoleEvaluate;
function ariaAllowedAttrEvaluate(node, options, virtualNode) {
var invalid = [];
var role = get_role_default(virtualNode);
var allowed = allowed_attr_default(role);
if (Array.isArray(options[role])) {
allowed = unique_array_default(options[role].concat(allowed));
}
var _iterator31 = _createForOfIteratorHelper(virtualNode.attrNames), _step31;
try {
for (_iterator31.s(); !(_step31 = _iterator31.n()).done; ) {
var _attrName = _step31.value;
if (validate_attr_default(_attrName) && !allowed.includes(_attrName) && !ignoredAttrs(_attrName, virtualNode.attr(_attrName), virtualNode)) {
invalid.push(_attrName);
}
}
} catch (err) {
_iterator31.e(err);
} finally {
_iterator31.f();
}
if (!invalid.length) {
var caseSensitiveFailures = [];
var caseSensitiveIncompletes = [];
var defaultValues = Object.keys(standards_default.ariaAttrs).reduce(function(values2, attrName) {
values2[attrName] = standards_default.ariaAttrs[attrName].defaultValue;
return values2;
}, {});
Object.assign(defaultValues, options.ariaFallbackValues || {});
var _iterator32 = _createForOfIteratorHelper(virtualNode.attrNames), _step32;
try {
for (_iterator32.s(); !(_step32 = _iterator32.n()).done; ) {
var attrName = _step32.value;
if (!validate_attr_default(attrName)) {
continue;
}
var attribute = standards_default.ariaAttrs[attrName];
if (!attribute || attribute.caseInsensitive !== false) {
continue;
}
var attrValue = virtualNode.attr(attrName);
if (!attrValue || attrValue === attrValue.toLowerCase()) {
continue;
}
var values2 = attrName + '="' + attrValue + '"';
if (attrValue.toLowerCase() === defaultValues[attrName]) {
caseSensitiveIncompletes.push(values2);
continue;
}
caseSensitiveFailures.push(values2);
}
} catch (err) {
_iterator32.e(err);
} finally {
_iterator32.f();
}
if (caseSensitiveFailures.length) {
this.data({
messageKey: 'caseSensitive',
values: caseSensitiveFailures
});
return false;
}
if (caseSensitiveIncompletes.length) {
this.data({
messageKey: 'caseSensitive',
values: caseSensitiveIncompletes
});
return void 0;
}
return true;
}
var invalidValues = invalid.map(function(attrName) {
return attrName + '="' + virtualNode.attr(attrName) + '"';
});
var isIncomplete = !role && !_isHtmlElement(virtualNode) && !_isFocusable(virtualNode);
this.data(_extends({}, !isIncomplete && {
messageKey: invalidValues.length === 1 ? 'singular' : 'plural'
}, {
values: invalidValues
}));
if (isIncomplete) {
return void 0;
}
return false;
}
function ignoredAttrs(attrName, attrValue, vNode) {
if (attrName === 'aria-required' && attrValue === 'false') {
return true;
}
if (attrName === 'aria-multiline' && attrValue === 'false' && vNode.hasAttr('contenteditable')) {
return true;
}
return false;
}
function ariaAllowedAttrElmEvaluate(node, options, virtualNode) {
var elmSpec = get_element_spec_default(virtualNode);
if (!elmSpec.allowedAriaAttrs) {
return true;
}
var explicitRole2 = get_explicit_role_default(virtualNode);
if (explicitRole2) {
return true;
}
var allowedAriaAttrs = elmSpec.allowedAriaAttrs;
var globalAriaAttrs = get_global_aria_attrs_default();
var invalid = [];
var _iterator33 = _createForOfIteratorHelper(virtualNode.attrNames), _step33;
try {
for (_iterator33.s(); !(_step33 = _iterator33.n()).done; ) {
var attrName = _step33.value;
if (globalAriaAttrs.includes(attrName) && !allowedAriaAttrs.includes(attrName)) {
invalid.push(attrName);
}
}
} catch (err) {
_iterator33.e(err);
} finally {
_iterator33.f();
}
if (!invalid.length) {
return true;
}
var messageKey = invalid.length > 1 ? 'plural' : 'singular';
this.data({
messageKey: messageKey,
nodeName: virtualNode.props.nodeName,
values: invalid.map(function(attrName) {
return attrName + '="' + virtualNode.attr(attrName) + '"';
}).join(', ')
});
return false;
}
function abstractroleEvaluate(node, options, virtualNode) {
var abstractRoles = token_list_default(virtualNode.attr('role')).filter(function(role) {
return get_role_type_default(role) === 'abstract';
});
if (abstractRoles.length > 0) {
this.data(abstractRoles);
return true;
}
return false;
}
var abstractrole_evaluate_default = abstractroleEvaluate;
function xmlLangMismatchMatches(node, virtualNode) {
var primaryLangValue = get_base_lang_default(virtualNode.attr('lang'));
var primaryXmlLangValue = get_base_lang_default(virtualNode.attr('xml:lang'));
return valid_langs_default(primaryLangValue) && valid_langs_default(primaryXmlLangValue);
}
var xml_lang_mismatch_matches_default = xmlLangMismatchMatches;
function windowIsTopMatches(node) {
return node.ownerDocument.defaultView.self === node.ownerDocument.defaultView.top;
}
var window_is_top_matches_default = windowIsTopMatches;
function svgNamespaceMatches(node, virtualNode) {
try {
var nodeName2 = virtualNode.props.nodeName;
if (nodeName2 === 'svg') {
return true;
}
return !!closest_default(virtualNode, 'svg');
} catch (_unused24) {
return false;
}
}
var svg_namespace_matches_default = svgNamespaceMatches;
function widgetNotInline(node, vNode) {
return matchesFns.every(function(fn) {
return fn(node, vNode);
});
}
var matchesFns = [ function(node, vNode) {
return isWidgetType(vNode);
}, function(node, vNode) {
return isNotAreaElement(vNode);
}, function(node, vNode) {
return !svg_namespace_matches_default(node, vNode);
}, function(node, vNode) {
return _isFocusable(vNode);
}, function(node, vNode) {
return _isInTabOrder(vNode) || !hasWidgetAncestorInTabOrder(vNode);
}, function(node) {
return !is_in_text_block_default(node, {
noLengthCompare: true,
includeInlineBlock: true
});
} ];
function isWidgetType(vNode) {
return get_role_type_default(vNode) === 'widget';
}
function isNotAreaElement(vNode) {
return vNode.props.nodeName !== 'area';
}
var hasWidgetAncestorInTabOrder = memoize_default(function hasWidgetAncestorInTabOrderMemoized(vNode) {
if (!(vNode !== null && vNode !== void 0 && vNode.parent)) {
return false;
}
if (isWidgetType(vNode.parent) && _isInTabOrder(vNode.parent)) {
return true;
}
return hasWidgetAncestorInTabOrder(vNode.parent);
}, {
primitive: true
});
function tableOrGridRoleMatches(_, vNode) {
var role = get_role_default(vNode);
return [ 'treegrid', 'grid', 'table' ].includes(role);
}
function summaryIsInteractiveMatches(_, virtualNode) {
var parent = virtualNode.parent;
if (parent.props.nodeName !== 'details' || isSlottedElm(virtualNode)) {
return false;
}
var firstSummary = parent.children.find(function(child) {
return child.props.nodeName === 'summary';
});
if (firstSummary !== virtualNode) {
return false;
}
return true;
}
function isSlottedElm(vNode) {
var _vNode$actualNode;
var domParent = (_vNode$actualNode = vNode.actualNode) === null || _vNode$actualNode === void 0 ? void 0 : _vNode$actualNode.parentElement;
return domParent && domParent !== vNode.parent.actualNode;
}
function skipLinkMatches(node) {
return _isSkipLink(node) && is_offscreen_default(node);
}
var skip_link_matches_default = skipLinkMatches;
function scrollableRegionFocusableMatches(node, virtualNode) {
return _getScroll(node, 13) !== void 0 && _isComboboxPopup(virtualNode) === false && isNonEmptyElementOutsideViewableRect(virtualNode);
}
function isNonEmptyElementOutsideViewableRect(vNode) {
var boundingRect = vNode.boundingClientRect;
return query_selector_all_default(vNode, '*').some(function(elm) {
if (!has_content_virtual_default(elm, true, true)) {
return false;
}
var rects = [];
if (hasChildTextNodes(elm)) {
var _rects;
(_rects = rects).push.apply(_rects, _toConsumableArray(getContentRects2(elm)));
} else {
rects = [ elm.boundingClientRect ];
}
return rects.some(function(rect) {
return rect.left < boundingRect.left || rect.right > boundingRect.right || rect.top < boundingRect.top || rect.bottom > boundingRect.bottom;
});
});
}
function getContentRects2(vNode) {
var range2 = document.createRange();
range2.selectNodeContents(vNode.actualNode);
return Array.from(range2.getClientRects());
}
function presentationRoleConflictMatches(node, virtualNode) {
return implicit_role_default(virtualNode, {
chromiumRoles: true
}) !== null;
}
var presentation_role_conflict_matches_default = presentationRoleConflictMatches;
function pAsHeadingMatches(node, virtualNode) {
if (virtualNode && get_role_default(virtualNode) === 'heading') {
return false;
}
var children = Array.from(node.parentNode.childNodes);
var nodeText = node.textContent.trim();
var isSentence = /[.!?:;](?![.!?:;])/g;
if (nodeText.length === 0 || (nodeText.match(isSentence) || []).length >= 2) {
return false;
}
var siblingsAfter = children.slice(children.indexOf(node) + 1).filter(function(elm) {
return elm.nodeName.toUpperCase() === 'P' && elm.textContent.trim() !== '';
});
return siblingsAfter.length !== 0;
}
function noExplicitNameRequired(node, virtualNode) {
var role = get_explicit_role_default(virtualNode);
if (!role || [ 'none', 'presentation' ].includes(role)) {
return true;
}
var _ref171 = aria_roles_default[role] || {}, accessibleNameRequired = _ref171.accessibleNameRequired;
if (accessibleNameRequired || _isFocusable(virtualNode)) {
return true;
}
return false;
}
var no_explicit_name_required_matches_default = noExplicitNameRequired;
var object_is_loaded_matches_default = function object_is_loaded_matches_default(node, vNode) {
return [ no_explicit_name_required_matches_default, objectHasLoaded ].every(function(fn) {
return fn(node, vNode);
});
};
function objectHasLoaded(node) {
var _node$ownerDocument;
if (!(node !== null && node !== void 0 && (_node$ownerDocument = node.ownerDocument) !== null && _node$ownerDocument !== void 0 && _node$ownerDocument.createRange)) {
return true;
}
var range2 = node.ownerDocument.createRange();
range2.setStart(node, 0);
range2.setEnd(node, node.childNodes.length);
return range2.getClientRects().length === 0;
}
function notHtmlMatches(node, virtualNode) {
return virtualNode.props.nodeName !== 'html';
}
var not_html_matches_default = notHtmlMatches;
function noRoleMatches(node, vNode) {
return !vNode.attr('role');
}
var no_role_matches_default = noRoleMatches;
function noNegativeTabindexMatches(node, virtualNode) {
var tabindex = parse_tabindex_default(virtualNode.attr('tabindex'));
return tabindex === null || tabindex >= 0;
}
var no_negative_tabindex_matches_default = noNegativeTabindexMatches;
function noNamingMethodMatches(node, virtualNode) {
var _get_element_spec_def3 = get_element_spec_default(virtualNode), namingMethods = _get_element_spec_def3.namingMethods;
if (namingMethods && namingMethods.length !== 0) {
return false;
}
if (get_explicit_role_default(virtualNode) === 'combobox' && query_selector_all_default(virtualNode, 'input:not([type="hidden"])').length) {
return false;
}
if (_isComboboxPopup(virtualNode, {
popupRoles: [ 'listbox' ]
})) {
return false;
}
return true;
}
var no_naming_method_matches_default = noNamingMethodMatches;
function noEmptyRoleMatches(node, virtualNode) {
if (!virtualNode.hasAttr('role')) {
return false;
}
if (!virtualNode.attr('role').trim()) {
return false;
}
return true;
}
var no_empty_role_matches_default = noEmptyRoleMatches;
function noAutoplayAudioMatches(node) {
if (!node.currentSrc) {
return false;
}
if (node.hasAttribute('paused') || node.hasAttribute('muted')) {
return false;
}
return true;
}
var no_autoplay_audio_matches_default = noAutoplayAudioMatches;
function nestedInteractiveMatches(node, virtualNode) {
var role = get_role_default(virtualNode);
if (!role) {
return false;
}
return !!standards_default.ariaRoles[role].childrenPresentational;
}
var nested_interactive_matches_default = nestedInteractiveMatches;
function linkInTextBlockMatches(node) {
var text = sanitize_default(node.innerText);
var role = get_explicit_role_default(node);
if (role && role !== 'link') {
return false;
}
if (!text) {
return false;
}
if (!_isVisibleOnScreen(node)) {
return false;
}
return is_in_text_block_default(node);
}
var link_in_text_block_matches_default = linkInTextBlockMatches;
function dataTableMatches(node) {
return !is_data_table_default(node) && !_isFocusable(node);
}
var layout_table_matches_default = dataTableMatches;
function landmarkUniqueMatches(node, virtualNode) {
return get_role_type_default(virtualNode) === 'landmark' && _isVisibleToScreenReaders(virtualNode);
}
function landmarkHasBodyContextMatches(node, virtualNode) {
var nativeScopeFilter = 'article, aside, main, nav, section';
return virtualNode.hasAttr('role') || !find_up_virtual_default(virtualNode, nativeScopeFilter);
}
var landmark_has_body_context_matches_default = landmarkHasBodyContextMatches;
function labelMatches(node, virtualNode) {
if (virtualNode.props.nodeName !== 'input' || virtualNode.hasAttr('type') === false) {
return true;
}
var type2 = virtualNode.attr('type').toLowerCase();
return [ 'hidden', 'image', 'button', 'submit', 'reset' ].includes(type2) === false;
}
var label_matches_default = labelMatches;
function labelContentNameMismatchMatches(node, virtualNode) {
var role = get_role_default(node);
if (!role) {
return false;
}
var widgetRoles = get_aria_roles_by_type_default('widget');
var isWidgetType2 = widgetRoles.includes(role);
if (!isWidgetType2) {
return false;
}
var rolesWithNameFromContents = get_aria_roles_supporting_name_from_content_default();
if (!rolesWithNameFromContents.includes(role)) {
return false;
}
if (!sanitize_default(_arialabelText(virtualNode)) && !sanitize_default(arialabelledby_text_default(node))) {
return false;
}
if (!sanitize_default(visible_virtual_default(virtualNode))) {
return false;
}
return true;
}
var label_content_name_mismatch_matches_default = labelContentNameMismatchMatches;
function isVisibleOnScreenMatches(node, virtualNode) {
return _isVisibleOnScreen(virtualNode);
}
function hasVisibleTextMatches(node) {
return _isVisibleOnScreen(node);
}
function isInitiatorMatches(node, virtualNode, context) {
return context.initiator;
}
var is_initiator_matches_default = isInitiatorMatches;
function insertedIntoFocusOrderMatches(node) {
return _insertedIntoFocusOrder(node);
}
var inserted_into_focus_order_matches_default = insertedIntoFocusOrderMatches;
function identicalLinksSamePurposeMatches(node, virtualNode) {
var hasAccName = !!_accessibleTextVirtual(virtualNode);
if (!hasAccName) {
return false;
}
var role = get_role_default(node);
if (role && role !== 'link') {
return false;
}
return true;
}
var identical_links_same_purpose_matches_default = identicalLinksSamePurposeMatches;
function htmlNamespaceMatches(node, virtualNode) {
return !svg_namespace_matches_default(node, virtualNode);
}
var html_namespace_matches_default = htmlNamespaceMatches;
function headingMatches(node, virtualNode) {
return get_role_default(virtualNode) === 'heading';
}
function hasImplicitChromiumRoleMatches(node, virtualNode) {
return implicit_role_default(virtualNode, {
chromium: true
}) !== null;
}
var has_implicit_chromium_role_matches_default = hasImplicitChromiumRoleMatches;
function frameTitleHasTextMatches(node, virtualNode) {
var title = virtualNode.attr('title');
return !!sanitize_default(title);
}
var frame_title_has_text_matches_default = frameTitleHasTextMatches;
function frameFocusableContentMatches(node, virtualNode, context) {
var _context$size, _context$size2;
return !context.initiator && !context.focusable && ((_context$size = context.size) === null || _context$size === void 0 ? void 0 : _context$size.width) * ((_context$size2 = context.size) === null || _context$size2 === void 0 ? void 0 : _context$size2.height) > 1;
}
var frame_focusable_content_matches_default = frameFocusableContentMatches;
function duplicateIdMiscMatches(node, virtualNode) {
var id = virtualNode.attr('id').trim();
var idSelector2 = '*[id="'.concat(escape_selector_default(id), '"]');
var idMatchingElms = Array.from(get_root_node_default2(node).querySelectorAll(idSelector2));
return !is_accessible_ref_default(node) && idMatchingElms.every(function(elm) {
return !_isFocusable(elm);
});
}
var duplicate_id_misc_matches_default = duplicateIdMiscMatches;
function duplicateIdAriaMatches(node) {
return is_accessible_ref_default(node);
}
var duplicate_id_aria_matches_default = duplicateIdAriaMatches;
function duplicateIdActiveMatches(node, virtualNode) {
var id = virtualNode.attr('id').trim();
var idSelector2 = '*[id="'.concat(escape_selector_default(id), '"]');
var idMatchingElms = Array.from(get_root_node_default2(node).querySelectorAll(idSelector2));
return !is_accessible_ref_default(node) && idMatchingElms.some(_isFocusable);
}
var duplicate_id_active_matches_default = duplicateIdActiveMatches;
function dataTableMatches2(node) {
return is_data_table_default(node);
}
var data_table_matches_default = dataTableMatches2;
function dataTableLargeMatches(node) {
if (is_data_table_default(node)) {
var tableArray = to_grid_default(node);
return tableArray.length >= 3 && tableArray[0].length >= 3 && tableArray[1].length >= 3 && tableArray[2].length >= 3;
}
return false;
}
var data_table_large_matches_default = dataTableLargeMatches;
function colorContrastMatches(node, virtualNode) {
var _virtualNode$props4 = virtualNode.props, nodeName2 = _virtualNode$props4.nodeName, inputType = _virtualNode$props4.type;
if (nodeName2 === 'option') {
return false;
}
if (nodeName2 === 'select' && !node.options.length) {
return false;
}
var nonTextInput = [ 'hidden', 'range', 'color', 'checkbox', 'radio', 'image' ];
if (nodeName2 === 'input' && nonTextInput.includes(inputType)) {
return false;
}
if (is_disabled_default(virtualNode) || _isInert(virtualNode)) {
return false;
}
var formElements = [ 'input', 'select', 'textarea' ];
if (formElements.includes(nodeName2)) {
var style = window.getComputedStyle(node);
var textIndent = parseInt(style.getPropertyValue('text-indent'), 10);
if (textIndent) {
var rect = node.getBoundingClientRect();
rect = {
top: rect.top,
bottom: rect.bottom,
left: rect.left + textIndent,
right: rect.right + textIndent
};
if (!visually_overlaps_default(rect, node)) {
return false;
}
}
return true;
}
var nodeParentLabel = find_up_virtual_default(virtualNode, 'label');
if (nodeName2 === 'label' || nodeParentLabel) {
var labelNode = nodeParentLabel || node;
var labelVirtual3 = nodeParentLabel ? get_node_from_tree_default(nodeParentLabel) : virtualNode;
if (labelNode.htmlFor) {
var doc = get_root_node_default2(labelNode);
var explicitControl = doc.getElementById(labelNode.htmlFor);
var explicitControlVirtual = explicitControl && get_node_from_tree_default(explicitControl);
if (explicitControlVirtual && is_disabled_default(explicitControlVirtual)) {
return false;
}
}
var query = 'input:not([type="hidden"],[type="image"],[type="button"],[type="submit"],[type="reset"]), select, textarea';
var implicitControl = query_selector_all_default(labelVirtual3, query)[0];
if (implicitControl && is_disabled_default(implicitControl)) {
return false;
}
}
var ariaLabelledbyControls = [];
var ancestorNode = virtualNode;
while (ancestorNode) {
if (ancestorNode.props.id) {
var virtualControls = get_accessible_refs_default(ancestorNode).filter(function(control) {
return token_list_default(control.getAttribute('aria-labelledby') || '').includes(ancestorNode.props.id);
}).map(function(control) {
return get_node_from_tree_default(control);
});
ariaLabelledbyControls.push.apply(ariaLabelledbyControls, _toConsumableArray(virtualControls));
}
ancestorNode = ancestorNode.parent;
}
if (ariaLabelledbyControls.length > 0 && ariaLabelledbyControls.every(is_disabled_default)) {
return false;
}
if (!hasRealTextChildren(virtualNode)) {
return false;
}
if (!parseFloat(virtualNode.getComputedStylePropertyValue('font-size'))) {
return false;
}
var range2 = document.createRange();
var childNodes = virtualNode.children;
for (var index = 0; index < childNodes.length; index++) {
var child = childNodes[index];
if (child.actualNode.nodeType === 3 && sanitize_default(child.actualNode.nodeValue) !== '') {
range2.selectNodeContents(child.actualNode);
}
}
var rects = Array.from(range2.getClientRects());
var clippingAncestors = get_overflow_hidden_ancestors_default(virtualNode);
return rects.some(function(rect) {
var overlaps = visually_overlaps_default(rect, node);
if (!clippingAncestors.length) {
return overlaps;
}
var withinOverflow = clippingAncestors.some(function(overflowNode) {
return _rectsOverlap(rect, overflowNode.boundingClientRect);
});
return overlaps && withinOverflow;
});
}
var color_contrast_matches_default = colorContrastMatches;
var removeUnicodeOptions = {
emoji: true,
nonBmp: false,
punctuations: true
};
function hasRealTextChildren(virtualNode) {
var visibleText = visible_virtual_default(virtualNode, false, true);
if (visibleText === '' || remove_unicode_default(visibleText, removeUnicodeOptions) === '') {
return false;
}
return virtualNode.children.some(function(vChild) {
return vChild.props.nodeName === '#text' && !_isIconLigature(vChild);
});
}
function bypassMatches(node, virtualNode, context) {
if (is_initiator_matches_default(node, virtualNode, context)) {
return !!node.querySelector('a[href]');
}
return true;
}
var bypass_matches_default = bypassMatches;
function avoidInlineSpacingMatches(node, virtualNode) {
return visible_virtual_default(virtualNode) !== '';
}
function autocompleteMatches(node, virtualNode) {
var autocomplete2 = virtualNode.attr('autocomplete');
if (!autocomplete2 || sanitize_default(autocomplete2) === '') {
return false;
}
var nodeName2 = virtualNode.props.nodeName;
if ([ 'textarea', 'input', 'select' ].includes(nodeName2) === false) {
return false;
}
var ariaReadonly = virtualNode.attr('aria-readonly') || 'false';
if (virtualNode.hasAttr('readonly') || ariaReadonly.toLowerCase() === 'true') {
return false;
}
var excludedInputTypes = [ 'submit', 'reset', 'button', 'hidden' ];
if (nodeName2 === 'input' && excludedInputTypes.includes(virtualNode.props.type)) {
return false;
}
var ariaDisabled = virtualNode.attr('aria-disabled') || 'false';
if (virtualNode.hasAttr('disabled') || ariaDisabled.toLowerCase() === 'true') {
return false;
}
var role = get_explicit_role_default(virtualNode);
var tabIndex = parse_tabindex_default(virtualNode.attr('tabindex'));
if (tabIndex < 0 && virtualNode.hasAttr('role')) {
var roleDef = standards_default.ariaRoles[role];
if (roleDef === void 0 || roleDef.type !== 'widget') {
return false;
}
}
if (tabIndex < 0 && virtualNode.actualNode && !_isVisibleOnScreen(virtualNode) && !_isVisibleToScreenReaders(virtualNode)) {
return false;
}
return true;
}
var autocomplete_matches_default = autocompleteMatches;
function ariaRequiredParentMatches(node, virtualNode) {
var role = get_explicit_role_default(virtualNode);
return !!required_context_default(role);
}
var aria_required_parent_matches_default = ariaRequiredParentMatches;
function ariaRequiredChildrenMatches(node, virtualNode) {
var role = get_explicit_role_default(virtualNode, {
dpub: true
});
return !!required_owned_default(role);
}
var aria_required_children_matches_default = ariaRequiredChildrenMatches;
function ariaHiddenFocusMatches(node, virtualNode) {
var vNode = virtualNode.parent;
while (vNode) {
var ariaHidden2 = _getAriaValue(vNode, 'aria-hidden').value;
if (ariaHidden2 === 'true') {
return false;
}
vNode = vNode.parent;
}
return true;
}
function ariaHasAttrMatches(node, virtualNode) {
var aria = /^aria-/;
return virtualNode.attrNames.some(function(attr) {
return aria.test(attr);
});
}
var aria_has_attr_matches_default = ariaHasAttrMatches;
function ariaAllowedRoleMatches(node, virtualNode) {
return get_explicit_role_default(virtualNode, {
dpub: true,
fallback: true
}) !== null;
}
var aria_allowed_role_matches_default = ariaAllowedRoleMatches;
function ariaAllowedAttrMatches(node, virtualNode) {
var aria = /^aria-/;
var attrs = virtualNode.attrNames;
if (attrs.length) {
for (var _i39 = 0, l = attrs.length; _i39 < l; _i39++) {
if (aria.test(attrs[_i39])) {
return true;
}
}
}
return false;
}
var aria_allowed_attr_matches_default = ariaAllowedAttrMatches;
var metadataFunctionMap = {
'abstractrole-evaluate': abstractrole_evaluate_default,
'accesskeys-after': accesskeys_after_default,
'accesskeys-evaluate': accesskeys_evaluate_default,
'alt-space-value-evaluate': alt_space_value_evaluate_default,
'aria-allowed-attr-elm-evaluate': ariaAllowedAttrElmEvaluate,
'aria-allowed-attr-evaluate': ariaAllowedAttrEvaluate,
'aria-allowed-attr-matches': aria_allowed_attr_matches_default,
'aria-allowed-role-evaluate': aria_allowed_role_evaluate_default,
'aria-allowed-role-matches': aria_allowed_role_matches_default,
'aria-busy-evaluate': ariaBusyEvaluate,
'aria-conditional-attr-evaluate': ariaConditionalAttrEvaluate,
'aria-conditional-checkbox-attr-evaluate': ariaConditionalCheckboxAttr,
'aria-conditional-radio-attr-evaluate': ariaConditionalRadioAttr,
'aria-conditional-row-attr-evaluate': ariaConditionalRowAttr,
'aria-errormessage-evaluate': ariaErrormessageEvaluate,
'aria-has-attr-matches': aria_has_attr_matches_default,
'aria-hidden-body-evaluate': aria_hidden_body_evaluate_default,
'aria-hidden-focus-matches': ariaHiddenFocusMatches,
'aria-label-evaluate': aria_label_evaluate_default,
'aria-labelledby-evaluate': aria_labelledby_evaluate_default,
'aria-level-evaluate': aria_level_evaluate_default,
'aria-no-deprecated-attr-evaluate': ariaNoDeprecatedAttrEvaluate,
'aria-prohibited-attr-evaluate': ariaProhibitedAttrEvaluate,
'aria-required-attr-evaluate': ariaRequiredAttrEvaluate,
'aria-required-children-evaluate': ariaRequiredChildrenEvaluate,
'aria-required-children-matches': aria_required_children_matches_default,
'aria-required-parent-evaluate': aria_required_parent_evaluate_default,
'aria-required-parent-matches': aria_required_parent_matches_default,
'aria-roledescription-evaluate': aria_roledescription_evaluate_default,
'aria-unsupported-attr-evaluate': aria_unsupported_attr_evaluate_default,
'aria-valid-attr-evaluate': aria_valid_attr_evaluate_default,
'aria-valid-attr-value-evaluate': ariaValidAttrValueEvaluate,
'attr-non-space-content-evaluate': attr_non_space_content_evaluate_default,
'autocomplete-appropriate-evaluate': autocomplete_appropriate_evaluate_default,
'autocomplete-matches': autocomplete_matches_default,
'autocomplete-valid-evaluate': autocomplete_valid_evaluate_default,
'avoid-inline-spacing-evaluate': avoid_inline_spacing_evaluate_default,
'avoid-inline-spacing-matches': avoidInlineSpacingMatches,
'braille-label-equivalent-evaluate': brailleLabelEquivalentEvaluate,
'braille-roledescription-equivalent-evaluate': brailleRoleDescriptionEquivalentEvaluate,
'bypass-matches': bypass_matches_default,
'caption-evaluate': caption_evaluate_default,
'caption-faked-evaluate': caption_faked_evaluate_default,
'color-contrast-evaluate': colorContrastEvaluate,
'color-contrast-matches': color_contrast_matches_default,
'css-orientation-lock-evaluate': css_orientation_lock_evaluate_default,
'data-table-large-matches': data_table_large_matches_default,
'data-table-matches': data_table_matches_default,
'deprecatedrole-evaluate': deprecatedroleEvaluate,
'dlitem-evaluate': dlitem_evaluate_default,
'doc-has-title-evaluate': doc_has_title_evaluate_default,
'duplicate-id-active-matches': duplicate_id_active_matches_default,
'duplicate-id-after': duplicate_id_after_default,
'duplicate-id-aria-matches': duplicate_id_aria_matches_default,
'duplicate-id-evaluate': duplicate_id_evaluate_default,
'duplicate-id-misc-matches': duplicate_id_misc_matches_default,
'duplicate-img-label-evaluate': duplicate_img_label_evaluate_default,
'exists-evaluate': exists_evaluate_default,
'explicit-evaluate': explicit_evaluate_default,
'fallbackrole-evaluate': fallbackrole_evaluate_default,
'focusable-content-evaluate': focusable_content_evaluate_default,
'focusable-disabled-evaluate': focusable_disabled_evaluate_default,
'focusable-element-evaluate': focusable_element_evaluate_default,
'focusable-modal-open-evaluate': focusable_modal_open_evaluate_default,
'focusable-no-name-evaluate': focusable_no_name_evaluate_default,
'focusable-not-tabbable-evaluate': focusable_not_tabbable_evaluate_default,
'frame-focusable-content-evaluate': frameFocusableContentEvaluate,
'frame-focusable-content-matches': frame_focusable_content_matches_default,
'frame-tested-after': frame_tested_after_default,
'frame-tested-evaluate': frame_tested_evaluate_default,
'frame-title-has-text-matches': frame_title_has_text_matches_default,
'has-alt-evaluate': has_alt_evaluate_default,
'has-descendant-after': has_descendant_after_default,
'has-descendant-evaluate': has_descendant_evaluate_default,
'has-global-aria-attribute-evaluate': has_global_aria_attribute_evaluate_default,
'has-implicit-chromium-role-matches': has_implicit_chromium_role_matches_default,
'has-lang-evaluate': has_lang_evaluate_default,
'has-text-content-evaluate': hasTextContentEvaluate,
'has-widget-role-evaluate': has_widget_role_evaluate_default,
'heading-matches': headingMatches,
'heading-order-after': headingOrderAfter,
'heading-order-evaluate': heading_order_evaluate_default,
'help-same-as-label-evaluate': help_same_as_label_evaluate_default,
'hidden-content-evaluate': hidden_content_evaluate_default,
'hidden-explicit-label-evaluate': hidden_explicit_label_evaluate_default,
'html-namespace-matches': html_namespace_matches_default,
'html5-scope-evaluate': html5_scope_evaluate_default,
'identical-links-same-purpose-after': identical_links_same_purpose_after_default,
'identical-links-same-purpose-evaluate': identical_links_same_purpose_evaluate_default,
'identical-links-same-purpose-matches': identical_links_same_purpose_matches_default,
'implicit-evaluate': implicit_evaluate_default,
'inline-style-property-evaluate': inlineStyleProperty,
'inserted-into-focus-order-matches': inserted_into_focus_order_matches_default,
'internal-link-present-evaluate': internal_link_present_evaluate_default,
'invalid-children-evaluate': invalidChildrenEvaluate,
'invalidrole-evaluate': invalidrole_evaluate_default,
'is-element-focusable-evaluate': is_element_focusable_evaluate_default,
'is-initiator-matches': is_initiator_matches_default,
'is-on-screen-evaluate': is_on_screen_evaluate_default,
'is-visible-matches': hasVisibleTextMatches,
'is-visible-on-screen-matches': isVisibleOnScreenMatches,
'label-content-name-mismatch-evaluate': label_content_name_mismatch_evaluate_default,
'label-content-name-mismatch-matches': label_content_name_mismatch_matches_default,
'label-matches': label_matches_default,
'landmark-has-body-context-matches': landmark_has_body_context_matches_default,
'landmark-is-top-level-evaluate': landmark_is_top_level_evaluate_default,
'landmark-is-unique-after': landmark_is_unique_after_default,
'landmark-is-unique-evaluate': landmark_is_unique_evaluate_default,
'landmark-unique-matches': landmarkUniqueMatches,
'layout-table-matches': layout_table_matches_default,
'link-in-text-block-evaluate': link_in_text_block_evaluate_default,
'link-in-text-block-matches': link_in_text_block_matches_default,
'link-in-text-block-style-evaluate': linkInTextBlockStyleEvaluate,
'listitem-evaluate': listitemEvaluate,
'matches-definition-evaluate': matches_definition_evaluate_default,
'meta-refresh-evaluate': metaRefreshEvaluate,
'meta-viewport-scale-evaluate': meta_viewport_scale_evaluate_default,
'multiple-label-evaluate': multiple_label_evaluate_default,
'nested-interactive-matches': nested_interactive_matches_default,
'no-autoplay-audio-evaluate': no_autoplay_audio_evaluate_default,
'no-autoplay-audio-matches': no_autoplay_audio_matches_default,
'no-empty-role-matches': no_empty_role_matches_default,
'no-explicit-name-required-matches': no_explicit_name_required_matches_default,
'no-focusable-content-evaluate': noFocusableContentEvaluate,
'no-implicit-explicit-label-evaluate': no_implicit_explicit_label_evaluate_default,
'no-naming-method-matches': no_naming_method_matches_default,
'no-negative-tabindex-matches': no_negative_tabindex_matches_default,
'no-role-matches': no_role_matches_default,
'non-empty-if-present-evaluate': non_empty_if_present_evaluate_default,
'not-html-matches': not_html_matches_default,
'object-is-loaded-matches': object_is_loaded_matches_default,
'only-dlitems-evaluate': onlyDlitemsEvaluate,
'only-listitems-evaluate': only_listitems_evaluate_default,
'p-as-heading-evaluate': p_as_heading_evaluate_default,
'p-as-heading-matches': pAsHeadingMatches,
'page-no-duplicate-after': page_no_duplicate_after_default,
'page-no-duplicate-evaluate': page_no_duplicate_evaluate_default,
'presentation-role-conflict-matches': presentation_role_conflict_matches_default,
'presentational-role-evaluate': presentationalRoleEvaluate,
'region-after': region_after_default,
'region-evaluate': regionEvaluate,
'same-caption-summary-evaluate': same_caption_summary_evaluate_default,
'scope-value-evaluate': scope_value_evaluate_default,
'scrollable-region-focusable-matches': scrollableRegionFocusableMatches,
'skip-link-evaluate': skip_link_evaluate_default,
'skip-link-matches': skip_link_matches_default,
'structured-dlitems-evaluate': structured_dlitems_evaluate_default,
'summary-interactive-matches': summaryIsInteractiveMatches,
'svg-namespace-matches': svg_namespace_matches_default,
'svg-non-empty-title-evaluate': svg_non_empty_title_evaluate_default,
'tabindex-evaluate': tabindex_evaluate_default,
'table-or-grid-role-matches': tableOrGridRoleMatches,
'target-offset-evaluate': targetOffsetEvaluate,
'target-size-evaluate': targetSizeEvaluate,
'td-has-header-evaluate': td_has_header_evaluate_default,
'td-headers-attr-evaluate': tdHeadersAttrEvaluate,
'th-has-data-cells-evaluate': th_has_data_cells_evaluate_default,
'title-only-evaluate': title_only_evaluate_default,
'unique-frame-title-after': unique_frame_title_after_default,
'unique-frame-title-evaluate': unique_frame_title_evaluate_default,
'unsupportedrole-evaluate': unsupportedrole_evaluate_default,
'valid-lang-evaluate': valid_lang_evaluate_default,
'valid-scrollable-semantics-evaluate': valid_scrollable_semantics_evaluate_default,
'widget-not-inline-matches': widgetNotInline,
'window-is-top-matches': window_is_top_matches_default,
'xml-lang-mismatch-evaluate': xml_lang_mismatch_evaluate_default,
'xml-lang-mismatch-matches': xml_lang_mismatch_matches_default
};
var metadata_function_map_default = metadataFunctionMap;
function CheckResult(check) {
this.id = check.id;
this.data = null;
this.relatedNodes = [];
this.result = null;
}
var check_result_default = CheckResult;
function createExecutionContext(spec) {
if (typeof spec === 'string') {
if (metadata_function_map_default[spec]) {
return metadata_function_map_default[spec];
}
if (/^\s*function[\s\w]*\(/.test(spec)) {
return new Function('return ' + spec + ';')();
}
throw new ReferenceError('Function ID does not exist in the metadata-function-map: '.concat(spec));
}
return spec;
}
function normalizeOptions() {
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
if (Array.isArray(options) || _typeof(options) !== 'object') {
options = {
value: options
};
}
return options;
}
function Check(spec) {
if (spec) {
this.id = spec.id;
this.configure(spec);
}
}
Check.prototype.enabled = true;
Check.prototype.run = function run(node, options, context, resolve, reject) {
options = options || {};
var enabled = options.hasOwnProperty('enabled') ? options.enabled : this.enabled;
var checkOptions = this.getOptions(options.options);
if (enabled) {
var checkResult = new check_result_default(this);
var helper = check_helper_default(checkResult, options, resolve, reject);
var result;
try {
result = this.evaluate.call(helper, node.actualNode, checkOptions, node, context);
} catch (e) {
if (node && node.actualNode) {
e.errorNode = node_serializer_default.toSpec(node);
}
reject(e);
return;
}
if (!helper.isAsync) {
checkResult.result = result;
resolve(checkResult);
}
} else {
resolve(null);
}
};
Check.prototype.runSync = function runSync(node, options, context) {
options = options || {};
var _options2 = options, _options2$enabled = _options2.enabled, enabled = _options2$enabled === void 0 ? this.enabled : _options2$enabled;
if (!enabled) {
return null;
}
var checkOptions = this.getOptions(options.options);
var checkResult = new check_result_default(this);
var helper = check_helper_default(checkResult, options);
helper.async = function async() {
throw new Error('Cannot run async check while in a synchronous run');
};
var result;
try {
result = this.evaluate.call(helper, node.actualNode, checkOptions, node, context);
} catch (e) {
if (node && node.actualNode) {
e.errorNode = node_serializer_default.toSpec(node);
}
throw e;
}
checkResult.result = result;
return checkResult;
};
Check.prototype.configure = function configure2(spec) {
var _this15 = this;
if (!spec.evaluate || metadata_function_map_default[spec.evaluate]) {
this._internalCheck = true;
}
if (spec.hasOwnProperty('enabled')) {
this.enabled = spec.enabled;
}
if (spec.hasOwnProperty('options')) {
if (this._internalCheck) {
this.options = normalizeOptions(spec.options);
} else {
this.options = spec.options;
}
}
[ 'evaluate', 'after' ].filter(function(prop) {
return spec.hasOwnProperty(prop);
}).forEach(function(prop) {
return _this15[prop] = createExecutionContext(spec[prop]);
});
};
Check.prototype.getOptions = function getOptions(options) {
if (this._internalCheck) {
return deep_merge_default(this.options, normalizeOptions(options || {}));
} else {
return options || this.options;
}
};
var check_default = Check;
function RuleResult(rule) {
this.id = rule.id;
this.result = constants_default.NA;
this.pageLevel = rule.pageLevel;
this.impact = null;
this.nodes = [];
}
var rule_result_default = RuleResult;
function Rule(spec, parentAudit) {
this._audit = parentAudit;
this.id = spec.id;
this.selector = spec.selector || '*';
if (spec.impact) {
assert_default(constants_default.impact.includes(spec.impact), 'Impact '.concat(spec.impact, ' is not a valid impact'));
this.impact = spec.impact;
}
this.excludeHidden = typeof spec.excludeHidden === 'boolean' ? spec.excludeHidden : true;
this.enabled = typeof spec.enabled === 'boolean' ? spec.enabled : true;
this.pageLevel = typeof spec.pageLevel === 'boolean' ? spec.pageLevel : false;
this.reviewOnFail = typeof spec.reviewOnFail === 'boolean' ? spec.reviewOnFail : false;
this.any = spec.any || [];
this.all = spec.all || [];
this.none = spec.none || [];
this.tags = spec.tags || [];
this.preload = spec.preload ? true : false;
this.actIds = spec.actIds;
if (spec.matches) {
this.matches = createExecutionContext(spec.matches);
}
}
Rule.prototype.matches = function matches3() {
return true;
};
Rule.prototype.gather = function gather(context) {
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var markStart = 'mark_gather_start_' + this.id;
var markEnd = 'mark_gather_end_' + this.id;
var markHiddenStart = 'mark_isVisibleToScreenReaders_start_' + this.id;
var markHiddenEnd = 'mark_isVisibleToScreenReaders_end_' + this.id;
if (options.performanceTimer) {
performance_timer_default.mark(markStart);
}
var elements = _select(this.selector, context);
if (this.excludeHidden) {
if (options.performanceTimer) {
performance_timer_default.mark(markHiddenStart);
}
elements = elements.filter(function(element) {
return _isVisibleToScreenReaders(element);
});
if (options.performanceTimer) {
performance_timer_default.mark(markHiddenEnd);
performance_timer_default.measure('rule_' + this.id + '#gather_axe.utils.isVisibleToScreenReaders', markHiddenStart, markHiddenEnd);
}
}
if (options.performanceTimer) {
performance_timer_default.mark(markEnd);
performance_timer_default.measure('rule_' + this.id + '#gather', markStart, markEnd);
}
return elements;
};
Rule.prototype.runChecks = function runChecks(type2, node, options, context, resolve, reject) {
var self2 = this;
var checkQueue = queue_default();
this[type2].forEach(function(c4) {
var check = self2._audit.checks[c4.id || c4];
var option = get_check_option_default(check, self2.id, options);
checkQueue.defer(function(res, rej) {
check.run(node, option, context, res, function(error) {
rej(new rule_error_default({
ruleId: self2.id,
method: ''.concat(check.id, '#evaluate'),
errorNode: new dq_element_default(node),
error: error
}));
});
});
});
checkQueue.then(function(results) {
results = results.filter(function(check) {
return check;
});
resolve({
type: type2,
results: results
});
})['catch'](reject);
};
Rule.prototype.runChecksSync = function runChecksSync(type2, node, options, context) {
var self2 = this;
var results = [];
this[type2].forEach(function(c4) {
var check = self2._audit.checks[c4.id || c4];
var option = get_check_option_default(check, self2.id, options);
results.push(check.runSync(node, option, context));
});
results = results.filter(function(check) {
return check;
});
return {
type: type2,
results: results
};
};
Rule.prototype.run = function run2(context) {
var _this16 = this;
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var resolve = arguments.length > 2 ? arguments[2] : undefined;
var reject = arguments.length > 3 ? arguments[3] : undefined;
if (options.performanceTimer) {
this._trackPerformance();
}
var q2 = queue_default();
var ruleResult = new rule_result_default(this);
var nodes;
try {
nodes = this.gatherAndMatchNodes(context, options);
} catch (error) {
reject(error);
return;
}
if (options.performanceTimer) {
this._logGatherPerformance(nodes);
}
nodes.forEach(function(node) {
q2.defer(function(resolveNode, rejectNode) {
var checkQueue = queue_default();
[ 'any', 'all', 'none' ].forEach(function(type2) {
checkQueue.defer(function(res, rej) {
_this16.runChecks(type2, node, options, context, res, rej);
});
});
checkQueue.then(function(results) {
var result = getResult(results);
if (result) {
result.node = new dq_element_default(node);
ruleResult.nodes.push(result);
if (_this16.reviewOnFail) {
[ 'any', 'all' ].forEach(function(type2) {
result[type2].forEach(function(checkResult) {
if (checkResult.result === false) {
checkResult.result = void 0;
}
});
});
result.none.forEach(function(checkResult) {
if (checkResult.result === true) {
checkResult.result = void 0;
}
});
}
}
resolveNode();
})['catch'](function(err2) {
return rejectNode(err2);
});
});
});
q2.then(function() {
if (options.performanceTimer) {
_this16._logRulePerformance();
}
setTimeout(function() {
resolve(ruleResult);
}, 0);
})['catch'](function(error) {
if (options.performanceTimer) {
_this16._logRulePerformance();
}
reject(error);
});
};
Rule.prototype.runSync = function runSync2(context) {
var _this17 = this;
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
if (options.performanceTimer) {
this._trackPerformance();
}
var ruleResult = new rule_result_default(this);
var nodes = this.gatherAndMatchNodes(context, options);
if (options.performanceTimer) {
this._logGatherPerformance(nodes);
}
nodes.forEach(function(node) {
var results = [];
[ 'any', 'all', 'none' ].forEach(function(type2) {
results.push(_this17.runChecksSync(type2, node, options, context));
});
var result = getResult(results);
if (result) {
result.node = node.actualNode ? new dq_element_default(node) : null;
ruleResult.nodes.push(result);
if (_this17.reviewOnFail) {
[ 'any', 'all' ].forEach(function(type2) {
result[type2].forEach(function(checkResult) {
if (checkResult.result === false) {
checkResult.result = void 0;
}
});
});
result.none.forEach(function(checkResult) {
if (checkResult.result === true) {
checkResult.result = void 0;
}
});
}
}
});
if (options.performanceTimer) {
this._logRulePerformance();
}
return ruleResult;
};
Rule.prototype._trackPerformance = function _trackPerformance() {
this._markStart = 'mark_rule_start_' + this.id;
this._markEnd = 'mark_rule_end_' + this.id;
this._markChecksStart = 'mark_runchecks_start_' + this.id;
this._markChecksEnd = 'mark_runchecks_end_' + this.id;
};
Rule.prototype._logGatherPerformance = function _logGatherPerformance(nodes) {
log('gather for '.concat(this.id, ' (').concat(nodes.length, ' nodes): ').concat(performance_timer_default.timeElapsed(), 'ms'));
performance_timer_default.mark(this._markChecksStart);
};
Rule.prototype._logRulePerformance = function _logRulePerformance() {
performance_timer_default.mark(this._markChecksEnd);
performance_timer_default.mark(this._markEnd);
performance_timer_default.measure('runchecks_' + this.id, this._markChecksStart, this._markChecksEnd);
performance_timer_default.measure('rule_' + this.id, this._markStart, this._markEnd);
};
function getResult(results) {
if (results.length) {
var hasResults = false;
var result = {};
results.forEach(function(r) {
var res = r.results.filter(function(_result) {
return _result;
});
result[r.type] = res;
if (res.length) {
hasResults = true;
}
});
if (hasResults) {
return result;
}
return null;
}
}
Rule.prototype.gatherAndMatchNodes = function gatherAndMatchNodes(context, options) {
var _this18 = this;
var markMatchesStart = 'mark_matches_start_' + this.id;
var markMatchesEnd = 'mark_matches_end_' + this.id;
var nodes = this.gather(context, options);
if (options.performanceTimer) {
performance_timer_default.mark(markMatchesStart);
}
nodes = nodes.filter(function(node) {
try {
return _this18.matches(node.actualNode, node, context);
} catch (error) {
throw new rule_error_default({
ruleId: _this18.id,
method: '#matches',
errorNode: new dq_element_default(node),
error: error
});
}
});
if (options.performanceTimer) {
performance_timer_default.mark(markMatchesEnd);
performance_timer_default.measure('rule_' + this.id + '#matches', markMatchesStart, markMatchesEnd);
}
return nodes;
};
function findAfterChecks(rule) {
return get_all_checks_default(rule).map(function(c4) {
var check = rule._audit.checks[c4.id || c4];
return check && typeof check.after === 'function' ? check : null;
}).filter(Boolean);
}
function findCheckResults(nodes, checkID) {
var checkResults = [];
nodes.forEach(function(nodeResult) {
var checks = get_all_checks_default(nodeResult);
checks.forEach(function(checkResult) {
if (checkResult.id === checkID) {
checkResult.node = nodeResult.node;
checkResults.push(checkResult);
}
});
});
return checkResults;
}
function filterChecks(checks) {
return checks.filter(function(check) {
return check.filtered !== true;
});
}
function sanitizeNodes(result) {
var checkTypes2 = [ 'any', 'all', 'none' ];
var nodes = result.nodes.filter(function(detail) {
var length = 0;
checkTypes2.forEach(function(type2) {
detail[type2] = filterChecks(detail[type2]);
length += detail[type2].length;
});
return length > 0;
});
if (result.pageLevel && nodes.length) {
nodes = [ nodes.reduce(function(a2, b3) {
if (a2) {
checkTypes2.forEach(function(type2) {
a2[type2].push.apply(a2[type2], b3[type2]);
});
return a2;
}
}) ];
}
return nodes;
}
Rule.prototype.after = function after(result, options) {
var _this19 = this;
var afterChecks = findAfterChecks(this);
afterChecks.forEach(function(check) {
var beforeResults = findCheckResults(result.nodes, check.id);
var checkOption = get_check_option_default(check, _this19.id, options);
var afterResults;
try {
afterResults = check.after(beforeResults, checkOption.options);
} catch (error) {
var _result$nodes;
throw new rule_error_default({
ruleId: _this19.id,
method: ''.concat(check.id, '#after'),
errorNode: (_result$nodes = result.nodes) === null || _result$nodes === void 0 || (_result$nodes = _result$nodes[0]) === null || _result$nodes === void 0 ? void 0 : _result$nodes.node,
error: error
});
}
if (_this19.reviewOnFail) {
afterResults.forEach(function(checkResult) {
var changeAnyAllResults = (_this19.any.includes(checkResult.id) || _this19.all.includes(checkResult.id)) && checkResult.result === false;
var changeNoneResult = _this19.none.includes(checkResult.id) && checkResult.result === true;
if (changeAnyAllResults || changeNoneResult) {
checkResult.result = void 0;
}
});
}
beforeResults.forEach(function(item) {
delete item.node;
if (afterResults.indexOf(item) === -1) {
item.filtered = true;
}
});
});
result.nodes = sanitizeNodes(result);
return result;
};
Rule.prototype.configure = function configure3(spec) {
if (spec.hasOwnProperty('selector')) {
this.selector = spec.selector;
}
if (spec.hasOwnProperty('excludeHidden')) {
this.excludeHidden = typeof spec.excludeHidden === 'boolean' ? spec.excludeHidden : true;
}
if (spec.hasOwnProperty('enabled')) {
this.enabled = typeof spec.enabled === 'boolean' ? spec.enabled : true;
}
if (spec.hasOwnProperty('pageLevel')) {
this.pageLevel = typeof spec.pageLevel === 'boolean' ? spec.pageLevel : false;
}
if (spec.hasOwnProperty('reviewOnFail')) {
this.reviewOnFail = typeof spec.reviewOnFail === 'boolean' ? spec.reviewOnFail : false;
}
if (spec.hasOwnProperty('any')) {
this.any = spec.any;
}
if (spec.hasOwnProperty('all')) {
this.all = spec.all;
}
if (spec.hasOwnProperty('none')) {
this.none = spec.none;
}
if (spec.hasOwnProperty('tags')) {
this.tags = spec.tags;
}
if (spec.hasOwnProperty('actIds')) {
this.actIds = spec.actIds;
}
if (spec.hasOwnProperty('matches')) {
this.matches = createExecutionContext(spec.matches);
}
if (spec.impact) {
assert_default(constants_default.impact.includes(spec.impact), 'Impact '.concat(spec.impact, ' is not a valid impact'));
this.impact = spec.impact;
}
};
var dotRegex = /\{\{.+?\}\}/g;
var Audit = function() {
function Audit(audit) {
_classCallCheck(this, Audit);
this.lang = 'en';
this.defaultConfig = audit;
this.standards = standards_default;
this._init();
this._defaultLocale = null;
}
return _createClass(Audit, [ {
key: '_setDefaultLocale',
value: function _setDefaultLocale() {
if (this._defaultLocale) {
return;
}
var locale = {
checks: {},
rules: {},
failureSummaries: {},
incompleteFallbackMessage: '',
lang: this.lang
};
var checkIDs = Object.keys(this.data.checks);
for (var _i40 = 0; _i40 < checkIDs.length; _i40++) {
var _id8 = checkIDs[_i40];
var check = this.data.checks[_id8];
var _check$messages = check.messages, pass = _check$messages.pass, fail = _check$messages.fail, incomplete = _check$messages.incomplete;
locale.checks[_id8] = {
pass: pass,
fail: fail,
incomplete: incomplete
};
}
var ruleIDs = Object.keys(this.data.rules);
for (var _i41 = 0; _i41 < ruleIDs.length; _i41++) {
var _id9 = ruleIDs[_i41];
var rule = this.data.rules[_id9];
var description = rule.description, help = rule.help;
locale.rules[_id9] = {
description: description,
help: help
};
}
var failureSummaries = Object.keys(this.data.failureSummaries);
for (var _i42 = 0; _i42 < failureSummaries.length; _i42++) {
var type2 = failureSummaries[_i42];
var failureSummary2 = this.data.failureSummaries[type2];
var failureMessage = failureSummary2.failureMessage;
locale.failureSummaries[type2] = {
failureMessage: failureMessage
};
}
locale.incompleteFallbackMessage = this.data.incompleteFallbackMessage;
this._defaultLocale = locale;
}
}, {
key: '_resetLocale',
value: function _resetLocale() {
var defaultLocale = this._defaultLocale;
if (!defaultLocale) {
return;
}
this.applyLocale(defaultLocale);
}
}, {
key: '_applyCheckLocale',
value: function _applyCheckLocale(checks) {
var keys = Object.keys(checks);
for (var _i43 = 0; _i43 < keys.length; _i43++) {
var _id0 = keys[_i43];
if (!this.data.checks[_id0]) {
throw new Error('Locale provided for unknown check: "'.concat(_id0, '"'));
}
this.data.checks[_id0] = mergeCheckLocale(this.data.checks[_id0], checks[_id0]);
}
}
}, {
key: '_applyRuleLocale',
value: function _applyRuleLocale(rules) {
var keys = Object.keys(rules);
for (var _i44 = 0; _i44 < keys.length; _i44++) {
var _id1 = keys[_i44];
if (!this.data.rules[_id1]) {
throw new Error('Locale provided for unknown rule: "'.concat(_id1, '"'));
}
this.data.rules[_id1] = mergeRuleLocale(this.data.rules[_id1], rules[_id1]);
}
}
}, {
key: '_applyFailureSummaries',
value: function _applyFailureSummaries(messages) {
var keys = Object.keys(messages);
for (var _i45 = 0; _i45 < keys.length; _i45++) {
var _key11 = keys[_i45];
if (!this.data.failureSummaries[_key11]) {
throw new Error('Locale provided for unknown failureMessage: "'.concat(_key11, '"'));
}
this.data.failureSummaries[_key11] = mergeFailureMessage(this.data.failureSummaries[_key11], messages[_key11]);
}
}
}, {
key: 'applyLocale',
value: function applyLocale(locale) {
this._setDefaultLocale();
if (locale.checks) {
this._applyCheckLocale(locale.checks);
}
if (locale.rules) {
this._applyRuleLocale(locale.rules);
}
if (locale.failureSummaries) {
this._applyFailureSummaries(locale.failureSummaries, 'failureSummaries');
}
if (locale.incompleteFallbackMessage) {
this.data.incompleteFallbackMessage = mergeFallbackMessage(this.data.incompleteFallbackMessage, locale.incompleteFallbackMessage);
}
if (locale.lang) {
this.lang = locale.lang;
}
}
}, {
key: 'setAllowedOrigins',
value: function setAllowedOrigins(allowedOrigins) {
var defaultOrigin = getDefaultOrigin();
this.allowedOrigins = [];
var _iterator34 = _createForOfIteratorHelper(allowedOrigins), _step34;
try {
for (_iterator34.s(); !(_step34 = _iterator34.n()).done; ) {
var origin = _step34.value;
if (origin === constants_default.allOrigins) {
this.allowedOrigins = [ '*' ];
return;
} else if (origin !== constants_default.sameOrigin) {
this.allowedOrigins.push(origin);
} else if (defaultOrigin) {
this.allowedOrigins.push(defaultOrigin);
}
}
} catch (err) {
_iterator34.e(err);
} finally {
_iterator34.f();
}
}
}, {
key: '_init',
value: function _init() {
var audit = getDefaultConfiguration(this.defaultConfig);
this.lang = audit.lang || 'en';
this.reporter = audit.reporter;
this.commands = {};
this.rules = [];
this.checks = {};
this.brand = 'axe';
this.application = 'axeAPI';
this.tagExclude = [ 'experimental', 'deprecated' ];
this.noHtml = audit.noHtml;
this.allowedOrigins = audit.allowedOrigins;
unpackToObject(audit.rules, this, 'addRule');
unpackToObject(audit.checks, this, 'addCheck');
this.data = {};
this.data.checks = audit.data && audit.data.checks || {};
this.data.rules = audit.data && audit.data.rules || {};
this.data.failureSummaries = audit.data && audit.data.failureSummaries || {};
this.data.incompleteFallbackMessage = audit.data && audit.data.incompleteFallbackMessage || '';
this._constructHelpUrls();
}
}, {
key: 'registerCommand',
value: function registerCommand(command) {
this.commands[command.id] = command.callback;
}
}, {
key: 'addRule',
value: function addRule(spec) {
if (spec.metadata) {
this.data.rules[spec.id] = spec.metadata;
}
var rule = this.getRule(spec.id);
if (rule) {
rule.configure(spec);
} else {
this.rules.push(new Rule(spec, this));
}
}
}, {
key: 'addCheck',
value: function addCheck(spec) {
var metadata = spec.metadata;
if (_typeof(metadata) === 'object') {
this.data.checks[spec.id] = metadata;
if (_typeof(metadata.messages) === 'object') {
Object.keys(metadata.messages).filter(function(prop) {
return metadata.messages.hasOwnProperty(prop) && typeof metadata.messages[prop] === 'string';
}).forEach(function(prop) {
if (metadata.messages[prop].indexOf('function') === 0) {
metadata.messages[prop] = new Function('return ' + metadata.messages[prop] + ';')();
}
});
}
}
if (this.checks[spec.id]) {
this.checks[spec.id].configure(spec);
} else {
this.checks[spec.id] = new check_default(spec);
}
}
}, {
key: 'run',
value: function run(context, options, resolve, reject) {
var _this20 = this;
_normalizeRunOptions(options);
dq_element_default.setRunOptions(options);
var internalsQueue = queue_default();
internalsQueue.defer(external.loadElementInternals());
internalsQueue.then(function() {
axe._selectCache = [];
var allRulesToRun = getRulesToRun(_this20.rules, context, options);
var runNowRules = allRulesToRun.now;
var runLaterRules = allRulesToRun.later;
var nowRulesQueue = queue_default();
runNowRules.forEach(function(rule) {
nowRulesQueue.defer(getDefferedRule(rule, context, options));
});
var preloaderQueue = queue_default();
if (runLaterRules.length) {
preloaderQueue.defer(function(res) {
_preload(options).then(function(assets) {
return res(assets);
})['catch'](function(err2) {
console.warn('Couldn\'t load preload assets: ', err2);
res(void 0);
});
});
}
var queueForNowRulesAndPreloader = queue_default();
queueForNowRulesAndPreloader.defer(nowRulesQueue);
queueForNowRulesAndPreloader.defer(preloaderQueue);
queueForNowRulesAndPreloader.then(function(nowRulesAndPreloaderResults) {
var assetsFromQueue = nowRulesAndPreloaderResults.pop();
if (assetsFromQueue && assetsFromQueue.length) {
var assets = assetsFromQueue[0];
if (assets) {
context = _extends({}, context, assets);
}
}
var nowRulesResults = nowRulesAndPreloaderResults[0];
if (!runLaterRules.length) {
axe._selectCache = void 0;
resolve(nowRulesResults.filter(function(result) {
return !!result;
}));
return;
}
var laterRulesQueue = queue_default();
runLaterRules.forEach(function(rule) {
var deferredRule = getDefferedRule(rule, context, options);
laterRulesQueue.defer(deferredRule);
});
laterRulesQueue.then(function(laterRuleResults) {
axe._selectCache = void 0;
resolve(nowRulesResults.concat(laterRuleResults).filter(function(result) {
return !!result;
}));
})['catch'](reject);
})['catch'](reject);
})['catch'](reject);
}
}, {
key: 'after',
value: function after(results, options) {
var rules = this.rules;
return results.map(function(ruleResult) {
if (ruleResult.error) {
return ruleResult;
}
var rule = find_by_default(rules, 'id', ruleResult.id);
if (!rule) {
throw new Error('Result for unknown rule. You may be running mismatch axe-core versions');
}
try {
return rule.after(ruleResult, options);
} catch (err2) {
if (options.debug) {
throw err2;
}
return createIncompleteErrorResult(rule, err2);
}
});
}
}, {
key: 'getRule',
value: function getRule(ruleId) {
return this.rules.find(function(rule) {
return rule.id === ruleId;
});
}
}, {
key: 'setBranding',
value: function setBranding(branding) {
if (typeof branding === 'string') {
this.application = branding;
}
if (branding && branding.hasOwnProperty('brand') && branding.brand && typeof branding.brand === 'string') {
this.brand = branding.brand;
}
if (branding && branding.hasOwnProperty('application') && branding.application && typeof branding.application === 'string') {
this.application = branding.application;
}
}
}, {
key: '_constructHelpUrls',
value: function _constructHelpUrls() {
var _this21 = this;
var previous = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
var version = (axe.version.match(/^[1-9][0-9]*\.[0-9]+/) || [ 'x.y' ])[0];
this.rules.forEach(function(rule) {
if (!_this21.data.rules[rule.id]) {
_this21.data.rules[rule.id] = {};
}
var metaData = _this21.data.rules[rule.id];
if (typeof metaData.helpUrl !== 'string' || previous && metaData.helpUrl === getHelpUrl(previous, rule.id, version)) {
metaData.helpUrl = getHelpUrl(_this21, rule.id, version);
}
});
}
}, {
key: 'resetRulesAndChecks',
value: function resetRulesAndChecks() {
this._init();
this._resetLocale();
}
} ]);
}();
var audit_default = Audit;
function getDefaultOrigin() {
if (window.origin && window.origin !== 'null') {
return window.origin;
}
if (window.location && window.location.origin && window.location.origin !== 'null') {
return window.location.origin;
}
}
function getDefaultConfiguration(audit) {
var config;
if (audit) {
config = clone2(audit);
config.commons = audit.commons;
} else {
config = {};
}
config.reporter = config.reporter || null;
config.noHtml = config.noHtml || false;
if (!config.allowedOrigins) {
var defaultOrigin = getDefaultOrigin();
config.allowedOrigins = defaultOrigin ? [ defaultOrigin ] : [];
}
config.rules = config.rules || [];
config.checks = config.checks || [];
config.data = _extends({
checks: {},
rules: {}
}, config.data);
return config;
}
function unpackToObject(collection, audit, method) {
var i, l;
for (i = 0, l = collection.length; i < l; i++) {
audit[method](collection[i]);
}
}
var mergeCheckLocale = function mergeCheckLocale(a2, b3) {
var pass = b3.pass, fail = b3.fail;
if (typeof pass === 'string' && dotRegex.test(pass)) {
pass = import_dot['default'].compile(pass);
}
if (typeof fail === 'string' && dotRegex.test(fail)) {
fail = import_dot['default'].compile(fail);
}
return _extends({}, a2, {
messages: {
pass: pass || a2.messages.pass,
fail: fail || a2.messages.fail,
incomplete: _typeof(a2.messages.incomplete) === 'object' ? _extends({}, a2.messages.incomplete, b3.incomplete) : b3.incomplete
}
});
};
var mergeRuleLocale = function mergeRuleLocale(a2, b3) {
var help = b3.help, description = b3.description;
if (typeof help === 'string' && dotRegex.test(help)) {
help = import_dot['default'].compile(help);
}
if (typeof description === 'string' && dotRegex.test(description)) {
description = import_dot['default'].compile(description);
}
return _extends({}, a2, {
help: help || a2.help,
description: description || a2.description
});
};
var mergeFailureMessage = function mergeFailureMessage(a2, b3) {
var failureMessage = b3.failureMessage;
if (typeof failureMessage === 'string' && dotRegex.test(failureMessage)) {
failureMessage = import_dot['default'].compile(failureMessage);
}
return _extends({}, a2, {
failureMessage: failureMessage || a2.failureMessage
});
};
var mergeFallbackMessage = function mergeFallbackMessage(a2, b3) {
if (typeof b3 === 'string' && dotRegex.test(b3)) {
b3 = import_dot['default'].compile(b3);
}
return b3 || a2;
};
function getRulesToRun(rules, context, options) {
var base = {
now: [],
later: []
};
var splitRules = rules.reduce(function(out, rule) {
if (!rule_should_run_default(rule, context, options)) {
return out;
}
if (rule.preload) {
out.later.push(rule);
return out;
}
out.now.push(rule);
return out;
}, base);
return splitRules;
}
function getDefferedRule(rule, context, options) {
if (options.performanceTimer) {
performance_timer_default.mark('mark_rule_start_' + rule.id);
}
return function(resolve, reject) {
rule.run(context, options, function(ruleResult) {
return resolve(ruleResult);
}, function(err2) {
if (options.debug) {
reject(err2);
} else {
resolve(createIncompleteErrorResult(rule, err2));
}
});
};
}
function createIncompleteErrorResult(rule, error) {
var errorNode = error.errorNode;
var serialError = _serializeError(error);
var none = [ {
id: 'error-occurred',
result: void 0,
data: serialError,
relatedNodes: []
} ];
var node = errorNode || new dq_element_default(document.documentElement);
return Object.assign(new rule_result_default(rule), {
error: serialError,
result: constants_default.CANTTELL,
nodes: [ {
any: [],
all: [],
none: none,
node: node
} ]
});
}
function getHelpUrl(_ref172, ruleId, version) {
var brand = _ref172.brand, application = _ref172.application, lang = _ref172.lang;
return constants_default.helpUrlBase + brand + '/' + (version || axe.version.substring(0, axe.version.lastIndexOf('.'))) + '/' + ruleId + '?application=' + encodeURIComponent(application) + (lang && lang !== 'en' ? '&lang=' + encodeURIComponent(lang) : '');
}
function setupGlobals(context) {
var hasWindow = window && 'Node' in window && 'NodeList' in window;
var hasDoc = !!document;
if (hasWindow && hasDoc) {
return;
}
if (!context || !context.ownerDocument) {
throw new Error('Required "window" or "document" globals not defined and cannot be deduced from the context. Either set the globals before running or pass in a valid Element.');
}
if (!hasDoc) {
cache_default.set('globalDocumentSet', true);
document = context.ownerDocument;
}
if (!hasWindow) {
cache_default.set('globalWindowSet', true);
window = document.defaultView;
}
}
function resetGlobals() {
if (cache_default.get('globalDocumentSet')) {
cache_default.set('globalDocumentSet', false);
document = null;
}
if (cache_default.get('globalWindowSet')) {
cache_default.set('globalWindowSet', false);
window = null;
}
}
function teardown() {
resetGlobals();
axe._memoizedFns.forEach(function(fn) {
return fn.clear();
});
cache_default.clear();
axe._tree = void 0;
axe._selectorData = void 0;
axe._selectCache = void 0;
}
var teardown_default = teardown;
function runRules(context, options, resolve, reject) {
try {
context = new Context(context);
axe._tree = context.flatTree;
axe._selectorData = _getSelectorData(context.flatTree);
} catch (e) {
teardown_default();
return reject(e);
}
var q2 = queue_default();
var audit = axe._audit;
if (options.performanceTimer) {
performance_timer_default.auditStart();
}
if (context.frames.length && options.iframes !== false) {
q2.defer(function(res, rej) {
_collectResultsFromFrames(context, options, 'rules', null, res, rej);
});
}
q2.defer(function(res, rej) {
audit.run(context, options, res, rej);
});
q2.then(function(data) {
try {
if (options.performanceTimer) {
performance_timer_default.auditEnd();
}
var results = merge_results_default(data.map(function(res) {
return {
results: res
};
}));
if (context.initiator) {
if (options.performanceTimer) {
performance_timer_default.mark('auditAfterStart');
}
results = audit.after(results, options);
if (options.performanceTimer) {
performance_timer_default.mark('auditAfterEnd');
performance_timer_default.measure('audit.after', 'auditAfterStart', 'auditAfterEnd');
performance_timer_default.logMeasures('audit.after');
}
results.forEach(_publishMetaData);
results = results.map(_finalizeRuleResult);
}
try {
resolve(results, teardown_default);
} catch (e) {
teardown_default();
log(e);
}
} catch (e) {
teardown_default();
reject(e);
}
})['catch'](function(e) {
teardown_default();
reject(e);
});
}
function load(audit) {
axe._audit = new audit_default(audit);
}
function runCommand(data, keepalive, callback) {
var resolve = callback;
var reject = function reject2(err2) {
if (err2 instanceof Error === false) {
err2 = new Error(err2);
}
callback(err2);
};
var context = data && data.context || {};
if (context.hasOwnProperty('include') && !context.include.length) {
context.include = [ document ];
}
var options = data && data.options || {};
switch (data.command) {
case 'rules':
return runRules(context, options, function(results, cleanupFn) {
results = node_serializer_default.mapRawResults(results);
resolve(results);
cleanupFn();
}, reject);
case 'cleanup-plugin':
return cleanup_default(resolve, reject);
default:
if (axe._audit && axe._audit.commands && axe._audit.commands[data.command]) {
return axe._audit.commands[data.command](data, callback);
}
}
}
if (window.top !== window) {
_respondable.subscribe('axe.start', runCommand);
_respondable.subscribe('axe.ping', function(data, keepalive, respond) {
respond({
axe: true
});
});
}
function Plugin(spec) {
this._run = spec.run;
this._collect = spec.collect;
this._registry = {};
spec.commands.forEach(function(command) {
axe._audit.registerCommand(command);
});
}
Plugin.prototype.run = function run3() {
return this._run.apply(this, arguments);
};
Plugin.prototype.collect = function collect() {
return this._collect.apply(this, arguments);
};
Plugin.prototype.cleanup = function cleanup2(done) {
var q2 = axe.utils.queue();
var that = this;
Object.keys(this._registry).forEach(function(key) {
q2.defer(function(_done) {
that._registry[key].cleanup(_done);
});
});
q2.then(done);
};
Plugin.prototype.add = function add(impl) {
this._registry[impl.id] = impl;
};
function registerPlugin(plugin) {
axe.plugins[plugin.id] = new Plugin(plugin);
}
var plugins_default = registerPlugin;
function reset() {
var audit = axe._audit;
if (!audit) {
throw new Error('No audit configured');
}
audit.resetRulesAndChecks();
resetStandards();
}
var reset_default = reset;
function resetLocale() {
var audit = axe._audit;
if (!audit) {
throw new Error('No audit configured');
}
audit._resetLocale();
}
var reset_locale_default = resetLocale;
function runVirtualRule(ruleId, vNode) {
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
options.reporter = options.reporter || axe._audit.reporter || 'v1';
axe._selectorData = {};
if (!(vNode instanceof abstract_virtual_node_default)) {
vNode = new serial_virtual_node_default(vNode);
}
var rule = _getRule(ruleId);
if (!rule) {
throw new Error('unknown rule `' + ruleId + '`');
}
rule = Object.create(rule, {
excludeHidden: {
value: false
}
});
var context = {
initiator: true,
include: [ vNode ],
exclude: [],
frames: [],
page: false,
focusable: true,
size: {},
flatTree: []
};
var rawResults = rule.runSync(context, options);
_publishMetaData(rawResults);
_finalizeRuleResult(rawResults);
var results = aggregate_result_default([ rawResults ]);
results.violations.forEach(function(result) {
return result.nodes.forEach(function(nodeResult) {
nodeResult.failureSummary = failure_summary_default(nodeResult);
});
});
return _extends({}, _getEnvironmentData(), results, {
toolOptions: options
});
}
function normalizeRunParams(_ref173) {
var _ref175, _options$reporter, _axe$_audit2;
var _ref174 = _slicedToArray(_ref173, 3), context = _ref174[0], options = _ref174[1], callback = _ref174[2];
var typeErr = new TypeError('axe.run arguments are invalid');
if (!_isContextSpec(context)) {
if (callback !== void 0) {
throw typeErr;
}
callback = options;
options = context;
context = document;
}
if (_typeof(options) !== 'object') {
if (callback !== void 0) {
throw typeErr;
}
callback = options;
options = {};
}
if (typeof callback !== 'function' && callback !== void 0) {
throw typeErr;
}
options = clone2(options);
options.reporter = (_ref175 = (_options$reporter = options.reporter) !== null && _options$reporter !== void 0 ? _options$reporter : (_axe$_audit2 = axe._audit) === null || _axe$_audit2 === void 0 ? void 0 : _axe$_audit2.reporter) !== null && _ref175 !== void 0 ? _ref175 : 'v1';
return {
context: context,
options: options,
callback: callback
};
}
var noop2 = function noop2() {};
function run4() {
for (var _len9 = arguments.length, args = new Array(_len9), _key12 = 0; _key12 < _len9; _key12++) {
args[_key12] = arguments[_key12];
}
setupGlobals(args[0]);
var _normalizeRunParams = normalizeRunParams(args), context = _normalizeRunParams.context, options = _normalizeRunParams.options, _normalizeRunParams$c = _normalizeRunParams.callback, callback = _normalizeRunParams$c === void 0 ? noop2 : _normalizeRunParams$c;
var _getPromiseHandlers = getPromiseHandlers(callback), thenable = _getPromiseHandlers.thenable, resolve = _getPromiseHandlers.resolve, reject = _getPromiseHandlers.reject;
try {
assert_default(axe._audit, 'No audit configured');
assert_default(!axe._running, 'Axe is already running. Use `await axe.run()` to wait for the previous run to finish before starting a new run.');
} catch (e) {
return handleError(e, callback);
}
axe._running = true;
if (options.performanceTimer) {
performance_timer_default.start();
}
function handleRunRules(rawResults, teardown2) {
var respond = function respond(results) {
if (options.performanceTimer) {
performance_timer_default.mark('reporterEnd');
performance_timer_default.measure('reporter', 'reporterStart', 'reporterEnd');
performance_timer_default.logMeasures('reporter');
performance_timer_default.end();
}
axe._running = false;
teardown2();
try {
resolve(results);
} catch (e) {
axe.log(e);
}
};
var wrappedReject = function wrappedReject(err2) {
axe._running = false;
teardown2();
try {
reject(err2);
} catch (e) {
axe.log(e);
}
};
try {
if (options.performanceTimer) {
performance_timer_default.mark('reporterStart');
}
createReport(rawResults, options, respond, wrappedReject);
} catch (err2) {
wrappedReject(err2);
}
}
function errorRunRules(err2) {
if (options.performanceTimer) {
performance_timer_default.end();
}
axe._running = false;
callback(err2);
reject(err2);
}
axe._runRules(context, options, handleRunRules, errorRunRules);
return thenable;
}
function getPromiseHandlers(callback) {
var thenable, reject, resolve;
if (typeof Promise === 'function' && callback === noop2) {
thenable = new Promise(function(_resolve, _reject) {
reject = _reject;
resolve = _resolve;
});
} else {
resolve = function resolve(result) {
return callback(null, result);
};
reject = function reject(err2) {
return callback(err2);
};
}
return {
thenable: thenable,
reject: reject,
resolve: resolve
};
}
function createReport(rawResults, options, respond, reject) {
var reporter = getReporter(options.reporter);
var results = reporter(rawResults, options, respond, reject);
if (results !== void 0) {
respond(results);
}
}
function handleError(err2, callback) {
if (typeof callback === 'function' && callback !== noop2) {
callback(err2.message);
return;
}
throw err2;
}
function runPartial() {
for (var _len0 = arguments.length, args = new Array(_len0), _key13 = 0; _key13 < _len0; _key13++) {
args[_key13] = arguments[_key13];
}
var _normalizeRunParams2 = normalizeRunParams(args), options = _normalizeRunParams2.options, context = _normalizeRunParams2.context;
assert_default(axe._audit, 'Axe is not configured. Audit is missing.');
assert_default(!axe._running, 'Axe is already running. Use `await axe.run()` to wait for the previous run to finish before starting a new run.');
var contextObj = new Context(context, axe._tree);
axe._tree = contextObj.flatTree;
axe._selectorData = _getSelectorData(contextObj.flatTree);
axe._running = true;
options.elementRef = false;
return new Promise(function(res, rej) {
if (options.performanceTimer) {
performance_timer_default.auditStart();
}
axe._audit.run(contextObj, options, res, rej);
}).then(function(results) {
if (options.performanceTimer) {
performance_timer_default.auditEnd();
}
results = node_serializer_default.mapRawResults(results);
var frames = contextObj.frames.map(function(_ref176) {
var node = _ref176.node;
return node_serializer_default.toSpec(node);
});
var environmentData;
if (contextObj.initiator) {
environmentData = _getEnvironmentData();
}
axe._running = false;
teardown_default();
return {
results: results,
frames: frames,
environmentData: environmentData
};
})['catch'](function(err2) {
axe._running = false;
teardown_default();
return Promise.reject(err2);
});
}
function finishRun(partialResults) {
var _ref178, _options$reporter2, _axe$_audit3;
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
options = clone2(options);
var _ref177 = partialResults.find(function(r) {
return r.environmentData;
}) || {}, environmentData = _ref177.environmentData;
_normalizeRunOptions(options);
options.reporter = (_ref178 = (_options$reporter2 = options.reporter) !== null && _options$reporter2 !== void 0 ? _options$reporter2 : (_axe$_audit3 = axe._audit) === null || _axe$_audit3 === void 0 ? void 0 : _axe$_audit3.reporter) !== null && _ref178 !== void 0 ? _ref178 : 'v1';
setFrameSpec(partialResults);
var results = merge_results_default(partialResults);
results = axe._audit.after(results, options);
results.forEach(_publishMetaData);
results = results.map(_finalizeRuleResult);
return createReport2(results, _extends({
environmentData: environmentData
}, options));
}
function setFrameSpec(partialResults) {
var frameStack = [];
var _iterator35 = _createForOfIteratorHelper(partialResults), _step35;
try {
for (_iterator35.s(); !(_step35 = _iterator35.n()).done; ) {
var partialResult = _step35.value;
var frameSpec = frameStack.shift();
if (!partialResult) {
continue;
}
partialResult.frameSpec = frameSpec !== null && frameSpec !== void 0 ? frameSpec : null;
var frameSpecs = getMergedFrameSpecs(partialResult);
frameStack.unshift.apply(frameStack, _toConsumableArray(frameSpecs));
}
} catch (err) {
_iterator35.e(err);
} finally {
_iterator35.f();
}
}
function getMergedFrameSpecs(_ref179) {
var childFrameSpecs = _ref179.frames, parentFrameSpec = _ref179.frameSpec;
if (!parentFrameSpec) {
return childFrameSpecs;
}
return childFrameSpecs.map(function(childFrameSpec) {
return node_serializer_default.mergeSpecs(childFrameSpec, parentFrameSpec);
});
}
function createReport2(results, options) {
return new Promise(function(resolve, reject) {
var reporter = getReporter(options.reporter);
reporter(results, options, resolve, reject);
});
}
function setup(node) {
if (axe._tree) {
throw new Error('Axe is already setup. Call `axe.teardown()` before calling `axe.setup` again.');
}
if (node && _typeof(node.documentElement) === 'object' && _typeof(node.defaultView) === 'object') {
node = node.documentElement;
}
setupGlobals(node);
axe._tree = _getFlattenedTree(node);
axe._selectorData = _getSelectorData(axe._tree);
return axe._tree[0];
}
var setup_default = setup;
var naReporter = function naReporter(results, options, callback) {
console.warn('"na" reporter will be deprecated in axe v4.0. Use the "v2" reporter instead.');
if (typeof options === 'function') {
callback = options;
options = {};
}
var _options3 = options, environmentData = _options3.environmentData, toolOptions = _objectWithoutProperties(_options3, _excluded13);
callback(_extends({}, _getEnvironmentData(environmentData), {
toolOptions: toolOptions
}, processAggregate(results, options)));
};
var na_default = naReporter;
var noPassesReporter = function noPassesReporter(results, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
var _options4 = options, environmentData = _options4.environmentData, toolOptions = _objectWithoutProperties(_options4, _excluded14);
options.resultTypes = [ 'violations' ];
var _processAggregate = processAggregate(results, options), violations = _processAggregate.violations;
callback(_extends({}, _getEnvironmentData(environmentData), {
toolOptions: toolOptions,
violations: violations
}));
};
var no_passes_default = noPassesReporter;
var rawReporter = function rawReporter(results, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
if (!results || !Array.isArray(results)) {
return callback(results);
}
var transformedResults = results.map(function(result) {
var transformedResult = _extends({}, result);
var types = [ 'passes', 'violations', 'incomplete', 'inapplicable' ];
for (var _i46 = 0, _types2 = types; _i46 < _types2.length; _i46++) {
var type2 = _types2[_i46];
transformedResult[type2] = node_serializer_default.mapRawNodeResults(transformedResult[type2]);
}
return transformedResult;
});
callback(transformedResults);
};
var raw_default = rawReporter;
var rawEnvReporter = function rawEnvReporter(results, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
var _options5 = options, environmentData = _options5.environmentData, toolOptions = _objectWithoutProperties(_options5, _excluded15);
raw_default(results, toolOptions, function(raw) {
var env = _getEnvironmentData(environmentData);
callback({
raw: raw,
env: env
});
});
};
var raw_env_default = rawEnvReporter;
var v1Reporter = function v1Reporter(results, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
var _options6 = options, environmentData = _options6.environmentData, toolOptions = _objectWithoutProperties(_options6, _excluded16);
var out = processAggregate(results, options);
var addFailureSummaries = function addFailureSummaries(result) {
result.nodes.forEach(function(nodeResult) {
nodeResult.failureSummary = failure_summary_default(nodeResult);
});
};
out.incomplete.forEach(addFailureSummaries);
out.violations.forEach(addFailureSummaries);
callback(_extends({}, _getEnvironmentData(environmentData), {
toolOptions: toolOptions
}, out));
};
var v1_default = v1Reporter;
var v2Reporter = function v2Reporter(results, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
var _options7 = options, environmentData = _options7.environmentData, toolOptions = _objectWithoutProperties(_options7, _excluded17);
var out = processAggregate(results, options);
callback(_extends({}, _getEnvironmentData(environmentData), {
toolOptions: toolOptions
}, out));
};
var v2_default = v2Reporter;
var _thisWillBeDeletedDoNotUse = {
base: {
Audit: audit_default,
CheckResult: check_result_default,
Check: check_default,
Context: Context,
RuleResult: rule_result_default,
Rule: Rule,
metadataFunctionMap: metadata_function_map_default
},
public: {
reporters: reporters,
external: external
},
helpers: {
failureSummary: failure_summary_default,
incompleteFallbackMessage: incompleteFallbackMessage,
processAggregate: processAggregate
},
utils: {
setDefaultFrameMessenger: setDefaultFrameMessenger,
cacheNodeSelectors: cacheNodeSelectors,
getNodesMatchingExpression: getNodesMatchingExpression,
convertSelector: _convertSelector
},
commons: {
dom: {
nativelyHidden: nativelyHidden,
displayHidden: displayHidden,
visibilityHidden: visibilityHidden,
contentVisibiltyHidden: contentVisibiltyHidden,
ariaHidden: ariaHidden,
opacityHidden: opacityHidden,
scrollHidden: scrollHidden,
overflowHidden: overflowHidden,
clipHidden: clipHidden,
areaHidden: areaHidden,
detailsHidden: detailsHidden
}
}
};
var exposed_for_testing_default = _thisWillBeDeletedDoNotUse;
axe._thisWillBeDeletedDoNotUse = exposed_for_testing_default;
axe.constants = constants_default;
axe.log = log;
axe._setLogger = setLogger;
axe.AbstractVirtualNode = abstract_virtual_node_default;
axe.SerialVirtualNode = serial_virtual_node_default;
axe.VirtualNode = virtual_node_default;
axe._cache = cache_default;
axe.imports = imports_exports;
axe.cleanup = cleanup_default;
axe.configure = configure_default;
axe.externalAPIs = externalAPIs;
axe.frameMessenger = frameMessenger2;
axe.getRules = get_rules_default;
axe._load = load;
axe.plugins = {};
axe.registerPlugin = plugins_default;
axe.hasReporter = hasReporter;
axe.getReporter = getReporter;
axe.addReporter = addReporter;
axe.reset = reset_default;
axe.resetLocale = reset_locale_default;
axe._runRules = runRules;
axe.runVirtualRule = runVirtualRule;
axe.run = run4;
axe.setup = setup_default;
axe.teardown = teardown_default;
axe.runPartial = runPartial;
axe.finishRun = finishRun;
axe.commons = commons_exports;
axe.utils = utils_exports;
axe.addReporter('na', na_default);
axe.addReporter('no-passes', no_passes_default);
axe.addReporter('rawEnv', raw_env_default);
axe.addReporter('raw', raw_default);
axe.addReporter('v1', v1_default);
axe.addReporter('v2', v2_default);
})();
'use strict';
axe._load({
lang: 'en',
data: {
rules: {
accesskeys: {
description: 'Ensure every accesskey attribute value is unique',
help: 'accesskey attribute value should be unique'
},
'area-alt': {
description: 'Ensure <area> elements of image maps have alternative text',
help: 'Active <area> elements must have alternative text'
},
'aria-allowed-attr': {
description: 'Ensure an element\'s role supports its ARIA attributes',
help: 'Elements must only use supported ARIA attributes'
},
'aria-allowed-role': {
description: 'Ensure role attribute has an appropriate value for the element',
help: 'ARIA role should be appropriate for the element'
},
'aria-braille-equivalent': {
description: 'Ensure aria-braillelabel and aria-brailleroledescription have a non-braille equivalent',
help: 'aria-braille attributes must have a non-braille equivalent'
},
'aria-command-name': {
description: 'Ensure every ARIA button, link and menuitem has an accessible name',
help: 'ARIA commands must have an accessible name'
},
'aria-conditional-attr': {
description: 'Ensure ARIA attributes are used as described in the specification of the element\'s role',
help: 'ARIA attributes must be used as specified for the element\'s role'
},
'aria-deprecated-role': {
description: 'Ensure elements do not use deprecated roles',
help: 'Deprecated ARIA roles must not be used'
},
'aria-dialog-name': {
description: 'Ensure every ARIA dialog and alertdialog node has an accessible name',
help: 'ARIA dialog and alertdialog nodes should have an accessible name'
},
'aria-hidden-body': {
description: 'Ensure aria-hidden="true" is not present on the document body.',
help: 'aria-hidden="true" must not be present on the document body'
},
'aria-hidden-focus': {
description: 'Ensure aria-hidden elements are not focusable nor contain focusable elements',
help: 'ARIA hidden element must not be focusable or contain focusable elements'
},
'aria-input-field-name': {
description: 'Ensure every ARIA input field has an accessible name',
help: 'ARIA input fields must have an accessible name'
},
'aria-meter-name': {
description: 'Ensure every ARIA meter node has an accessible name',
help: 'ARIA meter nodes must have an accessible name'
},
'aria-progressbar-name': {
description: 'Ensure every ARIA progressbar node has an accessible name',
help: 'ARIA progressbar nodes must have an accessible name'
},
'aria-prohibited-attr': {
description: 'Ensure ARIA attributes are not prohibited for an element\'s role',
help: 'Elements must only use permitted ARIA attributes'
},
'aria-required-attr': {
description: 'Ensure elements with ARIA roles have all required ARIA attributes',
help: 'Required ARIA attributes must be provided'
},
'aria-required-children': {
description: 'Ensure elements with an ARIA role that require child roles contain them',
help: 'Certain ARIA roles must contain particular children'
},
'aria-required-parent': {
description: 'Ensure elements with an ARIA role that require parent roles are contained by them',
help: 'Certain ARIA roles must be contained by particular parents'
},
'aria-roledescription': {
description: 'Ensure aria-roledescription is only used on elements with an implicit or explicit role',
help: 'aria-roledescription must be on elements with a semantic role'
},
'aria-roles': {
description: 'Ensure all elements with a role attribute use a valid value',
help: 'ARIA roles used must conform to valid values'
},
'aria-tab-name': {
description: 'Ensure every ARIA tab node has an accessible name',
help: 'ARIA tab nodes must have an accessible name'
},
'aria-text': {
description: 'Ensure role="text" is used on elements with no focusable descendants',
help: '"role=text" should have no focusable descendants'
},
'aria-toggle-field-name': {
description: 'Ensure every ARIA toggle field has an accessible name',
help: 'ARIA toggle fields must have an accessible name'
},
'aria-tooltip-name': {
description: 'Ensure every ARIA tooltip node has an accessible name',
help: 'ARIA tooltip nodes must have an accessible name'
},
'aria-treeitem-name': {
description: 'Ensure every ARIA treeitem node has an accessible name',
help: 'ARIA treeitem nodes should have an accessible name'
},
'aria-valid-attr-value': {
description: 'Ensure all ARIA attributes have valid values',
help: 'ARIA attributes must conform to valid values'
},
'aria-valid-attr': {
description: 'Ensure attributes that begin with aria- are valid ARIA attributes',
help: 'ARIA attributes must conform to valid names'
},
'audio-caption': {
description: 'Ensure <audio> elements have captions',
help: '<audio> elements must have a captions track'
},
'autocomplete-valid': {
description: 'Ensure the autocomplete attribute is correct and suitable for the form field',
help: 'autocomplete attribute must be used correctly'
},
'avoid-inline-spacing': {
description: 'Ensure that text spacing set through style attributes can be adjusted with custom stylesheets',
help: 'Inline text spacing must be adjustable with custom stylesheets'
},
blink: {
description: 'Ensure <blink> elements are not used',
help: '<blink> elements are deprecated and must not be used'
},
'button-name': {
description: 'Ensure buttons have discernible text',
help: 'Buttons must have discernible text'
},
bypass: {
description: 'Ensure each page has at least one mechanism for a user to bypass navigation and jump straight to the content',
help: 'Page must have means to bypass repeated blocks'
},
'color-contrast-enhanced': {
description: 'Ensure the contrast between foreground and background colors meets WCAG 2 AAA enhanced contrast ratio thresholds',
help: 'Elements must meet enhanced color contrast ratio thresholds'
},
'color-contrast': {
description: 'Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds',
help: 'Elements must meet minimum color contrast ratio thresholds'
},
'css-orientation-lock': {
description: 'Ensure content is not locked to any specific display orientation, and the content is operable in all display orientations',
help: 'CSS Media queries must not lock display orientation'
},
'definition-list': {
description: 'Ensure <dl> elements are structured correctly',
help: '<dl> elements must only directly contain properly-ordered <dt> and <dd> groups, <script>, <template> or <div> elements'
},
dlitem: {
description: 'Ensure <dt> and <dd> elements are contained by a <dl>',
help: '<dt> and <dd> elements must be contained by a <dl>'
},
'document-title': {
description: 'Ensure each HTML document contains a non-empty <title> element',
help: 'Documents must have <title> element to aid in navigation'
},
'duplicate-id-active': {
description: 'Ensure every id attribute value of active elements is unique',
help: 'IDs of active elements must be unique'
},
'duplicate-id-aria': {
description: 'Ensure every id attribute value used in ARIA and in labels is unique',
help: 'IDs used in ARIA and labels must be unique'
},
'duplicate-id': {
description: 'Ensure every id attribute value is unique',
help: 'id attribute value must be unique'
},
'empty-heading': {
description: 'Ensure headings have discernible text',
help: 'Headings should not be empty'
},
'empty-table-header': {
description: 'Ensure table headers have discernible text',
help: 'Table header text should not be empty'
},
'focus-order-semantics': {
description: 'Ensure elements in the focus order have a role appropriate for interactive content',
help: 'Elements in the focus order should have an appropriate role'
},
'form-field-multiple-labels': {
description: 'Ensure form field does not have multiple label elements',
help: 'Form field must not have multiple label elements'
},
'frame-focusable-content': {
description: 'Ensure <frame> and <iframe> elements with focusable content do not have tabindex=-1',
help: 'Frames with focusable content must not have tabindex=-1'
},
'frame-tested': {
description: 'Ensure <iframe> and <frame> elements contain the axe-core script',
help: 'Frames should be tested with axe-core'
},
'frame-title-unique': {
description: 'Ensure <iframe> and <frame> elements contain a unique title attribute',
help: 'Frames must have a unique title attribute'
},
'frame-title': {
description: 'Ensure <iframe> and <frame> elements have an accessible name',
help: 'Frames must have an accessible name'
},
'heading-order': {
description: 'Ensure the order of headings is semantically correct',
help: 'Heading levels should only increase by one'
},
'hidden-content': {
description: 'Inform users about hidden content.',
help: 'Hidden content on the page should be analyzed'
},
'html-has-lang': {
description: 'Ensure every HTML document has a lang attribute',
help: '<html> element must have a lang attribute'
},
'html-lang-valid': {
description: 'Ensure the lang attribute of the <html> element has a valid value',
help: '<html> element must have a valid value for the lang attribute'
},
'html-xml-lang-mismatch': {
description: 'Ensure that HTML elements with both valid lang and xml:lang attributes agree on the base language of the page',
help: 'HTML elements with lang and xml:lang must have the same base language'
},
'identical-links-same-purpose': {
description: 'Ensure that links with the same accessible name serve a similar purpose',
help: 'Links with the same name must have a similar purpose'
},
'image-alt': {
description: 'Ensure <img> elements have alternative text or a role of none or presentation',
help: 'Images must have alternative text'
},
'image-redundant-alt': {
description: 'Ensure image alternative is not repeated as text',
help: 'Alternative text of images should not be repeated as text'
},
'input-button-name': {
description: 'Ensure input buttons have discernible text',
help: 'Input buttons must have discernible text'
},
'input-image-alt': {
description: 'Ensure <input type="image"> elements have alternative text',
help: 'Image buttons must have alternative text'
},
'label-content-name-mismatch': {
description: 'Ensure that elements labelled through their content must have their visible text as part of their accessible name',
help: 'Elements must have their visible text as part of their accessible name'
},
'label-title-only': {
description: 'Ensure that every form element has a visible label and is not solely labeled using hidden labels, or the title or aria-describedby attributes',
help: 'Form elements should have a visible label'
},
label: {
description: 'Ensure every form element has a label',
help: 'Form elements must have labels'
},
'landmark-banner-is-top-level': {
description: 'Ensure the banner landmark is at top level',
help: 'Banner landmark should not be contained in another landmark'
},
'landmark-complementary-is-top-level': {
description: 'Ensure the complementary landmark or aside is at top level',
help: 'Aside should not be contained in another landmark'
},
'landmark-contentinfo-is-top-level': {
description: 'Ensure the contentinfo landmark is at top level',
help: 'Contentinfo landmark should not be contained in another landmark'
},
'landmark-main-is-top-level': {
description: 'Ensure the main landmark is at top level',
help: 'Main landmark should not be contained in another landmark'
},
'landmark-no-duplicate-banner': {
description: 'Ensure the document has at most one banner landmark',
help: 'Document should not have more than one banner landmark'
},
'landmark-no-duplicate-contentinfo': {
description: 'Ensure the document has at most one contentinfo landmark',
help: 'Document should not have more than one contentinfo landmark'
},
'landmark-no-duplicate-main': {
description: 'Ensure the document has at most one main landmark',
help: 'Document should not have more than one main landmark'
},
'landmark-one-main': {
description: 'Ensure the document has a main landmark',
help: 'Document should have one main landmark'
},
'landmark-unique': {
description: 'Ensure landmarks are unique',
help: 'Landmarks should have a unique role or role/label/title (i.e. accessible name) combination'
},
'link-in-text-block': {
description: 'Ensure links are distinguished from surrounding text in a way that does not rely on color',
help: 'Links must be distinguishable without relying on color'
},
'link-name': {
description: 'Ensure links have discernible text',
help: 'Links must have discernible text'
},
list: {
description: 'Ensure that lists are structured correctly',
help: '<ul> and <ol> must only directly contain <li>, <script> or <template> elements'
},
listitem: {
description: 'Ensure <li> elements are used semantically',
help: '<li> elements must be contained in a <ul> or <ol>'
},
marquee: {
description: 'Ensure <marquee> elements are not used',
help: '<marquee> elements are deprecated and must not be used'
},
'meta-refresh-no-exceptions': {
description: 'Ensure <meta http-equiv="refresh"> is not used for delayed refresh',
help: 'Delayed refresh must not be used'
},
'meta-refresh': {
description: 'Ensure <meta http-equiv="refresh"> is not used for delayed refresh',
help: 'Delayed refresh under 20 hours must not be used'
},
'meta-viewport-large': {
description: 'Ensure <meta name="viewport"> can scale a significant amount',
help: 'Users should be able to zoom and scale the text up to 500%'
},
'meta-viewport': {
description: 'Ensure <meta name="viewport"> does not disable text scaling and zooming',
help: 'Zooming and scaling must not be disabled'
},
'nested-interactive': {
description: 'Ensure interactive controls are not nested as they are not always announced by screen readers or can cause focus problems for assistive technologies',
help: 'Interactive controls must not be nested'
},
'no-autoplay-audio': {
description: 'Ensure <video> or <audio> elements do not autoplay audio for more than 3 seconds without a control mechanism to stop or mute the audio',
help: '<video> or <audio> elements must not play automatically'
},
'object-alt': {
description: 'Ensure <object> elements have alternative text',
help: '<object> elements must have alternative text'
},
'p-as-heading': {
description: 'Ensure bold, italic text and font-size is not used to style <p> elements as a heading',
help: 'Styled <p> elements must not be used as headings'
},
'page-has-heading-one': {
description: 'Ensure that the page, or at least one of its frames contains a level-one heading',
help: 'Page should contain a level-one heading'
},
'presentation-role-conflict': {
description: 'Ensure elements marked as presentational do not have global ARIA or tabindex so that all screen readers ignore them',
help: 'Elements marked as presentational should be consistently ignored'
},
region: {
description: 'Ensure all page content is contained by landmarks',
help: 'All page content should be contained by landmarks'
},
'role-img-alt': {
description: 'Ensure [role="img"] and [role="image"] elements have alternative text',
help: '[role="img"] and [role="image"] elements must have alternative text'
},
'scope-attr-valid': {
description: 'Ensure the scope attribute is used correctly on tables',
help: 'scope attribute should be used correctly'
},
'scrollable-region-focusable': {
description: 'Ensure elements that have scrollable content are accessible by keyboard in Safari',
help: 'Scrollable region must have keyboard access'
},
'select-name': {
description: 'Ensure select element has an accessible name',
help: 'Select element must have an accessible name'
},
'server-side-image-map': {
description: 'Ensure that server-side image maps are not used',
help: 'Server-side image maps must not be used'
},
'skip-link': {
description: 'Ensure all skip links have a focusable target',
help: 'The skip-link target should exist and be focusable'
},
'summary-name': {
description: 'Ensure summary elements have discernible text',
help: 'Summary elements must have discernible text'
},
'svg-img-alt': {
description: 'Ensure <svg> elements with an img, image, graphics-document or graphics-symbol role have accessible text',
help: '<svg> elements with an img or image role must have alternative text'
},
tabindex: {
description: 'Ensure tabindex attribute values are not greater than 0',
help: 'Elements should not have tabindex greater than zero'
},
'table-duplicate-name': {
description: 'Ensure the <caption> element does not contain the same text as the summary attribute',
help: 'Tables should not have the same summary and caption'
},
'table-fake-caption': {
description: 'Ensure that tables with a caption use the <caption> element.',
help: 'Data or header cells must not be used to give caption to a data table.'
},
'target-size': {
description: 'Ensure touch targets have sufficient size and space',
help: 'All touch targets must be 24px large, or leave sufficient space'
},
'td-has-header': {
description: 'Ensure that each non-empty data cell in a <table> larger than 3 by 3 has one or more table headers',
help: 'Non-empty <td> elements in larger <table> must have an associated table header'
},
'td-headers-attr': {
description: 'Ensure that each cell in a table that uses the headers attribute refers only to other <th> elements in that table',
help: 'Table cell headers attributes must refer to other <th> elements in the same table'
},
'th-has-data-cells': {
description: 'Ensure that <th> elements and elements with role=columnheader/rowheader have data cells they describe',
help: 'Table headers in a data table must refer to data cells'
},
'valid-lang': {
description: 'Ensure lang attributes have valid values',
help: 'lang attribute must have a valid value'
},
'video-caption': {
description: 'Ensure <video> elements have captions',
help: '<video> elements must have captions'
}
},
checks: {
abstractrole: {
impact: 'serious',
messages: {
pass: 'Abstract roles are not used',
fail: {
singular: 'Abstract role cannot be directly used: ${data.values}',
plural: 'Abstract roles cannot be directly used: ${data.values}'
}
}
},
'aria-allowed-attr-elm': {
messages: {
pass: 'ARIA attributes are allowed for this element',
fail: {
singular: 'ARIA attribute is not allowed on ${data.nodeName} elements: ${data.values}',
plural: 'ARIA attributes are not allowed on ${data.nodeName} elements: ${data.values}'
}
}
},
'aria-allowed-attr': {
impact: 'critical',
messages: {
pass: 'ARIA attributes are used correctly for the defined role',
fail: {
singular: 'ARIA attribute is not allowed: ${data.values}',
plural: 'ARIA attributes are not allowed: ${data.values}',
caseSensitive: 'The following ARIA attributes have case-sensitive values that must be lowercase: ${data.values}'
},
incomplete: {
default: 'Check that there is no problem if the ARIA attribute is ignored on this element: ${data.values}',
caseSensitive: 'The following ARIA attributes have case-sensitive values that might not be handled correctly by assistive technologies: ${data.values}'
}
}
},
'aria-allowed-role': {
impact: 'minor',
messages: {
pass: 'ARIA role is allowed for given element',
fail: {
singular: 'ARIA role ${data.values} is not allowed for given element',
plural: 'ARIA roles ${data.values} are not allowed for given element'
},
incomplete: {
singular: 'ARIA role ${data.values} must be removed when the element is made visible, as it is not allowed for the element',
plural: 'ARIA roles ${data.values} must be removed when the element is made visible, as they are not allowed for the element'
}
}
},
'aria-busy': {
impact: 'serious',
messages: {
pass: 'Element has an aria-busy attribute',
fail: 'Element uses aria-busy="true" while showing a loader'
}
},
'aria-conditional-attr': {
impact: 'serious',
messages: {
pass: 'ARIA attribute is allowed',
fail: {
checkbox: 'Remove aria-checked, or set it to "${data.checkState}" to match the real checkbox state',
radio: 'Remove aria-checked, or set it to "${data.checkState}" to match the real radio state',
rowSingular: 'This attribute is supported with treegrid rows, but not ${data.ownerRole}: ${data.invalidAttrs}',
rowPlural: 'These attributes are supported with treegrid rows, but not ${data.ownerRole}: ${data.invalidAttrs}'
}
}
},
'aria-errormessage': {
impact: 'critical',
messages: {
pass: 'aria-errormessage exists and references elements visible to screen readers that use a supported aria-errormessage technique',
fail: {
singular: 'aria-errormessage value `${data.values}` must use a technique to announce the message (e.g., aria-live, aria-describedby, role=alert, etc.)',
plural: 'aria-errormessage values `${data.values}` must use a technique to announce the message (e.g., aria-live, aria-describedby, role=alert, etc.)',
unsupported: 'Multiple IDs in aria-errormessage is not widely supported in assistive technologies',
hidden: 'aria-errormessage value `${data.values}` cannot reference a hidden element'
},
incomplete: {
singular: 'Ensure aria-errormessage value `${data.values}` references an existing element',
plural: 'Ensure aria-errormessage values `${data.values}` reference existing elements',
idrefs: 'Unable to determine if aria-errormessage element exists on the page: ${data.values}'
}
}
},
'aria-hidden-body': {
impact: 'critical',
messages: {
pass: 'No aria-hidden attribute is present on document body',
fail: 'aria-hidden=true should not be present on the document body'
}
},
'aria-level': {
impact: 'serious',
messages: {
pass: 'aria-level values are valid',
incomplete: 'aria-level values greater than 6 are not supported in all screenreader and browser combinations'
}
},
'aria-no-deprecated-attr': {
impact: 'minor',
messages: {
pass: 'No deprecated ARIA attributes are used',
incomplete: {
singular: 'The attribute is deprecated and should not be used: ${data.values}',
plural: 'The attributes are deprecated and should not be used: ${data.values}'
}
}
},
'aria-prohibited-attr': {
impact: 'serious',
messages: {
pass: 'ARIA attribute is allowed',
fail: {
hasRolePlural: '${data.prohibited} attributes cannot be used with role "${data.role}".',
hasRoleSingular: '${data.prohibited} attribute cannot be used with role "${data.role}".',
noRolePlural: '${data.prohibited} attributes cannot be used on "${data.nodeName}" elements with no valid role attribute.',
noRoleSingular: '${data.prohibited} attribute cannot be used on "${data.nodeName}" elements with no valid role attribute.'
},
incomplete: {
hasRoleSingular: '${data.prohibited} attribute is not well supported with role "${data.role}".',
hasRolePlural: '${data.prohibited} attributes are not well supported with role "${data.role}".',
noRoleSingular: '${data.prohibited} attribute is not well supported on "${data.nodeName}" elements with no valid role attribute.',
noRolePlural: '${data.prohibited} attributes are not well supported on "${data.nodeName}" elements with no valid role attribute.',
visibleLabelSingular: '${data.prohibited} attribute is not well supported, but the elements referenced by aria-labelledby are visible in the page. Verify the label is not necessary.',
visibleLabelPlural: '${data.prohibited} attributes are not well supported, but the elements referenced by aria-labelledby are visible in the page. Verify the labels are not necessary.',
unresolvedLabel: '${data.prohibited} attribute is not well supported, and does not reference an existing element. Verify the label is not necessary.'
}
}
},
'aria-required-attr': {
impact: 'critical',
messages: {
pass: 'All required ARIA attributes are present',
fail: {
singular: 'Required ARIA attribute not present: ${data.values}',
plural: 'Required ARIA attributes not present: ${data.values}'
}
}
},
'aria-required-children': {
impact: 'critical',
messages: {
pass: {
default: 'Required ARIA children are present',
'aria-busy': 'Element has an aria-busy attribute, so it is allowed to omit required children'
},
fail: {
singular: 'Required ARIA child role not present: ${data.values}',
plural: 'Required ARIA children role not present: ${data.values}',
unallowed: 'Element has children which are not allowed: ${data.values}',
unallowedPresentational: 'Element has presentational children which cannot be ignored because of ${data.values}',
'aria-busy-fail': 'Element has children which are not allowed: ${data.values}; Having aria-busy="true" does not allow children with roles that are not allowed'
},
incomplete: {
singular: 'Expecting ARIA child role to be added: ${data.values}',
plural: 'Expecting ARIA children role to be added: ${data.values}'
}
}
},
'aria-required-parent': {
impact: 'critical',
messages: {
pass: 'Required ARIA parent role present',
fail: {
singular: 'Required ARIA parent role not present: ${data.values}',
plural: 'Required ARIA parents role not present: ${data.values}'
}
}
},
'aria-roledescription': {
impact: 'serious',
messages: {
pass: 'aria-roledescription used on a supported semantic role',
incomplete: 'Check that the aria-roledescription is announced by supported screen readers',
fail: 'Give the element a role that supports aria-roledescription'
}
},
'aria-unsupported-attr': {
impact: 'critical',
messages: {
pass: 'ARIA attribute is supported',
fail: 'ARIA attribute is not widely supported in screen readers and assistive technologies: ${data.values}'
}
},
'aria-valid-attr-value': {
impact: 'critical',
messages: {
pass: 'ARIA attribute values are valid',
fail: {
singular: 'Invalid ARIA attribute value: ${data.values}',
plural: 'Invalid ARIA attribute values: ${data.values}'
},
incomplete: {
noId: 'ARIA attribute element ID does not exist on the page: ${data.needsReview}',
noIdShadow: 'ARIA attribute element ID does not exist on the page or is a descendant of a different shadow DOM tree: ${data.needsReview}',
ariaCurrent: 'ARIA attribute value is invalid and will be treated as "aria-current=true": ${data.needsReview}',
idrefs: 'Unable to determine if ARIA attribute element ID exists on the page: ${data.needsReview}',
empty: 'ARIA attribute value is ignored while empty: ${data.needsReview}',
controlsWithinPopup: 'Unable to determine if aria-controls referenced ID exists on the page while using aria-haspopup: ${data.needsReview}'
}
}
},
'aria-valid-attr': {
impact: 'critical',
messages: {
pass: 'ARIA attribute name is valid',
fail: {
singular: 'Invalid ARIA attribute name: ${data.values}',
plural: 'Invalid ARIA attribute names: ${data.values}'
}
}
},
'braille-label-equivalent': {
impact: 'serious',
messages: {
pass: 'aria-braillelabel is used on an element with accessible text',
fail: 'aria-braillelabel is used on an element with no accessible text',
incomplete: 'Unable to compute accessible text'
}
},
'braille-roledescription-equivalent': {
impact: 'serious',
messages: {
pass: 'aria-brailleroledescription is used on an element with aria-roledescription',
fail: {
noRoleDescription: 'aria-brailleroledescription is used on an element with no aria-roledescription',
emptyRoleDescription: 'aria-brailleroledescription is used on an element with an empty aria-roledescription'
}
}
},
deprecatedrole: {
impact: 'minor',
messages: {
pass: 'ARIA role is not deprecated',
fail: 'The role used is deprecated: ${data}'
}
},
fallbackrole: {
impact: 'serious',
messages: {
pass: 'Only one role value used',
fail: 'Use only one role value, since fallback roles are not supported in older browsers',
incomplete: 'Use only role \'presentation\' or \'none\' since they are synonymous.'
}
},
'has-global-aria-attribute': {
impact: 'minor',
messages: {
pass: {
singular: 'Element has global ARIA attribute: ${data.values}',
plural: 'Element has global ARIA attributes: ${data.values}'
},
fail: 'Element does not have global ARIA attribute'
}
},
'has-widget-role': {
impact: 'minor',
messages: {
pass: 'Element has a widget role.',
fail: 'Element does not have a widget role.'
}
},
invalidrole: {
impact: 'critical',
messages: {
pass: 'ARIA role is valid',
fail: {
singular: 'Role must be one of the valid ARIA roles: ${data.values}',
plural: 'Roles must be one of the valid ARIA roles: ${data.values}'
}
}
},
'is-element-focusable': {
impact: 'minor',
messages: {
pass: 'Element is focusable.',
fail: 'Element is not focusable.'
}
},
'no-implicit-explicit-label': {
impact: 'serious',
messages: {
pass: 'There is no mismatch between a <label> and accessible name',
incomplete: 'Check that the <label> does not need be part of the ARIA ${data} field\'s name'
}
},
unsupportedrole: {
impact: 'critical',
messages: {
pass: 'ARIA role is supported',
fail: 'The role used is not widely supported in screen readers and assistive technologies: ${data}'
}
},
'valid-scrollable-semantics': {
impact: 'minor',
messages: {
pass: 'Element has valid semantics for an element in the focus order.',
fail: 'Element has invalid semantics for an element in the focus order.'
}
},
'color-contrast-enhanced': {
impact: 'serious',
messages: {
pass: 'Element has sufficient color contrast of ${data.contrastRatio}',
fail: {
default: 'Element has insufficient color contrast of ${data.contrastRatio} (foreground color: ${data.fgColor}, background color: ${data.bgColor}, font size: ${data.fontSize}, font weight: ${data.fontWeight}). Expected contrast ratio of ${data.expectedContrastRatio}',
fgOnShadowColor: 'Element has insufficient color contrast of ${data.contrastRatio} between the foreground and shadow color (foreground color: ${data.fgColor}, text-shadow color: ${data.shadowColor}, font size: ${data.fontSize}, font weight: ${data.fontWeight}). Expected contrast ratio of ${data.expectedContrastRatio}',
shadowOnBgColor: 'Element has insufficient color contrast of ${data.contrastRatio} between the shadow color and background color (text-shadow color: ${data.shadowColor}, background color: ${data.bgColor}, font size: ${data.fontSize}, font weight: ${data.fontWeight}). Expected contrast ratio of ${data.expectedContrastRatio}'
},
incomplete: {
default: 'Unable to determine contrast ratio',
bgImage: 'Element\'s background color could not be determined due to a background image',
bgGradient: 'Element\'s background color could not be determined due to a background gradient',
imgNode: 'Element\'s background color could not be determined because element contains an image node',
bgOverlap: 'Element\'s background color could not be determined because it is overlapped by another element',
fgAlpha: 'Element\'s foreground color could not be determined because of alpha transparency',
elmPartiallyObscured: 'Element\'s background color could not be determined because it\'s partially obscured by another element',
elmPartiallyObscuring: 'Element\'s background color could not be determined because it partially overlaps other elements',
outsideViewport: 'Element\'s background color could not be determined because it\'s outside the viewport',
equalRatio: 'Element has a 1:1 contrast ratio with the background',
shortTextContent: 'Element content is too short to determine if it is actual text content',
emptyValue: 'Element has no value; test color contrast with a value entered',
nonBmp: 'Element content contains only non-text characters',
pseudoContent: 'Element\'s background color could not be determined due to a pseudo element',
colorParse: 'Could not parse color string ${data.colorParse}'
}
}
},
'color-contrast': {
impact: 'serious',
messages: {
pass: {
default: 'Element has sufficient color contrast of ${data.contrastRatio}',
hidden: 'Element is hidden'
},
fail: {
default: 'Element has insufficient color contrast of ${data.contrastRatio} (foreground color: ${data.fgColor}, background color: ${data.bgColor}, font size: ${data.fontSize}, font weight: ${data.fontWeight}). Expected contrast ratio of ${data.expectedContrastRatio}',
fgOnShadowColor: 'Element has insufficient color contrast of ${data.contrastRatio} between the foreground and shadow color (foreground color: ${data.fgColor}, text-shadow color: ${data.shadowColor}, font size: ${data.fontSize}, font weight: ${data.fontWeight}). Expected contrast ratio of ${data.expectedContrastRatio}',
shadowOnBgColor: 'Element has insufficient color contrast of ${data.contrastRatio} between the shadow color and background color (text-shadow color: ${data.shadowColor}, background color: ${data.bgColor}, font size: ${data.fontSize}, font weight: ${data.fontWeight}). Expected contrast ratio of ${data.expectedContrastRatio}'
},
incomplete: {
default: 'Unable to determine contrast ratio',
bgImage: 'Element\'s background color could not be determined due to a background image',
bgGradient: 'Element\'s background color could not be determined due to a background gradient',
imgNode: 'Element\'s background color could not be determined because element contains an image node',
bgOverlap: 'Element\'s background color could not be determined because it is overlapped by another element',
complexTextShadows: 'Element\'s contrast could not be determined because it uses complex text shadows',
fgAlpha: 'Element\'s foreground color could not be determined because of alpha transparency',
elmPartiallyObscured: 'Element\'s background color could not be determined because it\'s partially obscured by another element',
elmPartiallyObscuring: 'Element\'s background color could not be determined because it partially overlaps other elements',
outsideViewport: 'Element\'s background color could not be determined because it\'s outside the viewport',
equalRatio: 'Element has a 1:1 contrast ratio with the background',
shortTextContent: 'Element content is too short to determine if it is actual text content',
emptyValue: 'Element has no value; test color contrast with a value entered',
nonBmp: 'Element content contains only non-text characters',
pseudoContent: 'Element\'s background color could not be determined due to a pseudo element',
colorParse: 'Could not parse color string ${data.colorParse}'
}
}
},
'link-in-text-block-style': {
impact: 'serious',
messages: {
pass: 'Links can be distinguished from surrounding text by visual styling',
incomplete: {
default: 'Check if the link needs styling to distinguish it from nearby text',
pseudoContent: 'Check if the link\'s pseudo style is sufficient to distinguish it from the surrounding text'
},
fail: 'The link has no styling (such as underline) to distinguish it from the surrounding text'
}
},
'link-in-text-block': {
impact: 'serious',
messages: {
pass: 'Links can be distinguished from surrounding text in some way other than by color',
fail: {
fgContrast: 'The link has insufficient color contrast of ${data.contrastRatio}:1 with the surrounding text. (Minimum contrast is ${data.requiredContrastRatio}:1, link text: ${data.nodeColor}, surrounding text: ${data.parentColor})',
bgContrast: 'The link background has insufficient color contrast of ${data.contrastRatio} (Minimum contrast is ${data.requiredContrastRatio}:1, link background color: ${data.nodeBackgroundColor}, surrounding background color: ${data.parentBackgroundColor})'
},
incomplete: {
default: 'Element\'s foreground contrast ratio could not be determined',
bgContrast: 'Element\'s background contrast ratio could not be determined',
bgImage: 'Element\'s contrast ratio could not be determined due to a background image',
bgGradient: 'Element\'s contrast ratio could not be determined due to a background gradient',
imgNode: 'Element\'s contrast ratio could not be determined because element contains an image node',
bgOverlap: 'Element\'s contrast ratio could not be determined because of element overlap'
}
}
},
'autocomplete-appropriate': {
impact: 'serious',
messages: {
pass: 'The autocomplete value is on an appropriate element',
fail: 'The autocomplete value is inappropriate for this type of input'
}
},
'autocomplete-valid': {
impact: 'serious',
messages: {
pass: 'the autocomplete attribute is correctly formatted',
fail: 'the autocomplete attribute is incorrectly formatted',
incomplete: 'the autocomplete attribute has a non-standard value. Check whether any standard value could be used instead.'
}
},
accesskeys: {
impact: 'serious',
messages: {
pass: 'Accesskey attribute value is unique',
fail: 'Document has multiple elements with the same accesskey'
}
},
'focusable-content': {
impact: 'serious',
messages: {
pass: 'Element contains focusable elements',
incomplete: 'Check that elements with a negative tabindex can receive keyboard focus so the region can be scrolled',
fail: 'Element should have focusable content'
}
},
'focusable-disabled': {
impact: 'serious',
messages: {
pass: 'No focusable elements contained within element',
incomplete: 'Check if the focusable elements immediately move the focus indicator',
fail: 'Focusable content should be disabled, be removed from the DOM, or not be hidden with aria-hidden'
}
},
'focusable-element': {
impact: 'serious',
messages: {
pass: 'Element is focusable',
fail: 'Element should be focusable'
}
},
'focusable-modal-open': {
impact: 'serious',
messages: {
pass: 'No focusable elements while a modal is open',
incomplete: 'Check that focusable elements are not tabbable in the current state'
}
},
'focusable-no-name': {
impact: 'serious',
messages: {
pass: 'Element is not in tab order or has accessible text',
fail: 'Element is in tab order and does not have accessible text',
incomplete: 'Unable to determine if element has an accessible name'
}
},
'focusable-not-tabbable': {
impact: 'serious',
messages: {
pass: 'No focusable elements contained within element',
incomplete: 'Check if the focusable elements immediately move the focus indicator',
fail: 'Focusable content should have tabindex="-1", be removed from the DOM, or not be hidden with aria-hidden'
}
},
'frame-focusable-content': {
impact: 'serious',
messages: {
pass: 'Element does not have focusable descendants',
fail: 'Element has focusable descendants',
incomplete: 'Could not determine if element has descendants'
}
},
'landmark-is-top-level': {
impact: 'moderate',
messages: {
pass: 'The ${data.role} landmark is at the top level.',
fail: 'The ${data.role} landmark is contained in another landmark.'
}
},
'no-focusable-content': {
impact: 'serious',
messages: {
pass: 'Element does not have focusable descendants',
fail: {
default: 'Element has focusable descendants. Move them outside of the element, or remove them.',
notHidden: 'Using a negative tabindex on an element inside an interactive control does not prevent assistive technologies from focusing the element (even with aria-hidden="true")'
},
incomplete: 'Could not determine if element has descendants'
}
},
'page-has-heading-one': {
impact: 'moderate',
messages: {
pass: 'Page has at least one level-one heading',
fail: 'Page must have a level-one heading'
}
},
'page-has-main': {
impact: 'moderate',
messages: {
pass: 'Document has at least one main landmark',
fail: 'Document does not have a main landmark'
}
},
'page-no-duplicate-banner': {
impact: 'moderate',
messages: {
pass: 'Document does not have more than one banner landmark',
fail: 'Document has more than one banner landmark'
}
},
'page-no-duplicate-contentinfo': {
impact: 'moderate',
messages: {
pass: 'Document does not have more than one contentinfo landmark',
fail: 'Document has more than one contentinfo landmark'
}
},
'page-no-duplicate-main': {
impact: 'moderate',
messages: {
pass: 'Document does not have more than one main landmark',
fail: 'Document has more than one main landmark'
}
},
tabindex: {
impact: 'serious',
messages: {
pass: 'Element does not have a tabindex greater than 0',
fail: 'Element has a tabindex greater than 0'
}
},
'alt-space-value': {
impact: 'critical',
messages: {
pass: 'Element has a valid alt attribute value',
fail: 'Element has an alt attribute containing only a space character, which is not ignored by all screen readers'
}
},
'duplicate-img-label': {
impact: 'minor',
messages: {
pass: 'Element does not duplicate existing text in <img> alt text',
fail: 'Element contains <img> element with alt text that duplicates existing text'
}
},
'explicit-label': {
impact: 'critical',
messages: {
pass: 'Element has an explicit <label>',
fail: 'Element does not have an explicit <label>',
incomplete: 'Unable to determine if form element has an explicit <label>'
}
},
'help-same-as-label': {
impact: 'minor',
messages: {
pass: 'Help text (title or aria-describedby) does not duplicate label text',
fail: 'Help text (title or aria-describedby) text is the same as the label text'
}
},
'hidden-explicit-label': {
impact: 'critical',
messages: {
pass: 'Form element has a visible explicit <label>',
fail: 'Form element has explicit <label> that is hidden',
incomplete: 'Unable to determine if form element has explicit <label> that is hidden'
}
},
'implicit-label': {
impact: 'critical',
messages: {
pass: 'Element has an implicit (wrapped) <label>',
fail: 'Element does not have an implicit (wrapped) <label>',
incomplete: 'Unable to determine if form element has an implicit (wrapped) <label>'
}
},
'label-content-name-mismatch': {
impact: 'serious',
messages: {
pass: 'Element contains visible text as part of its accessible name',
fail: 'Text inside the element is not included in the accessible name',
incomplete: {
default: 'Unable to determine if the visible text is part of the accessible name',
valueText: 'Text inside the element may be value text rather than a label'
}
}
},
'multiple-label': {
impact: 'moderate',
messages: {
pass: 'Form field does not have multiple label elements',
incomplete: 'Multiple label elements is not widely supported in assistive technologies. Ensure the first label contains all necessary information.'
}
},
'title-only': {
impact: 'serious',
messages: {
pass: 'Form element does not solely use title attribute for its label',
fail: 'Only title used to generate label for form element'
}
},
'landmark-is-unique': {
impact: 'moderate',
messages: {
pass: 'Landmarks must have a unique role or role/label/title (i.e. accessible name) combination',
fail: 'The landmark must have a unique aria-label, aria-labelledby, or title to make landmarks distinguishable'
}
},
'has-lang': {
impact: 'serious',
messages: {
pass: 'The <html> element has a lang attribute',
fail: {
noXHTML: 'The xml:lang attribute is not valid on HTML pages, use the lang attribute.',
noLang: 'The <html> element does not have a lang attribute'
}
}
},
'valid-lang': {
impact: 'serious',
messages: {
pass: 'Value of lang attribute is included in the list of valid languages',
fail: 'Value of lang attribute not included in the list of valid languages'
}
},
'xml-lang-mismatch': {
impact: 'moderate',
messages: {
pass: 'Lang and xml:lang attributes have the same base language',
fail: 'Lang and xml:lang attributes do not have the same base language'
}
},
dlitem: {
impact: 'serious',
messages: {
pass: 'Description list item has a <dl> parent element',
fail: 'Description list item does not have a <dl> parent element'
}
},
listitem: {
impact: 'serious',
messages: {
pass: 'List item has a <ul>, <ol> or role="list" parent element',
fail: {
default: 'List item does not have a <ul> or <ol> parent element. Ensure the <li> is a direct child of a <ul> or <ol>, or that the parent has role="list".',
roleNotValid: 'List item parent element has a role that is not role="list". Ensure the parent element has role="list", or move the <li> inside a <ul> or <ol>.'
},
incomplete: 'Unable to determine if list item has a <ul>, <ol> or role="list" parent element'
}
},
'only-dlitems': {
impact: 'serious',
messages: {
pass: 'dl element only has direct children that are allowed inside; <dt>, <dd>, or <div> elements',
fail: 'dl element has direct children that are not allowed: ${data.values}',
incomplete: 'Unable to determine if dl element only has allowed direct children'
}
},
'only-listitems': {
impact: 'serious',
messages: {
pass: 'List element only has direct children that are allowed inside <li> elements',
fail: 'List element has direct children that are not allowed: ${data.values}',
incomplete: 'Unable to determine if list element only has allowed direct children'
}
},
'structured-dlitems': {
impact: 'serious',
messages: {
pass: 'When not empty, element has both <dt> and <dd> elements',
fail: 'When not empty, element does not have at least one <dt> element followed by at least one <dd> element'
}
},
caption: {
impact: 'critical',
messages: {
pass: 'The multimedia element has a captions track',
incomplete: 'Check that captions are available for the element'
}
},
'frame-tested': {
impact: 'critical',
messages: {
pass: 'The iframe was tested with axe-core',
fail: 'The iframe could not be tested with axe-core',
incomplete: 'The iframe still has to be tested with axe-core'
}
},
'no-autoplay-audio': {
impact: 'moderate',
messages: {
pass: '<video> or <audio> does not output audio for more than allowed duration or has controls mechanism',
fail: '<video> or <audio> outputs audio for more than allowed duration and does not have a controls mechanism',
incomplete: 'Check that the <video> or <audio> does not output audio for more than allowed duration or provides a controls mechanism'
}
},
'css-orientation-lock': {
impact: 'serious',
messages: {
pass: 'Display is operable, and orientation lock does not exist',
fail: 'CSS Orientation lock is applied, and makes display inoperable',
incomplete: 'CSS Orientation lock cannot be determined'
}
},
'meta-viewport-large': {
impact: 'minor',
messages: {
pass: '<meta> tag does not prevent significant zooming on mobile devices',
fail: '<meta> tag limits zooming on mobile devices'
}
},
'meta-viewport': {
impact: 'critical',
messages: {
pass: '<meta> tag does not disable zooming on mobile devices',
fail: '${data} on <meta> tag disables zooming on mobile devices'
}
},
'target-offset': {
impact: 'serious',
messages: {
pass: {
default: 'Target has sufficient space from its closest neighbors. Safe clickable space has a diameter of ${data.closestOffset}px which is at least ${data.minOffset}px.',
large: 'Target far exceeds the minimum size of ${data.minOffset}px.'
},
fail: 'Target has insufficient space to its closest neighbors. Safe clickable space has a diameter of ${data.closestOffset}px instead of at least ${data.minOffset}px.',
incomplete: {
default: 'Element with negative tabindex has insufficient space to its closest neighbors. Safe clickable space has a diameter of ${data.closestOffset}px instead of at least ${data.minOffset}px. Is this a target?',
nonTabbableNeighbor: 'Target has insufficient space to its closest neighbors. Safe clickable space has a diameter of ${data.closestOffset}px instead of at least ${data.minOffset}px. Is the neighbor a target?',
tooManyRects: 'Could not get the target size because there are too many overlapping elements'
}
}
},
'target-size': {
impact: 'serious',
messages: {
pass: {
default: 'Control has sufficient size (${data.width}px by ${data.height}px, should be at least ${data.minSize}px by ${data.minSize}px)',
obscured: 'Control is ignored because it is fully obscured and thus not clickable',
large: 'Target far exceeds the minimum size of ${data.minSize}px.'
},
fail: {
default: 'Target has insufficient size (${data.width}px by ${data.height}px, should be at least ${data.minSize}px by ${data.minSize}px)',
partiallyObscured: 'Target has insufficient size because it is partially obscured (smallest space is ${data.width}px by ${data.height}px, should be at least ${data.minSize}px by ${data.minSize}px)'
},
incomplete: {
default: 'Element with negative tabindex has insufficient size (${data.width}px by ${data.height}px, should be at least ${data.minSize}px by ${data.minSize}px). Is this a target?',
contentOverflow: 'Element size could not be accurately determined due to overflow content',
partiallyObscured: 'Element with negative tabindex has insufficient size because it is partially obscured (smallest space is ${data.width}px by ${data.height}px, should be at least ${data.minSize}px by ${data.minSize}px). Is this a target?',
partiallyObscuredNonTabbable: 'Target has insufficient size because it is partially obscured by a neighbor with negative tabindex (smallest space is ${data.width}px by ${data.height}px, should be at least ${data.minSize}px by ${data.minSize}px). Is the neighbor a target?',
tooManyRects: 'Could not get the target size because there are too many overlapping elements'
}
}
},
'header-present': {
impact: 'serious',
messages: {
pass: 'Page has a heading',
fail: 'Page does not have a heading'
}
},
'heading-order': {
impact: 'moderate',
messages: {
pass: 'Heading order valid',
fail: 'Heading order invalid',
incomplete: 'Unable to determine previous heading'
}
},
'identical-links-same-purpose': {
impact: 'minor',
messages: {
pass: 'There are no other links with the same name, that go to a different URL',
incomplete: 'Check that links have the same purpose, or are intentionally ambiguous.'
}
},
'internal-link-present': {
impact: 'serious',
messages: {
pass: 'Valid skip link found',
fail: 'No valid skip link found'
}
},
landmark: {
impact: 'serious',
messages: {
pass: 'Page has a landmark region',
fail: 'Page does not have a landmark region'
}
},
'meta-refresh-no-exceptions': {
impact: 'minor',
messages: {
pass: '<meta> tag does not immediately refresh the page',
fail: '<meta> tag forces timed refresh of page'
}
},
'meta-refresh': {
impact: 'critical',
messages: {
pass: '<meta> tag does not immediately refresh the page',
fail: '<meta> tag forces timed refresh of page (less than 20 hours)'
}
},
'p-as-heading': {
impact: 'serious',
messages: {
pass: '<p> elements are not styled as headings',
fail: 'Heading elements should be used instead of styled <p> elements',
incomplete: 'Unable to determine if <p> elements are styled as headings'
}
},
region: {
impact: 'moderate',
messages: {
pass: 'All page content is contained by landmarks',
fail: 'Some page content is not contained by landmarks'
}
},
'skip-link': {
impact: 'moderate',
messages: {
pass: 'Skip link target exists',
incomplete: 'Skip link target should become visible on activation',
fail: 'No skip link target'
}
},
'unique-frame-title': {
impact: 'serious',
messages: {
pass: 'Element\'s title attribute is unique',
fail: 'Element\'s title attribute is not unique'
}
},
'duplicate-id-active': {
impact: 'serious',
messages: {
pass: 'Document has no active elements that share the same id attribute',
fail: 'Document has active elements with the same id attribute: ${data}'
}
},
'duplicate-id-aria': {
impact: 'critical',
messages: {
pass: 'Document has no elements referenced with ARIA or labels that share the same id attribute',
fail: 'Document has multiple elements referenced with ARIA with the same id attribute: ${data}'
}
},
'duplicate-id': {
impact: 'minor',
messages: {
pass: 'Document has no static elements that share the same id attribute',
fail: 'Document has multiple static elements with the same id attribute: ${data}'
}
},
'aria-label': {
impact: 'serious',
messages: {
pass: 'aria-label attribute exists and is not empty',
fail: 'aria-label attribute does not exist or is empty'
}
},
'aria-labelledby': {
impact: 'serious',
messages: {
pass: 'aria-labelledby attribute exists and references elements that are visible to screen readers',
fail: 'aria-labelledby attribute does not exist, references elements that do not exist or references elements that are empty',
incomplete: 'Ensure aria-labelledby references an existing element'
}
},
'avoid-inline-spacing': {
impact: 'serious',
messages: {
pass: 'No inline styles with \'!important\' that affect text spacing has been specified',
fail: {
singular: 'Remove \'!important\' from inline style ${data.values}, as overriding this is not supported by most browsers',
plural: 'Remove \'!important\' from inline styles ${data.values}, as overriding this is not supported by most browsers'
}
}
},
'button-has-visible-text': {
impact: 'critical',
messages: {
pass: 'Element has inner text that is visible to screen readers',
fail: 'Element does not have inner text that is visible to screen readers',
incomplete: 'Unable to determine if element has children'
}
},
'doc-has-title': {
impact: 'serious',
messages: {
pass: 'Document has a non-empty <title> element',
fail: 'Document does not have a non-empty <title> element'
}
},
'error-occurred': {
messages: {
pass: '',
incomplete: 'Axe encountered an error; test the page for this type of problem manually'
}
},
exists: {
impact: 'minor',
messages: {
pass: 'Element does not exist',
incomplete: 'Element exists'
}
},
'has-alt': {
impact: 'critical',
messages: {
pass: 'Element has an alt attribute',
fail: 'Element does not have an alt attribute'
}
},
'has-visible-text': {
impact: 'minor',
messages: {
pass: 'Element has text that is visible to screen readers',
fail: 'Element does not have text that is visible to screen readers',
incomplete: 'Unable to determine if element has children'
}
},
'important-letter-spacing': {
impact: 'serious',
messages: {
pass: 'Letter-spacing in the style attribute is not set to !important, or meets the minimum',
fail: {
default: 'letter-spacing in the style attribute must not use !important, or be at ${data.minValue}em (current ${data.value}em)',
omitted: 'letter-spacing in the style attribute must not use !important, or be at ${data.minValue}em (current ${data.value}em). More elements with text are affected than are listed as related nodes'
},
incomplete: 'Unable to determine if letter-spacing in the style attribute meets the minimum'
}
},
'important-line-height': {
impact: 'serious',
messages: {
pass: 'line-height in the style attribute is not set to !important, or meets the minimum',
fail: {
default: 'line-height in the style attribute must not use !important, or be at ${data.minValue}em (current ${data.value}em)',
omitted: 'line-height in the style attribute must not use !important, or be at ${data.minValue}em (current ${data.value}em). More elements with text are affected than are listed as related nodes'
},
incomplete: 'Unable to determine if line-height in the style attribute meets the minimum'
}
},
'important-word-spacing': {
impact: 'serious',
messages: {
pass: 'word-spacing in the style attribute is not set to !important, or meets the minimum',
fail: {
default: 'word-spacing in the style attribute must not use !important, or be at ${data.minValue}em (current ${data.value}em)',
omitted: 'word-spacing in the style attribute must not use !important, or be at ${data.minValue}em (current ${data.value}em). More elements with text are affected than are listed as related nodes'
},
incomplete: 'Unable to determine if word-spacing in the style attribute meets the minimum'
}
},
'is-on-screen': {
impact: 'serious',
messages: {
pass: 'Element is not visible',
fail: 'Element is visible'
}
},
'non-empty-alt': {
impact: 'critical',
messages: {
pass: 'Element has a non-empty alt attribute',
fail: {
noAttr: 'Element has no alt attribute',
emptyAttr: 'Element has an empty alt attribute'
}
}
},
'non-empty-if-present': {
impact: 'critical',
messages: {
pass: {
default: 'Element does not have a value attribute',
'has-label': 'Element has a non-empty value attribute'
},
fail: 'Element has a value attribute and the value attribute is empty'
}
},
'non-empty-placeholder': {
impact: 'serious',
messages: {
pass: 'Element has a placeholder attribute',
fail: {
noAttr: 'Element has no placeholder attribute',
emptyAttr: 'Element has an empty placeholder attribute'
}
}
},
'non-empty-title': {
impact: 'serious',
messages: {
pass: 'Element has a title attribute',
fail: {
noAttr: 'Element has no title attribute',
emptyAttr: 'Element has an empty title attribute'
}
}
},
'non-empty-value': {
impact: 'critical',
messages: {
pass: 'Element has a non-empty value attribute',
fail: {
noAttr: 'Element has no value attribute',
emptyAttr: 'Element has an empty value attribute'
}
}
},
'presentational-role': {
impact: 'minor',
messages: {
pass: 'Element\'s default semantics were overridden with role="${data.role}"',
fail: {
default: 'Element\'s default semantics were not overridden with role="none" or role="presentation"',
globalAria: 'Element\'s role is not presentational because it has a global ARIA attribute',
focusable: 'Element\'s role is not presentational because it is focusable',
both: 'Element\'s role is not presentational because it has a global ARIA attribute and is focusable',
iframe: 'Using the "title" attribute on an ${data.nodeName} element with a presentational role behaves inconsistently between screen readers'
}
}
},
'role-none': {
impact: 'minor',
messages: {
pass: 'Element\'s default semantics were overridden with role="none"',
fail: 'Element\'s default semantics were not overridden with role="none"'
}
},
'role-presentation': {
impact: 'minor',
messages: {
pass: 'Element\'s default semantics were overridden with role="presentation"',
fail: 'Element\'s default semantics were not overridden with role="presentation"'
}
},
'svg-non-empty-title': {
impact: 'serious',
messages: {
pass: 'Element has a child that is a title',
fail: {
noTitle: 'Element has no child that is a title',
emptyTitle: 'Element child title is empty'
},
incomplete: 'Unable to determine element has a child that is a title'
}
},
'caption-faked': {
impact: 'serious',
messages: {
pass: 'The first row of a table is not used as a caption',
fail: 'The first child of the table should be a caption instead of a table cell'
}
},
'html5-scope': {
impact: 'moderate',
messages: {
pass: 'Scope attribute is only used on table header elements (<th>)',
fail: 'In HTML 5, scope attributes may only be used on table header elements (<th>)'
}
},
'same-caption-summary': {
impact: 'minor',
messages: {
pass: 'Content of summary attribute and <caption> are not duplicated',
fail: 'Content of summary attribute and <caption> element are identical',
incomplete: 'Unable to determine if <table> element has a caption'
}
},
'scope-value': {
impact: 'critical',
messages: {
pass: 'Scope attribute is used correctly',
fail: 'The value of the scope attribute may only be \'row\' or \'col\''
}
},
'td-has-header': {
impact: 'critical',
messages: {
pass: 'All non-empty data cells have table headers',
fail: 'Some non-empty data cells do not have table headers'
}
},
'td-headers-attr': {
impact: 'serious',
messages: {
pass: 'The headers attribute is exclusively used to refer to other header cells in the table',
incomplete: 'The headers attribute is empty',
fail: {
'cell-header-not-in-table': 'The headers attribute is not exclusively used to refer to other header cells in the table',
'cell-header-not-th': 'The headers attribute must refer to header cells, not data cells',
'header-refs-self': 'The element with headers attribute refers to itself'
}
}
},
'th-has-data-cells': {
impact: 'serious',
messages: {
pass: 'All table header cells refer to data cells',
incomplete: 'Table data cells are missing or empty'
}
},
'hidden-content': {
impact: 'minor',
messages: {
pass: 'All content on the page has been analyzed.',
fail: 'There were problems analyzing the content on this page.',
incomplete: 'There is hidden content on the page that was not analyzed. You will need to trigger the display of this content in order to analyze it.'
}
}
},
failureSummaries: {
any: {
failureMessage: function anonymous(it) {
var out = 'Fix any of the following:';
var arr1 = it;
if (arr1) {
var value, i1 = -1, l1 = arr1.length - 1;
while (i1 < l1) {
value = arr1[i1 += 1];
out += '\n ' + value.split('\n').join('\n ');
}
}
return out;
}
},
none: {
failureMessage: function anonymous(it) {
var out = 'Fix all of the following:';
var arr1 = it;
if (arr1) {
var value, i1 = -1, l1 = arr1.length - 1;
while (i1 < l1) {
value = arr1[i1 += 1];
out += '\n ' + value.split('\n').join('\n ');
}
}
return out;
}
}
},
incompleteFallbackMessage: 'axe couldn\'t tell the reason. Time to break out the element inspector!'
},
rules: [ {
id: 'accesskeys',
impact: 'serious',
selector: '[accesskey]',
excludeHidden: false,
tags: [ 'cat.keyboard', 'best-practice' ],
all: [],
any: [],
none: [ 'accesskeys' ]
}, {
id: 'area-alt',
impact: 'critical',
selector: 'map area[href]',
excludeHidden: false,
tags: [ 'cat.text-alternatives', 'wcag2a', 'wcag244', 'wcag412', 'section508', 'section508.22.a', 'TTv5', 'TT6.a', 'EN-301-549', 'EN-9.2.4.4', 'EN-9.4.1.2', 'ACT', 'RGAAv4', 'RGAA-1.1.2' ],
actIds: [ 'c487ae' ],
all: [],
any: [ {
options: {
attribute: 'alt'
},
id: 'non-empty-alt'
}, 'aria-label', 'aria-labelledby', {
options: {
attribute: 'title'
},
id: 'non-empty-title'
} ],
none: []
}, {
id: 'aria-allowed-attr',
impact: 'critical',
matches: 'aria-allowed-attr-matches',
tags: [ 'cat.aria', 'wcag2a', 'wcag412', 'EN-301-549', 'EN-9.4.1.2', 'RGAAv4', 'RGAA-7.1.1' ],
actIds: [ '5c01ea' ],
all: [ {
options: {
validTreeRowAttrs: [ 'aria-posinset', 'aria-setsize', 'aria-expanded', 'aria-level' ],
ariaFallbackValues: {
'aria-current': 'true',
'aria-required': 'true',
'aria-readonly': 'true'
}
},
id: 'aria-allowed-attr'
}, 'aria-allowed-attr-elm', 'aria-no-deprecated-attr' ],
any: [],
none: [ 'aria-unsupported-attr' ]
}, {
id: 'aria-allowed-role',
impact: 'minor',
excludeHidden: false,
selector: '[role]',
matches: 'aria-allowed-role-matches',
tags: [ 'cat.aria', 'best-practice' ],
all: [],
any: [ {
options: {
allowImplicit: true,
ignoredTags: []
},
id: 'aria-allowed-role'
} ],
none: []
}, {
id: 'aria-braille-equivalent',
reviewOnFail: true,
impact: 'serious',
selector: '[aria-brailleroledescription], [aria-braillelabel]',
tags: [ 'cat.aria', 'wcag2a', 'wcag412', 'EN-301-549', 'EN-9.4.1.2' ],
all: [ 'braille-roledescription-equivalent', 'braille-label-equivalent' ],
any: [],
none: []
}, {
id: 'aria-command-name',
impact: 'serious',
selector: '[role="link"], [role="button"], [role="menuitem"]',
matches: 'no-naming-method-matches',
tags: [ 'cat.aria', 'wcag2a', 'wcag412', 'TTv5', 'TT6.a', 'EN-301-549', 'EN-9.4.1.2', 'ACT', 'RGAAv4', 'RGAA-11.9.1' ],
actIds: [ '97a4e1' ],
all: [],
any: [ 'has-visible-text', 'aria-label', 'aria-labelledby', {
options: {
attribute: 'title'
},
id: 'non-empty-title'
} ],
none: []
}, {
id: 'aria-conditional-attr',
impact: 'serious',
matches: 'aria-allowed-attr-matches',
tags: [ 'cat.aria', 'wcag2a', 'wcag412', 'EN-301-549', 'EN-9.4.1.2', 'RGAAv4', 'RGAA-7.1.1' ],
actIds: [ '5c01ea' ],
all: [ {
options: {
invalidTableRowAttrs: [ 'aria-posinset', 'aria-setsize', 'aria-expanded', 'aria-level' ]
},
id: 'aria-conditional-attr'
} ],
any: [],
none: []
}, {
id: 'aria-deprecated-role',
impact: 'minor',
selector: '[role]',
matches: 'no-empty-role-matches',
tags: [ 'cat.aria', 'wcag2a', 'wcag412', 'EN-301-549', 'EN-9.4.1.2', 'RGAAv4', 'RGAA-7.1.1' ],
actIds: [ '674b10' ],
all: [],
any: [],
none: [ 'deprecatedrole' ]
}, {
id: 'aria-dialog-name',
impact: 'serious',
selector: '[role="dialog"], [role="alertdialog"]',
matches: 'no-naming-method-matches',
tags: [ 'cat.aria', 'best-practice' ],
all: [],
any: [ 'aria-label', 'aria-labelledby', {
options: {
attribute: 'title'
},
id: 'non-empty-title'
} ],
none: []
}, {
id: 'aria-hidden-body',
impact: 'critical',
selector: 'body',
excludeHidden: false,
matches: 'is-initiator-matches',
tags: [ 'cat.aria', 'wcag2a', 'wcag131', 'wcag412', 'EN-301-549', 'EN-9.1.3.1', 'EN-9.4.1.2', 'RGAAv4', 'RGAA-10.8.1' ],
all: [],
any: [ 'aria-hidden-body' ],
none: []
}, {
id: 'aria-hidden-focus',
impact: 'serious',
selector: '[aria-hidden="true"]',
matches: 'aria-hidden-focus-matches',
excludeHidden: false,
tags: [ 'cat.name-role-value', 'wcag2a', 'wcag412', 'TTv5', 'TT6.a', 'EN-301-549', 'EN-9.4.1.2', 'RGAAv4', 'RGAA-10.8.1' ],
actIds: [ '6cfa84' ],
all: [ 'focusable-modal-open', 'focusable-disabled', 'focusable-not-tabbable' ],
any: [],
none: []
}, {
id: 'aria-input-field-name',
impact: 'serious',
selector: '[role="combobox"], [role="listbox"], [role="searchbox"], [role="slider"], [role="spinbutton"], [role="textbox"]',
matches: 'no-naming-method-matches',
tags: [ 'cat.aria', 'wcag2a', 'wcag412', 'TTv5', 'TT5.c', 'EN-301-549', 'EN-9.4.1.2', 'ACT', 'RGAAv4', 'RGAA-11.1.1' ],
actIds: [ 'e086e5' ],
all: [],
any: [ 'aria-label', 'aria-labelledby', {
options: {
attribute: 'title'
},
id: 'non-empty-title'
} ],
none: [ 'no-implicit-explicit-label' ]
}, {
id: 'aria-meter-name',
impact: 'serious',
selector: '[role="meter"]',
matches: 'no-naming-method-matches',
tags: [ 'cat.aria', 'wcag2a', 'wcag111', 'EN-301-549', 'EN-9.1.1.1', 'RGAAv4', 'RGAA-11.1.1' ],
all: [],
any: [ 'aria-label', 'aria-labelledby', {
options: {
attribute: 'title'
},
id: 'non-empty-title'
} ],
none: []
}, {
id: 'aria-progressbar-name',
impact: 'serious',
selector: '[role="progressbar"]',
matches: 'no-naming-method-matches',
tags: [ 'cat.aria', 'wcag2a', 'wcag111', 'EN-301-549', 'EN-9.1.1.1', 'RGAAv4', 'RGAA-11.1.1' ],
all: [],
any: [ 'aria-label', 'aria-labelledby', {
options: {
attribute: 'title'
},
id: 'non-empty-title'
} ],
none: []
}, {
id: 'aria-prohibited-attr',
impact: 'serious',
matches: 'aria-allowed-attr-matches',
tags: [ 'cat.aria', 'wcag2a', 'wcag412', 'EN-301-549', 'EN-9.4.1.2', 'RGAAv4', 'RGAA-7.1.1' ],
actIds: [ '5c01ea' ],
all: [],
any: [],
none: [ {
options: {
elementsAllowedAriaLabel: [ 'applet' ]
},
id: 'aria-prohibited-attr'
} ]
}, {
id: 'aria-required-attr',
impact: 'critical',
selector: '[role]',
tags: [ 'cat.aria', 'wcag2a', 'wcag412', 'EN-301-549', 'EN-9.4.1.2', 'RGAAv4', 'RGAA-7.1.1' ],
actIds: [ '4e8ab6' ],
all: [],
any: [ 'aria-required-attr' ],
none: []
}, {
id: 'aria-required-children',
impact: 'critical',
selector: '[role]',
matches: 'aria-required-children-matches',
tags: [ 'cat.aria', 'wcag2a', 'wcag131', 'EN-301-549', 'EN-9.1.3.1', 'RGAAv4', 'RGAA-9.3.1' ],
actIds: [ 'bc4a75', 'ff89c9' ],
all: [],
any: [ {
options: {
reviewEmpty: [ 'doc-bibliography', 'doc-endnotes', 'grid', 'list', 'listbox', 'menu', 'menubar', 'table', 'tablist', 'tree', 'treegrid', 'rowgroup' ]
},
id: 'aria-required-children'
} ],
none: []
}, {
id: 'aria-required-parent',
impact: 'critical',
selector: '[role]',
matches: 'aria-required-parent-matches',
tags: [ 'cat.aria', 'wcag2a', 'wcag131', 'EN-301-549', 'EN-9.1.3.1', 'RGAAv4', 'RGAA-9.3.1' ],
actIds: [ 'ff89c9' ],
all: [],
any: [ {
options: {
ownGroupRoles: [ 'listitem', 'treeitem' ]
},
id: 'aria-required-parent'
} ],
none: []
}, {
id: 'aria-roledescription',
impact: 'serious',
selector: '[aria-roledescription]',
tags: [ 'cat.aria', 'wcag2a', 'wcag412', 'EN-301-549', 'EN-9.4.1.2', 'deprecated' ],
enabled: false,
all: [],
any: [ {
options: {
supportedRoles: [ 'button', 'img', 'image', 'checkbox', 'radio', 'combobox', 'menuitemcheckbox', 'menuitemradio' ]
},
id: 'aria-roledescription'
} ],
none: []
}, {
id: 'aria-roles',
impact: 'critical',
selector: '[role]',
matches: 'no-empty-role-matches',
tags: [ 'cat.aria', 'wcag2a', 'wcag412', 'EN-301-549', 'EN-9.4.1.2', 'RGAAv4', 'RGAA-7.1.1' ],
actIds: [ '674b10' ],
all: [],
any: [],
none: [ 'invalidrole', 'abstractrole', 'unsupportedrole' ]
}, {
id: 'aria-tab-name',
impact: 'serious',
selector: '[role="tab"]',
matches: 'no-naming-method-matches',
tags: [ 'cat.aria', 'wcag2a', 'wcag412', 'TTv5', 'TT5.c', 'EN-301-549', 'EN-9.4.1.2', 'ACT', 'RGAAv4', 'RGAA-7.1.1' ],
all: [],
any: [ 'has-visible-text', 'aria-label', 'aria-labelledby', {
options: {
attribute: 'title'
},
id: 'non-empty-title'
} ],
none: []
}, {
id: 'aria-text',
impact: 'serious',
selector: '[role=text]',
tags: [ 'cat.aria', 'best-practice' ],
all: [],
any: [ 'no-focusable-content' ],
none: []
}, {
id: 'aria-toggle-field-name',
impact: 'serious',
selector: '[role="checkbox"], [role="menuitemcheckbox"], [role="menuitemradio"], [role="radio"], [role="switch"], [role="option"]',
matches: 'no-naming-method-matches',
tags: [ 'cat.aria', 'wcag2a', 'wcag412', 'TTv5', 'TT5.c', 'EN-301-549', 'EN-9.4.1.2', 'ACT', 'RGAAv4', 'RGAA-7.1.1' ],
actIds: [ 'e086e5' ],
all: [],
any: [ 'has-visible-text', 'aria-label', 'aria-labelledby', {
options: {
attribute: 'title'
},
id: 'non-empty-title'
} ],
none: [ 'no-implicit-explicit-label' ]
}, {
id: 'aria-tooltip-name',
impact: 'serious',
selector: '[role="tooltip"]',
matches: 'no-naming-method-matches',
tags: [ 'cat.aria', 'wcag2a', 'wcag412', 'EN-301-549', 'EN-9.4.1.2' ],
all: [],
any: [ 'has-visible-text', 'aria-label', 'aria-labelledby', {
options: {
attribute: 'title'
},
id: 'non-empty-title'
} ],
none: []
}, {
id: 'aria-treeitem-name',
impact: 'serious',
selector: '[role="treeitem"]',
matches: 'no-naming-method-matches',
tags: [ 'cat.aria', 'best-practice' ],
all: [],
any: [ 'has-visible-text', 'aria-label', 'aria-labelledby', {
options: {
attribute: 'title'
},
id: 'non-empty-title'
} ],
none: []
}, {
id: 'aria-valid-attr-value',
impact: 'critical',
matches: 'aria-has-attr-matches',
tags: [ 'cat.aria', 'wcag2a', 'wcag412', 'EN-301-549', 'EN-9.4.1.2', 'RGAAv4', 'RGAA-7.1.1' ],
actIds: [ '6a7281' ],
all: [ {
options: [],
id: 'aria-valid-attr-value'
}, 'aria-errormessage', 'aria-level' ],
any: [],
none: []
}, {
id: 'aria-valid-attr',
impact: 'critical',
matches: 'aria-has-attr-matches',
tags: [ 'cat.aria', 'wcag2a', 'wcag412', 'EN-301-549', 'EN-9.4.1.2', 'RGAAv4', 'RGAA-7.1.1' ],
actIds: [ '5f99a7' ],
all: [],
any: [ {
options: [],
id: 'aria-valid-attr'
} ],
none: []
}, {
id: 'audio-caption',
impact: 'critical',
selector: 'audio',
enabled: false,
excludeHidden: false,
tags: [ 'cat.time-and-media', 'wcag2a', 'wcag121', 'EN-301-549', 'EN-9.1.2.1', 'section508', 'section508.22.a', 'deprecated' ],
actIds: [ '2eb176', 'afb423' ],
all: [],
any: [],
none: [ 'caption' ]
}, {
id: 'autocomplete-valid',
impact: 'serious',
matches: 'autocomplete-matches',
tags: [ 'cat.forms', 'wcag21aa', 'wcag135', 'EN-301-549', 'EN-9.1.3.5', 'ACT', 'RGAAv4', 'RGAA-11.13.1' ],
actIds: [ '73f2c2' ],
all: [ {
options: {
stateTerms: [ 'none', 'false', 'true', 'disabled', 'enabled', 'undefined', 'null', 'xoff', 'xon' ],
ignoredValues: [ 'text', 'pronouns', 'gender', 'message', 'content' ]
},
id: 'autocomplete-valid'
} ],
any: [],
none: []
}, {
id: 'avoid-inline-spacing',
impact: 'serious',
selector: '[style]',
matches: 'avoid-inline-spacing-matches',
tags: [ 'cat.structure', 'wcag21aa', 'wcag1412', 'EN-301-549', 'EN-9.1.4.12', 'ACT' ],
actIds: [ '24afc2', '9e45ec', '78fd32' ],
all: [ {
options: {
cssProperty: 'letter-spacing',
minValue: .12
},
id: 'important-letter-spacing'
}, {
options: {
cssProperty: 'word-spacing',
minValue: .16
},
id: 'important-word-spacing'
}, {
options: {
multiLineOnly: true,
cssProperty: 'line-height',
minValue: 1.5,
normalValue: 1
},
id: 'important-line-height'
} ],
any: [],
none: []
}, {
id: 'blink',
impact: 'serious',
selector: 'blink',
excludeHidden: false,
tags: [ 'cat.time-and-media', 'wcag2a', 'wcag222', 'section508', 'section508.22.j', 'TTv5', 'TT2.b', 'EN-301-549', 'EN-9.2.2.2', 'RGAAv4', 'RGAA-13.8.1' ],
all: [],
any: [],
none: [ 'is-on-screen' ]
}, {
id: 'button-name',
impact: 'critical',
selector: 'button',
matches: 'no-explicit-name-required-matches',
tags: [ 'cat.name-role-value', 'wcag2a', 'wcag412', 'section508', 'section508.22.a', 'TTv5', 'TT6.a', 'EN-301-549', 'EN-9.4.1.2', 'ACT', 'RGAAv4', 'RGAA-11.9.1' ],
actIds: [ '97a4e1', 'm6b1q3' ],
all: [],
any: [ 'button-has-visible-text', 'aria-label', 'aria-labelledby', {
options: {
attribute: 'title'
},
id: 'non-empty-title'
}, 'implicit-label', 'explicit-label', 'presentational-role' ],
none: []
}, {
id: 'bypass',
impact: 'serious',
selector: 'html:not(html *)',
pageLevel: true,
matches: 'bypass-matches',
reviewOnFail: true,
tags: [ 'cat.keyboard', 'wcag2a', 'wcag241', 'section508', 'section508.22.o', 'TTv5', 'TT9.a', 'EN-301-549', 'EN-9.2.4.1', 'RGAAv4', 'RGAA-12.7.1' ],
actIds: [ 'cf77f2', '047fe0', 'b40fd1', '3e12e1', 'ye5d6e' ],
all: [],
any: [ 'internal-link-present', {
options: {
selector: ':is(h1, h2, h3, h4, h5, h6):not([role]), [role=heading]'
},
id: 'header-present'
}, {
options: {
selector: 'main, [role=main]'
},
id: 'landmark'
} ],
none: []
}, {
id: 'color-contrast-enhanced',
impact: 'serious',
matches: 'color-contrast-matches',
excludeHidden: false,
enabled: false,
tags: [ 'cat.color', 'wcag2aaa', 'wcag146', 'ACT' ],
actIds: [ '09o5cg' ],
all: [],
any: [ {
options: {
ignoreUnicode: true,
ignoreLength: false,
ignorePseudo: false,
boldValue: 700,
boldTextPt: 14,
largeTextPt: 18,
contrastRatio: {
normal: {
expected: 7,
minThreshold: 4.5
},
large: {
expected: 4.5,
minThreshold: 3
}
},
pseudoSizeThreshold: .25,
shadowOutlineEmMax: .1,
textStrokeEmMin: .03
},
id: 'color-contrast-enhanced'
} ],
none: []
}, {
id: 'color-contrast',
impact: 'serious',
matches: 'color-contrast-matches',
excludeHidden: false,
tags: [ 'cat.color', 'wcag2aa', 'wcag143', 'TTv5', 'TT13.c', 'EN-301-549', 'EN-9.1.4.3', 'ACT', 'RGAAv4', 'RGAA-3.2.1' ],
actIds: [ 'afw4f7', '09o5cg' ],
all: [],
any: [ {
options: {
ignoreUnicode: true,
ignoreLength: false,
ignorePseudo: false,
boldValue: 700,
boldTextPt: 14,
largeTextPt: 18,
contrastRatio: {
normal: {
expected: 4.5
},
large: {
expected: 3
}
},
pseudoSizeThreshold: .25,
shadowOutlineEmMax: .2,
textStrokeEmMin: .03
},
id: 'color-contrast'
} ],
none: []
}, {
id: 'css-orientation-lock',
impact: 'serious',
selector: 'html:not(html *)',
tags: [ 'cat.structure', 'wcag134', 'wcag21aa', 'EN-301-549', 'EN-9.1.3.4', 'RGAAv4', 'RGAA-13.9.1', 'experimental' ],
actIds: [ 'b33eff' ],
all: [ {
options: {
degreeThreshold: 2
},
id: 'css-orientation-lock'
} ],
any: [],
none: [],
preload: true
}, {
id: 'definition-list',
impact: 'serious',
selector: 'dl',
matches: 'no-role-matches',
tags: [ 'cat.structure', 'wcag2a', 'wcag131', 'EN-301-549', 'EN-9.1.3.1', 'RGAAv4', 'RGAA-9.3.3' ],
all: [],
any: [],
none: [ 'structured-dlitems', {
options: {
validRoles: [ 'definition', 'term', 'listitem' ],
validNodeNames: [ 'dt', 'dd' ],
divGroups: true
},
id: 'only-dlitems'
} ]
}, {
id: 'dlitem',
impact: 'serious',
selector: 'dd, dt',
matches: 'no-role-matches',
tags: [ 'cat.structure', 'wcag2a', 'wcag131', 'EN-301-549', 'EN-9.1.3.1', 'RGAAv4', 'RGAA-9.3.3' ],
all: [],
any: [ 'dlitem' ],
none: []
}, {
id: 'document-title',
impact: 'serious',
selector: 'html:not(html *)',
matches: 'is-initiator-matches',
tags: [ 'cat.text-alternatives', 'wcag2a', 'wcag242', 'TTv5', 'TT12.a', 'EN-301-549', 'EN-9.2.4.2', 'ACT', 'RGAAv4', 'RGAA-8.5.1' ],
actIds: [ '2779a5' ],
all: [],
any: [ 'doc-has-title' ],
none: []
}, {
id: 'duplicate-id-active',
impact: 'serious',
selector: '[id]',
matches: 'duplicate-id-active-matches',
excludeHidden: false,
tags: [ 'cat.parsing', 'wcag2a-obsolete', 'wcag411', 'deprecated' ],
enabled: false,
actIds: [ '3ea0c8' ],
all: [],
any: [ 'duplicate-id-active' ],
none: []
}, {
id: 'duplicate-id-aria',
impact: 'critical',
selector: '[id]',
matches: 'duplicate-id-aria-matches',
excludeHidden: false,
tags: [ 'cat.parsing', 'wcag2a', 'wcag412', 'EN-301-549', 'EN-9.4.1.2', 'RGAAv4', 'RGAA-8.2.1' ],
reviewOnFail: true,
actIds: [ '3ea0c8' ],
all: [],
any: [ 'duplicate-id-aria' ],
none: []
}, {
id: 'duplicate-id',
impact: 'minor',
selector: '[id]',
matches: 'duplicate-id-misc-matches',
excludeHidden: false,
tags: [ 'cat.parsing', 'wcag2a-obsolete', 'wcag411', 'deprecated' ],
enabled: false,
actIds: [ '3ea0c8' ],
all: [],
any: [ 'duplicate-id' ],
none: []
}, {
id: 'empty-heading',
impact: 'minor',
selector: 'h1, h2, h3, h4, h5, h6, [role="heading"]',
matches: 'heading-matches',
tags: [ 'cat.name-role-value', 'best-practice' ],
actIds: [ 'ffd0e9' ],
all: [],
any: [ 'has-visible-text', 'aria-label', 'aria-labelledby', {
options: {
attribute: 'title'
},
id: 'non-empty-title'
} ],
none: []
}, {
id: 'empty-table-header',
impact: 'minor',
selector: 'th:not([role]), [role="rowheader"], [role="columnheader"]',
tags: [ 'cat.name-role-value', 'best-practice' ],
all: [],
any: [ 'has-visible-text' ],
none: []
}, {
id: 'focus-order-semantics',
impact: 'minor',
selector: 'div, h1, h2, h3, h4, h5, h6, [role=heading], p, span',
matches: 'inserted-into-focus-order-matches',
tags: [ 'cat.keyboard', 'best-practice', 'RGAAv4', 'RGAA-12.8.1', 'experimental' ],
all: [],
any: [ {
options: [],
id: 'has-widget-role'
}, {
options: {
roles: [ 'tooltip' ]
},
id: 'valid-scrollable-semantics'
} ],
none: []
}, {
id: 'form-field-multiple-labels',
impact: 'moderate',
selector: 'input, select, textarea',
matches: 'label-matches',
tags: [ 'cat.forms', 'wcag2a', 'wcag332', 'TTv5', 'TT5.c', 'EN-301-549', 'EN-9.3.3.2', 'RGAAv4', 'RGAA-11.2.1' ],
all: [],
any: [],
none: [ 'multiple-label' ]
}, {
id: 'frame-focusable-content',
impact: 'serious',
selector: 'html:not(html *)',
matches: 'frame-focusable-content-matches',
tags: [ 'cat.keyboard', 'wcag2a', 'wcag211', 'TTv5', 'TT4.a', 'EN-301-549', 'EN-9.2.1.1', 'RGAAv4', 'RGAA-7.3.2' ],
actIds: [ 'akn7bn' ],
all: [],
any: [ 'frame-focusable-content' ],
none: []
}, {
id: 'frame-tested',
impact: 'critical',
selector: 'html:not(html *), frame, iframe',
tags: [ 'cat.structure', 'best-practice', 'review-item' ],
all: [ {
options: {
isViolation: false
},
id: 'frame-tested'
} ],
any: [],
none: []
}, {
id: 'frame-title-unique',
impact: 'serious',
selector: 'frame[title], iframe[title]',
matches: 'frame-title-has-text-matches',
tags: [ 'cat.text-alternatives', 'wcag2a', 'wcag412', 'TTv5', 'TT12.d', 'EN-301-549', 'EN-9.4.1.2', 'RGAAv4', 'RGAA-2.2.1' ],
actIds: [ '4b1c6c' ],
all: [],
any: [],
none: [ 'unique-frame-title' ],
reviewOnFail: true
}, {
id: 'frame-title',
impact: 'serious',
selector: 'frame, iframe',
matches: 'no-negative-tabindex-matches',
tags: [ 'cat.text-alternatives', 'wcag2a', 'wcag412', 'section508', 'section508.22.i', 'TTv5', 'TT12.d', 'EN-301-549', 'EN-9.4.1.2', 'RGAAv4', 'RGAA-2.1.1' ],
actIds: [ 'cae760' ],
all: [],
any: [ {
options: {
attribute: 'title'
},
id: 'non-empty-title'
}, 'aria-label', 'aria-labelledby', 'presentational-role' ],
none: []
}, {
id: 'heading-order',
impact: 'moderate',
selector: 'h1, h2, h3, h4, h5, h6, [role=heading]',
matches: 'heading-matches',
tags: [ 'cat.semantics', 'best-practice' ],
all: [],
any: [ 'heading-order' ],
none: []
}, {
id: 'hidden-content',
impact: 'minor',
selector: '*',
excludeHidden: false,
tags: [ 'cat.structure', 'best-practice', 'experimental', 'review-item' ],
all: [],
any: [ 'hidden-content' ],
none: []
}, {
id: 'html-has-lang',
impact: 'serious',
selector: 'html:not(html *)',
matches: 'is-initiator-matches',
tags: [ 'cat.language', 'wcag2a', 'wcag311', 'TTv5', 'TT11.a', 'EN-301-549', 'EN-9.3.1.1', 'ACT', 'RGAAv4', 'RGAA-8.3.1' ],
actIds: [ 'b5c3f8' ],
all: [],
any: [ {
options: {
attributes: [ 'lang', 'xml:lang' ]
},
id: 'has-lang'
} ],
none: []
}, {
id: 'html-lang-valid',
impact: 'serious',
selector: 'html[lang]:not([lang=""]):not(html *), html[xml\\:lang]:not([xml\\:lang=""]):not(html *)',
tags: [ 'cat.language', 'wcag2a', 'wcag311', 'TTv5', 'TT11.a', 'EN-301-549', 'EN-9.3.1.1', 'ACT', 'RGAAv4', 'RGAA-8.4.1' ],
actIds: [ 'bf051a' ],
all: [],
any: [],
none: [ {
options: {
attributes: [ 'lang', 'xml:lang' ]
},
id: 'valid-lang'
} ]
}, {
id: 'html-xml-lang-mismatch',
impact: 'moderate',
selector: 'html[lang][xml\\:lang]:not(html *)',
matches: 'xml-lang-mismatch-matches',
tags: [ 'cat.language', 'wcag2a', 'wcag311', 'EN-301-549', 'EN-9.3.1.1', 'ACT', 'RGAAv4', 'RGAA-8.3.1' ],
actIds: [ '5b7ae0' ],
all: [ 'xml-lang-mismatch' ],
any: [],
none: []
}, {
id: 'identical-links-same-purpose',
impact: 'minor',
selector: 'a[href], area[href], [role="link"]',
excludeHidden: false,
enabled: false,
matches: 'identical-links-same-purpose-matches',
tags: [ 'cat.semantics', 'wcag2aaa', 'wcag249' ],
actIds: [ 'b20e66' ],
all: [ 'identical-links-same-purpose' ],
any: [],
none: []
}, {
id: 'image-alt',
impact: 'critical',
selector: 'img',
matches: 'no-explicit-name-required-matches',
tags: [ 'cat.text-alternatives', 'wcag2a', 'wcag111', 'section508', 'section508.22.a', 'TTv5', 'TT7.a', 'TT7.b', 'EN-301-549', 'EN-9.1.1.1', 'ACT', 'RGAAv4', 'RGAA-1.1.1' ],
actIds: [ '23a2a8' ],
all: [],
any: [ 'has-alt', 'aria-label', 'aria-labelledby', {
options: {
attribute: 'title'
},
id: 'non-empty-title'
}, 'presentational-role' ],
none: [ 'alt-space-value' ]
}, {
id: 'image-redundant-alt',
impact: 'minor',
selector: 'img',
tags: [ 'cat.text-alternatives', 'best-practice' ],
all: [],
any: [],
none: [ {
options: {
parentSelector: 'button, [role=button], a[href], p, li, td, th'
},
id: 'duplicate-img-label'
} ]
}, {
id: 'input-button-name',
impact: 'critical',
selector: 'input[type="button"], input[type="submit"], input[type="reset"]',
matches: 'no-explicit-name-required-matches',
tags: [ 'cat.name-role-value', 'wcag2a', 'wcag412', 'section508', 'section508.22.a', 'TTv5', 'TT5.c', 'EN-301-549', 'EN-9.4.1.2', 'ACT', 'RGAAv4', 'RGAA-11.9.1' ],
actIds: [ '97a4e1' ],
all: [],
any: [ 'non-empty-if-present', {
options: {
attribute: 'value'
},
id: 'non-empty-value'
}, 'aria-label', 'aria-labelledby', {
options: {
attribute: 'title'
},
id: 'non-empty-title'
}, 'implicit-label', 'explicit-label', 'presentational-role' ],
none: []
}, {
id: 'input-image-alt',
impact: 'critical',
selector: 'input[type="image"]',
matches: 'no-explicit-name-required-matches',
tags: [ 'cat.text-alternatives', 'wcag2a', 'wcag111', 'wcag412', 'section508', 'section508.22.a', 'TTv5', 'TT7.a', 'EN-301-549', 'EN-9.1.1.1', 'EN-9.4.1.2', 'ACT', 'RGAAv4', 'RGAA-1.1.3' ],
actIds: [ '59796f' ],
all: [],
any: [ {
options: {
attribute: 'alt'
},
id: 'non-empty-alt'
}, 'aria-label', 'aria-labelledby', {
options: {
attribute: 'title'
},
id: 'non-empty-title'
}, 'implicit-label', 'explicit-label' ],
none: []
}, {
id: 'label-content-name-mismatch',
impact: 'serious',
matches: 'label-content-name-mismatch-matches',
tags: [ 'cat.semantics', 'wcag21a', 'wcag253', 'EN-301-549', 'EN-9.2.5.3', 'RGAAv4', 'RGAA-6.1.5' ],
actIds: [ '2ee8b8' ],
all: [],
any: [ {
options: {
pixelThreshold: .1,
occurrenceThreshold: 3,
valueTextRoles: [ 'switch', 'checkbox', 'radio', 'menuitemcheckbox', 'menuitemradio' ]
},
id: 'label-content-name-mismatch'
} ],
none: []
}, {
id: 'label-title-only',
impact: 'serious',
selector: 'input, select, textarea',
matches: 'label-matches',
tags: [ 'cat.forms', 'best-practice' ],
all: [],
any: [],
none: [ 'title-only' ]
}, {
id: 'label',
impact: 'critical',
selector: 'input, textarea',
matches: 'label-matches',
tags: [ 'cat.forms', 'wcag2a', 'wcag412', 'section508', 'section508.22.n', 'TTv5', 'TT5.c', 'EN-301-549', 'EN-9.4.1.2', 'ACT', 'RGAAv4', 'RGAA-11.1.1' ],
actIds: [ 'e086e5' ],
all: [],
any: [ 'implicit-label', 'explicit-label', 'aria-label', 'aria-labelledby', {
options: {
attribute: 'title'
},
id: 'non-empty-title'
}, {
options: {
attribute: 'placeholder'
},
id: 'non-empty-placeholder'
}, 'presentational-role' ],
none: [ 'hidden-explicit-label' ]
}, {
id: 'landmark-banner-is-top-level',
impact: 'moderate',
selector: 'header:not([role]), [role=banner]',
matches: 'landmark-has-body-context-matches',
tags: [ 'cat.semantics', 'best-practice' ],
all: [],
any: [ 'landmark-is-top-level' ],
none: []
}, {
id: 'landmark-complementary-is-top-level',
impact: 'moderate',
selector: 'aside:not([role]), [role=complementary]',
tags: [ 'cat.semantics', 'best-practice', 'deprecated' ],
enabled: false,
all: [],
any: [ 'landmark-is-top-level' ],
none: []
}, {
id: 'landmark-contentinfo-is-top-level',
impact: 'moderate',
selector: 'footer:not([role]), [role=contentinfo]',
matches: 'landmark-has-body-context-matches',
tags: [ 'cat.semantics', 'best-practice' ],
all: [],
any: [ 'landmark-is-top-level' ],
none: []
}, {
id: 'landmark-main-is-top-level',
impact: 'moderate',
selector: 'main:not([role]), [role=main]',
tags: [ 'cat.semantics', 'best-practice' ],
all: [],
any: [ 'landmark-is-top-level' ],
none: []
}, {
id: 'landmark-no-duplicate-banner',
impact: 'moderate',
selector: 'header:not([role]), [role=banner]',
tags: [ 'cat.semantics', 'best-practice' ],
all: [],
any: [ {
options: {
selector: 'header:not([role]), [role=banner]',
role: 'banner'
},
id: 'page-no-duplicate-banner'
} ],
none: []
}, {
id: 'landmark-no-duplicate-contentinfo',
impact: 'moderate',
selector: 'footer:not([role]), [role=contentinfo]',
tags: [ 'cat.semantics', 'best-practice' ],
all: [],
any: [ {
options: {
selector: 'footer:not([role]), [role=contentinfo]',
role: 'contentinfo'
},
id: 'page-no-duplicate-contentinfo'
} ],
none: []
}, {
id: 'landmark-no-duplicate-main',
impact: 'moderate',
selector: 'main:not([role]), [role=main]',
tags: [ 'cat.semantics', 'best-practice' ],
all: [],
any: [ {
options: {
selector: 'main:not([role]), [role=\'main\']'
},
id: 'page-no-duplicate-main'
} ],
none: []
}, {
id: 'landmark-one-main',
impact: 'moderate',
selector: 'html:not(html *)',
tags: [ 'cat.semantics', 'best-practice' ],
all: [ {
options: {
selector: 'main:not([role]), [role=\'main\']',
passForModal: true
},
id: 'page-has-main'
} ],
any: [],
none: []
}, {
id: 'landmark-unique',
impact: 'moderate',
selector: '[role=banner], [role=complementary], [role=contentinfo], [role=main], [role=navigation], [role=region], [role=search], [role=form], form, footer, header, aside, main, nav, section',
tags: [ 'cat.semantics', 'best-practice' ],
matches: 'landmark-unique-matches',
all: [],
any: [ 'landmark-is-unique' ],
none: []
}, {
id: 'link-in-text-block',
impact: 'serious',
selector: 'a[href], [role=link]',
matches: 'link-in-text-block-matches',
excludeHidden: false,
tags: [ 'cat.color', 'wcag2a', 'wcag141', 'TTv5', 'TT13.a', 'EN-301-549', 'EN-9.1.4.1', 'RGAAv4', 'RGAA-10.6.1' ],
all: [],
any: [ {
options: {
requiredContrastRatio: 3,
allowSameColor: true
},
id: 'link-in-text-block'
}, 'link-in-text-block-style' ],
none: []
}, {
id: 'link-name',
impact: 'serious',
selector: 'a[href]',
tags: [ 'cat.name-role-value', 'wcag2a', 'wcag244', 'wcag412', 'section508', 'section508.22.a', 'TTv5', 'TT6.a', 'EN-301-549', 'EN-9.2.4.4', 'EN-9.4.1.2', 'ACT', 'RGAAv4', 'RGAA-6.2.1' ],
actIds: [ 'c487ae' ],
all: [],
any: [ 'has-visible-text', 'aria-label', 'aria-labelledby', {
options: {
attribute: 'title'
},
id: 'non-empty-title'
} ],
none: [ 'focusable-no-name' ]
}, {
id: 'list',
impact: 'serious',
selector: 'ul, ol',
matches: 'no-role-matches',
tags: [ 'cat.structure', 'wcag2a', 'wcag131', 'EN-301-549', 'EN-9.1.3.1', 'RGAAv4', 'RGAA-9.3.1' ],
all: [],
any: [],
none: [ {
options: {
validRoles: [ 'listitem' ],
validNodeNames: [ 'li' ]
},
id: 'only-listitems'
} ]
}, {
id: 'listitem',
impact: 'serious',
selector: 'li',
matches: 'no-role-matches',
tags: [ 'cat.structure', 'wcag2a', 'wcag131', 'EN-301-549', 'EN-9.1.3.1', 'RGAAv4', 'RGAA-9.3.1' ],
all: [],
any: [ 'listitem' ],
none: []
}, {
id: 'marquee',
impact: 'serious',
selector: 'marquee',
excludeHidden: false,
tags: [ 'cat.parsing', 'wcag2a', 'wcag222', 'TTv5', 'TT2.b', 'EN-301-549', 'EN-9.2.2.2', 'RGAAv4', 'RGAA-13.8.1' ],
all: [],
any: [],
none: [ 'is-on-screen' ]
}, {
id: 'meta-refresh-no-exceptions',
impact: 'minor',
selector: 'meta[http-equiv="refresh"][content]',
excludeHidden: false,
enabled: false,
tags: [ 'cat.time-and-media', 'wcag2aaa', 'wcag224', 'wcag325' ],
actIds: [ 'bisz58' ],
all: [],
any: [ {
options: {
minDelay: 72e3,
maxDelay: false
},
id: 'meta-refresh-no-exceptions'
} ],
none: []
}, {
id: 'meta-refresh',
impact: 'critical',
selector: 'meta[http-equiv="refresh"][content]',
excludeHidden: false,
tags: [ 'cat.time-and-media', 'wcag2a', 'wcag221', 'TTv5', 'TT8.a', 'EN-301-549', 'EN-9.2.2.1', 'RGAAv4', 'RGAA-13.1.2' ],
actIds: [ 'bc659a', 'bisz58' ],
all: [],
any: [ {
options: {
minDelay: 0,
maxDelay: 72e3
},
id: 'meta-refresh'
} ],
none: []
}, {
id: 'meta-viewport-large',
impact: 'minor',
selector: 'meta[name="viewport"]',
matches: 'is-initiator-matches',
excludeHidden: false,
tags: [ 'cat.sensory-and-visual-cues', 'best-practice' ],
all: [],
any: [ {
options: {
scaleMinimum: 5,
lowerBound: 2
},
id: 'meta-viewport-large'
} ],
none: []
}, {
id: 'meta-viewport',
impact: 'moderate',
selector: 'meta[name="viewport"]',
matches: 'is-initiator-matches',
excludeHidden: false,
tags: [ 'cat.sensory-and-visual-cues', 'wcag2aa', 'wcag144', 'EN-301-549', 'EN-9.1.4.4', 'ACT', 'RGAAv4', 'RGAA-10.4.2' ],
actIds: [ 'b4f0c3' ],
all: [],
any: [ {
options: {
scaleMinimum: 2
},
id: 'meta-viewport'
} ],
none: []
}, {
id: 'nested-interactive',
impact: 'serious',
matches: 'nested-interactive-matches',
tags: [ 'cat.keyboard', 'wcag2a', 'wcag412', 'TTv5', 'TT6.a', 'EN-301-549', 'EN-9.4.1.2', 'RGAAv4', 'RGAA-7.1.1' ],
actIds: [ '307n5z' ],
all: [],
any: [ 'no-focusable-content' ],
none: []
}, {
id: 'no-autoplay-audio',
impact: 'moderate',
excludeHidden: false,
selector: 'audio[autoplay], video[autoplay]',
matches: 'no-autoplay-audio-matches',
reviewOnFail: true,
tags: [ 'cat.time-and-media', 'wcag2a', 'wcag142', 'TTv5', 'TT2.a', 'EN-301-549', 'EN-9.1.4.2', 'ACT', 'RGAAv4', 'RGAA-4.10.1' ],
actIds: [ '80f0bf' ],
preload: true,
all: [ {
options: {
allowedDuration: 3
},
id: 'no-autoplay-audio'
} ],
any: [],
none: []
}, {
id: 'object-alt',
impact: 'serious',
selector: 'object[data]',
matches: 'object-is-loaded-matches',
tags: [ 'cat.text-alternatives', 'wcag2a', 'wcag111', 'section508', 'section508.22.a', 'EN-301-549', 'EN-9.1.1.1', 'RGAAv4', 'RGAA-1.1.6' ],
actIds: [ '8fc3b6' ],
all: [],
any: [ 'aria-label', 'aria-labelledby', {
options: {
attribute: 'title'
},
id: 'non-empty-title'
}, 'presentational-role' ],
none: []
}, {
id: 'p-as-heading',
impact: 'serious',
selector: 'p',
matches: 'p-as-heading-matches',
tags: [ 'cat.semantics', 'wcag2a', 'wcag131', 'EN-301-549', 'EN-9.1.3.1', 'RGAAv4', 'RGAA-9.1.3', 'experimental' ],
all: [ {
options: {
margins: [ {
weight: 150,
italic: true
}, {
weight: 150,
size: 1.15
}, {
italic: true,
size: 1.15
}, {
size: 1.4
} ],
passLength: 1,
failLength: .5
},
id: 'p-as-heading'
} ],
any: [],
none: []
}, {
id: 'page-has-heading-one',
impact: 'moderate',
selector: 'html:not(html *)',
tags: [ 'cat.semantics', 'best-practice' ],
all: [ {
options: {
selector: 'h1:not([role], [aria-level]), :is(h1, h2, h3, h4, h5, h6):not([role])[aria-level=1], [role=heading][aria-level=1]',
passForModal: true
},
id: 'page-has-heading-one'
} ],
any: [],
none: []
}, {
id: 'presentation-role-conflict',
impact: 'minor',
selector: 'img[alt=\'\'], [role="none"], [role="presentation"]',
matches: 'has-implicit-chromium-role-matches',
tags: [ 'cat.aria', 'best-practice', 'ACT' ],
actIds: [ '46ca7f' ],
all: [],
any: [],
none: [ 'is-element-focusable', 'has-global-aria-attribute' ]
}, {
id: 'region',
impact: 'moderate',
selector: 'body *',
tags: [ 'cat.keyboard', 'best-practice', 'RGAAv4', 'RGAA-9.2.1' ],
all: [],
any: [ {
options: {
regionMatcher: 'dialog, [role=dialog], [role=alertdialog], svg'
},
id: 'region'
} ],
none: []
}, {
id: 'role-img-alt',
impact: 'serious',
selector: ':is([role=\'img\'], [role=\'image\']):not(img, area, input, object)',
matches: 'html-namespace-matches',
tags: [ 'cat.text-alternatives', 'wcag2a', 'wcag111', 'section508', 'section508.22.a', 'TTv5', 'TT7.a', 'EN-301-549', 'EN-9.1.1.1', 'ACT', 'RGAAv4', 'RGAA-1.1.1' ],
actIds: [ '23a2a8' ],
all: [],
any: [ 'aria-label', 'aria-labelledby', {
options: {
attribute: 'title'
},
id: 'non-empty-title'
} ],
none: []
}, {
id: 'scope-attr-valid',
impact: 'moderate',
selector: 'td[scope], th[scope]',
tags: [ 'cat.tables', 'best-practice' ],
all: [ 'html5-scope', {
options: {
values: [ 'row', 'col', 'rowgroup', 'colgroup' ]
},
id: 'scope-value'
} ],
any: [],
none: []
}, {
id: 'scrollable-region-focusable',
impact: 'serious',
selector: '*:not(select,textarea)',
matches: 'scrollable-region-focusable-matches',
tags: [ 'cat.keyboard', 'wcag2a', 'wcag211', 'wcag213', 'TTv5', 'TT4.a', 'EN-301-549', 'EN-9.2.1.1', 'EN-9.2.1.3', 'RGAAv4', 'RGAA-7.3.2' ],
actIds: [ '0ssw9k' ],
all: [],
any: [ 'focusable-content', 'focusable-element' ],
none: []
}, {
id: 'select-name',
impact: 'critical',
selector: 'select',
tags: [ 'cat.forms', 'wcag2a', 'wcag412', 'section508', 'section508.22.n', 'TTv5', 'TT5.c', 'EN-301-549', 'EN-9.4.1.2', 'ACT', 'RGAAv4', 'RGAA-11.1.1' ],
actIds: [ 'e086e5' ],
all: [],
any: [ 'implicit-label', 'explicit-label', 'aria-label', 'aria-labelledby', {
options: {
attribute: 'title'
},
id: 'non-empty-title'
}, 'presentational-role' ],
none: [ 'hidden-explicit-label' ]
}, {
id: 'server-side-image-map',
impact: 'minor',
selector: 'img[ismap]',
tags: [ 'cat.text-alternatives', 'wcag2a', 'wcag211', 'section508', 'section508.22.f', 'TTv5', 'TT4.a', 'EN-301-549', 'EN-9.2.1.1', 'RGAAv4', 'RGAA-1.1.4' ],
all: [],
any: [],
none: [ 'exists' ]
}, {
id: 'skip-link',
impact: 'moderate',
selector: 'a[href^="#"], a[href^="/#"]',
matches: 'skip-link-matches',
tags: [ 'cat.keyboard', 'best-practice', 'RGAAv4', 'RGAA-12.7.1' ],
all: [],
any: [ 'skip-link' ],
none: []
}, {
id: 'summary-name',
impact: 'serious',
selector: 'summary',
matches: 'summary-interactive-matches',
tags: [ 'cat.name-role-value', 'wcag2a', 'wcag412', 'section508', 'section508.22.a', 'TTv5', 'TT6.a', 'EN-301-549', 'EN-9.4.1.2' ],
all: [],
any: [ 'has-visible-text', 'aria-label', 'aria-labelledby', {
options: {
attribute: 'title'
},
id: 'non-empty-title'
} ],
none: []
}, {
id: 'svg-img-alt',
impact: 'serious',
selector: ':is([role=\'img\'], [role=\'image\']), [role=\'graphics-symbol\'], svg[role=\'graphics-document\']',
matches: 'svg-namespace-matches',
tags: [ 'cat.text-alternatives', 'wcag2a', 'wcag111', 'section508', 'section508.22.a', 'TTv5', 'TT7.a', 'EN-301-549', 'EN-9.1.1.1', 'ACT', 'RGAAv4', 'RGAA-1.1.5' ],
actIds: [ '7d6734' ],
all: [],
any: [ 'svg-non-empty-title', 'aria-label', 'aria-labelledby', {
options: {
attribute: 'title'
},
id: 'non-empty-title'
} ],
none: []
}, {
id: 'tabindex',
impact: 'serious',
selector: '[tabindex]',
tags: [ 'cat.keyboard', 'best-practice' ],
all: [],
any: [ 'tabindex' ],
none: []
}, {
id: 'table-duplicate-name',
impact: 'minor',
selector: 'table',
tags: [ 'cat.tables', 'best-practice', 'RGAAv4', 'RGAA-5.2.1' ],
all: [],
any: [],
none: [ 'same-caption-summary' ]
}, {
id: 'table-fake-caption',
impact: 'serious',
selector: 'table',
matches: 'data-table-matches',
tags: [ 'cat.tables', 'experimental', 'wcag2a', 'wcag131', 'section508', 'section508.22.g', 'EN-301-549', 'EN-9.1.3.1', 'RGAAv4', 'RGAA-5.4.1' ],
all: [ 'caption-faked' ],
any: [],
none: []
}, {
id: 'target-size',
impact: 'serious',
selector: '*',
enabled: false,
matches: 'widget-not-inline-matches',
tags: [ 'cat.sensory-and-visual-cues', 'wcag22aa', 'wcag258', 'EN-301-549v4', 'EN-9.2.5.8' ],
all: [],
any: [ {
options: {
minSize: 24
},
id: 'target-size'
}, {
options: {
minOffset: 24
},
id: 'target-offset'
} ],
none: []
}, {
id: 'td-has-header',
impact: 'critical',
selector: 'table',
matches: 'data-table-large-matches',
tags: [ 'cat.tables', 'experimental', 'wcag2a', 'wcag131', 'section508', 'section508.22.g', 'TTv5', 'TT14.b', 'EN-301-549', 'EN-9.1.3.1', 'RGAAv4', 'RGAA-5.7.4' ],
all: [ 'td-has-header' ],
any: [],
none: []
}, {
id: 'td-headers-attr',
impact: 'serious',
selector: 'table',
matches: 'table-or-grid-role-matches',
tags: [ 'cat.tables', 'wcag2a', 'wcag131', 'section508', 'section508.22.g', 'TTv5', 'TT14.b', 'EN-301-549', 'EN-9.1.3.1', 'RGAAv4', 'RGAA-5.7.4' ],
actIds: [ 'a25f45' ],
all: [ 'td-headers-attr' ],
any: [],
none: []
}, {
id: 'th-has-data-cells',
impact: 'serious',
selector: 'table',
matches: 'data-table-matches',
tags: [ 'cat.tables', 'wcag2a', 'wcag131', 'section508', 'section508.22.g', 'TTv5', 'TT14.b', 'EN-301-549', 'EN-9.1.3.1', 'RGAAv4', 'RGAA-5.7.1' ],
actIds: [ 'd0f69e' ],
all: [ 'th-has-data-cells' ],
any: [],
none: []
}, {
id: 'valid-lang',
impact: 'serious',
selector: '[lang]:not(html), [xml\\:lang]:not(html)',
tags: [ 'cat.language', 'wcag2aa', 'wcag312', 'TTv5', 'TT11.b', 'EN-301-549', 'EN-9.3.1.2', 'ACT', 'RGAAv4', 'RGAA-8.8.1' ],
actIds: [ 'de46e4' ],
all: [],
any: [],
none: [ {
options: {
attributes: [ 'lang', 'xml:lang' ]
},
id: 'valid-lang'
} ]
}, {
id: 'video-caption',
impact: 'critical',
selector: 'video',
tags: [ 'cat.text-alternatives', 'wcag2a', 'wcag122', 'section508', 'section508.22.a', 'TTv5', 'TT17.a', 'EN-301-549', 'EN-9.1.2.2', 'RGAAv4', 'RGAA-4.3.1' ],
actIds: [ 'eac66b' ],
all: [],
any: [],
none: [ 'caption' ]
} ],
checks: [ {
id: 'abstractrole',
evaluate: 'abstractrole-evaluate'
}, {
id: 'aria-allowed-attr-elm',
evaluate: 'aria-allowed-attr-elm-evaluate'
}, {
id: 'aria-allowed-attr',
evaluate: 'aria-allowed-attr-evaluate',
options: {
validTreeRowAttrs: [ 'aria-posinset', 'aria-setsize', 'aria-expanded', 'aria-level' ],
ariaFallbackValues: {
'aria-current': 'true',
'aria-required': 'true',
'aria-readonly': 'true'
}
}
}, {
id: 'aria-allowed-role',
evaluate: 'aria-allowed-role-evaluate',
options: {
allowImplicit: true,
ignoredTags: []
}
}, {
id: 'aria-busy',
evaluate: 'aria-busy-evaluate',
deprecated: true
}, {
id: 'aria-conditional-attr',
evaluate: 'aria-conditional-attr-evaluate',
options: {
invalidTableRowAttrs: [ 'aria-posinset', 'aria-setsize', 'aria-expanded', 'aria-level' ]
}
}, {
id: 'aria-errormessage',
evaluate: 'aria-errormessage-evaluate'
}, {
id: 'aria-hidden-body',
evaluate: 'aria-hidden-body-evaluate'
}, {
id: 'aria-level',
evaluate: 'aria-level-evaluate'
}, {
id: 'aria-no-deprecated-attr',
evaluate: 'aria-no-deprecated-attr-evaluate'
}, {
id: 'aria-prohibited-attr',
evaluate: 'aria-prohibited-attr-evaluate',
options: {
elementsAllowedAriaLabel: [ 'applet' ]
}
}, {
id: 'aria-required-attr',
evaluate: 'aria-required-attr-evaluate'
}, {
id: 'aria-required-children',
evaluate: 'aria-required-children-evaluate',
options: {
reviewEmpty: [ 'doc-bibliography', 'doc-endnotes', 'grid', 'list', 'listbox', 'menu', 'menubar', 'table', 'tablist', 'tree', 'treegrid', 'rowgroup' ]
}
}, {
id: 'aria-required-parent',
evaluate: 'aria-required-parent-evaluate',
options: {
ownGroupRoles: [ 'listitem', 'treeitem' ]
}
}, {
id: 'aria-roledescription',
evaluate: 'aria-roledescription-evaluate',
options: {
supportedRoles: [ 'button', 'img', 'image', 'checkbox', 'radio', 'combobox', 'menuitemcheckbox', 'menuitemradio' ]
}
}, {
id: 'aria-unsupported-attr',
evaluate: 'aria-unsupported-attr-evaluate'
}, {
id: 'aria-valid-attr-value',
evaluate: 'aria-valid-attr-value-evaluate',
options: []
}, {
id: 'aria-valid-attr',
evaluate: 'aria-valid-attr-evaluate',
options: []
}, {
id: 'braille-label-equivalent',
evaluate: 'braille-label-equivalent-evaluate'
}, {
id: 'braille-roledescription-equivalent',
evaluate: 'braille-roledescription-equivalent-evaluate'
}, {
id: 'deprecatedrole',
evaluate: 'deprecatedrole-evaluate'
}, {
id: 'fallbackrole',
evaluate: 'fallbackrole-evaluate'
}, {
id: 'has-global-aria-attribute',
evaluate: 'has-global-aria-attribute-evaluate'
}, {
id: 'has-widget-role',
evaluate: 'has-widget-role-evaluate',
options: []
}, {
id: 'invalidrole',
evaluate: 'invalidrole-evaluate'
}, {
id: 'is-element-focusable',
evaluate: 'is-element-focusable-evaluate'
}, {
id: 'no-implicit-explicit-label',
evaluate: 'no-implicit-explicit-label-evaluate'
}, {
id: 'unsupportedrole',
evaluate: 'unsupportedrole-evaluate'
}, {
id: 'valid-scrollable-semantics',
evaluate: 'valid-scrollable-semantics-evaluate',
options: {
roles: [ 'tooltip' ]
}
}, {
id: 'color-contrast-enhanced',
evaluate: 'color-contrast-evaluate',
options: {
ignoreUnicode: true,
ignoreLength: false,
ignorePseudo: false,
boldValue: 700,
boldTextPt: 14,
largeTextPt: 18,
contrastRatio: {
normal: {
expected: 7,
minThreshold: 4.5
},
large: {
expected: 4.5,
minThreshold: 3
}
},
pseudoSizeThreshold: .25,
shadowOutlineEmMax: .1,
textStrokeEmMin: .03
}
}, {
id: 'color-contrast',
evaluate: 'color-contrast-evaluate',
options: {
ignoreUnicode: true,
ignoreLength: false,
ignorePseudo: false,
boldValue: 700,
boldTextPt: 14,
largeTextPt: 18,
contrastRatio: {
normal: {
expected: 4.5
},
large: {
expected: 3
}
},
pseudoSizeThreshold: .25,
shadowOutlineEmMax: .2,
textStrokeEmMin: .03
}
}, {
id: 'link-in-text-block-style',
evaluate: 'link-in-text-block-style-evaluate'
}, {
id: 'link-in-text-block',
evaluate: 'link-in-text-block-evaluate',
options: {
requiredContrastRatio: 3,
allowSameColor: true
}
}, {
id: 'autocomplete-appropriate',
evaluate: 'autocomplete-appropriate-evaluate',
deprecated: true
}, {
id: 'autocomplete-valid',
evaluate: 'autocomplete-valid-evaluate',
options: {
stateTerms: [ 'none', 'false', 'true', 'disabled', 'enabled', 'undefined', 'null', 'xoff', 'xon' ],
ignoredValues: [ 'text', 'pronouns', 'gender', 'message', 'content' ]
}
}, {
id: 'accesskeys',
evaluate: 'accesskeys-evaluate',
after: 'accesskeys-after'
}, {
id: 'focusable-content',
evaluate: 'focusable-content-evaluate'
}, {
id: 'focusable-disabled',
evaluate: 'focusable-disabled-evaluate'
}, {
id: 'focusable-element',
evaluate: 'focusable-element-evaluate'
}, {
id: 'focusable-modal-open',
evaluate: 'focusable-modal-open-evaluate'
}, {
id: 'focusable-no-name',
evaluate: 'focusable-no-name-evaluate'
}, {
id: 'focusable-not-tabbable',
evaluate: 'focusable-not-tabbable-evaluate'
}, {
id: 'frame-focusable-content',
evaluate: 'frame-focusable-content-evaluate'
}, {
id: 'landmark-is-top-level',
evaluate: 'landmark-is-top-level-evaluate'
}, {
id: 'no-focusable-content',
evaluate: 'no-focusable-content-evaluate'
}, {
id: 'page-has-heading-one',
evaluate: 'has-descendant-evaluate',
after: 'has-descendant-after',
options: {
selector: 'h1:not([role], [aria-level]), :is(h1, h2, h3, h4, h5, h6):not([role])[aria-level=1], [role=heading][aria-level=1]',
passForModal: true
}
}, {
id: 'page-has-main',
evaluate: 'has-descendant-evaluate',
after: 'has-descendant-after',
options: {
selector: 'main:not([role]), [role=\'main\']',
passForModal: true
}
}, {
id: 'page-no-duplicate-banner',
evaluate: 'page-no-duplicate-evaluate',
after: 'page-no-duplicate-after',
options: {
selector: 'header:not([role]), [role=banner]',
role: 'banner'
}
}, {
id: 'page-no-duplicate-contentinfo',
evaluate: 'page-no-duplicate-evaluate',
after: 'page-no-duplicate-after',
options: {
selector: 'footer:not([role]), [role=contentinfo]',
role: 'contentinfo'
}
}, {
id: 'page-no-duplicate-main',
evaluate: 'page-no-duplicate-evaluate',
after: 'page-no-duplicate-after',
options: {
selector: 'main:not([role]), [role=\'main\']'
}
}, {
id: 'tabindex',
evaluate: 'tabindex-evaluate'
}, {
id: 'alt-space-value',
evaluate: 'alt-space-value-evaluate'
}, {
id: 'duplicate-img-label',
evaluate: 'duplicate-img-label-evaluate',
options: {
parentSelector: 'button, [role=button], a[href], p, li, td, th'
}
}, {
id: 'explicit-label',
evaluate: 'explicit-evaluate'
}, {
id: 'help-same-as-label',
evaluate: 'help-same-as-label-evaluate'
}, {
id: 'hidden-explicit-label',
evaluate: 'hidden-explicit-label-evaluate'
}, {
id: 'implicit-label',
evaluate: 'implicit-evaluate'
}, {
id: 'label-content-name-mismatch',
evaluate: 'label-content-name-mismatch-evaluate',
options: {
pixelThreshold: .1,
occurrenceThreshold: 3,
valueTextRoles: [ 'switch', 'checkbox', 'radio', 'menuitemcheckbox', 'menuitemradio' ]
}
}, {
id: 'multiple-label',
evaluate: 'multiple-label-evaluate'
}, {
id: 'title-only',
evaluate: 'title-only-evaluate'
}, {
id: 'landmark-is-unique',
evaluate: 'landmark-is-unique-evaluate',
after: 'landmark-is-unique-after'
}, {
id: 'has-lang',
evaluate: 'has-lang-evaluate',
options: {
attributes: [ 'lang', 'xml:lang' ]
}
}, {
id: 'valid-lang',
evaluate: 'valid-lang-evaluate',
options: {
attributes: [ 'lang', 'xml:lang' ]
}
}, {
id: 'xml-lang-mismatch',
evaluate: 'xml-lang-mismatch-evaluate'
}, {
id: 'dlitem',
evaluate: 'dlitem-evaluate'
}, {
id: 'listitem',
evaluate: 'listitem-evaluate'
}, {
id: 'only-dlitems',
evaluate: 'invalid-children-evaluate',
options: {
validRoles: [ 'definition', 'term', 'listitem' ],
validNodeNames: [ 'dt', 'dd' ],
divGroups: true
}
}, {
id: 'only-listitems',
evaluate: 'invalid-children-evaluate',
options: {
validRoles: [ 'listitem' ],
validNodeNames: [ 'li' ]
}
}, {
id: 'structured-dlitems',
evaluate: 'structured-dlitems-evaluate'
}, {
id: 'caption',
evaluate: 'caption-evaluate'
}, {
id: 'frame-tested',
evaluate: 'frame-tested-evaluate',
after: 'frame-tested-after',
options: {
isViolation: false
}
}, {
id: 'no-autoplay-audio',
evaluate: 'no-autoplay-audio-evaluate',
options: {
allowedDuration: 3
}
}, {
id: 'css-orientation-lock',
evaluate: 'css-orientation-lock-evaluate',
options: {
degreeThreshold: 2
}
}, {
id: 'meta-viewport-large',
evaluate: 'meta-viewport-scale-evaluate',
options: {
scaleMinimum: 5,
lowerBound: 2
}
}, {
id: 'meta-viewport',
evaluate: 'meta-viewport-scale-evaluate',
options: {
scaleMinimum: 2
}
}, {
id: 'target-offset',
evaluate: 'target-offset-evaluate',
options: {
minOffset: 24
}
}, {
id: 'target-size',
evaluate: 'target-size-evaluate',
options: {
minSize: 24
}
}, {
id: 'header-present',
evaluate: 'has-descendant-evaluate',
after: 'has-descendant-after',
options: {
selector: ':is(h1, h2, h3, h4, h5, h6):not([role]), [role=heading]'
}
}, {
id: 'heading-order',
evaluate: 'heading-order-evaluate',
after: 'heading-order-after'
}, {
id: 'identical-links-same-purpose',
evaluate: 'identical-links-same-purpose-evaluate',
after: 'identical-links-same-purpose-after'
}, {
id: 'internal-link-present',
evaluate: 'internal-link-present-evaluate'
}, {
id: 'landmark',
evaluate: 'has-descendant-evaluate',
options: {
selector: 'main, [role=main]'
}
}, {
id: 'meta-refresh-no-exceptions',
evaluate: 'meta-refresh-evaluate',
options: {
minDelay: 72e3,
maxDelay: false
}
}, {
id: 'meta-refresh',
evaluate: 'meta-refresh-evaluate',
options: {
minDelay: 0,
maxDelay: 72e3
}
}, {
id: 'p-as-heading',
evaluate: 'p-as-heading-evaluate',
options: {
margins: [ {
weight: 150,
italic: true
}, {
weight: 150,
size: 1.15
}, {
italic: true,
size: 1.15
}, {
size: 1.4
} ],
passLength: 1,
failLength: .5
}
}, {
id: 'region',
evaluate: 'region-evaluate',
after: 'region-after',
options: {
regionMatcher: 'dialog, [role=dialog], [role=alertdialog], svg'
}
}, {
id: 'skip-link',
evaluate: 'skip-link-evaluate'
}, {
id: 'unique-frame-title',
evaluate: 'unique-frame-title-evaluate',
after: 'unique-frame-title-after'
}, {
id: 'duplicate-id-active',
evaluate: 'duplicate-id-evaluate',
after: 'duplicate-id-after'
}, {
id: 'duplicate-id-aria',
evaluate: 'duplicate-id-evaluate',
after: 'duplicate-id-after'
}, {
id: 'duplicate-id',
evaluate: 'duplicate-id-evaluate',
after: 'duplicate-id-after'
}, {
id: 'aria-label',
evaluate: 'aria-label-evaluate'
}, {
id: 'aria-labelledby',
evaluate: 'aria-labelledby-evaluate'
}, {
id: 'avoid-inline-spacing',
evaluate: 'avoid-inline-spacing-evaluate',
options: {
cssProperties: [ 'line-height', 'letter-spacing', 'word-spacing' ]
}
}, {
id: 'button-has-visible-text',
evaluate: 'has-text-content-evaluate'
}, {
id: 'doc-has-title',
evaluate: 'doc-has-title-evaluate'
}, {
id: 'error-occurred',
evaluate: 'exists-evaluate'
}, {
id: 'exists',
evaluate: 'exists-evaluate'
}, {
id: 'has-alt',
evaluate: 'has-alt-evaluate'
}, {
id: 'has-visible-text',
evaluate: 'has-text-content-evaluate'
}, {
id: 'important-letter-spacing',
evaluate: 'inline-style-property-evaluate',
options: {
cssProperty: 'letter-spacing',
minValue: .12
}
}, {
id: 'important-line-height',
evaluate: 'inline-style-property-evaluate',
options: {
multiLineOnly: true,
cssProperty: 'line-height',
minValue: 1.5,
normalValue: 1
}
}, {
id: 'important-word-spacing',
evaluate: 'inline-style-property-evaluate',
options: {
cssProperty: 'word-spacing',
minValue: .16
}
}, {
id: 'is-on-screen',
evaluate: 'is-on-screen-evaluate'
}, {
id: 'non-empty-alt',
evaluate: 'attr-non-space-content-evaluate',
options: {
attribute: 'alt'
}
}, {
id: 'non-empty-if-present',
evaluate: 'non-empty-if-present-evaluate'
}, {
id: 'non-empty-placeholder',
evaluate: 'attr-non-space-content-evaluate',
options: {
attribute: 'placeholder'
}
}, {
id: 'non-empty-title',
evaluate: 'attr-non-space-content-evaluate',
options: {
attribute: 'title'
}
}, {
id: 'non-empty-value',
evaluate: 'attr-non-space-content-evaluate',
options: {
attribute: 'value'
}
}, {
id: 'presentational-role',
evaluate: 'presentational-role-evaluate'
}, {
id: 'role-none',
evaluate: 'matches-definition-evaluate',
deprecated: true,
options: {
matcher: {
attributes: {
role: 'none'
}
}
}
}, {
id: 'role-presentation',
evaluate: 'matches-definition-evaluate',
deprecated: true,
options: {
matcher: {
attributes: {
role: 'presentation'
}
}
}
}, {
id: 'svg-non-empty-title',
evaluate: 'svg-non-empty-title-evaluate'
}, {
id: 'caption-faked',
evaluate: 'caption-faked-evaluate'
}, {
id: 'html5-scope',
evaluate: 'html5-scope-evaluate'
}, {
id: 'same-caption-summary',
evaluate: 'same-caption-summary-evaluate'
}, {
id: 'scope-value',
evaluate: 'scope-value-evaluate',
options: {
values: [ 'row', 'col', 'rowgroup', 'colgroup' ]
}
}, {
id: 'td-has-header',
evaluate: 'td-has-header-evaluate'
}, {
id: 'td-headers-attr',
evaluate: 'td-headers-attr-evaluate'
}, {
id: 'th-has-data-cells',
evaluate: 'th-has-data-cells-evaluate'
}, {
id: 'hidden-content',
evaluate: 'hidden-content-evaluate'
} ]
});
})(typeof window === 'object' ? window : this);