/*! For license information please see report-generator.js.LICENSE.txt */
!function(e){if("object"===typeof exports&&"undefined"!==typeof module)module.exports=e();else if("function"===typeof define&&define.amd)define([],e);else{var t;((t="undefined"!==typeof window?window:"undefined"!==typeof global?global:"undefined"!==typeof self?self:this).Lighthouse||(t.Lighthouse={})).ReportGenerator=e()}}((function(){return function e(t,r,s){function n(i,a){if(!r[i]){if(!t[i]){var l="function"==typeof require&&require;if(!a&&l)return l(i,!0);if(o)return o(i,!0);var c=new Error("Cannot find module '"+i+"'");throw c.code="MODULE_NOT_FOUND",c}var u=r[i]={exports:{}};t[i][0].call(u.exports,(function(e){return n(t[i][1][e]||e)}),u,u.exports,e,t,r,s)}return r[i].exports}for(var o="function"==typeof require&&require,i=0;i<s.length;i++)n(s[i]);return n}({"./html/html-report-assets.js":[function(e,t,r){"use strict";const s=globalThis.EXPORTED_CACHED_RESOURCES_ONLY_FOR_LIGHTHOUSE;t.exports={get REPORT_CSS(){return s.get("third_party/lighthouse/report-assets/report.css")},get REPORT_JAVASCRIPT(){return s.get("third_party/lighthouse/report-assets/report.js")},get REPORT_TEMPLATE(){return s.get("third_party/lighthouse/report-assets/template.html")},get REPORT_TEMPLATES(){return s.get("third_party/lighthouse/report-assets/templates.html")}}},{}],1:[function(e,t,r){"use strict";const s=e("./html/html-report-assets.js");class n{static replaceStrings(e,t){if(0===t.length)return e;const r=t[0],s=t.slice(1);return e.split(r.search).map((e=>n.replaceStrings(e,s))).join(r.replacement)}static generateReportHtml(e){const t=JSON.stringify(e).replace(/</g,"\\u003c").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029"),r=s.REPORT_JAVASCRIPT.replace(/<\//g,"\\u003c/");return n.replaceStrings(s.REPORT_TEMPLATE,[{search:"%%LIGHTHOUSE_JSON%%",replacement:t},{search:"%%LIGHTHOUSE_JAVASCRIPT%%",replacement:r},{search:"/*%%LIGHTHOUSE_CSS%%*/",replacement:s.REPORT_CSS},{search:"%%LIGHTHOUSE_TEMPLATES%%",replacement:s.REPORT_TEMPLATES}])}static generateReportCSV(e){const t=e=>`"${e.replace(/"/g,'""')}"`,r=e=>e.map((e=>e.toString())).map(t),s=Object.keys(e.categories).map((t=>{const s=[],n=e.categories[t],o=null===n.score?-1:n.score;return s.push(r([e.requestedUrl,e.finalUrl,n.title,`${t}-score`,`Overall ${n.title} Category Score`,"numeric",o])),s.concat(n.auditRefs.map((t=>{const s=e.audits[t.id],o=null===s.score?-1:s.score;return r([e.requestedUrl,e.finalUrl,n.title,s.id,s.title,s.scoreDisplayMode,o])})))}));return[["requestedUrl","finalUrl","category","name","title","type","score"]].concat(...s).map((e=>e.join(","))).join("\r\n")}static generateReport(e,t){const r=Array.isArray(t);"string"===typeof t&&(t=[t]);const s=t.map((t=>{if("html"===t)return n.generateReportHtml(e);if("csv"===t)return n.generateReportCSV(e);if("json"===t)return JSON.stringify(e,null,2);throw new Error("Invalid output mode: "+t)}));return r?s:s[0]}}t.exports=n},{"./html/html-report-assets.js":"./html/html-report-assets.js"}]},{},[1])(1)}));