@lhci/viewer 0.15.1 → 0.16.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/dist/chunks/entry-DHLFDJOJ.css +17 -0
  2. package/dist/chunks/entry-DHLFDJOJ.css.map +7 -0
  3. package/dist/chunks/entry-KSKAOE6M.js +22 -0
  4. package/dist/chunks/entry-KSKAOE6M.js.map +7 -0
  5. package/dist/index.html +5 -5
  6. package/dist/locales/ar-XB.json +3797 -0
  7. package/dist/locales/ar.json +3797 -0
  8. package/dist/locales/bg.json +3797 -0
  9. package/dist/locales/ca.json +3797 -0
  10. package/dist/locales/cs.json +3797 -0
  11. package/dist/locales/da.json +3797 -0
  12. package/dist/locales/de.json +3797 -0
  13. package/dist/locales/el.json +3797 -0
  14. package/dist/locales/en-GB.json +3797 -0
  15. package/dist/locales/en-US.json +3815 -0
  16. package/dist/locales/en-XA.json +2747 -0
  17. package/dist/locales/en-XL.json +3815 -0
  18. package/dist/locales/es-419.json +3797 -0
  19. package/dist/locales/es.json +3797 -0
  20. package/dist/locales/fi.json +3797 -0
  21. package/dist/locales/fil.json +3797 -0
  22. package/dist/locales/fr.json +3797 -0
  23. package/dist/locales/he.json +3794 -0
  24. package/dist/locales/hi.json +3797 -0
  25. package/dist/locales/hr.json +3797 -0
  26. package/dist/locales/hu.json +3797 -0
  27. package/dist/locales/id.json +3797 -0
  28. package/dist/locales/it.json +3797 -0
  29. package/dist/locales/ja.json +3797 -0
  30. package/dist/locales/ko.json +3797 -0
  31. package/dist/locales/lt.json +3797 -0
  32. package/dist/locales/lv.json +3797 -0
  33. package/dist/locales/nl.json +3797 -0
  34. package/dist/locales/no.json +3797 -0
  35. package/dist/locales/pl.json +3797 -0
  36. package/dist/locales/pt-PT.json +3797 -0
  37. package/dist/locales/pt.json +3797 -0
  38. package/dist/locales/ro.json +3797 -0
  39. package/dist/locales/ru.json +3794 -0
  40. package/dist/locales/sk.json +3797 -0
  41. package/dist/locales/sl.json +3797 -0
  42. package/dist/locales/sr-Latn.json +3797 -0
  43. package/dist/locales/sr.json +3797 -0
  44. package/dist/locales/sv.json +3797 -0
  45. package/dist/locales/ta.json +3794 -0
  46. package/dist/locales/te.json +3797 -0
  47. package/dist/locales/th.json +3797 -0
  48. package/dist/locales/tr.json +3797 -0
  49. package/dist/locales/uk.json +3797 -0
  50. package/dist/locales/vi.json +3797 -0
  51. package/dist/locales/zh-HK.json +3797 -0
  52. package/dist/locales/zh-TW.json +3797 -0
  53. package/dist/locales/zh.json +3797 -0
  54. package/package.json +12 -6
  55. package/src/ui/components/toast.jsx +1 -1
  56. package/src/ui/routes/comparison/comparison.css +3 -2
  57. package/src/ui/routes/comparison/comparison.jsx +39 -14
  58. package/dist/chunks/entry-JMR57VBF.js +0 -15
  59. package/dist/chunks/entry-JMR57VBF.js.map +0 -7
  60. package/dist/chunks/entry-W3IW5PUA.css +0 -12
  61. package/dist/chunks/entry-W3IW5PUA.css.map +0 -7
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../node_modules/ms/index.js", "../../../utils/node_modules/debug/src/common.js", "../../../utils/node_modules/debug/src/browser.js", "../../../../node_modules/whatwg-fetch/dist/fetch.umd.js", "../../../../node_modules/isomorphic-fetch/fetch-npm-browserify.js", "../../../utils/src/api-client.js", "../../../utils/src/lodash.js", "../../../utils/src/seed-data/lhr-generator.js", "../../../utils/src/audit-diff-finder.js", "../../../utils/src/markdown.js", "../../../../node_modules/preact/src/constants.js", "../../../../node_modules/preact/src/util.js", "../../../../node_modules/preact/src/options.js", "../../../../node_modules/preact/src/create-element.js", "../../../../node_modules/preact/src/component.js", "../../../../node_modules/preact/src/create-context.js", "../../../../node_modules/preact/src/diff/children.js", "../../../../node_modules/preact/src/diff/props.js", "../../../../node_modules/preact/src/diff/index.js", "../../../../node_modules/preact/src/render.js", "../../../../node_modules/preact/src/clone-element.js", "../../../../node_modules/preact/src/diff/catch-error.js", "../../../../node_modules/preact/hooks/src/index.js", "../../../../node_modules/clsx/dist/clsx.m.js", "../../../server/src/ui/components/loading-spinner.jsx", "../../../server/src/ui/components/paper.jsx", "../../../server/src/ui/hooks/use-api-data.jsx", "../../../server/src/ui/components/lhr-viewer-link.jsx", "../../../server/src/ui/components/lhr-viewer-button.jsx", "../../src/ui/components/lhci-components.jsx", "../../src/ui/components/report-upload-box.jsx", "../../src/ui/routes/landing/landing.jsx", "../../../server/src/ui/routes/build-view/lhr-comparison.jsx", "../../../server/src/ui/components/dropdown.jsx", "../../../server/src/ui/hooks/use-previous-value.jsx", "../../../server/src/ui/components/score-icon.jsx", "../../../server/src/ui/components/markdown.jsx", "../../../server/src/ui/components/nbsp.jsx", "../../../server/src/ui/routes/build-view/audit-detail/simple-details.jsx", "../../../server/src/ui/routes/build-view/audit-detail/table-details.jsx", "../../../server/src/ui/routes/build-view/audit-list/numeric-diff.jsx", "../../../server/src/ui/routes/build-view/audit-list/audit-diff.jsx", "../../../server/src/ui/routes/build-view/audit-detail/audit-detail.jsx", "../../../server/src/ui/routes/build-view/audit-detail/audit-detail-pane.jsx", "../../../server/src/ui/components/gauge.jsx", "../../../server/src/ui/components/pwa-gauge.jsx", "../../../server/src/ui/components/score-delta-badge.jsx", "../../../server/src/ui/routes/build-view/lhr-comparison-scores.jsx", "../../../server/src/ui/routes/build-view/audit-list/audit-group.jsx", "../../../server/src/ui/routes/build-view/lhr-comparison-legend.jsx", "../../../../node_modules/preact/compat/src/util.js", "../../../../node_modules/preact/compat/src/PureComponent.js", "../../../../node_modules/preact/compat/src/memo.js", "../../../../node_modules/preact/compat/src/forwardRef.js", "../../../../node_modules/preact/compat/src/Children.js", "../../../../node_modules/preact/compat/src/suspense.js", "../../../../node_modules/preact/compat/src/suspense-list.js", "../../../../node_modules/preact/src/constants.js", "../../../../node_modules/preact/compat/src/portals.js", "../../../../node_modules/preact/compat/src/render.js", "../../../../node_modules/preact/compat/src/index.js", "../../../server/src/ui/components/modal.jsx", "../../../server/src/ui/routes/build-view/lhr-comparison-runtime-diff.jsx", "../../src/ui/routes/comparison/comparison.jsx", "../../src/ui/components/toast.jsx", "../../src/ui/app.jsx", "../../src/ui/entry.jsx"],
4
- "sourcesContent": ["/**\n * Helpers.\n */\n\nvar s = 1000;\nvar m = s * 60;\nvar h = m * 60;\nvar d = h * 24;\nvar w = d * 7;\nvar y = d * 365.25;\n\n/**\n * Parse or format the given `val`.\n *\n * Options:\n *\n * - `long` verbose formatting [false]\n *\n * @param {String|Number} val\n * @param {Object} [options]\n * @throws {Error} throw an error if val is not a non-empty string or a number\n * @return {String|Number}\n * @api public\n */\n\nmodule.exports = function(val, options) {\n options = options || {};\n var type = typeof val;\n if (type === 'string' && val.length > 0) {\n return parse(val);\n } else if (type === 'number' && isFinite(val)) {\n return options.long ? fmtLong(val) : fmtShort(val);\n }\n throw new Error(\n 'val is not a non-empty string or a valid number. val=' +\n JSON.stringify(val)\n );\n};\n\n/**\n * Parse the given `str` and return milliseconds.\n *\n * @param {String} str\n * @return {Number}\n * @api private\n */\n\nfunction parse(str) {\n str = String(str);\n if (str.length > 100) {\n return;\n }\n var match = /^(-?(?:\\d+)?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(\n str\n );\n if (!match) {\n return;\n }\n var n = parseFloat(match[1]);\n var type = (match[2] || 'ms').toLowerCase();\n switch (type) {\n case 'years':\n case 'year':\n case 'yrs':\n case 'yr':\n case 'y':\n return n * y;\n case 'weeks':\n case 'week':\n case 'w':\n return n * w;\n case 'days':\n case 'day':\n case 'd':\n return n * d;\n case 'hours':\n case 'hour':\n case 'hrs':\n case 'hr':\n case 'h':\n return n * h;\n case 'minutes':\n case 'minute':\n case 'mins':\n case 'min':\n case 'm':\n return n * m;\n case 'seconds':\n case 'second':\n case 'secs':\n case 'sec':\n case 's':\n return n * s;\n case 'milliseconds':\n case 'millisecond':\n case 'msecs':\n case 'msec':\n case 'ms':\n return n;\n default:\n return undefined;\n }\n}\n\n/**\n * Short format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtShort(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return Math.round(ms / d) + 'd';\n }\n if (msAbs >= h) {\n return Math.round(ms / h) + 'h';\n }\n if (msAbs >= m) {\n return Math.round(ms / m) + 'm';\n }\n if (msAbs >= s) {\n return Math.round(ms / s) + 's';\n }\n return ms + 'ms';\n}\n\n/**\n * Long format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtLong(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return plural(ms, msAbs, d, 'day');\n }\n if (msAbs >= h) {\n return plural(ms, msAbs, h, 'hour');\n }\n if (msAbs >= m) {\n return plural(ms, msAbs, m, 'minute');\n }\n if (msAbs >= s) {\n return plural(ms, msAbs, s, 'second');\n }\n return ms + ' ms';\n}\n\n/**\n * Pluralization helper.\n */\n\nfunction plural(ms, msAbs, n, name) {\n var isPlural = msAbs >= n * 1.5;\n return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');\n}\n", "\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n */\n\nfunction setup(env) {\n\tcreateDebug.debug = createDebug;\n\tcreateDebug.default = createDebug;\n\tcreateDebug.coerce = coerce;\n\tcreateDebug.disable = disable;\n\tcreateDebug.enable = enable;\n\tcreateDebug.enabled = enabled;\n\tcreateDebug.humanize = require('ms');\n\tcreateDebug.destroy = destroy;\n\n\tObject.keys(env).forEach(key => {\n\t\tcreateDebug[key] = env[key];\n\t});\n\n\t/**\n\t* The currently active debug mode names, and names to skip.\n\t*/\n\n\tcreateDebug.names = [];\n\tcreateDebug.skips = [];\n\n\t/**\n\t* Map of special \"%n\" handling functions, for the debug \"format\" argument.\n\t*\n\t* Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n\t*/\n\tcreateDebug.formatters = {};\n\n\t/**\n\t* Selects a color for a debug namespace\n\t* @param {String} namespace The namespace string for the for the debug instance to be colored\n\t* @return {Number|String} An ANSI color code for the given namespace\n\t* @api private\n\t*/\n\tfunction selectColor(namespace) {\n\t\tlet hash = 0;\n\n\t\tfor (let i = 0; i < namespace.length; i++) {\n\t\t\thash = ((hash << 5) - hash) + namespace.charCodeAt(i);\n\t\t\thash |= 0; // Convert to 32bit integer\n\t\t}\n\n\t\treturn createDebug.colors[Math.abs(hash) % createDebug.colors.length];\n\t}\n\tcreateDebug.selectColor = selectColor;\n\n\t/**\n\t* Create a debugger with the given `namespace`.\n\t*\n\t* @param {String} namespace\n\t* @return {Function}\n\t* @api public\n\t*/\n\tfunction createDebug(namespace) {\n\t\tlet prevTime;\n\t\tlet enableOverride = null;\n\n\t\tfunction debug(...args) {\n\t\t\t// Disabled?\n\t\t\tif (!debug.enabled) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst self = debug;\n\n\t\t\t// Set `diff` timestamp\n\t\t\tconst curr = Number(new Date());\n\t\t\tconst ms = curr - (prevTime || curr);\n\t\t\tself.diff = ms;\n\t\t\tself.prev = prevTime;\n\t\t\tself.curr = curr;\n\t\t\tprevTime = curr;\n\n\t\t\targs[0] = createDebug.coerce(args[0]);\n\n\t\t\tif (typeof args[0] !== 'string') {\n\t\t\t\t// Anything else let's inspect with %O\n\t\t\t\targs.unshift('%O');\n\t\t\t}\n\n\t\t\t// Apply any `formatters` transformations\n\t\t\tlet index = 0;\n\t\t\targs[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {\n\t\t\t\t// If we encounter an escaped % then don't increase the array index\n\t\t\t\tif (match === '%%') {\n\t\t\t\t\treturn '%';\n\t\t\t\t}\n\t\t\t\tindex++;\n\t\t\t\tconst formatter = createDebug.formatters[format];\n\t\t\t\tif (typeof formatter === 'function') {\n\t\t\t\t\tconst val = args[index];\n\t\t\t\t\tmatch = formatter.call(self, val);\n\n\t\t\t\t\t// Now we need to remove `args[index]` since it's inlined in the `format`\n\t\t\t\t\targs.splice(index, 1);\n\t\t\t\t\tindex--;\n\t\t\t\t}\n\t\t\t\treturn match;\n\t\t\t});\n\n\t\t\t// Apply env-specific formatting (colors, etc.)\n\t\t\tcreateDebug.formatArgs.call(self, args);\n\n\t\t\tconst logFn = self.log || createDebug.log;\n\t\t\tlogFn.apply(self, args);\n\t\t}\n\n\t\tdebug.namespace = namespace;\n\t\tdebug.useColors = createDebug.useColors();\n\t\tdebug.color = createDebug.selectColor(namespace);\n\t\tdebug.extend = extend;\n\t\tdebug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release.\n\n\t\tObject.defineProperty(debug, 'enabled', {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: false,\n\t\t\tget: () => enableOverride === null ? createDebug.enabled(namespace) : enableOverride,\n\t\t\tset: v => {\n\t\t\t\tenableOverride = v;\n\t\t\t}\n\t\t});\n\n\t\t// Env-specific initialization logic for debug instances\n\t\tif (typeof createDebug.init === 'function') {\n\t\t\tcreateDebug.init(debug);\n\t\t}\n\n\t\treturn debug;\n\t}\n\n\tfunction extend(namespace, delimiter) {\n\t\tconst newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);\n\t\tnewDebug.log = this.log;\n\t\treturn newDebug;\n\t}\n\n\t/**\n\t* Enables a debug mode by namespaces. This can include modes\n\t* separated by a colon and wildcards.\n\t*\n\t* @param {String} namespaces\n\t* @api public\n\t*/\n\tfunction enable(namespaces) {\n\t\tcreateDebug.save(namespaces);\n\n\t\tcreateDebug.names = [];\n\t\tcreateDebug.skips = [];\n\n\t\tlet i;\n\t\tconst split = (typeof namespaces === 'string' ? namespaces : '').split(/[\\s,]+/);\n\t\tconst len = split.length;\n\n\t\tfor (i = 0; i < len; i++) {\n\t\t\tif (!split[i]) {\n\t\t\t\t// ignore empty strings\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tnamespaces = split[i].replace(/\\*/g, '.*?');\n\n\t\t\tif (namespaces[0] === '-') {\n\t\t\t\tcreateDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));\n\t\t\t} else {\n\t\t\t\tcreateDebug.names.push(new RegExp('^' + namespaces + '$'));\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t* Disable debug output.\n\t*\n\t* @return {String} namespaces\n\t* @api public\n\t*/\n\tfunction disable() {\n\t\tconst namespaces = [\n\t\t\t...createDebug.names.map(toNamespace),\n\t\t\t...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace)\n\t\t].join(',');\n\t\tcreateDebug.enable('');\n\t\treturn namespaces;\n\t}\n\n\t/**\n\t* Returns true if the given mode name is enabled, false otherwise.\n\t*\n\t* @param {String} name\n\t* @return {Boolean}\n\t* @api public\n\t*/\n\tfunction enabled(name) {\n\t\tif (name[name.length - 1] === '*') {\n\t\t\treturn true;\n\t\t}\n\n\t\tlet i;\n\t\tlet len;\n\n\t\tfor (i = 0, len = createDebug.skips.length; i < len; i++) {\n\t\t\tif (createDebug.skips[i].test(name)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tfor (i = 0, len = createDebug.names.length; i < len; i++) {\n\t\t\tif (createDebug.names[i].test(name)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t* Convert regexp to namespace\n\t*\n\t* @param {RegExp} regxep\n\t* @return {String} namespace\n\t* @api private\n\t*/\n\tfunction toNamespace(regexp) {\n\t\treturn regexp.toString()\n\t\t\t.substring(2, regexp.toString().length - 2)\n\t\t\t.replace(/\\.\\*\\?$/, '*');\n\t}\n\n\t/**\n\t* Coerce `val`.\n\t*\n\t* @param {Mixed} val\n\t* @return {Mixed}\n\t* @api private\n\t*/\n\tfunction coerce(val) {\n\t\tif (val instanceof Error) {\n\t\t\treturn val.stack || val.message;\n\t\t}\n\t\treturn val;\n\t}\n\n\t/**\n\t* XXX DO NOT USE. This is a temporary stub function.\n\t* XXX It WILL be removed in the next major release.\n\t*/\n\tfunction destroy() {\n\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t}\n\n\tcreateDebug.enable(createDebug.load());\n\n\treturn createDebug;\n}\n\nmodule.exports = setup;\n", "/* eslint-env browser */\n\n/**\n * This is the web browser implementation of `debug()`.\n */\n\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = localstorage();\nexports.destroy = (() => {\n\tlet warned = false;\n\n\treturn () => {\n\t\tif (!warned) {\n\t\t\twarned = true;\n\t\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t\t}\n\t};\n})();\n\n/**\n * Colors.\n */\n\nexports.colors = [\n\t'#0000CC',\n\t'#0000FF',\n\t'#0033CC',\n\t'#0033FF',\n\t'#0066CC',\n\t'#0066FF',\n\t'#0099CC',\n\t'#0099FF',\n\t'#00CC00',\n\t'#00CC33',\n\t'#00CC66',\n\t'#00CC99',\n\t'#00CCCC',\n\t'#00CCFF',\n\t'#3300CC',\n\t'#3300FF',\n\t'#3333CC',\n\t'#3333FF',\n\t'#3366CC',\n\t'#3366FF',\n\t'#3399CC',\n\t'#3399FF',\n\t'#33CC00',\n\t'#33CC33',\n\t'#33CC66',\n\t'#33CC99',\n\t'#33CCCC',\n\t'#33CCFF',\n\t'#6600CC',\n\t'#6600FF',\n\t'#6633CC',\n\t'#6633FF',\n\t'#66CC00',\n\t'#66CC33',\n\t'#9900CC',\n\t'#9900FF',\n\t'#9933CC',\n\t'#9933FF',\n\t'#99CC00',\n\t'#99CC33',\n\t'#CC0000',\n\t'#CC0033',\n\t'#CC0066',\n\t'#CC0099',\n\t'#CC00CC',\n\t'#CC00FF',\n\t'#CC3300',\n\t'#CC3333',\n\t'#CC3366',\n\t'#CC3399',\n\t'#CC33CC',\n\t'#CC33FF',\n\t'#CC6600',\n\t'#CC6633',\n\t'#CC9900',\n\t'#CC9933',\n\t'#CCCC00',\n\t'#CCCC33',\n\t'#FF0000',\n\t'#FF0033',\n\t'#FF0066',\n\t'#FF0099',\n\t'#FF00CC',\n\t'#FF00FF',\n\t'#FF3300',\n\t'#FF3333',\n\t'#FF3366',\n\t'#FF3399',\n\t'#FF33CC',\n\t'#FF33FF',\n\t'#FF6600',\n\t'#FF6633',\n\t'#FF9900',\n\t'#FF9933',\n\t'#FFCC00',\n\t'#FFCC33'\n];\n\n/**\n * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n * and the Firebug extension (any Firefox version) are known\n * to support \"%c\" CSS customizations.\n *\n * TODO: add a `localStorage` variable to explicitly enable/disable colors\n */\n\n// eslint-disable-next-line complexity\nfunction useColors() {\n\t// NB: In an Electron preload script, document will be defined but not fully\n\t// initialized. Since we know we're in Chrome, we'll just detect this case\n\t// explicitly\n\tif (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {\n\t\treturn true;\n\t}\n\n\t// Internet Explorer and Edge do not support colors.\n\tif (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\\/(\\d+)/)) {\n\t\treturn false;\n\t}\n\n\t// Is webkit? http://stackoverflow.com/a/16459606/376773\n\t// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n\treturn (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||\n\t\t// Is firebug? http://stackoverflow.com/a/398120/376773\n\t\t(typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||\n\t\t// Is firefox >= v31?\n\t\t// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||\n\t\t// Double check webkit in userAgent just in case we are in a worker\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/));\n}\n\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n\targs[0] = (this.useColors ? '%c' : '') +\n\t\tthis.namespace +\n\t\t(this.useColors ? ' %c' : ' ') +\n\t\targs[0] +\n\t\t(this.useColors ? '%c ' : ' ') +\n\t\t'+' + module.exports.humanize(this.diff);\n\n\tif (!this.useColors) {\n\t\treturn;\n\t}\n\n\tconst c = 'color: ' + this.color;\n\targs.splice(1, 0, c, 'color: inherit');\n\n\t// The final \"%c\" is somewhat tricky, because there could be other\n\t// arguments passed either before or after the %c, so we need to\n\t// figure out the correct index to insert the CSS into\n\tlet index = 0;\n\tlet lastC = 0;\n\targs[0].replace(/%[a-zA-Z%]/g, match => {\n\t\tif (match === '%%') {\n\t\t\treturn;\n\t\t}\n\t\tindex++;\n\t\tif (match === '%c') {\n\t\t\t// We only are interested in the *last* %c\n\t\t\t// (the user may have provided their own)\n\t\t\tlastC = index;\n\t\t}\n\t});\n\n\targs.splice(lastC, 0, c);\n}\n\n/**\n * Invokes `console.debug()` when available.\n * No-op when `console.debug` is not a \"function\".\n * If `console.debug` is not available, falls back\n * to `console.log`.\n *\n * @api public\n */\nexports.log = console.debug || console.log || (() => {});\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\nfunction save(namespaces) {\n\ttry {\n\t\tif (namespaces) {\n\t\t\texports.storage.setItem('debug', namespaces);\n\t\t} else {\n\t\t\texports.storage.removeItem('debug');\n\t\t}\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\nfunction load() {\n\tlet r;\n\ttry {\n\t\tr = exports.storage.getItem('debug');\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n\n\t// If debug isn't set in LS, and we're in Electron, try to load $DEBUG\n\tif (!r && typeof process !== 'undefined' && 'env' in process) {\n\t\tr = process.env.DEBUG;\n\t}\n\n\treturn r;\n}\n\n/**\n * Localstorage attempts to return the localstorage.\n *\n * This is necessary because safari throws\n * when a user disables cookies/localstorage\n * and you attempt to access it.\n *\n * @return {LocalStorage}\n * @api private\n */\n\nfunction localstorage() {\n\ttry {\n\t\t// TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context\n\t\t// The Browser also has localStorage in the global context.\n\t\treturn localStorage;\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\nmodule.exports = require('./common')(exports);\n\nconst {formatters} = module.exports;\n\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\nformatters.j = function (v) {\n\ttry {\n\t\treturn JSON.stringify(v);\n\t} catch (error) {\n\t\treturn '[UnexpectedJSONParseError]: ' + error.message;\n\t}\n};\n", "(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :\n typeof define === 'function' && define.amd ? define(['exports'], factory) :\n (factory((global.WHATWGFetch = {})));\n}(this, (function (exports) { 'use strict';\n\n var global =\n (typeof globalThis !== 'undefined' && globalThis) ||\n (typeof self !== 'undefined' && self) ||\n (typeof global !== 'undefined' && global);\n\n var support = {\n searchParams: 'URLSearchParams' in global,\n iterable: 'Symbol' in global && 'iterator' in Symbol,\n blob:\n 'FileReader' in global &&\n 'Blob' in global &&\n (function() {\n try {\n new Blob();\n return true\n } catch (e) {\n return false\n }\n })(),\n formData: 'FormData' in global,\n arrayBuffer: 'ArrayBuffer' in global\n };\n\n function isDataView(obj) {\n return obj && DataView.prototype.isPrototypeOf(obj)\n }\n\n if (support.arrayBuffer) {\n var viewClasses = [\n '[object Int8Array]',\n '[object Uint8Array]',\n '[object Uint8ClampedArray]',\n '[object Int16Array]',\n '[object Uint16Array]',\n '[object Int32Array]',\n '[object Uint32Array]',\n '[object Float32Array]',\n '[object Float64Array]'\n ];\n\n var isArrayBufferView =\n ArrayBuffer.isView ||\n function(obj) {\n return obj && viewClasses.indexOf(Object.prototype.toString.call(obj)) > -1\n };\n }\n\n function normalizeName(name) {\n if (typeof name !== 'string') {\n name = String(name);\n }\n if (/[^a-z0-9\\-#$%&'*+.^_`|~!]/i.test(name) || name === '') {\n throw new TypeError('Invalid character in header field name')\n }\n return name.toLowerCase()\n }\n\n function normalizeValue(value) {\n if (typeof value !== 'string') {\n value = String(value);\n }\n return value\n }\n\n // Build a destructive iterator for the value list\n function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift();\n return {done: value === undefined, value: value}\n }\n };\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n };\n }\n\n return iterator\n }\n\n function Headers(headers) {\n this.map = {};\n\n if (headers instanceof Headers) {\n headers.forEach(function(value, name) {\n this.append(name, value);\n }, this);\n } else if (Array.isArray(headers)) {\n headers.forEach(function(header) {\n this.append(header[0], header[1]);\n }, this);\n } else if (headers) {\n Object.getOwnPropertyNames(headers).forEach(function(name) {\n this.append(name, headers[name]);\n }, this);\n }\n }\n\n Headers.prototype.append = function(name, value) {\n name = normalizeName(name);\n value = normalizeValue(value);\n var oldValue = this.map[name];\n this.map[name] = oldValue ? oldValue + ', ' + value : value;\n };\n\n Headers.prototype['delete'] = function(name) {\n delete this.map[normalizeName(name)];\n };\n\n Headers.prototype.get = function(name) {\n name = normalizeName(name);\n return this.has(name) ? this.map[name] : null\n };\n\n Headers.prototype.has = function(name) {\n return this.map.hasOwnProperty(normalizeName(name))\n };\n\n Headers.prototype.set = function(name, value) {\n this.map[normalizeName(name)] = normalizeValue(value);\n };\n\n Headers.prototype.forEach = function(callback, thisArg) {\n for (var name in this.map) {\n if (this.map.hasOwnProperty(name)) {\n callback.call(thisArg, this.map[name], name, this);\n }\n }\n };\n\n Headers.prototype.keys = function() {\n var items = [];\n this.forEach(function(value, name) {\n items.push(name);\n });\n return iteratorFor(items)\n };\n\n Headers.prototype.values = function() {\n var items = [];\n this.forEach(function(value) {\n items.push(value);\n });\n return iteratorFor(items)\n };\n\n Headers.prototype.entries = function() {\n var items = [];\n this.forEach(function(value, name) {\n items.push([name, value]);\n });\n return iteratorFor(items)\n };\n\n if (support.iterable) {\n Headers.prototype[Symbol.iterator] = Headers.prototype.entries;\n }\n\n function consumed(body) {\n if (body.bodyUsed) {\n return Promise.reject(new TypeError('Already read'))\n }\n body.bodyUsed = true;\n }\n\n function fileReaderReady(reader) {\n return new Promise(function(resolve, reject) {\n reader.onload = function() {\n resolve(reader.result);\n };\n reader.onerror = function() {\n reject(reader.error);\n };\n })\n }\n\n function readBlobAsArrayBuffer(blob) {\n var reader = new FileReader();\n var promise = fileReaderReady(reader);\n reader.readAsArrayBuffer(blob);\n return promise\n }\n\n function readBlobAsText(blob) {\n var reader = new FileReader();\n var promise = fileReaderReady(reader);\n reader.readAsText(blob);\n return promise\n }\n\n function readArrayBufferAsText(buf) {\n var view = new Uint8Array(buf);\n var chars = new Array(view.length);\n\n for (var i = 0; i < view.length; i++) {\n chars[i] = String.fromCharCode(view[i]);\n }\n return chars.join('')\n }\n\n function bufferClone(buf) {\n if (buf.slice) {\n return buf.slice(0)\n } else {\n var view = new Uint8Array(buf.byteLength);\n view.set(new Uint8Array(buf));\n return view.buffer\n }\n }\n\n function Body() {\n this.bodyUsed = false;\n\n this._initBody = function(body) {\n /*\n fetch-mock wraps the Response object in an ES6 Proxy to\n provide useful test harness features such as flush. However, on\n ES5 browsers without fetch or Proxy support pollyfills must be used;\n the proxy-pollyfill is unable to proxy an attribute unless it exists\n on the object before the Proxy is created. This change ensures\n Response.bodyUsed exists on the instance, while maintaining the\n semantic of setting Request.bodyUsed in the constructor before\n _initBody is called.\n */\n this.bodyUsed = this.bodyUsed;\n this._bodyInit = body;\n if (!body) {\n this._bodyText = '';\n } else if (typeof body === 'string') {\n this._bodyText = body;\n } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {\n this._bodyBlob = body;\n } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {\n this._bodyFormData = body;\n } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {\n this._bodyText = body.toString();\n } else if (support.arrayBuffer && support.blob && isDataView(body)) {\n this._bodyArrayBuffer = bufferClone(body.buffer);\n // IE 10-11 can't handle a DataView body.\n this._bodyInit = new Blob([this._bodyArrayBuffer]);\n } else if (support.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(body) || isArrayBufferView(body))) {\n this._bodyArrayBuffer = bufferClone(body);\n } else {\n this._bodyText = body = Object.prototype.toString.call(body);\n }\n\n if (!this.headers.get('content-type')) {\n if (typeof body === 'string') {\n this.headers.set('content-type', 'text/plain;charset=UTF-8');\n } else if (this._bodyBlob && this._bodyBlob.type) {\n this.headers.set('content-type', this._bodyBlob.type);\n } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {\n this.headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8');\n }\n }\n };\n\n if (support.blob) {\n this.blob = function() {\n var rejected = consumed(this);\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return Promise.resolve(this._bodyBlob)\n } else if (this._bodyArrayBuffer) {\n return Promise.resolve(new Blob([this._bodyArrayBuffer]))\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as blob')\n } else {\n return Promise.resolve(new Blob([this._bodyText]))\n }\n };\n\n this.arrayBuffer = function() {\n if (this._bodyArrayBuffer) {\n var isConsumed = consumed(this);\n if (isConsumed) {\n return isConsumed\n }\n if (ArrayBuffer.isView(this._bodyArrayBuffer)) {\n return Promise.resolve(\n this._bodyArrayBuffer.buffer.slice(\n this._bodyArrayBuffer.byteOffset,\n this._bodyArrayBuffer.byteOffset + this._bodyArrayBuffer.byteLength\n )\n )\n } else {\n return Promise.resolve(this._bodyArrayBuffer)\n }\n } else {\n return this.blob().then(readBlobAsArrayBuffer)\n }\n };\n }\n\n this.text = function() {\n var rejected = consumed(this);\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return readBlobAsText(this._bodyBlob)\n } else if (this._bodyArrayBuffer) {\n return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer))\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as text')\n } else {\n return Promise.resolve(this._bodyText)\n }\n };\n\n if (support.formData) {\n this.formData = function() {\n return this.text().then(decode)\n };\n }\n\n this.json = function() {\n return this.text().then(JSON.parse)\n };\n\n return this\n }\n\n // HTTP methods whose capitalization should be normalized\n var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT'];\n\n function normalizeMethod(method) {\n var upcased = method.toUpperCase();\n return methods.indexOf(upcased) > -1 ? upcased : method\n }\n\n function Request(input, options) {\n if (!(this instanceof Request)) {\n throw new TypeError('Please use the \"new\" operator, this DOM object constructor cannot be called as a function.')\n }\n\n options = options || {};\n var body = options.body;\n\n if (input instanceof Request) {\n if (input.bodyUsed) {\n throw new TypeError('Already read')\n }\n this.url = input.url;\n this.credentials = input.credentials;\n if (!options.headers) {\n this.headers = new Headers(input.headers);\n }\n this.method = input.method;\n this.mode = input.mode;\n this.signal = input.signal;\n if (!body && input._bodyInit != null) {\n body = input._bodyInit;\n input.bodyUsed = true;\n }\n } else {\n this.url = String(input);\n }\n\n this.credentials = options.credentials || this.credentials || 'same-origin';\n if (options.headers || !this.headers) {\n this.headers = new Headers(options.headers);\n }\n this.method = normalizeMethod(options.method || this.method || 'GET');\n this.mode = options.mode || this.mode || null;\n this.signal = options.signal || this.signal;\n this.referrer = null;\n\n if ((this.method === 'GET' || this.method === 'HEAD') && body) {\n throw new TypeError('Body not allowed for GET or HEAD requests')\n }\n this._initBody(body);\n\n if (this.method === 'GET' || this.method === 'HEAD') {\n if (options.cache === 'no-store' || options.cache === 'no-cache') {\n // Search for a '_' parameter in the query string\n var reParamSearch = /([?&])_=[^&]*/;\n if (reParamSearch.test(this.url)) {\n // If it already exists then set the value with the current time\n this.url = this.url.replace(reParamSearch, '$1_=' + new Date().getTime());\n } else {\n // Otherwise add a new '_' parameter to the end with the current time\n var reQueryString = /\\?/;\n this.url += (reQueryString.test(this.url) ? '&' : '?') + '_=' + new Date().getTime();\n }\n }\n }\n }\n\n Request.prototype.clone = function() {\n return new Request(this, {body: this._bodyInit})\n };\n\n function decode(body) {\n var form = new FormData();\n body\n .trim()\n .split('&')\n .forEach(function(bytes) {\n if (bytes) {\n var split = bytes.split('=');\n var name = split.shift().replace(/\\+/g, ' ');\n var value = split.join('=').replace(/\\+/g, ' ');\n form.append(decodeURIComponent(name), decodeURIComponent(value));\n }\n });\n return form\n }\n\n function parseHeaders(rawHeaders) {\n var headers = new Headers();\n // Replace instances of \\r\\n and \\n followed by at least one space or horizontal tab with a space\n // https://tools.ietf.org/html/rfc7230#section-3.2\n var preProcessedHeaders = rawHeaders.replace(/\\r?\\n[\\t ]+/g, ' ');\n // Avoiding split via regex to work around a common IE11 bug with the core-js 3.6.0 regex polyfill\n // https://github.com/github/fetch/issues/748\n // https://github.com/zloirock/core-js/issues/751\n preProcessedHeaders\n .split('\\r')\n .map(function(header) {\n return header.indexOf('\\n') === 0 ? header.substr(1, header.length) : header\n })\n .forEach(function(line) {\n var parts = line.split(':');\n var key = parts.shift().trim();\n if (key) {\n var value = parts.join(':').trim();\n headers.append(key, value);\n }\n });\n return headers\n }\n\n Body.call(Request.prototype);\n\n function Response(bodyInit, options) {\n if (!(this instanceof Response)) {\n throw new TypeError('Please use the \"new\" operator, this DOM object constructor cannot be called as a function.')\n }\n if (!options) {\n options = {};\n }\n\n this.type = 'default';\n this.status = options.status === undefined ? 200 : options.status;\n this.ok = this.status >= 200 && this.status < 300;\n this.statusText = 'statusText' in options ? options.statusText : '';\n this.headers = new Headers(options.headers);\n this.url = options.url || '';\n this._initBody(bodyInit);\n }\n\n Body.call(Response.prototype);\n\n Response.prototype.clone = function() {\n return new Response(this._bodyInit, {\n status: this.status,\n statusText: this.statusText,\n headers: new Headers(this.headers),\n url: this.url\n })\n };\n\n Response.error = function() {\n var response = new Response(null, {status: 0, statusText: ''});\n response.type = 'error';\n return response\n };\n\n var redirectStatuses = [301, 302, 303, 307, 308];\n\n Response.redirect = function(url, status) {\n if (redirectStatuses.indexOf(status) === -1) {\n throw new RangeError('Invalid status code')\n }\n\n return new Response(null, {status: status, headers: {location: url}})\n };\n\n exports.DOMException = global.DOMException;\n try {\n new exports.DOMException();\n } catch (err) {\n exports.DOMException = function(message, name) {\n this.message = message;\n this.name = name;\n var error = Error(message);\n this.stack = error.stack;\n };\n exports.DOMException.prototype = Object.create(Error.prototype);\n exports.DOMException.prototype.constructor = exports.DOMException;\n }\n\n function fetch(input, init) {\n return new Promise(function(resolve, reject) {\n var request = new Request(input, init);\n\n if (request.signal && request.signal.aborted) {\n return reject(new exports.DOMException('Aborted', 'AbortError'))\n }\n\n var xhr = new XMLHttpRequest();\n\n function abortXhr() {\n xhr.abort();\n }\n\n xhr.onload = function() {\n var options = {\n status: xhr.status,\n statusText: xhr.statusText,\n headers: parseHeaders(xhr.getAllResponseHeaders() || '')\n };\n options.url = 'responseURL' in xhr ? xhr.responseURL : options.headers.get('X-Request-URL');\n var body = 'response' in xhr ? xhr.response : xhr.responseText;\n setTimeout(function() {\n resolve(new Response(body, options));\n }, 0);\n };\n\n xhr.onerror = function() {\n setTimeout(function() {\n reject(new TypeError('Network request failed'));\n }, 0);\n };\n\n xhr.ontimeout = function() {\n setTimeout(function() {\n reject(new TypeError('Network request failed'));\n }, 0);\n };\n\n xhr.onabort = function() {\n setTimeout(function() {\n reject(new exports.DOMException('Aborted', 'AbortError'));\n }, 0);\n };\n\n function fixUrl(url) {\n try {\n return url === '' && global.location.href ? global.location.href : url\n } catch (e) {\n return url\n }\n }\n\n xhr.open(request.method, fixUrl(request.url), true);\n\n if (request.credentials === 'include') {\n xhr.withCredentials = true;\n } else if (request.credentials === 'omit') {\n xhr.withCredentials = false;\n }\n\n if ('responseType' in xhr) {\n if (support.blob) {\n xhr.responseType = 'blob';\n } else if (\n support.arrayBuffer &&\n request.headers.get('Content-Type') &&\n request.headers.get('Content-Type').indexOf('application/octet-stream') !== -1\n ) {\n xhr.responseType = 'arraybuffer';\n }\n }\n\n if (init && typeof init.headers === 'object' && !(init.headers instanceof Headers)) {\n Object.getOwnPropertyNames(init.headers).forEach(function(name) {\n xhr.setRequestHeader(name, normalizeValue(init.headers[name]));\n });\n } else {\n request.headers.forEach(function(value, name) {\n xhr.setRequestHeader(name, value);\n });\n }\n\n if (request.signal) {\n request.signal.addEventListener('abort', abortXhr);\n\n xhr.onreadystatechange = function() {\n // DONE (success or failure)\n if (xhr.readyState === 4) {\n request.signal.removeEventListener('abort', abortXhr);\n }\n };\n }\n\n xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit);\n })\n }\n\n fetch.polyfill = true;\n\n if (!global.fetch) {\n global.fetch = fetch;\n global.Headers = Headers;\n global.Request = Request;\n global.Response = Response;\n }\n\n exports.Headers = Headers;\n exports.Request = Request;\n exports.Response = Response;\n exports.fetch = fetch;\n\n Object.defineProperty(exports, '__esModule', { value: true });\n\n})));\n", "// the whatwg-fetch polyfill installs the fetch() function\n// on the global object (window or self)\n//\n// Return that as the export for use in Webpack, Browserify etc.\nrequire('whatwg-fetch');\nmodule.exports = self.fetch.bind(self);\n", "/**\n * @license Copyright 2019 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.\n */\n'use strict';\n\nconst log = require('debug')('lhci:utils:api-client');\nconst fetch = require('isomorphic-fetch');\n\n/** @type {(s: string) => string} */\nconst btoa = typeof window === 'undefined' ? s => Buffer.from(s).toString('base64') : window.btoa; // eslint-disable-line no-undef\n\nclass ApiClient {\n /**\n * @param {{rootURL: string, fetch?: import('isomorphic-fetch'), URL?: typeof URL, extraHeaders?: Record<string, string>, basicAuth?: LHCI.ServerCommand.Options['basicAuth']}} options\n */\n constructor(options) {\n this._rootURL = options.rootURL;\n /** @type {Record<string, string>} */\n this._extraHeaders = options.extraHeaders || {};\n this._fetch = options.fetch || fetch;\n this._URL = options.URL || URL;\n\n if (options.basicAuth && options.basicAuth.password) {\n const {username = ApiClient.DEFAULT_BASIC_AUTH_USERNAME, password} = options.basicAuth;\n this._extraHeaders.Authorization = `Basic ${btoa(`${username}:${password}`)}`;\n }\n\n /** @type {LHCI.ServerCommand.StorageMethod} */\n const typecheck = this; // eslint-disable-line no-unused-vars\n }\n\n /** @param {string|undefined} token */\n setBuildToken(token) {\n this._extraHeaders = {...this._extraHeaders, 'x-lhci-build-token': token || ''};\n }\n\n /** @param {string|undefined} token */\n setAdminToken(token) {\n this._extraHeaders = {...this._extraHeaders, 'x-lhci-admin-token': token || ''};\n }\n\n /**\n * @param {string} url\n * @return {URL}\n */\n _normalizeURL(url) {\n if (!url.startsWith('/')) throw new Error(`Cannot normalize \"${url}\" without leading /`);\n const rootWithoutSlash = this._rootURL.endsWith('/')\n ? this._rootURL.slice(0, this._rootURL.length - 1)\n : this._rootURL;\n return new this._URL(`${rootWithoutSlash}${url}`);\n }\n\n /**\n * @param {Promise<any>} returnValuePromise\n * @return {Promise<any>}\n */\n _convert404ToUndefined(returnValuePromise) {\n return returnValuePromise.catch(err => {\n if ('status' in err && err.status === 404) return undefined;\n throw err;\n });\n }\n\n /**\n * @param {Response} response\n */\n async _convertFetchResponseToReturnValue(response) {\n if (response.status === 204) {\n return undefined;\n }\n\n if (response.status >= 400) {\n const body = await response.text();\n /** @type {Error & {status?: number, body?: string}} */\n const error = new Error(`Unexpected status code ${response.status}\\n ${body}`);\n error.status = response.status;\n error.body = body;\n throw error;\n }\n\n const json = await response.json();\n return json;\n }\n\n /**\n * @param {string} method\n * @param {string} url\n * @param {*} body\n * @return {Promise<any>}\n */\n async _fetchWithRequestBody(method, url, body) {\n const response = await this._fetch(this._normalizeURL(url).href, {\n method,\n body: JSON.stringify(body),\n headers: {...this._extraHeaders, 'content-type': 'application/json'},\n });\n\n return this._convertFetchResponseToReturnValue(response);\n }\n\n /**\n * @template {string} T\n * @param {string} rawUrl\n * @param {Partial<Record<T, string|number|boolean|undefined>>} [query]\n * @return {Promise<any>}\n */\n async _get(rawUrl, query) {\n const url = this._normalizeURL(rawUrl);\n if (query) {\n for (const [key, value] of Object.entries(query)) {\n if (value === undefined) continue;\n url.searchParams.append(key, value.toString());\n }\n }\n\n const response = await this._fetch(url.href, {headers: {...this._extraHeaders}});\n return this._convertFetchResponseToReturnValue(response);\n }\n\n /**\n * @param {string} url\n * @param {*} body\n * @return {Promise<any>}\n */\n async _post(url, body) {\n return this._fetchWithRequestBody('POST', url, body);\n }\n\n /**\n * @param {string} url\n * @param {*} body\n * @return {Promise<any>}\n */\n async _put(url, body) {\n return this._fetchWithRequestBody('PUT', url, body);\n }\n\n /**\n * @param {string} rawUrl\n * @return {Promise<void>}\n */\n async _delete(rawUrl) {\n const headers = {...this._extraHeaders};\n const response = await this._fetch(this._normalizeURL(rawUrl).href, {\n method: 'DELETE',\n headers,\n });\n return this._convertFetchResponseToReturnValue(response);\n }\n\n /**\n * @return {Promise<void>}\n */\n async initialize() {\n throw new Error('Unimplemented');\n }\n\n /**\n * @return {Promise<string>}\n */\n async getVersion() {\n const response = await this._fetch(this._normalizeURL('/version').href, {\n headers: {...this._extraHeaders},\n });\n\n const body = response.text();\n\n if (!response.ok) {\n /** @type {Error & {status?: number, body?: any}} */\n const error = new Error(`Unexpected status code ${response.status}\\n ${body}`);\n error.status = response.status;\n error.body = body;\n throw error;\n }\n\n return body;\n }\n\n /**\n * @return {Promise<Array<LHCI.ServerCommand.Project>>}\n */\n async getProjects() {\n return this._get('/v1/projects');\n }\n\n /**\n * @param {LHCI.ServerCommand.Project} project\n * @return {Promise<string>}\n */\n async getProjectToken(project) {\n return (await this._get(`/v1/projects/${project.id}/token`)).token;\n }\n\n /**\n * @param {string} token\n * @return {Promise<LHCI.ServerCommand.Project | undefined>}\n */\n async findProjectByToken(token) {\n return this._convert404ToUndefined(this._post(`/v1/projects/lookup`, {token}));\n }\n\n /**\n * @param {string} projectId\n * @return {Promise<LHCI.ServerCommand.Project | undefined>}\n */\n async findProjectById(projectId) {\n return this._convert404ToUndefined(this._get(`/v1/projects/${projectId}`));\n }\n\n /**\n * @param {string} slug\n * @return {Promise<LHCI.ServerCommand.Project | undefined>}\n */\n async findProjectBySlug(slug) {\n return this._convert404ToUndefined(this._get(`/v1/projects/slug:${slug}`));\n }\n\n /**\n * @param {StrictOmit<LHCI.ServerCommand.Project, 'id'|'token'|'adminToken'>} unsavedProject\n * @return {Promise<LHCI.ServerCommand.Project>}\n */\n async createProject(unsavedProject) {\n return this._post(`/v1/projects`, unsavedProject);\n }\n\n /**\n * @param {Pick<LHCI.ServerCommand.Project, 'id'|'baseBranch'|'externalUrl'|'name'>} projectUpdates\n * @return {Promise<void>}\n */\n async updateProject(projectUpdates) {\n return this._put(`/v1/projects/${projectUpdates.id}`, projectUpdates);\n }\n\n /**\n * @param {string} projectId\n * @return {Promise<void>}\n */\n async deleteProject(projectId) {\n return this._delete(`/v1/projects/${projectId}`);\n }\n\n /**\n * @param {string} projectId\n * @param {LHCI.ServerCommand.GetBuildsOptions} [options]\n * @return {Promise<LHCI.ServerCommand.Build[]>}\n */\n async getBuilds(projectId, options = {}) {\n return this._get(`/v1/projects/${projectId}/builds`, options);\n }\n\n /**\n * @param {string} projectId\n * @return {Promise<Array<{branch: string}>>}\n */\n // eslint-disable-next-line no-unused-vars\n async getBranches(projectId) {\n return this._get(`/v1/projects/${projectId}/branches`);\n }\n\n /**\n * @param {StrictOmit<LHCI.ServerCommand.Build, 'id'>} unsavedBuild\n * @return {Promise<LHCI.ServerCommand.Build>}\n */\n async createBuild(unsavedBuild) {\n return this._post(`/v1/projects/${unsavedBuild.projectId}/builds`, unsavedBuild);\n }\n\n /**\n * @param {string} projectId\n * @param {string} buildId\n * @return {Promise<void>}\n */\n async sealBuild(projectId, buildId) {\n return this._put(`/v1/projects/${projectId}/builds/${buildId}/lifecycle`, 'sealed');\n }\n\n /**\n * @param {string} projectId\n * @param {string} buildId\n * @return {Promise<void>}\n */\n async deleteBuild(projectId, buildId) {\n return this._delete(`/v1/projects/${projectId}/builds/${buildId}`);\n }\n\n /**\n * @param {string} projectId\n * @param {string} buildId\n * @return {Promise<LHCI.ServerCommand.Build | undefined>}\n */\n async findBuildById(projectId, buildId) {\n return this._convert404ToUndefined(this._get(`/v1/projects/${projectId}/builds/${buildId}`));\n }\n\n /**\n * @param {string} projectId\n * @param {string} buildId\n * @return {Promise<LHCI.ServerCommand.Build | undefined>}\n */\n async findAncestorBuildById(projectId, buildId) {\n return this._convert404ToUndefined(\n this._get(`/v1/projects/${projectId}/builds/${buildId}/ancestor`)\n );\n }\n\n /**\n * @param {string} projectId\n * @param {string} buildId\n * @param {LHCI.ServerCommand.GetRunsOptions} [options]\n * @return {Promise<LHCI.ServerCommand.Run[]>}\n */\n async getRuns(projectId, buildId, options = {}) {\n return this._get(`/v1/projects/${projectId}/builds/${buildId}/runs`, options);\n }\n\n /**\n * @param {string} projectId\n * @param {string} [buildId]\n * @return {Promise<{url: string}[]>}\n */\n async getUrls(projectId, buildId) {\n if (buildId) return this._get(`/v1/projects/${projectId}/builds/${buildId}/urls`);\n return this._get(`/v1/projects/${projectId}/urls`);\n }\n\n /**\n * @param {StrictOmit<LHCI.ServerCommand.Run, 'id'>} run\n * @return {Promise<LHCI.ServerCommand.Run>}\n */\n async createRun(run) {\n return this._post(`/v1/projects/${run.projectId}/builds/${run.buildId}/runs`, run);\n }\n\n /**\n * @param {string} projectId\n * @param {string} buildId\n * @return {Promise<Array<LHCI.ServerCommand.Statistic>>}\n */\n async getStatistics(projectId, buildId) {\n return this._get(`/v1/projects/${projectId}/builds/${buildId}/statistics`);\n }\n\n /**\n * \u2060@return {Promise<{viewerOrigin: string}>}\n */\n async getViewerOrigin() {\n return this._get('/v1/viewer/origin');\n }\n\n /**\n * @param {StrictOmit<LHCI.ServerCommand.Project, 'id'|'token'|'adminToken'>} unsavedProject\n * @return {Promise<LHCI.ServerCommand.Project>}\n */\n // eslint-disable-next-line no-unused-vars\n async _createProject(unsavedProject) {\n throw new Error('Unimplemented');\n }\n\n /**\n * @param {StrictOmit<LHCI.ServerCommand.Statistic, 'id'>} unsavedStatistic\n * @return {Promise<LHCI.ServerCommand.Statistic>}\n */\n // eslint-disable-next-line no-unused-vars\n async _createOrUpdateStatistic(unsavedStatistic) {\n throw new Error('Unimplemented');\n }\n\n /**\n * @param {string} projectId\n * @param {string} buildId\n * @return {Promise<Array<LHCI.ServerCommand.Statistic>>}\n */\n // eslint-disable-next-line no-unused-vars\n async _getStatistics(projectId, buildId) {\n throw new Error('Unimplemented');\n }\n\n /**\n * @param {string} projectId\n * @param {string} buildId\n * @return {Promise<void>}\n */\n // eslint-disable-next-line no-unused-vars\n async _invalidateStatistics(projectId, buildId) {\n throw new Error('Unimplemented');\n }\n\n /**\n * @param {Date} runAt\n * @return {Promise<LHCI.ServerCommand.Build[]>}\n */\n // eslint-disable-next-line no-unused-vars\n async findBuildsBeforeTimestamp(runAt) {\n throw new Error('Unimplemented');\n }\n\n /**\n * @param {string} projectId\n * @return {Promise<string>}\n */\n // eslint-disable-next-line no-unused-vars\n async _resetAdminToken(projectId) {\n throw new Error('Unimplemented');\n }\n\n /**\n * @param {string} projectId\n * @return {Promise<string>}\n */\n // eslint-disable-next-line no-unused-vars\n async _resetProjectToken(projectId) {\n throw new Error('Unimplemented');\n }\n\n async close() {}\n\n static get DEFAULT_BASIC_AUTH_USERNAME() {\n return 'lhci';\n }\n\n /**\n * Computes whether the two version strings are API-version compatible.\n * For now this is just semver, but could eventually take more into account.\n * @param {string} clientVersion\n * @param {string} serverVersion\n */\n static isApiVersionCompatible(clientVersion, serverVersion) {\n log(`checking for client (${clientVersion}) server (${serverVersion}) compatibility`);\n const partsClient = clientVersion.match(/(\\d+)\\.(\\d+)\\.\\d+/);\n const partsServer = serverVersion.match(/(\\d+)\\.(\\d+)\\.\\d+/);\n if (!partsClient || !partsServer) return false;\n\n let majorVersionClient = Number(partsClient[1]);\n let majorVersionServer = Number(partsServer[1]);\n if (majorVersionClient !== majorVersionServer) return false;\n\n if (majorVersionClient === 0) majorVersionClient = Number(partsClient[2]);\n if (majorVersionServer === 0) majorVersionServer = Number(partsServer[2]);\n\n return (\n majorVersionClient === majorVersionServer || majorVersionClient === majorVersionServer + 1\n );\n }\n}\n\nmodule.exports = ApiClient;\n", "/**\n * @license Copyright 2019 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.\n */\n'use strict';\n\n/**\n * Recursively merges properties of v2 into v1. Mutates o1 in place, does not return a copy.\n *\n * @template T\n * @param {T} v1\n * @param {T} v2\n * @return {T}\n */\nfunction merge(v1, v2) {\n if (Array.isArray(v1)) {\n if (!Array.isArray(v2)) return v2;\n\n for (let i = 0; i < Math.max(v1.length, v2.length); i++) {\n v1[i] = i < v2.length ? merge(v1[i], v2[i]) : v1[i];\n }\n\n return v1;\n } else if (typeof v1 === 'object' && v1 !== null) {\n if (typeof v2 !== 'object' || v2 === null) return v2;\n /** @type {Record<string, *>} */\n const o1 = v1;\n /** @type {Record<string, *>} */\n const o2 = v2;\n\n const o1Keys = new Set(Object.keys(o1));\n const o2Keys = new Set(Object.keys(o2));\n for (const key of new Set([...o1Keys, ...o2Keys])) {\n o1[key] = key in o2 ? merge(o1[key], o2[key]) : o1[key];\n }\n\n return v1;\n } else {\n return v2;\n }\n}\n\n/**\n * Converts a string from camelCase to kebab-case.\n * @param {string} s\n * @param {{alphanumericOnly?: boolean}} [opts]\n */\nfunction kebabCase(s, opts) {\n let kebabed = s.replace(/([a-z])([A-Z])/g, '$1-$2');\n if (opts && opts.alphanumericOnly) {\n kebabed = kebabed\n .replace(/[^a-z0-9]+/gi, '-')\n .replace(/-+/g, '-')\n .replace(/(^-|-$)/g, '');\n }\n return kebabed.toLowerCase();\n}\n\n/**\n * @template TKey\n * @template TValue\n * @param {Array<TValue>} items\n * @param {(item: TValue) => TKey} keyFn\n * @return {Map<TKey, Array<TValue>>}\n */\nfunction groupIntoMap(items, keyFn) {\n /** @type {Map<TKey, Array<TValue>>} */\n const groups = new Map();\n\n for (const item of items) {\n const key = keyFn(item);\n const group = groups.get(key) || [];\n group.push(item);\n groups.set(key, group);\n }\n\n return groups;\n}\n\n/**\n * @template {any[]} T\n * @param {(...args: T) => void} fn\n * @param {number} time\n * @return {{(...args: T): void; cancel: () => void;}}\n */\nfunction debounce(fn, time) {\n /** @type {NodeJS.Timeout|undefined} */\n let timeout;\n const cancel = () => {\n if (timeout) clearTimeout(timeout);\n timeout = undefined;\n };\n\n /** @param {T} args */\n const debouncedFn = (...args) => {\n if (timeout) clearTimeout(timeout);\n timeout = setTimeout(() => fn(...args), time);\n };\n\n debouncedFn.cancel = cancel;\n return debouncedFn;\n}\n\nmodule.exports = {\n merge,\n kebabCase,\n debounce,\n /**\n * Generates an array of numbers from `from` (inclusive) to `to` (exclusive)\n * @param {number} from\n * @param {number} to\n * @param {number} [by]\n * @return {Array<number>}\n */\n range(from, to, by = 1) {\n /** @type {Array<number>} */\n const numbers = [];\n for (let i = from; i < to; i += by) {\n numbers.push(i);\n }\n return numbers;\n },\n /**\n * Converts a string from kebab-case or camelCase to Start Case.\n * @param {string} s\n */\n startCase(s) {\n return kebabCase(s)\n .split('-')\n .map(word => `${word.slice(0, 1).toUpperCase()}${word.slice(1)}`)\n .join(' ');\n },\n /**\n * @param {string} s\n * @param {number} length\n * @param {string} [padding]\n */\n padStart(s, length, padding = ' ') {\n if (s.length >= length) return s;\n return `${padding.repeat(length)}${s}`.slice(-length);\n },\n /**\n * @param {string} s\n * @param {number} length\n * @param {string} [padding]\n */\n padEnd(s, length, padding = ' ') {\n if (s.length >= length) return s;\n return `${s}${padding.repeat(length)}`.slice(0, length);\n },\n /**\n * @param {any} o1\n * @param {any} o2\n * @param {number} [depth]\n * @return {boolean}\n */\n isEqual(o1, o2, depth = 0) {\n // Protect against infinite loops.\n if (depth > 100) return false;\n\n // If they don't share the same type they're not equal.\n if (typeof o1 !== typeof o2) return false;\n // If they're not objects, use referential equality with NaN handling.\n if (Number.isNaN(o1) && Number.isNaN(o2)) return true;\n if (typeof o1 !== 'object') return o1 === o2;\n // Try quick referential equality before perfoming deep comparisons.\n if (o1 === o2) return true;\n // Check for null.\n if (!o1 || !o2) return false;\n // At this point we know they're both truthy objects.\n // Perform deep inspection on the object's properties.\n\n if (Array.isArray(o1)) {\n if (!Array.isArray(o2)) return false;\n return o1.every((v, i) => this.isEqual(v, o2[i])) && o1.length === o2.length;\n }\n\n const o1Keys = Object.keys(o1).sort();\n const o2Keys = Object.keys(o2).sort();\n const allChildrenEqual = o1Keys.every(k => this.isEqual(o1[k], o2[k], depth + 1));\n return allChildrenEqual && this.isEqual(o1Keys, o2Keys);\n },\n /**\n * Deep clones an object via JSON.parse/JSON.stringify.\n * @template T\n * @param {T} o\n * @return {T}\n */\n cloneDeep(o) {\n return JSON.parse(JSON.stringify(o));\n },\n /**\n * Filters items by referential uniqueness of the value returned by keyFn.\n * Unique items are guaranteed to be in the same order of the original array.\n *\n * @template TArr\n * @template TKey\n * @param {Array<TArr>} items\n * @param {(item: TArr) => TKey} keyFn\n * @return {Array<TArr>}\n */\n uniqBy(items, keyFn) {\n /** @type {Set<TKey>} */\n const seen = new Set();\n /** @type {Array<TArr>} */\n const out = [];\n\n for (const item of items) {\n const key = keyFn(item);\n if (seen.has(key)) continue;\n seen.add(key);\n out.push(item);\n }\n\n return out;\n },\n /**\n * @template T\n * @param {Array<T>} items\n * @param {(item: T) => any} keyFn\n * @return {Array<Array<T>>}\n */\n groupBy(items, keyFn) {\n return [...groupIntoMap(items, keyFn).values()];\n },\n groupIntoMap,\n /**\n * @template TArr\n * @param {Array<TArr>} items\n * @param {(o: TArr) => number} keyFn\n */\n maxBy(items, keyFn) {\n let maxItem = undefined;\n let maxValue = -Infinity;\n for (const item of items) {\n const value = keyFn(item);\n if (value > maxValue) {\n maxItem = item;\n maxValue = value;\n }\n }\n\n return maxItem;\n },\n /**\n * @template TArr\n * @param {Array<TArr>} items\n * @param {(o: TArr) => number} keyFn\n */\n minBy(items, keyFn) {\n return this.maxBy(items, o => -keyFn(o));\n },\n /**\n * @template TArr\n * @param {Array<TArr>} items\n * @param {(o: TArr) => number} keyFn\n */\n sortBy(items, keyFn) {\n return items.slice().sort((a, b) => keyFn(a) - keyFn(b));\n },\n /**\n * @template {Object} T\n * @param {T} object\n * @param {Array<keyof T>} propertiesToPick\n * @return {Partial<T>}\n */\n pick(object, propertiesToPick) {\n /** @type {Partial<T>} */\n const out = {};\n for (const [key_, value] of Object.entries(object)) {\n const key = /** @type {keyof T} */ (key_);\n if (!propertiesToPick.includes(key)) continue;\n out[key] = value;\n }\n\n return out;\n },\n /**\n * @template {Object} T\n * @param {T} object\n * @param {Array<keyof T>} propertiesToDrop\n * @param {{dropUndefined?: boolean}} [options]\n * @return {Partial<T>}\n */\n omit(object, propertiesToDrop, options = {}) {\n /** @type {Partial<T>} */\n const out = {};\n for (const [key_, value] of Object.entries(object)) {\n const key = /** @type {keyof T} */ (key_);\n if (propertiesToDrop.includes(key)) continue;\n if (options.dropUndefined && value === undefined) continue;\n out[key] = value;\n }\n\n return out;\n },\n /** @param {string} uuid */\n shortId(uuid) {\n return uuid.replace(/-/g, '').slice(0, 12);\n },\n /** @param {string} string @param {number} number @param {string} [pluralForm] */\n pluralize(string, number, pluralForm) {\n pluralForm = pluralForm || `${string}s`;\n return number === 1 ? string : pluralForm;\n },\n uniqueId: (() => {\n let id = 1;\n return () => id++;\n })(),\n};\n", "/**\n * @license Copyright 2019 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.\n */\n'use strict';\n\nconst _ = require('../lodash.js');\n\n/** @typedef {import('./prandom.js')} PRandom */\n\nconst LOREM_IPSUM =\n // eslint-disable-next-line max-len\n 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin urna nunc, molestie sed hendrerit et, vulputate vitae mauris. Sed tempor vitae risus vel hendrerit. Nulla vestibulum malesuada erat vitae laoreet. Phasellus sodales vehicula dolor, dictum ullamcorper metus aliquam id. Nullam porttitor posuere purus id rhoncus. Sed et mi ligula. Donec imperdiet nulla sit amet justo cursus, id tempus ex accumsan. Maecenas ultricies elit eget lectus posuere vestibulum. Cras vestibulum neque nec justo congue feugiat non id dui. Pellentesque dapibus ac orci sed malesuada. Sed rhoncus vitae lorem eget facilisis. Donec auctor tortor a tortor egestas, vel condimentum lacus auctor.';\n\n/** @typedef {{url?: string, inclusionRate?: number, averageWastedMs?: number, averageTotalBytes?: number, averageWastedBytes?: number}} ItemGenDef */\n/** @typedef {{auditId: string, passRate?: number, averageNumericValue?: number, averageWastedMs?: number, items?: ItemGenDef[], unit?: string}} AuditGenDef */\n\n/** @param {string} auditId */\nfunction getCategoryForAuditId(auditId) {\n if (auditId.startsWith('a11y')) return 'accessibility';\n if (auditId.startsWith('seo')) return 'seo';\n if (auditId.startsWith('best-practices')) return 'best-practices';\n if (auditId.startsWith('pwa')) return 'pwa';\n return 'performance';\n}\n\n/** @param {string} auditId */\nfunction getGroupForAuditId(auditId) {\n if (auditId === 'cumulative-layout-shift') return 'metrics';\n if (auditId === 'first-contentful-paint') return 'metrics';\n if (auditId === 'first-meaningful-paint') return 'metrics';\n if (auditId === 'speed-index') return 'metrics';\n if (auditId === 'interactive') return 'metrics';\n if (auditId === 'first-cpu-idle') return 'metrics';\n if (auditId === 'max-potential-fid') return 'metrics';\n if (auditId.startsWith('diagnostic-')) return 'diagnostics';\n if (auditId.startsWith('uses-')) return 'load-opportunities';\n if (auditId.startsWith('a11y-aria')) return 'a11y-aria';\n if (auditId.startsWith('a11y')) return 'a11y-best-practices';\n if (auditId.startsWith('seo')) return 'seo-content';\n if (auditId.startsWith('best-practices')) return 'best-practices';\n if (auditId.startsWith('pwa-fast-reliable')) return 'pwa-fast-reliable';\n if (auditId.startsWith('pwa-installable')) return 'pwa-installable';\n if (auditId.startsWith('pwa-optimized')) return 'pwa-optimized';\n}\n\n/** @param {number} average @param {PRandom} prandom */\nfunction generateNumericValue(average, prandom) {\n const maxDeltaAsPercent = 0.1;\n const maxDelta = average * maxDeltaAsPercent;\n const percentile = prandom.next();\n return (percentile - 0.5) * 2 * maxDelta + average;\n}\n\n/**\n *\n * @param {string} pageUrl\n * @param {Array<AuditGenDef>} auditDefs\n * @param {PRandom} prandom\n * @return {LH.Result}\n */\nfunction createLHR(pageUrl, auditDefs, prandom) {\n /** @type {LH.Result['audits']} */\n const audits = {};\n\n const loremIpsumTokens = LOREM_IPSUM.split(' ');\n for (const auditDef of auditDefs) {\n const {auditId, averageNumericValue, averageWastedMs, unit = 'items'} = auditDef;\n const groupId = getGroupForAuditId(auditId);\n if (typeof averageNumericValue === 'number') {\n const numericValue = generateNumericValue(averageNumericValue, prandom);\n // score of 100 = <1000\n // score of 0 = >10000\n const score = 1 - Math.min(1, Math.max((numericValue - 1000) / 9000, 0));\n audits[auditId] = {\n score,\n numericValue,\n scoreDisplayMode: 'numeric',\n displayValue:\n groupId === 'metrics'\n ? `${(numericValue / 1000).toLocaleString(undefined, {maximumFractionDigits: 1})} s`\n : `${Math.round(numericValue)} ${unit}`,\n };\n } else if (typeof averageWastedMs === 'number') {\n const wastedMs = generateNumericValue(averageWastedMs, prandom);\n // score of 100 = <100\n // score of 0 = >1000\n const score = 1 - Math.min(1, Math.max((wastedMs - 100) / 900, 0));\n const hasBytes = auditDef.items && auditDef.items.some(item => item.averageWastedBytes);\n const wastedBytes = wastedMs * 257;\n audits[auditId] = {\n score,\n scoreDisplayMode: 'numeric',\n displayValue: hasBytes\n ? `${(wastedBytes / 1024).toLocaleString(undefined, {\n maximumFractionDigits: 0,\n })} KB`\n : `${(wastedMs / 1000).toLocaleString(undefined, {\n maximumFractionDigits: 1,\n })} s`,\n details: {\n type: 'opportunity',\n overallSavingsMs: wastedMs,\n overallSavingsBytes: hasBytes ? wastedBytes : undefined,\n items: [],\n },\n };\n } else {\n const {passRate = 1} = auditDef;\n audits[auditId] = {score: prandom.next() <= passRate ? 1 : 0, scoreDisplayMode: 'binary'};\n }\n\n /** @type {Record<string, any>} */\n const headersAsObject = {};\n if (auditDef.items) {\n const items = [];\n for (const {url, inclusionRate = 1, ...rest} of auditDef.items) {\n if (prandom.next() > inclusionRate) continue;\n /** @type {any} */\n const item = {};\n if (url) {\n if (url.includes('lorempixel')) {\n headersAsObject.thumbnail = {key: 'url', valueType: 'thumbnail'};\n }\n\n headersAsObject.url = {key: 'url', valueType: 'url', label: 'URL'};\n item.url = new URL(url, pageUrl).href;\n }\n\n for (const key of Object.keys(rest)) {\n if (key.startsWith('average')) {\n const dataKey = key.replace('average', '').replace(/^\\w/, v => v.toLowerCase());\n const valueType = key.endsWith('Ms') ? 'timespanMs' : 'bytes';\n headersAsObject[dataKey] = {key: dataKey, valueType, label: _.startCase(dataKey)};\n // @ts-ignore - tsc can't understand Object.keys\n const averageValue = rest[key];\n item[dataKey] = generateNumericValue(averageValue, prandom);\n } else {\n headersAsObject[key] = {key, valueType: 'text', label: _.startCase(key)};\n // @ts-ignore - tsc can't understand Object.keys\n item[key] = rest[key];\n }\n }\n\n items.push(item);\n }\n\n const details = audits[auditId].details || {type: 'table'};\n details.headings = Object.values(headersAsObject).map(header => {\n // Do the inverse of _getCanonicalizedTableHeadings\n if (getGroupForAuditId(auditId) === 'load-opportunities') return header;\n return {...header, itemType: header.valueType, text: header.label, valueType: undefined};\n });\n details.items = items;\n audits[auditId].details = details;\n }\n\n audits[auditId].title = _.startCase(auditId);\n audits[auditId].description = `Help text for ${_.startCase(auditId)}. ${loremIpsumTokens\n .slice(0, Math.round(auditId.length * 1.5))\n .join(' ')}.`;\n }\n\n /** @type {LH.Result['categories']} */\n const categories = {};\n\n const auditsGroupedByCategory = _.groupBy(Object.entries(audits), pair =>\n getCategoryForAuditId(pair[0])\n );\n for (const audits of auditsGroupedByCategory) {\n const category = getCategoryForAuditId(audits[0][0]);\n const sum = audits.reduce((sum, next) => sum + (next[1].score || 0), 0);\n categories[category] = {\n id: category,\n title: category.toUpperCase(),\n score: sum / audits.length,\n auditRefs: audits.map(([id]) => ({id, weight: 1, group: getGroupForAuditId(id)})),\n };\n }\n\n const fetchTimeBase = new Date('2019-08-01T12:00:00').getTime();\n const fetchTimeOffset = Math.round(prandom.next() * 1000 * 60 * 60 * 24 * 7);\n const fetchTime = new Date(fetchTimeBase + fetchTimeOffset).toISOString();\n\n return {\n requestedUrl: pageUrl,\n finalUrl: pageUrl,\n categories,\n audits,\n\n fetchTime,\n lighthouseVersion: '5.2.0',\n configSettings: {channel: 'cli'},\n categoryGroups: {\n metrics: {title: 'Metrics'},\n 'load-opportunities': {title: 'Opportunities'},\n diagnostics: {title: 'Diagnostics'},\n accessibility: {title: 'Accessibility'},\n seo: {title: 'SEO'},\n 'best-practices': {title: 'Best Practices'},\n 'pwa-fast-reliable': {title: 'PWA Fast & Reliable'},\n 'pwa-installable': {title: 'PWA Installable'},\n 'pwa-optimized': {title: 'PWA Optimized'},\n },\n runWarnings: [],\n userAgent: 'Chrome!',\n environment: {hostUserAgent: '', networkUserAgent: '', benchmarkIndex: 500},\n timing: {total: 1, entries: []},\n i18n: {rendererFormattedStrings: {}, icuMessagePaths: {}},\n };\n}\n\nmodule.exports = {createLHR, generateNumericValue, getGroupForAuditId};\n", "/**\n * @license Copyright 2019 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.\n */\n'use strict';\n\nconst _ = require('./lodash.js');\nconst {getGroupForAuditId} = require('./seed-data/lhr-generator.js');\n\n/** @typedef {'improvement'|'neutral'|'regression'} DiffLabel */\n/** @typedef {'better'|'worse'|'added'|'removed'|'ambiguous'|'no change'} RowLabel */\n/** @typedef {{item: Record<string, any>, kind?: string, index: number}} DetailItemEntry */\n\n// Hardcoded audit ids that arent worth diffing and generally regress the UX when done.\nconst auditsToNotDIff = ['main-thread-tasks', 'screenshot-thumbnails', 'metrics'];\n\n/**\n * @param {number} delta\n * @param {'audit'|'score'} deltaType\n * @return {DiffLabel}\n */\nfunction getDeltaLabel(delta, deltaType = 'audit') {\n if (delta === 0) return 'neutral';\n let isImprovement = delta < 0;\n if (deltaType === 'score') isImprovement = delta > 0;\n return isImprovement ? 'improvement' : 'regression';\n}\n\n/**\n * @param {LHCI.AuditDiff} diff\n * @return {DiffLabel}\n */\nfunction getDiffLabel(diff) {\n switch (diff.type) {\n case 'error':\n return 'regression';\n case 'score':\n return getDeltaLabel(getDeltaStats(diff).delta, 'score');\n case 'numericValue':\n case 'itemCount':\n case 'itemDelta':\n return getDeltaLabel(getDeltaStats(diff).delta, 'audit');\n case 'itemAddition':\n return 'regression';\n case 'itemRemoval':\n return 'improvement';\n default:\n return 'neutral';\n }\n}\n\n/**\n * Given the array of diffs for a particular row, determine its label.\n *\n * @param {Array<LHCI.AuditDiff>} diffs\n * @return {RowLabel}\n */\nfunction getRowLabel(diffs) {\n if (!diffs.length) return 'no change';\n\n if (diffs.some(diff => diff.type === 'itemAddition')) return 'added';\n if (diffs.some(diff => diff.type === 'itemRemoval')) return 'removed';\n\n const itemDeltaDiffs = diffs.filter(\n /** @return {diff is LHCI.NumericItemAuditDiff} */ diff => diff.type === 'itemDelta'\n );\n\n // All the diffs were worse, it's \"worse\".\n if (itemDeltaDiffs.every(diff => diff.compareValue > diff.baseValue)) return 'worse';\n // All the diffs were better, it's \"better\".\n if (itemDeltaDiffs.every(diff => diff.compareValue < diff.baseValue)) return 'better';\n // The item had diffs but some were better and some were worse, so we can't decide.\n if (itemDeltaDiffs.length) return 'ambiguous';\n\n return 'no change';\n}\n\n/**\n * @param {Array<LHCI.AuditDiff>} diffs\n * @param {number|undefined} compareItemIndex\n * @param {number|undefined} baseItemIndex\n * @return {Array<LHCI.AuditDiff>}\n */\nfunction getMatchingDiffsForIndex(diffs, compareItemIndex, baseItemIndex) {\n return diffs.filter(diff => {\n const compareIndex = 'compareItemIndex' in diff ? diff.compareItemIndex : undefined;\n const baseIndex = 'baseItemIndex' in diff ? diff.baseItemIndex : undefined;\n if (typeof compareIndex === 'number') return compareIndex === compareItemIndex;\n if (typeof baseIndex === 'number') return baseIndex === baseItemIndex;\n return false;\n });\n}\n\n/**\n * Given the array of all diffs for an audit, determine the label for a row with particular item index.\n *\n * @param {Array<LHCI.AuditDiff>} diffs\n * @param {number|undefined} compareItemIndex\n * @param {number|undefined} baseItemIndex\n * @return {RowLabel}\n */\nfunction getRowLabelForIndex(diffs, compareItemIndex, baseItemIndex) {\n return getRowLabel(getMatchingDiffsForIndex(diffs, compareItemIndex, baseItemIndex));\n}\n\n/**\n * Given the array of all diffs for an audit, determine the worst numeric delta for a particular row.\n * Used for sorting.\n *\n * @param {Array<LHCI.AuditDiff>} diffs\n * @param {number|undefined} compareItemIndex\n * @param {number|undefined} baseItemIndex\n * @return {number|undefined}\n */\nfunction getWorstNumericDeltaForIndex(diffs, compareItemIndex, baseItemIndex) {\n const matchingDiffs = getMatchingDiffsForIndex(diffs, compareItemIndex, baseItemIndex);\n const numericDiffs = matchingDiffs.filter(isNumericAuditDiff);\n if (!numericDiffs.length) return undefined;\n return Math.max(...numericDiffs.map(diff => getDeltaStats(diff).delta));\n}\n\n/** @param {Array<DiffLabel>} labels @return {DiffLabel} */\nfunction getMostSevereDiffLabel(labels) {\n if (labels.some(l => l === 'regression')) return 'regression';\n if (labels.some(l => l === 'neutral')) return 'neutral';\n return 'improvement';\n}\n\n/**\n * @param {LHCI.AuditDiff} diff\n * @return {diff is LHCI.NumericAuditDiff|LHCI.NumericItemAuditDiff} */\nfunction isNumericAuditDiff(diff) {\n return ['score', 'numericValue', 'itemCount', 'itemDelta'].includes(diff.type);\n}\n\n/** @param {number|null|undefined} score */\nfunction getScoreLevel(score) {\n if (typeof score !== 'number') return 'error';\n if (score >= 0.9) return 'pass';\n if (score >= 0.5) return 'average';\n return 'fail';\n}\n\n/** @param {number|null|undefined} value @param {[number, number]} cutoffs */\nfunction getMetricScoreLevel(value, cutoffs) {\n if (typeof value !== 'number') return 'error';\n if (value <= cutoffs[0]) return 'pass';\n if (value <= cutoffs[1]) return 'average';\n return 'fail';\n}\n\n/** @param {LHCI.AuditDiff} diff */\nfunction getDiffSeverity(diff) {\n const delta = isNumericAuditDiff(diff) ? getDeltaStats(diff).absoluteDelta : 0;\n if (diff.type === 'error') return 1e12;\n if (diff.type === 'score') return 1e10 * delta;\n if (diff.type === 'numericValue') return 1e8 * Math.max(delta / 1000, 1);\n if (diff.type === 'itemCount') return 1e6 * delta;\n if (diff.type === 'itemAddition') return 1e5;\n if (diff.type === 'itemRemoval') return 1e5;\n if (diff.type === 'itemDelta') return Math.min(Math.max(delta / 100, 1), 1e5 - 1);\n return 0;\n}\n\n/**\n * @param {LHCI.NumericAuditDiff | LHCI.NumericItemAuditDiff} diff\n */\nfunction getDeltaStats(diff) {\n const {baseValue, compareValue} = diff;\n const delta = compareValue - baseValue;\n const absoluteDelta = Math.abs(delta);\n // Handle the 0 case to avoid messy NaN handling.\n if (delta === 0) return {delta, absoluteDelta, percentDelta: 0, percentAbsoluteDelta: 0};\n\n // Percent delta is `delta / baseValue` unless `baseValue == 0`.\n // Then `percentDelta` is 100% by arbitrary convention (instead of Infinity/NaN).\n const percentDelta = baseValue ? delta / baseValue : 1;\n const percentAbsoluteDelta = Math.abs(percentDelta);\n\n return {\n delta,\n absoluteDelta,\n percentDelta,\n percentAbsoluteDelta,\n };\n}\n\n/**\n * @param {{auditId: string, type: LHCI.AuditDiffType, baseValue?: number|null, compareValue?: number|null, itemKey?: string, baseItemIndex?: number, compareItemIndex?: number}} diff\n * @return {LHCI.AuditDiff}\n */\nfunction createAuditDiff(diff) {\n const {auditId, type, baseValue, compareValue, baseItemIndex, compareItemIndex, itemKey} = diff;\n if (type === 'itemAddition') {\n if (typeof compareItemIndex !== 'number') throw new Error('compareItemIndex is not set');\n return {auditId, type, compareItemIndex};\n }\n\n if (type === 'itemRemoval') {\n if (typeof baseItemIndex !== 'number') throw new Error('baseItemIndex is not set');\n return {auditId, type, baseItemIndex};\n }\n\n if (type === 'displayValue') {\n throw new Error('Do not use createAuditDiff for displayValue, just manually create');\n }\n\n if (\n typeof compareValue !== 'number' ||\n typeof baseValue !== 'number' ||\n !Number.isFinite(baseValue) ||\n !Number.isFinite(compareValue) ||\n type === 'error'\n ) {\n return {\n auditId,\n type: 'error',\n attemptedType: type,\n baseValue: baseValue || NaN,\n compareValue: compareValue || NaN,\n };\n }\n\n /** @type {LHCI.NumericAuditDiff} */\n const numericDiffResult = {\n auditId,\n type: 'score',\n baseValue,\n compareValue,\n };\n\n if (type === 'itemDelta') {\n if (typeof itemKey !== 'string') throw new Error('itemKey is not set');\n if (typeof baseItemIndex !== 'number' && typeof compareItemIndex !== 'number') {\n throw new Error('Either baseItemIndex or compareItemIndex must be set');\n }\n\n return {\n ...numericDiffResult,\n type: 'itemDelta',\n baseItemIndex,\n compareItemIndex,\n itemKey,\n };\n }\n\n return {...numericDiffResult, type};\n}\n\n/**\n *\n * @param {string} auditId\n * @param {DetailItemEntry} baseEntry\n * @param {DetailItemEntry} compareEntry\n * @param {Array<{key: string | null}>} headings\n * @return {Array<LHCI.AuditDiff>}\n */\nfunction findAuditDetailItemKeyDiffs(auditId, baseEntry, compareEntry, headings) {\n /** @type {Array<LHCI.AuditDiff>} */\n const diffs = [];\n\n for (const key of Object.keys(baseEntry.item)) {\n const baseValue = baseEntry.item[key];\n const compareValue = compareEntry.item[key];\n // If these aren't numeric, comparable values, skip the key.\n if (typeof baseValue !== 'number' || typeof compareValue !== 'number') continue;\n // If these aren't shown in the table, skip the key.\n if (!headings.some(heading => heading.key === key)) continue;\n\n diffs.push(\n createAuditDiff({\n auditId,\n type: 'itemDelta',\n itemKey: key,\n baseItemIndex: baseEntry.index,\n compareItemIndex: compareEntry.index,\n baseValue,\n compareValue,\n })\n );\n }\n\n return diffs;\n}\n\n/**\n * This function creates NumericItemAuditDiffs from itemAddition/itemRemoved diffs. Normally, these\n * are superfluous data, but in some instances (table details views for example), it's desirable to\n * understand the diff state of each individual itemKey. The missing values are assumed to be 0\n * for the purposes of the diff.\n *\n * @param {Array<LHCI.AuditDiff>} diffs\n * @param {Array<Record<string, any>>} baseItems\n * @param {Array<Record<string, any>>} compareItems\n * @return {Array<LHCI.AuditDiff>}\n */\nfunction synthesizeItemKeyDiffs(diffs, baseItems, compareItems) {\n /** @type {Array<LHCI.AuditDiff>} */\n const itemKeyDiffs = [];\n\n for (const diff of diffs) {\n if (diff.type !== 'itemAddition' && diff.type !== 'itemRemoval') continue;\n\n const item =\n diff.type === 'itemAddition'\n ? compareItems[diff.compareItemIndex]\n : baseItems[diff.baseItemIndex];\n\n for (const key of Object.keys(item)) {\n const baseValue = diff.type === 'itemAddition' ? 0 : item[key];\n const compareValue = diff.type === 'itemAddition' ? item[key] : 0;\n if (typeof compareValue !== 'number' || typeof baseValue !== 'number') continue;\n\n const itemIndexKeyName = diff.type === 'itemAddition' ? 'compareItemIndex' : 'baseItemIndex';\n const itemIndexValue =\n diff.type === 'itemAddition' ? diff.compareItemIndex : diff.baseItemIndex;\n itemKeyDiffs.push(\n createAuditDiff({\n auditId: diff.auditId,\n type: 'itemDelta',\n itemKey: key,\n [itemIndexKeyName]: itemIndexValue,\n baseValue,\n compareValue,\n })\n );\n }\n }\n\n return itemKeyDiffs;\n}\n\n/** @param {string} s */\nfunction replaceNondeterministicStrings(s) {\n if (s.startsWith('http') && s.includes('?')) {\n try {\n const url = new URL(s);\n url.search = '';\n s = url.href;\n } catch (err) {}\n }\n\n return (\n s\n // YouTube Embeds\n .replace(/www-embed-player-[0-9a-z]+/i, 'www-embed-player')\n .replace(/player_ias-[0-9a-z]+/i, 'player_ias')\n // UUIDs\n .replace(/\\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\\b/gi, 'UUID')\n // localhost Ports\n .replace(/:[0-9]{3,5}\\//, ':PORT/')\n // Hash components embedded in filenames\n .replace(/(\\.|-)[0-9a-f]{6,8}\\.(js|css|woff|html|png|jpeg|jpg|svg)/i, '$1HASH.$2')\n );\n}\n\n/**\n * The items passed to this method can be dirtied by other libraries and contain circular structures.\n * Prune any private-looking properties that start with `_` throughout the entire object.\n *\n * @see https://github.com/GoogleChrome/lighthouse-ci/issues/666\n * @param {unknown} item\n * @return {unknown}\n */\nfunction deepPruneItemForKeySerialization(item) {\n if (typeof item !== 'object') return item;\n if (item === null) return item;\n\n if (Array.isArray(item)) {\n return item.map(entry => deepPruneItemForKeySerialization(entry));\n } else {\n const itemAsRecord = /** @type {Record<string, unknown>} */ (item);\n const keys = Object.keys(item);\n const keysToKeep = keys.filter(key => !key.startsWith('_'));\n /** @type {Record<string, any>} */\n const copy = {};\n for (const key of keysToKeep) {\n copy[key] = deepPruneItemForKeySerialization(itemAsRecord[key]);\n }\n return copy;\n }\n}\n\n/** @param {Record<string, any>} item @return {string} */\nfunction getItemKey(item) {\n // Do most specific checks at the top. most general at bottom..\n //\n // For sourcemapped opportunities that identify a source location\n const source = item.source;\n if (typeof source === 'string') return source;\n if (source && source.url) return `${source.url}:${source.line}:${source.column}`;\n // For the pre-grouped audits like resource-summary\n if (typeof item.label === 'string') return item.label;\n // For the pre-grouped audits like mainthread-work-breakdown\n if (typeof item.groupLabel === 'string') return item.groupLabel;\n // For user-timings\n if (typeof item.name === 'string') return item.name;\n // For dom-size\n if (typeof item.statistic === 'string') return item.statistic;\n // For third-party-summary\n if (item.entity && typeof item.entity.text === 'string') return item.entity.text;\n // For node\n if (typeof item.node?.path === 'string') return item.node.path;\n // Tap-targets\n if (\n typeof item.tapTarget?.path === 'string' &&\n typeof item.overlappingTarget?.path === 'string'\n ) {\n return `${item.tapTarget.path} + ${item.overlappingTarget.path}`;\n }\n // For most opportunities, diagnostics, etc where 1 row === 1 resource\n if (typeof item.url === 'string' && item.url) return item.url;\n if (typeof item.origin === 'string' && item.origin) return item.origin;\n\n // For everything else, use the entire object, actually works OK on most nodes.\n return JSON.stringify(deepPruneItemForKeySerialization(item));\n}\n\n/**\n * @param {Array<Record<string, any>>} baseItems\n * @param {Array<Record<string, any>>} compareItems\n * @return {Array<{base?: DetailItemEntry, compare?: DetailItemEntry}>}\n */\nfunction zipBaseAndCompareItems(baseItems, compareItems) {\n const groupedByKey = _.groupIntoMap(\n [\n ...baseItems.map((item, i) => ({item, kind: 'base', index: i})),\n ...compareItems.map((item, i) => ({item, kind: 'compare', index: i})),\n ],\n entry => replaceNondeterministicStrings(getItemKey(entry.item))\n );\n\n /** @type {Array<{base?: DetailItemEntry, compare?: DetailItemEntry}>} */\n const zipped = [];\n\n for (const entries of groupedByKey.values()) {\n const baseItems = entries.filter(entry => entry.kind === 'base');\n const compareItems = entries.filter(entry => entry.kind === 'compare');\n\n if (baseItems.length > 1 || compareItems.length > 1) {\n // The key is not actually unique, just treat all as added/removed.\n for (const entry of entries) {\n zipped.push({[entry.kind]: entry});\n }\n\n continue;\n }\n\n zipped.push({base: baseItems[0], compare: compareItems[0]});\n }\n\n return zipped;\n}\n\n/**\n * @param {Array<LHCI.AuditDiff>} diffs\n * @param {Array<{base?: DetailItemEntry, compare?: DetailItemEntry}>} zippedItems\n * @return {Array<{base?: DetailItemEntry, compare?: DetailItemEntry, diffs: Array<LHCI.AuditDiff>}>}\n */\nfunction sortZippedBaseAndCompareItems(diffs, zippedItems) {\n /** @type {Array<RowLabel>} */\n const rowLabelSortOrder = ['added', 'worse', 'ambiguous', 'removed', 'better', 'no change'];\n\n return zippedItems\n .map(item => {\n return {\n ...item,\n diffs: getMatchingDiffsForIndex(\n diffs,\n item.compare && item.compare.index,\n item.base && item.base.index\n ),\n };\n })\n .sort((a, b) => {\n const compareIndexA = a.compare && a.compare.index;\n const baseIndexA = a.base && a.base.index;\n const compareIndexB = b.compare && b.compare.index;\n const baseIndexB = b.base && b.base.index;\n\n const rowStateIndexA = rowLabelSortOrder.indexOf(\n getRowLabelForIndex(diffs, compareIndexA, baseIndexA)\n );\n const rowStateIndexB = rowLabelSortOrder.indexOf(\n getRowLabelForIndex(diffs, compareIndexB, baseIndexB)\n );\n\n const labelValueA = getItemKey(\n (a.compare && a.compare.item) || (a.base && a.base.item) || {}\n );\n const labelValueB = getItemKey(\n (b.compare && b.compare.item) || (b.base && b.base.item) || {}\n );\n\n const numericValueA = getWorstNumericDeltaForIndex(diffs, compareIndexA, baseIndexA);\n const numericValueB = getWorstNumericDeltaForIndex(diffs, compareIndexB, baseIndexB);\n\n if (rowStateIndexA === rowStateIndexB) {\n return typeof numericValueA === 'number' && typeof numericValueB === 'number'\n ? numericValueB - numericValueA\n : labelValueA.localeCompare(labelValueB);\n }\n return rowStateIndexA - rowStateIndexB;\n });\n}\n\n/**\n * @param {string} auditId\n * @param {Array<Record<string, any>>} baseItems\n * @param {Array<Record<string, any>>} compareItems\n * @param {Array<{key: string | null}>} headings\n * @return {Array<LHCI.AuditDiff>}\n */\nfunction findAuditDetailItemsDiffs(auditId, baseItems, compareItems, headings) {\n /** @type {Array<LHCI.AuditDiff>} */\n const diffs = [];\n\n for (const {base, compare} of zipBaseAndCompareItems(baseItems, compareItems)) {\n if (base && compare) {\n diffs.push(...findAuditDetailItemKeyDiffs(auditId, base, compare, headings));\n } else if (compare) {\n diffs.push({type: 'itemAddition', auditId, compareItemIndex: compare.index});\n } else if (base) {\n diffs.push({type: 'itemRemoval', auditId, baseItemIndex: base.index});\n } else {\n throw new Error('Impossible');\n }\n }\n\n return diffs;\n}\n\n/**\n * @param {LH.AuditResult} audit\n */\nfunction normalizeScore(audit) {\n if (audit.scoreDisplayMode === 'notApplicable') {\n // notApplicable should be treated as passing.\n return 1;\n }\n\n if (audit.scoreDisplayMode === 'informative') {\n // informative should be treated as failing.\n return 0;\n }\n\n return audit.score;\n}\n\n/**\n * @param {LH.AuditResult} audit\n */\nfunction getNumericValue(audit) {\n if (\n typeof audit.numericValue !== 'number' &&\n audit.details &&\n typeof audit.details.overallSavingsMs === 'number'\n ) {\n return audit.details.overallSavingsMs;\n }\n\n return audit.numericValue;\n}\n\n/**\n * @param {LH.AuditResult} audit\n */\nfunction normalizeNumericValue(audit) {\n if (audit.scoreDisplayMode === 'notApplicable') {\n return 0;\n }\n\n return getNumericValue(audit);\n}\n\n/**\n * @param {LH.AuditResult} audit\n * @return {Required<Pick<Required<LH.AuditResult>['details'],'items'|'headings'>>}\n */\nfunction normalizeDetails(audit) {\n if (!audit.details) return {items: [], headings: []};\n return {items: audit.details.items || [], headings: audit.details.headings || []};\n}\n\n/**\n * @param {LH.AuditResult} baseAudit\n * @param {LH.AuditResult} compareAudit\n * @param {{forceAllScoreDiffs?: boolean, skipDisplayValueDiffs?: boolean, synthesizeItemKeyDiffs?: boolean, percentAbsoluteDeltaThreshold?: number}} options\n * @return {Array<LHCI.AuditDiff>}\n */\nfunction findAuditDiffs(baseAudit, compareAudit, options = {}) {\n const auditId = baseAudit.id || '';\n const {percentAbsoluteDeltaThreshold = 0} = options;\n /** @type {Array<LHCI.AuditDiff>} */\n const diffs = [];\n\n if (auditsToNotDIff.includes(auditId)) return diffs;\n\n if (typeof baseAudit.score === 'number' || typeof compareAudit.score === 'number') {\n diffs.push(\n createAuditDiff({\n auditId,\n type: 'score',\n baseValue: normalizeScore(baseAudit),\n compareValue: normalizeScore(compareAudit),\n })\n );\n }\n\n if (\n typeof getNumericValue(baseAudit) === 'number' ||\n typeof getNumericValue(compareAudit) === 'number'\n ) {\n diffs.push(\n createAuditDiff({\n auditId,\n type: 'numericValue',\n baseValue: normalizeNumericValue(baseAudit),\n compareValue: normalizeNumericValue(compareAudit),\n })\n );\n }\n\n if (typeof baseAudit.displayValue === 'string' || typeof compareAudit.displayValue === 'string') {\n diffs.push({\n auditId,\n type: 'displayValue',\n baseValue: baseAudit.displayValue || '',\n compareValue: compareAudit.displayValue || '',\n });\n }\n\n let hasItemDetails = false;\n /** @type {Partial<LH.AuditResult['details']>} */\n const baseAuditDetails = baseAudit.details || {};\n /** @type {Partial<LH.AuditResult['details']>} */\n const compareAuditDetails = compareAudit.details || {};\n // TODO: support checklist.\n if (\n (baseAuditDetails.type !== 'debugdata' &&\n baseAuditDetails.type !== 'checklist' &&\n baseAuditDetails.items) ||\n (compareAuditDetails.type !== 'debugdata' &&\n compareAuditDetails.type !== 'checklist' &&\n compareAuditDetails.items)\n ) {\n hasItemDetails = true;\n const {items: baseItems, headings: baseHeadings} = normalizeDetails(baseAudit);\n const {items: compareItems, headings: compareHeadings} = normalizeDetails(compareAudit);\n const headings = baseHeadings.concat(compareHeadings);\n\n diffs.push(\n createAuditDiff({\n auditId,\n type: 'itemCount',\n baseValue: baseItems.length,\n compareValue: compareItems.length,\n })\n );\n\n diffs.push(...findAuditDetailItemsDiffs(auditId, baseItems, compareItems, headings));\n\n if (options.synthesizeItemKeyDiffs) {\n diffs.push(...synthesizeItemKeyDiffs(diffs, baseItems, compareItems));\n }\n }\n\n const filteredDiffs = diffs.filter(diff => {\n // Errors are always surfaced.\n if (diff.type === 'error') return true;\n // Additions and removals are always surfaced.\n if (diff.type === 'itemAddition' || diff.type === 'itemRemoval') return true;\n // If it's a score and we're not forcing all score diffs, only flag level changes.\n if (diff.type === 'score' && !options.forceAllScoreDiffs) {\n return getScoreLevel(diff.baseValue) !== getScoreLevel(diff.compareValue);\n }\n // If it's a display value change, ensure the values are different, and defer to the options.\n if (diff.type === 'displayValue') {\n return diff.baseValue !== diff.compareValue && !options.skipDisplayValueDiffs;\n }\n\n // Ensure the percent delta is above our threshold (0 by default).\n return getDeltaStats(diff).percentAbsoluteDelta > percentAbsoluteDeltaThreshold;\n });\n\n // If the only diff found was a displayValue diff, skip it as the others were probably ignored by\n // our percentAbsoluteDeltaThreshold.\n if (filteredDiffs.length === 1 && filteredDiffs[0].type === 'displayValue') return [];\n\n // If the only diff found was a numericValue/displayValue diff *AND* it seems like the result was flaky, skip it.\n // The result is likely flaky if the audit passed *OR* it was supposed to have details but no details items changed.\n const isAllPassing = compareAudit.score === 1 && baseAudit.score === 1;\n const group = getGroupForAuditId(auditId);\n if (\n group !== 'metrics' && // if metrics group audit is found, don't skip it\n filteredDiffs.every(diff => diff.type === 'displayValue' || diff.type === 'numericValue') &&\n (isAllPassing || hasItemDetails)\n ) {\n return [];\n }\n\n return filteredDiffs;\n}\n\nmodule.exports = {\n findAuditDiffs,\n getDiffSeverity,\n getDeltaLabel,\n getDeltaStats,\n getDiffLabel,\n getRowLabel,\n getRowLabelForIndex,\n getMostSevereDiffLabel,\n getMetricScoreLevel,\n zipBaseAndCompareItems,\n synthesizeItemKeyDiffs,\n sortZippedBaseAndCompareItems,\n replaceNondeterministicStrings,\n};\n", "/**\n * @license Copyright 2019 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.\n */\n'use strict';\n\n/**\n * @see https://github.com/GoogleChrome/lighthouse/blob/2ff07d29a3e12a75cc844427c567330eb84d4249/lighthouse-core/report/html/renderer/util.js#L320-L347\n *\n * Split a string on markdown links (e.g. [some link](https://...)) into\n * segments of plain text that weren't part of a link (marked as\n * `isLink === false`), and segments with text content and a URL that did make\n * up a link (marked as `isLink === true`).\n * @param {string} text\n * @return {Array<{isLink: true, text: string, linkHref: string}|{isLink: false, text: string}>}\n */\nfunction splitMarkdownLink(text) {\n /** @type {Array<{isLink: true, text: string, linkHref: string}|{isLink: false, text: string}>} */\n const segments = [];\n\n const parts = text.split(/\\[([^\\]]+?)\\]\\((https?:\\/\\/.*?)\\)/g);\n while (parts.length) {\n // Shift off the same number of elements as the pre-split and capture groups.\n const [preambleText, linkText, linkHref] = parts.splice(0, 3);\n\n if (preambleText) {\n // Skip empty text as it's an artifact of splitting, not meaningful.\n segments.push({\n isLink: false,\n text: preambleText,\n });\n }\n\n // Append link if there are any.\n if (linkText && linkHref) {\n segments.push({\n isLink: true,\n text: linkText,\n linkHref,\n });\n }\n }\n\n return segments;\n}\n\nmodule.exports = {splitMarkdownLink};\n", "/** Normal hydration that attaches to a DOM tree but does not diff it. */\nexport const MODE_HYDRATE = 1 << 5;\n/** Signifies this VNode suspended on the previous render */\nexport const MODE_SUSPENDED = 1 << 7;\n/** Indicates that this node needs to be inserted while patching children */\nexport const INSERT_VNODE = 1 << 16;\n/** Indicates a VNode has been matched with another VNode in the diff */\nexport const MATCHED = 1 << 17;\n\n/** Reset all mode flags */\nexport const RESET_MODE = ~(MODE_HYDRATE | MODE_SUSPENDED);\n\nexport const EMPTY_OBJ = /** @type {any} */ ({});\nexport const EMPTY_ARR = [];\nexport const IS_NON_DIMENSIONAL =\n\t/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;\n", "import { EMPTY_ARR } from './constants';\n\nexport const isArray = Array.isArray;\n\n/**\n * Assign properties from `props` to `obj`\n * @template O, P The obj and props types\n * @param {O} obj The object to copy properties to\n * @param {P} props The object to copy properties from\n * @returns {O & P}\n */\nexport function assign(obj, props) {\n\t// @ts-expect-error We change the type of `obj` to be `O & P`\n\tfor (let i in props) obj[i] = props[i];\n\treturn /** @type {O & P} */ (obj);\n}\n\n/**\n * Remove a child node from its parent if attached. This is a workaround for\n * IE11 which doesn't support `Element.prototype.remove()`. Using this function\n * is smaller than including a dedicated polyfill.\n * @param {preact.ContainerNode} node The node to remove\n */\nexport function removeNode(node) {\n\tlet parentNode = node.parentNode;\n\tif (parentNode) parentNode.removeChild(node);\n}\n\nexport const slice = EMPTY_ARR.slice;\n", "import { _catchError } from './diff/catch-error';\n\n/**\n * The `option` object can potentially contain callback functions\n * that are called during various stages of our renderer. This is the\n * foundation on which all our addons like `preact/debug`, `preact/compat`,\n * and `preact/hooks` are based on. See the `Options` type in `internal.d.ts`\n * for a full list of available option hooks (most editors/IDEs allow you to\n * ctrl+click or cmd+click on mac the type definition below).\n * @type {Options}\n */\nconst options = {\n\t_catchError\n};\n\nexport default options;\n", "import { slice } from './util';\nimport options from './options';\n\nlet vnodeId = 0;\n\n/**\n * Create an virtual node (used for JSX)\n * @param {VNode[\"type\"]} type The node name or Component constructor for this\n * virtual node\n * @param {object | null | undefined} [props] The properties of the virtual node\n * @param {Array<import('.').ComponentChildren>} [children] The children of the\n * virtual node\n * @returns {VNode}\n */\nexport function createElement(type, props, children) {\n\tlet normalizedProps = {},\n\t\tkey,\n\t\tref,\n\t\ti;\n\tfor (i in props) {\n\t\tif (i == 'key') key = props[i];\n\t\telse if (i == 'ref') ref = props[i];\n\t\telse normalizedProps[i] = props[i];\n\t}\n\n\tif (arguments.length > 2) {\n\t\tnormalizedProps.children =\n\t\t\targuments.length > 3 ? slice.call(arguments, 2) : children;\n\t}\n\n\t// If a Component VNode, check for and apply defaultProps\n\t// Note: type may be undefined in development, must never error here.\n\tif (typeof type == 'function' && type.defaultProps != null) {\n\t\tfor (i in type.defaultProps) {\n\t\t\tif (normalizedProps[i] === undefined) {\n\t\t\t\tnormalizedProps[i] = type.defaultProps[i];\n\t\t\t}\n\t\t}\n\t}\n\n\treturn createVNode(type, normalizedProps, key, ref, null);\n}\n\n/**\n * Create a VNode (used internally by Preact)\n * @param {VNode[\"type\"]} type The node name or Component\n * Constructor for this virtual node\n * @param {object | string | number | null} props The properties of this virtual node.\n * If this virtual node represents a text node, this is the text of the node (string or number).\n * @param {string | number | null} key The key for this virtual node, used when\n * diffing it against its children\n * @param {VNode[\"ref\"]} ref The ref property that will\n * receive a reference to its created child\n * @returns {VNode}\n */\nexport function createVNode(type, props, key, ref, original) {\n\t// V8 seems to be better at detecting type shapes if the object is allocated from the same call site\n\t// Do not inline into createElement and coerceToVNode!\n\t/** @type {VNode} */\n\tconst vnode = {\n\t\ttype,\n\t\tprops,\n\t\tkey,\n\t\tref,\n\t\t_children: null,\n\t\t_parent: null,\n\t\t_depth: 0,\n\t\t_dom: null,\n\t\t// _nextDom must be initialized to undefined b/c it will eventually\n\t\t// be set to dom.nextSibling which can return `null` and it is important\n\t\t// to be able to distinguish between an uninitialized _nextDom and\n\t\t// a _nextDom that has been set to `null`\n\t\t_nextDom: undefined,\n\t\t_component: null,\n\t\tconstructor: undefined,\n\t\t_original: original == null ? ++vnodeId : original,\n\t\t_index: -1,\n\t\t_flags: 0\n\t};\n\n\t// Only invoke the vnode hook if this was *not* a direct copy:\n\tif (original == null && options.vnode != null) options.vnode(vnode);\n\n\treturn vnode;\n}\n\nexport function createRef() {\n\treturn { current: null };\n}\n\nexport function Fragment(props) {\n\treturn props.children;\n}\n\n/**\n * Check if a the argument is a valid Preact VNode.\n * @param {*} vnode\n * @returns {vnode is VNode}\n */\nexport const isValidElement = vnode =>\n\tvnode != null && vnode.constructor == undefined;\n", "import { assign } from './util';\nimport { diff, commitRoot } from './diff/index';\nimport options from './options';\nimport { Fragment } from './create-element';\nimport { MODE_HYDRATE } from './constants';\n\n/**\n * Base Component class. Provides `setState()` and `forceUpdate()`, which\n * trigger rendering\n * @param {object} props The initial component props\n * @param {object} context The initial context from parent components'\n * getChildContext\n */\nexport function BaseComponent(props, context) {\n\tthis.props = props;\n\tthis.context = context;\n}\n\n/**\n * Update component state and schedule a re-render.\n * @this {Component}\n * @param {object | ((s: object, p: object) => object)} update A hash of state\n * properties to update with new values or a function that given the current\n * state and props returns a new partial state\n * @param {() => void} [callback] A function to be called once component state is\n * updated\n */\nBaseComponent.prototype.setState = function (update, callback) {\n\t// only clone state when copying to nextState the first time.\n\tlet s;\n\tif (this._nextState != null && this._nextState !== this.state) {\n\t\ts = this._nextState;\n\t} else {\n\t\ts = this._nextState = assign({}, this.state);\n\t}\n\n\tif (typeof update == 'function') {\n\t\t// Some libraries like `immer` mark the current state as readonly,\n\t\t// preventing us from mutating it, so we need to clone it. See #2716\n\t\tupdate = update(assign({}, s), this.props);\n\t}\n\n\tif (update) {\n\t\tassign(s, update);\n\t}\n\n\t// Skip update if updater function returned null\n\tif (update == null) return;\n\n\tif (this._vnode) {\n\t\tif (callback) {\n\t\t\tthis._stateCallbacks.push(callback);\n\t\t}\n\t\tenqueueRender(this);\n\t}\n};\n\n/**\n * Immediately perform a synchronous re-render of the component\n * @this {Component}\n * @param {() => void} [callback] A function to be called after component is\n * re-rendered\n */\nBaseComponent.prototype.forceUpdate = function (callback) {\n\tif (this._vnode) {\n\t\t// Set render mode so that we can differentiate where the render request\n\t\t// is coming from. We need this because forceUpdate should never call\n\t\t// shouldComponentUpdate\n\t\tthis._force = true;\n\t\tif (callback) this._renderCallbacks.push(callback);\n\t\tenqueueRender(this);\n\t}\n};\n\n/**\n * Accepts `props` and `state`, and returns a new Virtual DOM tree to build.\n * Virtual DOM is generally constructed via [JSX](http://jasonformat.com/wtf-is-jsx).\n * @param {object} props Props (eg: JSX attributes) received from parent\n * element/component\n * @param {object} state The component's current state\n * @param {object} context Context object, as returned by the nearest\n * ancestor's `getChildContext()`\n * @returns {ComponentChildren | void}\n */\nBaseComponent.prototype.render = Fragment;\n\n/**\n * @param {VNode} vnode\n * @param {number | null} [childIndex]\n */\nexport function getDomSibling(vnode, childIndex) {\n\tif (childIndex == null) {\n\t\t// Use childIndex==null as a signal to resume the search from the vnode's sibling\n\t\treturn vnode._parent\n\t\t\t? getDomSibling(vnode._parent, vnode._index + 1)\n\t\t\t: null;\n\t}\n\n\tlet sibling;\n\tfor (; childIndex < vnode._children.length; childIndex++) {\n\t\tsibling = vnode._children[childIndex];\n\n\t\tif (sibling != null && sibling._dom != null) {\n\t\t\t// Since updateParentDomPointers keeps _dom pointer correct,\n\t\t\t// we can rely on _dom to tell us if this subtree contains a\n\t\t\t// rendered DOM node, and what the first rendered DOM node is\n\t\t\treturn sibling._dom;\n\t\t}\n\t}\n\n\t// If we get here, we have not found a DOM node in this vnode's children.\n\t// We must resume from this vnode's sibling (in it's parent _children array)\n\t// Only climb up and search the parent if we aren't searching through a DOM\n\t// VNode (meaning we reached the DOM parent of the original vnode that began\n\t// the search)\n\treturn typeof vnode.type == 'function' ? getDomSibling(vnode) : null;\n}\n\n/**\n * Trigger in-place re-rendering of a component.\n * @param {Component} component The component to rerender\n */\nfunction renderComponent(component) {\n\tlet oldVNode = component._vnode,\n\t\toldDom = oldVNode._dom,\n\t\tparentDom = component._parentDom,\n\t\tcommitQueue = [],\n\t\trefQueue = [];\n\n\tif (parentDom) {\n\t\tconst newVNode = assign({}, oldVNode);\n\t\tnewVNode._original = oldVNode._original + 1;\n\t\tif (options.vnode) options.vnode(newVNode);\n\n\t\tdiff(\n\t\t\tparentDom,\n\t\t\tnewVNode,\n\t\t\toldVNode,\n\t\t\tcomponent._globalContext,\n\t\t\tparentDom.ownerSVGElement !== undefined,\n\t\t\toldVNode._flags & MODE_HYDRATE ? [oldDom] : null,\n\t\t\tcommitQueue,\n\t\t\toldDom == null ? getDomSibling(oldVNode) : oldDom,\n\t\t\t!!(oldVNode._flags & MODE_HYDRATE),\n\t\t\trefQueue\n\t\t);\n\n\t\tnewVNode._parent._children[newVNode._index] = newVNode;\n\t\tcommitRoot(commitQueue, newVNode, refQueue);\n\n\t\tif (newVNode._dom != oldDom) {\n\t\t\tupdateParentDomPointers(newVNode);\n\t\t}\n\t}\n}\n\n/**\n * @param {VNode} vnode\n */\nfunction updateParentDomPointers(vnode) {\n\tif ((vnode = vnode._parent) != null && vnode._component != null) {\n\t\tvnode._dom = vnode._component.base = null;\n\t\tfor (let i = 0; i < vnode._children.length; i++) {\n\t\t\tlet child = vnode._children[i];\n\t\t\tif (child != null && child._dom != null) {\n\t\t\t\tvnode._dom = vnode._component.base = child._dom;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn updateParentDomPointers(vnode);\n\t}\n}\n\n/**\n * The render queue\n * @type {Array<Component>}\n */\nlet rerenderQueue = [];\n\n/*\n * The value of `Component.debounce` must asynchronously invoke the passed in callback. It is\n * important that contributors to Preact can consistently reason about what calls to `setState`, etc.\n * do, and when their effects will be applied. See the links below for some further reading on designing\n * asynchronous APIs.\n * * [Designing APIs for Asynchrony](https://blog.izs.me/2013/08/designing-apis-for-asynchrony)\n * * [Callbacks synchronous and asynchronous](https://blog.ometer.com/2011/07/24/callbacks-synchronous-and-asynchronous/)\n */\n\nlet prevDebounce;\n\nconst defer =\n\ttypeof Promise == 'function'\n\t\t? Promise.prototype.then.bind(Promise.resolve())\n\t\t: setTimeout;\n\n/**\n * Enqueue a rerender of a component\n * @param {Component} c The component to rerender\n */\nexport function enqueueRender(c) {\n\tif (\n\t\t(!c._dirty &&\n\t\t\t(c._dirty = true) &&\n\t\t\trerenderQueue.push(c) &&\n\t\t\t!process._rerenderCount++) ||\n\t\tprevDebounce !== options.debounceRendering\n\t) {\n\t\tprevDebounce = options.debounceRendering;\n\t\t(prevDebounce || defer)(process);\n\t}\n}\n\n/**\n * @param {Component} a\n * @param {Component} b\n */\nconst depthSort = (a, b) => a._vnode._depth - b._vnode._depth;\n\n/** Flush the render queue by rerendering all queued components */\nfunction process() {\n\tlet c;\n\trerenderQueue.sort(depthSort);\n\t// Don't update `renderCount` yet. Keep its value non-zero to prevent unnecessary\n\t// process() calls from getting scheduled while `queue` is still being consumed.\n\twhile ((c = rerenderQueue.shift())) {\n\t\tif (c._dirty) {\n\t\t\tlet renderQueueLength = rerenderQueue.length;\n\t\t\trenderComponent(c);\n\t\t\tif (rerenderQueue.length > renderQueueLength) {\n\t\t\t\t// When i.e. rerendering a provider additional new items can be injected, we want to\n\t\t\t\t// keep the order from top to bottom with those new items so we can handle them in a\n\t\t\t\t// single pass\n\t\t\t\trerenderQueue.sort(depthSort);\n\t\t\t}\n\t\t}\n\t}\n\tprocess._rerenderCount = 0;\n}\n\nprocess._rerenderCount = 0;\n", "import { enqueueRender } from './component';\n\nexport let i = 0;\n\nexport function createContext(defaultValue, contextId) {\n\tcontextId = '__cC' + i++;\n\n\tconst context = {\n\t\t_id: contextId,\n\t\t_defaultValue: defaultValue,\n\t\t/** @type {FunctionComponent} */\n\t\tConsumer(props, contextValue) {\n\t\t\t// return props.children(\n\t\t\t// \tcontext[contextId] ? context[contextId].props.value : defaultValue\n\t\t\t// );\n\t\t\treturn props.children(contextValue);\n\t\t},\n\t\t/** @type {FunctionComponent} */\n\t\tProvider(props) {\n\t\t\tif (!this.getChildContext) {\n\t\t\t\t/** @type {Component[]} */\n\t\t\t\tlet subs = [];\n\t\t\t\tlet ctx = {};\n\t\t\t\tctx[contextId] = this;\n\n\t\t\t\tthis.getChildContext = () => ctx;\n\n\t\t\t\tthis.shouldComponentUpdate = function (_props) {\n\t\t\t\t\tif (this.props.value !== _props.value) {\n\t\t\t\t\t\t// I think the forced value propagation here was only needed when `options.debounceRendering` was being bypassed:\n\t\t\t\t\t\t// https://github.com/preactjs/preact/commit/4d339fb803bea09e9f198abf38ca1bf8ea4b7771#diff-54682ce380935a717e41b8bfc54737f6R358\n\t\t\t\t\t\t// In those cases though, even with the value corrected, we're double-rendering all nodes.\n\t\t\t\t\t\t// It might be better to just tell folks not to use force-sync mode.\n\t\t\t\t\t\t// Currently, using `useContext()` in a class component will overwrite its `this.context` value.\n\t\t\t\t\t\t// subs.some(c => {\n\t\t\t\t\t\t// \tc.context = _props.value;\n\t\t\t\t\t\t// \tenqueueRender(c);\n\t\t\t\t\t\t// });\n\n\t\t\t\t\t\t// subs.some(c => {\n\t\t\t\t\t\t// \tc.context[contextId] = _props.value;\n\t\t\t\t\t\t// \tenqueueRender(c);\n\t\t\t\t\t\t// });\n\t\t\t\t\t\tsubs.some(c => {\n\t\t\t\t\t\t\tc._force = true;\n\t\t\t\t\t\t\tenqueueRender(c);\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\tthis.sub = c => {\n\t\t\t\t\tsubs.push(c);\n\t\t\t\t\tlet old = c.componentWillUnmount;\n\t\t\t\t\tc.componentWillUnmount = () => {\n\t\t\t\t\t\tsubs.splice(subs.indexOf(c), 1);\n\t\t\t\t\t\tif (old) old.call(c);\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t}\n\n\t\t\treturn props.children;\n\t\t}\n\t};\n\n\t// Devtools needs access to the context object when it\n\t// encounters a Provider. This is necessary to support\n\t// setting `displayName` on the context object instead\n\t// of on the component itself. See:\n\t// https://reactjs.org/docs/context.html#contextdisplayname\n\n\treturn (context.Provider._contextRef = context.Consumer.contextType =\n\t\tcontext);\n}\n", "import { diff, unmount, applyRef } from './index';\nimport { createVNode, Fragment } from '../create-element';\nimport { EMPTY_OBJ, EMPTY_ARR, INSERT_VNODE, MATCHED } from '../constants';\nimport { isArray } from '../util';\nimport { getDomSibling } from '../component';\n\n/**\n * Diff the children of a virtual node\n * @param {PreactElement} parentDom The DOM element whose children are being\n * diffed\n * @param {ComponentChildren[]} renderResult\n * @param {VNode} newParentVNode The new virtual node whose children should be\n * diff'ed against oldParentVNode\n * @param {VNode} oldParentVNode The old virtual node whose children should be\n * diff'ed against newParentVNode\n * @param {object} globalContext The current context object - modified by\n * getChildContext\n * @param {boolean} isSvg Whether or not this DOM node is an SVG node\n * @param {Array<PreactElement>} excessDomChildren\n * @param {Array<Component>} commitQueue List of components which have callbacks\n * to invoke in commitRoot\n * @param {PreactElement} oldDom The current attached DOM element any new dom\n * elements should be placed around. Likely `null` on first render (except when\n * hydrating). Can be a sibling DOM element when diffing Fragments that have\n * siblings. In most cases, it starts out as `oldChildren[0]._dom`.\n * @param {boolean} isHydrating Whether or not we are in hydration\n * @param {any[]} refQueue an array of elements needed to invoke refs\n */\nexport function diffChildren(\n\tparentDom,\n\trenderResult,\n\tnewParentVNode,\n\toldParentVNode,\n\tglobalContext,\n\tisSvg,\n\texcessDomChildren,\n\tcommitQueue,\n\toldDom,\n\tisHydrating,\n\trefQueue\n) {\n\tlet i,\n\t\t/** @type {VNode} */\n\t\toldVNode,\n\t\t/** @type {VNode} */\n\t\tchildVNode,\n\t\t/** @type {PreactElement} */\n\t\tnewDom,\n\t\t/** @type {PreactElement} */\n\t\tfirstChildDom;\n\n\t// This is a compression of oldParentVNode!=null && oldParentVNode != EMPTY_OBJ && oldParentVNode._children || EMPTY_ARR\n\t// as EMPTY_OBJ._children should be `undefined`.\n\t/** @type {VNode[]} */\n\tlet oldChildren = (oldParentVNode && oldParentVNode._children) || EMPTY_ARR;\n\n\tlet newChildrenLength = renderResult.length;\n\n\tnewParentVNode._nextDom = oldDom;\n\tconstructNewChildrenArray(newParentVNode, renderResult, oldChildren);\n\toldDom = newParentVNode._nextDom;\n\n\tfor (i = 0; i < newChildrenLength; i++) {\n\t\tchildVNode = newParentVNode._children[i];\n\n\t\tif (\n\t\t\tchildVNode == null ||\n\t\t\ttypeof childVNode == 'boolean' ||\n\t\t\ttypeof childVNode == 'function'\n\t\t) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t// At this point, constructNewChildrenArray has assigned _index to be the\n\t\t// matchingIndex for this VNode's oldVNode (or -1 if there is no oldVNode).\n\t\tif (childVNode._index === -1) {\n\t\t\toldVNode = EMPTY_OBJ;\n\t\t} else {\n\t\t\toldVNode = oldChildren[childVNode._index] || EMPTY_OBJ;\n\t\t}\n\n\t\t// Update childVNode._index to its final index\n\t\tchildVNode._index = i;\n\n\t\t// Morph the old element into the new one, but don't append it to the dom yet\n\t\tdiff(\n\t\t\tparentDom,\n\t\t\tchildVNode,\n\t\t\toldVNode,\n\t\t\tglobalContext,\n\t\t\tisSvg,\n\t\t\texcessDomChildren,\n\t\t\tcommitQueue,\n\t\t\toldDom,\n\t\t\tisHydrating,\n\t\t\trefQueue\n\t\t);\n\n\t\t// Adjust DOM nodes\n\t\tnewDom = childVNode._dom;\n\t\tif (childVNode.ref && oldVNode.ref != childVNode.ref) {\n\t\t\tif (oldVNode.ref) {\n\t\t\t\tapplyRef(oldVNode.ref, null, childVNode);\n\t\t\t}\n\t\t\trefQueue.push(\n\t\t\t\tchildVNode.ref,\n\t\t\t\tchildVNode._component || newDom,\n\t\t\t\tchildVNode\n\t\t\t);\n\t\t}\n\n\t\tif (firstChildDom == null && newDom != null) {\n\t\t\tfirstChildDom = newDom;\n\t\t}\n\n\t\tif (\n\t\t\tchildVNode._flags & INSERT_VNODE ||\n\t\t\toldVNode._children === childVNode._children\n\t\t) {\n\t\t\toldDom = insert(childVNode, oldDom, parentDom);\n\t\t} else if (\n\t\t\ttypeof childVNode.type == 'function' &&\n\t\t\tchildVNode._nextDom !== undefined\n\t\t) {\n\t\t\t// Since Fragments or components that return Fragment like VNodes can\n\t\t\t// contain multiple DOM nodes as the same level, continue the diff from\n\t\t\t// the sibling of last DOM child of this child VNode\n\t\t\toldDom = childVNode._nextDom;\n\t\t} else if (newDom) {\n\t\t\toldDom = newDom.nextSibling;\n\t\t}\n\n\t\t// Eagerly cleanup _nextDom. We don't need to persist the value because it\n\t\t// is only used by `diffChildren` to determine where to resume the diff\n\t\t// after diffing Components and Fragments. Once we store it the nextDOM\n\t\t// local var, we can clean up the property. Also prevents us hanging on to\n\t\t// DOM nodes that may have been unmounted.\n\t\tchildVNode._nextDom = undefined;\n\n\t\t// Unset diffing flags\n\t\tchildVNode._flags &= ~(INSERT_VNODE | MATCHED);\n\t}\n\n\t// TODO: With new child diffing algo, consider alt ways to diff Fragments.\n\t// Such as dropping oldDom and moving fragments in place\n\t//\n\t// Because the newParentVNode is Fragment-like, we need to set it's\n\t// _nextDom property to the nextSibling of its last child DOM node.\n\t//\n\t// `oldDom` contains the correct value here because if the last child\n\t// is a Fragment-like, then oldDom has already been set to that child's _nextDom.\n\t// If the last child is a DOM VNode, then oldDom will be set to that DOM\n\t// node's nextSibling.\n\tnewParentVNode._nextDom = oldDom;\n\tnewParentVNode._dom = firstChildDom;\n}\n\n/**\n * @param {VNode} newParentVNode\n * @param {ComponentChildren[]} renderResult\n * @param {VNode[]} oldChildren\n */\nfunction constructNewChildrenArray(newParentVNode, renderResult, oldChildren) {\n\t/** @type {number} */\n\tlet i;\n\t/** @type {VNode} */\n\tlet childVNode;\n\t/** @type {VNode} */\n\tlet oldVNode;\n\n\tconst newChildrenLength = renderResult.length;\n\tlet oldChildrenLength = oldChildren.length,\n\t\tremainingOldChildren = oldChildrenLength;\n\n\tlet skew = 0;\n\n\tnewParentVNode._children = [];\n\tfor (i = 0; i < newChildrenLength; i++) {\n\t\t// @ts-expect-error We are reusing the childVNode variable to hold both the\n\t\t// pre and post normalized childVNode\n\t\tchildVNode = renderResult[i];\n\n\t\tif (\n\t\t\tchildVNode == null ||\n\t\t\ttypeof childVNode == 'boolean' ||\n\t\t\ttypeof childVNode == 'function'\n\t\t) {\n\t\t\tchildVNode = newParentVNode._children[i] = null;\n\t\t}\n\t\t// If this newVNode is being reused (e.g. <div>{reuse}{reuse}</div>) in the same diff,\n\t\t// or we are rendering a component (e.g. setState) copy the oldVNodes so it can have\n\t\t// it's own DOM & etc. pointers\n\t\telse if (\n\t\t\ttypeof childVNode == 'string' ||\n\t\t\ttypeof childVNode == 'number' ||\n\t\t\t// eslint-disable-next-line valid-typeof\n\t\t\ttypeof childVNode == 'bigint' ||\n\t\t\tchildVNode.constructor == String\n\t\t) {\n\t\t\tchildVNode = newParentVNode._children[i] = createVNode(\n\t\t\t\tnull,\n\t\t\t\tchildVNode,\n\t\t\t\tnull,\n\t\t\t\tnull,\n\t\t\t\tchildVNode\n\t\t\t);\n\t\t} else if (isArray(childVNode)) {\n\t\t\tchildVNode = newParentVNode._children[i] = createVNode(\n\t\t\t\tFragment,\n\t\t\t\t{ children: childVNode },\n\t\t\t\tnull,\n\t\t\t\tnull,\n\t\t\t\tnull\n\t\t\t);\n\t\t} else if (childVNode.constructor === undefined && childVNode._depth > 0) {\n\t\t\t// VNode is already in use, clone it. This can happen in the following\n\t\t\t// scenario:\n\t\t\t// const reuse = <div />\n\t\t\t// <div>{reuse}<span />{reuse}</div>\n\t\t\tchildVNode = newParentVNode._children[i] = createVNode(\n\t\t\t\tchildVNode.type,\n\t\t\t\tchildVNode.props,\n\t\t\t\tchildVNode.key,\n\t\t\t\tchildVNode.ref ? childVNode.ref : null,\n\t\t\t\tchildVNode._original\n\t\t\t);\n\t\t} else {\n\t\t\tchildVNode = newParentVNode._children[i] = childVNode;\n\t\t}\n\n\t\t// Handle unmounting null placeholders, i.e. VNode => null in unkeyed children\n\t\tif (childVNode == null) {\n\t\t\toldVNode = oldChildren[i];\n\t\t\tif (oldVNode && oldVNode.key == null && oldVNode._dom) {\n\t\t\t\tif (oldVNode._dom == newParentVNode._nextDom) {\n\t\t\t\t\tnewParentVNode._nextDom = getDomSibling(oldVNode);\n\t\t\t\t}\n\n\t\t\t\tunmount(oldVNode, oldVNode, false);\n\n\t\t\t\t// Explicitly nullify this position in oldChildren instead of just\n\t\t\t\t// setting `_match=true` to prevent other routines (e.g.\n\t\t\t\t// `findMatchingIndex` or `getDomSibling`) from thinking VNodes or DOM\n\t\t\t\t// nodes in this position are still available to be used in diffing when\n\t\t\t\t// they have actually already been unmounted. For example, by only\n\t\t\t\t// setting `_match=true` here, the unmounting loop later would attempt\n\t\t\t\t// to unmount this VNode again seeing `_match==true`. Further,\n\t\t\t\t// getDomSibling doesn't know about _match and so would incorrectly\n\t\t\t\t// assume DOM nodes in this subtree are mounted and usable.\n\t\t\t\toldChildren[i] = null;\n\t\t\t\tremainingOldChildren--;\n\t\t\t}\n\n\t\t\tcontinue;\n\t\t}\n\n\t\tchildVNode._parent = newParentVNode;\n\t\tchildVNode._depth = newParentVNode._depth + 1;\n\n\t\tconst skewedIndex = i + skew;\n\t\tconst matchingIndex = findMatchingIndex(\n\t\t\tchildVNode,\n\t\t\toldChildren,\n\t\t\tskewedIndex,\n\t\t\tremainingOldChildren\n\t\t);\n\n\t\t// Temporarily store the matchingIndex on the _index property so we can pull\n\t\t// out the oldVNode in diffChildren. We'll override this to the VNode's\n\t\t// final index after using this property to get the oldVNode\n\t\tchildVNode._index = matchingIndex;\n\n\t\toldVNode = null;\n\t\tif (matchingIndex !== -1) {\n\t\t\toldVNode = oldChildren[matchingIndex];\n\t\t\tremainingOldChildren--;\n\t\t\tif (oldVNode) {\n\t\t\t\toldVNode._flags |= MATCHED;\n\t\t\t}\n\t\t}\n\n\t\t// Here, we define isMounting for the purposes of the skew diffing\n\t\t// algorithm. Nodes that are unsuspending are considered mounting and we detect\n\t\t// this by checking if oldVNode._original === null\n\t\tconst isMounting = oldVNode == null || oldVNode._original === null;\n\n\t\tif (isMounting) {\n\t\t\tif (matchingIndex == -1) {\n\t\t\t\tskew--;\n\t\t\t}\n\n\t\t\t// If we are mounting a DOM VNode, mark it for insertion\n\t\t\tif (typeof childVNode.type != 'function') {\n\t\t\t\tchildVNode._flags |= INSERT_VNODE;\n\t\t\t}\n\t\t} else if (matchingIndex !== skewedIndex) {\n\t\t\tif (matchingIndex === skewedIndex + 1) {\n\t\t\t\tskew++;\n\t\t\t} else if (matchingIndex > skewedIndex) {\n\t\t\t\tif (remainingOldChildren > newChildrenLength - skewedIndex) {\n\t\t\t\t\tskew += matchingIndex - skewedIndex;\n\t\t\t\t} else {\n\t\t\t\t\t// ### Change from keyed: I think this was missing from the algo...\n\t\t\t\t\tskew--;\n\t\t\t\t}\n\t\t\t} else if (matchingIndex < skewedIndex) {\n\t\t\t\tif (matchingIndex == skewedIndex - 1) {\n\t\t\t\t\tskew = matchingIndex - skewedIndex;\n\t\t\t\t} else {\n\t\t\t\t\tskew = 0;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tskew = 0;\n\t\t\t}\n\n\t\t\t// Move this VNode's DOM if the original index (matchingIndex) doesn't\n\t\t\t// match the new skew index (i + new skew)\n\t\t\tif (matchingIndex !== i + skew) {\n\t\t\t\tchildVNode._flags |= INSERT_VNODE;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Remove remaining oldChildren if there are any. Loop forwards so that as we\n\t// unmount DOM from the beginning of the oldChildren, we can adjust oldDom to\n\t// point to the next child, which needs to be the first DOM node that won't be\n\t// unmounted.\n\tif (remainingOldChildren) {\n\t\tfor (i = 0; i < oldChildrenLength; i++) {\n\t\t\toldVNode = oldChildren[i];\n\t\t\tif (oldVNode != null && (oldVNode._flags & MATCHED) === 0) {\n\t\t\t\tif (oldVNode._dom == newParentVNode._nextDom) {\n\t\t\t\t\tnewParentVNode._nextDom = getDomSibling(oldVNode);\n\t\t\t\t}\n\n\t\t\t\tunmount(oldVNode, oldVNode);\n\t\t\t}\n\t\t}\n\t}\n}\n\n/**\n * @param {VNode} parentVNode\n * @param {PreactElement} oldDom\n * @param {PreactElement} parentDom\n * @returns {PreactElement}\n */\nfunction insert(parentVNode, oldDom, parentDom) {\n\t// Note: VNodes in nested suspended trees may be missing _children.\n\n\tif (typeof parentVNode.type == 'function') {\n\t\tlet children = parentVNode._children;\n\t\tfor (let i = 0; children && i < children.length; i++) {\n\t\t\tif (children[i]) {\n\t\t\t\t// If we enter this code path on sCU bailout, where we copy\n\t\t\t\t// oldVNode._children to newVNode._children, we need to update the old\n\t\t\t\t// children's _parent pointer to point to the newVNode (parentVNode\n\t\t\t\t// here).\n\t\t\t\tchildren[i]._parent = parentVNode;\n\t\t\t\toldDom = insert(children[i], oldDom, parentDom);\n\t\t\t}\n\t\t}\n\n\t\treturn oldDom;\n\t} else if (parentVNode._dom != oldDom) {\n\t\tparentDom.insertBefore(parentVNode._dom, oldDom || null);\n\t\toldDom = parentVNode._dom;\n\t}\n\n\treturn oldDom && oldDom.nextSibling;\n}\n\n/**\n * Flatten and loop through the children of a virtual node\n * @param {ComponentChildren} children The unflattened children of a virtual\n * node\n * @returns {VNode[]}\n */\nexport function toChildArray(children, out) {\n\tout = out || [];\n\tif (children == null || typeof children == 'boolean') {\n\t} else if (isArray(children)) {\n\t\tchildren.some(child => {\n\t\t\ttoChildArray(child, out);\n\t\t});\n\t} else {\n\t\tout.push(children);\n\t}\n\treturn out;\n}\n\n/**\n * @param {VNode} childVNode\n * @param {VNode[]} oldChildren\n * @param {number} skewedIndex\n * @param {number} remainingOldChildren\n * @returns {number}\n */\nfunction findMatchingIndex(\n\tchildVNode,\n\toldChildren,\n\tskewedIndex,\n\tremainingOldChildren\n) {\n\tconst key = childVNode.key;\n\tconst type = childVNode.type;\n\tlet x = skewedIndex - 1;\n\tlet y = skewedIndex + 1;\n\tlet oldVNode = oldChildren[skewedIndex];\n\n\t// We only need to perform a search if there are more children\n\t// (remainingOldChildren) to search. However, if the oldVNode we just looked\n\t// at skewedIndex was not already used in this diff, then there must be at\n\t// least 1 other (so greater than 1) remainingOldChildren to attempt to match\n\t// against. So the following condition checks that ensuring\n\t// remainingOldChildren > 1 if the oldVNode is not already used/matched. Else\n\t// if the oldVNode was null or matched, then there could needs to be at least\n\t// 1 (aka `remainingOldChildren > 0`) children to find and compare against.\n\tlet shouldSearch =\n\t\tremainingOldChildren >\n\t\t(oldVNode != null && (oldVNode._flags & MATCHED) === 0 ? 1 : 0);\n\n\tif (\n\t\toldVNode === null ||\n\t\t(oldVNode && key == oldVNode.key && type === oldVNode.type)\n\t) {\n\t\treturn skewedIndex;\n\t} else if (shouldSearch) {\n\t\twhile (x >= 0 || y < oldChildren.length) {\n\t\t\tif (x >= 0) {\n\t\t\t\toldVNode = oldChildren[x];\n\t\t\t\tif (\n\t\t\t\t\toldVNode &&\n\t\t\t\t\t(oldVNode._flags & MATCHED) === 0 &&\n\t\t\t\t\tkey == oldVNode.key &&\n\t\t\t\t\ttype === oldVNode.type\n\t\t\t\t) {\n\t\t\t\t\treturn x;\n\t\t\t\t}\n\t\t\t\tx--;\n\t\t\t}\n\n\t\t\tif (y < oldChildren.length) {\n\t\t\t\toldVNode = oldChildren[y];\n\t\t\t\tif (\n\t\t\t\t\toldVNode &&\n\t\t\t\t\t(oldVNode._flags & MATCHED) === 0 &&\n\t\t\t\t\tkey == oldVNode.key &&\n\t\t\t\t\ttype === oldVNode.type\n\t\t\t\t) {\n\t\t\t\t\treturn y;\n\t\t\t\t}\n\t\t\t\ty++;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn -1;\n}\n", "import { IS_NON_DIMENSIONAL } from '../constants';\nimport options from '../options';\n\nfunction setStyle(style, key, value) {\n\tif (key[0] === '-') {\n\t\tstyle.setProperty(key, value == null ? '' : value);\n\t} else if (value == null) {\n\t\tstyle[key] = '';\n\t} else if (typeof value != 'number' || IS_NON_DIMENSIONAL.test(key)) {\n\t\tstyle[key] = value;\n\t} else {\n\t\tstyle[key] = value + 'px';\n\t}\n}\n\n/**\n * Set a property value on a DOM node\n * @param {PreactElement} dom The DOM node to modify\n * @param {string} name The name of the property to set\n * @param {*} value The value to set the property to\n * @param {*} oldValue The old value the property had\n * @param {boolean} isSvg Whether or not this DOM node is an SVG node or not\n */\nexport function setProperty(dom, name, value, oldValue, isSvg) {\n\tlet useCapture;\n\n\to: if (name === 'style') {\n\t\tif (typeof value == 'string') {\n\t\t\tdom.style.cssText = value;\n\t\t} else {\n\t\t\tif (typeof oldValue == 'string') {\n\t\t\t\tdom.style.cssText = oldValue = '';\n\t\t\t}\n\n\t\t\tif (oldValue) {\n\t\t\t\tfor (name in oldValue) {\n\t\t\t\t\tif (!(value && name in value)) {\n\t\t\t\t\t\tsetStyle(dom.style, name, '');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (value) {\n\t\t\t\tfor (name in value) {\n\t\t\t\t\tif (!oldValue || value[name] !== oldValue[name]) {\n\t\t\t\t\t\tsetStyle(dom.style, name, value[name]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t// Benchmark for comparison: https://esbench.com/bench/574c954bdb965b9a00965ac6\n\telse if (name[0] === 'o' && name[1] === 'n') {\n\t\tuseCapture =\n\t\t\tname !== (name = name.replace(/(PointerCapture)$|Capture$/, '$1'));\n\n\t\t// Infer correct casing for DOM built-in events:\n\t\tif (name.toLowerCase() in dom) name = name.toLowerCase().slice(2);\n\t\telse name = name.slice(2);\n\n\t\tif (!dom._listeners) dom._listeners = {};\n\t\tdom._listeners[name + useCapture] = value;\n\n\t\tif (value) {\n\t\t\tif (!oldValue) {\n\t\t\t\tvalue._attached = Date.now();\n\t\t\t\tconst handler = useCapture ? eventProxyCapture : eventProxy;\n\t\t\t\tdom.addEventListener(name, handler, useCapture);\n\t\t\t} else {\n\t\t\t\tvalue._attached = oldValue._attached;\n\t\t\t}\n\t\t} else {\n\t\t\tconst handler = useCapture ? eventProxyCapture : eventProxy;\n\t\t\tdom.removeEventListener(name, handler, useCapture);\n\t\t}\n\t} else {\n\t\tif (isSvg) {\n\t\t\t// Normalize incorrect prop usage for SVG:\n\t\t\t// - xlink:href / xlinkHref --> href (xlink:href was removed from SVG and isn't needed)\n\t\t\t// - className --> class\n\t\t\tname = name.replace(/xlink(H|:h)/, 'h').replace(/sName$/, 's');\n\t\t} else if (\n\t\t\tname !== 'width' &&\n\t\t\tname !== 'height' &&\n\t\t\tname !== 'href' &&\n\t\t\tname !== 'list' &&\n\t\t\tname !== 'form' &&\n\t\t\t// Default value in browsers is `-1` and an empty string is\n\t\t\t// cast to `0` instead\n\t\t\tname !== 'tabIndex' &&\n\t\t\tname !== 'download' &&\n\t\t\tname !== 'rowSpan' &&\n\t\t\tname !== 'colSpan' &&\n\t\t\tname !== 'role' &&\n\t\t\tname in dom\n\t\t) {\n\t\t\ttry {\n\t\t\t\tdom[name] = value == null ? '' : value;\n\t\t\t\t// labelled break is 1b smaller here than a return statement (sorry)\n\t\t\t\tbreak o;\n\t\t\t} catch (e) {}\n\t\t}\n\n\t\t// aria- and data- attributes have no boolean representation.\n\t\t// A `false` value is different from the attribute not being\n\t\t// present, so we can't remove it. For non-boolean aria\n\t\t// attributes we could treat false as a removal, but the\n\t\t// amount of exceptions would cost too many bytes. On top of\n\t\t// that other frameworks generally stringify `false`.\n\n\t\tif (typeof value == 'function') {\n\t\t\t// never serialize functions as attribute values\n\t\t} else if (value != null && (value !== false || name[4] === '-')) {\n\t\t\tdom.setAttribute(name, value);\n\t\t} else {\n\t\t\tdom.removeAttribute(name);\n\t\t}\n\t}\n}\n\n/**\n * Proxy an event to hooked event handlers\n * @param {PreactEvent} e The event object from the browser\n * @private\n */\nfunction eventProxy(e) {\n\tconst eventHandler = this._listeners[e.type + false];\n\t/**\n\t * This trick is inspired by Vue https://github.com/vuejs/core/blob/main/packages/runtime-dom/src/modules/events.ts#L90-L101\n\t * when the dom performs an event it leaves micro-ticks in between bubbling up which means that an event can trigger on a newly\n\t * created DOM-node while the event bubbles up, this can cause quirky behavior as seen in https://github.com/preactjs/preact/issues/3927\n\t */\n\tif (!e._dispatched) {\n\t\t// When an event has no _dispatched we know this is the first event-target in the chain\n\t\t// so we set the initial dispatched time.\n\t\te._dispatched = Date.now();\n\t\t// When the _dispatched is smaller than the time when the targetted event handler was attached\n\t\t// we know we have bubbled up to an element that was added during patching the dom.\n\t} else if (e._dispatched <= eventHandler._attached) {\n\t\treturn;\n\t}\n\treturn eventHandler(options.event ? options.event(e) : e);\n}\n\n/**\n * Proxy an event to hooked event handlers\n * @param {PreactEvent} e The event object from the browser\n * @private\n */\nfunction eventProxyCapture(e) {\n\treturn this._listeners[e.type + true](options.event ? options.event(e) : e);\n}\n", "import {\n\tEMPTY_OBJ,\n\tMODE_HYDRATE,\n\tMODE_SUSPENDED,\n\tRESET_MODE\n} from '../constants';\nimport { BaseComponent, getDomSibling } from '../component';\nimport { Fragment } from '../create-element';\nimport { diffChildren } from './children';\nimport { setProperty } from './props';\nimport { assign, isArray, removeNode, slice } from '../util';\nimport options from '../options';\n\n/**\n * Diff two virtual nodes and apply proper changes to the DOM\n * @param {PreactElement} parentDom The parent of the DOM element\n * @param {VNode} newVNode The new virtual node\n * @param {VNode} oldVNode The old virtual node\n * @param {object} globalContext The current context object. Modified by\n * getChildContext\n * @param {boolean} isSvg Whether or not this element is an SVG node\n * @param {Array<PreactElement>} excessDomChildren\n * @param {Array<Component>} commitQueue List of components which have callbacks\n * to invoke in commitRoot\n * @param {PreactElement} oldDom The current attached DOM element any new dom\n * elements should be placed around. Likely `null` on first render (except when\n * hydrating). Can be a sibling DOM element when diffing Fragments that have\n * siblings. In most cases, it starts out as `oldChildren[0]._dom`.\n * @param {boolean} isHydrating Whether or not we are in hydration\n * @param {any[]} refQueue an array of elements needed to invoke refs\n */\nexport function diff(\n\tparentDom,\n\tnewVNode,\n\toldVNode,\n\tglobalContext,\n\tisSvg,\n\texcessDomChildren,\n\tcommitQueue,\n\toldDom,\n\tisHydrating,\n\trefQueue\n) {\n\t/** @type {any} */\n\tlet tmp,\n\t\tnewType = newVNode.type;\n\n\t// When passing through createElement it assigns the object\n\t// constructor as undefined. This to prevent JSON-injection.\n\tif (newVNode.constructor !== undefined) return null;\n\n\t// If the previous diff bailed out, resume creating/hydrating.\n\tif (oldVNode._flags & MODE_SUSPENDED) {\n\t\tisHydrating = !!(oldVNode._flags & MODE_HYDRATE);\n\t\toldDom = newVNode._dom = oldVNode._dom;\n\t\texcessDomChildren = [oldDom];\n\t}\n\n\tif ((tmp = options._diff)) tmp(newVNode);\n\n\touter: if (typeof newType == 'function') {\n\t\ttry {\n\t\t\tlet c, isNew, oldProps, oldState, snapshot, clearProcessingException;\n\t\t\tlet newProps = newVNode.props;\n\n\t\t\t// Necessary for createContext api. Setting this property will pass\n\t\t\t// the context value as `this.context` just for this component.\n\t\t\ttmp = newType.contextType;\n\t\t\tlet provider = tmp && globalContext[tmp._id];\n\t\t\tlet componentContext = tmp\n\t\t\t\t? provider\n\t\t\t\t\t? provider.props.value\n\t\t\t\t\t: tmp._defaultValue\n\t\t\t\t: globalContext;\n\n\t\t\t// Get component and set it to `c`\n\t\t\tif (oldVNode._component) {\n\t\t\t\tc = newVNode._component = oldVNode._component;\n\t\t\t\tclearProcessingException = c._processingException = c._pendingError;\n\t\t\t} else {\n\t\t\t\t// Instantiate the new component\n\t\t\t\tif ('prototype' in newType && newType.prototype.render) {\n\t\t\t\t\t// @ts-expect-error The check above verifies that newType is suppose to be constructed\n\t\t\t\t\tnewVNode._component = c = new newType(newProps, componentContext); // eslint-disable-line new-cap\n\t\t\t\t} else {\n\t\t\t\t\t// @ts-expect-error Trust me, Component implements the interface we want\n\t\t\t\t\tnewVNode._component = c = new BaseComponent(\n\t\t\t\t\t\tnewProps,\n\t\t\t\t\t\tcomponentContext\n\t\t\t\t\t);\n\t\t\t\t\tc.constructor = newType;\n\t\t\t\t\tc.render = doRender;\n\t\t\t\t}\n\t\t\t\tif (provider) provider.sub(c);\n\n\t\t\t\tc.props = newProps;\n\t\t\t\tif (!c.state) c.state = {};\n\t\t\t\tc.context = componentContext;\n\t\t\t\tc._globalContext = globalContext;\n\t\t\t\tisNew = c._dirty = true;\n\t\t\t\tc._renderCallbacks = [];\n\t\t\t\tc._stateCallbacks = [];\n\t\t\t}\n\n\t\t\t// Invoke getDerivedStateFromProps\n\t\t\tif (c._nextState == null) {\n\t\t\t\tc._nextState = c.state;\n\t\t\t}\n\n\t\t\tif (newType.getDerivedStateFromProps != null) {\n\t\t\t\tif (c._nextState == c.state) {\n\t\t\t\t\tc._nextState = assign({}, c._nextState);\n\t\t\t\t}\n\n\t\t\t\tassign(\n\t\t\t\t\tc._nextState,\n\t\t\t\t\tnewType.getDerivedStateFromProps(newProps, c._nextState)\n\t\t\t\t);\n\t\t\t}\n\n\t\t\toldProps = c.props;\n\t\t\toldState = c.state;\n\t\t\tc._vnode = newVNode;\n\n\t\t\t// Invoke pre-render lifecycle methods\n\t\t\tif (isNew) {\n\t\t\t\tif (\n\t\t\t\t\tnewType.getDerivedStateFromProps == null &&\n\t\t\t\t\tc.componentWillMount != null\n\t\t\t\t) {\n\t\t\t\t\tc.componentWillMount();\n\t\t\t\t}\n\n\t\t\t\tif (c.componentDidMount != null) {\n\t\t\t\t\tc._renderCallbacks.push(c.componentDidMount);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (\n\t\t\t\t\tnewType.getDerivedStateFromProps == null &&\n\t\t\t\t\tnewProps !== oldProps &&\n\t\t\t\t\tc.componentWillReceiveProps != null\n\t\t\t\t) {\n\t\t\t\t\tc.componentWillReceiveProps(newProps, componentContext);\n\t\t\t\t}\n\n\t\t\t\tif (\n\t\t\t\t\t!c._force &&\n\t\t\t\t\t((c.shouldComponentUpdate != null &&\n\t\t\t\t\t\tc.shouldComponentUpdate(\n\t\t\t\t\t\t\tnewProps,\n\t\t\t\t\t\t\tc._nextState,\n\t\t\t\t\t\t\tcomponentContext\n\t\t\t\t\t\t) === false) ||\n\t\t\t\t\t\tnewVNode._original === oldVNode._original)\n\t\t\t\t) {\n\t\t\t\t\t// More info about this here: https://gist.github.com/JoviDeCroock/bec5f2ce93544d2e6070ef8e0036e4e8\n\t\t\t\t\tif (newVNode._original !== oldVNode._original) {\n\t\t\t\t\t\t// When we are dealing with a bail because of sCU we have to update\n\t\t\t\t\t\t// the props, state and dirty-state.\n\t\t\t\t\t\t// when we are dealing with strict-equality we don't as the child could still\n\t\t\t\t\t\t// be dirtied see #3883\n\t\t\t\t\t\tc.props = newProps;\n\t\t\t\t\t\tc.state = c._nextState;\n\t\t\t\t\t\tc._dirty = false;\n\t\t\t\t\t}\n\n\t\t\t\t\tnewVNode._dom = oldVNode._dom;\n\t\t\t\t\tnewVNode._children = oldVNode._children;\n\t\t\t\t\tnewVNode._children.forEach(vnode => {\n\t\t\t\t\t\tif (vnode) vnode._parent = newVNode;\n\t\t\t\t\t});\n\n\t\t\t\t\tfor (let i = 0; i < c._stateCallbacks.length; i++) {\n\t\t\t\t\t\tc._renderCallbacks.push(c._stateCallbacks[i]);\n\t\t\t\t\t}\n\t\t\t\t\tc._stateCallbacks = [];\n\n\t\t\t\t\tif (c._renderCallbacks.length) {\n\t\t\t\t\t\tcommitQueue.push(c);\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak outer;\n\t\t\t\t}\n\n\t\t\t\tif (c.componentWillUpdate != null) {\n\t\t\t\t\tc.componentWillUpdate(newProps, c._nextState, componentContext);\n\t\t\t\t}\n\n\t\t\t\tif (c.componentDidUpdate != null) {\n\t\t\t\t\tc._renderCallbacks.push(() => {\n\t\t\t\t\t\tc.componentDidUpdate(oldProps, oldState, snapshot);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tc.context = componentContext;\n\t\t\tc.props = newProps;\n\t\t\tc._parentDom = parentDom;\n\t\t\tc._force = false;\n\n\t\t\tlet renderHook = options._render,\n\t\t\t\tcount = 0;\n\t\t\tif ('prototype' in newType && newType.prototype.render) {\n\t\t\t\tc.state = c._nextState;\n\t\t\t\tc._dirty = false;\n\n\t\t\t\tif (renderHook) renderHook(newVNode);\n\n\t\t\t\ttmp = c.render(c.props, c.state, c.context);\n\n\t\t\t\tfor (let i = 0; i < c._stateCallbacks.length; i++) {\n\t\t\t\t\tc._renderCallbacks.push(c._stateCallbacks[i]);\n\t\t\t\t}\n\t\t\t\tc._stateCallbacks = [];\n\t\t\t} else {\n\t\t\t\tdo {\n\t\t\t\t\tc._dirty = false;\n\t\t\t\t\tif (renderHook) renderHook(newVNode);\n\n\t\t\t\t\ttmp = c.render(c.props, c.state, c.context);\n\n\t\t\t\t\t// Handle setState called in render, see #2553\n\t\t\t\t\tc.state = c._nextState;\n\t\t\t\t} while (c._dirty && ++count < 25);\n\t\t\t}\n\n\t\t\t// Handle setState called in render, see #2553\n\t\t\tc.state = c._nextState;\n\n\t\t\tif (c.getChildContext != null) {\n\t\t\t\tglobalContext = assign(assign({}, globalContext), c.getChildContext());\n\t\t\t}\n\n\t\t\tif (!isNew && c.getSnapshotBeforeUpdate != null) {\n\t\t\t\tsnapshot = c.getSnapshotBeforeUpdate(oldProps, oldState);\n\t\t\t}\n\n\t\t\tlet isTopLevelFragment =\n\t\t\t\ttmp != null && tmp.type === Fragment && tmp.key == null;\n\t\t\tlet renderResult = isTopLevelFragment ? tmp.props.children : tmp;\n\n\t\t\tdiffChildren(\n\t\t\t\tparentDom,\n\t\t\t\tisArray(renderResult) ? renderResult : [renderResult],\n\t\t\t\tnewVNode,\n\t\t\t\toldVNode,\n\t\t\t\tglobalContext,\n\t\t\t\tisSvg,\n\t\t\t\texcessDomChildren,\n\t\t\t\tcommitQueue,\n\t\t\t\toldDom,\n\t\t\t\tisHydrating,\n\t\t\t\trefQueue\n\t\t\t);\n\n\t\t\tc.base = newVNode._dom;\n\n\t\t\t// We successfully rendered this VNode, unset any stored hydration/bailout state:\n\t\t\tnewVNode._flags &= RESET_MODE;\n\n\t\t\tif (c._renderCallbacks.length) {\n\t\t\t\tcommitQueue.push(c);\n\t\t\t}\n\n\t\t\tif (clearProcessingException) {\n\t\t\t\tc._pendingError = c._processingException = null;\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tnewVNode._original = null;\n\t\t\t// if hydrating or creating initial tree, bailout preserves DOM:\n\t\t\tif (isHydrating || excessDomChildren != null) {\n\t\t\t\tnewVNode._dom = oldDom;\n\t\t\t\tnewVNode._flags |= isHydrating\n\t\t\t\t\t? MODE_HYDRATE | MODE_SUSPENDED\n\t\t\t\t\t: MODE_HYDRATE;\n\t\t\t\texcessDomChildren[excessDomChildren.indexOf(oldDom)] = null;\n\t\t\t\t// ^ could possibly be simplified to:\n\t\t\t\t// excessDomChildren.length = 0;\n\t\t\t} else {\n\t\t\t\tnewVNode._dom = oldVNode._dom;\n\t\t\t\tnewVNode._children = oldVNode._children;\n\t\t\t}\n\t\t\toptions._catchError(e, newVNode, oldVNode);\n\t\t}\n\t} else if (\n\t\texcessDomChildren == null &&\n\t\tnewVNode._original === oldVNode._original\n\t) {\n\t\tnewVNode._children = oldVNode._children;\n\t\tnewVNode._dom = oldVNode._dom;\n\t} else {\n\t\tnewVNode._dom = diffElementNodes(\n\t\t\toldVNode._dom,\n\t\t\tnewVNode,\n\t\t\toldVNode,\n\t\t\tglobalContext,\n\t\t\tisSvg,\n\t\t\texcessDomChildren,\n\t\t\tcommitQueue,\n\t\t\tisHydrating,\n\t\t\trefQueue\n\t\t);\n\t}\n\n\tif ((tmp = options.diffed)) tmp(newVNode);\n}\n\n/**\n * @param {Array<Component>} commitQueue List of components\n * which have callbacks to invoke in commitRoot\n * @param {VNode} root\n */\nexport function commitRoot(commitQueue, root, refQueue) {\n\troot._nextDom = undefined;\n\n\tfor (let i = 0; i < refQueue.length; i++) {\n\t\tapplyRef(refQueue[i], refQueue[++i], refQueue[++i]);\n\t}\n\n\tif (options._commit) options._commit(root, commitQueue);\n\n\tcommitQueue.some(c => {\n\t\ttry {\n\t\t\t// @ts-expect-error Reuse the commitQueue variable here so the type changes\n\t\t\tcommitQueue = c._renderCallbacks;\n\t\t\tc._renderCallbacks = [];\n\t\t\tcommitQueue.some(cb => {\n\t\t\t\t// @ts-expect-error See above comment on commitQueue\n\t\t\t\tcb.call(c);\n\t\t\t});\n\t\t} catch (e) {\n\t\t\toptions._catchError(e, c._vnode);\n\t\t}\n\t});\n}\n\n/**\n * Diff two virtual nodes representing DOM element\n * @param {PreactElement} dom The DOM element representing the virtual nodes\n * being diffed\n * @param {VNode} newVNode The new virtual node\n * @param {VNode} oldVNode The old virtual node\n * @param {object} globalContext The current context object\n * @param {boolean} isSvg Whether or not this DOM node is an SVG node\n * @param {Array<PreactElement>} excessDomChildren\n * @param {Array<Component>} commitQueue List of components which have callbacks\n * to invoke in commitRoot\n * @param {boolean} isHydrating Whether or not we are in hydration\n * @param {any[]} refQueue an array of elements needed to invoke refs\n * @returns {PreactElement}\n */\nfunction diffElementNodes(\n\tdom,\n\tnewVNode,\n\toldVNode,\n\tglobalContext,\n\tisSvg,\n\texcessDomChildren,\n\tcommitQueue,\n\tisHydrating,\n\trefQueue\n) {\n\tlet oldProps = oldVNode.props;\n\tlet newProps = newVNode.props;\n\tlet nodeType = /** @type {string} */ (newVNode.type);\n\t/** @type {any} */\n\tlet i;\n\t/** @type {{ __html?: string }} */\n\tlet newHtml;\n\t/** @type {{ __html?: string }} */\n\tlet oldHtml;\n\t/** @type {ComponentChildren} */\n\tlet newChildren;\n\tlet value;\n\tlet inputValue;\n\tlet checked;\n\n\t// Tracks entering and exiting SVG namespace when descending through the tree.\n\tif (nodeType === 'svg') isSvg = true;\n\n\tif (excessDomChildren != null) {\n\t\tfor (i = 0; i < excessDomChildren.length; i++) {\n\t\t\tvalue = excessDomChildren[i];\n\n\t\t\t// if newVNode matches an element in excessDomChildren or the `dom`\n\t\t\t// argument matches an element in excessDomChildren, remove it from\n\t\t\t// excessDomChildren so it isn't later removed in diffChildren\n\t\t\tif (\n\t\t\t\tvalue &&\n\t\t\t\t'setAttribute' in value === !!nodeType &&\n\t\t\t\t(nodeType ? value.localName === nodeType : value.nodeType === 3)\n\t\t\t) {\n\t\t\t\tdom = value;\n\t\t\t\texcessDomChildren[i] = null;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tif (dom == null) {\n\t\tif (nodeType === null) {\n\t\t\treturn document.createTextNode(newProps);\n\t\t}\n\n\t\tif (isSvg) {\n\t\t\tdom = document.createElementNS('http://www.w3.org/2000/svg', nodeType);\n\t\t} else {\n\t\t\tdom = document.createElement(nodeType, newProps.is && newProps);\n\t\t}\n\n\t\t// we created a new parent, so none of the previously attached children can be reused:\n\t\texcessDomChildren = null;\n\t\t// we are creating a new node, so we can assume this is a new subtree (in\n\t\t// case we are hydrating), this deopts the hydrate\n\t\tisHydrating = false;\n\t}\n\n\tif (nodeType === null) {\n\t\t// During hydration, we still have to split merged text from SSR'd HTML.\n\t\tif (oldProps !== newProps && (!isHydrating || dom.data !== newProps)) {\n\t\t\tdom.data = newProps;\n\t\t}\n\t} else {\n\t\t// If excessDomChildren was not null, repopulate it with the current element's children:\n\t\texcessDomChildren = excessDomChildren && slice.call(dom.childNodes);\n\n\t\toldProps = oldVNode.props || EMPTY_OBJ;\n\n\t\t// If we are in a situation where we are not hydrating but are using\n\t\t// existing DOM (e.g. replaceNode) we should read the existing DOM\n\t\t// attributes to diff them\n\t\tif (!isHydrating && excessDomChildren != null) {\n\t\t\toldProps = {};\n\t\t\tfor (i = 0; i < dom.attributes.length; i++) {\n\t\t\t\tvalue = dom.attributes[i];\n\t\t\t\toldProps[value.name] = value.value;\n\t\t\t}\n\t\t}\n\n\t\tfor (i in oldProps) {\n\t\t\tvalue = oldProps[i];\n\t\t\tif (i == 'children') {\n\t\t\t} else if (i == 'dangerouslySetInnerHTML') {\n\t\t\t\toldHtml = value;\n\t\t\t} else if (i !== 'key' && !(i in newProps)) {\n\t\t\t\tsetProperty(dom, i, null, value, isSvg);\n\t\t\t}\n\t\t}\n\n\t\t// During hydration, props are not diffed at all (including dangerouslySetInnerHTML)\n\t\t// @TODO we should warn in debug mode when props don't match here.\n\t\tfor (i in newProps) {\n\t\t\tvalue = newProps[i];\n\t\t\tif (i == 'children') {\n\t\t\t\tnewChildren = value;\n\t\t\t} else if (i == 'dangerouslySetInnerHTML') {\n\t\t\t\tnewHtml = value;\n\t\t\t} else if (i == 'value') {\n\t\t\t\tinputValue = value;\n\t\t\t} else if (i == 'checked') {\n\t\t\t\tchecked = value;\n\t\t\t} else if (\n\t\t\t\ti !== 'key' &&\n\t\t\t\t(!isHydrating || typeof value == 'function') &&\n\t\t\t\toldProps[i] !== value\n\t\t\t) {\n\t\t\t\tsetProperty(dom, i, value, oldProps[i], isSvg);\n\t\t\t}\n\t\t}\n\n\t\t// If the new vnode didn't have dangerouslySetInnerHTML, diff its children\n\t\tif (newHtml) {\n\t\t\t// Avoid re-applying the same '__html' if it did not changed between re-render\n\t\t\tif (\n\t\t\t\t!isHydrating &&\n\t\t\t\t(!oldHtml ||\n\t\t\t\t\t(newHtml.__html !== oldHtml.__html &&\n\t\t\t\t\t\tnewHtml.__html !== dom.innerHTML))\n\t\t\t) {\n\t\t\t\tdom.innerHTML = newHtml.__html;\n\t\t\t}\n\n\t\t\tnewVNode._children = [];\n\t\t} else {\n\t\t\tif (oldHtml) dom.innerHTML = '';\n\n\t\t\tdiffChildren(\n\t\t\t\tdom,\n\t\t\t\tisArray(newChildren) ? newChildren : [newChildren],\n\t\t\t\tnewVNode,\n\t\t\t\toldVNode,\n\t\t\t\tglobalContext,\n\t\t\t\tisSvg && nodeType !== 'foreignObject',\n\t\t\t\texcessDomChildren,\n\t\t\t\tcommitQueue,\n\t\t\t\texcessDomChildren\n\t\t\t\t\t? excessDomChildren[0]\n\t\t\t\t\t: oldVNode._children && getDomSibling(oldVNode, 0),\n\t\t\t\tisHydrating,\n\t\t\t\trefQueue\n\t\t\t);\n\n\t\t\t// Remove children that are not part of any vnode.\n\t\t\tif (excessDomChildren != null) {\n\t\t\t\tfor (i = excessDomChildren.length; i--; ) {\n\t\t\t\t\tif (excessDomChildren[i] != null) removeNode(excessDomChildren[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// As above, don't diff props during hydration\n\t\tif (!isHydrating) {\n\t\t\ti = 'value';\n\t\t\tif (\n\t\t\t\tinputValue !== undefined &&\n\t\t\t\t// #2756 For the <progress>-element the initial value is 0,\n\t\t\t\t// despite the attribute not being present. When the attribute\n\t\t\t\t// is missing the progress bar is treated as indeterminate.\n\t\t\t\t// To fix that we'll always update it when it is 0 for progress elements\n\t\t\t\t(inputValue !== dom[i] ||\n\t\t\t\t\t(nodeType === 'progress' && !inputValue) ||\n\t\t\t\t\t// This is only for IE 11 to fix <select> value not being updated.\n\t\t\t\t\t// To avoid a stale select value we need to set the option.value\n\t\t\t\t\t// again, which triggers IE11 to re-evaluate the select value\n\t\t\t\t\t(nodeType === 'option' && inputValue !== oldProps[i]))\n\t\t\t) {\n\t\t\t\tsetProperty(dom, i, inputValue, oldProps[i], false);\n\t\t\t}\n\n\t\t\ti = 'checked';\n\t\t\tif (checked !== undefined && checked !== dom[i]) {\n\t\t\t\tsetProperty(dom, i, checked, oldProps[i], false);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn dom;\n}\n\n/**\n * Invoke or update a ref, depending on whether it is a function or object ref.\n * @param {Ref<any>} ref\n * @param {any} value\n * @param {VNode} vnode\n */\nexport function applyRef(ref, value, vnode) {\n\ttry {\n\t\tif (typeof ref == 'function') ref(value);\n\t\telse ref.current = value;\n\t} catch (e) {\n\t\toptions._catchError(e, vnode);\n\t}\n}\n\n/**\n * Unmount a virtual node from the tree and apply DOM changes\n * @param {VNode} vnode The virtual node to unmount\n * @param {VNode} parentVNode The parent of the VNode that initiated the unmount\n * @param {boolean} [skipRemove] Flag that indicates that a parent node of the\n * current element is already detached from the DOM.\n */\nexport function unmount(vnode, parentVNode, skipRemove) {\n\tlet r;\n\tif (options.unmount) options.unmount(vnode);\n\n\tif ((r = vnode.ref)) {\n\t\tif (!r.current || r.current === vnode._dom) {\n\t\t\tapplyRef(r, null, parentVNode);\n\t\t}\n\t}\n\n\tif ((r = vnode._component) != null) {\n\t\tif (r.componentWillUnmount) {\n\t\t\ttry {\n\t\t\t\tr.componentWillUnmount();\n\t\t\t} catch (e) {\n\t\t\t\toptions._catchError(e, parentVNode);\n\t\t\t}\n\t\t}\n\n\t\tr.base = r._parentDom = null;\n\t\tvnode._component = undefined;\n\t}\n\n\tif ((r = vnode._children)) {\n\t\tfor (let i = 0; i < r.length; i++) {\n\t\t\tif (r[i]) {\n\t\t\t\tunmount(\n\t\t\t\t\tr[i],\n\t\t\t\t\tparentVNode,\n\t\t\t\t\tskipRemove || typeof vnode.type !== 'function'\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\tif (!skipRemove && vnode._dom != null) {\n\t\tremoveNode(vnode._dom);\n\t}\n\n\t// Must be set to `undefined` to properly clean up `_nextDom`\n\t// for which `null` is a valid value. See comment in `create-element.js`\n\tvnode._parent = vnode._dom = vnode._nextDom = undefined;\n}\n\n/** The `.render()` method for a PFC backing instance. */\nfunction doRender(props, state, context) {\n\treturn this.constructor(props, context);\n}\n", "import { EMPTY_OBJ } from './constants';\nimport { commitRoot, diff } from './diff/index';\nimport { createElement, Fragment } from './create-element';\nimport options from './options';\nimport { slice } from './util';\n\n/**\n * Render a Preact virtual node into a DOM element\n * @param {ComponentChild} vnode The virtual node to render\n * @param {PreactElement} parentDom The DOM element to render into\n * @param {PreactElement | object} [replaceNode] Optional: Attempt to re-use an\n * existing DOM tree rooted at `replaceNode`\n */\nexport function render(vnode, parentDom, replaceNode) {\n\tif (options._root) options._root(vnode, parentDom);\n\n\t// We abuse the `replaceNode` parameter in `hydrate()` to signal if we are in\n\t// hydration mode or not by passing the `hydrate` function instead of a DOM\n\t// element..\n\tlet isHydrating = typeof replaceNode == 'function';\n\n\t// To be able to support calling `render()` multiple times on the same\n\t// DOM node, we need to obtain a reference to the previous tree. We do\n\t// this by assigning a new `_children` property to DOM nodes which points\n\t// to the last rendered tree. By default this property is not present, which\n\t// means that we are mounting a new tree for the first time.\n\tlet oldVNode = isHydrating\n\t\t? null\n\t\t: (replaceNode && replaceNode._children) || parentDom._children;\n\n\tvnode = ((!isHydrating && replaceNode) || parentDom)._children =\n\t\tcreateElement(Fragment, null, [vnode]);\n\n\t// List of effects that need to be called after diffing.\n\tlet commitQueue = [],\n\t\trefQueue = [];\n\tdiff(\n\t\tparentDom,\n\t\t// Determine the new vnode tree and store it on the DOM element on\n\t\t// our custom `_children` property.\n\t\tvnode,\n\t\toldVNode || EMPTY_OBJ,\n\t\tEMPTY_OBJ,\n\t\tparentDom.ownerSVGElement !== undefined,\n\t\t!isHydrating && replaceNode\n\t\t\t? [replaceNode]\n\t\t\t: oldVNode\n\t\t\t? null\n\t\t\t: parentDom.firstChild\n\t\t\t? slice.call(parentDom.childNodes)\n\t\t\t: null,\n\t\tcommitQueue,\n\t\t!isHydrating && replaceNode\n\t\t\t? replaceNode\n\t\t\t: oldVNode\n\t\t\t? oldVNode._dom\n\t\t\t: parentDom.firstChild,\n\t\tisHydrating,\n\t\trefQueue\n\t);\n\n\t// Flush all queued effects\n\tcommitRoot(commitQueue, vnode, refQueue);\n}\n\n/**\n * Update an existing DOM element with data from a Preact virtual node\n * @param {ComponentChild} vnode The virtual node to render\n * @param {PreactElement} parentDom The DOM element to update\n */\nexport function hydrate(vnode, parentDom) {\n\trender(vnode, parentDom, hydrate);\n}\n", "import { assign, slice } from './util';\nimport { createVNode } from './create-element';\n\n/**\n * Clones the given VNode, optionally adding attributes/props and replacing its\n * children.\n * @param {VNode} vnode The virtual DOM element to clone\n * @param {object} props Attributes/props to add when cloning\n * @param {Array<ComponentChildren>} rest Any additional arguments will be used\n * as replacement children.\n * @returns {VNode}\n */\nexport function cloneElement(vnode, props, children) {\n\tlet normalizedProps = assign({}, vnode.props),\n\t\tkey,\n\t\tref,\n\t\ti;\n\n\tlet defaultProps;\n\n\tif (vnode.type && vnode.type.defaultProps) {\n\t\tdefaultProps = vnode.type.defaultProps;\n\t}\n\n\tfor (i in props) {\n\t\tif (i == 'key') key = props[i];\n\t\telse if (i == 'ref') ref = props[i];\n\t\telse if (props[i] === undefined && defaultProps !== undefined) {\n\t\t\tnormalizedProps[i] = defaultProps[i];\n\t\t} else {\n\t\t\tnormalizedProps[i] = props[i];\n\t\t}\n\t}\n\n\tif (arguments.length > 2) {\n\t\tnormalizedProps.children =\n\t\t\targuments.length > 3 ? slice.call(arguments, 2) : children;\n\t}\n\n\treturn createVNode(\n\t\tvnode.type,\n\t\tnormalizedProps,\n\t\tkey || vnode.key,\n\t\tref || vnode.ref,\n\t\tnull\n\t);\n}\n", "/**\n * Find the closest error boundary to a thrown error and call it\n * @param {object} error The thrown value\n * @param {VNode} vnode The vnode that threw the error that was caught (except\n * for unmounting when this parameter is the highest parent that was being\n * unmounted)\n * @param {VNode} [oldVNode]\n * @param {ErrorInfo} [errorInfo]\n */\nexport function _catchError(error, vnode, oldVNode, errorInfo) {\n\t/** @type {Component} */\n\tlet component,\n\t\t/** @type {ComponentType} */\n\t\tctor,\n\t\t/** @type {boolean} */\n\t\thandled;\n\n\tfor (; (vnode = vnode._parent); ) {\n\t\tif ((component = vnode._component) && !component._processingException) {\n\t\t\ttry {\n\t\t\t\tctor = component.constructor;\n\n\t\t\t\tif (ctor && ctor.getDerivedStateFromError != null) {\n\t\t\t\t\tcomponent.setState(ctor.getDerivedStateFromError(error));\n\t\t\t\t\thandled = component._dirty;\n\t\t\t\t}\n\n\t\t\t\tif (component.componentDidCatch != null) {\n\t\t\t\t\tcomponent.componentDidCatch(error, errorInfo || {});\n\t\t\t\t\thandled = component._dirty;\n\t\t\t\t}\n\n\t\t\t\t// This is an error boundary. Mark it as having bailed out, and whether it was mid-hydration.\n\t\t\t\tif (handled) {\n\t\t\t\t\treturn (component._pendingError = component);\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\terror = e;\n\t\t\t}\n\t\t}\n\t}\n\n\tthrow error;\n}\n", "import { options } from 'preact';\n\n/** @type {number} */\nlet currentIndex;\n\n/** @type {import('./internal').Component} */\nlet currentComponent;\n\n/** @type {import('./internal').Component} */\nlet previousComponent;\n\n/** @type {number} */\nlet currentHook = 0;\n\n/** @type {Array<import('./internal').Component>} */\nlet afterPaintEffects = [];\n\nlet EMPTY = [];\n\nlet oldBeforeDiff = options._diff;\nlet oldBeforeRender = options._render;\nlet oldAfterDiff = options.diffed;\nlet oldCommit = options._commit;\nlet oldBeforeUnmount = options.unmount;\n\nconst RAF_TIMEOUT = 100;\nlet prevRaf;\n\noptions._diff = vnode => {\n\tcurrentComponent = null;\n\tif (oldBeforeDiff) oldBeforeDiff(vnode);\n};\n\noptions._render = vnode => {\n\tif (oldBeforeRender) oldBeforeRender(vnode);\n\n\tcurrentComponent = vnode._component;\n\tcurrentIndex = 0;\n\n\tconst hooks = currentComponent.__hooks;\n\tif (hooks) {\n\t\tif (previousComponent === currentComponent) {\n\t\t\thooks._pendingEffects = [];\n\t\t\tcurrentComponent._renderCallbacks = [];\n\t\t\thooks._list.forEach(hookItem => {\n\t\t\t\tif (hookItem._nextValue) {\n\t\t\t\t\thookItem._value = hookItem._nextValue;\n\t\t\t\t}\n\t\t\t\thookItem._pendingValue = EMPTY;\n\t\t\t\thookItem._nextValue = hookItem._pendingArgs = undefined;\n\t\t\t});\n\t\t} else {\n\t\t\thooks._pendingEffects.forEach(invokeCleanup);\n\t\t\thooks._pendingEffects.forEach(invokeEffect);\n\t\t\thooks._pendingEffects = [];\n\t\t\tcurrentIndex = 0;\n\t\t}\n\t}\n\tpreviousComponent = currentComponent;\n};\n\noptions.diffed = vnode => {\n\tif (oldAfterDiff) oldAfterDiff(vnode);\n\n\tconst c = vnode._component;\n\tif (c && c.__hooks) {\n\t\tif (c.__hooks._pendingEffects.length) afterPaint(afterPaintEffects.push(c));\n\t\tc.__hooks._list.forEach(hookItem => {\n\t\t\tif (hookItem._pendingArgs) {\n\t\t\t\thookItem._args = hookItem._pendingArgs;\n\t\t\t}\n\t\t\tif (hookItem._pendingValue !== EMPTY) {\n\t\t\t\thookItem._value = hookItem._pendingValue;\n\t\t\t}\n\t\t\thookItem._pendingArgs = undefined;\n\t\t\thookItem._pendingValue = EMPTY;\n\t\t});\n\t}\n\tpreviousComponent = currentComponent = null;\n};\n\noptions._commit = (vnode, commitQueue) => {\n\tcommitQueue.some(component => {\n\t\ttry {\n\t\t\tcomponent._renderCallbacks.forEach(invokeCleanup);\n\t\t\tcomponent._renderCallbacks = component._renderCallbacks.filter(cb =>\n\t\t\t\tcb._value ? invokeEffect(cb) : true\n\t\t\t);\n\t\t} catch (e) {\n\t\t\tcommitQueue.some(c => {\n\t\t\t\tif (c._renderCallbacks) c._renderCallbacks = [];\n\t\t\t});\n\t\t\tcommitQueue = [];\n\t\t\toptions._catchError(e, component._vnode);\n\t\t}\n\t});\n\n\tif (oldCommit) oldCommit(vnode, commitQueue);\n};\n\noptions.unmount = vnode => {\n\tif (oldBeforeUnmount) oldBeforeUnmount(vnode);\n\n\tconst c = vnode._component;\n\tif (c && c.__hooks) {\n\t\tlet hasErrored;\n\t\tc.__hooks._list.forEach(s => {\n\t\t\ttry {\n\t\t\t\tinvokeCleanup(s);\n\t\t\t} catch (e) {\n\t\t\t\thasErrored = e;\n\t\t\t}\n\t\t});\n\t\tc.__hooks = undefined;\n\t\tif (hasErrored) options._catchError(hasErrored, c._vnode);\n\t}\n};\n\n/**\n * Get a hook's state from the currentComponent\n * @param {number} index The index of the hook to get\n * @param {number} type The index of the hook to get\n * @returns {any}\n */\nfunction getHookState(index, type) {\n\tif (options._hook) {\n\t\toptions._hook(currentComponent, index, currentHook || type);\n\t}\n\tcurrentHook = 0;\n\n\t// Largely inspired by:\n\t// * https://github.com/michael-klein/funcy.js/blob/f6be73468e6ec46b0ff5aa3cc4c9baf72a29025a/src/hooks/core_hooks.mjs\n\t// * https://github.com/michael-klein/funcy.js/blob/650beaa58c43c33a74820a3c98b3c7079cf2e333/src/renderer.mjs\n\t// Other implementations to look at:\n\t// * https://codesandbox.io/s/mnox05qp8\n\tconst hooks =\n\t\tcurrentComponent.__hooks ||\n\t\t(currentComponent.__hooks = {\n\t\t\t_list: [],\n\t\t\t_pendingEffects: []\n\t\t});\n\n\tif (index >= hooks._list.length) {\n\t\thooks._list.push({ _pendingValue: EMPTY });\n\t}\n\treturn hooks._list[index];\n}\n\n/**\n * @param {import('./index').StateUpdater<any>} [initialState]\n */\nexport function useState(initialState) {\n\tcurrentHook = 1;\n\treturn useReducer(invokeOrReturn, initialState);\n}\n\n/**\n * @param {import('./index').Reducer<any, any>} reducer\n * @param {import('./index').StateUpdater<any>} initialState\n * @param {(initialState: any) => void} [init]\n * @returns {[ any, (state: any) => void ]}\n */\nexport function useReducer(reducer, initialState, init) {\n\t/** @type {import('./internal').ReducerHookState} */\n\tconst hookState = getHookState(currentIndex++, 2);\n\thookState._reducer = reducer;\n\tif (!hookState._component) {\n\t\thookState._value = [\n\t\t\t!init ? invokeOrReturn(undefined, initialState) : init(initialState),\n\n\t\t\taction => {\n\t\t\t\tconst currentValue = hookState._nextValue\n\t\t\t\t\t? hookState._nextValue[0]\n\t\t\t\t\t: hookState._value[0];\n\t\t\t\tconst nextValue = hookState._reducer(currentValue, action);\n\n\t\t\t\tif (currentValue !== nextValue) {\n\t\t\t\t\thookState._nextValue = [nextValue, hookState._value[1]];\n\t\t\t\t\thookState._component.setState({});\n\t\t\t\t}\n\t\t\t}\n\t\t];\n\n\t\thookState._component = currentComponent;\n\n\t\tif (!currentComponent._hasScuFromHooks) {\n\t\t\tcurrentComponent._hasScuFromHooks = true;\n\t\t\tlet prevScu = currentComponent.shouldComponentUpdate;\n\t\t\tconst prevCWU = currentComponent.componentWillUpdate;\n\n\t\t\t// If we're dealing with a forced update `shouldComponentUpdate` will\n\t\t\t// not be called. But we use that to update the hook values, so we\n\t\t\t// need to call it.\n\t\t\tcurrentComponent.componentWillUpdate = function (p, s, c) {\n\t\t\t\tif (this._force) {\n\t\t\t\t\tlet tmp = prevScu;\n\t\t\t\t\t// Clear to avoid other sCU hooks from being called\n\t\t\t\t\tprevScu = undefined;\n\t\t\t\t\tupdateHookState(p, s, c);\n\t\t\t\t\tprevScu = tmp;\n\t\t\t\t}\n\n\t\t\t\tif (prevCWU) prevCWU.call(this, p, s, c);\n\t\t\t};\n\n\t\t\t// This SCU has the purpose of bailing out after repeated updates\n\t\t\t// to stateful hooks.\n\t\t\t// we store the next value in _nextValue[0] and keep doing that for all\n\t\t\t// state setters, if we have next states and\n\t\t\t// all next states within a component end up being equal to their original state\n\t\t\t// we are safe to bail out for this specific component.\n\t\t\t/**\n\t\t\t *\n\t\t\t * @type {import('./internal').Component[\"shouldComponentUpdate\"]}\n\t\t\t */\n\t\t\t// @ts-ignore - We don't use TS to downtranspile\n\t\t\t// eslint-disable-next-line no-inner-declarations\n\t\t\tfunction updateHookState(p, s, c) {\n\t\t\t\tif (!hookState._component.__hooks) return true;\n\n\t\t\t\tconst stateHooks = hookState._component.__hooks._list.filter(\n\t\t\t\t\tx => x._component\n\t\t\t\t);\n\t\t\t\tconst allHooksEmpty = stateHooks.every(x => !x._nextValue);\n\t\t\t\t// When we have no updated hooks in the component we invoke the previous SCU or\n\t\t\t\t// traverse the VDOM tree further.\n\t\t\t\tif (allHooksEmpty) {\n\t\t\t\t\treturn prevScu ? prevScu.call(this, p, s, c) : true;\n\t\t\t\t}\n\n\t\t\t\t// We check whether we have components with a nextValue set that\n\t\t\t\t// have values that aren't equal to one another this pushes\n\t\t\t\t// us to update further down the tree\n\t\t\t\tlet shouldUpdate = false;\n\t\t\t\tstateHooks.forEach(hookItem => {\n\t\t\t\t\tif (hookItem._nextValue) {\n\t\t\t\t\t\tconst currentValue = hookItem._value[0];\n\t\t\t\t\t\thookItem._value = hookItem._nextValue;\n\t\t\t\t\t\thookItem._nextValue = undefined;\n\t\t\t\t\t\tif (currentValue !== hookItem._value[0]) shouldUpdate = true;\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\treturn shouldUpdate || hookState._component.props !== p\n\t\t\t\t\t? prevScu\n\t\t\t\t\t\t? prevScu.call(this, p, s, c)\n\t\t\t\t\t\t: true\n\t\t\t\t\t: false;\n\t\t\t}\n\n\t\t\tcurrentComponent.shouldComponentUpdate = updateHookState;\n\t\t}\n\t}\n\n\treturn hookState._nextValue || hookState._value;\n}\n\n/**\n * @param {import('./internal').Effect} callback\n * @param {any[]} args\n */\nexport function useEffect(callback, args) {\n\t/** @type {import('./internal').EffectHookState} */\n\tconst state = getHookState(currentIndex++, 3);\n\tif (!options._skipEffects && argsChanged(state._args, args)) {\n\t\tstate._value = callback;\n\t\tstate._pendingArgs = args;\n\n\t\tcurrentComponent.__hooks._pendingEffects.push(state);\n\t}\n}\n\n/**\n * @param {import('./internal').Effect} callback\n * @param {any[]} args\n */\nexport function useLayoutEffect(callback, args) {\n\t/** @type {import('./internal').EffectHookState} */\n\tconst state = getHookState(currentIndex++, 4);\n\tif (!options._skipEffects && argsChanged(state._args, args)) {\n\t\tstate._value = callback;\n\t\tstate._pendingArgs = args;\n\n\t\tcurrentComponent._renderCallbacks.push(state);\n\t}\n}\n\nexport function useRef(initialValue) {\n\tcurrentHook = 5;\n\treturn useMemo(() => ({ current: initialValue }), []);\n}\n\n/**\n * @param {object} ref\n * @param {() => object} createHandle\n * @param {any[]} args\n */\nexport function useImperativeHandle(ref, createHandle, args) {\n\tcurrentHook = 6;\n\tuseLayoutEffect(\n\t\t() => {\n\t\t\tif (typeof ref == 'function') {\n\t\t\t\tref(createHandle());\n\t\t\t\treturn () => ref(null);\n\t\t\t} else if (ref) {\n\t\t\t\tref.current = createHandle();\n\t\t\t\treturn () => (ref.current = null);\n\t\t\t}\n\t\t},\n\t\targs == null ? args : args.concat(ref)\n\t);\n}\n\n/**\n * @param {() => any} factory\n * @param {any[]} args\n */\nexport function useMemo(factory, args) {\n\t/** @type {import('./internal').MemoHookState} */\n\tconst state = getHookState(currentIndex++, 7);\n\tif (argsChanged(state._args, args)) {\n\t\tstate._pendingValue = factory();\n\t\tstate._pendingArgs = args;\n\t\tstate._factory = factory;\n\t\treturn state._pendingValue;\n\t}\n\n\treturn state._value;\n}\n\n/**\n * @param {() => void} callback\n * @param {any[]} args\n */\nexport function useCallback(callback, args) {\n\tcurrentHook = 8;\n\treturn useMemo(() => callback, args);\n}\n\n/**\n * @param {import('./internal').PreactContext} context\n */\nexport function useContext(context) {\n\tconst provider = currentComponent.context[context._id];\n\t// We could skip this call here, but than we'd not call\n\t// `options._hook`. We need to do that in order to make\n\t// the devtools aware of this hook.\n\t/** @type {import('./internal').ContextHookState} */\n\tconst state = getHookState(currentIndex++, 9);\n\t// The devtools needs access to the context object to\n\t// be able to pull of the default value when no provider\n\t// is present in the tree.\n\tstate._context = context;\n\tif (!provider) return context._defaultValue;\n\t// This is probably not safe to convert to \"!\"\n\tif (state._value == null) {\n\t\tstate._value = true;\n\t\tprovider.sub(currentComponent);\n\t}\n\treturn provider.props.value;\n}\n\n/**\n * Display a custom label for a custom hook for the devtools panel\n * @type {<T>(value: T, cb?: (value: T) => string | number) => void}\n */\nexport function useDebugValue(value, formatter) {\n\tif (options.useDebugValue) {\n\t\toptions.useDebugValue(formatter ? formatter(value) : value);\n\t}\n}\n\n/**\n * @param {(error: any, errorInfo: import('preact').ErrorInfo) => void} cb\n */\nexport function useErrorBoundary(cb) {\n\t/** @type {import('./internal').ErrorBoundaryHookState} */\n\tconst state = getHookState(currentIndex++, 10);\n\tconst errState = useState();\n\tstate._value = cb;\n\tif (!currentComponent.componentDidCatch) {\n\t\tcurrentComponent.componentDidCatch = (err, errorInfo) => {\n\t\t\tif (state._value) state._value(err, errorInfo);\n\t\t\terrState[1](err);\n\t\t};\n\t}\n\treturn [\n\t\terrState[0],\n\t\t() => {\n\t\t\terrState[1](undefined);\n\t\t}\n\t];\n}\n\nexport function useId() {\n\tconst state = getHookState(currentIndex++, 11);\n\tif (!state._value) {\n\t\t// Grab either the root node or the nearest async boundary node.\n\t\t/** @type {import('./internal.d').VNode} */\n\t\tlet root = currentComponent._vnode;\n\t\twhile (root !== null && !root._mask && root._parent !== null) {\n\t\t\troot = root._parent;\n\t\t}\n\n\t\tlet mask = root._mask || (root._mask = [0, 0]);\n\t\tstate._value = 'P' + mask[0] + '-' + mask[1]++;\n\t}\n\n\treturn state._value;\n}\n/**\n * After paint effects consumer.\n */\nfunction flushAfterPaintEffects() {\n\tlet component;\n\twhile ((component = afterPaintEffects.shift())) {\n\t\tif (!component._parentDom || !component.__hooks) continue;\n\t\ttry {\n\t\t\tcomponent.__hooks._pendingEffects.forEach(invokeCleanup);\n\t\t\tcomponent.__hooks._pendingEffects.forEach(invokeEffect);\n\t\t\tcomponent.__hooks._pendingEffects = [];\n\t\t} catch (e) {\n\t\t\tcomponent.__hooks._pendingEffects = [];\n\t\t\toptions._catchError(e, component._vnode);\n\t\t}\n\t}\n}\n\nlet HAS_RAF = typeof requestAnimationFrame == 'function';\n\n/**\n * Schedule a callback to be invoked after the browser has a chance to paint a new frame.\n * Do this by combining requestAnimationFrame (rAF) + setTimeout to invoke a callback after\n * the next browser frame.\n *\n * Also, schedule a timeout in parallel to the the rAF to ensure the callback is invoked\n * even if RAF doesn't fire (for example if the browser tab is not visible)\n *\n * @param {() => void} callback\n */\nfunction afterNextFrame(callback) {\n\tconst done = () => {\n\t\tclearTimeout(timeout);\n\t\tif (HAS_RAF) cancelAnimationFrame(raf);\n\t\tsetTimeout(callback);\n\t};\n\tconst timeout = setTimeout(done, RAF_TIMEOUT);\n\n\tlet raf;\n\tif (HAS_RAF) {\n\t\traf = requestAnimationFrame(done);\n\t}\n}\n\n// Note: if someone used options.debounceRendering = requestAnimationFrame,\n// then effects will ALWAYS run on the NEXT frame instead of the current one, incurring a ~16ms delay.\n// Perhaps this is not such a big deal.\n/**\n * Schedule afterPaintEffects flush after the browser paints\n * @param {number} newQueueLength\n */\nfunction afterPaint(newQueueLength) {\n\tif (newQueueLength === 1 || prevRaf !== options.requestAnimationFrame) {\n\t\tprevRaf = options.requestAnimationFrame;\n\t\t(prevRaf || afterNextFrame)(flushAfterPaintEffects);\n\t}\n}\n\n/**\n * @param {import('./internal').EffectHookState} hook\n */\nfunction invokeCleanup(hook) {\n\t// A hook cleanup can introduce a call to render which creates a new root, this will call options.vnode\n\t// and move the currentComponent away.\n\tconst comp = currentComponent;\n\tlet cleanup = hook._cleanup;\n\tif (typeof cleanup == 'function') {\n\t\thook._cleanup = undefined;\n\t\tcleanup();\n\t}\n\n\tcurrentComponent = comp;\n}\n\n/**\n * Invoke a Hook's effect\n * @param {import('./internal').EffectHookState} hook\n */\nfunction invokeEffect(hook) {\n\t// A hook call can introduce a call to render which creates a new root, this will call options.vnode\n\t// and move the currentComponent away.\n\tconst comp = currentComponent;\n\thook._cleanup = hook._value();\n\tcurrentComponent = comp;\n}\n\n/**\n * @param {any[]} oldArgs\n * @param {any[]} newArgs\n */\nfunction argsChanged(oldArgs, newArgs) {\n\treturn (\n\t\t!oldArgs ||\n\t\toldArgs.length !== newArgs.length ||\n\t\tnewArgs.some((arg, index) => arg !== oldArgs[index])\n\t);\n}\n\nfunction invokeOrReturn(arg, f) {\n\treturn typeof f == 'function' ? f(arg) : f;\n}\n", "function toVal(mix) {\n\tvar k, y, str='';\n\tif (mix) {\n\t\tif (typeof mix === 'object') {\n\t\t\tif (!!mix.push) {\n\t\t\t\tfor (k=0; k < mix.length; k++) {\n\t\t\t\t\tif (mix[k] && (y = toVal(mix[k]))) {\n\t\t\t\t\t\tstr && (str += ' ');\n\t\t\t\t\t\tstr += y;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfor (k in mix) {\n\t\t\t\t\tif (mix[k] && (y = toVal(k))) {\n\t\t\t\t\t\tstr && (str += ' ');\n\t\t\t\t\t\tstr += y;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (typeof mix !== 'boolean' && !mix.call) {\n\t\t\tstr && (str += ' ');\n\t\t\tstr += mix;\n\t\t}\n\t}\n\treturn str;\n}\n\nexport default function () {\n\tvar i=0, x, str='';\n\twhile (i < arguments.length) {\n\t\tif (x = toVal(arguments[i++])) {\n\t\t\tstr && (str += ' ');\n\t\t\tstr += x\n\t\t}\n\t}\n\treturn str;\n}\n", "/**\n * @license Copyright 2019 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport {h} from 'preact';\nimport clsx from 'clsx';\nimport './loading-spinner.css';\n\n// @ts-ignore - tsc doesn't understand bundlers :)\nconst SVG_PATH = require('./loading-spinner.svg');\n\nconst LoadingSpinner_ = () => {\n return <img src={SVG_PATH} alt=\"Loading spinner\" />;\n};\n\n/** @param {{solo?: boolean}} props */\nexport const LoadingSpinner = props => {\n return (\n <div\n className={clsx('loading-spinner', {\n 'loading-spinner--container': !props.solo,\n })}\n >\n <LoadingSpinner_ />\n </div>\n );\n};\n", "/**\n * @license Copyright 2019 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport {h} from 'preact';\nimport clsx from 'clsx';\nimport './paper.css';\n\n/** @param {{children: string|JSX.Element|JSX.Element[], className?: string, key?: any}} props */\nexport const Paper = props => {\n const {children} = props;\n return <div className={clsx('paper', props.className)}>{children}</div>;\n};\n", "/**\n * @license Copyright 2019 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.\n */\n\n/**\n * @fileoverview\n *\n * Contains all of the hooks for consuming API data throughout the app.\n * The shape of the return object for all hooks is the below tuple:\n *\n * `[loadingState, data]: [LoadingState, TData | undefined]`\n *\n * Conventions:\n *\n * 1. `loadingState === 'loaded'` if and only if `data !== undefined`.\n * Hooks that violate this convention automatically redirect to the project selector via\n * logic in `async-loader.jsx`.\n * 2. A request is sent if and only if all of a hook's parameters are defined\n * (i.e. `arguments.every(arg => arg !== undefined)`).\n * 3. A request is reissued whenever the parameters have changed.\n */\n\nimport {useState, useEffect, useMemo} from 'preact/hooks';\nimport ApiClient from '@lhci/utils/src/api-client.js';\nimport _ from '@lhci/utils/src/lodash.js';\n\nexport const api = new ApiClient({\n rootURL: window.location.origin,\n URL: window.URL,\n fetch: window.fetch.bind(window),\n});\n\n/** @param {string} projectId @return {string|undefined} */\nfunction getAdminTokenForProject(projectId) {\n return localStorage.getItem(`adminToken__${projectId}`) || undefined;\n}\n\n/** @param {string} projectId @param {string} adminToken */\nfunction setAdminTokenForProject(projectId, adminToken) {\n return localStorage.setItem(`adminToken__${projectId}`, adminToken);\n}\n\n/** @param {string} projectId @return {[string|undefined, (s: string) => void]} */\nexport function useAdminToken(projectId) {\n const adminToken = getAdminTokenForProject(projectId);\n // We only use state to trigger a rerender, not to actually keep track of the data\n const setAdminToken = useState(adminToken)[1];\n\n return [\n adminToken,\n token => {\n setAdminTokenForProject(projectId, token);\n setAdminToken(token);\n },\n ];\n}\n\n/** @typedef {'loading'|'error'|'loaded'} LoadingState */\n\n// We cache the last result to getRuns so repeated requests for a particular LHR aren't repeated.\n// This could be more sophisticated in the future to de-deduplicate requests and be more aggressive.\n// But we don't really need it do be yet, so we'll stay conservative.\n/** @type {Partial<Record<keyof ApiClient, {parameters: any, result: any}>>} */\nconst lastCachedApiData = {\n getRuns: {parameters: undefined, result: undefined},\n};\n\n/**\n * @template {keyof StrictOmit<ApiClient, '_rootURL'|'_URL'|'_extraHeaders'|'_fetch'>} T\n * @param {T} apiMethod\n * @param {Parameters<ApiClient[T]>|undefined} apiParameters\n * @return {[LoadingState, UnPromisify<ReturnType<ApiClient[T]>> | undefined]}\n */\nfunction useApiData(apiMethod, apiParameters) {\n const [loadingState, setLoadingState] = useState(/** @type {LoadingState} */ ('loading'));\n const [apiData, setApiData] = useState(/** @type {any} */ (undefined));\n const cache = lastCachedApiData[apiMethod];\n\n useEffect(() => {\n if (!apiParameters) return;\n\n // Wrap in IIFE because the return value of useEffect should be a cleanup function, not a Promise.\n (async () => {\n try {\n // Use the cached response if the parameters match.\n let response = undefined;\n if (cache && _.isEqual(apiParameters, cache.parameters)) {\n response = cache.result;\n } else {\n // @ts-ignore - tsc can't figure out that apiParameters matches our apiMethod signature\n response = await api[apiMethod](...apiParameters);\n }\n\n setApiData(response);\n setLoadingState('loaded');\n\n // If this is supposed to be cached, stash the result and parameters used.\n if (cache) {\n cache.result = response;\n cache.parameters = apiParameters;\n }\n } catch (err) {\n console.error(err); // eslint-disable-line no-console\n setLoadingState('error');\n }\n })();\n }, apiParameters);\n\n return [loadingState, apiData];\n}\n\n/**\n * @return {[LoadingState, string | undefined]}\n */\nexport function useVersion() {\n return useApiData('getVersion', []);\n}\n\n/**\n * @return {[LoadingState, Array<LHCI.ServerCommand.Project> | undefined]}\n */\nexport function useProjectList() {\n return useApiData('getProjects', []);\n}\n\n/**\n * @param {string|undefined} projectId\n * @return {[LoadingState, LHCI.ServerCommand.Project | undefined]}\n */\nexport function useProject(projectId) {\n return useApiData('findProjectById', projectId ? [projectId] : undefined);\n}\n\n/**\n * @param {string|undefined} projectSlug\n * @return {[LoadingState, LHCI.ServerCommand.Project | undefined]}\n */\nexport function useProjectBySlug(projectSlug) {\n return useApiData('findProjectBySlug', projectSlug ? [projectSlug] : undefined);\n}\n\n/**\n * @param {string|undefined} projectId\n * @return {[LoadingState, Array<LHCI.ServerCommand.Build> | undefined]}\n */\nexport function useProjectBuilds(projectId) {\n const lifecycle = /** @type {'sealed'} */ ('sealed');\n const options = useMemo(() => ({limit: 1000, lifecycle}), []);\n return useApiData('getBuilds', projectId ? [projectId, options] : undefined);\n}\n\n/**\n * @param {string|undefined} projectId\n * @return {[LoadingState, Array<{url: string}> | undefined]}\n */\nexport function useProjectURLs(projectId) {\n return useApiData('getUrls', projectId ? [projectId] : undefined);\n}\n\n/**\n * @param {string|undefined} projectId\n * @return {[LoadingState, Array<{branch: string}> | undefined]}\n */\nexport function useProjectBranches(projectId) {\n return useApiData('getBranches', projectId ? [projectId] : undefined);\n}\n\n/**\n * @param {string|undefined} projectId\n * @param {string|undefined} buildId\n * @return {[LoadingState, LHCI.ServerCommand.Build | undefined]}\n */\nexport function useBuild(projectId, buildId) {\n return useApiData('findBuildById', projectId && buildId ? [projectId, buildId] : undefined);\n}\n\n/**\n * @param {string|undefined} projectId\n * @param {string|null|undefined} buildId\n * @return {[LoadingState, Array<{url: string}> | undefined]}\n */\nexport function useBuildURLs(projectId, buildId) {\n const [loadingState, data] = useApiData(\n 'getUrls',\n projectId && buildId ? [projectId, buildId] : undefined\n );\n\n // If we receive a `null` that means it's explicitly not available, so short-circuit and return empty\n if (buildId === null) return ['loaded', []];\n return [loadingState, data];\n}\n\n/**\n * @param {string} projectId\n * @param {string} branch\n * @param {{limit?: number}} [options]\n * @return {[LoadingState, Array<LHCI.ServerCommand.Build> | undefined]}\n */\nexport function useBranchBuilds(projectId, branch, options = {}) {\n // Construct this options object in a `useMemo` to prevent infinitely re-requesting.\n const getBuildsOptions = useMemo(() => ({branch, limit: options.limit}), [branch, options.limit]);\n return useApiData('getBuilds', [projectId, getBuildsOptions]);\n}\n\n/**\n * @param {string|undefined} projectId\n * @param {string|undefined} buildId\n * @param {string|null|undefined} url\n * @return {[LoadingState, Array<LHCI.ServerCommand.Run> | undefined]}\n */\nexport function useOptionalBuildRepresentativeRuns(projectId, buildId, url) {\n const isUrlDefined = url !== undefined;\n // Construct this options object in a `useMemo` to prevent infinitely re-requesting.\n const getRunsOptions = useMemo(\n () => (url ? {representative: true, url} : {representative: true}),\n [url]\n );\n\n return useApiData(\n 'getRuns',\n projectId && buildId && isUrlDefined ? [projectId, buildId, getRunsOptions] : undefined\n );\n}\n\n/**\n * @param {string|undefined} projectId\n * @param {string|undefined} buildId\n * @return {[LoadingState, LHCI.ServerCommand.Build | null | undefined]}\n */\nexport function useAncestorBuild(projectId, buildId) {\n const [apiLoadingState, build] = useApiData(\n 'findAncestorBuildById',\n projectId && buildId ? [projectId, buildId] : undefined\n );\n\n // If we couldn't find an ancestor build but we tried, consider it loaded with `null` to differentiate from `undefined`.\n if (apiLoadingState === 'loaded' && !build) {\n return ['loaded', null];\n }\n\n return [apiLoadingState, build];\n}\n\n/**\n * @param {string|undefined} projectId\n * @param {string|null|undefined} buildId\n * @return {[LoadingState, LHCI.ServerCommand.Build | null | undefined]}\n */\nexport function useOptionalBuildById(projectId, buildId) {\n const buildData = useApiData(\n 'findBuildById',\n projectId && buildId ? [projectId, buildId] : undefined\n );\n\n // If there was no id to lookup in the first place then it's just loaded.\n if (buildId === null) return ['loaded', null];\n return buildData;\n}\n\n/**\n * @param {string|undefined} projectId\n * @param {string[]|undefined} buildIds\n * @return {[LoadingState, Array<LHCI.ServerCommand.Statistic> | undefined]}\n */\nexport function useBuildStatistics(projectId, buildIds) {\n const [loadingState, setLoadingState] = useState(/** @type {LoadingState} */ ('loading'));\n const [statistics, setStatistics] = useState(\n /** @type {Array<LHCI.ServerCommand.Statistic> | undefined} */ (undefined)\n );\n\n useEffect(() => {\n if (!buildIds || !projectId) return;\n\n // Wrap in IIFE because the return value of useEffect should be a cleanup function, not a Promise.\n (async () => {\n try {\n setStatistics(undefined);\n setLoadingState('loading');\n\n await Promise.all(\n buildIds.map(async buildId => {\n const response = await api.getStatistics(projectId, buildId);\n setStatistics(existing => (existing || []).concat(response));\n })\n );\n\n setStatistics(existing => existing || []);\n setLoadingState('loaded');\n } catch (err) {\n console.error(err); // eslint-disable-line no-console\n setLoadingState('error');\n }\n })();\n }, [projectId, buildIds]);\n\n return [loadingState, statistics];\n}\n\n/**\n * @param {string|undefined} projectId\n * @param {string|undefined} buildId\n * @param {string|undefined} url\n * @return {[LoadingState, LHCI.ServerCommand.Run | null | undefined]}\n */\nexport function useRepresentativeRun(projectId, buildId, url) {\n // Construct this options object in a `useMemo` to prevent infinitely re-requesting.\n const getRunsOptions = useMemo(() => ({url, representative: true}), [url]);\n const [apiLoadingState, runs] = useApiData(\n 'getRuns',\n projectId && buildId && url ? [projectId, buildId, getRunsOptions] : undefined\n );\n\n // If we couldn't find a run but we tried, consider it loaded with `null` to differentiate from `undefined`.\n if (apiLoadingState === 'loaded' && (!runs || runs.length !== 1)) {\n return ['loaded', null];\n }\n\n return [apiLoadingState, runs && runs[0]];\n}\n\n/**\n * @param {LHCI.ServerCommand.Run|null|undefined} run\n * @return {LH.Result|null|undefined}\n */\nexport function useLhr(run) {\n if (!run) return run;\n\n try {\n return JSON.parse(run.lhr);\n } catch (_) {\n return null;\n }\n}\n", "/**\n * @license Copyright 2019 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport {h} from 'preact';\nimport clsx from 'clsx';\nimport {useState} from 'preact/hooks';\nimport {api} from '../hooks/use-api-data';\nimport './lhr-viewer-link.css';\n\n/** @typedef {LH.Result|(() => Promise<LH.Result>)} LHResolver */\n\n/** @param {LH.Result} lhr */\nexport async function openLhrInClassicViewer(lhr) {\n // Allows for self-hosted viewer uri instead of linking externally\n const cliViewerOrigin = (await api.getViewerOrigin()).viewerOrigin || 'https://googlechrome.github.io';\n const VIEWER_ORIGIN = process.env.VIEWER_ORIGIN || cliViewerOrigin;\n // Chrome doesn't allow us to immediately postMessage to a popup right\n // after it's created. Normally, we could also listen for the popup window's\n // load event, however it is cross-domain and won't fire. Instead, listen\n // for a message from the target app saying \"I'm open\".\n window.addEventListener('message', function msgHandler(messageEvent) {\n if (messageEvent.origin !== VIEWER_ORIGIN) {\n return;\n }\n // https://github.com/GoogleChrome/lighthouse/blob/35f1a6f90e9443bdf42179a4c9823e6d4848a9e6/lighthouse-viewer/app/src/lighthouse-report-viewer.js#L415-L418\n if (popup && messageEvent.data.opened) {\n popup.postMessage({lhresults: lhr}, VIEWER_ORIGIN);\n window.removeEventListener('message', msgHandler);\n }\n });\n\n // The popup's window.name is keyed by version+url+fetchTime, so we reuse/select tabs correctly\n const fetchTime = lhr.fetchTime;\n const windowName = `${lhr.lighthouseVersion}-${lhr.requestedUrl}-${fetchTime}`;\n const popup = window.open(`${VIEWER_ORIGIN}/lighthouse/viewer`, windowName);\n}\n\n/** @param {{children: string|JSX.Element|JSX.Element[], lhr: LHResolver, className?: string}} props */\nexport const LhrViewerLink = props => {\n const {children, lhr: lhrOrResolver} = props;\n const [isLoading, setIsLoading] = useState(false);\n\n return (\n <span\n className={clsx('lhr-viewer-link', props.className, {\n 'lhr-viewer-link--loading': isLoading,\n })}\n onClick={async evt => {\n evt.preventDefault();\n evt.stopImmediatePropagation();\n if (isLoading) return;\n\n if (typeof lhrOrResolver === 'object') return openLhrInClassicViewer(lhrOrResolver);\n\n setIsLoading(true);\n const lhr = await lhrOrResolver();\n setIsLoading(false);\n openLhrInClassicViewer(lhr);\n }}\n >\n {children}\n </span>\n );\n};\n", "/**\n * @license Copyright 2019 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport {h} from 'preact';\nimport {LhrViewerLink} from './lhr-viewer-link';\nimport './lhr-viewer-button.css';\n\n// @ts-ignore - ts doesn't know how bundlers work :)\nconst LH_ICON_PATH = require('../favicon.svg');\n\n/** @param {{lhr: import('./lhr-viewer-link').LHResolver, label?: string}} props */\nexport const LhrViewerButton = props => {\n const {lhr, label = 'Open Report'} = props;\n return (\n <LhrViewerLink lhr={lhr}>\n <div className=\"lhr-viewer-button\" role=\"button\">\n <img src={LH_ICON_PATH} /> <span>{label}</span>\n </div>\n </LhrViewerLink>\n );\n};\n", "/**\n * @license Copyright 2020 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport {h} from 'preact';\nexport {LoadingSpinner} from '../../../../server/src/ui/components/loading-spinner.jsx';\nexport {Paper} from '../../../../server/src/ui/components/paper.jsx';\nexport {LhrViewerButton} from '../../../../server/src/ui/components/lhr-viewer-button.jsx';\n\n/** @type {string} */\n// @ts-expect-error - tsc doesn't get parcel :)\nexport const CONFETTI_PATH = require('../../../../server/src/ui/routes/project-list/confetti.svg');\n\n/** @type {string} */\n// @ts-expect-error - tsc doesn't get parcel :)\nexport const LH_LOGO_PATH = require('../../../../server/src/ui/logo.svg');\n", "/**\n * @license Copyright 2020 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport {h, Fragment} from 'preact';\nimport './report-upload-box.css';\nimport {LhrViewerButton} from './lhci-components';\nimport {useState, useEffect, useRef} from 'preact/hooks';\nimport clsx from 'clsx';\n\n/** @typedef {import('../app.jsx').ToastMessage} ToastMessage */\n/** @typedef {import('../app.jsx').ReportData} ReportData */\n/** @typedef {'filename'|'hostname'|'pathname'|'path'|'timestamp-hostname'|'timestamp-pathname'} DisplayType */\n/** @typedef {{variant: 'base'|'compare', displayType: DisplayType, report: ReportData|undefined, setReport: (d: ReportData) => void, addToast: (t: ToastMessage) => void, showOpenLhrLink?: boolean, dragTarget?: 'self' | 'document'}} ReportUploadBoxProps */\n/** @typedef {HTMLElement|undefined} DragData */\n\n/** @param {string} s @return {LH.Result|Error} */\nexport function parseStringAsLhr(s) {\n if (s.includes('<script>window.__LIGHTHOUSE_JSON__ = ')) {\n const match = s.match(/window\\.__LIGHTHOUSE_JSON__ = (.*?});<\\/script>/);\n if (match) s = match[1];\n }\n\n if (s.trim().charAt(0) === '{') {\n try {\n const lhr = JSON.parse(s);\n if (lhr.lighthouseVersion) return lhr;\n return new Error(`JSON did not contain a lighthouseVersion`);\n } catch (err) {\n return new Error(`File was not valid JSON (${err.message})`);\n }\n }\n\n return new Error('File was not a valid report');\n}\n\n/** @param {LH.Result} lhrA @param {LH.Result} lhrB @return {DisplayType} */\nexport function computeBestDisplayType(lhrA, lhrB) {\n const urlA = new URL(lhrA.finalUrl);\n const urlB = new URL(lhrB.finalUrl);\n if (urlA.hostname !== urlB.hostname) return 'hostname';\n if (urlA.pathname !== urlB.pathname) return 'pathname';\n if (urlA.search !== urlB.search) return 'path';\n if (urlA.pathname.length < 5) return 'timestamp-hostname';\n return 'timestamp-pathname';\n}\n\n/** @param {{report: ReportData, displayType: DisplayType}} props */\nconst FilePill = props => {\n const {filename, lhr} = props.report;\n const url = new URL(lhr.finalUrl);\n const timestamp = new Date(lhr.fetchTime).toLocaleString();\n const options = {\n filename,\n hostname: url.hostname,\n pathname: url.pathname,\n path: `${url.pathname}${url.search}`,\n 'timestamp-hostname': `${timestamp} (${url.hostname})`,\n 'timestamp-pathname': `${timestamp} (${url.pathname})`,\n };\n\n const tooltip = `${url.href} at ${timestamp}`;\n return <span title={tooltip}>{options[props.displayType]}</span>;\n};\n\n/** @param {Pick<ReportUploadBoxProps, 'addToast'|'setReport'>} props @param {FileList} fileList */\nfunction handleFileInput(props, fileList) {\n const filename = fileList[0].name;\n const reader = new FileReader();\n reader.readAsText(fileList[0], 'utf-8');\n\n reader.addEventListener('load', () => {\n if (typeof reader.result !== 'string') {\n props.addToast({message: 'File was not readable as text!', level: 'error'});\n return;\n }\n\n const lhr = parseStringAsLhr(reader.result);\n if (lhr instanceof Error) {\n props.addToast({message: `Invalid file: ${lhr.message}`, level: 'error'});\n return;\n }\n\n props.setReport({filename, data: reader.result, lhr});\n });\n\n reader.addEventListener('error', () => {\n props.addToast({message: 'File was not readable!', level: 'error'});\n });\n}\n\n/** @param {ReportUploadBoxProps} props @param {import('preact/hooks').MutableRef<DragData>} dragTargetRef @param {(b: boolean) => void} setIsDragging @param {Event} e */\nfunction handleDragEnter(props, dragTargetRef, setIsDragging, e) {\n if (!(e.target instanceof HTMLElement)) return;\n e.stopPropagation();\n e.preventDefault();\n setIsDragging(true);\n dragTargetRef.current = e.target;\n}\n\n/** @param {ReportUploadBoxProps} props @param {import('preact/hooks').MutableRef<DragData>} dragTargetRef @param {(b: boolean) => void} setIsDragging @param {Event} e */\nfunction handleDragLeave(props, dragTargetRef, setIsDragging, e) {\n if (e.target !== dragTargetRef.current) return;\n e.stopPropagation();\n e.preventDefault();\n setIsDragging(false);\n dragTargetRef.current = undefined;\n}\n\n/** @param {ReportUploadBoxProps} props @param {import('preact/hooks').Ref<DragData>} dragTargetRef @param {(b: boolean) => void} setIsDragging @param {Event} e */\nfunction handleDragOver(props, dragTargetRef, setIsDragging, e) {\n if (!dragTargetRef.current) return;\n e.stopPropagation();\n e.preventDefault();\n}\n\n/** @param {Pick<ReportUploadBoxProps, 'addToast'|'setReport'>} props @param {import('preact/hooks').MutableRef<DragData>} dragTargetRef @param {(b: boolean) => void} setIsDragging @param {Event} e */\nfunction handleDrop(props, dragTargetRef, setIsDragging, e) {\n if (!dragTargetRef.current) return;\n if (!(e instanceof DragEvent)) return;\n if (!e.dataTransfer) return;\n e.stopPropagation();\n e.preventDefault();\n setIsDragging(false);\n dragTargetRef.current = undefined;\n handleFileInput(props, e.dataTransfer.files);\n}\n\n/** @param {ReportUploadBoxProps} props */\nexport const ReportUploadBox = props => {\n const [isDragging, setIsDragging] = useState(false);\n const dragTargetRef = useRef(/** @type {HTMLElement|undefined} */ (undefined));\n\n /** @param {Event} e */\n const onDragEnter = e => handleDragEnter(props, dragTargetRef, setIsDragging, e);\n /** @param {Event} e */\n const onDragLeave = e => handleDragLeave(props, dragTargetRef, setIsDragging, e);\n /** @param {Event} e */\n const onDragOver = e => handleDragOver(props, dragTargetRef, setIsDragging, e);\n /** @param {Event} e */\n const onDrop = e => handleDrop(props, dragTargetRef, setIsDragging, e);\n\n useEffect(() => {\n if (props.dragTarget !== 'document') return;\n\n document.addEventListener('dragenter', onDragEnter);\n document.addEventListener('dragleave', onDragLeave);\n document.addEventListener('dragover', onDragOver);\n document.addEventListener('drop', onDrop);\n\n return () => {\n document.removeEventListener('dragenter', onDragEnter);\n document.removeEventListener('dragleave', onDragLeave);\n document.removeEventListener('dragover', onDragOver);\n document.removeEventListener('drop', onDrop);\n };\n }, [props.dragTarget, props.addToast, props.setReport, dragTargetRef.current]);\n\n return (\n <div\n className={clsx(`report-upload-box report-upload-box--${props.variant}`, {\n 'report-upload-box--drop': isDragging,\n 'report-upload-box--document-target': props.dragTarget === 'document',\n })}\n onDragEnter={onDragEnter}\n onDragLeave={onDragLeave}\n onDragOver={onDragOver}\n onDrop={onDrop}\n >\n <div className=\"report-upload-box__drop-outline\">Drop your report to upload</div>\n <span className=\"report-upload-box__label\">\n {props.variant === 'base' ? 'Base' : 'Compare'}\n </span>\n <div className=\"report-upload-box__file\">\n {props.report ? (\n <FilePill report={props.report} displayType={props.displayType} />\n ) : (\n <Fragment />\n )}\n </div>\n <div className=\"report-upload-box__lhr-link\">\n {props.report && props.showOpenLhrLink ? (\n <LhrViewerButton lhr={props.report.lhr} label=\"View Report\" />\n ) : null}\n </div>\n <div className=\"report-upload-box__spacer\" />\n <label className=\"report-upload-box__upload\">\n Select file\n <input\n type=\"file\"\n style={{display: 'none'}}\n onChange={e => {\n const input = e.target;\n if (!(input instanceof HTMLInputElement)) return;\n const fileList = input.files;\n if (!fileList || fileList.length !== 1) return;\n handleFileInput(props, fileList);\n }}\n />\n </label>\n </div>\n );\n};\n", "/**\n * @license Copyright 2020 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport {h} from 'preact';\nimport './landing.css';\nimport {CONFETTI_PATH, LH_LOGO_PATH, Paper} from '../../components/lhci-components.jsx';\nimport {ReportUploadBox} from '../../components/report-upload-box';\n\n/** @typedef {import('../../app.jsx').ToastMessage} ToastMessage */\n/** @typedef {import('../../app.jsx').ReportData} ReportData */\n\n/** @param {{baseReport?: ReportData, compareReport?: ReportData, setBaseReport: (d: ReportData) => void, setCompareReport: (d: ReportData) => void, addToast: (t: ToastMessage) => void}} props */\nexport const LandingRoute = props => {\n return (\n <div className=\"landing\">\n <div className=\"landing__background\">\n <img src={CONFETTI_PATH} alt=\"Lighthouse CI Background Image\" />\n </div>\n <Paper className=\"landing__paper\">\n <div className=\"landing__logos\">\n <img className=\"landing__logo\" src={LH_LOGO_PATH} alt=\"Lighthouse Logo\" />\n <img className=\"landing__logo landing__logo--diff\" src={LH_LOGO_PATH} alt=\"\" />\n <h1>Lighthouse Report Diff Tool</h1>\n </div>\n <p>Provide two Lighthouse reports to start comparing!</p>\n <p>\n <a href=\"./?baseReport=https://googlechrome.github.io/lighthouse-ci/packages/server/test/fixtures/lh-5-6-0-verge-a.json&compareReport=https://googlechrome.github.io/lighthouse-ci/packages/server/test/fixtures/lh-5-6-0-verge-b.json\">\n View example diff\n </a>\n </p>\n <div className=\"landing__upload\">\n <ReportUploadBox\n variant=\"base\"\n report={props.baseReport}\n setReport={props.setBaseReport}\n addToast={props.addToast}\n displayType=\"filename\"\n dragTarget={props.baseReport ? 'self' : 'document'}\n />\n <ReportUploadBox\n variant=\"compare\"\n report={props.compareReport}\n setReport={props.setCompareReport}\n addToast={props.addToast}\n displayType=\"filename\"\n dragTarget={props.baseReport ? 'document' : 'self'}\n />\n </div>\n <p>Above, drag &apos;n drop your JSON/HTML, or select the files from disk.</p>\n\n <footer>\n Powered by <a href=\"https://github.com/GoogleChrome/lighthouse-ci\">lighthouse-ci</a>\n </footer>\n </Paper>\n </div>\n );\n};\n", "/**\n * @license Copyright 2020 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport {h, Fragment} from 'preact';\nimport {useState, useEffect} from 'preact/hooks';\nimport clsx from 'clsx';\nimport _ from '@lhci/utils/src/lodash';\nimport {findAuditDiffs, getDiffSeverity} from '@lhci/utils/src/audit-diff-finder';\n\nimport {Dropdown} from '../../components/dropdown';\nimport {AuditDetailPane} from './audit-detail/audit-detail-pane';\nimport {LhrComparisonScores} from './lhr-comparison-scores';\nimport {AuditGroup} from './audit-list/audit-group';\nimport {LhrComparisonLegend} from './lhr-comparison-legend';\nimport {Paper} from '../../components/paper';\nimport {LhrViewerLink} from '../../components/lhr-viewer-link';\n\nimport './lhr-comparison.css';\nimport {Modal} from '../../components/modal';\nimport {LhrRuntimeDiff, computeRuntimeDiffs} from './lhr-comparison-runtime-diff';\n\n/** @typedef {{id: string, pairs: Array<LHCI.AuditPair>, group: {id: string, title: string}, showAsUnchanged: boolean}} AuditGroupDef */\n\n/** @param {(s: string) => void} setAuditId */\nfunction useAuditPermalinkScrollOnLoad(setAuditId) {\n /** @param {number} ms */\n const wait = ms => new Promise(r => setTimeout(r, ms));\n\n /** @param {string} selector */\n const waitUntilSelector = async selector => {\n let attempts = 0;\n while (!document.querySelector(selector) && attempts < 10) {\n await wait(500);\n attempts++;\n }\n };\n\n useEffect(() => {\n if (window.location.hash.length <= 1) return;\n\n Promise.resolve().then(async () => {\n await waitUntilSelector('.lhr-comparison__audit-groups');\n setAuditId(window.location.hash.slice(1));\n });\n }, []);\n}\n\n/**\n * @param {LH.Result} lhr\n * @param {LH.Result|undefined} baseLhr\n * @param {{percentAbsoluteDeltaThreshold: number}} options\n * @return {Array<AuditGroupDef>}\n */\nexport function computeAuditGroups(lhr, baseLhr, options) {\n /** @type {Array<AuditGroupDef>} */\n const auditGroups = [];\n\n for (const [categoryId, category] of Object.entries(lhr.categories)) {\n const categoryAsGroup = {title: category.title, description: category.description};\n const auditRefsGroupedByGroup = _.groupBy(category.auditRefs, ref => ref.group);\n\n const unchangedAuditsGroupId = `unchanged:${categoryId}`;\n /** @type {AuditGroupDef} */\n const unchangedAuditsGroup = {\n id: unchangedAuditsGroupId,\n group: {id: unchangedAuditsGroupId, title: `Unchanged Audits - ${category.title}`},\n pairs: [],\n showAsUnchanged: true,\n };\n\n for (const auditRefGroup of auditRefsGroupedByGroup) {\n let groupId = auditRefGroup[0].group || '';\n let groupWithoutId = lhr.categoryGroups && lhr.categoryGroups[groupId];\n if (!groupWithoutId) {\n // Only use the category as the group if the entire category is ungrouped.\n // The lack of a category when the category otherwise uses groups means it's hidden.\n if (auditRefsGroupedByGroup.length !== 1) continue;\n groupId = `category:${categoryId}`;\n groupWithoutId = categoryAsGroup;\n }\n const group = {...groupWithoutId, id: groupId};\n\n const pairs = auditRefGroup\n .map(ref => {\n const audit = {...lhr.audits[ref.id], id: ref.id};\n const baseAudit = baseLhr && baseLhr.audits[audit.id || ''];\n const diffs = baseAudit\n ? findAuditDiffs(baseAudit, audit, {...options, synthesizeItemKeyDiffs: true})\n : [];\n const maxSeverity = Math.max(...diffs.map(getDiffSeverity), 0);\n return {audit, baseAudit, diffs, maxSeverity, group};\n })\n .sort((a, b) => (a.audit.score || 0) - (b.audit.score || 0));\n\n const pairsWithDiffs = pairs.filter(pair => !pair.baseAudit || pair.diffs.length);\n const pairsWithoutDiffs = pairs.filter(pair => pair.baseAudit && !pair.diffs.length);\n if (pairsWithDiffs.length) {\n auditGroups.push({id: groupId, group, pairs: pairsWithDiffs, showAsUnchanged: false});\n }\n if (pairsWithoutDiffs.length) {\n unchangedAuditsGroup.pairs.push(...pairsWithoutDiffs);\n }\n }\n\n if (unchangedAuditsGroup.pairs.length) {\n auditGroups.push(unchangedAuditsGroup);\n }\n }\n\n return auditGroups;\n}\n\n/** @param {{hookElements: LHCI.HookElements<'dropdowns'>, selectedAuditId?: string | null, lhr?: LH.Result, baseLhr?: LH.Result, percentAbsoluteDeltaThreshold: number, setPercentAbsoluteDeltaThreshold: (x: number) => void}} props */\nconst LhrComparisonScoresAndUrl = props => {\n return (\n <div className=\"lhr-comparison__scores-and-dropdowns\">\n <div className=\"container\">\n <div className=\"lhr-comparison__dropdowns\">\n {props.hookElements.dropdowns}\n <Dropdown\n label=\"Threshold\"\n value={props.percentAbsoluteDeltaThreshold.toString()}\n setValue={value => {\n props.setPercentAbsoluteDeltaThreshold(Number(value));\n }}\n options={[\n {value: '0', label: '0%'},\n {value: '0.05', label: '5%'},\n {value: '0.1', label: '10%'},\n {value: '0.15', label: '15%'},\n {value: '0.25', label: '25%'},\n ]}\n />\n </div>\n {props.selectedAuditId ? <Fragment /> : <LhrComparisonScores {...props} />}\n </div>\n </div>\n );\n};\n\n/** @param {{auditGroups: Array<AuditGroupDef|undefined>, baseLhr?: LH.Result, selectedAuditId: string|null, setSelectedAuditId: (id: string|null) => void, showAsNarrow: boolean}} props */\nconst AuditGroups = props => {\n return (\n <div className=\"lhr-comparison__audit-groups\">\n {props.auditGroups.map(auditGroup => {\n if (!auditGroup) return undefined;\n return (\n <AuditGroup\n key={auditGroup.id}\n showAsNarrow={props.showAsNarrow}\n showAsUnchanged={auditGroup.showAsUnchanged}\n pairs={auditGroup.pairs}\n group={auditGroup.group}\n baseLhr={props.baseLhr}\n selectedAuditId={props.selectedAuditId}\n setSelectedAuditId={props.setSelectedAuditId}\n />\n );\n })}\n </div>\n );\n};\n\n/** @param {{lhr: LH.Result, baseLhr: LH.Result|undefined, hookElements: LHCI.HookElements<'dropdowns'|'warnings'>, className?: string}} props */\nexport const LhrComparison = props => {\n const {lhr, baseLhr} = props;\n const defaultAck = /** @type {'none'|'acknowledged'|'closed'} */ ('none');\n const [percentAbsoluteDeltaThreshold, setDiffThreshold] = useState(0.05);\n const [selectedAuditId, setAuditId] = useState(/** @type {string|null} */ (null));\n const [runtimeDiffAck, setRuntimeDiffAck] = useState(defaultAck);\n useAuditPermalinkScrollOnLoad(setAuditId);\n\n // Attach the LHRs to the window for easy debugging.\n useEffect(() => {\n // @ts-ignore\n window.__LHR__ = lhr;\n // @ts-ignore\n window.__BASE_LHR__ = baseLhr;\n }, [lhr, baseLhr]);\n\n const runtimeDiffs = computeRuntimeDiffs(lhr, baseLhr);\n const runtimeDiffsHaveError = runtimeDiffs.some(diff => diff.severity === 'error');\n const auditGroups = computeAuditGroups(lhr, baseLhr, {percentAbsoluteDeltaThreshold});\n\n return (\n <Fragment>\n {runtimeDiffAck === 'none' && runtimeDiffsHaveError ? (\n <Modal onClose={() => setRuntimeDiffAck('acknowledged')}>\n <LhrRuntimeDiff diffs={runtimeDiffs} variant=\"full\" />\n </Modal>\n ) : null}\n {selectedAuditId ? (\n <AuditDetailPane\n selectedAuditId={selectedAuditId}\n setSelectedAuditId={setAuditId}\n pairs={auditGroups\n .filter(group => !group.showAsUnchanged)\n .map(group => group.pairs)\n .reduce((a, b) => a.concat(b))}\n baseLhr={baseLhr}\n />\n ) : (\n <Fragment />\n )}\n <div\n className={clsx('lhr-comparison', props.className, {\n 'lhr-comparison--with-audit-selection': !!selectedAuditId,\n })}\n >\n <LhrComparisonScoresAndUrl\n lhr={lhr}\n baseLhr={baseLhr}\n selectedAuditId={selectedAuditId}\n hookElements={props.hookElements}\n percentAbsoluteDeltaThreshold={percentAbsoluteDeltaThreshold}\n setPercentAbsoluteDeltaThreshold={setDiffThreshold}\n />\n <div className=\"container\">\n {props.hookElements.warnings}\n {runtimeDiffAck !== 'closed' && runtimeDiffs.length ? (\n <Paper className=\"position-relative\">\n <LhrRuntimeDiff diffs={runtimeDiffs} variant=\"mini\" />\n <div\n className=\"lhr-comparison-runtime-diff__close\"\n onClick={() => setRuntimeDiffAck('closed')}\n >\n <i className=\"material-icons\">close</i>\n </div>\n </Paper>\n ) : null}\n {auditGroups.length && baseLhr ? (\n <Fragment>\n {selectedAuditId ? null : (\n <div className=\"lhr-comparison__legend-container\">\n <LhrComparisonLegend />\n </div>\n )}\n <AuditGroups\n showAsNarrow={!!selectedAuditId}\n auditGroups={auditGroups}\n baseLhr={baseLhr}\n selectedAuditId={selectedAuditId}\n setSelectedAuditId={setAuditId}\n />\n </Fragment>\n ) : props.hookElements.warnings ? null : (\n <Paper className=\"lhr-comparison__warning\">\n <i className=\"material-icons\">sentiment_satisfied_alt</i>\n <div>\n Woah, no differences found! Switch base builds to explore other differences, or{' '}\n <LhrViewerLink className=\"lhr-comparison__warning__lhr-link\" lhr={props.lhr}>\n jump straight to the Lighthouse report.\n </LhrViewerLink>\n </div>\n </Paper>\n )}\n </div>\n </div>\n </Fragment>\n );\n};\n", "/**\n * @license Copyright 2019 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport {h, Fragment} from 'preact';\nimport clsx from 'clsx';\nimport './dropdown.css';\n\n/** @param {{options: Array<{value: string, label: string}>, value: string, setValue(v: string): void, className?: string, title?: string, label?: string}} props */\nexport const Dropdown = props => {\n const {options, value, setValue, className, title, label} = props;\n const computedOptions = options.some(option => option.value === value)\n ? options\n : [...options, {value, label: value}];\n return (\n <div\n className={clsx('dropdown', className)}\n style={{position: 'relative'}}\n data-tooltip={title}\n >\n <label>\n {label ? <span className=\"dropdown__label\">{label}</span> : <Fragment />}\n <select\n onChange={evt => {\n if (!(evt.target instanceof HTMLSelectElement)) return;\n setValue(evt.target.value);\n }}\n >\n {computedOptions.map(option => {\n return (\n <option key={option.value} value={option.value} selected={option.value === value}>\n {option.label}\n </option>\n );\n })}\n </select>\n </label>\n <div className=\"dropdown__chevron\">\n <i className=\"material-icons\">arrow_drop_down</i>\n </div>\n </div>\n );\n};\n", "/**\n * @license Copyright 2019 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport {useRef, useEffect} from 'preact/hooks';\n\n/**\n * @template T\n * @param {T} value\n * @return {T|null|undefined}\n */\nexport function usePreviousValue(value) {\n /** @type {import('preact').Ref<T|undefined>} */\n const ref = useRef(undefined);\n\n useEffect(() => {\n ref.current = value;\n }, [value]);\n\n // This is returned before our useEffect callback runs to update the value.\n return ref.current;\n}\n", "/**\n * @license Copyright 2019 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport {h} from 'preact';\n\n/** @param {{score: number}} props */\nexport const ScoreIcon = props => {\n const score = props.score;\n if (score >= 0.9) return <i className=\"lh-score-pass\" />;\n if (score >= 0.5) return <i className=\"lh-score-average\" />;\n return (\n <i className=\"lh-score-fail\">\n <svg viewBox=\"0 0 120 120\" xmlns=\"http://www.w3.org/2000/svg\">\n <polygon points=\"10,110 60,10 110,110\" />\n </svg>\n </i>\n );\n};\n\n/** @param {{audit: LH.AuditResult}} props */\nexport const ScoreWord = props => {\n const score = props.audit.score || 0;\n if (score >= 0.9) return <span className=\"lh-score-word\">Pass</span>;\n return <span className=\"lh-score-word\">Fail</span>;\n};\n", "/**\n * @license Copyright 2019 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport {h, Fragment} from 'preact';\nimport {splitMarkdownLink} from '@lhci/utils/src/markdown.js';\n\n/** @param {{text: string}} props */\nexport const Markdown = props => {\n const segments = splitMarkdownLink(props.text);\n\n return (\n <Fragment>\n {segments.map((segment, i) => {\n if (!segment.isLink) return <span key={i}>{segment.text}</span>;\n\n const url = new URL(segment.linkHref);\n\n const DOCS_ORIGINS = ['https://developers.google.com', 'https://web.dev'];\n if (DOCS_ORIGINS.includes(url.origin)) {\n url.searchParams.set('utm_source', 'lighthouse');\n url.searchParams.set('utm_medium', 'ci');\n }\n\n return (\n <a key={i} href={url.href} target=\"_blank\" rel=\"noopener noreferrer\">\n {segment.text}\n </a>\n );\n })}\n </Fragment>\n );\n};\n", "/**\n * @license Copyright 2019 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport {h} from 'preact';\n\nexport const Nbsp = () => {\n return <span style={{display: 'inline-block', width: 4, height: 1}} />;\n};\n", "/**\n * @license Copyright 2019 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport {Fragment, h} from 'preact';\nimport {Nbsp} from '../../../components/nbsp';\nimport './simple-details.css';\nimport {getDiffLabel, getDeltaStats} from '@lhci/utils/src/audit-diff-finder.js';\n\n/** @param {{type: LH.DetailsType, baseValue: any, compareValue: any, diff?: LHCI.NumericItemAuditDiff}} props */\nexport const SimpleDetails = props => {\n let type = props.type;\n const {compareValue, baseValue, diff} = props;\n const value = compareValue === undefined ? baseValue : compareValue;\n\n if (typeof value === 'object' && value.type) {\n type = value.type;\n }\n\n const label = diff ? getDiffLabel(diff) : 'neutral';\n\n const numericBase = Number.isFinite(baseValue) ? baseValue : 0;\n const numericCompare = Number.isFinite(compareValue) ? compareValue : 0;\n const baseDisplay = `Base Value: ${Math.round(numericBase).toLocaleString()}`;\n const compareDisplay = `Compare Value: ${Math.round(numericCompare).toLocaleString()}`;\n const numericTitle = `${baseDisplay}, ${compareDisplay}`;\n const deltaPercent =\n diff && getDeltaStats(diff).percentAbsoluteDelta !== 1\n ? ` (${(getDeltaStats(diff).percentAbsoluteDelta * 100).toLocaleString(undefined, {\n maximumFractionDigits: 0,\n })}%)`\n : '';\n\n switch (type) {\n case 'bytes': {\n const kb = Math.abs((numericCompare - numericBase) / 1024);\n return (\n <pre className={`simple-details--${label}`} data-tooltip={numericTitle}>\n {numericCompare >= numericBase ? '+' : '-'}\n {kb.toLocaleString(undefined, {maximumFractionDigits: Math.abs(kb) < 1 ? 1 : 0})}\n <Nbsp />\n KB\n {deltaPercent}\n </pre>\n );\n }\n case 'ms':\n case 'timespanMs': {\n const ms = Math.abs(Math.round(numericCompare - numericBase));\n return (\n <pre className={`simple-details--${label}`} data-tooltip={numericTitle}>\n {numericCompare >= numericBase ? '+' : '-'}\n {ms.toLocaleString()}\n <Nbsp />\n ms\n {deltaPercent}\n </pre>\n );\n }\n case 'thumbnail':\n return (\n <img\n style={{width: 48, height: 48, objectFit: 'cover'}}\n src={value}\n onError={evt => {\n const img = evt.srcElement;\n if (!(img instanceof HTMLImageElement)) return;\n\n // On failure just replace the image with a 1x1 transparent gif.\n img.onerror = null;\n img.src =\n 'data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==';\n }}\n />\n );\n case 'url': {\n let display = value;\n let hostname = '';\n try {\n const url = new URL(value);\n display = url.pathname;\n hostname = url.hostname;\n } catch (_) {}\n\n // FIXME: use title instead of data-tooltip because of the `overflow: hidden` constraints on the table cell.\n return (\n <span title={value}>\n {display}\n {hostname ? <span className=\"simple-details__url-hostname\">({hostname})</span> : ''}\n </span>\n );\n }\n case 'link': {\n if (!value.url) return <span>{value.text}</span>;\n return (\n <a target=\"_blank\" rel=\"noopener noreferrer\" href={value.url}>\n {value.text}\n </a>\n );\n }\n case 'code':\n return <pre>{value}</pre>;\n case 'numeric': {\n return (\n <pre className={`simple-details--${label}`}>\n {numericCompare >= numericBase ? '+' : '-'}\n {Math.abs(numericCompare - numericBase).toLocaleString()}\n {deltaPercent}\n </pre>\n );\n }\n case 'text':\n return <span>{value}</span>;\n case 'node':\n return <pre>{value.snippet}</pre>;\n case 'source-location': {\n if (!value.url) return <pre>{JSON.stringify(value)}</pre>;\n const {url, line, column} = value;\n return (\n <pre>\n {url}:{line}:{column}\n </pre>\n );\n }\n case 'debugdata': {\n return <Fragment />;\n }\n default: {\n const debugdata = JSON.stringify(props);\n return <pre data-tooltip={debugdata}>{debugdata.slice(0, 20)}</pre>;\n }\n }\n};\n", "/**\n * @license Copyright 2019 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport {h, Fragment} from 'preact';\nimport './table-details.css';\nimport {SimpleDetails} from './simple-details';\nimport {\n zipBaseAndCompareItems,\n sortZippedBaseAndCompareItems,\n getRowLabelForIndex,\n} from '@lhci/utils/src/audit-diff-finder';\n\n/** @param {LH.DetailsType} itemType @return {boolean} */\nfunction isNumericValueType(itemType) {\n switch (itemType) {\n case 'bytes':\n case 'ms':\n case 'timespanMs':\n case 'numeric':\n return true;\n default:\n return false;\n }\n}\n\n/** @param {{pair: LHCI.AuditPair}} props */\nexport const TableDetails = props => {\n const {audit, baseAudit, diffs: allDiffs} = props.pair;\n if (!audit.details) return <Fragment />;\n const {headings: compareHeadings, items: compareItems} = audit.details;\n if (!compareHeadings || !compareItems) return <Fragment />;\n\n const baseHeadings = (baseAudit && baseAudit.details && baseAudit.details.headings) || [];\n const baseItems = (baseAudit && baseAudit.details && baseAudit.details.items) || [];\n\n const zippedItems = zipBaseAndCompareItems(baseItems, compareItems);\n const sortedItems = sortZippedBaseAndCompareItems(allDiffs, zippedItems);\n const headings = compareHeadings.length ? compareHeadings : baseHeadings;\n // We'll insert the row label before the first numeric heading, or last if none is found.\n let insertRowLabelAfterIndex =\n headings.findIndex(heading =>\n isNumericValueType(heading.valueType || heading.itemType || 'unknown')\n ) - 1;\n if (insertRowLabelAfterIndex < 0) insertRowLabelAfterIndex = headings.length - 1;\n\n return (\n <div className=\"table-details\">\n <table>\n <thead>\n <tr>\n {headings.map((heading, i) => {\n const itemType = heading.valueType || heading.itemType || 'unknown';\n return (\n <Fragment key={i}>\n <th className={`table-column--${itemType}`}>{heading.label || heading.text}</th>\n {insertRowLabelAfterIndex === i ? <th /> : null}\n </Fragment>\n );\n })}\n </tr>\n </thead>\n <tbody>\n {sortedItems.map(({base, compare, diffs}) => {\n const definedItem = compare || base;\n // This should never be true, but make tsc happy\n if (!definedItem) return null;\n\n const key = `${base && base.index}-${compare && compare.index}`;\n const state = getRowLabelForIndex(\n allDiffs,\n compare && compare.index,\n base && base.index\n );\n\n return (\n <tr key={key}>\n {headings.map((heading, j) => {\n const itemType = heading.valueType || heading.itemType || 'unknown';\n const diff = diffs.find(\n /** @return {diff is LHCI.NumericItemAuditDiff} */\n diff => diff.type === 'itemDelta' && diff.itemKey === heading.key\n );\n\n // With the introduction of subitems, not every item will have a value for every heading.\n const compareItem = heading.key && compare && compare.item[heading.key];\n const baseItem = heading.key && base && base.item[heading.key];\n\n return (\n <Fragment key={j}>\n <td className={`table-column--${itemType}`}>\n {compareItem || baseItem ? (\n <SimpleDetails\n type={itemType}\n compareValue={compareItem}\n baseValue={baseItem}\n diff={diff}\n />\n ) : (\n <Fragment />\n )}\n </td>\n {insertRowLabelAfterIndex === j ? (\n <td className=\"table-column--row-label\">\n {state === 'added' || state === 'removed' ? state : ''}\n </td>\n ) : null}\n </Fragment>\n );\n })}\n </tr>\n );\n })}\n </tbody>\n </table>\n </div>\n );\n};\n", "/**\n * @license Copyright 2019 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport {h, Fragment} from 'preact';\nimport {getDeltaLabel} from '@lhci/utils/src/audit-diff-finder';\nimport clsx from 'clsx';\nimport {Nbsp} from '../../../components/nbsp';\nimport './numeric-diff.css';\n\nconst BIG_PICTURE_LIMITS = {\n 'first-contentful-paint': [0, 10000],\n 'first-meaningful-paint': [0, 10000],\n 'largest-contentful-paint': [0, 15000],\n 'speed-index': [0, 15000],\n 'first-cpu-idle': [0, 15000],\n 'interactive': [0, 20000],\n 'estimated-input-latency': [0, 1500],\n 'max-potential-fid': [0, 1500],\n 'total-blocking-time': [0, 1500],\n 'experimental-interaction-to-next-paint': [0, 3500],\n 'cumulative-layout-shift': [0, 1],\n __default__: [0, 30 * 1000],\n};\n\n/** @param {LH.AuditResult|undefined} audit @param {'lower'|'upper'} limitType */\nconst getBigPictureLimit = (audit, limitType) => {\n const auditId = /** @type {keyof typeof BIG_PICTURE_LIMITS} */ (audit && audit.id) || '';\n const limits = BIG_PICTURE_LIMITS[auditId] || BIG_PICTURE_LIMITS.__default__;\n return limits[limitType === 'lower' ? 0 : 1];\n};\n\n/** @param {number} x @param {'up'|'down'} direction */\nconst toNearestRoundNumber = (x, direction) => {\n const fn = direction === 'up' ? Math.ceil : Math.floor;\n if (x < 10) return fn(x);\n if (x < 100) return fn(x / 10) * 10;\n if (x < 1000) return fn(x / 100) * 100;\n if (x < 10000) return fn(x / 1000) * 1000;\n return fn(x / 2500) * 2500;\n};\n\n/**\n * @param {LH.AuditResult|undefined} audit\n * @param {string|undefined} groupId\n * @return {'ms'|'bytes'|'none'}\n */\nconst getUnitFromAudit = (audit, groupId) => {\n if (audit && audit.id === 'cumulative-layout-shift') return 'none';\n if (groupId === 'metrics') return 'ms';\n if (groupId === 'load-opportunities') return 'ms';\n if (!audit) return 'none';\n\n if (audit.details) {\n const details = audit.details;\n if (details.overallSavingsMs) return 'ms';\n }\n\n const displayValue = audit.displayValue || '';\n if (/[0-9,.]+\\s(ms|s)$/.test(displayValue)) return 'ms';\n if (/[0-9,.]+\\s(KB|MB)$/.test(displayValue)) return 'bytes';\n\n return 'none';\n};\n\n/** @param {number} x @param {{asDelta?: boolean, unit: 'ms'|'bytes'|'none', withSuffix?: boolean, preventSecondsConversion?: boolean}} options */\nconst toDisplay = (x, options) => {\n const {asDelta = false, withSuffix = false, unit = 'none'} = options;\n let value = Math.round(x);\n let fractionDigits = 0;\n let suffixUnit = '';\n\n if (unit === 'ms') {\n suffixUnit = 'ms';\n\n if (Math.abs(value) >= 1000 && !options.preventSecondsConversion) {\n value /= 1000;\n fractionDigits = 1;\n suffixUnit = 's';\n }\n }\n\n if (unit === 'bytes') {\n suffixUnit = 'KB';\n value /= 1024;\n\n if (Math.abs(value) >= 500) {\n value /= 1024;\n fractionDigits = 1;\n suffixUnit = 'MB';\n }\n }\n\n if (unit === 'none') {\n if (Math.abs(x) < 1) {\n value = x;\n fractionDigits = 3;\n } else if (Math.abs(value) < 10) {\n value = x;\n fractionDigits = 1;\n } else if (Math.abs(value) >= 50) {\n value /= 1000;\n fractionDigits = 1;\n suffixUnit = 'K';\n }\n }\n\n const string = value.toLocaleString(undefined, {\n minimumFractionDigits: fractionDigits,\n maximumFractionDigits: fractionDigits,\n });\n\n const numericSign = asDelta && value >= 0 ? '+' : '';\n const resultStr = numericSign + string + (withSuffix ? suffixUnit : '');\n return {\n element: (\n <span>\n {numericSign}\n {string}\n {withSuffix ? (\n <Fragment>\n <Nbsp />\n {suffixUnit}\n </Fragment>\n ) : (\n ''\n )}\n </span>\n ),\n string: resultStr,\n length: resultStr.length,\n };\n};\n\n/** @param {{diff: LHCI.NumericAuditDiff, audit?: LH.AuditResult, groupId?: string, showAsBigPicture?: boolean, showAsNarrow?: boolean}} props */\nexport const NumericDiff = props => {\n const {diff, audit, groupId} = props;\n const unit = getUnitFromAudit(audit, groupId);\n const currentNumericValue = diff.compareValue;\n const baseNumericValue = diff.baseValue;\n\n if (typeof baseNumericValue !== 'number' || typeof currentNumericValue !== 'number') {\n return <span>No diff available</span>;\n }\n\n const delta = currentNumericValue - baseNumericValue;\n const minValue = Math.min(currentNumericValue, baseNumericValue);\n const maxValue = Math.max(currentNumericValue, baseNumericValue);\n const lowerLimit = props.showAsBigPicture\n ? getBigPictureLimit(audit, 'lower')\n : toNearestRoundNumber(minValue * 0.8, 'down');\n const upperLimit = props.showAsBigPicture\n ? getBigPictureLimit(audit, 'upper')\n : toNearestRoundNumber(maxValue * 1.2, 'up');\n const range = upperLimit - lowerLimit;\n\n const minValueConstrainted = Math.min(Math.max(minValue, lowerLimit), upperLimit);\n const maxValueConstrainted = Math.min(Math.max(maxValue, lowerLimit), upperLimit);\n const boxLeft = (100 * (minValueConstrainted - lowerLimit)) / range;\n const boxRight = 100 - (100 * (maxValueConstrainted - lowerLimit)) / range;\n const deltaType = getDeltaLabel(delta, 'audit');\n const minValueIsCurrentValue = minValue === currentNumericValue;\n const hoverDisplay = `${toDisplay(baseNumericValue, {unit, withSuffix: true}).string} to ${\n toDisplay(currentNumericValue, {\n withSuffix: true,\n unit,\n }).string\n }`;\n\n if (props.showAsNarrow) {\n return (\n <div className={clsx('audit-numeric-diff', `text--${deltaType}`)} data-tooltip={hoverDisplay}>\n {\n toDisplay(delta, {asDelta: true, withSuffix: true, preventSecondsConversion: true, unit})\n .element\n }\n </div>\n );\n }\n\n // We want to ensure there's ~10px per character of space for the delta label.\n // The min-width of the bar is ~300px, so if the deltaLabel is going to take up more than\n // the narrowCutoffThresholdInPercent we want to flip it over to the other side.\n const {element: deltaLabel, length: deltaLabelLength} = toDisplay(delta, {\n asDelta: true,\n withSuffix: true,\n preventSecondsConversion: true,\n unit,\n });\n const narrowCutoffThresholdInPercent = (deltaLabelLength * 10 * 100) / 300;\n\n return (\n <Fragment>\n <div className=\"audit-numeric-diff\">\n <div className=\"audit-numeric-diff__left-label\">\n {toDisplay(lowerLimit, {unit}).element}\n </div>\n <div className=\"audit-numeric-diff__bar\">\n <div\n className={clsx('audit-numeric-diff__box', {\n 'audit-numeric-diff__box--improvement': deltaType === 'improvement',\n 'audit-numeric-diff__box--regression': deltaType === 'regression',\n })}\n style={{left: `${boxLeft}%`, right: `${boxRight}%`}}\n data-tooltip={hoverDisplay}\n >\n <div\n className=\"audit-numeric-diff__now\"\n style={{left: minValueIsCurrentValue ? '0%' : '100%'}}\n />\n <div\n className={clsx('audit-numeric-diff__delta-label', {\n 'audit-numeric-diff__delta-label--narrow-left':\n deltaType === 'improvement' && boxLeft < narrowCutoffThresholdInPercent,\n 'audit-numeric-diff__delta-label--narrow-right':\n deltaType === 'regression' && boxRight < narrowCutoffThresholdInPercent,\n })}\n style={{[minValueIsCurrentValue ? 'right' : 'left']: '100%'}}\n >\n {deltaLabel}\n </div>\n </div>\n </div>\n <div className=\"audit-numeric-diff__right-label\">\n {toDisplay(upperLimit, {unit}).element}\n </div>\n </div>\n </Fragment>\n );\n};\n", "/**\n * @license Copyright 2019 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport * as _ from '@lhci/utils/src/lodash';\nimport {h, Fragment} from 'preact';\nimport {ScoreWord} from '../../../components/score-icon';\nimport {NumericDiff} from './numeric-diff';\nimport {getDiffLabel, getRowLabelForIndex} from '@lhci/utils/src/audit-diff-finder';\nimport clsx from 'clsx';\n\n/** @type {Record<string, string>} */\nconst ICONS_BY_AUDIT_ID = {\n 'font-display': 'font_download',\n 'uses-rel-preconnect': 'language',\n\n 'user-timings': 'timer',\n 'bootup-time': 'speed',\n 'mainthread-work-breakdown': 'speed',\n\n 'third-party-summary': 'language',\n\n deprecations: 'error',\n 'errors-in-console': 'error',\n 'font-sizes': 'format_size',\n};\n\n/** @param {{audit: LH.AuditResult, groupId: string}} props */\nconst IconForAuditItems = props => {\n const auditId = props.audit.id || '';\n const groupId = props.groupId || '';\n\n let icon = '';\n if (groupId.includes('opportunities')) icon = 'web_asset';\n if (groupId.includes('a11y')) icon = 'code';\n if (auditId.includes('image')) icon = 'photo';\n icon = ICONS_BY_AUDIT_ID[auditId] || icon || 'list_alt';\n\n return <i className=\"material-icons\">{icon}</i>;\n};\n\n/** @param {{diff: LHCI.AuditDiff, audit: LH.AuditResult, baseAudit: LH.AuditResult}} props */\nconst ScoreDiff = props => {\n return (\n <Fragment>\n <ScoreWord audit={props.baseAudit} />\n <i\n className={`material-icons audit-group__diff-arrow audit-group__diff-arrow--${getDiffLabel(\n props.diff\n )}`}\n >\n arrow_forward\n </i>\n <ScoreWord audit={props.audit} />\n </Fragment>\n );\n};\n\n/** @param {{diff: LHCI.DisplayValueAuditDiff, audit: LH.AuditResult, baseAudit: LH.AuditResult}} props */\nconst DisplayValueDiff = props => {\n return (\n <Fragment>\n <span>{props.diff.baseValue}</span>\n <i\n className={`material-icons audit-group__diff-arrow audit-group__diff-arrow--${getDiffLabel(\n props.diff\n )}`}\n >\n arrow_forward\n </i>\n <span>{props.diff.compareValue}</span>\n </Fragment>\n );\n};\n\n/** @param {import('@lhci/utils/src/audit-diff-finder').RowLabel} rowLabel @return {'regression'|'improvement'|'neutral'} */\nfunction getDiffLabelForRowLabel(rowLabel) {\n switch (rowLabel) {\n case 'added':\n case 'worse':\n case 'ambiguous':\n return 'regression';\n case 'removed':\n case 'better':\n return 'improvement';\n case 'no change':\n return 'neutral';\n }\n}\n\n/** @param {Array<LHCI.AuditDiff>} diffs */\nfunction getUniqueBaseCompareIndexPairs(diffs) {\n return _.uniqBy(\n diffs\n .map(diff => ({\n base: 'baseItemIndex' in diff ? diff.baseItemIndex : undefined,\n compare: 'compareItemIndex' in diff ? diff.compareItemIndex : undefined,\n }))\n .filter(indexes => typeof indexes.base === 'number' || typeof indexes.compare === 'number'),\n idx => `${idx.base}-${idx.compare}`\n );\n}\n\n/** @param {{diffs: Array<LHCI.AuditDiff>, audit: LH.AuditResult, baseAudit: LH.AuditResult, groupId: string, showAsNarrow?: boolean}} props */\nexport const ItemDiff = props => {\n const {diffs, baseAudit, groupId} = props;\n const baseAuditItems = (baseAudit.details && baseAudit.details.items) || [];\n\n const rowIndexes = getUniqueBaseCompareIndexPairs(diffs);\n const rowLabels = rowIndexes\n .map(pair => getRowLabelForIndex(diffs, pair.compare, pair.base))\n .map(getDiffLabelForRowLabel);\n\n const regressionCount = rowLabels.filter(label => label === 'regression').length;\n const improvementCount = rowLabels.filter(label => label === 'improvement').length;\n\n const baseElements = (\n <Fragment>\n <div className=\"audit-group__diff-badge-group\">\n <IconForAuditItems audit={props.audit} groupId={groupId} />\n <div className=\"audit-group__diff-badges\">\n <span className=\"audit-group__diff-badge\">{baseAuditItems.length}</span>\n </div>\n </div>\n <i\n className={`material-icons audit-group__diff-arrow audit-group__diff-arrow--${\n improvementCount > regressionCount ? 'improvement' : 'regression'\n }`}\n >\n arrow_forward\n </i>\n </Fragment>\n );\n\n return (\n <Fragment>\n {props.showAsNarrow ? <Fragment /> : baseElements}\n <div className={clsx(`audit-group__diff-badge-group`)}>\n <IconForAuditItems audit={props.audit} groupId={groupId} />\n <div\n className={clsx('audit-group__diff-badges', {\n 'audit-group__diff-badge-group--multiple': Boolean(regressionCount && improvementCount),\n })}\n >\n {regressionCount ? (\n <span className=\"audit-group__diff-badge audit-group__diff-badge--regression\">\n {regressionCount}\n </span>\n ) : null}\n {improvementCount ? (\n <span className=\"audit-group__diff-badge audit-group__diff-badge--improvement\">\n {improvementCount}\n </span>\n ) : null}\n </div>\n </div>\n </Fragment>\n );\n};\n\nconst NoBaseAudit = () => (\n <div className=\"audit-group__error-message\" data-tooltip=\"Audit did not run in the base report\">\n <i className=\"material-icons\">error_outline</i> Audit Missing\n </div>\n);\n\n/** @param {{audit: LH.AuditResult, baseAudit: LH.AuditResult}} props */\nconst ErrorDiff = props => {\n let message = 'An unknown error occurred while trying to compare the audit results.';\n if (props.audit.scoreDisplayMode === 'error') {\n message = `Audit in compare report errored: ${props.audit.errorMessage}`;\n } else if (props.baseAudit.scoreDisplayMode === 'error') {\n message = `Audit in base report errored: ${props.baseAudit.errorMessage}`;\n }\n\n return (\n <div className=\"audit-group__error-message\" data-tooltip={message}>\n <i className=\"material-icons\">error_outline</i> Audit Error\n </div>\n );\n};\n\n/** @param {{pair: LHCI.AuditPair, showAsBigPicture: boolean, showAsNarrow: boolean}} props */\nexport const AuditDiff = props => {\n const {audit, baseAudit, diffs, group} = props.pair;\n const noDiffAvailable = <span>No diff available</span>;\n\n if (!baseAudit) return <NoBaseAudit />;\n\n const errorDiff = diffs.find(diff => diff.type === 'error');\n if (errorDiff) return <ErrorDiff audit={audit} baseAudit={baseAudit} />;\n\n const numericDiff = diffs.find(diff => diff.type === 'numericValue');\n if (numericDiff && numericDiff.type === 'numericValue') {\n return (\n <NumericDiff\n diff={numericDiff}\n audit={audit}\n groupId={group.id}\n showAsBigPicture={props.showAsBigPicture}\n showAsNarrow={props.showAsNarrow}\n />\n );\n }\n\n const hasItemDiff = diffs.some(\n diff => diff.type === 'itemAddition' || diff.type === 'itemRemoval' || diff.type === 'itemDelta'\n );\n if (hasItemDiff) {\n return (\n <ItemDiff\n diffs={diffs}\n audit={audit}\n baseAudit={baseAudit}\n groupId={group.id}\n showAsNarrow={props.showAsNarrow}\n />\n );\n }\n\n const scoreDiff = diffs.find(diff => diff.type === 'score');\n if (scoreDiff) return <ScoreDiff diff={scoreDiff} audit={audit} baseAudit={baseAudit} />;\n\n const displayValueDiff = diffs.find(diff => diff.type === 'displayValue');\n if (!displayValueDiff || displayValueDiff.type !== 'displayValue') return noDiffAvailable;\n return <DisplayValueDiff diff={displayValueDiff} audit={audit} baseAudit={baseAudit} />;\n};\n", "/**\n * @license Copyright 2019 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport {h, Fragment} from 'preact';\nimport clsx from 'clsx';\nimport {ScoreWord, ScoreIcon} from '../../../components/score-icon';\nimport {Markdown} from '../../../components/markdown';\nimport {TableDetails} from './table-details';\nimport {NumericDiff} from '../audit-list/numeric-diff';\nimport {ItemDiff} from '../audit-list/audit-diff';\nimport {getDiffLabel} from '@lhci/utils/src/audit-diff-finder';\n\n/** @param {{pair: LHCI.AuditPair, diff: LHCI.AuditDiff}} props */\nconst ScoreOnlyDetails = props => {\n const {audit, baseAudit} = props.pair;\n if (!baseAudit) return null;\n\n return (\n <div className=\"audit-detail-pane__audit-details--binary\">\n <ScoreWord audit={baseAudit} />\n <i\n className={`material-icons audit-group__diff-arrow audit-group__diff-arrow--${getDiffLabel(\n props.diff\n )}`}\n >\n arrow_forward\n </i>\n <ScoreWord audit={audit} />\n </div>\n );\n};\n\n/** @param {{pair: LHCI.AuditPair}} props */\nconst ErrorDetails = props => {\n const erroredAudit =\n props.pair.audit.scoreDisplayMode === 'error' ? props.pair.audit : props.pair.baseAudit;\n if (!erroredAudit) return null;\n return (\n <Fragment>\n <div className=\"audit-detail-pane__audit-details-summary\">\n Error occurred in the{' '}\n {erroredAudit === props.pair.baseAudit ? 'base report:' : 'compare report:'}\n </div>\n <pre>{erroredAudit.errorMessage || 'Unknown error'}</pre>\n </Fragment>\n );\n};\n\n/** @param {{pair: LHCI.AuditPair, key?: string}} props */\nconst Details = props => {\n const {pair} = props;\n const details = pair.audit.details || {type: 'unknown'};\n const baseDetails = (pair.baseAudit && pair.baseAudit.details) || {type: 'unknown'};\n const hasItems = Boolean((details.items || []).length || (baseDetails.items || []).length);\n\n let itemDiff = undefined;\n let tableDetails = undefined;\n let numericDetails = undefined;\n\n if (pair.audit.errorMessage || (pair.baseAudit && pair.baseAudit.errorMessage)) {\n return <ErrorDetails pair={pair} />;\n }\n\n if ((details.type === 'table' || details.type === 'opportunity') && hasItems) {\n tableDetails = <TableDetails pair={pair} />;\n if (pair.baseAudit) {\n itemDiff = <ItemDiff {...pair} baseAudit={pair.baseAudit} groupId={pair.group.id} />;\n }\n }\n\n const numericDiff = pair.diffs.find(diff => diff.type === 'numericValue');\n if (numericDiff && numericDiff.type === 'numericValue') {\n numericDetails = <NumericDiff diff={numericDiff} audit={pair.audit} />;\n }\n\n if (tableDetails || numericDiff) {\n return (\n <Fragment>\n <div className=\"audit-detail-pane__audit-details-summary\">{numericDetails || itemDiff}</div>\n {tableDetails}\n </Fragment>\n );\n }\n\n const scoreDiff = pair.diffs.find(diff => diff.type === 'score');\n if (scoreDiff && scoreDiff.type === 'score')\n return <ScoreOnlyDetails diff={scoreDiff} pair={props.pair} />;\n\n return <pre>{JSON.stringify(props.pair, null, 2)}</pre>;\n};\n\n/** @param {{pair: LHCI.AuditPair, key?: string}} props */\nexport const AuditDetail = props => {\n const {audit} = props.pair;\n\n return (\n <div id={`audit-detail-pane-audit--${audit.id}`} className={clsx('audit-detail-pane__audit')}>\n <div className=\"audit-detail-pane__score\">\n <ScoreIcon score={audit.score || 0} />\n </div>\n <div className=\"audit-detail-pane__audit-title\">{audit.title}</div>\n <div className=\"audit-detail-pane__audit-description\">\n <Markdown text={audit.description || ''} />\n </div>\n <div className=\"audit-detail-pane__audit-details\">\n <Details pair={props.pair} />\n </div>\n </div>\n );\n};\n", "/**\n * @license Copyright 2019 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport {h} from 'preact';\nimport './audit-detail-pane.css';\nimport {usePreviousValue} from '../../../hooks/use-previous-value.jsx';\nimport {useEffect, useRef} from 'preact/hooks';\nimport {AuditDetail} from './audit-detail';\n\n/**\n * @param {{selectedAuditId: string, setSelectedAuditId: (id: string|null) => void, pairs: Array<LHCI.AuditPair>, baseLhr?: LH.Result}} props\n */\nexport const AuditDetailPane = props => {\n /** @type {import('preact').Ref<HTMLElement|undefined>} */\n const paneElementRef = useRef(undefined);\n const previouslySelectedAuditId = usePreviousValue(props.selectedAuditId);\n\n // Scroll to the selected audit *when it changes*\n useEffect(() => {\n const auditId = props.selectedAuditId;\n const paneElement = paneElementRef.current;\n if (!paneElement || !auditId || auditId === previouslySelectedAuditId) return;\n\n const childElement = paneElement.querySelector(`#audit-detail-pane-audit--${auditId}`);\n if (!childElement || !(childElement instanceof HTMLElement)) return;\n\n paneElement.scrollTo(0, childElement.offsetTop);\n }, [props.selectedAuditId, previouslySelectedAuditId]);\n\n return (\n <div className=\"audit-detail-pane\" ref={el => (paneElementRef.current = el)}>\n <div className=\"audit-detail-pane__close\" onClick={() => props.setSelectedAuditId(null)}>\n <i className=\"material-icons\">close</i>\n </div>\n {props.pairs.map(pair => {\n const {audit} = pair;\n if (!audit.id) return undefined;\n return <AuditDetail key={audit.id} pair={pair} />;\n })}\n </div>\n );\n};\n", "/**\n * @license Copyright 2019 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport {h} from 'preact';\nimport clsx from 'clsx';\nimport './gauge.css';\nimport {getDiffLabel} from '@lhci/utils/src/audit-diff-finder';\n\n/** @param {{className?: string, score: number, diff?: LHCI.NumericAuditDiff}} props */\nexport const Gauge = props => {\n const score = Math.round(props.score * 100);\n const rawBaseScore = props.diff ? props.diff.baseValue : props.score;\n const baseScore = Math.round(rawBaseScore * 100);\n const label = props.diff ? getDiffLabel(props.diff) : 'neutral';\n\n // 352 is ~= 2 * Math.PI * gauge radius (56)\n // https://codepen.io/xgad/post/svg-radial-progress-meters\n // score of 50: `stroke-dasharray: 176 352`;\n // The roundcap on the arc makes it extend slightly past where it should, so we need to adjust it by a few pts.\n const baseDasharrayScore = Math.max(0, props.score * 352 - 2);\n const baseStrokeDasharray = `${baseDasharrayScore} 352`;\n const delta = Math.abs(baseScore - score);\n const deltaDasharrayScore = Math.max(0, (delta / 100) * 352 - 2);\n const deltaStrokeDasharray = `${deltaDasharrayScore} 352`;\n const deltaTransform = `rotate(${(Math.min(score, baseScore) / 100) * 360}deg)`;\n const indicatorTransform = `rotate(${props.score * 360}deg)`;\n\n return (\n <div className={clsx('gauge', `gauge--${label}`)}>\n <div className=\"gauge-arc\">\n <svg viewBox=\"0 0 120 120\">\n <circle\n className=\"gauge-arc__arc\"\n transform=\"rotate(-90 60 60)\"\n r=\"56\"\n cx=\"60\"\n cy=\"60\"\n style={{strokeDasharray: baseStrokeDasharray}}\n />\n </svg>\n <div\n className=\"gauge-arc__delta-wrapper\"\n style={{transform: deltaTransform, display: deltaDasharrayScore < 1 ? 'none' : 'block'}}\n >\n <svg viewBox=\"0 0 120 120\">\n <circle\n className=\"gauge-arc__arc\"\n transform=\"rotate(-90 60 60)\"\n r=\"56\"\n cx=\"60\"\n cy=\"60\"\n style={{strokeDasharray: deltaStrokeDasharray}}\n />\n </svg>\n </div>\n <div className=\"gauge-arc__indicator-wrapper\" style={{transform: indicatorTransform}}>\n <div className=\"gauge-arc__indicator\" />\n </div>\n </div>\n <span>{score}</span>\n </div>\n );\n};\n", "/**\n * @license Copyright 2019 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport {h} from 'preact';\nimport clsx from 'clsx';\n\nimport * as _ from '@lhci/utils/src/lodash.js';\nimport './pwa-gauge.css';\n\n// For SVG to function properly, we need to use the real attribtues that preact doesn't set.\n/* eslint-disable react/no-unknown-property */\n\n/** @typedef {{optimized: boolean, installable: boolean, fastAndReliable: boolean}} PWABadgeStatus */\n\n/** @param {{deltaType: import('@lhci/utils/src/audit-diff-finder').DiffLabel}} props */\nexport const FastReliableIcon = props => {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n class={`pwa-icon pwa-icon--${props.deltaType}`}\n >\n <g fill-rule=\"nonzero\" fill=\"none\">\n <circle class={`pwa-icon__background`} cx=\"12\" cy=\"12\" r=\"12\" />\n <path\n d=\"M12 4.3l6.3 2.8v4.2c0 3.88-2.69 7.52-6.3 8.4-3.61-.88-6.3-4.51-6.3-8.4V7.1L12 4.3zm-.56 12.88l3.3-5.79.04-.08c.05-.1.01-.29-.26-.29h-1.96l.56-3.92h-.56L9.3 12.82c0 .03.07-.12-.03.07-.11.2-.12.37.2.37h1.97l-.56 3.92h.56z\"\n fill=\"#FFF\"\n />\n </g>\n </svg>\n );\n};\n\n/** @param {{deltaType: import('@lhci/utils/src/audit-diff-finder').DiffLabel}} props */\nexport const InstallableIcon = props => {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n class={`pwa-icon pwa-icon--${props.deltaType}`}\n >\n <g fill-rule=\"nonzero\" fill=\"none\">\n <circle class={`pwa-icon__background`} cx=\"12\" cy=\"12\" r=\"12\" />\n <path\n d=\"M12 5a7 7 0 1 0 0 14 7 7 0 0 0 0-14zm3.5 7.7h-2.8v2.8h-1.4v-2.8H8.5v-1.4h2.8V8.5h1.4v2.8h2.8v1.4z\"\n fill=\"#FFF\"\n />\n </g>\n </svg>\n );\n};\n\n/** @param {{deltaType: import('@lhci/utils/src/audit-diff-finder').DiffLabel}} props */\nexport const OptimizedIcon = props => {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n class={`pwa-icon pwa-icon--${props.deltaType}`}\n >\n <g fill=\"none\" fill-rule=\"evenodd\">\n <rect class={`pwa-icon__background`} width=\"24\" height=\"24\" rx=\"12\" />\n <path d=\"M5 5h14v14H5z\" />\n <path\n fill=\"#FFF\"\n d=\"M12 15.07l3.6 2.18-.95-4.1 3.18-2.76-4.2-.36L12 6.17l-1.64 3.86-4.2.36 3.2 2.76-.96 4.1z\"\n />\n </g>\n </svg>\n );\n};\n\n/**\n *\n * @param {PWABadgeStatus} base\n * @param {PWABadgeStatus} compare\n * @param {keyof PWABadgeStatus} key\n * @return {import('@lhci/utils/src/audit-diff-finder').DiffLabel}\n */\nexport function getBadgeDiffType(base, compare, key) {\n if (base[key] === compare[key]) return 'neutral';\n if (compare[key]) return 'improvement';\n return 'regression';\n}\n\n/** @param {LH.Result} lhr @return {PWABadgeStatus} */\nexport function getBadgeStatus(lhr) {\n const pwaCategory = lhr.categories.pwa;\n const auditsByCategory = _.groupIntoMap(pwaCategory.auditRefs, ref => ref.group);\n /** @param {LH.CategoryResult['auditRefs']} [refs] */\n const hasEveryPass = (refs = []) =>\n refs.map(ref => lhr.audits[ref.id]).every(audit => audit && audit.score === 1);\n return {\n optimized: hasEveryPass(auditsByCategory.get('pwa-optimized') || []),\n installable: hasEveryPass(auditsByCategory.get('pwa-installable') || []),\n fastAndReliable: hasEveryPass(auditsByCategory.get('pwa-fast-reliable') || []),\n };\n}\n\n/** @param {{status: PWABadgeStatus}} props */\nexport const PWAGauge = props => {\n const {status} = props;\n const all = status.optimized && status.installable && status.fastAndReliable;\n\n return (\n <div\n className={clsx('pwa-gauge', {\n 'pwa-gauge--all': all,\n 'pwa-gauge--pwa-optimized': !all && status.optimized,\n 'pwa-gauge--pwa-installable': !all && status.installable,\n 'pwa-gauge--pwa-fast-reliable': !all && status.fastAndReliable,\n })}\n >\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 60 60\">\n <defs>\n <linearGradient\n id=\"pwa-gauge__check-circle__gradient\"\n x1=\"50%\"\n y1=\"0%\"\n x2=\"50%\"\n y2=\"100%\"\n >\n <stop stop-color=\"#00C852\" offset=\"0%\" />\n <stop stop-color=\"#009688\" offset=\"100%\" />\n </linearGradient>\n <linearGradient\n id=\"pwa-gauge__installable__shadow-gradient\"\n x1=\"76.056%\"\n x2=\"24.111%\"\n y1=\"82.995%\"\n y2=\"24.735%\"\n >\n <stop stop-color=\"#A5D6A7\" offset=\"0%\" />\n <stop stop-color=\"#80CBC4\" offset=\"100%\" />\n </linearGradient>\n <linearGradient\n id=\"pwa-gauge__fast-reliable__shadow-gradient\"\n x1=\"76.056%\"\n y1=\"82.995%\"\n x2=\"25.678%\"\n y2=\"26.493%\"\n >\n <stop stop-color=\"#64B5F6\" offset=\"0%\" />\n <stop stop-color=\"#2979FF\" offset=\"100%\" />\n </linearGradient>\n\n <g id=\"pwa-gauge__fast-reliable-badge\">\n <circle fill=\"#FFFFFF\" cx=\"10\" cy=\"10\" r=\"10\" />\n <path\n fill=\"#304FFE\"\n d=\"M10 3.58l5.25 2.34v3.5c0 3.23-2.24 6.26-5.25 7-3.01-.74-5.25-3.77-5.25-7v-3.5L10 3.58zm-.47 10.74l2.76-4.83.03-.07c.04-.08 0-.24-.22-.24h-1.64l.47-3.26h-.47l-2.7 4.77c-.02.01.05-.1-.04.05-.09.16-.1.31.18.31h1.63l-.47 3.27h.47z\"\n />\n </g>\n <g id=\"pwa-gauge__installable-badge\">\n <circle fill=\"#FFFFFF\" cx=\"10\" cy=\"10\" r=\"10\" />\n <path\n fill=\"#009688\"\n d=\"M10 4.167A5.835 5.835 0 0 0 4.167 10 5.835 5.835 0 0 0 10 15.833 5.835 5.835 0 0 0 15.833 10 5.835 5.835 0 0 0 10 4.167zm2.917 6.416h-2.334v2.334H9.417v-2.334H7.083V9.417h2.334V7.083h1.166v2.334h2.334v1.166z\"\n />\n </g>\n </defs>\n\n <g stroke=\"none\" fill-rule=\"nonzero\">\n {/* Background and PWA logo (color by default) */}\n <circle class=\"pwa-gauge__disc\" cx=\"30\" cy=\"30\" r=\"30\" />\n <g class=\"pwa-gauge__logo\">\n <path\n class=\"pwa-gauge__logo--secondary-color\"\n d=\"M35.66 19.39l.7-1.75h2L37.4 15 38.6 12l3.4 9h-2.51l-.58-1.61z\"\n />\n <path\n class=\"pwa-gauge__logo--primary-color\"\n d=\"M33.52 21l3.65-9h-2.42l-2.5 5.82L30.5 12h-1.86l-1.9 5.82-1.35-2.65-1.21 3.72L25.4 21h2.38l1.72-5.2 1.64 5.2z\"\n />\n <path\n class=\"pwa-gauge__logo--secondary-color\"\n fill-rule=\"nonzero\"\n d=\"M20.3 17.91h1.48c.45 0 .85-.05 1.2-.15l.39-1.18 1.07-3.3a2.64 2.64 0 0 0-.28-.37c-.55-.6-1.36-.91-2.42-.91H18v9h2.3V17.9zm1.96-3.84c.22.22.33.5.33.87 0 .36-.1.65-.29.87-.2.23-.59.35-1.15.35h-.86v-2.41h.87c.52 0 .89.1 1.1.32z\"\n />\n </g>\n\n {/* No badges. */}\n <rect\n class=\"pwa-gauge__component pwa-gauge__na-line\"\n fill=\"#FFFFFF\"\n x=\"20\"\n y=\"32\"\n width=\"20\"\n height=\"4\"\n rx=\"2\"\n />\n\n {/* Just fast and reliable. */}\n <g\n class=\"pwa-gauge__component pwa-gauge__fast-reliable-badge\"\n transform=\"translate(20, 29)\"\n >\n <path\n fill=\"url(#pwa-gauge__fast-reliable__shadow-gradient)\"\n d=\"M33.63 19.49A30 30 0 0 1 16.2 30.36L3 17.14 17.14 3l16.49 16.49z\"\n />\n <use href=\"#pwa-gauge__fast-reliable-badge\" />\n </g>\n\n {/* Just installable. */}\n <g\n class=\"pwa-gauge__component pwa-gauge__installable-badge\"\n transform=\"translate(20, 29)\"\n >\n <path\n fill=\"url(#pwa-gauge__installable__shadow-gradient)\"\n d=\"M33.629 19.487c-4.272 5.453-10.391 9.39-17.415 10.869L3 17.142 17.142 3 33.63 19.487z\"\n />\n <use href=\"#pwa-gauge__installable-badge\" />\n </g>\n\n {/* Fast and reliable and installable. */}\n <g class=\"pwa-gauge__component pwa-gauge__fast-reliable-installable-badges\">\n <g transform=\"translate(8, 29)\">\n {/* fast and reliable */}\n <path\n fill=\"url(#pwa-gauge__fast-reliable__shadow-gradient)\"\n d=\"M16.321 30.463L3 17.143 17.142 3l22.365 22.365A29.864 29.864 0 0 1 22 31c-1.942 0-3.84-.184-5.679-.537z\"\n />\n <use href=\"#pwa-gauge__fast-reliable-badge\" />\n </g>\n <g transform=\"translate(32, 29)\">\n {/* installable */}\n <path\n fill=\"url(#pwa-gauge__installable__shadow-gradient)\"\n d=\"M25.982 11.84a30.107 30.107 0 0 1-13.08 15.203L3 17.143 17.142 3l8.84 8.84z\"\n />\n <use href=\"#pwa-gauge__installable-badge\" />\n </g>\n </g>\n\n {/* Full PWA. */}\n <g class=\"pwa-gauge__component pwa-gauge__check-circle\" transform=\"translate(18, 28)\">\n <circle fill=\"#FFFFFF\" cx=\"12\" cy=\"12\" r=\"12\" />\n <path\n fill=\"url(#pwa-gauge__check-circle__gradient)\"\n d=\"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z\"\n />\n </g>\n </g>\n </svg>\n </div>\n );\n};\n", "/**\n * @license Copyright 2020 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport {h} from 'preact';\nimport './score-delta-badge.css';\nimport {getDiffLabel} from '@lhci/utils/src/audit-diff-finder';\nimport clsx from 'clsx';\n\n/** @param {{diff: LHCI.NumericAuditDiff, className?: string}} props */\nexport const ScoreDeltaBadge = props => {\n const delta = Math.round((props.diff.compareValue - props.diff.baseValue) * 100);\n return (\n <div\n className={clsx(\n 'score-delta-badge',\n `score-delta-badge--${getDiffLabel(props.diff)}`,\n props.className\n )}\n >\n {delta < 0 ? delta : `+${delta}`}\n </div>\n );\n};\n", "/**\n * @license Copyright 2019 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport {h, Fragment} from 'preact';\nimport './lhr-comparison-scores.css';\nimport clsx from 'clsx';\n\nimport {Gauge} from '../../components/gauge';\nimport {\n PWAGauge,\n getBadgeStatus,\n FastReliableIcon,\n InstallableIcon,\n OptimizedIcon,\n getBadgeDiffType,\n} from '../../components/pwa-gauge';\nimport {ScoreDeltaBadge} from '../../components/score-delta-badge';\n\n/** @param {{lhr: LH.Result, baseLhr?: LH.Result, categoryId: string}} props */\nconst StandardScoreItem = props => {\n const {lhr, baseLhr, categoryId} = props;\n const category = lhr.categories[categoryId];\n const baseCategory = baseLhr && baseLhr.categories[categoryId];\n /** @type {LHCI.NumericAuditDiff|undefined} */\n const diff = baseCategory && {\n auditId: '',\n type: 'score',\n baseValue: baseCategory.score,\n compareValue: category.score,\n };\n\n return (\n <div key={categoryId} className={clsx('lhr-comparison-scores-item')}>\n <Gauge score={category.score} diff={diff} />\n <div className=\"lhr-comparison-scores-item__label\">{category.title}</div>\n {diff ? <ScoreDeltaBadge diff={diff} className=\"lhr-comparison-scores-item__delta\" /> : null}\n </div>\n );\n};\n\n/** @param {{lhr: LH.Result, baseLhr?: LH.Result, categoryId: string}} props */\nconst PwaScoreItem = props => {\n const {lhr, baseLhr, categoryId} = props;\n const compareStatus = getBadgeStatus(lhr);\n let deltaEl;\n const overallStatus = 'neutral';\n\n if (baseLhr) {\n const baseStatus = getBadgeStatus(baseLhr);\n const diffTypes = {\n fastAndReliable: getBadgeDiffType(baseStatus, compareStatus, 'fastAndReliable'),\n installable: getBadgeDiffType(baseStatus, compareStatus, 'installable'),\n optimized: getBadgeDiffType(baseStatus, compareStatus, 'optimized'),\n };\n const allEqual = Object.values(diffTypes).every(type => type === 'neutral');\n\n const individualBadges = (\n <Fragment>\n {diffTypes.fastAndReliable === 'neutral' ? (\n <Fragment />\n ) : (\n <FastReliableIcon deltaType={diffTypes.fastAndReliable} />\n )}\n {diffTypes.installable === 'neutral' ? (\n <Fragment />\n ) : (\n <InstallableIcon deltaType={diffTypes.installable} />\n )}\n {diffTypes.optimized === 'neutral' ? (\n <Fragment />\n ) : (\n <OptimizedIcon deltaType={diffTypes.optimized} />\n )}\n </Fragment>\n );\n\n deltaEl = (\n <div className={clsx('lhr-comparison-scores-item__delta')}>\n {allEqual ? '-' : individualBadges}\n </div>\n );\n }\n\n return (\n <div\n key={categoryId}\n className={clsx(\n 'lhr-comparison-scores-item',\n `lhr-comparison-scores-item--pwa`,\n `lhr-comparison-scores-item--${overallStatus}`\n )}\n >\n <PWAGauge status={compareStatus} />\n <div className=\"lhr-comparison-scores-item__label\">PWA</div>\n {deltaEl}\n </div>\n );\n};\n\n/**\n * @param {{lhr?: LH.Result, baseLhr?: LH.Result}} props\n */\nexport const LhrComparisonScores = props => {\n const {lhr, baseLhr} = props;\n if (!lhr) return null;\n\n const compareCategoryIds = Object.keys(lhr.categories);\n const baseCategoryIds = baseLhr ? Object.keys(baseLhr.categories) : compareCategoryIds;\n const categoryIds = compareCategoryIds.filter(id => baseCategoryIds.includes(id));\n\n return (\n <div className=\"lhr-comparison-scores\">\n {categoryIds\n .sort((idA, idB) => {\n const sortKeyA = idA === 'pwa' ? Infinity : categoryIds.indexOf(idA);\n const sortKeyB = idB === 'pwa' ? Infinity : categoryIds.indexOf(idB);\n return sortKeyA - sortKeyB;\n })\n .map(id => {\n return id === 'pwa' ? (\n <PwaScoreItem lhr={lhr} baseLhr={baseLhr} categoryId={id} />\n ) : (\n <StandardScoreItem lhr={lhr} baseLhr={baseLhr} categoryId={id} />\n );\n })}\n </div>\n );\n};\n", "/**\n * @license Copyright 2019 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport {h, Fragment} from 'preact';\nimport './audit-group.css';\nimport {Paper} from '../../../components/paper';\nimport {ScoreIcon} from '../../../components/score-icon';\nimport clsx from 'clsx';\nimport {AuditDiff} from './audit-diff';\nimport {useState} from 'preact/hooks';\nimport {openLhrInClassicViewer} from '../../../components/lhr-viewer-link';\n\n/** @typedef {{key?: string, group: {id: string, title: string}, selectedAuditId: string|null, setSelectedAuditId: (id: string|null) => void, pairs: Array<LHCI.AuditPair>, baseLhr?: LH.Result, showAsNarrow: boolean, showAsUnchanged: boolean}} Props */\n\n/** @param {Props & {showAsBigPicture: boolean, setShowAsBigPicture: (b: boolean) => void}} props */\nconst MetricsTabHeader = props => {\n return (\n <div className=\"audit-group__big-picture-tabs\">\n <span\n className={clsx('big-picture-tabs__tab', {\n 'big-picture-tabs__tab--selected': props.showAsBigPicture,\n })}\n onClick={() => props.setShowAsBigPicture(true)}\n >\n Overview\n </span>\n <span\n className={clsx('big-picture-tabs__tab', {\n 'big-picture-tabs__tab--selected': !props.showAsBigPicture,\n })}\n onClick={() => props.setShowAsBigPicture(false)}\n >\n Magnified\n </span>\n </div>\n );\n};\n\n/** @param {Props & {showAsBigPicture: boolean}} props */\nconst ChangedAuditList = props => {\n return (\n <Fragment>\n {props.pairs.map(pair => {\n const {audit} = pair;\n\n // Only metrics are allowed to display the numericValue diff in this view.\n if (props.group.id !== 'metrics') {\n pair = {...pair, diffs: pair.diffs.filter(diff => diff.type !== 'numericValue')};\n }\n\n return (\n <div\n key={audit.id}\n className={clsx('audit-group__audit')}\n onClick={() => props.setSelectedAuditId(audit.id || null)}\n >\n <div className=\"audit-group__audit-score\">\n <ScoreIcon score={audit.score || 0} />\n </div>\n <div className=\"audit-group__audit-title\">{audit.title}</div>\n <div className=\"audit-group__audit-diff\">\n <AuditDiff\n pair={pair}\n showAsBigPicture={props.showAsBigPicture}\n showAsNarrow={props.showAsNarrow}\n />\n </div>\n </div>\n );\n })}\n </Fragment>\n );\n};\n\n/** @param {Props & {expanded: boolean}} props */\nconst UnchangedAuditList = props => {\n const baseLhr = props.baseLhr;\n if (!baseLhr || !props.expanded) return <Fragment />;\n\n return (\n <Fragment>\n {props.pairs.map(pair => {\n const {audit} = pair;\n\n return (\n <div\n key={audit.id}\n className={clsx('audit-group__audit', 'audit-group__audit--unchanged')}\n onClick={e => {\n e.preventDefault();\n e.stopPropagation();\n openLhrInClassicViewer(baseLhr);\n }}\n >\n <div className=\"audit-group__audit-score\">\n <ScoreIcon score={audit.score || 0} />\n </div>\n <div className=\"audit-group__audit-title\">{audit.title}</div>\n <div className=\"audit-group__audit-diff\">Open Report</div>\n </div>\n );\n })}\n </Fragment>\n );\n};\n\n/** @param {Props} props */\nexport const AuditGroup = props => {\n const {group} = props;\n const [showAsBigPicture, setShowAsBigPicture] = useState(group.id === 'metrics');\n const [expanded, setExpanded] = useState(false);\n\n return (\n <Paper\n className={clsx('audit-group', {\n 'audit-group--expanded': expanded,\n 'audit-group--unchanged': props.showAsUnchanged,\n })}\n >\n <div className=\"audit-group__header\" onClick={() => setExpanded(!expanded)}>\n <div className=\"audit-group__title\">\n {group.title} {props.showAsUnchanged ? `(${props.pairs.length})` : ''}\n </div>\n <div className=\"audit-group__expand-toggle\">\n <i className=\"material-icons\">chevron_right</i>\n </div>\n {group.id === 'metrics' && !props.showAsNarrow ? (\n <MetricsTabHeader\n {...props}\n showAsBigPicture={showAsBigPicture}\n setShowAsBigPicture={setShowAsBigPicture}\n />\n ) : (\n <Fragment />\n )}\n </div>\n <div className=\"audit-group__audits\">\n {props.showAsUnchanged ? (\n <UnchangedAuditList {...props} expanded={expanded} />\n ) : (\n <ChangedAuditList {...props} showAsBigPicture={showAsBigPicture} />\n )}\n </div>\n </Paper>\n );\n};\n", "/**\n * @license Copyright 2019 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport {h} from 'preact';\nimport './lhr-comparison-legend.css';\nimport {ScoreIcon} from '../../components/score-icon';\n\nexport const LhrComparisonLegend = () => {\n return (\n <div className=\"lhr-comparison-legend\">\n <ScoreIcon score={0} />\n <span className=\"lhr-comparison-legend__label\">0-49</span>\n <ScoreIcon score={0.5} />\n <span className=\"lhr-comparison-legend__label\">50-89</span>\n <ScoreIcon score={1} />\n <span className=\"lhr-comparison-legend__label\">90-100</span>\n <i className=\"lhr-comparison-legend__chip lhr-comparison-legend__chip--regression\" />\n <span className=\"lhr-comparison-legend__label\">Regression</span>\n <i className=\"lhr-comparison-legend__chip lhr-comparison-legend__chip--improvement\" />\n <span className=\"lhr-comparison-legend__label\">Improvement</span>\n </div>\n );\n};\n", "/**\n * Assign properties from `props` to `obj`\n * @template O, P The obj and props types\n * @param {O} obj The object to copy properties to\n * @param {P} props The object to copy properties from\n * @returns {O & P}\n */\nexport function assign(obj, props) {\n\tfor (let i in props) obj[i] = props[i];\n\treturn /** @type {O & P} */ (obj);\n}\n\n/**\n * Check if two objects have a different shape\n * @param {object} a\n * @param {object} b\n * @returns {boolean}\n */\nexport function shallowDiffers(a, b) {\n\tfor (let i in a) if (i !== '__source' && !(i in b)) return true;\n\tfor (let i in b) if (i !== '__source' && a[i] !== b[i]) return true;\n\treturn false;\n}\n\n/**\n * Check if two values are the same value\n * @param {*} x\n * @param {*} y\n * @returns {boolean}\n */\nexport function is(x, y) {\n\treturn (x === y && (x !== 0 || 1 / x === 1 / y)) || (x !== x && y !== y);\n}\n", "import { Component } from 'preact';\nimport { shallowDiffers } from './util';\n\n/**\n * Component class with a predefined `shouldComponentUpdate` implementation\n */\nexport function PureComponent(p) {\n\tthis.props = p;\n}\nPureComponent.prototype = new Component();\n// Some third-party libraries check if this property is present\nPureComponent.prototype.isPureReactComponent = true;\nPureComponent.prototype.shouldComponentUpdate = function (props, state) {\n\treturn shallowDiffers(this.props, props) || shallowDiffers(this.state, state);\n};\n", "import { createElement } from 'preact';\nimport { shallowDiffers } from './util';\n\n/**\n * Memoize a component, so that it only updates when the props actually have\n * changed. This was previously known as `React.pure`.\n * @param {import('./internal').FunctionComponent} c functional component\n * @param {(prev: object, next: object) => boolean} [comparer] Custom equality function\n * @returns {import('./internal').FunctionComponent}\n */\nexport function memo(c, comparer) {\n\tfunction shouldUpdate(nextProps) {\n\t\tlet ref = this.props.ref;\n\t\tlet updateRef = ref == nextProps.ref;\n\t\tif (!updateRef && ref) {\n\t\t\tref.call ? ref(null) : (ref.current = null);\n\t\t}\n\n\t\tif (!comparer) {\n\t\t\treturn shallowDiffers(this.props, nextProps);\n\t\t}\n\n\t\treturn !comparer(this.props, nextProps) || !updateRef;\n\t}\n\n\tfunction Memoed(props) {\n\t\tthis.shouldComponentUpdate = shouldUpdate;\n\t\treturn createElement(c, props);\n\t}\n\tMemoed.displayName = 'Memo(' + (c.displayName || c.name) + ')';\n\tMemoed.prototype.isReactComponent = true;\n\tMemoed._forwarded = true;\n\treturn Memoed;\n}\n", "import { options } from 'preact';\nimport { assign } from './util';\n\nlet oldDiffHook = options._diff;\noptions._diff = vnode => {\n\tif (vnode.type && vnode.type._forwarded && vnode.ref) {\n\t\tvnode.props.ref = vnode.ref;\n\t\tvnode.ref = null;\n\t}\n\tif (oldDiffHook) oldDiffHook(vnode);\n};\n\nexport const REACT_FORWARD_SYMBOL =\n\t(typeof Symbol != 'undefined' &&\n\t\tSymbol.for &&\n\t\tSymbol.for('react.forward_ref')) ||\n\t0xf47;\n\n/**\n * Pass ref down to a child. This is mainly used in libraries with HOCs that\n * wrap components. Using `forwardRef` there is an easy way to get a reference\n * of the wrapped component instead of one of the wrapper itself.\n * @param {import('./index').ForwardFn} fn\n * @returns {import('./internal').FunctionComponent}\n */\nexport function forwardRef(fn) {\n\tfunction Forwarded(props) {\n\t\tlet clone = assign({}, props);\n\t\tdelete clone.ref;\n\t\treturn fn(clone, props.ref || null);\n\t}\n\n\t// mobx-react checks for this being present\n\tForwarded.$$typeof = REACT_FORWARD_SYMBOL;\n\t// mobx-react heavily relies on implementation details.\n\t// It expects an object here with a `render` property,\n\t// and prototype.render will fail. Without this\n\t// mobx-react throws.\n\tForwarded.render = Forwarded;\n\n\tForwarded.prototype.isReactComponent = Forwarded._forwarded = true;\n\tForwarded.displayName = 'ForwardRef(' + (fn.displayName || fn.name) + ')';\n\treturn Forwarded;\n}\n", "import { toChildArray } from 'preact';\n\nconst mapFn = (children, fn) => {\n\tif (children == null) return null;\n\treturn toChildArray(toChildArray(children).map(fn));\n};\n\n// This API is completely unnecessary for Preact, so it's basically passthrough.\nexport const Children = {\n\tmap: mapFn,\n\tforEach: mapFn,\n\tcount(children) {\n\t\treturn children ? toChildArray(children).length : 0;\n\t},\n\tonly(children) {\n\t\tconst normalized = toChildArray(children);\n\t\tif (normalized.length !== 1) throw 'Children.only';\n\t\treturn normalized[0];\n\t},\n\ttoArray: toChildArray\n};\n", "import { Component, createElement, options, Fragment } from 'preact';\nimport { MODE_HYDRATE } from '../../src/constants';\nimport { assign } from './util';\n\nconst oldCatchError = options._catchError;\noptions._catchError = function (error, newVNode, oldVNode, errorInfo) {\n\tif (error.then) {\n\t\t/** @type {import('./internal').Component} */\n\t\tlet component;\n\t\tlet vnode = newVNode;\n\n\t\tfor (; (vnode = vnode._parent); ) {\n\t\t\tif ((component = vnode._component) && component._childDidSuspend) {\n\t\t\t\tif (newVNode._dom == null) {\n\t\t\t\t\tnewVNode._dom = oldVNode._dom;\n\t\t\t\t\tnewVNode._children = oldVNode._children;\n\t\t\t\t}\n\t\t\t\t// Don't call oldCatchError if we found a Suspense\n\t\t\t\treturn component._childDidSuspend(error, newVNode);\n\t\t\t}\n\t\t}\n\t}\n\toldCatchError(error, newVNode, oldVNode, errorInfo);\n};\n\nconst oldUnmount = options.unmount;\noptions.unmount = function (vnode) {\n\t/** @type {import('./internal').Component} */\n\tconst component = vnode._component;\n\tif (component && component._onResolve) {\n\t\tcomponent._onResolve();\n\t}\n\n\t// if the component is still hydrating\n\t// most likely it is because the component is suspended\n\t// we set the vnode.type as `null` so that it is not a typeof function\n\t// so the unmount will remove the vnode._dom\n\tif (component && vnode._flags & MODE_HYDRATE) {\n\t\tvnode.type = null;\n\t}\n\n\tif (oldUnmount) oldUnmount(vnode);\n};\n\nfunction detachedClone(vnode, detachedParent, parentDom) {\n\tif (vnode) {\n\t\tif (vnode._component && vnode._component.__hooks) {\n\t\t\tvnode._component.__hooks._list.forEach(effect => {\n\t\t\t\tif (typeof effect._cleanup == 'function') effect._cleanup();\n\t\t\t});\n\n\t\t\tvnode._component.__hooks = null;\n\t\t}\n\n\t\tvnode = assign({}, vnode);\n\t\tif (vnode._component != null) {\n\t\t\tif (vnode._component._parentDom === parentDom) {\n\t\t\t\tvnode._component._parentDom = detachedParent;\n\t\t\t}\n\t\t\tvnode._component = null;\n\t\t}\n\n\t\tvnode._children =\n\t\t\tvnode._children &&\n\t\t\tvnode._children.map(child =>\n\t\t\t\tdetachedClone(child, detachedParent, parentDom)\n\t\t\t);\n\t}\n\n\treturn vnode;\n}\n\nfunction removeOriginal(vnode, detachedParent, originalParent) {\n\tif (vnode && originalParent) {\n\t\tvnode._original = null;\n\t\tvnode._children =\n\t\t\tvnode._children &&\n\t\t\tvnode._children.map(child =>\n\t\t\t\tremoveOriginal(child, detachedParent, originalParent)\n\t\t\t);\n\n\t\tif (vnode._component) {\n\t\t\tif (vnode._component._parentDom === detachedParent) {\n\t\t\t\tif (vnode._dom) {\n\t\t\t\t\toriginalParent.appendChild(vnode._dom);\n\t\t\t\t}\n\t\t\t\tvnode._component._force = true;\n\t\t\t\tvnode._component._parentDom = originalParent;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn vnode;\n}\n\n// having custom inheritance instead of a class here saves a lot of bytes\nexport function Suspense() {\n\t// we do not call super here to golf some bytes...\n\tthis._pendingSuspensionCount = 0;\n\tthis._suspenders = null;\n\tthis._detachOnNextRender = null;\n}\n\n// Things we do here to save some bytes but are not proper JS inheritance:\n// - call `new Component()` as the prototype\n// - do not set `Suspense.prototype.constructor` to `Suspense`\nSuspense.prototype = new Component();\n\n/**\n * @this {import('./internal').SuspenseComponent}\n * @param {Promise} promise The thrown promise\n * @param {import('./internal').VNode<any, any>} suspendingVNode The suspending component\n */\nSuspense.prototype._childDidSuspend = function (promise, suspendingVNode) {\n\tconst suspendingComponent = suspendingVNode._component;\n\n\t/** @type {import('./internal').SuspenseComponent} */\n\tconst c = this;\n\n\tif (c._suspenders == null) {\n\t\tc._suspenders = [];\n\t}\n\tc._suspenders.push(suspendingComponent);\n\n\tconst resolve = suspended(c._vnode);\n\n\tlet resolved = false;\n\tconst onResolved = () => {\n\t\tif (resolved) return;\n\n\t\tresolved = true;\n\t\tsuspendingComponent._onResolve = null;\n\n\t\tif (resolve) {\n\t\t\tresolve(onSuspensionComplete);\n\t\t} else {\n\t\t\tonSuspensionComplete();\n\t\t}\n\t};\n\n\tsuspendingComponent._onResolve = onResolved;\n\n\tconst onSuspensionComplete = () => {\n\t\tif (!--c._pendingSuspensionCount) {\n\t\t\t// If the suspension was during hydration we don't need to restore the\n\t\t\t// suspended children into the _children array\n\t\t\tif (c.state._suspended) {\n\t\t\t\tconst suspendedVNode = c.state._suspended;\n\t\t\t\tc._vnode._children[0] = removeOriginal(\n\t\t\t\t\tsuspendedVNode,\n\t\t\t\t\tsuspendedVNode._component._parentDom,\n\t\t\t\t\tsuspendedVNode._component._originalParentDom\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tc.setState({ _suspended: (c._detachOnNextRender = null) });\n\n\t\t\tlet suspended;\n\t\t\twhile ((suspended = c._suspenders.pop())) {\n\t\t\t\tsuspended.forceUpdate();\n\t\t\t}\n\t\t}\n\t};\n\n\t/**\n\t * We do not set `suspended: true` during hydration because we want the actual markup\n\t * to remain on screen and hydrate it when the suspense actually gets resolved.\n\t * While in non-hydration cases the usual fallback -> component flow would occour.\n\t */\n\tif (\n\t\t!c._pendingSuspensionCount++ &&\n\t\t!(suspendingVNode._flags & MODE_HYDRATE)\n\t) {\n\t\tc.setState({ _suspended: (c._detachOnNextRender = c._vnode._children[0]) });\n\t}\n\tpromise.then(onResolved, onResolved);\n};\n\nSuspense.prototype.componentWillUnmount = function () {\n\tthis._suspenders = [];\n};\n\n/**\n * @this {import('./internal').SuspenseComponent}\n * @param {import('./internal').SuspenseComponent[\"props\"]} props\n * @param {import('./internal').SuspenseState} state\n */\nSuspense.prototype.render = function (props, state) {\n\tif (this._detachOnNextRender) {\n\t\t// When the Suspense's _vnode was created by a call to createVNode\n\t\t// (i.e. due to a setState further up in the tree)\n\t\t// it's _children prop is null, in this case we \"forget\" about the parked vnodes to detach\n\t\tif (this._vnode._children) {\n\t\t\tconst detachedParent = document.createElement('div');\n\t\t\tconst detachedComponent = this._vnode._children[0]._component;\n\t\t\tthis._vnode._children[0] = detachedClone(\n\t\t\t\tthis._detachOnNextRender,\n\t\t\t\tdetachedParent,\n\t\t\t\t(detachedComponent._originalParentDom = detachedComponent._parentDom)\n\t\t\t);\n\t\t}\n\n\t\tthis._detachOnNextRender = null;\n\t}\n\n\t// Wrap fallback tree in a VNode that prevents itself from being marked as aborting mid-hydration:\n\t/** @type {import('./internal').VNode} */\n\tconst fallback =\n\t\tstate._suspended && createElement(Fragment, null, props.fallback);\n\tif (fallback) fallback._flags &= ~MODE_HYDRATE;\n\n\treturn [\n\t\tcreateElement(Fragment, null, state._suspended ? null : props.children),\n\t\tfallback\n\t];\n};\n\n/**\n * Checks and calls the parent component's _suspended method, passing in the\n * suspended vnode. This is a way for a parent (e.g. SuspenseList) to get notified\n * that one of its children/descendants suspended.\n *\n * The parent MAY return a callback. The callback will get called when the\n * suspension resolves, notifying the parent of the fact.\n * Moreover, the callback gets function `unsuspend` as a parameter. The resolved\n * child descendant will not actually get unsuspended until `unsuspend` gets called.\n * This is a way for the parent to delay unsuspending.\n *\n * If the parent does not return a callback then the resolved vnode\n * gets unsuspended immediately when it resolves.\n *\n * @param {import('./internal').VNode} vnode\n * @returns {((unsuspend: () => void) => void)?}\n */\nexport function suspended(vnode) {\n\t/** @type {import('./internal').Component} */\n\tlet component = vnode._parent._component;\n\treturn component && component._suspended && component._suspended(vnode);\n}\n\nexport function lazy(loader) {\n\tlet prom;\n\tlet component;\n\tlet error;\n\n\tfunction Lazy(props) {\n\t\tif (!prom) {\n\t\t\tprom = loader();\n\t\t\tprom.then(\n\t\t\t\texports => {\n\t\t\t\t\tcomponent = exports.default || exports;\n\t\t\t\t},\n\t\t\t\te => {\n\t\t\t\t\terror = e;\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\n\t\tif (error) {\n\t\t\tthrow error;\n\t\t}\n\n\t\tif (!component) {\n\t\t\tthrow prom;\n\t\t}\n\n\t\treturn createElement(component, props);\n\t}\n\n\tLazy.displayName = 'Lazy';\n\tLazy._forwarded = true;\n\treturn Lazy;\n}\n", "import { Component, toChildArray } from 'preact';\nimport { suspended } from './suspense.js';\n\n// Indexes to linked list nodes (nodes are stored as arrays to save bytes).\nconst SUSPENDED_COUNT = 0;\nconst RESOLVED_COUNT = 1;\nconst NEXT_NODE = 2;\n\n// Having custom inheritance instead of a class here saves a lot of bytes.\nexport function SuspenseList() {\n\tthis._next = null;\n\tthis._map = null;\n}\n\n// Mark one of child's earlier suspensions as resolved.\n// Some pending callbacks may become callable due to this\n// (e.g. the last suspended descendant gets resolved when\n// revealOrder === 'together'). Process those callbacks as well.\nconst resolve = (list, child, node) => {\n\tif (++node[RESOLVED_COUNT] === node[SUSPENDED_COUNT]) {\n\t\t// The number a child (or any of its descendants) has been suspended\n\t\t// matches the number of times it's been resolved. Therefore we\n\t\t// mark the child as completely resolved by deleting it from ._map.\n\t\t// This is used to figure out when *all* children have been completely\n\t\t// resolved when revealOrder is 'together'.\n\t\tlist._map.delete(child);\n\t}\n\n\t// If revealOrder is falsy then we can do an early exit, as the\n\t// callbacks won't get queued in the node anyway.\n\t// If revealOrder is 'together' then also do an early exit\n\t// if all suspended descendants have not yet been resolved.\n\tif (\n\t\t!list.props.revealOrder ||\n\t\t(list.props.revealOrder[0] === 't' && list._map.size)\n\t) {\n\t\treturn;\n\t}\n\n\t// Walk the currently suspended children in order, calling their\n\t// stored callbacks on the way. Stop if we encounter a child that\n\t// has not been completely resolved yet.\n\tnode = list._next;\n\twhile (node) {\n\t\twhile (node.length > 3) {\n\t\t\tnode.pop()();\n\t\t}\n\t\tif (node[RESOLVED_COUNT] < node[SUSPENDED_COUNT]) {\n\t\t\tbreak;\n\t\t}\n\t\tlist._next = node = node[NEXT_NODE];\n\t}\n};\n\n// Things we do here to save some bytes but are not proper JS inheritance:\n// - call `new Component()` as the prototype\n// - do not set `Suspense.prototype.constructor` to `Suspense`\nSuspenseList.prototype = new Component();\n\nSuspenseList.prototype._suspended = function (child) {\n\tconst list = this;\n\tconst delegated = suspended(list._vnode);\n\n\tlet node = list._map.get(child);\n\tnode[SUSPENDED_COUNT]++;\n\n\treturn unsuspend => {\n\t\tconst wrappedUnsuspend = () => {\n\t\t\tif (!list.props.revealOrder) {\n\t\t\t\t// Special case the undefined (falsy) revealOrder, as there\n\t\t\t\t// is no need to coordinate a specific order or unsuspends.\n\t\t\t\tunsuspend();\n\t\t\t} else {\n\t\t\t\tnode.push(unsuspend);\n\t\t\t\tresolve(list, child, node);\n\t\t\t}\n\t\t};\n\t\tif (delegated) {\n\t\t\tdelegated(wrappedUnsuspend);\n\t\t} else {\n\t\t\twrappedUnsuspend();\n\t\t}\n\t};\n};\n\nSuspenseList.prototype.render = function (props) {\n\tthis._next = null;\n\tthis._map = new Map();\n\n\tconst children = toChildArray(props.children);\n\tif (props.revealOrder && props.revealOrder[0] === 'b') {\n\t\t// If order === 'backwards' (or, well, anything starting with a 'b')\n\t\t// then flip the child list around so that the last child will be\n\t\t// the first in the linked list.\n\t\tchildren.reverse();\n\t}\n\t// Build the linked list. Iterate through the children in reverse order\n\t// so that `_next` points to the first linked list node to be resolved.\n\tfor (let i = children.length; i--; ) {\n\t\t// Create a new linked list node as an array of form:\n\t\t// \t[suspended_count, resolved_count, next_node]\n\t\t// where suspended_count and resolved_count are numeric counters for\n\t\t// keeping track how many times a node has been suspended and resolved.\n\t\t//\n\t\t// Note that suspended_count starts from 1 instead of 0, so we can block\n\t\t// processing callbacks until componentDidMount has been called. In a sense\n\t\t// node is suspended at least until componentDidMount gets called!\n\t\t//\n\t\t// Pending callbacks are added to the end of the node:\n\t\t// \t[suspended_count, resolved_count, next_node, callback_0, callback_1, ...]\n\t\tthis._map.set(children[i], (this._next = [1, 0, this._next]));\n\t}\n\treturn props.children;\n};\n\nSuspenseList.prototype.componentDidUpdate =\n\tSuspenseList.prototype.componentDidMount = function () {\n\t\t// Iterate through all children after mounting for two reasons:\n\t\t// 1. As each node[SUSPENDED_COUNT] starts from 1, this iteration increases\n\t\t// each node[RELEASED_COUNT] by 1, therefore balancing the counters.\n\t\t// The nodes can now be completely consumed from the linked list.\n\t\t// 2. Handle nodes that might have gotten resolved between render and\n\t\t// componentDidMount.\n\t\tthis._map.forEach((node, child) => {\n\t\t\tresolve(this, child, node);\n\t\t});\n\t};\n", "/** Normal hydration that attaches to a DOM tree but does not diff it. */\nexport const MODE_HYDRATE = 1 << 5;\n/** Signifies this VNode suspended on the previous render */\nexport const MODE_SUSPENDED = 1 << 7;\n/** Indicates that this node needs to be inserted while patching children */\nexport const INSERT_VNODE = 1 << 16;\n/** Indicates a VNode has been matched with another VNode in the diff */\nexport const MATCHED = 1 << 17;\n\n/** Reset all mode flags */\nexport const RESET_MODE = ~(MODE_HYDRATE | MODE_SUSPENDED);\n\nexport const EMPTY_OBJ = /** @type {any} */ ({});\nexport const EMPTY_ARR = [];\nexport const IS_NON_DIMENSIONAL =\n\t/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;\n", "import { createElement, render } from 'preact';\n\n/**\n * @param {import('../../src/index').RenderableProps<{ context: any }>} props\n */\nfunction ContextProvider(props) {\n\tthis.getChildContext = () => props.context;\n\treturn props.children;\n}\n\n/**\n * Portal component\n * @this {import('./internal').Component}\n * @param {object | null | undefined} props\n *\n * TODO: use createRoot() instead of fake root\n */\nfunction Portal(props) {\n\tconst _this = this;\n\tlet container = props._container;\n\n\t_this.componentWillUnmount = function () {\n\t\trender(null, _this._temp);\n\t\t_this._temp = null;\n\t\t_this._container = null;\n\t};\n\n\t// When we change container we should clear our old container and\n\t// indicate a new mount.\n\tif (_this._container && _this._container !== container) {\n\t\t_this.componentWillUnmount();\n\t}\n\n\tif (!_this._temp) {\n\t\t_this._container = container;\n\n\t\t// Create a fake DOM parent node that manages a subset of `container`'s children:\n\t\t_this._temp = {\n\t\t\tnodeType: 1,\n\t\t\tparentNode: container,\n\t\t\tchildNodes: [],\n\t\t\tappendChild(child) {\n\t\t\t\tthis.childNodes.push(child);\n\t\t\t\t_this._container.appendChild(child);\n\t\t\t},\n\t\t\tinsertBefore(child, before) {\n\t\t\t\tthis.childNodes.push(child);\n\t\t\t\t_this._container.appendChild(child);\n\t\t\t},\n\t\t\tremoveChild(child) {\n\t\t\t\tthis.childNodes.splice(this.childNodes.indexOf(child) >>> 1, 1);\n\t\t\t\t_this._container.removeChild(child);\n\t\t\t}\n\t\t};\n\t}\n\n\t// Render our wrapping element into temp.\n\trender(\n\t\tcreateElement(ContextProvider, { context: _this.context }, props._vnode),\n\t\t_this._temp\n\t);\n}\n\n/**\n * Create a `Portal` to continue rendering the vnode tree at a different DOM node\n * @param {import('./internal').VNode} vnode The vnode to render\n * @param {import('./internal').PreactElement} container The DOM node to continue rendering in to.\n */\nexport function createPortal(vnode, container) {\n\tconst el = createElement(Portal, { _vnode: vnode, _container: container });\n\tel.containerInfo = container;\n\treturn el;\n}\n", "import {\n\trender as preactRender,\n\thydrate as preactHydrate,\n\toptions,\n\ttoChildArray,\n\tComponent\n} from 'preact';\n\nexport const REACT_ELEMENT_TYPE =\n\t(typeof Symbol != 'undefined' && Symbol.for && Symbol.for('react.element')) ||\n\t0xeac7;\n\nconst CAMEL_PROPS =\n\t/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/;\nconst ON_ANI = /^on(Ani|Tra|Tou|BeforeInp|Compo)/;\nconst CAMEL_REPLACE = /[A-Z0-9]/g;\n\nconst IS_DOM = typeof document !== 'undefined';\n\n// Input types for which onchange should not be converted to oninput.\n// type=\"file|checkbox|radio\", plus \"range\" in IE11.\n// (IE11 doesn't support Symbol, which we use here to turn `rad` into `ra` which matches \"range\")\nconst onChangeInputType = type =>\n\t(typeof Symbol != 'undefined' && typeof Symbol() == 'symbol'\n\t\t? /fil|che|rad/\n\t\t: /fil|che|ra/\n\t).test(type);\n\n// Some libraries like `react-virtualized` explicitly check for this.\nComponent.prototype.isReactComponent = {};\n\n// `UNSAFE_*` lifecycle hooks\n// Preact only ever invokes the unprefixed methods.\n// Here we provide a base \"fallback\" implementation that calls any defined UNSAFE_ prefixed method.\n// - If a component defines its own `componentDidMount()` (including via defineProperty), use that.\n// - If a component defines `UNSAFE_componentDidMount()`, `componentDidMount` is the alias getter/setter.\n// - If anything assigns to an `UNSAFE_*` property, the assignment is forwarded to the unprefixed property.\n// See https://github.com/preactjs/preact/issues/1941\n[\n\t'componentWillMount',\n\t'componentWillReceiveProps',\n\t'componentWillUpdate'\n].forEach(key => {\n\tObject.defineProperty(Component.prototype, key, {\n\t\tconfigurable: true,\n\t\tget() {\n\t\t\treturn this['UNSAFE_' + key];\n\t\t},\n\t\tset(v) {\n\t\t\tObject.defineProperty(this, key, {\n\t\t\t\tconfigurable: true,\n\t\t\t\twritable: true,\n\t\t\t\tvalue: v\n\t\t\t});\n\t\t}\n\t});\n});\n\n/**\n * Proxy render() since React returns a Component reference.\n * @param {import('./internal').VNode} vnode VNode tree to render\n * @param {import('./internal').PreactElement} parent DOM node to render vnode tree into\n * @param {() => void} [callback] Optional callback that will be called after rendering\n * @returns {import('./internal').Component | null} The root component reference or null\n */\nexport function render(vnode, parent, callback) {\n\t// React destroys any existing DOM nodes, see #1727\n\t// ...but only on the first render, see #1828\n\tif (parent._children == null) {\n\t\tparent.textContent = '';\n\t}\n\n\tpreactRender(vnode, parent);\n\tif (typeof callback == 'function') callback();\n\n\treturn vnode ? vnode._component : null;\n}\n\nexport function hydrate(vnode, parent, callback) {\n\tpreactHydrate(vnode, parent);\n\tif (typeof callback == 'function') callback();\n\n\treturn vnode ? vnode._component : null;\n}\n\nlet oldEventHook = options.event;\noptions.event = e => {\n\tif (oldEventHook) e = oldEventHook(e);\n\n\te.persist = empty;\n\te.isPropagationStopped = isPropagationStopped;\n\te.isDefaultPrevented = isDefaultPrevented;\n\treturn (e.nativeEvent = e);\n};\n\nfunction empty() {}\n\nfunction isPropagationStopped() {\n\treturn this.cancelBubble;\n}\n\nfunction isDefaultPrevented() {\n\treturn this.defaultPrevented;\n}\n\nconst classNameDescriptorNonEnumberable = {\n\tenumerable: false,\n\tconfigurable: true,\n\tget() {\n\t\treturn this.class;\n\t}\n};\n\nfunction handleDomVNode(vnode) {\n\tlet props = vnode.props,\n\t\ttype = vnode.type,\n\t\tnormalizedProps = {};\n\n\tfor (let i in props) {\n\t\tlet value = props[i];\n\n\t\tif (\n\t\t\t(i === 'value' && 'defaultValue' in props && value == null) ||\n\t\t\t// Emulate React's behavior of not rendering the contents of noscript tags on the client.\n\t\t\t(IS_DOM && i === 'children' && type === 'noscript') ||\n\t\t\ti === 'class' ||\n\t\t\ti === 'className'\n\t\t) {\n\t\t\t// Skip applying value if it is null/undefined and we already set\n\t\t\t// a default value\n\t\t\tcontinue;\n\t\t}\n\n\t\tlet lowerCased = i.toLowerCase();\n\t\tif (i === 'defaultValue' && 'value' in props && props.value == null) {\n\t\t\t// `defaultValue` is treated as a fallback `value` when a value prop is present but null/undefined.\n\t\t\t// `defaultValue` for Elements with no value prop is the same as the DOM defaultValue property.\n\t\t\ti = 'value';\n\t\t} else if (i === 'download' && value === true) {\n\t\t\t// Calling `setAttribute` with a truthy value will lead to it being\n\t\t\t// passed as a stringified value, e.g. `download=\"true\"`. React\n\t\t\t// converts it to an empty string instead, otherwise the attribute\n\t\t\t// value will be used as the file name and the file will be called\n\t\t\t// \"true\" upon downloading it.\n\t\t\tvalue = '';\n\t\t} else if (lowerCased === 'ondoubleclick') {\n\t\t\ti = 'ondblclick';\n\t\t} else if (\n\t\t\tlowerCased === 'onchange' &&\n\t\t\t(type === 'input' || type === 'textarea') &&\n\t\t\t!onChangeInputType(props.type)\n\t\t) {\n\t\t\tlowerCased = i = 'oninput';\n\t\t} else if (lowerCased === 'onfocus') {\n\t\t\ti = 'onfocusin';\n\t\t} else if (lowerCased === 'onblur') {\n\t\t\ti = 'onfocusout';\n\t\t} else if (ON_ANI.test(i)) {\n\t\t\ti = lowerCased;\n\t\t} else if (type.indexOf('-') === -1 && CAMEL_PROPS.test(i)) {\n\t\t\ti = i.replace(CAMEL_REPLACE, '-$&').toLowerCase();\n\t\t} else if (value === null) {\n\t\t\tvalue = undefined;\n\t\t}\n\n\t\t// Add support for onInput and onChange, see #3561\n\t\t// if we have an oninput prop already change it to oninputCapture\n\t\tif (lowerCased === 'oninput') {\n\t\t\ti = lowerCased;\n\t\t\tif (normalizedProps[i]) {\n\t\t\t\ti = 'oninputCapture';\n\t\t\t}\n\t\t}\n\n\t\tnormalizedProps[i] = value;\n\t}\n\n\t// Add support for array select values: <select multiple value={[]} />\n\tif (\n\t\ttype == 'select' &&\n\t\tnormalizedProps.multiple &&\n\t\tArray.isArray(normalizedProps.value)\n\t) {\n\t\t// forEach() always returns undefined, which we abuse here to unset the value prop.\n\t\tnormalizedProps.value = toChildArray(props.children).forEach(child => {\n\t\t\tchild.props.selected =\n\t\t\t\tnormalizedProps.value.indexOf(child.props.value) != -1;\n\t\t});\n\t}\n\n\t// Adding support for defaultValue in select tag\n\tif (type == 'select' && normalizedProps.defaultValue != null) {\n\t\tnormalizedProps.value = toChildArray(props.children).forEach(child => {\n\t\t\tif (normalizedProps.multiple) {\n\t\t\t\tchild.props.selected =\n\t\t\t\t\tnormalizedProps.defaultValue.indexOf(child.props.value) != -1;\n\t\t\t} else {\n\t\t\t\tchild.props.selected =\n\t\t\t\t\tnormalizedProps.defaultValue == child.props.value;\n\t\t\t}\n\t\t});\n\t}\n\n\tif (props.class && !props.className) {\n\t\tnormalizedProps.class = props.class;\n\t\tObject.defineProperty(\n\t\t\tnormalizedProps,\n\t\t\t'className',\n\t\t\tclassNameDescriptorNonEnumberable\n\t\t);\n\t} else if (props.className && !props.class) {\n\t\tnormalizedProps.class = normalizedProps.className = props.className;\n\t} else if (props.class && props.className) {\n\t\tnormalizedProps.class = normalizedProps.className = props.className;\n\t}\n\n\tvnode.props = normalizedProps;\n}\n\nlet oldVNodeHook = options.vnode;\noptions.vnode = vnode => {\n\t// only normalize props on Element nodes\n\tif (typeof vnode.type === 'string') {\n\t\thandleDomVNode(vnode);\n\t}\n\n\tvnode.$$typeof = REACT_ELEMENT_TYPE;\n\n\tif (oldVNodeHook) oldVNodeHook(vnode);\n};\n\n// Only needed for react-relay\nlet currentComponent;\nconst oldBeforeRender = options._render;\noptions._render = function (vnode) {\n\tif (oldBeforeRender) {\n\t\toldBeforeRender(vnode);\n\t}\n\tcurrentComponent = vnode._component;\n};\n\nconst oldDiffed = options.diffed;\n/** @type {(vnode: import('./internal').VNode) => void} */\noptions.diffed = function (vnode) {\n\tif (oldDiffed) {\n\t\toldDiffed(vnode);\n\t}\n\n\tconst props = vnode.props;\n\tconst dom = vnode._dom;\n\n\tif (\n\t\tdom != null &&\n\t\tvnode.type === 'textarea' &&\n\t\t'value' in props &&\n\t\tprops.value !== dom.value\n\t) {\n\t\tdom.value = props.value == null ? '' : props.value;\n\t}\n\n\tcurrentComponent = null;\n};\n\n// This is a very very private internal function for React it\n// is used to sort-of do runtime dependency injection. So far\n// only `react-relay` makes use of it. It uses it to read the\n// context value.\nexport const __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = {\n\tReactCurrentDispatcher: {\n\t\tcurrent: {\n\t\t\treadContext(context) {\n\t\t\t\treturn currentComponent._globalContext[context._id].props.value;\n\t\t\t}\n\t\t}\n\t}\n};\n", "import {\n\tcreateElement,\n\trender as preactRender,\n\tcloneElement as preactCloneElement,\n\tcreateRef,\n\tComponent,\n\tcreateContext,\n\tFragment\n} from 'preact';\nimport {\n\tuseState,\n\tuseId,\n\tuseReducer,\n\tuseEffect,\n\tuseLayoutEffect,\n\tuseRef,\n\tuseImperativeHandle,\n\tuseMemo,\n\tuseCallback,\n\tuseContext,\n\tuseDebugValue\n} from 'preact/hooks';\nimport { PureComponent } from './PureComponent';\nimport { memo } from './memo';\nimport { forwardRef } from './forwardRef';\nimport { Children } from './Children';\nimport { Suspense, lazy } from './suspense';\nimport { SuspenseList } from './suspense-list';\nimport { createPortal } from './portals';\nimport { is } from './util';\nimport {\n\thydrate,\n\trender,\n\tREACT_ELEMENT_TYPE,\n\t__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED\n} from './render';\n\nconst version = '17.0.2'; // trick libraries to think we are react\n\n/**\n * Legacy version of createElement.\n * @param {import('./internal').VNode[\"type\"]} type The node name or Component constructor\n */\nfunction createFactory(type) {\n\treturn createElement.bind(null, type);\n}\n\n/**\n * Check if the passed element is a valid (p)react node.\n * @param {*} element The element to check\n * @returns {boolean}\n */\nfunction isValidElement(element) {\n\treturn !!element && element.$$typeof === REACT_ELEMENT_TYPE;\n}\n\n/**\n * Check if the passed element is a Fragment node.\n * @param {*} element The element to check\n * @returns {boolean}\n */\nfunction isFragment(element) {\n\treturn isValidElement(element) && element.type === Fragment;\n}\n\n/**\n * Wrap `cloneElement` to abort if the passed element is not a valid element and apply\n * all vnode normalizations.\n * @param {import('./internal').VNode} element The vnode to clone\n * @param {object} props Props to add when cloning\n * @param {Array<import('./internal').ComponentChildren>} rest Optional component children\n */\nfunction cloneElement(element) {\n\tif (!isValidElement(element)) return element;\n\treturn preactCloneElement.apply(null, arguments);\n}\n\n/**\n * Remove a component tree from the DOM, including state and event handlers.\n * @param {import('./internal').PreactElement} container\n * @returns {boolean}\n */\nfunction unmountComponentAtNode(container) {\n\tif (container._children) {\n\t\tpreactRender(null, container);\n\t\treturn true;\n\t}\n\treturn false;\n}\n\n/**\n * Get the matching DOM node for a component\n * @param {import('./internal').Component} component\n * @returns {import('./internal').PreactElement | null}\n */\nfunction findDOMNode(component) {\n\treturn (\n\t\t(component &&\n\t\t\t(component.base || (component.nodeType === 1 && component))) ||\n\t\tnull\n\t);\n}\n\n/**\n * Deprecated way to control batched rendering inside the reconciler, but we\n * already schedule in batches inside our rendering code\n * @template Arg\n * @param {(arg: Arg) => void} callback function that triggers the updated\n * @param {Arg} [arg] Optional argument that can be passed to the callback\n */\n// eslint-disable-next-line camelcase\nconst unstable_batchedUpdates = (callback, arg) => callback(arg);\n\n/**\n * In React, `flushSync` flushes the entire tree and forces a rerender. It's\n * implmented here as a no-op.\n * @template Arg\n * @template Result\n * @param {(arg: Arg) => Result} callback function that runs before the flush\n * @param {Arg} [arg] Optional argument that can be passed to the callback\n * @returns\n */\nconst flushSync = (callback, arg) => callback(arg);\n\n/**\n * Strict Mode is not implemented in Preact, so we provide a stand-in for it\n * that just renders its children without imposing any restrictions.\n */\nconst StrictMode = Fragment;\n\nexport function startTransition(cb) {\n\tcb();\n}\n\nexport function useDeferredValue(val) {\n\treturn val;\n}\n\nexport function useTransition() {\n\treturn [false, startTransition];\n}\n\n// TODO: in theory this should be done after a VNode is diffed as we want to insert\n// styles/... before it attaches\nexport const useInsertionEffect = useLayoutEffect;\n\n// compat to react-is\nexport const isElement = isValidElement;\n\n/**\n * This is taken from https://github.com/facebook/react/blob/main/packages/use-sync-external-store/src/useSyncExternalStoreShimClient.js#L84\n * on a high level this cuts out the warnings, ... and attempts a smaller implementation\n * @typedef {{ _value: any; _getSnapshot: () => any }} Store\n */\nexport function useSyncExternalStore(subscribe, getSnapshot) {\n\tconst value = getSnapshot();\n\n\t/**\n\t * @typedef {{ _instance: Store }} StoreRef\n\t * @type {[StoreRef, (store: StoreRef) => void]}\n\t */\n\tconst [{ _instance }, forceUpdate] = useState({\n\t\t_instance: { _value: value, _getSnapshot: getSnapshot }\n\t});\n\n\tuseLayoutEffect(() => {\n\t\t_instance._value = value;\n\t\t_instance._getSnapshot = getSnapshot;\n\n\t\tif (didSnapshotChange(_instance)) {\n\t\t\tforceUpdate({ _instance });\n\t\t}\n\t}, [subscribe, value, getSnapshot]);\n\n\tuseEffect(() => {\n\t\tif (didSnapshotChange(_instance)) {\n\t\t\tforceUpdate({ _instance });\n\t\t}\n\n\t\treturn subscribe(() => {\n\t\t\tif (didSnapshotChange(_instance)) {\n\t\t\t\tforceUpdate({ _instance });\n\t\t\t}\n\t\t});\n\t}, [subscribe]);\n\n\treturn value;\n}\n\n/** @type {(inst: Store) => boolean} */\nfunction didSnapshotChange(inst) {\n\tconst latestGetSnapshot = inst._getSnapshot;\n\tconst prevValue = inst._value;\n\ttry {\n\t\tconst nextValue = latestGetSnapshot();\n\t\treturn !is(prevValue, nextValue);\n\t} catch (error) {\n\t\treturn true;\n\t}\n}\n\nexport * from 'preact/hooks';\nexport {\n\tversion,\n\tChildren,\n\trender,\n\thydrate,\n\tunmountComponentAtNode,\n\tcreatePortal,\n\tcreateElement,\n\tcreateContext,\n\tcreateFactory,\n\tcloneElement,\n\tcreateRef,\n\tFragment,\n\tisValidElement,\n\tisFragment,\n\tfindDOMNode,\n\tComponent,\n\tPureComponent,\n\tmemo,\n\tforwardRef,\n\tflushSync,\n\t// eslint-disable-next-line camelcase\n\tunstable_batchedUpdates,\n\tStrictMode,\n\tSuspense,\n\tSuspenseList,\n\tlazy,\n\t__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED\n};\n\n// React copies the named exports to the default one.\nexport default {\n\tuseState,\n\tuseId,\n\tuseReducer,\n\tuseEffect,\n\tuseLayoutEffect,\n\tuseInsertionEffect,\n\tuseTransition,\n\tuseDeferredValue,\n\tuseSyncExternalStore,\n\tstartTransition,\n\tuseRef,\n\tuseImperativeHandle,\n\tuseMemo,\n\tuseCallback,\n\tuseContext,\n\tuseDebugValue,\n\tversion,\n\tChildren,\n\trender,\n\thydrate,\n\tunmountComponentAtNode,\n\tcreatePortal,\n\tcreateElement,\n\tcreateContext,\n\tcreateFactory,\n\tcloneElement,\n\tcreateRef,\n\tFragment,\n\tisValidElement,\n\tisElement,\n\tisFragment,\n\tfindDOMNode,\n\tComponent,\n\tPureComponent,\n\tmemo,\n\tforwardRef,\n\tflushSync,\n\tunstable_batchedUpdates,\n\tStrictMode,\n\tSuspense,\n\tSuspenseList,\n\tlazy,\n\t__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED\n};\n", "/**\n * @license Copyright 2020 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport {h} from 'preact';\nimport {createPortal, useRef, useEffect} from 'preact/compat';\nimport clsx from 'clsx';\nimport './modal.css';\n\n/** @param {{className?: string, children: LHCI.PreactNode, onClose: () => void}} props */\nexport const Modal = props => {\n const modalRootRef = useRef(\n document.getElementById('preact-modal-root') || document.createElement('div')\n );\n\n useEffect(() => {\n modalRootRef.current.id = 'preact-modal-root';\n document.body.appendChild(modalRootRef.current);\n return () => document.body.removeChild(modalRootRef.current);\n }, []);\n\n return createPortal(\n <div className=\"modal-backdrop\">\n <div className={clsx('modal', props.className)} style={{position: 'relative'}}>\n {props.children}\n <div className=\"modal__close\" onClick={props.onClose}>\n <i className=\"material-icons\">close</i>\n </div>\n </div>\n </div>,\n modalRootRef.current\n );\n};\n", "/**\n * @license Copyright 2020 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport {h} from 'preact';\nimport './lhr-comparison-runtime-diff.css';\nimport clsx from 'clsx';\n\n/** @typedef {{label: string, base: string, compare: string, severity: 'warn'|'error'}} RuntimeDiff */\n\n/** @param {any} value */\nfunction getStringValueFromRawConfigSetting(value) {\n if (typeof value === 'string') return value;\n if (typeof value === 'number') return value.toString();\n if (typeof value === 'undefined') return 'Unset';\n if (typeof value === 'boolean') return value ? 'Enabled' : 'Disabled';\n if (Array.isArray(value)) return value.join(', ');\n return 'Unknown';\n}\n\n/**\n * @param {LH.Result} lhr\n * @param {LH.Result|undefined} baseLhr\n * @return {Array<RuntimeDiff>}\n */\nexport function computeRuntimeDiffs(lhr, baseLhr) {\n if (!baseLhr) return [];\n\n /** @type {Array<RuntimeDiff>} */\n const diffs = [];\n\n const {benchmarkIndex} = lhr.environment;\n const {benchmarkIndex: baseBenchmarkIndex} = baseLhr.environment;\n const benchmarkMultiplicativeDelta =\n Math.abs(benchmarkIndex - baseBenchmarkIndex) / Math.min(benchmarkIndex, baseBenchmarkIndex);\n if (benchmarkMultiplicativeDelta > 1.5) {\n diffs.push({\n label: 'CPU/Memory Power',\n base: baseLhr.environment.benchmarkIndex.toString(),\n compare: lhr.environment.benchmarkIndex.toString(),\n severity: benchmarkMultiplicativeDelta > 2 ? 'error' : 'warn',\n });\n }\n\n const settings = lhr.configSettings;\n const baseSettings = baseLhr.configSettings;\n const throttling = settings.throttling || {};\n const baseThrottling = settings.throttling || {};\n const potentialDiffs = [\n ['Lighthouse Version', baseLhr.lighthouseVersion, lhr.lighthouseVersion],\n ['Storage Reset', baseSettings.disableStorageReset, settings.disableStorageReset],\n ['Emulated Form Factor', baseSettings.emulatedFormFactor, settings.emulatedFormFactor],\n ['Throttling Method', baseSettings.throttlingMethod, settings.throttlingMethod],\n ['CPU Throttling', baseThrottling.cpuSlowdownMultiplier, throttling.cpuSlowdownMultiplier],\n ['Network RTT', baseThrottling.rttMs, throttling.rttMs],\n ['Network Throughput', baseThrottling.throughputKbps, throttling.throughputKbps],\n ['Network RTT', baseThrottling.requestLatencyMs, throttling.requestLatencyMs],\n [\n 'Network Throughput (Up)',\n baseThrottling.uploadThroughputKbps,\n throttling.uploadThroughputKbps,\n ],\n [\n 'Network Throughput (Down)',\n baseThrottling.downloadThroughputKbps,\n throttling.downloadThroughputKbps,\n ],\n ];\n\n for (const [label, rawBase, rawCompare] of potentialDiffs) {\n const base = getStringValueFromRawConfigSetting(rawBase);\n const compare = getStringValueFromRawConfigSetting(rawCompare);\n if (base === compare) continue;\n diffs.push({label, base, compare, severity: 'error'});\n }\n\n return diffs;\n}\n\n/**\n * @param {{diffs: Array<RuntimeDiff>, variant: 'mini'|'full'}} props\n */\nexport const LhrRuntimeDiff = props => {\n const {diffs} = props;\n\n return (\n <div\n className={clsx(\n 'lhr-comparison-runtime-diff',\n `lhr-comparison-runtime-diff--${props.variant}`\n )}\n >\n <div className=\"lhr-comparison__warning\">\n <i className=\"material-icons\">info</i>\n <div>\n Changes of runtime settings or the environment can substantially affect your Lighthouse\n scores and might be the reason for the differences here.\n </div>\n </div>\n <div className=\"lhr-comparison-runtime-diff__diffs\">\n The following runtime differences were detected:\n <table>\n <thead>\n <tr>\n <th />\n <th>Base</th>\n <th>Compare</th>\n </tr>\n </thead>\n <tbody>\n {diffs.map(diff => (\n <tr key={diff.label}>\n <td>{diff.label}</td>\n <td>{diff.base}</td>\n <td>{diff.compare}</td>\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n </div>\n );\n};\n", "/**\n * @license Copyright 2020 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport {h} from 'preact';\nimport './comparison.css';\nimport {LH_LOGO_PATH} from '../../components/lhci-components.jsx';\nimport {ReportUploadBox, computeBestDisplayType} from '../../components/report-upload-box';\nimport {LhrComparison} from '../../../../../server/src/ui/routes/build-view/lhr-comparison';\n\n/** @typedef {import('../../app.jsx').ToastMessage} ToastMessage */\n/** @typedef {import('../../app.jsx').ReportData} ReportData */\n\n/** @param {{baseReport: ReportData, compareReport: ReportData, setBaseReport: (d: ReportData|undefined) => void, setCompareReport: (d: ReportData|undefined) => void, addToast: (t: ToastMessage) => void}} props */\nexport const ComparisonRoute = props => {\n const displayType = computeBestDisplayType(props.baseReport.lhr, props.compareReport.lhr);\n return (\n <div className=\"comparison\">\n <div className=\"comparison-header\">\n <div\n className=\"comparison-header__switcher\"\n onClick={() => {\n props.setBaseReport(props.compareReport);\n props.setCompareReport(props.baseReport);\n }}\n >\n <i className=\"material-icons\">swap_horiz</i>\n </div>\n <div className=\"comparison-header__logo\">\n <img\n src={LH_LOGO_PATH}\n alt=\"Lighthouse Logo\"\n onClick={() => {\n props.setBaseReport(undefined);\n props.setCompareReport(undefined);\n }}\n />\n </div>\n <div className=\"comparison-header__upload\">\n <ReportUploadBox\n variant=\"base\"\n dragTarget=\"self\"\n report={props.baseReport}\n setReport={props.setBaseReport}\n addToast={props.addToast}\n displayType={displayType}\n showOpenLhrLink\n />\n <ReportUploadBox\n variant=\"compare\"\n dragTarget=\"self\"\n report={props.compareReport}\n setReport={props.setCompareReport}\n addToast={props.addToast}\n displayType={displayType}\n showOpenLhrLink\n />\n </div>\n <a className=\"comparison-header__info\" href=\"https://github.com/GoogleChrome/lighthouse-ci\">\n <i className=\"material-icons\">info</i>\n </a>\n </div>\n <div className=\"comparison-body\">\n <LhrComparison\n lhr={props.compareReport.lhr}\n baseLhr={props.baseReport.lhr}\n hookElements={{}}\n />\n </div>\n </div>\n );\n};\n", "/**\n * @license Copyright 2020 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport {h} from 'preact';\nimport './toast.css';\nimport {useEffect} from 'preact/hooks';\n\n/** @typedef {import('../app.jsx').ToastMessage} ToastMessage */\n\n/** @param {{toast: ToastMessage, setToasts: import('preact/hooks/src').StateUpdater<Array<ToastMessage>>}} props */\nexport const Toast = props => {\n const setToasts = props.setToasts;\n const {message, level = 'info'} = props.toast;\n\n useEffect(() => {\n const interval = setTimeout(\n () => setToasts(toasts => toasts.filter(t => t !== props.toast)),\n 5000\n );\n return () => clearInterval(interval);\n }, []);\n\n return <div className={`toast toast--${level}`}>{message}</div>;\n};\n", "/**\n * @license Copyright 2020 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport {h, Fragment} from 'preact';\nimport {useState, useEffect, useCallback} from 'preact/hooks';\nimport '../../../server/src/ui/app.css';\nimport './app.css';\nimport {LandingRoute} from './routes/landing/landing.jsx';\nimport {ComparisonRoute} from './routes/comparison/comparison.jsx';\nimport {LoadingSpinner} from './components/lhci-components.jsx';\nimport {parseStringAsLhr} from './components/report-upload-box.jsx';\nimport {Toast} from './components/toast.jsx';\n\nconst SEARCH_PARAMS = new URLSearchParams(location.search);\nconst INITIAL_BASE_URL = SEARCH_PARAMS.get('baseReport');\nconst INITIAL_COMPARE_URL = SEARCH_PARAMS.get('compareReport');\n\n/**\n * @typedef {{filename: string, data: string, lhr: LH.Result}} ReportData\n */\n/**\n * @typedef {{message: string, level?: 'error' | 'info'}} ToastMessage\n */\n\n/**\n * @param {string} url\n * @param {(r: ReportData) => void} setReport\n */\nasync function loadReportFromURL(url, setReport) {\n const filename = new URL(url).pathname.split('/').slice(-1)[0] || 'Unknown';\n const response = await fetch(url);\n const data = await response.text();\n const lhr = parseStringAsLhr(data);\n if (lhr instanceof Error) throw lhr;\n setReport({filename, data, lhr});\n}\n\n/**\n * @param {(r: ReportData) => void} setBaseReport\n * @param {(r: ReportData) => void} setCompareReport\n * @param {(b: boolean) => void} setIsLoading\n * @param {(t: ToastMessage) => void} addToast\n */\nasync function loadInitialReports(setBaseReport, setCompareReport, setIsLoading, addToast) {\n if (window.location.hostname === 'localhost') {\n const lastBaseReport = localStorage.getItem('lastBaseReport');\n const lastCompareReport = localStorage.getItem('lastCompareReport');\n if (lastBaseReport) setBaseReport(JSON.parse(lastBaseReport));\n if (lastCompareReport) setCompareReport(JSON.parse(lastCompareReport));\n }\n\n const promises = [\n INITIAL_BASE_URL && loadReportFromURL(INITIAL_BASE_URL, setBaseReport),\n INITIAL_COMPARE_URL && loadReportFromURL(INITIAL_COMPARE_URL, setCompareReport),\n ].filter(/** @return {p is Promise<void>} */ p => !!p);\n if (!promises.length) return;\n\n setIsLoading(true);\n await Promise.all(\n promises.map(p =>\n p.catch(err => {\n console.error(err); // eslint-disable-line no-console\n addToast({message: `Failed loading report from URL: ${err.message}`, level: 'error'});\n })\n )\n );\n setIsLoading(false);\n}\n\nexport const App = () => {\n const initialReport = /** @type {ReportData|undefined} */ (undefined);\n const [isLoading, setIsLoading] = useState(false);\n const [baseReport, setBaseReport] = useState(initialReport);\n const [compareReport, setCompareReport] = useState(initialReport);\n const [toasts, setToasts] = useState(/** @type {Array<ToastMessage>} */ ([]));\n /** @param {ToastMessage} toast */\n const addToastUnmemoized = toast => setToasts(toasts => [...toasts, toast]);\n const addToast = useCallback(addToastUnmemoized, [setToasts]);\n\n useEffect(() => {\n loadInitialReports(setBaseReport, setCompareReport, setIsLoading, addToast);\n }, []);\n\n useEffect(() => {\n try {\n if (baseReport) localStorage.setItem('lastBaseReport', JSON.stringify(baseReport));\n if (compareReport) localStorage.setItem('lastCompareReport', JSON.stringify(compareReport));\n } catch (err) {\n console.error(`Error saving to localStorage: ${err}`); // eslint-disable-line no-console\n }\n }, [baseReport, compareReport]);\n\n return (\n <div className=\"lhci-viewer\">\n {isLoading ? (\n <div className=\"loading-container\">\n <LoadingSpinner />\n </div>\n ) : (\n <Fragment />\n )}\n <div className=\"toast-container\">\n {toasts.map(toast => (\n <Toast key={toast.message} toast={toast} setToasts={setToasts} />\n ))}\n </div>\n {baseReport && compareReport ? (\n <ComparisonRoute\n baseReport={baseReport}\n setBaseReport={setBaseReport}\n compareReport={compareReport}\n setCompareReport={setCompareReport}\n addToast={addToast}\n />\n ) : (\n <LandingRoute\n baseReport={baseReport}\n setBaseReport={setBaseReport}\n compareReport={compareReport}\n setCompareReport={setCompareReport}\n addToast={addToast}\n />\n )}\n </div>\n );\n};\n", "/**\n * @license Copyright 2020 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport {h, render} from 'preact';\nimport {App} from './app.jsx';\n\n// Fontsource for fonts/icons instead of google cdn\nimport '@fontsource/roboto/400.css';\nimport '@fontsource/roboto/500.css';\nimport '@fontsource/roboto-mono/400.css';\nimport '@fontsource/roboto-mono/500.css';\nimport '@fontsource/material-icons';\n\nconst preactRoot = document.getElementById('preact-root');\nif (!preactRoot) throw new Error('Missing #preact-root');\nrender(<App />, preactRoot);\n"],
5
- "mappings": "40CAAA,IAAAA,GAAAC,EAAA,CAAAC,GAAAC,KAAA,CAIA,IAAIC,GAAI,IACJC,GAAID,GAAI,GACRE,GAAID,GAAI,GACRE,EAAID,GAAI,GACRE,GAAID,EAAI,EACRE,GAAIF,EAAI,OAgBZJ,GAAO,QAAU,SAASO,EAAKC,EAAS,CACtCA,EAAUA,GAAW,CAAC,EACtB,IAAIC,EAAO,OAAOF,EAClB,GAAIE,IAAS,UAAYF,EAAI,OAAS,EACpC,OAAOG,GAAMH,CAAG,EACX,GAAIE,IAAS,UAAY,SAASF,CAAG,EAC1C,OAAOC,EAAQ,KAAOG,GAAQJ,CAAG,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s", "m", "h", "d", "w", "y", "val", "options", "type", "parse", "fmtLong", "fmtShort", "str", "match", "n", "ms", "msAbs", "plural", "name", "isPlural", "require_common", "__commonJSMin", "exports", "module", "setup", "env", "createDebug", "coerce", "disable", "enable", "enabled", "destroy", "key", "selectColor", "namespace", "hash", "i", "prevTime", "enableOverride", "debug", "args", "self", "curr", "ms", "index", "match", "format", "formatter", "val", "extend", "delimiter", "newDebug", "namespaces", "split", "len", "toNamespace", "name", "regexp", "require_browser", "__commonJSMin", "exports", "module", "formatArgs", "save", "load", "useColors", "localstorage", "warned", "args", "c", "index", "lastC", "match", "namespaces", "error", "r", "formatters", "v", "require_fetch_umd", "__commonJSMin", "exports", "module", "global", "factory", "support", "e", "isDataView", "obj", "viewClasses", "isArrayBufferView", "normalizeName", "name", "normalizeValue", "value", "iteratorFor", "items", "iterator", "Headers", "headers", "header", "oldValue", "callback", "thisArg", "consumed", "body", "fileReaderReady", "reader", "resolve", "reject", "readBlobAsArrayBuffer", "blob", "promise", "readBlobAsText", "readArrayBufferAsText", "buf", "view", "chars", "i", "bufferClone", "Body", "rejected", "isConsumed", "decode", "methods", "normalizeMethod", "method", "upcased", "Request", "input", "options", "reParamSearch", "reQueryString", "form", "bytes", "split", "parseHeaders", "rawHeaders", "preProcessedHeaders", "line", "parts", "key", "Response", "bodyInit", "response", "redirectStatuses", "url", "status", "err", "message", "error", "fetch", "init", "request", "xhr", "abortXhr", "fixUrl", "require_fetch_npm_browserify", "__commonJSMin", "exports", "module", "require_api_client", "__commonJSMin", "exports", "module", "log", "fetch", "btoa", "s", "ApiClient", "_ApiClient", "options", "username", "password", "typecheck", "token", "__spreadProps", "__spreadValues", "url", "rootWithoutSlash", "returnValuePromise", "err", "response", "__async", "body", "error", "method", "rawUrl", "query", "key", "value", "headers", "project", "projectId", "slug", "unsavedProject", "projectUpdates", "_0", "unsavedBuild", "buildId", "_1", "run", "unsavedStatistic", "runAt", "clientVersion", "serverVersion", "partsClient", "partsServer", "majorVersionClient", "majorVersionServer", "require_lodash", "__commonJSMin", "exports", "module", "merge", "v1", "v2", "i", "o1", "o2", "o1Keys", "o2Keys", "key", "kebabCase", "s", "opts", "kebabed", "groupIntoMap", "items", "keyFn", "groups", "item", "group", "debounce", "fn", "time", "timeout", "cancel", "debouncedFn", "args", "from", "to", "by", "numbers", "word", "length", "padding", "depth", "v", "k", "o", "seen", "out", "maxItem", "maxValue", "value", "a", "b", "object", "propertiesToPick", "key_", "propertiesToDrop", "options", "uuid", "string", "number", "pluralForm", "id", "require_lhr_generator", "__commonJSMin", "exports", "module", "_", "LOREM_IPSUM", "getCategoryForAuditId", "auditId", "getGroupForAuditId", "generateNumericValue", "average", "prandom", "maxDelta", "createLHR", "pageUrl", "auditDefs", "audits", "loremIpsumTokens", "auditDef", "averageNumericValue", "averageWastedMs", "unit", "groupId", "numericValue", "score", "wastedMs", "hasBytes", "item", "wastedBytes", "passRate", "headersAsObject", "items", "_a", "_b", "url", "inclusionRate", "rest", "__objRest", "key", "dataKey", "v", "valueType", "averageValue", "details", "header", "__spreadProps", "__spreadValues", "categories", "auditsGroupedByCategory", "pair", "category", "sum", "next", "id", "fetchTimeBase", "fetchTimeOffset", "fetchTime", "require_audit_diff_finder", "__commonJSMin", "exports", "module", "_", "getGroupForAuditId", "auditsToNotDIff", "getDeltaLabel", "delta", "deltaType", "isImprovement", "getDiffLabel", "diff", "getDeltaStats", "getRowLabel", "diffs", "itemDeltaDiffs", "getMatchingDiffsForIndex", "compareItemIndex", "baseItemIndex", "compareIndex", "baseIndex", "getRowLabelForIndex", "getWorstNumericDeltaForIndex", "numericDiffs", "isNumericAuditDiff", "getMostSevereDiffLabel", "labels", "l", "getScoreLevel", "score", "getMetricScoreLevel", "value", "cutoffs", "getDiffSeverity", "baseValue", "compareValue", "absoluteDelta", "percentDelta", "percentAbsoluteDelta", "createAuditDiff", "auditId", "type", "itemKey", "numericDiffResult", "__spreadProps", "__spreadValues", "findAuditDetailItemKeyDiffs", "baseEntry", "compareEntry", "headings", "key", "heading", "synthesizeItemKeyDiffs", "baseItems", "compareItems", "itemKeyDiffs", "item", "itemIndexKeyName", "itemIndexValue", "replaceNondeterministicStrings", "s", "url", "err", "deepPruneItemForKeySerialization", "entry", "itemAsRecord", "keysToKeep", "copy", "getItemKey", "_a", "_b", "_c", "source", "zipBaseAndCompareItems", "groupedByKey", "i", "zipped", "entries", "sortZippedBaseAndCompareItems", "zippedItems", "rowLabelSortOrder", "a", "b", "compareIndexA", "baseIndexA", "compareIndexB", "baseIndexB", "rowStateIndexA", "rowStateIndexB", "labelValueA", "labelValueB", "numericValueA", "numericValueB", "findAuditDetailItemsDiffs", "base", "compare", "normalizeScore", "audit", "getNumericValue", "normalizeNumericValue", "normalizeDetails", "findAuditDiffs", "baseAudit", "compareAudit", "options", "percentAbsoluteDeltaThreshold", "hasItemDetails", "baseAuditDetails", "compareAuditDetails", "baseHeadings", "compareHeadings", "filteredDiffs", "isAllPassing", "require_markdown", "__commonJSMin", "exports", "module", "splitMarkdownLink", "text", "segments", "parts", "preambleText", "linkText", "linkHref", "MODE_HYDRATE", "slice", "options", "vnodeId", "isValidElement", "rerenderQueue", "prevDebounce", "defer", "depthSort", "i", "EMPTY_OBJ", "EMPTY_ARR", "IS_NON_DIMENSIONAL", "isArray", "Array", "assign", "obj", "props", "removeNode", "node", "parentNode", "removeChild", "createElement", "type", "children", "key", "ref", "normalizedProps", "arguments", "length", "call", "defaultProps", "createVNode", "original", "vnode", "__k", "__", "__b", "__e", "__d", "__c", "constructor", "__v", "__i", "__u", "Fragment", "props", "children", "BaseComponent", "context", "this", "getDomSibling", "vnode", "childIndex", "__", "sibling", "__k", "length", "__e", "type", "updateParentDomPointers", "i", "child", "__c", "base", "enqueueRender", "c", "__d", "rerenderQueue", "push", "process", "prevDebounce", "options", "debounceRendering", "defer", "renderQueueLength", "component", "newVNode", "oldVNode", "oldDom", "parentDom", "commitQueue", "refQueue", "sort", "depthSort", "shift", "__v", "__P", "assign", "diff", "__n", "ownerSVGElement", "__u", "__i", "commitRoot", "diffChildren", "renderResult", "newParentVNode", "oldParentVNode", "globalContext", "isSvg", "excessDomChildren", "isHydrating", "childVNode", "newDom", "firstChildDom", "oldChildren", "EMPTY_ARR", "newChildrenLength", "constructNewChildrenArray", "EMPTY_OBJ", "ref", "applyRef", "insert", "nextSibling", "skewedIndex", "matchingIndex", "oldChildrenLength", "remainingOldChildren", "skew", "constructor", "String", "createVNode", "isArray", "key", "__b", "findMatchingIndex", "unmount", "parentVNode", "insertBefore", "toChildArray", "out", "some", "x", "y", "setStyle", "style", "value", "setProperty", "IS_NON_DIMENSIONAL", "test", "dom", "name", "oldValue", "useCapture", "o", "cssText", "replace", "toLowerCase", "slice", "l", "_attached", "Date", "now", "addEventListener", "eventProxyCapture", "eventProxy", "removeEventListener", "e", "removeAttribute", "setAttribute", "eventHandler", "_dispatched", "event", "tmp", "isNew", "oldProps", "oldState", "snapshot", "clearProcessingException", "newProps", "provider", "componentContext", "renderHook", "count", "newType", "outer", "contextType", "__E", "prototype", "render", "doRender", "sub", "state", "__h", "_sb", "__s", "getDerivedStateFromProps", "componentWillMount", "componentDidMount", "componentWillReceiveProps", "shouldComponentUpdate", "forEach", "componentWillUpdate", "componentDidUpdate", "__r", "getChildContext", "getSnapshotBeforeUpdate", "MODE_HYDRATE", "indexOf", "diffElementNodes", "diffed", "root", "cb", "call", "newHtml", "oldHtml", "newChildren", "inputValue", "checked", "nodeType", "localName", "document", "createTextNode", "createElementNS", "createElement", "is", "data", "childNodes", "attributes", "__html", "innerHTML", "removeNode", "current", "skipRemove", "r", "componentWillUnmount", "replaceNode", "firstChild", "slice", "EMPTY_ARR", "options", "__e", "error", "vnode", "oldVNode", "errorInfo", "component", "ctor", "handled", "__", "__c", "constructor", "getDerivedStateFromError", "setState", "__d", "componentDidCatch", "__E", "e", "vnodeId", "isValidElement", "undefined", "BaseComponent", "prototype", "update", "callback", "s", "this", "__s", "state", "assign", "props", "__v", "_sb", "push", "enqueueRender", "forceUpdate", "__h", "render", "Fragment", "rerenderQueue", "defer", "Promise", "then", "bind", "resolve", "setTimeout", "depthSort", "a", "b", "__b", "process", "__r", "i", "currentIndex", "currentComponent", "previousComponent", "prevRaf", "currentHook", "afterPaintEffects", "EMPTY", "oldBeforeDiff", "options", "__b", "oldBeforeRender", "__r", "oldAfterDiff", "diffed", "oldCommit", "__c", "oldBeforeUnmount", "unmount", "getHookState", "index", "type", "__h", "hooks", "__H", "__", "length", "push", "__V", "useState", "initialState", "useReducer", "invokeOrReturn", "reducer", "init", "hookState", "_reducer", "action", "currentValue", "__N", "nextValue", "setState", "_hasScuFromHooks", "updateHookState", "p", "s", "c", "stateHooks", "filter", "x", "every", "prevScu", "call", "this", "shouldUpdate", "forEach", "hookItem", "props", "shouldComponentUpdate", "prevCWU", "componentWillUpdate", "__e", "tmp", "useEffect", "callback", "args", "state", "__s", "argsChanged", "_pendingArgs", "useRef", "initialValue", "currentHook", "useMemo", "current", "useMemo", "factory", "args", "state", "getHookState", "currentIndex", "argsChanged", "__V", "_pendingArgs", "__h", "__", "useCallback", "callback", "currentHook", "flushAfterPaintEffects", "component", "afterPaintEffects", "shift", "__P", "__H", "__h", "forEach", "invokeCleanup", "invokeEffect", "e", "options", "__e", "__v", "__b", "vnode", "currentComponent", "oldBeforeDiff", "__r", "oldBeforeRender", "currentIndex", "hooks", "__c", "previousComponent", "__", "hookItem", "__N", "EMPTY", "_pendingArgs", "diffed", "oldAfterDiff", "c", "length", "push", "prevRaf", "requestAnimationFrame", "afterNextFrame", "__V", "commitQueue", "some", "filter", "cb", "oldCommit", "unmount", "oldBeforeUnmount", "hasErrored", "s", "HAS_RAF", "callback", "raf", "done", "clearTimeout", "timeout", "cancelAnimationFrame", "setTimeout", "hook", "comp", "cleanup", "argsChanged", "oldArgs", "newArgs", "arg", "index", "invokeOrReturn", "f", "toVal", "mix", "k", "y", "str", "clsx_m_default", "i", "x", "SVG_PATH", "LoadingSpinner_", "y", "LoadingSpinner", "props", "clsx_m_default", "Paper", "props", "children", "y", "clsx_m_default", "import_api_client", "import_lodash", "api", "ApiClient", "openLhrInClassicViewer", "lhr", "__async", "VIEWER_ORIGIN", "api", "msgHandler", "messageEvent", "popup", "fetchTime", "windowName", "LhrViewerLink", "props", "children", "lhrOrResolver", "isLoading", "setIsLoading", "h", "y", "clsx_m_default", "evt", "LH_ICON_PATH", "LhrViewerButton", "props", "lhr", "label", "y", "LhrViewerLink", "CONFETTI_PATH", "LH_LOGO_PATH", "parseStringAsLhr", "s", "match", "lhr", "err", "computeBestDisplayType", "lhrA", "lhrB", "urlA", "urlB", "FilePill", "props", "filename", "url", "timestamp", "options", "tooltip", "y", "handleFileInput", "fileList", "reader", "handleDragEnter", "dragTargetRef", "setIsDragging", "e", "handleDragLeave", "handleDragOver", "handleDrop", "ReportUploadBox", "isDragging", "h", "_", "onDragEnter", "onDragLeave", "onDragOver", "onDrop", "p", "clsx_m_default", "g", "LhrViewerButton", "input", "LandingRoute", "props", "y", "CONFETTI_PATH", "Paper", "LH_LOGO_PATH", "ReportUploadBox", "import_lodash", "import_audit_diff_finder", "Dropdown", "props", "options", "value", "setValue", "className", "title", "label", "computedOptions", "option", "y", "clsx_m_default", "g", "evt", "usePreviousValue", "value", "ref", "_", "p", "ScoreIcon", "props", "score", "y", "ScoreWord", "import_markdown", "Markdown", "props", "segments", "y", "g", "segment", "i", "url", "Nbsp", "y", "import_audit_diff_finder", "SimpleDetails", "props", "type", "compareValue", "baseValue", "diff", "value", "label", "numericBase", "numericCompare", "baseDisplay", "compareDisplay", "numericTitle", "deltaPercent", "kb", "y", "Nbsp", "ms", "evt", "img", "display", "hostname", "url", "_", "line", "column", "g", "debugdata", "import_audit_diff_finder", "isNumericValueType", "itemType", "TableDetails", "props", "audit", "baseAudit", "allDiffs", "y", "g", "compareHeadings", "compareItems", "baseHeadings", "baseItems", "zippedItems", "sortedItems", "headings", "insertRowLabelAfterIndex", "heading", "i", "base", "compare", "diffs", "key", "state", "j", "diff", "compareItem", "baseItem", "SimpleDetails", "import_audit_diff_finder", "BIG_PICTURE_LIMITS", "getBigPictureLimit", "audit", "limitType", "auditId", "toNearestRoundNumber", "x", "direction", "fn", "getUnitFromAudit", "groupId", "displayValue", "toDisplay", "options", "asDelta", "withSuffix", "unit", "value", "fractionDigits", "suffixUnit", "string", "numericSign", "resultStr", "y", "g", "Nbsp", "NumericDiff", "props", "diff", "currentNumericValue", "baseNumericValue", "delta", "minValue", "maxValue", "lowerLimit", "upperLimit", "range", "minValueConstrainted", "maxValueConstrainted", "boxLeft", "boxRight", "deltaType", "minValueIsCurrentValue", "hoverDisplay", "clsx_m_default", "deltaLabel", "deltaLabelLength", "narrowCutoffThresholdInPercent", "_", "import_audit_diff_finder", "ICONS_BY_AUDIT_ID", "IconForAuditItems", "props", "auditId", "groupId", "icon", "y", "ScoreDiff", "g", "ScoreWord", "DisplayValueDiff", "getDiffLabelForRowLabel", "rowLabel", "getUniqueBaseCompareIndexPairs", "diffs", "diff", "indexes", "idx", "ItemDiff", "baseAudit", "baseAuditItems", "rowLabels", "pair", "regressionCount", "label", "improvementCount", "baseElements", "clsx_m_default", "NoBaseAudit", "ErrorDiff", "message", "AuditDiff", "audit", "group", "noDiffAvailable", "numericDiff", "NumericDiff", "scoreDiff", "displayValueDiff", "import_audit_diff_finder", "ScoreOnlyDetails", "props", "audit", "baseAudit", "y", "ScoreWord", "ErrorDetails", "erroredAudit", "g", "Details", "pair", "details", "baseDetails", "hasItems", "itemDiff", "tableDetails", "numericDetails", "TableDetails", "ItemDiff", "__spreadProps", "__spreadValues", "numericDiff", "diff", "NumericDiff", "scoreDiff", "AuditDetail", "clsx_m_default", "ScoreIcon", "Markdown", "AuditDetailPane", "props", "paneElementRef", "_", "previouslySelectedAuditId", "usePreviousValue", "p", "auditId", "paneElement", "childElement", "y", "el", "pair", "audit", "AuditDetail", "import_audit_diff_finder", "Gauge", "props", "score", "rawBaseScore", "baseScore", "label", "baseStrokeDasharray", "delta", "deltaDasharrayScore", "deltaStrokeDasharray", "deltaTransform", "indicatorTransform", "y", "clsx_m_default", "_", "FastReliableIcon", "props", "y", "InstallableIcon", "OptimizedIcon", "getBadgeDiffType", "base", "compare", "key", "getBadgeStatus", "lhr", "pwaCategory", "auditsByCategory", "ref", "hasEveryPass", "refs", "audit", "PWAGauge", "status", "all", "clsx_m_default", "import_audit_diff_finder", "ScoreDeltaBadge", "props", "delta", "y", "clsx_m_default", "StandardScoreItem", "props", "lhr", "baseLhr", "categoryId", "category", "baseCategory", "diff", "y", "clsx_m_default", "Gauge", "ScoreDeltaBadge", "PwaScoreItem", "compareStatus", "getBadgeStatus", "deltaEl", "overallStatus", "baseStatus", "diffTypes", "getBadgeDiffType", "allEqual", "type", "individualBadges", "g", "FastReliableIcon", "InstallableIcon", "OptimizedIcon", "PWAGauge", "LhrComparisonScores", "compareCategoryIds", "baseCategoryIds", "categoryIds", "id", "idA", "idB", "sortKeyA", "sortKeyB", "MetricsTabHeader", "props", "y", "clsx_m_default", "ChangedAuditList", "g", "pair", "audit", "__spreadProps", "__spreadValues", "diff", "ScoreIcon", "AuditDiff", "UnchangedAuditList", "baseLhr", "e", "openLhrInClassicViewer", "AuditGroup", "group", "showAsBigPicture", "setShowAsBigPicture", "h", "expanded", "setExpanded", "Paper", "LhrComparisonLegend", "y", "ScoreIcon", "assign", "obj", "props", "i", "shallowDiffers", "a", "b", "PureComponent", "p", "this", "PureComponent", "prototype", "Component", "isPureReactComponent", "shouldComponentUpdate", "props", "state", "shallowDiffers", "this", "oldDiffHook", "options", "__b", "vnode", "type", "__f", "ref", "REACT_FORWARD_SYMBOL", "Symbol", "for", "oldCatchError", "options", "error", "newVNode", "oldVNode", "errorInfo", "then", "component", "vnode", "__", "__c", "__e", "__k", "oldUnmount", "unmount", "detachedClone", "detachedParent", "parentDom", "__H", "forEach", "effect", "assign", "__P", "map", "child", "removeOriginal", "originalParent", "__v", "appendChild", "Suspense", "this", "__u", "_suspenders", "__b", "suspended", "__a", "SuspenseList", "this", "_next", "_map", "options", "unmount", "vnode", "component", "__c", "__R", "__u", "type", "oldUnmount", "Suspense", "prototype", "Component", "promise", "suspendingVNode", "suspendingComponent", "c", "_suspenders", "push", "resolve", "suspended", "__v", "resolved", "onResolved", "onSuspensionComplete", "state", "__a", "suspendedVNode", "__k", "removeOriginal", "__P", "__O", "setState", "pop", "forceUpdate", "then", "componentWillUnmount", "render", "props", "detachedParent", "document", "createElement", "detachedComponent", "detachedClone", "__b", "fallback", "Fragment", "children", "list", "child", "node", "delete", "revealOrder", "size", "length", "ContextProvider", "getChildContext", "context", "Portal", "_this", "container", "_container", "_temp", "nodeType", "parentNode", "childNodes", "appendChild", "insertBefore", "before", "removeChild", "splice", "indexOf", "createPortal", "el", "containerInfo", "delegated", "get", "unsuspend", "wrappedUnsuspend", "Map", "toChildArray", "reverse", "i", "set", "componentDidUpdate", "componentDidMount", "forEach", "REACT_ELEMENT_TYPE", "Symbol", "for", "CAMEL_PROPS", "ON_ANI", "CAMEL_REPLACE", "IS_DOM", "onChangeInputType", "test", "Component", "prototype", "isReactComponent", "forEach", "key", "Object", "defineProperty", "configurable", "get", "this", "set", "v", "writable", "value", "oldEventHook", "options", "event", "empty", "isPropagationStopped", "cancelBubble", "isDefaultPrevented", "defaultPrevented", "e", "persist", "nativeEvent", "currentComponent", "classNameDescriptorNonEnumberable", "enumerable", "class", "oldVNodeHook", "vnode", "type", "props", "normalizedProps", "i", "IS_DOM", "lowerCased", "toLowerCase", "onChangeInputType", "ON_ANI", "test", "indexOf", "CAMEL_PROPS", "replace", "CAMEL_REPLACE", "multiple", "Array", "isArray", "toChildArray", "children", "child", "selected", "defaultValue", "className", "$$typeof", "REACT_ELEMENT_TYPE", "oldBeforeRender", "__r", "__c", "oldDiffed", "diffed", "dom", "__e", "Modal", "props", "modalRootRef", "_", "p", "j", "y", "clsx_m_default", "getStringValueFromRawConfigSetting", "value", "computeRuntimeDiffs", "lhr", "baseLhr", "diffs", "benchmarkIndex", "baseBenchmarkIndex", "benchmarkMultiplicativeDelta", "settings", "baseSettings", "throttling", "baseThrottling", "potentialDiffs", "label", "rawBase", "rawCompare", "base", "compare", "LhrRuntimeDiff", "props", "y", "clsx_m_default", "diff", "useAuditPermalinkScrollOnLoad", "setAuditId", "wait", "ms", "r", "waitUntilSelector", "selector", "__async", "attempts", "p", "computeAuditGroups", "lhr", "baseLhr", "options", "auditGroups", "categoryId", "category", "categoryAsGroup", "auditRefsGroupedByGroup", "_", "ref", "unchangedAuditsGroupId", "unchangedAuditsGroup", "auditRefGroup", "groupId", "groupWithoutId", "group", "__spreadProps", "__spreadValues", "pairs", "audit", "baseAudit", "diffs", "maxSeverity", "a", "b", "pairsWithDiffs", "pair", "pairsWithoutDiffs", "LhrComparisonScoresAndUrl", "props", "y", "Dropdown", "value", "g", "LhrComparisonScores", "AuditGroups", "auditGroup", "AuditGroup", "LhrComparison", "defaultAck", "percentAbsoluteDeltaThreshold", "setDiffThreshold", "h", "selectedAuditId", "runtimeDiffAck", "setRuntimeDiffAck", "runtimeDiffs", "computeRuntimeDiffs", "runtimeDiffsHaveError", "diff", "Modal", "LhrRuntimeDiff", "AuditDetailPane", "clsx_m_default", "Paper", "LhrComparisonLegend", "LhrViewerLink", "ComparisonRoute", "props", "displayType", "computeBestDisplayType", "y", "LH_LOGO_PATH", "ReportUploadBox", "LhrComparison", "Toast", "props", "setToasts", "message", "level", "p", "interval", "toasts", "t", "y", "SEARCH_PARAMS", "INITIAL_BASE_URL", "INITIAL_COMPARE_URL", "loadReportFromURL", "url", "setReport", "__async", "filename", "data", "lhr", "parseStringAsLhr", "loadInitialReports", "setBaseReport", "setCompareReport", "setIsLoading", "addToast", "lastBaseReport", "lastCompareReport", "promises", "p", "err", "App", "isLoading", "h", "baseReport", "compareReport", "toasts", "setToasts", "T", "toast", "y", "LoadingSpinner", "g", "Toast", "ComparisonRoute", "LandingRoute", "preactRoot", "q", "y", "App"]
7
- }