chrome-devtools-frontend 1.0.1002543 → 1.0.1002867
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/config/gni/devtools_grd_files.gni +1 -0
- package/front_end/core/host/UserMetrics.ts +2 -1
- package/front_end/core/i18n/locales/en-US.json +11 -32
- package/front_end/core/i18n/locales/en-XL.json +11 -32
- package/front_end/entrypoints/main/MainImpl.ts +1 -0
- package/front_end/generated/InspectorBackendCommands.js +4 -2
- package/front_end/generated/SupportedCSSProperties.js +3 -5
- package/front_end/generated/protocol.ts +18 -4
- package/front_end/models/issues_manager/AttributionReportingIssue.ts +4 -1
- package/front_end/models/issues_manager/DeprecationIssue.ts +84 -103
- package/front_end/models/issues_manager/descriptions/arInvalidHeader.md +3 -0
- package/front_end/panels/elements/stylesSidebarPane.css +3 -0
- package/front_end/panels/issues/AttributionReportingIssueDetailsView.ts +14 -0
- package/front_end/panels/lighthouse/LighthouseController.ts +2 -1
- package/front_end/third_party/lighthouse/lighthouse-dt-bundle.js +409 -409
- package/front_end/third_party/lighthouse/locales/en-US.json +3 -0
- package/front_end/third_party/lighthouse/locales/en-XL.json +3 -0
- package/front_end/third_party/lighthouse/report/bundle.d.ts +2 -22
- package/front_end/third_party/lighthouse/report/bundle.js +5 -354
- package/front_end/third_party/lighthouse/report-assets/report-generator.mjs +1 -1
- package/front_end/ui/components/text_editor/javascript.ts +2 -2
- package/package.json +1 -1
- package/scripts/whitespaces.txt +1 -0
@@ -1,5 +1,5 @@
|
|
1
1
|
/**
|
2
|
-
* Lighthouse v9.6.
|
2
|
+
* Lighthouse v9.6.1 202d605b30c6223dcbba24244da76a9ee7293d6b (May 11 2022)
|
3
3
|
*
|
4
4
|
* Automated auditing, performance metrics, and best practices for the web.
|
5
5
|
*
|
@@ -178,7 +178,7 @@ if(!Number.isFinite(r.receiveHeadersEnd)||r.receiveHeadersEnd<0)return;if(!Numbe
|
|
178
178
|
static estimateRTTByOrigin(e,t){const{forceCoarseEstimates:r=!1,coarseEstimateMultiplier:a=.3,useDownloadEstimates:n=!0,useSendStartEstimates:i=!0,useHeadersEndEstimates:o=!0}=t||{};let s=NetworkAnalyzer$b._estimateRTTByOriginViaTCPTiming(e);if(!s.size||r){s=new Map;const t=NetworkAnalyzer$b._estimateRTTByOriginViaDownloadTiming(e),r=NetworkAnalyzer$b._estimateRTTByOriginViaSendStartTiming(e),c=NetworkAnalyzer$b._estimateRTTByOriginViaHeadersEndTiming(e);for(const[e,r]of t.entries())n&&s.set(e,r);for(const[e,t]of r.entries()){if(!i)continue;const r=s.get(e)||[];s.set(e,r.concat(t))}for(const[e,t]of c.entries()){if(!o)continue;const r=s.get(e)||[];s.set(e,r.concat(t))}for(const e of s.values())e.forEach(((t,r)=>e[r]=t*a))}if(!s.size)throw new Error("No timing information available");return NetworkAnalyzer$b.summarize(s)}static estimateServerResponseTimeByOrigin(e,t){let r=(t||{}).rttByOrigin;if(!r){r=new Map;const a=NetworkAnalyzer$b.estimateRTTByOrigin(e,t)
|
179
179
|
;for(const[e,t]of a.entries())r.set(e,t.min)}const a=NetworkAnalyzer$b._estimateResponseTimeByOrigin(e,r);return NetworkAnalyzer$b.summarize(a)}static estimateThroughput(e){let t=0;const r=e.reduce(((e,r)=>("data"===r.parsedURL?.scheme||r.failed||!r.finished||r.statusCode>300||!r.transferSize||(t+=r.transferSize,e.push({time:r.responseReceivedTime,isStart:!0}),e.push({time:r.endTime,isStart:!1})),e)),[]).sort(((e,t)=>e.time-t.time));if(!r.length)return 1/0;let a=0,n=0,i=0;return r.forEach((e=>{e.isStart?(0===a&&(n=e.time),a++):(a--,0===a&&(i+=e.time-n))})),8*t/i}static findMainDocument(e,t){const r=NetworkAnalyzer$b.findOptionalMainDocument(e,t);if(!r)throw new Error("Unable to identify the main resource");return r}static findOptionalMainDocument(e,t){if(t){const r=e.find((e=>t.startsWith(e.url)&&Po.equalWithExcludedFragments(e.url,t)));if(r)return r}const r=e.filter((e=>e.resourceType===Mo.TYPES.Document));if(r.length)return r.reduce(((e,t)=>t.startTime<e.startTime?t:e))}
|
180
180
|
static resolveRedirects(e){for(;e.redirectDestination;)e=e.redirectDestination;return e}}var Fo=NetworkAnalyzer$b;const Uo=vi.exports,jo=Fo;function getNetworkError(e){if(!e)return new Uo(Uo.errors.NO_DOCUMENT_REQUEST);if(e.failed){const t=e.localizedFailDescription;return"net::ERR_NAME_NOT_RESOLVED"===t||"net::ERR_NAME_RESOLUTION_FAILED"===t||t.startsWith("net::ERR_DNS_")?new Uo(Uo.errors.DNS_FAILURE):new Uo(Uo.errors.FAILED_DOCUMENT_REQUEST,{errorDetails:t})}return e.hasErrorStatusCode()?new Uo(Uo.errors.ERRORED_DOCUMENT_REQUEST,{statusCode:`${e.statusCode}`}):void 0}function getInterstitialError(e,t){if(!e)return;return t.find((e=>e.documentURL.startsWith("chrome-error://")))&&e.failed?e.localizedFailDescription.startsWith("net::ERR_CERT")?new Uo(Uo.errors.INSECURE_DOCUMENT_REQUEST,{securityMessages:e.localizedFailDescription}):new Uo(Uo.errors.CHROME_INTERSTITIAL_ERROR):void 0}function getNonHtmlError(e){if(e)return"text/html"!==e.mimeType?new Uo(Uo.errors.NOT_HTML,{
|
181
|
-
mimeType:e.mimeType}):void 0}var Bo={getNetworkError,getInterstitialError,getPageLoadError:function getPageLoadError$2(e,t){const{url:r,loadFailureMode:a,networkRecords:n}=t;let i,o;try{i=jo.findMainDocument(n,r)}catch(e){}i&&(o=jo.resolveRedirects(i));const s=getNetworkError(i),c=getInterstitialError(i,n),l=getNonHtmlError(o);if("ignore"!==a)return c||(s||(l||e))},getNonHtmlError};var $o=getAugmentedNamespace(Object.freeze({__proto__:null,version:"9.6.
|
181
|
+
mimeType:e.mimeType}):void 0}var Bo={getNetworkError,getInterstitialError,getPageLoadError:function getPageLoadError$2(e,t){const{url:r,loadFailureMode:a,networkRecords:n}=t;let i,o;try{i=jo.findMainDocument(n,r)}catch(e){}i&&(o=jo.resolveRedirects(i));const s=getNetworkError(i),c=getInterstitialError(i,n),l=getNonHtmlError(o);if("ignore"!==a)return c||(s||(l||e))},getNonHtmlError};var $o=getAugmentedNamespace(Object.freeze({__proto__:null,version:"9.6.1"}));const{version:qo}=$o,zo={latency:0,downloadThroughput:0,uploadThroughput:0,offline:!1},Vo={rate:1};function parseUseragentIntoMetadata(e,t){const r=e.match(/Chrome\/([\d.]+)/)?.[1]||"99.0.1234.0",[a]=r.split(".",1),n="mobile"===t;return{brands:[{brand:"Chromium",version:a},{brand:"Google Chrome",version:a},{brand:"Lighthouse",version:qo}],fullVersion:r,...n?{platform:"Android",platformVersion:"6.0",architecture:"",model:"Moto G4"}:{platform:"macOS",platformVersion:"10.15.7",architecture:"x86",model:""},mobile:n}}
|
182
182
|
function enableNetworkThrottling(e,t){const r={offline:!1,latency:t.requestLatencyMs||0,downloadThroughput:t.downloadThroughputKbps||0,uploadThroughput:t.uploadThroughputKbps||0};return r.downloadThroughput=Math.floor(1024*r.downloadThroughput/8),r.uploadThroughput=Math.floor(1024*r.uploadThroughput/8),e.sendCommand("Network.emulateNetworkConditions",r)}function clearNetworkThrottling(e){return e.sendCommand("Network.emulateNetworkConditions",zo)}function enableCPUThrottling(e,t){const r=t.cpuSlowdownMultiplier;return e.sendCommand("Emulation.setCPUThrottlingRate",{rate:r})}function clearCPUThrottling(e){return e.sendCommand("Emulation.setCPUThrottlingRate",Vo)}var Wo={emulate:async function emulate(e,t){if(!1!==t.emulatedUserAgent){const r=t.emulatedUserAgent;await e.sendCommand("Network.setUserAgentOverride",{userAgent:r,userAgentMetadata:parseUseragentIntoMetadata(r,t.formFactor)})}if(!0!==t.screenEmulation.disabled){
|
183
183
|
const{width:r,height:a,deviceScaleFactor:n,mobile:i}=t.screenEmulation,o={width:r,height:a,deviceScaleFactor:n,mobile:i};await e.sendCommand("Emulation.setDeviceMetricsOverride",o),await e.sendCommand("Emulation.setTouchEmulationEnabled",{enabled:o.mobile})}},throttle:async function throttle(e,t){if("devtools"!==t.throttlingMethod)return clearNetworkThrottling(e);await Promise.all([enableNetworkThrottling(e,t.throttling),enableCPUThrottling(e,t.throttling)])},clearThrottling:async function clearThrottling(e){await Promise.all([clearNetworkThrottling(e),clearCPUThrottling(e)])},enableNetworkThrottling,clearNetworkThrottling,enableCPUThrottling,clearCPUThrottling};const Go=on.default,Ho={
|
184
184
|
warningData:"{locationCount, plural,\n =1 {There may be stored data affecting loading performance in this location: {locations}. Audit this page in an incognito window to prevent those resources from affecting your scores.}\n other {There may be stored data affecting loading performance in these locations: {locations}. Audit this page in an incognito window to prevent those resources from affecting your scores.}\n }"},Yo=oi.createMessageInstanceIdFn("lighthouse-core/gather/driver/storage.js",Ho);var Ko={clearDataForOrigin:async function clearDataForOrigin(e,t){const r={msg:"Cleaning origin data",id:"lh:storage:clearDataForOrigin"};Go.time(r);const a=new URL(t).origin,n=["file_systems","shader_cache","service_workers","cache_storage"].join(",");e.setNextProtocolTimeout(5e3);try{await e.sendCommand("Storage.clearDataForOrigin",{origin:a,storageTypes:n})}catch(e){if("PROTOCOL_TIMEOUT"!==e.code)throw e;Go.warn("Driver","clearDataForOrigin timed out")}finally{Go.timeEnd(r)}},
|
@@ -499,102 +499,104 @@ async addStyleRule(e,t){const r=await e.sendCommand("Page.getFrameTree"),{styleS
|
|
499
499
|
;return await this.removeStyleRule(t,a),await t.sendCommand("CSS.disable"),await t.sendCommand("DOM.disable"),n}};const Mp=eo,Pp=As;var Op=class ServiceWorker$1 extends Mp{meta={supportedModes:["navigation"]};async beforePass(e){return this.getArtifact({...e,dependencies:{}})}async afterPass(){}async getArtifact(e){const t=e.driver.defaultSession,{versions:r}=await Pp.getServiceWorkerVersions(t),{registrations:a}=await Pp.getServiceWorkerRegistrations(t);return{versions:r,registrations:a}}};const Fp=eo,Up=ji;var jp=class SourceMaps extends Fp{meta={supportedModes:["timespan","navigation"]};constructor(){super(),this._scriptParsedEvents=[],this.onScriptParsed=this.onScriptParsed.bind(this)}async fetchSourceMap(e,t){const r=await e.fetcher.fetchResource(t,{timeout:1500});if(null===r.content)throw new Error(`Failed fetching source map (${r.status})`);return JSON.parse(r.content)}parseSourceMapFromDataUrl(e){const t=Buffer.from(e.split(",")[1],"base64");return JSON.parse(t.toString())}
|
500
500
|
onScriptParsed(e){e.sourceMapURL&&this._scriptParsedEvents.push(e)}_resolveUrl(e,t){try{return new Up(e,t).href}catch(e){return}}async _retrieveMapFromScriptParsedEvent(e,t){if(!t.sourceMapURL)throw new Error("precondition failed: event.sourceMapURL should exist");const r=t.sourceMapURL.startsWith("data:"),a=t.url,n=r?t.sourceMapURL:this._resolveUrl(t.sourceMapURL,t.url);if(!n)return{scriptUrl:a,errorMessage:`Could not resolve map url: ${t.sourceMapURL}`};const i=r?void 0:n;try{const t=r?this.parseSourceMapFromDataUrl(n):await this.fetchSourceMap(e,n);return t.sections&&(t.sections=t.sections.filter((e=>e.map))),{scriptUrl:a,sourceMapUrl:i,map:t}}catch(e){return{scriptUrl:a,sourceMapUrl:i,errorMessage:e.toString()}}}async startSensitiveInstrumentation(e){const t=e.driver.defaultSession;t.on("Debugger.scriptParsed",this.onScriptParsed),await t.sendCommand("Debugger.enable")}async stopSensitiveInstrumentation(e){const t=e.driver.defaultSession;await t.sendCommand("Debugger.disable"),
|
501
501
|
t.off("Debugger.scriptParsed",this.onScriptParsed)}async getArtifact(e){await e.driver.fetcher.enable();const t=this._scriptParsedEvents.map((t=>this._retrieveMapFromScriptParsedEvent(e.driver,t)));return Promise.all(t)}};const Bp=oo,$p=eo;var qp=class TraceCompat extends $p{meta={supportedModes:["timespan","navigation"],dependencies:{Trace:Bp.symbol}};async getArtifact(e){return{defaultPass:e.dependencies.Trace}}};const zp=vi.exports,Vp=ao;var Wp=class LHTraceProcessor$2 extends Vp{static createNoNavstartError(){return new zp(zp.errors.NO_NAVSTART)}static createNoResourceSendRequestError(){return new zp(zp.errors.NO_RESOURCE_REQUEST)}static createNoTracingStartedError(){return new zp(zp.errors.NO_TRACING_STARTED)}static createNoFirstContentfulPaintError(){return new zp(zp.errors.NO_FCP)}};const Gp=Ao,Hp=Wp;var Yp=Gp(class ProcessedTrace$h{static async compute_(e){return Hp.processTrace(e)}},null);const Kp=Ao,Jp=Wp;var Xp=Kp(class ProcessedNavigation$7{static async compute_(e){
|
502
|
-
return Jp.processNavigation(e)}},null);const Zp=
|
503
|
-
;
|
504
|
-
|
505
|
-
|
506
|
-
;
|
507
|
-
|
508
|
-
|
509
|
-
;
|
510
|
-
exports
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
description:
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
description:"
|
524
|
-
|
525
|
-
|
526
|
-
|
527
|
-
|
528
|
-
description:"
|
529
|
-
|
530
|
-
description:"
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
;
|
536
|
-
|
537
|
-
|
538
|
-
return Object.assign({id:"
|
539
|
-
description:"
|
540
|
-
description:"
|
541
|
-
|
542
|
-
|
543
|
-
title:
|
544
|
-
|
545
|
-
},
|
546
|
-
|
502
|
+
return Jp.processNavigation(e)}},null);const Zp=Ao,Qp=Yp,eh=new Set(["keydown","keypress","keyup"]),th=new Set(["mousedown","mouseup","pointerdown","pointerup","click"]),rh={keyboard:eh,tapOrClick:th,drag:th};class Responsiveness{static getHighPercentileResponsiveness(e){const t=e.frameTreeEvents.filter((e=>"Responsiveness.Renderer.UserInteraction"===e.name)).sort(((e,t)=>t.args.data.maxDuration-e.args.data.maxDuration));if(0===t.length)return null;return t[Math.min(9,Math.floor(t.length/50))]}static findInteractionEvent(e,{traceEvents:t}){const r=t.filter((e=>"EventTiming"===e.name&&"e"!==e.ph));if(r.length&&!r.some((e=>e.args.data?.frame)))return{name:"FallbackTiming",duration:e.args.data.maxDuration};const{maxDuration:a,interactionType:n}=e.args.data;let i,o=Number.POSITIVE_INFINITY;for(const t of r){if(t.args.data.frame!==e.args.frame)continue;const{type:r,duration:s}=t.args.data,c=rh[n];if(!c)throw new Error(`unexpected responsiveness interactionType '${n}'`);if(!c.has(r))continue
|
503
|
+
;const l=Math.abs(s-a);l<o&&(i=t,o=l)}if(!i)throw new Error(`no interaction event found for responsiveness type '${n}'`);if(o>5)throw new Error(`no interaction event found within 5ms of responsiveness maxDuration (max: ${a}, closest ${i.args.data.duration})`);return i}static async compute_(e,t){const{settings:r,trace:a}=e;if("simulate"===r.throttlingMethod)throw new Error("Responsiveness currently unsupported by simulated throttling");const n=await Qp.request(a,t),i=Responsiveness.getHighPercentileResponsiveness(n);if(!i)return null;const o=Responsiveness.findInteractionEvent(i,a);return JSON.parse(JSON.stringify(o))}}var ah=Zp(Responsiveness,["trace","settings"]);const nh=eo,{resolveNodeIdToObjectId:ih}=Du,oh=hn,sh=kp,ch=Jl,lh=oo,uh=Yp,dh=Xp,mh=vi.exports,ph=ah;function getNodeDetailsData(){const e=this.nodeType===document.ELEMENT_NODE?this:this.parentElement;let t;return e&&(t={node:getNodeDetails(e)}),t}class TraceElements extends nh{meta={supportedModes:["timespan","navigation"],
|
504
|
+
dependencies:{Trace:lh.symbol}};animationIdToName=new Map;constructor(){super(),this._onAnimationStarted=this._onAnimationStarted.bind(this)}_onAnimationStarted({animation:{id:e,name:t}}){t&&this.animationIdToName.set(e,t)}static traceRectToLHRect(e){const t={x:e[0],y:e[1],width:e[2],height:e[3]};return sh.addRectTopAndBottom(t)}static getTopLayoutShiftElements(e){const t=new Map,r=e.filter((e=>"LayoutShift"===e.name)).map((e=>e.args?.data)),a=r.findIndex((e=>e&&!e.had_recent_input));r.forEach(((e,r)=>{if(!e||!e.impacted_nodes||!e.score)return;if(-1!==a&&r>=a&&e.had_recent_input)return;let n=0;const i=new Map;e.impacted_nodes.forEach((e=>{if(!e.node_id||!e.old_rect||!e.new_rect)return;const t=TraceElements.traceRectToLHRect(e.old_rect),r=TraceElements.traceRectToLHRect(e.new_rect),a=sh.getRectArea(t)+sh.getRectArea(r)-sh.getRectOverlapArea(t,r);i.set(e.node_id,a),n+=a}));for(const[r,a]of i.entries()){let i=t.get(r)||0;i+=a/n*e.score,t.set(r,i)}}))
|
505
|
+
;return[...t.entries()].sort(((e,t)=>t[1]-e[1])).slice(0,5).map((([e,t])=>({nodeId:e,score:t})))}static async getResponsivenessElement(e,t){const{settings:r}=t;try{const a=await ph.request({trace:e,settings:r},t);if(!a||"FallbackTiming"===a.name)return;return{nodeId:a.args.data.nodeId}}catch{return}}async getAnimatedElements(e){const t=new Map;for(const r of e){if("Animation"!==r.name)continue;if(!r.id2||!r.id2.local)continue;const e=r.id2.local,a=t.get(e)||{begin:void 0,status:void 0};"b"===r.ph?a.begin=r:"n"===r.ph&&r.args.data&&void 0!==r.args.data.compositeFailed&&(a.status=r),t.set(e,a)}const r=new Map;for(const{begin:e,status:a}of t.values()){const t=e?.args?.data?.nodeId,n=e?.args?.data?.id,i=a?.args?.data?.compositeFailed,o=a?.args?.data?.unsupportedProperties;if(!t||!n)continue;const s=r.get(t)||new Set;s.add({animationId:n,failureReasonsMask:i,unsupportedProperties:o}),r.set(t,s)}const a=[];for(const[e,t]of r){const r=[]
|
506
|
+
;for(const{animationId:e,failureReasonsMask:a,unsupportedProperties:n}of t){const t=this.animationIdToName.get(e);r.push({name:t,failureReasonsMask:a,unsupportedProperties:n})}a.push({nodeId:e,animations:r})}return a}async startInstrumentation(e){await e.driver.defaultSession.sendCommand("Animation.enable"),e.driver.defaultSession.on("Animation.animationStarted",this._onAnimationStarted)}async stopInstrumentation(e){e.driver.defaultSession.off("Animation.animationStarted",this._onAnimationStarted),await e.driver.defaultSession.sendCommand("Animation.disable")}async _getArtifact(e,t){const r=e.driver.defaultSession;if(!t)throw new Error("Trace is missing!");const a=await uh.request(t,e),{largestContentfulPaintEvt:n}=await dh.request(a,e).catch((t=>{if("timespan"===e.gatherMode&&t.code===mh.errors.NO_FCP.code)return{largestContentfulPaintEvt:void 0};throw t
|
507
|
+
})),{mainThreadEvents:i}=a,o=n?.args?.data?.nodeId,s=TraceElements.getTopLayoutShiftElements(i),c=await this.getAnimatedElements(i),l=await TraceElements.getResponsivenessElement(t,e),u=new Map([["largest-contentful-paint",o?[{nodeId:o}]:[]],["layout-shift",s],["animation",c],["responsiveness",l?[l]:[]]]),d=[];for(const[e,t]of u)for(let a=0;a<t.length;a++){const n=t[a].nodeId;let i;try{const e=await ih(r,n);if(!e)continue;i=await r.sendCommand("Runtime.callFunctionOn",{objectId:e,functionDeclaration:`function () {\n ${getNodeDetailsData.toString()};\n ${oh.getNodeDetailsString};\n return getNodeDetailsData.call(this);\n }`,returnByValue:!0,awaitPromise:!0})}catch(e){ch.captureException(e,{tags:{gatherer:this.name},level:"error"});continue}i?.result?.value&&d.push({traceEventType:e,...i.result.value,score:t[a].score,animations:t[a].animations,nodeId:n})}return d}async getArtifact(e){return this._getArtifact(e,e.dependencies.Trace)}
|
508
|
+
async afterPass(e,t){const r={...e,dependencies:{}};return await this.stopInstrumentation(r),this._getArtifact(r,t.trace)}}var hh=TraceElements;const gh=eo;function getViewportDimensions(){return{innerWidth:window.innerWidth,innerHeight:window.innerHeight,outerWidth:window.outerWidth,outerHeight:window.outerHeight,devicePixelRatio:window.devicePixelRatio}}var fh=class ViewportDimensions extends gh{meta={supportedModes:["snapshot","timespan","navigation"]};async getArtifact(e){const t=e.driver,r=await t.executionContext.evaluate(getViewportDimensions,{args:[],useIsolation:!0});if(!Object.values(r).every(Number.isFinite)){const e=JSON.stringify(r);throw new Error(`ViewportDimensions results were not numeric: ${e}`)}return r}},yh={exports:{}},vh={exports:{}};const bh=kc,wh={failingElementsHeader:"Failing Elements"},Sh=oi.createMessageInstanceIdFn("lighthouse-core/audits/accessibility/axe-audit.js",wh);vh.exports=class AxeAudit$I extends bh{static audit(e){
|
509
|
+
if((e.Accessibility.notApplicable||[]).find((e=>e.id===this.meta.id)))return{score:null,notApplicable:!0};const t=e.Accessibility.incomplete||[],r=t.find((e=>e.id===this.meta.id));if(r?.error)return{score:null,errorMessage:`axe-core Error: ${r.error.message||"Unknown error"}`};const a=this.meta.scoreDisplayMode===bh.SCORING_MODES.INFORMATIVE,n=e.Accessibility.violations||[],i=(a?n.concat(t):n).find((e=>e.id===this.meta.id)),o=i?.impact,s=i?.tags;if(a&&!i)return{score:null,notApplicable:!0};let c=[];i?.nodes&&(c=i.nodes.map((e=>({node:{...bh.makeNodeItem(e.node),explanation:e.failureSummary},subItems:e.relatedNodes.length?{type:"subitems",items:e.relatedNodes.map((e=>({relatedNode:bh.makeNodeItem(e)})))}:void 0}))));const l=[{key:"node",itemType:"node",subItemsHeading:{key:"relatedNode",itemType:"node"},text:Sh(wh.failingElementsHeader)}];let u;return(o||s)&&(u={type:"debugdata",impact:o,tags:s}),{score:Number(void 0===i),details:{...bh.makeTableDetails(l,c),debugData:u}}}},
|
510
|
+
vh.exports.UIStrings=wh;const Th=vh.exports,Eh={title:"`[accesskey]` values are unique",failureTitle:"`[accesskey]` values are not unique",description:"Access keys let users quickly focus a part of the page. For proper navigation, each access key must be unique. [Learn more](https://web.dev/accesskeys/)."},xh=oi.createMessageInstanceIdFn("lighthouse-core/audits/accessibility/accesskeys.js",Eh);yh.exports=class Accesskeys extends Th{static get meta(){return{id:"accesskeys",title:xh(Eh.title),failureTitle:xh(Eh.failureTitle),description:xh(Eh.description),requiredArtifacts:["Accessibility"]}}},yh.exports.UIStrings=Eh;var _h={exports:{}};const Ah=vh.exports,Rh={title:"`[aria-*]` attributes match their roles",failureTitle:"`[aria-*]` attributes do not match their roles",description:"Each ARIA `role` supports a specific subset of `aria-*` attributes. Mismatching these invalidates the `aria-*` attributes. [Learn more](https://web.dev/aria-allowed-attr/)."
|
511
|
+
},kh=oi.createMessageInstanceIdFn("lighthouse-core/audits/accessibility/aria-allowed-attr.js",Rh);_h.exports=class ARIAAllowedAttr extends Ah{static get meta(){return{id:"aria-allowed-attr",title:kh(Rh.title),failureTitle:kh(Rh.failureTitle),description:kh(Rh.description),requiredArtifacts:["Accessibility"]}}},_h.exports.UIStrings=Rh;var Dh={exports:{}};const Ch=vh.exports,Ih={title:"`button`, `link`, and `menuitem` elements have accessible names",failureTitle:"`button`, `link`, and `menuitem` elements do not have accessible names.",description:"When an element doesn't have an accessible name, screen readers announce it with a generic name, making it unusable for users who rely on screen readers. [Learn more](https://web.dev/aria-name/)."},Nh=oi.createMessageInstanceIdFn("lighthouse-core/audits/accessibility/aria-command-name.js",Ih);Dh.exports=class AriaCommandName extends Ch{static get meta(){return{id:"aria-command-name",title:Nh(Ih.title),failureTitle:Nh(Ih.failureTitle),
|
512
|
+
description:Nh(Ih.description),requiredArtifacts:["Accessibility"]}}},Dh.exports.UIStrings=Ih;var Lh={exports:{}};const Mh=vh.exports,Ph={title:'`[aria-hidden="true"]` is not present on the document `<body>`',failureTitle:'`[aria-hidden="true"]` is present on the document `<body>`',description:'Assistive technologies, like screen readers, work inconsistently when `aria-hidden="true"` is set on the document `<body>`. [Learn more](https://web.dev/aria-hidden-body/).'},Oh=oi.createMessageInstanceIdFn("lighthouse-core/audits/accessibility/aria-hidden-body.js",Ph);Lh.exports=class AriaHiddenBody extends Mh{static get meta(){return{id:"aria-hidden-body",title:Oh(Ph.title),failureTitle:Oh(Ph.failureTitle),description:Oh(Ph.description),requiredArtifacts:["Accessibility"]}}},Lh.exports.UIStrings=Ph;var Fh={exports:{}};const Uh=vh.exports,jh={title:'`[aria-hidden="true"]` elements do not contain focusable descendents',failureTitle:'`[aria-hidden="true"]` elements contain focusable descendents',
|
513
|
+
description:'Focusable descendents within an `[aria-hidden="true"]` element prevent those interactive elements from being available to users of assistive technologies like screen readers. [Learn more](https://web.dev/aria-hidden-focus/).'},Bh=oi.createMessageInstanceIdFn("lighthouse-core/audits/accessibility/aria-hidden-focus.js",jh);Fh.exports=class AriaHiddenFocus extends Uh{static get meta(){return{id:"aria-hidden-focus",title:Bh(jh.title),failureTitle:Bh(jh.failureTitle),description:Bh(jh.description),requiredArtifacts:["Accessibility"]}}},Fh.exports.UIStrings=jh;var $h={exports:{}};const qh=vh.exports,zh={title:"ARIA input fields have accessible names",failureTitle:"ARIA input fields do not have accessible names",description:"When an input field doesn't have an accessible name, screen readers announce it with a generic name, making it unusable for users who rely on screen readers. [Learn more](https://web.dev/aria-name/)."
|
514
|
+
},Vh=oi.createMessageInstanceIdFn("lighthouse-core/audits/accessibility/aria-input-field-name.js",zh);$h.exports=class AriaInputFieldName extends qh{static get meta(){return{id:"aria-input-field-name",title:Vh(zh.title),failureTitle:Vh(zh.failureTitle),description:Vh(zh.description),requiredArtifacts:["Accessibility"]}}},$h.exports.UIStrings=zh;var Wh={exports:{}};const Gh=vh.exports,Hh={title:"ARIA `meter` elements have accessible names",failureTitle:"ARIA `meter` elements do not have accessible names.",description:"When an element doesn't have an accessible name, screen readers announce it with a generic name, making it unusable for users who rely on screen readers. [Learn more](https://web.dev/aria-name/)."},Yh=oi.createMessageInstanceIdFn("lighthouse-core/audits/accessibility/aria-meter-name.js",Hh);Wh.exports=class AriaMeterName extends Gh{static get meta(){return{id:"aria-meter-name",title:Yh(Hh.title),failureTitle:Yh(Hh.failureTitle),description:Yh(Hh.description),
|
515
|
+
requiredArtifacts:["Accessibility"]}}},Wh.exports.UIStrings=Hh;var Kh={exports:{}};const Jh=vh.exports,Xh={title:"ARIA `progressbar` elements have accessible names",failureTitle:"ARIA `progressbar` elements do not have accessible names.",description:"When a `progressbar` element doesn't have an accessible name, screen readers announce it with a generic name, making it unusable for users who rely on screen readers. [Learn more](https://web.dev/aria-name/)."},Zh=oi.createMessageInstanceIdFn("lighthouse-core/audits/accessibility/aria-progressbar-name.js",Xh);Kh.exports=class AriaProgressbarName extends Jh{static get meta(){return{id:"aria-progressbar-name",title:Zh(Xh.title),failureTitle:Zh(Xh.failureTitle),description:Zh(Xh.description),requiredArtifacts:["Accessibility"]}}},Kh.exports.UIStrings=Xh;var Qh={exports:{}};const eg=vh.exports,tg={title:"`[role]`s have all required `[aria-*]` attributes",failureTitle:"`[role]`s do not have all required `[aria-*]` attributes",
|
516
|
+
description:"Some ARIA roles have required attributes that describe the state of the element to screen readers. [Learn more](https://web.dev/aria-required-attr/)."},rg=oi.createMessageInstanceIdFn("lighthouse-core/audits/accessibility/aria-required-attr.js",tg);Qh.exports=class ARIARequiredAttr extends eg{static get meta(){return{id:"aria-required-attr",title:rg(tg.title),failureTitle:rg(tg.failureTitle),description:rg(tg.description),requiredArtifacts:["Accessibility"]}}},Qh.exports.UIStrings=tg;var ag={exports:{}};const ng=vh.exports,ig={title:"Elements with an ARIA `[role]` that require children to contain a specific `[role]` have all required children.",failureTitle:"Elements with an ARIA `[role]` that require children to contain a specific `[role]` are missing some or all of those required children.",description:"Some ARIA parent roles must contain specific child roles to perform their intended accessibility functions. [Learn more](https://web.dev/aria-required-children/)."
|
517
|
+
},og=oi.createMessageInstanceIdFn("lighthouse-core/audits/accessibility/aria-required-children.js",ig);ag.exports=class AriaRequiredChildren extends ng{static get meta(){return{id:"aria-required-children",title:og(ig.title),failureTitle:og(ig.failureTitle),description:og(ig.description),requiredArtifacts:["Accessibility"]}}},ag.exports.UIStrings=ig;var sg={exports:{}};const cg=vh.exports,lg={title:"`[role]`s are contained by their required parent element",failureTitle:"`[role]`s are not contained by their required parent element",description:"Some ARIA child roles must be contained by specific parent roles to properly perform their intended accessibility functions. [Learn more](https://web.dev/aria-required-parent/)."},ug=oi.createMessageInstanceIdFn("lighthouse-core/audits/accessibility/aria-required-parent.js",lg);sg.exports=class AriaRequiredParent extends cg{static get meta(){return{id:"aria-required-parent",title:ug(lg.title),failureTitle:ug(lg.failureTitle),
|
518
|
+
description:ug(lg.description),requiredArtifacts:["Accessibility"]}}},sg.exports.UIStrings=lg;var dg={exports:{}};const mg=vh.exports,pg={title:"`[role]` values are valid",failureTitle:"`[role]` values are not valid",description:"ARIA roles must have valid values in order to perform their intended accessibility functions. [Learn more](https://web.dev/aria-roles/)."},hg=oi.createMessageInstanceIdFn("lighthouse-core/audits/accessibility/aria-roles.js",pg);dg.exports=class AriaRoles extends mg{static get meta(){return{id:"aria-roles",title:hg(pg.title),failureTitle:hg(pg.failureTitle),description:hg(pg.description),requiredArtifacts:["Accessibility"]}}},dg.exports.UIStrings=pg;var gg={exports:{}};const fg=vh.exports,yg={title:"ARIA toggle fields have accessible names",failureTitle:"ARIA toggle fields do not have accessible names",
|
519
|
+
description:"When a toggle field doesn't have an accessible name, screen readers announce it with a generic name, making it unusable for users who rely on screen readers. [Learn more](https://web.dev/aria-name/)."},vg=oi.createMessageInstanceIdFn("lighthouse-core/audits/accessibility/aria-toggle-field-name.js",yg);gg.exports=class AriaToggleFieldName extends fg{static get meta(){return{id:"aria-toggle-field-name",title:vg(yg.title),failureTitle:vg(yg.failureTitle),description:vg(yg.description),requiredArtifacts:["Accessibility"]}}},gg.exports.UIStrings=yg;var bg={exports:{}};const wg=vh.exports,Sg={title:"ARIA `tooltip` elements have accessible names",failureTitle:"ARIA `tooltip` elements do not have accessible names.",description:"When an element doesn't have an accessible name, screen readers announce it with a generic name, making it unusable for users who rely on screen readers. [Learn more](https://web.dev/aria-name/)."
|
520
|
+
},Tg=oi.createMessageInstanceIdFn("lighthouse-core/audits/accessibility/aria-tooltip-name.js",Sg);bg.exports=class AriaTooltipName extends wg{static get meta(){return{id:"aria-tooltip-name",title:Tg(Sg.title),failureTitle:Tg(Sg.failureTitle),description:Tg(Sg.description),requiredArtifacts:["Accessibility"]}}},bg.exports.UIStrings=Sg;var Eg={exports:{}};const xg=vh.exports,_g={title:"ARIA `treeitem` elements have accessible names",failureTitle:"ARIA `treeitem` elements do not have accessible names.",description:"When an element doesn't have an accessible name, screen readers announce it with a generic name, making it unusable for users who rely on screen readers. [Learn more](https://web.dev/aria-name/)."},Ag=oi.createMessageInstanceIdFn("lighthouse-core/audits/accessibility/aria-treeitem-name.js",_g);Eg.exports=class AriaTreeitemName extends xg{static get meta(){return{id:"aria-treeitem-name",title:Ag(_g.title),failureTitle:Ag(_g.failureTitle),description:Ag(_g.description),
|
521
|
+
requiredArtifacts:["Accessibility"]}}},Eg.exports.UIStrings=_g;var Rg={exports:{}};const kg=vh.exports,Dg={title:"`[aria-*]` attributes have valid values",failureTitle:"`[aria-*]` attributes do not have valid values",description:"Assistive technologies, like screen readers, can't interpret ARIA attributes with invalid values. [Learn more](https://web.dev/aria-valid-attr-value/)."},Cg=oi.createMessageInstanceIdFn("lighthouse-core/audits/accessibility/aria-valid-attr-value.js",Dg);Rg.exports=class ARIAValidAttr$1 extends kg{static get meta(){return{id:"aria-valid-attr-value",title:Cg(Dg.title),failureTitle:Cg(Dg.failureTitle),description:Cg(Dg.description),requiredArtifacts:["Accessibility"]}}},Rg.exports.UIStrings=Dg;var Ig={exports:{}};const Ng=vh.exports,Lg={title:"`[aria-*]` attributes are valid and not misspelled",failureTitle:"`[aria-*]` attributes are not valid or misspelled",
|
522
|
+
description:"Assistive technologies, like screen readers, can't interpret ARIA attributes with invalid names. [Learn more](https://web.dev/aria-valid-attr/)."},Mg=oi.createMessageInstanceIdFn("lighthouse-core/audits/accessibility/aria-valid-attr.js",Lg);Ig.exports=class ARIAValidAttr extends Ng{static get meta(){return{id:"aria-valid-attr",title:Mg(Lg.title),failureTitle:Mg(Lg.failureTitle),description:Mg(Lg.description),requiredArtifacts:["Accessibility"]}}},Ig.exports.UIStrings=Lg;var Pg={exports:{}};const Og=vh.exports,Fg={title:"Buttons have an accessible name",failureTitle:"Buttons do not have an accessible name",description:'When a button doesn\'t have an accessible name, screen readers announce it as "button", making it unusable for users who rely on screen readers. [Learn more](https://web.dev/button-name/).'},Ug=oi.createMessageInstanceIdFn("lighthouse-core/audits/accessibility/button-name.js",Fg);Pg.exports=class ButtonName extends Og{static get meta(){return{
|
523
|
+
id:"button-name",title:Ug(Fg.title),failureTitle:Ug(Fg.failureTitle),description:Ug(Fg.description),requiredArtifacts:["Accessibility"]}}},Pg.exports.UIStrings=Fg;var jg={exports:{}};const Bg=vh.exports,$g={title:"The page contains a heading, skip link, or landmark region",failureTitle:"The page does not contain a heading, skip link, or landmark region",description:"Adding ways to bypass repetitive content lets keyboard users navigate the page more efficiently. [Learn more](https://web.dev/bypass/)."},qg=oi.createMessageInstanceIdFn("lighthouse-core/audits/accessibility/bypass.js",$g);jg.exports=class Bypass extends Bg{static get meta(){return{id:"bypass",title:qg($g.title),failureTitle:qg($g.failureTitle),description:qg($g.description),requiredArtifacts:["Accessibility"]}}},jg.exports.UIStrings=$g;var zg={exports:{}};const Vg=vh.exports,Wg={title:"Background and foreground colors have a sufficient contrast ratio",
|
524
|
+
failureTitle:"Background and foreground colors do not have a sufficient contrast ratio.",description:"Low-contrast text is difficult or impossible for many users to read. [Learn more](https://web.dev/color-contrast/)."},Gg=oi.createMessageInstanceIdFn("lighthouse-core/audits/accessibility/color-contrast.js",Wg);zg.exports=class ColorContrast extends Vg{static get meta(){return{id:"color-contrast",title:Gg(Wg.title),failureTitle:Gg(Wg.failureTitle),description:Gg(Wg.description),requiredArtifacts:["Accessibility"]}}},zg.exports.UIStrings=Wg;var Hg={exports:{}};const Yg=vh.exports,Kg={title:"`<dl>`'s contain only properly-ordered `<dt>` and `<dd>` groups, `<script>`, `<template>` or `<div>` elements.",failureTitle:"`<dl>`'s do not contain only properly-ordered `<dt>` and `<dd>` groups, `<script>`, `<template>` or `<div>` elements.",
|
525
|
+
description:"When definition lists are not properly marked up, screen readers may produce confusing or inaccurate output. [Learn more](https://web.dev/definition-list/)."},Jg=oi.createMessageInstanceIdFn("lighthouse-core/audits/accessibility/definition-list.js",Kg);Hg.exports=class DefinitionList extends Yg{static get meta(){return{id:"definition-list",title:Jg(Kg.title),failureTitle:Jg(Kg.failureTitle),description:Jg(Kg.description),requiredArtifacts:["Accessibility"]}}},Hg.exports.UIStrings=Kg;var Xg={exports:{}};const Zg=vh.exports,Qg={title:"Definition list items are wrapped in `<dl>` elements",failureTitle:"Definition list items are not wrapped in `<dl>` elements",description:"Definition list items (`<dt>` and `<dd>`) must be wrapped in a parent `<dl>` element to ensure that screen readers can properly announce them. [Learn more](https://web.dev/dlitem/)."},ef=oi.createMessageInstanceIdFn("lighthouse-core/audits/accessibility/dlitem.js",Qg);Xg.exports=class DLItem extends Zg{
|
526
|
+
static get meta(){return{id:"dlitem",title:ef(Qg.title),failureTitle:ef(Qg.failureTitle),description:ef(Qg.description),requiredArtifacts:["Accessibility"]}}},Xg.exports.UIStrings=Qg;var tf={exports:{}};const rf=vh.exports,af={title:"Document has a `<title>` element",failureTitle:"Document doesn't have a `<title>` element",description:"The title gives screen reader users an overview of the page, and search engine users rely on it heavily to determine if a page is relevant to their search. [Learn more](https://web.dev/document-title/)."},nf=oi.createMessageInstanceIdFn("lighthouse-core/audits/accessibility/document-title.js",af);tf.exports=class DocumentTitle extends rf{static get meta(){return{id:"document-title",title:nf(af.title),failureTitle:nf(af.failureTitle),description:nf(af.description),requiredArtifacts:["Accessibility"]}}},tf.exports.UIStrings=af;var of={exports:{}};const sf=vh.exports,cf={title:"`[id]` attributes on active, focusable elements are unique",
|
527
|
+
failureTitle:"`[id]` attributes on active, focusable elements are not unique",description:"All focusable elements must have a unique `id` to ensure that they're visible to assistive technologies. [Learn more](https://web.dev/duplicate-id-active/)."},lf=oi.createMessageInstanceIdFn("lighthouse-core/audits/accessibility/duplicate-id-active.js",cf);of.exports=class DuplicateIdActive extends sf{static get meta(){return{id:"duplicate-id-active",title:lf(cf.title),failureTitle:lf(cf.failureTitle),description:lf(cf.description),requiredArtifacts:["Accessibility"]}}},of.exports.UIStrings=cf;var uf={exports:{}};const df=vh.exports,mf={title:"ARIA IDs are unique",failureTitle:"ARIA IDs are not unique",description:"The value of an ARIA ID must be unique to prevent other instances from being overlooked by assistive technologies. [Learn more](https://web.dev/duplicate-id-aria/)."},pf=oi.createMessageInstanceIdFn("lighthouse-core/audits/accessibility/duplicate-id-aria.js",mf)
|
528
|
+
;uf.exports=class DuplicateIdAria extends df{static get meta(){return{id:"duplicate-id-aria",title:pf(mf.title),failureTitle:pf(mf.failureTitle),description:pf(mf.description),requiredArtifacts:["Accessibility"]}}},uf.exports.UIStrings=mf;var hf={exports:{}};const gf=vh.exports,ff={title:"No form fields have multiple labels",failureTitle:"Form fields have multiple labels",description:"Form fields with multiple labels can be confusingly announced by assistive technologies like screen readers which use either the first, the last, or all of the labels. [Learn more](https://web.dev/form-field-multiple-labels/)."},yf=oi.createMessageInstanceIdFn("lighthouse-core/audits/accessibility/form-field-multiple-labels.js",ff);hf.exports=class FormFieldMultipleLabels extends gf{static get meta(){return{id:"form-field-multiple-labels",title:yf(ff.title),failureTitle:yf(ff.failureTitle),description:yf(ff.description),scoreDisplayMode:gf.SCORING_MODES.INFORMATIVE,requiredArtifacts:["Accessibility"]}}},
|
529
|
+
hf.exports.UIStrings=ff;var vf={exports:{}};const bf=vh.exports,wf={title:"`<frame>` or `<iframe>` elements have a title",failureTitle:"`<frame>` or `<iframe>` elements do not have a title",description:"Screen reader users rely on frame titles to describe the contents of frames. [Learn more](https://web.dev/frame-title/)."},Sf=oi.createMessageInstanceIdFn("lighthouse-core/audits/accessibility/frame-title.js",wf);vf.exports=class FrameTitle extends bf{static get meta(){return{id:"frame-title",title:Sf(wf.title),failureTitle:Sf(wf.failureTitle),description:Sf(wf.description),requiredArtifacts:["Accessibility"]}}},vf.exports.UIStrings=wf;var Tf={exports:{}};const Ef=vh.exports,xf={title:"Heading elements appear in a sequentially-descending order",failureTitle:"Heading elements are not in a sequentially-descending order",
|
530
|
+
description:"Properly ordered headings that do not skip levels convey the semantic structure of the page, making it easier to navigate and understand when using assistive technologies. [Learn more](https://web.dev/heading-order/)."},_f=oi.createMessageInstanceIdFn("lighthouse-core/audits/accessibility/heading-order.js",xf);Tf.exports=class HeadingOrder extends Ef{static get meta(){return{id:"heading-order",title:_f(xf.title),failureTitle:_f(xf.failureTitle),description:_f(xf.description),requiredArtifacts:["Accessibility"]}}},Tf.exports.UIStrings=xf;var Af={exports:{}};const Rf=vh.exports,kf={title:"`<html>` element has a `[lang]` attribute",failureTitle:"`<html>` element does not have a `[lang]` attribute",
|
531
|
+
description:"If a page doesn't specify a lang attribute, a screen reader assumes that the page is in the default language that the user chose when setting up the screen reader. If the page isn't actually in the default language, then the screen reader might not announce the page's text correctly. [Learn more](https://web.dev/html-has-lang/)."},Df=oi.createMessageInstanceIdFn("lighthouse-core/audits/accessibility/html-has-lang.js",kf);Af.exports=class HTMLHasLang extends Rf{static get meta(){return{id:"html-has-lang",title:Df(kf.title),failureTitle:Df(kf.failureTitle),description:Df(kf.description),requiredArtifacts:["Accessibility"]}}},Af.exports.UIStrings=kf;var Cf={exports:{}};const If=vh.exports,Nf={title:"`<html>` element has a valid value for its `[lang]` attribute",failureTitle:"`<html>` element does not have a valid value for its `[lang]` attribute.",
|
532
|
+
description:"Specifying a valid [BCP 47 language](https://www.w3.org/International/questions/qa-choosing-language-tags#question) helps screen readers announce text properly. [Learn more](https://web.dev/html-lang-valid/)."},Lf=oi.createMessageInstanceIdFn("lighthouse-core/audits/accessibility/html-lang-valid.js",Nf);Cf.exports=class HTMLLangValid extends If{static get meta(){return{id:"html-lang-valid",title:Lf(Nf.title),failureTitle:Lf(Nf.failureTitle),description:Lf(Nf.description),requiredArtifacts:["Accessibility"]}}},Cf.exports.UIStrings=Nf;var Mf={exports:{}};const Pf=vh.exports,Of={title:"Image elements have `[alt]` attributes",failureTitle:"Image elements do not have `[alt]` attributes",description:"Informative elements should aim for short, descriptive alternate text. Decorative elements can be ignored with an empty alt attribute. [Learn more](https://web.dev/image-alt/)."},Ff=oi.createMessageInstanceIdFn("lighthouse-core/audits/accessibility/image-alt.js",Of)
|
533
|
+
;Mf.exports=class ImageAlt extends Pf{static get meta(){return{id:"image-alt",title:Ff(Of.title),failureTitle:Ff(Of.failureTitle),description:Ff(Of.description),requiredArtifacts:["Accessibility"]}}},Mf.exports.UIStrings=Of;var Uf={exports:{}};const jf=vh.exports,Bf={title:'`<input type="image">` elements have `[alt]` text',failureTitle:'`<input type="image">` elements do not have `[alt]` text',description:"When an image is being used as an `<input>` button, providing alternative text can help screen reader users understand the purpose of the button. [Learn more](https://web.dev/input-image-alt/)."},$f=oi.createMessageInstanceIdFn("lighthouse-core/audits/accessibility/input-image-alt.js",Bf);Uf.exports=class InputImageAlt extends jf{static get meta(){return{id:"input-image-alt",title:$f(Bf.title),failureTitle:$f(Bf.failureTitle),description:$f(Bf.description),requiredArtifacts:["Accessibility"]}}},Uf.exports.UIStrings=Bf;var qf={exports:{}};const zf=vh.exports,Vf={
|
534
|
+
title:"Form elements have associated labels",failureTitle:"Form elements do not have associated labels",description:"Labels ensure that form controls are announced properly by assistive technologies, like screen readers. [Learn more](https://web.dev/label/)."},Wf=oi.createMessageInstanceIdFn("lighthouse-core/audits/accessibility/label.js",Vf);qf.exports=class Label extends zf{static get meta(){return{id:"label",title:Wf(Vf.title),failureTitle:Wf(Vf.failureTitle),description:Wf(Vf.description),requiredArtifacts:["Accessibility"]}}},qf.exports.UIStrings=Vf;var Gf={exports:{}};const Hf=vh.exports,Yf={title:"Links have a discernible name",failureTitle:"Links do not have a discernible name",description:"Link text (and alternate text for images, when used as links) that is discernible, unique, and focusable improves the navigation experience for screen reader users. [Learn more](https://web.dev/link-name/)."
|
535
|
+
},Kf=oi.createMessageInstanceIdFn("lighthouse-core/audits/accessibility/link-name.js",Yf);Gf.exports=class LinkName extends Hf{static get meta(){return{id:"link-name",title:Kf(Yf.title),failureTitle:Kf(Yf.failureTitle),description:Kf(Yf.description),requiredArtifacts:["Accessibility"]}}},Gf.exports.UIStrings=Yf;var Jf={exports:{}};const Xf=vh.exports,Zf={title:"Lists contain only `<li>` elements and script supporting elements (`<script>` and `<template>`).",failureTitle:"Lists do not contain only `<li>` elements and script supporting elements (`<script>` and `<template>`).",description:"Screen readers have a specific way of announcing lists. Ensuring proper list structure aids screen reader output. [Learn more](https://web.dev/list/)."},Qf=oi.createMessageInstanceIdFn("lighthouse-core/audits/accessibility/list.js",Zf);Jf.exports=class List extends Xf{static get meta(){return{id:"list",title:Qf(Zf.title),failureTitle:Qf(Zf.failureTitle),description:Qf(Zf.description),
|
536
|
+
requiredArtifacts:["Accessibility"]}}},Jf.exports.UIStrings=Zf;var ey={exports:{}};const ty=vh.exports,ry={title:"List items (`<li>`) are contained within `<ul>` or `<ol>` parent elements",failureTitle:"List items (`<li>`) are not contained within `<ul>` or `<ol>` parent elements.",description:"Screen readers require list items (`<li>`) to be contained within a parent `<ul>` or `<ol>` to be announced properly. [Learn more](https://web.dev/listitem/)."},ay=oi.createMessageInstanceIdFn("lighthouse-core/audits/accessibility/listitem.js",ry);ey.exports=class ListItem extends ty{static get meta(){return{id:"listitem",title:ay(ry.title),failureTitle:ay(ry.failureTitle),description:ay(ry.description),requiredArtifacts:["Accessibility"]}}},ey.exports.UIStrings=ry;const ny=kc;var iy=class ManualAudit$e extends ny{static get partialMeta(){return{scoreDisplayMode:ny.SCORING_MODES.MANUAL,requiredArtifacts:[]}}static audit(){return{score:0}}};const oy=iy
|
537
|
+
;var sy=class CustomControlsLabels extends oy{static get meta(){return Object.assign({id:"custom-controls-labels",description:"Custom interactive controls have associated labels, provided by aria-label or aria-labelledby. [Learn more](https://web.dev/custom-controls-labels/).",title:"Custom controls have associated labels"},super.partialMeta)}};const cy=iy;var ly=class CustomControlsRoles extends cy{static get meta(){return Object.assign({id:"custom-controls-roles",description:"Custom interactive controls have appropriate ARIA roles. [Learn more](https://web.dev/custom-control-roles/).",title:"Custom controls have ARIA roles"},super.partialMeta)}};const uy=iy;var dy=class FocusTraps extends uy{static get meta(){return Object.assign({id:"focus-traps",description:"A user can tab into and out of any control or region without accidentally trapping their focus. [Learn more](https://web.dev/focus-traps/).",title:"User focus is not accidentally trapped in a region"},super.partialMeta)}}
|
538
|
+
;const my=iy;var py=class FocusableControls extends my{static get meta(){return Object.assign({id:"focusable-controls",description:"Custom interactive controls are keyboard focusable and display a focus indicator. [Learn more](https://web.dev/focusable-controls/).",title:"Interactive controls are keyboard focusable"},super.partialMeta)}};const hy=iy;var gy=class InteractiveElementAffordance extends hy{static get meta(){return Object.assign({id:"interactive-element-affordance",description:"Interactive elements, such as links and buttons, should indicate their state and be distinguishable from non-interactive elements. [Learn more](https://web.dev/interactive-element-affordance/).",title:"Interactive elements indicate their purpose and state"},super.partialMeta)}};const fy=iy;var yy=class LogicalTabOrder extends fy{static get meta(){return Object.assign({id:"logical-tab-order",
|
539
|
+
description:"Tabbing through the page follows the visual layout. Users cannot focus elements that are offscreen. [Learn more](https://web.dev/logical-tab-order/).",title:"The page has a logical tab order"},super.partialMeta)}};const vy=iy;var by=class ManagedFocus extends vy{static get meta(){return Object.assign({id:"managed-focus",description:"If new content, such as a dialog, is added to the page, the user's focus is directed to it. [Learn more](https://web.dev/managed-focus/).",title:"The user's focus is directed to new content added to the page"},super.partialMeta)}};const wy=iy;var Sy=class OffscreenContentHidden extends wy{static get meta(){return Object.assign({id:"offscreen-content-hidden",description:"Offscreen content is hidden with display: none or aria-hidden=true. [Learn more](https://web.dev/offscreen-content-hidden/).",title:"Offscreen content is hidden from assistive technology"},super.partialMeta)}};const Ty=iy;var Ey=class UseLandmarks extends Ty{static get meta(){
|
540
|
+
return Object.assign({id:"use-landmarks",description:"Landmark elements (<main>, <nav>, etc.) are used to improve the keyboard navigation of the page for assistive technology. [Learn more](https://web.dev/use-landmarks/).",title:"HTML5 landmark elements are used to improve navigation"},super.partialMeta)}};const xy=iy;var _y=class VisualOrderFollowsDOM extends xy{static get meta(){return Object.assign({id:"visual-order-follows-dom",description:"DOM order matches the visual order, improving navigation for assistive technology. [Learn more](https://web.dev/visual-order-follows-dom/).",title:"Visual order on the page follows DOM order"},super.partialMeta)}},Ay={exports:{}};const Ry=vh.exports,ky={title:'The document does not use `<meta http-equiv="refresh">`',failureTitle:'The document uses `<meta http-equiv="refresh">`',
|
541
|
+
description:"Users do not expect a page to refresh automatically, and doing so will move focus back to the top of the page. This may create a frustrating or confusing experience. [Learn more](https://web.dev/meta-refresh/)."},Dy=oi.createMessageInstanceIdFn("lighthouse-core/audits/accessibility/meta-refresh.js",ky);Ay.exports=class MetaRefresh extends Ry{static get meta(){return{id:"meta-refresh",title:Dy(ky.title),failureTitle:Dy(ky.failureTitle),description:Dy(ky.description),requiredArtifacts:["Accessibility"]}}},Ay.exports.UIStrings=ky;var Cy={exports:{}};const Iy=vh.exports,Ny={title:'`[user-scalable="no"]` is not used in the `<meta name="viewport">` element and the `[maximum-scale]` attribute is not less than 5.',failureTitle:'`[user-scalable="no"]` is used in the `<meta name="viewport">` element or the `[maximum-scale]` attribute is less than 5.',
|
542
|
+
description:"Disabling zooming is problematic for users with low vision who rely on screen magnification to properly see the contents of a web page. [Learn more](https://web.dev/meta-viewport/)."},Ly=oi.createMessageInstanceIdFn("lighthouse-core/audits/accessibility/meta-viewport.js",Ny);Cy.exports=class MetaViewport extends Iy{static get meta(){return{id:"meta-viewport",title:Ly(Ny.title),failureTitle:Ly(Ny.failureTitle),description:Ly(Ny.description),requiredArtifacts:["Accessibility"]}}},Cy.exports.UIStrings=Ny;var My={exports:{}};const Py=vh.exports,Oy={title:"`<object>` elements have alternate text",failureTitle:"`<object>` elements do not have alternate text",description:"Screen readers cannot translate non-text content. Adding alternate text to `<object>` elements helps screen readers convey meaning to users. [Learn more](https://web.dev/object-alt/)."},Fy=oi.createMessageInstanceIdFn("lighthouse-core/audits/accessibility/object-alt.js",Oy);My.exports=class ObjectAlt extends Py{
|
543
|
+
static get meta(){return{id:"object-alt",title:Fy(Oy.title),failureTitle:Fy(Oy.failureTitle),description:Fy(Oy.description),requiredArtifacts:["Accessibility"]}}},My.exports.UIStrings=Oy;var Uy={exports:{}};const jy=vh.exports,By={title:"No element has a `[tabindex]` value greater than 0",failureTitle:"Some elements have a `[tabindex]` value greater than 0",description:"A value greater than 0 implies an explicit navigation ordering. Although technically valid, this often creates frustrating experiences for users who rely on assistive technologies. [Learn more](https://web.dev/tabindex/)."},$y=oi.createMessageInstanceIdFn("lighthouse-core/audits/accessibility/tabindex.js",By);Uy.exports=class TabIndex extends jy{static get meta(){return{id:"tabindex",title:$y(By.title),failureTitle:$y(By.failureTitle),description:$y(By.description),requiredArtifacts:["Accessibility"]}}},Uy.exports.UIStrings=By;var qy={exports:{}};const zy=vh.exports,Vy={
|
544
|
+
title:"Cells in a `<table>` element that use the `[headers]` attribute refer to table cells within the same table.",failureTitle:"Cells in a `<table>` element that use the `[headers]` attribute refer to an element `id` not found within the same table.",description:"Screen readers have features to make navigating tables easier. Ensuring `<td>` cells using the `[headers]` attribute only refer to other cells in the same table may improve the experience for screen reader users. [Learn more](https://web.dev/td-headers-attr/)."},Wy=oi.createMessageInstanceIdFn("lighthouse-core/audits/accessibility/td-headers-attr.js",Vy);qy.exports=class TDHeadersAttr extends zy{static get meta(){return{id:"td-headers-attr",title:Wy(Vy.title),failureTitle:Wy(Vy.failureTitle),description:Wy(Vy.description),requiredArtifacts:["Accessibility"]}}},qy.exports.UIStrings=Vy;var Gy={exports:{}};const Hy=vh.exports,Yy={
|
545
|
+
title:'`<th>` elements and elements with `[role="columnheader"/"rowheader"]` have data cells they describe.',failureTitle:'`<th>` elements and elements with `[role="columnheader"/"rowheader"]` do not have data cells they describe.',description:"Screen readers have features to make navigating tables easier. Ensuring table headers always refer to some set of cells may improve the experience for screen reader users. [Learn more](https://web.dev/th-has-data-cells/)."},Ky=oi.createMessageInstanceIdFn("lighthouse-core/audits/accessibility/th-has-data-cells.js",Yy);Gy.exports=class THHasDataCells extends Hy{static get meta(){return{id:"th-has-data-cells",title:Ky(Yy.title),failureTitle:Ky(Yy.failureTitle),description:Ky(Yy.description),requiredArtifacts:["Accessibility"]}}},Gy.exports.UIStrings=Yy;var Jy={exports:{}};const Xy=vh.exports,Zy={title:"`[lang]` attributes have a valid value",failureTitle:"`[lang]` attributes do not have a valid value",
|
546
|
+
description:"Specifying a valid [BCP 47 language](https://www.w3.org/International/questions/qa-choosing-language-tags#question) on elements helps ensure that text is pronounced correctly by a screen reader. [Learn more](https://web.dev/valid-lang/)."},Qy=oi.createMessageInstanceIdFn("lighthouse-core/audits/accessibility/valid-lang.js",Zy);Jy.exports=class ValidLang extends Xy{static get meta(){return{id:"valid-lang",title:Qy(Zy.title),failureTitle:Qy(Zy.failureTitle),description:Qy(Zy.description),requiredArtifacts:["Accessibility"]}}},Jy.exports.UIStrings=Zy;var ev={exports:{}};const tv=vh.exports,rv={title:'`<video>` elements contain a `<track>` element with `[kind="captions"]`',failureTitle:'`<video>` elements do not contain a `<track>` element with `[kind="captions"]`.',description:"When a video provides a caption it is easier for deaf and hearing impaired users to access its information. [Learn more](https://web.dev/video-caption/)."
|
547
|
+
},av=oi.createMessageInstanceIdFn("lighthouse-core/audits/accessibility/video-caption.js",rv);ev.exports=class VideoCaption extends tv{static get meta(){return{id:"video-caption",title:av(rv.title),failureTitle:av(rv.failureTitle),description:av(rv.description),requiredArtifacts:["Accessibility"]}}},ev.exports.UIStrings=rv;var nv={exports:{}};const iv=kc,ov={title:"Provides a valid `apple-touch-icon`",failureTitle:"Does not provide a valid `apple-touch-icon`",description:"For ideal appearance on iOS when users add a progressive web app to the home screen, define an `apple-touch-icon`. It must point to a non-transparent 192px (or 180px) square PNG. [Learn More](https://web.dev/apple-touch-icon/).",precomposedWarning:"`apple-touch-icon-precomposed` is out of date; `apple-touch-icon` is preferred."},sv=oi.createMessageInstanceIdFn("lighthouse-core/audits/apple-touch-icon.js",ov);nv.exports=class AppleTouchIcon extends iv{static get meta(){return{id:"apple-touch-icon",title:sv(ov.title),
|
548
|
+
failureTitle:sv(ov.failureTitle),description:sv(ov.description),supportedModes:["navigation"],requiredArtifacts:["LinkElements"]}}static audit(e){const t=e.LinkElements.filter((e=>"apple-touch-icon"===e.rel||"apple-touch-icon-precomposed"===e.rel)).filter((e=>!!e.href)),r=0!==t.length,a=[];return 0!==t.filter((e=>"apple-touch-icon-precomposed"===e.rel)).length&&0===t.filter((e=>"apple-touch-icon"===e.rel)).length&&a.push(sv(ov.precomposedWarning)),{score:r?1:0,warnings:a}}},nv.exports.UIStrings=ov;var cv={exports:{}};const lv=kc,uv=oi,dv=on.default,mv={title:"`<input>` elements correctly use `autocomplete`",failureTitle:"`<input>` elements do not have correct `autocomplete` attributes",description:"`autocomplete` helps users submit forms quicker. To reduce user effort, consider enabling by setting the `autocomplete` attribute to a valid value. [Learn more](https://developers.google.com/web/fundamentals/design-and-ux/input/forms#use_metadata_to_enable_auto-complete)",
|
547
549
|
columnSuggestions:"Suggested Token",columnCurrent:"Current Value",warningInvalid:'`autocomplete` token(s): "{token}" is invalid in {snippet}',warningOrder:'Review order of tokens: "{tokens}" in {snippet}',reviewOrder:"Review order of tokens",manualReview:"Requires manual review"
|
548
|
-
},
|
549
|
-
NO_SERVER_DATA:
|
550
|
+
},pv=uv.createMessageInstanceIdFn("lighthouse-core/audits/autocomplete.js",mv),hv=["name","honorific-prefix","given-name","additional-name","family-name","honorific-suffix","nickname","username","new-password","current-password","one-time-code","organization-title","organization","street-address","address-line1","address-line2","address-line3","address-level4","address-level3","address-level2","address-level1","country","country-name","postal-code","cc-name","cc-given-name","cc-additional-name","cc-family-name","cc-number","cc-exp","cc-exp-month","cc-exp-year","cc-csc","cc-type","transaction-currency","transaction-amount","language","bday","bday-day","bday-month","bday-year","sex","url","photo","tel","tel-country-code","tel-national","tel-area-code","on","tel-local","tel-local-prefix","tel-local-suffix","tel-extension","email","impp","off","additional-name-initial","home","work","mobile","fax","pager","shipping","billing"],gv=["NO_SERVER_DATA","UNKNOWN_TYPE","EMPTY_TYPE","HTML_TYPE_UNSPECIFIED","HTML_TYPE_UNRECOGNIZED"],fv={
|
551
|
+
NO_SERVER_DATA:pv(mv.manualReview),UNKNOWN_TYPE:pv(mv.manualReview),EMPTY_TYPE:pv(mv.manualReview),NAME_FIRST:"given-name",NAME_MIDDLE:"additional-name",NAME_LAST:"family-name",NAME_FULL:"name",NAME_MIDDLE_INITIAL:"additional-name-initial",NAME_SUFFIX:"honorific-suffix",NAME_BILLING_FIRST:"billing given-name",NAME_BILLING_MIDDLE:"billing additional-name",NAME_BILLING_LAST:"billing family-name",NAME_BILLING_MIDDLE_INITIAL:"billing additional-name-initial",NAME_BILLING_FULL:"billing name",NAME_BILLING_SUFFIX:"billing honorific-suffix",EMAIL_ADDRESS:"email",MERCHANT_EMAIL_SIGNUP:"email",PHONE_HOME_NUMBER:"tel-local",PHONE_HOME_CITY_CODE:"tel-area-code",PHONE_HOME_COUNTRY_CODE:"tel-country-code",PHONE_HOME_CITY_AND_NUMBER:"tel-national",PHONE_HOME_WHOLE_NUMBER:"tel",PHONE_HOME_EXTENSION:"tel-extension",PHONE_BILLING_NUMBER:"billing tel-local",PHONE_BILLING_CITY_CODE:"billing tel-area-code",PHONE_BILLING_COUNTRY_CODE:"tel-country-code",PHONE_BILLING_CITY_AND_NUMBER:"tel-national",
|
550
552
|
PHONE_BILLING_WHOLE_NUMBER:"tel",ADDRESS_HOME_STREET_ADDRESS:"street-address",ADDRESS_HOME_LINE1:"address-line1",ADDRESS_HOME_LINE2:"address-line2",ADDRESS_HOME_LINE3:"address-line3",ADDRESS_HOME_STATE:"address-level1",ADDRESS_HOME_CITY:"address-level2",ADDRESS_HOME_DEPENDENT_LOCALITY:"address-level3",ADDRESS_HOME_ZIP:"postal-code",ADDRESS_HOME_COUNTRY:"country-name",ADDRESS_BILLING_DEPENDENT_LOCALITY:"billing address-level3",ADDRESS_BILLING_STREET_ADDRESS:"billing street-address",ADDRESS_BILLING_LINE1:"billing address-line1",ADDRESS_BILLING_LINE2:"billing address-line2",ADDRESS_BILLING_LINE3:"billing address-line3",ADDRESS_BILLING_APT_NUM:"billing address-level3",ADDRESS_BILLING_CITY:"billing address-level2",ADDRESS_BILLING_STATE:"billing address-level1",ADDRESS_BILLING_ZIP:"billing postal-code",ADDRESS_BILLING_COUNTRY:"billing country-name",CREDIT_CARD_NAME_FULL:"cc-name",CREDIT_CARD_NAME_FIRST:"cc-given-name",CREDIT_CARD_NAME_LAST:"cc-family-name",CREDIT_CARD_NUMBER:"cc-number",
|
551
|
-
CREDIT_CARD_EXP_MONTH:"cc-exp-month",CREDIT_CARD_EXP_2_DIGIT_YEAR:"cc-exp-year",CREDIT_CARD_EXP_4_DIGIT_YEAR:"cc-exp-year",CREDIT_CARD_EXP_DATE_2_DIGIT_YEAR:"cc-exp",CREDIT_CARD_EXP_DATE_4_DIGIT_YEAR:"cc-exp",CREDIT_CARD_TYPE:"cc-type",CREDIT_CARD_VERIFICATION_CODE:"cc-csc",COMPANY_NAME:"organization",PASSWORD:"current-password",ACCOUNT_CREATION_PASSWORD:"new-password",HTML_TYPE_UNSPECIFIED:
|
553
|
+
CREDIT_CARD_EXP_MONTH:"cc-exp-month",CREDIT_CARD_EXP_2_DIGIT_YEAR:"cc-exp-year",CREDIT_CARD_EXP_4_DIGIT_YEAR:"cc-exp-year",CREDIT_CARD_EXP_DATE_2_DIGIT_YEAR:"cc-exp",CREDIT_CARD_EXP_DATE_4_DIGIT_YEAR:"cc-exp",CREDIT_CARD_TYPE:"cc-type",CREDIT_CARD_VERIFICATION_CODE:"cc-csc",COMPANY_NAME:"organization",PASSWORD:"current-password",ACCOUNT_CREATION_PASSWORD:"new-password",HTML_TYPE_UNSPECIFIED:pv(mv.manualReview),HTML_TYPE_NAME:"name",HTML_TYPE_HONORIFIC_PREFIX:"honorific-prefix",HTML_TYPE_GIVEN_NAME:"given-name",HTML_TYPE_ADDITIONAL_NAME:"additional-name",HTML_TYPE_FAMILY_NAME:"family-name",HTML_TYPE_ORGANIZATION:"organization",HTML_TYPE_STREET_ADDRESS:"street-address",HTML_TYPE_ADDRESS_LINE1:"address-line1",HTML_TYPE_ADDRESS_LINE2:"address-line2",HTML_TYPE_ADDRESS_LINE3:"address-line3",HTML_TYPE_ADDRESS_LEVEL1:"address-level1",HTML_TYPE_ADDRESS_LEVEL2:"address-level2",HTML_TYPE_ADDRESS_LEVEL3:"address-level3",HTML_TYPE_COUNTRY_CODE:"tel-country-code",
|
552
554
|
HTML_TYPE_COUNTRY_NAME:"country-name",HTML_TYPE_POSTAL_CODE:"postal-code",HTML_TYPE_FULL_ADDRESS:"street-address",HTML_TYPE_CREDIT_CARD_NAME_FULL:"cc-name",HTML_TYPE_CREDIT_CARD_NAME_FIRST:"cc-given-name",HTML_TYPE_CREDIT_CARD_NAME_LAST:"cc-family-name",HTML_TYPE_CREDIT_CARD_NUMBER:"cc-number",HTML_TYPE_CREDIT_CARD_EXP:"cc-exp",HTML_TYPE_CREDIT_CARD_EXP_MONTH:"cc-exp-month",HTML_TYPE_CREDIT_CARD_EXP_YEAR:"cc-exp-year",HTML_TYPE_CREDIT_CARD_VERIFICATION_CODE:"cc-csc",HTML_TYPE_CREDIT_CARD_TYPE:"cc-csc",HTML_TYPE_TEL:"tel",HTML_TYPE_TEL_COUNTRY_CODE:"tel-country-code",HTML_TYPE_TEL_NATIONAL:"tel-national",HTML_TYPE_TEL_AREA_CODE:"tel-area-code",HTML_TYPE_TEL_LOCAL:"tel-local",HTML_TYPE_TEL_LOCAL_PREFIX:"tel-local-prefix",HTML_TYPE_TEL_LOCAL_SUFFIX:"tel-local-suffix",HTML_TYPE_TEL_EXTENSION:"tel-extension",HTML_TYPE_EMAIL:"email",HTML_TYPE_ADDITIONAL_NAME_INITIAL:"additional-name-initial",HTML_TYPE_CREDIT_CARD_EXP_DATE_2_DIGIT_YEAR:"cc-exp-year",
|
553
|
-
HTML_TYPE_CREDIT_CARD_EXP_DATE_4_DIGIT_YEAR:"cc-exp-year",HTML_TYPE_CREDIT_CARD_EXP_2_DIGIT_YEAR:"cc-exp-year",HTML_TYPE_CREDIT_CARD_EXP_4_DIGIT_YEAR:"cc-exp-year",HTML_TYPE_UPI_VPA:
|
554
|
-
const e=this.checkAttributeValidity(n);if(e.hasValidTokens&&e.isValidOrder)continue;if(!n.autocomplete.prediction)continue;if(
|
555
|
-
}],i=
|
556
|
-
traceEventNames:["EventDispatch","EvaluateScript","v8.evaluateModule","FunctionCall","TimerFire","FireIdleCallback","FireAnimationFrame","RunMicrotasks","V8.Execute"]},garbageCollection:{id:"garbageCollection",label:"Garbage Collection",traceEventNames:["MinorGC","MajorGC","BlinkGC.AtomicPhase","ThreadState::performIdleLazySweep","ThreadState::completeSweep","BlinkGCMarking"]},other:{id:"other",label:"Other",traceEventNames:["MessageLoop::RunTask","TaskQueueManager::ProcessTaskFromWorkQueue","ThreadControllerImpl::DoWork"]}},
|
557
|
-
parent:void 0,children:[],attributableURLs:[],group:
|
555
|
+
HTML_TYPE_CREDIT_CARD_EXP_DATE_4_DIGIT_YEAR:"cc-exp-year",HTML_TYPE_CREDIT_CARD_EXP_2_DIGIT_YEAR:"cc-exp-year",HTML_TYPE_CREDIT_CARD_EXP_4_DIGIT_YEAR:"cc-exp-year",HTML_TYPE_UPI_VPA:pv(mv.manualReview),HTML_TYPE_ONE_TIME_CODE:"one-time-code",HTML_TYPE_UNRECOGNIZED:pv(mv.manualReview),HTML_TYPE_TRANSACTION_AMOUNT:"transaction-amount",HTML_TYPE_TRANSACTION_CURRENCY:"transaction-currency"};cv.exports=class AutocompleteAudit extends lv{static get meta(){return{id:"autocomplete",title:pv(mv.title),failureTitle:pv(mv.failureTitle),description:pv(mv.description),requiredArtifacts:["Inputs"]}}static checkAttributeValidity(e){if(!e.autocomplete.attribute)return{hasValidTokens:!1};const t=e.autocomplete.attribute.split(" ");for(const e of t)if("section-"!==e.slice(0,8)&&!hv.includes(e))return{hasValidTokens:!1};return e.autocomplete.property?{hasValidTokens:!0,isValidOrder:!0}:{hasValidTokens:!0,isValidOrder:!1}}static audit(e){const t=[],r=[];let a=!1;for(const n of e.Inputs.inputs){
|
556
|
+
const e=this.checkAttributeValidity(n);if(e.hasValidTokens&&e.isValidOrder)continue;if(!n.autocomplete.prediction)continue;if(gv.includes(n.autocomplete.prediction)&&!n.autocomplete.attribute)continue;a=!0;let i=fv[n.autocomplete.prediction];n.autocomplete.attribute||(n.autocomplete.attribute=""),n.autocomplete.attribute&&r.push(pv(mv.warningInvalid,{token:n.autocomplete.attribute,snippet:n.node.snippet})),!1===e.isValidOrder&&(r.push(pv(mv.warningOrder,{tokens:n.autocomplete.attribute,snippet:n.node.snippet})),i=mv.reviewOrder),n.autocomplete.prediction in fv||!e.isValidOrder?t.push({node:lv.makeNodeItem(n.node),suggestion:i,current:n.autocomplete.attribute}):dv.warn(`Autocomplete prediction (${n.autocomplete.prediction})\n not found in our mapping`)}const n=[{key:"node",itemType:"node",text:pv(uv.UIStrings.columnFailingElem)},{key:"current",itemType:"text",text:pv(mv.columnCurrent)},{key:"suggestion",itemType:"text",text:pv(mv.columnSuggestions)
|
557
|
+
}],i=lv.makeTableDetails(n,t);let o;return t.length>0&&(o=pv(uv.UIStrings.displayValueElementsFound,{nodeCount:t.length})),{score:t.length>0?0:1,notApplicable:!a,displayValue:o,details:i,warnings:r}}},cv.exports.UIStrings=mv;var yv={exports:{}};const vv={parseHTML:{id:"parseHTML",label:"Parse HTML & CSS",traceEventNames:["ParseHTML","ParseAuthorStyleSheet"]},styleLayout:{id:"styleLayout",label:"Style & Layout",traceEventNames:["ScheduleStyleRecalculation","UpdateLayoutTree","InvalidateLayout","Layout"]},paintCompositeRender:{id:"paintCompositeRender",label:"Rendering",traceEventNames:["Animation","HitTest","PaintSetup","Paint","PaintImage","RasterTask","ScrollLayer","UpdateLayer","UpdateLayerTree","CompositeLayers","PrePaint"]},scriptParseCompile:{id:"scriptParseCompile",label:"Script Parsing & Compilation",traceEventNames:["v8.compile","v8.compileModule","v8.parseOnBackground"]},scriptEvaluation:{id:"scriptEvaluation",label:"Script Evaluation",
|
558
|
+
traceEventNames:["EventDispatch","EvaluateScript","v8.evaluateModule","FunctionCall","TimerFire","FireIdleCallback","FireAnimationFrame","RunMicrotasks","V8.Execute"]},garbageCollection:{id:"garbageCollection",label:"Garbage Collection",traceEventNames:["MinorGC","MajorGC","BlinkGC.AtomicPhase","ThreadState::performIdleLazySweep","ThreadState::completeSweep","BlinkGCMarking"]},other:{id:"other",label:"Other",traceEventNames:["MessageLoop::RunTask","TaskQueueManager::ProcessTaskFromWorkQueue","ThreadControllerImpl::DoWork"]}},bv={};for(const e of Object.values(vv))for(const t of e.traceEventNames)bv[t]=e;var wv={taskGroups:vv,taskNameToGroup:bv};const{taskGroups:Sv,taskNameToGroup:Tv}=wv;class MainThreadTasks$9{static _createNewTaskNode(e,t){const r="X"===e.ph&&!t,a="B"===e.ph&&t&&"E"===t.ph;if(!r&&!a)throw new Error("Invalid parameters for _createNewTaskNode");const n=e.ts,i=t?t.ts:e.ts+Number(e.dur||0);return{event:e,endEvent:t,startTime:n,endTime:i,duration:i-n,unbounded:!1,
|
559
|
+
parent:void 0,children:[],attributableURLs:[],group:Sv.other,selfTime:NaN}}static _assignAllTimersUntilTs(e,t,r,a){for(;a.length;){const n=a.pop();if(!n)break;if(n.ts>t){a.push(n);break}if(n.ts<e.startTime)continue;const i=n.args.data.timerId;r.timers.set(i,e)}}static _createTasksFromStartAndEndEvents(e,t,r){const a=[],n=t.slice().reverse();for(let t=0;t<e.length;t++){const i=e[t];if("X"===i.ph){a.push(MainThreadTasks$9._createNewTaskNode(i));continue}let o,s=-1,c=0,l=t+1;for(let t=n.length-1;t>=0;t--){const r=n[t];for(;l<e.length&&!(e[l].ts>=r.ts);l++)e[l].name===i.name&&c++;if(r.name===i.name&&!(r.ts<i.ts)){if(!(c>0)){s=t;break}c--}}let u=!1;-1===s?(o={...i,ph:"E",ts:r},u=!0):o=s===n.length-1?n.pop():n.splice(s,1)[0];const d=MainThreadTasks$9._createNewTaskNode(i,o);d.unbounded=u,a.push(d)}if(n.length)throw new Error(`Fatal trace logic error - ${n.length} unmatched end events`);return a}static _createTaskRelationships(e,t,r){let a;const n=t.slice().reverse()
|
558
560
|
;for(let t=0;t<e.length;t++){let i=e[t];if("XHRReadyStateChange"===i.event.name){const e=i.event.args.data,t=e?.url;e&&t&&1===e.readyState&&r.xhrs.set(t,i)}for(;a&&Number.isFinite(a.endTime)&&a.endTime<=i.startTime;)MainThreadTasks$9._assignAllTimersUntilTs(a,a.endTime,r,n),a=a.parent;if(a){if(i.endTime>a.endTime){const e=i.endTime-a.endTime;if(e<1e3)a.endTime=i.endTime,a.duration+=e;else if(i.unbounded)i.endTime=a.endTime,i.duration=i.endTime-i.startTime;else{if(!(i.startTime-a.startTime<1e3)||a.children.length){const t=new Error("Fatal trace logic error - child cannot end after parent");throw t.timeDelta=e,t.nextTaskEvent=i.event,t.nextTaskEndEvent=i.endEvent,t.nextTaskEndTime=i.endTime,t.currentTaskEvent=a.event,t.currentTaskEndEvent=a.endEvent,t.currentTaskEndTime=a.endTime,t}{const e=i,t=a,r=a.parent;if(r){const a=r.children.length-1;if(r.children[a]!==t)throw new Error("Fatal trace logic error - impossible children");r.children.pop(),r.children.push(e)}e.parent=r,
|
559
561
|
e.startTime=t.startTime,e.duration=e.endTime-e.startTime,a=e,i=t}}}i.parent=a,a.children.push(i),MainThreadTasks$9._assignAllTimersUntilTs(a,i.startTime,r,n)}a=i}a&&MainThreadTasks$9._assignAllTimersUntilTs(a,a.endTime,r,n)}static _createTasksFromEvents(e,t,r){const a=[],n=[],i=[];for(const t of e)"X"!==t.ph&&"B"!==t.ph||a.push(t),"E"===t.ph&&n.push(t),"TimerInstall"===t.name&&i.push(t);const o=MainThreadTasks$9._createTasksFromStartAndEndEvents(a,n,r).sort(((e,t)=>e.startTime-t.startTime||t.duration-e.duration));return MainThreadTasks$9._createTaskRelationships(o,i,t),o.sort(((e,t)=>e.startTime-t.startTime||t.duration-e.duration))}static _computeRecursiveSelfTime(e,t){if(t&&e.endTime>t.endTime)throw new Error("Fatal trace logic error - child cannot end after parent");const r=e.children.map((t=>MainThreadTasks$9._computeRecursiveSelfTime(t,e))).reduce(((e,t)=>e+t),0);return e.selfTime=e.duration-r,e.duration}static _computeRecursiveAttributableURLs(e,t,r,a){const n=e.event.args,i={
|
560
562
|
...n.beginData||{},...n.data||{}},o=i.frame||"";let s=a.frameURLsById.get(o);const c=(i.stackTrace||[]).map((e=>e.url)),l=c[0];o&&s&&s.startsWith("about:")&&l&&(a.frameURLsById.set(o,l),s=l);let u=[];switch(e.event.name){case"v8.compile":case"EvaluateScript":case"FunctionCall":u=[i.url,s];break;case"v8.compileModule":u=[e.event.args.fileName];break;case"TimerFire":{const t=e.event.args.data.timerId,r=a.timers.get(t);if(!r)break;u=r.attributableURLs;break}case"ParseHTML":u=[i.url,s];break;case"ParseAuthorStyleSheet":u=[i.styleSheetUrl,s];break;case"UpdateLayoutTree":case"Layout":case"Paint":if(s){u=[s];break}if(r.length)break;u=a.lastTaskURLs;break;case"XHRReadyStateChange":case"XHRLoad":{const e=i.url,t=i.readyState;if(!e||"number"==typeof t&&4!==t)break;const r=a.xhrs.get(e);if(!r)break;u=r.attributableURLs;break}default:u=[]}const d=Array.from(t);for(const e of[...u,...c])e&&(r.includes(e)||r.push(e),d[d.length-1]!==e&&d.push(e));e.attributableURLs=d,
|
561
|
-
e.children.forEach((e=>MainThreadTasks$9._computeRecursiveAttributableURLs(e,d,r,a))),d.length||e.parent||!r.length||MainThreadTasks$9._setRecursiveEmptyAttributableURLs(e,r)}static _setRecursiveEmptyAttributableURLs(e,t){e.attributableURLs.length||(e.attributableURLs=t.slice(),e.children.forEach((e=>MainThreadTasks$9._setRecursiveEmptyAttributableURLs(e,t))))}static _computeRecursiveTaskGroup(e,t){const r=
|
563
|
+
e.children.forEach((e=>MainThreadTasks$9._computeRecursiveAttributableURLs(e,d,r,a))),d.length||e.parent||!r.length||MainThreadTasks$9._setRecursiveEmptyAttributableURLs(e,r)}static _setRecursiveEmptyAttributableURLs(e,t){e.attributableURLs.length||(e.attributableURLs=t.slice(),e.children.forEach((e=>MainThreadTasks$9._setRecursiveEmptyAttributableURLs(e,t))))}static _computeRecursiveTaskGroup(e,t){const r=Tv[e.event.name];e.group=r||t||Sv.other,e.children.forEach((t=>MainThreadTasks$9._computeRecursiveTaskGroup(t,e.group)))}static getMainThreadTasks(e,t,r){const a=new Map,n=new Map,i=new Map;t.forEach((({id:e,url:t})=>i.set(e,t)));const o={timers:a,xhrs:n,frameURLsById:i,lastTaskURLs:[]},s=MainThreadTasks$9._createTasksFromEvents(e,o,r);for(const e of s)e.parent||(MainThreadTasks$9._computeRecursiveSelfTime(e,void 0),MainThreadTasks$9._computeRecursiveAttributableURLs(e,[],[],o),MainThreadTasks$9._computeRecursiveTaskGroup(e),o.lastTaskURLs=e.attributableURLs);const c=(s[0]||{
|
562
564
|
startTime:0}).startTime;for(const e of s)if(e.startTime=(e.startTime-c)/1e3,e.endTime=(e.endTime-c)/1e3,e.duration/=1e3,e.selfTime/=1e3,!Number.isFinite(e.selfTime))throw new Error("Invalid task timing data");return s}static printTaskTreeToDebugString(e,t={}){const r=Math.max(...e.map((e=>e.endTime)),0),{printWidth:a=100,startTime:n=0,endTime:i=r,taskLabelFn:o=(e=>e.event.name)}=t;function computeTaskDepth(e){let t=0;for(;e.parent;e=e.parent)t++;return t}const s=(i-n)/a,c=new Map,l=new Map;for(const t of e){if(t.startTime>i||t.endTime<n)continue;const e=computeTaskDepth(t),r=l.get(e)||[];r.push(t),l.set(e,r);const a=String.fromCharCode(65+c.size%26);c.set(t,{id:a,task:t})}const u=[`Trace Duration: ${r.toFixed(0)}ms`,`Range: [${n}, ${i}]`,`█ = ${s.toFixed(2)}ms`,""],d=Array.from(l.entries()).sort(((e,t)=>e[0]-t[0]));for(const[,e]of d){const t=Array.from({length:a}).map((()=>" "));for(const r of e){const e=Math.max(r.startTime,n),a=Math.min(r.endTime,i),{id:o}=c.get(r)||{id:"?"
|
563
|
-
},l=Math.floor(e/s),u=Math.floor(a/s),d=Math.floor((l+u)/2);for(let e=l;e<=u;e++)t[e]="█";for(let e=0;e<o.length;e++)t[d]=o}u.push(t.join(""))}u.push("");for(const{id:e,task:t}of c.values())u.push(`${e} = ${o(t)}`);return u.join("\n")}}var
|
564
|
-
getAttributableURLForTask:getAttributableURLForTask$2,getExecutionTimingsByURL:function getExecutionTimingsByURL$2(e,t){const r=getJavaScriptURLs$2(t),a=new Map;for(const t of e){const e=getAttributableURLForTask$2(t,r),n=a.get(e)||{},i=n[t.group.id]||0;n[t.group.id]=i+t.selfTime,a.set(e,n)}return a}};const
|
565
|
-
},
|
566
|
-
})).filter((e=>e.total>=t.options.thresholdInMs)).sort(((e,t)=>t.total-e.total));let m;l&&(m=[
|
567
|
-
return this._record}get initiatorType(){return this._record.initiator&&this._record.initiator.type}get fromDiskCache(){return!!this._record.fromDiskCache}get isNonNetworkProtocol(){return
|
568
|
-
return this._childEvents.some((e=>"Layout"===e.name))}getEvaluateScriptURLs(){const e=new Set;for(const t of this._childEvents)"EvaluateScript"===t.name&&t.args.data&&t.args.data.url&&e.add(t.args.data.url);return e}cloneWithoutRelationships(){return new CPUNode$1(this._event,this._childEvents)}}const
|
569
|
-
e.frameId&&e.resourceType===
|
570
|
-
;const s=[...r.record.redirects,r.record];for(let e=1;e<s.length;e++){const r=t.idToNodeMap.get(s[e-1].requestId),a=t.idToNodeMap.get(s[e].requestId);a&&r&&a.addDependency(r)}}))}static linkCPUNodes(e,t,r){const a=new Set([
|
565
|
+
},l=Math.floor(e/s),u=Math.floor(a/s),d=Math.floor((l+u)/2);for(let e=l;e<=u;e++)t[e]="█";for(let e=0;e<o.length;e++)t[d]=o}u.push(t.join(""))}u.push("");for(const{id:e,task:t}of c.values())u.push(`${e} = ${o(t)}`);return u.join("\n")}}var Ev=MainThreadTasks$9;const xv=Ao,_v=Ev,Av=Yp;var Rv=xv(class MainThreadTasks$8{static async compute_(e,t){const{mainThreadEvents:r,frames:a,timestamps:n}=await Av.request(e,t);return _v.getMainThreadTasks(r,a,n.traceEnd)}},null);const kv=Ki,Dv=new Set(["CpuProfiler::StartProfiling"]),Cv=new Set(["V8.GCCompactor","MajorGC","MinorGC"]);function getJavaScriptURLs$2(e){const t=new Set;for(const r of e)r.resourceType===kv.TYPES.Script&&t.add(r.url);return t}function getAttributableURLForTask$2(e,t){const r=e.attributableURLs.find((e=>t.has(e))),a=e.attributableURLs[0];let n=r||a;return n&&"about:blank"!==n||(n=Dv.has(e.event.name)?"Browser":Cv.has(e.event.name)?"Browser GC":"Unattributable"),n}var Iv={getJavaScriptURLs:getJavaScriptURLs$2,
|
566
|
+
getAttributableURLForTask:getAttributableURLForTask$2,getExecutionTimingsByURL:function getExecutionTimingsByURL$2(e,t){const r=getJavaScriptURLs$2(t),a=new Map;for(const t of e){const e=getAttributableURLForTask$2(t,r),n=a.get(e)||{},i=n[t.group.id]||0;n[t.group.id]=i+t.selfTime,a.set(e,n)}return a}};const Nv=kc,{taskGroups:Lv}=wv,Mv=oi,Pv=Lo,Ov=Rv,{getExecutionTimingsByURL:Fv}=Iv,Uv={title:"JavaScript execution time",failureTitle:"Reduce JavaScript execution time",description:"Consider reducing the time spent parsing, compiling, and executing JS. You may find delivering smaller JS payloads helps with this. [Learn more](https://web.dev/bootup-time/).",columnTotal:"Total CPU Time",columnScriptEval:"Script Evaluation",columnScriptParse:"Script Parse",chromeExtensionsWarning:"Chrome extensions negatively affected this page's load performance. Try auditing the page in incognito mode or from a Chrome profile without extensions."
|
567
|
+
},jv=Mv.createMessageInstanceIdFn("lighthouse-core/audits/bootup-time.js",Uv);class BootupTime extends Nv{static get meta(){return{id:"bootup-time",title:jv(Uv.title),failureTitle:jv(Uv.failureTitle),description:jv(Uv.description),scoreDisplayMode:Nv.SCORING_MODES.NUMERIC,requiredArtifacts:["traces","devtoolsLogs"]}}static get defaultOptions(){return{p10:1282,median:3500,thresholdInMs:50}}static async audit(e,t){const r=t.settings||{},a=e.traces[BootupTime.DEFAULT_PASS],n=e.devtoolsLogs[BootupTime.DEFAULT_PASS],i=await Pv.request(n,t),o=await Ov.request(a,t),s="simulate"===r.throttlingMethod?r.throttling.cpuSlowdownMultiplier:1,c=Fv(o,i);let l=!1,u=0;const d=Array.from(c).map((([e,r])=>{let a=0;for(const[e,t]of Object.entries(r))r[e]=t*s,a+=t*s;const n=r[Lv.scriptEvaluation.id]||0,i=r[Lv.scriptParseCompile.id]||0;return a>=t.options.thresholdInMs&&(u+=n+i),l=l||e.startsWith("chrome-extension:")&&n>100,{url:e,total:a,scripting:n,scriptParseCompile:i}
|
568
|
+
})).filter((e=>e.total>=t.options.thresholdInMs)).sort(((e,t)=>t.total-e.total));let m;l&&(m=[jv(Uv.chromeExtensionsWarning)]);const p={wastedMs:u},h=[{key:"url",itemType:"url",text:jv(Mv.UIStrings.columnURL)},{key:"total",granularity:1,itemType:"ms",text:jv(Uv.columnTotal)},{key:"scripting",granularity:1,itemType:"ms",text:jv(Uv.columnScriptEval)},{key:"scriptParseCompile",granularity:1,itemType:"ms",text:jv(Uv.columnScriptParse)}],f=BootupTime.makeTableDetails(h,d,p);return{score:Nv.computeLogNormalScore({p10:t.options.p10,median:t.options.median},u),numericValue:u,numericUnit:"millisecond",displayValue:u>0?jv(Mv.UIStrings.seconds,{timeInMs:u}):"",details:f,runWarnings:m}}}yv.exports=BootupTime,yv.exports.UIStrings=Uv;var Bv={exports:{}};const $v=Zc,qv=Ki;class NetworkNode$1 extends $v{constructor(e){super(e.requestId),this._record=e}get type(){return $v.TYPES.NETWORK}get startTime(){return 1e3*this._record.startTime*1e3}get endTime(){return 1e3*this._record.endTime*1e3}get record(){
|
569
|
+
return this._record}get initiatorType(){return this._record.initiator&&this._record.initiator.type}get fromDiskCache(){return!!this._record.fromDiskCache}get isNonNetworkProtocol(){return qv.isNonNetworkRequest(this._record)}get isConnectionless(){return this.fromDiskCache||this.isNonNetworkProtocol}hasRenderBlockingPriority(){const e=this._record.priority,t=this._record.resourceType===qv.TYPES.Script,r=this._record.resourceType===qv.TYPES.Document;return"VeryHigh"===e||"High"===e&&t||"High"===e&&r}cloneWithoutRelationships(){const e=new NetworkNode$1(this._record);return e.setIsMainDocument(this._isMainDocument),e}}var zv=NetworkNode$1;const Vv=Zc;class CPUNode$1 extends Vv{constructor(e,t=[]){super(`${e.tid}.${e.ts}`),this._event=e,this._childEvents=t}get type(){return Vv.TYPES.CPU}get startTime(){return this._event.ts}get endTime(){return this._event.ts+this._event.dur}get event(){return this._event}get childEvents(){return this._childEvents}didPerformLayout(){
|
570
|
+
return this._childEvents.some((e=>"Layout"===e.name))}getEvaluateScriptURLs(){const e=new Set;for(const t of this._childEvents)"EvaluateScript"===t.name&&t.args.data&&t.args.data.url&&e.add(t.args.data.url);return e}cloneWithoutRelationships(){return new CPUNode$1(this._event,this._childEvents)}}const Wv=Ao,Gv=zv,Hv=CPUNode$1,Yv=Fo,Kv=ao,Jv=Ki,Xv=Yp,Zv=Lo,Qv=/^video/;class PageDependencyGraph$a{static getNetworkInitiators(e){if(!e.initiator)return[];if(e.initiator.url)return[e.initiator.url];if("script"===e.initiator.type){const t=new Set;let r=e.initiator.stack;for(;r;){const e=r.callFrames||[];for(const r of e)r.url&&t.add(r.url);r=r.parent}return Array.from(t)}return[]}static getNetworkNodeOutput(e){const t=[],r=new Map,a=new Map,n=new Map;return e.forEach((e=>{if(Qv.test(e.mimeType))return;for(;r.has(e.requestId);)e.requestId+=":duplicate";const i=new Gv(e);t.push(i);const o=a.get(e.url)||[];if(o.push(i),r.set(e.requestId,i),a.set(e.url,o),
|
571
|
+
e.frameId&&e.resourceType===Jv.TYPES.Document&&e.documentURL===e.url){const t=n.has(e.frameId)?null:i;n.set(e.frameId,t)}})),{nodes:t,idToNodeMap:r,urlToNodeMap:a,frameIdToNodeMap:n}}static getCPUNodes({mainThreadEvents:e}){const t=[];let r=0;for(Kv.assertHasToplevelEvents(e);r<e.length;){const a=e[r];if(r++,!Kv.isScheduleableTask(a)||!a.dur)continue;const n=[];for(const t=a.ts+a.dur;r<e.length&&e[r].ts<t;r++)n.push(e[r]);t.push(new Hv(a,n))}return t}static linkNetworkNodes(e,t){t.nodes.forEach((r=>{const a=r.record.initiatorRequest||e.record,n=t.idToNodeMap.get(a.requestId)||e,i=!n.isDependentOn(r)&&r.canDependOn(n),o=PageDependencyGraph$a.getNetworkInitiators(r.record);if(o.length?o.forEach((e=>{const a=t.urlToNodeMap.get(e)||[];1===a.length&&a[0].startTime<=r.startTime&&!a[0].isDependentOn(r)?r.addDependency(a[0]):i&&n.addDependent(r)})):i&&n.addDependent(r),r!==e&&0===r.getDependencies().length&&r.canDependOn(e)&&r.addDependency(e),!r.record.redirects)return
|
572
|
+
;const s=[...r.record.redirects,r.record];for(let e=1;e<s.length;e++){const r=t.idToNodeMap.get(s[e-1].requestId),a=t.idToNodeMap.get(s[e].requestId);a&&r&&a.addDependency(r)}}))}static linkCPUNodes(e,t,r){const a=new Set([Jv.TYPES.XHR,Jv.TYPES.Fetch,Jv.TYPES.Script]);function addDependentNetworkRequest(e,r){const n=t.idToNodeMap.get(r);if(!n||n.startTime<=e.startTime)return;const{record:i}=n,o=i.resourceType||i.redirectDestination?.resourceType;a.has(o)&&e.addDependent(n)}function addDependencyOnFrame(e,r){if(!r)return;const a=t.frameIdToNodeMap.get(r);a&&(a.startTime>=e.startTime||e.addDependency(a))}function addDependencyOnUrl(e,r){if(!r)return;const a=t.urlToNodeMap.get(r)||[];let n=null,i=1/0;for(const t of a){if(e.startTime<=t.startTime)return;const r=e.startTime-t.endTime;r>=-1e5&&r<i&&(n=t,i=r)}n&&e.addDependency(n)}const n=new Map;for(const t of r){for(const e of t.childEvents){if(!e.args.data)continue
|
571
573
|
;const r=e.args.data.url,a=(e.args.data.stackTrace||[]).map((e=>e.url)).filter(Boolean);switch(e.name){case"TimerInstall":n.set(e.args.data.timerId,t),a.forEach((e=>addDependencyOnUrl(t,e)));break;case"TimerFire":{const r=n.get(e.args.data.timerId);if(!r||r.endTime>t.startTime)break;r.addDependent(t);break}case"InvalidateLayout":case"ScheduleStyleRecalculation":addDependencyOnFrame(t,e.args.data.frame),a.forEach((e=>addDependencyOnUrl(t,e)));break;case"EvaluateScript":addDependencyOnFrame(t,e.args.data.frame),addDependencyOnUrl(t,r),a.forEach((e=>addDependencyOnUrl(t,e)));break;case"XHRReadyStateChange":if(4!==e.args.data.readyState)break;addDependencyOnUrl(t,r),a.forEach((e=>addDependencyOnUrl(t,e)));break;case"FunctionCall":case"v8.compile":addDependencyOnFrame(t,e.args.data.frame),addDependencyOnUrl(t,r);break;case"ParseAuthorStyleSheet":addDependencyOnFrame(t,e.args.data.frame),addDependencyOnUrl(t,e.args.data.styleSheetUrl);break;case"ResourceSendRequest":
|
572
|
-
addDependencyOnFrame(t,e.args.data.frame),addDependentNetworkRequest(t,e.args.data.requestId),a.forEach((e=>addDependencyOnUrl(t,e)))}}0===t.getNumberOfDependencies()&&t.canDependOn(e)&&t.addDependency(e)}let i=!1,o=!1,s=!1;for(const e of r){let t=!1;!i&&e.childEvents.some((e=>"Layout"===e.name))&&(t=i=!0),!o&&e.childEvents.some((e=>"Paint"===e.name))&&(t=o=!0),!s&&e.childEvents.some((e=>"ParseHTML"===e.name))&&(t=s=!0),t||e.event.dur>=1e4||(1===e.getNumberOfDependencies()||e.getNumberOfDependents()<=1)&&PageDependencyGraph$a._pruneNode(e)}}static _pruneNode(e){const t=e.getDependencies(),r=e.getDependents();for(const a of t){e.removeDependency(a);for(const e of r)a.addDependent(e)}for(const t of r)e.removeDependent(t)}static createGraph(e,t){const r=PageDependencyGraph$a.getNetworkNodeOutput(t),a=PageDependencyGraph$a.getCPUNodes(e),n
|
573
|
-
;if(o){if(s=o&&r.idToNodeMap.get(o.requestId),!s)throw new Error("rootNode not found")}else s=i;if(PageDependencyGraph$a.linkNetworkNodes(s,r),PageDependencyGraph$a.linkCPUNodes(s,r,a),i.setIsMainDocument(!0),
|
574
|
-
;const
|
575
|
-
devtoolsLog:i,settings:o},t),m=this.getOptimisticGraph(c,u),p=this.getPessimisticGraph(c,u);let h={label:`optimistic${s}`};const f=d.simulate(m,h);h={label:`optimisticFlex${s}`,flexibleOrdering:!0};const y=d.simulate(m,h);h={label:`pessimistic${s}`};const v=d.simulate(p,h),b=this.getEstimateFromSimulation(f.timeInMs<y.timeInMs?f:y,{...r,optimistic:!0}),w=this.getEstimateFromSimulation(v,{...r,optimistic:!1}),S=this.getScaledCoefficients(d.rtt),T=S.intercept>0?Math.min(1,b.timeInMs/1e3):1;return{timing:S.intercept*T+S.optimistic*b.timeInMs+S.pessimistic*w.timeInMs,optimisticEstimate:b,pessimisticEstimate:w,optimisticGraph:m,pessimisticGraph:p}}static async compute_(e,t){return this.computeMetricWithGraphs(e,t)}};const
|
576
|
-
e.startTime<=t&&i.push(e);const r=e.getEvaluateScriptURLs();for(const t of r){const r=n.get(t)||e;n.set(t,e.startTime<r.startTime?e:r)}}})),i.sort(((e,t)=>e.startTime-t.startTime));const o=
|
577
|
-
static getOptimisticGraph(e,t){return this.getFirstPaintBasedGraph(e,t.timestamps.firstContentfulPaint,(e=>e.hasRenderBlockingPriority()&&"script"!==e.initiatorType))}static getPessimisticGraph(e,t){return this.getFirstPaintBasedGraph(e,t.timestamps.firstContentfulPaint,(e=>e.hasRenderBlockingPriority()))}},["devtoolsLog","gatherContext","settings","simulator","trace"]);const
|
578
|
-
const r=await
|
579
|
-
const r=await
|
580
|
-
case"Document":return Math.round(.33*t);default:return Math.round(.5*t)}}static async audit(e,t){const r=e.GatherContext,a=e.traces[
|
581
|
-
e.record.transferSize=Math.max(r-t,0)}));const l=r.simulate(t,{label:i});t.traverse((e=>{if("network"!==e.type)return;const t=c.get(e.record.requestId);void 0!==t&&(e.record.transferSize=t)}));const u=o.timeInMs-l.timeInMs;let d=
|
582
|
-
displayValue:s,numericValue:o,numericUnit:"millisecond",score:UnusedBytes$4.scoreForWastedMs(o),details:c}}static audit_(e,t,r){throw new Error("audit_ unimplemented")}}var
|
574
|
+
addDependencyOnFrame(t,e.args.data.frame),addDependentNetworkRequest(t,e.args.data.requestId),a.forEach((e=>addDependencyOnUrl(t,e)))}}0===t.getNumberOfDependencies()&&t.canDependOn(e)&&t.addDependency(e)}let i=!1,o=!1,s=!1;for(const e of r){let t=!1;!i&&e.childEvents.some((e=>"Layout"===e.name))&&(t=i=!0),!o&&e.childEvents.some((e=>"Paint"===e.name))&&(t=o=!0),!s&&e.childEvents.some((e=>"ParseHTML"===e.name))&&(t=s=!0),t||e.event.dur>=1e4||(1===e.getNumberOfDependencies()||e.getNumberOfDependents()<=1)&&PageDependencyGraph$a._pruneNode(e)}}static _pruneNode(e){const t=e.getDependencies(),r=e.getDependents();for(const a of t){e.removeDependency(a);for(const e of r)a.addDependent(e)}for(const t of r)e.removeDependent(t)}static createGraph(e,t){const r=PageDependencyGraph$a.getNetworkNodeOutput(t),a=PageDependencyGraph$a.getCPUNodes(e),n=Yv.findMainDocument(t),i=r.idToNodeMap.get(n.requestId);if(!i)throw new Error("mainDocumentNode not found.");const o=i.record.redirects?.[0];let s
|
575
|
+
;if(o){if(s=o&&r.idToNodeMap.get(o.requestId),!s)throw new Error("rootNode not found")}else s=i;if(PageDependencyGraph$a.linkNetworkNodes(s,r),PageDependencyGraph$a.linkCPUNodes(s,r,a),i.setIsMainDocument(!0),Gv.hasCycle(s))throw new Error("Invalid dependency graph created, cycle detected");return s}static printGraph(e,t=100){function padRight(e,t,r=" "){return e+r.repeat(Math.max(t-e.length,0))}const r=[];e.traverse((e=>r.push(e))),r.sort(((e,t)=>e.startTime-t.startTime));const a=r[0].startTime,n=(r.reduce(((e,t)=>Math.max(e,t.endTime)),0)-a)/t;r.forEach((e=>{const r=Math.round((e.startTime-a)/n),i=Math.ceil((e.endTime-e.startTime)/n),o=padRight("",r)+padRight("",i,"="),s=e.record?e.record.url:e.type;console.log(padRight(o,t),`| ${s.slice(0,30)}`)}))}static async compute_(e,t){const r=e.trace,a=e.devtoolsLog,[n,i]=await Promise.all([Xv.request(r,t),Zv.request(a,t)]);return PageDependencyGraph$a.createGraph(n,i)}}var eb=Wv(PageDependencyGraph$a,["devtoolsLog","trace"])
|
576
|
+
;const tb=Zc,rb=Ki,ab=Yp,nb=Xp,ib=eb,ob=Dl;var sb=class LanternMetricArtifact$1{static getScriptUrls(e,t){const r=new Set;return e.traverse((e=>{e.type!==tb.TYPES.CPU&&e.record.resourceType===rb.TYPES.Script&&(t&&!t(e)||r.add(e.record.url))})),r}static get COEFFICIENTS(){throw new Error("COEFFICIENTS unimplemented!")}static getScaledCoefficients(e){return this.COEFFICIENTS}static getOptimisticGraph(e,t){throw new Error("Optimistic graph unimplemented!")}static getPessimisticGraph(e,t){throw new Error("Pessmistic graph unimplemented!")}static getEstimateFromSimulation(e,t){return e}static async computeMetricWithGraphs(e,t,r){const a=e.gatherContext||{gatherMode:"navigation"},{trace:n,devtoolsLog:i,settings:o}=e;if("navigation"!==a.gatherMode)throw new Error("Lantern metrics can only be computed on navigations");const s=this.name.replace("Lantern",""),c=await ib.request({trace:n,devtoolsLog:i},t),l=await ab.request(n,t),u=await nb.request(l,t),d=e.simulator||await ob.request({
|
577
|
+
devtoolsLog:i,settings:o},t),m=this.getOptimisticGraph(c,u),p=this.getPessimisticGraph(c,u);let h={label:`optimistic${s}`};const f=d.simulate(m,h);h={label:`optimisticFlex${s}`,flexibleOrdering:!0};const y=d.simulate(m,h);h={label:`pessimistic${s}`};const v=d.simulate(p,h),b=this.getEstimateFromSimulation(f.timeInMs<y.timeInMs?f:y,{...r,optimistic:!0}),w=this.getEstimateFromSimulation(v,{...r,optimistic:!1}),S=this.getScaledCoefficients(d.rtt),T=S.intercept>0?Math.min(1,b.timeInMs/1e3):1;return{timing:S.intercept*T+S.optimistic*b.timeInMs+S.pessimistic*w.timeInMs,optimisticEstimate:b,pessimisticEstimate:w,optimisticGraph:m,pessimisticGraph:p}}static async compute_(e,t){return this.computeMetricWithGraphs(e,t)}};const cb=Ao,lb=sb,ub=Zc;var db=cb(class LanternFirstContentfulPaint$6 extends lb{static get COEFFICIENTS(){return{intercept:0,optimistic:.5,pessimistic:.5}}static getBlockingNodeData(e,t,r,a){const n=new Map,i=[];e.traverse((e=>{if(e.type===ub.TYPES.CPU){
|
578
|
+
e.startTime<=t&&i.push(e);const r=e.getEvaluateScriptURLs();for(const t of r){const r=n.get(t)||e;n.set(t,e.startTime<r.startTime?e:r)}}})),i.sort(((e,t)=>e.startTime-t.startTime));const o=lb.getScriptUrls(e,(e=>e.endTime<=t&&r(e))),s=new Set,c=new Set;for(const e of o){const t=n.get(e);t&&(i.includes(t)?c.add(t.id):s.add(e))}const l=i.find((e=>e.didPerformLayout()));l&&c.add(l.id);const u=i.find((e=>e.childEvents.some((e=>"Paint"===e.name))));u&&c.add(u.id);const d=i.find((e=>e.childEvents.some((e=>"ParseHTML"===e.name))));return d&&c.add(d.id),a&&i.filter(a).forEach((e=>c.add(e.id))),{definitelyNotRenderBlockingScriptUrls:s,blockingCpuNodeIds:c}}static getFirstPaintBasedGraph(e,t,r,a){const{definitelyNotRenderBlockingScriptUrls:n,blockingCpuNodeIds:i}=this.getBlockingNodeData(e,t,r,a);return e.cloneWithRelationships((e=>{if(e.type===ub.TYPES.NETWORK){if((e.endTime>t||e.startTime>t)&&!e.isMainDocument())return!1;const a=e.record.url;return!n.has(a)&&r(e)}return i.has(e.id)}))}
|
579
|
+
static getOptimisticGraph(e,t){return this.getFirstPaintBasedGraph(e,t.timestamps.firstContentfulPaint,(e=>e.hasRenderBlockingPriority()&&"script"!==e.initiatorType))}static getPessimisticGraph(e,t){return this.getFirstPaintBasedGraph(e,t.timestamps.firstContentfulPaint,(e=>e.hasRenderBlockingPriority()))}},["devtoolsLog","gatherContext","settings","simulator","trace"]);const mb=Ao,pb=sb,hb=vi.exports,gb=db;var fb=mb(class LanternFirstMeaningfulPaint$2 extends pb{static get COEFFICIENTS(){return{intercept:0,optimistic:.5,pessimistic:.5}}static getOptimisticGraph(e,t){const r=t.timestamps.firstMeaningfulPaint;if(!r)throw new hb(hb.errors.NO_FMP);return gb.getFirstPaintBasedGraph(e,r,(e=>e.hasRenderBlockingPriority()&&"script"!==e.initiatorType))}static getPessimisticGraph(e,t){const r=t.timestamps.firstMeaningfulPaint;if(!r)throw new hb(hb.errors.NO_FMP);return gb.getFirstPaintBasedGraph(e,r,(e=>e.hasRenderBlockingPriority()),(e=>e.didPerformLayout()))}static async compute_(e,t){
|
580
|
+
const r=await gb.request(e,t),a=await this.computeMetricWithGraphs(e,t);return a.timing=Math.max(a.timing,r.timing),a}},["devtoolsLog","gatherContext","settings","simulator","trace"]);const yb=Ao,vb=sb,bb=Zc,wb=Ki,Sb=fb;class LanternInteractive$4 extends vb{static get COEFFICIENTS(){return{intercept:0,optimistic:.5,pessimistic:.5}}static getOptimisticGraph(e){return e.cloneWithRelationships((e=>{if(e.type===bb.TYPES.CPU)return e.event.dur>2e4;const t=e.record.resourceType===wb.TYPES.Image,r=e.record.resourceType===wb.TYPES.Script;return!t&&(r||"High"===e.record.priority||"VeryHigh"===e.record.priority)}))}static getPessimisticGraph(e){return e}static getEstimateFromSimulation(e,t){if(!t.fmpResult)throw new Error("missing fmpResult");const r=LanternInteractive$4.getLastLongTaskEndTime(e.nodeTimings),a=t.optimistic?t.fmpResult.optimisticEstimate.timeInMs:t.fmpResult.pessimisticEstimate.timeInMs;return{timeInMs:Math.max(a,r),nodeTimings:e.nodeTimings}}static async compute_(e,t){
|
581
|
+
const r=await Sb.request(e,t),a=await this.computeMetricWithGraphs(e,t,{fmpResult:r});return a.timing=Math.max(a.timing,r.timing),a}static getLastLongTaskEndTime(e,t=50){return Array.from(e.entries()).filter((([e,r])=>e.type===bb.TYPES.CPU&&r.duration>t)).map((([e,t])=>t.endTime)).reduce(((e,t)=>Math.max(e||0,t||0)),0)}}var Tb=yb(LanternInteractive$4,["devtoolsLog","gatherContext","settings","simulator","trace"]);const Eb=kc,xb=xc.linearInterpolation,_b=Tb,Ab=oi,Rb=Lo,kb=Dl,Db=eb,Cb=Ab.createMessageInstanceIdFn("lighthouse-core/audits/byte-efficiency/byte-efficiency-audit.js",{});class UnusedBytes$4 extends Eb{static scoreForWastedMs(e){return 0===e?1:e<300?xb(0,1,300,.75,e):e<750?xb(300,.75,750,.5,e):Math.max(0,xb(750,.5,5e3,0,e))}static estimateTransferSize(e,t,r){if(e){if(e.resourceType===r)return e.transferSize||0;{const r=e.transferSize||0,a=e.resourceSize||0,n=Number.isFinite(a)&&a>0?r/a:1;return Math.round(t*n)}}switch(r){case"Stylesheet":return Math.round(.2*t);case"Script":
|
582
|
+
case"Document":return Math.round(.33*t);default:return Math.round(.5*t)}}static async audit(e,t){const r=e.GatherContext,a=e.traces[Eb.DEFAULT_PASS],n=e.devtoolsLogs[Eb.DEFAULT_PASS],i={devtoolsLog:n,settings:t?.settings||{}},o=await Rb.request(n,t);if(!o.some((e=>e.transferSize))&&"timespan"===r.gatherMode)return{score:1,notApplicable:!0};const[s,c,l]=await Promise.all([this.audit_(e,o,t),"navigation"===r.gatherMode?Db.request({trace:a,devtoolsLog:n},t):null,kb.request(i,t)]);return this.createAuditProduct(s,c,l,r)}static computeWasteWithTTIGraph(e,t,r,a){const n=`${(a=Object.assign({includeLoad:!0,label:this.meta.id},a)).label}-before`,i=`${a.label}-after`,o=r.simulate(t,{label:n}),s=a.providedWastedBytesByUrl||new Map;if(!a.providedWastedBytesByUrl)for(const{url:t,wastedBytes:r}of e)s.set(t,(s.get(t)||0)+r);const c=new Map;t.traverse((e=>{if("network"!==e.type)return;const t=s.get(e.record.url);if(!t)return;const r=e.record.transferSize;c.set(e.record.requestId,r),
|
583
|
+
e.record.transferSize=Math.max(r-t,0)}));const l=r.simulate(t,{label:i});t.traverse((e=>{if("network"!==e.type)return;const t=c.get(e.record.requestId);void 0!==t&&(e.record.transferSize=t)}));const u=o.timeInMs-l.timeInMs;let d=_b.getLastLongTaskEndTime(o.nodeTimings)-_b.getLastLongTaskEndTime(l.nodeTimings);return a.includeLoad&&(d=Math.max(d,u)),10*Math.round(Math.max(d,0)/10)}static createAuditProduct(e,t,r,a){const n=e.items.sort(((e,t)=>t.wastedBytes-e.wastedBytes)),i=n.reduce(((e,t)=>e+t.wastedBytes),0);let o;if("navigation"===a.gatherMode){if(!t)throw Error("Page dependency graph should always be computed in navigation mode");o=this.computeWasteWithTTIGraph(n,t,r,{providedWastedBytesByUrl:e.wastedBytesByUrl})}else o=r.computeWastedMsFromWastedBytes(i);let s=e.displayValue||"";void 0===e.displayValue&&i&&(s=Cb(Ab.UIStrings.displayValueByteSavings,{wastedBytes:i}));const c=Eb.makeOpportunityDetails(e.headings,n,o,i);return{explanation:e.explanation,warnings:e.warnings,
|
584
|
+
displayValue:s,numericValue:o,numericUnit:"millisecond",score:UnusedBytes$4.scoreForWastedMs(o),details:c}}static audit_(e,t,r){throw new Error("audit_ unimplemented")}}var Ib=UnusedBytes$4,Nb={exports:{}};var Lb={ArrayUtilities:{lowerBound:function lowerBound(e,t,r,a,n){let i=a||0,o=void 0!==n?n:e.length;for(;i<o;){const a=i+o>>1;r(t,e[a])>0?i=a+1:o=a}return o},upperBound:function upperBound(e,t,r,a,n){let i=a||0,o=void 0!==n?n:e.length;for(;i<o;){const a=i+o>>1;r(t,e[a])>=0?i=a+1:o=a}return o}}};!function(e,t){const r=Lb;Object.defineProperty(t,"__esModule",{value:!0}),t.TextSourceMap=t.SourceMapEntry=t.Offset=t.Section=t.SourceMapV3=void 0;t.SourceMapV3=class SourceMapV3{constructor(){}};t.Section=class Section{constructor(){}};t.Offset=class Offset{constructor(){}};class SourceMapEntry{constructor(e,t,r,a,n,i){this.lineNumber=e,this.columnNumber=t,this.sourceURL=r,this.sourceLineNumber=a,this.sourceColumnNumber=n,this.name=i}static compare(e,t){
|
583
585
|
return e.lineNumber!==t.lineNumber?e.lineNumber-t.lineNumber:e.columnNumber-t.columnNumber}}t.SourceMapEntry=SourceMapEntry;const a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=new Map;for(let e=0;e<a.length;++e)n.set(a.charAt(e),e);const i=new WeakMap;class TextSourceMap{constructor(e,t,r,a){if(this.initiator=a,this.json=r,this.compiledURLInternal=e,this.sourceMappingURL=t,this.baseURL=t.startsWith("data:")?e:t,this.mappingsInternal=null,this.sourceInfos=new Map,this.json.sections){Boolean(this.json.sections.find((e=>Boolean(e.url))))&&console.warn(`SourceMap "${t}" contains unsupported "URL" field in one of its sections.`)}this.eachSection(this.parseSources.bind(this))}compiledURL(){return this.compiledURLInternal}url(){return this.sourceMappingURL}sourceURLs(){return[...this.sourceInfos.keys()]}embeddedContentByURL(e){const t=this.sourceInfos.get(e);return t?t.content:null}findEntry(e,t){
|
584
586
|
const a=this.mappings(),n=r.ArrayUtilities.upperBound(a,void 0,((r,a)=>e-a.lineNumber||t-a.columnNumber));return n?a[n-1]:null}sourceLineMapping(e,t,a){const n=this.reversedMappings(e),i=r.ArrayUtilities.lowerBound(n,t,lineComparator),o=r.ArrayUtilities.upperBound(n,t,lineComparator);if(i>=n.length||n[i].sourceLineNumber!==t)return null;const s=n.slice(i,o);if(!s.length)return null;const c=r.ArrayUtilities.lowerBound(s,a,((e,t)=>e-t.sourceColumnNumber));return c>=s.length?s[s.length-1]:s[c];function lineComparator(e,t){return e-t.sourceLineNumber}}findReverseEntries(e,t,a){const n=this.reversedMappings(e),i=r.ArrayUtilities.upperBound(n,void 0,((e,r)=>t-r.sourceLineNumber||a-r.sourceColumnNumber));let o=i;for(;o>0&&n[o-1].sourceLineNumber===n[i-1].sourceLineNumber&&n[o-1].sourceColumnNumber===n[i-1].sourceColumnNumber;)--o;return n.slice(o,i)}mappings(){return null===this.mappingsInternal&&(this.mappingsInternal=[],this.eachSection(this.parseMap.bind(this)),this.json=null),
|
585
587
|
this.mappingsInternal}reversedMappings(e){const t=this.sourceInfos.get(e);if(!t)return[];const r=this.mappings();return null===t.reverseMappings&&(t.reverseMappings=r.filter((t=>t.sourceURL===e)).sort((function sourceMappingComparator(e,t){if(e.sourceLineNumber!==t.sourceLineNumber)return e.sourceLineNumber-t.sourceLineNumber;if(e.sourceColumnNumber!==t.sourceColumnNumber)return e.sourceColumnNumber-t.sourceColumnNumber;if(e.lineNumber!==t.lineNumber)return e.lineNumber-t.lineNumber;return e.columnNumber-t.columnNumber}))),t.reverseMappings}eachSection(e){if(this.json)if(this.json.sections)for(const t of this.json.sections)e(t.map,t.offset.line,t.offset.column);else e(this.json,0,0)}parseSources(e){const t=[];let r=e.sourceRoot||"";r&&!r.endsWith("/")&&(r+="/");for(let a=0;a<e.sources.length;++a){let n=r+e.sources[a];const i=e.sourcesContent&&e.sourcesContent[a];this.compiledURLInternal,this.sourceInfos.set(n,new TextSourceMap.SourceInfo(i||null,null)),t.push(n)}i.set(e,t)}
|
586
588
|
parseMap(e,t,r){let a=0,n=0,o=0,s=0;const c=i.get(e),l=e.names||[],u=new TextSourceMap.StringCharIterator(e.mappings);let d=c&&c[a];for(;;){if(","===u.peek())u.next();else{for(;";"===u.peek();)t+=1,r=0,u.next();if(!u.hasNext())break}if(r+=this.decodeVLQ(u),!u.hasNext()||this.isSeparator(u.peek())){this.mappings().push(new SourceMapEntry(t,r));continue}const e=this.decodeVLQ(u);e&&(a+=e,c&&(d=c[a])),n+=this.decodeVLQ(u),o+=this.decodeVLQ(u),u.hasNext()&&!this.isSeparator(u.peek())?(s+=this.decodeVLQ(u),this.mappings().push(new SourceMapEntry(t,r,d,n,o,l[s]))):this.mappings().push(new SourceMapEntry(t,r,d,n,o))}this.mappings().sort(SourceMapEntry.compare)}isSeparator(e){return","===e||";"===e}decodeVLQ(e){let t=0,r=0,a=TextSourceMap._VLQ_CONTINUATION_MASK;for(;a&TextSourceMap._VLQ_CONTINUATION_MASK;)a=n.get(e.next())||0,t+=(a&TextSourceMap._VLQ_BASE_MASK)<<r,r+=TextSourceMap._VLQ_BASE_SHIFT;const i=1&t;return t>>=1,i?-t:t}reverseMapTextRange(e,t){function comparator(e,t){
|
587
589
|
return e.lineNumber!==t.sourceLineNumber?e.lineNumber-t.sourceLineNumber:e.columnNumber-t.sourceColumnNumber}const a=this.reversedMappings(e);if(!a.length)return null;const n=r.ArrayUtilities.lowerBound(a,{lineNumber:t.startLine,columnNumber:t.startColumn},comparator),i=r.ArrayUtilities.upperBound(a,{lineNumber:t.endLine,columnNumber:t.endColumn},comparator),o=a[n],s=a[i];return new TextUtils.TextRange.TextRange(o.lineNumber,o.columnNumber,s.lineNumber,s.columnNumber)}mapsOrigin(){const e=this.mappings();if(e.length>0){const t=e[0];return 0===(null==t?void 0:t.lineNumber)||0===t.columnNumber}return!1}}t.TextSourceMap=TextSourceMap,function(e){e._VLQ_BASE_SHIFT=5,e._VLQ_BASE_MASK=31,e._VLQ_CONTINUATION_MASK=32;e.StringCharIterator=class StringCharIterator{constructor(e){this.string=e,this.position=0}next(){return this.string.charAt(this.position++)}peek(){return this.string.charAt(this.position)}hasNext(){return this.position<this.string.length}};e.SourceInfo=class SourceInfo{
|
588
|
-
constructor(e,t){this.content=e,this.reverseMappings=t}}}(TextSourceMap=t.TextSourceMap||(t.TextSourceMap={})),e.exports=TextSourceMap}(
|
589
|
-
;if(void 0!==c){if(c>l.length){const t=`${e.url()} mapping for last column out of bounds: ${o+1}:${c}`;return
|
590
|
-
return!!e.includes("webpack/bootstrap")||(!!e.includes("(webpack)/buildin")||!!e.includes("external "))}static _normalizeAggregatedData(e){for(const[t,r]of e.entries()){let a=r;if(a.sort(((e,t)=>t.resourceSize-e.resourceSize)),a.length>1){const e=a[0].resourceSize;a=a.filter((t=>t.resourceSize/e>=.1))}a=a.filter((e=>e.resourceSize>=512)),a.length>1?e.set(t,a):e.delete(t)}}static async compute_(e,t){const r=await
|
591
|
-
var
|
592
|
-
static _getNodeModuleName(e){const t=e.split("node_modules/"),r=indexOfOrEnd(e=t[t.length-1],"/");return"@"===e[0]?e.slice(0,indexOfOrEnd(e,"/",r+1)):e.slice(0,r)}static async _getDuplicationGroupedByNodeModules(e,t){const r=await
|
593
|
-
;for(let r=0;r<u.length;r++){const a=u[r],o=a.scriptUrl;let s=i.get(o);if(void 0===s){const r=
|
594
|
-
label:
|
595
|
-
items:t.filter((e=>"image/gif"===e.mimeType&&e.resourceType===
|
596
|
-
;const r=t.match(
|
597
|
-
;return t.products=r,t}))}(e),r=new Map,a=new Map,n=new Map;for(const e of t){e.totalExecutionTime=Number(e.totalExecutionTime)||0,e.totalOccurrences=Number(e.totalOccurrences)||0,e.averageExecutionTime=e.totalExecutionTime/e.totalOccurrences;for(const t of e.domains){if(r.has(t)){const a=r.get(t);throw new Error(`Duplicate domain ${t} (${e.name} and ${a.name})`)}r.set(t,e);const i=getRootDomain(t);if(t.startsWith("*.")){const r=t.slice(2);r===i?a.set(i,e):n.set(r,e)}}}for(const[e,t]of a.entries())t||a.delete(e);return{getEntity:getEntityInDataset.bind(null,r,n,a),getProduct:getProductInDataset.bind(null,r,n,a),getRootDomain,entities:t}}};const{createAPIFromDataset:
|
590
|
+
constructor(e,t){this.content=e,this.reverseMappings=t}}}(TextSourceMap=t.TextSourceMap||(t.TextSourceMap={})),e.exports=TextSourceMap}(Nb,Nb.exports);const Mb={TextSourceMap:Nb.exports};Mb.TextSourceMap.prototype.computeLastGeneratedColumns=function(){const e=this.mappings();if(!e.length||void 0===e[0].lastColumnNumber)for(let t=0;t<e.length-1;t++){const r=e[t],a=e[t+1];r.lineNumber===a.lineNumber&&(r.lastColumnNumber=a.columnNumber)}};var Pb=Mb;const Ob=on.default,Fb=Ao,Ub=Pb;function computeGeneratedFileSizes(e,t){const r=t.split("\n"),a={},n=t.length;let i=n;e.computeLastGeneratedColumns();for(const t of e.mappings()){const n=t.sourceURL,o=t.lineNumber,s=t.columnNumber,c=t.lastColumnNumber;if(!n)continue;const l=r[o];if(null==l){const t=`${e.url()} mapping for line out of bounds: ${o+1}`;return Ob.error("JSBundles",t),{errorMessage:t}}if(s>l.length){const t=`${e.url()} mapping for column out of bounds: ${o+1}:${s}`;return Ob.error("JSBundles",t),{errorMessage:t}}let u=0
|
591
|
+
;if(void 0!==c){if(c>l.length){const t=`${e.url()} mapping for last column out of bounds: ${o+1}:${c}`;return Ob.error("JSBundles",t),{errorMessage:t}}u=c-s}else u=l.length-s+1;a[n]=(a[n]||0)+u,i-=u}return{files:a,unmappedBytes:i,totalBytes:n}}var jb=Fb(class JSBundles{static async compute_(e){const{SourceMaps:t,ScriptElements:r}=e,a=[];for(const e of t){if(!e.map)continue;const{scriptUrl:t,map:n}=e;if(!n.mappings)continue;const i=r.find((e=>e.src===t));if(!i)continue;const o=e.scriptUrl||"compiled.js",s=e.sourceMapUrl||"compiled.js.map",c=new Ub.TextSourceMap(o,s,n),l={rawMap:n,script:i,map:c,sizes:computeGeneratedFileSizes(c,i?.content?i.content:"")};a.push(l)}return a}},["ScriptElements","SourceMaps"]);const Bb=Ao,$b=jb;class ModuleDuplication$2{static normalizeSource(e){const t=(e=e.replace(/\?$/,"")).lastIndexOf("node_modules");return-1!==t&&(e=e.substring(t)),e}static _shouldIgnoreSource(e){
|
592
|
+
return!!e.includes("webpack/bootstrap")||(!!e.includes("(webpack)/buildin")||!!e.includes("external "))}static _normalizeAggregatedData(e){for(const[t,r]of e.entries()){let a=r;if(a.sort(((e,t)=>t.resourceSize-e.resourceSize)),a.length>1){const e=a[0].resourceSize;a=a.filter((t=>t.resourceSize/e>=.1))}a=a.filter((e=>e.resourceSize>=512)),a.length>1?e.set(t,a):e.delete(t)}}static async compute_(e,t){const r=await $b.request(e,t),a=new Map;for(const{rawMap:e,sizes:t}of r){if("errorMessage"in t)continue;const r=[];a.set(e,r);for(let a=0;a<e.sources.length;a++){if(this._shouldIgnoreSource(e.sources[a]))continue;const n=(e.sourceRoot||"")+e.sources[a],i=t.files[n];r.push({source:ModuleDuplication$2.normalizeSource(e.sources[a]),resourceSize:i})}}const n=new Map;for(const{rawMap:e,script:t}of r){const r=a.get(e);if(r)for(const e of r){let r=n.get(e.source);r||(r=[],n.set(e.source,r)),r.push({scriptUrl:t.src||"",resourceSize:e.resourceSize})}}return this._normalizeAggregatedData(n),n}}
|
593
|
+
var qb=Bb(ModuleDuplication$2,["ScriptElements","SourceMaps"]);var zb={getRequestForScript:function getRequestForScript$3(e,t){if(!t)return;let r=t.requestId&&e.find((e=>e.requestId===t.requestId));for(r||(r=e.find((e=>e.url===t.src)));r?.redirectDestination;)r=r.redirectDestination;return r}};const Vb=Ib,Wb=qb,Gb=oi,{getRequestForScript:Hb}=zb,Yb={title:"Remove duplicate modules in JavaScript bundles",description:"Remove large, duplicate JavaScript modules from bundles to reduce unnecessary bytes consumed by network activity. "},Kb=Gb.createMessageInstanceIdFn("lighthouse-core/audits/byte-efficiency/duplicated-javascript.js",Yb);function indexOfOrEnd(e,t,r=0){const a=e.indexOf(t,r);return-1===a?e.length:a}class DuplicatedJavascript extends Vb{static get meta(){return{id:"duplicated-javascript",title:Kb(Yb.title),description:Kb(Yb.description),scoreDisplayMode:Vb.SCORING_MODES.NUMERIC,requiredArtifacts:["devtoolsLogs","traces","SourceMaps","ScriptElements","GatherContext","URL"]}}
|
594
|
+
static _getNodeModuleName(e){const t=e.split("node_modules/"),r=indexOfOrEnd(e=t[t.length-1],"/");return"@"===e[0]?e.slice(0,indexOfOrEnd(e,"/",r+1)):e.slice(0,r)}static async _getDuplicationGroupedByNodeModules(e,t){const r=await Wb.request(e,t),a=new Map;for(const[e,t]of r.entries()){if(!e.includes("node_modules")){a.set(e,t);continue}const r="node_modules/"+DuplicatedJavascript._getNodeModuleName(e),n=a.get(r)||[];for(const{scriptUrl:e,resourceSize:r}of t){let t=n.find((t=>t.scriptUrl===e));t||(t={scriptUrl:e,resourceSize:0},n.push(t)),t.resourceSize+=r}a.set(r,n)}for(const e of r.values())e.sort(((e,t)=>t.resourceSize-e.resourceSize));return a}static _estimateTransferRatio(e,t){return Vb.estimateTransferSize(e,t,"Script")/t}static async audit_(e,t,r){const a=r.options?.ignoreThresholdInBytes||1024,n=await DuplicatedJavascript._getDuplicationGroupedByNodeModules(e,r),i=new Map,o=[];let s=0;const c=new Set,l=new Map;for(const[r,u]of n.entries()){const n=[];let d=0
|
595
|
+
;for(let r=0;r<u.length;r++){const a=u[r],o=a.scriptUrl;let s=i.get(o);if(void 0===s){const r=Hb(t,{src:o}),a=e.ScriptElements.find((e=>e.src===o));if(!a||null===a.content)continue;const n=a.content.length;s=DuplicatedJavascript._estimateTransferRatio(r,n),i.set(o,s)}if(void 0===s)continue;const c=Math.round(a.resourceSize*s);n.push({url:o,sourceTransferBytes:c}),0!==r&&(d+=c,l.set(o,(l.get(o)||0)+c))}if(d<=a){s+=d;for(const e of n)c.add(e.url)}else o.push({source:r,wastedBytes:d,url:"",totalBytes:0,subItems:{type:"subitems",items:n}})}s>a&&o.push({source:"Other",wastedBytes:s,url:"",totalBytes:0,subItems:{type:"subitems",items:Array.from(c).map((e=>({url:e})))}});return{items:o,headings:[{key:"source",valueType:"code",subItemsHeading:{key:"url",valueType:"url"},label:Kb(Gb.UIStrings.columnSource)},{key:null,valueType:"bytes",subItemsHeading:{key:"sourceTransferBytes"},granularity:.05,label:Kb(Gb.UIStrings.columnTransferSize)},{key:"wastedBytes",valueType:"bytes",granularity:.05,
|
596
|
+
label:Kb(Gb.UIStrings.columnWastedBytes)}],wastedBytesByUrl:l}}}Bv.exports=DuplicatedJavascript,Bv.exports.UIStrings=Yb;var Jb={exports:{}};const Xb=Ki,Zb=Ib,Qb=oi,ew={title:"Use video formats for animated content",description:"Large GIFs are inefficient for delivering animated content. Consider using MPEG4/WebM videos for animations and PNG/WebP for static images instead of GIF to save network bytes. [Learn more](https://web.dev/efficient-animated-content/)"},tw=Qb.createMessageInstanceIdFn("lighthouse-core/audits/byte-efficiency/efficient-animated-content.js",ew);class EfficientAnimatedContent extends Zb{static get meta(){return{id:"efficient-animated-content",title:tw(ew.title),description:tw(ew.description),scoreDisplayMode:Zb.SCORING_MODES.NUMERIC,requiredArtifacts:["devtoolsLogs","traces","GatherContext"]}}static getPercentSavings(e){return Math.round(29.1*Math.log10(e)-100.7)/100}static audit_(e,t){return{
|
597
|
+
items:t.filter((e=>"image/gif"===e.mimeType&&e.resourceType===Xb.TYPES.Image&&(e.resourceSize||0)>102400)).map((e=>{const t=e.resourceSize||0;return{url:e.url,totalBytes:t,wastedBytes:Math.round(t*EfficientAnimatedContent.getPercentSavings(t))}})),headings:[{key:"url",valueType:"url",label:tw(Qb.UIStrings.columnURL)},{key:"totalBytes",valueType:"bytes",label:tw(Qb.UIStrings.columnResourceSize)},{key:"wastedBytes",valueType:"bytes",label:tw(Qb.UIStrings.columnWastedBytes)}]}}}Jb.exports=EfficientAnimatedContent,Jb.exports.UIStrings=ew;var rw={exports:{}};const aw=/:\/\/(\S*?)(:\d+)?(\/|$)/,nw=/([a-z0-9.-]+\.[a-z0-9]+|localhost)/i,iw=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,ow=/[^.]+\.([^.]+|(gov|com|co|ne)\.\w{2})$/i;function getDomainFromOriginOrURL(e){return"string"!=typeof e||e.length>1e4||e.startsWith("data:")?null:aw.test(e)?e.match(aw)[1]:nw.test(e)?e.match(nw)[0]:null}function getRootDomain(e){const t=getDomainFromOriginOrURL(e);if(!t)return null;if(iw.test(t))return t
|
598
|
+
;const r=t.match(ow);return r&&r[0]||t}function sliceSubdomainFromDomain(e,t){return e.length<=t.length?e:e.split(".").slice(1).join(".")}function getEntityInDataset(e,t,r,a){const n=getDomainFromOriginOrURL(a),i=getRootDomain(n);if(n&&i){if(e.has(n))return e.get(n);for(let e=n;e.length>i.length;e=sliceSubdomainFromDomain(e,i))if(t.has(e))return t.get(e);return r.has(i)?r.get(i):void 0}}function getProductInDataset(e,t,r,a){const n=getEntityInDataset(e,t,r,a),i=n&&n.products;if(i&&"string"==typeof a)for(const e of i)for(const t of e.urlPatterns){if(t instanceof RegExp&&t.test(a))return e;if("string"==typeof t&&a.includes(t))return e}}var sw={createAPIFromDataset:function createAPIFromDataset$1(e){const t=function cloneEntities(e){return e.map((e=>{const t={company:e.name,...e},r=(e.products||[]).map((e=>({company:t.company,categories:t.categories,facades:[],...e,urlPatterns:(e.urlPatterns||[]).map((e=>e.startsWith("REGEXP:")?new RegExp(e.slice("REGEXP:".length)):e))})))
|
599
|
+
;return t.products=r,t}))}(e),r=new Map,a=new Map,n=new Map;for(const e of t){e.totalExecutionTime=Number(e.totalExecutionTime)||0,e.totalOccurrences=Number(e.totalOccurrences)||0,e.averageExecutionTime=e.totalExecutionTime/e.totalOccurrences;for(const t of e.domains){if(r.has(t)){const a=r.get(t);throw new Error(`Duplicate domain ${t} (${e.name} and ${a.name})`)}r.set(t,e);const i=getRootDomain(t);if(t.startsWith("*.")){const r=t.slice(2);r===i?a.set(i,e):n.set(r,e)}}}for(const[e,t]of a.entries())t||a.delete(e);return{getEntity:getEntityInDataset.bind(null,r,n,a),getProduct:getProductInDataset.bind(null,r,n,a),getRootDomain,entities:t}}};const{createAPIFromDataset:cw}=sw;const lw=cw([{name:"Google Analytics",company:"Google",homepage:"https://marketingplatform.google.com/about/analytics/",categories:["analytics"],domains:["*.google-analytics.com","*.urchin.com","analytics.google.com"]},{name:"Google Tag Manager",company:"Google",
|
598
600
|
homepage:"https://marketingplatform.google.com/about/tag-manager/",categories:["tag-manager"],domains:["*.googletagmanager.com"]},{name:"Facebook",homepage:"https://www.facebook.com",categories:["social"],domains:["*.facebook.com","*.atlassbx.com","*.fbsbx.com","fbcdn-photos-e-a.akamaihd.net","*.facebook.net","*.fbcdn.net"],products:[{name:"Facebook Messenger Customer Chat",urlPatterns:["REGEXP:connect\\.facebook\\.net\\/.*\\/sdk\\/xfbml\\.customerchat\\.js"],facades:[{name:"React Live Chat Loader",repo:"https://github.com/calibreapp/react-live-chat-loader"}]}]},{name:"Google CDN",company:"Google",homepage:"https://developers.google.com/speed/libraries/",categories:["cdn"],domains:["ajax.googleapis.com","commondatastorage.googleapis.com","www.gstatic.com","ssl.gstatic.com"]},{name:"Other Google APIs/SDKs",company:"Google",homepage:"https://developers.google.com/apis-explorer/#p/",categories:["utility"],
|
599
601
|
domains:["accounts.google.com","apis.google.com","calendar.google.com","clients2.google.com","cse.google.com","news.google.com","pay.google.com","payments.google.com","play.google.com","smartlock.google.com","www.google.com","www.google.de","www.google.co.jp","www.google.com.au","www.google.co.uk","www.google.ie","www.google.com.sg","www.google.co.in","www.google.com.br","www.google.ca","www.google.co.kr","www.google.co.nz","www.google.co.id","www.google.fr","www.google.be","www.google.com.ua","www.google.nl","www.google.ru","www.google.se","www.googleapis.com","imasdk.googleapis.com","storage.googleapis.com","translate.googleapis.com","translate.google.com","lh3.googleusercontent.com","csi.gstatic.com"]},{name:"Google/Doubleclick Ads",company:"Google",homepage:"https://marketingplatform.google.com/about/enterprise/",categories:["ad"],
|
600
602
|
domains:["adservice.google.com","adservice.google.com.au","adservice.google.com.sg","adservice.google.com.br","adservice.google.com.ua","adservice.google.co.uk","adservice.google.co.jp","adservice.google.co.in","adservice.google.co.kr","adservice.google.co.id","adservice.google.co.nz","adservice.google.ie","adservice.google.se","adservice.google.de","adservice.google.ca","adservice.google.be","adservice.google.es","adservice.google.ch","adservice.google.fr","adservice.google.nl","*.googleadservices.com","*.googlesyndication.com","*.googletagservices.com","*.2mdn.net","*.doubleclick.net"]},{name:"Google Maps",company:"Google",homepage:"https://www.google.com/maps",categories:["utility"],domains:["maps.google.com","maps-api-ssl.google.com","maps.googleapis.com","mts.googleapis.com","maps.gstatic.com"]},{name:"YouTube",homepage:"https://youtube.com",categories:["video"],domains:["*.youtube.com","*.ggpht.com","*.youtube-nocookie.com","*.ytimg.com"],products:[{
|
@@ -696,7 +698,7 @@ company:"Optomaton",categories:["ad"],domains:["*.volvelle.tech"]},{name:"GovMet
|
|
696
698
|
domains:["*.trafficfactory.biz"]},{name:"Starfield Services Root Certificate Authority",company:"Starfield Technologies",categories:["utility"],domains:["*.starfieldtech.com","ss2.us"]},{name:"Launch Darkly",homepage:"https://launchdarkly.com",categories:["utility"],domains:["*.launchdarkly.com"]},{name:"Errorception",categories:["utility"],domains:["*.errorception.com"]},{name:"Sectigo",homepage:"https://sectigo.com/",categories:["utility"],domains:["*.sectigo.com"]},{name:"Proclivity Media",categories:["analytics"],domains:["*.pswec.com"]},{name:"Adschoom",company:"JSWeb Production",categories:["ad"],domains:["*.adschoom.com"]},{name:"Commission Factory",categories:["ad"],domains:["*.cfjump.com"]},{name:"Statuspage",company:"Atlassian",homepage:"https://www.statuspage.io",categories:["utility"],domains:["*.statuspage.io"]},{name:"Lengow",categories:["hosting"],domains:["*.lengow.com"]},{name:"Zanox",categories:["ad"],domains:["*.zanox.com","*.zanox.ws"]},{name:"Atlas Solutions",
|
697
699
|
homepage:"https://atlassolutions.com",categories:["analytics"],domains:["*.atdmt.com"]},{name:"Google Trust Services",company:"Google",categories:["utility"],domains:["*.pki.goog"]},{name:"OptiMonk",categories:["ad"],domains:["*.optimonk.com"]},{name:"Verizon Uplynk",company:"Verizon",categories:["content"],domains:["*.uplynk.com"]},{name:"Dynamic Dummy Image Generator",company:"Open Source",categories:["utility"],domains:["*.dummyimage.com"]},{name:"Blogg.se",categories:["hosting"],domains:["*.cdnme.se","*.publishme.se"]},{name:"Intelligent Reach",categories:["ad"],domains:["*.ist-track.com"]},{name:"DMG Media",categories:["content"],domains:["*.mol.im","*.and.co.uk","*.anm.co.uk","*.dailymail.co.uk"]},{name:"EMX Digital",homepage:"https://emxdigital.com",categories:["ad"],domains:["*.emxdgt.com"]},{name:"SecurityMetrics",categories:["utility"],domains:["*.securitymetrics.com"]},{name:"Merchant Equipment Store",categories:["utility"],domains:["*.merchantequip.com"]},{name:"ShopiMind",
|
698
700
|
company:"ShopIMind",categories:["ad"],domains:["*.shopimind.com"]},{name:"Clickadu (Winner Solutions)",categories:["ad"],domains:["*.clickadu.com"]},{name:"CJ Affiliate",company:"Conversant",categories:["ad"],domains:["*.cj.com","*.dpbolvw.net"]},{name:"NAVIS",categories:["content"],domains:["*.navistechnologies.info"]},{name:"dstillery",categories:["ad"],domains:["*.dstillery.com","*.media6degrees.com"]},{name:"Let's Encrypt",homepage:"https://letsencrypt.org/",categories:["utility"],domains:["*.letsencrypt.org"]},{name:"Webtype",categories:["cdn"],domains:["*.webtype.com"]},{name:"Travelocity USA",company:"Travelocity",categories:["content"],domains:["*.travelocity.com"]},{name:"eWAY",company:"Web Active Pty",categories:["utility"],domains:["*.eway.com.au"]},{name:"Research Now",categories:["analytics"],domains:["*.researchgnow.com","*.researchnow.com"]},{name:"Grapeshot",categories:["ad"],domains:["*.gscontxt.net","*.grapeshot.co.uk"]},{name:"Twitter Short URL",company:"Twitter",
|
699
|
-
categories:["social"],domains:["*.t.co"]}]);function getEntity(e){return
|
701
|
+
categories:["social"],domains:["*.t.co"]}]);function getEntity(e){return lw.getEntity(e)}function isThirdParty(e,t){const r=getEntity(e);return!!r&&r!==t}var uw={getEntity,getProduct:function getProduct(e){return lw.getProduct(e)},isThirdParty,isFirstParty:function isFirstParty(e,t){return!isThirdParty(e,t)}},dw={moduleSizes:[498,155,242,615,220,657,651,1664,790,1534,558,279,868,974,618,356,720,133,826,732,235,552,170,585,1030,210,349,179,546,167,1634,118,199,478,849,470,452,417,147,60,180,433,360,303,1325,1518,397,201,550,226,132,156,198,312,544,2125,658,778,1084,701,401,81,716,632,321,428,648,804,718,130,1443,142,374,259,286,403,821,938,514,654,280,328,186,233,243,553,267,187,206,879,105,343,779,833,773,275,477,696,224,759,671,772,746,716,182,304,658,473,592,235,334,277,404,420,280,675,1034,508,725,526,498,498,499,752,661,276,275,843,1698,962,562,609,573,1048,205,374,226,625,632,308,772,641,233],dependencies:{
|
700
702
|
"Array.prototype.fill":[3,5,8,17,19,21,22,29,30,35,38,39,40,42,43,45,48,51,52,53,55,56,58,60,61,63,64,65,68,69,70,71,72,73,74,75,80,81,82,83,84,87,88,89,91],"Array.prototype.filter":[1,8,9,10,12,14,17,19,21,22,27,28,29,30,33,35,38,39,42,43,45,47,48,51,52,53,58,60,61,63,65,68,69,70,71,72,73,74,75,80,81,82,83,84,87,88,89,92],"Array.prototype.find":[1,3,8,9,12,14,17,19,21,22,29,30,33,35,38,39,40,42,43,45,47,48,51,52,53,55,56,58,60,61,63,64,65,68,69,70,71,72,73,74,75,80,81,82,83,84,87,88,89,94],"Array.prototype.findIndex":[1,3,8,9,12,14,17,19,21,22,29,30,33,35,38,39,40,42,43,45,47,48,51,52,53,55,56,58,60,61,63,64,65,68,69,70,71,72,73,74,75,80,81,82,83,84,87,88,89,93],"Array.prototype.forEach":[1,6,8,9,11,12,14,17,19,21,22,29,30,33,35,38,39,42,43,45,47,48,51,52,53,58,60,61,63,65,68,69,70,71,72,73,74,75,80,81,82,83,84,87,88,89,95],"Array.from":[1,7,8,15,16,17,18,19,21,22,23,29,30,33,35,36,38,39,42,43,45,46,48,51,52,53,58,60,61,63,65,68,69,70,71,72,73,74,75,80,81,82,83,84,86,87,88,89,96],
|
701
703
|
"Array.isArray":[8,17,19,21,22,29,30,35,38,39,42,43,45,47,48,51,53,58,60,61,63,65,68,69,70,71,72,73,74,75,80,81,82,83,87,98],"Array.prototype.map":[1,8,9,10,12,14,17,19,21,22,27,28,29,30,33,35,38,39,42,43,45,47,48,51,52,53,58,60,61,63,65,68,69,70,71,72,73,74,75,80,81,82,83,84,87,88,89,99],"Array.of":[8,17,19,21,22,23,29,30,35,38,39,42,43,45,48,51,53,58,60,61,63,65,68,69,70,71,72,73,74,75,80,81,82,83,87,100],"Array.prototype.reduce":[1,8,11,12,13,17,19,21,22,29,30,35,38,39,42,43,45,48,51,53,58,60,61,63,65,68,69,70,71,72,73,74,75,80,81,82,83,84,87,102],"Array.prototype.reduceRight":[1,8,11,12,13,17,19,21,22,29,30,35,38,39,42,43,45,48,51,53,58,60,61,63,65,68,69,70,71,72,73,74,75,80,81,82,83,84,87,101],"Array.prototype.some":[1,8,9,11,12,14,17,19,21,22,29,30,33,35,38,39,42,43,45,47,48,51,52,53,58,60,61,63,65,68,69,70,71,72,73,74,75,80,81,82,83,84,87,88,89,103],"Date.now":[8,17,19,21,22,29,30,35,38,39,42,43,45,48,51,53,58,60,61,63,65,68,69,70,71,72,73,74,75,80,81,82,83,87,104],
|
702
704
|
"Date.prototype.toISOString":[8,17,19,21,22,24,29,30,35,38,39,42,43,45,48,51,53,58,60,61,63,65,68,69,70,71,72,73,74,75,77,78,80,81,82,83,87,105],"Date.prototype.toJSON":[8,17,19,21,22,29,30,35,38,39,42,43,45,48,51,53,58,60,61,63,65,68,69,70,71,72,73,74,75,80,81,82,83,84,87,106],"Date.prototype.toString":[21,22,38,39,43,45,51,53,70,72,73,74,75,87,107],"Function.prototype.name":[108],"Number.isInteger":[8,17,19,21,22,29,30,35,38,39,42,43,45,48,49,51,53,58,60,61,63,65,68,69,70,71,72,73,74,75,80,81,82,83,87,109],"Number.isSafeInteger":[8,17,19,21,22,29,30,35,38,39,42,43,45,48,49,51,53,58,60,61,63,65,68,69,70,71,72,73,74,75,80,81,82,83,87,110],"Number.parseInt":[8,17,19,21,22,29,30,35,38,39,42,43,45,48,51,53,54,58,60,61,63,65,68,69,70,71,72,73,74,75,79,80,81,82,83,87,90,111],"Object.defineProperties":[8,17,19,21,22,29,30,35,38,39,42,43,45,48,51,53,56,58,60,61,63,64,65,68,69,70,71,72,73,74,75,80,81,82,83,87,112],
|
@@ -704,78 +706,78 @@ categories:["social"],domains:["*.t.co"]}]);function getEntity(e){return rw.getE
|
|
704
706
|
"Object.keys":[8,17,19,21,22,29,30,35,38,39,42,43,45,48,51,53,58,60,61,63,64,65,68,69,70,71,72,73,74,75,80,81,82,83,84,87,122],"Object.preventExtensions":[8,17,19,21,22,29,30,32,35,38,39,42,43,44,45,48,51,53,58,60,61,63,65,68,69,70,71,72,73,74,75,80,81,82,83,87,123],"Object.seal":[8,17,19,21,22,29,30,32,35,38,39,42,43,44,45,48,51,53,58,60,61,63,65,68,69,70,71,72,73,74,75,80,81,82,83,87,124],"Object.setPrototypeOf":[2,8,17,19,21,22,29,30,35,38,39,42,43,45,48,51,53,58,60,61,63,65,66,68,69,70,71,72,73,74,75,80,81,82,83,87,125],"Reflect.apply":[1,8,17,19,21,22,29,30,35,38,39,42,43,45,48,51,53,58,60,61,63,65,68,69,70,71,72,73,74,75,80,81,82,83,87,127],"Reflect.construct":[1,8,17,19,21,22,29,30,34,35,38,39,40,42,43,45,48,51,53,55,56,58,60,61,63,64,65,68,69,70,71,72,73,74,75,80,81,82,83,87,128],"Reflect.defineProperty":[8,17,19,21,22,29,30,35,38,39,42,43,45,48,51,53,58,60,61,63,65,68,69,70,71,72,73,74,75,80,81,82,83,87,129],
|
705
707
|
"Reflect.deleteProperty":[8,17,19,21,22,29,30,35,38,39,42,43,45,48,51,53,58,60,61,63,65,68,69,70,71,72,73,74,75,80,81,82,83,87,130],"Reflect.get":[8,17,19,20,21,22,29,30,35,38,39,42,43,45,48,51,53,58,60,61,62,63,65,68,69,70,71,72,73,74,75,80,81,82,83,84,87,133],"Reflect.getOwnPropertyDescriptor":[8,17,19,21,22,29,30,35,38,39,42,43,45,48,51,53,58,60,61,63,65,68,69,70,71,72,73,74,75,80,81,82,83,87,131],"Reflect.getPrototypeOf":[8,17,19,20,21,22,29,30,35,38,39,42,43,45,48,51,53,58,60,61,62,63,65,68,69,70,71,72,73,74,75,80,81,82,83,84,87,132],"Reflect.has":[8,17,19,21,22,29,30,35,38,39,42,43,45,48,51,53,58,60,61,63,65,68,69,70,71,72,73,74,75,80,81,82,83,87,134],"Reflect.isExtensible":[8,17,19,21,22,29,30,35,38,39,42,43,45,48,51,53,58,60,61,63,65,68,69,70,71,72,73,74,75,80,81,82,83,87,135],"Reflect.ownKeys":[8,17,19,21,22,29,30,35,38,39,42,43,45,48,51,53,58,60,61,63,65,68,69,70,71,72,73,74,75,80,81,82,83,87,136],
|
706
708
|
"Reflect.preventExtensions":[8,17,19,21,22,29,30,32,35,38,39,42,43,45,48,51,53,58,60,61,63,65,68,69,70,71,72,73,74,75,80,81,82,83,87,137],"Reflect.setPrototypeOf":[2,8,17,19,21,22,29,30,35,38,39,42,43,45,48,51,53,58,60,61,63,65,66,68,69,70,71,72,73,74,75,80,81,82,83,87,138],"String.prototype.codePointAt":[8,17,19,21,22,29,30,35,38,39,42,43,45,48,51,53,58,60,61,63,65,68,69,70,71,72,73,74,75,76,80,81,82,83,87,139],"String.fromCodePoint":[8,17,19,21,22,29,30,35,38,39,42,43,45,48,51,53,58,60,61,63,65,68,69,70,71,72,73,74,75,80,81,82,83,87,140],"String.raw":[8,17,19,21,22,29,30,35,38,39,42,43,45,48,51,53,58,60,61,63,65,68,69,70,71,72,73,74,75,80,81,82,83,87,141],"String.prototype.repeat":[8,17,19,21,22,29,30,35,38,39,42,43,45,48,51,53,58,60,61,63,65,68,69,70,71,72,73,74,75,78,80,81,82,83,87,142],"Array.prototype.includes":[3,8,12,17,19,21,22,29,30,35,38,39,40,42,43,45,48,51,52,53,55,56,58,60,61,63,64,65,68,69,70,71,72,73,74,75,80,81,82,83,87,88,89,97],
|
707
|
-
"Object.entries":[8,17,19,21,22,29,30,35,38,39,42,43,45,48,51,53,58,60,61,63,64,65,67,68,69,70,71,72,73,74,75,80,81,82,83,87,114],"Object.getOwnPropertyDescriptors":[8,17,19,21,22,23,29,30,35,38,39,42,43,45,48,51,53,58,60,61,63,65,68,69,70,71,72,73,74,75,80,81,82,83,87,116],"Object.values":[8,17,19,21,22,29,30,35,38,39,42,43,45,48,51,53,58,60,61,63,64,65,67,68,69,70,71,72,73,74,75,80,81,82,83,87,126]},maxSize:77759,baseSize:3708};!function(e){const t=
|
709
|
+
"Object.entries":[8,17,19,21,22,29,30,35,38,39,42,43,45,48,51,53,58,60,61,63,64,65,67,68,69,70,71,72,73,74,75,80,81,82,83,87,114],"Object.getOwnPropertyDescriptors":[8,17,19,21,22,23,29,30,35,38,39,42,43,45,48,51,53,58,60,61,63,65,68,69,70,71,72,73,74,75,80,81,82,83,87,116],"Object.values":[8,17,19,21,22,29,30,35,38,39,42,43,45,48,51,53,58,60,61,63,64,65,67,68,69,70,71,72,73,74,75,80,81,82,83,87,126]},maxSize:77759,baseSize:3708};!function(e){const t=Ib,r=jb,a=oi,n=uw,{getRequestForScript:i}=zb,o={title:"Avoid serving legacy JavaScript to modern browsers",
|
708
710
|
description:"Polyfills and transforms enable legacy browsers to use new JavaScript features. However, many aren't necessary for modern browsers. For your bundled JavaScript, adopt a modern script deployment strategy using module/nomodule feature detection to reduce the amount of code shipped to modern browsers, while retaining support for legacy browsers. [Learn More](https://philipwalton.com/articles/deploying-es2015-code-in-production-today/)"},s=a.createMessageInstanceIdFn("lighthouse-core/audits/byte-efficiency/legacy-javascript.js",o);class CodePatternMatcher{constructor(e){const t=e.map((e=>`(${e.expression})`)).join("|");this.re=new RegExp(`(^\r\n|\r|\n)|${t}`,"g"),this.patterns=e}match(e){this.re.lastIndex=0;const t=new Set,r=[];let a,n=0,i=0;for(;null!==(a=this.re.exec(e));){const e=a.slice(1),[o,...s]=e;if(o){n++,i=a.index+1;continue}const c=this.patterns[s.findIndex(Boolean)];if(t.has(c)){const e=r.find((e=>e.name===c.name));e&&(e.count+=1)}else t.add(c),r.push({name:c.name,
|
709
711
|
line:n,column:a.index-i,count:1})}return r}}e.exports=class LegacyJavascript extends t{static get meta(){return{id:"legacy-javascript",scoreDisplayMode:t.SCORING_MODES.NUMERIC,description:s(o.description),title:s(o.title),requiredArtifacts:["devtoolsLogs","traces","ScriptElements","SourceMaps","GatherContext","URL"]}}static buildPolyfillExpression(e,t){const qt=e=>`['"]${e}['"]`;let r="";if(r+=e?`${e}\\.${t}\\s?=[^=]`:`(?:window\\.|[\\s;]+)${t}\\s?=[^=]`,e&&(r+=`|${e}\\[${qt(t)}\\]\\s?=[^=]`),r+=`|defineProperty\\(${e||"window"},\\s?${qt(t)}`,e){const a=e.replace(".prototype","");r+=`|\\$export\\([^,]+,${qt(a)},{${t}:`,r+=`|{target:${qt(a)}\\S*},{${t}:`}else r+=`|function ${t}\\(`;return r}static getPolyfillData(){
|
710
712
|
return[["Array.prototype.fill","es6.array.fill"],["Array.prototype.filter","es6.array.filter"],["Array.prototype.find","es6.array.find"],["Array.prototype.findIndex","es6.array.find-index"],["Array.prototype.forEach","es6.array.for-each"],["Array.from","es6.array.from"],["Array.isArray","es6.array.is-array"],["Array.prototype.map","es6.array.map"],["Array.of","es6.array.of"],["Array.prototype.some","es6.array.some"],["Date.now","es6.date.now"],["Date.prototype.toISOString","es6.date.to-iso-string"],["Date.prototype.toJSON","es6.date.to-json"],["Date.prototype.toString","es6.date.to-string"],["Function.prototype.name","es6.function.name"],["Number.isInteger","es6.number.is-integer"],["Number.isSafeInteger","es6.number.is-safe-integer"],["Object.defineProperties","es6.object.define-properties"],["Object.defineProperty","es6.object.define-property"],["Object.freeze","es6.object.freeze"],["Object.getPrototypeOf","es6.object.get-prototype-of"],["Object.isExtensible","es6.object.is-extensible"],["Object.isFrozen","es6.object.is-frozen"],["Object.isSealed","es6.object.is-sealed"],["Object.keys","es6.object.keys"],["Object.preventExtensions","es6.object.prevent-extensions"],["Object.seal","es6.object.seal"],["Object.setPrototypeOf","es6.object.set-prototype-of"],["Reflect.apply","es6.reflect.apply"],["Reflect.construct","es6.reflect.construct"],["Reflect.defineProperty","es6.reflect.define-property"],["Reflect.deleteProperty","es6.reflect.delete-property"],["Reflect.get","es6.reflect.get"],["Reflect.getOwnPropertyDescriptor","es6.reflect.get-own-property-descriptor"],["Reflect.getPrototypeOf","es6.reflect.get-prototype-of"],["Reflect.has","es6.reflect.has"],["Reflect.isExtensible","es6.reflect.is-extensible"],["Reflect.ownKeys","es6.reflect.own-keys"],["Reflect.preventExtensions","es6.reflect.prevent-extensions"],["Reflect.setPrototypeOf","es6.reflect.set-prototype-of"],["String.prototype.codePointAt","es6.string.code-point-at"],["String.fromCodePoint","es6.string.from-code-point"],["String.raw","es6.string.raw"],["String.prototype.repeat","es6.string.repeat"],["Array.prototype.includes","es7.array.includes"],["Object.entries","es7.object.entries"],["Object.getOwnPropertyDescriptors","es7.object.get-own-property-descriptors"],["Object.values","es7.object.values"]].map((e=>{
|
711
713
|
const[t,r]=e;return{name:t,coreJs2Module:r,coreJs3Module:r.replace("es6.","es.").replace("es7.","es.").replace("typed.","typed-array.")}}))}static getPolyfillPatterns(){return this.getPolyfillData().map((({name:e})=>{const t=e.split("."),r=t.length>1?t.slice(0,t.length-1).join("."):null,a=t[t.length-1];return{name:e,expression:this.buildPolyfillExpression(r,a)}}))}static getTransformPatterns(){return[{name:"@babel/plugin-transform-classes",expression:"Cannot call a class as a function",estimateBytes:e=>150+e.count*"_classCallCheck()".length},{name:"@babel/plugin-transform-regenerator",expression:/regeneratorRuntime\.a?wrap/.source,estimateBytes:e=>80*e.count},{name:"@babel/plugin-transform-spread",expression:/\.apply\(void 0,\s?_toConsumableArray/.source,estimateBytes:e=>1169+e.count*"_toConsumableArray()".length}]}static detectAcrossScripts(e,t,r,a){const n=new Map,i=this.getPolyfillData();for(const{requestId:o,content:s}of Object.values(t)){if(!s)continue
|
712
|
-
;const t=r.find((e=>e.requestId===o));if(!t)continue;const c=e.match(s),l=a.find((e=>e.script.src===t.url));if(l)for(const{coreJs2Module:e,coreJs3Module:t,name:r}of i){if(c.some((e=>e.name===r)))continue;const a=l.rawMap.sources.find((r=>r.endsWith(`${e}.js`)||r.endsWith(`${t}.js`)));if(!a)continue;const n=l.map.mappings().find((e=>e.sourceURL===a));n?c.push({name:r,line:n.lineNumber,column:n.columnNumber,count:1}):c.push({name:r,line:0,column:0,count:1})}c.length&&n.set(t.url,c)}return n}static estimateWastedBytes(e){const t=e.filter((e=>!e.name.startsWith("@"))),r=e.filter((e=>e.name.startsWith("@")));let a=0;const n=
|
714
|
+
;const t=r.find((e=>e.requestId===o));if(!t)continue;const c=e.match(s),l=a.find((e=>e.script.src===t.url));if(l)for(const{coreJs2Module:e,coreJs3Module:t,name:r}of i){if(c.some((e=>e.name===r)))continue;const a=l.rawMap.sources.find((r=>r.endsWith(`${e}.js`)||r.endsWith(`${t}.js`)));if(!a)continue;const n=l.map.mappings().find((e=>e.sourceURL===a));n?c.push({name:r,line:n.lineNumber,column:n.columnNumber,count:1}):c.push({name:r,line:0,column:0,count:1})}c.length&&n.set(t.url,c)}return n}static estimateWastedBytes(e){const t=e.filter((e=>!e.name.startsWith("@"))),r=e.filter((e=>e.name.startsWith("@")));let a=0;const n=dw,i=new Set;for(const e of t){const t=n.dependencies[e.name];if(t)for(const e of t)i.add(e)}t.length>0&&(a+=n.baseSize),a+=[...i].reduce(((e,t)=>e+n.moduleSizes[t]),0),a=Math.min(a,n.maxSize);let o=0;for(const e of r){const t=this.getTransformPatterns().find((t=>t.name===e.name));t&&t.estimateBytes&&(o+=t.estimateBytes(e))}return a+o}
|
713
715
|
static async estimateTransferRatioForScript(e,r,a,n){let o=e.get(r);if(void 0!==o)return o;const s=a.ScriptElements.find((e=>e.src===r)),c=i(n,s);if(s&&null!==s.content){const e=s.content.length;o=t.estimateTransferSize(c,e,"Script")/e}else o=1;return e.set(r,o),o}static async audit_(e,i,o){const c=n.getEntity(e.URL.finalUrl),l=await r.request(e,o),u=[],d=new CodePatternMatcher([...this.getPolyfillPatterns(),...this.getTransformPatterns()]),m=new Map,p=this.detectAcrossScripts(d,e.ScriptElements,i,l);for(const[r,a]of p.entries()){const n=await this.estimateTransferRatioForScript(m,r,e,i),o=Math.round(this.estimateWastedBytes(a)*n),s={url:r,wastedBytes:o,subItems:{type:"subitems",items:[]},totalBytes:0},c=l.find((e=>e.script.src===r));for(const e of a){const{name:a,line:n,column:i}=e,o={signal:a,location:t.makeSourceLocation(r,n,i,c)};s.subItems.items.push(o)}u.push(s)}const h=new Map;for(const e of u)n.isFirstParty(e.url,c)&&h.set(e.url,e.wastedBytes);return{items:u,headings:[{
|
714
|
-
key:"url",valueType:"url",subItemsHeading:{key:"location",valueType:"source-location"},label:s(a.UIStrings.columnURL)},{key:null,valueType:"code",subItemsHeading:{key:"signal"},label:""},{key:"wastedBytes",valueType:"bytes",label:s(a.UIStrings.columnWastedBytes)}],wastedBytesByUrl:h}}},e.exports.UIStrings=o}(
|
715
|
-
static estimateWebPSizeFromDimensions(e){const t=e.naturalWidth*e.naturalHeight;return Math.round(.2*t)}static estimateAvifSizeFromDimensions(e){const t=e.naturalWidth*e.naturalHeight;return Math.round(t*(2/12))}static estimateAvifSizeFromWebPAndJpegEstimates(e){if(!e.jpegSize||!e.webpSize)return;return 5*e.jpegSize/10/2+8*e.webpSize/10/2}static audit_(e){const t=e.URL.finalUrl,r=e.OptimizedImages,a=e.ImageElements,n=new Map;a.forEach((e=>n.set(e.src,e)));const i=[],o=[];for(const e of r){const r=n.get(e.url);if(e.failed){o.push(`Unable to decode ${
|
716
|
-
;s=ModernImageFormats.estimateWebPSizeFromDimensions({naturalHeight:t,naturalWidth:a}),c=ModernImageFormats.estimateAvifSizeFromDimensions({naturalHeight:t,naturalWidth:a}),l=!1}if(void 0===s||void 0===c)continue;const u=e.originalSize-s,d=e.originalSize-c;if(d<8192)continue;const m=
|
717
|
-
gatherContext:e.gatherContext,settings:e.settings}}static computeSimulatedMetric(e,t){throw new Error("Unimplemented")}static computeObservedMetric(e,t){throw new Error("Unimplemented")}static async compute_(e,t){const r=e.gatherContext||{gatherMode:"navigation"},{trace:a,devtoolsLog:n,settings:i}=e;if(!a||!n||!i)throw new Error("Did not provide necessary metric computation data");const o=await
|
718
|
-
;const
|
719
|
-
const a=r.timestamps.firstContentfulPaint/1e3,isLongEnoughQuietPeriod=e=>e.end>a+
|
720
|
-
;const n=
|
721
|
-
requiredArtifacts:["ImageElements","ViewportDimensions","GatherContext","devtoolsLogs","traces"]}}static computeVisiblePixels(e,t){const r=t.innerWidth,a=t.innerHeight,n=3*t.innerHeight,i=Math.max(e.top,-100),o=Math.min(e.right,r+100),s=Math.min(e.bottom,a+n),c=Math.max(e.left,-100);return Math.max(o-c,0)*Math.max(s-i,0)}static computeWaste(e,t,r){const a=r.find((t=>t.url===e.src));if(!a)return null;if("lazy"===e.loading||"eager"===e.loading)return null;const n=
|
722
|
-
;for(const[e,t]of r)"cpu"===e.type&&t.duration>=50?a=Math.max(a,t.startTime):"network"===e.type&&n.set(e.record.url,t.startTime);return e.filter((e=>{if(e.wastedBytes<2048)return!1;if(e.wastedPercent<75)return!1;return(n.get(e.url)||0)<a-50}))}static filterObservedResults(e,t){return e.filter((e=>!(e.wastedBytes<2048)&&(!(e.wastedPercent<75)&&e.requestStartTime<t/1e6-.05)))}static computeWasteWithTTIGraph(e,t,r){return super.computeWasteWithTTIGraph(e,t,r,{includeLoad:!1})}static async audit_(e,t,r){const a=e.ImageElements,n=e.ViewportDimensions,i=e.GatherContext,o=e.traces[
|
723
|
-
devtoolsLog:s,gatherContext:i,settings:u},t=await
|
724
|
-
networkRecord:r[t.header.sourceURL]},t),e)),{})}static indexUsedRules(e,t){e.forEach((e=>{const r=t[e.styleSheetId];r&&e.used&&r.usedRules.push(e)}))}static computeUsage(e){let t=0;const r=e.content.length;for(const r of e.usedRules)t+=r.endOffset-r.startOffset;const a=
|
725
|
-
const{CSSUsage:r,URL:a,devtoolsLog:n}=e,i=await
|
726
|
-
description:"Resources are blocking the first paint of your page. Consider delivering critical JS/CSS inline and deferring all non-critical JS/styles. [Learn more](https://web.dev/render-blocking-resources/)."},
|
727
|
-
const r=e.GatherContext,a=e.traces[
|
728
|
-
wastedMs:0};return{results:h,wastedMs:RenderBlockingResources.estimateSavingsWithGraphs(c,d.optimisticGraph,f,l,e.Stacks)}}static estimateSavingsWithGraphs(e,t,r,a,n){const{nodeTimings:i}=e.simulate(t),o=new Map(i);let s=0;const c=t.cloneWithRelationships((e=>{!function adjustNodeTimings(e,t,r){const a=e.get(t);if(!a)return;const n=computeStackSpecificTiming(t,a,r);a.duration-n.duration&&(t.traverse((t=>{e.delete(t)})),e.set(t,n))}(o,e,n);const t=r.has(e.id);if(e.type!==
|
729
|
-
const a=await
|
730
|
-
description:"Large network payloads cost users real money and are highly correlated with long load times. [Learn more](https://web.dev/total-byte-weight/).",displayValue:"Total size was {totalBytes, number, bytes} KiB"},
|
731
|
-
p10:t.options.p10,median:t.options.median},n),s=[{key:"url",itemType:"url",text:
|
732
|
-
"`"===l&&"${"===m?(u.push("templateBrace"),o=!1,r++,d++):"\\"===p?(r++,d++):p===l&&(o=!1)):s?(r++,"\\"===p?(r++,d++):"["===p?c=!0:"]"===p&&c?c=!1:"/"!==p||c||(s=!1)):"/*"===m?(n=!0,i="!"===e.charAt(d+2),i&&(r+=2),d++):"//"===m&&t.singlelineComments?(a=!0,n=!1,i=!1,d++):"/"===p&&t.regex&&hasPunctuatorBefore(e,d)?(s=!0,r++):"{"===p&&u.length?(u.push("normalBrace"),r++):"}"===p&&u.length?("templateBrace"===u[u.length-1]&&(o=!0,l="`"),u.pop(),r++):f?(o=!0,l=p,r++):h||r++}return n||o?e.length:r}var
|
733
|
-
static get meta(){return{id:"unminified-css",title:
|
734
|
-
label:
|
735
|
-
;for(const n of e.ScriptElements){const{src:e,content:i}=n;if(!i)continue;const o=
|
736
|
-
},
|
716
|
+
key:"url",valueType:"url",subItemsHeading:{key:"location",valueType:"source-location"},label:s(a.UIStrings.columnURL)},{key:null,valueType:"code",subItemsHeading:{key:"signal"},label:""},{key:"wastedBytes",valueType:"bytes",label:s(a.UIStrings.columnWastedBytes)}],wastedBytesByUrl:h}}},e.exports.UIStrings=o}(rw);var mw={exports:{}};const pw=Ib,hw=ji,gw=oi,fw={title:"Serve images in next-gen formats",description:"Image formats like WebP and AVIF often provide better compression than PNG or JPEG, which means faster downloads and less data consumption. [Learn more](https://web.dev/uses-webp-images/)."},yw=gw.createMessageInstanceIdFn("lighthouse-core/audits/byte-efficiency/modern-image-formats.js",fw);class ModernImageFormats extends pw{static get meta(){return{id:"modern-image-formats",title:yw(fw.title),description:yw(fw.description),scoreDisplayMode:pw.SCORING_MODES.NUMERIC,requiredArtifacts:["OptimizedImages","devtoolsLogs","traces","URL","GatherContext","ImageElements"]}}
|
717
|
+
static estimateWebPSizeFromDimensions(e){const t=e.naturalWidth*e.naturalHeight;return Math.round(.2*t)}static estimateAvifSizeFromDimensions(e){const t=e.naturalWidth*e.naturalHeight;return Math.round(t*(2/12))}static estimateAvifSizeFromWebPAndJpegEstimates(e){if(!e.jpegSize||!e.webpSize)return;return 5*e.jpegSize/10/2+8*e.webpSize/10/2}static audit_(e){const t=e.URL.finalUrl,r=e.OptimizedImages,a=e.ImageElements,n=new Map;a.forEach((e=>n.set(e.src,e)));const i=[],o=[];for(const e of r){const r=n.get(e.url);if(e.failed){o.push(`Unable to decode ${hw.getURLDisplayName(e.url)}`);continue}if("image/webp"===e.mimeType||"image/avif"===e.mimeType)continue;const a=e.jpegSize;let s=e.webpSize,c=ModernImageFormats.estimateAvifSizeFromWebPAndJpegEstimates({jpegSize:a,webpSize:s}),l=!0;if(void 0===s){if(!r){o.push(`Unable to locate resource ${hw.getURLDisplayName(e.url)}`);continue}if(!r.naturalDimensions)continue;const t=r.naturalDimensions.height,a=r.naturalDimensions.width;if(!a||!t)continue
|
718
|
+
;s=ModernImageFormats.estimateWebPSizeFromDimensions({naturalHeight:t,naturalWidth:a}),c=ModernImageFormats.estimateAvifSizeFromDimensions({naturalHeight:t,naturalWidth:a}),l=!1}if(void 0===s||void 0===c)continue;const u=e.originalSize-s,d=e.originalSize-c;if(d<8192)continue;const m=hw.elideDataURI(e.url),p=!hw.originsMatch(t,e.url);i.push({node:r?pw.makeNodeItem(r.node):void 0,url:m,fromProtocol:l,isCrossOrigin:p,totalBytes:e.originalSize,wastedBytes:d,wastedWebpBytes:u})}return{warnings:o,items:i,headings:[{key:"node",valueType:"node",label:""},{key:"url",valueType:"url",label:yw(gw.UIStrings.columnURL)},{key:"totalBytes",valueType:"bytes",label:yw(gw.UIStrings.columnResourceSize)},{key:"wastedBytes",valueType:"bytes",label:yw(gw.UIStrings.columnWastedBytes)}]}}}mw.exports=ModernImageFormats,mw.exports.UIStrings=fw;var vw={exports:{}};const bw=ao,ww=Yp,Sw=Xp,Tw=Lo;var Ew=class Metric$1{constructor(){}static getMetricComputationInput(e){return{trace:e.trace,devtoolsLog:e.devtoolsLog,
|
719
|
+
gatherContext:e.gatherContext,settings:e.settings}}static computeSimulatedMetric(e,t){throw new Error("Unimplemented")}static computeObservedMetric(e,t){throw new Error("Unimplemented")}static async compute_(e,t){const r=e.gatherContext||{gatherMode:"navigation"},{trace:a,devtoolsLog:n,settings:i}=e;if(!a||!n||!i)throw new Error("Did not provide necessary metric computation data");const o=await ww.request(a,t),s="timespan"===r.gatherMode?void 0:await Sw.request(o,t),c=Object.assign({networkRecords:await Tw.request(n,t),gatherContext:r,processedTrace:o,processedNavigation:s},e);switch(bw.assertHasToplevelEvents(c.processedTrace.mainThreadEvents),i.throttlingMethod){case"simulate":if("navigation"!==r.gatherMode)throw new Error(`${r.gatherMode} does not support throttlingMethod simulate`);return this.computeSimulatedMetric(c,t);case"provided":case"devtools":return this.computeObservedMetric(c,t);default:throw new TypeError(`Unrecognized throttling method: ${i.throttlingMethod}`)}}}
|
720
|
+
;const xw=Ew;var _w=class NavigationMetric$8 extends xw{static computeSimulatedMetric(e,t){throw new Error("Unimplemented")}static computeObservedMetric(e,t){throw new Error("Unimplemented")}static async compute_(e,t){if("navigation"!==e.gatherContext.gatherMode)throw new Error(`${this.name} can only be computed on navigations`);return super.compute_(e,t)}};const Aw=Ao,Rw=_w,kw=Tb,Dw=ls,Cw=ao,Iw=vi.exports,Nw=5e3;class Interactive$4 extends Rw{static _findNetworkQuietPeriods(e,t){const r=t.timestamps.traceEnd/1e3,a=e.filter((e=>e.finished&&"GET"===e.requestMethod&&!e.failed&&e.statusCode<400));return Dw.findNetworkQuietPeriods(a,2,r)}static _findCPUQuietPeriods(e,t){const r=t.timestamps.timeOrigin/1e3,a=t.timestamps.traceEnd/1e3;if(0===e.length)return[{start:0,end:a}];const n=[];return e.forEach(((t,i)=>{0===i&&n.push({start:0,end:t.start+r}),i===e.length-1?n.push({start:t.end+r,end:a}):n.push({start:t.end+r,end:e[i+1].start+r})})),n}static findOverlappingQuietPeriods(e,t,r){
|
721
|
+
const a=r.timestamps.firstContentfulPaint/1e3,isLongEnoughQuietPeriod=e=>e.end>a+Nw&&e.end-e.start>=Nw,n=this._findNetworkQuietPeriods(t,r).filter(isLongEnoughQuietPeriod),i=this._findCPUQuietPeriods(e,r).filter(isLongEnoughQuietPeriod),o=i.slice(),s=n.slice();let c=o.shift(),l=s.shift();for(;c&&l;)if(c.start>=l.start){if(l.end>=c.start+Nw)return{cpuQuietPeriod:c,networkQuietPeriod:l,cpuQuietPeriods:i,networkQuietPeriods:n};l=s.shift()}else{if(c.end>=l.start+Nw)return{cpuQuietPeriod:c,networkQuietPeriod:l,cpuQuietPeriods:i,networkQuietPeriods:n};c=o.shift()}throw new Iw(c?Iw.errors.NO_TTI_NETWORK_IDLE_PERIOD:Iw.errors.NO_TTI_CPU_IDLE_PERIOD)}static computeSimulatedMetric(e,t){const r=Rw.getMetricComputationInput(e);return kw.request(r,t)}static computeObservedMetric(e){const{processedTrace:t,processedNavigation:r,networkRecords:a}=e;if(!r.timestamps.domContentLoaded)throw new Iw(Iw.errors.NO_DCL)
|
722
|
+
;const n=Cw.getMainThreadTopLevelEvents(t).filter((e=>e.duration>=50)),i=Interactive$4.findOverlappingQuietPeriods(n,a,r).cpuQuietPeriod,o=1e3*Math.max(i.start,r.timestamps.firstContentfulPaint/1e3,r.timestamps.domContentLoaded/1e3),s=(o-r.timestamps.timeOrigin)/1e3;return Promise.resolve({timing:s,timestamp:o})}}var Lw=Aw(Interactive$4,["devtoolsLog","gatherContext","settings","simulator","trace"]);const Mw=Ib,Pw=Ki,Ow=Jl,Fw=ji,Uw=oi,jw=Lw,Bw=Yp,$w={title:"Defer offscreen images",description:"Consider lazy-loading offscreen and hidden images after all critical resources have finished loading to lower time to interactive. [Learn more](https://web.dev/offscreen-images/)."},qw=Uw.createMessageInstanceIdFn("lighthouse-core/audits/byte-efficiency/offscreen-images.js",$w);class OffscreenImages extends Mw{static get meta(){return{id:"offscreen-images",title:qw($w.title),description:qw($w.description),scoreDisplayMode:Mw.SCORING_MODES.NUMERIC,supportedModes:["navigation"],
|
723
|
+
requiredArtifacts:["ImageElements","ViewportDimensions","GatherContext","devtoolsLogs","traces"]}}static computeVisiblePixels(e,t){const r=t.innerWidth,a=t.innerHeight,n=3*t.innerHeight,i=Math.max(e.top,-100),o=Math.min(e.right,r+100),s=Math.min(e.bottom,a+n),c=Math.max(e.left,-100);return Math.max(o-c,0)*Math.max(s-i,0)}static computeWaste(e,t,r){const a=r.find((t=>t.url===e.src));if(!a)return null;if("lazy"===e.loading||"eager"===e.loading)return null;const n=Fw.elideDataURI(e.src),i=e.displayedWidth*e.displayedHeight,o=this.computeVisiblePixels(e.clientRect,t),s=0===i?1:1-o/i,c=Pw.getResourceSizeOnNetwork(a),l=Math.round(c*s);return Number.isFinite(s)?{node:Mw.makeNodeItem(e.node),url:n,requestStartTime:a.startTime,totalBytes:c,wastedBytes:l,wastedPercent:100*s}:new Error(`Invalid image sizing information ${n}`)}static filterLanternResults(e,t){const r=t.pessimisticEstimate.nodeTimings;let a=0;const n=new Map
|
724
|
+
;for(const[e,t]of r)"cpu"===e.type&&t.duration>=50?a=Math.max(a,t.startTime):"network"===e.type&&n.set(e.record.url,t.startTime);return e.filter((e=>{if(e.wastedBytes<2048)return!1;if(e.wastedPercent<75)return!1;return(n.get(e.url)||0)<a-50}))}static filterObservedResults(e,t){return e.filter((e=>!(e.wastedBytes<2048)&&(!(e.wastedPercent<75)&&e.requestStartTime<t/1e6-.05)))}static computeWasteWithTTIGraph(e,t,r){return super.computeWasteWithTTIGraph(e,t,r,{includeLoad:!1})}static async audit_(e,t,r){const a=e.ImageElements,n=e.ViewportDimensions,i=e.GatherContext,o=e.traces[Mw.DEFAULT_PASS],s=e.devtoolsLogs[Mw.DEFAULT_PASS],c=[],l=new Map;for(const e of a){const r=OffscreenImages.computeWaste(e,n,t);if(null===r)continue;if(r instanceof Error){c.push(r.message),Ow.captureException(r,{tags:{audit:this.meta.id},level:"warning"});continue}const a=l.get(r.url);(!a||a.wastedBytes>r.wastedBytes)&&l.set(r.url,r)}const u=r.settings;let d;const m=Array.from(l.values());try{const e={trace:o,
|
725
|
+
devtoolsLog:s,gatherContext:i,settings:u},t=await jw.request(e,r),a=t;d="simulate"===r.settings.throttlingMethod?OffscreenImages.filterLanternResults(m,a):OffscreenImages.filterObservedResults(m,t.timestamp)}catch(e){if("simulate"===r.settings.throttlingMethod)throw e;d=OffscreenImages.filterObservedResults(m,await Bw.request(o,r).then((e=>e.timestamps.traceEnd)))}return{warnings:c,items:d,headings:[{key:"node",valueType:"node",label:""},{key:"url",valueType:"url",label:qw(Uw.UIStrings.columnURL)},{key:"totalBytes",valueType:"bytes",label:qw(Uw.UIStrings.columnResourceSize)},{key:"wastedBytes",valueType:"bytes",label:qw(Uw.UIStrings.columnWastedBytes)}]}}}vw.exports=OffscreenImages,vw.exports.UIStrings=$w;var zw={exports:{}};const Vw=Ao,Ww=Ib,Gw=Lo,Hw=100;class UnusedCSS$3{static indexStylesheetsById(e,t){const r=t.filter((e=>e.resourceSize>0)).reduce(((e,t)=>(e[t.url]=t,e)),{});return e.reduce(((e,t)=>(e[t.header.styleSheetId]=Object.assign({usedRules:[],
|
726
|
+
networkRecord:r[t.header.sourceURL]},t),e)),{})}static indexUsedRules(e,t){e.forEach((e=>{const r=t[e.styleSheetId];r&&e.used&&r.usedRules.push(e)}))}static computeUsage(e){let t=0;const r=e.content.length;for(const r of e.usedRules)t+=r.endOffset-r.startOffset;const a=Ww.estimateTransferSize(e.networkRecord,r,"Stylesheet"),n=(r-t)/r;return{wastedBytes:Math.round(n*a),wastedPercent:100*n,totalBytes:a}}static determineContentPreview(e){let t=(e||"").slice(0,500).replace(/( {2,}|\t)+/g," ").replace(/\n\s+}/g,"\n}").trim();if(t.length>Hw){const e=t.indexOf("{"),r=t.indexOf("}");if(-1===e||-1===r||e>r||e>Hw)t=t.slice(0,Hw)+"...";else if(r<Hw)t=t.slice(0,r+1)+" ...";else{const r=t.slice(0,Hw).lastIndexOf(";");t=r<e?t.slice(0,Hw)+"... } ...":t.slice(0,r+1)+" ... } ..."}}return t}static mapSheetToResult(e,t){let r=e.header.sourceURL;if(!r||r===t){r=UnusedCSS$3.determineContentPreview(e.content)}return{url:r,...UnusedCSS$3.computeUsage(e)}}static async compute_(e,t){
|
727
|
+
const{CSSUsage:r,URL:a,devtoolsLog:n}=e,i=await Gw.request(n,t),o=UnusedCSS$3.indexStylesheetsById(r.stylesheets,i);UnusedCSS$3.indexUsedRules(r.rules,o);return Object.keys(o).map((e=>UnusedCSS$3.mapSheetToResult(o[e],a.finalUrl)))}}var Yw=Vw(UnusedCSS$3,["CSSUsage","URL","devtoolsLog"]);const Kw=Ao,Jw=_w,Xw=db;var Zw=Kw(class FirstContentfulPaint$3 extends Jw{static computeSimulatedMetric(e,t){const r=Jw.getMetricComputationInput(e);return Xw.request(r,t)}static async computeObservedMetric(e){const{processedNavigation:t}=e;return{timing:t.timings.firstContentfulPaint,timestamp:t.timestamps.firstContentfulPaint}}},["devtoolsLog","gatherContext","settings","simulator","trace"]);const Qw=kc,eS=oi,tS=Zc,rS=Ib,aS=Yw,nS=Ki,iS=Yp,oS=Xp,sS=Dl,cS=Zw,lS={title:"Eliminate render-blocking resources",
|
728
|
+
description:"Resources are blocking the first paint of your page. Consider delivering critical JS/CSS inline and deferring all non-critical JS/styles. [Learn more](https://web.dev/render-blocking-resources/)."},uS=eS.createMessageInstanceIdFn("lighthouse-core/audits/byte-efficiency/render-blocking-resources.js",lS);function computeStackSpecificTiming(e,t,r){const a={...t};return r.some((e=>"amp"===e.id))&&e.type===tS.TYPES.NETWORK&&e.record.resourceType===nS.TYPES.Stylesheet&&t.endTime>2100&&(a.endTime=Math.max(t.startTime,2100),a.duration=a.endTime-a.startTime),a}class RenderBlockingResources extends Qw{static get meta(){return{id:"render-blocking-resources",title:uS(lS.title),supportedModes:["navigation"],scoreDisplayMode:Qw.SCORING_MODES.NUMERIC,description:uS(lS.description),requiredArtifacts:["URL","TagsBlockingFirstPaint","traces","devtoolsLogs","CSSUsage","GatherContext","Stacks"]}}static async computeResults(e,t){
|
729
|
+
const r=e.GatherContext,a=e.traces[Qw.DEFAULT_PASS],n=e.devtoolsLogs[Qw.DEFAULT_PASS],i={devtoolsLog:n,settings:t.settings},o=await iS.request(a,t),s=await oS.request(o,t),c=await sS.request(i,t),l=await RenderBlockingResources.computeWastedCSSBytes(e,t),u={trace:a,devtoolsLog:n,gatherContext:r,simulator:c,settings:{...t.settings,throttlingMethod:"simulate"}},d=await cS.request(u,t),m=s.timestamps.firstContentfulPaint/1e3,p=function getNodesAndTimingByUrl(e){const t={};return Array.from(e.keys()).forEach((r=>{if("network"!==r.type)return;const a=e.get(r);a&&(t[r.record.url]={node:r,nodeTiming:a})})),t}(d.optimisticEstimate.nodeTimings),h=[],f=new Set;for(const t of e.TagsBlockingFirstPaint){if(1e3*t.endTime>m)continue;if(!p[t.tag.url])continue;const{node:r,nodeTiming:a}=p[t.tag.url],n=computeStackSpecificTiming(r,a,e.Stacks);r.traverse((e=>f.add(e.id)));const i=Math.round(n.duration);i<50||h.push({url:t.tag.url,totalBytes:t.transferSize,wastedMs:i})}if(!h.length)return{results:h,
|
730
|
+
wastedMs:0};return{results:h,wastedMs:RenderBlockingResources.estimateSavingsWithGraphs(c,d.optimisticGraph,f,l,e.Stacks)}}static estimateSavingsWithGraphs(e,t,r,a,n){const{nodeTimings:i}=e.simulate(t),o=new Map(i);let s=0;const c=t.cloneWithRelationships((e=>{!function adjustNodeTimings(e,t,r){const a=e.get(t);if(!a)return;const n=computeStackSpecificTiming(t,a,r);a.duration-n.duration&&(t.traverse((t=>{e.delete(t)})),e.set(t,n))}(o,e,n);const t=r.has(e.id);if(e.type!==tS.TYPES.NETWORK)return!t;const i=e.record.resourceType===nS.TYPES.Stylesheet;if(t&&i){const t=a.get(e.record.url)||0;s+=(e.record.transferSize||0)-t}return!t}));if("network"!==c.type)throw new Error("minimalFCPGraph not a NetworkNode");const l=Math.max(...Array.from(Array.from(o).map((e=>e[1].endTime)))),u=c.record.transferSize,d=u||0;c.record.transferSize=d+s;const m=e.simulate(c).timeInMs;return c.record.transferSize=u,Math.round(Math.max(l-m,0))}static async computeWastedCSSBytes(e,t){const r=new Map;try{
|
731
|
+
const a=await aS.request({CSSUsage:e.CSSUsage,URL:e.URL,devtoolsLog:e.devtoolsLogs[Qw.DEFAULT_PASS]},t);for(const e of a)r.set(e.url,e.wastedBytes)}catch(e){}return r}static async audit(e,t){const{results:r,wastedMs:a}=await RenderBlockingResources.computeResults(e,t);let n;r.length>0&&(n=uS(eS.UIStrings.displayValueMsSavings,{wastedMs:a}));const i=[{key:"url",valueType:"url",label:uS(eS.UIStrings.columnURL)},{key:"totalBytes",valueType:"bytes",label:uS(eS.UIStrings.columnTransferSize)},{key:"wastedMs",valueType:"timespanMs",label:uS(eS.UIStrings.columnWastedMs)}],o=Qw.makeOpportunityDetails(i,r,a);return{displayValue:n,score:rS.scoreForWastedMs(a),numericValue:a,numericUnit:"millisecond",details:o}}}zw.exports=RenderBlockingResources,zw.exports.UIStrings=lS;var dS={exports:{}};const mS=kc,pS=oi,hS=Ki,gS=Lo,fS={title:"Avoids enormous network payloads",failureTitle:"Avoid enormous network payloads",
|
732
|
+
description:"Large network payloads cost users real money and are highly correlated with long load times. [Learn more](https://web.dev/total-byte-weight/).",displayValue:"Total size was {totalBytes, number, bytes} KiB"},yS=pS.createMessageInstanceIdFn("lighthouse-core/audits/byte-efficiency/total-byte-weight.js",fS);dS.exports=class TotalByteWeight extends mS{static get meta(){return{id:"total-byte-weight",title:yS(fS.title),failureTitle:yS(fS.failureTitle),description:yS(fS.description),scoreDisplayMode:mS.SCORING_MODES.NUMERIC,requiredArtifacts:["devtoolsLogs"]}}static get defaultOptions(){return{p10:2731008,median:4096e3}}static async audit(e,t){const r=e.devtoolsLogs[mS.DEFAULT_PASS],a=await gS.request(r,t);let n=0,i=[];a.forEach((e=>{if(hS.isNonNetworkRequest(e)||!e.transferSize)return;const t={url:e.url,totalBytes:e.transferSize};n+=t.totalBytes,i.push(t)})),i=i.sort(((e,t)=>t.totalBytes-e.totalBytes||e.url.localeCompare(t.url))).slice(0,10);const o=mS.computeLogNormalScore({
|
733
|
+
p10:t.options.p10,median:t.options.median},n),s=[{key:"url",itemType:"url",text:yS(pS.UIStrings.columnURL)},{key:"totalBytes",itemType:"bytes",text:yS(pS.UIStrings.columnTransferSize)}],c=mS.makeTableDetails(s,i);return{score:o,numericValue:n,numericUnit:"byte",displayValue:yS(fS.displayValue,{totalBytes:n}),details:c}}},dS.exports.UIStrings=fS;var vS={exports:{}};const bS=/(return|case|{|\(|\[|\.\.\.|;|,|<|>|<=|>=|==|!=|===|!==|\+|-|\*|%|\*\*|\+\+|--|<<|>>|>>>|&|\||\^|!|~|&&|\|\||\?|:|=|\+=|-=|\*=|%=|\*\*=|<<=|>>=|>>>=|&=|\|=|\^=|=>|\/|\/=|\})$/,wS=/( |\n|\t)+$/;function hasPunctuatorBefore(e,t){for(let r=t;r>0;r--){const t=Math.max(0,r-6),a=e.slice(t,r);if(!wS.test(a))return bS.test(a)}return!0}function computeTokenLength$2(e,t){let r=0,a=!1,n=!1,i=!1,o=!1,s=!1,c=!1,l=null;const u=[];for(let d=0;d<e.length;d++){const m=e.substr(d,2),p=m.charAt(0),h=" "===p||"\n"===p||"\t"===p,f="'"===p||'"'===p||"`"===p;a?"\n"===p&&(a=!1):n?(i&&r++,"*/"===m&&(i&&r++,n=!1,d++)):o?(r++,
|
734
|
+
"`"===l&&"${"===m?(u.push("templateBrace"),o=!1,r++,d++):"\\"===p?(r++,d++):p===l&&(o=!1)):s?(r++,"\\"===p?(r++,d++):"["===p?c=!0:"]"===p&&c?c=!1:"/"!==p||c||(s=!1)):"/*"===m?(n=!0,i="!"===e.charAt(d+2),i&&(r+=2),d++):"//"===m&&t.singlelineComments?(a=!0,n=!1,i=!1,d++):"/"===p&&t.regex&&hasPunctuatorBefore(e,d)?(s=!0,r++):"{"===p&&u.length?(u.push("normalBrace"),r++):"}"===p&&u.length?("templateBrace"===u[u.length-1]&&(o=!0,l="`"),u.pop(),r++):f?(o=!0,l=p,r++):h||r++}return n||o?e.length:r}var SS=function computeJSTokenLength(e){return computeTokenLength$2(e,{singlelineComments:!0,regex:!0})};const TS=Ib,ES=Yw,xS=oi,_S=function computeCSSTokenLength(e){return computeTokenLength$2(e,{singlelineComments:!1,regex:!1})},AS={title:"Minify CSS",description:"Minifying CSS files can reduce network payload sizes. [Learn more](https://web.dev/unminified-css/)."},RS=xS.createMessageInstanceIdFn("lighthouse-core/audits/byte-efficiency/unminified-css.js",AS);class UnminifiedCSS extends TS{
|
735
|
+
static get meta(){return{id:"unminified-css",title:RS(AS.title),description:RS(AS.description),scoreDisplayMode:TS.SCORING_MODES.NUMERIC,requiredArtifacts:["CSSUsage","devtoolsLogs","traces","URL","GatherContext"]}}static computeTokenLength(e){return _S(e)}static computeWaste(e,t,r){const a=e.content,n=UnminifiedCSS.computeTokenLength(a);let i=e.header.sourceURL;if(!i||i===r){i=ES.determineContentPreview(e.content)}const o=TS.estimateTransferSize(t,a.length,"Stylesheet"),s=1-n/a.length;return{url:i,totalBytes:o,wastedBytes:Math.round(o*s),wastedPercent:100*s}}static audit_(e,t){const r=e.URL.finalUrl,a=[];for(const n of e.CSSUsage.stylesheets){const e=t.find((e=>e.url===n.header.sourceURL));if(!n.content)continue;const i=UnminifiedCSS.computeWaste(n,e,r);i.wastedPercent<5||i.wastedBytes<2048||!Number.isFinite(i.wastedBytes)||a.push(i)}return{items:a,headings:[{key:"url",valueType:"url",label:RS(xS.UIStrings.columnURL)},{key:"totalBytes",valueType:"bytes",
|
736
|
+
label:RS(xS.UIStrings.columnTransferSize)},{key:"wastedBytes",valueType:"bytes",label:RS(xS.UIStrings.columnWastedBytes)}]}}}vS.exports=UnminifiedCSS,vS.exports.UIStrings=AS;var kS={exports:{}};const DS=Ib,CS=oi,IS=SS,{getRequestForScript:NS}=zb,LS={title:"Minify JavaScript",description:"Minifying JavaScript files can reduce payload sizes and script parse time. [Learn more](https://web.dev/unminified-javascript/)."},MS=CS.createMessageInstanceIdFn("lighthouse-core/audits/byte-efficiency/unminified-javascript.js",LS);class UnminifiedJavaScript extends DS{static get meta(){return{id:"unminified-javascript",title:MS(LS.title),description:MS(LS.description),scoreDisplayMode:DS.SCORING_MODES.NUMERIC,requiredArtifacts:["ScriptElements","devtoolsLogs","traces","GatherContext"]}}static computeWaste(e,t,r){const a=e.length,n=IS(e),i=DS.estimateTransferSize(r,a,"Script"),o=1-n/a;return{url:t,totalBytes:i,wastedBytes:Math.round(i*o),wastedPercent:100*o}}static audit_(e,t){const r=[],a=[]
|
737
|
+
;for(const n of e.ScriptElements){const{src:e,content:i}=n;if(!i)continue;const o=NS(t,n),s=e&&o?o.url:`inline: ${i.substr(0,40)}...`;try{const e=UnminifiedJavaScript.computeWaste(i,s,o);if(e.wastedPercent<10||e.wastedBytes<2048||!Number.isFinite(e.wastedBytes))continue;r.push(e)}catch(e){const t=o?o.url:"?";a.push(`Unable to process script ${t}: ${e.message}`)}}return{items:r,warnings:a,headings:[{key:"url",valueType:"url",label:MS(CS.UIStrings.columnURL)},{key:"totalBytes",valueType:"bytes",label:MS(CS.UIStrings.columnTransferSize)},{key:"wastedBytes",valueType:"bytes",label:MS(CS.UIStrings.columnWastedBytes)}]}}}kS.exports=UnminifiedJavaScript,kS.exports.UIStrings=LS;var PS={exports:{}};const OS=Ib,FS=Yw,US=oi,jS={title:"Reduce unused CSS",description:"Reduce unused rules from stylesheets and defer CSS not used for above-the-fold content to decrease bytes consumed by network activity. [Learn more](https://web.dev/unused-css-rules/)."
|
738
|
+
},BS=US.createMessageInstanceIdFn("lighthouse-core/audits/byte-efficiency/unused-css-rules.js",jS);PS.exports=class UnusedCSSRules extends OS{static get meta(){return{id:"unused-css-rules",title:BS(jS.title),description:BS(jS.description),scoreDisplayMode:OS.SCORING_MODES.NUMERIC,requiredArtifacts:["CSSUsage","URL","devtoolsLogs","traces","GatherContext"]}}static async audit_(e,t,r){return{items:(await FS.request({CSSUsage:e.CSSUsage,URL:e.URL,devtoolsLog:e.devtoolsLogs[OS.DEFAULT_PASS]},r)).filter((e=>e&&e.wastedBytes>10240)),headings:[{key:"url",valueType:"url",label:BS(US.UIStrings.columnURL)},{key:"totalBytes",valueType:"bytes",label:BS(US.UIStrings.columnTransferSize)},{key:"wastedBytes",valueType:"bytes",label:BS(US.UIStrings.columnWastedBytes)}]}}},PS.exports.UIStrings=jS;var $S={exports:{}};
|
737
739
|
/**
|
738
740
|
* @license Copyright 2020 Google Inc. All Rights Reserved.
|
739
741
|
* 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
|
740
742
|
* 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.
|
741
|
-
*/const
|
742
|
-
;const o=void 0!==n.lastColumnNumber?n.lastColumnNumber-1:a[n.lineNumber];for(let a=n.columnNumber;a<=o;a++){if(e.every((e=>1===e.unusedByIndex[t]))){const e=n.sourceURL||"(unmapped)";r[e]=(r[e]||0)+1}t+=1}}const o=Object.entries(r).sort((([e,t],[r,a])=>a-t)),s={};for(const[e,t]of o)s[e]=t;return s}static async compute_(e){const{url:t,scriptCoverages:r,bundle:a}=e,n=r.map(UnusedJavascriptSummary.computeWaste),i=UnusedJavascriptSummary.determineLengths(n),o=UnusedJavascriptSummary.createItem(t,i);return a?{...o,sourcesWastedBytes:UnusedJavascriptSummary.createSourceWastedBytes(n,a)}:o}}var
|
743
|
-
},
|
744
|
-
;if(0===u.wastedBytes||0===u.totalBytes)continue;const d=
|
745
|
-
label:
|
746
|
-
displayValue:"{itemCount, plural,\n =1 {1 resource found}\n other {# resources found}\n }"},
|
747
|
-
static isCacheableAsset(e){const t=new Set([200,203,206]),r=new Set([
|
748
|
-
;const o=CacheHeaders$1.getCacheHitProbability(i);if(o>.925)continue;const s=
|
749
|
-
title:"Efficiently encode images",description:"Optimized images load faster and consume less cellular data. [Learn more](https://web.dev/uses-optimized-images/)."},
|
750
|
-
o.push(`Unable to decode ${
|
751
|
-
label:
|
752
|
-
},
|
753
|
-
node:
|
754
|
-
;const
|
755
|
-
node:
|
756
|
-
description:
|
757
|
-
description:"If the width of your app's content doesn't match the width of the viewport, your app might not be optimized for mobile screens. [Learn more](https://web.dev/content-width/).",explanation:"The viewport size of {innerWidth}px does not match the window size of {outerWidth}px."},
|
758
|
-
static async compute_(e,t){const r=e.URL.finalUrl,a=await
|
759
|
-
;const i=n.filter((e=>"network"===e.type)).reverse().map((e=>e.record));i.some((t=>!CriticalRequestChains$2.isCritical(t,e)))||function addChain(e){let t=r;for(const r of e)t[r.requestId]||(t[r.requestId]={request:r,children:{}}),t=t[r.requestId].children}(i)}),(function getNextNodes(e){return e.getDependents().filter((e=>e.getDependencies().every((e=>a.has(e)))))})),r}static async compute_(e,t){const r=await
|
760
|
-
description:"The Critical Request Chains below show you what resources are loaded with a high priority. Consider reducing the length of chains, reducing the download size of resources, or deferring the download of unnecessary resources to improve page load. [Learn more](https://web.dev/critical-request-chains/).",displayValue:"{itemCount, plural,\n =1 {1 chain found}\n other {# chains found}\n }"},
|
761
|
-
chainTransferSize:n+o.request.transferSize}),o.children&&walk(o.children,r+1,a)}),"")}(e,0)}static _getLongestChain(e){const t={duration:0,length:0,transferSize:0};return CriticalRequestChains$1._traverse(e,(e=>{const r=e.chainDuration;r>t.duration&&(t.duration=r,t.transferSize=e.chainTransferSize,t.length=e.depth)})),t.length++,t}static flattenRequests(e){const t={},r=new Map;return CriticalRequestChains$1._traverse(e,(function flatten(e){const a=e.node.request,n={url:a.url,startTime:a.startTime,endTime:a.endTime,responseReceivedTime:a.responseReceivedTime,transferSize:a.transferSize};let i=r.get(e.id);if(i?i.request=n:(i={request:n},t[e.id]=i),e.node.children)for(const t of Object.keys(e.node.children)){const e={request:{}};r.set(t,e),i.children||(i.children={}),i.children[t]=e}r.set(e.id,i)})),t}static audit(e,t){const r=e.traces[
|
762
|
-
;const r=CriticalRequestChains$1.flattenRequests(e),a=Object.keys(r)[0],n=a&&r[a].children;n&&Object.keys(n).length>0&&function walk(e,r){Object.keys(e).forEach((r=>{const a=e[r];a.children?walk(a.children):t++}),"")}(n);const i=CriticalRequestChains$1._getLongestChain(r);return{score:Number(0===t),notApplicable:0===t,displayValue:t?
|
743
|
+
*/const qS=Ao;class UnusedJavascriptSummary{static computeWaste(e){let t=0;for(const r of e.functions)t=Math.max(t,...r.ranges.map((e=>e.endOffset)));const r=new Uint8Array(t);for(const t of e.functions)for(const e of t.ranges)if(0===e.count)for(let t=e.startOffset;t<e.endOffset;t++)r[t]=1;let a=0;for(const e of r)a+=e;return{unusedByIndex:r,unusedLength:a,contentLength:t}}static createItem(e,t){const r=t.unused/t.content||0,a=Math.round(t.content*r);return{url:e,totalBytes:t.content,wastedBytes:a,wastedPercent:100*r}}static determineLengths(e){let t=0,r=0;for(const a of e)t+=a.unusedLength,r+=a.contentLength;return{content:r,unused:t}}static createSourceWastedBytes(e,t){if(!t.script.content)return;const r={},a=t.script.content.split("\n").map((e=>e.length));let n=0;const i=a.map((e=>{const t=n;return n+=e+1,t}));t.map.computeLastGeneratedColumns();for(const n of t.map.mappings()){let t=i[n.lineNumber];t+=n.columnNumber
|
744
|
+
;const o=void 0!==n.lastColumnNumber?n.lastColumnNumber-1:a[n.lineNumber];for(let a=n.columnNumber;a<=o;a++){if(e.every((e=>1===e.unusedByIndex[t]))){const e=n.sourceURL||"(unmapped)";r[e]=(r[e]||0)+1}t+=1}}const o=Object.entries(r).sort((([e,t],[r,a])=>a-t)),s={};for(const[e,t]of o)s[e]=t;return s}static async compute_(e){const{url:t,scriptCoverages:r,bundle:a}=e,n=r.map(UnusedJavascriptSummary.computeWaste),i=UnusedJavascriptSummary.determineLengths(n),o=UnusedJavascriptSummary.createItem(t,i);return a?{...o,sourcesWastedBytes:UnusedJavascriptSummary.createSourceWastedBytes(n,a)}:o}}var zS=qS(UnusedJavascriptSummary,["bundle","scriptCoverages","url"]);const VS=Ib,WS=zS,GS=jb,HS=oi,{getRequestForScript:YS}=zb,KS={title:"Reduce unused JavaScript",description:"Reduce unused JavaScript and defer loading scripts until they are required to decrease bytes consumed by network activity. [Learn more](https://web.dev/unused-javascript/)."
|
745
|
+
},JS=HS.createMessageInstanceIdFn("lighthouse-core/audits/byte-efficiency/unused-javascript.js",KS),XS=20480,ZS=512;function commonPrefix(e){if(!e.length)return"";const t=e.reduce(((e,t)=>e>t?e:t));let r=e.reduce(((e,t)=>e>t?t:e));for(;!t.startsWith(r);)r=r.slice(0,-1);return r}function trimCommonPrefix(e,t){return t&&e.startsWith(t)?"…"+e.slice(t.length):e}$S.exports=class UnusedJavaScript extends VS{static get meta(){return{id:"unused-javascript",title:JS(KS.title),description:JS(KS.description),scoreDisplayMode:VS.SCORING_MODES.NUMERIC,requiredArtifacts:["JsUsage","ScriptElements","SourceMaps","GatherContext","devtoolsLogs","traces"]}}static async audit_(e,t,r){const a=await GS.request(e,r),{unusedThreshold:n=XS,bundleSourceUnusedThreshold:i=ZS}=r.options||{},o=[];for(const[s,c]of Object.entries(e.JsUsage)){const e=YS(t,{src:s});if(!e)continue;const l=a.find((e=>e.script.src===s)),u=await WS.request({url:s,scriptCoverages:c,bundle:l},r)
|
746
|
+
;if(0===u.wastedBytes||0===u.totalBytes)continue;const d=VS.estimateTransferSize(e,u.totalBytes,"Script")/u.totalBytes,m={url:u.url,totalBytes:Math.round(d*u.totalBytes),wastedBytes:Math.round(d*u.wastedBytes),wastedPercent:u.wastedPercent};if(m.wastedBytes<=n)continue;if(o.push(m),!l||"errorMessage"in l.sizes)continue;const p=l.sizes;if(u.sourcesWastedBytes){const e=Object.entries(u.sourcesWastedBytes).sort(((e,t)=>t[1]-e[1])).slice(0,5).map((([e,t])=>{const r="(unmapped)"===e?p.unmappedBytes:p.files[e];return{source:e,unused:Math.round(t*d),total:Math.round(r*d)}})).filter((e=>e.unused>=i)),t=commonPrefix([...l.map.sourceInfos.keys()]);m.subItems={type:"subitems",items:e.map((({source:e,unused:r,total:a})=>({source:trimCommonPrefix(e,t),sourceBytes:a,sourceWastedBytes:r})))}}}return{items:o,headings:[{key:"url",valueType:"url",subItemsHeading:{key:"source",valueType:"code"},label:JS(HS.UIStrings.columnURL)},{key:"totalBytes",valueType:"bytes",subItemsHeading:{key:"sourceBytes"},
|
747
|
+
label:JS(HS.UIStrings.columnTransferSize)},{key:"wastedBytes",valueType:"bytes",subItemsHeading:{key:"sourceWastedBytes"},label:JS(HS.UIStrings.columnWastedBytes)}]}}},$S.exports.UIStrings=KS;var QS={exports:{}};const eT=function parseCacheControl(e){if("string"!=typeof e)return null;var t={},r=e.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(function(e,r,a,n){var i=a||n;return t[r]=!i||i.toLowerCase(),""}));if(t["max-age"])try{var a=parseInt(t["max-age"],10);if(isNaN(a))return null;t["max-age"]=a}catch(r){}return r?null:t},tT=kc,rT=Ki,aT=ji,nT=xc.linearInterpolation,iT=oi,oT=Lo,sT={title:"Uses efficient cache policy on static assets",failureTitle:"Serve static assets with an efficient cache policy",description:"A long cache lifetime can speed up repeat visits to your page. [Learn more](https://web.dev/uses-long-cache-ttl/).",
|
748
|
+
displayValue:"{itemCount, plural,\n =1 {1 resource found}\n other {# resources found}\n }"},cT=iT.createMessageInstanceIdFn("lighthouse-core/audits/byte-efficiency/uses-long-cache-ttl.js",sT);class CacheHeaders$1 extends tT{static get meta(){return{id:"uses-long-cache-ttl",title:cT(sT.title),failureTitle:cT(sT.failureTitle),description:cT(sT.description),scoreDisplayMode:tT.SCORING_MODES.NUMERIC,requiredArtifacts:["devtoolsLogs"]}}static get defaultOptions(){return{p10:28672,median:131072}}static getCacheHitProbability(e){const t=[0,.2,1,3,8,12,24,48,72,168,8760,1/0];if(12!==t.length)throw new Error("deciles 0-10 and 1 for overflow");const r=e/3600,a=t.findIndex((e=>e>=r));if(a===t.length-1)return 1;if(0===a)return 0;const n=t[a],i=t[a-1];return nT(i,(a-1)/10,n,a/10,r)}static computeCacheLifetimeInSeconds(e,t){if(t&&void 0!==t["max-age"])return t["max-age"];const r=e.get("expires");if(r){const e=new Date(r).getTime();return e?Math.ceil((e-Date.now())/1e3):0}return null}
|
749
|
+
static isCacheableAsset(e){const t=new Set([200,203,206]),r=new Set([rT.TYPES.Font,rT.TYPES.Image,rT.TYPES.Media,rT.TYPES.Script,rT.TYPES.Stylesheet]);return!rT.isNonNetworkRequest(e)&&(t.has(e.statusCode)&&r.has(e.resourceType||"Other"))}static shouldSkipRecord(e,t){return!(t||!(e.get("pragma")||"").includes("no-cache"))||!(!t||!(t["must-revalidate"]||t["no-cache"]||t["no-store"]||t["stale-while-revalidate"]||t.private))}static audit(e,t){const r=e.devtoolsLogs[tT.DEFAULT_PASS];return oT.request(r,t).then((e=>{const r=[];let a=0;for(const t of e){if(!CacheHeaders$1.isCacheableAsset(t))continue;const e=new Map;for(const r of t.responseHeaders||[])if(e.has(r.name.toLowerCase())){const t=e.get(r.name.toLowerCase());e.set(r.name.toLowerCase(),`${t}, ${r.value}`)}else e.set(r.name.toLowerCase(),r.value);const n=eT(e.get("cache-control"));if(this.shouldSkipRecord(e,n))continue;let i=CacheHeaders$1.computeCacheLifetimeInSeconds(e,n);if(null!==i&&(!Number.isFinite(i)||i<=0))continue;i=i||0
|
750
|
+
;const o=CacheHeaders$1.getCacheHitProbability(i);if(o>.925)continue;const s=aT.elideDataURI(t.url),c=t.transferSize||0,l=(1-o)*c;let u;a+=l,n&&(u={type:"debugdata",...n}),r.push({url:s,debugData:u,cacheLifetimeMs:1e3*i,cacheHitProbability:o,totalBytes:c,wastedBytes:l})}r.sort(((e,t)=>e.cacheLifetimeMs-t.cacheLifetimeMs||t.totalBytes-e.totalBytes||e.url.localeCompare(t.url)));const n=tT.computeLogNormalScore({p10:t.options.p10,median:t.options.median},a),i=[{key:"url",itemType:"url",text:cT(iT.UIStrings.columnURL)},{key:"cacheLifetimeMs",itemType:"ms",text:cT(iT.UIStrings.columnCacheTTL),displayUnit:"duration"},{key:"totalBytes",itemType:"bytes",text:cT(iT.UIStrings.columnTransferSize),displayUnit:"kb",granularity:1}],o={wastedBytes:a},s=tT.makeTableDetails(i,r,o);return{score:n,numericValue:a,numericUnit:"byte",displayValue:cT(sT.displayValue,{itemCount:r.length}),details:s}}))}}QS.exports=CacheHeaders$1,QS.exports.UIStrings=sT;var lT={exports:{}};const uT=Ib,dT=ji,mT=oi,pT={
|
751
|
+
title:"Efficiently encode images",description:"Optimized images load faster and consume less cellular data. [Learn more](https://web.dev/uses-optimized-images/)."},hT=mT.createMessageInstanceIdFn("lighthouse-core/audits/byte-efficiency/uses-optimized-images.js",pT);class UsesOptimizedImages extends uT{static get meta(){return{id:"uses-optimized-images",title:hT(pT.title),description:hT(pT.description),scoreDisplayMode:uT.SCORING_MODES.NUMERIC,requiredArtifacts:["OptimizedImages","ImageElements","GatherContext","devtoolsLogs","traces","URL"]}}static computeSavings(e){const t=e.originalSize-e.jpegSize;return{bytes:t,percent:100*t/e.originalSize}}static estimateJPEGSizeFromDimensions(e){const t=e.naturalWidth*e.naturalHeight;return Math.round(t*(2/8))}static audit_(e){const t=e.URL.finalUrl,r=e.OptimizedImages,a=e.ImageElements,n=new Map;a.forEach((e=>n.set(e.src,e)));const i=[],o=[];for(const e of r){const r=n.get(e.url);if(e.failed){
|
752
|
+
o.push(`Unable to decode ${dT.getURLDisplayName(e.url)}`);continue}if(!1===/(jpeg|bmp)/.test(e.mimeType))continue;let a=e.jpegSize,s=!0;if(void 0===a){if(!r){o.push(`Unable to locate resource ${dT.getURLDisplayName(e.url)}`);continue}if(!r.naturalDimensions)continue;const t=r.naturalDimensions.height,n=r.naturalDimensions.width;if(!t||!n)continue;a=UsesOptimizedImages.estimateJPEGSizeFromDimensions({naturalHeight:t,naturalWidth:n}),s=!1}if(e.originalSize<a+4096)continue;const c=dT.elideDataURI(e.url),l=!dT.originsMatch(t,e.url),u=UsesOptimizedImages.computeSavings({...e,jpegSize:a});i.push({node:r?uT.makeNodeItem(r.node):void 0,url:c,fromProtocol:s,isCrossOrigin:l,totalBytes:e.originalSize,wastedBytes:u.bytes})}return{warnings:o,items:i,headings:[{key:"node",valueType:"node",label:""},{key:"url",valueType:"url",label:hT(mT.UIStrings.columnURL)},{key:"totalBytes",valueType:"bytes",label:hT(mT.UIStrings.columnResourceSize)},{key:"wastedBytes",valueType:"bytes",
|
753
|
+
label:hT(mT.UIStrings.columnWastedBytes)}]}}}lT.exports=UsesOptimizedImages,lT.exports.UIStrings=pT;var gT={exports:{}},fT={exports:{}};const yT=ji,vT=Ao;class ImageRecords$1{static indexNetworkRecords(e){return e.reduce(((e,t)=>((/^image/.test(t.mimeType)||/\.(avif|webp)$/i.test(t.url))&&t.finished&&200===t.statusCode&&(e[t.url]=t),e)),{})}static async compute_(e){const t=ImageRecords$1.indexNetworkRecords(e.networkRecords),r=[];for(const a of e.ImageElements){const e=t[a.src]?.mimeType;r.push({...a,mimeType:e||yT.guessMimeType(a.src)})}return r.sort(((e,r)=>{const a=t[e.src]||{};return(t[r.src]||{}).resourceSize-a.resourceSize})),r}}var bT=vT(ImageRecords$1,["ImageElements","networkRecords"]);const wT=Ib,ST=Ki,TT=bT,ET=ji,xT=oi,_T={title:"Properly size images",description:"Serve images that are appropriately-sized to save cellular data and improve load time. [Learn more](https://web.dev/uses-responsive-images/)."
|
754
|
+
},AT=xT.createMessageInstanceIdFn("lighthouse-core/audits/byte-efficiency/uses-responsive-images.js",_T);class UsesResponsiveImages$1 extends wT{static get meta(){return{id:"uses-responsive-images",title:AT(_T.title),description:AT(_T.description),scoreDisplayMode:wT.SCORING_MODES.NUMERIC,requiredArtifacts:["ImageElements","ViewportDimensions","GatherContext","devtoolsLogs","traces"]}}static getDisplayedDimensions(e,t){if(e.displayedWidth&&e.displayedHeight)return{width:e.displayedWidth*t.devicePixelRatio,height:e.displayedHeight*t.devicePixelRatio};const r=t.innerWidth,a=2*t.innerHeight,n=e.naturalWidth/e.naturalHeight;let i=r,o=a;return n>r/a?o=r/n:i=a*n,{width:i*t.devicePixelRatio,height:o*t.devicePixelRatio}}static computeWaste(e,t,r){const a=r.find((t=>t.url===e.src));if(!a)return null;const n=this.getDisplayedDimensions(e,t),i=n.width*n.height,o=ET.elideDataURI(e.src),s=1-i/(e.naturalWidth*e.naturalHeight),c=ST.getResourceSizeOnNetwork(a),l=Math.round(c*s);return{
|
755
|
+
node:wT.makeNodeItem(e.node),url:o,totalBytes:c,wastedBytes:l,wastedPercent:100*s}}static async audit_(e,t,r){const a=await TT.request({ImageElements:e.ImageElements,networkRecords:t},r),n=e.ViewportDimensions,i=new Map;for(const e of a){if("image/svg+xml"===e.mimeType||e.isCss)continue;if(!e.naturalDimensions)continue;const r=e.naturalDimensions.height,a=e.naturalDimensions.width;if(!a||!r)continue;const o=UsesResponsiveImages$1.computeWaste({...e,naturalHeight:r,naturalWidth:a},n,t);if(!o)continue;const s=i.get(o.url);(!s||s.wastedBytes>o.wastedBytes)&&i.set(o.url,o)}return{items:Array.from(i.values()).filter((e=>e.wastedBytes>4096)),headings:[{key:"node",valueType:"node",label:""},{key:"url",valueType:"url",label:AT(xT.UIStrings.columnURL)},{key:"totalBytes",valueType:"bytes",label:AT(xT.UIStrings.columnResourceSize)},{key:"wastedBytes",valueType:"bytes",label:AT(xT.UIStrings.columnWastedBytes)}]}}}fT.exports=UsesResponsiveImages$1,fT.exports.UIStrings=_T,fT.exports.str_=AT
|
756
|
+
;const RT=kc,kT=fT.exports,DT=ji,CT=oi,IT={title:"Images were appropriate for their displayed size",failureTitle:"Images were larger than their displayed size",columnDisplayedDimensions:"Displayed dimensions",columnActualDimensions:"Actual dimensions"},NT=CT.createMessageInstanceIdFn("lighthouse-core/audits/byte-efficiency/uses-responsive-images-snapshot.js",IT);gT.exports=class UsesResponsiveImagesSnapshot extends RT{static get meta(){return{id:"uses-responsive-images-snapshot",title:NT(IT.title),failureTitle:NT(IT.failureTitle),description:kT.str_(kT.UIStrings.description),supportedModes:["snapshot"],requiredArtifacts:["ImageElements","ViewportDimensions"]}}static async audit(e){let t=1;const r=[];for(const a of e.ImageElements){if(!a.naturalDimensions)continue;const n=a.naturalDimensions,i=kT.getDisplayedDimensions({...a,naturalWidth:n.width,naturalHeight:n.height},e.ViewportDimensions),o=n.width*n.height,s=i.width*i.height;o<=s||(o-s>1365&&(t=0),r.push({
|
757
|
+
node:RT.makeNodeItem(a.node),url:DT.elideDataURI(a.src),displayedDimensions:`${i.width}x${i.height}`,actualDimensions:`${n.width}x${n.height}`}))}const a=[{key:"node",itemType:"node",text:""},{key:"url",itemType:"url",text:NT(CT.UIStrings.columnURL)},{key:"displayedDimensions",itemType:"text",text:NT(IT.columnDisplayedDimensions)},{key:"actualDimensions",itemType:"text",text:NT(IT.columnActualDimensions)}];return{score:t,details:RT.makeTableDetails(a,r)}}},gT.exports.UIStrings=IT;var LT={exports:{}};const MT=Ib,PT=ji,OT=oi,FT={title:"Enable text compression",description:"Text-based resources should be served with compression (gzip, deflate or brotli) to minimize total network bytes. [Learn more](https://web.dev/uses-text-compression/)."},UT=OT.createMessageInstanceIdFn("lighthouse-core/audits/byte-efficiency/uses-text-compression.js",FT);LT.exports=class ResponsesAreCompressed extends MT{static get meta(){return{id:"uses-text-compression",title:UT(FT.title),
|
758
|
+
description:UT(FT.description),scoreDisplayMode:MT.SCORING_MODES.NUMERIC,requiredArtifacts:["ResponseCompression","GatherContext","devtoolsLogs","traces"]}}static audit_(e){const t=e.ResponseCompression,r=[];t.forEach((e=>{if(!e.gzipSize||e.gzipSize<0)return;const t=e.resourceSize,a=e.gzipSize,n=t-a;if(1-a/t<.1||n<1400||e.transferSize<a)return;const i=PT.elideDataURI(e.url);r.find((t=>t.url===i&&t.totalBytes===e.resourceSize))||r.push({url:i,totalBytes:t,wastedBytes:n})}));const a=[{key:"url",valueType:"url",label:UT(OT.UIStrings.columnURL)},{key:"totalBytes",valueType:"bytes",label:UT(OT.UIStrings.columnTransferSize)},{key:"wastedBytes",valueType:"bytes",label:UT(OT.UIStrings.columnWastedBytes)}];return{items:r,headings:a}}},LT.exports.UIStrings=FT;var jT={exports:{}};const BT=kc,$T={title:"Content is sized correctly for the viewport",failureTitle:"Content is not sized correctly for the viewport",
|
759
|
+
description:"If the width of your app's content doesn't match the width of the viewport, your app might not be optimized for mobile screens. [Learn more](https://web.dev/content-width/).",explanation:"The viewport size of {innerWidth}px does not match the window size of {outerWidth}px."},qT=oi.createMessageInstanceIdFn("lighthouse-core/audits/content-width.js",$T);jT.exports=class ContentWidth extends BT{static get meta(){return{id:"content-width",title:qT($T.title),failureTitle:qT($T.failureTitle),description:qT($T.description),requiredArtifacts:["ViewportDimensions"]}}static audit(e,t){const r=e.ViewportDimensions.innerWidth===e.ViewportDimensions.outerWidth;if("desktop"===t.settings.formFactor)return{score:1,notApplicable:!0};let a;return r||(a=qT($T.explanation,{innerWidth:e.ViewportDimensions.innerWidth,outerWidth:e.ViewportDimensions.outerWidth})),{score:Number(r),explanation:a}}},jT.exports.UIStrings=$T;var zT={exports:{}};const VT=Ao,WT=Fo,GT=Lo;var HT=VT(class MainResource$g{
|
760
|
+
static async compute_(e,t){const r=e.URL.finalUrl,a=await GT.request(e.devtoolsLog,t),n=WT.findMainDocument(a,r);if(!n)throw new Error("Unable to identify the main resource");return n}},["URL","devtoolsLog"]);const YT=Ao,KT=Ki,JT=HT,XT=eb;class CriticalRequestChains$2{static isCritical(e,t){if(!t)throw new Error("mainResource not provided");if(e.requestId===t.requestId)return!0;if(e.isLinkPreload)return!1;for(;e.redirectDestination;)e=e.redirectDestination;const r=e.resourceType===KT.TYPES.Document&&e.frameId!==t.frameId;return!([KT.TYPES.Image,KT.TYPES.XHR,KT.TYPES.Fetch,KT.TYPES.EventSource].includes(e.resourceType||"Other")||r||e.mimeType&&e.mimeType.startsWith("image/"))&&(!!e.initiatorRequest&&["VeryHigh","High","Medium"].includes(e.priority))}static extractChainsFromGraph(e,t){const r={};const a=new Set;return t.traverse(((t,n)=>{if(a.add(t),"network"!==t.type)return;if(!CriticalRequestChains$2.isCritical(t.record,e))return
|
761
|
+
;const i=n.filter((e=>"network"===e.type)).reverse().map((e=>e.record));i.some((t=>!CriticalRequestChains$2.isCritical(t,e)))||function addChain(e){let t=r;for(const r of e)t[r.requestId]||(t[r.requestId]={request:r,children:{}}),t=t[r.requestId].children}(i)}),(function getNextNodes(e){return e.getDependents().filter((e=>e.getDependencies().every((e=>a.has(e)))))})),r}static async compute_(e,t){const r=await JT.request({URL:e.URL,devtoolsLog:e.devtoolsLog},t),a=await XT.request({trace:e.trace,devtoolsLog:e.devtoolsLog},t);return CriticalRequestChains$2.extractChainsFromGraph(r,a)}}var ZT=YT(CriticalRequestChains$2,["URL","devtoolsLog","trace"]);const QT=kc,eE=ZT,tE={title:"Avoid chaining critical requests",
|
762
|
+
description:"The Critical Request Chains below show you what resources are loaded with a high priority. Consider reducing the length of chains, reducing the download size of resources, or deferring the download of unnecessary resources to improve page load. [Learn more](https://web.dev/critical-request-chains/).",displayValue:"{itemCount, plural,\n =1 {1 chain found}\n other {# chains found}\n }"},rE=oi.createMessageInstanceIdFn("lighthouse-core/audits/critical-request-chains.js",tE);class CriticalRequestChains$1 extends QT{static get meta(){return{id:"critical-request-chains",title:rE(tE.title),description:rE(tE.description),scoreDisplayMode:QT.SCORING_MODES.INFORMATIVE,supportedModes:["navigation"],requiredArtifacts:["traces","devtoolsLogs","URL"]}}static _traverse(e,t){!function walk(e,r,a,n=0){const i=Object.keys(e);0!==i.length&&i.forEach((i=>{const o=e[i];a||(a=o.request.startTime),t({depth:r,id:i,node:o,chainDuration:1e3*(o.request.endTime-a),
|
763
|
+
chainTransferSize:n+o.request.transferSize}),o.children&&walk(o.children,r+1,a)}),"")}(e,0)}static _getLongestChain(e){const t={duration:0,length:0,transferSize:0};return CriticalRequestChains$1._traverse(e,(e=>{const r=e.chainDuration;r>t.duration&&(t.duration=r,t.transferSize=e.chainTransferSize,t.length=e.depth)})),t.length++,t}static flattenRequests(e){const t={},r=new Map;return CriticalRequestChains$1._traverse(e,(function flatten(e){const a=e.node.request,n={url:a.url,startTime:a.startTime,endTime:a.endTime,responseReceivedTime:a.responseReceivedTime,transferSize:a.transferSize};let i=r.get(e.id);if(i?i.request=n:(i={request:n},t[e.id]=i),e.node.children)for(const t of Object.keys(e.node.children)){const e={request:{}};r.set(t,e),i.children||(i.children={}),i.children[t]=e}r.set(e.id,i)})),t}static audit(e,t){const r=e.traces[QT.DEFAULT_PASS],a=e.devtoolsLogs[QT.DEFAULT_PASS],n=e.URL;return eE.request({devtoolsLog:a,trace:r,URL:n},t).then((e=>{let t=0
|
764
|
+
;const r=CriticalRequestChains$1.flattenRequests(e),a=Object.keys(r)[0],n=a&&r[a].children;n&&Object.keys(n).length>0&&function walk(e,r){Object.keys(e).forEach((r=>{const a=e[r];a.children?walk(a.children):t++}),"")}(n);const i=CriticalRequestChains$1._getLongestChain(r);return{score:Number(0===t),notApplicable:0===t,displayValue:t?rE(tE.displayValue,{itemCount:t}):"",details:{type:"criticalrequestchain",chains:r,longestChain:i}}}))}}zT.exports=CriticalRequestChains$1,zT.exports.UIStrings=tE;var aE={exports:{}},nE={},iE={},oE={},sE={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Type=e.Severity=e.Finding=void 0;class Finding{constructor(e,t,r,a,n){this.type=e,this.description=t,this.severity=r,this.directive=a,this.value=n}static getHighestSeverity(e){if(0===e.length)return t.NONE;return e.map((e=>e.severity)).reduce(((e,t)=>e<t?e:t),t.NONE)}equals(e){
|
763
765
|
return e instanceof Finding&&(e.type===this.type&&e.description===this.description&&e.severity===this.severity&&e.directive===this.directive&&e.value===this.value)}}var t;e.Finding=Finding,function(e){e[e.HIGH=10]="HIGH",e[e.SYNTAX=20]="SYNTAX",e[e.MEDIUM=30]="MEDIUM",e[e.HIGH_MAYBE=40]="HIGH_MAYBE",e[e.STRICT_CSP=45]="STRICT_CSP",e[e.MEDIUM_MAYBE=50]="MEDIUM_MAYBE",e[e.INFO=60]="INFO",e[e.NONE=100]="NONE"}(t=e.Severity||(e.Severity={})),function(e){e[e.MISSING_SEMICOLON=100]="MISSING_SEMICOLON",e[e.UNKNOWN_DIRECTIVE=101]="UNKNOWN_DIRECTIVE",e[e.INVALID_KEYWORD=102]="INVALID_KEYWORD",e[e.NONCE_CHARSET=106]="NONCE_CHARSET",e[e.MISSING_DIRECTIVES=300]="MISSING_DIRECTIVES",e[e.SCRIPT_UNSAFE_INLINE=301]="SCRIPT_UNSAFE_INLINE",e[e.SCRIPT_UNSAFE_EVAL=302]="SCRIPT_UNSAFE_EVAL",e[e.PLAIN_URL_SCHEMES=303]="PLAIN_URL_SCHEMES",e[e.PLAIN_WILDCARD=304]="PLAIN_WILDCARD",e[e.SCRIPT_ALLOWLIST_BYPASS=305]="SCRIPT_ALLOWLIST_BYPASS",e[e.OBJECT_ALLOWLIST_BYPASS=306]="OBJECT_ALLOWLIST_BYPASS",
|
764
|
-
e[e.NONCE_LENGTH=307]="NONCE_LENGTH",e[e.IP_SOURCE=308]="IP_SOURCE",e[e.DEPRECATED_DIRECTIVE=309]="DEPRECATED_DIRECTIVE",e[e.SRC_HTTP=310]="SRC_HTTP",e[e.STRICT_DYNAMIC=400]="STRICT_DYNAMIC",e[e.STRICT_DYNAMIC_NOT_STANDALONE=401]="STRICT_DYNAMIC_NOT_STANDALONE",e[e.NONCE_HASH=402]="NONCE_HASH",e[e.UNSAFE_INLINE_FALLBACK=403]="UNSAFE_INLINE_FALLBACK",e[e.ALLOWLIST_FALLBACK=404]="ALLOWLIST_FALLBACK",e[e.IGNORED=405]="IGNORED",e[e.REQUIRE_TRUSTED_TYPES_FOR_SCRIPTS=500]="REQUIRE_TRUSTED_TYPES_FOR_SCRIPTS",e[e.REPORTING_DESTINATION_MISSING=600]="REPORTING_DESTINATION_MISSING",e[e.REPORT_TO_ONLY=601]="REPORT_TO_ONLY"}(e.Type||(e.Type={}))}(
|
766
|
+
e[e.NONCE_LENGTH=307]="NONCE_LENGTH",e[e.IP_SOURCE=308]="IP_SOURCE",e[e.DEPRECATED_DIRECTIVE=309]="DEPRECATED_DIRECTIVE",e[e.SRC_HTTP=310]="SRC_HTTP",e[e.STRICT_DYNAMIC=400]="STRICT_DYNAMIC",e[e.STRICT_DYNAMIC_NOT_STANDALONE=401]="STRICT_DYNAMIC_NOT_STANDALONE",e[e.NONCE_HASH=402]="NONCE_HASH",e[e.UNSAFE_INLINE_FALLBACK=403]="UNSAFE_INLINE_FALLBACK",e[e.ALLOWLIST_FALLBACK=404]="ALLOWLIST_FALLBACK",e[e.IGNORED=405]="IGNORED",e[e.REQUIRE_TRUSTED_TYPES_FOR_SCRIPTS=500]="REQUIRE_TRUSTED_TYPES_FOR_SCRIPTS",e[e.REPORTING_DESTINATION_MISSING=600]="REPORTING_DESTINATION_MISSING",e[e.REPORT_TO_ONLY=601]="REPORT_TO_ONLY"}(e.Type||(e.Type={}))}(sE),function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CspError=e.isHash=e.HASH_PATTERN=e.STRICT_HASH_PATTERN=e.isNonce=e.NONCE_PATTERN=e.STRICT_NONCE_PATTERN=e.isUrlScheme=e.isKeyword=e.isDirective=e.Version=e.FETCH_DIRECTIVES=e.Directive=e.TrustedTypesSink=e.Keyword=e.Csp=void 0;const t=sE;class Csp{constructor(){this.directives={}}clone(){
|
765
767
|
const e=new Csp;for(const[t,r]of Object.entries(this.directives))r&&(e.directives[t]=[...r]);return e}convertToString(){let e="";for(const[t,r]of Object.entries(this.directives)){if(e+=t,void 0!==r)for(let t,a=0;t=r[a];a++)e+=" ",e+=t;e+="; "}return e}getEffectiveCsp(e,i){const o=i||[],s=this.clone(),c=s.getEffectiveDirective(a.SCRIPT_SRC),l=this.directives[c]||[],u=s.directives[c];if(u&&(s.policyHasScriptNonces()||s.policyHasScriptHashes()))if(e>=n.CSP2)l.includes(r.UNSAFE_INLINE)&&(arrayRemove(u,r.UNSAFE_INLINE),o.push(new t.Finding(t.Type.IGNORED,"unsafe-inline is ignored if a nonce or a hash is present. (CSP2 and above)",t.Severity.NONE,c,r.UNSAFE_INLINE)));else for(const e of l)(e.startsWith("'nonce-")||e.startsWith("'sha"))&&arrayRemove(u,e);if(u&&this.policyHasStrictDynamic())if(e>=n.CSP3)for(const e of l)e.startsWith("'")&&e!==r.SELF&&e!==r.UNSAFE_INLINE||(arrayRemove(u,e),
|
766
768
|
o.push(new t.Finding(t.Type.IGNORED,"Because of strict-dynamic this entry is ignored in CSP3 and above",t.Severity.NONE,c,e)));else arrayRemove(u,r.STRICT_DYNAMIC);return e<n.CSP3&&(delete s.directives[a.REPORT_TO],delete s.directives[a.WORKER_SRC],delete s.directives[a.MANIFEST_SRC],delete s.directives[a.TRUSTED_TYPES],delete s.directives[a.REQUIRE_TRUSTED_TYPES_FOR]),s}getEffectiveDirective(t){return!(t in this.directives)&&e.FETCH_DIRECTIVES.includes(t)?a.DEFAULT_SRC:t}getEffectiveDirectives(e){return[...new Set(e.map((e=>this.getEffectiveDirective(e))))]}policyHasScriptNonces(){const e=this.getEffectiveDirective(a.SCRIPT_SRC);return(this.directives[e]||[]).some((e=>isNonce(e)))}policyHasScriptHashes(){const e=this.getEffectiveDirective(a.SCRIPT_SRC);return(this.directives[e]||[]).some((e=>isHash(e)))}policyHasStrictDynamic(){const e=this.getEffectiveDirective(a.SCRIPT_SRC);return(this.directives[e]||[]).includes(r.STRICT_DYNAMIC)}}var r,a,n;function isNonce(t,r){
|
767
769
|
return(r?e.STRICT_NONCE_PATTERN:e.NONCE_PATTERN).test(t)}function isHash(t,r){return(r?e.STRICT_HASH_PATTERN:e.HASH_PATTERN).test(t)}e.Csp=Csp,function(e){e.SELF="'self'",e.NONE="'none'",e.UNSAFE_INLINE="'unsafe-inline'",e.UNSAFE_EVAL="'unsafe-eval'",e.WASM_EVAL="'wasm-eval'",e.WASM_UNSAFE_EVAL="'wasm-unsafe-eval'",e.STRICT_DYNAMIC="'strict-dynamic'",e.UNSAFE_HASHED_ATTRIBUTES="'unsafe-hashed-attributes'",e.UNSAFE_HASHES="'unsafe-hashes'",e.REPORT_SAMPLE="'report-sample'"}(r=e.Keyword||(e.Keyword={})),(e.TrustedTypesSink||(e.TrustedTypesSink={})).SCRIPT="'script'",function(e){e.CHILD_SRC="child-src",e.CONNECT_SRC="connect-src",e.DEFAULT_SRC="default-src",e.FONT_SRC="font-src",e.FRAME_SRC="frame-src",e.IMG_SRC="img-src",e.MEDIA_SRC="media-src",e.OBJECT_SRC="object-src",e.SCRIPT_SRC="script-src",e.SCRIPT_SRC_ATTR="script-src-attr",e.SCRIPT_SRC_ELEM="script-src-elem",e.STYLE_SRC="style-src",e.STYLE_SRC_ATTR="style-src-attr",e.STYLE_SRC_ELEM="style-src-elem",e.PREFETCH_SRC="prefetch-src",
|
768
770
|
e.MANIFEST_SRC="manifest-src",e.WORKER_SRC="worker-src",e.BASE_URI="base-uri",e.PLUGIN_TYPES="plugin-types",e.SANDBOX="sandbox",e.DISOWN_OPENER="disown-opener",e.FORM_ACTION="form-action",e.FRAME_ANCESTORS="frame-ancestors",e.REPORT_TO="report-to",e.REPORT_URI="report-uri",e.BLOCK_ALL_MIXED_CONTENT="block-all-mixed-content",e.UPGRADE_INSECURE_REQUESTS="upgrade-insecure-requests",e.REFLECTED_XSS="reflected-xss",e.REFERRER="referrer",e.REQUIRE_SRI_FOR="require-sri-for",e.TRUSTED_TYPES="trusted-types",e.REQUIRE_TRUSTED_TYPES_FOR="require-trusted-types-for"}(a=e.Directive||(e.Directive={})),e.FETCH_DIRECTIVES=[a.CHILD_SRC,a.CONNECT_SRC,a.DEFAULT_SRC,a.FONT_SRC,a.FRAME_SRC,a.IMG_SRC,a.MANIFEST_SRC,a.MEDIA_SRC,a.OBJECT_SRC,a.SCRIPT_SRC,a.SCRIPT_SRC_ATTR,a.SCRIPT_SRC_ELEM,a.STYLE_SRC,a.STYLE_SRC_ATTR,a.STYLE_SRC_ELEM,a.WORKER_SRC],function(e){e[e.CSP1=1]="CSP1",e[e.CSP2=2]="CSP2",e[e.CSP3=3]="CSP3"}(n=e.Version||(e.Version={})),e.isDirective=function isDirective(e){
|
769
|
-
return Object.values(a).includes(e)},e.isKeyword=function isKeyword(e){return Object.values(r).includes(e)},e.isUrlScheme=function isUrlScheme(e){return new RegExp("^[a-zA-Z][+a-zA-Z0-9.-]*:$").test(e)},e.STRICT_NONCE_PATTERN=new RegExp("^'nonce-[a-zA-Z0-9+/_-]+[=]{0,2}'$"),e.NONCE_PATTERN=new RegExp("^'nonce-(.+)'$"),e.isNonce=isNonce,e.STRICT_HASH_PATTERN=new RegExp("^'(sha256|sha384|sha512)-[a-zA-Z0-9+/]+[=]{0,2}'$"),e.HASH_PATTERN=new RegExp("^'(sha256|sha384|sha512)-(.+)'$"),e.isHash=isHash;class CspError extends Error{constructor(e){super(e)}}function arrayRemove(e,t){if(e.includes(t)){const r=e.findIndex((e=>t===e));e.splice(r,1)}}e.CspError=CspError}(
|
770
|
-
enumerable:!0,value:t})}:function(e,t){e.default=t}),
|
771
|
-
;for(const[r,a]of Object.entries(e.directives))if(void 0!==a)for(const e of a)
|
772
|
-
;t.push(new
|
773
|
-
|
774
|
-
;var
|
775
|
-
|
776
|
-
;var
|
777
|
-
if(!e.pathname.startsWith(s))continue}else if(e.pathname!==s)continue;return e}}return null},
|
778
|
-
e.checkHasConfiguredReporting=e.checkSrcHttp=e.checkNonceLength=e.checkDeprecatedDirective=e.checkIpSource=e.looksLikeIpAddress=e.checkFlashObjectAllowlistBypass=e.checkScriptAllowlistBypass=e.checkMissingDirectives=e.checkMultipleMissingBaseUriDirective=e.checkMissingBaseUriDirective=e.checkMissingScriptSrcDirective=e.checkMissingObjectSrcDirective=e.checkWildcards=e.checkPlainUrlSchemes=e.checkScriptUnsafeEval=e.checkScriptUnsafeInline=e.URL_SCHEMES_CAUSING_XSS=e.DIRECTIVES_CAUSING_XSS=void 0;const n=a(
|
771
|
+
return Object.values(a).includes(e)},e.isKeyword=function isKeyword(e){return Object.values(r).includes(e)},e.isUrlScheme=function isUrlScheme(e){return new RegExp("^[a-zA-Z][+a-zA-Z0-9.-]*:$").test(e)},e.STRICT_NONCE_PATTERN=new RegExp("^'nonce-[a-zA-Z0-9+/_-]+[=]{0,2}'$"),e.NONCE_PATTERN=new RegExp("^'nonce-(.+)'$"),e.isNonce=isNonce,e.STRICT_HASH_PATTERN=new RegExp("^'(sha256|sha384|sha512)-[a-zA-Z0-9+/]+[=]{0,2}'$"),e.HASH_PATTERN=new RegExp("^'(sha256|sha384|sha512)-(.+)'$"),e.isHash=isHash;class CspError extends Error{constructor(e){super(e)}}function arrayRemove(e,t){if(e.includes(t)){const r=e.findIndex((e=>t===e));e.splice(r,1)}}e.CspError=CspError}(oE);var cE=globalThis&&globalThis.__createBinding||(Object.create?function(e,t,r,a){void 0===a&&(a=r),Object.defineProperty(e,a,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,a){void 0===a&&(a=r),e[a]=t[r]}),lE=globalThis&&globalThis.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{
|
772
|
+
enumerable:!0,value:t})}:function(e,t){e.default=t}),uE=globalThis&&globalThis.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&cE(t,e,r);return lE(t,e),t};Object.defineProperty(iE,"__esModule",{value:!0}),iE.checkInvalidKeyword=iE.checkMissingSemicolon=iE.checkUnknownDirective=void 0;const dE=uE(oE),mE=oE,pE=sE;iE.checkUnknownDirective=function checkUnknownDirective(e){const t=[];for(const r of Object.keys(e.directives))dE.isDirective(r)||(r.endsWith(":")?t.push(new pE.Finding(pE.Type.UNKNOWN_DIRECTIVE,"CSP directives don't end with a colon.",pE.Severity.SYNTAX,r)):t.push(new pE.Finding(pE.Type.UNKNOWN_DIRECTIVE,'Directive "'+r+'" is not a known CSP directive.',pE.Severity.SYNTAX,r)));return t},iE.checkMissingSemicolon=function checkMissingSemicolon(e){const t=[]
|
773
|
+
;for(const[r,a]of Object.entries(e.directives))if(void 0!==a)for(const e of a)dE.isDirective(e)&&t.push(new pE.Finding(pE.Type.MISSING_SEMICOLON,'Did you forget the semicolon? "'+e+'" seems to be a directive, not a value.',pE.Severity.SYNTAX,r,e));return t},iE.checkInvalidKeyword=function checkInvalidKeyword(e){const t=[],r=Object.values(mE.Keyword).map((e=>e.replace(/'/g,"")));for(const[a,n]of Object.entries(e.directives))if(void 0!==n)for(const e of n)if(r.some((t=>t===e))||e.startsWith("nonce-")||e.match(/^(sha256|sha384|sha512)-/))t.push(new pE.Finding(pE.Type.INVALID_KEYWORD,'Did you forget to surround "'+e+'" with single-ticks?',pE.Severity.SYNTAX,a,e));else if(e.startsWith("'")){if(a===dE.Directive.REQUIRE_TRUSTED_TYPES_FOR){if(e===dE.TrustedTypesSink.SCRIPT)continue}else if(a===dE.Directive.TRUSTED_TYPES){if("'allow-duplicates'"===e||"'none'"===e)continue}else if(dE.isKeyword(e)||dE.isHash(e)||dE.isNonce(e))continue
|
774
|
+
;t.push(new pE.Finding(pE.Type.INVALID_KEYWORD,e+" seems to be an invalid CSP keyword.",pE.Severity.SYNTAX,a,e))}return t};var hE={},gE={};Object.defineProperty(gE,"__esModule",{value:!0}),gE.URLS=void 0,
|
775
|
+
gE.URLS=["//gstatic.com/fsn/angular_js-bundle1.js","//www.gstatic.com/fsn/angular_js-bundle1.js","//www.googleadservices.com/pageadimg/imgad","//yandex.st/angularjs/1.2.16/angular-cookies.min.js","//yastatic.net/angularjs/1.2.23/angular.min.js","//yuedust.yuedu.126.net/js/components/angular/angular.js","//art.jobs.netease.com/script/angular.js","//csu-c45.kxcdn.com/angular/angular.js","//elysiumwebsite.s3.amazonaws.com/uploads/blog-media/rockstar/angular.min.js","//inno.blob.core.windows.net/new/libs/AngularJS/1.2.1/angular.min.js","//gift-talk.kakao.com/public/javascripts/angular.min.js","//ajax.googleapis.com/ajax/libs/angularjs/1.2.0rc1/angular-route.min.js","//master-sumok.ru/vendors/angular/angular-cookies.js","//ayicommon-a.akamaihd.net/static/vendor/angular-1.4.2.min.js","//pangxiehaitao.com/framework/angular-1.3.9/angular-animate.min.js","//cdnjs.cloudflare.com/ajax/libs/angular.js/1.2.16/angular.min.js","//96fe3ee995e96e922b6b-d10c35bd0a0de2c718b252bc575fdb73.ssl.cf1.rackcdn.com/angular.js","//oss.maxcdn.com/angularjs/1.2.20/angular.min.js","//reports.zemanta.com/smedia/common/angularjs/1.2.11/angular.js","//cdn.shopify.com/s/files/1/0225/6463/t/1/assets/angular-animate.min.js","//parademanagement.com.s3-website-ap-southeast-1.amazonaws.com/js/angular.min.js","//cdn.jsdelivr.net/angularjs/1.1.2/angular.min.js","//eb2883ede55c53e09fd5-9c145fb03d93709ea57875d307e2d82e.ssl.cf3.rackcdn.com/components/angular-resource.min.js","//andors-trail.googlecode.com/git/AndorsTrailEdit/lib/angular.min.js","//cdn.walkme.com/General/EnvironmentTests/angular/angular.min.js","//laundrymail.com/angular/angular.js","//s3-eu-west-1.amazonaws.com/staticancpa/js/angular-cookies.min.js","//collade.demo.stswp.com/js/vendor/angular.min.js","//mrfishie.github.io/sailor/bower_components/angular/angular.min.js","//askgithub.com/static/js/angular.min.js","//services.amazon.com/solution-providers/assets/vendor/angular-cookies.min.js","//raw.githubusercontent.com/angular/code.angularjs.org/master/1.0.7/angular-resource.js","//prb-resume.appspot.com/bower_components/angular-animate/angular-animate.js","//dl.dropboxusercontent.com/u/30877786/angular.min.js","//static.tumblr.com/x5qdx0r/nPOnngtff/angular-resource.min_1_.js","//storage.googleapis.com/assets-prod.urbansitter.net/us-sym/assets/vendor/angular-sanitize/angular-sanitize.min.js","//twitter.github.io/labella.js/bower_components/angular/angular.min.js","//cdn2-casinoroom.global.ssl.fastly.net/js/lib/angular-animate.min.js","//www.adobe.com/devnet-apps/flashshowcase/lib/angular/angular.1.1.5.min.js","//eternal-sunset.herokuapp.com/bower_components/angular/angular.js","//cdn.bootcss.com/angular.js/1.2.0/angular.min.js"]
|
776
|
+
;var fE={};Object.defineProperty(fE,"__esModule",{value:!0}),fE.URLS=void 0,fE.URLS=["//vk.com/swf/video.swf","//ajax.googleapis.com/ajax/libs/yui/2.8.0r4/build/charts/assets/charts.swf"];var yE={};Object.defineProperty(yE,"__esModule",{value:!0}),yE.URLS=yE.NEEDS_EVAL=void 0,yE.NEEDS_EVAL=["googletagmanager.com","www.googletagmanager.com","www.googleadservices.com","google-analytics.com","ssl.google-analytics.com","www.google-analytics.com"],
|
777
|
+
yE.URLS=["//bebezoo.1688.com/fragment/index.htm","//www.google-analytics.com/gtm/js","//googleads.g.doubleclick.net/pagead/conversion/1036918760/wcm","//www.googleadservices.com/pagead/conversion/1070110417/wcm","//www.google.com/tools/feedback/escalation-options","//pin.aliyun.com/check_audio","//offer.alibaba.com/market/CID100002954/5/fetchKeyword.do","//ccrprod.alipay.com/ccr/arriveTime.json","//group.aliexpress.com/ajaxAcquireGroupbuyProduct.do","//detector.alicdn.com/2.7.3/index.php","//suggest.taobao.com/sug","//translate.google.com/translate_a/l","//count.tbcdn.cn//counter3","//wb.amap.com/channel.php","//translate.googleapis.com/translate_a/l","//afpeng.alimama.com/ex","//accounts.google.com/o/oauth2/revoke","//pagead2.googlesyndication.com/relatedsearch","//yandex.ru/soft/browsers/check","//api.facebook.com/restserver.php","//mts0.googleapis.com/maps/vt","//syndication.twitter.com/widgets/timelines/765840589183213568","//www.youtube.com/profile_style","//googletagmanager.com/gtm/js","//mc.yandex.ru/watch/24306916/1","//share.yandex.net/counter/gpp/","//ok.go.mail.ru/lady_on_lady_recipes_r.json","//d1f69o4buvlrj5.cloudfront.net/__efa_15_1_ornpba.xekq.arg/optout_check","//www.googletagmanager.com/gtm/js","//api.vk.com/method/wall.get","//www.sharethis.com/get-publisher-info.php","//google.ru/maps/vt","//pro.netrox.sc/oapi/h_checksite.ashx","//vimeo.com/api/oembed.json/","//de.blog.newrelic.com/wp-admin/admin-ajax.php","//ajax.googleapis.com/ajax/services/search/news","//ssl.google-analytics.com/gtm/js","//pubsub.pubnub.com/subscribe/demo/hello_world/","//pass.yandex.ua/services","//id.rambler.ru/script/topline_info.js","//m.addthis.com/live/red_lojson/100eng.json","//passport.ngs.ru/ajax/check","//catalog.api.2gis.ru/ads/search","//gum.criteo.com/sync","//maps.google.com/maps/vt","//ynuf.alipay.com/service/um.json","//securepubads.g.doubleclick.net/gampad/ads","//c.tiles.mapbox.com/v3/texastribune.tx-congress-cvap/6/15/26.grid.json","//rexchange.begun.ru/banners","//an.yandex.ru/page/147484","//links.services.disqus.com/api/ping","//api.map.baidu.com/","//tj.gongchang.com/api/keywordrecomm/","//data.gongchang.com/livegrail/","//ulogin.ru/token.php","//beta.gismeteo.ru/api/informer/layout.js/120x240-3/ru/","//maps.googleapis.com/maps/api/js/GeoPhotoService.GetMetadata","//a.config.skype.com/config/v1/Skype/908_1.33.0.111/SkypePersonalization","//maps.beeline.ru/w","//target.ukr.net/","//www.meteoprog.ua/data/weather/informer/Poltava.js","//cdn.syndication.twimg.com/widgets/timelines/599200054310604802","//wslocker.ru/client/user.chk.php","//community.adobe.com/CommunityPod/getJSON","//maps.google.lv/maps/vt","//dev.virtualearth.net/REST/V1/Imagery/Metadata/AerialWithLabels/26.318581","//awaps.yandex.ru/10/8938/02400400.","//a248.e.akamai.net/h5.hulu.com/h5.mp4","//nominatim.openstreetmap.org/","//plugins.mozilla.org/en-us/plugins_list.json","//h.cackle.me/widget/32153/bootstrap","//graph.facebook.com/1/","//fellowes.ugc.bazaarvoice.com/data/reviews.json","//widgets.pinterest.com/v3/pidgets/boards/ciciwin/hedgehog-squirrel-crafts/pins/","//appcenter.intuit.com/Account/LogoutJSONP","//www.linkedin.com/countserv/count/share","//se.wikipedia.org/w/api.php","//cse.google.com/api/007627024705277327428/cse/r3vs7b0fcli/queries/js","//relap.io/api/v2/similar_pages_jsonp.js","//c1n3.hypercomments.com/stream/subscribe","//maps.google.de/maps/vt","//books.google.com/books","//connect.mail.ru/share_count","//tr.indeed.com/m/newjobs","//www-onepick-opensocial.googleusercontent.com/gadgets/proxy","//www.panoramio.com/map/get_panoramas.php","//client.siteheart.com/streamcli/client","//www.facebook.com/restserver.php","//autocomplete.travelpayouts.com/avia","//www.googleapis.com/freebase/v1/topic/m/0344_","//mts1.googleapis.com/mapslt/ft","//api.twitter.com/1/statuses/oembed.json","//fast.wistia.com/embed/medias/o75jtw7654.json","//partner.googleadservices.com/gampad/ads","//pass.yandex.ru/services","//gupiao.baidu.com/stocks/stockbets","//widget.admitad.com/widget/init","//api.instagram.com/v1/tags/partykungen23328/media/recent","//video.media.yql.yahoo.com/v1/video/sapi/streams/063fb76c-6c70-38c5-9bbc-04b7c384de2b","//ib.adnxs.com/jpt","//pass.yandex.com/services","//www.google.de/maps/vt","//clients1.google.com/complete/search","//api.userlike.com/api/chat/slot/proactive/","//www.youku.com/index_cookielist/s/jsonp","//mt1.googleapis.com/mapslt/ft","//api.mixpanel.com/track/","//wpd.b.qq.com/cgi/get_sign.php","//pipes.yahooapis.com/pipes/pipe.run","//gdata.youtube.com/feeds/api/videos/WsJIHN1kNWc","//9.chart.apis.google.com/chart","//cdn.syndication.twitter.com/moments/709229296800440320","//api.flickr.com/services/feeds/photos_friends.gne","//cbks0.googleapis.com/cbk","//www.blogger.com/feeds/5578653387562324002/posts/summary/4427562025302749269","//query.yahooapis.com/v1/public/yql","//kecngantang.blogspot.com/feeds/posts/default/-/Komik","//www.travelpayouts.com/widgets/50f53ce9ada1b54bcc000031.json","//i.cackle.me/widget/32586/bootstrap","//translate.yandex.net/api/v1.5/tr.json/detect","//a.tiles.mapbox.com/v3/zentralmedia.map-n2raeauc.jsonp","//maps.google.ru/maps/vt","//c1n2.hypercomments.com/stream/subscribe","//rec.ydf.yandex.ru/cookie","//cdn.jsdelivr.net"]
|
778
|
+
;var vE={};function getSchemeFreeUrl(e){return e=(e=e.replace(/^\w[+\w.-]*:\/\//i,"")).replace(/^\/\//,"")}function setScheme(e){return e.startsWith("//")?e.replace("//","https://"):e}Object.defineProperty(vE,"__esModule",{value:!0}),vE.applyCheckFunktionToDirectives=vE.matchWildcardUrls=vE.getHostname=vE.getSchemeFreeUrl=void 0,vE.getSchemeFreeUrl=getSchemeFreeUrl,vE.getHostname=function getHostname(e){const t=new URL("https://"+getSchemeFreeUrl(e).replace("*","wildcard_placeholder")).hostname.replace("wildcard_placeholder","*"),r=/^\[[\d:]+\]/;return getSchemeFreeUrl(e).match(r)&&!t.match(r)?"["+t+"]":t},vE.matchWildcardUrls=function matchWildcardUrls(e,t){const r=new URL(setScheme(e.replace("*","wildcard_placeholder"))),a=t.map((e=>new URL(setScheme(e)))),n=r.hostname.toLowerCase(),i=n.startsWith("wildcard_placeholder."),o=n.replace(/^\wildcard_placeholder/i,""),s=r.pathname,c="/"!==s;for(const e of a){const t=e.hostname;if(t.endsWith(o)&&(i||n===t)){if(c)if(s.endsWith("/")){
|
779
|
+
if(!e.pathname.startsWith(s))continue}else if(e.pathname!==s)continue;return e}}return null},vE.applyCheckFunktionToDirectives=function applyCheckFunktionToDirectives(e,t){const r=Object.keys(e.directives);for(const a of r){const r=e.directives[a];r&&t(a,r)}},function(e){var t=this&&this.__createBinding||(Object.create?function(e,t,r,a){void 0===a&&(a=r),Object.defineProperty(e,a,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,a){void 0===a&&(a=r),e[a]=t[r]}),r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var a={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&t(a,e,n);return r(a,e),a};Object.defineProperty(e,"__esModule",{value:!0}),
|
780
|
+
e.checkHasConfiguredReporting=e.checkSrcHttp=e.checkNonceLength=e.checkDeprecatedDirective=e.checkIpSource=e.looksLikeIpAddress=e.checkFlashObjectAllowlistBypass=e.checkScriptAllowlistBypass=e.checkMissingDirectives=e.checkMultipleMissingBaseUriDirective=e.checkMissingBaseUriDirective=e.checkMissingScriptSrcDirective=e.checkMissingObjectSrcDirective=e.checkWildcards=e.checkPlainUrlSchemes=e.checkScriptUnsafeEval=e.checkScriptUnsafeInline=e.URL_SCHEMES_CAUSING_XSS=e.DIRECTIVES_CAUSING_XSS=void 0;const n=a(gE),i=a(fE),o=a(yE),s=a(oE),c=oE,l=sE,u=a(vE);function checkMissingObjectSrcDirective(e){let t=[];return c.Directive.OBJECT_SRC in e.directives?t=e.directives[c.Directive.OBJECT_SRC]:c.Directive.DEFAULT_SRC in e.directives&&(t=e.directives[c.Directive.DEFAULT_SRC]),void 0!==t&&t.length>=1?[]:[new l.Finding(l.Type.MISSING_DIRECTIVES,"Missing object-src allows the injection of plugins which can execute JavaScript. Can you set it to 'none'?",l.Severity.HIGH,c.Directive.OBJECT_SRC)]}
|
779
781
|
function checkMissingScriptSrcDirective(e){return c.Directive.SCRIPT_SRC in e.directives||c.Directive.DEFAULT_SRC in e.directives?[]:[new l.Finding(l.Type.MISSING_DIRECTIVES,"script-src directive is missing.",l.Severity.HIGH,c.Directive.SCRIPT_SRC)]}function checkMissingBaseUriDirective(e){return checkMultipleMissingBaseUriDirective([e])}function checkMultipleMissingBaseUriDirective(e){if(e.some((e=>e.policyHasScriptNonces()||e.policyHasScriptHashes()&&e.policyHasStrictDynamic()))&&!e.some((e=>c.Directive.BASE_URI in e.directives))){const e="Missing base-uri allows the injection of base tags. They can be used to set the base URL for all relative (script) URLs to an attacker controlled domain. Can you set it to 'none' or 'self'?";return[new l.Finding(l.Type.MISSING_DIRECTIVES,e,l.Severity.HIGH,c.Directive.BASE_URI)]}return[]}function looksLikeIpAddress(e){return!(!e.startsWith("[")||!e.endsWith("]"))||!!/^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$/.test(e)}
|
780
782
|
e.DIRECTIVES_CAUSING_XSS=[c.Directive.SCRIPT_SRC,c.Directive.OBJECT_SRC,c.Directive.BASE_URI],e.URL_SCHEMES_CAUSING_XSS=["data:","http:","https:"],e.checkScriptUnsafeInline=function checkScriptUnsafeInline(e){const t=e.getEffectiveDirective(c.Directive.SCRIPT_SRC);return(e.directives[t]||[]).includes(c.Keyword.UNSAFE_INLINE)?[new l.Finding(l.Type.SCRIPT_UNSAFE_INLINE,"'unsafe-inline' allows the execution of unsafe in-page scripts and event handlers.",l.Severity.HIGH,t,c.Keyword.UNSAFE_INLINE)]:[]},e.checkScriptUnsafeEval=function checkScriptUnsafeEval(e){const t=e.getEffectiveDirective(c.Directive.SCRIPT_SRC);return(e.directives[t]||[]).includes(c.Keyword.UNSAFE_EVAL)?[new l.Finding(l.Type.SCRIPT_UNSAFE_EVAL,"'unsafe-eval' allows the execution of code injected into DOM APIs such as eval().",l.Severity.MEDIUM_MAYBE,t,c.Keyword.UNSAFE_EVAL)]:[]},e.checkPlainUrlSchemes=function checkPlainUrlSchemes(t){const r=[],a=t.getEffectiveDirectives(e.DIRECTIVES_CAUSING_XSS);for(const n of a){
|
781
783
|
const a=t.directives[n]||[];for(const t of a)e.URL_SCHEMES_CAUSING_XSS.includes(t)&&r.push(new l.Finding(l.Type.PLAIN_URL_SCHEMES,t+" URI in "+n+" allows the execution of unsafe scripts.",l.Severity.HIGH,n,t))}return r},e.checkWildcards=function checkWildcards(t){const r=[],a=t.getEffectiveDirectives(e.DIRECTIVES_CAUSING_XSS);for(const e of a){const a=t.directives[e]||[];for(const t of a){"*"!==u.getSchemeFreeUrl(t)||r.push(new l.Finding(l.Type.PLAIN_WILDCARD,e+" should not allow '*' as source",l.Severity.HIGH,e,t))}}return r},e.checkMissingObjectSrcDirective=checkMissingObjectSrcDirective,e.checkMissingScriptSrcDirective=checkMissingScriptSrcDirective,e.checkMissingBaseUriDirective=checkMissingBaseUriDirective,e.checkMultipleMissingBaseUriDirective=checkMultipleMissingBaseUriDirective,e.checkMissingDirectives=function checkMissingDirectives(e){return[...checkMissingObjectSrcDirective(e),...checkMissingScriptSrcDirective(e),...checkMissingBaseUriDirective(e)]},
|
@@ -783,21 +785,21 @@ e.checkScriptAllowlistBypass=function checkScriptAllowlistBypass(e){const t=[],r
|
|
783
785
|
}else t.push(new l.Finding(l.Type.SCRIPT_ALLOWLIST_BYPASS,"No bypass found; make sure that this URL doesn't serve JSONP replies or Angular libraries.",l.Severity.MEDIUM_MAYBE,r,e))}return t},e.checkFlashObjectAllowlistBypass=function checkFlashObjectAllowlistBypass(e){const t=[],r=e.getEffectiveDirective(c.Directive.OBJECT_SRC),a=e.directives[r]||[],n=e.directives[c.Directive.PLUGIN_TYPES];if(n&&!n.includes("application/x-shockwave-flash"))return[];for(const e of a){if(e===c.Keyword.NONE)return[];const a="//"+u.getSchemeFreeUrl(e),n=u.matchWildcardUrls(a,i.URLS);n?t.push(new l.Finding(l.Type.OBJECT_ALLOWLIST_BYPASS,n.hostname+" is known to host Flash files which allow to bypass this CSP.",l.Severity.HIGH,r,e)):r===c.Directive.OBJECT_SRC&&t.push(new l.Finding(l.Type.OBJECT_ALLOWLIST_BYPASS,"Can you restrict object-src to 'none' only?",l.Severity.MEDIUM_MAYBE,r,e))}return t},e.looksLikeIpAddress=looksLikeIpAddress,e.checkIpSource=function checkIpSource(e){const t=[]
|
784
786
|
;return u.applyCheckFunktionToDirectives(e,((e,r)=>{for(const a of r){const r=u.getHostname(a);looksLikeIpAddress(r)&&("127.0.0.1"===r?t.push(new l.Finding(l.Type.IP_SOURCE,e+" directive allows localhost as source. Please make sure to remove this in production environments.",l.Severity.INFO,e,a)):t.push(new l.Finding(l.Type.IP_SOURCE,e+" directive has an IP-Address as source: "+r+" (will be ignored by browsers!). ",l.Severity.INFO,e,a)))}})),t},e.checkDeprecatedDirective=function checkDeprecatedDirective(e){const t=[];return c.Directive.REFLECTED_XSS in e.directives&&t.push(new l.Finding(l.Type.DEPRECATED_DIRECTIVE,"reflected-xss is deprecated since CSP2. Please, use the X-XSS-Protection header instead.",l.Severity.INFO,c.Directive.REFLECTED_XSS)),c.Directive.REFERRER in e.directives&&t.push(new l.Finding(l.Type.DEPRECATED_DIRECTIVE,"referrer is deprecated since CSP2. Please, use the Referrer-Policy header instead.",l.Severity.INFO,c.Directive.REFERRER)),
|
785
787
|
c.Directive.DISOWN_OPENER in e.directives&&t.push(new l.Finding(l.Type.DEPRECATED_DIRECTIVE,"disown-opener is deprecated since CSP3. Please, use the Cross Origin Opener Policy header instead.",l.Severity.INFO,c.Directive.DISOWN_OPENER)),t},e.checkNonceLength=function checkNonceLength(e){const t=new RegExp("^'nonce-(.+)'$"),r=[];return u.applyCheckFunktionToDirectives(e,((e,a)=>{for(const n of a){const a=n.match(t);if(!a)continue;a[1].length<8&&r.push(new l.Finding(l.Type.NONCE_LENGTH,"Nonces should be at least 8 characters long.",l.Severity.MEDIUM,e,n)),s.isNonce(n,!0)||r.push(new l.Finding(l.Type.NONCE_CHARSET,"Nonces should only use the base64 charset.",l.Severity.INFO,e,n))}})),r},e.checkSrcHttp=function checkSrcHttp(e){const t=[];return u.applyCheckFunktionToDirectives(e,((e,r)=>{for(const a of r){const r=e===c.Directive.REPORT_URI?"Use HTTPS to send violation reports securely.":"Allow only resources downloaded over HTTPS."
|
786
|
-
;a.startsWith("http://")&&t.push(new l.Finding(l.Type.SRC_HTTP,r,l.Severity.MEDIUM,e,a))}})),t},e.checkHasConfiguredReporting=function checkHasConfiguredReporting(e){return(e.directives[c.Directive.REPORT_URI]||[]).length>0?[]:(e.directives[c.Directive.REPORT_TO]||[]).length>0?[new l.Finding(l.Type.REPORT_TO_ONLY,"This CSP policy only provides a reporting destination via the 'report-to' directive. This directive is only supported in Chromium-based browsers so it is recommended to also use a 'report-uri' directive.",l.Severity.INFO,c.Directive.REPORT_TO)]:[new l.Finding(l.Type.REPORTING_DESTINATION_MISSING,"This CSP policy does not configure a reporting destination. This makes it difficult to maintain the CSP policy over time and monitor for any breakages.",l.Severity.INFO,c.Directive.REPORT_URI)]}}(
|
787
|
-
}:function(e,t,r,a){void 0===a&&(a=r),e[a]=t[r]}),
|
788
|
-
;return r.some((e=>!e.startsWith("'")))&&!r.includes(
|
789
|
-
;return(e.directives[t]||[]).includes(
|
790
|
-
;return(e.directives[t]||[]).includes(
|
791
|
-
|
792
|
-
;t.push(e)}return t};var
|
793
|
-
const r=t[e].trim().match(/\S+/g);if(Array.isArray(r)){const e=r[0].toLowerCase();if(e in this.csp.directives)continue;
|
788
|
+
;a.startsWith("http://")&&t.push(new l.Finding(l.Type.SRC_HTTP,r,l.Severity.MEDIUM,e,a))}})),t},e.checkHasConfiguredReporting=function checkHasConfiguredReporting(e){return(e.directives[c.Directive.REPORT_URI]||[]).length>0?[]:(e.directives[c.Directive.REPORT_TO]||[]).length>0?[new l.Finding(l.Type.REPORT_TO_ONLY,"This CSP policy only provides a reporting destination via the 'report-to' directive. This directive is only supported in Chromium-based browsers so it is recommended to also use a 'report-uri' directive.",l.Severity.INFO,c.Directive.REPORT_TO)]:[new l.Finding(l.Type.REPORTING_DESTINATION_MISSING,"This CSP policy does not configure a reporting destination. This makes it difficult to maintain the CSP policy over time and monitor for any breakages.",l.Severity.INFO,c.Directive.REPORT_URI)]}}(hE);var bE={},wE=globalThis&&globalThis.__createBinding||(Object.create?function(e,t,r,a){void 0===a&&(a=r),Object.defineProperty(e,a,{enumerable:!0,get:function(){return t[r]}})
|
789
|
+
}:function(e,t,r,a){void 0===a&&(a=r),e[a]=t[r]}),SE=globalThis&&globalThis.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),TE=globalThis&&globalThis.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&wE(t,e,r);return SE(t,e),t};Object.defineProperty(bE,"__esModule",{value:!0}),bE.checkRequiresTrustedTypesForScripts=bE.checkAllowlistFallback=bE.checkUnsafeInlineFallback=bE.checkStrictDynamicNotStandalone=bE.checkStrictDynamic=void 0;const EE=TE(oE),xE=oE,_E=sE;bE.checkStrictDynamic=function checkStrictDynamic(e){const t=e.getEffectiveDirective(EE.Directive.SCRIPT_SRC),r=e.directives[t]||[]
|
790
|
+
;return r.some((e=>!e.startsWith("'")))&&!r.includes(xE.Keyword.STRICT_DYNAMIC)?[new _E.Finding(_E.Type.STRICT_DYNAMIC,"Host allowlists can frequently be bypassed. Consider using 'strict-dynamic' in combination with CSP nonces or hashes.",_E.Severity.STRICT_CSP,t)]:[]},bE.checkStrictDynamicNotStandalone=function checkStrictDynamicNotStandalone(e){const t=e.getEffectiveDirective(EE.Directive.SCRIPT_SRC);return!(e.directives[t]||[]).includes(xE.Keyword.STRICT_DYNAMIC)||e.policyHasScriptNonces()||e.policyHasScriptHashes()?[]:[new _E.Finding(_E.Type.STRICT_DYNAMIC_NOT_STANDALONE,"'strict-dynamic' without a CSP nonce/hash will block all scripts.",_E.Severity.INFO,t)]},bE.checkUnsafeInlineFallback=function checkUnsafeInlineFallback(e){if(!e.policyHasScriptNonces()&&!e.policyHasScriptHashes())return[];const t=e.getEffectiveDirective(EE.Directive.SCRIPT_SRC)
|
791
|
+
;return(e.directives[t]||[]).includes(xE.Keyword.UNSAFE_INLINE)?[]:[new _E.Finding(_E.Type.UNSAFE_INLINE_FALLBACK,"Consider adding 'unsafe-inline' (ignored by browsers supporting nonces/hashes) to be backward compatible with older browsers.",_E.Severity.STRICT_CSP,t)]},bE.checkAllowlistFallback=function checkAllowlistFallback(e){const t=e.getEffectiveDirective(EE.Directive.SCRIPT_SRC),r=e.directives[t]||[];return r.includes(xE.Keyword.STRICT_DYNAMIC)?r.some((e=>["http:","https:","*"].includes(e)||e.includes(".")))?[]:[new _E.Finding(_E.Type.ALLOWLIST_FALLBACK,"Consider adding https: and http: url schemes (ignored by browsers supporting 'strict-dynamic') to be backward compatible with older browsers.",_E.Severity.STRICT_CSP,t)]:[]},bE.checkRequiresTrustedTypesForScripts=function checkRequiresTrustedTypesForScripts(e){const t=e.getEffectiveDirective(EE.Directive.REQUIRE_TRUSTED_TYPES_FOR)
|
792
|
+
;return(e.directives[t]||[]).includes(EE.TrustedTypesSink.SCRIPT)?[]:[new _E.Finding(_E.Type.REQUIRE_TRUSTED_TYPES_FOR_SCRIPTS,"Consider requiring Trusted Types for scripts to lock down DOM XSS injection sinks. You can do this by adding \"require-trusted-types-for 'script'\" to your policy.",_E.Severity.INFO,EE.Directive.REQUIRE_TRUSTED_TYPES_FOR)]},Object.defineProperty(nE,"__esModule",{value:!0}),nE.evaluateForSyntaxErrors=nE.evaluateForWarnings=nE.evaluateForFailure=void 0;const AE=iE,RE=hE,kE=bE,DE=oE;function arrayContains(e,t){return e.some((e=>e.equals(t)))}function atLeastOnePasses(e,t){const r=[];for(const a of e)r.push(t(a));return function setIntersection(e){const t=[];if(0===e.length)return t;const r=e[0];for(const a of r)e.every((e=>arrayContains(e,a)))&&t.push(a);return t}(r)}function atLeastOneFails(e,t){const r=[];for(const a of e)r.push(t(a));return function setUnion(e){const t=[];for(const r of e)for(const e of r)arrayContains(t,e)||t.push(e);return t}(r)}
|
793
|
+
nE.evaluateForFailure=function evaluateForFailure$1(e){const t=[...atLeastOnePasses(e,RE.checkMissingScriptSrcDirective),...atLeastOnePasses(e,RE.checkMissingObjectSrcDirective),...RE.checkMultipleMissingBaseUriDirective(e)],r=e.map((e=>e.getEffectiveCsp(DE.Version.CSP3))),a=r.filter((e=>{const t=e.getEffectiveDirective(DE.Directive.SCRIPT_SRC);return e.directives[t]}));return[...t,...[...atLeastOnePasses(a,kE.checkStrictDynamic),...atLeastOnePasses(a,RE.checkScriptUnsafeInline),...atLeastOnePasses(r,RE.checkWildcards),...atLeastOnePasses(r,RE.checkPlainUrlSchemes)]]},nE.evaluateForWarnings=function evaluateForWarnings$1(e){return[...atLeastOneFails(e,kE.checkUnsafeInlineFallback),...atLeastOneFails(e,kE.checkAllowlistFallback)]},nE.evaluateForSyntaxErrors=function evaluateForSyntaxErrors$1(e){const t=[];for(const r of e){const e=[...RE.checkNonceLength(r),...AE.checkUnknownDirective(r),...RE.checkDeprecatedDirective(r),...AE.checkMissingSemicolon(r),...AE.checkInvalidKeyword(r)]
|
794
|
+
;t.push(e)}return t};var CE={},IE=globalThis&&globalThis.__createBinding||(Object.create?function(e,t,r,a){void 0===a&&(a=r),Object.defineProperty(e,a,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,a){void 0===a&&(a=r),e[a]=t[r]}),NE=globalThis&&globalThis.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),LE=globalThis&&globalThis.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&IE(t,e,r);return NE(t,e),t};Object.defineProperty(CE,"__esModule",{value:!0}),CE.TEST_ONLY=CE.CspParser=void 0;const ME=LE(oE);function normalizeDirectiveValue(e){const t=(e=e.trim()).toLowerCase();return ME.isKeyword(t)||ME.isUrlScheme(e)?t:e}CE.CspParser=class CspParser$1{constructor(e){this.csp=new ME.Csp,this.parse(e)}parse(e){this.csp=new ME.Csp;const t=e.split(";");for(let e=0;e<t.length;e++){
|
795
|
+
const r=t[e].trim().match(/\S+/g);if(Array.isArray(r)){const e=r[0].toLowerCase();if(e in this.csp.directives)continue;ME.isDirective(e);const t=[];for(let e,a=1;e=r[a];a++)e=normalizeDirectiveValue(e),t.includes(e)||t.push(e);this.csp.directives[e]=t}}return this.csp}},CE.TEST_ONLY={normalizeDirectiveValue};const{evaluateForFailure:PE,evaluateForSyntaxErrors:OE,evaluateForWarnings:FE}=nE,{Type:UE}=sE,{CspParser:jE}=CE,{Directive:BE}=oE,$E=on.default,qE=oi,{isIcuMessage:zE}=Vn,VE={missingBaseUri:"Missing base-uri allows injected <base> tags to set the base URL for all relative URLs (e.g. scripts) to an attacker controlled domain. Consider setting base-uri to 'none' or 'self'.",missingScriptSrc:"script-src directive is missing. This can allow the execution of unsafe scripts.",missingObjectSrc:"Missing object-src allows the injection of plugins that execute unsafe scripts. Consider setting object-src to 'none' if you can.",
|
794
796
|
strictDynamic:"Host allowlists can frequently be bypassed. Consider using CSP nonces or hashes instead, along with 'strict-dynamic' if necessary.",unsafeInline:"'unsafe-inline' allows the execution of unsafe in-page scripts and event handlers. Consider using CSP nonces or hashes to allow scripts individually.",unsafeInlineFallback:"Consider adding 'unsafe-inline' (ignored by browsers supporting nonces/hashes) to be backward compatible with older browsers.",allowlistFallback:"Consider adding https: and http: URL schemes (ignored by browsers supporting 'strict-dynamic') to be backward compatible with older browsers.",reportToOnly:"The reporting destination is only configured via the report-to directive. This directive is only supported in Chromium-based browsers so it is recommended to also use a report-uri directive.",reportingDestinationMissing:"No CSP configures a reporting destination. This makes it difficult to maintain the CSP over time and monitor for any breakages.",
|
795
797
|
nonceLength:"Nonces should be at least 8 characters long.",nonceCharset:"Nonces should use the base64 charset.",missingSemicolon:"Did you forget the semicolon? {keyword} seems to be a directive, not a keyword.",unknownDirective:"Unknown CSP directive.",unknownKeyword:"{keyword} seems to be an invalid keyword.",deprecatedReflectedXSS:"reflected-xss is deprecated since CSP2. Please, use the X-XSS-Protection header instead.",deprecatedReferrer:"referrer is deprecated since CSP2. Please, use the Referrer-Policy header instead.",deprecatedDisownOpener:"disown-opener is deprecated since CSP3. Please, use the Cross-Origin-Opener-Policy header instead.",plainWildcards:"Avoid using plain wildcards ({keyword}) in this directive. Plain wildcards allow scripts to be sourced from an unsafe domain.",plainUrlScheme:"Avoid using plain URL schemes ({keyword}) in this directive. Plain URL schemes allow scripts to be sourced from an unsafe domain."
|
796
|
-
},
|
797
|
-
return new
|
798
|
-
metaTagMessage:"The page contains a CSP defined in a <meta> tag. Consider defining the CSP in an HTTP header if you can.",columnDirective:"Directive",columnSeverity:"Severity",itemSeveritySyntax:"Syntax"},
|
799
|
-
static findingToTableItem(e,t){return{directive:e.directive,description:
|
800
|
-
const{cspHeaders:r,cspMetaTags:a}=await this.getRawCsps(e,t),{score:n,results:i}=this.constructResults(r,a),o=[{key:"description",itemType:"text",subItemsHeading:{key:"description"},text:
|
798
|
+
},WE=qE.createMessageInstanceIdFn("lighthouse-core/lib/csp-evaluator.js",VE),GE={[UE.MISSING_SEMICOLON]:VE.missingSemicolon,[UE.UNKNOWN_DIRECTIVE]:WE(VE.unknownDirective),[UE.INVALID_KEYWORD]:VE.unknownKeyword,[UE.MISSING_DIRECTIVES]:{[BE.BASE_URI]:WE(VE.missingBaseUri),[BE.SCRIPT_SRC]:WE(VE.missingScriptSrc),[BE.OBJECT_SRC]:WE(VE.missingObjectSrc)},[UE.SCRIPT_UNSAFE_INLINE]:WE(VE.unsafeInline),[UE.PLAIN_WILDCARD]:VE.plainWildcards,[UE.PLAIN_URL_SCHEMES]:VE.plainUrlScheme,[UE.NONCE_LENGTH]:WE(VE.nonceLength),[UE.NONCE_CHARSET]:WE(VE.nonceCharset),[UE.DEPRECATED_DIRECTIVE]:{[BE.REFLECTED_XSS]:WE(VE.deprecatedReflectedXSS),[BE.REFERRER]:WE(VE.deprecatedReferrer),[BE.DISOWN_OPENER]:WE(VE.deprecatedDisownOpener)},[UE.STRICT_DYNAMIC]:WE(VE.strictDynamic),[UE.UNSAFE_INLINE_FALLBACK]:WE(VE.unsafeInlineFallback),[UE.ALLOWLIST_FALLBACK]:WE(VE.allowlistFallback),[UE.REPORTING_DESTINATION_MISSING]:WE(VE.reportingDestinationMissing),[UE.REPORT_TO_ONLY]:WE(VE.reportToOnly)};function parseCsp(e){
|
799
|
+
return new jE(e).csp}var HE={getTranslatedDescription:function getTranslatedDescription$1(e){let t=GE[e.type];return t?zE(t)?t:"string"==typeof t?WE(t,{keyword:e.value||""}):(t=t[e.directive],t||($E.warn("CSP Evaluator",`No translation found for description: ${e.description}`),e.description)):($E.warn("CSP Evaluator",`No translation found for description: ${e.description}`),e.description)},evaluateRawCspsForXss:function evaluateRawCspsForXss$1(e){const t=e.map(parseCsp);return{bypasses:PE(t),warnings:FE(t),syntax:OE(t)}},parseCsp,UIStrings:VE};const YE=kc,KE=HT,JE=oi,{evaluateRawCspsForXss:XE,getTranslatedDescription:ZE}=HE,QE={title:"Ensure CSP is effective against XSS attacks",description:"A strong Content Security Policy (CSP) significantly reduces the risk of cross-site scripting (XSS) attacks. [Learn more](https://web.dev/csp-xss/)",noCsp:"No CSP found in enforcement mode",
|
800
|
+
metaTagMessage:"The page contains a CSP defined in a <meta> tag. Consider defining the CSP in an HTTP header if you can.",columnDirective:"Directive",columnSeverity:"Severity",itemSeveritySyntax:"Syntax"},ex=JE.createMessageInstanceIdFn("lighthouse-core/audits/csp-xss.js",QE);aE.exports=class CspXss extends YE{static get meta(){return{id:"csp-xss",scoreDisplayMode:YE.SCORING_MODES.INFORMATIVE,title:ex(QE.title),description:ex(QE.description),requiredArtifacts:["devtoolsLogs","MetaElements","URL"]}}static async getRawCsps(e,t){const r=e.devtoolsLogs[YE.DEFAULT_PASS],a=await KE.request({devtoolsLog:r,URL:e.URL},t),n=e.MetaElements.filter((e=>e.httpEquiv&&"content-security-policy"===e.httpEquiv.toLowerCase())).flatMap((e=>(e.content||"").split(","))).filter((e=>e.replace(/\s/g,"")));return{cspHeaders:a.responseHeaders.filter((e=>"content-security-policy"===e.name.toLowerCase())).flatMap((e=>e.value.split(","))).filter((e=>e.replace(/\s/g,""))),cspMetaTags:n}}
|
801
|
+
static findingToTableItem(e,t){return{directive:e.directive,description:ZE(e),severity:t}}static constructSyntaxResults(e,t){const r=[];for(let a=0;a<e.length;++a){const n=e[a].map((e=>this.findingToTableItem(e)));n.length&&r.push({severity:ex(QE.itemSeveritySyntax),description:{type:"code",value:t[a]},subItems:{type:"subitems",items:n}})}return r}static constructResults(e,t){const r=[...e,...t];if(!r.length)return{score:0,results:[{severity:ex(JE.UIStrings.itemSeverityHigh),description:ex(QE.noCsp),directive:void 0}]};const{bypasses:a,warnings:n,syntax:i}=XE(r),o=[...this.constructSyntaxResults(i,r),...a.map((e=>this.findingToTableItem(e,ex(JE.UIStrings.itemSeverityHigh)))),...n.map((e=>this.findingToTableItem(e,ex(JE.UIStrings.itemSeverityMedium))))];return t.length&&o.push({severity:ex(JE.UIStrings.itemSeverityMedium),description:ex(QE.metaTagMessage),directive:void 0}),{score:a.length?0:1,results:o}}static async audit(e,t){
|
802
|
+
const{cspHeaders:r,cspMetaTags:a}=await this.getRawCsps(e,t),{score:n,results:i}=this.constructResults(r,a),o=[{key:"description",itemType:"text",subItemsHeading:{key:"description"},text:ex(JE.UIStrings.columnDescription)},{key:"directive",itemType:"code",subItemsHeading:{key:"directive"},text:ex(QE.columnDirective)},{key:"severity",itemType:"text",subItemsHeading:{key:"severity"},text:ex(QE.columnSeverity)}],s=YE.makeTableDetails(o,i);return{score:n,notApplicable:!i.length,details:s}}},aE.exports.UIStrings=QE;var tx={exports:{}};const rx=kc,ax=jb,nx=oi,ix={title:"Avoids deprecated APIs",failureTitle:"Uses deprecated APIs",description:"Deprecated APIs will eventually be removed from the browser. [Learn more](https://web.dev/deprecations/).",displayValue:"{itemCount, plural,\n =1 {1 warning found}\n other {# warnings found}\n }",columnDeprecate:"Deprecation / Warning",columnLine:"Line",feature:"Check the feature status page for more details.",
|
801
803
|
milestone:"This change will go into effect with milestone {milestone}.",authorizationCoveredByWildcard:"Authorization will not be covered by the wildcard symbol (*) in CORS `Access-Control-Allow-Headers` handling.",canRequestURLHTTPContainingNewline:"Resource requests whose URLs contained both removed whitespace `(n|r|t)` characters and less-than characters (`<`) are blocked. Please remove newlines and encode less-than characters from places like element attribute values in order to load these resources.",chromeLoadTimesConnectionInfo:"`chrome.loadTimes()` is deprecated, instead use standardized API: Navigation Timing 2.",chromeLoadTimesFirstPaintAfterLoadTime:"`chrome.loadTimes()` is deprecated, instead use standardized API: Paint Timing.",chromeLoadTimesWasAlternateProtocolAvailable:"`chrome.loadTimes()` is deprecated, instead use standardized API: `nextHopProtocol` in Navigation Timing 2.",
|
802
804
|
cookieWithTruncatingChar:"Cookies containing a `(0|r|n)` character will be rejected instead of truncated.",crossOriginAccessBasedOnDocumentDomain:"Relaxing the same-origin policy by setting `document.domain` is deprecated, and will be disabled by default. This deprecation warning is for a cross-origin access that was enabled by setting `document.domain`.",crossOriginWindowAlert:"Triggering `window.alert` from cross origin iframes has been deprecated and will be removed in the future.",crossOriginWindowConfirm:"Triggering `window.confirm` from cross origin iframes has been deprecated and will be removed in the future.",cssSelectorInternalMediaControlsOverlayCastButton:"The `disableRemotePlayback` attribute should be used in order to disable the default Cast integration instead of using `-internal-media-controls-overlay-cast-button` selector.",customCursorIntersectsViewport:"Custom cursors with size greater than 32x32 DIP intersecting native UI is deprecated and will be removed.",
|
803
805
|
documentDomainSettingWithoutOriginAgentClusterHeader:"Relaxing the same-origin policy by setting `document.domain` is deprecated, and will be disabled by default. To continue using this feature, please opt-out of origin-keyed agent clusters by sending an `Origin-Agent-Cluster: ?0` header along with the HTTP response for the document and frames. See https://developer.chrome.com/blog/immutable-document-domain/ for more details.",eventPath:"`Event.path` is deprecated and will be removed. Please use `Event.composedPath()` instead.",geolocationInsecureOrigin:"`getCurrentPosition()` and `watchPosition()` no longer work on insecure origins. To use this feature, you should consider switching your application to a secure origin, such as HTTPS. See https://goo.gle/chrome-insecure-origins for more details.",
|
@@ -811,26 +813,26 @@ requestedSubresourceWithEmbeddedCredentials:"Subresource requests whose URLs con
|
|
811
813
|
rtcPeerConnectionComplexPlanBSdpUsingDefaultSdpSemantics:"Complex Plan B SDP detected! Chrome will switch the default `sdpSemantics` from `plan-b` to the standardized `unified-plan` format and this peer connection is relying on the default `sdpSemantics`. This SDP is not compatible with Unified Plan and will be rejected by clients expecting Unified Plan. For more information about how to prepare for the switch, see https://webrtc.org/web-apis/chrome/unified-plan/.",rtcPeerConnectionLegacyCreateWithMediaConstraints:"The `mediaConstraints` version of `RTCOfferOptions/RTCAnswerOptions` are deprecated and will soon be removed, please migrate to the promise-based `createOffer`/`createAnswer` instead.",
|
812
814
|
rtcPeerConnectionSdpSemanticsPlanB:"Plan B SDP semantics, which is used when constructing an `RTCPeerConnection` with `{sdpSemantics:plan-b}`, is a legacy non-standard version of the Session Description Protocol that has been permanently deleted from the Web Platform. It is still available when building with IS_FUCHSIA, but we intend to delete it as soon as possible. Stop depending on it. See https://crbug.com/1302249 for status.",rtcpMuxPolicyNegotiate:"The `rtcpMuxPolicy` option is deprecated and will be removed.",rtpDataChannel:"RTP data channels are no longer supported. The `RtpDataChannels` constraint is currently ignored, and may cause an error at a later date.",selectionAddRangeIntersect:"The behavior that `Selection.addRange()` merges existing Range and the specified Range was removed.",sharedArrayBufferConstructedWithoutIsolation:"`SharedArrayBuffer` will require cross-origin isolation. See https://developer.chrome.com/blog/enabling-shared-array-buffer/ for more details.",
|
813
815
|
textToSpeech_DisallowedByAutoplay:"`speechSynthesis.speak()` without user activation is deprecated and will be removed.",v8SharedArrayBufferConstructedInExtensionWithoutIsolation:"Extensions should opt into cross-origin isolation to continue using `SharedArrayBuffer`. See https://developer.chrome.com/docs/extensions/mv3/cross-origin-isolation/.",webCodecsVideoFrameDefaultTimestamp:"Constructing a `VideoFrame` without a timestamp is deprecated and support will be removed. Please provide a timestamp via `VideoFrameInit`.",xhrJSONEncodingDetection:"UTF-16 is not supported by response json in `XMLHttpRequest`",xmlHttpRequestSynchronousInNonWorkerOutsideBeforeUnload:"Synchronous `XMLHttpRequest` on the main thread is deprecated because of its detrimental effects to the end user’s experience. For more help, check https://xhr.spec.whatwg.org/.",xrSupportsSession:"`supportsSession()` is deprecated. Please use `isSessionSupported()` and check the resolved boolean value instead.",
|
814
|
-
unknownDeprecation:"..."},
|
815
|
-
r=5637885046816768;break;case"ChromeLoadTimesWasAlternateProtocolAvailable":t=
|
816
|
-
;case"GeolocationInsecureOriginDeprecatedNotRemoved":t=
|
817
|
-
;case"MediaSourceAbortRemove":t=
|
818
|
-
;break;case"PrefixedStorageInfo":t=
|
819
|
-
t=
|
820
|
-
t=
|
821
|
-
;return a.length>0&&(o=
|
822
|
-
numStylesheets:i.filter((e=>"Stylesheet"===e.resourceType)).length,numFonts:i.filter((e=>"Font"===e.resourceType)).length,numTasks:s.length,numTasksOver10ms:s.filter((e=>e.duration>10)).length,numTasksOver25ms:s.filter((e=>e.duration>25)).length,numTasksOver50ms:s.filter((e=>e.duration>50)).length,numTasksOver100ms:s.filter((e=>e.duration>100)).length,numTasksOver500ms:s.filter((e=>e.duration>500)).length,rtt:o.rtt,throughput:o.throughput,maxRtt:d,maxServerLatency:m,totalByteWeight:l,totalTaskTime:u,mainDocumentTransferSize:c}]}}}},
|
823
|
-
},
|
824
|
-
|
825
|
-
;const t=e.Doctype.name.trim(),r=e.Doctype.publicId,a=e.Doctype.systemId;return""!==r?{score:0,explanation:
|
826
|
-
statisticDOMWidth:"Maximum Child Elements"},
|
827
|
-
numericValue:r.totalBodyElements,numericUnit:"element",displayValue:
|
828
|
-
description:"Users are mistrustful of or confused by sites that request their location without context. Consider tying the request to a user action instead. [Learn more](https://web.dev/geolocation-on-start/)."},
|
829
|
-
failureTitle:"Issues were logged in the `Issues` panel in Chrome Devtools",description:"Issues logged to the `Issues` panel in Chrome Devtools indicate unresolved problems. They can come from network request failures, insufficient security controls, and other browser concerns. Open up the Issues panel in Chrome DevTools for more details on each issue.",columnIssueType:"Issue type",issueTypeBlockedByResponse:"Blocked by cross-origin policy",issueTypeHeavyAds:"Heavy resource usage by ads"}
|
830
|
-
items:Array.from(t).map((e=>({url:e})))}}}static getCookieRow(e){const t=new Set;for(const r of e){const e=r.request?.url||r.cookieUrl;e&&t.add(e)}return{issueType:"Cookie",subItems:{type:"subitems",items:Array.from(t).map((e=>({url:e})))}}}static getBlockedByResponseRow(e){const t=new Set;for(const r of e){const e=r.request?.url;e&&t.add(e)}return{issueType
|
831
|
-
r.blockedByResponseIssue.length&&a.push(this.getBlockedByResponseRow(r.blockedByResponseIssue)),r.heavyAdIssue.length&&a.push({issueType
|
832
|
-
requiredArtifacts:["Stacks"]}}static audit(e){const t=e.Stacks.filter((e=>"js"===e.detector)).filter((e=>!e.id.endsWith("-fast"))).map((e=>({name:e.name,version:e.version,npm:e.npm}))),r=[{key:"name",itemType:"text",text:
|
833
|
-
return{id:"no-document-write",title:
|
816
|
+
unknownDeprecation:"..."},ox=nx.createMessageInstanceIdFn("lighthouse-core/audits/deprecations.js",ix);tx.exports=class Deprecations extends rx{static get meta(){return{id:"deprecations",title:ox(ix.title),failureTitle:ox(ix.failureTitle),description:ox(ix.description),requiredArtifacts:["InspectorIssues","SourceMaps","ScriptElements"]}}static async audit(e,t){const r=await ax.request(e,t),a=e.InspectorIssues.deprecationIssue.map((e=>{const{url:t,lineNumber:a,columnNumber:n}=e.sourceCodeLocation,i=r.find((e=>e.script.src===t)),o=function getMeta(e){let t,r=0,a=0;const n=e.message;switch(e.type){case"AuthorizationCoveredByWildcard":t=ox(ix.authorizationCoveredByWildcard),a=97;break;case"CanRequestURLHTTPContainingNewline":t=ox(ix.canRequestURLHTTPContainingNewline),r=5735596811091968;break;case"ChromeLoadTimesConnectionInfo":t=ox(ix.chromeLoadTimesConnectionInfo),r=5637885046816768;break;case"ChromeLoadTimesFirstPaintAfterLoadTime":t=ox(ix.chromeLoadTimesFirstPaintAfterLoadTime),
|
817
|
+
r=5637885046816768;break;case"ChromeLoadTimesWasAlternateProtocolAvailable":t=ox(ix.chromeLoadTimesWasAlternateProtocolAvailable),r=5637885046816768;break;case"CookieWithTruncatingChar":t=ox(ix.cookieWithTruncatingChar),a=103;break;case"CrossOriginAccessBasedOnDocumentDomain":t=ox(ix.crossOriginAccessBasedOnDocumentDomain),a=106;break;case"CrossOriginWindowAlert":t=ox(ix.crossOriginWindowAlert);break;case"CrossOriginWindowConfirm":t=ox(ix.crossOriginWindowConfirm);break;case"CSSSelectorInternalMediaControlsOverlayCastButton":t=ox(ix.cssSelectorInternalMediaControlsOverlayCastButton),r=5714245488476160;break;case"CustomCursorIntersectsViewport":t=ox(ix.customCursorIntersectsViewport),r=5825971391299584,a=75;break;case"DocumentDomainSettingWithoutOriginAgentClusterHeader":t=ox(ix.documentDomainSettingWithoutOriginAgentClusterHeader),a=106;break;case"EventPath":t=ox(ix.eventPath),r=5726124632965120,a=109;break;case"GeolocationInsecureOrigin":t=ox(ix.geolocationInsecureOrigin);break
|
818
|
+
;case"GeolocationInsecureOriginDeprecatedNotRemoved":t=ox(ix.geolocationInsecureOriginDeprecatedNotRemoved);break;case"GetUserMediaInsecureOrigin":t=ox(ix.getUserMediaInsecureOrigin);break;case"HostCandidateAttributeGetter":t=ox(ix.hostCandidateAttributeGetter);break;case"InsecurePrivateNetworkSubresourceRequest":t=ox(ix.insecurePrivateNetworkSubresourceRequest),r=5436853517811712,a=92;break;case"LegacyConstraintGoogCpuOveruseDetection":t=ox(ix.legacyConstraintGoogCpuOveruseDetection),a=103;break;case"LegacyConstraintGoogIPv6":t=ox(ix.legacyConstraintGoogIPv6),a=103;break;case"LegacyConstraintGoogScreencastMinBitrate":t=ox(ix.legacyConstraintGoogScreencastMinBitrate),a=103;break;case"LegacyConstraintGoogSuspendBelowMinBitrate":t=ox(ix.legacyConstraintGoogSuspendBelowMinBitrate),a=103;break;case"LocalCSSFileExtensionRejected":t=ox(ix.localCSSFileExtensionRejected),a=64;break;case"MediaElementAudioSourceNode":t=ox(ix.mediaElementAudioSourceNode),r=5258622686724096,a=71;break
|
819
|
+
;case"MediaSourceAbortRemove":t=ox(ix.mediaSourceAbortRemove),r=6107495151960064;break;case"MediaSourceDurationTruncatingBuffered":t=ox(ix.mediaSourceDurationTruncatingBuffered),r=6107495151960064;break;case"NoSysexWebMIDIWithoutPermission":t=ox(ix.noSysexWebMIDIWithoutPermission),r=5138066234671104,a=82;break;case"NotificationInsecureOrigin":t=ox(ix.notificationInsecureOrigin);break;case"NotificationPermissionRequestedIframe":t=ox(ix.notificationPermissionRequestedIframe),r=6451284559265792;break;case"ObsoleteWebRtcCipherSuite":t=ox(ix.obsoleteWebRtcCipherSuite),a=81;break;case"PaymentRequestBasicCard":t=ox(ix.paymentRequestBasicCard),r=5730051011117056,a=100;break;case"PaymentRequestShowWithoutGesture":t=ox(ix.paymentRequestShowWithoutGesture),r=5948593429020672,a=102;break;case"PictureSourceSrc":t=ox(ix.pictureSourceSrc);break;case"PrefixedCancelAnimationFrame":t=ox(ix.prefixedCancelAnimationFrame);break;case"PrefixedRequestAnimationFrame":t=ox(ix.prefixedRequestAnimationFrame)
|
820
|
+
;break;case"PrefixedStorageInfo":t=ox(ix.prefixedStorageInfo);break;case"PrefixedVideoDisplayingFullscreen":t=ox(ix.prefixedVideoDisplayingFullscreen);break;case"PrefixedVideoEnterFullScreen":t=ox(ix.prefixedVideoEnterFullScreen);break;case"PrefixedVideoEnterFullscreen":t=ox(ix.prefixedVideoEnterFullscreen);break;case"PrefixedVideoExitFullScreen":t=ox(ix.prefixedVideoExitFullScreen);break;case"PrefixedVideoExitFullscreen":t=ox(ix.prefixedVideoExitFullscreen);break;case"PrefixedVideoSupportsFullscreen":t=ox(ix.prefixedVideoSupportsFullscreen);break;case"RangeExpand":t=ox(ix.rangeExpand);break;case"RequestedSubresourceWithEmbeddedCredentials":t=ox(ix.requestedSubresourceWithEmbeddedCredentials),r=5669008342777856;break;case"RTCConstraintEnableDtlsSrtpFalse":t=ox(ix.rtcConstraintEnableDtlsSrtpFalse),a=97;break;case"RTCConstraintEnableDtlsSrtpTrue":t=ox(ix.rtcConstraintEnableDtlsSrtpTrue),a=97;break;case"RTCPeerConnectionComplexPlanBSdpUsingDefaultSdpSemantics":
|
821
|
+
t=ox(ix.rtcPeerConnectionComplexPlanBSdpUsingDefaultSdpSemantics),a=72;break;case"RTCPeerConnectionLegacyCreateWithMediaConstraints":t=ox(ix.rtcPeerConnectionLegacyCreateWithMediaConstraints),a=103;break;case"RTCPeerConnectionSdpSemanticsPlanB":t=ox(ix.rtcPeerConnectionSdpSemanticsPlanB),r=5823036655665152,a=93;break;case"RtcpMuxPolicyNegotiate":t=ox(ix.rtcpMuxPolicyNegotiate),r=5654810086866944,a=62;break;case"RTPDataChannel":t=ox(ix.rtpDataChannel),a=88;break;case"SelectionAddRangeIntersect":t=ox(ix.selectionAddRangeIntersect),r=6680566019653632;break;case"SharedArrayBufferConstructedWithoutIsolation":t=ox(ix.sharedArrayBufferConstructedWithoutIsolation),a=106;break;case"TextToSpeech_DisallowedByAutoplay":t=ox(ix.textToSpeech_DisallowedByAutoplay),r=5687444770914304,a=71;break;case"V8SharedArrayBufferConstructedInExtensionWithoutIsolation":t=ox(ix.v8SharedArrayBufferConstructedInExtensionWithoutIsolation),a=96;break;case"WebCodecsVideoFrameDefaultTimestamp":
|
822
|
+
t=ox(ix.webCodecsVideoFrameDefaultTimestamp),r=5667793157488640,a=99;break;case"XHRJSONEncodingDetection":t=ox(ix.xhrJSONEncodingDetection),a=93;break;case"XMLHttpRequestSynchronousInNonWorkerOutsideBeforeUnload":t=ox(ix.xmlHttpRequestSynchronousInNonWorkerOutsideBeforeUnload);break;case"XRSupportsSession":t=ox(ix.xrSupportsSession),a=80;break;default:t=n||ox(ix.unknownDeprecation)}return{message:t,milestone:a,feature:r}}(e),s=[];let c;o.feature&&s.push({type:"link",url:`https://chromestatus.com/feature/${o.feature}`,text:ox(ix.feature)}),o.milestone&&s.push({type:"link",url:"https://chromiumdash.appspot.com/schedule",text:ox(ix.milestone,{milestone:o.milestone})}),s.length&&(c={type:"subitems",items:s});return{value:o.message||"",source:rx.makeSourceLocation(t,a,n-1,i),subItems:c}})),n=[{key:"value",itemType:"text",text:ox(ix.columnDeprecate)},{key:"source",itemType:"source-location",text:ox(nx.UIStrings.columnSource)}],i=rx.makeTableDetails(n,a);let o
|
823
|
+
;return a.length>0&&(o=ox(ix.displayValue,{itemCount:a.length})),{score:Number(0===a.length),displayValue:o,details:i}}},tx.exports.UIStrings=ix;const sx=kc,cx=Rv,lx=Lo,ux=xl,dx=Fo;var mx=class Diagnostics extends sx{static get meta(){return{id:"diagnostics",scoreDisplayMode:sx.SCORING_MODES.INFORMATIVE,title:"Diagnostics",description:"Collection of useful page vitals.",supportedModes:["navigation"],requiredArtifacts:["traces","devtoolsLogs"]}}static async audit(e,t){const r=e.traces[sx.DEFAULT_PASS],a=e.devtoolsLogs[sx.DEFAULT_PASS],n=await cx.request(r,t),i=await lx.request(a,t),o=await ux.request(a,t),s=n.filter((e=>!e.parent)),c=dx.findMainDocument(i).transferSize,l=i.reduce(((e,t)=>e+(t.transferSize||0)),0),u=s.reduce(((e,t)=>e+(t.duration||0)),0),d=Math.max(...o.additionalRttByOrigin.values())+o.rtt,m=Math.max(...o.serverResponseTimeByOrigin.values());return{score:1,details:{type:"debugdata",items:[{numRequests:i.length,numScripts:i.filter((e=>"Script"===e.resourceType)).length,
|
824
|
+
numStylesheets:i.filter((e=>"Stylesheet"===e.resourceType)).length,numFonts:i.filter((e=>"Font"===e.resourceType)).length,numTasks:s.length,numTasksOver10ms:s.filter((e=>e.duration>10)).length,numTasksOver25ms:s.filter((e=>e.duration>25)).length,numTasksOver50ms:s.filter((e=>e.duration>50)).length,numTasksOver100ms:s.filter((e=>e.duration>100)).length,numTasksOver500ms:s.filter((e=>e.duration>500)).length,rtt:o.rtt,throughput:o.throughput,maxRtt:d,maxServerLatency:m,totalByteWeight:l,totalTaskTime:u,mainDocumentTransferSize:c}]}}}},px={exports:{}};const hx=kc,gx=HT,fx={title:"Properly defines charset",failureTitle:"Charset declaration is missing or occurs too late in the HTML",description:"A character encoding declaration is required. It can be done with a `<meta>` tag in the first 1024 bytes of the HTML or in the Content-Type HTTP response header. [Learn more](https://web.dev/charset/)."
|
825
|
+
},yx=oi.createMessageInstanceIdFn("lighthouse-core/audits/dobetterweb/charset.js",fx),vx=/^[a-zA-Z0-9-_:.()]{2,}$/,bx=/<meta[^>]+charset[^<]+>/i,wx=/charset\s*=\s*[a-zA-Z0-9-_:.()]{2,}/i;px.exports=class CharsetDefined extends hx{static get meta(){return{id:"charset",title:yx(fx.title),failureTitle:yx(fx.failureTitle),description:yx(fx.description),requiredArtifacts:["MainDocumentContent","URL","devtoolsLogs","MetaElements"]}}static async audit(e,t){const r=e.devtoolsLogs[hx.DEFAULT_PASS],a=await gx.request({devtoolsLog:r,URL:e.URL},t);let n=!1;if(a.responseHeaders){const e=a.responseHeaders.find((e=>"content-type"===e.name.toLowerCase()));e&&(n=wx.test(e.value))}return n=n||65279===e.MainDocumentContent.charCodeAt(0),bx.test(e.MainDocumentContent.slice(0,1024))&&(n=n||e.MetaElements.some((e=>e.charset&&vx.test(e.charset)||"content-type"===e.httpEquiv&&e.content&&wx.test(e.content)))),{score:Number(n)}}},px.exports.UIStrings=fx,px.exports.CHARSET_HTML_REGEX=bx,
|
826
|
+
px.exports.CHARSET_HTTP_REGEX=wx,px.exports.IANA_REGEX=vx;var Sx={exports:{}};const Tx=kc,Ex={title:"Page has the HTML doctype",failureTitle:"Page lacks the HTML doctype, thus triggering quirks-mode",description:"Specifying a doctype prevents the browser from switching to quirks-mode. [Learn more](https://web.dev/doctype/).",explanationNoDoctype:"Document must contain a doctype",explanationPublicId:"Expected publicId to be an empty string",explanationSystemId:"Expected systemId to be an empty string",explanationBadDoctype:"Doctype name must be the lowercase string `html`"},xx=oi.createMessageInstanceIdFn("lighthouse-core/audits/dobetterweb/doctype.js",Ex);Sx.exports=class Doctype extends Tx{static get meta(){return{id:"doctype",title:xx(Ex.title),failureTitle:xx(Ex.failureTitle),description:xx(Ex.description),requiredArtifacts:["Doctype"]}}static audit(e){if(!e.Doctype)return{score:0,explanation:xx(Ex.explanationNoDoctype)}
|
827
|
+
;const t=e.Doctype.name.trim(),r=e.Doctype.publicId,a=e.Doctype.systemId;return""!==r?{score:0,explanation:xx(Ex.explanationPublicId)}:""!==a?{score:0,explanation:xx(Ex.explanationSystemId)}:"html"===t?{score:1}:{score:0,explanation:xx(Ex.explanationBadDoctype)}}},Sx.exports.UIStrings=Ex;var _x={exports:{}};const Ax=kc,Rx=oi,kx={title:"Avoids an excessive DOM size",failureTitle:"Avoid an excessive DOM size",description:"A large DOM will increase memory usage, cause longer [style calculations](https://developers.google.com/web/fundamentals/performance/rendering/reduce-the-scope-and-complexity-of-style-calculations), and produce costly [layout reflows](https://developers.google.com/speed/articles/reflow). [Learn more](https://web.dev/dom-size/).",columnStatistic:"Statistic",columnValue:"Value",displayValue:"{itemCount, plural,\n =1 {1 element}\n other {# elements}\n }",statisticDOMElements:"Total DOM Elements",statisticDOMDepth:"Maximum DOM Depth",
|
828
|
+
statisticDOMWidth:"Maximum Child Elements"},Dx=Rx.createMessageInstanceIdFn("lighthouse-core/audits/dobetterweb/dom-size.js",kx);_x.exports=class DOMSize extends Ax{static get meta(){return{id:"dom-size",title:Dx(kx.title),failureTitle:Dx(kx.failureTitle),description:Dx(kx.description),scoreDisplayMode:Ax.SCORING_MODES.NUMERIC,requiredArtifacts:["DOMStats"]}}static get defaultOptions(){return{p10:818,median:1400}}static audit(e,t){const r=e.DOMStats,a=Ax.computeLogNormalScore({p10:t.options.p10,median:t.options.median},r.totalBodyElements),n=[{key:"statistic",itemType:"text",text:Dx(kx.columnStatistic)},{key:"node",itemType:"node",text:Dx(Rx.UIStrings.columnElement)},{key:"value",itemType:"numeric",text:Dx(kx.columnValue)}],i=[{statistic:Dx(kx.statisticDOMElements),value:r.totalBodyElements},{node:Ax.makeNodeItem(r.depth),statistic:Dx(kx.statisticDOMDepth),value:r.depth.max},{node:Ax.makeNodeItem(r.width),statistic:Dx(kx.statisticDOMWidth),value:r.width.max}];return{score:a,
|
829
|
+
numericValue:r.totalBodyElements,numericUnit:"element",displayValue:Dx(kx.displayValue,{itemCount:r.totalBodyElements}),details:Ax.makeTableDetails(n,i)}}},_x.exports.UIStrings=kx;var Cx={exports:{}};const Ix=kc,Nx=jb;var Lx=class ViolationAudit$4 extends Ix{static async getViolationResults(e,t,r){const a=await Nx.request(e,t);const n=new Set;return e.ConsoleMessages.filter((e=>e.url&&"violation"===e.source&&r.test(e.text))).map((e=>{const t=a.find((t=>t.script.src===e.url));return Ix.makeSourceLocationFromConsoleMessage(e,t)})).filter((function filterUndefined(e){return void 0!==e})).filter((e=>{const t=`${e.url}!${e.line}!${e.column}`;return!n.has(t)&&(n.add(t),!0)})).map((e=>({source:e})))}};const Mx=Lx,Px=oi,Ox={title:"Avoids requesting the geolocation permission on page load",failureTitle:"Requests the geolocation permission on page load",
|
830
|
+
description:"Users are mistrustful of or confused by sites that request their location without context. Consider tying the request to a user action instead. [Learn more](https://web.dev/geolocation-on-start/)."},Fx=Px.createMessageInstanceIdFn("lighthouse-core/audits/dobetterweb/geolocation-on-start.js",Ox);Cx.exports=class GeolocationOnStart extends Mx{static get meta(){return{id:"geolocation-on-start",title:Fx(Ox.title),failureTitle:Fx(Ox.failureTitle),description:Fx(Ox.description),supportedModes:["navigation"],requiredArtifacts:["ConsoleMessages","SourceMaps","ScriptElements"]}}static async audit(e,t){const r=await Mx.getViolationResults(e,t,/geolocation/),a=[{key:"source",itemType:"source-location",text:Fx(Px.UIStrings.columnSource)}],n=Mx.makeTableDetails(a,r);return{score:Number(0===r.length),details:n}}},Cx.exports.UIStrings=Ox;var Ux={exports:{}};const jx=kc,Bx={title:"No issues in the `Issues` panel in Chrome Devtools",
|
831
|
+
failureTitle:"Issues were logged in the `Issues` panel in Chrome Devtools",description:"Issues logged to the `Issues` panel in Chrome Devtools indicate unresolved problems. They can come from network request failures, insufficient security controls, and other browser concerns. Open up the Issues panel in Chrome DevTools for more details on each issue.",columnIssueType:"Issue type",issueTypeBlockedByResponse:"Blocked by cross-origin policy",issueTypeHeavyAds:"Heavy resource usage by ads"},$x=oi.createMessageInstanceIdFn("lighthouse-core/audits/dobetterweb/inspector-issues.js",Bx);Ux.exports=class IssuesPanelEntries extends jx{static get meta(){return{id:"inspector-issues",title:$x(Bx.title),failureTitle:$x(Bx.failureTitle),description:$x(Bx.description),requiredArtifacts:["InspectorIssues"]}}static getMixedContentRow(e){const t=new Set;for(const r of e){const e=r.request?.url||r.mainResourceURL;t.add(e)}return{issueType:"Mixed content",subItems:{type:"subitems",
|
832
|
+
items:Array.from(t).map((e=>({url:e})))}}}static getCookieRow(e){const t=new Set;for(const r of e){const e=r.request?.url||r.cookieUrl;e&&t.add(e)}return{issueType:"Cookie",subItems:{type:"subitems",items:Array.from(t).map((e=>({url:e})))}}}static getBlockedByResponseRow(e){const t=new Set;for(const r of e){const e=r.request?.url;e&&t.add(e)}return{issueType:$x(Bx.issueTypeBlockedByResponse),subItems:{type:"subitems",items:Array.from(t).map((e=>({url:e})))}}}static getContentSecurityPolicyRow(e){const t=new Set;for(const r of e){const e=r.blockedURL;e&&t.add(e)}return{issueType:"Content security policy",subItems:{type:"subitems",items:Array.from(t).map((e=>({url:e})))}}}static audit(e){const t=[{key:"issueType",itemType:"text",subItemsHeading:{key:"url",itemType:"url"},text:$x(Bx.columnIssueType)}],r=e.InspectorIssues,a=[];r.mixedContentIssue.length&&a.push(this.getMixedContentRow(r.mixedContentIssue)),r.cookieIssue.length&&a.push(this.getCookieRow(r.cookieIssue)),
|
833
|
+
r.blockedByResponseIssue.length&&a.push(this.getBlockedByResponseRow(r.blockedByResponseIssue)),r.heavyAdIssue.length&&a.push({issueType:$x(Bx.issueTypeHeavyAds)});const n=r.contentSecurityPolicyIssue.filter((e=>"kTrustedTypesSinkViolation"!==e.contentSecurityPolicyViolationType&&"kTrustedTypesPolicyViolation"!==e.contentSecurityPolicyViolationType));return n.length&&a.push(this.getContentSecurityPolicyRow(n)),{score:a.length>0?0:1,details:jx.makeTableDetails(t,a)}}},Ux.exports.UIStrings=Bx;var qx={exports:{}};const zx=kc,Vx=oi,Wx={title:"Detected JavaScript libraries",description:"All front-end JavaScript libraries detected on the page. [Learn more](https://web.dev/js-libraries/).",columnVersion:"Version"},Gx=Vx.createMessageInstanceIdFn("lighthouse-core/audits/dobetterweb/js-libraries.js",Wx);qx.exports=class JsLibrariesAudit extends zx{static get meta(){return{id:"js-libraries",title:Gx(Wx.title),scoreDisplayMode:zx.SCORING_MODES.INFORMATIVE,description:Gx(Wx.description),
|
834
|
+
requiredArtifacts:["Stacks"]}}static audit(e){const t=e.Stacks.filter((e=>"js"===e.detector)).filter((e=>!e.id.endsWith("-fast"))).map((e=>({name:e.name,version:e.version,npm:e.npm}))),r=[{key:"name",itemType:"text",text:Gx(Vx.UIStrings.columnName)},{key:"version",itemType:"text",text:Gx(Wx.columnVersion)}],a=zx.makeTableDetails(r,t,{}),n={type:"debugdata",stacks:e.Stacks.map((e=>({id:e.id,version:e.version})))};return t.length?{score:1,details:{...a,debugData:n}}:{score:null,notApplicable:!0}}},qx.exports.UIStrings=Wx;var Hx={exports:{}};const Yx=Lx,Kx=oi,Jx={title:"Avoids `document.write()`",failureTitle:"Avoid `document.write()`",description:"For users on slow connections, external scripts dynamically injected via `document.write()` can delay page load by tens of seconds. [Learn more](https://web.dev/no-document-write/)."},Xx=Kx.createMessageInstanceIdFn("lighthouse-core/audits/dobetterweb/no-document-write.js",Jx);Hx.exports=class NoDocWriteAudit extends Yx{static get meta(){
|
835
|
+
return{id:"no-document-write",title:Xx(Jx.title),failureTitle:Xx(Jx.failureTitle),description:Xx(Jx.description),requiredArtifacts:["ConsoleMessages","SourceMaps","ScriptElements"]}}static async audit(e,t){const r=await Yx.getViolationResults(e,t,/document\.write/),a=[{key:"source",itemType:"source-location",text:Xx(Kx.UIStrings.columnSource)}],n=Yx.makeTableDetails(a,r);return{score:Number(0===r.length),details:n}}},Hx.exports.UIStrings=Jx;var Zx={exports:{}},Qx={exports:{}};!function(e,t){var r;t=e.exports=SemVer,r="object"==typeof La&&La.env&&La.env.NODE_DEBUG&&/\bsemver\b/i.test(La.env.NODE_DEBUG)?function(){var e=Array.prototype.slice.call(arguments,0);e.unshift("SEMVER"),console.log.apply(console,e)}:function(){},t.SEMVER_SPEC_VERSION="2.0.0";var a=Number.MAX_SAFE_INTEGER||9007199254740991,n=t.re=[],i=t.src=[],o=0,s=o++;i[s]="0|[1-9]\\d*";var c=o++;i[c]="[0-9]+";var l=o++;i[l]="\\d*[a-zA-Z-][a-zA-Z0-9-]*";var u=o++;i[u]="("+i[s]+")\\.("+i[s]+")\\.("+i[s]+")";var d=o++
|
834
836
|
;i[d]="("+i[c]+")\\.("+i[c]+")\\.("+i[c]+")";var m=o++;i[m]="(?:"+i[s]+"|"+i[l]+")";var p=o++;i[p]="(?:"+i[c]+"|"+i[l]+")";var h=o++;i[h]="(?:-("+i[m]+"(?:\\."+i[m]+")*))";var f=o++;i[f]="(?:-?("+i[p]+"(?:\\."+i[p]+")*))";var y=o++;i[y]="[0-9A-Za-z-]+";var v=o++;i[v]="(?:\\+("+i[y]+"(?:\\."+i[y]+")*))";var b=o++,w="v?"+i[u]+i[h]+"?"+i[v]+"?";i[b]="^"+w+"$";var S="[v=\\s]*"+i[d]+i[f]+"?"+i[v]+"?",T=o++;i[T]="^"+S+"$";var E=o++;i[E]="((?:<|>)?=?)";var x=o++;i[x]=i[c]+"|x|X|\\*";var _=o++;i[_]=i[s]+"|x|X|\\*";var A=o++;i[A]="[v=\\s]*("+i[_]+")(?:\\.("+i[_]+")(?:\\.("+i[_]+")(?:"+i[h]+")?"+i[v]+"?)?)?";var R=o++;i[R]="[v=\\s]*("+i[x]+")(?:\\.("+i[x]+")(?:\\.("+i[x]+")(?:"+i[f]+")?"+i[v]+"?)?)?";var k=o++;i[k]="^"+i[E]+"\\s*"+i[A]+"$";var D=o++;i[D]="^"+i[E]+"\\s*"+i[R]+"$";var C=o++;i[C]="(?:^|[^\\d])(\\d{1,16})(?:\\.(\\d{1,16}))?(?:\\.(\\d{1,16}))?(?:$|[^\\d])";var I=o++;i[I]="(?:~>?)";var N=o++;i[N]="(\\s*)"+i[I]+"\\s+",n[N]=new RegExp(i[N],"g");var L=o++;i[L]="^"+i[I]+i[A]+"$";var M=o++
|
835
837
|
;i[M]="^"+i[I]+i[R]+"$";var P=o++;i[P]="(?:\\^)";var O=o++;i[O]="(\\s*)"+i[P]+"\\s+",n[O]=new RegExp(i[O],"g");var F=o++;i[F]="^"+i[P]+i[A]+"$";var U=o++;i[U]="^"+i[P]+i[R]+"$";var j=o++;i[j]="^"+i[E]+"\\s*("+S+")$|^$";var B=o++;i[B]="^"+i[E]+"\\s*("+w+")$|^$";var $=o++;i[$]="(\\s*)"+i[E]+"\\s*("+S+"|"+i[A]+")",n[$]=new RegExp(i[$],"g");var q=o++;i[q]="^\\s*("+i[A]+")\\s+-\\s+("+i[A]+")\\s*$";var z=o++;i[z]="^\\s*("+i[R]+")\\s+-\\s+("+i[R]+")\\s*$";var V=o++;i[V]="(<|>)?=?\\s*\\*";for(var W=0;W<35;W++)r(W,i[W]),n[W]||(n[W]=new RegExp(i[W]));function parse(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof SemVer)return e;if("string"!=typeof e)return null;if(e.length>256)return null;if(!(t.loose?n[T]:n[b]).test(e))return null;try{return new SemVer(e,t)}catch(e){return null}}function SemVer(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof SemVer){if(e.loose===t.loose)return e;e=e.version
|
836
838
|
}else if("string"!=typeof e)throw new TypeError("Invalid Version: "+e);if(e.length>256)throw new TypeError("version is longer than 256 characters");if(!(this instanceof SemVer))return new SemVer(e,t);r("SemVer",e,t),this.options=t,this.loose=!!t.loose;var i=e.trim().match(t.loose?n[T]:n[b]);if(!i)throw new TypeError("Invalid Version: "+e);if(this.raw=e,this.major=+i[1],this.minor=+i[2],this.patch=+i[3],this.major>a||this.major<0)throw new TypeError("Invalid major version");if(this.minor>a||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>a||this.patch<0)throw new TypeError("Invalid patch version");i[4]?this.prerelease=i[4].split(".").map((function(e){if(/^[0-9]+$/.test(e)){var t=+e;if(t>=0&&t<a)return t}return e})):this.prerelease=[],this.build=i[5]?i[5].split("."):[],this.format()}t.parse=parse,t.valid=function valid(e,t){var r=parse(e,t);return r?r.version:null},t.clean=function clean(e,t){var r=parse(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null},
|
@@ -847,7 +849,7 @@ e=(e=(e=e.replace(n[N],"$1~")).replace(n[O],"$1^")).split(/\s+/).join(" ");var i
|
|
847
849
|
return e.trim().split(/\s+/).map((function(e){return function replaceTilde(e,t){var a=t.loose?n[M]:n[L];return e.replace(a,(function(t,a,n,i,o){var s;return r("tilde",e,t,a,n,i,o),isX(a)?s="":isX(n)?s=">="+a+".0.0 <"+(+a+1)+".0.0":isX(i)?s=">="+a+"."+n+".0 <"+a+"."+(+n+1)+".0":o?(r("replaceTilde pr",o),s=">="+a+"."+n+"."+i+"-"+o+" <"+a+"."+(+n+1)+".0"):s=">="+a+"."+n+"."+i+" <"+a+"."+(+n+1)+".0",r("tilde return",s),s}))}(e,t)})).join(" ")}(e,t),r("tildes",e),e=function replaceXRanges(e,t){return r("replaceXRanges",e,t),e.split(/\s+/).map((function(e){return function replaceXRange(e,t){e=e.trim();var a=t.loose?n[D]:n[k];return e.replace(a,(function(t,a,n,i,o,s){r("xRange",e,t,a,n,i,o,s);var c=isX(n),l=c||isX(i),u=l||isX(o);return"="===a&&u&&(a=""),c?t=">"===a||"<"===a?"<0.0.0":"*":a&&u?(l&&(i=0),o=0,">"===a?(a=">=",l?(n=+n+1,i=0,o=0):(i=+i+1,o=0)):"<="===a&&(a="<",l?n=+n+1:i=+i+1),t=a+n+"."+i+"."+o):l?t=">="+n+".0.0 <"+(+n+1)+".0.0":u&&(t=">="+n+"."+i+".0 <"+n+"."+(+i+1)+".0"),
|
848
850
|
r("xRange return",t),t}))}(e,t)})).join(" ")}(e,t),r("xrange",e),e=function replaceStars(e,t){return r("replaceStars",e,t),e.trim().replace(n[V],"")}(e,t),r("stars",e),e}(e,this.options)}),this).join(" ").split(/\s+/);return this.options.loose&&(o=o.filter((function(e){return!!e.match(i)}))),o=o.map((function(e){return new Comparator(e,this.options)}),this)},Range.prototype.intersects=function(e,t){if(!(e instanceof Range))throw new TypeError("a Range is required");return this.set.some((function(r){return r.every((function(r){return e.set.some((function(e){return e.every((function(e){return r.intersects(e,t)}))}))}))}))},t.toComparators=function toComparators(e,t){return new Range(e,t).set.map((function(e){return e.map((function(e){return e.value})).join(" ").trim().split(" ")}))},Range.prototype.test=function(e){if(!e)return!1;"string"==typeof e&&(e=new SemVer(e,this.options));for(var t=0;t<this.set.length;t++)if(testSet(this.set[t],e,this.options))return!0;return!1},
|
849
851
|
t.satisfies=satisfies,t.maxSatisfying=function maxSatisfying(e,t,r){var a=null,n=null;try{var i=new Range(t,r)}catch(e){return null}return e.forEach((function(e){i.test(e)&&(a&&-1!==n.compare(e)||(n=new SemVer(a=e,r)))})),a},t.minSatisfying=function minSatisfying(e,t,r){var a=null,n=null;try{var i=new Range(t,r)}catch(e){return null}return e.forEach((function(e){i.test(e)&&(a&&1!==n.compare(e)||(n=new SemVer(a=e,r)))})),a},t.minVersion=function minVersion(e,t){e=new Range(e,t);var r=new SemVer("0.0.0");if(e.test(r))return r;if(r=new SemVer("0.0.0-0"),e.test(r))return r;r=null;for(var a=0;a<e.set.length;++a){e.set[a].forEach((function(e){var t=new SemVer(e.semver.version);switch(e.operator){case">":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":r&&!gt(r,t)||(r=t);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+e.operator)}}))}if(r&&e.test(r))return r;return null},t.validRange=function validRange(e,t){try{
|
850
|
-
return new Range(e,t).range||"*"}catch(e){return null}},t.ltr=function ltr(e,t,r){return outside(e,t,"<",r)},t.gtr=function gtr(e,t,r){return outside(e,t,">",r)},t.outside=outside,t.prerelease=function prerelease(e,t){var r=parse(e,t);return r&&r.prerelease.length?r.prerelease:null},t.intersects=function intersects(e,t,r){return e=new Range(e,r),t=new Range(t,r),e.intersects(t)},t.coerce=function coerce(e){if(e instanceof SemVer)return e;if("string"!=typeof e)return null;var t=e.match(n[C]);if(null==t)return null;return parse(t[1]+"."+(t[2]||"0")+"."+(t[3]||"0"))}}(
|
852
|
+
return new Range(e,t).range||"*"}catch(e){return null}},t.ltr=function ltr(e,t,r){return outside(e,t,"<",r)},t.gtr=function gtr(e,t,r){return outside(e,t,">",r)},t.outside=outside,t.prerelease=function prerelease(e,t){var r=parse(e,t);return r&&r.prerelease.length?r.prerelease:null},t.intersects=function intersects(e,t,r){return e=new Range(e,r),t=new Range(t,r),e.intersects(t)},t.coerce=function coerce(e){if(e instanceof SemVer)return e;if("string"!=typeof e)return null;var t=e.match(n[C]);if(null==t)return null;return parse(t[1]+"."+(t[2]||"0")+"."+(t[3]||"0"))}}(Qx,Qx.exports);const e_=kc,t_=Jl,r_=Qx.exports,a_={npm:{"@angular/core":[{id:"SNYK-JS-ANGULARCORE-1070902",severity:"low",semver:{vulnerable:["<11.0.5",">=11.1.0-next.0 <11.1.0-next.3"]}}],angular:[{id:"SNYK-JS-ANGULAR-572020",severity:"high",semver:{vulnerable:["<1.8.0"]}},{id:"SNYK-JS-ANGULAR-570058",severity:"medium",semver:{vulnerable:["<1.8.0"]}},{id:"SNYK-JS-ANGULAR-534884",severity:"high",semver:{
|
851
853
|
vulnerable:[">=1.4.0-beta.6 <1.7.9"]}},{id:"SNYK-JS-ANGULAR-471885",severity:"medium",semver:{vulnerable:["<1.6.3"]}},{id:"SNYK-JS-ANGULAR-471882",severity:"medium",semver:{vulnerable:["<1.6.5"]}},{id:"SNYK-JS-ANGULAR-471879",severity:"medium",semver:{vulnerable:["<1.6.0-rc.0"]}},{id:"npm:angular:20180202",severity:"medium",semver:{vulnerable:["<1.6.9"]}},{id:"npm:angular:20171018",severity:"medium",semver:{vulnerable:["<1.6.7"]}},{id:"npm:angular:20160527",severity:"medium",semver:{vulnerable:[">=1.0.0 <1.2.30"]}},{id:"npm:angular:20160122",severity:"medium",semver:{vulnerable:[">=1.3.0 <1.5.0-rc.2"]}},{id:"npm:angular:20140608",severity:"low",semver:{vulnerable:["<1.3.0"]}},{id:"npm:angular:20131113",severity:"high",semver:{vulnerable:["<1.2.2"]}},{id:"npm:angular:20140908",severity:"medium",semver:{vulnerable:["<1.3.0-rc.5"]}},{id:"npm:angular:20161101",severity:"medium",semver:{vulnerable:[">=1.5.0 <1.5.9"]}},{id:"npm:angular:20150909",severity:"high",semver:{
|
852
854
|
vulnerable:["<1.5.0-beta.2"]}},{id:"npm:angular:20151205",severity:"medium",semver:{vulnerable:["<1.5.0-rc.0"]}},{id:"npm:angular:20151130",severity:"medium",semver:{vulnerable:["<1.4.10"]}},{id:"npm:angular:20130622",severity:"medium",semver:{vulnerable:[">=1.0.0 <1.2.0"]}},{id:"npm:angular:20150807-1",severity:"medium",semver:{vulnerable:[">=1.3.1 <1.5.0-beta.0"]}},{id:"npm:angular:20150807",severity:"high",semver:{vulnerable:[">=1.0.0 <1.5.0-beta.0"]}},{id:"npm:angular:20150315",severity:"medium",semver:{vulnerable:["<1.6.1"]}},{id:"npm:angular:20150310",severity:"high",semver:{vulnerable:["<1.4.0-beta.6"]}},{id:"npm:angular:20141104",severity:"medium",semver:{vulnerable:["<1.3.2"]}},{id:"npm:angular:20130621",severity:"medium",semver:{vulnerable:["<1.2.0"]}},{id:"npm:angular:20140909",severity:"high",semver:{vulnerable:[">=1.2.19 <1.2.27"]}},{id:"npm:angular:20130625",severity:"high",semver:{vulnerable:["<1.1.5"]}}],backbone:[{id:"npm:backbone:20160523",severity:"medium",semver:{
|
853
855
|
vulnerable:["<0.1.2"]}},{id:"npm:backbone:20110701",severity:"medium",semver:{vulnerable:["<0.5.0"]}}],bootstrap:[{id:"SNYK-JS-BOOTSTRAP-173700",severity:"medium",semver:{vulnerable:["<3.4.1",">=4.0.0 <4.3.1"]}},{id:"SNYK-JS-BOOTSTRAP-73560",severity:"medium",semver:{vulnerable:[">=4.0.0 <4.1.2"]}},{id:"SNYK-JS-BOOTSTRAP-72890",severity:"medium",semver:{vulnerable:["<3.4.0"]}},{id:"SNYK-JS-BOOTSTRAP-72889",severity:"medium",semver:{vulnerable:["<3.4.0"]}},{id:"npm:bootstrap:20180529",severity:"medium",semver:{vulnerable:["<3.4.0",">=4.0.0 <4.1.2"]}},{id:"npm:bootstrap:20160627",severity:"medium",semver:{vulnerable:["<3.4.0",">=4.0.0-alpha <4.0.0-beta.2"]}},{id:"npm:bootstrap:20120510",severity:"medium",semver:{vulnerable:["<2.1.0"]}}],dojo:[{id:"SNYK-JS-DOJO-1535223",severity:"high",semver:{vulnerable:["<1.17.0"]}},{id:"SNYK-JS-DOJO-559224",severity:"medium",semver:{vulnerable:["<1.11.10",">=1.12.1 <1.12.8",">=1.13.0 <1.13.7",">=1.14.0 <1.14.6",">=1.15.0 <1.15.3",">=1.16.0 <1.16.2"]}
|
@@ -859,66 +861,66 @@ vulnerable:["<1.13.0"]}},{id:"npm:jquery-ui:20121127",severity:"medium",semver:{
|
|
859
861
|
vulnerable:["<4.17.11"]}},{id:"npm:lodash:20180130",severity:"medium",semver:{vulnerable:["<4.17.5"]}}],moment:[{id:"SNYK-JS-MOMENT-2440688",severity:"high",semver:{vulnerable:["<2.29.2"]}},{id:"npm:moment:20170905",severity:"low",semver:{vulnerable:["<2.19.3"]}},{id:"npm:moment:20161019",severity:"medium",semver:{vulnerable:["<2.15.2"]}},{id:"npm:moment:20160126",severity:"medium",semver:{vulnerable:["<2.11.2"]}}],mustache:[{id:"npm:mustache:20151207",severity:"medium",semver:{vulnerable:["<2.2.1"]}},{id:"npm:mustache:20110814",severity:"medium",semver:{vulnerable:["< 0.3.1"]}}],next:[{id:"SNYK-JS-NEXT-2405694",severity:"medium",semver:{vulnerable:[">=10.0.0 <12.1.0"]}},{id:"SNYK-JS-NEXT-2388583",severity:"medium",semver:{vulnerable:[">=12.0.0 <12.0.9"]}},{id:"SNYK-JS-NEXT-2312745",severity:"high",semver:{vulnerable:[">=12.0.0 <12.0.5",">=11.1.0 <11.1.3"]}},{id:"SNYK-JS-NEXT-1577139",severity:"medium",semver:{vulnerable:[">=10.0.0 <11.1.1"]}},{id:"SNYK-JS-NEXT-1540422",
|
860
862
|
severity:"medium",semver:{vulnerable:["<11.1.0"]}},{id:"SNYK-JS-NEXT-1063481",severity:"medium",semver:{vulnerable:[">=9.5.0 <9.5.4"]}},{id:"SNYK-JS-NEXT-571938",severity:"high",semver:{vulnerable:["<5.1.0"]}},{id:"SNYK-JS-NEXT-561584",severity:"medium",semver:{vulnerable:["<9.3.2"]}},{id:"SNYK-JS-NEXT-174590",severity:"high",semver:{vulnerable:["<2.4.1"]}},{id:"SNYK-JS-NEXT-72454",severity:"medium",semver:{vulnerable:[">=7.0.0 <7.0.2"]}},{id:"npm:next:20180124",severity:"high",semver:{vulnerable:["<4.2.3"]}},{id:"npm:next:20170607",severity:"medium",semver:{vulnerable:["<2.4.3"]}},{id:"npm:next:20170601",severity:"high",semver:{vulnerable:["<2.4.1",">=3.0.0-beta1 <3.0.0-beta7"]}}],react:[{id:"npm:react:20150318",severity:"high",semver:{vulnerable:[">=0.0.1 <0.14.0"]}},{id:"npm:react:20131217",severity:"medium",semver:{vulnerable:[">=0.5.0 <0.5.2",">=0.4.0 <0.4.2"]}}],riot:[{id:"npm:riot:20131114",severity:"medium",semver:{vulnerable:["<0.9.6"]}}],"socket.io":[{
|
861
863
|
id:"SNYK-JS-SOCKETIO-1024859",severity:"medium",semver:{vulnerable:["<2.4.0"]}},{id:"npm:socket.io:20120417",severity:"medium",semver:{vulnerable:["<0.9.6"]}},{id:"npm:socket.io:20120323",severity:"medium",semver:{vulnerable:["<0.9.7"]}}],three:[{id:"SNYK-JS-THREE-1064931",severity:"high",semver:{vulnerable:["<0.125.0"]}}],underscore:[{id:"SNYK-JS-UNDERSCORE-1080984",severity:"medium",semver:{vulnerable:[">=1.13.0-0 <1.13.0-2",">=1.3.2 <1.12.1"]}}],vue:[{id:"npm:vue:20170829",severity:"medium",semver:{vulnerable:["<2.4.3"]}},{id:"npm:vue:20170401",severity:"medium",semver:{vulnerable:["<2.3.0-beta.1"]}},{id:"npm:vue:20180802",severity:"medium",semver:{vulnerable:["<2.5.17"]}},{id:"npm:vue:20180222",severity:"low",semver:{vulnerable:["<2.5.14"]}}],yui:[{id:"npm:yui:20130604",severity:"medium",semver:{vulnerable:[">=3.0.0 <3.10.1","=3.10.2"]}},{id:"npm:yui:20130515",severity:"medium",semver:{vulnerable:["<3.10.0 >=3.0.0"]}},{id:"npm:yui:20121030",severity:"medium",semver:{
|
862
|
-
vulnerable:["<3.0.0 >=2.4.0"]}},{id:"npm:yui:20120428",severity:"medium",semver:{vulnerable:["<3.5.1 >=3.5.0-PR1"]}},{id:"npm:yui:20101025",severity:"medium",semver:{vulnerable:["<2.8.2 >=2.4.0"]}}]}},
|
863
|
-
medium:
|
864
|
-
return e.sort(((e,t)=>t.numericSeverity-e.numericSeverity))[0].severity}static audit(e){const t=e.Stacks.filter((e=>"js"===e.detector)),r=NoVulnerableLibrariesAudit.snykDB;if(!t.length)return{score:1};let a=0;const n=[];for(const e of t){const t=this.normalizeVersion(e.version)||"",i=this.getVulnerabilities(t,e,r),o=i.length;let s;a+=o,i.length>0&&(s=this.highestSeverity(i),n.push({highestSeverity:s,vulnCount:o,detectedLib:{text:e.name+"@"+t,url:`https://snyk.io/vuln/npm:${e.npm}?lh=${t}&utm_source=lighthouse&utm_medium=ref&utm_campaign=audit`,type:"link"}}))}let i;a>0&&(i=
|
865
|
-
title:"Avoids requesting the notification permission on page load",failureTitle:"Requests the notification permission on page load",description:"Users are mistrustful of or confused by sites that request to send notifications without context. Consider tying the request to user gestures instead. [Learn more](https://web.dev/notification-on-start/)."},
|
866
|
-
|
867
|
-
exports:{}};const
|
868
|
-
flexibleOrdering:true}),i=new Map;t.traverse((e=>{"network"===e.type&&a.has(e.record.url)&&(i.set(e.record.requestId,e.record.protocol),e.record.protocol="h2")}));const o=r.simulate(t,{label:"uses-http2-after",flexibleOrdering:true});t.traverse((e=>{if("network"!==e.type)return;const t=i.get(e.record.requestId);void 0!==t&&(e.record.protocol=t)}));const s=n.timeInMs-o.timeInMs,c=
|
869
|
-
;if(!/HTTP\/[01][.\d]?/i.test(n.protocol))continue;(a.get(n.parsedURL.securityOrigin)||[]).length<6||(r.add(n.url),t.push({protocol:n.protocol,url:n.url}))}return t}static async audit(e,t){const r=e.traces[
|
870
|
-
numericValue:u,numericUnit:"millisecond",score:
|
871
|
-
itemType:"source-location",text:
|
872
|
-
const{ignoredPatterns:r,...a}=t,n=Object.keys(a);return n.length&&
|
873
|
-
static async compute_(e){return e.traceEvents.filter((e=>"Screenshot"===e.name)).map((e=>({timestamp:e.ts,datauri:`data:image/jpeg;base64,${e.args.snapshot}`})))}},null);const
|
874
|
-
title:"All text remains visible during webfont loads",failureTitle:"Ensure text remains visible during webfont load",description:"Leverage the font-display CSS feature to ensure text is user-visible while webfonts are loading. [Learn more](https://web.dev/font-display/).",undeclaredFontOriginWarning:"{fontCountForOrigin, plural, =1 {Lighthouse was unable to automatically check the `font-display` value for the origin {fontOrigin}.} other {Lighthouse was unable to automatically check the `font-display` values for the origin {fontOrigin}.}}"},
|
875
|
-
const i=n.content.replace(/(\r|\n)+/g," ").match(/@font-face\s*{(.*?)}/g)||[];for(const o of i){const i=o.match(
|
876
|
-
const r=e.devtoolsLogs[this.DEFAULT_PASS],a=await
|
864
|
+
vulnerable:["<3.0.0 >=2.4.0"]}},{id:"npm:yui:20120428",severity:"medium",semver:{vulnerable:["<3.5.1 >=3.5.0-PR1"]}},{id:"npm:yui:20101025",severity:"medium",semver:{vulnerable:["<2.8.2 >=2.4.0"]}}]}},n_=oi,i_={title:"Avoids front-end JavaScript libraries with known security vulnerabilities",failureTitle:"Includes front-end JavaScript libraries with known security vulnerabilities",description:"Some third-party scripts may contain known security vulnerabilities that are easily identified and exploited by attackers. [Learn more](https://web.dev/no-vulnerable-libraries/).",displayValue:"{itemCount, plural,\n =1 {1 vulnerability detected}\n other {# vulnerabilities detected}\n }",columnVersion:"Library Version",columnVuln:"Vulnerability Count",columnSeverity:"Highest Severity"},o_=n_.createMessageInstanceIdFn("lighthouse-core/audits/dobetterweb/no-vulnerable-libraries.js",i_),s_=/^(\d+\.\d+\.\d+)[^-0-9]+/,c_={low:o_(n_.UIStrings.itemSeverityLow),
|
865
|
+
medium:o_(n_.UIStrings.itemSeverityMedium),high:o_(n_.UIStrings.itemSeverityHigh)};class NoVulnerableLibrariesAudit extends e_{static get meta(){return{id:"no-vulnerable-libraries",title:o_(i_.title),failureTitle:o_(i_.failureTitle),description:o_(i_.description),requiredArtifacts:["Stacks"]}}static get snykDB(){return a_}static get severityMap(){return{high:3,medium:2,low:1}}static normalizeVersion(e){if(!e)return e;if(r_.valid(e))return e;if(/^\d+\.\d+$/.test(e))return`${e}.0`;const t=e.match(s_);return t?t[1]:e}static getVulnerabilities(e,t,r){if(!t.npm||!r.npm[t.npm])return[];try{r_.satisfies(e,"*")}catch(e){return e.pkgName=t.npm,t_.captureException(e,{level:"warning"}),[]}return r.npm[t.npm].filter((t=>t.semver.vulnerable.some((t=>r_.satisfies(e,t))))).map((r=>({severity:c_[r.severity],numericSeverity:this.severityMap[r.severity],library:`${t.name}@${e}`,url:"https://snyk.io/vuln/"+r.id})))}static highestSeverity(e){
|
866
|
+
return e.sort(((e,t)=>t.numericSeverity-e.numericSeverity))[0].severity}static audit(e){const t=e.Stacks.filter((e=>"js"===e.detector)),r=NoVulnerableLibrariesAudit.snykDB;if(!t.length)return{score:1};let a=0;const n=[];for(const e of t){const t=this.normalizeVersion(e.version)||"",i=this.getVulnerabilities(t,e,r),o=i.length;let s;a+=o,i.length>0&&(s=this.highestSeverity(i),n.push({highestSeverity:s,vulnCount:o,detectedLib:{text:e.name+"@"+t,url:`https://snyk.io/vuln/npm:${e.npm}?lh=${t}&utm_source=lighthouse&utm_medium=ref&utm_campaign=audit`,type:"link"}}))}let i;a>0&&(i=o_(i_.displayValue,{itemCount:a}));const o=[{key:"detectedLib",itemType:"link",text:o_(i_.columnVersion)},{key:"vulnCount",itemType:"text",text:o_(i_.columnVuln)},{key:"highestSeverity",itemType:"text",text:o_(i_.columnSeverity)}],s=e_.makeTableDetails(o,n,{});return{score:Number(0===a),displayValue:i,details:s}}}Zx.exports=NoVulnerableLibrariesAudit,Zx.exports.UIStrings=i_;var l_={exports:{}};const u_=Lx,d_=oi,m_={
|
867
|
+
title:"Avoids requesting the notification permission on page load",failureTitle:"Requests the notification permission on page load",description:"Users are mistrustful of or confused by sites that request to send notifications without context. Consider tying the request to user gestures instead. [Learn more](https://web.dev/notification-on-start/)."},p_=d_.createMessageInstanceIdFn("lighthouse-core/audits/dobetterweb/notification-on-start.js",m_);l_.exports=class NotificationOnStart extends u_{static get meta(){return{id:"notification-on-start",title:p_(m_.title),failureTitle:p_(m_.failureTitle),description:p_(m_.description),supportedModes:["navigation"],requiredArtifacts:["ConsoleMessages","SourceMaps","ScriptElements"]}}static async audit(e,t){const r=await u_.getViolationResults(e,t,/notification permission/),a=[{key:"source",itemType:"source-location",text:p_(d_.UIStrings.columnSource)}],n=u_.makeTableDetails(a,r);return{score:Number(0===r.length),details:n}}},
|
868
|
+
l_.exports.UIStrings=m_;var h_={exports:{}};const g_=kc,f_=oi,y_={title:"Allows users to paste into password fields",failureTitle:"Prevents users to paste into password fields",description:"Preventing password pasting undermines good security policy. [Learn more](https://web.dev/password-inputs-can-be-pasted-into/)."},v_=f_.createMessageInstanceIdFn("lighthouse-core/audits/dobetterweb/password-inputs-can-be-pasted-into.js",y_);h_.exports=class PasswordInputsCanBePastedIntoAudit extends g_{static get meta(){return{id:"password-inputs-can-be-pasted-into",title:v_(y_.title),failureTitle:v_(y_.failureTitle),description:v_(y_.description),requiredArtifacts:["PasswordInputsWithPreventedPaste"]}}static audit(e){const t=e.PasswordInputsWithPreventedPaste,r=[];t.forEach((e=>{r.push({node:g_.makeNodeItem(e.node)})}));const a=[{key:"node",itemType:"node",text:v_(f_.UIStrings.columnFailingElem)}];return{score:Number(0===t.length),details:g_.makeTableDetails(a,r)}}},h_.exports.UIStrings=y_;var b_={
|
869
|
+
exports:{}};const w_=kc,S_=uw,T_=ji,E_=Ib,x_=Tb,A_=Ki,R_=Lo,k_=Dl,D_=eb,C_=oi,I_={title:"Use HTTP/2",description:"HTTP/2 offers many benefits over HTTP/1.1, including binary headers and multiplexing. [Learn more](https://web.dev/uses-http2/).",displayValue:"{itemCount, plural,\n =1 {1 request not served via HTTP/2}\n other {# requests not served via HTTP/2}\n }",columnProtocol:"Protocol"},N_=C_.createMessageInstanceIdFn("lighthouse-core/audits/dobetterweb/uses-http2.js",I_),L_=new Set([A_.TYPES.Document,A_.TYPES.Font,A_.TYPES.Image,A_.TYPES.Stylesheet,A_.TYPES.Script,A_.TYPES.Media]);class UsesHTTP2Audit extends w_{static get meta(){return{id:"uses-http2",title:N_(I_.title),description:N_(I_.description),scoreDisplayMode:w_.SCORING_MODES.NUMERIC,supportedModes:["timespan","navigation"],requiredArtifacts:["URL","devtoolsLogs","traces","GatherContext"]}}static computeWasteWithTTIGraph(e,t,r){const a=new Set(e.map((e=>e.url))),n=r.simulate(t,{label:"uses-http2-before",
|
870
|
+
flexibleOrdering:true}),i=new Map;t.traverse((e=>{"network"===e.type&&a.has(e.record.url)&&(i.set(e.record.requestId,e.record.protocol),e.record.protocol="h2")}));const o=r.simulate(t,{label:"uses-http2-after",flexibleOrdering:true});t.traverse((e=>{if("network"!==e.type)return;const t=i.get(e.record.requestId);void 0!==t&&(e.record.protocol=t)}));const s=n.timeInMs-o.timeInMs,c=x_.getLastLongTaskEndTime(n.nodeTimings)-x_.getLastLongTaskEndTime(o.nodeTimings),l=Math.max(c,s);return 10*Math.round(Math.max(l,0)/10)}static isStaticAsset(e){if(!L_.has(e.resourceType))return!1;if(e.resourceSize<100){if(S_.getEntity(e.url))return!1}return!0}static determineNonHttp2Resources(e){const t=[],r=new Set,a=new Map;for(const t of e){if(!UsesHTTP2Audit.isStaticAsset(t))continue;if(T_.isLikeLocalhost(t.parsedURL.host))continue;const e=a.get(t.parsedURL.securityOrigin)||[];e.push(t),a.set(t.parsedURL.securityOrigin,e)}for(const n of e){if(r.has(n.url))continue;if(n.fetchedViaServiceWorker)continue
|
871
|
+
;if(!/HTTP\/[01][.\d]?/i.test(n.protocol))continue;(a.get(n.parsedURL.securityOrigin)||[]).length<6||(r.add(n.url),t.push({protocol:n.protocol,url:n.url}))}return t}static async audit(e,t){const r=e.traces[w_.DEFAULT_PASS],a=e.devtoolsLogs[w_.DEFAULT_PASS],n=await R_.request(a,t),i=UsesHTTP2Audit.determineNonHttp2Resources(n);let o;if(i.length>0&&(o=N_(I_.displayValue,{itemCount:i.length})),"timespan"===e.GatherContext.gatherMode){const e=[{key:"url",itemType:"url",text:N_(C_.UIStrings.columnURL)},{key:"protocol",itemType:"text",text:N_(I_.columnProtocol)}],t=w_.makeTableDetails(e,i);return{displayValue:o,score:i.length?0:1,details:t}}const s={devtoolsLog:a,settings:t?.settings||{}},c=await D_.request({trace:r,devtoolsLog:a},t),l=await k_.request(s,t),u=UsesHTTP2Audit.computeWasteWithTTIGraph(i,c,l),d=[{key:"url",valueType:"url",label:N_(C_.UIStrings.columnURL)},{key:"protocol",valueType:"text",label:N_(I_.columnProtocol)}],m=w_.makeOpportunityDetails(d,i,u);return{displayValue:o,
|
872
|
+
numericValue:u,numericUnit:"millisecond",score:E_.scoreForWastedMs(u),details:m}}}b_.exports=UsesHTTP2Audit,b_.exports.UIStrings=I_;var M_={exports:{}};const P_=Lx,O_=oi,F_={title:"Uses passive listeners to improve scrolling performance",failureTitle:"Does not use passive listeners to improve scrolling performance",description:"Consider marking your touch and wheel event listeners as `passive` to improve your page's scroll performance. [Learn more](https://web.dev/uses-passive-event-listeners/)."},U_=O_.createMessageInstanceIdFn("lighthouse-core/audits/dobetterweb/uses-passive-event-listeners.js",F_);M_.exports=class PassiveEventsAudit extends P_{static get meta(){return{id:"uses-passive-event-listeners",title:U_(F_.title),failureTitle:U_(F_.failureTitle),description:U_(F_.description),requiredArtifacts:["ConsoleMessages","SourceMaps","ScriptElements"]}}static async audit(e,t){const r=await P_.getViolationResults(e,t,/passive event listener/),a=[{key:"source",
|
873
|
+
itemType:"source-location",text:U_(O_.UIStrings.columnSource)}],n=P_.makeTableDetails(a,r);return{score:Number(0===r.length),details:n}}},M_.exports.UIStrings=F_;var j_={exports:{}};const B_=on.default,$_=kc,q_=jb,z_=oi,V_={title:"No browser errors logged to the console",failureTitle:"Browser errors were logged to the console",description:"Errors logged to the console indicate unresolved problems. They can come from network request failures and other browser concerns. [Learn more](https://web.dev/errors-in-console/)"},W_=z_.createMessageInstanceIdFn("lighthouse-core/audits/errors-in-console.js",V_);class ErrorLogs extends $_{static get meta(){return{id:"errors-in-console",title:W_(V_.title),failureTitle:W_(V_.failureTitle),description:W_(V_.description),requiredArtifacts:["ConsoleMessages","SourceMaps","ScriptElements"]}}static get defaultOptions(){return{ignoredPatterns:["ERR_BLOCKED_BY_CLIENT.Inspector"]}}static filterAccordingToOptions(e,t){
|
874
|
+
const{ignoredPatterns:r,...a}=t,n=Object.keys(a);return n.length&&B_.warn(this.meta.id,"Unrecognized options",n),r?e.filter((({description:e})=>{if(!e)return!0;for(const t of r){if(t instanceof RegExp&&t.test(e))return!1;if("string"==typeof t&&e.includes(t))return!1}return!0})):e}static async audit(e,t){const r=t.options,a=await q_.request(e,t),n=e.ConsoleMessages.filter((e=>"error"===e.level)).map((e=>{const t=a.find((t=>t.script.src===e.url));return{source:e.source,description:e.text,sourceLocation:$_.makeSourceLocationFromConsoleMessage(e,t)}})),i=ErrorLogs.filterAccordingToOptions(n,r).sort(((e,t)=>(e.description||"").localeCompare(t.description||""))),o=[{key:"sourceLocation",itemType:"source-location",text:W_(z_.UIStrings.columnSource)},{key:"description",itemType:"code",text:W_(z_.UIStrings.columnDescription)}],s=$_.makeTableDetails(o,i),c=i.length;return{score:Number(0===c),details:s}}}j_.exports=ErrorLogs,j_.exports.UIStrings=V_;const G_=Ao;var H_=G_(class Screenshots$1{
|
875
|
+
static async compute_(e){return e.traceEvents.filter((e=>"Screenshot"===e.name)).map((e=>({timestamp:e.ts,datauri:`data:image/jpeg;base64,${e.args.snapshot}`})))}},null);const Y_=kc,K_=vi.exports,J_=Yp,X_=H_;var Z_=class FinalScreenshot extends Y_{static get meta(){return{id:"final-screenshot",scoreDisplayMode:Y_.SCORING_MODES.INFORMATIVE,title:"Final Screenshot",description:"The last screenshot captured of the pageload.",requiredArtifacts:["traces","GatherContext"]}}static async audit(e,t){const r=e.traces[Y_.DEFAULT_PASS],a=await J_.request(r,t),n=await X_.request(r,t),{timeOrigin:i}=a.timestamps,o=n[n.length-1];if(!o){if("timespan"===e.GatherContext.gatherMode)return{notApplicable:!0,score:1};throw new K_(K_.errors.NO_SCREENSHOTS)}return{score:1,details:{type:"screenshot",timing:Math.round((o.timestamp-i)/1e3),timestamp:o.timestamp,data:o.datauri}}}},Q_={exports:{}};const eA=kc,tA=ji,rA=/^(block|fallback|optional|swap)$/,aA=/url\((.*?)\)/,nA=new RegExp(aA,"g"),iA=oi,oA=Jl,sA=Lo,cA={
|
876
|
+
title:"All text remains visible during webfont loads",failureTitle:"Ensure text remains visible during webfont load",description:"Leverage the font-display CSS feature to ensure text is user-visible while webfonts are loading. [Learn more](https://web.dev/font-display/).",undeclaredFontOriginWarning:"{fontCountForOrigin, plural, =1 {Lighthouse was unable to automatically check the `font-display` value for the origin {fontOrigin}.} other {Lighthouse was unable to automatically check the `font-display` values for the origin {fontOrigin}.}}"},lA=iA.createMessageInstanceIdFn("lighthouse-core/audits/font-display.js",cA);class FontDisplay$1 extends eA{static get meta(){return{id:"font-display",title:lA(cA.title),failureTitle:lA(cA.failureTitle),description:lA(cA.description),supportedModes:["navigation"],requiredArtifacts:["devtoolsLogs","CSSUsage","URL"]}}static findFontDisplayDeclarations(e,t){const r=new Set,a=new Set;for(const n of e.CSSUsage.stylesheets){
|
877
|
+
const i=n.content.replace(/(\r|\n)+/g," ").match(/@font-face\s*{(.*?)}/g)||[];for(const o of i){const i=o.match(nA);if(!i)continue;const s=o.match(/font-display\s*:\s*(\w+)\s*(;|\})/)?.[1]||"",c=t.test(s)?r:a,l=i.map((e=>e.match(aA)[1].trim())).map((e=>/^('|").*\1$/.test(e)?e.substr(1,e.length-2):e));for(const t of l)try{const r=tA.isValid(n.header.sourceURL)?n.header.sourceURL:e.URL.finalUrl,a=new tA(t,r);c.add(a.href)}catch(e){oA.captureException(e,{tags:{audit:this.meta.id}})}}}return{passingURLs:r,failingURLs:a}}static getWarningsForFontUrls(e){const t=new Map;for(const r of e){const e=tA.getOrigin(r);if(!e)continue;const a=t.get(e)||0;t.set(e,a+1)}return[...t].map((([e,t])=>lA(cA.undeclaredFontOriginWarning,{fontCountForOrigin:t,fontOrigin:e})))}static async audit(e,t){
|
878
|
+
const r=e.devtoolsLogs[this.DEFAULT_PASS],a=await sA.request(r,t),{passingURLs:n,failingURLs:i}=FontDisplay$1.findFontDisplayDeclarations(e,rA),o=[],s=a.filter((e=>"Font"===e.resourceType)).filter((e=>!/^data:/.test(e.url))).filter((e=>!/^blob:/.test(e.url))).filter((e=>!!i.has(e.url)||(n.has(e.url)||o.push(e.url),!1))).map((e=>{const t=Math.min(1e3*(e.endTime-e.startTime),3e3);return{url:e.url,wastedMs:t}})),c=[{key:"url",itemType:"url",text:lA(iA.UIStrings.columnURL)},{key:"wastedMs",itemType:"ms",text:lA(iA.UIStrings.columnWastedMs)}],l=eA.makeTableDetails(c,s);return{score:Number(0===s.length),details:l,warnings:FontDisplay$1.getWarningsForFontUrls(o)}}}Q_.exports=FontDisplay$1,Q_.exports.UIStrings=cA;
|
877
879
|
/**
|
878
880
|
* @license Copyright 2020 Google Inc. All Rights Reserved.
|
879
881
|
* 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
|
880
882
|
* 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.
|
881
883
|
*/
|
882
|
-
const
|
883
|
-
failureTitle:
|
884
|
-
itemType:"url",text:
|
885
|
-
return!(e.displayedWidth<=1||e.displayedHeight<=1)&&(!!(e.naturalDimensions&&e.naturalDimensions.width&&e.naturalDimensions.height)&&("image/svg+xml"!==
|
886
|
-
actualSize:`${e.naturalDimensions.width} x ${e.naturalDimensions.height}`,actualPixels:e.naturalDimensions.width*e.naturalDimensions.height,expectedSize:`${r} x ${a}`,expectedPixels:r*a}}function quantizeDpr(e){return e>=2?2:e>=1.5?1.5:1}
|
887
|
-
}(t.clientRect,e.ViewportDimensions))).map((e=>getResult(e,t))),a=[{key:"node",itemType:"node",text:""},{key:"url",itemType:"url",text:
|
888
|
-
const r=t.icons.value,a=[];return r.filter((e=>{const t=e.value.type.value;if(t)return"image/png"===t;const r=e.value.src.value;return r&&new
|
889
|
-
failureText:"Manifest does not have a PNG icon of at least 512px",validate:e=>
|
890
|
-
},{id:"hasName",failureText:"Manifest does not have `name`",validate:e=>!!e.name.value},{id:"hasMaskableIcon",failureText:"Manifest does not have at least one icon that is maskable",validate:e=>
|
884
|
+
const uA=kc;var dA=class FullPageScreenshot extends uA{static get meta(){return{id:"full-page-screenshot",scoreDisplayMode:uA.SCORING_MODES.INFORMATIVE,title:"Full-page screenshot",description:"A full-height screenshot of the final rendered page",requiredArtifacts:["FullPageScreenshot"]}}static async audit(e){return e.FullPageScreenshot?{score:1,details:{type:"full-page-screenshot",...e.FullPageScreenshot}}:{score:0,notApplicable:!0}}},mA={exports:{}};const pA=kc,hA=ji,gA=oi,fA={title:"Displays images with correct aspect ratio",failureTitle:"Displays images with incorrect aspect ratio",description:"Image display dimensions should match natural aspect ratio. [Learn more](https://web.dev/image-aspect-ratio/).",columnDisplayed:"Aspect Ratio (Displayed)",columnActual:"Aspect Ratio (Actual)"},yA=gA.createMessageInstanceIdFn("lighthouse-core/audits/image-aspect-ratio.js",fA);class ImageAspectRatio extends pA{static get meta(){return{id:"image-aspect-ratio",title:yA(fA.title),
|
885
|
+
failureTitle:yA(fA.failureTitle),description:yA(fA.description),requiredArtifacts:["ImageElements"]}}static computeAspectRatios(e){const t=hA.elideDataURI(e.src),r=e.naturalDimensions.width/e.naturalDimensions.height,a=e.displayedWidth/e.displayedHeight,n=e.displayedWidth/r,i=Math.abs(n-e.displayedHeight)<2;return{url:t,node:pA.makeNodeItem(e.node),displayedAspectRatio:`${e.displayedWidth} x ${e.displayedHeight}\n (${a.toFixed(2)})`,actualAspectRatio:`${e.naturalDimensions.width} x ${e.naturalDimensions.height}\n (${r.toFixed(2)})`,doRatiosMatch:i}}static audit(e){const t=e.ImageElements,r=[];t.filter((e=>!e.isCss&&"image/svg+xml"!==hA.guessMimeType(e.src)&&e.naturalDimensions&&e.naturalDimensions.height>5&&e.naturalDimensions.width>5&&e.displayedWidth&&e.displayedHeight&&"fill"===e.computedStyles.objectFit)).forEach((e=>{const t=e,a=ImageAspectRatio.computeAspectRatios(t);a.doRatiosMatch||r.push(a)}));const a=[{key:"node",itemType:"node",text:""},{key:"url",
|
886
|
+
itemType:"url",text:yA(gA.UIStrings.columnURL)},{key:"displayedAspectRatio",itemType:"text",text:yA(fA.columnDisplayed)},{key:"actualAspectRatio",itemType:"text",text:yA(fA.columnActual)}];return{score:Number(0===r.length),details:pA.makeTableDetails(a,r)}}}mA.exports=ImageAspectRatio,mA.exports.UIStrings=fA;var vA={exports:{}};const bA=kc,wA=ji,SA=oi,TA={title:"Serves images with appropriate resolution",failureTitle:"Serves images with low resolution",description:"Image natural dimensions should be proportional to the display size and the pixel ratio to maximize image clarity. [Learn more](https://web.dev/serve-responsive-images/).",columnDisplayed:"Displayed size",columnActual:"Actual size",columnExpected:"Expected size"},EA=SA.createMessageInstanceIdFn("lighthouse-core/audits/image-size-responsive.js",TA);function isCandidate(e){
|
887
|
+
return!(e.displayedWidth<=1||e.displayedHeight<=1)&&(!!(e.naturalDimensions&&e.naturalDimensions.width&&e.naturalDimensions.height)&&("image/svg+xml"!==wA.guessMimeType(e.src)&&(!e.isCss&&("fill"===e.computedStyles.objectFit&&(!["pixelated","crisp-edges"].includes(e.computedStyles.imageRendering)&&!/ \d+(\.\d+)?x/.test(e.srcset))))))}function imageHasNaturalDimensions(e){return!!e.naturalDimensions}function imageHasRightSize(e,t){const[r,a]=function allowedImageSize(e,t,r){let a=1;(e>64||t>64)&&(a=.75);const n=quantizeDpr(r),i=Math.ceil(a*n*e),o=Math.ceil(a*n*t);return[i,o]}(e.displayedWidth,e.displayedHeight,t);return e.naturalDimensions.width>=r&&e.naturalDimensions.height>=a}function getResult(e,t){const[r,a]=function expectedImageSize(e,t,r){const a=Math.ceil(quantizeDpr(r)*e),n=Math.ceil(quantizeDpr(r)*t);return[a,n]}(e.displayedWidth,e.displayedHeight,t);return{url:wA.elideDataURI(e.src),node:bA.makeNodeItem(e.node),displayedSize:`${e.displayedWidth} x ${e.displayedHeight}`,
|
888
|
+
actualSize:`${e.naturalDimensions.width} x ${e.naturalDimensions.height}`,actualPixels:e.naturalDimensions.width*e.naturalDimensions.height,expectedSize:`${r} x ${a}`,expectedPixels:r*a}}function quantizeDpr(e){return e>=2?2:e>=1.5?1.5:1}vA.exports=class ImageSizeResponsive extends bA{static get meta(){return{id:"image-size-responsive",title:EA(TA.title),failureTitle:EA(TA.failureTitle),description:EA(TA.description),requiredArtifacts:["ImageElements","ViewportDimensions"]}}static audit(e){const t=e.ViewportDimensions.devicePixelRatio,r=Array.from(e.ImageElements).filter(isCandidate).filter(imageHasNaturalDimensions).filter((e=>!imageHasRightSize(e,t))).filter((t=>function isVisible(e,t){return(e.bottom-e.top)*(e.right-e.left)>0&&e.top<=t.innerHeight&&e.bottom>=0&&e.left<=t.innerWidth&&e.right>=0}(t.clientRect,e.ViewportDimensions))).filter((t=>function isSmallerThanViewport(e,t){return e.bottom-e.top<=t.innerHeight&&e.right-e.left<=t.innerWidth
|
889
|
+
}(t.clientRect,e.ViewportDimensions))).map((e=>getResult(e,t))),a=[{key:"node",itemType:"node",text:""},{key:"url",itemType:"url",text:EA(SA.UIStrings.columnURL)},{key:"displayedSize",itemType:"text",text:EA(TA.columnDisplayed)},{key:"actualSize",itemType:"text",text:EA(TA.columnActual)},{key:"expectedSize",itemType:"text",text:EA(TA.columnExpected)}],n=function sortResultsBySizeDelta(e){return e.sort(((e,t)=>t.expectedPixels-t.actualPixels-(e.expectedPixels-e.actualPixels)))}(function deduplicateResultsByUrl(e){e.sort(((e,t)=>e.url===t.url?0:e.url<t.url?-1:1));const t=[];for(const r of e){const e=t[t.length-1];e&&e.url===r.url?e.expectedPixels<r.expectedPixels&&(t[t.length-1]=r):t.push(r)}return t}(r));return{score:Number(0===r.length),details:bA.makeTableDetails(a,n)}}},vA.exports.UIStrings=TA;var xA={exports:{}};const _A=ji;const AA=Ao,RA={doExist:function doExist(e){return!(!e||!e.icons)&&0!==e.icons.value.length},pngSizedAtLeast:function pngSizedAtLeast(e,t){
|
890
|
+
const r=t.icons.value,a=[];return r.filter((e=>{const t=e.value.type.value;if(t)return"image/png"===t;const r=e.value.src.value;return r&&new _A(r).pathname.endsWith(".png")})).forEach((e=>{e.value.sizes.value&&a.push(...e.value.sizes.value)})),a.filter((e=>/\d+x\d+/.test(e))).filter((t=>{const r=t.split(/x/i),a=[parseFloat(r[0]),parseFloat(r[1])];return a[0]>=e&&a[1]>=e&&a[0]===a[1]}))},containsMaskableIcon:function containsMaskableIcon(e){return e.icons.value.some((e=>e.value.purpose?.value&&e.value.purpose.value.includes("maskable")))}},kA=["minimal-ui","fullscreen","standalone"];class ManifestValues$4{static get manifestChecks(){return[{id:"hasStartUrl",failureText:"Manifest does not contain a `start_url`",validate:e=>!!e.start_url.value},{id:"hasIconsAtLeast144px",failureText:"Manifest does not have a PNG icon of at least 144px",validate:e=>RA.doExist(e)&&RA.pngSizedAtLeast(144,e).length>0},{id:"hasIconsAtLeast512px",
|
891
|
+
failureText:"Manifest does not have a PNG icon of at least 512px",validate:e=>RA.doExist(e)&&RA.pngSizedAtLeast(512,e).length>0},{id:"fetchesIcon",failureText:"Manifest icon failed to be fetched",validate:(e,t)=>{const r=["cannot-download-icon","no-icon-available"];return RA.doExist(e)&&!t.some((e=>r.includes(e.errorId)))}},{id:"hasPWADisplayValue",failureText:"Manifest's `display` value is not one of: "+kA.join(" | "),validate:e=>kA.includes(e.display.value)},{id:"hasBackgroundColor",failureText:"Manifest does not have `background_color`",validate:e=>!!e.background_color.value},{id:"hasThemeColor",failureText:"Manifest does not have `theme_color`",validate:e=>!!e.theme_color.value},{id:"hasShortName",failureText:"Manifest does not have `short_name`",validate:e=>!!e.short_name.value},{id:"shortNameLength",failureText:"Manifest's `short_name` is too long (>12 characters) to be displayed on a homescreen without truncation",validate:e=>!!e.short_name.value&&e.short_name.value.length<=12
|
892
|
+
},{id:"hasName",failureText:"Manifest does not have `name`",validate:e=>!!e.name.value},{id:"hasMaskableIcon",failureText:"Manifest does not have at least one icon that is maskable",validate:e=>RA.doExist(e)&&RA.containsMaskableIcon(e)}]}static async compute_({WebAppManifest:e,InstallabilityErrors:t}){if(null===e)return{isParseFailure:!0,parseFailureReason:"No manifest was fetched",allChecks:[]};const r=e.value;if(void 0===r)return{isParseFailure:!0,parseFailureReason:"Manifest failed to parse as valid JSON",allChecks:[]};return{isParseFailure:!1,allChecks:ManifestValues$4.manifestChecks.map((e=>({id:e.id,failureText:e.failureText,passing:e.validate(r,t.errors)})))}}}var DA=AA(ManifestValues$4,["InstallabilityErrors","WebAppManifest"]);const CA=kc,IA=DA,NA={title:"Web app manifest and service worker meet the installability requirements",failureTitle:"Web app manifest or service worker do not meet the installability requirements",
|
891
893
|
description:"Service worker is the technology that enables your app to use many Progressive Web App features, such as offline, add to homescreen, and push notifications. With proper service worker and manifest implementations, browsers can proactively prompt users to add your app to their homescreen, which can lead to higher engagement. [Learn more](https://web.dev/installable-manifest/).",columnValue:"Failure reason",displayValue:"{itemCount, plural,\n =1 {1 reason}\n other {# reasons}\n }",noErrorId:"Installability error id '{errorId}' is not recognized","not-in-main-frame":"Page is not loaded in the main frame","not-from-secure-origin":"Page is not served from a secure origin","no-manifest":"Page has no manifest <link> URL","start-url-not-valid":"Manifest start URL is not valid","manifest-missing-name-or-short-name":"Manifest does not contain a 'name' or 'short_name' field",
|
892
894
|
"manifest-display-not-supported":"Manifest 'display' property must be one of 'standalone', 'fullscreen', or 'minimal-ui'","manifest-empty":"Manifest could not be fetched, is empty, or could not be parsed","no-matching-service-worker":"No matching service worker detected. You may need to reload the page, or check that the scope of the service worker for the current page encloses the scope and start URL from the manifest.","manifest-missing-suitable-icon":'Manifest does not contain a suitable icon - PNG, SVG or WebP format of at least {value0} px is required, the sizes attribute must be set, and the purpose attribute, if set, must include "any".',"no-acceptable-icon":'No supplied icon is at least {value0} px square in PNG, SVG or WebP format, with the purpose attribute unset or set to "any"',"cannot-download-icon":"Could not download a required icon from the manifest","no-icon-available":"Downloaded icon was empty or corrupted",
|
893
895
|
"platform-not-supported-on-android":"The specified application platform is not supported on Android","no-id-specified":"No Play store ID provided","ids-do-not-match":"The Play Store app URL and Play Store ID do not match","already-installed":"The app is already installed","url-not-supported-for-webapk":"A URL in the manifest contains a username, password, or port","in-incognito":"Page is loaded in an incognito window","not-offline-capable":"Page does not work offline","no-url-for-service-worker":"Could not check service worker without a 'start_url' field in the manifest","prefer-related-applications":"Manifest specifies prefer_related_applications: true","prefer-related-applications-only-beta-stable":"prefer_related_applications is only supported on Chrome Beta and Stable channels on Android.","manifest-display-override-not-supported":"Manifest contains 'display_override' field, and the first supported display mode must be one of 'standalone', 'fullscreen', or 'minimal-ui'",
|
894
|
-
"manifest-location-changed":"Manifest URL changed while the manifest was being fetched.","warn-not-offline-capable":"Page does not work offline. The page will not be regarded as installable after Chrome 93, stable release August 2021.","protocol-timeout":"Lighthouse could not determine if there was a service worker. Please try with a newer version of Chrome.","pipeline-restarted":"PWA has been uninstalled and installability checks resetting.","scheme-not-supported-for-webapk":"The manifest URL scheme ({scheme}) is not supported on Android."},
|
895
|
-
;for(const i of t){if("in-incognito"===i.errorId)continue;if("warn-not-offline-capable"===i.errorId){a.push(
|
896
|
-
itemType:"text",text:
|
897
|
-
description:"All sites should be protected with HTTPS, even ones that don't handle sensitive data. This includes avoiding [mixed content](https://developers.google.com/web/fundamentals/security/prevent-mixed-content/what-is-mixed-content), where some resources are loaded over HTTP despite the initial request being served over HTTPS. HTTPS prevents intruders from tampering with or passively listening in on the communications between your app and your users, and is a prerequisite for HTTP/2 and many new web platform APIs. [Learn more](https://web.dev/is-on-https/).",displayValue:"{itemCount, plural,\n =1 {1 insecure request found}\n other {# insecure requests found}\n }",columnInsecureURL:"Insecure URL",columnResolution:"Request Resolution",allowed:"Allowed",blocked:"Blocked",warning:"Allowed with warning",upgraded:"Automatically upgraded to HTTPS"},
|
898
|
-
}
|
899
|
-
score:Number(0===a.length),displayValue:i,details:
|
900
|
-
}],n=
|
896
|
+
"manifest-location-changed":"Manifest URL changed while the manifest was being fetched.","warn-not-offline-capable":"Page does not work offline. The page will not be regarded as installable after Chrome 93, stable release August 2021.","protocol-timeout":"Lighthouse could not determine if there was a service worker. Please try with a newer version of Chrome.","pipeline-restarted":"PWA has been uninstalled and installability checks resetting.","scheme-not-supported-for-webapk":"The manifest URL scheme ({scheme}) is not supported on Android."},LA=oi.createMessageInstanceIdFn("lighthouse-core/audits/installable-manifest.js",NA);class InstallableManifest extends CA{static get meta(){return{id:"installable-manifest",title:LA(NA.title),failureTitle:LA(NA.failureTitle),description:LA(NA.description),supportedModes:["navigation"],requiredArtifacts:["WebAppManifest","InstallabilityErrors"]}}static getInstallabilityErrors(e){const t=e.InstallabilityErrors.errors,r=[],a=[],n=/{([^}]+)}/g
|
897
|
+
;for(const i of t){if("in-incognito"===i.errorId)continue;if("warn-not-offline-capable"===i.errorId){a.push(LA(NA[i.errorId]));continue}if("pipeline-restarted"===i.errorId)continue;const t=NA[i.errorId];if("scheme-not-supported-for-webapk"===i.errorId){const a=e.WebAppManifest?.url;if(!a)continue;const n=new URL(a).protocol;r.push(LA(t,{scheme:n}));continue}if(void 0===t){r.push(LA(NA.noErrorId,{errorId:i.errorId}));continue}const o=t.match(n)||[],s=i.errorArguments?.length&&i.errorArguments[0].value;if(t&&i.errorArguments.length!==o.length){const e=JSON.stringify(i.errorArguments),t=i.errorArguments.length>o.length?`${i.errorId} has unexpected arguments ${e}`:`${i.errorId} does not have the expected number of arguments.`;r.push(t)}else t&&s?r.push(LA(t,{value0:s})):t&&r.push(LA(t))}return{i18nErrors:r,warnings:a}}static async audit(e,t){const{i18nErrors:r,warnings:a}=InstallableManifest.getInstallabilityErrors(e),n=e.WebAppManifest?e.WebAppManifest.url:null,i=[{key:"reason",
|
898
|
+
itemType:"text",text:LA(NA.columnValue)}],o=r.map((e=>({reason:e})));if(!o.length){const r=await IA.request(e,t);r.isParseFailure&&o.push({reason:r.parseFailureReason})}const s={type:"debugdata",manifestUrl:n};return o.length>0?{score:0,warnings:a,numericValue:o.length,numericUnit:"element",displayValue:LA(NA.displayValue,{itemCount:o.length}),details:{...CA.makeTableDetails(i,o),debugData:s}}:{score:1,warnings:a,details:{...CA.makeTableDetails(i,o),debugData:s}}}}xA.exports=InstallableManifest,xA.exports.UIStrings=NA;var MA={exports:{}};const PA=kc,OA=ji,FA=Ki,UA=Lo,jA={title:"Uses HTTPS",failureTitle:"Does not use HTTPS",
|
899
|
+
description:"All sites should be protected with HTTPS, even ones that don't handle sensitive data. This includes avoiding [mixed content](https://developers.google.com/web/fundamentals/security/prevent-mixed-content/what-is-mixed-content), where some resources are loaded over HTTP despite the initial request being served over HTTPS. HTTPS prevents intruders from tampering with or passively listening in on the communications between your app and your users, and is a prerequisite for HTTP/2 and many new web platform APIs. [Learn more](https://web.dev/is-on-https/).",displayValue:"{itemCount, plural,\n =1 {1 insecure request found}\n other {# insecure requests found}\n }",columnInsecureURL:"Insecure URL",columnResolution:"Request Resolution",allowed:"Allowed",blocked:"Blocked",warning:"Allowed with warning",upgraded:"Automatically upgraded to HTTPS"},BA={MixedContentAutomaticallyUpgraded:jA.upgraded,MixedContentBlocked:jA.blocked,MixedContentWarning:jA.warning
|
900
|
+
},$A=oi.createMessageInstanceIdFn("lighthouse-core/audits/is-on-https.js",jA);MA.exports=class HTTPS extends PA{static get meta(){return{id:"is-on-https",title:$A(jA.title),failureTitle:$A(jA.failureTitle),description:$A(jA.description),requiredArtifacts:["devtoolsLogs","InspectorIssues"]}}static audit(e,t){const r=e.devtoolsLogs[PA.DEFAULT_PASS];return UA.request(r,t).then((t=>{const r=t.filter((e=>!FA.isSecureRequest(e))).map((e=>OA.elideDataURI(e.url))),a=Array.from(new Set(r)).map((e=>({url:e,resolution:void 0}))),n=[{key:"url",itemType:"url",text:$A(jA.columnInsecureURL)},{key:"resolution",itemType:"text",text:$A(jA.columnResolution)}];for(const t of e.InspectorIssues.mixedContentIssue){let e=a.find((e=>e.url===t.insecureURL));e||(e={url:t.insecureURL},a.push(e)),e.resolution=BA[t.resolutionStatus]?$A(BA[t.resolutionStatus]):t.resolutionStatus}for(const e of a)e.resolution||(e.resolution=$A(jA.allowed));let i;return a.length>0&&(i=$A(jA.displayValue,{itemCount:a.length})),{
|
901
|
+
score:Number(0===a.length),displayValue:i,details:PA.makeTableDetails(n,a)}}))}},MA.exports.UIStrings=jA;var qA={exports:{}};const zA=kc,VA=oi,WA={title:"Largest Contentful Paint element",description:"This is the largest contentful element painted within the viewport. [Learn More](https://web.dev/lighthouse-largest-contentful-paint/)"},GA=VA.createMessageInstanceIdFn("lighthouse-core/audits/largest-contentful-paint-element.js",WA);qA.exports=class LargestContentfulPaintElement extends zA{static get meta(){return{id:"largest-contentful-paint-element",title:GA(WA.title),description:GA(WA.description),scoreDisplayMode:zA.SCORING_MODES.INFORMATIVE,supportedModes:["navigation"],requiredArtifacts:["traces","TraceElements"]}}static audit(e){const t=e.TraceElements.find((e=>"largest-contentful-paint"===e.traceEventType)),r=[];t&&r.push({node:zA.makeNodeItem(t.node)});const a=[{key:"node",itemType:"node",text:GA(VA.UIStrings.columnElement)
|
902
|
+
}],n=zA.makeTableDetails(a,r),i=GA(VA.UIStrings.displayValueElementsFound,{nodeCount:r.length});return{score:1,notApplicable:0===r.length,displayValue:i,details:n}}},qA.exports.UIStrings=WA;var HA={exports:{}};
|
901
903
|
/**
|
902
904
|
* @license Copyright 2020 Google Inc. All Rights Reserved.
|
903
905
|
* 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
|
904
906
|
* 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.
|
905
|
-
*/const
|
906
|
-
|
907
|
-
const t=e.TraceElements.find((e=>"largest-contentful-paint"===e.traceEventType)),r=t?e.ImageElements.find((e=>e.node.devtoolsNodePath===t.node.devtoolsNodePath)):void 0;if(!r||!this.isImageInViewport(r,e.ViewportDimensions))return{score:1,notApplicable:!0};const a=[{key:"node",itemType:"node",text:
|
908
|
-
;class LongTasks$3 extends
|
909
|
-
startTime:e.startTime}))),u=[{key:"url",itemType:"url",text:
|
910
|
-
itemType:"ms",granularity:1,text:"Start Time"},{key:"duration",itemType:"ms",granularity:1,text:"End Time"}],a)}}},
|
911
|
-
;t.set(r.group.id,e+r.selfTime)}return t}static async audit(e,t){const r=t.settings||{},a=e.traces[MainThreadWorkBreakdown.DEFAULT_PASS],n=await
|
912
|
-
description:"To reach the most number of users, sites should work across every major browser. [Learn more](https://web.dev/pwa-cross-browser/)."},
|
913
|
-
;var
|
914
|
-
}
|
907
|
+
*/const YA=kc,KA=oi,JA={title:"Avoid large layout shifts",description:"These DOM elements contribute most to the CLS of the page.",columnContribution:"CLS Contribution"},XA=KA.createMessageInstanceIdFn("lighthouse-core/audits/layout-shift-elements.js",JA);HA.exports=class LayoutShiftElements extends YA{static get meta(){return{id:"layout-shift-elements",title:XA(JA.title),description:XA(JA.description),scoreDisplayMode:YA.SCORING_MODES.INFORMATIVE,requiredArtifacts:["traces","TraceElements"]}}static audit(e){const t=e.TraceElements.filter((e=>"layout-shift"===e.traceEventType)).map((e=>({node:YA.makeNodeItem(e.node),score:e.score}))),r=[{key:"node",itemType:"node",text:XA(KA.UIStrings.columnElement)},{key:"score",itemType:"numeric",granularity:.001,text:XA(JA.columnContribution)}],a=YA.makeTableDetails(r,t);let n;return t.length>0&&(n=XA(KA.UIStrings.displayValueElementsFound,{nodeCount:t.length})),{score:1,notApplicable:0===a.items.length,displayValue:n,details:a}}},
|
908
|
+
HA.exports.UIStrings=JA;var ZA={exports:{}};const QA=kc,eR=oi,tR={title:"Largest Contentful Paint image was not lazily loaded",failureTitle:"Largest Contentful Paint image was lazily loaded",description:"Above-the-fold images that are lazily loaded render later in the page lifecycle, which can delay the largest contentful paint. [Learn more](https://web.dev/lcp-lazy-loading/)."},rR=eR.createMessageInstanceIdFn("lighthouse-core/audits/lcp-lazy-loaded.js",tR);ZA.exports=class LargestContentfulPaintLazyLoaded extends QA{static get meta(){return{id:"lcp-lazy-loaded",title:rR(tR.title),failureTitle:rR(tR.failureTitle),description:rR(tR.description),supportedModes:["navigation"],requiredArtifacts:["TraceElements","ViewportDimensions","ImageElements"]}}static isImageInViewport(e,t){return e.clientRect.top<t.innerHeight}static audit(e){
|
909
|
+
const t=e.TraceElements.find((e=>"largest-contentful-paint"===e.traceEventType)),r=t?e.ImageElements.find((e=>e.node.devtoolsNodePath===t.node.devtoolsNodePath)):void 0;if(!r||!this.isImageInViewport(r,e.ViewportDimensions))return{score:1,notApplicable:!0};const a=[{key:"node",itemType:"node",text:rR(eR.UIStrings.columnElement)}],n=QA.makeTableDetails(a,[{node:QA.makeNodeItem(r.node)}]);return{score:"lazy"===r.loading?0:1,details:n}}},ZA.exports.UIStrings=tR;var aR={exports:{}};const nR=kc,iR=Lo,oR=oi,sR=Rv,cR=eb,lR=Dl,{getJavaScriptURLs:uR,getAttributableURLForTask:dR}=Iv,mR={startTime:0,endTime:0,duration:0},pR={title:"Avoid long main-thread tasks",description:"Lists the longest tasks on the main thread, useful for identifying worst contributors to input delay. [Learn more](https://web.dev/long-tasks-devtools/)",displayValue:"{itemCount, plural,\n =1 {# long task found}\n other {# long tasks found}\n }"},hR=oR.createMessageInstanceIdFn("lighthouse-core/audits/long-tasks.js",pR)
|
910
|
+
;class LongTasks$3 extends nR{static get meta(){return{id:"long-tasks",scoreDisplayMode:nR.SCORING_MODES.INFORMATIVE,title:hR(pR.title),description:hR(pR.description),requiredArtifacts:["traces","devtoolsLogs"]}}static async audit(e,t){const r=t.settings||{},a=e.traces[nR.DEFAULT_PASS],n=await sR.request(a,t),i=e.devtoolsLogs[LongTasks$3.DEFAULT_PASS],o=await iR.request(i,t),s=new Map;if("simulate"===r.throttlingMethod){const e={devtoolsLog:i,settings:t.settings},r=await cR.request({trace:a,devtoolsLog:i},t),n=await lR.request(e,t),o=await n.simulate(r,{label:"long-tasks-diagnostic"});for(const[e,t]of o.nodeTimings.entries())"cpu"===e.type&&s.set(e.event,t)}else for(const e of n)e.unbounded||e.parent||s.set(e.event,e);const c=uR(o),l=n.map((e=>{const t=s.get(e.event)||mR;return{...e,duration:t.duration,startTime:t.startTime}})).filter((e=>e.duration>=50&&!e.unbounded&&!e.parent)).sort(((e,t)=>t.duration-e.duration)).slice(0,20).map((e=>({url:dR(e,c),duration:e.duration,
|
911
|
+
startTime:e.startTime}))),u=[{key:"url",itemType:"url",text:hR(oR.UIStrings.columnURL)},{key:"startTime",itemType:"ms",granularity:1,text:hR(oR.UIStrings.columnStartTime)},{key:"duration",itemType:"ms",granularity:1,text:hR(oR.UIStrings.columnDuration)}],d=nR.makeTableDetails(u,l);let m;return l.length>0&&(m=hR(pR.displayValue,{itemCount:l.length})),{score:0===l.length?1:0,notApplicable:0===l.length,details:d,displayValue:m}}}aR.exports=LongTasks$3,aR.exports.UIStrings=pR;const gR=kc,fR=Rv;var yR=class MainThreadTasks$5 extends gR{static get meta(){return{id:"main-thread-tasks",scoreDisplayMode:gR.SCORING_MODES.INFORMATIVE,title:"Tasks",description:"Lists the toplevel main thread tasks that executed during page load.",requiredArtifacts:["traces"]}}static async audit(e,t){const r=e.traces[gR.DEFAULT_PASS],a=(await fR.request(r,t)).filter((e=>e.duration>5&&!e.parent)).map((e=>({duration:e.duration,startTime:e.startTime})));return{score:1,details:gR.makeTableDetails([{key:"startTime",
|
912
|
+
itemType:"ms",granularity:1,text:"Start Time"},{key:"duration",itemType:"ms",granularity:1,text:"End Time"}],a)}}},vR={exports:{}};const bR=kc,{taskGroups:wR}=wv,SR=oi,TR=Rv,ER={title:"Minimizes main-thread work",failureTitle:"Minimize main-thread work",description:"Consider reducing the time spent parsing, compiling and executing JS. You may find delivering smaller JS payloads helps with this. [Learn more](https://web.dev/mainthread-work-breakdown/)",columnCategory:"Category"},xR=SR.createMessageInstanceIdFn("lighthouse-core/audits/mainthread-work-breakdown.js",ER);class MainThreadWorkBreakdown extends bR{static get meta(){return{id:"mainthread-work-breakdown",title:xR(ER.title),failureTitle:xR(ER.failureTitle),description:xR(ER.description),scoreDisplayMode:bR.SCORING_MODES.NUMERIC,requiredArtifacts:["traces"]}}static get defaultOptions(){return{p10:2017,median:4e3}}static getExecutionTimingsByGroup(e){const t=new Map;for(const r of e){const e=t.get(r.group.id)||0
|
913
|
+
;t.set(r.group.id,e+r.selfTime)}return t}static async audit(e,t){const r=t.settings||{},a=e.traces[MainThreadWorkBreakdown.DEFAULT_PASS],n=await TR.request(a,t),i="simulate"===r.throttlingMethod?r.throttling.cpuSlowdownMultiplier:1,o=MainThreadWorkBreakdown.getExecutionTimingsByGroup(n);let s=0;const c={},l=Array.from(o).map((([e,t])=>{const r=t*i;s+=r;const a=c[e]||0;return c[e]=a+r,{group:e,groupLabel:wR[e].label,duration:r}})),u=[{key:"groupLabel",itemType:"text",text:xR(ER.columnCategory)},{key:"duration",itemType:"ms",granularity:1,text:xR(SR.UIStrings.columnTimeSpent)}];l.sort(((e,t)=>c[t.group]-c[e.group]));const d=MainThreadWorkBreakdown.makeTableDetails(u,l);return{score:bR.computeLogNormalScore({p10:t.options.p10,median:t.options.median},s),numericValue:s,numericUnit:"millisecond",displayValue:xR(SR.UIStrings.seconds,{timeInMs:s}),details:d}}}vR.exports=MainThreadWorkBreakdown,vR.exports.UIStrings=ER;var _R={exports:{}};const AR=iy,RR={title:"Site works cross-browser",
|
914
|
+
description:"To reach the most number of users, sites should work across every major browser. [Learn more](https://web.dev/pwa-cross-browser/)."},kR=oi.createMessageInstanceIdFn("lighthouse-core/audits/manual/pwa-cross-browser.js",RR);_R.exports=class PWACrossBrowser extends AR{static get meta(){return Object.assign({id:"pwa-cross-browser",title:kR(RR.title),description:kR(RR.description)},super.partialMeta)}},_R.exports.UIStrings=RR;var DR={exports:{}};const CR=iy,IR={title:"Each page has a URL",description:"Ensure individual pages are deep linkable via URL and that URLs are unique for the purpose of shareability on social media. [Learn more](https://web.dev/pwa-each-page-has-url/)."},NR=oi.createMessageInstanceIdFn("lighthouse-core/audits/manual/pwa-each-page-has-url.js",IR);DR.exports=class PWAEachPageHasURL extends CR{static get meta(){return Object.assign({id:"pwa-each-page-has-url",title:NR(IR.title),description:NR(IR.description)},super.partialMeta)}},DR.exports.UIStrings=IR
|
915
|
+
;var LR={exports:{}};const MR=iy,PR={title:"Page transitions don't feel like they block on the network",description:"Transitions should feel snappy as you tap around, even on a slow network. This experience is key to a user's perception of performance. [Learn more](https://web.dev/pwa-page-transitions/)."},OR=oi.createMessageInstanceIdFn("lighthouse-core/audits/manual/pwa-page-transitions.js",PR);LR.exports=class PWAPageTransitions extends MR{static get meta(){return Object.assign({id:"pwa-page-transitions",title:OR(PR.title),description:OR(PR.description)},super.partialMeta)}},LR.exports.UIStrings=PR;var FR={exports:{}};const UR=kc,jR=DA,BR={title:"Manifest has a maskable icon",failureTitle:"Manifest doesn't have a maskable icon",description:"A maskable icon ensures that the image fills the entire shape without being letterboxed when installing the app on a device. [Learn more](https://web.dev/maskable-icon-audit/)."
|
916
|
+
},$R=oi.createMessageInstanceIdFn("lighthouse-core/audits/maskable-icon.js",BR);FR.exports=class MaskableIcon extends UR{static get meta(){return{id:"maskable-icon",title:$R(BR.title),failureTitle:$R(BR.failureTitle),description:$R(BR.description),supportedModes:["navigation"],requiredArtifacts:["WebAppManifest","InstallabilityErrors"]}}static async audit(e,t){const r=await jR.request(e,t);if(r.isParseFailure)return{score:0,explanation:r.parseFailureReason};return{score:r.allChecks.find((e=>"hasMaskableIcon"===e.id))?.passing?1:0}}},FR.exports.UIStrings=BR;var qR={exports:{}};!function(e){function JPEGEncoder(e){
|
915
917
|
var t,r,a,n,i,o=Math.floor,s=new Array(64),c=new Array(64),l=new Array(64),u=new Array(64),d=new Array(65535),m=new Array(65535),p=new Array(64),h=new Array(64),f=[],y=0,v=7,b=new Array(64),w=new Array(64),S=new Array(64),T=new Array(256),E=new Array(2048),x=[0,1,5,6,14,15,27,28,2,4,7,13,16,26,29,42,3,8,12,17,25,30,41,43,9,11,18,24,31,40,44,53,10,19,23,32,39,45,52,54,20,22,33,38,46,51,55,60,21,34,37,47,50,56,59,61,35,36,48,49,57,58,62,63],_=[0,0,1,5,1,1,1,1,1,1,0,0,0,0,0,0,0],A=[0,1,2,3,4,5,6,7,8,9,10,11],R=[0,0,2,1,3,3,2,4,3,5,5,4,4,0,0,1,125],k=[1,2,3,0,4,17,5,18,33,49,65,6,19,81,97,7,34,113,20,50,129,145,161,8,35,66,177,193,21,82,209,240,36,51,98,114,130,9,10,22,23,24,25,26,37,38,39,40,41,42,52,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,225,226,227,228,229,230,231,232,233,234,241,242,243,244,245,246,247,248,249,250],D=[0,0,3,1,1,1,1,1,1,1,1,1,0,0,0,0,0],C=[0,1,2,3,4,5,6,7,8,9,10,11],I=[0,0,2,1,2,4,4,3,4,7,5,4,4,0,1,2,119],N=[0,1,2,3,17,4,5,33,49,6,18,65,81,7,97,113,19,34,50,129,8,20,66,145,161,177,193,9,35,51,82,240,21,98,114,209,10,22,36,52,225,37,241,23,24,25,26,38,39,40,41,42,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,130,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,226,227,228,229,230,231,232,233,234,242,243,244,245,246,247,248,249,250]
|
916
918
|
;function computeHuffmanTbl(e,t){for(var r=0,a=0,n=new Array,i=1;i<=16;i++){for(var o=1;o<=e[i];o++)n[t[a]]=[],n[t[a]][0]=r,n[t[a]][1]=i,a++,r++;r*=2}return n}function writeBits(e){for(var t=e[0],r=e[1]-1;r>=0;)t&1<<r&&(y|=1<<v),r--,--v<0&&(255==y?(writeByte(255),writeByte(0)):writeByte(y),v=7,y=0)}function writeByte(e){f.push(e)}function writeWord(e){writeByte(e>>8&255),writeByte(255&e)}function processDU(e,t,r,a,n){for(var i,o=n[0],s=n[240],c=function fDCTQuant(e,t){var r,a,n,i,o,s,c,l,u,d,m=0;for(u=0;u<8;++u){r=e[m],a=e[m+1],n=e[m+2],i=e[m+3],o=e[m+4],s=e[m+5],c=e[m+6];var h=r+(l=e[m+7]),f=r-l,y=a+c,v=a-c,b=n+s,w=n-s,S=i+o,T=i-o,E=h+S,x=h-S,_=y+b,A=y-b;e[m]=E+_,e[m+4]=E-_;var R=.707106781*(A+x);e[m+2]=x+R,e[m+6]=x-R;var k=.382683433*((E=T+w)-(A=v+f)),D=.5411961*E+k,C=1.306562965*A+k,I=.707106781*(_=w+v),N=f+I,L=f-I;e[m+5]=L+D,e[m+3]=L-D,e[m+1]=N+C,e[m+7]=N-C,m+=8}for(m=0,u=0;u<8;++u){r=e[m],a=e[m+8],n=e[m+16],i=e[m+24],o=e[m+32],s=e[m+40],c=e[m+48]
|
917
919
|
;var M=r+(l=e[m+56]),P=r-l,O=a+c,F=a-c,U=n+s,j=n-s,B=i+o,$=i-o,q=M+B,z=M-B,V=O+U,W=O-U;e[m]=q+V,e[m+32]=q-V;var G=.707106781*(W+z);e[m+16]=z+G,e[m+48]=z-G;var H=.382683433*((q=$+j)-(W=F+P)),Y=.5411961*q+H,K=1.306562965*W+H,J=.707106781*(V=j+F),X=P+J,Z=P-J;e[m+40]=Z+Y,e[m+24]=Z-Y,e[m+8]=X+K,e[m+56]=X-K,m++}for(u=0;u<64;++u)d=e[u]*t[u],p[u]=d>0?d+.5|0:d-.5|0;return p}(e,t),l=0;l<64;++l)h[x[l]]=c[l];var u=h[0]-r;r=h[0],0==u?writeBits(a[0]):(writeBits(a[m[i=32767+u]]),writeBits(d[i]));for(var f=63;f>0&&0==h[f];f--);if(0==f)return writeBits(o),r;for(var y,v=1;v<=f;){for(var b=v;0==h[v]&&v<=f;++v);var w=v-b;if(w>=16){y=w>>4;for(var S=1;S<=y;++S)writeBits(s);w&=15}i=32767+h[v],writeBits(n[(w<<4)+m[i]]),writeBits(d[i]),v++}return 63!=f&&writeBits(o),r}function setQuality(e){if(e<=0&&(e=1),e>100&&(e=100),i!=e){(function initQuantTables(e){
|
918
920
|
for(var t=[16,11,10,16,24,40,51,61,12,12,14,19,26,58,60,55,14,13,16,24,40,57,69,56,14,17,22,29,51,87,80,62,18,22,37,56,68,109,103,77,24,35,55,64,81,104,113,92,49,64,78,87,103,121,120,101,72,92,95,98,112,100,103,99],r=0;r<64;r++){var a=o((t[r]*e+50)/100);a<1?a=1:a>255&&(a=255),s[x[r]]=a}for(var n=[17,18,24,47,99,99,99,99,18,21,26,66,99,99,99,99,24,26,56,99,99,99,99,99,47,66,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99],i=0;i<64;i++){var d=o((n[i]*e+50)/100);d<1?d=1:d>255&&(d=255),c[x[i]]=d}for(var m=[1,1.387039845,1.306562965,1.175875602,1,.785694958,.5411961,.275899379],p=0,h=0;h<8;h++)for(var f=0;f<8;f++)l[p]=1/(s[x[p]]*m[h]*m[f]*8),u[p]=1/(c[x[p]]*m[h]*m[f]*8),p++})(e<50?Math.floor(5e3/e):Math.floor(200-2*e)),i=e}}this.encode=function(e,i){(new Date).getTime(),i&&setQuality(i),f=new Array,y=0,v=7,writeWord(65496),function writeAPP0(){writeWord(65504),writeWord(16),writeByte(74),writeByte(70),writeByte(73),
|
919
921
|
writeByte(70),writeByte(0),writeByte(1),writeByte(1),writeByte(0),writeWord(1),writeWord(1),writeByte(0),writeByte(0)}(),function writeAPP1(e){if(e){writeWord(65505),69===e[0]&&120===e[1]&&105===e[2]&&102===e[3]?writeWord(e.length+2):(writeWord(e.length+5+2),writeByte(69),writeByte(120),writeByte(105),writeByte(102),writeByte(0));for(var t=0;t<e.length;t++)writeByte(e[t])}}(e.exifBuffer),function writeDQT(){writeWord(65499),writeWord(132),writeByte(0);for(var e=0;e<64;e++)writeByte(s[e]);writeByte(1);for(var t=0;t<64;t++)writeByte(c[t])}(),function writeSOF0(e,t){writeWord(65472),writeWord(17),writeByte(8),writeWord(t),writeWord(e),writeByte(3),writeByte(1),writeByte(17),writeByte(0),writeByte(2),writeByte(17),writeByte(1),writeByte(3),writeByte(17),writeByte(1)}(e.width,e.height),function writeDHT(){writeWord(65476),writeWord(418),writeByte(0);for(var e=0;e<16;e++)writeByte(_[e+1]);for(var t=0;t<=11;t++)writeByte(A[t]);writeByte(16);for(var r=0;r<16;r++)writeByte(R[r+1])
|
920
922
|
;for(var a=0;a<=161;a++)writeByte(k[a]);writeByte(1);for(var n=0;n<16;n++)writeByte(D[n+1]);for(var i=0;i<=11;i++)writeByte(C[i]);writeByte(17);for(var o=0;o<16;o++)writeByte(I[o+1]);for(var s=0;s<=161;s++)writeByte(N[s])}(),function writeSOS(){writeWord(65498),writeWord(12),writeByte(3),writeByte(1),writeByte(0),writeByte(2),writeByte(17),writeByte(3),writeByte(17),writeByte(0),writeByte(63),writeByte(0)}();var o=0,d=0,m=0;y=0,v=7,this.encode.displayName="_encode_";for(var p,h,T,x,L,M,P,O,F,U=e.data,j=e.width,B=e.height,$=4*j,q=0;q<B;){for(p=0;p<$;){for(M=L=$*q+p,P=-1,O=0,F=0;F<64;F++)M=L+(O=F>>3)*$+(P=4*(7&F)),q+O>=B&&(M-=$*(q+1+O-B)),p+P>=$&&(M-=p+P-$+4),h=U[M++],T=U[M++],x=U[M++],b[F]=(E[h]+E[T+256>>0]+E[x+512>>0]>>16)-128,w[F]=(E[h+768>>0]+E[T+1024>>0]+E[x+1280>>0]>>16)-128,S[F]=(E[h+1280>>0]+E[T+1536>>0]+E[x+1792>>0]>>16)-128;o=processDU(b,l,o,t,a),d=processDU(w,u,d,r,n),m=processDU(S,u,m,r,n),p+=32}q+=8}if(v>=0){var z=[];z[1]=v+1,z[0]=(1<<v+1)-1,writeBits(z)}
|
921
|
-
return writeWord(65497),new Buffer$2(f)},function init(){(new Date).getTime(),e||(e=50),function initCharLookupTable(){for(var e=String.fromCharCode,t=0;t<256;t++)T[t]=e(t)}(),function initHuffmanTbl(){t=computeHuffmanTbl(_,A),r=computeHuffmanTbl(D,C),a=computeHuffmanTbl(R,k),n=computeHuffmanTbl(I,N)}(),function initCategoryNumber(){for(var e=1,t=2,r=1;r<=15;r++){for(var a=e;a<t;a++)m[32767+a]=r,d[32767+a]=[],d[32767+a][1]=r,d[32767+a][0]=a;for(var n=-(t-1);n<=-e;n++)m[32767+n]=r,d[32767+n]=[],d[32767+n][1]=r,d[32767+n][0]=t-1+n;e<<=1,t<<=1}}(),function initRGBYUVTable(){for(var e=0;e<256;e++)E[e]=19595*e,E[e+256>>0]=38470*e,E[e+512>>0]=7471*e+32768,E[e+768>>0]=-11059*e,E[e+1024>>0]=-21709*e,E[e+1280>>0]=32768*e+8421375,E[e+1536>>0]=-27439*e,E[e+1792>>0]=-5329*e}(),setQuality(e),(new Date).getTime()}()}e.exports=function encode(e,t){void 0===t&&(t=50);return{data:new JPEGEncoder(t).encode(e,t),width:e.width,height:e.height}}}(
|
923
|
+
return writeWord(65497),new Buffer$2(f)},function init(){(new Date).getTime(),e||(e=50),function initCharLookupTable(){for(var e=String.fromCharCode,t=0;t<256;t++)T[t]=e(t)}(),function initHuffmanTbl(){t=computeHuffmanTbl(_,A),r=computeHuffmanTbl(D,C),a=computeHuffmanTbl(R,k),n=computeHuffmanTbl(I,N)}(),function initCategoryNumber(){for(var e=1,t=2,r=1;r<=15;r++){for(var a=e;a<t;a++)m[32767+a]=r,d[32767+a]=[],d[32767+a][1]=r,d[32767+a][0]=a;for(var n=-(t-1);n<=-e;n++)m[32767+n]=r,d[32767+n]=[],d[32767+n][1]=r,d[32767+n][0]=t-1+n;e<<=1,t<<=1}}(),function initRGBYUVTable(){for(var e=0;e<256;e++)E[e]=19595*e,E[e+256>>0]=38470*e,E[e+512>>0]=7471*e+32768,E[e+768>>0]=-11059*e,E[e+1024>>0]=-21709*e,E[e+1280>>0]=32768*e+8421375,E[e+1536>>0]=-27439*e,E[e+1792>>0]=-5329*e}(),setQuality(e),(new Date).getTime()}()}e.exports=function encode(e,t){void 0===t&&(t=50);return{data:new JPEGEncoder(t).encode(e,t),width:e.width,height:e.height}}}(qR);var zR,VR,WR={exports:{}};zR=WR,VR=function jpegImage(){
|
922
924
|
var e=new Int32Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63]),t=4017,r=799,a=3406,n=2276,i=1567,o=3784,s=5793,c=2896;function constructor(){}function buildHuffmanTable(e,t){for(var r,a,n=0,i=[],o=16;o>0&&!e[o-1];)o--;i.push({children:[],index:0});var s,c=i[0];for(r=0;r<o;r++){for(a=0;a<e[r];a++){for((c=i.pop()).children[c.index]=t[n];c.index>0;){if(0===i.length)throw new Error("Could not recreate Huffman Table");c=i.pop()}for(c.index++,i.push(c);i.length<=r;)i.push(s={children:[],index:0}),c.children[c.index]=s.children,c=s;n++}r+1<o&&(i.push(s={children:[],index:0}),c.children[c.index]=s.children,c=s)}return i[0].children}function decodeScan(t,r,a,n,i,o,s,c,l,u){a.precision,a.samplesPerLine,a.scanLines;var d=a.mcusPerLine,m=a.progressive;a.maxH,a.maxV;var p=r,h=0,f=0;function readBit(){if(f>0)return f--,h>>f&1;if(255==(h=t[r++])){var e=t[r++]
|
923
925
|
;if(e)throw new Error("unexpected marker: "+(h<<8|e).toString(16))}return f=7,h>>>7}function decodeHuffman(e){for(var t,r=e;null!==(t=readBit());){if("number"==typeof(r=r[t]))return r;if("object"!=typeof r)throw new Error("invalid huffman sequence")}return null}function receive(e){for(var t=0;e>0;){var r=readBit();if(null===r)return;t=t<<1|r,e--}return t}function receiveAndExtend(e){var t=receive(e);return t>=1<<e-1?t:t+(-1<<e)+1}var y,v=0,b=0;function decodeMcu(e,t,r,a,n){var i=r%d,o=(r/d|0)*e.v+a,s=i*e.h+n;void 0===e.blocks[o]&&u.tolerantDecoding||t(e,e.blocks[o][s])}function decodeBlock(e,t,r){var a=r/e.blocksPerLine|0,n=r%e.blocksPerLine;void 0===e.blocks[a]&&u.tolerantDecoding||t(e,e.blocks[a][n])}var w,S,T,E,x,_,A=n.length;_=m?0===o?0===c?function decodeDCFirst(e,t){var r=decodeHuffman(e.huffmanTableDC),a=0===r?0:receiveAndExtend(r)<<l;t[0]=e.pred+=a}:function decodeDCSuccessive(e,t){t[0]|=readBit()<<l}:0===c?function decodeACFirst(t,r){if(v>0)v--;else for(var a=o,n=s;a<=n;){
|
924
926
|
var i=decodeHuffman(t.huffmanTableAC),c=15&i,u=i>>4;if(0!==c)r[e[a+=u]]=receiveAndExtend(c)*(1<<l),a++;else{if(u<15){v=receive(u)+(1<<u)-1;break}a+=16}}}:function decodeACSuccessive(t,r){for(var a=o,n=s,i=0;a<=n;){var c=e[a],u=r[c]<0?-1:1;switch(b){case 0:var d=decodeHuffman(t.huffmanTableAC),m=15&d;if(i=d>>4,0===m)i<15?(v=receive(i)+(1<<i),b=4):(i=16,b=1);else{if(1!==m)throw new Error("invalid ACn encoding");y=receiveAndExtend(m),b=i?2:3}continue;case 1:case 2:r[c]?r[c]+=(readBit()<<l)*u:0==--i&&(b=2==b?3:0);break;case 3:r[c]?r[c]+=(readBit()<<l)*u:(r[c]=y<<l,b=0);break;case 4:r[c]&&(r[c]+=(readBit()<<l)*u)}a++}4===b&&0==--v&&(b=0)}:function decodeBaseline(t,r){var a=decodeHuffman(t.huffmanTableDC),n=0===a?0:receiveAndExtend(a);r[0]=t.pred+=n;for(var i=1;i<64;){var o=decodeHuffman(t.huffmanTableAC),s=15&o,c=o>>4;if(0!==s)r[e[i+=c]]=receiveAndExtend(s),i++;else{if(c<15)break;i+=16}}};var R,k,D,C,I=0;for(k=1==A?n[0].blocksPerLine*n[0].blocksPerColumn:d*a.mcusPerColumn,i||(i=k);I<k;){
|
@@ -931,10 +933,10 @@ n.samplesPerLine=readUint16(),n.components={},n.componentsOrder=[];var b=n.scanL
|
|
931
933
|
if(255==t[a-3]&&t[a-2]>=192&&t[a-2]<=254){a-=3;break}throw new Error("unknown JPEG marker "+m.toString(16))}m=readUint16()}if(1!=l.length)throw new Error("only single frame JPEGs supported");for(var U=0;U<l.length;U++){var j=l[U].components;for(var B in j)j[B].quantizationTable=c[j[B].quantizationIdx],delete j[B].quantizationIdx}for(this.width=n.samplesPerLine,this.height=n.scanLines,this.jfif=o,this.adobe=s,this.components=[],U=0;U<n.componentsOrder.length;U++){var $=n.components[n.componentsOrder[U]];this.components.push({lines:buildComponentData(0,$),scaleX:$.h/n.maxH,scaleY:$.v/n.maxV})}},getData:function getData(e,t){var r,a,n,i,o,s,c,l,u,d,m,p,h,f,y,v,b,w,S,T,E,x=this.width/e,_=this.height/t,A=0,R=e*t*this.components.length;requestMemoryAllocation(R);var k=new Uint8Array(R);switch(this.components.length){case 1:for(r=this.components[0],d=0;d<t;d++)for(o=r.lines[0|d*r.scaleY*_],u=0;u<e;u++)m=o[0|u*r.scaleX*x],k[A++]=m;break;case 2:for(r=this.components[0],a=this.components[1],
|
932
934
|
d=0;d<t;d++)for(o=r.lines[0|d*r.scaleY*_],s=a.lines[0|d*a.scaleY*_],u=0;u<e;u++)m=o[0|u*r.scaleX*x],k[A++]=m,m=s[0|u*a.scaleX*x],k[A++]=m;break;case 3:for(E=!0,this.adobe&&this.adobe.transformCode?E=!0:void 0!==this.opts.colorTransform&&(E=!!this.opts.colorTransform),r=this.components[0],a=this.components[1],n=this.components[2],d=0;d<t;d++)for(o=r.lines[0|d*r.scaleY*_],s=a.lines[0|d*a.scaleY*_],c=n.lines[0|d*n.scaleY*_],u=0;u<e;u++)E?(m=o[0|u*r.scaleX*x],p=s[0|u*a.scaleX*x],w=clampTo8bit(m+1.402*((h=c[0|u*n.scaleX*x])-128)),S=clampTo8bit(m-.3441363*(p-128)-.71413636*(h-128)),T=clampTo8bit(m+1.772*(p-128))):(w=o[0|u*r.scaleX*x],S=s[0|u*a.scaleX*x],T=c[0|u*n.scaleX*x]),k[A++]=w,k[A++]=S,k[A++]=T;break;case 4:if(!this.adobe)throw new Error("Unsupported color mode (4 components)");for(E=!1,this.adobe&&this.adobe.transformCode?E=!0:void 0!==this.opts.colorTransform&&(E=!!this.opts.colorTransform),r=this.components[0],a=this.components[1],n=this.components[2],i=this.components[3],
|
933
935
|
d=0;d<t;d++)for(o=r.lines[0|d*r.scaleY*_],s=a.lines[0|d*a.scaleY*_],c=n.lines[0|d*n.scaleY*_],l=i.lines[0|d*i.scaleY*_],u=0;u<e;u++)E?(m=o[0|u*r.scaleX*x],p=s[0|u*a.scaleX*x],h=c[0|u*n.scaleX*x],f=l[0|u*i.scaleX*x],y=255-clampTo8bit(m+1.402*(h-128)),v=255-clampTo8bit(m-.3441363*(p-128)-.71413636*(h-128)),b=255-clampTo8bit(m+1.772*(p-128))):(y=o[0|u*r.scaleX*x],v=s[0|u*a.scaleX*x],b=c[0|u*n.scaleX*x],f=l[0|u*i.scaleX*x]),k[A++]=255-y,k[A++]=255-v,k[A++]=255-b,k[A++]=255-f;break;default:throw new Error("Unsupported color mode")}return k},copyToImageData:function copyToImageData(e,t){var r,a,n,i,o,s,c,l,u,d=e.width,m=e.height,p=e.data,h=this.getData(d,m),f=0,y=0;switch(this.components.length){case 1:for(a=0;a<m;a++)for(r=0;r<d;r++)n=h[f++],p[y++]=n,p[y++]=n,p[y++]=n,t&&(p[y++]=255);break;case 3:for(a=0;a<m;a++)for(r=0;r<d;r++)c=h[f++],l=h[f++],u=h[f++],p[y++]=c,p[y++]=l,p[y++]=u,t&&(p[y++]=255);break;case 4:for(a=0;a<m;a++)for(r=0;r<d;r++)o=h[f++],s=h[f++],n=h[f++],
|
934
|
-
c=255-clampTo8bit(o*(1-(i=h[f++])/255)+i),l=255-clampTo8bit(s*(1-i/255)+i),u=255-clampTo8bit(n*(1-i/255)+i),p[y++]=c,p[y++]=l,p[y++]=u,t&&(p[y++]=255);break;default:throw new Error("Unsupported color mode")}}};var l=0,u=0;function requestMemoryAllocation(e=0){var t=l+e;if(t>u){var r=Math.ceil((t-u)/1024/1024);throw new Error(`maxMemoryUsageInMB limit exceeded by at least ${r}MB`)}l=t}return constructor.resetMaxMemoryUsage=function(e){l=0,u=e},constructor.getBytesAllocated=function(){return l},constructor.requestMemoryAllocation=requestMemoryAllocation,constructor}(),
|
935
|
-
data:r.useTArray?new Uint8Array(o):new Buffer$2(o)};n.comments.length>0&&(s.comments=n.comments)}catch(e){throw e instanceof RangeError?new Error("Could not allocate enough memory for the image. Required: "+o):e}return n.copyToImageData(s,r.formatAsRGBA),s};const
|
936
|
-
const o=getPixel(r,n,i,t,e.data);a[i][o]++}return a}(e),r},getTimeStamp:function(){return t},setProgress:function(e,t){a=e,n=Boolean(t)},setPerceptualProgress:function(e,t){i=e,o=Boolean(t)},getImage:function(){return e},getParsedImage:function(){return s||(s=
|
937
|
-
;const c=s.map((function(e){const t=e.args&&e.args.snapshot,r=e.ts/1e3;if(t===o)return null;o=t;return frame$1(Buffer$2.from(t,"base64"),r)})).filter(Boolean);if(0===c.length)return Promise.reject(new Error("No screenshots found in trace"));const l=frame$1(function synthesizeWhiteFrame(e){const t=
|
936
|
+
c=255-clampTo8bit(o*(1-(i=h[f++])/255)+i),l=255-clampTo8bit(s*(1-i/255)+i),u=255-clampTo8bit(n*(1-i/255)+i),p[y++]=c,p[y++]=l,p[y++]=u,t&&(p[y++]=255);break;default:throw new Error("Unsupported color mode")}}};var l=0,u=0;function requestMemoryAllocation(e=0){var t=l+e;if(t>u){var r=Math.ceil((t-u)/1024/1024);throw new Error(`maxMemoryUsageInMB limit exceeded by at least ${r}MB`)}l=t}return constructor.resetMaxMemoryUsage=function(e){l=0,u=e},constructor.getBytesAllocated=function(){return l},constructor.requestMemoryAllocation=requestMemoryAllocation,constructor}(),zR.exports=function decode(e,t={}){var r={colorTransform:void 0,useTArray:!1,formatAsRGBA:!0,tolerantDecoding:!0,maxResolutionInMP:100,maxMemoryUsageInMB:512,...t},a=new Uint8Array(e),n=new VR;n.opts=r,VR.resetMaxMemoryUsage(1024*r.maxMemoryUsageInMB*1024),n.parse(a);var i=r.formatAsRGBA?4:3,o=n.width*n.height*i;try{VR.requestMemoryAllocation(o);var s={width:n.width,height:n.height,exifBuffer:n.exifBuffer,
|
937
|
+
data:r.useTArray?new Uint8Array(o):new Buffer$2(o)};n.comments.length>0&&(s.comments=n.comments)}catch(e){throw e instanceof RangeError?new Error("Could not allocate enough memory for the image. Required: "+o):e}return n.copyToImageData(s,r.formatAsRGBA),s};const GR=wn,HR={encode:qR.exports,decode:WR.exports};function getPixel(e,t,r,a,n){return n[4*(e+t*a)+r]}function isWhitePixel(e,t,r){return getPixel(e,t,0,r.width,r.data)>=249&&getPixel(e,t,1,r.width,r.data)>=249&&getPixel(e,t,2,r.width,r.data)>=249}function frame$1(e,t){let r=null,a=null,n=null,i=null,o=null,s=null;return{getHistogram:function(){if(r)return r;const e=this.getParsedImage();return r=function convertPixelsToHistogram(e){const createHistogramArray=function(){const e=[];for(let t=0;t<256;t++)e[t]=0;return e},t=e.width,r=e.height,a=[createHistogramArray(),createHistogramArray(),createHistogramArray()];for(let n=0;n<r;n++)for(let r=0;r<t;r++)if(!isWhitePixel(r,n,e))for(let i=0;i<a.length;i++){
|
938
|
+
const o=getPixel(r,n,i,t,e.data);a[i][o]++}return a}(e),r},getTimeStamp:function(){return t},setProgress:function(e,t){a=e,n=Boolean(t)},setPerceptualProgress:function(e,t){i=e,o=Boolean(t)},getImage:function(){return e},getParsedImage:function(){return s||(s=HR.decode(e)),s},getProgress:function(){return a},isProgressInterpolated:function(){return n},getPerceptualProgress:function(){return i},isPerceptualProgressInterpolated:function(){return o}}}var YR,KR={extractFramesFromTimeline:function extractFramesFromTimeline(e,t){let r;t=t||{},e="string"==typeof e?GR.readFileSync(e,"utf-8"):e;try{r="string"==typeof e?JSON.parse(e):e}catch(e){throw new Error("Speedline: Invalid JSON"+e.message)}let a=r.traceEvents||r,n=Number.MAX_VALUE,i=-Number.MAX_VALUE;a.forEach((e=>{0!==e.ts&&(n=Math.min(n,e.ts),i=Math.max(i,e.ts))})),n=(t.timeOrigin||n)/1e3,i/=1e3;let o=null;const s=a.filter((e=>e.cat.includes("disabled-by-default-devtools.screenshot")&&e.ts>=1e3*n));s.sort(((e,t)=>e.ts-t.ts))
|
939
|
+
;const c=s.map((function(e){const t=e.args&&e.args.snapshot,r=e.ts/1e3;if(t===o)return null;o=t;return frame$1(Buffer$2.from(t,"base64"),r)})).filter(Boolean);if(0===c.length)return Promise.reject(new Error("No screenshots found in trace"));const l=frame$1(function synthesizeWhiteFrame(e){const t=HR.decode(e[0].getImage()),r=t.width,a=t.height,n=Buffer$2.alloc(r*a*4);let i=0;for(;i<n.length;)n[i++]=255,n[i++]=255,n[i++]=255,n[i++]=255;return HR.encode({data:n,width:r,height:a}).data}(c),n);c.unshift(l);const u={startTs:n,endTs:i,frames:c};return Promise.resolve(u)},create:frame$1};
|
938
940
|
/**
|
939
941
|
* @preserve
|
940
942
|
* Copyright 2015 Igor Bezkrovny
|
@@ -942,59 +944,57 @@ const o=getPixel(r,n,i,t,e.data);a[i][o]++}return a}(e),r},getTimeStamp:function
|
|
942
944
|
*
|
943
945
|
* ssim.ts - part of Image Quantization Library
|
944
946
|
*/!function(e){var t,r;(t=e.Channels||(e.Channels={}))[t.Grey=1]="Grey",t[t.GreyAlpha=2]="GreyAlpha",t[t.RGB=3]="RGB",t[t.RGBAlpha=4]="RGBAlpha",e.Channels,e.compare=function compare(e,t,a,n,i,o,s){if(void 0===a&&(a=8),void 0===n&&(n=.01),void 0===i&&(i=.03),void 0===o&&(o=!0),void 0===s&&(s=8),e.width!==t.width||e.height!==t.height)throw new Error("Images have different sizes!");var c=(1<<s)-1,l=Math.pow(n*c,2),u=Math.pow(i*c,2),d=0,m=0,p=0;return r._iterate(e,t,a,o,(function iteration(e,t,r,a){var n,i,o;n=i=o=0;for(var s=0;s<e.length;s++)i+=Math.pow(e[s]-r,2),o+=Math.pow(t[s]-a,2),n+=(e[s]-r)*(t[s]-a);var c=e.length-1;i/=c,o/=c;var h=(2*r*a+l)*(2*(n/=c)+u),f=(Math.pow(r,2)+Math.pow(a,2)+l)*(i+o+u);m+=h/f,p+=(2*n+u)/(i+o+u),d++})),{ssim:m/d,mcs:p/d}},function(e){function _lumaValuesForWindow(e,t,r,a,n,i){for(var o=e.data,s=new Float32Array(new ArrayBuffer(a*n*4)),c=0,l=r+n,u=r;u<l;u++){var d=u*e.width,m=(d+t)*e.channels,p=(d+t+a)*e.channels;switch(e.channels){case 1:
|
945
|
-
for(;m<p;)s[c++]=o[m++];break;case 2:for(;m<p;)s[c++]=o[m++]*(o[m++]/255);break;case 3:if(i)for(;m<p;)s[c++]=.212655*o[m++]+.715158*o[m++]+.072187*o[m++];else for(;m<p;)s[c++]=o[m++]+o[m++]+o[m++];break;case 4:if(i)for(;m<p;)s[c++]=(.212655*o[m++]+.715158*o[m++]+.072187*o[m++])*(o[m++]/255);else for(;m<p;)s[c++]=(o[m++]+o[m++]+o[m++])*(o[m++]/255)}}return s}function _averageLuma(e){for(var t=0,r=0;r<e.length;r++)t+=e[r];return t/e.length}e._iterate=function _iterate(e,t,r,a,n){for(var i=e.width,o=e.height,s=0;s<o;s+=r)for(var c=0;c<i;c+=r){var l=Math.min(r,i-c),u=Math.min(r,o-s),d=_lumaValuesForWindow(e,c,s,l,u,a),m=_lumaValuesForWindow(t,c,s,l,u,a);n(d,m,_averageLuma(d),_averageLuma(m))}}}(r||(r={}))}(
|
946
|
-
;const o=e[t],s=e[r],c=s.getTimeStamp()-o.getTimeStamp(),l=n(o),u=n(s);if(i(o,l,!1),i(s,u,!1),Math.abs(l-u)<calculateFastModeAllowableChange(c))for(let a=t+1;a<r;a++)i(e[a],l,!0);else if(r-t>1){const o=Math.floor((t+r)/2);calculateProgressBetweenFrames(e,t,o,a,n,i),calculateProgressBetweenFrames(e,o,r,a,n,i)}}function calculateFrameSimilarity(e,t){const r={channels:4},a=Object.assign(e.getParsedImage(),r),n=Object.assign(t.getParsedImage(),r);return
|
947
|
+
for(;m<p;)s[c++]=o[m++];break;case 2:for(;m<p;)s[c++]=o[m++]*(o[m++]/255);break;case 3:if(i)for(;m<p;)s[c++]=.212655*o[m++]+.715158*o[m++]+.072187*o[m++];else for(;m<p;)s[c++]=o[m++]+o[m++]+o[m++];break;case 4:if(i)for(;m<p;)s[c++]=(.212655*o[m++]+.715158*o[m++]+.072187*o[m++])*(o[m++]/255);else for(;m<p;)s[c++]=(o[m++]+o[m++]+o[m++])*(o[m++]/255)}}return s}function _averageLuma(e){for(var t=0,r=0;r<e.length;r++)t+=e[r];return t/e.length}e._iterate=function _iterate(e,t,r,a,n){for(var i=e.width,o=e.height,s=0;s<o;s+=r)for(var c=0;c<i;c+=r){var l=Math.min(r,i-c),u=Math.min(r,o-s),d=_lumaValuesForWindow(e,c,s,l,u,a),m=_lumaValuesForWindow(t,c,s,l,u,a);n(d,m,_averageLuma(d),_averageLuma(m))}}}(r||(r={}))}(YR||(YR={}));const JR=YR,XR=Math.log(4/6);function calculateFastModeAllowableChange(e){const t=e/1e3;return 6*Math.exp(XR*t)-1}function calculateProgressBetweenFrames(e,t,r,a,n,i){if(!a)return void e.forEach((e=>i(e,n(e),!1)))
|
948
|
+
;const o=e[t],s=e[r],c=s.getTimeStamp()-o.getTimeStamp(),l=n(o),u=n(s);if(i(o,l,!1),i(s,u,!1),Math.abs(l-u)<calculateFastModeAllowableChange(c))for(let a=t+1;a<r;a++)i(e[a],l,!0);else if(r-t>1){const o=Math.floor((t+r)/2);calculateProgressBetweenFrames(e,t,o,a,n,i),calculateProgressBetweenFrames(e,o,r,a,n,i)}}function calculateFrameSimilarity(e,t){const r={channels:4},a=Object.assign(e.getParsedImage(),r),n=Object.assign(t.getParsedImage(),r);return JR.compare(a,n).ssim}var ZR={calculateFastModeAllowableChange,calculateFrameSimilarity,calculateVisualProgress:function calculateVisualProgress(e,t){const r=e[0],a=e[e.length-1];return calculateProgressBetweenFrames(e,0,e.length-1,t&&t.fastMode,(function getProgress(e){return"number"==typeof e.getProgress()?e.getProgress():function calculateFrameProgress(e,t,r){let a=0,n=0;const i=e.getHistogram(),o=t.getHistogram(),s=r.getHistogram();for(let e=0;e<3;e++)for(let t=0;t<256;t++){
|
947
949
|
const r=i[e][t],c=o[e][t],l=s[e][t],u=Math.abs(r-c),d=Math.abs(l-c);n+=Math.min(u,d),a+=d}let c;return c=0===n&&0===a?100:Math.floor(n/a*100),c}(e,r,a)}),(function setProgress(e,t,r){return e.setProgress(t,r)})),e},calculatePerceptualProgress:function calculatePerceptualProgress(e,t){const r=e[0],a=e[e.length-1],n=calculateFrameSimilarity(r,a);return calculateProgressBetweenFrames(e,0,e.length-1,t&&t.fastMode,(function getProgress(e){if("number"==typeof e.getPerceptualProgress())return e.getPerceptualProgress();const t=calculateFrameSimilarity(e,a);return Math.max(100*(t-n)/(1-n),0)}),(function setProgress(e,t,r){return e.setPerceptualProgress(t,r)})),e},calculateSpeedIndexes:function calculateSpeedIndexes(e,t){const r="number"==typeof e[0].getProgress(),a="number"==typeof e[0].getPerceptualProgress(),n=r?"getProgress":"getPerceptualProgress",i=t.startTs;let o,s;for(let t=0;t<e.length&&!s;t++)e[t][n]()>0&&(s=e[t].getTimeStamp())
|
948
|
-
;for(let t=0;t<e.length&&!o;t++)e[t][n]()>=100&&(o=e[t].getTimeStamp());let c=e[0].getTimeStamp(),l=e[0].getProgress(),u=e[0].getPerceptualProgress(),d=s-i,m=s-i;return e.forEach((function(e){if(e.getTimeStamp()>s){const t=e.getTimeStamp()-c;d+=t*(1-l),m+=t*(1-u)}c=e.getTimeStamp(),l=e.getProgress()/100,u=e.getPerceptualProgress()/100})),d=r?d:void 0,m=a?m:void 0,{firstPaintTs:s,visuallyCompleteTs:o,speedIndex:d,perceptualSpeedIndex:m}}};const
|
949
|
-
const r=
|
950
|
-
static async computeObservedMetric(e){const{processedNavigation:t}=e;return{timing:t.timings.firstContentfulPaintAllFrames,timestamp:t.timestamps.firstContentfulPaintAllFrames}}},["devtoolsLog","gatherContext","settings","simulator","trace"]);const
|
951
|
-
;const t="Image"===e.record.resourceType,r="Low"===e.record.priority||"VeryLow"===e.record.priority;return!t||!r}static getOptimisticGraph(e,t){const r=t.timestamps.largestContentfulPaint;if(!r)throw new
|
952
|
-
;const
|
953
|
-
},["devtoolsLog","gatherContext","settings","simulator","trace"]);const
|
954
|
-
const r=await
|
955
|
-
;const r=t.fcpResult.pessimisticEstimate.timeInMs;return{timeInMs:t.optimistic?t.speedline.speedIndex:LanternSpeedIndex$2.computeLayoutBasedSpeedIndex(e.nodeTimings,r),nodeTimings:e.nodeTimings}}static async compute_(e,t){const r=await
|
956
|
-
const r=
|
957
|
-
static getTimingsAfterFCP(e,t){return Array.from(e.entries()).filter((([e,r])=>e.type===
|
958
|
-
}return a}};const
|
959
|
-
;for(const[a,n]of e.entries())a.type===
|
960
|
-
static async summarize(e,t,r,a,n){const i={trace:e,devtoolsLog:t,gatherContext:r,settings:a},requestOrUndefined=(e,t)=>e.request(t,n).catch((e=>{})),o=await
|
950
|
+
;for(let t=0;t<e.length&&!o;t++)e[t][n]()>=100&&(o=e[t].getTimeStamp());let c=e[0].getTimeStamp(),l=e[0].getProgress(),u=e[0].getPerceptualProgress(),d=s-i,m=s-i;return e.forEach((function(e){if(e.getTimeStamp()>s){const t=e.getTimeStamp()-c;d+=t*(1-l),m+=t*(1-u)}c=e.getTimeStamp(),l=e.getProgress()/100,u=e.getPerceptualProgress()/100})),d=r?d:void 0,m=a?m:void 0,{firstPaintTs:s,visuallyCompleteTs:o,speedIndex:d,perceptualSpeedIndex:m}}};const QR=KR,ek=ZR;const tk={All:"all",pSI:"perceptualSpeedIndex",SI:"speedIndex"};const rk=Ao,speedline=function(e,t){const r=t&&t.include||tk.All;if(!Object.keys(tk).some((e=>tk[e]===r)))throw new Error(`Unrecognized include option: ${r}`);return QR.extractFramesFromTimeline(e,t).then((function(e){const a=e.frames;return r!==tk.All&&r!==tk.SI||ek.calculateVisualProgress(a,t),r!==tk.All&&r!==tk.pSI||ek.calculatePerceptualProgress(a,t),function calculateValues(e,t){
|
951
|
+
const r=ek.calculateSpeedIndexes(e,t),a=Math.floor(t.endTs-t.startTs),n=Math.floor(r.firstPaintTs-t.startTs),i=Math.floor(r.visuallyCompleteTs-t.startTs);return{beginning:t.startTs,end:t.endTs,frames:e,first:n,complete:i,duration:a,speedIndex:r.speedIndex,perceptualSpeedIndex:r.perceptualSpeedIndex}}(a,e)}))},ak=vi.exports,nk=Yp;var ik=rk(class Speedline$4{static async compute_(e,t){return nk.request(e,t).then((t=>{const r=e.traceEvents.slice(),a=t.timestamps.timeOrigin;return speedline(r,{timeOrigin:a,fastMode:!0,include:"speedIndex"})})).catch((e=>{if(/No screenshots found in trace/.test(e.message))throw new ak(ak.errors.NO_SCREENSHOTS);throw e})).then((e=>{if(0===e.frames.length)throw new ak(ak.errors.NO_SPEEDLINE_FRAMES);if(0===e.speedIndex)throw new ak(ak.errors.SPEEDINDEX_OF_ZERO);return e}))}},null);const ok=Ao,sk=_w;var ck=ok(class FirstContentfulPaintAllFrames$1 extends sk{static computeSimulatedMetric(){throw new Error("FCP All Frames not implemented in lantern")}
|
952
|
+
static async computeObservedMetric(e){const{processedNavigation:t}=e;return{timing:t.timings.firstContentfulPaintAllFrames,timestamp:t.timestamps.firstContentfulPaintAllFrames}}},["devtoolsLog","gatherContext","settings","simulator","trace"]);const lk=Ao,uk=_w,dk=vi.exports,mk=fb;var pk=lk(class FirstMeaningfulPaint$2 extends uk{static computeSimulatedMetric(e,t){const r=uk.getMetricComputationInput(e);return mk.request(r,t)}static async computeObservedMetric(e){const{processedNavigation:t}=e;if(void 0===t.timings.firstMeaningfulPaint)throw new dk(dk.errors.NO_FMP);return{timing:t.timings.firstMeaningfulPaint,timestamp:t.timestamps.firstMeaningfulPaint}}},["devtoolsLog","gatherContext","settings","simulator","trace"]);const hk=Ao,gk=sb,fk=vi.exports,yk=db;class LanternLargestContentfulPaint$1 extends gk{static get COEFFICIENTS(){return{intercept:0,optimistic:.5,pessimistic:.5}}static isNotLowPriorityImageNode(e){if("network"!==e.type)return!0
|
953
|
+
;const t="Image"===e.record.resourceType,r="Low"===e.record.priority||"VeryLow"===e.record.priority;return!t||!r}static getOptimisticGraph(e,t){const r=t.timestamps.largestContentfulPaint;if(!r)throw new fk(fk.errors.NO_LCP);return yk.getFirstPaintBasedGraph(e,r,LanternLargestContentfulPaint$1.isNotLowPriorityImageNode)}static getPessimisticGraph(e,t){const r=t.timestamps.largestContentfulPaint;if(!r)throw new fk(fk.errors.NO_LCP);return yk.getFirstPaintBasedGraph(e,r,(e=>!0),(e=>e.didPerformLayout()))}static getEstimateFromSimulation(e){const t=Array.from(e.nodeTimings.entries()).filter((e=>LanternLargestContentfulPaint$1.isNotLowPriorityImageNode(e[0]))).map((e=>e[1].endTime));return{timeInMs:Math.max(...t),nodeTimings:e.nodeTimings}}static async compute_(e,t){const r=await yk.request(e,t),a=await this.computeMetricWithGraphs(e,t);return a.timing=Math.max(a.timing,r.timing),a}}var vk=hk(LanternLargestContentfulPaint$1,["devtoolsLog","gatherContext","settings","simulator","trace"])
|
954
|
+
;const bk=Ao,wk=_w,Sk=vi.exports,Tk=vk;var Ek=bk(class LargestContentfulPaint$2 extends wk{static computeSimulatedMetric(e,t){const r=wk.getMetricComputationInput(e);return Tk.request(r,t)}static async computeObservedMetric(e){const{processedNavigation:t}=e;if(void 0===t.timings.largestContentfulPaint)throw new Sk(Sk.errors.NO_LCP);return{timing:t.timings.largestContentfulPaint,timestamp:t.timestamps.largestContentfulPaint}}},["devtoolsLog","gatherContext","settings","simulator","trace"]);const xk=Ao,_k=_w,Ak=vi.exports;var Rk=xk(class LargestContentfulPaintAllFrames$1 extends _k{static async computeSimulatedMetric(){throw new Error("LCP All Frames not implemented in lantern")}static async computeObservedMetric(e){const{processedNavigation:t}=e;if(void 0===t.timings.largestContentfulPaintAllFrames)throw new Ak(Ak.errors.NO_LCP_ALL_FRAMES);return{timing:t.timings.largestContentfulPaintAllFrames,timestamp:t.timestamps.largestContentfulPaintAllFrames}}
|
955
|
+
},["devtoolsLog","gatherContext","settings","simulator","trace"]);const kk=Ao,Dk=Yp,Ck=vi.exports;class CumulativeLayoutShift$2{static getLayoutShiftEvents(e){const t=[];let r=!0;for(const a of e)if("LayoutShift"===a.name&&a.args.data&&void 0!==a.args.data.is_main_frame){if(void 0===a.args.data.weighted_score_delta)throw new Ck(Ck.errors.UNSUPPORTED_OLD_CHROME,{featureName:"Cumulative Layout Shift"});if(a.args.data.had_recent_input){if(!r)continue}else r=!1;t.push({ts:a.ts,isMainFrame:a.args.data.is_main_frame,weightedScore:a.args.data.weighted_score_delta})}return t}static calculate(e){let t=0,r=0,a=Number.NEGATIVE_INFINITY,n=Number.NEGATIVE_INFINITY;for(const i of e)(i.ts-a>5e6||i.ts-n>1e6)&&(a=i.ts,r=0),n=i.ts,r+=i.weightedScore,t=Math.max(t,r);return t}static calculateTotalCumulativeLayoutShift(e){return e.reduce(((e,t)=>e+t.weightedScore),0)}static async compute_(e,t){
|
956
|
+
const r=await Dk.request(e,t),a=CumulativeLayoutShift$2.getLayoutShiftEvents(r.frameTreeEvents),n=a.filter((e=>e.isMainFrame)),i=CumulativeLayoutShift$2.calculateTotalCumulativeLayoutShift(n);return{cumulativeLayoutShift:CumulativeLayoutShift$2.calculate(a),cumulativeLayoutShiftMainFrame:CumulativeLayoutShift$2.calculate(n),totalCumulativeLayoutShift:i}}}var Ik=kk(CumulativeLayoutShift$2,null);const Nk=Ao,Lk=sb,Mk=Zc,Pk=ik,Ok=db,Fk=mn.throttling;class LanternSpeedIndex$2 extends Lk{static get COEFFICIENTS(){return{intercept:-250,optimistic:1.4,pessimistic:.65}}static getScaledCoefficients(e){const t=this.COEFFICIENTS,r=Fk.mobileSlow4G.rttMs-30,a=Math.max((e-30)/r,0);return{intercept:t.intercept*a,optimistic:.5+(t.optimistic-.5)*a,pessimistic:.5+(t.pessimistic-.5)*a}}static getOptimisticGraph(e){return e}static getPessimisticGraph(e){return e}static getEstimateFromSimulation(e,t){if(!t.fcpResult)throw new Error("missing fcpResult");if(!t.speedline)throw new Error("missing speedline")
|
957
|
+
;const r=t.fcpResult.pessimisticEstimate.timeInMs;return{timeInMs:t.optimistic?t.speedline.speedIndex:LanternSpeedIndex$2.computeLayoutBasedSpeedIndex(e.nodeTimings,r),nodeTimings:e.nodeTimings}}static async compute_(e,t){const r=await Pk.request(e.trace,t),a=await Ok.request(e,t),n=await this.computeMetricWithGraphs(e,t,{speedline:r,fcpResult:a});return n.timing=Math.max(n.timing,a.timing),n}static computeLayoutBasedSpeedIndex(e,t){const r=[];for(const[t,a]of e.entries())if(t.type===Mk.TYPES.CPU&&t.childEvents.some((e=>"Layout"===e.name))){const e=Math.max(Math.log2(a.endTime-a.startTime),0);r.push({time:a.endTime,weight:e})}const a=r.map((e=>e.weight*Math.max(e.time,t))).reduce(((e,t)=>e+t),0),n=r.map((e=>e.weight)).reduce(((e,t)=>e+t),0);return n?a/n:t}}var Uk=Nk(LanternSpeedIndex$2,["devtoolsLog","gatherContext","settings","simulator","trace"]);const jk=Ao,Bk=_w,$k=Uk,qk=ik;var zk=jk(class SpeedIndex$2 extends Bk{static computeSimulatedMetric(e,t){
|
958
|
+
const r=Bk.getMetricComputationInput(e);return $k.request(r,t)}static async computeObservedMetric(e,t){const r=await qk.request(e.trace,t),a=Math.round(r.speedIndex),n=1e3*(a+r.beginning);return Promise.resolve({timing:a,timestamp:n})}},["devtoolsLog","gatherContext","settings","simulator","trace"]);const Vk=Ao,Wk=sb,Gk=Zc,Hk=db;class LanternMaxPotentialFID$1 extends Wk{static get COEFFICIENTS(){return{intercept:0,optimistic:.5,pessimistic:.5}}static getOptimisticGraph(e){return e}static getPessimisticGraph(e){return e}static getEstimateFromSimulation(e,t){if(!t.fcpResult)throw new Error("missing fcpResult");const r=t.optimistic?t.fcpResult.pessimisticEstimate.timeInMs:t.fcpResult.optimisticEstimate.timeInMs,a=LanternMaxPotentialFID$1.getTimingsAfterFCP(e.nodeTimings,r);return{timeInMs:Math.max(...a.map((e=>e.duration)),16),nodeTimings:e.nodeTimings}}static async compute_(e,t){const r=await Hk.request(e,t);return super.computeMetricWithGraphs(e,t,{fcpResult:r})}
|
959
|
+
static getTimingsAfterFCP(e,t){return Array.from(e.entries()).filter((([e,r])=>e.type===Gk.TYPES.CPU&&r.endTime>t)).map((([e,t])=>t))}}var Yk=Vk(LanternMaxPotentialFID$1,["devtoolsLog","gatherContext","settings","simulator","trace"]);const Kk=Ao,Jk=_w,Xk=Yk,Zk=ao;var Qk=Kk(class MaxPotentialFID$2 extends Jk{static computeSimulatedMetric(e,t){const r=Jk.getMetricComputationInput(e);return Xk.request(r,t)}static computeObservedMetric(e){const{firstContentfulPaint:t}=e.processedNavigation.timings,r=Zk.getMainThreadTopLevelEvents(e.processedTrace,t).filter((e=>e.duration>=1));return Promise.resolve({timing:Math.max(...r.map((e=>e.duration)),16)})}},["devtoolsLog","gatherContext","settings","simulator","trace"]);var eD={BLOCKING_TIME_THRESHOLD:50,calculateSumOfBlockingTime:function calculateSumOfBlockingTime$2(e,t,r){if(r<=t)return 0;let a=0;for(const n of e){if(n.duration<50)continue;if(n.end<t)continue;if(n.start>r)continue;const e=Math.max(n.start,t),i=Math.min(n.end,r)-e;i<50||(a+=i-50)
|
960
|
+
}return a}};const tD=Ao,rD=sb,aD=Zc,nD=db,iD=Tb,{BLOCKING_TIME_THRESHOLD:oD,calculateSumOfBlockingTime:sD}=eD;class LanternTotalBlockingTime$1 extends rD{static get COEFFICIENTS(){return{intercept:0,optimistic:.5,pessimistic:.5}}static getOptimisticGraph(e){return e}static getPessimisticGraph(e){return e}static getEstimateFromSimulation(e,t){if(!t.fcpResult)throw new Error("missing fcpResult");if(!t.interactiveResult)throw new Error("missing interactiveResult");const r=t.optimistic?t.fcpResult.pessimisticEstimate.timeInMs:t.fcpResult.optimisticEstimate.timeInMs,a=t.optimistic?t.interactiveResult.optimisticEstimate.timeInMs:t.interactiveResult.pessimisticEstimate.timeInMs,n=oD,i=LanternTotalBlockingTime$1.getTopLevelEvents(e.nodeTimings,n);return{timeInMs:sD(i,r,a),nodeTimings:e.nodeTimings}}static async compute_(e,t){const r=await nD.request(e,t),a=await iD.request(e,t);return this.computeMetricWithGraphs(e,t,{fcpResult:r,interactiveResult:a})}static getTopLevelEvents(e,t){const r=[]
|
961
|
+
;for(const[a,n]of e.entries())a.type===aD.TYPES.CPU&&(n.duration<t||r.push({start:n.startTime,end:n.endTime,duration:n.duration}));return r}}var cD=tD(LanternTotalBlockingTime$1,["devtoolsLog","gatherContext","settings","simulator","trace"]);const lD=Ao,uD=Ew,dD=ao,mD=cD,pD=Lw,{calculateSumOfBlockingTime:hD}=eD;var gD=lD(class TotalBlockingTime$2 extends uD{static computeSimulatedMetric(e,t){const r=uD.getMetricComputationInput(e);return mD.request(r,t)}static async computeObservedMetric(e,t){const r=dD.getMainThreadTopLevelEvents(e.processedTrace);if(e.processedNavigation){const{firstContentfulPaint:a}=e.processedNavigation.timings,n=uD.getMetricComputationInput(e),i=(await pD.request(n,t)).timing;return{timing:hD(r,a,i)}}return{timing:hD(r,0,e.processedTrace.timestamps.traceEnd)}}},["devtoolsLog","gatherContext","settings","simulator","trace"]);const fD=Yp,yD=Xp,vD=ik,bD=Zw,wD=ck,SD=pk,TD=Ek,ED=Rk,xD=Lw,_D=Ik,AD=zk,RD=Qk,kD=gD,DD=Ao;class TimingSummary$1{
|
962
|
+
static async summarize(e,t,r,a,n){const i={trace:e,devtoolsLog:t,gatherContext:r,settings:a},requestOrUndefined=(e,t)=>e.request(t,n).catch((e=>{})),o=await fD.request(e,n),s=await requestOrUndefined(yD,o),c=await vD.request(e,n),l=await requestOrUndefined(bD,i),u=await requestOrUndefined(wD,i),d=await requestOrUndefined(SD,i),m=await requestOrUndefined(TD,i),p=await requestOrUndefined(ED,i),h=await requestOrUndefined(xD,i),f=await requestOrUndefined(_D,e),y=await requestOrUndefined(RD,i),v=await requestOrUndefined(AD,i),b=await requestOrUndefined(kD,i),{cumulativeLayoutShift:w,cumulativeLayoutShiftMainFrame:S,totalCumulativeLayoutShift:T}=f||{};return{metrics:{firstContentfulPaint:l?.timing,firstContentfulPaintTs:l?.timestamp,firstContentfulPaintAllFrames:u?.timing,firstContentfulPaintAllFramesTs:u?.timestamp,firstMeaningfulPaint:d?.timing,firstMeaningfulPaintTs:d?.timestamp,largestContentfulPaint:m?.timing,largestContentfulPaintTs:m?.timestamp,
|
961
963
|
largestContentfulPaintAllFrames:p?.timing,largestContentfulPaintAllFramesTs:p?.timestamp,interactive:h?.timing,interactiveTs:h?.timestamp,speedIndex:v?.timing,speedIndexTs:v?.timestamp,totalBlockingTime:b?.timing,maxPotentialFID:y?.timing,cumulativeLayoutShift:w,cumulativeLayoutShiftMainFrame:S,totalCumulativeLayoutShift:T,observedTimeOrigin:o.timings.timeOrigin,observedTimeOriginTs:o.timestamps.timeOrigin,observedNavigationStart:s?.timings.timeOrigin,observedNavigationStartTs:s?.timestamps.timeOrigin,observedFirstPaint:s?.timings.firstPaint,observedFirstPaintTs:s?.timestamps.firstPaint,observedFirstContentfulPaint:s?.timings.firstContentfulPaint,observedFirstContentfulPaintTs:s?.timestamps.firstContentfulPaint,observedFirstContentfulPaintAllFrames:s?.timings.firstContentfulPaintAllFrames,observedFirstContentfulPaintAllFramesTs:s?.timestamps.firstContentfulPaintAllFrames,observedFirstMeaningfulPaint:s?.timings.firstMeaningfulPaint,
|
962
964
|
observedFirstMeaningfulPaintTs:s?.timestamps.firstMeaningfulPaint,observedLargestContentfulPaint:s?.timings.largestContentfulPaint,observedLargestContentfulPaintTs:s?.timestamps.largestContentfulPaint,observedLargestContentfulPaintAllFrames:s?.timings.largestContentfulPaintAllFrames,observedLargestContentfulPaintAllFramesTs:s?.timestamps.largestContentfulPaintAllFrames,observedTraceEnd:o.timings.traceEnd,observedTraceEndTs:o.timestamps.traceEnd,observedLoad:s?.timings.load,observedLoadTs:s?.timestamps.load,observedDomContentLoaded:s?.timings.domContentLoaded,observedDomContentLoadedTs:s?.timestamps.domContentLoaded,observedCumulativeLayoutShift:w,observedCumulativeLayoutShiftMainFrame:S,observedTotalCumulativeLayoutShift:T,observedFirstVisualChange:c.first,observedFirstVisualChangeTs:1e3*(c.first+c.beginning),observedLastVisualChange:c.complete,observedLastVisualChangeTs:1e3*(c.complete+c.beginning),observedSpeedIndex:c.speedIndex,observedSpeedIndexTs:1e3*(c.speedIndex+c.beginning)},
|
963
|
-
debugInfo:{lcpInvalidated:!!s?.lcpInvalidated}}}static async compute_(e,t){return TimingSummary$1.summarize(e.trace,e.devtoolsLog,e.gatherContext,e.settings,t)}}var
|
964
|
-
;"number"!=typeof t||
|
965
|
-
numericValue:a,numericUnit:"unitless",displayValue:a.toLocaleString(t.settings.locale),details:i}}},
|
966
|
-
if(
|
967
|
-
description:"
|
968
|
-
numericValue:
|
969
|
-
|
970
|
-
settings:t.settings},a=await
|
971
|
-
|
972
|
-
|
973
|
-
title:
|
974
|
-
;const
|
975
|
-
|
976
|
-
|
977
|
-
|
978
|
-
const
|
979
|
-
},{key:"statusCode",itemType:"text",text:"Status Code"},{key:"mimeType",itemType:"text",text:"MIME Type"},{key:"resourceType",itemType:"text",text:"Resource Type"}],r)}}))}},VC={exports:{}};const WC=kc,GC=oi,HC=Lo,YC=xl,KC={title:"Network Round Trip Times",description:"Network round trip times (RTT) have a large impact on performance. If the RTT to an origin is high, it's an indication that servers closer to the user could improve performance. [Learn more](https://hpbn.co/primer-on-latency-and-bandwidth/)."},JC=GC.createMessageInstanceIdFn("lighthouse-core/audits/network-rtt.js",KC);VC.exports=class NetworkRTT extends WC{static get meta(){return{id:"network-rtt",scoreDisplayMode:WC.SCORING_MODES.INFORMATIVE,title:JC(KC.title),description:JC(KC.description),requiredArtifacts:["devtoolsLogs"]}}static async audit(e,t){const r=e.devtoolsLogs[WC.DEFAULT_PASS];if(!(await HC.request(r,t)).length)return{score:1,notApplicable:!0};const a=await YC.request(r,t);let n=0;const i=a.rtt,o=[]
|
980
|
-
;for(const[e,t]of a.additionalRttByOrigin.entries()){if(!e.startsWith("http"))continue;const r=t+i;o.push({origin:e,rtt:r}),n=Number.isFinite(r)?Math.max(r,n):n}o.sort(((e,t)=>t.rtt-e.rtt));const s=[{key:"origin",itemType:"text",text:JC(GC.UIStrings.columnURL)},{key:"rtt",itemType:"ms",granularity:1,text:JC(GC.UIStrings.columnTimeSpent)}],c=WC.makeTableDetails(s,o);return{score:1,numericValue:n,numericUnit:"millisecond",displayValue:JC(GC.UIStrings.ms,{timeInMs:n}),details:c}}},VC.exports.UIStrings=KC;var XC={exports:{}};const ZC=kc,QC=oi,eI=Lo,tI=xl,rI={title:"Server Backend Latencies",description:"Server latencies can impact web performance. If the server latency of an origin is high, it's an indication the server is overloaded or has poor backend performance. [Learn more](https://hpbn.co/primer-on-web-performance/#analyzing-the-resource-waterfall)."},aI=QC.createMessageInstanceIdFn("lighthouse-core/audits/network-server-latency.js",rI)
|
965
|
+
debugInfo:{lcpInvalidated:!!s?.lcpInvalidated}}}static async compute_(e,t){return TimingSummary$1.summarize(e.trace,e.devtoolsLog,e.gatherContext,e.settings,t)}}var CD=DD(TimingSummary$1,["devtoolsLog","gatherContext","settings","trace"]);const ID=kc,ND=CD,LD=new Set(["cumulativeLayoutShift","cumulativeLayoutShiftMainFrame","totalCumulativeLayoutShift","observedCumulativeLayoutShift","observedCumulativeLayoutShiftMainFrame","observedTotalCumulativeLayoutShift"]);var MD=class Metrics extends ID{static get meta(){return{id:"metrics",scoreDisplayMode:ID.SCORING_MODES.INFORMATIVE,title:"Metrics",description:"Collects all available metrics.",supportedModes:["navigation"],requiredArtifacts:["traces","devtoolsLogs","GatherContext"]}}static async audit(e,t){const r=e.GatherContext,a=e.traces[ID.DEFAULT_PASS],n=e.devtoolsLogs[ID.DEFAULT_PASS],i=await ND.request({trace:a,devtoolsLog:n,gatherContext:r,settings:t.settings},t),o=i.metrics,s=i.debugInfo;for(const[e,t]of Object.entries(o)){const r=e
|
966
|
+
;"number"!=typeof t||LD.has(r)||(o[r]=Math.round(t))}const c={type:"debugdata",items:[o,s]};return{score:1,numericValue:o.interactive||0,numericUnit:"millisecond",details:c}}},PD={exports:{}};const OD=kc,FD=Ik,UD=oi,jD={description:"Cumulative Layout Shift measures the movement of visible elements within the viewport. [Learn more](https://web.dev/cls/)."},BD=UD.createMessageInstanceIdFn("lighthouse-core/audits/metrics/cumulative-layout-shift.js",jD);PD.exports=class CumulativeLayoutShift extends OD{static get meta(){return{id:"cumulative-layout-shift",title:BD(UD.UIStrings.cumulativeLayoutShiftMetric),description:BD(jD.description),scoreDisplayMode:OD.SCORING_MODES.NUMERIC,requiredArtifacts:["traces"]}}static get defaultOptions(){return{p10:.1,median:.25}}static async audit(e,t){const r=e.traces[OD.DEFAULT_PASS],{cumulativeLayoutShift:a,...n}=await FD.request(r,t),i={type:"debugdata",items:[n]};return{score:OD.computeLogNormalScore({p10:t.options.p10,median:t.options.median},a),
|
967
|
+
numericValue:a,numericUnit:"unitless",displayValue:a.toLocaleString(t.settings.locale),details:i}}},PD.exports.UIStrings=jD;var $D={exports:{}};const qD=kc,zD=ah,VD=oi,WD={description:"Interaction to Next Paint measures page responsiveness, how long it takes the page to visibly respond to user input. [Learn more](https://web.dev/inp/)."},GD=VD.createMessageInstanceIdFn("lighthouse-core/audits/metrics/experimental-interaction-to-next-paint.js",WD);$D.exports=class ExperimentalInteractionToNextPaint extends qD{static get meta(){return{id:"experimental-interaction-to-next-paint",title:GD(VD.UIStrings.interactionToNextPaint),description:GD(WD.description),scoreDisplayMode:qD.SCORING_MODES.NUMERIC,supportedModes:["timespan"],requiredArtifacts:["traces"]}}static get defaultOptions(){return{p10:200,median:500}}static async audit(e,t){const{settings:r}=t;if("simulate"===r.throttlingMethod)return{score:null,notApplicable:!0};const a={trace:e.traces[qD.DEFAULT_PASS],settings:r
|
968
|
+
},n=await zD.request(a,t);if(null===n)return{score:null,notApplicable:!0};const i="FallbackTiming"===n.name?n.duration:n.args.data.duration;return{score:qD.computeLogNormalScore({p10:t.options.p10,median:t.options.median},i),numericValue:i,numericUnit:"millisecond",displayValue:GD(VD.UIStrings.ms,{timeInMs:i})}}},$D.exports.UIStrings=WD;const HD=kc,YD=mn.throttling.mobileRegular3G,KD=Zw;var JD=class FirstContentfulPaint3G extends HD{static get meta(){return{id:"first-contentful-paint-3g",title:"First Contentful Paint (3G)",description:"First Contentful Paint 3G marks the time at which the first text or image is painted while on a 3G network. [Learn more](https://developers.google.com/web/tools/lighthouse/audits/first-contentful-paint).",scoreDisplayMode:HD.SCORING_MODES.NUMERIC,supportedModes:["navigation"],requiredArtifacts:["traces","devtoolsLogs","GatherContext"]}}static get defaultOptions(){return{p10:2700,median:4500}}static async audit(e,t){const r=e.GatherContext,a={
|
969
|
+
trace:e.traces[HD.DEFAULT_PASS],devtoolsLog:e.devtoolsLogs[HD.DEFAULT_PASS],gatherContext:r,settings:{...t.settings,throttlingMethod:"simulate",throttling:YD}},n=await KD.request(a,t);return{score:HD.computeLogNormalScore({p10:t.options.p10,median:t.options.median},n.timing),numericValue:n.timing,numericUnit:"millisecond",displayValue:`${n.timing} ms`}}},XD={exports:{}};const ZD=kc,QD=oi,eC=Zw,tC={description:"First Contentful Paint marks the time at which the first text or image is painted. [Learn more](https://web.dev/first-contentful-paint/)."},rC=QD.createMessageInstanceIdFn("lighthouse-core/audits/metrics/first-contentful-paint.js",tC);XD.exports=class FirstContentfulPaint extends ZD{static get meta(){return{id:"first-contentful-paint",title:rC(QD.UIStrings.firstContentfulPaintMetric),description:rC(tC.description),scoreDisplayMode:ZD.SCORING_MODES.NUMERIC,supportedModes:["navigation"],requiredArtifacts:["traces","devtoolsLogs","GatherContext"]}}static get defaultOptions(){return{
|
970
|
+
mobile:{scoring:{p10:1800,median:3e3}},desktop:{scoring:{p10:934,median:1600}}}}static async audit(e,t){const r={trace:e.traces[ZD.DEFAULT_PASS],devtoolsLog:e.devtoolsLogs[ZD.DEFAULT_PASS],gatherContext:e.GatherContext,settings:t.settings},a=await eC.request(r,t),n=t.options[t.settings.formFactor];return{score:ZD.computeLogNormalScore(n.scoring,a.timing),numericValue:a.timing,numericUnit:"millisecond",displayValue:rC(QD.UIStrings.seconds,{timeInMs:a.timing})}}},XD.exports.UIStrings=tC;var aC={exports:{}};const nC=kc,iC=oi,oC=pk,sC={description:"First Meaningful Paint measures when the primary content of a page is visible. [Learn more](https://web.dev/first-meaningful-paint/)."},cC=iC.createMessageInstanceIdFn("lighthouse-core/audits/metrics/first-meaningful-paint.js",sC);aC.exports=class FirstMeaningfulPaint extends nC{static get meta(){return{id:"first-meaningful-paint",title:cC(iC.UIStrings.firstMeaningfulPaintMetric),description:cC(sC.description),
|
971
|
+
scoreDisplayMode:nC.SCORING_MODES.NUMERIC,supportedModes:["navigation"],requiredArtifacts:["traces","devtoolsLogs","GatherContext"]}}static get defaultOptions(){return{mobile:{scoring:{p10:2336,median:4e3}},desktop:{scoring:{p10:934,median:1600}}}}static async audit(e,t){const r={trace:e.traces[nC.DEFAULT_PASS],devtoolsLog:e.devtoolsLogs[nC.DEFAULT_PASS],gatherContext:e.GatherContext,settings:t.settings},a=await oC.request(r,t),n=t.options[t.settings.formFactor];return{score:nC.computeLogNormalScore(n.scoring,a.timing),numericValue:a.timing,numericUnit:"millisecond",displayValue:cC(iC.UIStrings.seconds,{timeInMs:a.timing})}}},aC.exports.UIStrings=sC;var lC={exports:{}};const uC=kc,dC=oi,mC=Lw,pC={description:"Time to interactive is the amount of time it takes for the page to become fully interactive. [Learn more](https://web.dev/interactive/)."},hC=dC.createMessageInstanceIdFn("lighthouse-core/audits/metrics/interactive.js",pC);lC.exports=class InteractiveMetric extends uC{
|
972
|
+
static get meta(){return{id:"interactive",title:hC(dC.UIStrings.interactiveMetric),description:hC(pC.description),scoreDisplayMode:uC.SCORING_MODES.NUMERIC,supportedModes:["navigation"],requiredArtifacts:["traces","devtoolsLogs","GatherContext"]}}static get defaultOptions(){return{mobile:{scoring:{p10:3785,median:7300}},desktop:{scoring:{p10:2468,median:4500}}}}static async audit(e,t){const r={trace:e.traces[uC.DEFAULT_PASS],devtoolsLog:e.devtoolsLogs[uC.DEFAULT_PASS],gatherContext:e.GatherContext,settings:t.settings},a=(await mC.request(r,t)).timing,n=t.options[t.settings.formFactor];return{score:uC.computeLogNormalScore(n.scoring,a),numericValue:a,numericUnit:"millisecond",displayValue:hC(dC.UIStrings.seconds,{timeInMs:a})}}},lC.exports.UIStrings=pC;var gC={exports:{}};const fC=kc,yC=oi,vC=Ek,bC=vi.exports,wC={description:"Largest Contentful Paint marks the time at which the largest text or image is painted. [Learn more](https://web.dev/lighthouse-largest-contentful-paint/)"
|
973
|
+
},SC=yC.createMessageInstanceIdFn("lighthouse-core/audits/metrics/largest-contentful-paint.js",wC);gC.exports=class LargestContentfulPaint extends fC{static get meta(){return{id:"largest-contentful-paint",title:SC(yC.UIStrings.largestContentfulPaintMetric),description:SC(wC.description),scoreDisplayMode:fC.SCORING_MODES.NUMERIC,supportedModes:["navigation"],requiredArtifacts:["HostUserAgent","traces","devtoolsLogs","GatherContext"]}}static get defaultOptions(){return{mobile:{scoring:{p10:2500,median:4e3}},desktop:{scoring:{p10:1200,median:2400}}}}static async audit(e,t){const r={trace:e.traces[fC.DEFAULT_PASS],devtoolsLog:e.devtoolsLogs[fC.DEFAULT_PASS],gatherContext:e.GatherContext,settings:t.settings};let a;try{a=await vC.request(r,t)}catch(t){const r=e.HostUserAgent.match(/Chrome\/(\d+)/);if(!r)throw t;if(Number(r[1])<79&&"NO_LCP"===t.code)throw new bC(bC.errors.UNSUPPORTED_OLD_CHROME,{featureName:"Largest Contentful Paint"});throw t}const n=t.options[t.settings.formFactor];return{
|
974
|
+
score:fC.computeLogNormalScore(n.scoring,a.timing),numericValue:a.timing,numericUnit:"millisecond",displayValue:SC(yC.UIStrings.seconds,{timeInMs:a.timing})}}},gC.exports.UIStrings=wC;var TC={exports:{}};const EC=kc,xC=Qk,_C=oi,AC={description:"The maximum potential First Input Delay that your users could experience is the duration of the longest task. [Learn more](https://web.dev/lighthouse-max-potential-fid/)."},RC=_C.createMessageInstanceIdFn("lighthouse-core/audits/metrics/max-potential-fid.js",AC);TC.exports=class MaxPotentialFID extends EC{static get meta(){return{id:"max-potential-fid",title:RC(_C.UIStrings.maxPotentialFIDMetric),description:RC(AC.description),scoreDisplayMode:EC.SCORING_MODES.NUMERIC,supportedModes:["navigation"],requiredArtifacts:["traces","devtoolsLogs","GatherContext"]}}static get defaultOptions(){return{p10:130,median:250}}static async audit(e,t){const r={trace:e.traces[EC.DEFAULT_PASS],devtoolsLog:e.devtoolsLogs[EC.DEFAULT_PASS],
|
975
|
+
gatherContext:e.GatherContext,settings:t.settings},a=await xC.request(r,t);return{score:EC.computeLogNormalScore({p10:t.options.p10,median:t.options.median},a.timing),numericValue:a.timing,numericUnit:"millisecond",displayValue:RC(_C.UIStrings.ms,{timeInMs:a.timing})}}},TC.exports.UIStrings=AC;var kC={exports:{}};const DC=kc,CC=oi,IC=zk,NC={description:"Speed Index shows how quickly the contents of a page are visibly populated. [Learn more](https://web.dev/speed-index/)."},LC=CC.createMessageInstanceIdFn("lighthouse-core/audits/metrics/speed-index.js",NC);kC.exports=class SpeedIndex extends DC{static get meta(){return{id:"speed-index",title:LC(CC.UIStrings.speedIndexMetric),description:LC(NC.description),scoreDisplayMode:DC.SCORING_MODES.NUMERIC,supportedModes:["navigation"],requiredArtifacts:["traces","devtoolsLogs","GatherContext"]}}static get defaultOptions(){return{mobile:{scoring:{p10:3387,median:5800}},desktop:{scoring:{p10:1311,median:2300}}}}static async audit(e,t){const r={
|
976
|
+
trace:e.traces[DC.DEFAULT_PASS],devtoolsLog:e.devtoolsLogs[DC.DEFAULT_PASS],gatherContext:e.GatherContext,settings:t.settings},a=await IC.request(r,t),n=t.options[t.settings.formFactor];return{score:DC.computeLogNormalScore(n.scoring,a.timing),numericValue:a.timing,numericUnit:"millisecond",displayValue:LC(CC.UIStrings.seconds,{timeInMs:a.timing})}}},kC.exports.UIStrings=NC;var MC={exports:{}};const PC=kc,OC=gD,FC=oi,UC={description:"Sum of all time periods between FCP and Time to Interactive, when task length exceeded 50ms, expressed in milliseconds. [Learn more](https://web.dev/lighthouse-total-blocking-time/)."},jC=FC.createMessageInstanceIdFn("lighthouse-core/audits/metrics/total-blocking-time.js",UC);MC.exports=class TotalBlockingTime extends PC{static get meta(){return{id:"total-blocking-time",title:jC(FC.UIStrings.totalBlockingTimeMetric),description:jC(UC.description),scoreDisplayMode:PC.SCORING_MODES.NUMERIC,requiredArtifacts:["traces","devtoolsLogs","GatherContext"]}}
|
977
|
+
static get defaultOptions(){return{mobile:{scoring:{p10:200,median:600}},desktop:{scoring:{p10:150,median:350}}}}static async audit(e,t){const r=e.traces[PC.DEFAULT_PASS],a=e.devtoolsLogs[PC.DEFAULT_PASS],n=e.GatherContext,i={trace:r,devtoolsLog:a,gatherContext:n,settings:t.settings};if("timespan"===n.gatherMode&&"simulate"===t.settings.throttlingMethod)return{score:1,notApplicable:!0};const o=await OC.request(i,t),s=t.options[t.settings.formFactor];return{score:PC.computeLogNormalScore(s.scoring,o.timing),numericValue:o.timing,numericUnit:"millisecond",displayValue:jC(FC.UIStrings.ms,{timeInMs:o.timing})}}},MC.exports.UIStrings=UC;const BC=kc,$C=ji,qC=Lo;var zC=class NetworkRequests extends BC{static get meta(){return{id:"network-requests",scoreDisplayMode:BC.SCORING_MODES.INFORMATIVE,title:"Network Requests",description:"Lists the network requests that were made during page load.",requiredArtifacts:["devtoolsLogs"]}}static audit(e,t){const r=e.devtoolsLogs[BC.DEFAULT_PASS]
|
978
|
+
;return qC.request(r,t).then((e=>{const t=e.reduce(((e,t)=>Math.min(e,t.startTime)),1/0),timeToMs=e=>e<t||!Number.isFinite(e)?void 0:1e3*(e-t),r=e.map((e=>{const t=e.lrStatistics?.endTimeDeltaMs,r=e.lrStatistics?.TCPMs,a=e.lrStatistics?.requestMs,n=e.lrStatistics?.responseMs;return{url:$C.elideDataURI(e.url),protocol:e.protocol,startTime:timeToMs(e.startTime),endTime:timeToMs(e.endTime),finished:e.finished,transferSize:e.transferSize,resourceSize:e.resourceSize,statusCode:e.statusCode,mimeType:e.mimeType,resourceType:e.resourceType,lrEndTimeDeltaMs:t,lrTCPMs:r,lrRequestMs:a,lrResponseMs:n}}));return{score:1,details:BC.makeTableDetails([{key:"url",itemType:"url",text:"URL"},{key:"protocol",itemType:"text",text:"Protocol"},{key:"startTime",itemType:"ms",granularity:1,text:"Start Time"},{key:"endTime",itemType:"ms",granularity:1,text:"End Time"},{key:"transferSize",itemType:"bytes",displayUnit:"kb",granularity:1,text:"Transfer Size"},{key:"resourceSize",itemType:"bytes",displayUnit:"kb",
|
979
|
+
granularity:1,text:"Resource Size"},{key:"statusCode",itemType:"text",text:"Status Code"},{key:"mimeType",itemType:"text",text:"MIME Type"},{key:"resourceType",itemType:"text",text:"Resource Type"}],r)}}))}},VC={exports:{}};const WC=kc,GC=oi,HC=Lo,YC=xl,KC={title:"Network Round Trip Times",description:"Network round trip times (RTT) have a large impact on performance. If the RTT to an origin is high, it's an indication that servers closer to the user could improve performance. [Learn more](https://hpbn.co/primer-on-latency-and-bandwidth/)."},JC=GC.createMessageInstanceIdFn("lighthouse-core/audits/network-rtt.js",KC);VC.exports=class NetworkRTT extends WC{static get meta(){return{id:"network-rtt",scoreDisplayMode:WC.SCORING_MODES.INFORMATIVE,title:JC(KC.title),description:JC(KC.description),requiredArtifacts:["devtoolsLogs"]}}static async audit(e,t){const r=e.devtoolsLogs[WC.DEFAULT_PASS];if(!(await HC.request(r,t)).length)return{score:1,notApplicable:!0};const a=await YC.request(r,t)
|
980
|
+
;let n=0;const i=a.rtt,o=[];for(const[e,t]of a.additionalRttByOrigin.entries()){if(!e.startsWith("http"))continue;const r=t+i;o.push({origin:e,rtt:r}),n=Number.isFinite(r)?Math.max(r,n):n}o.sort(((e,t)=>t.rtt-e.rtt));const s=[{key:"origin",itemType:"text",text:JC(GC.UIStrings.columnURL)},{key:"rtt",itemType:"ms",granularity:1,text:JC(GC.UIStrings.columnTimeSpent)}],c=WC.makeTableDetails(s,o);return{score:1,numericValue:n,numericUnit:"millisecond",displayValue:JC(GC.UIStrings.ms,{timeInMs:n}),details:c}}},VC.exports.UIStrings=KC;var XC={exports:{}};const ZC=kc,QC=oi,eI=Lo,tI=xl,rI={title:"Server Backend Latencies",description:"Server latencies can impact web performance. If the server latency of an origin is high, it's an indication the server is overloaded or has poor backend performance. [Learn more](https://hpbn.co/primer-on-web-performance/#analyzing-the-resource-waterfall)."},aI=QC.createMessageInstanceIdFn("lighthouse-core/audits/network-server-latency.js",rI)
|
981
981
|
;XC.exports=class NetworkServerLatency extends ZC{static get meta(){return{id:"network-server-latency",scoreDisplayMode:ZC.SCORING_MODES.INFORMATIVE,title:aI(rI.title),description:aI(rI.description),requiredArtifacts:["devtoolsLogs"]}}static async audit(e,t){const r=e.devtoolsLogs[ZC.DEFAULT_PASS];if(!(await eI.request(r,t)).length)return{score:1,notApplicable:!0};const a=await tI.request(r,t);let n=0;const i=[];for(const[e,t]of a.serverResponseTimeByOrigin.entries())e.startsWith("http")&&(n=Math.max(t,n),i.push({origin:e,serverResponseTime:t}));i.sort(((e,t)=>t.serverResponseTime-e.serverResponseTime));const o=[{key:"origin",itemType:"text",text:aI(QC.UIStrings.columnURL)},{key:"serverResponseTime",itemType:"ms",granularity:1,text:aI(QC.UIStrings.columnTimeSpent)}],s=ZC.makeTableDetails(o,i);return{score:Math.max(1-n/500,0),numericValue:n,numericUnit:"millisecond",displayValue:aI(QC.UIStrings.ms,{timeInMs:n}),details:s}}},XC.exports.UIStrings=rI;var nI={exports:{}}
|
982
|
-
;const iI=kc,oI=
|
982
|
+
;const iI=kc,oI=jb,sI=oi,cI={title:"Avoids `unload` event listeners",failureTitle:"Registers an `unload` listener",description:"The `unload` event does not fire reliably and listening for it can prevent browser optimizations like the Back-Forward Cache. Use `pagehide` or `visibilitychange` events instead. [Learn more](https://web.dev/bfcache/#never-use-the-unload-event)"},lI=sI.createMessageInstanceIdFn("lighthouse-core/audits/no-unload-listeners.js",cI);nI.exports=class NoUnloadListeners extends iI{static get meta(){return{id:"no-unload-listeners",title:lI(cI.title),failureTitle:lI(cI.failureTitle),description:lI(cI.description),requiredArtifacts:["GlobalListeners","JsUsage","SourceMaps","ScriptElements"]}}static async audit(e,t){const r=e.GlobalListeners.filter((e=>"unload"===e.type));if(!r.length)return{score:1};const a=await oI.request(e,t),n=[{key:"source",itemType:"source-location",text:lI(sI.UIStrings.columnSource)}],i=new Map
|
983
983
|
;for(const[t,r]of Object.entries(e.JsUsage))for(const e of r)i.set(e.scriptId,t);const o=r.map((e=>{const t=i.get(e.scriptId);if(!t)return{source:{type:"url",value:"(unknown)"}};const r=a.find((e=>e.script.src===t));return{source:iI.makeSourceLocation(t,e.lineNumber,e.columnNumber,r)}}));return{score:0,details:iI.makeTableDetails(n,o)}}},nI.exports.UIStrings=cI;var uI={exports:{}};const dI=kc,mI=oi,pI={title:"Avoid non-composited animations",description:"Animations which are not composited can be janky and increase CLS. [Learn more](https://web.dev/non-composited-animations)",displayValue:"{itemCount, plural,\n =1 {# animated element found}\n other {# animated elements found}\n }",unsupportedCSSProperty:"{propertyCount, plural,\n =1 {Unsupported CSS Property: {properties}}\n other {Unsupported CSS Properties: {properties}}\n }",transformDependsBoxSize:"Transform-related property depends on box size",filterMayMovePixels:"Filter-related property may move pixels",
|
984
984
|
nonReplaceCompositeMode:'Effect has composite mode other than "replace"',incompatibleAnimations:"Target has another animation which is incompatible",unsupportedTimingParameters:"Effect has unsupported timing parameters"},hI=mI.createMessageInstanceIdFn("lighthouse-core/audits/non-composited-animations.js",pI),gI=[{flag:8192,text:pI.unsupportedCSSProperty},{flag:2048,text:pI.transformDependsBoxSize},{flag:4096,text:pI.filterMayMovePixels},{flag:16,text:pI.nonReplaceCompositeMode},{flag:64,text:pI.incompatibleAnimations},{flag:8,text:pI.unsupportedTimingParameters}];function getActionableFailureReasons(e,t){return gI.filter((t=>e&t.flag)).map((e=>e.text===pI.unsupportedCSSProperty?hI(e.text,{propertyCount:t.length,properties:t.join(", ")}):hI(e.text)))}uI.exports=class NonCompositedAnimations extends dI{static get meta(){return{id:"non-composited-animations",scoreDisplayMode:dI.SCORING_MODES.INFORMATIVE,title:hI(pI.title),description:hI(pI.description),
|
985
985
|
requiredArtifacts:["TraceElements","HostUserAgent"]}}static async audit(e){const t=e.HostUserAgent.match(/Chrome\/(\d+)/);if(!t||Number(t[1])<86)return{score:1,notApplicable:!0};const r=[];let a=!1;e.TraceElements.forEach((e=>{if("animation"!==e.traceEventType)return;const t=e.animations||[],n=new Map;for(const{name:e,failureReasonsMask:r,unsupportedProperties:i}of t){if(!r)continue;const t=getActionableFailureReasons(r,i||[]);for(const r of t){e&&(a=!0);const t=n.get(e)||new Set;t.add(r),n.set(e,t)}}if(!n.size)return;const i=[];for(const[e,t]of n)for(const r of t)i.push({failureReason:r,animation:e});r.push({node:dI.makeNodeItem(e.node),subItems:{type:"subitems",items:i}})}));const n=[{key:"node",itemType:"node",subItemsHeading:{key:"failureReason",itemType:"text"},text:hI(mI.UIStrings.columnElement)}];a&&n.push({key:null,itemType:"text",subItemsHeading:{key:"animation",itemType:"text"},text:hI(mI.UIStrings.columnName)});const i=dI.makeTableDetails(n,r);let o
|
986
986
|
;return r.length>0&&(o=hI(pI.displayValue,{itemCount:r.length})),{score:0===r.length?1:0,notApplicable:0===r.length,details:i,displayValue:o}}},uI.exports.UIStrings=pI;var fI={exports:{}};const yI=Ao,vI=Lo,bI=ji,wI=Ki,SI=Tu,{Util:TI}=Ni;class ResourceSummary$2{static determineResourceType(e){if(!e.resourceType)return"other";return{Stylesheet:"stylesheet",Image:"image",Media:"media",Font:"font",Script:"script",Document:"document"}[e.resourceType]||"other"}static summarize(e,t,r){const a={stylesheet:{count:0,resourceSize:0,transferSize:0},image:{count:0,resourceSize:0,transferSize:0},media:{count:0,resourceSize:0,transferSize:0},font:{count:0,resourceSize:0,transferSize:0},script:{count:0,resourceSize:0,transferSize:0},document:{count:0,resourceSize:0,transferSize:0},other:{count:0,resourceSize:0,transferSize:0},total:{count:0,resourceSize:0,transferSize:0},"third-party":{count:0,resourceSize:0,transferSize:0}},n=SI.getMatchingBudget(r,t);let i=[]
|
987
|
-
;if(n?.options?.firstPartyHostnames)i=n.options.firstPartyHostnames;else{const e=TI.getRootDomain(t);i=[`*.${e}`]}return e.filter((e=>("other"!==this.determineResourceType(e)||!e.url.endsWith("/favicon.ico"))&&!wI.isNonNetworkRequest(e))).forEach((e=>{const t=this.determineResourceType(e);a[t].count++,a[t].resourceSize+=e.resourceSize,a[t].transferSize+=e.transferSize,a.total.count++,a.total.resourceSize+=e.resourceSize,a.total.transferSize+=e.transferSize;i.some((t=>{const r=new bI(e.url);return t.startsWith("*.")?r.hostname.endsWith(t.slice(2)):r.hostname===t}))||(a["third-party"].count++,a["third-party"].resourceSize+=e.resourceSize,a["third-party"].transferSize+=e.transferSize)})),a}static async compute_(e,t){const r=await vI.request(e.devtoolsLog,t);return ResourceSummary$2.summarize(r,e.URL.finalUrl,e.budgets)}}var EI=yI(ResourceSummary$2,["URL","devtoolsLog","budgets"]);const xI=kc,_I=EI,AI=
|
987
|
+
;if(n?.options?.firstPartyHostnames)i=n.options.firstPartyHostnames;else{const e=TI.getRootDomain(t);i=[`*.${e}`]}return e.filter((e=>("other"!==this.determineResourceType(e)||!e.url.endsWith("/favicon.ico"))&&!wI.isNonNetworkRequest(e))).forEach((e=>{const t=this.determineResourceType(e);a[t].count++,a[t].resourceSize+=e.resourceSize,a[t].transferSize+=e.transferSize,a.total.count++,a.total.resourceSize+=e.resourceSize,a.total.transferSize+=e.transferSize;i.some((t=>{const r=new bI(e.url);return t.startsWith("*.")?r.hostname.endsWith(t.slice(2)):r.hostname===t}))||(a["third-party"].count++,a["third-party"].resourceSize+=e.resourceSize,a["third-party"].transferSize+=e.transferSize)})),a}static async compute_(e,t){const r=await vI.request(e.devtoolsLog,t);return ResourceSummary$2.summarize(r,e.URL.finalUrl,e.budgets)}}var EI=yI(ResourceSummary$2,["URL","devtoolsLog","budgets"]);const xI=kc,_I=EI,AI=HT,RI=Tu,kI=oi,DI={title:"Performance budget",
|
988
988
|
description:"Keep the quantity and size of network requests under the targets set by the provided performance budget. [Learn more](https://developers.google.com/web/tools/lighthouse/audits/budgets).",requestCountOverBudget:"{count, plural,\n =1 {1 request}\n other {# requests}\n }"},CI=kI.createMessageInstanceIdFn("lighthouse-core/audits/performance-budget.js",DI);fI.exports=class ResourceBudget extends xI{static get meta(){return{id:"performance-budget",title:CI(DI.title),description:CI(DI.description),scoreDisplayMode:xI.SCORING_MODES.INFORMATIVE,supportedModes:["navigation"],requiredArtifacts:["devtoolsLogs","URL"]}}static getRowLabel(e){return{total:kI.UIStrings.totalResourceType,document:kI.UIStrings.documentResourceType,script:kI.UIStrings.scriptResourceType,stylesheet:kI.UIStrings.stylesheetResourceType,image:kI.UIStrings.imageResourceType,media:kI.UIStrings.mediaResourceType,font:kI.UIStrings.fontResourceType,other:kI.UIStrings.otherResourceType,
|
989
989
|
"third-party":kI.UIStrings.thirdPartyResourceType}[e]}static tableItems(e,t){return Object.keys(t).map((r=>{const a=CI(this.getRowLabel(r)),n=t[r].count,i=t[r].transferSize;let o,s;if(e.resourceSizes){const t=e.resourceSizes.find((e=>e.resourceType===r));t&&i>1024*t.budget&&(o=i-1024*t.budget)}if(e.resourceCounts){const t=e.resourceCounts.find((e=>e.resourceType===r));if(t&&n>t.budget){const e=n-t.budget;s=CI(DI.requestCountOverBudget,{count:e})}}return{resourceType:r,label:a,requestCount:n,transferSize:i,countOverBudget:s,sizeOverBudget:o}})).filter((t=>!(!e.resourceSizes||!e.resourceSizes.some((e=>e.resourceType===t.resourceType)))||!(!e.resourceCounts||!e.resourceCounts.some((e=>e.resourceType===t.resourceType))))).sort(((e,t)=>(t.sizeOverBudget||0)-(e.sizeOverBudget||0)))}static async audit(e,t){const r=e.devtoolsLogs[xI.DEFAULT_PASS],a={devtoolsLog:r,URL:e.URL,budgets:t.settings.budgets},n=await _I.request(a,t),i=await AI.request({URL:e.URL,devtoolsLog:r
|
990
|
-
},t),o=RI.getMatchingBudget(t.settings.budgets,i.url);if(!o)return{score:0,notApplicable:!0};const s=[{key:"label",itemType:"text",text:CI(kI.UIStrings.columnResourceType)},{key:"requestCount",itemType:"numeric",text:CI(kI.UIStrings.columnRequests)},{key:"transferSize",itemType:"bytes",text:CI(kI.UIStrings.columnTransferSize)},{key:"countOverBudget",itemType:"text",text:""},{key:"sizeOverBudget",itemType:"bytes",text:CI(kI.UIStrings.columnOverBudget)}];return{details:xI.makeTableDetails(s,this.tableItems(o,n)),score:1}}},fI.exports.UIStrings=DI;const II=kc,NI=oi,LI=
|
990
|
+
},t),o=RI.getMatchingBudget(t.settings.budgets,i.url);if(!o)return{score:0,notApplicable:!0};const s=[{key:"label",itemType:"text",text:CI(kI.UIStrings.columnResourceType)},{key:"requestCount",itemType:"numeric",text:CI(kI.UIStrings.columnRequests)},{key:"transferSize",itemType:"bytes",text:CI(kI.UIStrings.columnTransferSize)},{key:"countOverBudget",itemType:"text",text:""},{key:"sizeOverBudget",itemType:"bytes",text:CI(kI.UIStrings.columnOverBudget)}];return{details:xI.makeTableDetails(s,this.tableItems(o,n)),score:1}}},fI.exports.UIStrings=DI;const II=kc,NI=oi,LI=db,MI=fb,PI=Tb,OI=Uk,FI=vk,UI=NI.createMessageInstanceIdFn("lighthouse-core/audits/predictive-perf.js",{});var jI=class PredictivePerf extends II{static get meta(){return{id:"predictive-perf",title:"Predicted Performance (beta)",description:"Predicted performance evaluates how your site will perform under a cellular connection on a mobile device.",scoreDisplayMode:II.SCORING_MODES.NUMERIC,supportedModes:["navigation"],
|
991
991
|
requiredArtifacts:["traces","devtoolsLogs","GatherContext"]}}static async audit(e,t){const r=e.GatherContext,a={trace:e.traces[II.DEFAULT_PASS],devtoolsLog:e.devtoolsLogs[II.DEFAULT_PASS],gatherContext:r,settings:{}},n=await LI.request(a,t),i=await MI.request(a,t),o=await PI.request(a,t),s=await OI.request(a,t),c=await FI.request(a,t),l={roughEstimateOfFCP:n.timing,optimisticFCP:n.optimisticEstimate.timeInMs,pessimisticFCP:n.pessimisticEstimate.timeInMs,roughEstimateOfFMP:i.timing,optimisticFMP:i.optimisticEstimate.timeInMs,pessimisticFMP:i.pessimisticEstimate.timeInMs,roughEstimateOfTTI:o.timing,optimisticTTI:o.optimisticEstimate.timeInMs,pessimisticTTI:o.pessimisticEstimate.timeInMs,roughEstimateOfSI:s.timing,optimisticSI:s.optimisticEstimate.timeInMs,pessimisticSI:s.pessimisticEstimate.timeInMs,roughEstimateOfLCP:c.timing,optimisticLCP:c.optimisticEstimate.timeInMs,pessimisticLCP:c.pessimisticEstimate.timeInMs};return{score:II.computeLogNormalScore({p10:3651,median:1e4
|
992
|
-
},l.roughEstimateOfTTI),numericValue:l.roughEstimateOfTTI,numericUnit:"millisecond",displayValue:UI(NI.UIStrings.ms,{timeInMs:l.roughEstimateOfTTI}),details:{type:"debugdata",items:[l]}}}},BI={exports:{}};const $I=kc,qI=oi,zI=
|
993
|
-
const r=e.devtoolsLogs[this.DEFAULT_PASS],a=await WI.request(r,t),n=zI.findFontDisplayDeclarations(e,VI).passingURLs,i=PreloadFontsAudit.getURLsAttemptedToPreload(a),o=Array.from(n).filter((e=>!i.has(e))).map((e=>({url:e}))),s=[{key:"url",itemType:"url",text:HI(qI.UIStrings.columnURL)}];return{score:o.length>0?0:1,details:$I.makeTableDetails(s,o),notApplicable:0===n.size}}static async audit(){return{score:1,notApplicable:!0}}}BI.exports=PreloadFontsAudit,BI.exports.UIStrings=GI;var YI={exports:{}};const KI=kc,JI=oi,XI=Ki,ZI=
|
992
|
+
},l.roughEstimateOfTTI),numericValue:l.roughEstimateOfTTI,numericUnit:"millisecond",displayValue:UI(NI.UIStrings.ms,{timeInMs:l.roughEstimateOfTTI}),details:{type:"debugdata",items:[l]}}}},BI={exports:{}};const $I=kc,qI=oi,zI=Q_.exports,VI=/^(optional)$/,WI=Lo,GI={title:"Fonts with `font-display: optional` are preloaded",failureTitle:"Fonts with `font-display: optional` are not preloaded",description:"Preload `optional` fonts so first-time visitors may use them. [Learn more](https://web.dev/preload-optional-fonts/)"},HI=qI.createMessageInstanceIdFn("lighthouse-core/audits/preload-fonts.js",GI);class PreloadFontsAudit extends $I{static get meta(){return{id:"preload-fonts",title:HI(GI.title),failureTitle:HI(GI.failureTitle),description:HI(GI.description),requiredArtifacts:["devtoolsLogs","URL","CSSUsage"]}}static getURLsAttemptedToPreload(e){const t=e.filter((e=>"Font"===e.resourceType)).filter((e=>e.isLinkPreload)).map((e=>e.url));return new Set(t)}static async audit_(e,t){
|
993
|
+
const r=e.devtoolsLogs[this.DEFAULT_PASS],a=await WI.request(r,t),n=zI.findFontDisplayDeclarations(e,VI).passingURLs,i=PreloadFontsAudit.getURLsAttemptedToPreload(a),o=Array.from(n).filter((e=>!i.has(e))).map((e=>({url:e}))),s=[{key:"url",itemType:"url",text:HI(qI.UIStrings.columnURL)}];return{score:o.length>0?0:1,details:$I.makeTableDetails(s,o),notApplicable:0===n.size}}static async audit(){return{score:1,notApplicable:!0}}}BI.exports=PreloadFontsAudit,BI.exports.UIStrings=GI;var YI={exports:{}};const KI=kc,JI=oi,XI=Ki,ZI=HT,QI=vk,eN=Dl,tN=Ib,rN={title:"Preload Largest Contentful Paint image",description:"Preload the image used by the LCP element in order to improve your LCP time. [Learn more](https://web.dev/optimize-lcp/#preload-important-resources)."},aN=JI.createMessageInstanceIdFn("lighthouse-core/audits/preload-lcp-image.js",rN);class PreloadLCPImageAudit extends KI{static get meta(){return{id:"preload-lcp-image",title:aN(rN.title),description:aN(rN.description),
|
994
994
|
supportedModes:["navigation"],requiredArtifacts:["traces","devtoolsLogs","GatherContext","URL","TraceElements","ImageElements"],scoreDisplayMode:KI.SCORING_MODES.NUMERIC}}static shouldPreloadRequest(e,t,r){const a=t.redirects?t.redirects.length:0;return!e.isLinkPreload&&(!XI.isNonNetworkRequest(e)&&(!(r.length<=a)&&e.frameId===t.frameId))}static findLCPNode(e,t){let r,a;return e.traverse(((e,n)=>{"network"===e.type&&e.record.url===t&&(r=e,a=n.slice(1).filter((e=>"network"===e.type)))})),{lcpNode:r,path:a}}static getLCPNodeToPreload(e,t,r,a){if(!r)return;const n=a.find((e=>e.node.devtoolsNodePath===r.node.devtoolsNodePath));if(!n)return;const i=n.src,{lcpNode:o,path:s}=PreloadLCPImageAudit.findLCPNode(t,i);if(!o||!s)return;return PreloadLCPImageAudit.shouldPreloadRequest(o.record,e,s)?o:void 0}static computeWasteWithGraph(e,t,r,a){if(!e||!t)return{wastedMs:0,results:[]};const n=r.cloneWithRelationships(),i=new Set;for(const e of t.getDependencies())i.add(e.id);let o=null,s=null
|
995
995
|
;for(const{node:e}of n.traverseGenerator())"network"===e.type&&(e.isMainDocument()?s=e:e.id===t.id&&(o=e));if(!s)throw new Error("Could not find main document node");if(!o)throw new Error("Could not find the LCP node");o.removeAllDependencies(),o.addDependency(s);const c=a.simulate(r,{flexibleOrdering:!0}),l=a.simulate(n,{flexibleOrdering:!0}),u=c.nodeTimings.get(t);if(!u)throw new Error("Impossible - node timings should never be undefined");const d=l.nodeTimings.get(o);if(!d)throw new Error("Impossible - node timings should never be undefined");const m=Array.from(l.nodeTimings.keys()).reduce(((e,t)=>e.set(t.id,t)),new Map);let p=0;for(const e of Array.from(i)){const t=m.get(e);if(!t)throw new Error("Impossible - node should never be undefined");const r=l.nodeTimings.get(t)?.endTime||0;p=Math.max(p,r)}const h=u.endTime-Math.max(d.endTime,p);return{wastedMs:h,results:[{node:KI.makeNodeItem(e.node),url:t.record.url,wastedMs:h}]}}static async audit(e,t){
|
996
996
|
const r=e.GatherContext,a=e.traces[PreloadLCPImageAudit.DEFAULT_PASS],n=e.devtoolsLogs[PreloadLCPImageAudit.DEFAULT_PASS],i=e.URL,o={trace:a,devtoolsLog:n,gatherContext:r,settings:t.settings},s=e.TraceElements.find((e=>"largest-contentful-paint"===e.traceEventType)),[c,l,u]=await Promise.all([ZI.request({devtoolsLog:n,URL:i},t),QI.request(o,t),eN.request({devtoolsLog:n,settings:t.settings},t)]),d=l.pessimisticGraph,m=PreloadLCPImageAudit.getLCPNodeToPreload(c,d,s,e.ImageElements),{results:p,wastedMs:h}=PreloadLCPImageAudit.computeWasteWithGraph(s,m,d,u),f=[{key:"node",valueType:"node",label:""},{key:"url",valueType:"url",label:aN(JI.UIStrings.columnURL)},{key:"wastedMs",valueType:"timespanMs",label:aN(JI.UIStrings.columnWastedMs)}],y=KI.makeOpportunityDetails(f,p,h);return{score:tN.scoreForWastedMs(h),numericValue:h,numericUnit:"millisecond",displayValue:h?aN(JI.UIStrings.displayValueMsSavings,{wastedMs:h}):"",details:y}}}YI.exports=PreloadLCPImageAudit,YI.exports.UIStrings=rN;var nN={
|
997
|
-
exports:{}};const iN=kc,oN=
|
997
|
+
exports:{}};const iN=kc,oN=Ib,sN=oi,cN=Yp,lN=Lo,uN=HT,dN=Tb,mN={title:"Avoid multiple page redirects",description:"Redirects introduce additional delays before the page can be loaded. [Learn more](https://web.dev/redirects/)."},pN=sN.createMessageInstanceIdFn("lighthouse-core/audits/redirects.js",mN);class Redirects extends iN{static get meta(){return{id:"redirects",title:pN(mN.title),description:pN(mN.description),scoreDisplayMode:iN.SCORING_MODES.NUMERIC,supportedModes:["navigation"],requiredArtifacts:["URL","GatherContext","devtoolsLogs","traces"]}}static getDocumentRequestChain(e,t,r){const a=[];for(const e of r.processEvents){if("navigationStart"!==e.name)continue;const r=e.args.data||{};if(!r.documentLoaderURL||!r.isLoadingMainFrame)continue;let n=t.find((e=>e.url===r.documentLoaderURL));for(;n;)a.push(n),n=n.redirectDestination}return a.length?a:(e.redirects||[]).concat(e)}static async audit(e,t){
|
998
998
|
const r=t.settings,a=e.traces[iN.DEFAULT_PASS],n=e.devtoolsLogs[iN.DEFAULT_PASS],i=e.GatherContext,o=await cN.request(a,t),s=await lN.request(n,t),c=await uN.request({URL:e.URL,devtoolsLog:n},t),l={trace:a,devtoolsLog:n,gatherContext:i,settings:r},u=await dN.request(l,t),d=new Map;for(const[e,t]of u.pessimisticEstimate.nodeTimings.entries())"network"===e.type&&d.set(e.record.url,t);const m=Redirects.getDocumentRequestChain(c,s,o);let p=0;const h=[];for(let e=0;e<m.length&&!(m.length<2);e++){const t=m[e],a=m[e+1]||t,n=d.get(t.url),i=d.get(a.url);if(!n||!i)throw new Error("Could not find redirects in graph");const o=i.startTime-n.startTime,s=a.startTime-t.startTime,c="simulate"===r.throttlingMethod?o:1e3*s;p+=c,h.push({url:t.url,wastedMs:c})}const f=[{key:"url",valueType:"url",label:pN(sN.UIStrings.columnURL)},{key:"wastedMs",valueType:"timespanMs",label:pN(sN.UIStrings.columnTimeSpent)}],y=iN.makeOpportunityDetails(f,h,p);return{score:m.length<=2?1:oN.scoreForWastedMs(p),numericValue:p,
|
999
999
|
numericUnit:"millisecond",displayValue:p?pN(sN.UIStrings.displayValueMsSavings,{wastedMs:p}):"",details:y}}}nN.exports=Redirects,nN.exports.UIStrings=mN;var hN={exports:{}};const gN=kc,fN=EI,yN=oi,vN={title:"Keep request counts low and transfer sizes small",description:"To set budgets for the quantity and size of page resources, add a budget.json file. [Learn more](https://web.dev/use-lighthouse-for-performance-budgets/).",displayValue:"{requestCount, plural, =1 {1 request • {byteCount, number, bytes} KiB} other {# requests • {byteCount, number, bytes} KiB}}"},bN=yN.createMessageInstanceIdFn("lighthouse-core/audits/resource-summary.js",vN);hN.exports=class ResourceSummary extends gN{static get meta(){return{id:"resource-summary",title:bN(vN.title),description:bN(vN.description),scoreDisplayMode:gN.SCORING_MODES.INFORMATIVE,requiredArtifacts:["devtoolsLogs","URL"]}}static async audit(e,t){const r=e.devtoolsLogs[gN.DEFAULT_PASS],a=await fN.request({devtoolsLog:r,URL:e.URL,
|
1000
1000
|
budgets:t.settings.budgets},t),n=[{key:"label",itemType:"text",text:bN(yN.UIStrings.columnResourceType)},{key:"requestCount",itemType:"numeric",text:bN(yN.UIStrings.columnRequests)},{key:"transferSize",itemType:"bytes",text:bN(yN.UIStrings.columnTransferSize)}],i={total:bN(yN.UIStrings.totalResourceType),document:bN(yN.UIStrings.documentResourceType),script:bN(yN.UIStrings.scriptResourceType),stylesheet:bN(yN.UIStrings.stylesheetResourceType),image:bN(yN.UIStrings.imageResourceType),media:bN(yN.UIStrings.mediaResourceType),font:bN(yN.UIStrings.fontResourceType),other:bN(yN.UIStrings.otherResourceType),"third-party":bN(yN.UIStrings.thirdPartyResourceType)},o=Object.keys(a).map((e=>({resourceType:e,label:i[e],requestCount:a[e].count,transferSize:a[e].transferSize}))),s=o.find((e=>"third-party"===e.resourceType))||[],c=o.filter((e=>"third-party"!==e.resourceType)).sort(((e,t)=>t.transferSize-e.transferSize)).concat(s);return{details:gN.makeTableDetails(n,c),score:1,
|
@@ -1019,12 +1019,12 @@ n.samplesPerLine=readUint16(),n.components={},n.componentsOrder=[];var w=n.scanL
|
|
1019
1019
|
var r,a,n,i,o,s,c,l,u,d,m,p,h,f,y,v,b,w,S,T,E,x=this.width/e,_=this.height/t,A=0,R=e*t*this.components.length;requestMemoryAllocation(R);var k=new Uint8Array(R);switch(this.components.length){case 1:for(r=this.components[0],d=0;d<t;d++)for(o=r.lines[0|d*r.scaleY*_],u=0;u<e;u++)m=o[0|u*r.scaleX*x],k[A++]=m;break;case 2:for(r=this.components[0],a=this.components[1],d=0;d<t;d++)for(o=r.lines[0|d*r.scaleY*_],s=a.lines[0|d*a.scaleY*_],u=0;u<e;u++)m=o[0|u*r.scaleX*x],k[A++]=m,m=s[0|u*a.scaleX*x],k[A++]=m;break;case 3:for(E=!0,this.adobe&&this.adobe.transformCode?E=!0:void 0!==this.opts.colorTransform&&(E=!!this.opts.colorTransform),r=this.components[0],a=this.components[1],n=this.components[2],d=0;d<t;d++)for(o=r.lines[0|d*r.scaleY*_],s=a.lines[0|d*a.scaleY*_],c=n.lines[0|d*n.scaleY*_],u=0;u<e;u++)E?(m=o[0|u*r.scaleX*x],p=s[0|u*a.scaleX*x],w=clampTo8bit(m+1.402*((h=c[0|u*n.scaleX*x])-128)),S=clampTo8bit(m-.3441363*(p-128)-.71413636*(h-128)),
|
1020
1020
|
T=clampTo8bit(m+1.772*(p-128))):(w=o[0|u*r.scaleX*x],S=s[0|u*a.scaleX*x],T=c[0|u*n.scaleX*x]),k[A++]=w,k[A++]=S,k[A++]=T;break;case 4:if(!this.adobe)throw new Error("Unsupported color mode (4 components)");for(E=!1,this.adobe&&this.adobe.transformCode?E=!0:void 0!==this.opts.colorTransform&&(E=!!this.opts.colorTransform),r=this.components[0],a=this.components[1],n=this.components[2],i=this.components[3],d=0;d<t;d++)for(o=r.lines[0|d*r.scaleY*_],s=a.lines[0|d*a.scaleY*_],c=n.lines[0|d*n.scaleY*_],l=i.lines[0|d*i.scaleY*_],u=0;u<e;u++)E?(m=o[0|u*r.scaleX*x],p=s[0|u*a.scaleX*x],h=c[0|u*n.scaleX*x],f=l[0|u*i.scaleX*x],y=255-clampTo8bit(m+1.402*(h-128)),v=255-clampTo8bit(m-.3441363*(p-128)-.71413636*(h-128)),b=255-clampTo8bit(m+1.772*(p-128))):(y=o[0|u*r.scaleX*x],v=s[0|u*a.scaleX*x],b=c[0|u*n.scaleX*x],f=l[0|u*i.scaleX*x]),k[A++]=255-y,k[A++]=255-v,k[A++]=255-b,k[A++]=255-f;break;default:throw new Error("Unsupported color mode")}return k},copyToImageData:function copyToImageData(e,t){
|
1021
1021
|
var r,a,n,i,o,s,c,l,u,d=e.width,m=e.height,p=e.data,h=this.getData(d,m),f=0,y=0;switch(this.components.length){case 1:for(a=0;a<m;a++)for(r=0;r<d;r++)n=h[f++],p[y++]=n,p[y++]=n,p[y++]=n,t&&(p[y++]=255);break;case 3:for(a=0;a<m;a++)for(r=0;r<d;r++)c=h[f++],l=h[f++],u=h[f++],p[y++]=c,p[y++]=l,p[y++]=u,t&&(p[y++]=255);break;case 4:for(a=0;a<m;a++)for(r=0;r<d;r++)o=h[f++],s=h[f++],n=h[f++],c=255-clampTo8bit(o*(1-(i=h[f++])/255)+i),l=255-clampTo8bit(s*(1-i/255)+i),u=255-clampTo8bit(n*(1-i/255)+i),p[y++]=c,p[y++]=l,p[y++]=u,t&&(p[y++]=255);break;default:throw new Error("Unsupported color mode")}}};var l=0,u=0;function requestMemoryAllocation(e=0){var t=l+e;if(t>u){var r=Math.ceil((t-u)/1024/1024);throw new Error(`maxMemoryUsageInMB limit exceeded by at least ${r}MB`)}l=t}return constructor.resetMaxMemoryUsage=function(e){l=0,u=e},constructor.getBytesAllocated=function(){return l},constructor.requestMemoryAllocation=requestMemoryAllocation,constructor}();e.exports=function decode(e,r={}){
|
1022
|
-
var a={colorTransform:void 0,useTArray:!1,formatAsRGBA:!0,tolerantDecoding:!0,maxResolutionInMP:100,maxMemoryUsageInMB:512,...r},n=new Uint8Array(e),i=new t;i.opts=a,t.resetMaxMemoryUsage(1024*a.maxMemoryUsageInMB*1024),i.parse(n);var o=a.formatAsRGBA?4:3,s=i.width*i.height*o;try{t.requestMemoryAllocation(s);var c={width:i.width,height:i.height,exifBuffer:i.exifBuffer,data:a.useTArray?new Uint8Array(s):Buffer$2.alloc(s)};i.comments.length>0&&(c.comments=i.comments)}catch(e){throw e instanceof RangeError?new Error("Could not allocate enough memory for the image. Required: "+s):e}return i.copyToImageData(c,a.formatAsRGBA),c}}(SN);var TN={encode:wN.exports,decode:SN.exports};const EN=kc,xN=vi.exports,_N=TN,AN=
|
1022
|
+
var a={colorTransform:void 0,useTArray:!1,formatAsRGBA:!0,tolerantDecoding:!0,maxResolutionInMP:100,maxMemoryUsageInMB:512,...r},n=new Uint8Array(e),i=new t;i.opts=a,t.resetMaxMemoryUsage(1024*a.maxMemoryUsageInMB*1024),i.parse(n);var o=a.formatAsRGBA?4:3,s=i.width*i.height*o;try{t.requestMemoryAllocation(s);var c={width:i.width,height:i.height,exifBuffer:i.exifBuffer,data:a.useTArray?new Uint8Array(s):Buffer$2.alloc(s)};i.comments.length>0&&(c.comments=i.comments)}catch(e){throw e instanceof RangeError?new Error("Could not allocate enough memory for the image. Required: "+s):e}return i.copyToImageData(c,a.formatAsRGBA),c}}(SN);var TN={encode:wN.exports,decode:SN.exports};const EN=kc,xN=vi.exports,_N=TN,AN=ik;class ScreenshotThumbnails extends EN{static get meta(){return{id:"screenshot-thumbnails",scoreDisplayMode:EN.SCORING_MODES.INFORMATIVE,title:"Screenshot Thumbnails",description:"This is what the load of your site looked like.",requiredArtifacts:["traces","GatherContext"]}}
|
1023
1023
|
static scaleImageToThumbnail(e){const t=120,r=e.width/t,a=Math.floor(e.height/r),n=new Uint8Array(t*a*4);for(let i=0;i<t;i++)for(let o=0;o<a;o++){const a=Math.floor(i*r),s=4*(Math.floor(o*r)*e.width+a),c=4*(o*t+i);n[c]=e.data[s],n[c+1]=e.data[s+1],n[c+2]=e.data[s+2],n[c+3]=e.data[s+3]}return{width:t,height:a,data:n}}static async _audit(e,t){const r=e.traces[EN.DEFAULT_PASS],a=new Map,n=await AN.request(r,t),i=t.options.minimumTimelineDuration||3e3,o=[],s=n.frames.filter((e=>!e.isProgressInterpolated())),c=n.complete||Math.max(...n.frames.map((e=>e.getTimeStamp()-n.beginning))),l=Math.max(c,i);if(!s.length||!Number.isFinite(l))throw new xN(xN.errors.INVALID_SPEEDLINE);for(let e=1;e<=10;e++){const t=n.beginning+l*e/10;let r,i=null;10===e?i=s[s.length-1]:s.forEach((e=>{e.getTimeStamp()<=t&&(i=e)}));const c=a.get(i);if(c)r=c;else{const e=i.getParsedImage(),t=ScreenshotThumbnails.scaleImageToThumbnail(e);r=_N.encode(t,90).data.toString("base64"),a.set(i,r)}o.push({
|
1024
|
-
timing:Math.round(t-n.beginning),timestamp:1e3*t,data:`data:image/jpeg;base64,${r}`})}return{score:1,details:{type:"filmstrip",scale:l,items:o}}}static async audit(e,t){try{return await this._audit(e,t)}catch(t){if(new Set([xN.errors.NO_SCREENSHOTS.code,xN.errors.SPEEDINDEX_OF_ZERO.code,xN.errors.NO_SPEEDLINE_FRAMES.code,xN.errors.INVALID_SPEEDLINE.code]).has(t.code)&&"timespan"===e.GatherContext.gatherMode)return{notApplicable:!0,score:1};throw t}}}var RN=ScreenshotThumbnails;const kN=kc,DN=
|
1024
|
+
timing:Math.round(t-n.beginning),timestamp:1e3*t,data:`data:image/jpeg;base64,${r}`})}return{score:1,details:{type:"filmstrip",scale:l,items:o}}}static async audit(e,t){try{return await this._audit(e,t)}catch(t){if(new Set([xN.errors.NO_SCREENSHOTS.code,xN.errors.SPEEDINDEX_OF_ZERO.code,xN.errors.NO_SPEEDLINE_FRAMES.code,xN.errors.INVALID_SPEEDLINE.code]).has(t.code)&&"timespan"===e.GatherContext.gatherMode)return{notApplicable:!0,score:1};throw t}}}var RN=ScreenshotThumbnails;const kN=kc,DN=jb,CN=zS,IN=qb;class ScriptTreemapDataAudit extends kN{static get meta(){return{id:"script-treemap-data",scoreDisplayMode:kN.SCORING_MODES.INFORMATIVE,title:"Script Treemap Data",description:"Used for treemap app",requiredArtifacts:["traces","devtoolsLogs","SourceMaps","ScriptElements","JsUsage","URL"]}}static makeScriptNode(e,t,r){function newNode(e){return{name:e,resourceBytes:0}}const a=newNode(t);function addAllNodesInSourcePath(e,r){let n=a;a.resourceBytes+=r.resourceBytes,
|
1025
1025
|
r.unusedBytes&&(a.unusedBytes=(a.unusedBytes||0)+r.unusedBytes);const i=e.replace(t,"").split(/\/+/);i.forEach(((e,t)=>{if(0===e.length)return;const a=t===i.length-1;let o=n.children&&n.children.find((t=>t.name===e));o||(o=newNode(e),n.children=n.children||[],n.children.push(o)),n=o,n.resourceBytes+=r.resourceBytes,r.unusedBytes&&(n.unusedBytes=(n.unusedBytes||0)+r.unusedBytes),a&&void 0!==r.duplicatedNormalizedModuleName&&(n.duplicatedNormalizedModuleName=r.duplicatedNormalizedModuleName)}))}for(const[e,t]of Object.entries(r))addAllNodesInSourcePath(e,t);if(function collapseAll(e){for(;e.children&&1===e.children.length;)e.name+="/"+e.children[0].name,e.children=e.children[0].children;if(e.children)for(const t of e.children)collapseAll(t)}(a),!a.name)return{...a,name:e,children:a.children};const n={...a};return n.name=e,n.children=[a],n}static async makeNodes(e,t){const r=[];let a=0;for(const t of e.ScriptElements)t.src||(a+=(t.content||"").length);if(a){const t=e.URL.finalUrl;r.push({
|
1026
1026
|
name:t,resourceBytes:a})}const n=await DN.request(e,t),i=await IN.request(e,t);for(const a of e.ScriptElements){if(!a.src)continue;const o=a.src,s=n.find((e=>a.src===e.script.src)),c=e.JsUsage[a.src]||[];if(!s&&0===c.length){r.push({name:o,resourceBytes:a.content?.length||0});continue}const l=await CN.request({url:a.src,scriptCoverages:c,bundle:s},t);let u;if(s&&!("errorMessage"in s.sizes)){const e={};for(const t of Object.keys(s.sizes.files)){const r={resourceBytes:s.sizes.files[t]};l.sourcesWastedBytes&&(r.unusedBytes=l.sourcesWastedBytes[t]);let a=t;s.rawMap.sourceRoot&&t.startsWith(s.rawMap.sourceRoot)&&(a=t.replace(s.rawMap.sourceRoot,""));const n=IN.normalizeSource(a);i.has(n)&&(r.duplicatedNormalizedModuleName=n),e[t]=r}if(s.sizes.unmappedBytes){const t={resourceBytes:s.sizes.unmappedBytes};l.sourcesWastedBytes&&(t.unusedBytes=l.sourcesWastedBytes["(unmapped)"]),e["(unmapped)"]=t}u=this.makeScriptNode(a.src,s.rawMap.sourceRoot||"",e)}else u={name:o,resourceBytes:l.totalBytes,
|
1027
|
-
unusedBytes:l.wastedBytes};r.push(u)}return r}static async audit(e,t){return{score:1,details:{type:"treemap-data",nodes:await ScriptTreemapDataAudit.makeNodes(e,t)}}}}var NN=ScriptTreemapDataAudit,LN={exports:{}};const MN=kc,PN=ji,ON=
|
1027
|
+
unusedBytes:l.wastedBytes};r.push(u)}return r}static async audit(e,t){return{score:1,details:{type:"treemap-data",nodes:await ScriptTreemapDataAudit.makeNodes(e,t)}}}}var NN=ScriptTreemapDataAudit,LN={exports:{}};const MN=kc,PN=ji,ON=HT,FN={title:"Document has a valid `rel=canonical`",failureTitle:"Document does not have a valid `rel=canonical`",description:"Canonical links suggest which URL to show in search results. [Learn more](https://web.dev/canonical/).",explanationConflict:"Multiple conflicting URLs ({urlList})",explanationInvalid:"Invalid URL ({url})",explanationRelative:"Is not an absolute URL ({url})",explanationPointsElsewhere:"Points to another `hreflang` location ({url})",explanationRoot:"Points to the domain's root URL (the homepage), instead of an equivalent page of content"},UN=oi.createMessageInstanceIdFn("lighthouse-core/audits/seo/canonical.js",FN);class Canonical extends MN{static get meta(){return{id:"canonical",title:UN(FN.title),failureTitle:UN(FN.failureTitle),
|
1028
1028
|
description:UN(FN.description),supportedModes:["navigation"],requiredArtifacts:["LinkElements","URL","devtoolsLogs"]}}static collectCanonicalURLs(e){const t=new Set,r=new Set;let a,n;for(const i of e)if("body"!==i.source)if("canonical"===i.rel){if(!i.hrefRaw)continue;i.href?PN.isValid(i.hrefRaw)?t.add(i.href):n=i:a=i}else"alternate"===i.rel&&i.href&&i.hreflang&&r.add(i.href);return{uniqueCanonicalURLs:t,hreflangURLs:r,invalidCanonicalLink:a,relativeCanonicallink:n}}static findInvalidCanonicalURLReason(e){const{uniqueCanonicalURLs:t,invalidCanonicalLink:r,relativeCanonicallink:a}=e;if(r)return{score:0,explanation:UN(FN.explanationInvalid,{url:r.hrefRaw})};if(a)return{score:0,explanation:UN(FN.explanationRelative,{url:a.hrefRaw})};const n=Array.from(t);return 0===n.length?{score:1,notApplicable:!0}:n.length>1?{score:0,explanation:UN(FN.explanationConflict,{urlList:n.join(", ")})}:void 0}static findCommonCanonicalURLMistakes(e,t,r){const{hreflangURLs:a}=e
|
1029
1029
|
;return a.has(r.href)&&a.has(t.href)&&r.href!==t.href?{score:0,explanation:UN(FN.explanationPointsElsewhere,{url:r.href})}:t.origin===r.origin&&"/"===t.pathname&&"/"!==r.pathname?{score:0,explanation:UN(FN.explanationRoot)}:void 0}static async audit(e,t){const r=e.devtoolsLogs[MN.DEFAULT_PASS],a=await ON.request({devtoolsLog:r,URL:e.URL},t),n=new PN(a.url),i=Canonical.collectCanonicalURLs(e.LinkElements),o=Canonical.findInvalidCanonicalURLReason(i);if(o)return o;const s=new PN([...i.uniqueCanonicalURLs][0]),c=Canonical.findCommonCanonicalURLMistakes(i,s,n);return c||{score:1}}}LN.exports=Canonical,LN.exports.UIStrings=FN;var jN={exports:{}};const BN=kc,$N={title:"Links are crawlable",failureTitle:"Links are not crawlable",
|
1030
1030
|
description:"Search engines may use `href` attributes on links to crawl websites. Ensure that the `href` attribute of anchor elements links to an appropriate destination, so more pages of the site can be discovered. [Learn More](https://support.google.com/webmasters/answer/9112205)",columnFailingLink:"Uncrawlable Link"},qN=oi.createMessageInstanceIdFn("lighthouse-core/audits/seo/crawlable-anchors.js",$N);jN.exports=class CrawlableAnchors extends BN{static get meta(){return{id:"crawlable-anchors",title:qN($N.title),failureTitle:qN($N.failureTitle),description:qN($N.description),requiredArtifacts:["AnchorElements","URL"]}}static audit({AnchorElements:e,URL:t}){const r=e.filter((({rawHref:e,name:r="",role:a=""})=>{if(e=e.replace(/\s/g,""),r=r.trim(),(a=a.trim()).length>0)return;if(e.startsWith("mailto:"))return;if(e.startsWith("file:"))return!0;if(!(r.length>0)){if(""===e)return!0;if(/javascript:void(\(|)0(\)|)/.test(e))return!0;try{new URL(e,t.finalUrl)}catch(e){return!0}}})),a=[{
|
@@ -1044,11 +1044,11 @@ static audit({LinkElements:e}){const t=[],r=e.filter((e=>{const t="alternate"===
|
|
1044
1044
|
;return t>-1?e.substr(0,t):e}function splitLine(e){var t=String(e).indexOf(":");return!e||t<0?null:[e.slice(0,t),e.slice(t+1)]}function formatUserAgent(e){var t=e.toLowerCase(),r=t.indexOf("/");return r>-1&&(t=t.substr(0,r)),t.trim()}function normaliseEncoding(e){try{return urlEncodeToUpper(encodeURI(e).replace(/%25/g,"%"))}catch(t){return e}}function urlEncodeToUpper(e){return e.replace(/%[0-9a-fA-F]{2}/g,(function(e){return e.toUpperCase()}))}function matches(e,t){var r=new Array(t.length+1),a=1;r[0]=0;for(var n=0;n<e.length;n++){if("$"===e[n]&&n+1===e.length)return r[a-1]===t.length;if("*"==e[n]){a=t.length-r[0]+1;for(var i=1;i<a;i++)r[i]=r[i-1]+1}else{var o=0;for(i=0;i<a;i++)r[i]<t.length&&t[r[i]]===e[n]&&(r[o++]=r[i]+1);if(0==o)return!1;a=o}}return!0}function parseUrl(e){try{return new URL(e,"http://robots-relative.samclarke.com/")}catch(e){return null}}function Robots$1(e,t){this._url=parseUrl(e)||{},this._url.port=this._url.port||80,this._rules=Object.create(null),
|
1045
1045
|
this._sitemaps=[],this._preferredHost=null,function parseRobots(e,t){for(var r=e.split(/\r\n|\r|\n/).map(removeComments).map(splitLine).map(trimLine),a=[],n=!0,i=0;i<r.length;i++){var o=r[i];if(o&&o[0]){switch(o[0].toLowerCase()){case"user-agent":n&&(a.length=0),o[1]&&a.push(formatUserAgent(o[1]));break;case"disallow":t.addRule(a,o[1],!1,i+1);break;case"allow":t.addRule(a,o[1],!0,i+1);break;case"crawl-delay":t.setCrawlDelay(a,o[1]);break;case"sitemap":o[1]&&t.addSitemap(o[1]);break;case"host":o[1]&&t.setPreferredHost(o[1].toLowerCase())}n="user-agent"!==o[0].toLowerCase()}}}(t||"",this)}Robots$1.prototype.addRule=function(e,t,r,a){var n=this._rules;e.forEach((function(e){n[e]=n[e]||[],t&&n[e].push({pattern:normaliseEncoding(t),allow:r,lineNumber:a})}))},Robots$1.prototype.setCrawlDelay=function(e,t){var r=this._rules,a=Number(t);e.forEach((function(e){r[e]=r[e]||[],isNaN(a)||(r[e].crawlDelay=a)}))},Robots$1.prototype.addSitemap=function(e){this._sitemaps.push(e)},
|
1046
1046
|
Robots$1.prototype.setPreferredHost=function(e){this._preferredHost=e},Robots$1.prototype._getRule=function(e,t){var r=parseUrl(e)||{},a=formatUserAgent(t||"*");if(r.port=r.port||80,r.protocol===this._url.protocol&&r.hostname===this._url.hostname&&r.port===this._url.port){var n=this._rules[a]||this._rules["*"]||[];return function findRule(e,t){for(var r=null,a=0;a<t.length;a++){var n=t[a];matches(n.pattern,e)&&(!r||n.pattern.length>r.pattern.length||n.pattern.length==r.pattern.length&&n.allow&&!r.allow)&&(r=n)}return r}(urlEncodeToUpper(r.pathname+r.search),n)}},Robots$1.prototype.isAllowed=function(e,t){var r=this._getRule(e,t);if(void 0!==r)return!r||r.allow},Robots$1.prototype.getMatchingLineNumber=function(e,t){var r=this._getRule(e,t);return r?r.lineNumber:-1},Robots$1.prototype.isDisallowed=function(e,t){return!this.isAllowed(e,t)},Robots$1.prototype.getCrawlDelay=function(e){var t=formatUserAgent(e||"*");return(this._rules[t]||this._rules["*"]||{}).crawlDelay},
|
1047
|
-
Robots$1.prototype.getPreferredHost=function(){return this._preferredHost},Robots$1.prototype.getSitemaps=function(){return this._sitemaps.slice(0)};var gL=Robots$1;const fL=kc,robotsParser=function(e,t){return new gL(e,t)},yL=ji,vL=
|
1047
|
+
Robots$1.prototype.getPreferredHost=function(){return this._preferredHost},Robots$1.prototype.getSitemaps=function(){return this._sitemaps.slice(0)};var gL=Robots$1;const fL=kc,robotsParser=function(e,t){return new gL(e,t)},yL=ji,vL=HT,bL=new Set(["noindex","none"]),wL="unavailable_after",SL={title:"Page isn’t blocked from indexing",failureTitle:"Page is blocked from indexing",description:"Search engines are unable to include your pages in search results if they don't have permission to crawl them. [Learn more](https://web.dev/is-crawable/)."},TL=oi.createMessageInstanceIdFn("lighthouse-core/audits/seo/is-crawlable.js",SL);function hasBlockingDirective(e){return e.split(",").map((e=>e.toLowerCase().trim())).some((e=>bL.has(e)||function isUnavailable(e){const t=e.split(":");if(t.length<=1||t[0]!==wL)return!1;const r=Date.parse(t.slice(1).join(":"));return!isNaN(r)&&r<Date.now()}(e)))}hL.exports=class IsCrawlable extends fL{static get meta(){return{id:"is-crawlable",title:TL(SL.title),
|
1048
1048
|
failureTitle:TL(SL.failureTitle),description:TL(SL.description),supportedModes:["navigation"],requiredArtifacts:["MetaElements","RobotsTxt","URL","devtoolsLogs"]}}static audit(e,t){const r=e.devtoolsLogs[fL.DEFAULT_PASS],a=e.MetaElements.find((e=>"robots"===e.name));return vL.request({devtoolsLog:r,URL:e.URL},t).then((t=>{const r=[];if(a){const e=a.content||"";hasBlockingDirective(e)&&r.push({source:{...fL.makeNodeItem(a.node),snippet:`<meta name="robots" content="${e}" />`}})}if(t.responseHeaders&&t.responseHeaders.filter((e=>"x-robots-tag"===e.name.toLowerCase()&&!function hasUserAgent(e){const t=e.match(/^([^,:]+):/);return!!t&&t[1].toLowerCase()!==wL}(e.value)&&hasBlockingDirective(e.value))).forEach((e=>r.push({source:`${e.name}: ${e.value}`}))),e.RobotsTxt.content){const a=new yL("/robots.txt",t.url),n=robotsParser(a.href,e.RobotsTxt.content);if(!n.isAllowed(t.url)){const e=n.getMatchingLineNumber(t.url)||1;r.push({source:{type:"source-location",url:a.href,urlProvider:"network",
|
1049
1049
|
line:e-1,column:0}})}}const n=fL.makeTableDetails([{key:"source",itemType:"code",text:"Blocking Directive Source"}],r);return{score:Number(0===r.length),details:n}}))}},hL.exports.UIStrings=SL;var EL={exports:{}};const xL=kc,_L=ji,AL=new Set(["click here","click this","go","here","information","learn more","more","more info","more information","right here","read more","see more","start","this","ここをクリック","こちらをクリック","リンク","続きを読む","続く","全文表示","click aquí","click aqui","clicka aquí","clicka aqui","pincha aquí","pincha aqui","aquí","aqui","más","mas","más información","más informacion","mas información","mas informacion","este","enlace","este enlace","empezar","clique aqui","ir","mais informação","mais informações","mais","veja mais","여기","여기를 클릭","클릭","링크","자세히","자세히 보기","계속","이동","전체 보기","här","klicka här","läs mer","mer","mer info","mer information"]),RL={title:"Links have descriptive text",failureTitle:"Links do not have descriptive text",
|
1050
1050
|
description:"Descriptive link text helps search engines understand your content. [Learn more](https://web.dev/link-text/).",displayValue:"{itemCount, plural,\n =1 {1 link found}\n other {# links found}\n }"},kL=oi.createMessageInstanceIdFn("lighthouse-core/audits/seo/link-text.js",RL);EL.exports=class LinkText extends xL{static get meta(){return{id:"link-text",title:kL(RL.title),failureTitle:kL(RL.failureTitle),description:kL(RL.description),requiredArtifacts:["URL","AnchorElements"]}}static audit(e){const t=e.AnchorElements.filter((e=>e.href&&!e.rel.includes("nofollow"))).filter((t=>{const r=t.href.toLowerCase();return!(r.startsWith("javascript:")||r.startsWith("mailto:")||_L.equalWithExcludedFragments(t.href,e.URL.finalUrl))&&AL.has(t.text.trim().toLowerCase())})).map((e=>({href:e.href,text:e.text.trim()}))),r=xL.makeTableDetails([{key:"href",itemType:"url",text:"Link destination"},{key:"text",itemType:"text",text:"Link Text"}],t,{});let a
|
1051
|
-
;return t.length&&(a=kL(RL.displayValue,{itemCount:t.length})),{score:Number(0===t.length),details:r,displayValue:a}}},EL.exports.UIStrings=RL;var DL={exports:{}};const CL=
|
1051
|
+
;return t.length&&(a=kL(RL.displayValue,{itemCount:t.length})),{score:Number(0===t.length),details:r,displayValue:a}}},EL.exports.UIStrings=RL;var DL={exports:{}};const CL=iy,IL={description:"Run the [Structured Data Testing Tool](https://search.google.com/structured-data/testing-tool/) and the [Structured Data Linter](http://linter.structured-data.org/) to validate structured data. [Learn more](https://web.dev/structured-data/).",title:"Structured data is valid"},NL=oi.createMessageInstanceIdFn("lighthouse-core/audits/seo/manual/structured-data.js",IL);DL.exports=class StructuredData extends CL{static get meta(){return Object.assign({id:"structured-data",description:NL(IL.description),title:NL(IL.title)},super.partialMeta)}},DL.exports.UIStrings=IL;var LL={exports:{}};const ML=kc,PL={title:"Document has a meta description",failureTitle:"Document does not have a meta description",
|
1052
1052
|
description:"Meta descriptions may be included in search results to concisely summarize page content. [Learn more](https://web.dev/meta-description/).",explanation:"Description text is empty."},OL=oi.createMessageInstanceIdFn("lighthouse-core/audits/seo/meta-description.js",PL);LL.exports=class Description extends ML{static get meta(){return{id:"meta-description",title:OL(PL.title),failureTitle:OL(PL.failureTitle),description:OL(PL.description),requiredArtifacts:["MetaElements"]}}static audit(e){const t=e.MetaElements.find((e=>"description"===e.name));if(!t)return{score:0};return 0===(t.content||"").trim().length?{score:0,explanation:OL(PL.explanation)}:{score:1}}},LL.exports.UIStrings=PL;var FL={exports:{}};const UL=kc,jL=ji,BL="application/x-java-applet",$L="application/x-java-bean",qL=new Set(["application/x-shockwave-flash",BL,$L,"application/x-silverlight","application/x-silverlight-2"]),zL=new Set(["swf","flv","class","xap"]),VL=new Set(["code","movie","source","src"]),WL={
|
1053
1053
|
title:"Document avoids plugins",failureTitle:"Document uses plugins",description:"Search engines can't index plugin content, and many devices restrict plugins or don't support them. [Learn more](https://web.dev/plugins/)."},GL=oi.createMessageInstanceIdFn("lighthouse-core/audits/seo/plugins.js",WL);function isPluginURL(e){try{const t=new jL(e,"http://example.com").pathname.split(".");if(t.length<2)return!1;const r=t[t.length-1];return zL.has(r.trim().toLowerCase())}catch(e){return!1}}FL.exports=class Plugins extends UL{static get meta(){return{id:"plugins",title:GL(WL.title),failureTitle:GL(WL.failureTitle),description:GL(WL.description),requiredArtifacts:["EmbeddedContent"]}}static audit(e){const t=e.EmbeddedContent.filter((e=>{if("APPLET"===e.tagName)return!0;if(("EMBED"===e.tagName||"OBJECT"===e.tagName)&&e.type&&function isPluginType(e){return e=e.trim().toLowerCase(),qL.has(e)||e.startsWith(BL)||e.startsWith($L)}(e.type))return!0;const t=e.src||e.code
|
1054
1054
|
;if("EMBED"===e.tagName&&t&&isPluginURL(t))return!0;if("OBJECT"===e.tagName&&e.data&&isPluginURL(e.data))return!0;return e.params.filter((e=>VL.has(e.name.trim().toLowerCase())&&isPluginURL(e.value))).length>0})).map((e=>({source:UL.makeNodeItem(e.node)}))),r=UL.makeTableDetails([{key:"source",itemType:"code",text:"Element source"}],t);return{score:Number(0===t.length),details:r}}},FL.exports.UIStrings=WL;var HL={exports:{}};const YL=kc,KL=ji,JL="sitemap",XL="user-agent",ZL="allow",QL="disallow",eM=new Set([ZL,QL]),tM=new Set([XL,QL,ZL,JL,"crawl-delay","clean-param","host","request-rate","visit-time","noindex"]),rM=new Set(["https:","http:","ftp:"]),aM={title:"robots.txt is valid",failureTitle:"robots.txt is not valid",description:"If your robots.txt file is malformed, crawlers may not be able to understand how you want your website to be crawled or indexed. [Learn more](https://web.dev/robots-txt/).",displayValueHttpBadCode:"Request for robots.txt returned HTTP status: {statusCode}",
|
@@ -1058,21 +1058,21 @@ displayValueValidationError:"{itemCount, plural,\n =1 {1 error found}\n ot
|
|
1058
1058
|
return e=oM.filterOutTinyRects(e),e=mergeTouchingClientRects(e=oM.filterOutRectsContainedByOthers(e))}};const cM=kc,lM=YN,{rectsTouchOrOverlap:uM,getRectOverlapArea:dM,getRectAtCenter:mM,allRectsContainedWithinEachOther:pM,getLargestRect:hM,getBoundingRectWithPadding:gM}=kp,{getTappableRectsFromClientRects:fM}=sM,yM=oi,vM={title:"Tap targets are sized appropriately",failureTitle:"Tap targets are not sized appropriately",description:"Interactive elements like buttons and links should be large enough (48x48px), and have enough space around them, to be easy enough to tap without overlapping onto other elements. [Learn more](https://web.dev/tap-targets/).",tapTargetHeader:"Tap Target",overlappingTargetHeader:"Overlapping Target",explanationViewportMetaNotOptimized:"Tap targets are too small because there's no viewport meta tag optimized for mobile screens",displayValue:"{decimalProportion, number, percent} appropriately sized tap targets"
|
1059
1059
|
},bM=yM.createMessageInstanceIdFn("lighthouse-core/audits/seo/tap-targets.js",vM);function clientRectBelowMinimumSize(e){return e.width<48||e.height<48}function getOverlapFailureForTargetPair(e,t){let r=null;for(const a of e){const e=mM(a,48),n=dM(e,a);for(const a of t){const t=dM(e,a),i=t/n;i<.25||(!r||i>r.overlapScoreRatio)&&(r={overlapScoreRatio:i,tapTargetScore:n,overlappingTargetScore:t})}}return r}class TapTargets extends cM{static get meta(){return{id:"tap-targets",title:bM(vM.title),failureTitle:bM(vM.failureTitle),description:bM(vM.description),requiredArtifacts:["MetaElements","TapTargets"]}}static async audit(e,t){if("desktop"===t.settings.formFactor)return{score:1,notApplicable:!0};if(!(await lM.request(e.MetaElements,t)).isMobileOptimized)return{score:0,explanation:bM(vM.explanationViewportMetaNotOptimized)};const r=function getBoundedTapTargets(e){return e.map((e=>({tapTarget:e,paddedBoundsRect:gM(e.clientRects,48)})))}(e.TapTargets),a=function getAllOverlapFailures(e,t){
|
1060
1060
|
const r=[];return e.forEach((e=>{const a=fM(e.tapTarget.clientRects);for(const n of t){if(n===e)continue;if(!uM(e.paddedBoundsRect,n.paddedBoundsRect))continue;if(e.tapTarget.href===n.tapTarget.href&&/https?:\/\//.test(e.tapTarget.href))continue;const t=n.tapTarget.clientRects;if(pM(a,t))continue;const i=getOverlapFailureForTargetPair(a,t);i&&r.push({...i,tapTarget:e.tapTarget,overlappingTarget:n.tapTarget})}})),r}(function getTooSmallTargets(e){return e.filter((e=>e.tapTarget.clientRects.every(clientRectBelowMinimumSize)))}(r),r),n=function getTableItems(e){const t=e.map((e=>{const t=hM(e.tapTarget.clientRects),r=Math.floor(t.width),a=Math.floor(t.height),n=r+"x"+a;return{tapTarget:cM.makeNodeItem(e.tapTarget.node),overlappingTarget:cM.makeNodeItem(e.overlappingTarget.node),tapTargetScore:e.tapTargetScore,overlappingTargetScore:e.overlappingTargetScore,overlapScoreRatio:e.overlapScoreRatio,size:n,width:r,height:a}}));return t.sort(((e,t)=>t.overlapScoreRatio-e.overlapScoreRatio)),t
|
1061
|
-
}(function mergeSymmetricFailures(e){const t=[];return e.forEach(((r,a)=>{const n=e.find((e=>e.tapTarget===r.overlappingTarget&&e.overlappingTarget===r.tapTarget));if(!n)return void t.push(r);const{overlapScoreRatio:i}=r,{overlapScoreRatio:o}=n;(i>o||i===o&&a<e.indexOf(n))&&t.push(r)})),t}(a)),i=[{key:"tapTarget",itemType:"node",text:bM(vM.tapTargetHeader)},{key:"size",itemType:"text",text:bM(yM.UIStrings.columnSize)},{key:"overlappingTarget",itemType:"node",text:bM(vM.overlappingTargetHeader)}],o=cM.makeTableDetails(i,n),s=e.TapTargets.length,c=new Set(a.map((e=>e.tapTarget))).size;let l=1,u=1;c>0&&(u=(s-c)/s,l=.89*u);return{score:l,details:o,displayValue:bM(vM.displayValue,{decimalProportion:u})}}}TapTargets.FINGER_SIZE_PX=48,iM.exports=TapTargets,iM.exports.UIStrings=vM;var wM={exports:{}};const SM=kc,TM=oi,EM=
|
1061
|
+
}(function mergeSymmetricFailures(e){const t=[];return e.forEach(((r,a)=>{const n=e.find((e=>e.tapTarget===r.overlappingTarget&&e.overlappingTarget===r.tapTarget));if(!n)return void t.push(r);const{overlapScoreRatio:i}=r,{overlapScoreRatio:o}=n;(i>o||i===o&&a<e.indexOf(n))&&t.push(r)})),t}(a)),i=[{key:"tapTarget",itemType:"node",text:bM(vM.tapTargetHeader)},{key:"size",itemType:"text",text:bM(yM.UIStrings.columnSize)},{key:"overlappingTarget",itemType:"node",text:bM(vM.overlappingTargetHeader)}],o=cM.makeTableDetails(i,n),s=e.TapTargets.length,c=new Set(a.map((e=>e.tapTarget))).size;let l=1,u=1;c>0&&(u=(s-c)/s,l=.89*u);return{score:l,details:o,displayValue:bM(vM.displayValue,{decimalProportion:u})}}}TapTargets.FINGER_SIZE_PX=48,iM.exports=TapTargets,iM.exports.UIStrings=vM;var wM={exports:{}};const SM=kc,TM=oi,EM=HT,xM=Lo,_M=Fo,AM={title:"Initial server response time was short",failureTitle:"Reduce initial server response time",
|
1062
1062
|
description:"Keep the server response time for the main document short because all other requests depend on it. [Learn more](https://web.dev/time-to-first-byte/).",displayValue:"Root document took {timeInMs, number, milliseconds} ms"},RM=TM.createMessageInstanceIdFn("lighthouse-core/audits/server-response-time.js",AM);class ServerResponseTime extends SM{static get meta(){return{id:"server-response-time",title:RM(AM.title),failureTitle:RM(AM.failureTitle),description:RM(AM.description),supportedModes:["timespan","navigation"],requiredArtifacts:["devtoolsLogs","URL","GatherContext"]}}static calculateResponseTime(e){const t=e.timing;return t?t.receiveHeadersEnd-t.sendEnd:0}static async audit(e,t){const r=e.devtoolsLogs[SM.DEFAULT_PASS];let a;if("timespan"===e.GatherContext.gatherMode){const n=await xM.request(r,t),i=_M.findOptionalMainDocument(n,e.URL.finalUrl);if(!i)return{score:null,notApplicable:!0};a=i}else a=await EM.request({devtoolsLog:r,URL:e.URL},t)
|
1063
1063
|
;const n=ServerResponseTime.calculateResponseTime(a),i=n<600,o=RM(AM.displayValue,{timeInMs:n}),s=[{key:"url",valueType:"url",label:RM(TM.UIStrings.columnURL)},{key:"responseTime",valueType:"timespanMs",label:RM(TM.UIStrings.columnTimeSpent)}],c=SM.makeOpportunityDetails(s,[{url:a.url,responseTime:n}],n-100);return{numericValue:n,numericUnit:"millisecond",score:Number(i),displayValue:o,details:c}}}wM.exports=ServerResponseTime,wM.exports.UIStrings=AM;var kM={exports:{}};const DM=ji,CM=kc,IM={title:"Registers a service worker that controls page and `start_url`",failureTitle:"Does not register a service worker that controls page and `start_url`",description:"The service worker is the technology that enables your app to use many Progressive Web App features, such as offline, add to homescreen, and push notifications. [Learn more](https://web.dev/service-worker/).",explanationOutOfScope:"This origin has one or more service workers, however the page ({pageUrl}) is not in scope.",
|
1064
1064
|
explanationNoManifest:"This page is controlled by a service worker, however no `start_url` was found because no manifest was fetched.",explanationBadManifest:"This page is controlled by a service worker, however no `start_url` was found because manifest failed to parse as valid JSON",explanationBadStartUrl:"This page is controlled by a service worker, however the `start_url` ({startUrl}) is not in the service worker's scope ({scopeUrl})"},NM=oi.createMessageInstanceIdFn("lighthouse-core/audits/service-worker.js",IM);class ServiceWorker extends CM{static get meta(){return{id:"service-worker",title:NM(IM.title),failureTitle:NM(IM.failureTitle),description:NM(IM.description),requiredArtifacts:["URL","ServiceWorker","WebAppManifest"]}}static getVersionsForOrigin(e,t){return e.filter((e=>"activated"===e.status)).filter((e=>new DM(e.scriptURL).origin===t.origin))}static getControllingServiceWorker(e,t,r){const a=[];for(const r of e){const e=t.find((e=>e.registrationId===r.registrationId))
|
1065
1065
|
;if(e){const t=new DM(e.scopeURL).href,n=new DM(r.scriptURL).href;a.push({scopeUrl:t,scriptUrl:n})}}return a.filter((e=>r.href.startsWith(e.scopeUrl))).sort(((e,t)=>e.scopeUrl.length-t.scopeUrl.length)).pop()}static checkStartUrl(e,t){if(!e)return NM(IM.explanationNoManifest);if(!e.value)return NM(IM.explanationBadManifest);const r=e.value.start_url.value;return r.startsWith(t)?void 0:NM(IM.explanationBadStartUrl,{startUrl:r,scopeUrl:t})}static audit(e){const t=new DM(e.URL.finalUrl),{versions:r,registrations:a}=e.ServiceWorker,n=ServiceWorker.getVersionsForOrigin(r,t);if(0===n.length)return{score:0};const i=ServiceWorker.getControllingServiceWorker(n,a,t);if(!i)return{score:0,explanation:NM(IM.explanationOutOfScope,{pageUrl:t.href})};const{scriptUrl:o,scopeUrl:s}=i,c={type:"debugdata",scriptUrl:o,scopeUrl:s},l=ServiceWorker.checkStartUrl(e.WebAppManifest,i.scopeUrl);return l?{score:0,details:c,explanation:l}:{score:1,details:c}}}kM.exports=ServiceWorker,kM.exports.UIStrings=IM
|
1066
|
-
;var LM={exports:{}};const MM=kc;var PM=class MultiCheckAudit$2 extends MM{static async audit(e,t){const r=await this.audit_(e,t);return this.createAuditProduct(r)}static createAuditProduct(e){const t={...e,...e.manifestValues,manifestValues:void 0,allChecks:void 0};e.manifestValues?.allChecks&&e.manifestValues.allChecks.forEach((e=>{t[e.id]=e.passing}));const r={type:"debugdata",items:[t]};return e.failures.length>0?{score:0,explanation:`Failures: ${e.failures.join(",\n")}.`,details:r}:{score:1,details:r}}static audit_(e,t){throw new Error("audit_ unimplemented")}};const OM=PM,FM=
|
1067
|
-
return{id:"splash-screen",title:jM(UM.title),failureTitle:jM(UM.failureTitle),description:jM(UM.description),supportedModes:["navigation"],requiredArtifacts:["WebAppManifest","InstallabilityErrors"]}}static assessManifest(e,t){if(e.isParseFailure&&e.parseFailureReason)return void t.push(e.parseFailureReason);const r=["hasName","hasBackgroundColor","hasThemeColor","hasIconsAtLeast512px"];e.allChecks.filter((e=>r.includes(e.id))).forEach((e=>{e.passing||t.push(e.failureText)}))}static async audit_(e,t){const r=[],a=await FM.request(e,t);return SplashScreen.assessManifest(a,r),{failures:r,manifestValues:a}}}LM.exports=SplashScreen,LM.exports.UIStrings=UM;var BM={exports:{}};const $M=PM,qM=
|
1066
|
+
;var LM={exports:{}};const MM=kc;var PM=class MultiCheckAudit$2 extends MM{static async audit(e,t){const r=await this.audit_(e,t);return this.createAuditProduct(r)}static createAuditProduct(e){const t={...e,...e.manifestValues,manifestValues:void 0,allChecks:void 0};e.manifestValues?.allChecks&&e.manifestValues.allChecks.forEach((e=>{t[e.id]=e.passing}));const r={type:"debugdata",items:[t]};return e.failures.length>0?{score:0,explanation:`Failures: ${e.failures.join(",\n")}.`,details:r}:{score:1,details:r}}static audit_(e,t){throw new Error("audit_ unimplemented")}};const OM=PM,FM=DA,UM={title:"Configured for a custom splash screen",failureTitle:"Is not configured for a custom splash screen",description:"A themed splash screen ensures a high-quality experience when users launch your app from their homescreens. [Learn more](https://web.dev/splash-screen/)."},jM=oi.createMessageInstanceIdFn("lighthouse-core/audits/splash-screen.js",UM);class SplashScreen extends OM{static get meta(){
|
1067
|
+
return{id:"splash-screen",title:jM(UM.title),failureTitle:jM(UM.failureTitle),description:jM(UM.description),supportedModes:["navigation"],requiredArtifacts:["WebAppManifest","InstallabilityErrors"]}}static assessManifest(e,t){if(e.isParseFailure&&e.parseFailureReason)return void t.push(e.parseFailureReason);const r=["hasName","hasBackgroundColor","hasThemeColor","hasIconsAtLeast512px"];e.allChecks.filter((e=>r.includes(e.id))).forEach((e=>{e.passing||t.push(e.failureText)}))}static async audit_(e,t){const r=[],a=await FM.request(e,t);return SplashScreen.assessManifest(a,r),{failures:r,manifestValues:a}}}LM.exports=SplashScreen,LM.exports.UIStrings=UM;var BM={exports:{}};const $M=PM,qM=DA,zM=Rs,VM={title:"Sets a theme color for the address bar.",failureTitle:"Does not set a theme color for the address bar.",description:"The browser address bar can be themed to match your site. [Learn more](https://web.dev/themed-omnibox/)."
|
1068
1068
|
},WM=oi.createMessageInstanceIdFn("lighthouse-core/audits/themed-omnibox.js",VM);class ThemedOmnibox extends $M{static get meta(){return{id:"themed-omnibox",title:WM(VM.title),failureTitle:WM(VM.failureTitle),description:WM(VM.description),supportedModes:["navigation"],requiredArtifacts:["WebAppManifest","InstallabilityErrors","MetaElements"]}}static isValidColor(e){return zM.valueType(e)===zM.TYPES.COLOR}static assessMetaThemecolor(e,t){e?ThemedOmnibox.isValidColor(e.content||"")||t.push("The theme-color meta tag did not contain a valid CSS color"):t.push('No `<meta name="theme-color">` tag found')}static assessManifest(e,t){if(e.isParseFailure&&e.parseFailureReason)return void t.push(e.parseFailureReason);const r=e.allChecks.find((e=>"hasThemeColor"===e.id));r&&!r.passing&&t.push(r.failureText)}static async audit_(e,t){const r=[],a=e.MetaElements.find((e=>"theme-color"===e.name)),n=await qM.request(e,t);return ThemedOmnibox.assessManifest(n,r),ThemedOmnibox.assessMetaThemecolor(a,r),
|
1069
|
-
{failures:r,manifestValues:n,themeColor:a?.content||null}}}BM.exports=ThemedOmnibox,BM.exports.UIStrings=VM;var GM={exports:{}},HM={exports:{}};const YM=kc,KM=oi,JM=
|
1069
|
+
{failures:r,manifestValues:n,themeColor:a?.content||null}}}BM.exports=ThemedOmnibox,BM.exports.UIStrings=VM;var GM={exports:{}},HM={exports:{}};const YM=kc,KM=oi,JM=uw,XM=Lo,ZM=Rv,{getJavaScriptURLs:QM,getAttributableURLForTask:eP}=Iv,tP={title:"Minimize third-party usage",failureTitle:"Reduce the impact of third-party code",description:"Third-party code can significantly impact load performance. Limit the number of redundant third-party providers and try to load third-party code after your page has primarily finished loading. [Learn more](https://developers.google.com/web/fundamentals/performance/optimizing-content-efficiency/loading-third-party-javascript/).",columnThirdParty:"Third-Party",displayValue:"Third-party code blocked the main thread for {timeInMs, number, milliseconds} ms"},rP=KM.createMessageInstanceIdFn("lighthouse-core/audits/third-party-summary.js",tP);class ThirdPartySummary$1 extends YM{static get meta(){return{id:"third-party-summary",title:rP(tP.title),
|
1070
1070
|
failureTitle:rP(tP.failureTitle),description:rP(tP.description),requiredArtifacts:["traces","devtoolsLogs","URL"]}}static getSummaries(e,t,r){const a=new Map,n=new Map,i={mainThreadTime:0,blockingTime:0,transferSize:0};for(const t of e){const e=a.get(t.url)||{...i};e.transferSize+=t.transferSize,a.set(t.url,e)}const o=QM(e);for(const e of t){const t=eP(e,o),n=a.get(t)||{...i},s=e.selfTime*r;n.mainThreadTime+=s,n.blockingTime+=Math.max(s-50,0),a.set(t,n)}const s=new Map;for(const[e,t]of a.entries()){const r=JM.getEntity(e);if(!r){a.delete(e);continue}const o=n.get(r)||{...i};o.transferSize+=t.transferSize,o.mainThreadTime+=t.mainThreadTime,o.blockingTime+=t.blockingTime,n.set(r,o);const c=s.get(r)||[];c.push(e),s.set(r,c)}return{byURL:a,byEntity:n,urls:s}}static makeSubItems(e,t,r){let a=(t.urls.get(e)||[]).map((e=>({url:e,...t.byURL.get(e)}))).filter((e=>e.transferSize>0)).sort(((e,t)=>t.blockingTime-e.blockingTime||t.transferSize-e.transferSize));const n={transferSize:0,blockingTime:0
|
1071
1071
|
},i=Math.max(4096,r.transferSize/20),o=Math.min(5,a.length);let s=0;for(;s<o;){const e=a[s];if(0===e.blockingTime&&e.transferSize<i)break;s++,n.transferSize+=e.transferSize,n.blockingTime+=e.blockingTime}if(!n.blockingTime&&!n.transferSize)return[];a=a.slice(0,s);const c={url:rP(KM.UIStrings.otherResourcesLabel),transferSize:r.transferSize-n.transferSize,blockingTime:r.blockingTime-n.blockingTime};return c.transferSize>i&&a.push(c),a}static async audit(e,t){const r=t.settings||{},a=e.traces[YM.DEFAULT_PASS],n=e.devtoolsLogs[YM.DEFAULT_PASS],i=await XM.request(n,t),o=JM.getEntity(e.URL.finalUrl),s=await ZM.request(a,t),c="simulate"===r.throttlingMethod?r.throttling.cpuSlowdownMultiplier:1,l=ThirdPartySummary$1.getSummaries(i,s,c),u={wastedBytes:0,wastedMs:0},d=Array.from(l.byEntity.entries()).filter((([e])=>!(o&&o.name===e.name))).map((([e,t])=>(u.wastedBytes+=t.transferSize,u.wastedMs+=t.blockingTime,{...t,entity:{type:"link",text:e.name,url:e.homepage||""},subItems:{type:"subitems",
|
1072
|
-
items:ThirdPartySummary$1.makeSubItems(e,l,t)}}))).sort(((e,t)=>t.blockingTime-e.blockingTime||t.transferSize-e.transferSize)),m=[{key:"entity",itemType:"link",text:rP(tP.columnThirdParty),subItemsHeading:{key:"url",itemType:"url"}},{key:"transferSize",granularity:1,itemType:"bytes",text:rP(KM.UIStrings.columnTransferSize),subItemsHeading:{key:"transferSize"}},{key:"blockingTime",granularity:1,itemType:"ms",text:rP(KM.UIStrings.columnBlockingTime),subItemsHeading:{key:"blockingTime"}}];return d.length?{score:Number(u.wastedMs<=250),displayValue:rP(tP.displayValue,{timeInMs:u.wastedMs}),details:YM.makeTableDetails(m,d,u)}:{score:1,notApplicable:!0}}}HM.exports=ThirdPartySummary$1,HM.exports.UIStrings=tP;const aP=kc,nP=oi,iP=
|
1072
|
+
items:ThirdPartySummary$1.makeSubItems(e,l,t)}}))).sort(((e,t)=>t.blockingTime-e.blockingTime||t.transferSize-e.transferSize)),m=[{key:"entity",itemType:"link",text:rP(tP.columnThirdParty),subItemsHeading:{key:"url",itemType:"url"}},{key:"transferSize",granularity:1,itemType:"bytes",text:rP(KM.UIStrings.columnTransferSize),subItemsHeading:{key:"transferSize"}},{key:"blockingTime",granularity:1,itemType:"ms",text:rP(KM.UIStrings.columnBlockingTime),subItemsHeading:{key:"blockingTime"}}];return d.length?{score:Number(u.wastedMs<=250),displayValue:rP(tP.displayValue,{timeInMs:u.wastedMs}),details:YM.makeTableDetails(m,d,u)}:{score:1,notApplicable:!0}}}HM.exports=ThirdPartySummary$1,HM.exports.UIStrings=tP;const aP=kc,nP=oi,iP=uw,oP=Lo,sP=HT,cP=Rv,lP=HM.exports,uP={title:"Lazy load third-party resources with facades",failureTitle:"Some third-party resources can be lazy loaded with a facade",
|
1073
1073
|
description:"Some third-party embeds can be lazy loaded. Consider replacing them with a facade until they are required. [Learn more](https://web.dev/third-party-facades/).",displayValue:"{itemCount, plural,\n =1 {# facade alternative available}\n other {# facade alternatives available}\n }",columnProduct:"Product",categoryVideo:"{productName} (Video)",categoryCustomerSuccess:"{productName} (Customer Success)",categoryMarketing:"{productName} (Marketing)",categorySocial:"{productName} (Social)"},dP=nP.createMessageInstanceIdFn("lighthouse-core/audits/third-party-facades.js",uP),mP={video:uP.categoryVideo,"customer-success":uP.categoryCustomerSuccess,marketing:uP.categoryMarketing,social:uP.categorySocial};class ThirdPartyFacades extends aP{static get meta(){return{id:"third-party-facades",title:dP(uP.title),failureTitle:dP(uP.failureTitle),description:dP(uP.description),supportedModes:["navigation"],requiredArtifacts:["traces","devtoolsLogs","URL"]}}static condenseItems(e){
|
1074
1074
|
e.sort(((e,t)=>t.transferSize-e.transferSize));let t=e.findIndex((e=>e.transferSize<1e3))||1;if((-1===t||t>5)&&(t=5),t>=e.length-1)return;const r=e.splice(t).reduce(((e,t)=>(e.transferSize+=t.transferSize,e.blockingTime+=t.blockingTime,e)));r.transferSize<1e3||(r.url=dP(nP.UIStrings.otherResourcesLabel),e.push(r))}static getProductsWithFacade(e,t){const r=new Map;for(const a of e.keys()){const e=iP.getEntity(a);if(!e||iP.isFirstParty(a,t))continue;const n=iP.getProduct(a);n&&n.facades&&n.facades.length&&(r.has(n.name)||r.set(n.name,{product:n,entity:e}))}return Array.from(r.values())}static async audit(e,t){const r=t.settings,a=e.traces[aP.DEFAULT_PASS],n=e.devtoolsLogs[aP.DEFAULT_PASS],i=await oP.request(n,t),o=await sP.request({devtoolsLog:n,URL:e.URL},t),s=iP.getEntity(o.url),c=await cP.request(a,t),l="simulate"===r.throttlingMethod?r.throttling.cpuSlowdownMultiplier:1,u=lP.getSummaries(i,c,l),d=ThirdPartyFacades.getProductsWithFacade(u.byURL,s),m=[]
|
1075
|
-
;for(const{product:e,entity:t}of d){const r=mP[e.categories[0]];let a;a=r?dP(r,{productName:e.name}):e.name;const n=u.urls.get(t),i=u.byEntity.get(t);if(!n||!i)continue;const o=Array.from(n).map((e=>({url:e,...u.byURL.get(e)})));this.condenseItems(o),m.push({product:a,transferSize:i.transferSize,blockingTime:i.blockingTime,subItems:{type:"subitems",items:o}})}if(!m.length)return{score:1,notApplicable:!0};const p=[{key:"product",itemType:"text",subItemsHeading:{key:"url",itemType:"url"},text:dP(uP.columnProduct)},{key:"transferSize",itemType:"bytes",subItemsHeading:{key:"transferSize"},granularity:1,text:dP(nP.UIStrings.columnTransferSize)},{key:"blockingTime",itemType:"ms",subItemsHeading:{key:"blockingTime"},granularity:1,text:dP(nP.UIStrings.columnBlockingTime)}];return{score:0,displayValue:dP(uP.displayValue,{itemCount:m.length}),details:aP.makeTableDetails(p,m)}}}GM.exports=ThirdPartyFacades,GM.exports.UIStrings=uP;var pP={exports:{}};const hP=kc,gP=
|
1075
|
+
;for(const{product:e,entity:t}of d){const r=mP[e.categories[0]];let a;a=r?dP(r,{productName:e.name}):e.name;const n=u.urls.get(t),i=u.byEntity.get(t);if(!n||!i)continue;const o=Array.from(n).map((e=>({url:e,...u.byURL.get(e)})));this.condenseItems(o),m.push({product:a,transferSize:i.transferSize,blockingTime:i.blockingTime,subItems:{type:"subitems",items:o}})}if(!m.length)return{score:1,notApplicable:!0};const p=[{key:"product",itemType:"text",subItemsHeading:{key:"url",itemType:"url"},text:dP(uP.columnProduct)},{key:"transferSize",itemType:"bytes",subItemsHeading:{key:"transferSize"},granularity:1,text:dP(nP.UIStrings.columnTransferSize)},{key:"blockingTime",itemType:"ms",subItemsHeading:{key:"blockingTime"},granularity:1,text:dP(nP.UIStrings.columnBlockingTime)}];return{score:0,displayValue:dP(uP.displayValue,{itemCount:m.length}),details:aP.makeTableDetails(p,m)}}}GM.exports=ThirdPartyFacades,GM.exports.UIStrings=uP;var pP={exports:{}};const hP=kc,gP=CD,fP=HT,yP=Tu,vP=oi,bP={
|
1076
1076
|
title:"Timing budget",description:"Set a timing budget to help you keep an eye on the performance of your site. Performant sites load fast and respond to user input events quickly. [Learn more](https://developers.google.com/web/tools/lighthouse/audits/budgets).",columnTimingMetric:"Metric",columnMeasurement:"Measurement"},wP=vP.createMessageInstanceIdFn("lighthouse-core/audits/timing-budget.js",bP);pP.exports=class TimingBudget extends hP{static get meta(){return{id:"timing-budget",title:wP(bP.title),description:wP(bP.description),scoreDisplayMode:hP.SCORING_MODES.INFORMATIVE,supportedModes:["navigation"],requiredArtifacts:["devtoolsLogs","traces","URL","GatherContext"]}}static getRowLabel(e){const t={"first-contentful-paint":vP.UIStrings.firstContentfulPaintMetric,interactive:vP.UIStrings.interactiveMetric,"first-meaningful-paint":vP.UIStrings.firstMeaningfulPaintMetric,"max-potential-fid":vP.UIStrings.maxPotentialFIDMetric,"total-blocking-time":vP.UIStrings.totalBlockingTimeMetric,
|
1077
1077
|
"speed-index":vP.UIStrings.speedIndexMetric,"largest-contentful-paint":vP.UIStrings.largestContentfulPaintMetric,"cumulative-layout-shift":vP.UIStrings.cumulativeLayoutShiftMetric};return wP(t[e])}static getMeasurement(e,t){return{"first-contentful-paint":t.firstContentfulPaint,interactive:t.interactive,"first-meaningful-paint":t.firstMeaningfulPaint,"max-potential-fid":t.maxPotentialFID,"total-blocking-time":t.totalBlockingTime,"speed-index":t.speedIndex,"largest-contentful-paint":t.largestContentfulPaint,"cumulative-layout-shift":t.cumulativeLayoutShift}[e]}static tableItems(e,t){let r=[];if(!e.timings)return r;r=e.timings.map((e=>{const r=e.metric,a=this.getRowLabel(r),n=this.getMeasurement(r,t);return{metric:r,label:a,measurement:n,overBudget:n&&n>e.budget?n-e.budget:void 0}})).sort(((e,t)=>(t.overBudget||0)-(e.overBudget||0)));const a=r.find((e=>"cumulative-layout-shift"===e.metric));return a&&("number"==typeof a.measurement&&(a.measurement={type:"numeric",
|
1078
1078
|
value:Number(a.measurement),granularity:.01}),"number"==typeof a.overBudget&&(a.overBudget={type:"numeric",value:Number(a.overBudget),granularity:.01})),r}static async audit(e,t){const r=e.GatherContext,a=e.devtoolsLogs[hP.DEFAULT_PASS],n=e.traces[hP.DEFAULT_PASS],i=await fP.request({URL:e.URL,devtoolsLog:a},t),o={trace:n,devtoolsLog:a,gatherContext:r,settings:t.settings},s=(await gP.request(o,t)).metrics,c=yP.getMatchingBudget(t.settings.budgets,i.url);if(!c)return{score:0,notApplicable:!0};const l=[{key:"label",itemType:"text",text:wP(bP.columnTimingMetric)},{key:"measurement",itemType:"ms",text:wP(bP.columnMeasurement)},{key:"overBudget",itemType:"ms",text:wP(vP.UIStrings.columnOverBudget)}];return{details:hP.makeTableDetails(l,this.tableItems(c,s)),score:1}}},pP.exports.UIStrings=bP;var SP={exports:{}};const TP=kc,EP=oi,xP=ji,_P={title:"Image elements have explicit `width` and `height`",failureTitle:"Image elements do not have explicit `width` and `height`",
|
@@ -1080,11 +1080,11 @@ description:"Set an explicit width and height on image elements to reduce layout
|
|
1080
1080
|
;const t=e.attributeWidth,r=e.attributeHeight,a=e.cssEffectiveRules.width,n=e.cssEffectiveRules.height,i=e.cssEffectiveRules.aspectRatio,o=UnsizedImages.doesHtmlAttrProvideExplicitSize(t),s=UnsizedImages.isCssPropExplicitlySet(a),c=UnsizedImages.doesHtmlAttrProvideExplicitSize(r),l=UnsizedImages.isCssPropExplicitlySet(n),u=UnsizedImages.isCssPropExplicitlySet(i),d=o||s,m=c||l;return d&&m||d&&u||m&&u}static isNonNetworkSvg(e){const t="image/svg+xml"===xP.guessMimeType(e.src),r=e.src.slice(0,e.src.indexOf(":")),a=xP.isNonNetworkProtocol(r);return t&&a}static async audit(e){const t=e.ImageElements.filter((e=>!e.isCss&&!e.isInShadowDOM)),r=[];for(const e of t){if("fixed"===e.computedStyles.position||"absolute"===e.computedStyles.position)continue;if(UnsizedImages.isNonNetworkSvg(e))continue;if(UnsizedImages.isSizedImage(e))continue;const t=e.node.boundingRect;0===t.width&&0===t.height||r.push({url:xP.elideDataURI(e.src),node:TP.makeNodeItem(e.node)})}const a=[{key:"node",itemType:"node",
|
1081
1081
|
text:""},{key:"url",itemType:"url",text:AP(EP.UIStrings.columnURL)}];return{score:r.length>0?0:1,notApplicable:0===t.length,details:TP.makeTableDetails(a,r)}}}SP.exports=UnsizedImages,SP.exports.UIStrings=_P;var RP={exports:{}};const kP=Ao,DP=Yp;var CP=kP(class UserTimings$1{static async compute_(e,t){const r=await DP.request(e,t),a=[],n={};return r.processEvents.filter((e=>!!e.cat.includes("blink.user_timing")&&("requestStart"!==e.name&&"navigationStart"!==e.name&&"paintNonDefaultBackgroundColor"!==e.name&&void 0===e.args.frame))).forEach((e=>{"R"===e.ph||"I"===e.ph.toUpperCase()?a.push({name:e.name,isMark:!0,args:e.args,startTime:e.ts}):"b"===e.ph.toLowerCase()?n[e.name]=e.ts:"e"===e.ph.toLowerCase()&&a.push({name:e.name,isMark:!1,args:e.args,startTime:n[e.name],endTime:e.ts,duration:e.ts-n[e.name]})})),a.forEach((e=>{e.startTime=(e.startTime-r.timeOriginEvt.ts)/1e3,e.isMark||(e.endTime=(e.endTime-r.timeOriginEvt.ts)/1e3,e.duration=e.duration/1e3)})),a}},null)
|
1082
1082
|
;const IP=kc,NP=oi,LP=CP,MP={title:"User Timing marks and measures",description:"Consider instrumenting your app with the User Timing API to measure your app's real-world performance during key user experiences. [Learn more](https://web.dev/user-timings/).",displayValue:"{itemCount, plural,\n =1 {1 user timing}\n other {# user timings}\n }",columnType:"Type"},PP=NP.createMessageInstanceIdFn("lighthouse-core/audits/user-timings.js",MP);class UserTimings extends IP{static get meta(){return{id:"user-timings",title:PP(MP.title),description:PP(MP.description),scoreDisplayMode:IP.SCORING_MODES.INFORMATIVE,requiredArtifacts:["traces"]}}static get excludedPrefixes(){return["goog_"]}static excludeEvent(e){return UserTimings.excludedPrefixes.every((t=>!e.name.startsWith(t)))}static audit(e,t){const r=e.traces[IP.DEFAULT_PASS];return LP.request(r,t).then((e=>{const t=e.filter(UserTimings.excludeEvent),r=t.map((e=>({name:e.name,startTime:e.startTime,duration:e.isMark?void 0:e.duration,
|
1083
|
-
timingType:e.isMark?"Mark":"Measure"}))).sort(((e,t)=>e.timingType===t.timingType?e.startTime-t.startTime:"Measure"===e.timingType?-1:1)),a=[{key:"name",itemType:"text",text:PP(NP.UIStrings.columnName)},{key:"timingType",itemType:"text",text:PP(MP.columnType)},{key:"startTime",itemType:"ms",granularity:.01,text:PP(NP.UIStrings.columnStartTime)},{key:"duration",itemType:"ms",granularity:.01,text:PP(NP.UIStrings.columnDuration)}],n=IP.makeTableDetails(a,r);let i;return t.length&&(i=PP(MP.displayValue,{itemCount:t.length})),{score:Number(0===t.length),notApplicable:0===t.length,displayValue:i,details:n}}))}}RP.exports=UserTimings,RP.exports.UIStrings=MP;var OP={exports:{}};const FP=kc,UP=
|
1083
|
+
timingType:e.isMark?"Mark":"Measure"}))).sort(((e,t)=>e.timingType===t.timingType?e.startTime-t.startTime:"Measure"===e.timingType?-1:1)),a=[{key:"name",itemType:"text",text:PP(NP.UIStrings.columnName)},{key:"timingType",itemType:"text",text:PP(MP.columnType)},{key:"startTime",itemType:"ms",granularity:.01,text:PP(NP.UIStrings.columnStartTime)},{key:"duration",itemType:"ms",granularity:.01,text:PP(NP.UIStrings.columnDuration)}],n=IP.makeTableDetails(a,r);let i;return t.length&&(i=PP(MP.displayValue,{itemCount:t.length})),{score:Number(0===t.length),notApplicable:0===t.length,displayValue:i,details:n}}))}}RP.exports=UserTimings,RP.exports.UIStrings=MP;var OP={exports:{}};const FP=kc,UP=Ib,jP=ji,BP=oi,$P=Lo,qP=HT,zP=Dl,VP=Yp,WP=Xp,GP=eb,HP=vk,YP={title:"Preconnect to required origins",description:"Consider adding `preconnect` or `dns-prefetch` resource hints to establish early connections to important third-party origins. [Learn more](https://web.dev/uses-rel-preconnect/).",
|
1084
1084
|
unusedWarning:'A `<link rel=preconnect>` was found for "{securityOrigin}" but was not used by the browser. Only use `preconnect` for important origins that the page will certainly request.',crossoriginWarning:'A `<link rel=preconnect>` was found for "{securityOrigin}" but was not used by the browser. Check that you are using the `crossorigin` attribute properly.',tooManyPreconnectLinksWarning:"More than 2 `<link rel=preconnect>` connections were found. These should be used sparingly and only to the most important origins."},KP=BP.createMessageInstanceIdFn("lighthouse-core/audits/uses-rel-preconnect.js",YP);class UsesRelPreconnectAudit extends FP{static get meta(){return{id:"uses-rel-preconnect",title:KP(YP.title),description:KP(YP.description),supportedModes:["navigation"],requiredArtifacts:["traces","devtoolsLogs","URL","LinkElements"],scoreDisplayMode:FP.SCORING_MODES.NUMERIC}}static hasValidTiming(e){return!!e.timing&&e.timing.connectEnd>0&&e.timing.connectStart>0}
|
1085
1085
|
static hasAlreadyConnectedToOrigin(e){return!!e.timing&&e.timing.dnsEnd-e.timing.dnsStart==0&&e.timing.connectEnd-e.timing.connectStart==0}static socketStartTimeIsBelowThreshold(e,t){return Math.max(0,e.startTime-t.endTime)<15}static async audit(e,t){const r=e.traces[UsesRelPreconnectAudit.DEFAULT_PASS],a=e.devtoolsLogs[UsesRelPreconnectAudit.DEFAULT_PASS],n=t.settings;let i=0;const o=[],s=await VP.request(r,t),[c,l,u,d,m]=await Promise.all([$P.request(a,t),qP.request({devtoolsLog:a,URL:e.URL},t),zP.request({devtoolsLog:a,settings:n},t),WP.request(s,t),GP.request({trace:r,devtoolsLog:a},t)]),{rtt:p,additionalRttByOrigin:h}=u.getOptions(),f=await HP.getPessimisticGraph(m,d),y=new Set;f.traverse((e=>{"network"===e.type&&y.add(e.record.url)}));const v=new Map;c.forEach((e=>{
|
1086
1086
|
if(!UsesRelPreconnectAudit.hasValidTiming(e)||e.initiator.url===l.url||!e.parsedURL||!e.parsedURL.securityOrigin||l.parsedURL.securityOrigin===e.parsedURL.securityOrigin||!y.has(e.url)||UsesRelPreconnectAudit.hasAlreadyConnectedToOrigin(e)||!UsesRelPreconnectAudit.socketStartTimeIsBelowThreshold(e,l))return;const t=e.parsedURL.securityOrigin,r=v.get(t)||[];r.push(e),v.set(t,r)}));const b=e.LinkElements.filter((e=>"preconnect"===e.rel)),w=new Set(b.map((e=>jP.getOrigin(e.href||""))));let S=[];v.forEach((e=>{const t=e.reduce(((e,t)=>t.startTime<e.startTime?t:e));if(!t.timing)return;const r=t.parsedURL.securityOrigin,a=h.get(r)||0;let n=p+a;"https"===t.parsedURL.scheme&&(n*=2);const s=1e3*t.startTime-1e3*l.endTime+t.timing.dnsStart,c=Math.min(n,s);c<50||(w.has(r)?o.push(KP(YP.crossoriginWarning,{securityOrigin:r})):(i=Math.max(c,i),S.push({url:r,wastedMs:c})))})),S=S.sort(((e,t)=>t.wastedMs-e.wastedMs))
|
1087
|
-
;for(const e of w)e&&(c.some((t=>e===t.parsedURL.securityOrigin))||o.push(KP(YP.unusedWarning,{securityOrigin:e})));if(b.length>=2)return{score:1,warnings:b.length>=3?[...o,KP(YP.tooManyPreconnectLinksWarning)]:o};const T=[{key:"url",valueType:"url",label:KP(BP.UIStrings.columnURL)},{key:"wastedMs",valueType:"timespanMs",label:KP(BP.UIStrings.columnWastedMs)}],E=FP.makeOpportunityDetails(T,S,i);return{score:UP.scoreForWastedMs(i),numericValue:i,numericUnit:"millisecond",displayValue:i?KP(BP.UIStrings.displayValueMsSavings,{wastedMs:i}):"",warnings:o,details:E}}}OP.exports=UsesRelPreconnectAudit,OP.exports.UIStrings=YP;var JP={exports:{}};const XP=ji,ZP=Ki,QP=kc,eO=
|
1087
|
+
;for(const e of w)e&&(c.some((t=>e===t.parsedURL.securityOrigin))||o.push(KP(YP.unusedWarning,{securityOrigin:e})));if(b.length>=2)return{score:1,warnings:b.length>=3?[...o,KP(YP.tooManyPreconnectLinksWarning)]:o};const T=[{key:"url",valueType:"url",label:KP(BP.UIStrings.columnURL)},{key:"wastedMs",valueType:"timespanMs",label:KP(BP.UIStrings.columnWastedMs)}],E=FP.makeOpportunityDetails(T,S,i);return{score:UP.scoreForWastedMs(i),numericValue:i,numericUnit:"millisecond",displayValue:i?KP(BP.UIStrings.displayValueMsSavings,{wastedMs:i}):"",warnings:o,details:E}}}OP.exports=UsesRelPreconnectAudit,OP.exports.UIStrings=YP;var JP={exports:{}};const XP=ji,ZP=Ki,QP=kc,eO=Ib,tO=ZT,rO=oi,aO=HT,nO=eb,iO=Dl,oO={title:"Preload key requests",description:"Consider using `<link rel=preload>` to prioritize fetching resources that are currently requested later in page load. [Learn more](https://web.dev/uses-rel-preload/).",
|
1088
1088
|
crossoriginWarning:'A preload `<link>` was found for "{preloadURL}" but was not used by the browser. Check that you are using the `crossorigin` attribute properly.'},sO=rO.createMessageInstanceIdFn("lighthouse-core/audits/uses-rel-preload.js",oO);class UsesRelPreloadAudit extends QP{static get meta(){return{id:"uses-rel-preload",title:sO(oO.title),description:sO(oO.description),supportedModes:["navigation"],requiredArtifacts:["devtoolsLogs","traces","URL"],scoreDisplayMode:QP.SCORING_MODES.NUMERIC}}static getURLsToPreload(e,t){const r=new Set;return t.traverse(((t,a)=>{if("network"!==t.type)return;const n=a.slice(1).filter((e=>"network"===e.type));UsesRelPreloadAudit.shouldPreloadRequest(t.record,e,n)&&r.add(t.record.url)})),r}static getURLsFailedToPreload(e){const t=[];e.traverse((e=>"network"===e.type&&t.push(e.record)));const r=t.filter((e=>e.isLinkPreload)),a=new Map;for(const e of r){const t=a.get(e.frameId)||new Set;t.add(e.url),a.set(e.frameId,t)}const n=t.filter((e=>{
|
1089
1089
|
const t=a.get(e.frameId);if(!t)return!1;if(!t.has(e.url))return!1;return!(e.fromDiskCache||e.fromMemoryCache||e.fromPrefetchCache)&&!e.isLinkPreload}));return new Set(n.map((e=>e.url)))}static shouldPreloadRequest(e,t,r){const a=t.redirects?t.redirects.length:0;return!e.isLinkPreload&&(!!tO.isCritical(e,t)&&(!ZP.isNonNetworkRequest(e)&&(r.length===a+2&&(e.frameId===t.frameId&&XP.rootDomainsMatch(e.url,t.url)))))}static computeWasteWithGraph(e,t,r){if(!e.size)return{wastedMs:0,results:[]};const a=r.simulate(t,{flexibleOrdering:!0}),n=t.cloneWithRelationships(),i=[];let o=null;if(n.traverse((t=>{"network"===t.type&&(t.isMainDocument()?o=t:t.record&&e.has(t.record.url)&&i.push(t))})),!o)throw new Error("Could not find main document node");for(const e of i)e.removeAllDependencies(),e.addDependency(o);const s=r.simulate(n,{flexibleOrdering:!0}),c=Array.from(a.nodeTimings.keys()).reduce(((e,t)=>e.set(t.record,t)),new Map),l=[];for(const e of i){
|
1090
1090
|
const t=c.get(e.record),r=s.nodeTimings.get(e),n=a.nodeTimings.get(t);if(!n||!r)throw new Error("Missing preload node");const i=Math.round(n.endTime-r.endTime);i<100||l.push({url:e.record.url,wastedMs:i})}return l.length?{wastedMs:Math.max(...l.map((e=>e.wastedMs))),results:l}:{wastedMs:0,results:l}}static async audit_(e,t){const r=e.traces[UsesRelPreloadAudit.DEFAULT_PASS],a=e.devtoolsLogs[UsesRelPreloadAudit.DEFAULT_PASS],n=e.URL,i={devtoolsLog:a,settings:t.settings},[o,s,c]=await Promise.all([aO.request({devtoolsLog:a,URL:n},t),nO.request({trace:r,devtoolsLog:a},t),iO.request(i,t)]),l=UsesRelPreloadAudit.getURLsToPreload(o,s),{results:u,wastedMs:d}=UsesRelPreloadAudit.computeWasteWithGraph(l,s,c);let m;u.sort(((e,t)=>t.wastedMs-e.wastedMs));const p=UsesRelPreloadAudit.getURLsFailedToPreload(s);p.size&&(m=Array.from(p).map((e=>sO(oO.crossoriginWarning,{preloadURL:e}))));const h=[{key:"url",valueType:"url",label:sO(rO.UIStrings.columnURL)},{key:"wastedMs",valueType:"timespanMs",
|
@@ -1093,139 +1093,139 @@ label:sO(rO.UIStrings.columnWastedMs)}],f=QP.makeOpportunityDetails(h,u,d);retur
|
|
1093
1093
|
* @license Copyright 2020 Google Inc. All Rights Reserved.
|
1094
1094
|
* 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
|
1095
1095
|
* 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.
|
1096
|
-
*/const lO=
|
1096
|
+
*/const lO=uw,uO=kc,dO=oi,mO={title:"Page has valid source maps",failureTitle:"Missing source maps for large first-party JavaScript",description:"Source maps translate minified code to the original source code. This helps developers debug in production. In addition, Lighthouse is able to provide further insights. Consider deploying source maps to take advantage of these benefits. [Learn more](https://developers.google.com/web/tools/chrome-devtools/javascript/source-maps).",columnMapURL:"Map URL",missingSourceMapErrorMessage:"Large JavaScript file is missing a source map",missingSourceMapItemsWarningMesssage:"{missingItems, plural,\n =1 {Warning: missing 1 item in `.sourcesContent`}\n other {Warning: missing # items in `.sourcesContent`}\n }"},pO=dO.createMessageInstanceIdFn("lighthouse-core/audits/valid-source-maps.js",mO);cO.exports=class ValidSourceMaps extends uO{static get meta(){return{id:"valid-source-maps",title:pO(mO.title),failureTitle:pO(mO.failureTitle),
|
1097
1097
|
description:pO(mO.description),requiredArtifacts:["ScriptElements","SourceMaps","URL"]}}static isLargeFirstPartyJS(e,t){if(null===e.content)return!1;const r=e.content.length>=512e3,a=!!e.src&&lO.isFirstParty(e.src,lO.getEntity(t));return r&&a}static async audit(e){const{SourceMaps:t}=e,r=new Set;let a=!1;const n=[];for(const i of e.ScriptElements){if(!i.src)continue;const o=t.find((e=>e.scriptUrl===i.src)),s=[];if(!this.isLargeFirstPartyJS(i,e.URL.finalUrl)||o&&o.map||(a=!0,r.add(i.src),s.push({error:pO(mO.missingSourceMapErrorMessage)})),o&&!o.map&&s.push({error:o.errorMessage}),o?.map){const e=o.map.sourcesContent||[];let t=0;for(let r=0;r<o.map.sources.length;r++)(e.length<r||!e[r])&&(t+=1);t>0&&s.push({error:pO(mO.missingSourceMapItemsWarningMesssage,{missingItems:t})})}(o||s.length)&&n.push({scriptUrl:i.src,sourceMapUrl:o?.sourceMapUrl,subItems:{type:"subitems",items:s}})}const i=[{key:"scriptUrl",itemType:"url",subItemsHeading:{key:"error"},text:pO(dO.UIStrings.columnURL)},{
|
1098
1098
|
key:"sourceMapUrl",itemType:"url",text:pO(mO.columnMapURL)}];return n.sort(((e,t)=>{const a=r.has(e.scriptUrl),n=r.has(t.scriptUrl);return a&&!n?-1:!a&&n?1:e.subItems.items.length&&!t.subItems.items.length?-1:!e.subItems.items.length&&t.subItems.items.length?1:t.scriptUrl.localeCompare(e.scriptUrl)})),{score:a?0:1,details:uO.makeTableDetails(i,n)}}},cO.exports.UIStrings=mO;var hO={exports:{}};const gO=kc,fO=YN,yO={title:'Has a `<meta name="viewport">` tag with `width` or `initial-scale`',failureTitle:'Does not have a `<meta name="viewport">` tag with `width` or `initial-scale`',description:'A `<meta name="viewport">` not only optimizes your app for mobile screen sizes, but also prevents [a 300 millisecond delay to user input](https://developers.google.com/web/updates/2013/12/300ms-tap-delay-gone-away). [Learn more](https://web.dev/viewport/).',explanationNoTag:'No `<meta name="viewport">` tag found'},vO=oi.createMessageInstanceIdFn("lighthouse-core/audits/viewport.js",yO)
|
1099
|
-
;hO.exports=class Viewport extends gO{static get meta(){return{id:"viewport",title:vO(yO.title),failureTitle:vO(yO.failureTitle),description:vO(yO.description),requiredArtifacts:["MetaElements"]}}static async audit(e,t){const r=await fO.request(e.MetaElements,t);return r.hasViewportTag?{score:Number(r.isMobileOptimized),warnings:r.parserWarnings}:{score:0,explanation:vO(yO.explanationNoTag)}}},hO.exports.UIStrings=yO;var bO={exports:{}};const wO=kc,SO
|
1100
|
-
},
|
1101
|
-
inputDelay:{startTs:r,endTs:n},processingDelay:{startTs:n,endTs:i},presentationDelay:{startTs:i,endTs:r+1e3*t.duration}}}static
|
1102
|
-
key:"total",granularity:1,itemType:"ms"},granularity:1,text:"Total time"},{key:null,itemType:"ms",subItemsHeading:{key:"scripting",granularity:1,itemType:"ms"},text:"Script evaluation"},{key:null,itemType:"ms",subItemsHeading:{key:"layout",granularity:1,itemType:"ms"},text:AO.styleLayout.label},{key:null,itemType:"ms",subItemsHeading:{key:"render",granularity:1,itemType:"ms"},text:AO.paintCompositeRender.label}];return{table:wO.makeTableDetails(u,l),phases:c}}static
|
1103
|
-
;return{score:d<DO.p10?1:0,displayValue:
|
1104
|
-
|
1105
|
-
|
1106
|
-
|
1107
|
-
path:`${a}/audits/
|
1108
|
-
|
1109
|
-
id:"
|
1110
|
-
|
1111
|
-
|
1112
|
-
patterns:["^https?://
|
1113
|
-
patterns:["^https?://
|
1114
|
-
patterns:["^https?://
|
1115
|
-
patterns:["^https?://
|
1116
|
-
patterns:["^https?://
|
1117
|
-
|
1118
|
-
this.noTransform=
|
1119
|
-
|
1120
|
-
|
1121
|
-
return
|
1122
|
-
|
1123
|
-
|
1124
|
-
|
1125
|
-
return
|
1126
|
-
|
1127
|
-
const
|
1128
|
-
const
|
1129
|
-
;
|
1130
|
-
const a=await VF.request(e,r),n=await
|
1131
|
-
description:"Tasks blocking the main thread can delay ad requests and cause a poor user experience. Consider removing long blocking tasks or moving them off of the main thread. These tasks can be especially detrimental to performance on less powerful devices. [Learn more](https://developers.google.com/publisher-ads-audits/reference/audits/ad-blocking-tasks).",failureDisplayValue:"{timeInMs, number, seconds} s blocked",
|
1132
|
-
requiredArtifacts:["traces","devtoolsLogs"]}}static async audit(e,t){const r="simulate"==t.settings.throttlingMethod?200:100,a={trace:e.traces[
|
1133
|
-
displayValue:l?iU
|
1134
|
-
},{key:"startTime",itemType:"ms",text:fU
|
1135
|
-
;c.sort(((e,t)=>e.endTime-t.endTime));const l=o.get(i)||{startTime:1/0},u=c.map((e=>e.startTime)),d=c.map((e=>e.endTime)),m=Math.min(...u),p=Math.min(Math.max(...d),l.startTime)-m;let h="";c.length>0&&p>0&&(h=fU
|
1136
|
-
const n=r.allRecords.filter((e=>null!=e.resourceType)).filter((e=>["Script","XHR"].includes(e.resourceType||"")&&e.endTime<t.startTime)).filter((t=>t.initiatorRequest==e||
|
1137
|
-
requestsByUrl:r,xhrEdges:n,allRecords:e}}var
|
1138
|
-
computeAdRequestWaterfall:async function computeAdRequestWaterfall$4(e,t,r){const a=await
|
1139
|
-
|
1140
|
-
description:"Consider reducing the number of resources, loading multiple resources simultaneously, or loading resources earlier to improve ad speed. Requests that block ad loading can be found below. [Learn more](https://developers.google.com/publisher-ads-audits/reference/audits/ad-request-critical-path).",displayValue:"{serialResources, plural, =1 {1 serial resource} other {# serial resources}}",columnUrl:"Request",columnType:"Type",columnStartTime:"Start",columnEndTime:"End"
|
1141
|
-
|
1142
|
-
|
1143
|
-
failureTitle:"Reduce time to send the first bid request",description:"This metric measures the elapsed time from the start of page load until the first bid request is made. Delayed bid requests will decrease impressions and viewability, and have a negative impact on ad revenue. [Learn More](https://developers.google.com/publisher-ads-audits/reference/audits/bid-request-from-page-start).",displayValue:"{timeInMs, number, seconds} s"
|
1144
|
-
trace:e.traces[
|
1145
|
-
},cj=
|
1146
|
-
;const uj=oi,{auditNotApplicable:
|
1147
|
-
requiredArtifacts:["ViewportDimensions","IFrameElements"]}}static audit(e){const t=e.ViewportDimensions,r=e.IFrameElements.filter(
|
1148
|
-
;const{innerWidth:r,innerHeight:a}=t,{left:n,top:i,right:o,bottom:s}=e;return(Math.min(o,r)-Math.max(n,0))*(Math.min(s,a)-Math.max(i,0))},isBoxInViewport:isBoxInViewport$1,overlaps:function overlaps$1(e,t){
|
1149
|
-
description:"Too many ads loaded outside the viewport lowers viewability rates and impacts user experience. Consider loading ads below the fold lazily as the user scrolls down. Consider using GPT's [Lazy Loading API](https://developers.google.com/doubleclick-gpt/reference#googletag.PubAdsService_enableLazyLoad). [Learn more](https://developers.google.com/publisher-ads-audits/reference/audits/ads-in-viewport).",failureDisplayValue:"{hiddenAds, plural, =1 {1 ad} other {# ads}} out of view",columnSlot:"Slots Outside Viewport"
|
1150
|
-
const t=e.ViewportDimensions,r=e.IFrameElements.filter((e=>
|
1151
|
-
title:"Ad tag is loaded asynchronously",failureTitle:"Load ad tag asynchronously",description:"Loading the ad tag synchronously blocks content rendering until the tag is fetched and loaded. Consider using the `async` attribute to load gpt.js and/or adsbygoogle.js asynchronously. [Learn more](https://developers.google.com/publisher-ads-audits/reference/audits/async-ad-tags)."},
|
1152
|
-
;const o=
|
1153
|
-
columnBlockedUrl:"Blocked URL",columnFunctionName:"Function"},
|
1154
|
-
end:1/0,eventName:e}:n.name==`${e}EventEnd`&&(r.end=n.ts,a.push(r));return a}function quantifyBlockedTime(e,t,r){const a=t.find((t=>t.url==e.url)),n=t.find((t=>t.url==e.blockedUrl));if(!a||!n)return 0;const i=r.get(a),o=r.get(n);return i&&o?o.startTime-i.endTime:0}class BlockingLoadEvents extends
|
1155
|
-
;const a=findTraceEventOfCallFrame(t,o);if(!a)continue;const c=l.find((e=>e.start<=a.ts&&a.ts<=e.end));if(c){const r=Object.assign({eventName:c.eventName,blockedUrl:e.url,time:i[c.eventName],blockedTime:1/0},t);r.blockedTime=quantifyBlockedTime(r,n,s),u.push(r)}}const m=u.length>0;let p=0;return m&&(p=Math.min(...u.map((e=>e.blockedTime)))),{numericValue:u.length,numericUnit:"unitless",score:m?0:1,displayValue:m&&p?eB
|
1156
|
-
description:"Speed up, load earlier, parallelize, or eliminate the following requests and their dependencies in order to speed up ad loading. [Learn More](https://developers.google.com/publisher-ads-audits/reference/audits/bottleneck-requests).",displayValue:"{blockedTime, number, seconds} s spent blocked on requests",columnUrl:"Blocking Request",columnInitiatorUrl:"Initiator Request",columnStartTime:"Start",columnSelfTime:"Exclusive Time",columnDuration:"Total Time"},
|
1157
|
-
static async audit(e,t){const r=e.traces[
|
1158
|
-
description:"Loading a tag more than once in the same page is redundant and adds overhead without benefit. [Learn more](https://developers.google.com/publisher-ads-audits/reference/audits/duplicate-tags).",failureDisplayValue:"{duplicateTags, plural, =1 {1 duplicate tag} other {# duplicate tags}}",columnScript:"Script",columnNumReqs:"Duplicate Requests",columnFrameId:"Frame ID"},
|
1159
|
-
|
1160
|
-
timeInMs:
|
1161
|
-
;
|
1162
|
-
title:"Ad slots effectively use horizontal space",failureTitle:"Increase the width of ad slots",description:"Ad slots that utilize most of the page width generally experience increased click-through rate over smaller ad sizes. We recommend leaving no more than 25% of the viewport width unutilized on mobile devices.",failureDisplayValue:"{percentUnused, number, percent} of viewport width is underutilized"},
|
1163
|
-
;const o=i.map((e=>e.searchParams.get("prev_iu_szs")||e.searchParams.get("sz"))).join("|").split(/[|,]/).map((e=>parseInt(e.split("x")[0]))).filter((e=>e<=n&&e>1));if(!o.length)return
|
1164
|
-
columnBidder:"Bidder",columnUrl:"URL",columnStartTime:"Start",columnDuration:"Duration"},
|
1165
|
-
;return{numericValue:c.length,numericUnit:"unitless",score:u?0:1,details:u?GptBidsInParallel.makeTableDetails(
|
1166
|
-
requiredArtifacts:["devtoolsLogs"]}}static async audit(e,t){const r=e.devtoolsLogs[
|
1167
|
-
description:'For privacy and security, always load GPT/AdSense over HTTPS. Insecure pages should explicitly request the ad script securely. GPT Example: `<script async src="https://securepubads.g.doubleclick.net/tag/js/gpt.js">` AdSense Example: `<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js">`. [Learn more](https://developers.google.com/publisher-ads-audits/reference/audits/loads-ad-tag-over-https).'},
|
1168
|
-
type:"debugdata",numAdTagHttpReqs:n.length-i.length,numAdTagHttpsReqs:i.length};if(!n.length){const e=
|
1169
|
-
},
|
1170
|
-
const r=await async function findStaticallyLoadableTags(e,t){const r=e.devtoolsLogs[
|
1171
|
-
;const
|
1172
|
-
return
|
1173
|
-
;e&&a.push(Object.assign({},e,{url:n.url,type:t}))}return a}(s.get(
|
1174
|
-
static async computeObservedMetric(e,t){const{networkRecords:r}=e,a=
|
1175
|
-
scoreDisplayMode:
|
1176
|
-
description:"The ads to page-height ratio can impact user experience and ultimately user retention. [Learn more](https://developers.google.com/publisher-ads-audits/reference/audits/viewport-ad-density).",displayValue:"{adDensity, number, percent} ads to page-height ratio"},
|
1177
|
-
const r=new Set([...e.map((e=>e.clientRect.left)),...e.map((e=>e.clientRect.right))].map((e=>Math.min(Math.max(1,e),t.innerWidth-1))));e=e.sort(((e,t)=>e.clientRect.top!==t.clientRect.top?e.clientRect.top-t.clientRect.top:e.clientRect.bottom-t.clientRect.bottom));let a=0;for(const t of r){let r=0,n=0;for(const a of e){if(t<a.clientRect.left||t>a.clientRect.right)continue;if(a.isPositionFixed){r+=a.clientRect.height;continue}const e=a.clientRect.bottom-Math.max(n,a.clientRect.top);e>0&&(r+=e),n=Math.max(n,a.clientRect.bottom)}a=Math.max(a,r)}return a}(r,t),n=Math.max(...r.map((e=>e.clientRect.top+e.clientRect.height/2)))+t.innerHeight,i=Math.min(1,a/n);return{score:i>.3?0:1,numericValue:i,numericUnit:"unitless",displayValue:xq
|
1178
|
-
title:"Cumulative ad shift",failureTitle:"Reduce ad-related layout shift",description:"Measures layout shifts that were caused by ads or happened near ads. Reducing cumulative ad-related layout shift will improve user experience. [Learn more](https://developers.google.com/publisher-ads-audits/reference/audits/cumulative-ad-shift)."},
|
1179
|
-
const t=r.clientRect;if((e.top>=t.top||a.top>=t.bottom)&&
|
1180
|
-
const r=e.traces[
|
1181
|
-
displayValue:"{numErrors, plural, =1 {1 error} other {# errors}} found"},
|
1182
|
-
key:"description",itemType:"code",text:
|
1183
|
-
requiredArtifacts:["ConsoleMessages","devtoolsLogs"]}}static async audit(e,t){const r=e.devtoolsLogs[
|
1184
|
-
title:"Total ad JS blocking time",failureTitle:"Reduce ad JS blocking time",description:"Ad-related scripts are blocking the main thread. [Learn more](https://developers.google.com/publisher-ads-audits/reference/audits/total-ad-blocking-time).",failureDisplayValue:"{timeInMs, number, seconds} s blocked",columnName:"Name",columnBlockingTime:"Blocking Time"},
|
1185
|
-
const r=e.traces[
|
1186
|
-
if(globalThis.isDevtools||globalThis.isLightrider)return!0;try{return require.resolve("lighthouse-logger"),!1}catch(e){return!0}}const mergeOptionsOfItems=function(e){const t=[];for(const r of e){const e=r.path&&t.find((e=>e.path===r.path));e?e.options=Object.assign({},e.options,r.options):t.push(r)}return t};const
|
1187
|
-
;const
|
1099
|
+
;hO.exports=class Viewport extends gO{static get meta(){return{id:"viewport",title:vO(yO.title),failureTitle:vO(yO.failureTitle),description:vO(yO.description),requiredArtifacts:["MetaElements"]}}static async audit(e,t){const r=await fO.request(e.MetaElements,t);return r.hasViewportTag?{score:Number(r.isMobileOptimized),warnings:r.parserWarnings}:{score:0,explanation:vO(yO.explanationNoTag)}}},hO.exports.UIStrings=yO;var bO={exports:{}};const wO=kc,SO=ah,TO=Yp,EO=oi,xO=Lo,_O=Ev,{taskGroups:AO}=wv,RO=ao,{getExecutionTimingsByURL:kO}=Iv,DO=$D.exports.defaultOptions,CO=vi.exports,IO={title:"Minimizes work during key interaction",failureTitle:"Minimize work during key interaction",description:"This is the thread-blocking work occurring during the Interaction to Next Paint measurement. [Learn more](https://web.dev/inp/).",inputDelay:"Input delay",processingDelay:"Processing delay",presentationDelay:"Presentation delay",
|
1100
|
+
displayValue:"{timeInMs, number, milliseconds} ms spent on event '{interactionType}'",eventTarget:"Event target"},NO=EO.createMessageInstanceIdFn("lighthouse-core/audits/work-during-interaction.js",IO);class WorkDuringInteraction extends wO{static get meta(){return{id:"work-during-interaction",title:NO(IO.title),failureTitle:NO(IO.failureTitle),description:NO(IO.description),scoreDisplayMode:wO.SCORING_MODES.NUMERIC,supportedModes:["timespan"],requiredArtifacts:["traces","devtoolsLogs","TraceElements"]}}static recursivelyClipTasks(e,t,r,a){const n=e.event.ts,i=e.endEvent?.ts??e.event.ts+Number(e.event.dur||0);e.startTime=Math.max(r,Math.min(a,n))/1e3,e.endTime=Math.max(r,Math.min(a,i))/1e3,e.duration=e.endTime-e.startTime;const o=e.children.map((t=>WorkDuringInteraction.recursivelyClipTasks(t,e,r,a))).reduce(((e,t)=>e+t),0);return e.selfTime=e.duration-o,e.duration}static clipTasksByTs(e,t,r){for(const a of e)a.parent||WorkDuringInteraction.recursivelyClipTasks(a,void 0,t,r)}
|
1101
|
+
static getPhaseTimes(e){const t=e.args.data,r=e.ts,a=r-1e3*t.timeStamp,n=a+1e3*t.processingStart,i=a+1e3*t.processingEnd;return{inputDelay:{startTs:r,endTs:n},processingDelay:{startTs:n,endTs:i},presentationDelay:{startTs:i,endTs:r+1e3*t.duration}}}static getThreadBreakdownTable(e,t,r,a){const n=RO.filteredTraceSort(t.traceEvents,(t=>t.pid===e.pid&&t.tid===e.tid)),i=n.reduce(((e,t)=>Math.max(t.ts+(t.dur||0),e)),0),{frames:o}=r,s=_O.getMainThreadTasks(n,o,i),c=WorkDuringInteraction.getPhaseTimes(e),l=[];for(const[e,t]of Object.entries(c)){WorkDuringInteraction.clipTasksByTs(s,t.startTs,t.endTs);const r=kO(s,a),n=[];for(const[e,t]of r){const r=Object.values(t).reduce(((e,t)=>e+t)),a=t[AO.scriptEvaluation.id]||0,i=t[AO.styleLayout.id]||0,o=t[AO.paintCompositeRender.id]||0;n.push({url:e,total:r,scripting:a,layout:i,render:o})}const i=n.filter((e=>e.total>1)).sort(((e,t)=>t.total-e.total));l.push({phase:NO(IO[e]),total:(t.endTs-t.startTs)/1e3,subItems:{type:"subitems",items:i}})}const u=[{
|
1102
|
+
key:"phase",itemType:"text",subItemsHeading:{key:"url",itemType:"url"},text:"Phase"},{key:"total",itemType:"ms",subItemsHeading:{key:"total",granularity:1,itemType:"ms"},granularity:1,text:"Total time"},{key:null,itemType:"ms",subItemsHeading:{key:"scripting",granularity:1,itemType:"ms"},text:"Script evaluation"},{key:null,itemType:"ms",subItemsHeading:{key:"layout",granularity:1,itemType:"ms"},text:AO.styleLayout.label},{key:null,itemType:"ms",subItemsHeading:{key:"render",granularity:1,itemType:"ms"},text:AO.paintCompositeRender.label}];return{table:wO.makeTableDetails(u,l),phases:c}}static getTraceElementTable(e){const t=e.find((e=>"responsiveness"===e.traceEventType));if(!t)return;const r=[{key:"node",itemType:"node",text:NO(IO.eventTarget)}],a=[{node:wO.makeNodeItem(t.node)}];return wO.makeTableDetails(r,a)}static async audit(e,t){const{settings:r}=t;if("simulate"===r.throttlingMethod)return{score:null,notApplicable:!0};const a=e.traces[WorkDuringInteraction.DEFAULT_PASS],n={
|
1103
|
+
trace:a,settings:r},i=await SO.request(n,t);if(null===i)return{score:null,notApplicable:!0};if("FallbackTiming"===i.name)throw new CO(CO.errors.UNSUPPORTED_OLD_CHROME,{featureName:"detailed EventTiming trace events"});const o=[],s=WorkDuringInteraction.getTraceElementTable(e.TraceElements);s&&o.push(s);const c=e.devtoolsLogs[WorkDuringInteraction.DEFAULT_PASS],l=await xO.request(c,t),u=await TO.request(a,t),{table:d,phases:m}=WorkDuringInteraction.getThreadBreakdownTable(i,a,u,l);o.push(d);const p=i.args.data.type;o.push({type:"debugdata",interactionType:p,phases:m});const h=i.args.data.duration,f=NO(IO.displayValue,{timeInMs:h,interactionType:p});return{score:h<DO.p10?1:0,displayValue:f,details:{type:"list",items:o}}}}bO.exports=WorkDuringInteraction,bO.exports.UIStrings=IO;var LO={exports:{}},MO={exports:{}};const PO={GROUPS__METRICS:"Metrics",GROUPS__ADS_PERFORMANCE:"Ad Speed",GROUPS__ADS_BEST_PRACTICES:"Tag Best Practices",NOT_APPLICABLE__DEFAULT:"Audit not applicable",
|
1104
|
+
NOT_APPLICABLE__INVALID_TIMING:"Invalid timing task data",NOT_APPLICABLE__NO_AD_RELATED_REQ:"No ad-related requests",NOT_APPLICABLE__NO_AD_RENDERED:"No ads rendered",NOT_APPLICABLE__NO_ADS_VIEWPORT:"No ads in viewport",NOT_APPLICABLE__NO_ADS:"No ads requested",NOT_APPLICABLE__NO_BIDS:"No bids detected",NOT_APPLICABLE__NO_EVENT_MATCHING_REQ:"No event matches network records",NOT_APPLICABLE__NO_GPT:"GPT not requested",NOT_APPLICABLE__NO_RECORDS:"No successful network records",NOT_APPLICABLE__NO_VISIBLE_SLOTS:"No visible slots",NOT_APPLICABLE__NO_TAG:"No tag requested",NOT_APPLICABLE__NO_TAGS:"No tags requested",NOT_APPLICABLE__NO_TASKS:"No tasks to compare",NOT_APPLICABLE__NO_VALID_AD_WIDTHS:"No requested ads contain ads of valid width",NOT_APPLICABLE__NO_LAYOUT_SHIFTS:"No layout shift events found",ERRORS__AREA_LARGER_THAN_VIEWPORT:"Calculated ad area is larger than viewport",ERRORS__VIEWPORT_AREA_ZERO:"Viewport area is zero",
|
1105
|
+
WARNINGS__NO_ADS:"No ads were requested when fetching this page.",WARNINGS__NO_AD_RENDERED:"No ads were rendered when rendering this page.",WARNINGS__NO_TAG:"The GPT tag was not requested."},OO=oi.createMessageInstanceIdFn("node_modules/lighthouse-plugin-publisher-ads/messages/common-strings.js",PO),notApplicableObj=e=>({notApplicable:!0,score:1,displayValue:OO(e)}),FO={Default:notApplicableObj(PO.NOT_APPLICABLE__DEFAULT),InvalidTiming:notApplicableObj(PO.NOT_APPLICABLE__INVALID_TIMING),NoAdRelatedReq:notApplicableObj(PO.NOT_APPLICABLE__NO_AD_RELATED_REQ),NoAdRendered:notApplicableObj(PO.NOT_APPLICABLE__NO_AD_RENDERED),NoAdsViewport:notApplicableObj(PO.NOT_APPLICABLE__NO_ADS_VIEWPORT),NoAds:notApplicableObj(PO.NOT_APPLICABLE__NO_ADS),NoBids:notApplicableObj(PO.NOT_APPLICABLE__NO_BIDS),NoEventMatchingReq:notApplicableObj(PO.NOT_APPLICABLE__NO_EVENT_MATCHING_REQ),NoGpt:notApplicableObj(PO.NOT_APPLICABLE__NO_GPT),NoLayoutShifts:notApplicableObj(PO.NOT_APPLICABLE__NO_LAYOUT_SHIFTS),
|
1106
|
+
NoRecords:notApplicableObj(PO.NOT_APPLICABLE__NO_RECORDS),NoVisibleSlots:notApplicableObj(PO.NOT_APPLICABLE__NO_VISIBLE_SLOTS),NoTag:notApplicableObj(PO.NOT_APPLICABLE__NO_TAG),NoTags:notApplicableObj(PO.NOT_APPLICABLE__NO_TAGS),NoTasks:notApplicableObj(PO.NOT_APPLICABLE__NO_TASKS),NoValidAdWidths:notApplicableObj(PO.NOT_APPLICABLE__NO_VALID_AD_WIDTHS)},UO={NoAds:OO(PO.WARNINGS__NO_ADS),NoAdRendered:OO(PO.WARNINGS__NO_AD_RENDERED),NoTag:OO(PO.WARNINGS__NO_TAG)},jO={ViewportAreaZero:OO(PO.ERRORS__VIEWPORT_AREA_ZERO)},BO={Metrics:OO(PO.GROUPS__METRICS),AdsPerformance:OO(PO.GROUPS__ADS_PERFORMANCE),AdsBestPractices:OO(PO.GROUPS__ADS_BEST_PRACTICES)};MO.exports={auditNotApplicable:FO,runWarning:UO,auditError:jO,group:BO},MO.exports.UIStrings=PO,function(e){const t=oi,{group:r}=MO.exports,a="lighthouse-plugin-publisher-ads",n={
|
1107
|
+
categoryDescription:"A Lighthouse plugin to improve ad speed and overall quality that is targeted at sites using GPT or AdSense tag. [Learn more](https://developers.google.com/publisher-ads-audits/reference)"},i=t.createMessageInstanceIdFn("node_modules/lighthouse-plugin-publisher-ads/plugin.js",n);e.exports={audits:[{path:`${a}/audits/ad-blocking-tasks`},{path:`${a}/audits/ad-render-blocking-resources`},{path:`${a}/audits/ad-request-critical-path`},{path:`${a}/audits/bid-request-from-page-start`},{path:`${a}/audits/ad-request-from-page-start`},{path:`${a}/audits/ad-top-of-viewport`},{path:`${a}/audits/ads-in-viewport`},{path:`${a}/audits/async-ad-tags`},{path:`${a}/audits/blocking-load-events`},{path:`${a}/audits/bottleneck-requests`},{path:`${a}/audits/duplicate-tags`},{path:`${a}/audits/first-ad-render`},{path:`${a}/audits/full-width-slots`},{path:`${a}/audits/gpt-bids-parallel`},{path:`${a}/audits/loads-gpt-from-official-source`},{path:`${a}/audits/loads-ad-tag-over-https`},{
|
1108
|
+
path:`${a}/audits/script-injected-tags`},{path:`${a}/audits/serial-header-bidding`},{path:`${a}/audits/tag-load-time`},{path:`${a}/audits/viewport-ad-density`},{path:`${a}/audits/cumulative-ad-shift`},{path:`${a}/audits/deprecated-api-usage`},{path:`${a}/audits/gpt-errors-overall`},{path:`${a}/audits/total-ad-blocking-time`}],groups:{metrics:{title:r.Metrics},"ads-performance":{title:r.AdsPerformance},"ads-best-practices":{title:r.AdsBestPractices}},category:{title:"Publisher Ads",description:i(n.categoryDescription),auditRefs:[{id:"tag-load-time",weight:5,group:"metrics"},{id:"bid-request-from-page-start",weight:5,group:"metrics"},{id:"ad-request-from-page-start",weight:25,group:"metrics"},{id:"first-ad-render",weight:10,group:"metrics"},{id:"cumulative-ad-shift",weight:5,group:"metrics"},{id:"total-ad-blocking-time",weight:2,group:"metrics"},{id:"gpt-bids-parallel",weight:1,group:"ads-performance"},{id:"serial-header-bidding",weight:1,group:"ads-performance"},{
|
1109
|
+
id:"bottleneck-requests",weight:1,group:"ads-performance"},{id:"script-injected-tags",weight:1,group:"ads-performance"},{id:"blocking-load-events",weight:1,group:"ads-performance"},{id:"ad-render-blocking-resources",weight:1,group:"ads-performance"},{id:"ad-blocking-tasks",weight:1,group:"ads-performance"},{id:"ad-request-critical-path",weight:0,group:"ads-performance"},{id:"ads-in-viewport",weight:4,group:"ads-best-practices"},{id:"async-ad-tags",weight:2,group:"ads-best-practices"},{id:"loads-ad-tag-over-https",weight:1,group:"ads-best-practices"},{id:"loads-gpt-from-official-source",weight:4,group:"ads-best-practices"},{id:"viewport-ad-density",weight:2,group:"ads-best-practices"},{id:"ad-top-of-viewport",weight:2,group:"ads-best-practices"},{id:"duplicate-tags",weight:1,group:"ads-best-practices"},{id:"deprecated-gpt-api-usage",weight:0,group:"ads-best-practices"},{id:"gpt-errors-overall",weight:0,group:"ads-best-practices"}]}},Object.defineProperty(e.exports,"UIStrings",{
|
1110
|
+
enumerable:!1,get:()=>n})}(LO);var $O={exports:{}},qO=[{label:"Prebid JS",patterns:["^https?://([^.]*.)?prebid[.]org/.*","^https?://acdn[.]adnxs[.]com/prebid/.*"]},{label:"33Across",patterns:["^https?://ssc[.]33across.com/api/.*"]},{label:"AppNexus",patterns:["^https?://ib[.]adnxs[.]com/.*"]},{label:"Amazon Ads",patterns:["^https?://[a-z-_.]*[.]amazon-adsystem[.]com/.*bid.*"]},{label:"AdTechus (AOL)",patterns:["^https?://([^.]*.)?adserver[.]adtechus[.]com/.*"]},{label:"Aardvark",patterns:["^https?://thor[.]rtk[.]io/.*"]},{label:"AdBlade",patterns:["^https?://rtb[.]adblade[.]com/prebidjs/bid.*"]},{label:"AdBund",patterns:["^https?://us-east-engine[.]adbund[.]xyz/prebid/ad/get.*","^https?://us-west-engine[.]adbund[.]xyz/prebid/ad/get.*"]},{label:"AdButler",patterns:["^https?://servedbyadbutler[.]com/adserve.*"]},{label:"Adequant",patterns:["^https?://rex[.]adequant[.]com/rex/c2s_prebid.*"]},{label:"AdForm",patterns:["^https?://adx[.]adform[.]net/adx.*"]},{label:"AdMedia",
|
1111
|
+
patterns:["^https?://b[.]admedia[.]com/banner/prebid/bidder.*"]},{label:"AdMixer",patterns:["^https?://inv-nets[.]admixer[.]net/prebid[.]aspx.*","^https?://inv-nets[.]admixer[.]net/videoprebid[.]aspx.*"]},{label:"AOL",patterns:["^https?://adserver-us[.]adtech[.]advertising[.]com.*","^https?://adserver-eu[.]adtech[.]advertising[.]com.*","^https?://adserver-as[.]adtech[.]advertising[.]com.*","^https?://adserver[.]adtech[.]de/pubapi/.*"]},{label:"Beachfront",patterns:["^https?://reachms[.]bfmio[.]com/bid[.]json?exchange_id=.*"]},{label:"Bidfluence",patterns:["^https?://cdn[.]bidfluence[.]com/forge[.]js.*"]},{label:"Brightcom",patterns:["^https?://hb[.]iselephant[.]com/auc/ortb.*"]},{label:"C1x",patterns:["^https?://ht-integration[.]c1exchange[.]com:9000/ht.*"]},{label:"CentroBid",patterns:["^https?://t[.]brand-server[.]com/hb.*"]},{label:"Conversant",patterns:["^https?://media[.]msg[.]dotomi[.]com/s2s/.*"]},{label:"Criteo",
|
1112
|
+
patterns:["^https?://static[.]criteo[.]net/js/ld/publishertag[.]js.*","^https?://([^.]*.)?bidder[.]criteo[.]com/cdb.*","^https?://([^.]*.)?rtax[.]criteo[.]com/delivery/rta.*","^https?://([^.]*.)?rtax[.]eu[.]criteo[.]com/delivery/rta.*"]},{label:"Datablocks",patterns:["^https?://[a-z0-9_.-]*[.]dblks[.]net/.*"]},{label:"Districtm",patterns:["^https?://prebid[.]districtm[.]ca/lib[.]js.*"]},{label:"E-Planning",patterns:["^https?://ads[.]us[.]e-planning[.]net.*"]},{label:"Essens",patterns:["^https?://bid[.]essrtb[.]com/bid/prebid_call.*"]},{label:"Facebook",patterns:["^https?://an[.]facebook[.]com/v2/placementbid[.]json.*"]},{label:"FeatureForward",patterns:["^https?://prmbdr[.]featureforward[.]com/newbidder/.*"]},{label:"Fidelity",patterns:["^https?://x[.]fidelity-media[.]com.*"]},{label:"GetIntent",patterns:["^https?://px[.]adhigh[.]net/rtb/direct_banner.*","^https?://px[.]adhigh[.]net/rtb/direct_vast.*"]},{label:"GumGum",patterns:["^https?://g2[.]gumgum[.]com/hbid/imp.*"]},{
|
1113
|
+
label:"Hiromedia",patterns:["^https?://hb-rtb[.]ktdpublishers[.]com/bid/get.*"]},{label:"Imonomy",patterns:["^https?://b[.]imonomy[.]com/openrtb/hb/.*"]},{label:"ImproveDigital",patterns:["^https?://ad[.]360yield[.]com/hb.*"]},{label:"IndexExchange",patterns:["^https?://as(-sec)?[.]casalemedia[.]com/(cygnus|headertag).*","^https?://js(-sec)?[.]indexww[.]com/ht/.*"]},{label:"InnerActive",patterns:["^https?://ad-tag[.]inner-active[.]mobi/simpleM2M/requestJsonAd.*"]},{label:"Innity",patterns:["^https?://as[.]innity[.]com/synd/.*"]},{label:"JCM",patterns:["^https?://media[.]adfrontiers[.]com/pq.*"]},{label:"JustPremium",patterns:["^https?://pre[.]ads[.]justpremium[.]com/v/.*"]},{label:"Kargo",patterns:["^https?://krk[.]kargo[.]com/api/v1/bid.*"]},{label:"Komoona",patterns:["^https?://bidder[.]komoona[.]com/v1/GetSBids.*"]},{label:"KruxLink",patterns:["^https?://link[.]krxd[.]net/hb.*"]},{label:"Kumma",patterns:["^https?://cdn[.]kumma[.]com/pb_ortb[.]js.*"]},{label:"Mantis",
|
1114
|
+
patterns:["^https?://mantodea[.]mantisadnetwork[.]com/website/prebid.*"]},{label:"MarsMedia",patterns:["^https?://bid306[.]rtbsrv[.]com:9306/bidder.*"]},{label:"Media.net",patterns:["^https?://contextual[.]media[.]net/bidexchange.*"]},{label:"MemeGlobal",patterns:["^https?://stinger[.]memeglobal[.]com/api/v1/services/prebid.*"]},{label:"MobFox",patterns:["^https?://my[.]mobfox[.]com/request[.]php.*"]},{label:"NanoInteractive",patterns:["^https?://tmp[.]audiencemanager[.]de/hb.*"]},{label:"OpenX",patterns:["^https?://([^.]*.)?d[.]openx[.]net/w/1[.]0/arj.*","^https?://([^.]*.)?servedbyopenx[.]com/.*"]},{label:"Piximedia",patterns:["^https?://static[.]adserver[.]pm/prebid.*"]},{label:"Platformio",patterns:["^https?://piohbdisp[.]hb[.]adx1[.]com.*"]},{label:"Pollux",patterns:["^https?://adn[.]plxnt[.]com/prebid.*"]},{label:"PubGears",patterns:["^https?://c[.]pubgears[.]com/tags.*"]},{label:"Pubmatic",
|
1115
|
+
patterns:["^https?://ads[.]pubmatic[.]com/AdServer/js/gshowad[.]js.*","^https?://([^.]*.)?gads.pubmatic[.]com/.*","^https?://hbopenbid.pubmatic[.]com/.*"]},{label:"Pulsepoint",patterns:["^https?://bid[.]contextweb[.]com/header/tag.*"]},{label:"Quantcast",patterns:["^https?://global[.]qc[.]rtb[.]quantserve[.]com:8080/qchb.*"]},{label:"Rhythmone",patterns:["^https?://tag[.]1rx[.]io/rmp/.*"]},{label:"Roxot",patterns:["^https?://r[.]rxthdr[.]com.*"]},{label:"Rubicon",patterns:["^https?://([^.]*.)?(fastlane|optimized-by|anvil)[.]rubiconproject[.]com/a/api.*","^https?://fastlane-adv[.]rubiconproject[.]com/v1/auction/video.*"]},{label:"Sekindo",patterns:["^https?://hb[.]sekindo[.]com/live/liveView[.]php.*"]},{label:"ShareThrough",patterns:["^https?://btlr[.]sharethrough[.]com/header-bid/.*"]},{label:"Smart AdServer",patterns:["^https?://prg[.]smartadserver[.]com/prebid.*"]},{label:"Sonobi",patterns:["^https?://apex[.]go[.]sonobi[.]com/trinity[.]js.*"]},{label:"Sovrn",
|
1116
|
+
patterns:["^https?://ap[.]lijit[.]com/rtb/bid.*"]},{label:"SpringServe",patterns:["^https?://bidder[.]springserve[.]com/display/hbid.*"]},{label:"StickyAds",patterns:["^https?://cdn[.]stickyadstv[.]com/mustang/mustang[.]min[.]js.*","^https?://cdn[.]stickyadstv[.]com/prime-time/.*"]},{label:"TapSense3",patterns:["^https?://ads04[.]tapsense[.]com/ads/headerad.*"]},{label:"ThoughtLeadr",patterns:["^https?://a[.]thoughtleadr[.]com/v4/.*"]},{label:"TremorBid",patterns:["^https?://([^.]*.)?ads[.]tremorhub[.]com/ad/tag.*"]},{label:"Trion",patterns:["^https?://in-appadvertising[.]com/api/bidRequest.*"]},{label:"TripleLift",patterns:["^https?://tlx[.]3lift[.]com/header/auction.*"]},{label:"TrustX",patterns:["^https?://sofia[.]trustx[.]org/hb.*"]},{label:"UCFunnel",patterns:["^https?://agent[.]aralego[.]com/header.*"]},{label:"Underdog Media",patterns:["^https?://udmserve[.]net/udm/img[.]fetch.*"]},{label:"UnRuly",patterns:["^https?://targeting[.]unrulymedia[.]com/prebid.*"]},{
|
1117
|
+
label:"VertaMedia",patterns:["^https?://rtb[.]vertamedia[.]com/hb/.*"]},{label:"Vertoz",patterns:["^https?://hb[.]vrtzads[.]com/vzhbidder/bid.*"]},{label:"WideOrbig",patterns:["^https?://([^.]*.)?atemda[.]com/JSAdservingMP[.]ashx.*"]},{label:"WideSpace",patterns:["^https?://engine[.]widespace[.]com/map/engine/hb/.*"]},{label:"YieldBot",patterns:["^https?://cdn[.]yldbt[.]com/js/yieldbot[.]intent[.]js.*"]},{label:"YieldMo",patterns:["^https?://ads[.]yieldmo[.]com/exchange/prebid.*"]}];const zO=/([a-zA-Z][a-zA-Z_-]*)\s*(?:=(?:"([^"]*)"|([^ \t",;]*)))?/g,VO="max-age",WO="s-maxage",GO="max-stale",HO="min-fresh",YO="immutable",KO="must-revalidate",JO="no-cache",XO="no-store",ZO="no-transform",QO="only-if-cached",eF="private",tF="proxy-revalidate",rF="public";function parseBooleanOnly(e){return null===e}function parseDuration(e){if(!e)return null;const t=parseInt(e,10);return!Number.isFinite(t)||t<0?null:t}class CacheControl{constructor(){this.maxAge=null,this.sharedMaxAge=null,
|
1118
|
+
this.maxStale=null,this.maxStaleDuration=null,this.minFresh=null,this.immutable=null,this.mustRevalidate=null,this.noCache=null,this.noStore=null,this.noTransform=null,this.onlyIfCached=null,this.private=null,this.proxyRevalidate=null,this.public=null}parse(e){if(!e||0===e.length)return this;const t={},r=e.match(zO)||[];return Array.prototype.forEach.call(r,(e=>{const r=e.split("=",2),[a]=r;let n=null;r.length>1&&(n=r[1].trim()),t[a.toLowerCase()]=n})),this.maxAge=parseDuration(t[VO]),this.sharedMaxAge=parseDuration(t[WO]),this.maxStale=parseBooleanOnly(t[GO]),this.maxStaleDuration=parseDuration(t[GO]),this.maxStaleDuration&&(this.maxStale=!0),this.minFresh=parseDuration(t[HO]),this.immutable=parseBooleanOnly(t[YO]),this.mustRevalidate=parseBooleanOnly(t[KO]),this.noCache=parseBooleanOnly(t[JO]),this.noStore=parseBooleanOnly(t[XO]),this.noTransform=parseBooleanOnly(t[ZO]),this.onlyIfCached=parseBooleanOnly(t[QO]),this.private=parseBooleanOnly(t[eF]),
|
1119
|
+
this.proxyRevalidate=parseBooleanOnly(t[tF]),this.public=parseBooleanOnly(t[rF]),this}format(){const e=[];return"number"==typeof this.maxAge&&e.push(`${VO}=${this.maxAge}`),"number"==typeof this.sharedMaxAge&&e.push(`${WO}=${this.sharedMaxAge}`),this.maxStale&&("number"==typeof this.maxStaleDuration?e.push(`${GO}=${this.maxStaleDuration}`):e.push(GO)),"number"==typeof this.minFresh&&e.push(`${HO}=${this.minFresh}`),this.immutable&&e.push(YO),this.mustRevalidate&&e.push(KO),this.noCache&&e.push(JO),this.noStore&&e.push(XO),this.noTransform&&e.push(ZO),this.onlyIfCached&&e.push(QO),this.private&&e.push(eF),this.proxyRevalidate&&e.push(tF),this.public&&e.push(rF),e.join(", ")}}var aF={CacheControl,parse:function parse(e){return(new CacheControl).parse(e)},format:function format$2(e){return e instanceof CacheControl?e.format():CacheControl.prototype.format.call(e)}};const nF=QS.exports,{parse:iF}=aF;function getHeader(e,t){const r=t.toLowerCase()
|
1120
|
+
;return(e.responseHeaders||[]).find((e=>e.name.toLowerCase()===r))}var oF={isCacheable:function isCacheable$2(e){if(!nF.isCacheableAsset(e))return!1;const t=getHeader(e,"cache-control");if(t){try{const e=iF(t.value);if(e.noStore||e.noCache||0===e.maxAge)return!1}catch(e){}return!0}return!!getHeader(e,"expires")||!!getHeader(e,"last-modified")}};const sF=qO,cF=uw,{isCacheable:lF}=oF,{URL:uF}=Gn;function toURL$2(e){let t;try{t="string"==typeof e?new uF(e):e}catch(e){t=new uF("http://_")}return t}function isGoogleAds$2(e){return e=toURL$2(e),/(^|\.)(doubleclick.net|google(syndication|tagservices).com)$/.test(e.hostname)}function isAdSenseTag(e){const t="pagead2.googlesyndication.com"===(e=toURL$2(e)).host,r=["/pagead/js/adsbygoogle.js","/pagead/show_ads.js"].includes(e.pathname);return t&&r}function isAdSenseImplTag(e){const t="pagead2.googlesyndication.com"===(e=toURL$2(e)).host,r=/(^\/pagead\/js\/.*\/show_ads_impl.*?\.js)/.test(e.pathname);return t&&r}function isAdSense$1(e){
|
1121
|
+
return isAdSenseTag(e=toURL$2(e))||isAdSenseImplTag(e)}function isAdSenseAdRequest(e){if(!e)return!1;const t=new uF(e.url);return"/pagead/ads"===t.pathname&&"googleads.g.doubleclick.net"===t.host}function isAdSenseIframe(e){return/(^aswift_\d+)/.test(e.id)}function isGptTag$2(e){const{host:t,pathname:r}=toURL$2(e),a=["www.googletagservices.com","pagead2.googlesyndication.com","securepubads.g.doubleclick.net"].includes(t),n=["/tag/js/gpt.js","/tag/js/gpt_mobile.js"].includes(r);return a&&n}function isAMPTag(e){const{host:t,pathname:r}=toURL$2(e),a=["cdn.ampproject.org"].includes(t),n=["/v0/amp-ad-0.1.js"].includes(r);return a&&n}function isGptImplTag$4(e){return isGoogleAds$2(e)&&/(^\/gpt\/pubads_impl([a-z_]*)((?<!rendering)_)\d+\.js)/.test(toURL$2(e).pathname)}function isAMPImplTag(e){return/^\/[a-z_]*\/\d+\/v0\/amp-ad-network-doubleclick-impl-0.1.js/.test(toURL$2(e).pathname)}function isGpt$3(e){return isGptTag$2(e=toURL$2(e))||isGptImplTag$4(e)}function isGptAdRequest$1(e){
|
1122
|
+
if(!e)return!1;return"/gampad/ads"===new uF(e.url).pathname&&"XHR"===e.resourceType&&isGoogleAds$2(e.url)}function isAMPAdRequest(e){if(!e)return!1;const t=new uF(e.url);return"/gampad/ads"===t.pathname&&"securepubads.g.doubleclick.net"===t.host&&"Fetch"===e.resourceType}function isGptIframe$1(e){return/(^google_ads_iframe_)/.test(e.id)}function isAdScript$2(e){return isAdSense$1(e)||isGpt$3(e)||function isAMP(e){return isAMPTag(e)||isAMPImplTag(e)}(e)}function getHeaderBidder$2(e){for(const t of sF)for(const r of t.patterns)if(new RegExp(r).test(e))return t.label}function isBidRelatedRequest$1(e){return!!getHeaderBidder$2("string"==typeof e?e:e.url)}var dF={isGoogleAds:isGoogleAds$2,isGptAdRequest:isGptAdRequest$1,isImpressionPing:function isImpressionPing$3(e){const{host:t,pathname:r}=toURL$2(e);return["securepubads.g.doubleclick.net","googleads4.g.doubleclick.net"].includes(t)&&["/pcs/view","/pagead/adview"].includes(r)},isGpt:isGpt$3,isAdSense:isAdSense$1,isAdSenseTag,
|
1123
|
+
isAdSenseImplTag,isAdSenseAdRequest,isAdSenseIframe,isGptTag:isGptTag$2,isGptImplTag:isGptImplTag$4,isGptIframe:isGptIframe$1,isAdTag:function isAdTag$3(e){return isAdSenseTag(e)||isGptTag$2(e)||isAMPTag(e)},isAdScript:isAdScript$2,isAdRequest:function isAdRequest$5(e){return isAdSenseAdRequest(e)||isGptAdRequest$1(e)||isAMPAdRequest(e)},isAdIframe:function isAdIframe$3(e){return isAdSenseIframe(e)||isGptIframe$1(e)},isImplTag:function isImplTag$3(e){return isAdSenseTag(e)||isGptImplTag$4(e)||isAMPImplTag(e)},containsAnySubstring:function containsAnySubstring$1(e,t){return t.some((t=>e.includes(t)))},hasImpressionPath:function hasImpressionPath(e){return"/pcs/view"===e.pathname||"/pagead/adview"===e.pathname},getHeaderBidder:getHeaderBidder$2,isBidRelatedRequest:isBidRelatedRequest$1,isBidRequest:function isBidRequest$4(e){return isBidRelatedRequest$1(e)&&function isPossibleBidRequest(e){return(null==e.resourceSize||e.resourceSize>0)&&"Image"!=e.resourceType&&!lF(e)}(e)},
|
1124
|
+
isStaticRequest:function isStaticRequest$1(e){return["parser","preload","other"].includes(e.initiator.type)},toURL:toURL$2,trimUrl:function trimUrl$1(e){const t=new uF(e),r=t.pathname.length>60?t.pathname.substr(0,60)+"...":t.pathname;return t.origin+r},getNameOrTld:function getNameOrTld$2(e){const t=getHeaderBidder$2(e);if(t)return t;if(isGpt$3(e))return"GPT";if(isAdSense$1(e))return"AdSense";if(isAMPTag(e))return"AMP tag";const r=cF.getEntity(e);if(r)return r.name;const{host:a}=new uF(e),[n=""]=a.match(/([^.]*(\.[a-z]{2,3}){1,2})$/)||[];return n||a},isAMPTag,isAMPAdRequest,isAdRelated:function isAdRelated$3(e){const t="string"==typeof e?e:e.url;if(isAdScript$2(t)||getHeaderBidder$2(t))return!0;const r=cF.getEntity(t);return!!r&&r.categories.includes("ad")}};const mF=Zc,pF=sb,{isBidRelatedRequest:hF,isImpressionPing:gF,isGoogleAds:fF,isGptAdRequest:yF,isGptTag:vF,isGptImplTag:bF,toURL:wF}=dF;function getFrame(e){return e.args.frame||e.args.data&&e.args.data.frame||null}
|
1125
|
+
function isAdTask(e){return!!function getCpuNodeUrls(e){const t=new Set;for(const{args:r}of e.childEvents)r.data&&r.data.url&&t.add(r.data.url);return Array.from(t)}(e).find((e=>hF(e)||fF(wF(e))))}function addEdge(e,t){e===t||e.endTime>t.startTime||e.addDependent(t)}function addEdges(e){const t=[],r=[];e.traverse((e=>{e.type===mF.TYPES.NETWORK&&(vF(e.record.url)&&"Script"===e.record.resourceType?r.push(e):yF(e.record)&&t.push(e))})),e.traverse((e=>{if(e.type===mF.TYPES.NETWORK){if(bF(e.record.url)){const t=e;for(const e of r)addEdge(e,t)}if(hF(e.record)){const r=e;for(const e of t)addEdge(r,e)}if(gF(e.record.url)){const r=e;for(const e of t){addEdge(e,r);for(const t of e.getDependents())addEdge(t,r)}}}}))}class AdLanternMetric$6 extends pF{static get COEFFICIENTS(){return{intercept:0,optimistic:1,pessimistic:0}}static getPessimisticGraph(e){const t=e.cloneWithRelationships((e=>!0));return addEdges(t),t}static getOptimisticGraph(e){
|
1126
|
+
const t=e.record.frameId,r=AdLanternMetric$6.getPessimisticGraph(e),a=r.cloneWithRelationships((e=>{if(e.type===mF.TYPES.CPU)return function isLongTask(e){return e.event.dur>5e4}(e)||isAdTask(e)||!!getFrame(e.event)&&getFrame(e.event)!==t;if(e.hasRenderBlockingPriority())return!0;const r=e.record.url;return hF(r)||fF(wF(r))}));return addEdges(r),a}static getEstimateFromSimulation(e,t){throw new Error("getEstimateFromSimulation not implemented by "+this.name)}static findTiming(e,t){let r={startTime:1/0,endTime:-1/0,duration:0};for(const[a,n]of e.entries())t(a,n)&&r.startTime>n.startTime&&(r=n);return r}static findNetworkTiming(e,t){return this.findTiming(e,(e=>e.type===mF.TYPES.NETWORK&&t(e.record)))}}var SF=AdLanternMetric$6;const TF=SF,EF=Dl,xF=Lo,_F=eb,{isAdRequest:AF,isBidRequest:RF,isImplTag:kF,isImpressionPing:DF}=dF,{URL:CF}=Gn;function getPageStartTime$4(e,t=-1){const r=e.find((e=>200==e.statusCode));return r?r.startTime:t}async function getTimingsByRecord$5(e,t,r){
|
1127
|
+
const a=new Map,n=await xF.request(t,r);if("simulate"==r.settings.throttlingMethod){const n=await _F.request({trace:e,devtoolsLog:t},r),i=TF.getOptimisticGraph(n),o=await EF.request({devtoolsLog:t,settings:r.settings},r),{nodeTimings:s}=o.simulate(i,{});for(const[{record:e},t]of s.entries())e&&a.set(e,t)}else{const e=getPageStartTime$4(n);for(const t of n)a.set(t,{startTime:1e3*(t.startTime-e),endTime:1e3*(t.endTime-e),duration:1e3*(t.endTime-t.startTime)})}return a}function getScriptUrl$1(e){if(e.args.data&&["EvaluateScript","FunctionCall"].includes(e.name))return e.args.data.url?e.args.data.url:e.args.data.stackTrace?e.args.data.stackTrace[0].url:void 0}var IF={getTagEndTime:function getTagEndTime$1(e){const t=e.find((e=>kF(new CF(e.url))));return t?t.endTime:-1},getImpressionStartTime:function getImpressionStartTime$1(e){const t=e.find((e=>DF(e.url)));return t?t.startTime:-1},getAdStartTime:function getAdStartTime$2(e){const t=e.find(AF);return t?t.startTime:-1},
|
1128
|
+
getBidStartTime:function getBidStartTime$1(e){const t=e.find(RF);return t?t.startTime:-1},getPageStartTime:getPageStartTime$4,getPageResponseTime:function getPageResponseTime(e,t=-1){const r=e.find((e=>200==e.statusCode));return r?r.responseReceivedTime:t},getScriptUrl:getScriptUrl$1,getTimingsByRecord:getTimingsByRecord$5,getScriptEvaluationTimes:async function getScriptEvaluationTimes$1(e,t,r){const a=1e3*getPageStartTime$4(await xF.request(t,r)),n=new Map;for(const t of e.traceEvents){const e=getScriptUrl$1(t);if(!e)continue;const r=t.ts/1e3-a;(!n.has(e)||n.get(e)>r)&&n.set(e,r)}if("simulate"!==r.settings.throttlingMethod)return n;const i=await getTimingsByRecord$5(e,t,r),o=new Map;for(const[e,t]of i.entries()){const i=n.get(e.url);if(!i)continue;if(o.has(e.url))continue;const s=1e3*e.startTime-a,c=t.endTime,l=r.settings.throttling.cpuSlowdownMultiplier*(i-s);o.set(e.url,c+l)}return o}};const NF=SF,LF=Ew,MF=Ao,{getAdStartTime:PF,getPageStartTime:OF}=IF,{isAdRequest:FF}=dF
|
1129
|
+
;class LanternAdRequestTime extends NF{static getEstimateFromSimulation(e,t){const{nodeTimings:r}=e;return{timeInMs:NF.findNetworkTiming(r,FF).startTime,nodeTimings:r}}}LanternAdRequestTime=MF(LanternAdRequestTime);class AdRequestTime$1 extends LF{static async computeSimulatedMetric(e,t){return LanternAdRequestTime.request(e,t)}static async computeObservedMetric(e){const{networkRecords:t}=e,r=OF(t),a=1e3*(PF(t)-r);return Promise.resolve({timing:a})}static async request(e,t){throw Error("Not implemented -- class not decorated")}}var UF=AdRequestTime$1=MF(AdRequestTime$1);var jF={getAttributableUrl:function getAttributableUrl$3(e,t=new Set){const r=e.attributableURLs.find((e=>t.has(e))),a=e.attributableURLs[0],n=r||a;if(n)return n;let i=50,o="";for(const r of e.children){const e=getAttributableUrl$3(r,t);e&&r.duration>i&&(o=e,i=r.duration)}return o}};const BF=SF,$F=Zc,qF=Ew,{getAttributableUrl:zF}=jF,VF=Dl,WF=Rv,GF=Ao,HF=Lo,YF=eb;class LongTasks$2 extends qF{
|
1130
|
+
static async getSimulationGraph(e,t,r){const a=await YF.request({trace:e,devtoolsLog:t},r);return BF.getOptimisticGraph(a)}static async computeSimulatedResult(e,t,r){const a=await this.getSimulationGraph(e,t,r),n=await VF.request({devtoolsLog:t,settings:r.settings},r),{nodeTimings:i}=n.simulate(a,{}),o=[];for(const[e,t]of i.entries())e.type!==$F.TYPES.CPU||t.duration<100||o.push({event:e.event,startTime:t.startTime,endTime:t.endTime,duration:t.duration,selfTime:t.duration,attributableURLs:Array.from(e.getEvaluateScriptURLs()),children:[],parent:e.parent,unbounded:e.unbounded,group:e.group});return o}static async computeObservedResult(e,t,r){const a=await WF.request(e,r),n=await HF.request(t,r),i=new Set(n.filter((e=>"Script"===e.resourceType)).map((e=>e.url)));return a.filter((e=>function isLong(e,t){if(e.duration<50)return!1;const r=zF(e,t);if(!r)return!1;if(e.parent)return r!=zF(e.parent,t);return!0}(e,i)))}static async compute_({trace:e,devtoolsLog:t},r){
|
1131
|
+
return"simulate"==r.settings.throttlingMethod?this.computeSimulatedResult(e,t,r):this.computeObservedResult(e,t,r)}static async request(e,t){throw Error("Not implemented -- class not decorated")}}var KF=LongTasks$2=GF(LongTasks$2),JF=getAugmentedNamespace(Object.freeze({__proto__:null,Audit:kc}));const XF=UF,ZF=oi,QF=KF,{auditNotApplicable:eU}=MO.exports,{Audit:tU}=JF,{getAttributableUrl:rU}=jF,{isAdScript:aU}=dF,{URL:nU}=Gn,iU={title:"No long tasks blocking ad-related network requests",failureTitle:"Avoid long tasks that block ad-related network requests",description:"Tasks blocking the main thread can delay ad requests and cause a poor user experience. Consider removing long blocking tasks or moving them off of the main thread. These tasks can be especially detrimental to performance on less powerful devices. [Learn more](https://developers.google.com/publisher-ads-audits/reference/audits/ad-blocking-tasks).",failureDisplayValue:"{timeInMs, number, seconds} s blocked",
|
1132
|
+
columnScript:"Attributable URL",columnStartTime:"Start",columnDuration:"Duration"},oU=ZF.createMessageInstanceIdFn("node_modules/lighthouse-plugin-publisher-ads/audits/ad-blocking-tasks.js",iU),sU=[{key:"script",itemType:"url",text:oU(iU.columnScript)},{key:"startTime",itemType:"ms",text:oU(iU.columnStartTime),granularity:1},{key:"duration",itemType:"ms",text:oU(iU.columnDuration),granularity:1}];class AdBlockingTasks extends tU{static get meta(){return{id:"ad-blocking-tasks",title:oU(iU.title),failureTitle:oU(iU.failureTitle),description:oU(iU.description),requiredArtifacts:["traces","devtoolsLogs"]}}static async audit(e,t){const r="simulate"==t.settings.throttlingMethod?200:100,a={trace:e.traces[tU.DEFAULT_PASS],devtoolsLog:e.devtoolsLogs[tU.DEFAULT_PASS],settings:t.settings};let n=[];try{n=await QF.request(a,t)}catch(e){return eU.InvalidTiming}if(!n.length)return eU.NoTasks;const{timing:i}=await XF.request(a,t);if(!(i>0))return eU.NoAdRelatedReq;const o=[];for(const e of n){
|
1133
|
+
if(e.startTime>i||e.duration<r)continue;const t=rU(e);if(t&&aU(new nU(t)))continue;const a=t&&new nU(t),n=a&&a.origin+a.pathname||"Other";o.push({script:n,rawUrl:t,startTime:e.startTime,endTime:e.endTime,duration:e.duration,isTopLevel:!e.parent})}let s=Array.from(o);s.length>10&&(s=o.filter((e=>"Other"!==e.script&&e.isTopLevel)).sort(((e,t)=>t.duration-e.duration)).splice(0,10).sort(((e,t)=>e.startTime-t.startTime)));const c=s.reduce(((e,t)=>t.isTopLevel?e+t.duration:e),0),l=s.length>0;return{score:l?0:1,numericValue:c,numericUnit:"millisecond",displayValue:l?oU(iU.failureDisplayValue,{timeInMs:c}):"",details:AdBlockingTasks.makeTableDetails(sU,s)}}}$O.exports=AdBlockingTasks,$O.exports.UIStrings=iU;var cU={exports:{}};const lU=oi,uU=Lo,{auditNotApplicable:dU}=MO.exports,{Audit:mU}=JF,{getTimingsByRecord:pU}=IF,{isAdTag:hU}=dF,{URL:gU}=Gn,fU={title:"Minimal render-blocking resources found",failureTitle:"Avoid render-blocking resources",
|
1134
|
+
description:"Render-blocking resources slow down tag load times. Consider loading critical JS/CSS inline or loading scripts asynchronously or loading the tag earlier in the head. [Learn more](https://developers.google.com/web/tools/lighthouse/audits/blocking-resources).",failureDisplayValue:"Up to {timeInMs, number, seconds} s tag load time improvement",columnUrl:"Resource",columnStartTime:"Start",columnDuration:"Duration"},yU=lU.createMessageInstanceIdFn("node_modules/lighthouse-plugin-publisher-ads/audits/ad-render-blocking-resources.js",fU),vU=[{key:"url",itemType:"url",text:yU(fU.columnUrl)},{key:"startTime",itemType:"ms",text:yU(fU.columnStartTime),granularity:1},{key:"duration",itemType:"ms",text:yU(fU.columnDuration),granularity:1}];class AdRenderBlockingResources extends mU{static get meta(){return{id:"ad-render-blocking-resources",title:yU(fU.title),failureTitle:yU(fU.failureTitle),scoreDisplayMode:"binary",description:yU(fU.description),
|
1135
|
+
requiredArtifacts:["LinkElements","ScriptElements","devtoolsLogs","traces"]}}static async audit(e,t){const r=e.devtoolsLogs[mU.DEFAULT_PASS],a=e.traces[mU.DEFAULT_PASS],n=await uU.request(r,t),i=n.find((e=>hU(new gU(e.url))));if(!i)return dU.NoTag;const o=await pU(a,r,t),s=new Set;for(const t of e.LinkElements)t.href&&"stylesheet"==t.rel&&s.add(t.href);for(const t of e.ScriptElements)!t.src||t.defer||t.async||s.add(t.src);const c=n.filter((e=>e.endTime<i.startTime)).filter((e=>e!=i.initiatorRequest)).filter((e=>e.initiator.type="parser")).filter((e=>s.has(e.url))).map((e=>Object.assign({url:e.url},o.get(e))));c.sort(((e,t)=>e.endTime-t.endTime));const l=o.get(i)||{startTime:1/0},u=c.map((e=>e.startTime)),d=c.map((e=>e.endTime)),m=Math.min(...u),p=Math.min(Math.max(...d),l.startTime)-m;let h="";c.length>0&&p>0&&(h=yU(fU.failureDisplayValue,{timeInMs:p}));return{score:c.length>0&&p>100?0:1,numericValue:c.length,numericUnit:"unitless",displayValue:h,details:{opportunity:p,
|
1136
|
+
...AdRenderBlockingResources.makeTableDetails(vU,c)}}}}cU.exports=AdRenderBlockingResources,cU.exports.UIStrings=fU;var bU={exports:{}};var wU={assert:function assert$2(e){if(null==e)throw new Error("Expected not to be null");return e}};const SU=Zc,TU=Lo,{assert:EU}=wU,{getNameOrTld:xU,trimUrl:_U}=dF,{getNetworkInitiators:AU}=eb,{getTimingsByRecord:RU}=IF,{isAdRequest:kU,isAdSense:DU,isGpt:CU,isBidRequest:IU,isAdRelated:NU}=dF;function isXhrCritical(e,t,r){const a=t.xhrEdges.get(e.url);if(!a)return!1;for(const{url:e}of r)if(a.has(e))return!0;return!1}function addInitiatedRequests(e,t,r,a){const n=r.allRecords.filter((e=>null!=e.resourceType)).filter((e=>["Script","XHR"].includes(e.resourceType||"")&&e.endTime<t.startTime)).filter((t=>t.initiatorRequest==e||AU(t).includes(e.url)));for(const e of n){"XHR"==e.resourceType&&isXhrCritical(e,r,a)&&linkGraph(r,e,a)}}function linkGraph(e,t,r=new Set){if(!t||r.has(t))return r;r.add(t);const a=new Set
|
1137
|
+
;for(let n=t.initiator.stack;n;n=n.parent)for(const{url:i}of n.callFrames){if(a.has(i))continue;a.add(i);const o=e.requestsByUrl.get(i);if(o&&(linkGraph(e,o,r),"Script"==o.resourceType)){const a=n.callFrames[0].url,i=e.requestsByUrl.get(a);i&&addInitiatedRequests(i,t,e,r)}}return linkGraph(e,t.initiatorRequest||null,r),r}function buildNetworkSummary(e,t){const r=new Map;for(const t of e)r.set(t.url,t);const a=t.filter((e=>e.name.startsWith("XHR"))).filter((e=>!!(e.args.data||{}).url)),n=new Map;for(const e of a){const t=e.args.data||{},r=n.get(t.url)||new Set;for(const{url:e}of t.stackTrace||[])r.add(e);n.set(t.url,r)}return{requestsByUrl:r,xhrEdges:n,allRecords:e}}var LU={getTransitiveClosure:function getTransitiveClosure(e,t){const r=new Set,a=function findTargetRequest(e,t){let r=null;return e.traverse((e=>{e.type!==SU.TYPES.CPU&&t(e.record)&&(r&&r.startTime<e.startTime||(r=e))})),r}(e,t),n=[],i=[];if(null==a)return{requests:n,traceEvents:i};const o=[a];for(;o.length;){
|
1138
|
+
const e=o.pop();e&&!r.has(e)&&(r.add(e),o.push(...e.getDependencies()))}const s=new Set;for(o.push(...e.getDependents());o.length;){const e=o.pop();if(e&&!s.has(e)){if(s.add(e),r.has(e))for(const e of o)r.add(e);o.push(...e.getDependents())}}for(const e of r)e.type===SU.TYPES.NETWORK?e.endTime<EU(a).startTime&&n.push(e.record):e.type===SU.TYPES.CPU&&e.event.ts<1e6*EU(a).startTime&&i.push(e.event,...e.childEvents);return{requests:n,traceEvents:i}},getCriticalGraph:function getCriticalGraph$1(e,t,r){const a=buildNetworkSummary(e,t),n=new Set;return linkGraph(a,r,n),n},computeAdRequestWaterfall:async function computeAdRequestWaterfall$4(e,t,r){const a=await TU.request(t,r),n=a.find(kU)||a.find(IU)||a.find(NU);if(null==n)return Promise.resolve([]);const i=new Set,o=EU(n),s=a.filter((e=>CU(e.url)||DU(e.url))),c=a.filter((e=>IU(e)&&e.endTime<=o.startTime)),l=buildNetworkSummary(a,e.traceEvents);for(const e of[o,...c,...s])linkGraph(l,e,i)
|
1139
|
+
;const u=new Set(["Script","XHR","Fetch","EventStream","Document",void 0]),d=Array.from(i).filter((e=>e.endTime<o.startTime)).filter((e=>u.has(e.resourceType))).filter((e=>"text/css"!=e.mimeType)),m=await RU(e,t,r),p=function computeSummaries(e){e.sort(((e,t)=>e.nameOrTld!=t.nameOrTld?e.nameOrTld<t.nameOrTld?-1:1:e.type!=t.type?e.type<t.type?-1:1:e.startTime!=t.startTime?e.startTime<t.startTime?-1:1:e.endTime-t.endTime));const t=[];for(let n=0;n<e.length;n++){const i=e[n];let o;for(;n<e.length&&(o=e[n+1],o&&(r=o,a=i,!(Math.max(r.startTime,a.startTime)>Math.min(r.endTime,a.endTime)||r.type&&a.type&&r.type!=a.type||"Script"==r.type||r.nameOrTld!=a.nameOrTld)));)i.endTime=Math.max(i.endTime,o.endTime),i.duration=i.endTime-i.startTime,n++;t.push(i)}var r,a;return t.sort(((e,t)=>e.startTime-t.startTime)),t}(d.map((e=>{const{startTime:t,endTime:r}=m.get(e)||e;return{startTime:t,endTime:r,duration:r-t,selfTime:0,url:_U(e.url),nameOrTld:xU(e.url),type:e.resourceType,record:e}})))
|
1140
|
+
;return function computeSelfTimes(e){if(!e.length)return[];let t=EU(e[0]);t.selfTime=t.duration;let r=t.startTime;for(const a of e){if(a.endTime<r||a==t)continue;const e=Math.max(r,a.startTime),n=Math.min(t.endTime,a.endTime);e<n&&(t.selfTime-=n-e),r=Math.max(r,n),a.endTime>t.endTime&&(a.selfTime=a.endTime-e,t=a)}}(p),p}};const MU=oi,{auditNotApplicable:PU}=MO.exports,{Audit:OU}=JF,{computeAdRequestWaterfall:FU}=LU,UU={title:"Ad request waterfall",failureTitle:"Reduce critical path for ad loading",description:"Consider reducing the number of resources, loading multiple resources simultaneously, or loading resources earlier to improve ad speed. Requests that block ad loading can be found below. [Learn more](https://developers.google.com/publisher-ads-audits/reference/audits/ad-request-critical-path).",displayValue:"{serialResources, plural, =1 {1 serial resource} other {# serial resources}}",columnUrl:"Request",columnType:"Type",columnStartTime:"Start",columnEndTime:"End"
|
1141
|
+
},jU=MU.createMessageInstanceIdFn("node_modules/lighthouse-plugin-publisher-ads/audits/ad-request-critical-path.js",UU),BU=[{key:"nameOrTld",itemType:"text",text:jU(UU.columnType)},{key:"url",itemType:"url",text:jU(UU.columnUrl)},{key:"startTime",itemType:"ms",text:jU(UU.columnStartTime),granularity:1},{key:"endTime",itemType:"ms",text:jU(UU.columnEndTime),granularity:1}];class AdRequestCriticalPath extends OU{static get meta(){return{id:"ad-request-critical-path",title:jU(UU.title),failureTitle:jU(UU.failureTitle),description:jU(UU.description),scoreDisplayMode:"informative",requiredArtifacts:["devtoolsLogs","traces"]}}static async audit(e,t){const r=e.traces[OU.DEFAULT_PASS],a=e.devtoolsLogs[OU.DEFAULT_PASS],n=(await FU(r,a,t)).filter((e=>e.startTime>0&&e.startTime<e.endTime));if(!n.length)return PU.NoAds;const i=function computeDepth(e){let t=0,r=0;for(const{startTime:a,endTime:n}of e)a>=t?(++r,t=n):t=Math.min(t,n);return r}(n),o=i>3;for(const e of n)delete e.record
|
1142
|
+
;const s=function computeIdleTimes(e){let t=1/0;const r=[];for(let a=0;a<e.length;){const{startTime:n,endTime:i}=e[a];for(n-t>150&&r.push(n-t),t=i;++a<e.length&&e[a].startTime<t;)t=Math.max(t,e[a].endTime)}return r}(n),c=Math.max(...s),l=s.reduce(((e,t)=>e+t),0);return{numericValue:i,numericUnit:"unitless",score:o?0:1,displayValue:jU(UU.displayValue,{serialResources:i}),details:{size:n.length,depth:i,maxIdleTime:c,totalIdleTime:l,...AdRequestCriticalPath.makeTableDetails(BU,n)}}}}bU.exports=AdRequestCriticalPath,bU.exports.UIStrings=UU;var $U={exports:{}};const qU=SF,zU=Ew,VU=Ao,{getAdStartTime:WU,getBidStartTime:GU,getPageStartTime:HU}=IF,{isAdRequest:YU,isBidRequest:KU}=dF;class LanternBidRequestTime extends qU{static getEstimateFromSimulation(e,t){const{nodeTimings:r}=e,a=qU.findNetworkTiming(r,KU).startTime;return a>qU.findNetworkTiming(r,YU).startTime?{timeInMs:-1,nodeTimings:r}:{timeInMs:a,nodeTimings:r}}}LanternBidRequestTime=VU(LanternBidRequestTime)
|
1143
|
+
;class BidRequestTime extends zU{static async computeSimulatedMetric(e,t){return LanternBidRequestTime.request(e,t)}static async computeObservedMetric(e){const{networkRecords:t}=e,r=HU(t),a=GU(t);if(WU(t)<a)return{timing:-1};return{timing:1e3*(a-r)}}static async request(e,t){throw Error("Not implemented -- class not decorated")}}const JU=BidRequestTime=VU(BidRequestTime),XU=oi,{auditNotApplicable:ZU}=MO.exports,{Audit:QU}=JF,ej={title:"First bid request time",failureTitle:"Reduce time to send the first bid request",description:"This metric measures the elapsed time from the start of page load until the first bid request is made. Delayed bid requests will decrease impressions and viewability, and have a negative impact on ad revenue. [Learn More](https://developers.google.com/publisher-ads-audits/reference/audits/bid-request-from-page-start).",displayValue:"{timeInMs, number, seconds} s"
|
1144
|
+
},tj=XU.createMessageInstanceIdFn("node_modules/lighthouse-plugin-publisher-ads/audits/bid-request-from-page-start.js",ej);$U.exports=class BidRequestFromPageStart extends QU{static get meta(){return{id:"bid-request-from-page-start",title:tj(ej.title),failureTitle:tj(ej.failureTitle),description:tj(ej.description),scoreDisplayMode:QU.SCORING_MODES.NUMERIC,requiredArtifacts:["devtoolsLogs","traces"]}}static get defaultOptions(){return{simulate:{p10:4350,median:8e3},provided:{p10:1200,median:2e3}}}static async audit(e,t){const r={trace:e.traces[QU.DEFAULT_PASS],devtoolsLog:e.devtoolsLogs[QU.DEFAULT_PASS],settings:t.settings},a=t.options["provided"==t.settings.throttlingMethod?"provided":"simulate"],{timing:n}=await JU.request(r,t);return n>0?{numericValue:n,numericUnit:"millisecond",score:QU.computeLogNormalScore(a,n),displayValue:tj(ej.displayValue,{timeInMs:n})}:ZU.NoBids}},$U.exports.UIStrings=ej;var rj={exports:{}}
|
1145
|
+
;const aj=UF,nj=oi,{auditNotApplicable:ij,runWarning:oj}=MO.exports,{Audit:sj}=JF,cj={title:"First ad request time",failureTitle:"Reduce time to send the first ad request",description:"This metric measures the elapsed time from the start of page load until the first ad request is made. Delayed ad requests will decrease impressions and viewability, and have a negative impact on ad revenue. [Learn more](https://developers.google.com/publisher-ads-audits/reference/audits/ad-request-from-page-start).",displayValue:"{timeInMs, number, seconds} s"},lj=nj.createMessageInstanceIdFn("node_modules/lighthouse-plugin-publisher-ads/audits/ad-request-from-page-start.js",cj);rj.exports=class AdRequestFromPageStart extends sj{static get meta(){return{id:"ad-request-from-page-start",title:lj(cj.title),failureTitle:lj(cj.failureTitle),description:lj(cj.description),scoreDisplayMode:sj.SCORING_MODES.NUMERIC,requiredArtifacts:["devtoolsLogs","traces"]}}static get defaultOptions(){return{simulate:{
|
1146
|
+
p10:6500,median:1e4},provided:{p10:1900,median:3500}}}static async audit(e,t){const r={trace:e.traces[sj.DEFAULT_PASS],devtoolsLog:e.devtoolsLogs[sj.DEFAULT_PASS],settings:t.settings},a=t.options["provided"==t.settings.throttlingMethod?"provided":"simulate"],{timing:n}=await aj.request(r,t);if(!(n>0)){const e=ij.NoAds;return e.runWarnings=[oj.NoAds],e}return{numericValue:n,numericUnit:"millisecond",score:sj.computeLogNormalScore(a,n),displayValue:lj(cj.displayValue,{timeInMs:n})}}},rj.exports.UIStrings=cj;var uj={exports:{}};const dj=oi,{auditNotApplicable:mj}=MO.exports,{Audit:pj}=JF,{isAdIframe:hj}=dF,gj={title:"No ad found at the very top of the viewport",failureTitle:"Move the top ad further down the page",
|
1147
|
+
description:"Over 10% of ads are never viewed because users scroll past them before they become viewable. By moving ad slots away from the very top of the viewport, users are more likely to see ads before scrolling away. [Learn more](https://developers.google.com/publisher-ads-audits/reference/audits/ad-top-of-viewport).",failureDisplayValue:"A scroll of {valueInPx, number} px would hide half of your topmost ad",columnSlot:"Top Slot ID"},fj=dj.createMessageInstanceIdFn("node_modules/lighthouse-plugin-publisher-ads/audits/ad-top-of-viewport.js",gj),yj=[{key:"slot",itemType:"text",text:fj(gj.columnSlot)}];class AdTopOfViewport extends pj{static get meta(){return{id:"ad-top-of-viewport",title:fj(gj.title),failureTitle:fj(gj.failureTitle),description:fj(gj.description),requiredArtifacts:["ViewportDimensions","IFrameElements"]}}static audit(e){const t=e.ViewportDimensions,r=e.IFrameElements.filter(hj).filter((e=>e.clientRect.width*e.clientRect.height>1&&!e.isPositionFixed)).map((e=>({
|
1148
|
+
midpoint:e.clientRect.top+e.clientRect.height/2,id:e.id})));if(!r.length)return mj.NoVisibleSlots;const a=r.reduce(((e,t)=>e.midpoint<t.midpoint?e:t)),n=a.midpoint<t.innerHeight;if(!n)return mj.NoAdsViewport;const i=n&&a.midpoint<100?0:1;return{score:i,numericValue:a.midpoint,numericUnit:"unitless",displayValue:i?"":fj(gj.failureDisplayValue,{valueInPx:a.midpoint}),details:AdTopOfViewport.makeTableDetails(yj,i?[]:[{slot:a.id}])}}}uj.exports=AdTopOfViewport,uj.exports.UIStrings=gj;var vj={exports:{}};function isBoxInViewport$1(e,t){const{innerWidth:r,innerHeight:a}=t,{left:n,top:i,right:o,bottom:s}=e;return n<o&&i<s&&n<r&&i<a&&0<o&&0<s}var bj={boxViewableArea:function boxViewableArea(e,t){if(!isBoxInViewport$1(e,t))return 0;const{innerWidth:r,innerHeight:a}=t,{left:n,top:i,right:o,bottom:s}=e;return(Math.min(o,r)-Math.max(n,0))*(Math.min(s,a)-Math.max(i,0))},isBoxInViewport:isBoxInViewport$1,overlaps:function overlaps$1(e,t){
|
1149
|
+
const r=!(e.right<t.left||t.right<e.left),a=!(e.bottom<t.top||t.bottom<e.top);return r&&a},toClientRect:function toClientRect$1([e,t,r,a]){return{left:e,top:t,width:r,height:a,right:e+r,bottom:t+a}}};const{auditNotApplicable:wj}=MO.exports,{Audit:Sj}=JF,Tj=oi,{isBoxInViewport:Ej}=bj,{isGptIframe:xj}=dF,_j={title:"Few or no ads loaded outside viewport",failureTitle:"Avoid loading ads until they are nearly on-screen",description:"Too many ads loaded outside the viewport lowers viewability rates and impacts user experience. Consider loading ads below the fold lazily as the user scrolls down. Consider using GPT's [Lazy Loading API](https://developers.google.com/doubleclick-gpt/reference#googletag.PubAdsService_enableLazyLoad). [Learn more](https://developers.google.com/publisher-ads-audits/reference/audits/ads-in-viewport).",failureDisplayValue:"{hiddenAds, plural, =1 {1 ad} other {# ads}} out of view",columnSlot:"Slots Outside Viewport"
|
1150
|
+
},Aj=Tj.createMessageInstanceIdFn("node_modules/lighthouse-plugin-publisher-ads/audits/ads-in-viewport.js",_j),Rj=[{key:"slot",itemType:"text",text:Aj(_j.columnSlot)}];class AdsInViewport extends Sj{static get meta(){return{id:"ads-in-viewport",title:Aj(_j.title),failureTitle:Aj(_j.failureTitle),description:Aj(_j.description),requiredArtifacts:["ViewportDimensions","IFrameElements"]}}static audit(e){const t=e.ViewportDimensions,r=e.IFrameElements.filter((e=>xj(e)&&e.clientRect.height*e.clientRect.width>1));if(!r.length)return wj.NoVisibleSlots;const a=r.filter((e=>!Ej(e.clientRect,t))).map((e=>({slot:e.id}))).sort(((e,t)=>e.slot.localeCompare(t.slot)));return{numericValue:(r.length-a.length)/r.length,numericUnit:"unitless",score:a.length>3?0:1,displayValue:a.length?Aj(_j.failureDisplayValue,{hiddenAds:a.length}):"",details:AdsInViewport.makeTableDetails(Rj,a)}}}vj.exports=AdsInViewport,vj.exports.UIStrings=_j;var kj={exports:{}};var Dj={count:function count(e,t){let r=0
|
1151
|
+
;for(const a of e)t(a)&&r++;return r},bucket:function bucket$1(e,t){const r=new Map;for(const a of e){const e=t(a);if(null!=e){const t=r.get(e)||[];t.push(a),r.set(e,t)}}return r},flatten:function flatten(e){const t=[];for(const r of e)t.push(...r);return t}};const Cj=Dj,Ij=oi,Nj=HT,Lj=Lo,{auditNotApplicable:Mj}=MO.exports,{Audit:Pj}=JF,{isAdTag:Oj,isStaticRequest:Fj}=dF,{URL:Uj}=Gn,jj={title:"Ad tag is loaded asynchronously",failureTitle:"Load ad tag asynchronously",description:"Loading the ad tag synchronously blocks content rendering until the tag is fetched and loaded. Consider using the `async` attribute to load gpt.js and/or adsbygoogle.js asynchronously. [Learn more](https://developers.google.com/publisher-ads-audits/reference/audits/async-ad-tags)."},Bj=Ij.createMessageInstanceIdFn("node_modules/lighthouse-plugin-publisher-ads/audits/async-ad-tags.js",jj);function isAsync(e){return"Low"==e.priority||Fj(e)}kj.exports=class AsyncAdTags extends Pj{static get meta(){return{
|
1152
|
+
id:"async-ad-tags",title:Bj(jj.title),failureTitle:Bj(jj.failureTitle),description:Bj(jj.description),requiredArtifacts:["devtoolsLogs","URL"]}}static async audit(e,t){const r=e.devtoolsLogs[Pj.DEFAULT_PASS],a=await Lj.request(r,t),n=await Nj.request({URL:e.URL,devtoolsLog:r},t),i=a.filter((e=>Oj(new Uj(e.url)))).filter((e=>e.frameId===n.frameId));if(!i.length)return Mj.NoTag;const o=Cj.count(i,isAsync)-i.length;return{score:Number(0===o),numericValue:o,numericUnit:"unitless"}}},kj.exports.UIStrings=jj;var $j={exports:{}};const qj=on.default,zj=Ao,Vj=Yp,Wj=Xp;qj.warn("trace-of-tab","trace-of-tab is deprecated, use processed-trace / processed-navigation instead");var Gj=zj(class TraceOfTab$1{static async compute_(e,t){const r=await Vj.request(e,t),a=await Wj.request(r,t);return{...r,...a}}},null);const Hj=oi,Yj=Lo,Kj=Gj,{auditNotApplicable:Jj}=MO.exports,{Audit:Xj}=JF,{computeAdRequestWaterfall:Zj}=LU,{getTimingsByRecord:Qj}=IF,eB={title:"Ads not blocked by load events",
|
1153
|
+
failureTitle:"Avoid waiting on load events",description:"Waiting on load events increases ad latency. To speed up ads, eliminate the following load event handlers. [Learn More](https://developers.google.com/publisher-ads-audits/reference/audits/blocking-load-events).",displayValue:"{timeInMs, number, seconds} s blocked",columnEvent:"Event Name",columnTime:"Event Time",columnScript:"Script",columnBlockedUrl:"Blocked URL",columnFunctionName:"Function"},tB=Hj.createMessageInstanceIdFn("node_modules/lighthouse-plugin-publisher-ads/audits/blocking-load-events.js",eB),rB=[{key:"eventName",itemType:"text",text:tB(eB.columnEvent)},{key:"time",itemType:"ms",text:tB(eB.columnTime),granularity:1},{key:"url",itemType:"url",text:tB(eB.columnScript)},{key:"functionName",itemType:"text",text:tB(eB.columnFunctionName)}];function findOriginalCallFrame(e){const{record:t}=e;let r=t&&t.initiator&&t.initiator.stack;if(r){for(;r.parent;)r=r.parent;return r.callFrames[r.callFrames.length-1]}}
|
1154
|
+
function findTraceEventOfCallFrame(e,t){return t.find((t=>"FunctionCall"==t.name&&t.args.data&&t.args.data.functionName==e.functionName&&t.args.data.scriptId==e.scriptId&&t.args.data.url==e.url&&Math.abs(t.args.data.lineNumber==e.lineNumber)<2&&Math.abs(t.args.data.columnNumber==e.columnNumber)<2))}function findEventIntervals(e,t){let r={};const a=[];for(const n of t)n.name==`${e}EventStart`?r={start:n.ts,end:1/0,eventName:e}:n.name==`${e}EventEnd`&&(r.end=n.ts,a.push(r));return a}function quantifyBlockedTime(e,t,r){const a=t.find((t=>t.url==e.url)),n=t.find((t=>t.url==e.blockedUrl));if(!a||!n)return 0;const i=r.get(a),o=r.get(n);return i&&o?o.startTime-i.endTime:0}class BlockingLoadEvents extends Xj{static get meta(){return{id:"blocking-load-events",title:tB(eB.title),failureTitle:tB(eB.failureTitle),description:tB(eB.description),requiredArtifacts:["devtoolsLogs","traces"]}}static async audit(e,t){
|
1155
|
+
const r=e.traces[Xj.DEFAULT_PASS],a=e.devtoolsLogs[Xj.DEFAULT_PASS],n=await Yj.request(a,t),{timings:i,processEvents:o}=await Kj.request(r,t),s=await Qj(r,a,t),c=(await Zj(r,a,t)).sort(((e,t)=>e.startTime-t.startTime));if(!c.length)return Jj.NoAdRelatedReq;const l=[...findEventIntervals("domContentLoaded",o),...findEventIntervals("load",o)],u=[],d=new Set;for(const e of c){const t=findOriginalCallFrame(e);if(!t)continue;const r=JSON.stringify(t);if(d.has(r))continue;d.add(r);const a=findTraceEventOfCallFrame(t,o);if(!a)continue;const c=l.find((e=>e.start<=a.ts&&a.ts<=e.end));if(c){const r=Object.assign({eventName:c.eventName,blockedUrl:e.url,time:i[c.eventName],blockedTime:1/0},t);r.blockedTime=quantifyBlockedTime(r,n,s),u.push(r)}}const m=u.length>0;let p=0;return m&&(p=Math.min(...u.map((e=>e.blockedTime)))),{numericValue:u.length,numericUnit:"unitless",score:m?0:1,displayValue:m&&p?tB(eB.displayValue,{timeInMs:p}):"",details:BlockingLoadEvents.makeTableDetails(rB,u)}}}
|
1156
|
+
$j.exports=BlockingLoadEvents,$j.exports.UIStrings=eB;var aB={exports:{}};const nB=oi,{auditNotApplicable:iB}=MO.exports,{Audit:oB}=JF,{computeAdRequestWaterfall:sB}=LU,{isAdScript:cB,toURL:lB}=dF,uB={title:"No bottleneck requests found",failureTitle:"Avoid bottleneck requests",description:"Speed up, load earlier, parallelize, or eliminate the following requests and their dependencies in order to speed up ad loading. [Learn More](https://developers.google.com/publisher-ads-audits/reference/audits/bottleneck-requests).",displayValue:"{blockedTime, number, seconds} s spent blocked on requests",columnUrl:"Blocking Request",columnInitiatorUrl:"Initiator Request",columnStartTime:"Start",columnSelfTime:"Exclusive Time",columnDuration:"Total Time"},dB=nB.createMessageInstanceIdFn("node_modules/lighthouse-plugin-publisher-ads/audits/bottleneck-requests.js",uB),mB=[{key:"url",itemType:"url",text:dB(uB.columnUrl)},{key:"selfTime",itemType:"ms",text:dB(uB.columnSelfTime),granularity:1},{
|
1157
|
+
key:"duration",itemType:"ms",text:dB(uB.columnDuration),granularity:1}];class BottleneckRequests extends oB{static get meta(){return{id:"bottleneck-requests",title:dB(uB.title),failureTitle:dB(uB.failureTitle),description:dB(uB.description),requiredArtifacts:["devtoolsLogs","traces"]}}static async audit(e,t){const r=e.traces[oB.DEFAULT_PASS],a=e.devtoolsLogs[oB.DEFAULT_PASS],n=(await sB(r,a,t)).filter((e=>e.startTime>0));if(!n.length)return iB.NoAdRelatedReq;const cost=e=>3*e.selfTime+e.duration,i=n.filter((e=>!cB(lB(e.url))&&(e.selfTime>250||e.duration>1e3))).sort(((e,t)=>cost(t)-cost(e))).slice(0,5),o=i.reduce(((e,t)=>e+t.selfTime),0)/1e3,s=1e3*o>1e3;for(const e of i)delete e.record;return{numericValue:i.length,numericUnit:"unitless",score:s?0:1,displayValue:s?dB(uB.displayValue,{blockedTime:o}):"",details:BottleneckRequests.makeTableDetails(mB,i)}}}aB.exports=BottleneckRequests,aB.exports.UIStrings=uB;var pB={exports:{}}
|
1158
|
+
;const hB=oi,gB=HT,fB=Lo,yB=Ki,{auditNotApplicable:vB}=MO.exports,{Audit:bB}=JF,{containsAnySubstring:wB}=dF,{URL:SB}=Gn,TB={title:"No duplicate tags found",failureTitle:"Load tags only once",description:"Loading a tag more than once in the same page is redundant and adds overhead without benefit. [Learn more](https://developers.google.com/publisher-ads-audits/reference/audits/duplicate-tags).",failureDisplayValue:"{duplicateTags, plural, =1 {1 duplicate tag} other {# duplicate tags}}",columnScript:"Script",columnNumReqs:"Duplicate Requests",columnFrameId:"Frame ID"},EB=hB.createMessageInstanceIdFn("node_modules/lighthouse-plugin-publisher-ads/audits/duplicate-tags.js",TB),xB=["googletagservices.com/tag/js/gpt.js","securepubads.g.doubleclick.net/tag/js/gpt.js","pagead2.googlesyndication.com/pagead/js/adsbygoogle.js","pagead2.googlesyndication.com/pagead/js/show_ads.js","cdn.ampproject.org/v0/amp-ad-0.1.js"],_B=[{key:"script",itemType:"url",text:EB(TB.columnScript)},{key:"numReqs",
|
1159
|
+
itemType:"text",text:EB(TB.columnNumReqs)}];class DuplicateTags extends bB{static get meta(){return{id:"duplicate-tags",title:EB(TB.title),failureTitle:EB(TB.failureTitle),description:EB(TB.description),requiredArtifacts:["devtoolsLogs","URL"]}}static async audit(e,t){const r=e.devtoolsLogs[bB.DEFAULT_PASS],a=await fB.request(r,t),n=await gB.request({URL:e.URL,devtoolsLog:r},t),i=a.filter((e=>e.frameId===n.frameId)).filter((e=>wB(e.url,xB))).filter((e=>e.resourceType===yB.TYPES.Script));if(!i.length)return vB.NoTags;const o=new Map;for(const e of i){const t=new SB(e.url).pathname,r=o.get(t)||0;o.set(t,r+1)}const s=[];for(const[e,t]of o)t>1&&s.push({script:e,numReqs:t});return{numericValue:s.length,numericUnit:"unitless",score:s.length?0:1,details:DuplicateTags.makeTableDetails(_B,s),displayValue:s.length?EB(TB.failureDisplayValue,{duplicateTags:s.length}):""}}}pB.exports=DuplicateTags,pB.exports.UIStrings=TB;var AB={exports:{}}
|
1160
|
+
;const RB=SF,kB=Ew,DB=Ao,{getPageStartTime:CB,getImpressionStartTime:IB}=IF,{isImpressionPing:NB}=dF;class LanternAdRenderTime extends RB{static getEstimateFromSimulation(e,t){const{nodeTimings:r}=e;return{timeInMs:RB.findNetworkTiming(r,(e=>!!e.url&&NB(new URL(e.url)))).startTime,nodeTimings:r}}}LanternAdRenderTime=DB(LanternAdRenderTime);class AdRenderTime extends kB{static async computeSimulatedMetric(e,t){return LanternAdRenderTime.request(e,t)}static async computeObservedMetric(e,t){const{networkRecords:r}=e,a=CB(r),n=1e3*(IB(r)-a);return Promise.resolve({timing:n})}static async request(e,t){throw Error("Not implemented -- class not decorated")}}const LB=AdRenderTime=DB(AdRenderTime),MB=oi,{auditNotApplicable:PB,runWarning:OB}=MO.exports,{Audit:FB}=JF,UB={title:"Latency of first ad render",failureTitle:"Reduce time to render first ad",
|
1161
|
+
description:"This metric measures the time for the first ad iframe to render from page navigation. [Learn more](https://developers.google.com/publisher-ads-audits/reference/audits/first-ad-render).",displayValue:"{timeInMs, number, seconds} s"},jB=MB.createMessageInstanceIdFn("node_modules/lighthouse-plugin-publisher-ads/audits/first-ad-render.js",UB);AB.exports=class FirstAdRender extends FB{static get meta(){return{id:"first-ad-render",title:jB(UB.title),failureTitle:jB(UB.failureTitle),description:jB(UB.description),scoreDisplayMode:FB.SCORING_MODES.NUMERIC,requiredArtifacts:["devtoolsLogs","traces"]}}static get defaultOptions(){return{simulate:{p10:12900,median:22e3},provided:{p10:2750,median:3700}}}static async audit(e,t){const r=e.traces[FB.DEFAULT_PASS],a={devtoolsLog:e.devtoolsLogs[FB.DEFAULT_PASS],trace:r,settings:t.settings},{timing:n}=await LB.request(a,t);if(!(n>0)){const e=PB.NoAdRendered;return e.runWarnings=[OB.NoAdRendered],e}
|
1162
|
+
const i=t.options["provided"==t.settings.throttlingMethod?"provided":"simulate"];return{numericValue:n,numericUnit:"millisecond",score:FB.computeLogNormalScore(i,n),displayValue:jB(UB.displayValue,{timeInMs:n})}}},AB.exports.UIStrings=UB;var BB={exports:{}};const $B=oi,qB=Lo,{auditNotApplicable:zB}=MO.exports,{Audit:VB}=JF,{isAdRequest:WB}=dF,{URL:GB}=Gn,HB={title:"Ad slots effectively use horizontal space",failureTitle:"Increase the width of ad slots",description:"Ad slots that utilize most of the page width generally experience increased click-through rate over smaller ad sizes. We recommend leaving no more than 25% of the viewport width unutilized on mobile devices.",failureDisplayValue:"{percentUnused, number, percent} of viewport width is underutilized"},YB=$B.createMessageInstanceIdFn("node_modules/lighthouse-plugin-publisher-ads/audits/full-width-slots.js",HB);BB.exports=class FullWidthSlots extends VB{static get meta(){return{id:"full-width-slots",title:YB(HB.title),
|
1163
|
+
failureTitle:YB(HB.failureTitle),description:YB(HB.description),requiredArtifacts:["ViewportDimensions","devtoolsLogs"]}}static async audit(e,t){const r=e.devtoolsLogs[VB.DEFAULT_PASS],a=await qB.request(r,t),n=e.ViewportDimensions.innerWidth,i=a.filter(WB).map((e=>new GB(e.url)));if(!i.length)return zB.NoAds;const o=i.map((e=>e.searchParams.get("prev_iu_szs")||e.searchParams.get("sz"))).join("|").split(/[|,]/).map((e=>parseInt(e.split("x")[0]))).filter((e=>e<=n&&e>1));if(!o.length)return zB.NoValidAdWidths;const s=1-Math.max(...o)/n,c=s>.25?0:1;return{score:c,numericValue:s,numericUnit:"unitless",displayValue:c?"":YB(HB.failureDisplayValue,{percentUnused:s})}}},BB.exports.UIStrings=HB;var KB={exports:{}};const JB=Lo,{assert:XB}=wU,{auditNotApplicable:ZB}=MO.exports,{Audit:QB}=JF,{getCriticalGraph:e$}=LU,{getTimingsByRecord:t$}=IF,{isGptImplTag:r$,isBidRequest:a$,getHeaderBidder:n$}=dF,i$={title:"GPT and bids loaded in parallel",failureTitle:"Load GPT and bids in parallel",
|
1164
|
+
description:"To optimize ad loading, bid requests should not wait on GPT to load. This issue can often be fixed by making sure that bid requests do not wait on `googletag.pubadsReady` or `googletag.cmd.push`. [Learn More](https://developers.google.com/publisher-ads-audits/reference/audits/gpt-bids-parallel).",columnBidder:"Bidder",columnUrl:"URL",columnStartTime:"Start",columnDuration:"Duration"},o$=[{key:"bidder",itemType:"text",text:i$.columnBidder},{key:"url",itemType:"url",text:i$.columnUrl},{key:"startTime",itemType:"ms",text:i$.columnStartTime},{key:"duration",itemType:"ms",text:i$.columnDuration}];class GptBidsInParallel extends QB{static get meta(){return{id:"gpt-bids-parallel",title:i$.title,failureTitle:i$.failureTitle,description:i$.description,requiredArtifacts:["devtoolsLogs","traces"]}}static async audit(e,t){const r=e.devtoolsLogs[QB.DEFAULT_PASS],a=e.traces[QB.DEFAULT_PASS],n=await JB.request(r,t),i=n.find((e=>r$(e.url)));if(!i)return ZB.NoGpt
|
1165
|
+
;const o=n.filter(a$).filter((e=>e.frameId==i.frameId));if(!o.length)return ZB.NoBids;const s=await t$(a,r,t),c=[],l=new Set;for(const e of o)if(e$(n,a.traceEvents,e).has(i)){const{startTime:t,endTime:r}=s.get(e)||e,a=XB(n$(e.url));if(l.has(a))continue;l.add(a),c.push({bidder:a,url:e.url,startTime:t,duration:r-t})}const u=c.length>0;return{numericValue:c.length,numericUnit:"unitless",score:u?0:1,details:u?GptBidsInParallel.makeTableDetails(o$,c):void 0}}}KB.exports=GptBidsInParallel,KB.exports.UIStrings=i$;var s$={exports:{}};const c$=oi,l$=Lo,{auditNotApplicable:u$}=MO.exports,{Audit:d$}=JF,{isGptTag:m$}=dF,{URL:p$}=Gn,h$={title:"GPT tag is loaded from an official source",failureTitle:"Load GPT from an official source",description:"Load GPT from 'securepubads.g.doubleclick.net' for standard integrations or from 'pagead2.googlesyndication.com' for limited ads. [Learn more](https://developers.google.com/publisher-ads-audits/reference/audits/loads-gpt-from-official-source)."
|
1166
|
+
},g$=c$.createMessageInstanceIdFn("node_modules/lighthouse-plugin-publisher-ads/audits/loads-gpt-from-official-source.js",h$);s$.exports=class LoadsGptFromOfficalSource extends d${static get meta(){return{id:"loads-gpt-from-official-source",title:g$(h$.title),failureTitle:g$(h$.failureTitle),description:g$(h$.description),requiredArtifacts:["devtoolsLogs"]}}static async audit(e,t){const r=e.devtoolsLogs[d$.DEFAULT_PASS],a=(await l$.request(r,t)).map((e=>new p$(e.url))).find(m$);if(!a)return u$.NoGpt;const n=["securepubads.g.doubleclick.net","pagead2.googlesyndication.com"].includes(a.host);return{score:Number(n),numericValue:Number(!n),numericUnit:"unitless"}}},s$.exports.UIStrings=h$;var f$={exports:{}};const y$=oi,v$=Lo,{auditNotApplicable:b$}=MO.exports,{Audit:w$}=JF,{isAdTag:S$}=dF,{URL:T$}=Gn,E$={title:"Ad tag is loaded over HTTPS",failureTitle:"Load ad tag over HTTPS",
|
1167
|
+
description:'For privacy and security, always load GPT/AdSense over HTTPS. Insecure pages should explicitly request the ad script securely. GPT Example: `<script async src="https://securepubads.g.doubleclick.net/tag/js/gpt.js">` AdSense Example: `<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js">`. [Learn more](https://developers.google.com/publisher-ads-audits/reference/audits/loads-ad-tag-over-https).'},x$=y$.createMessageInstanceIdFn("node_modules/lighthouse-plugin-publisher-ads/audits/loads-ad-tag-over-https.js",E$);f$.exports=class LoadsAdTagOverHttps extends w${static get meta(){return{id:"loads-ad-tag-over-https",title:x$(E$.title),failureTitle:x$(E$.failureTitle),description:x$(E$.description),requiredArtifacts:["devtoolsLogs"]}}static async audit(e,t){const r=e.devtoolsLogs[w$.DEFAULT_PASS],a=await v$.request(r,t);if(!a.find((e=>200==e.statusCode)))return b$.NoRecords;const n=a.filter((e=>S$(new T$(e.url)))),i=n.filter((e=>e.isSecure)),o={
|
1168
|
+
type:"debugdata",numAdTagHttpReqs:n.length-i.length,numAdTagHttpsReqs:i.length};if(!n.length){const e=b$.NoTag;return e.details=o,e}return{numericValue:o.numAdTagHttpReqs,score:o.numAdTagHttpReqs?0:1,details:o}}},f$.exports.UIStrings=E$;var _$={exports:{}};const A$=Dj,R$=oi,k$=eb,{auditNotApplicable:D$}=MO.exports,{Audit:C$}=JF,{computeAdRequestWaterfall:I$}=LU,{getScriptEvaluationTimes:N$}=IF,L$={title:"Ad scripts are loaded statically",failureTitle:"Load ad scripts statically",description:"Load the following scripts directly with `<script async src=...>` instead of injecting scripts with JavaScript. Doing so allows the browser to preload scripts sooner. [Learn more](https://developers.google.com/publisher-ads-audits/reference/audits/script-injected-tags).",failureDisplayValue:"Load {tags, plural, =1 {1 script} other {# scripts}} statically",columnUrl:"Script",columnLoadTime:"Load Time"
|
1169
|
+
},M$=R$.createMessageInstanceIdFn("node_modules/lighthouse-plugin-publisher-ads/audits/script-injected-tags.js",L$),P$=[{key:"url",itemType:"url",text:M$(L$.columnUrl)},{key:"loadTime",itemType:"ms",granularity:1,text:M$(L$.columnLoadTime)}],O$=[/amazon-adsystem\.com\/aax2\/apstag.js/,/js-sec\.indexww\.com\/ht\/p\/.*\.js/,/pubads\.g\.doubleclick\.net\/tag\/js\/gpt\.js/,/static\.criteo\.net\/js\/.*\/publishertag\.js/,/www\.googletagservices\.com\/tag\/js\/gpt\.js/,/pagead2\.googlesyndication\.com\/pagead\/js\/adsbygoogle\.js/,/cdn\.ampproject\.org\/v0\/amp-ad-\d+\.\d+\.js/];function initiatedByInlineScript(e){if("script"!==e.initiator.type)return!1;const t=k$.getNetworkInitiators(e);return 1===t.length&&t[0]===e.documentURL}class StaticAdTags extends C${static get meta(){return{id:"script-injected-tags",title:M$(L$.title),failureTitle:M$(L$.failureTitle),description:M$(L$.description),requiredArtifacts:["devtoolsLogs","traces"]}}static async audit(e,t){
|
1170
|
+
const r=await async function findStaticallyLoadableTags(e,t){const r=e.devtoolsLogs[C$.DEFAULT_PASS],a=e.traces[C$.DEFAULT_PASS],n=[],i=await I$(a,r,t);for(const{record:e}of i)e&&"Script"===e.resourceType&&(initiatedByInlineScript(e)||O$.find((t=>e.url.match(t))))&&n.push(e);return n}(e,t);if(!r.length)return D$.NoTag;const a=new Set,n=[],i=e.devtoolsLogs[C$.DEFAULT_PASS],o=e.traces[C$.DEFAULT_PASS],s=await N$(o,i,t);for(const e of r){if(a.has(e.url))continue;a.add(e.url);const t=r.filter((t=>t.url===e.url));if(0===A$.count(t,(e=>"parser"===e.initiator.type&&!e.isLinkPreload))){const t=s.get(e.url)||0;if(t<400)continue;n.push({url:e.url,loadTime:t})}}n.sort(((e,t)=>e.loadTime-t.loadTime));const c=n.length>0;return{displayValue:c?M$(L$.failureDisplayValue,{tags:n.length}):"",score:Number(!c),numericValue:n.length,numericUnit:"unitless",details:StaticAdTags.makeTableDetails(P$,n)}}}_$.exports=StaticAdTags,_$.exports.UIStrings=L$;var F$={exports:{}}
|
1171
|
+
;const U$=UF,j$=oi,B$=HT,$$=Lo,{auditNotApplicable:q$}=MO.exports,{Audit:z$}=JF,{bucket:V$}=Dj,{getTimingsByRecord:W$}=IF,{isCacheable:G$}=oF,{isGoogleAds:H$,getHeaderBidder:Y$}=dF,{URL:K$}=Gn,J$={title:"Header bidding is parallelized",failureTitle:"Parallelize bid requests",description:"Send header bidding requests simultaneously, rather than serially, to retrieve bids more quickly. [Learn more](https://developers.google.com/publisher-ads-audits/reference/audits/serial-header-bidding).",columnBidder:"Bidder",columnUrl:"URL",columnStartTime:"Start",columnDuration:"Duration"},X$=j$.createMessageInstanceIdFn("node_modules/lighthouse-plugin-publisher-ads/audits/serial-header-bidding.js",J$),Z$=[{key:"bidder",itemType:"text",text:X$(J$.columnBidder)},{key:"url",itemType:"url",text:X$(J$.columnUrl)},{key:"startTime",itemType:"ms",text:X$(J$.columnStartTime)},{key:"duration",itemType:"ms",text:X$(J$.columnDuration)}],Q$="ad",tq="bid",rq="unknown";function checkRecordType(e){
|
1172
|
+
return H$(new K$(e.url))?Q$:Y$(e.url)?tq:rq}function isPossibleBid(e){return(null==e.resourceSize||e.resourceSize>0)&&"Image"!=e.resourceType&&e.endTime-e.startTime>=.05&&!G$(e)}function clearQueryString(e){const t=new K$(e);return t.search="",t.toString()}class SerialHeaderBidding extends z${static get meta(){return{id:"serial-header-bidding",title:X$(J$.title),failureTitle:X$(J$.failureTitle),description:X$(J$.description),requiredArtifacts:["devtoolsLogs","traces","URL"]}}static async audit(e,t){const r=e.devtoolsLogs[z$.DEFAULT_PASS],a=e.traces[z$.DEFAULT_PASS],n=await $$.request(r,t);if(!n.length)return q$.NoRecords;const i=await B$.request({URL:e.URL,devtoolsLog:r},t),o=n.filter(isPossibleBid).filter((e=>e.frameId==i.frameId)),s=V$(o,checkRecordType);if(!s.has(tq))return q$.NoBids;const c={trace:a,devtoolsLog:r,settings:t.settings},{timing:l}=await U$.request(c,t),u=await W$(a,r,t),d=function constructRecords(e,t,r){const a=[];for(const n of e){const e=r.get(n)
|
1173
|
+
;e&&a.push(Object.assign({},e,{url:n.url,type:t}))}return a}(s.get(tq)||[],tq,u);let m,p=[];for(const e of d)l>0&&e.endTime>l||(e.bidder=Y$(e.url),e.url=clearQueryString(e.url),m&&e.startTime>=m.endTime&&(p.push(m),p.push(e)),(!m||e.endTime<m.endTime||e.startTime>=m.endTime)&&(m=e));p=Array.from(new Set(p));const h=p.length>1;return{numericValue:Number(h),numericUnit:"unitless",score:h?0:1,details:h?SerialHeaderBidding.makeTableDetails(Z$,p):void 0}}}F$.exports=SerialHeaderBidding,F$.exports.UIStrings=J$;var aq={exports:{}};const nq=SF,iq=Ew,oq=Ao,{getPageStartTime:sq,getTagEndTime:cq}=IF,{isImplTag:lq}=dF,{URL:uq}=Gn;class LanternTagLoadTime extends nq{static getEstimateFromSimulation(e,t){const{nodeTimings:r}=e;return{timeInMs:nq.findNetworkTiming(r,(e=>!!e.url&&lq(new uq(e.url)))).endTime,nodeTimings:r}}}LanternTagLoadTime=oq(LanternTagLoadTime);class TagLoadTime$1 extends iq{static async computeSimulatedMetric(e,t){return LanternTagLoadTime.request(e,t)}
|
1174
|
+
static async computeObservedMetric(e,t){const{networkRecords:r}=e,a=sq(r),n=1e3*(cq(r)-a);return Promise.resolve({timing:n})}static async request(e,t){throw Error("Not implemented -- class not decorated")}}const dq=TagLoadTime$1=oq(TagLoadTime$1),mq=oi,{auditNotApplicable:pq,runWarning:hq}=MO.exports,{Audit:gq}=JF,fq={title:"Tag load time",failureTitle:"Reduce tag load time",description:"This metric measures the time for the ad tag's implementation script (pubads_impl.js for GPT; adsbygoogle.js for AdSense) to load after the page loads. [Learn more](https://developers.google.com/publisher-ads-audits/reference/audits/tag-load-time).",displayValue:"{timeInMs, number, seconds} s"},yq=mq.createMessageInstanceIdFn("node_modules/lighthouse-plugin-publisher-ads/audits/tag-load-time.js",fq);aq.exports=class TagLoadTime extends gq{static get meta(){return{id:"tag-load-time",title:yq(fq.title),failureTitle:yq(fq.failureTitle),description:yq(fq.description),
|
1175
|
+
scoreDisplayMode:gq.SCORING_MODES.NUMERIC,requiredArtifacts:["devtoolsLogs","traces"]}}static get defaultOptions(){return{simulate:{p10:4350,median:8e3},provided:{p10:1200,median:2e3}}}static async audit(e,t){const r={trace:e.traces[gq.DEFAULT_PASS],devtoolsLog:e.devtoolsLogs[gq.DEFAULT_PASS],settings:t.settings},a=t.options["provided"==t.settings.throttlingMethod?"provided":"simulate"],{timing:n}=await dq.request(r,t);if(!(n>0)){const e=pq.NoTag;return e.runWarnings=[hq.NoTag],e}return{numericValue:n,numericUnit:"millisecond",score:gq.computeLogNormalScore(a,n),displayValue:yq(fq.displayValue,{timeInMs:n})}}},aq.exports.UIStrings=fq;var vq={exports:{}};const bq=oi,{auditNotApplicable:wq,auditError:Sq}=MO.exports,{Audit:Tq}=JF,{isAdIframe:Eq}=dF,xq={title:"Ads to page-height ratio is within recommended range",failureTitle:"Reduce ads to page-height ratio",
|
1176
|
+
description:"The ads to page-height ratio can impact user experience and ultimately user retention. [Learn more](https://developers.google.com/publisher-ads-audits/reference/audits/viewport-ad-density).",displayValue:"{adDensity, number, percent} ads to page-height ratio"},_q=bq.createMessageInstanceIdFn("node_modules/lighthouse-plugin-publisher-ads/audits/viewport-ad-density.js",xq);vq.exports=class ViewportAdDensity extends Tq{static get meta(){return{id:"viewport-ad-density",title:_q(xq.title),failureTitle:_q(xq.failureTitle),description:_q(xq.description),requiredArtifacts:["ViewportDimensions","IFrameElements"]}}static audit(e){const t=e.ViewportDimensions,r=e.IFrameElements.filter((e=>Eq(e)&&e.clientRect.width*e.clientRect.height>1));if(!r.length)return wq.NoVisibleSlots;if(t.innerHeight<=0)throw new Error(Sq.ViewportAreaZero);const a=function computeAdLength(e,t){
|
1177
|
+
const r=new Set([...e.map((e=>e.clientRect.left)),...e.map((e=>e.clientRect.right))].map((e=>Math.min(Math.max(1,e),t.innerWidth-1))));e=e.sort(((e,t)=>e.clientRect.top!==t.clientRect.top?e.clientRect.top-t.clientRect.top:e.clientRect.bottom-t.clientRect.bottom));let a=0;for(const t of r){let r=0,n=0;for(const a of e){if(t<a.clientRect.left||t>a.clientRect.right)continue;if(a.isPositionFixed){r+=a.clientRect.height;continue}const e=a.clientRect.bottom-Math.max(n,a.clientRect.top);e>0&&(r+=e),n=Math.max(n,a.clientRect.bottom)}a=Math.max(a,r)}return a}(r,t),n=Math.max(...r.map((e=>e.clientRect.top+e.clientRect.height/2)))+t.innerHeight,i=Math.min(1,a/n);return{score:i>.3?0:1,numericValue:i,numericUnit:"unitless",displayValue:_q(xq.displayValue,{adDensity:i})}}},vq.exports.UIStrings=xq;var Aq={exports:{}};const Rq=oi,{auditNotApplicable:kq}=MO.exports,{Audit:Dq}=JF,{getScriptUrl:Cq}=IF,{isAdIframe:Iq,isAdRelated:Nq,isImplTag:Lq}=dF,{overlaps:Mq,toClientRect:Pq}=bj,Oq={
|
1178
|
+
title:"Cumulative ad shift",failureTitle:"Reduce ad-related layout shift",description:"Measures layout shifts that were caused by ads or happened near ads. Reducing cumulative ad-related layout shift will improve user experience. [Learn more](https://developers.google.com/publisher-ads-audits/reference/audits/cumulative-ad-shift)."},Fq=Rq.createMessageInstanceIdFn("node_modules/lighthouse-plugin-publisher-ads/audits/cumulative-ad-shift.js",Oq);Aq.exports=class CumulativeAdShift extends Dq{static get meta(){return{id:"cumulative-ad-shift",title:Fq(Oq.title),failureTitle:Fq(Oq.failureTitle),description:Fq(Oq.description),scoreDisplayMode:Dq.SCORING_MODES.NUMERIC,requiredArtifacts:["traces","IFrameElements"]}}static get defaultOptions(){return{p10:.05,median:.25}}static isAdExpansion(e,t){if(!e.args||!e.args.data)return!1;for(const r of e.args.data.impacted_nodes||[]){const e=Pq(r.old_rect||[]),a=Pq(r.new_rect||[]);if(!(e.top>a.top||e.height!==a.height))for(const r of t){
|
1179
|
+
const t=r.clientRect;if((e.top>=t.top||a.top>=t.bottom)&&Mq(e,t))return!0}}return!1}static isAttributableToTask(e,t){if(!e.args||!e.args.data)return!1;return!!t.find((t=>t.ts<e.ts&&e.ts-t.ts<5e4))}static compute(e,t,r,a){let n=0,i=0,o=0,s=0,c=0,l=0;for(const u of e)u.args&&u.args.data&&u.args.data.is_main_frame&&(n+=u.args.data.score,i++,(this.isAdExpansion(u,r)||this.isAttributableToTask(u,t))&&(o+=u.args.data.score,s++,u.ts<a&&(c+=u.args.data.score,l++)));return{cumulativeShift:n,numShifts:i,cumulativeAdShift:o,numAdShifts:s,cumulativePreImplTagAdShift:c,numPreImplTagAdShifts:l}}static getLayoutShiftEventsByWindow(e){let t=0,r=[],a=0,n=[];for(const i of e){if("LayoutShift"!==i.name||!i.args||!i.args.data)continue;if(n.length){const e=n[0],o=n[n.length-1];(o.ts-e.ts>5e6||i.ts-o.ts>1e6)&&(a>t&&(r=n,t=a),n=[],a=0)}n.push(i);const e=i.args.data;a+=e.weighted_score_delta||e.score||0}return r.length||(r=n),r}static async audit(e,t){
|
1180
|
+
const r=e.traces[Dq.DEFAULT_PASS],a=this.getLayoutShiftEventsByWindow(r.traceEvents);if(!a.length)return kq.NoLayoutShifts;const n=r.traceEvents.filter((e=>Nq(Cq(e)||""))),i=n.find((e=>Lq(Cq(e)||"")))||{ts:1/0},o=e.IFrameElements.filter(Iq),s=this.compute(a,n,o,i.ts),c=s.cumulativeAdShift;return o.length||c?{numericValue:c,numericUnit:"unitless",score:Dq.computeLogNormalScore({p10:t.options.p10,median:t.options.median},c),displayValue:c.toLocaleString(t.settings.locale),details:s}:kq.NoAdRendered}},Aq.exports.UIStrings=Oq;var Uq={exports:{}};const jq=oi,Bq=Lo,{auditNotApplicable:$q}=MO.exports,{Audit:qq}=JF,{isGpt:zq,isGptImplTag:Vq}=dF,Wq={title:"Deprecated GPT API Usage",failureTitle:"Avoid deprecated GPT APIs",description:"Deprecated GPT API methods should be avoided to ensure your page is tagged correctly. [Learn more](https://developers.google.com/publisher-ads-audits/reference/audits/deprecated-gpt-api-usage).",
|
1181
|
+
displayValue:"{numErrors, plural, =1 {1 error} other {# errors}} found"},Gq=jq.createMessageInstanceIdFn("node_modules/lighthouse-plugin-publisher-ads/audits/deprecated-api-usage.js",Wq);Uq.exports=class DeprecatedApiUsage extends qq{static get meta(){return{id:"deprecated-gpt-api-usage",title:Gq(Wq.title),failureTitle:Gq(Wq.failureTitle),description:Gq(Wq.description),scoreDisplayMode:"informative",requiredArtifacts:["ConsoleMessages","devtoolsLogs"]}}static async audit(e,t){const r=e.devtoolsLogs[qq.DEFAULT_PASS];if(!(await Bq.request(r,t)).find((e=>Vq(e.url))))return $q.NoGpt;const a=e.ConsoleMessages.filter((e=>"warning"===e.level||"error"===e.level)).filter((e=>e.url&&zq(e.url))).filter((e=>e.text.toLowerCase().includes("deprecated")||e.text.toLowerCase().includes("discouraged"))).map((e=>({source:e.source,description:e.text,url:e.url,timestamp:e.timestamp}))).sort(((e,t)=>(e.timestamp||0)-(t.timestamp||0))),n=[{key:"url",itemType:"url",text:Gq(jq.UIStrings.columnURL)},{
|
1182
|
+
key:"description",itemType:"code",text:Gq(jq.UIStrings.columnDescription)}],i=qq.makeTableDetails(n,a),o=a.length;return{score:Number(0===o),details:i,displayValue:Gq(Wq.displayValue,{numErrors:o})}}},Uq.exports.UIStrings=Wq;var Hq={exports:{}};const Yq=oi,Kq=Lo,{auditNotApplicable:Jq}=MO.exports,{Audit:Xq}=JF,{isGpt:Zq,isGptImplTag:Qq}=dF,ez={title:"GPT Errors",failureTitle:"Fix GPT errors",description:"Fix GPT errors to ensure your page is tagged as intended. [Learn more](https://developers.google.com/publisher-ads-audits/reference/audits/gpt-errors-overall).",displayValue:"{numErrors, plural, =1 {1 error} other {# errors}} found"},tz=Yq.createMessageInstanceIdFn("node_modules/lighthouse-plugin-publisher-ads/audits/gpt-errors-overall.js",ez);Hq.exports=class GptErrorsOverall extends Xq{static get meta(){return{id:"gpt-errors-overall",title:tz(ez.title),failureTitle:tz(ez.failureTitle),description:tz(ez.description),scoreDisplayMode:"informative",
|
1183
|
+
requiredArtifacts:["ConsoleMessages","devtoolsLogs"]}}static async audit(e,t){const r=e.devtoolsLogs[Xq.DEFAULT_PASS];if(!(await Kq.request(r,t)).find((e=>Qq(e.url))))return Jq.NoGpt;const a=e.ConsoleMessages.filter((e=>"error"===e.level||"warning"===e.level)).filter((e=>e.url&&Zq(e.url))).filter((e=>!e.text.toLowerCase().includes("deprecated")&&!e.text.toLowerCase().includes("discouraged"))).map((e=>({source:e.source,description:e.text,url:e.url,timestamp:e.timestamp}))).sort(((e,t)=>(e.timestamp||0)-(t.timestamp||0))),n=[{key:"url",itemType:"url",text:tz(Yq.UIStrings.columnURL)},{key:"description",itemType:"code",text:tz(Yq.UIStrings.columnDescription)}],i=Xq.makeTableDetails(n,a),o=a.length;return{score:Number(0===o),details:i,displayValue:tz(ez.displayValue,{numErrors:o})}}},Hq.exports.UIStrings=ez;var rz={exports:{}};const az=oi,nz=KF,iz=Lo,{auditNotApplicable:oz}=MO.exports,{Audit:sz}=JF,{getAttributableUrl:cz}=jF,{isAdRelated:lz,getNameOrTld:uz}=dF,dz={
|
1184
|
+
title:"Total ad JS blocking time",failureTitle:"Reduce ad JS blocking time",description:"Ad-related scripts are blocking the main thread. [Learn more](https://developers.google.com/publisher-ads-audits/reference/audits/total-ad-blocking-time).",failureDisplayValue:"{timeInMs, number, seconds} s blocked",columnName:"Name",columnBlockingTime:"Blocking Time"},mz=az.createMessageInstanceIdFn("node_modules/lighthouse-plugin-publisher-ads/audits/total-ad-blocking-time.js",dz),pz=[{key:"name",itemType:"text",text:mz(dz.columnName)},{key:"blockingTime",itemType:"ms",text:mz(dz.columnBlockingTime),granularity:1}];class TotalAdBlockingTime extends sz{static get meta(){return{id:"total-ad-blocking-time",title:mz(dz.title),failureTitle:mz(dz.failureTitle),description:mz(dz.description),requiredArtifacts:["traces","devtoolsLogs"]}}static get defaultOptions(){return{simulate:{p10:290,median:600},provided:{p10:150,median:350}}}static async audit(e,t){
|
1185
|
+
const r=e.traces[sz.DEFAULT_PASS],a=e.devtoolsLogs[sz.DEFAULT_PASS];if(!(await iz.request(a,t)).find((e=>lz(e.url))))return oz.NoAdRelatedReq;const n={trace:r,devtoolsLog:a,settings:t.settings};let i=[];try{i=await nz.request(n,t)}catch(e){return oz.InvalidTiming}let o=0;const s=new Map;for(const e of i){const t=cz(e);if(!t||!lz(t))continue;if(e.parent)continue;const r=e.duration-50;o+=r;const a=uz(t),n=s.get(a)||0;s.set(a,n+r)}const c=[];for(const[e,t]of s.entries())c.push({name:e,blockingTime:t});c.sort(((e,t)=>t.blockingTime-e.blockingTime));const l=t.options[t.settings.throttlingMethod]||t.options.provided;return{score:sz.computeLogNormalScore(l,o),numericValue:o,numericUnit:"millisecond",displayValue:mz(dz.failureDisplayValue,{timeInMs:o}),details:TotalAdBlockingTime.makeTableDetails(pz,c)}}}rz.exports=TotalAdBlockingTime,rz.exports.UIStrings=dz;const hz=bn,gz=la,fz=mn,yz=Tu,vz=xu,bz=pu,wz=oi,Sz=Su;function isBundledEnvironment(){
|
1186
|
+
if(globalThis.isDevtools||globalThis.isLightrider)return!0;try{return require.resolve("lighthouse-logger"),!1}catch(e){return!0}}const mergeOptionsOfItems=function(e){const t=[];for(const r of e){const e=r.path&&t.find((e=>e.path===r.path));e?e.options=Object.assign({},e.options,r.options):t.push(r)}return t};const Tz=function _mergeConfigFragment(e,t,r=!1){if(null==e)return t;if(void 0===t)return e;if(Array.isArray(t)){if(r)return t;if(!Array.isArray(e))throw new TypeError("Expected array but got "+typeof e);const a=e.slice();return t.forEach((e=>{a.some((t=>gz(t,e)))||a.push(e)})),a}if("object"==typeof t){if("object"!=typeof e)throw new TypeError("Expected object but got "+typeof e);if(Array.isArray(e))throw new TypeError("Expected object but got Array");return Object.keys(t).forEach((a=>{const n=r||"settings"===a&&"object"==typeof e[a];e[a]=_mergeConfigFragment(e[a],t[a],n)})),e}return t}
|
1187
|
+
;const Ez=new Map([["../gather/gatherers/accessibility",ku],["../gather/gatherers/anchor-elements",Lu],["../gather/gatherers/cache-contents",Pu],["../gather/gatherers/console-messages",Fu],["../gather/gatherers/css-usage",$u],["../gather/gatherers/devtools-log-compat",Vu],["../gather/gatherers/devtools-log",Ws],["../gather/gatherers/dobetterweb/doctype",Gu],["../gather/gatherers/dobetterweb/domstats",Ku],["../gather/gatherers/dobetterweb/optimized-images",nd],["../gather/gatherers/dobetterweb/password-inputs-with-prevented-paste",sd],["../gather/gatherers/dobetterweb/response-compression",gm],["../gather/gatherers/dobetterweb/tags-blocking-first-paint",bm],["../gather/gatherers/full-page-screenshot",_m],["../gather/gatherers/global-listeners",Rm],["../gather/gatherers/iframe-elements",Cm],["../gather/gatherers/image-elements",Fm],["../gather/gatherers/inputs",Bm],["../gather/gatherers/inspector-issues",Vm],["../gather/gatherers/installability-errors",$s],["../gather/gatherers/js-usage",Gm],["../gather/gatherers/link-elements",ip],["../gather/gatherers/main-document-content",dp],["../gather/gatherers/meta-elements",hp],["../gather/gatherers/network-user-agent",Ys],["../gather/gatherers/script-elements",Tp],["../gather/gatherers/seo/embedded-content",_p],["../gather/gatherers/seo/font-size",Im.exports],["../gather/gatherers/seo/robots-txt",Rp],["../gather/gatherers/seo/tap-targets",Lp],["../gather/gatherers/service-worker",Op],["../gather/gatherers/source-maps",jp],["../gather/gatherers/stacks",Xs],["../gather/gatherers/trace-compat",qp],["../gather/gatherers/trace-elements",hh],["../gather/gatherers/trace",oo],["../gather/gatherers/viewport-dimensions",fh],["../gather/gatherers/web-app-manifest",Us],["../audits/accessibility/accesskeys",yh.exports],["../audits/accessibility/aria-allowed-attr",_h.exports],["../audits/accessibility/aria-command-name",Dh.exports],["../audits/accessibility/aria-hidden-body",Lh.exports],["../audits/accessibility/aria-hidden-focus",Fh.exports],["../audits/accessibility/aria-input-field-name",$h.exports],["../audits/accessibility/aria-meter-name",Wh.exports],["../audits/accessibility/aria-progressbar-name",Kh.exports],["../audits/accessibility/aria-required-attr",Qh.exports],["../audits/accessibility/aria-required-children",ag.exports],["../audits/accessibility/aria-required-parent",sg.exports],["../audits/accessibility/aria-roles",dg.exports],["../audits/accessibility/aria-toggle-field-name",gg.exports],["../audits/accessibility/aria-tooltip-name",bg.exports],["../audits/accessibility/aria-treeitem-name",Eg.exports],["../audits/accessibility/aria-valid-attr-value",Rg.exports],["../audits/accessibility/aria-valid-attr",Ig.exports],["../audits/accessibility/button-name",Pg.exports],["../audits/accessibility/bypass",jg.exports],["../audits/accessibility/color-contrast",zg.exports],["../audits/accessibility/definition-list",Hg.exports],["../audits/accessibility/dlitem",Xg.exports],["../audits/accessibility/document-title",tf.exports],["../audits/accessibility/duplicate-id-active",of.exports],["../audits/accessibility/duplicate-id-aria",uf.exports],["../audits/accessibility/form-field-multiple-labels",hf.exports],["../audits/accessibility/frame-title",vf.exports],["../audits/accessibility/heading-order",Tf.exports],["../audits/accessibility/html-has-lang",Af.exports],["../audits/accessibility/html-lang-valid",Cf.exports],["../audits/accessibility/image-alt",Mf.exports],["../audits/accessibility/input-image-alt",Uf.exports],["../audits/accessibility/label",qf.exports],["../audits/accessibility/link-name",Gf.exports],["../audits/accessibility/list",Jf.exports],["../audits/accessibility/listitem",ey.exports],["../audits/accessibility/manual/custom-controls-labels",sy],["../audits/accessibility/manual/custom-controls-roles",ly],["../audits/accessibility/manual/focus-traps",dy],["../audits/accessibility/manual/focusable-controls",py],["../audits/accessibility/manual/interactive-element-affordance",gy],["../audits/accessibility/manual/logical-tab-order",yy],["../audits/accessibility/manual/managed-focus",by],["../audits/accessibility/manual/offscreen-content-hidden",Sy],["../audits/accessibility/manual/use-landmarks",Ey],["../audits/accessibility/manual/visual-order-follows-dom",_y],["../audits/accessibility/meta-refresh",Ay.exports],["../audits/accessibility/meta-viewport",Cy.exports],["../audits/accessibility/object-alt",My.exports],["../audits/accessibility/tabindex",Uy.exports],["../audits/accessibility/td-headers-attr",qy.exports],["../audits/accessibility/th-has-data-cells",Gy.exports],["../audits/accessibility/valid-lang",Jy.exports],["../audits/accessibility/video-caption",ev.exports],["../audits/apple-touch-icon",nv.exports],["../audits/autocomplete",cv.exports],["../audits/bootup-time",yv.exports],["../audits/byte-efficiency/duplicated-javascript",Bv.exports],["../audits/byte-efficiency/efficient-animated-content",Jb.exports],["../audits/byte-efficiency/legacy-javascript",rw.exports],["../audits/byte-efficiency/modern-image-formats",mw.exports],["../audits/byte-efficiency/offscreen-images",vw.exports],["../audits/byte-efficiency/render-blocking-resources",zw.exports],["../audits/byte-efficiency/total-byte-weight",dS.exports],["../audits/byte-efficiency/unminified-css",vS.exports],["../audits/byte-efficiency/unminified-javascript",kS.exports],["../audits/byte-efficiency/unused-css-rules",PS.exports],["../audits/byte-efficiency/unused-javascript",$S.exports],["../audits/byte-efficiency/uses-long-cache-ttl",QS.exports],["../audits/byte-efficiency/uses-optimized-images",lT.exports],["../audits/byte-efficiency/uses-responsive-images-snapshot",gT.exports],["../audits/byte-efficiency/uses-responsive-images",fT.exports],["../audits/byte-efficiency/uses-text-compression",LT.exports],["../audits/content-width",jT.exports],["../audits/critical-request-chains",zT.exports],["../audits/csp-xss",aE.exports],["../audits/deprecations",tx.exports],["../audits/diagnostics",mx],["../audits/dobetterweb/charset",px.exports],["../audits/dobetterweb/doctype",Sx.exports],["../audits/dobetterweb/dom-size",_x.exports],["../audits/dobetterweb/geolocation-on-start",Cx.exports],["../audits/dobetterweb/inspector-issues",Ux.exports],["../audits/dobetterweb/js-libraries",qx.exports],["../audits/dobetterweb/no-document-write",Hx.exports],["../audits/dobetterweb/no-vulnerable-libraries",Zx.exports],["../audits/dobetterweb/notification-on-start",l_.exports],["../audits/dobetterweb/password-inputs-can-be-pasted-into",h_.exports],["../audits/dobetterweb/uses-http2",b_.exports],["../audits/dobetterweb/uses-passive-event-listeners",M_.exports],["../audits/errors-in-console",j_.exports],["../audits/final-screenshot",Z_],["../audits/font-display",Q_.exports],["../audits/full-page-screenshot",dA],["../audits/image-aspect-ratio",mA.exports],["../audits/image-size-responsive",vA.exports],["../audits/installable-manifest",xA.exports],["../audits/is-on-https",MA.exports],["../audits/largest-contentful-paint-element",qA.exports],["../audits/layout-shift-elements",HA.exports],["../audits/lcp-lazy-loaded",ZA.exports],["../audits/long-tasks",aR.exports],["../audits/main-thread-tasks",yR],["../audits/mainthread-work-breakdown",vR.exports],["../audits/manual/pwa-cross-browser",_R.exports],["../audits/manual/pwa-each-page-has-url",DR.exports],["../audits/manual/pwa-page-transitions",LR.exports],["../audits/maskable-icon",FR.exports],["../audits/metrics",MD],["../audits/metrics/cumulative-layout-shift",PD.exports],["../audits/metrics/experimental-interaction-to-next-paint",$D.exports],["../audits/metrics/first-contentful-paint-3g",JD],["../audits/metrics/first-contentful-paint",XD.exports],["../audits/metrics/first-meaningful-paint",aC.exports],["../audits/metrics/interactive",lC.exports],["../audits/metrics/largest-contentful-paint",gC.exports],["../audits/metrics/max-potential-fid",TC.exports],["../audits/metrics/speed-index",kC.exports],["../audits/metrics/total-blocking-time",MC.exports],["../audits/network-requests",zC],["../audits/network-rtt",VC.exports],["../audits/network-server-latency",XC.exports],["../audits/no-unload-listeners",nI.exports],["../audits/non-composited-animations",uI.exports],["../audits/oopif-iframe-test-audit",{
|
1188
1188
|
meta:{id:"oopif-iframe-test-audit",title:"IFrame Elements",failureTitle:"IFrame Elements",description:"Audit to force the inclusion of IFrameElements artifact",requiredArtifacts:["IFrameElements"]},audit:()=>({score:1})
|
1189
|
-
}],["../audits/performance-budget",fI.exports],["../audits/predictive-perf",jI],["../audits/preload-fonts",BI.exports],["../audits/preload-lcp-image",YI.exports],["../audits/redirects",nN.exports],["../audits/resource-summary",hN.exports],["../audits/screenshot-thumbnails",RN],["../audits/script-treemap-data",NN],["../audits/seo/canonical",LN.exports],["../audits/seo/crawlable-anchors",jN.exports],["../audits/seo/font-size",zN.exports],["../audits/seo/hreflang",eL.exports],["../audits/seo/http-status-code",cL.exports],["../audits/seo/is-crawlable",hL.exports],["../audits/seo/link-text",EL.exports],["../audits/seo/manual/structured-data",DL.exports],["../audits/seo/meta-description",LL.exports],["../audits/seo/plugins",FL.exports],["../audits/seo/robots-txt",HL.exports],["../audits/seo/tap-targets",iM.exports],["../audits/server-response-time",wM.exports],["../audits/service-worker",kM.exports],["../audits/splash-screen",LM.exports],["../audits/themed-omnibox",BM.exports],["../audits/third-party-facades",GM.exports],["../audits/third-party-summary",HM.exports],["../audits/timing-budget",pP.exports],["../audits/unsized-images",SP.exports],["../audits/user-timings",RP.exports],["../audits/uses-rel-preconnect",OP.exports],["../audits/uses-rel-preload",JP.exports],["../audits/valid-source-maps",cO.exports],["../audits/viewport",hO.exports],["../audits/work-during-interaction",bO.exports],["lighthouse-plugin-publisher-ads",
|
1190
|
-
;function requireWrapper(e){return
|
1191
|
-
var
|
1192
|
-
;const a=requireWrapper(isBundledEnvironment()?r:resolveModulePath(r,t,"plugin")),n=
|
1193
|
-
;return n.forEach((e=>
|
1194
|
-
throw new Error("Invalid expanded Gatherer: "+JSON.stringify(a))},resolveModulePath,resolveSettings:function resolveSettings$2(e={},t){const r=
|
1195
|
-
Timing:"",PageLoadError:""});class Config$1{constructor(e,t){const r={msg:"Create config",id:"lh:init:config"};
|
1196
|
-
;const i=
|
1197
|
-
;for(const e of t.requiredArtifacts)if(!a.has(e))throw new Error(`${e} gatherer, required by audit ${t.id}, was not found in config.`)}const n=new Set;e.forEach((e=>{const t=e.passName;if(n.has(t))throw new Error(`Passes must have unique names (repeated passName: ${t}.`);n.add(t)}))}(this.passes,this.audits),
|
1198
|
-
;const{defaultPassConfig:t}=
|
1199
|
-
static filterCategoriesAndAudits(e,t){if(!e)return{categories:null,requestedAuditNames:new Set};if(t.onlyAudits&&t.skipAudits)throw new Error("Cannot set both skipAudits and onlyAudits");const r={},a=!!t.onlyCategories,n=!!t.onlyAudits,i=t.onlyCategories||[],o=t.onlyAudits||[],s=t.skipAudits||[];i.forEach((t=>{e[t]||
|
1200
|
-
}else n&&(c.auditRefs=c.auditRefs.filter((e=>o.includes(e.id))));c.auditRefs=c.auditRefs.filter((e=>!s.includes(e.id))),c.auditRefs.length&&(r[t]=c,c.auditRefs.forEach((e=>l.add(e.id))))}));return t.skipAudits&&t.skipAudits.includes("full-page-screenshot")||!t.onlyCategories&&!t.skipAudits||l.add("full-page-screenshot"),{categories:r,requestedAuditNames:l}}static getGatherersRequestedByAudits(e){if(!e)return new Set;const t=new Set;for(const r of e){const{requiredArtifacts:e,__internalOptionalArtifacts:a}=r.implementation.meta;e.forEach((e=>t.add(e))),a&&a.forEach((e=>t.add(e)))}return t}static generatePassesNeededByGatherers(e,t){if(!e)return null;const r=t.has("traces");return e.map((e=>{if(e.gatherers=e.gatherers.filter((e=>{const r=e.instance;return t.has(r.name)})),e.recordTrace&&!r){const t=e.passName||"unknown pass";
|
1201
|
-
})).filter((e=>!!e.recordTrace||("defaultPass"===e.passName||e.gatherers.length>0)))}static requireAudits(e,t){const r={msg:"Requiring audits",id:"lh:config:requireAudits"};
|
1202
|
-
beforePass(e){}pass(e){}afterPass(e,t){}};const
|
1203
|
-
method:r,params:a[0],sessionId:n}),t.call(e,r,...a)},e.emit[
|
1204
|
-
})),i=this._session.send(e,...t);return Promise.race([i,n]).finally((()=>{a&&clearTimeout(a)}))}async dispose(){this._session.removeAllListeners(),await this._session.detach()}_getConnection(){const e=this._session.connection();if(!e)throw new Error("Connection has been closed.");return e}}var
|
1205
|
-
this._executionContext=void 0,this._fetcher=void 0,this.defaultSession=
|
1206
|
-
stopInstrumentation:"stopSensitiveInstrumentation",getArtifact:"stopInstrumentation"};async function collectArtifactDependencies(e,t){if(!e.dependencies)return{};const r=Object.entries(e.dependencies).map((async([e,r])=>{const a=t[r.id];if(void 0===a)throw new Error(`"${r.id}" did not run`);if(a instanceof Error)throw createDependencyError(r,a);const n=Promise.resolve().then((()=>a)).catch((e=>Promise.reject(createDependencyError(r,e))));return[e,await n]}));return Object.fromEntries(await Promise.all(r))}var
|
1207
|
-
const{driver:t,artifactDefinitions:r,artifactState:a,baseArtifacts:n,phase:i,gatherMode:o,computedCache:s,settings:c,url:l}=e,u=
|
1208
|
-
Inputs:"",FullPageScreenshot:"",GlobalListeners:"",IFrameElements:"",ImageElements:"",InstallabilityErrors:"",InspectorIssues:"",JsUsage:"",LinkElements:"",MainDocumentContent:"",MetaElements:"",NetworkUserAgent:"",OptimizedImages:"",PasswordInputsWithPreventedPaste:"",ResponseCompression:"",RobotsTxt:"",ServiceWorker:"",ScriptElements:"",SourceMaps:"",Stacks:"",TagsBlockingFirstPaint:"",TapTargets:"",TraceElements:"",ViewportDimensions:"",WebAppManifest:"",devtoolsLogs:"",traces:""};for(const e of Object.keys(
|
1209
|
-
gatherer:"seo/embedded-content"},{id:
|
1210
|
-
|
1211
|
-
artifacts:[
|
1212
|
-
;for(const t of Object.keys(
|
1213
|
-
return e?e.filter((e=>e.gatherer.instance.meta.supportedModes.includes(t))):null}function filterNavigationsByAvailableArtifacts(e,t){if(!e)return e;const r=new Set(t.map((e=>e.id)).concat(
|
1214
|
-
function filterCategoriesByAvailableAudits(e,t){if(!e)return e;const r=new Map(t.map((e=>[e.implementation.meta.id,e.implementation.meta]))),a=Object.entries(e).map((([e,t])=>{const a={...t,auditRefs:t.auditRefs.filter((e=>r.has(e.id)))},n=a.auditRefs.length<t.auditRefs.length,i=a.auditRefs.every((e=>{const t=r.get(e.id);return!!t&&t.scoreDisplayMode===
|
1215
|
-
;!function warnOnUnknownOnlyCategories(e,t){if(t)for(const r of t)e?.[r]||
|
1216
|
-
;const
|
1217
|
-
;i||
|
1218
|
-
}));return
|
1219
|
-
;const a=new Map,n=
|
1220
|
-
;await a.connect();const n=new Map,i=await a.url(),o={config:r,computedCache:n};return{artifacts:await
|
1221
|
-
}),c=
|
1222
|
-
;async function _setup({driver:e,config:t,requestor:r,options:a}){await e.connect(),a?.skipAboutBlank||await
|
1223
|
-
navigationError:void 0,warnings:o}}catch(e){if(!(e instanceof
|
1224
|
-
;
|
1225
|
-
await async function _cleanupNavigation({driver:e}){await
|
1226
|
-
;
|
1227
|
-
const r=a.config||t.config,{gatherMode:n}=e.GatherContext,{config:s}=
|
1228
|
-
;return this._gatherSteps.some((e=>"navigation"===e.artifacts.GatherContext.gatherMode))&&void 0===a.disableStorageReset&&(a.disableStorageReset=!0),r.settingsOverrides=a,t.configContext=r,t}_addGatherStep(e,t){const r=t?.stepName,a={artifacts:e.artifacts,name:r||this._getDefaultStepName(e.artifacts),config:t.config,configContext:t.configContext};this._gatherSteps.push(a),this._gatherStepRunnerOptions.set(a,e.runnerOptions)}async navigate(e,t){if(this.currentTimespan)throw new Error("Timespan already in progress");const r=this._getNextNavigationOptions(t),a=await
|
1229
|
-
this._addGatherStep(r,t),r}async snapshot(e){if(this.currentTimespan)throw new Error("Timespan already in progress");const t={...this.options,...e},r=await
|
1230
|
-
},
|
1231
|
-
plugins:["lighthouse-plugin-publisher-ads"],settings:r}},self.listenForStatus=function listenForStatus(e){Log.events.addListener("status",e)},self.registerLocaleData=Vn.registerLocaleData,self.lookupLocale=function lookupCanonicalLocale(e){return oi.lookupLocale(e,Vn.getCanonicalLocales())}):global.runBundledLighthouse=
|
1189
|
+
}],["../audits/performance-budget",fI.exports],["../audits/predictive-perf",jI],["../audits/preload-fonts",BI.exports],["../audits/preload-lcp-image",YI.exports],["../audits/redirects",nN.exports],["../audits/resource-summary",hN.exports],["../audits/screenshot-thumbnails",RN],["../audits/script-treemap-data",NN],["../audits/seo/canonical",LN.exports],["../audits/seo/crawlable-anchors",jN.exports],["../audits/seo/font-size",zN.exports],["../audits/seo/hreflang",eL.exports],["../audits/seo/http-status-code",cL.exports],["../audits/seo/is-crawlable",hL.exports],["../audits/seo/link-text",EL.exports],["../audits/seo/manual/structured-data",DL.exports],["../audits/seo/meta-description",LL.exports],["../audits/seo/plugins",FL.exports],["../audits/seo/robots-txt",HL.exports],["../audits/seo/tap-targets",iM.exports],["../audits/server-response-time",wM.exports],["../audits/service-worker",kM.exports],["../audits/splash-screen",LM.exports],["../audits/themed-omnibox",BM.exports],["../audits/third-party-facades",GM.exports],["../audits/third-party-summary",HM.exports],["../audits/timing-budget",pP.exports],["../audits/unsized-images",SP.exports],["../audits/user-timings",RP.exports],["../audits/uses-rel-preconnect",OP.exports],["../audits/uses-rel-preload",JP.exports],["../audits/valid-source-maps",cO.exports],["../audits/viewport",hO.exports],["../audits/work-during-interaction",bO.exports],["lighthouse-plugin-publisher-ads",LO.exports],["lighthouse-plugin-publisher-ads/audits/ad-blocking-tasks",$O.exports],["lighthouse-plugin-publisher-ads/audits/ad-render-blocking-resources",cU.exports],["lighthouse-plugin-publisher-ads/audits/ad-request-critical-path",bU.exports],["lighthouse-plugin-publisher-ads/audits/bid-request-from-page-start",$U.exports],["lighthouse-plugin-publisher-ads/audits/ad-request-from-page-start",rj.exports],["lighthouse-plugin-publisher-ads/audits/ad-top-of-viewport",uj.exports],["lighthouse-plugin-publisher-ads/audits/ads-in-viewport",vj.exports],["lighthouse-plugin-publisher-ads/audits/async-ad-tags",kj.exports],["lighthouse-plugin-publisher-ads/audits/blocking-load-events",$j.exports],["lighthouse-plugin-publisher-ads/audits/bottleneck-requests",aB.exports],["lighthouse-plugin-publisher-ads/audits/duplicate-tags",pB.exports],["lighthouse-plugin-publisher-ads/audits/first-ad-render",AB.exports],["lighthouse-plugin-publisher-ads/audits/full-width-slots",BB.exports],["lighthouse-plugin-publisher-ads/audits/gpt-bids-parallel",KB.exports],["lighthouse-plugin-publisher-ads/audits/loads-gpt-from-official-source",s$.exports],["lighthouse-plugin-publisher-ads/audits/loads-ad-tag-over-https",f$.exports],["lighthouse-plugin-publisher-ads/audits/script-injected-tags",_$.exports],["lighthouse-plugin-publisher-ads/audits/serial-header-bidding",F$.exports],["lighthouse-plugin-publisher-ads/audits/tag-load-time",aq.exports],["lighthouse-plugin-publisher-ads/audits/viewport-ad-density",vq.exports],["lighthouse-plugin-publisher-ads/audits/cumulative-ad-shift",Aq.exports],["lighthouse-plugin-publisher-ads/audits/deprecated-api-usage",Uq.exports],["lighthouse-plugin-publisher-ads/audits/gpt-errors-overall",Hq.exports],["lighthouse-plugin-publisher-ads/audits/total-ad-blocking-time",rz.exports]])
|
1190
|
+
;function requireWrapper(e){return Ez.get(e)||function commonjsRequire(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}(e)}function resolveModulePath(e,t,r){try{return require.resolve(e)}catch(e){}try{return require.resolve(e,{paths:[process.cwd()]})}catch(e){}const a=hz.resolve(process.cwd(),e);try{return require.resolve(a)}catch(e){}const n="Unable to locate "+(r?`${r}: `:"")+`\`${e}\`.\n Tried to require() from these locations:\n lighthouse-core/config\n ${a}`;if(!t)throw new Error(n);const i=hz.resolve(t,e);try{return require.resolve(i)}catch(e){}try{return require.resolve(e,{paths:[t]})}catch(e){}throw new Error(n+`\n ${i}`)}function shallowClone(e){return"object"==typeof e?Object.assign(Object.create(Object.getPrototypeOf(e)),e):e}function deepClone$2(e){return JSON.parse(JSON.stringify(e))}
|
1191
|
+
var xz={deepClone:deepClone$2,deepCloneConfigJson:function deepCloneConfigJson$2(e){const t=deepClone$2(e);if(Array.isArray(t.passes)&&Array.isArray(e.passes))for(let r=0;r<t.passes.length;r++){t.passes[r].gatherers=(e.passes[r].gatherers||[]).map((e=>shallowClone(e)))}return Array.isArray(e.audits)&&(t.audits=e.audits.map((e=>shallowClone(e)))),Array.isArray(e.artifacts)&&(t.artifacts=e.artifacts.map((e=>({...e,gatherer:shallowClone(e.gatherer)})))),t},mergeConfigFragment:Tz,mergeConfigFragmentArrayByKey:function mergeConfigFragmentArrayByKey$1(e,t,r){const a=new Map,n=e||[];for(let e=0;e<n.length;e++){const t=n[e];a.set(r(t),{index:e,item:t})}for(const e of t||[]){const t=a.get(r(e));if(t){const r=t.item,a="object"==typeof e&&"object"==typeof r?Tz(r,e,!0):e;n[t.index]=a}else n.push(e)}return n},mergeOptionsOfItems,mergePlugins:function mergePlugins$2(e,t,r){const a=e.plugins||[],n=new Set([...a,...r?.plugins||[]]);for(const r of n){Sz.assertValidPluginName(e,r)
|
1192
|
+
;const a=requireWrapper(isBundledEnvironment()?r:resolveModulePath(r,t,"plugin")),n=vz.parsePlugin(a,r);e=Tz(e,n)}return e},resolveAuditsToDefns:function resolveAuditsToDefns$2(e,t){if(!e)return null;const r=bz.getAuditList(),a=e.map((e=>{const a=function expandAuditShorthand(e){if("string"==typeof e)return{path:e,options:{}};if("implementation"in e&&"function"==typeof e.implementation.audit)return e;if("path"in e&&"string"==typeof e.path)return e;if("audit"in e&&"function"==typeof e.audit)return{implementation:e,options:{}};throw new Error("Invalid Audit type "+JSON.stringify(e))}(e);let n;return n="implementation"in a?a.implementation:function requireAudit(e,t,r){const a=`${e}.js`;let n=`../audits/${e}`;if(!t.find((e=>e===a)))if(isBundledEnvironment())n=e;else{const t=resolveModulePath(e,r,"audit");n=hz.relative("lighthouse-core/config",t)}return requireWrapper(n)}(a.path,r,t),{implementation:n,path:a.path,options:a.options||{}}})),n=mergeOptionsOfItems(a)
|
1193
|
+
;return n.forEach((e=>Sz.assertValidAudit(e))),n},resolveGathererToDefn:function resolveGathererToDefn$2(e,t,r){const a=function expandGathererShorthand(e){if("string"==typeof e)return{path:e};if("implementation"in e||"instance"in e)return e;if("path"in e){if("string"!=typeof e.path)throw new Error("Invalid Gatherer type "+JSON.stringify(e));return e}if("function"==typeof e)return{implementation:e};if(e&&"function"==typeof e.beforePass)return{instance:e};throw new Error("Invalid Gatherer type "+JSON.stringify(e))}(e);if(a.instance)return{instance:a.instance,implementation:a.implementation,path:a.path};if(a.implementation){return{instance:new(0,a.implementation),implementation:a.implementation,path:a.path}}if(a.path){return function requireGatherer(e,t,r){const a=t.find((t=>t===`${e}.js`));let n=`../gather/gatherers/${e}`;a||(n=resolveModulePath(e,r,"gatherer"));const i=requireWrapper(n);return{instance:new i,implementation:i,path:e}}(a.path,t,r)}
|
1194
|
+
throw new Error("Invalid expanded Gatherer: "+JSON.stringify(a))},resolveModulePath,resolveSettings:function resolveSettings$2(e={},t){const r=wz.lookupLocale(t?.locale||e.locale),{defaultSettings:a}=fz,n=Tz(deepClone$2(a),e,!0),i=Tz(n,function cleanFlagsForSettings(e={}){const t={};for(const r of Object.keys(e))r in fz.defaultSettings&&(t[r]=e[r]);return t}(t),!0);return i.budgets&&(i.budgets=yz.initializeBudget(i.budgets)),i.locale=r,!0===i.emulatedUserAgent&&(i.emulatedUserAgent=fz.userAgents[i.formFactor]),Sz.assertValidSettings(i),i}};const _z=gu.exports,Az=mn,Rz=Vn,kz=Su,Dz=on.default,Cz=bn,Iz=pu,{mergePlugins:Nz,mergeConfigFragment:Lz,resolveSettings:Mz,resolveAuditsToDefns:Pz,resolveGathererToDefn:Oz,deepClone:Fz,deepCloneConfigJson:Uz}=xz,jz=Object.keys({fetchTime:"",LighthouseRunWarnings:"",HostFormFactor:"",HostUserAgent:"",NetworkUserAgent:"",BenchmarkIndex:"",WebAppManifest:"",GatherContext:"",InstallabilityErrors:"",Stacks:"",traces:"",devtoolsLogs:"",settings:"",URL:"",
|
1195
|
+
Timing:"",PageLoadError:""});class Config$1{constructor(e,t){const r={msg:"Create config",id:"lh:init:config"};Dz.time(r,"verbose");let a=t?.configPath;if(e||(e=_z,a=Cz.resolve("lighthouse-core/config","./default-config.js")),a&&!Cz.isAbsolute(a))throw new Error("configPath must be an absolute path.");if((e=Uz(e)).extends){if("lighthouse:default"!==e.extends)throw new Error("`lighthouse:default` is the only valid extension method.");e=Config$1.extendConfigJSON(Uz(_z),e)}const n=a?Cz.dirname(a):void 0;e=Nz(e,n,t),t&&function assertValidFlags(e){if("devtools"===e.channel&&e.internalDisableDeviceScreenEmulation&&(e.formFactor=e.emulatedFormFactor,e.emulatedFormFactor=e.internalDisableDeviceScreenEmulation=void 0),e.emulatedFormFactor||e.internalDisableDeviceScreenEmulation)throw new Error("Invalid emulation flag. Emulation configuration changed in LH 7.0. See https://github.com/GoogleChrome/lighthouse/blob/master/docs/emulation.md")}(t)
|
1196
|
+
;const i=Mz(e.settings||{},t),o=Config$1.augmentPassesWithDefaults(e.passes);Config$1.adjustDefaultPassForThrottling(i,o);const s=Config$1.requireGatherers(o,n);this.settings=i,this.passes=s,this.audits=Config$1.requireAudits(e.audits,n),this.categories=e.categories||null,this.groups=e.groups||null,Config$1.filterConfigIfNeeded(this),function assertValidPasses(e,t){if(!Array.isArray(e))return;const r=Config$1.getGatherersRequestedByAudits(t),a=new Set(jz);e.forEach(((e,t)=>{0===t&&"fatal"!==e.loadFailureMode&&(Dz.warn(`"${e.passName}" is the first pass but was marked as non-fatal. The first pass will always be treated as loadFailureMode=fatal.`),e.loadFailureMode="fatal"),e.gatherers.forEach((e=>{const t=e.instance;if(a.add(t.name),!r.has(t.name)){const e=`${t.name} gatherer requested, however no audit requires it.`;Dz.warn("config",e)}}))}));for(const e of t||[]){const t=e.implementation.meta
|
1197
|
+
;for(const e of t.requiredArtifacts)if(!a.has(e))throw new Error(`${e} gatherer, required by audit ${t.id}, was not found in config.`)}const n=new Set;e.forEach((e=>{const t=e.passName;if(n.has(t))throw new Error(`Passes must have unique names (repeated passName: ${t}.`);n.add(t)}))}(this.passes,this.audits),kz.assertValidCategories(this.categories,this.audits,this.groups),Dz.timeEnd(r)}getPrintString(){const e=Fz(this);if(e.passes)for(const t of e.passes)for(const e of t.gatherers)e.implementation=void 0,e.instance=void 0;if(e.audits)for(const t of e.audits)t.implementation=void 0,0===Object.keys(t.options).length&&(t.options=void 0);return Rz.replaceIcuMessages(e,e.settings.locale),JSON.stringify(e,null,2)}static extendConfigJSON(e,t){if(t.passes&&e.passes){for(const r of t.passes){const t=r.passName||Az.defaultPassConfig.passName,a=e.passes.find((e=>e.passName===t));a?Lz(a,r):e.passes.push(r)}delete t.passes}return Lz(e,t)}static augmentPassesWithDefaults(e){if(!e)return null
|
1198
|
+
;const{defaultPassConfig:t}=Az;return e.map((e=>Lz(Fz(t),e)))}static adjustDefaultPassForThrottling(e,t){if(!t||"devtools"!==e.throttlingMethod&&"provided"!==e.throttlingMethod)return;const r=t.find((e=>"defaultPass"===e.passName));if(!r)return;const a=Az.nonSimulatedPassConfigOverrides;r.pauseAfterFcpMs=Math.max(a.pauseAfterFcpMs,r.pauseAfterFcpMs),r.pauseAfterLoadMs=Math.max(a.pauseAfterLoadMs,r.pauseAfterLoadMs),r.cpuQuietThresholdMs=Math.max(a.cpuQuietThresholdMs,r.cpuQuietThresholdMs),r.networkQuietThresholdMs=Math.max(a.networkQuietThresholdMs,r.networkQuietThresholdMs)}static filterConfigIfNeeded(e){const t=e.settings;if(!t.onlyCategories&&!t.onlyAudits&&!t.skipAudits)return;const{categories:r,requestedAuditNames:a}=Config$1.filterCategoriesAndAudits(e.categories,t),n=e.audits&&e.audits.filter((e=>a.has(e.implementation.meta.id))),i=Config$1.getGatherersRequestedByAudits(n),o=Config$1.generatePassesNeededByGatherers(e.passes,i);e.categories=r,e.audits=n,e.passes=o}
|
1199
|
+
static filterCategoriesAndAudits(e,t){if(!e)return{categories:null,requestedAuditNames:new Set};if(t.onlyAudits&&t.skipAudits)throw new Error("Cannot set both skipAudits and onlyAudits");const r={},a=!!t.onlyCategories,n=!!t.onlyAudits,i=t.onlyCategories||[],o=t.onlyAudits||[],s=t.skipAudits||[];i.forEach((t=>{e[t]||Dz.warn("config",`unrecognized category in 'onlyCategories': ${t}`)}));const c=new Set(o.concat(s));for(const t of c){const r=Object.keys(e).find((r=>!!e[r].auditRefs.find((e=>e.id===t))));if(r)o.includes(t)&&i.includes(r)&&Dz.warn("config",`${t} in 'onlyAudits' is already included by ${r} in 'onlyCategories'`);else{const e=s.includes(t)?"skipAudits":"onlyAudits";Dz.warn("config",`unrecognized audit in '${e}': ${t}`)}}const l=new Set(o);s.forEach((e=>l.delete(e))),Object.keys(e).forEach((t=>{const c=Fz(e[t]);if(a&&n)i.includes(t)||(c.auditRefs=c.auditRefs.filter((e=>o.includes(e.id))));else if(a){if(!i.includes(t))return
|
1200
|
+
}else n&&(c.auditRefs=c.auditRefs.filter((e=>o.includes(e.id))));c.auditRefs=c.auditRefs.filter((e=>!s.includes(e.id))),c.auditRefs.length&&(r[t]=c,c.auditRefs.forEach((e=>l.add(e.id))))}));return t.skipAudits&&t.skipAudits.includes("full-page-screenshot")||!t.onlyCategories&&!t.skipAudits||l.add("full-page-screenshot"),{categories:r,requestedAuditNames:l}}static getGatherersRequestedByAudits(e){if(!e)return new Set;const t=new Set;for(const r of e){const{requiredArtifacts:e,__internalOptionalArtifacts:a}=r.implementation.meta;e.forEach((e=>t.add(e))),a&&a.forEach((e=>t.add(e)))}return t}static generatePassesNeededByGatherers(e,t){if(!e)return null;const r=t.has("traces");return e.map((e=>{if(e.gatherers=e.gatherers.filter((e=>{const r=e.instance;return t.has(r.name)})),e.recordTrace&&!r){const t=e.passName||"unknown pass";Dz.warn("config",`Trace not requested by an audit, dropping trace in ${t}`),e.recordTrace=!1}return e
|
1201
|
+
})).filter((e=>!!e.recordTrace||("defaultPass"===e.passName||e.gatherers.length>0)))}static requireAudits(e,t){const r={msg:"Requiring audits",id:"lh:config:requireAudits"};Dz.time(r,"verbose");const a=Pz(e,t);return Dz.timeEnd(r),a}static requireGatherers(e,t){if(!e)return null;const r={msg:"Requiring gatherers",id:"lh:config:requireGatherers"};Dz.time(r,"verbose");const a=Iz.getGathererList(),n=e.map((e=>{const r=e.gatherers.map((e=>Oz(e,a,t))),n=Array.from(new Map(r.map((e=>[e.instance.name,e]))).values());return n.forEach((e=>function assertValidGatherer(e,t){if(t=t||e.name||"gatherer","function"!=typeof e.beforePass)throw new Error(`${t} has no beforePass() method.`);if("function"!=typeof e.pass)throw new Error(`${t} has no pass() method.`);if("function"!=typeof e.afterPass)throw new Error(`${t} has no afterPass() method.`)}(e.instance,e.path))),Object.assign(e,{gatherers:n})}));return Dz.timeEnd(r),n}}var Bz=Config$1;var $z=class Gatherer{get name(){return this.constructor.name}
|
1202
|
+
beforePass(e){}pass(e){}afterPass(e,t){}};const qz=pu,zz=on.default,Vz=hu,Wz=Bz,Gz=ji;async function lighthouse(e,t={},r,a){t.logLevel=t.logLevel||"error",zz.setLevel(t.logLevel);const n={config:generateConfig(r,t),computedCache:new Map},i=a||new Vz(t.port,t.hostname),o=await qz.gather((()=>{const t=Gz.normalizeUrl(e);return qz._gatherArtifactsFromBrowser(t,n,i)}),n);return qz.audit(o,n)}function generateConfig(e,t){return new Wz(e,t)}lighthouse.generateConfig=generateConfig,lighthouse.getAuditList=qz.getAuditList,lighthouse.traceCategories=To.traceCategories,lighthouse.Audit=kc,lighthouse.Gatherer=$z,lighthouse.NetworkRecords=Lo;var Hz=lighthouse;const Yz=vi.exports,Kz=Symbol("monkeypatch");class ProtocolSession$1{constructor(e){this._session=e,this._targetInfo=void 0,this._nextProtocolTimeout=void 0,this._callbackMap=new WeakMap;const t=e.emit;t[Kz]||(e.emit=(r,...a)=>{const n=this._targetInfo&&"iframe"===this._targetInfo.type?this._targetInfo.targetId:void 0;return t.call(e,"*",{
|
1203
|
+
method:r,params:a[0],sessionId:n}),t.call(e,r,...a)},e.emit[Kz]=!0)}setTargetInfo(e){this._targetInfo=e}hasNextProtocolTimeout(){return void 0!==this._nextProtocolTimeout}getNextProtocolTimeout(){return this._nextProtocolTimeout||3e4}setNextProtocolTimeout(e){this._nextProtocolTimeout=e}on(e,t){this._session.on(e,t)}once(e,t){this._session.once(e,t)}addSessionAttachedListener(e){const listener=t=>e(new ProtocolSession$1(t));this._callbackMap.set(e,listener),this._getConnection().on("sessionattached",listener)}removeSessionAttachedListener(e){const t=this._callbackMap.get(e);t&&this._getConnection().off("sessionattached",t)}addProtocolMessageListener(e){this._session.on("*",e)}removeProtocolMessageListener(e){this._session.off("*",e)}off(e,t){this._session.off(e,t)}sendCommand(e,...t){const r=this.getNextProtocolTimeout();let a;this._nextProtocolTimeout=void 0;const n=new Promise(((t,n)=>{r!==1/0&&(a=setTimeout(n,r,new Yz(Yz.errors.PROTOCOL_TIMEOUT,{protocolMethod:e})))
|
1204
|
+
})),i=this._session.send(e,...t);return Promise.race([i,n]).finally((()=>{a&&clearTimeout(a)}))}async dispose(){this._session.removeAllListeners(),await this._session.detach()}_getConnection(){const e=this._session.connection();if(!e)throw new Error("Connection has been closed.");return e}}var Jz=ProtocolSession$1;const Xz=on.default,Zz=Jz,Qz=yi,eV=gi,throwNotConnectedFn=()=>{throw new Error("Session not connected")},tV={setTargetInfo:throwNotConnectedFn,hasNextProtocolTimeout:throwNotConnectedFn,getNextProtocolTimeout:throwNotConnectedFn,setNextProtocolTimeout:throwNotConnectedFn,on:throwNotConnectedFn,once:throwNotConnectedFn,off:throwNotConnectedFn,addProtocolMessageListener:throwNotConnectedFn,removeProtocolMessageListener:throwNotConnectedFn,addSessionAttachedListener:throwNotConnectedFn,removeSessionAttachedListener:throwNotConnectedFn,sendCommand:throwNotConnectedFn,dispose:throwNotConnectedFn};var rV=class Driver$3{constructor(e){this._page=e,this._session=void 0,
|
1205
|
+
this._executionContext=void 0,this._fetcher=void 0,this.defaultSession=tV}get executionContext(){return this._executionContext?this._executionContext:throwNotConnectedFn()}get fetcher(){return this._fetcher?this._fetcher:throwNotConnectedFn()}async url(){return this._page.url()}async connect(){if(this._session)return;const e={msg:"Connecting to browser",id:"lh:driver:connect"};Xz.time(e);const t=await this._page.target().createCDPSession();this._session=this.defaultSession=new Zz(t),this._executionContext=new Qz(this._session),this._fetcher=new eV(this._session,this._executionContext),Xz.timeEnd(e)}async disconnect(){this._session&&await this._session.dispose()}};const aV=on.default;function createDependencyError(e,t){return new Error(`Dependency "${e.id}" failed with exception: ${t.message}`)}const nV={startInstrumentation:void 0,startSensitiveInstrumentation:"startInstrumentation",stopSensitiveInstrumentation:"startSensitiveInstrumentation",
|
1206
|
+
stopInstrumentation:"stopSensitiveInstrumentation",getArtifact:"stopInstrumentation"};async function collectArtifactDependencies(e,t){if(!e.dependencies)return{};const r=Object.entries(e.dependencies).map((async([e,r])=>{const a=t[r.id];if(void 0===a)throw new Error(`"${r.id}" did not run`);if(a instanceof Error)throw createDependencyError(r,a);const n=Promise.resolve().then((()=>a)).catch((e=>Promise.reject(createDependencyError(r,e))));return[e,await n]}));return Object.fromEntries(await Promise.all(r))}var iV={getEmptyArtifactState:function getEmptyArtifactState$3(){return{startInstrumentation:{},startSensitiveInstrumentation:{},stopSensitiveInstrumentation:{},stopInstrumentation:{},getArtifact:{}}},awaitArtifacts:async function awaitArtifacts$3(e){const t={};for(const[r,a]of Object.entries(e.getArtifact)){const e=await a.catch((e=>e));void 0!==e&&(t[r]=e)}return t},collectPhaseArtifacts:async function collectPhaseArtifacts$3(e){
|
1207
|
+
const{driver:t,artifactDefinitions:r,artifactState:a,baseArtifacts:n,phase:i,gatherMode:o,computedCache:s,settings:c,url:l}=e,u=nV[i],d=u&&a[u]||{};for(const e of r){aV["getArtifact"===i?"log":"verbose"](`artifacts:${i}`,e.id);const r=e.gatherer.instance,u=(d[e.id]||Promise.resolve()).then((async()=>{const u="getArtifact"===i?await collectArtifactDependencies(e,a.getArtifact):{};return r[i]({url:l,gatherMode:o,driver:t,baseArtifacts:n,dependencies:u,computedCache:s,settings:c})}));await u.catch((()=>{})),a[i][e.id]=u}},collectArtifactDependencies};const oV=gu.exports,sV=yu,{deepClone:cV}=xz,lV={performance:[{id:"uses-responsive-images-snapshot",weight:0},{id:"experimental-interaction-to-next-paint",weight:0,group:"metrics",acronym:"INP",relevantAudits:sV.inpRelevantAudits},{id:"work-during-interaction",weight:0}]};const uV={DevtoolsLog:"",Trace:"",Accessibility:"",AnchorElements:"",CacheContents:"",ConsoleMessages:"",CSSUsage:"",Doctype:"",DOMStats:"",EmbeddedContent:"",FontSize:"",
|
1208
|
+
Inputs:"",FullPageScreenshot:"",GlobalListeners:"",IFrameElements:"",ImageElements:"",InstallabilityErrors:"",InspectorIssues:"",JsUsage:"",LinkElements:"",MainDocumentContent:"",MetaElements:"",NetworkUserAgent:"",OptimizedImages:"",PasswordInputsWithPreventedPaste:"",ResponseCompression:"",RobotsTxt:"",ServiceWorker:"",ScriptElements:"",SourceMaps:"",Stacks:"",TagsBlockingFirstPaint:"",TapTargets:"",TraceElements:"",ViewportDimensions:"",WebAppManifest:"",devtoolsLogs:"",traces:""};for(const e of Object.keys(uV))uV[e]=e;var dV={artifacts:[{id:uV.DevtoolsLog,gatherer:"devtools-log"},{id:uV.Trace,gatherer:"trace"},{id:uV.Accessibility,gatherer:"accessibility"},{id:uV.AnchorElements,gatherer:"anchor-elements"},{id:uV.CacheContents,gatherer:"cache-contents"},{id:uV.ConsoleMessages,gatherer:"console-messages"},{id:uV.CSSUsage,gatherer:"css-usage"},{id:uV.Doctype,gatherer:"dobetterweb/doctype"},{id:uV.DOMStats,gatherer:"dobetterweb/domstats"},{id:uV.EmbeddedContent,
|
1209
|
+
gatherer:"seo/embedded-content"},{id:uV.FontSize,gatherer:"seo/font-size"},{id:uV.Inputs,gatherer:"inputs"},{id:uV.GlobalListeners,gatherer:"global-listeners"},{id:uV.IFrameElements,gatherer:"iframe-elements"},{id:uV.ImageElements,gatherer:"image-elements"},{id:uV.InstallabilityErrors,gatherer:"installability-errors"},{id:uV.InspectorIssues,gatherer:"inspector-issues"},{id:uV.JsUsage,gatherer:"js-usage"},{id:uV.LinkElements,gatherer:"link-elements"},{id:uV.MainDocumentContent,gatherer:"main-document-content"},{id:uV.MetaElements,gatherer:"meta-elements"},{id:uV.NetworkUserAgent,gatherer:"network-user-agent"},{id:uV.OptimizedImages,gatherer:"dobetterweb/optimized-images"},{id:uV.PasswordInputsWithPreventedPaste,gatherer:"dobetterweb/password-inputs-with-prevented-paste"},{id:uV.ResponseCompression,gatherer:"dobetterweb/response-compression"},{id:uV.RobotsTxt,gatherer:"seo/robots-txt"},{id:uV.ServiceWorker,gatherer:"service-worker"},{id:uV.ScriptElements,gatherer:"script-elements"},{
|
1210
|
+
id:uV.SourceMaps,gatherer:"source-maps"},{id:uV.Stacks,gatherer:"stacks"},{id:uV.TagsBlockingFirstPaint,gatherer:"dobetterweb/tags-blocking-first-paint"},{id:uV.TapTargets,gatherer:"seo/tap-targets"},{id:uV.TraceElements,gatherer:"trace-elements"},{id:uV.ViewportDimensions,gatherer:"viewport-dimensions"},{id:uV.WebAppManifest,gatherer:"web-app-manifest"},{id:uV.devtoolsLogs,gatherer:"devtools-log-compat"},{id:uV.traces,gatherer:"trace-compat"},{id:uV.FullPageScreenshot,gatherer:"full-page-screenshot"}],navigations:[{id:"default",pauseAfterFcpMs:1e3,pauseAfterLoadMs:1e3,networkQuietThresholdMs:1e3,cpuQuietThresholdMs:1e3,
|
1211
|
+
artifacts:[uV.DevtoolsLog,uV.Trace,uV.Accessibility,uV.AnchorElements,uV.CacheContents,uV.ConsoleMessages,uV.CSSUsage,uV.Doctype,uV.DOMStats,uV.EmbeddedContent,uV.FontSize,uV.Inputs,uV.GlobalListeners,uV.IFrameElements,uV.ImageElements,uV.InstallabilityErrors,uV.InspectorIssues,uV.JsUsage,uV.LinkElements,uV.MainDocumentContent,uV.MetaElements,uV.NetworkUserAgent,uV.OptimizedImages,uV.PasswordInputsWithPreventedPaste,uV.ResponseCompression,uV.RobotsTxt,uV.ServiceWorker,uV.ScriptElements,uV.SourceMaps,uV.Stacks,uV.TagsBlockingFirstPaint,uV.TapTargets,uV.TraceElements,uV.ViewportDimensions,uV.WebAppManifest,uV.devtoolsLogs,uV.traces,uV.FullPageScreenshot]}],settings:oV.settings,audits:[...(oV.audits||[]).map((e=>"string"==typeof e?{path:e}:e)),"byte-efficiency/uses-responsive-images-snapshot","metrics/experimental-interaction-to-next-paint","work-during-interaction"],categories:function mergeCategories(){if(!oV.categories)return{};const e=cV(oV.categories)
|
1212
|
+
;for(const t of Object.keys(lV))e[t]&&e[t].auditRefs.push(...lV[t]);return e}(),groups:oV.groups};const mV=on.default,pV=kc,hV=Object.keys({fetchTime:"",LighthouseRunWarnings:"",BenchmarkIndex:"",settings:"",Timing:"",URL:"",PageLoadError:"",HostFormFactor:"",HostUserAgent:"",GatherContext:""}),gV=["full-page-screenshot"],fV=["HostUserAgent","HostFormFactor","Stacks","GatherContext"];function getAuditIdsInCategories(e,t){if(!e)return new Set;const r=(t=t||Object.keys(e)).map((t=>e[t])).flatMap((e=>e?.auditRefs||[]));return new Set(r.map((e=>e.id)))}function filterArtifactsByAvailableAudits(e,t){if(!e)return null;if(!t)return e;const r=new Map(e.map((e=>[e.id,e]))),a=new Set([...fV,...t.flatMap((e=>e.implementation.meta.requiredArtifacts))]);let n=0;for(;n!==a.size;){n=a.size;for(const e of a){const t=r.get(e);if(t&&t.dependencies)for(const e of Object.values(t.dependencies))a.add(e.id)}}return e.filter((e=>a.has(e.id)))}function filterArtifactsByGatherMode(e,t){
|
1213
|
+
return e?e.filter((e=>e.gatherer.instance.meta.supportedModes.includes(t))):null}function filterNavigationsByAvailableArtifacts(e,t){if(!e)return e;const r=new Set(t.map((e=>e.id)).concat(hV));return e.map((e=>({...e,artifacts:e.artifacts.filter((e=>r.has(e.id)))}))).filter((e=>e.artifacts.length))}function filterAuditsByAvailableArtifacts(e,t){if(!e)return null;const r=new Set(t.map((e=>e.id)).concat(hV));return e.filter((e=>e.implementation.meta.requiredArtifacts.every((e=>r.has(e)))))}function filterAuditsByGatherMode(e,t){return e?e.filter((e=>{const r=e.implementation.meta;return!r.supportedModes||r.supportedModes.includes(t)})):null}function filterCategoriesByGatherMode(e,t){if(!e)return null;const r=Object.entries(e).filter((([e,r])=>!r.supportedModes||r.supportedModes.includes(t)));return Object.fromEntries(r)}function filterCategoriesByExplicitFilters(e,t){if(!e||!t)return e;const r=Object.entries(e).filter((([e])=>t.includes(e)));return Object.fromEntries(r)}
|
1214
|
+
function filterCategoriesByAvailableAudits(e,t){if(!e)return e;const r=new Map(t.map((e=>[e.implementation.meta.id,e.implementation.meta]))),a=Object.entries(e).map((([e,t])=>{const a={...t,auditRefs:t.auditRefs.filter((e=>r.has(e.id)))},n=a.auditRefs.length<t.auditRefs.length,i=a.auditRefs.every((e=>{const t=r.get(e.id);return!!t&&t.scoreDisplayMode===pV.SCORING_MODES.MANUAL}));return n&&i&&(a.auditRefs=[]),[e,a]})).filter((e=>"object"==typeof e[1]&&e[1].auditRefs.length));return Object.fromEntries(a)}var yV={filterConfigByGatherMode:function filterConfigByGatherMode$1(e,t){const r=filterArtifactsByGatherMode(e.artifacts,t),a=filterAuditsByAvailableArtifacts(filterAuditsByGatherMode(e.audits,t),r||[]),n=filterCategoriesByAvailableAudits(filterCategoriesByGatherMode(e.categories,t),a||[]);return{...e,artifacts:r,audits:a,categories:n}},filterConfigByExplicitFilters:function filterConfigByExplicitFilters$1(e,t){const{onlyAudits:r,onlyCategories:a,skipAudits:n}=t
|
1215
|
+
;!function warnOnUnknownOnlyCategories(e,t){if(t)for(const r of t)e?.[r]||mV.warn("config",`unrecognized category in 'onlyCategories': ${r}`)}(e.categories,a);let i=getAuditIdsInCategories(e.categories,void 0);a?i=getAuditIdsInCategories(e.categories,a):r&&(i=new Set);const o=new Set([...i,...r||[],...gV].filter((e=>!n||!n.includes(e)))),s=o.size&&e.audits?e.audits.filter((e=>o.has(e.implementation.meta.id))):e.audits,c=filterCategoriesByExplicitFilters(filterCategoriesByAvailableAudits(e.categories,s||[]),a),l=filterArtifactsByAvailableAudits(e.artifacts,s),u=filterNavigationsByAvailableArtifacts(e.navigations,l||[]);return{...e,artifacts:l,navigations:u,audits:s,categories:c}},filterArtifactsByGatherMode,filterArtifactsByAvailableAudits,filterNavigationsByAvailableArtifacts,filterAuditsByAvailableArtifacts,filterAuditsByGatherMode,filterCategoriesByAvailableAudits,filterCategoriesByExplicitFilters,filterCategoriesByGatherMode}
|
1216
|
+
;const vV=bn,bV=on.default,wV=pu,SV=dV,{defaultNavigationConfig:TV,nonSimulatedPassConfigOverrides:EV}=mn,{isFRGathererDefn:xV,throwInvalidDependencyOrder:_V,isValidArtifactDependency:AV,throwInvalidArtifactDependency:RV,assertArtifactTopologicalOrder:kV,assertValidConfig:DV}=Su,{filterConfigByGatherMode:CV,filterConfigByExplicitFilters:IV}=yV,{deepCloneConfigJson:NV,resolveSettings:LV,resolveAuditsToDefns:MV,resolveGathererToDefn:PV,mergePlugins:OV,mergeConfigFragment:FV,mergeConfigFragmentArrayByKey:UV}=xz,jV=vV.join("lighthouse-core/fraggle-rock/config","./default-config.js");function resolveWorkingCopy(e,t){let{configPath:r}=t;if(r&&!vV.isAbsolute(r))throw new Error("configPath must be an absolute path");e||(e=SV,r=jV);const a=r?vV.dirname(r):void 0;return{configWorkingCopy:NV(e),configPath:r,configDir:a}}function resolveArtifactDependencies(e,t,r){if(!("dependencies"in t.instance.meta))return;const a=Object.entries(t.instance.meta.dependencies).map((([a,n])=>{const i=r.get(n)
|
1217
|
+
;i||_V(e.id,a);return AV(t,i.gatherer)||RV(e.id,a),[a,{id:i.id}]}));return Object.fromEntries(a)}function resolveNavigationsToDefns(e,t,r){if(!e)return null;if(!t)throw new Error("Cannot use navigations without defining artifacts");const a={msg:"Resolve navigation definitions",id:"lh:config:resolveNavigationsToDefns"};bV.time(a,"verbose");const n=new Map(t.map((e=>[e.id,e]))),i=e.map((e=>{const t={...TV,...e},a=t.id,i=t.artifacts.map((e=>{const t=n.get(e);if(!t)throw new Error(`Unrecognized artifact "${e}" in navigation "${a}"`);return t})),o={...t,artifacts:i};return function overrideNavigationThrottlingWindows(e,t){e.disableThrottling||"simulate"!==t.throttlingMethod&&(e.cpuQuietThresholdMs=Math.max(e.cpuQuietThresholdMs||0,EV.cpuQuietThresholdMs),e.networkQuietThresholdMs=Math.max(e.networkQuietThresholdMs||0,EV.networkQuietThresholdMs),e.pauseAfterFcpMs=Math.max(e.pauseAfterFcpMs||0,EV.pauseAfterFcpMs),e.pauseAfterLoadMs=Math.max(e.pauseAfterLoadMs||0,EV.pauseAfterLoadMs))}(o,r),o
|
1218
|
+
}));return kV(i),bV.timeEnd(a),i}var BV={resolveWorkingCopy,initializeConfig:function initializeConfig$4(e,t){const r={msg:"Initialize config",id:"lh:config"};bV.time(r,"verbose");let{configWorkingCopy:a,configDir:n}=resolveWorkingCopy(e,t);a=function resolveExtensions(e){if(!e.extends)return e;if("lighthouse:default"!==e.extends)throw new Error("`lighthouse:default` is the only valid extension method.");const{artifacts:t,navigations:r,...a}=e,n=NV(SV),i=FV(n,a);return i.artifacts=UV(n.artifacts,t,(e=>e.id)),i.navigations=UV(n.navigations,r,(e=>e.id)),i}(a),a=OV(a,n,t.settingsOverrides);const i=LV(a.settings||{},t.settingsOverrides);!function overrideSettingsForGatherMode(e,t){"timespan"===t.gatherMode&&"simulate"===e.throttlingMethod&&(e.throttlingMethod="devtools")}(i,t);const o=function resolveArtifactsToDefns(e,t){if(!e)return null;const r={msg:"Resolve artifact definitions",id:"lh:config:resolveArtifactsToDefns"};bV.time(r,"verbose")
|
1219
|
+
;const a=new Map,n=wV.getGathererList(),i=e.map((e=>{const r=e.gatherer,i=PV(r,n,t);if(!xV(i))throw new Error(`${i.instance.name} gatherer does not have a Fraggle Rock meta obj`);const o={id:e.id,gatherer:i,dependencies:resolveArtifactDependencies(e,i,a)},s=o.gatherer.instance.meta.symbol;return s&&a.set(s,o),o}));return bV.timeEnd(r),i}(a.artifacts,n);let s={artifacts:o,navigations:resolveNavigationsToDefns(a.navigations,o,i),audits:MV(a.audits,n),categories:a.categories||null,groups:a.groups||null,settings:i};const{warnings:c}=DV(s);return s=CV(s,t.gatherMode),s=IV(s,i),bV.timeEnd(r),{config:s,warnings:c}}};const $V=on.default,qV=rV,zV=pu,{getEmptyArtifactState:VV,collectPhaseArtifacts:WV,awaitArtifacts:GV}=iV,{initializeConfig:HV}=BV,{getBaseArtifacts:YV,finalizeArtifacts:KV}=ac;var JV={snapshotGather:async function snapshotGather$2(e){const{configContext:t={}}=e;$V.setLevel(t.logLevel||"error");const{config:r}=HV(e.config,{...t,gatherMode:"snapshot"}),a=new qV(e.page)
|
1220
|
+
;await a.connect();const n=new Map,i=await a.url(),o={config:r,computedCache:n};return{artifacts:await zV.gather((async()=>{const e=await YV(r,a,{gatherMode:"snapshot"});e.URL.requestedUrl=i,e.URL.finalUrl=i;const t=r.artifacts||[],o=VV();await WV({url:i,phase:"getArtifact",gatherMode:"snapshot",driver:a,baseArtifacts:e,artifactDefinitions:t,artifactState:o,computedCache:n,settings:r.settings}),await a.disconnect();const s=await GV(o);return KV(e,s)}),o),runnerOptions:o}}};const XV=on.default,ZV=rV,QV=pu,{getEmptyArtifactState:eW,collectPhaseArtifacts:tW,awaitArtifacts:rW}=iV,{prepareTargetForTimespanMode:aW}=es,{initializeConfig:nW}=BV,{getBaseArtifacts:iW,finalizeArtifacts:oW}=ac;var sW={startTimespanGather:async function startTimespanGather$2(e){const{configContext:t={}}=e;XV.setLevel(t.logLevel||"error");const{config:r}=nW(e.config,{...t,gatherMode:"timespan"}),a=new ZV(e.page);await a.connect();const n=new Map,i=r.artifacts||[],o=await a.url(),s=await iW(r,a,{gatherMode:"timespan"
|
1221
|
+
}),c=eW(),l={url:o,driver:a,artifactDefinitions:i,artifactState:c,baseArtifacts:s,computedCache:n,gatherMode:"timespan",settings:r.settings};return await aW(a,r.settings),await tW({phase:"startInstrumentation",...l}),await tW({phase:"startSensitiveInstrumentation",...l}),{async endTimespanGather(){const e=await a.url();l.url=e;const t={config:r,computedCache:n};return{artifacts:await QV.gather((async()=>{s.URL.requestedUrl=o,s.URL.finalUrl=e,await tW({phase:"stopSensitiveInstrumentation",...l}),await tW({phase:"stopInstrumentation",...l}),await tW({phase:"getArtifact",...l}),await a.disconnect();const t=await rW(c);return oW(s,t)}),t),runnerOptions:t}}}}};const cW=on.default,lW=rV,uW=pu,{getEmptyArtifactState:dW,collectPhaseArtifacts:mW,awaitArtifacts:pW}=iV,hW=es,{gotoURL:gW}=_s,fW=Ko,yW=Wo,{defaultNavigationConfig:vW}=mn,{initializeConfig:bW}=BV,{getBaseArtifacts:wW,finalizeArtifacts:SW}=ac,TW=Vn,EW=vi.exports,xW=ji,{getPageLoadError:_W}=Bo,AW=oo,RW=Ws,kW=Lo
|
1222
|
+
;async function _setup({driver:e,config:t,requestor:r,options:a}){await e.connect(),a?.skipAboutBlank||await gW(e,vW.blankPage,{waitUntil:["navigated"]});const n=await wW(t,e,{gatherMode:"navigation"});return"string"==typeof r&&(n.URL.requestedUrl=r),await hW.prepareTargetForNavigationMode(e,t.settings),{baseArtifacts:n}}async function _setupNavigation({requestor:e,driver:t,navigation:r,config:a,options:n}){n?.skipAboutBlank||await gW(t,r.blankPage,{...r,waitUntil:["navigated"]});const{warnings:i}=await hW.prepareTargetForIndividualNavigation(t.defaultSession,a.settings,{...r,requestor:e});return{warnings:i}}async function _navigate(e){const{driver:t,config:r,requestor:a}=e;try{const{requestedUrl:n,finalUrl:i,warnings:o}=await gW(t,a,{...e.navigation,debugNavigation:r.settings.debugNavigation,maxWaitForFcp:r.settings.maxWaitForFcp,maxWaitForLoad:r.settings.maxWaitForLoad,waitUntil:e.navigation.pauseAfterFcpMs?["fcp","load"]:["load"]});return{requestedUrl:n,finalUrl:i,
|
1223
|
+
navigationError:void 0,warnings:o}}catch(e){if(!(e instanceof EW))throw e;if("NO_FCP"!==e.code&&"PAGE_HUNG"!==e.code)throw e;if("string"!=typeof a)throw e;return{requestedUrl:a,finalUrl:a,navigationError:e,warnings:[]}}}async function _computeNavigationResult(e,t,r,a){const{navigationError:n,finalUrl:i}=a,o=[...r.warnings,...a.warnings],s=await async function _collectDebugData(e,t){const r=t.artifactDefinitions.find((e=>e.gatherer.instance.meta.symbol===RW.symbol)),a=t.artifactDefinitions.find((e=>e.gatherer.instance.meta.symbol===AW.symbol)),n=[r,a].filter((e=>Boolean(e)));if(!n.length)return{};await mW({...t,phase:"getArtifact",artifactDefinitions:n});const i=t.artifactState.getArtifact,o=r?.id,s=o&&await i[o],c=s&&await kW.request(s,e),l=a?.id;return{devtoolsLog:s,records:c,trace:l&&await i[l]}}(e,t),c=s.records?_W(n,{url:i,loadFailureMode:e.navigation.loadFailureMode,networkRecords:s.records}):n;if(c){const t=e.config.settings.locale,r=TW.getFormatted(c.friendlyMessage,t)
|
1224
|
+
;cW.error("NavigationRunner",r,a.requestedUrl);const n={},l=`pageLoadError-${e.navigation.id}`;return s.devtoolsLog&&(n.devtoolsLogs={[l]:s.devtoolsLog}),s.trace&&(n.traces={[l]:s.trace}),{requestedUrl:a.requestedUrl,finalUrl:i,pageLoadError:c,artifacts:n,warnings:[...o,c.friendlyMessage]}}{await mW({phase:"getArtifact",...t});const e=await pW(t.artifactState);return{requestedUrl:a.requestedUrl,finalUrl:i,artifacts:e,warnings:o,pageLoadError:void 0}}}async function _navigation(e){const t=dW(),r={url:await e.driver.url(),gatherMode:"navigation",driver:e.driver,computedCache:e.computedCache,artifactDefinitions:e.navigation.artifacts,artifactState:t,baseArtifacts:e.baseArtifacts,settings:e.config.settings},a=await _setupNavigation(e);await mW({phase:"startInstrumentation",...r}),await mW({phase:"startSensitiveInstrumentation",...r});const n=await _navigate(e);return r.url=n.finalUrl,await mW({phase:"stopSensitiveInstrumentation",...r}),await mW({phase:"stopInstrumentation",...r}),
|
1225
|
+
await async function _cleanupNavigation({driver:e}){await yW.clearThrottling(e.defaultSession)}(e),_computeNavigationResult(e,r,a,n)}async function _navigations({driver:e,config:t,requestor:r,baseArtifacts:a,computedCache:n,options:i}){if(!t.navigations)throw new Error("No navigations configured");const o={},s=[];for(const c of t.navigations){const l={driver:e,navigation:c,requestor:r,config:t,baseArtifacts:a,computedCache:n,options:i};let u=!1;const d=await _navigation(l);if("fatal"===c.loadFailureMode&&(d.pageLoadError&&(o.PageLoadError=d.pageLoadError,u=!0),o.URL={requestedUrl:d.requestedUrl,finalUrl:d.finalUrl}),s.push(...d.warnings),Object.assign(o,d.artifacts),u)break}return{artifacts:{...o,LighthouseRunWarnings:s}}}async function _cleanup({requestedUrl:e,driver:t,config:r}){!r.settings.disableStorageReset&&e&&await fW.clearDataForOrigin(t.defaultSession,e),await t.disconnect()}var DW={navigationGather:async function navigationGather$2(e,t){const{page:r,configContext:a={}}=t
|
1226
|
+
;cW.setLevel(a.logLevel||"error");const{config:n}=bW(t.config,{...a,gatherMode:"navigation"}),i=new Map,o={skipAboutBlank:a.skipAboutBlank};"string"!=typeof e&&(o.skipAboutBlank=!0);const s={config:n,computedCache:i};return{artifacts:await uW.gather((async()=>{const t={driver:new lW(r),config:n,requestor:"string"==typeof e?xW.normalizeUrl(e):e,options:o},{baseArtifacts:a}=await _setup(t),{artifacts:s}=await _navigations({...t,baseArtifacts:a,computedCache:i});return await _cleanup(t),SW(a,s)}),s),runnerOptions:s}},_setup,_setupNavigation,_navigate,_navigation,_navigations,_cleanup};const{generateFlowReportHtml:CW}=Zl,{snapshotGather:IW}=JV,{startTimespanGather:NW}=sW,{navigationGather:LW}=DW,MW=pu,{initializeConfig:PW}=BV;async function auditGatherSteps$1(e,t){if(!e.length)throw new Error("Need at least one step before getting the result");const r=[];for(const a of e){const{artifacts:e,name:n,configContext:i}=a;let o=t.gatherStepRunnerOptions?.get(a);if(!o){
|
1227
|
+
const r=a.config||t.config,{gatherMode:n}=e.GatherContext,{config:s}=PW(r,{...i,gatherMode:n});o={config:s,computedCache:new Map}}const s=await MW.audit(e,o);if(!s)throw new Error(`Step "${n}" did not return a result`);r.push({lhr:s.lhr,name:n})}const a=new URL(e[0].artifacts.URL.finalUrl);return{steps:r,name:t.name||`User flow (${a.hostname})`}}var OW={UserFlow:class UserFlow$1{constructor(e,t){this.options={page:e,...t},this.name=t?.name,this._gatherSteps=[],this._gatherStepRunnerOptions=new WeakMap}_shortenUrl(e){const t=new URL(e);return`${t.hostname}${t.pathname}`}_getDefaultStepName(e){const t=this._shortenUrl(e.URL.finalUrl);switch(e.GatherContext.gatherMode){case"navigation":return`Navigation report (${t})`;case"timespan":return`Timespan report (${t})`;case"snapshot":return`Snapshot report (${t})`}}_getNextNavigationOptions(e){const t={...this.options,...e},r={...t.configContext},a={...r.settingsOverrides};void 0===r.skipAboutBlank&&(r.skipAboutBlank=!0)
|
1228
|
+
;return this._gatherSteps.some((e=>"navigation"===e.artifacts.GatherContext.gatherMode))&&void 0===a.disableStorageReset&&(a.disableStorageReset=!0),r.settingsOverrides=a,t.configContext=r,t}_addGatherStep(e,t){const r=t?.stepName,a={artifacts:e.artifacts,name:r||this._getDefaultStepName(e.artifacts),config:t.config,configContext:t.configContext};this._gatherSteps.push(a),this._gatherStepRunnerOptions.set(a,e.runnerOptions)}async navigate(e,t){if(this.currentTimespan)throw new Error("Timespan already in progress");const r=this._getNextNavigationOptions(t),a=await LW(e,r);return this._addGatherStep(a,r),a}async startTimespan(e){if(this.currentTimespan)throw new Error("Timespan already in progress");const t={...this.options,...e},r=await NW(t);this.currentTimespan={timespan:r,options:t}}async endTimespan(){if(!this.currentTimespan)throw new Error("No timespan in progress");const{timespan:e,options:t}=this.currentTimespan,r=await e.endTimespanGather();return this.currentTimespan=void 0,
|
1229
|
+
this._addGatherStep(r,t),r}async snapshot(e){if(this.currentTimespan)throw new Error("Timespan already in progress");const t={...this.options,...e},r=await IW(t);return this._addGatherStep(r,t),r}async createFlowResult(){return auditGatherSteps$1(this._gatherSteps,{name:this.name,config:this.options.config,gatherStepRunnerOptions:this._gatherStepRunnerOptions})}async generateReport(){const e=await this.createFlowResult();return CW(e)}createArtifactsJson(){return{gatherSteps:this._gatherSteps,name:this.name}}},auditGatherSteps:auditGatherSteps$1};const{UserFlow:FW,auditGatherSteps:UW}=OW,{snapshotGather:jW}=JV,{startTimespanGather:BW}=sW,{navigationGather:$W}=DW,{generateFlowReportHtml:qW}=Zl,zW=pu;var VW=async function snapshot(...e){const t=await jW(...e);return zW.audit(t.artifacts,t.runnerOptions)},WW=async function startTimespan(...e){const{endTimespanGather:t}=await BW(...e);return{endTimespan:async()=>{const e=await t();return zW.audit(e.artifacts,e.runnerOptions)}}
|
1230
|
+
},GW=async function navigation(...e){const t=await $W(...e);return zW.audit(t.artifacts,t.runnerOptions)};const HW=uo;var YW=class RawConnection extends HW{constructor(e){super(),this._port=e,this._port.on("message",this.handleRawMessage.bind(this)),this._port.on("close",this.dispose.bind(this))}connect(){return Promise.resolve()}disconnect(){return this._port.close(),Promise.resolve()}sendRawMessage(e){this._port.send(e)}};globalThis.Buffer=Buffer$2,"undefined"!=typeof self?(globalThis.isDevtools=!0,self.setUpWorkerConnection=function setUpWorkerConnection(e){return new YW(e)},self.runLighthouse=Hz,self.runLighthouseNavigation=GW,self.startLighthouseTimespan=WW,self.runLighthouseSnapshot=VW,self.createConfig=function createConfig(e,t){const r={onlyCategories:e,screenEmulation:{disabled:!0}};return"desktop"===t&&(r.throttling=mn.throttling.desktopDense4G,r.emulatedUserAgent=mn.userAgents.desktop,r.formFactor="desktop"),{extends:"lighthouse:default",
|
1231
|
+
plugins:["lighthouse-plugin-publisher-ads"],settings:r}},self.listenForStatus=function listenForStatus(e){Log.events.addListener("status",e)},self.registerLocaleData=Vn.registerLocaleData,self.lookupLocale=function lookupCanonicalLocale(e){return oi.lookupLocale(e,Vn.getCanonicalLocales())}):global.runBundledLighthouse=Hz}();
|