lighthouse 10.0.2-dev.20230320 → 10.0.2-dev.20230322
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.
- package/cli/test/smokehouse/lighthouse-runners/bundle.js +1 -1
- package/core/audits/audit.js +1 -1
- package/core/audits/byte-efficiency/byte-efficiency-audit.d.ts +2 -0
- package/core/audits/byte-efficiency/byte-efficiency-audit.js +5 -1
- package/core/audits/byte-efficiency/unminified-javascript.js +2 -1
- package/core/audits/byte-efficiency/uses-responsive-images-snapshot.js +4 -0
- package/core/audits/dobetterweb/doctype.js +3 -2
- package/core/computed/metrics/cumulative-layout-shift.d.ts +3 -3
- package/core/computed/metrics/cumulative-layout-shift.js +21 -9
- package/core/computed/unused-css.js +8 -7
- package/core/config/lr-mobile-config.js +0 -11
- package/core/gather/driver/prepare.js +15 -0
- package/core/lib/asset-saver.js +2 -12
- package/core/lib/page-functions.d.ts +17 -5
- package/core/lib/page-functions.js +41 -22
- package/core/lib/tracehouse/trace-processor.d.ts +8 -0
- package/core/lib/tracehouse/trace-processor.js +15 -2
- package/core/lib/url-utils.js +1 -1
- package/dist/report/bundle.esm.js +36 -3
- package/dist/report/flow.js +3 -3
- package/dist/report/standalone.js +4 -4
- package/flow-report/src/summary/category.tsx +0 -1
- package/package.json +3 -3
- package/report/renderer/performance-category-renderer.js +3 -3
- package/shared/tsconfig.json +1 -1
- package/shared/util.d.ts +6 -0
- package/shared/util.js +33 -0
- package/types/artifacts.d.ts +1 -0
- package/types/lhr/audit-details.d.ts +17 -11
package/dist/report/flow.js
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
15
|
* See the License for the specific language governing permissions and
|
|
16
16
|
* limitations under the License.
|
|
17
|
-
*/const oe="…",re={PASS:{label:"pass",minScore:.9},AVERAGE:{label:"average",minScore:.5},FAIL:{label:"fail"},ERROR:{label:"error"}},se=["com","co","gov","edu","ac","org","go","gob","or","net","in","ne","nic","gouv","web","spb","blog","jus","kiev","mil","wi","qc","ca","bel","on"];class le{static get RATINGS(){return re}static get PASS_THRESHOLD(){return.9}static get MS_DISPLAY_VALUE(){return"%10d ms"}static getFinalDisplayedUrl(e){if(e.finalDisplayedUrl)return e.finalDisplayedUrl;if(e.finalUrl)return e.finalUrl;throw new Error("Could not determine final displayed URL")}static getMainDocumentUrl(e){return e.mainDocumentUrl||e.finalUrl}static getFullPageScreenshot(e){if(e.fullPageScreenshot)return e.fullPageScreenshot;return e.audits["full-page-screenshot"]?.details}static splitMarkdownCodeSpans(e){const a=[],n=e.split(/`(.*?)`/g);for(let e=0;e<n.length;e++){const t=n[e];if(!t)continue;const i=e%2!=0;a.push({isCode:i,text:t})}return a}static splitMarkdownLink(e){const a=[],n=e.split(/\[([^\]]+?)\]\((https?:\/\/.*?)\)/g);for(;n.length;){const[e,t,i]=n.splice(0,3);e&&a.push({isLink:!1,text:e}),t&&i&&a.push({isLink:!0,text:t,linkHref:i})}return a}static getURLDisplayName(e,a){const n=void 0!==(a=a||{numPathParts:void 0,preserveQuery:void 0,preserveHost:void 0}).numPathParts?a.numPathParts:2,t=void 0===a.preserveQuery||a.preserveQuery,i=a.preserveHost||!1;let o;if("about:"===e.protocol||"data:"===e.protocol)o=e.href;else{o=e.pathname;const a=o.split("/").filter((e=>e.length));n&&a.length>n&&(o=oe+a.slice(-1*n).join("/")),i&&(o=`${e.host}/${o.replace(/^\//,"")}`),t&&(o=`${o}${e.search}`)}if("data:"!==e.protocol&&(o=o.replace(/([a-f0-9]{7})[a-f0-9]{13}[a-f0-9]*/g,"$1…"),o=o.replace(/([a-zA-Z0-9-_]{9})(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])[a-zA-Z0-9-_]{10,}/g,"$1…"),o=o.replace(/(\d{3})\d{6,}/g,"$1…"),o=o.replace(/\u2026+/g,oe),o.length>64&&o.includes("?")&&(o=o.replace(/\?([^=]*)(=)?.*/,"?$1$2…"),o.length>64&&(o=o.replace(/\?.*/,"?…")))),o.length>64){const e=o.lastIndexOf(".");o=e>=0?o.slice(0,63-(o.length-e))+`…${o.slice(e)}`:o.slice(0,63)+oe}return o}static parseURL(e){const a=new URL(e);return{file:le.getURLDisplayName(a),hostname:a.hostname,origin:a.origin}}static createOrReturnURL(e){return e instanceof URL?e:new URL(e)}static getTld(e){const a=e.split(".").slice(-2);return se.includes(a[0])?`.${a.join(".")}`:`.${a[a.length-1]}`}static getRootDomain(e){const a=le.createOrReturnURL(e).hostname,n=le.getTld(a).split(".");return a.split(".").slice(-n.length).join(".")}static filterRelevantLines(e,a,n){if(0===a.length)return e.slice(0,2*n+1);const t=new Set;return(a=a.sort(((e,a)=>(e.lineNumber||0)-(a.lineNumber||0)))).forEach((({lineNumber:e})=>{let a=e-n,i=e+n;for(;a<1;)a++,i++;t.has(a-3-1)&&(a-=3);for(let e=a;e<=i;e++){const a=e;t.add(a)}})),e.filter((e=>t.has(e.lineNumber)))}}
|
|
17
|
+
*/const oe="…",re={PASS:{label:"pass",minScore:.9},AVERAGE:{label:"average",minScore:.5},FAIL:{label:"fail"},ERROR:{label:"error"}},se=["com","co","gov","edu","ac","org","go","gob","or","net","in","ne","nic","gouv","web","spb","blog","jus","kiev","mil","wi","qc","ca","bel","on"];class le{static get RATINGS(){return re}static get PASS_THRESHOLD(){return.9}static get MS_DISPLAY_VALUE(){return"%10d ms"}static getFinalDisplayedUrl(e){if(e.finalDisplayedUrl)return e.finalDisplayedUrl;if(e.finalUrl)return e.finalUrl;throw new Error("Could not determine final displayed URL")}static getMainDocumentUrl(e){return e.mainDocumentUrl||e.finalUrl}static getFullPageScreenshot(e){if(e.fullPageScreenshot)return e.fullPageScreenshot;return e.audits["full-page-screenshot"]?.details}static splitMarkdownCodeSpans(e){const a=[],n=e.split(/`(.*?)`/g);for(let e=0;e<n.length;e++){const t=n[e];if(!t)continue;const i=e%2!=0;a.push({isCode:i,text:t})}return a}static splitMarkdownLink(e){const a=[],n=e.split(/\[([^\]]+?)\]\((https?:\/\/.*?)\)/g);for(;n.length;){const[e,t,i]=n.splice(0,3);e&&a.push({isLink:!1,text:e}),t&&i&&a.push({isLink:!0,text:t,linkHref:i})}return a}static truncate(e,a,n="…"){if(e.length<=a)return e;const t=new Intl.Segmenter(void 0,{granularity:"grapheme"}).segment(e)[Symbol.iterator]();let i=0;for(let o=0;o<=a-n.length;o++){const a=t.next();if(a.done)return e;i=a.value.index}for(let a=0;a<n.length;a++)if(t.next().done)return e;return e.slice(0,i)+n}static getURLDisplayName(e,a){const n=void 0!==(a=a||{numPathParts:void 0,preserveQuery:void 0,preserveHost:void 0}).numPathParts?a.numPathParts:2,t=void 0===a.preserveQuery||a.preserveQuery,i=a.preserveHost||!1;let o;if("about:"===e.protocol||"data:"===e.protocol)o=e.href;else{o=e.pathname;const a=o.split("/").filter((e=>e.length));n&&a.length>n&&(o=oe+a.slice(-1*n).join("/")),i&&(o=`${e.host}/${o.replace(/^\//,"")}`),t&&(o=`${o}${e.search}`)}if("data:"!==e.protocol&&(o=o.replace(/([a-f0-9]{7})[a-f0-9]{13}[a-f0-9]*/g,"$1…"),o=o.replace(/([a-zA-Z0-9-_]{9})(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])[a-zA-Z0-9-_]{10,}/g,"$1…"),o=o.replace(/(\d{3})\d{6,}/g,"$1…"),o=o.replace(/\u2026+/g,oe),o.length>64&&o.includes("?")&&(o=o.replace(/\?([^=]*)(=)?.*/,"?$1$2…"),o.length>64&&(o=o.replace(/\?.*/,"?…")))),o.length>64){const e=o.lastIndexOf(".");o=e>=0?o.slice(0,63-(o.length-e))+`…${o.slice(e)}`:o.slice(0,63)+oe}return o}static parseURL(e){const a=new URL(e);return{file:le.getURLDisplayName(a),hostname:a.hostname,origin:a.origin}}static createOrReturnURL(e){return e instanceof URL?e:new URL(e)}static getTld(e){const a=e.split(".").slice(-2);return se.includes(a[0])?`.${a.join(".")}`:`.${a[a.length-1]}`}static getRootDomain(e){const a=le.createOrReturnURL(e).hostname,n=le.getTld(a).split(".");return a.split(".").slice(-n.length).join(".")}static filterRelevantLines(e,a,n){if(0===a.length)return e.slice(0,2*n+1);const t=new Set;return(a=a.sort(((e,a)=>(e.lineNumber||0)-(a.lineNumber||0)))).forEach((({lineNumber:e})=>{let a=e-n,i=e+n;for(;a<1;)a++,i++;t.has(a-3-1)&&(a-=3);for(let e=a;e<=i;e++){const a=e;t.add(a)}})),e.filter((e=>t.has(e.lineNumber)))}}
|
|
18
18
|
/**
|
|
19
19
|
* @license Copyright 2023 The Lighthouse Authors. All Rights Reserved.
|
|
20
20
|
* 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
|
|
@@ -133,7 +133,7 @@ class ka{constructor(e,a){this._document=e,this._lighthouseChannel="unknown",thi
|
|
|
133
133
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
134
134
|
* See the License for the specific language governing permissions and
|
|
135
135
|
* limitations under the License.
|
|
136
|
-
*/class Ia extends wa{_renderMetric(e){const a=this.dom.createComponent("metric"),n=this.dom.find(".lh-metric",a);n.id=e.result.id;const t=me.calculateRating(e.result.score,e.result.scoreDisplayMode);n.classList.add(`lh-metric--${t}`);this.dom.find(".lh-metric__title",a).textContent=e.result.title;const i=this.dom.find(".lh-metric__value",a);i.textContent=e.result.displayValue||"";const o=this.dom.find(".lh-metric__description",a);if(o.append(this.dom.convertMarkdownLinkSnippets(e.result.description)),"error"===e.result.scoreDisplayMode){o.textContent="",i.textContent="Error!";this.dom.createChildOf(o,"span").textContent=e.result.errorMessage||"Report error: no metric information"}else"notApplicable"===e.result.scoreDisplayMode&&(i.textContent="--");return n}_renderOpportunity(e,a){const n=this.dom.createComponent("opportunity"),t=this.populateAuditValues(e,n);if(t.id=e.result.id,!e.result.details||"error"===e.result.scoreDisplayMode)return t;const i=e.result.details;if(
|
|
136
|
+
*/class Ia extends wa{_renderMetric(e){const a=this.dom.createComponent("metric"),n=this.dom.find(".lh-metric",a);n.id=e.result.id;const t=me.calculateRating(e.result.score,e.result.scoreDisplayMode);n.classList.add(`lh-metric--${t}`);this.dom.find(".lh-metric__title",a).textContent=e.result.title;const i=this.dom.find(".lh-metric__value",a);i.textContent=e.result.displayValue||"";const o=this.dom.find(".lh-metric__description",a);if(o.append(this.dom.convertMarkdownLinkSnippets(e.result.description)),"error"===e.result.scoreDisplayMode){o.textContent="",i.textContent="Error!";this.dom.createChildOf(o,"span").textContent=e.result.errorMessage||"Report error: no metric information"}else"notApplicable"===e.result.scoreDisplayMode&&(i.textContent="--");return n}_renderOpportunity(e,a){const n=this.dom.createComponent("opportunity"),t=this.populateAuditValues(e,n);if(t.id=e.result.id,!e.result.details||"error"===e.result.scoreDisplayMode)return t;const i=e.result.details;if(void 0===i.overallSavingsMs)return t;const o=this.dom.find("span.lh-audit__display-text, div.lh-audit__display-text",t),r=i.overallSavingsMs/a*100+"%";if(this.dom.find("div.lh-sparkline__bar",t).style.width=r,o.textContent=ue.i18n.formatSeconds(i.overallSavingsMs,.01),e.result.displayValue){const a=e.result.displayValue;this.dom.find("div.lh-load-opportunity__sparkline",t).title=a,o.title=a}return t}_getWastedMs(e){if(e.result.details){const a=e.result.details;if("number"!=typeof a.overallSavingsMs)throw new Error("non-opportunity details passed to _getWastedMs");return a.overallSavingsMs}return Number.MIN_VALUE}_getScoringCalculatorHref(e){const a=e.filter((e=>"metrics"===e.group)),n=e.find((e=>"interactive"===e.id)),t=e.find((e=>"first-cpu-idle"===e.id)),i=e.find((e=>"first-meaningful-paint"===e.id));n&&a.push(n),t&&a.push(t),i&&a.push(i);const o=[...a.map((e=>{let a;var n;return"number"==typeof e.result.numericValue?(a="cumulative-layout-shift"===e.id?(n=e.result.numericValue,Math.round(100*n)/100):Math.round(e.result.numericValue),a=a.toString()):a="null",[e.acronym||e.id,a]}))];ue.reportJson&&(o.push(["device",ue.reportJson.configSettings.formFactor]),o.push(["version",ue.reportJson.lighthouseVersion]));const r=new URLSearchParams(o),s=new URL("https://googlechrome.github.io/lighthouse/scorecalc/");return s.hash=r.toString(),s.href}_classifyPerformanceAudit(e){return e.group?null:void 0!==e.result.details?.overallSavingsMs?"load-opportunity":"diagnostic"}render(e,a,n){const t=ue.strings,i=this.dom.createElement("div","lh-category");i.id=e.id,i.append(this.renderCategoryHeader(e,a,n));const o=e.auditRefs.filter((e=>"metrics"===e.group));if(o.length){const[n,r]=this.renderAuditGroup(a.metrics),s=this.dom.createElement("input","lh-metrics-toggle__input"),l=`lh-metrics-toggle${ue.getUniqueSuffix()}`;s.setAttribute("aria-label","Toggle the display of metric descriptions"),s.type="checkbox",s.id=l,n.prepend(s);const p=this.dom.find(".lh-audit-group__header",n),u=this.dom.createChildOf(p,"label","lh-metrics-toggle__label");u.htmlFor=l;const c=this.dom.createChildOf(u,"span","lh-metrics-toggle__labeltext--show"),d=this.dom.createChildOf(u,"span","lh-metrics-toggle__labeltext--hide");c.textContent=ue.strings.expandView,d.textContent=ue.strings.collapseView;const m=this.dom.createElement("div","lh-metrics-container");if(n.insertBefore(m,r),o.forEach((e=>{m.append(this._renderMetric(e))})),i.querySelector(".lh-gauge__wrapper")){const a=this.dom.find(".lh-category-header__description",i),n=this.dom.createChildOf(a,"div","lh-metrics__disclaimer"),o=this.dom.convertMarkdownLinkSnippets(t.varianceDisclaimer);n.append(o);const r=this.dom.createChildOf(n,"a","lh-calclink");r.target="_blank",r.textContent=t.calculatorLink,this.dom.safelySetHref(r,this._getScoringCalculatorHref(e.auditRefs))}n.classList.add("lh-audit-group--metrics"),i.append(n)}const r=this.dom.createChildOf(i,"div","lh-filmstrip-container"),s=e.auditRefs.find((e=>"screenshot-thumbnails"===e.id))?.result;if(s?.details){r.id=s.id;const e=this.detailsRenderer.render(s.details);e&&r.append(e)}const l=e.auditRefs.filter((e=>"load-opportunity"===this._classifyPerformanceAudit(e))).filter((e=>!me.showAsPassed(e.result))).sort(((e,a)=>this._getWastedMs(a)-this._getWastedMs(e))),p=o.filter((e=>!!e.relevantAudits));if(p.length&&this.renderMetricAuditFilter(p,i),l.length){const e=2e3,n=l.map((e=>this._getWastedMs(e))),o=Math.max(...n),r=Math.max(1e3*Math.ceil(o/1e3),e),[s,p]=this.renderAuditGroup(a["load-opportunities"]),u=this.dom.createComponent("opportunityHeader");this.dom.find(".lh-load-opportunity__col--one",u).textContent=t.opportunityResourceColumnLabel,this.dom.find(".lh-load-opportunity__col--two",u).textContent=t.opportunitySavingsColumnLabel;const c=this.dom.find(".lh-load-opportunity__header",u);s.insertBefore(c,p),l.forEach((e=>s.insertBefore(this._renderOpportunity(e,r),p))),s.classList.add("lh-audit-group--load-opportunities"),i.append(s)}const u=e.auditRefs.filter((e=>"diagnostic"===this._classifyPerformanceAudit(e))).filter((e=>!me.showAsPassed(e.result))).sort(((e,a)=>("informative"===e.result.scoreDisplayMode?100:Number(e.result.score))-("informative"===a.result.scoreDisplayMode?100:Number(a.result.score))));if(u.length){const[e,n]=this.renderAuditGroup(a.diagnostics);u.forEach((a=>e.insertBefore(this.renderAudit(a),n))),e.classList.add("lh-audit-group--diagnostics"),i.append(e)}const c=e.auditRefs.filter((e=>this._classifyPerformanceAudit(e)&&me.showAsPassed(e.result)));if(!c.length)return i;const d={auditRefs:c,groupDefinitions:a},m=this.renderClump("passed",d);i.append(m);const h=[];if(["performance-budget","timing-budget"].forEach((a=>{const n=e.auditRefs.find((e=>e.id===a));if(n?.result.details){const e=this.detailsRenderer.render(n.result.details);e&&(e.id=a,e.classList.add("lh-details","lh-details--budget","lh-audit"),h.push(e))}})),h.length>0){const[e,n]=this.renderAuditGroup(a.budgets);h.forEach((a=>e.insertBefore(a,n))),e.classList.add("lh-audit-group--budgets"),i.append(e)}return i}renderMetricAuditFilter(e,a){const n=this.dom.createElement("div","lh-metricfilter");this.dom.createChildOf(n,"span","lh-metricfilter__text").textContent=ue.strings.showRelevantAudits;const t=[{acronym:"All"},...e],i=ue.getUniqueSuffix();for(const e of t){const t=`metric-${e.acronym}-${i}`,o=this.dom.createChildOf(n,"input","lh-metricfilter__radio");o.type="radio",o.name=`metricsfilter-${i}`,o.id=t;const r=this.dom.createChildOf(n,"label","lh-metricfilter__label");r.htmlFor=t,r.title=e.result?.title,r.textContent=e.acronym||e.id,"All"===e.acronym&&(o.checked=!0,r.classList.add("lh-metricfilter__label--active")),a.append(n),o.addEventListener("input",(n=>{for(const e of a.querySelectorAll("label.lh-metricfilter__label"))e.classList.toggle("lh-metricfilter__label--active",e.htmlFor===t);a.classList.toggle("lh-category--filtered","All"!==e.acronym);for(const n of a.querySelectorAll("div.lh-audit"))"All"!==e.acronym?(n.hidden=!0,e.relevantAudits&&e.relevantAudits.includes(n.id)&&(n.hidden=!1)):n.hidden=!1;const i=a.querySelectorAll("div.lh-audit-group, details.lh-audit-group");for(const e of i){e.hidden=!1;const a=Array.from(e.querySelectorAll("div.lh-audit")),n=!!a.length&&a.every((e=>e.hidden));e.hidden=n}}))}}}
|
|
137
137
|
/**
|
|
138
138
|
* @license
|
|
139
139
|
* Copyright 2018 The Lighthouse Authors. All Rights Reserved.
|
|
@@ -232,7 +232,7 @@ function(e){return Array.from(e.tBodies[0].rows)}(e),t=n.filter((e=>!e.classList
|
|
|
232
232
|
* @license Copyright 2021 The Lighthouse Authors. All Rights Reserved.
|
|
233
233
|
* 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
|
|
234
234
|
* 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.
|
|
235
|
-
*/function $a(){return new ka(document,document.documentElement).createComponent("styles")}const Ja=({category:e,href:a,gatherMode:n})=>D("div",{ref:Ne((()=>function(e,a){const n=new ka(document,document.documentElement),t=new za(n);return new wa(n,t).renderCategoryScore(e,{},a)}(e,{gatherMode:n,omitLabel:!0,onPageAnchorRendered:e=>e.href=a})),[e,a]),"data-testid":"CategoryScore"}),qa=({text:e})=>D("span",{ref:Ne((()=>{return a=e,new ka(document,document.documentElement).convertMarkdownCodeSnippets(a);var a}),[e])});function Ka(e,a){switch(e){case"navigation":return a.navigationReport;case"timespan":return a.timespanReport;case"snapshot":return a.snapshotReport}}function Za(e,a){switch(e){case"pass":return a.ratingPass;case"average":return a.ratingAverage;case"fail":return a.ratingFail;case"error":return a.ratingError}}function Ya(e){return e.weight*(1-e.result.score)}function Xa(e){return e.result.details&&"opportunity"===e.result.details.type&&e.result.details.overallSavingsMs||0}const Qa=({audit:e})=>D("div",{className:`SummaryTooltipAudit SummaryTooltipAudit--${me.calculateRating(e.result.score,e.result.scoreDisplayMode)}`,children:D(qa,{text:e.result.title})}),en=({category:e})=>{const a=da();const n=e.auditRefs.filter((function(a){return null!==a.result.score&&"metrics"!==a.group&&("hidden"!==a.group||"performance"!==e.id)&&(a.weight>0||Xa(a)>0)&&!me.showAsPassed(a.result)})).sort(((e,a)=>{const n=Ya(e),t=Ya(a);return n!==t?t-n:Xa(a)-Xa(e)})).splice(0,2);return n.length?D("div",{className:"SummaryTooltipAudits",children:[D("div",{className:"SummaryTooltipAudits__title",children:a.highestImpact}),n.map((e=>D(Qa,{audit:e},e.id)))]}):null},an=({category:e,gatherMode:a,url:n})=>{const t=da(),i=ma(),{numPassed:o,numPassableAudits:r,numInformative:s,totalWeight:l}=me.calculateCategoryFraction(e),p=ca(),u=me.shouldDisplayAsFraction(a),c=u?o/r:e.score,d=null===c?"error":me.calculateRating(c);return D("div",{className:"SummaryTooltip",children:[D("div",{className:"SummaryTooltip__title",children:Ka(a,t)}),D("div",{className:"SummaryTooltip__url",children:n}),D(Te,{}),D("div",{className:"SummaryTooltip__category",children:[D("div",{className:"SummaryTooltip__category-title",children:e.title}),0!==l&&D("div",{className:`SummaryTooltip__rating SummaryTooltip__rating--${d}`,children:[D("span",{children:Za(d,t)}),!u&&null!==e.score&&D(h,{children:[D("span",{children:" · "}),D("span",{children:p.formatter.formatInteger(100*e.score)})]})]})]}),D("div",{className:"SummaryTooltip__fraction",children:[D("span",{children:i(t.passedAuditCount,{numPassed:o})}),D("span",{children:" / "}),D("span",{children:i(t.passableAuditCount,{numPassableAudits:r})})]}),0!==s&&D("div",{className:"SummaryTooltip__informative",children:i(t.informativeAuditCount,{numInformative:s})}),D(en,{category:e})]})},nn=({category:e,href:a,gatherMode:n,finalDisplayedUrl:t})=>D("div",{className:"SummaryCategory",children:D("div",e?{className:"SummaryCategory__content",children:[D(Ja,{category:e,href:a,gatherMode:n}),D(an,{category:e,gatherMode:n,url:t})]}:{className:"SummaryCategory__null","data-testid":"SummaryCategory__null"})}),tn=["performance","accessibility","best-practices","seo"],on=({lhr:e})=>{const a=da();return D("div",{className:"SummaryNavigationHeader","data-testid":"SummaryNavigationHeader",children:[D(De,{}),D("div",{className:"SummaryNavigationHeader__url",children:D("a",{rel:"noopener",target:"_blank",href:e.finalDisplayedUrl,children:e.finalDisplayedUrl})}),D("div",{className:"SummaryNavigationHeader__category",children:a.categoryPerformance}),D("div",{className:"SummaryNavigationHeader__category",children:a.categoryAccessibility}),D("div",{className:"SummaryNavigationHeader__category",children:a.categoryBestPractices}),D("div",{className:"SummaryNavigationHeader__category",children:a.categorySeo})]})},rn=({lhr:e,label:a,hashIndex:n})=>{const t=Y((()=>me.prepareReportResult(e)),[e]),i=da(),o=Le(e.gatherMode,i);return D("div",{className:"SummaryFlowStep",children:["navigation"===e.gatherMode||0===n?D(on,{lhr:e}):D("div",{className:"SummaryFlowStep__separator",children:[D(De,{}),D(Te,{})]}),D(je,{lhr:e,width:40}),D(De,{mode:e.gatherMode}),D("div",{className:"SummaryFlowStep__label",children:[D("div",{className:"SummaryFlowStep__mode",children:o}),D("a",{className:"SummaryFlowStep__link",href:`#index=${n}`,children:a})]}),tn.map((a=>D(nn,{category:t.categories[a],href:`#index=${n}&anchor=${a}`,gatherMode:e.gatherMode,finalDisplayedUrl:e.finalDisplayedUrl},a)))]})},sn=()=>D("div",{className:"SummaryFlow",children:ze().steps.map(((e,a)=>D(rn,{lhr:e.lhr,label:e.name,hashIndex:a},e.lhr.fetchTime)))}),ln=()=>{const e=ze(),a=da(),n=ma();let t=0,i=0,o=0;for(const a of e.steps)switch(a.lhr.gatherMode){case"navigation":t++;break;case"timespan":i++;break;case"snapshot":o++}const r=[];t&&r.push(n(a.navigationReportCount,{numNavigation:t})),i&&r.push(n(a.timespanReportCount,{numTimespan:i})),o&&r.push(n(a.snapshotReportCount,{numSnapshot:o}));const s=r.join(" · ");return D("div",{className:"SummaryHeader",children:[D("div",{className:"SummaryHeader__title",children:a.summary}),D("div",{className:"SummaryHeader__subtitle",children:s})]})},pn=({children:e})=>D("div",{className:"SummarySectionHeader",children:[D("div",{className:"SummarySectionHeader__content",children:e}),D(Te,{})]}),un=()=>{const e=da();return D("div",{className:"Summary","data-testid":"Summary",children:[D(ln,{}),D(Te,{}),D(pn,{children:e.allReports}),D(sn,{})]})};const cn=({hashState:e})=>D("div",{ref:Ne((()=>function(e,a={}){const n=document.createElement("article");n.classList.add("lh-root","lh-vars");const t=new ka(n.ownerDocument,n);return new Ta(t).renderReport(e,n,a),new Va(t,a).initFeatures(e),n}(e.currentLhr,{disableFireworks:!0,disableDarkMode:!0,omitTopbar:!0,omitGlobalStyles:!0,onPageAnchorRendered:a=>function(e,a){const n=e.cloneNode(!0);if(!n.hash)return n;const t=e.hash.substr(1);n.hash=`#index=${a}&anchor=${t}`,n.onclick=e=>{e.preventDefault();const a=document.getElementById(t);a&&a.scrollIntoView()},e.replaceWith(n)}(a,e.index)})),[e]),"data-testid":"Report"}),dn=e=>{const a=da();return D("div",{className:"HelpDialogColumn",children:[D("div",{className:"HelpDialogColumn__legend",children:[D("div",{className:"HelpDialogColumnTimeline",children:[e.icon,D("div",{className:"HelpDialogColumnTimeline__line"})]}),D("div",{className:"HelpDialogColumn__legend-label",children:e.userFriendlyModeLabel})]}),D("div",{className:"HelpDialogColumn__header",children:[D("div",{className:"HelpDialogColumn__header-title",children:e.lighthouseOfficialModeLabel}),D("p",{children:e.modeDescription})]}),D("div",{className:"HelpDialogColumn__use-cases",children:[D("p",{children:e.useCaseInstruction}),D("ul",{children:e.useCases.map(((e,a)=>D("li",{children:e},a)))})]}),D("div",{className:"HelpDialogColumn__categories",children:[D("p",{children:a.categories}),D("ul",{children:e.availableCategories.map(((e,a)=>D("li",{children:e},a)))})]})]})},mn=({onClose:e})=>{const a=da();return D("div",{className:"HelpDialog",children:[D("div",{className:"HelpDialog__title",children:[D("div",{children:a.helpDialogTitle}),D("div",{style:{flexGrow:1}}),D("button",{className:"HelpDialog__close",onClick:e,children:D(ye,{})})]}),D("div",{className:"HelpDialog__columns",children:[D(dn,{icon:D(ve,{}),userFriendlyModeLabel:a.navigationDescription,lighthouseOfficialModeLabel:a.navigationReport,modeDescription:a.navigationLongDescription,useCaseInstruction:a.helpUseCaseInstructionNavigation,useCases:[a.helpUseCaseNavigation1,a.helpUseCaseNavigation2,a.helpUseCaseNavigation3],availableCategories:[a.categoryPerformance,a.categoryAccessibility,a.categoryBestPractices,a.categorySeo,a.categoryProgressiveWebApp]}),D(dn,{icon:D(fe,{}),userFriendlyModeLabel:a.timespanDescription,lighthouseOfficialModeLabel:a.timespanReport,modeDescription:a.timespanLongDescription,useCaseInstruction:a.helpUseCaseInstructionTimespan,useCases:[a.helpUseCaseTimespan1,a.helpUseCaseTimespan2],availableCategories:[a.categoryPerformance,a.categoryBestPractices]}),D(dn,{icon:D(be,{}),userFriendlyModeLabel:a.snapshotDescription,lighthouseOfficialModeLabel:a.snapshotReport,modeDescription:a.snapshotLongDescription,useCaseInstruction:a.helpUseCaseInstructionSnapshot,useCases:[a.helpUseCaseSnapshot1,a.helpUseCaseSnapshot2],availableCategories:[a.categoryPerformance,a.categoryAccessibility,a.categoryBestPractices,a.categorySeo]})]})]})};function hn(e,a){const n=new Blob([a],{type:"text/html"}),t=function(e){const a=e.steps[0].lhr;return Ga(e.name.replace(/\s/g,"-"),a.fetchTime)}(e)+".html";hn.saveFile(n,t)}hn.saveFile=function(e,a){new ka(document,document.documentElement).saveFile(e,a)};const gn=()=>D("svg",{role:"img",class:"lh-topbar__logo",title:"Lighthouse logo",width:"24",height:"24",fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 48 48",children:[D("path",{d:"m14 7 10-7 10 7v10h5v7h-5l5 24H9l5-24H9v-7h5V7Z",fill:"#F63"}),D("path",{d:"M31.561 24H14l-1.689 8.105L31.561 24ZM18.983 48H9l1.022-4.907L35.723 32.27l1.663 7.98L18.983 48Z",fill:"#FFA385"}),D("path",{fill:"#FF3",d:"M20.5 10h7v7h-7z"})]}),vn=({onClick:e,label:a,children:n})=>D("button",{className:"TopbarButton",onClick:e,"aria-label":a,children:n}),fn=({onMenuClick:e})=>{const a=ze(),n=da(),[t,i]=J(!1),{getReportHtml:o,saveAsGist:r}=X(Pe);return D("div",{className:"Topbar",children:[D(vn,{onClick:e,label:"Button that opens and closes the sidebar",children:D(we,{})}),D("div",{className:"Topbar__logo",children:D(gn,{})}),D("div",{className:"Topbar__title",children:n.title}),o&&D(vn,{onClick:()=>{const e=o(a);hn(a,e)},label:"Button that saves the report as HTML",children:n.save}),r&&D(vn,{onClick:()=>r(a),label:"Button that saves the report to a gist",children:n.dropdownSaveGist}),D("div",{style:{flexGrow:1}}),D(vn,{onClick:()=>i((e=>!e)),label:"Button that toggles the help dialog",children:D("div",{className:"Topbar__help-label",children:[D(Se,{}),n.helpLabel]})}),t?D(mn,{onClose:()=>i(!1)}):null]})},bn=({lhr:e,position:a})=>D("div",{className:`HeaderThumbnail HeaderThumbnail--${a}`,children:[D(je,{lhr:e,height:"main"===a?120:80}),D("div",{className:"HeaderThumbnail__icon",children:D(Re,{mode:e.gatherMode})})]}),yn=({hashState:e})=>{const a=ze(),{index:n}=e,t=a.steps[n],i=a.steps[n-1],o=a.steps[n+1],r=da(),s=Le(t.lhr.gatherMode,r);return D("div",{className:"Header",children:[i&&D(h,{children:[a.steps[n-2]&&D("div",{className:"Header__segment"}),D("div",{className:"Header__prev-thumbnail",children:[D(bn,{lhr:i.lhr,position:"prev"}),D("div",{className:"Header__segment"})]}),D("a",{className:"Header__prev-title",href:"#index="+(n-1),children:i.name})]}),D("div",{className:"Header__current-thumbnail",children:D(bn,{lhr:t.lhr,position:"main"})}),D("div",{className:"Header__current-title",children:[t.name,D("div",{className:"Header__current-description",children:s})]}),o&&D(h,{children:[D("div",{className:"Header__next-thumbnail",children:[D("div",{className:"Header__segment"}),D(bn,{lhr:o.lhr,position:"next"})]}),D("a",{className:"Header__next-title",href:`#index=${n+1}`,children:o.name}),a.steps[n+2]&&D("div",{className:"Header__segment"})]})]})},_n=()=>D("div",{ref:Ne($a)});const Cn=()=>{const e=Ie(),a=Z(null);return K((()=>{const n=function(e){return e&&e.anchor?document.getElementById(e.anchor):null}(e);n?n.scrollIntoView():a.current&&(a.current.scrollTop=0)}),[e]),D("div",{ref:a,className:"Content",children:e?D(h,{children:[D(yn,{hashState:e}),D(cn,{hashState:e})]}):D(un,{})})},kn=({flowResult:e,options:a})=>{const[n,t]=J(!1),i=Y((()=>a||{}),[a]);return D(Pe.Provider,{value:i,children:D(Ae.Provider,{value:e,children:D(ha,{children:[D(_n,{}),D("div",{className:xe("App",{"App--collapsed":n}),"data-testid":"App",children:[D(fn,{onMenuClick:()=>t((e=>!e))}),D(Ca,{}),D(Cn,{})]})]})})})};
|
|
235
|
+
*/function $a(){return new ka(document,document.documentElement).createComponent("styles")}const Ja=({category:e,href:a,gatherMode:n})=>D("div",{ref:Ne((()=>function(e,a){const n=new ka(document,document.documentElement),t=new za(n);return new wa(n,t).renderCategoryScore(e,{},a)}(e,{gatherMode:n,omitLabel:!0,onPageAnchorRendered:e=>e.href=a})),[e,a]),"data-testid":"CategoryScore"}),qa=({text:e})=>D("span",{ref:Ne((()=>{return a=e,new ka(document,document.documentElement).convertMarkdownCodeSnippets(a);var a}),[e])});function Ka(e,a){switch(e){case"navigation":return a.navigationReport;case"timespan":return a.timespanReport;case"snapshot":return a.snapshotReport}}function Za(e,a){switch(e){case"pass":return a.ratingPass;case"average":return a.ratingAverage;case"fail":return a.ratingFail;case"error":return a.ratingError}}function Ya(e){return e.weight*(1-e.result.score)}function Xa(e){return e.result.details&&e.result.details.overallSavingsMs||0}const Qa=({audit:e})=>D("div",{className:`SummaryTooltipAudit SummaryTooltipAudit--${me.calculateRating(e.result.score,e.result.scoreDisplayMode)}`,children:D(qa,{text:e.result.title})}),en=({category:e})=>{const a=da();const n=e.auditRefs.filter((function(a){return null!==a.result.score&&"metrics"!==a.group&&("hidden"!==a.group||"performance"!==e.id)&&(a.weight>0||Xa(a)>0)&&!me.showAsPassed(a.result)})).sort(((e,a)=>{const n=Ya(e),t=Ya(a);return n!==t?t-n:Xa(a)-Xa(e)})).splice(0,2);return n.length?D("div",{className:"SummaryTooltipAudits",children:[D("div",{className:"SummaryTooltipAudits__title",children:a.highestImpact}),n.map((e=>D(Qa,{audit:e},e.id)))]}):null},an=({category:e,gatherMode:a,url:n})=>{const t=da(),i=ma(),{numPassed:o,numPassableAudits:r,numInformative:s,totalWeight:l}=me.calculateCategoryFraction(e),p=ca(),u=me.shouldDisplayAsFraction(a),c=u?o/r:e.score,d=null===c?"error":me.calculateRating(c);return D("div",{className:"SummaryTooltip",children:[D("div",{className:"SummaryTooltip__title",children:Ka(a,t)}),D("div",{className:"SummaryTooltip__url",children:n}),D(Te,{}),D("div",{className:"SummaryTooltip__category",children:[D("div",{className:"SummaryTooltip__category-title",children:e.title}),0!==l&&D("div",{className:`SummaryTooltip__rating SummaryTooltip__rating--${d}`,children:[D("span",{children:Za(d,t)}),!u&&null!==e.score&&D(h,{children:[D("span",{children:" · "}),D("span",{children:p.formatter.formatInteger(100*e.score)})]})]})]}),D("div",{className:"SummaryTooltip__fraction",children:[D("span",{children:i(t.passedAuditCount,{numPassed:o})}),D("span",{children:" / "}),D("span",{children:i(t.passableAuditCount,{numPassableAudits:r})})]}),0!==s&&D("div",{className:"SummaryTooltip__informative",children:i(t.informativeAuditCount,{numInformative:s})}),D(en,{category:e})]})},nn=({category:e,href:a,gatherMode:n,finalDisplayedUrl:t})=>D("div",{className:"SummaryCategory",children:D("div",e?{className:"SummaryCategory__content",children:[D(Ja,{category:e,href:a,gatherMode:n}),D(an,{category:e,gatherMode:n,url:t})]}:{className:"SummaryCategory__null","data-testid":"SummaryCategory__null"})}),tn=["performance","accessibility","best-practices","seo"],on=({lhr:e})=>{const a=da();return D("div",{className:"SummaryNavigationHeader","data-testid":"SummaryNavigationHeader",children:[D(De,{}),D("div",{className:"SummaryNavigationHeader__url",children:D("a",{rel:"noopener",target:"_blank",href:e.finalDisplayedUrl,children:e.finalDisplayedUrl})}),D("div",{className:"SummaryNavigationHeader__category",children:a.categoryPerformance}),D("div",{className:"SummaryNavigationHeader__category",children:a.categoryAccessibility}),D("div",{className:"SummaryNavigationHeader__category",children:a.categoryBestPractices}),D("div",{className:"SummaryNavigationHeader__category",children:a.categorySeo})]})},rn=({lhr:e,label:a,hashIndex:n})=>{const t=Y((()=>me.prepareReportResult(e)),[e]),i=da(),o=Le(e.gatherMode,i);return D("div",{className:"SummaryFlowStep",children:["navigation"===e.gatherMode||0===n?D(on,{lhr:e}):D("div",{className:"SummaryFlowStep__separator",children:[D(De,{}),D(Te,{})]}),D(je,{lhr:e,width:40}),D(De,{mode:e.gatherMode}),D("div",{className:"SummaryFlowStep__label",children:[D("div",{className:"SummaryFlowStep__mode",children:o}),D("a",{className:"SummaryFlowStep__link",href:`#index=${n}`,children:a})]}),tn.map((a=>D(nn,{category:t.categories[a],href:`#index=${n}&anchor=${a}`,gatherMode:e.gatherMode,finalDisplayedUrl:e.finalDisplayedUrl},a)))]})},sn=()=>D("div",{className:"SummaryFlow",children:ze().steps.map(((e,a)=>D(rn,{lhr:e.lhr,label:e.name,hashIndex:a},e.lhr.fetchTime)))}),ln=()=>{const e=ze(),a=da(),n=ma();let t=0,i=0,o=0;for(const a of e.steps)switch(a.lhr.gatherMode){case"navigation":t++;break;case"timespan":i++;break;case"snapshot":o++}const r=[];t&&r.push(n(a.navigationReportCount,{numNavigation:t})),i&&r.push(n(a.timespanReportCount,{numTimespan:i})),o&&r.push(n(a.snapshotReportCount,{numSnapshot:o}));const s=r.join(" · ");return D("div",{className:"SummaryHeader",children:[D("div",{className:"SummaryHeader__title",children:a.summary}),D("div",{className:"SummaryHeader__subtitle",children:s})]})},pn=({children:e})=>D("div",{className:"SummarySectionHeader",children:[D("div",{className:"SummarySectionHeader__content",children:e}),D(Te,{})]}),un=()=>{const e=da();return D("div",{className:"Summary","data-testid":"Summary",children:[D(ln,{}),D(Te,{}),D(pn,{children:e.allReports}),D(sn,{})]})};const cn=({hashState:e})=>D("div",{ref:Ne((()=>function(e,a={}){const n=document.createElement("article");n.classList.add("lh-root","lh-vars");const t=new ka(n.ownerDocument,n);return new Ta(t).renderReport(e,n,a),new Va(t,a).initFeatures(e),n}(e.currentLhr,{disableFireworks:!0,disableDarkMode:!0,omitTopbar:!0,omitGlobalStyles:!0,onPageAnchorRendered:a=>function(e,a){const n=e.cloneNode(!0);if(!n.hash)return n;const t=e.hash.substr(1);n.hash=`#index=${a}&anchor=${t}`,n.onclick=e=>{e.preventDefault();const a=document.getElementById(t);a&&a.scrollIntoView()},e.replaceWith(n)}(a,e.index)})),[e]),"data-testid":"Report"}),dn=e=>{const a=da();return D("div",{className:"HelpDialogColumn",children:[D("div",{className:"HelpDialogColumn__legend",children:[D("div",{className:"HelpDialogColumnTimeline",children:[e.icon,D("div",{className:"HelpDialogColumnTimeline__line"})]}),D("div",{className:"HelpDialogColumn__legend-label",children:e.userFriendlyModeLabel})]}),D("div",{className:"HelpDialogColumn__header",children:[D("div",{className:"HelpDialogColumn__header-title",children:e.lighthouseOfficialModeLabel}),D("p",{children:e.modeDescription})]}),D("div",{className:"HelpDialogColumn__use-cases",children:[D("p",{children:e.useCaseInstruction}),D("ul",{children:e.useCases.map(((e,a)=>D("li",{children:e},a)))})]}),D("div",{className:"HelpDialogColumn__categories",children:[D("p",{children:a.categories}),D("ul",{children:e.availableCategories.map(((e,a)=>D("li",{children:e},a)))})]})]})},mn=({onClose:e})=>{const a=da();return D("div",{className:"HelpDialog",children:[D("div",{className:"HelpDialog__title",children:[D("div",{children:a.helpDialogTitle}),D("div",{style:{flexGrow:1}}),D("button",{className:"HelpDialog__close",onClick:e,children:D(ye,{})})]}),D("div",{className:"HelpDialog__columns",children:[D(dn,{icon:D(ve,{}),userFriendlyModeLabel:a.navigationDescription,lighthouseOfficialModeLabel:a.navigationReport,modeDescription:a.navigationLongDescription,useCaseInstruction:a.helpUseCaseInstructionNavigation,useCases:[a.helpUseCaseNavigation1,a.helpUseCaseNavigation2,a.helpUseCaseNavigation3],availableCategories:[a.categoryPerformance,a.categoryAccessibility,a.categoryBestPractices,a.categorySeo,a.categoryProgressiveWebApp]}),D(dn,{icon:D(fe,{}),userFriendlyModeLabel:a.timespanDescription,lighthouseOfficialModeLabel:a.timespanReport,modeDescription:a.timespanLongDescription,useCaseInstruction:a.helpUseCaseInstructionTimespan,useCases:[a.helpUseCaseTimespan1,a.helpUseCaseTimespan2],availableCategories:[a.categoryPerformance,a.categoryBestPractices]}),D(dn,{icon:D(be,{}),userFriendlyModeLabel:a.snapshotDescription,lighthouseOfficialModeLabel:a.snapshotReport,modeDescription:a.snapshotLongDescription,useCaseInstruction:a.helpUseCaseInstructionSnapshot,useCases:[a.helpUseCaseSnapshot1,a.helpUseCaseSnapshot2],availableCategories:[a.categoryPerformance,a.categoryAccessibility,a.categoryBestPractices,a.categorySeo]})]})]})};function hn(e,a){const n=new Blob([a],{type:"text/html"}),t=function(e){const a=e.steps[0].lhr;return Ga(e.name.replace(/\s/g,"-"),a.fetchTime)}(e)+".html";hn.saveFile(n,t)}hn.saveFile=function(e,a){new ka(document,document.documentElement).saveFile(e,a)};const gn=()=>D("svg",{role:"img",class:"lh-topbar__logo",title:"Lighthouse logo",width:"24",height:"24",fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 48 48",children:[D("path",{d:"m14 7 10-7 10 7v10h5v7h-5l5 24H9l5-24H9v-7h5V7Z",fill:"#F63"}),D("path",{d:"M31.561 24H14l-1.689 8.105L31.561 24ZM18.983 48H9l1.022-4.907L35.723 32.27l1.663 7.98L18.983 48Z",fill:"#FFA385"}),D("path",{fill:"#FF3",d:"M20.5 10h7v7h-7z"})]}),vn=({onClick:e,label:a,children:n})=>D("button",{className:"TopbarButton",onClick:e,"aria-label":a,children:n}),fn=({onMenuClick:e})=>{const a=ze(),n=da(),[t,i]=J(!1),{getReportHtml:o,saveAsGist:r}=X(Pe);return D("div",{className:"Topbar",children:[D(vn,{onClick:e,label:"Button that opens and closes the sidebar",children:D(we,{})}),D("div",{className:"Topbar__logo",children:D(gn,{})}),D("div",{className:"Topbar__title",children:n.title}),o&&D(vn,{onClick:()=>{const e=o(a);hn(a,e)},label:"Button that saves the report as HTML",children:n.save}),r&&D(vn,{onClick:()=>r(a),label:"Button that saves the report to a gist",children:n.dropdownSaveGist}),D("div",{style:{flexGrow:1}}),D(vn,{onClick:()=>i((e=>!e)),label:"Button that toggles the help dialog",children:D("div",{className:"Topbar__help-label",children:[D(Se,{}),n.helpLabel]})}),t?D(mn,{onClose:()=>i(!1)}):null]})},bn=({lhr:e,position:a})=>D("div",{className:`HeaderThumbnail HeaderThumbnail--${a}`,children:[D(je,{lhr:e,height:"main"===a?120:80}),D("div",{className:"HeaderThumbnail__icon",children:D(Re,{mode:e.gatherMode})})]}),yn=({hashState:e})=>{const a=ze(),{index:n}=e,t=a.steps[n],i=a.steps[n-1],o=a.steps[n+1],r=da(),s=Le(t.lhr.gatherMode,r);return D("div",{className:"Header",children:[i&&D(h,{children:[a.steps[n-2]&&D("div",{className:"Header__segment"}),D("div",{className:"Header__prev-thumbnail",children:[D(bn,{lhr:i.lhr,position:"prev"}),D("div",{className:"Header__segment"})]}),D("a",{className:"Header__prev-title",href:"#index="+(n-1),children:i.name})]}),D("div",{className:"Header__current-thumbnail",children:D(bn,{lhr:t.lhr,position:"main"})}),D("div",{className:"Header__current-title",children:[t.name,D("div",{className:"Header__current-description",children:s})]}),o&&D(h,{children:[D("div",{className:"Header__next-thumbnail",children:[D("div",{className:"Header__segment"}),D(bn,{lhr:o.lhr,position:"next"})]}),D("a",{className:"Header__next-title",href:`#index=${n+1}`,children:o.name}),a.steps[n+2]&&D("div",{className:"Header__segment"})]})]})},_n=()=>D("div",{ref:Ne($a)});const Cn=()=>{const e=Ie(),a=Z(null);return K((()=>{const n=function(e){return e&&e.anchor?document.getElementById(e.anchor):null}(e);n?n.scrollIntoView():a.current&&(a.current.scrollTop=0)}),[e]),D("div",{ref:a,className:"Content",children:e?D(h,{children:[D(yn,{hashState:e}),D(cn,{hashState:e})]}):D(un,{})})},kn=({flowResult:e,options:a})=>{const[n,t]=J(!1),i=Y((()=>a||{}),[a]);return D(Pe.Provider,{value:i,children:D(Ae.Provider,{value:e,children:D(ha,{children:[D(_n,{}),D("div",{className:xe("App",{"App--collapsed":n}),"data-testid":"App",children:[D(fn,{onMenuClick:()=>t((e=>!e))}),D(Ca,{}),D(Cn,{})]})]})})})};
|
|
236
236
|
/**
|
|
237
237
|
* @license Copyright 2021 The Lighthouse Authors. All Rights Reserved.
|
|
238
238
|
* 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
|