New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

perfume.js

Package Overview
Dependencies
Maintainers
1
Versions
157
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

perfume.js - npm Package Compare versions

Comparing version 8.0.0 to 8.1.0

dist/es/onVisibilityChange.js

10

dist/es/perfume.js
/**
* Perfume.js v8.0.0 (http://zizzamia.github.io/perfume)
* Perfume.js v8.1.0 (http://zizzamia.github.io/perfume)
* Copyright 2022 Leonardo Zizzamia (https://github.com/Zizzamia/perfume.js/graphs/contributors)

@@ -17,2 +17,3 @@ * Licensed under MIT (https://github.com/Zizzamia/perfume.js/blob/master/LICENSE)

import { initPerformanceObserver } from './observe';
import { didVisibilityChange } from './onVisibilityChange';
import { reportStorageEstimate } from './storageEstimate';

@@ -25,3 +26,3 @@ import { roundByFour } from './utils';

if (options === void 0) { options = {}; }
this.v = '8.0.0';
this.v = '8.1.0';
// Extend default config with external options

@@ -40,2 +41,7 @@ config.analyticsTracker = options.analyticsTracker;

}
// Init visibilitychange listener
if (typeof document.hidden !== 'undefined') {
// Opera 12.10 and Firefox 18 and later support
document.addEventListener('visibilitychange', function () { return didVisibilityChange; });
}
var navigationTiming = getNavigationTiming();

@@ -42,0 +48,0 @@ // Log Navigation Timing

4

dist/es/reportPerf.js
import { config } from './config';
import { getNavigatorInfo } from './getNavigatorInfo';
import { visibility } from './onVisibilityChange';
import { pushTask } from './utils';

@@ -9,3 +10,4 @@ /**

pushTask(function () {
if (!config.analyticsTracker) {
// Doesn't send timing when page is hidden
if (visibility.isHidden || !config.analyticsTracker) {
return;

@@ -12,0 +14,0 @@ }

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/**
* Perfume.js v8.0.0 (http://zizzamia.github.io/perfume)
* Perfume.js v8.1.0 (http://zizzamia.github.io/perfume)
* Copyright 2022 Leonardo Zizzamia (https://github.com/Zizzamia/perfume.js/graphs/contributors)

@@ -19,2 +19,3 @@ * Licensed under MIT (https://github.com/Zizzamia/perfume.js/blob/master/LICENSE)

var observe_1 = require("./observe");
var onVisibilityChange_1 = require("./onVisibilityChange");
var storageEstimate_1 = require("./storageEstimate");

@@ -27,3 +28,3 @@ var utils_1 = require("./utils");

if (options === void 0) { options = {}; }
this.v = '8.0.0';
this.v = '8.1.0';
// Extend default config with external options

@@ -42,2 +43,7 @@ config_1.config.analyticsTracker = options.analyticsTracker;

}
// Init visibilitychange listener
if (typeof document.hidden !== 'undefined') {
// Opera 12.10 and Firefox 18 and later support
document.addEventListener('visibilitychange', function () { return onVisibilityChange_1.didVisibilityChange; });
}
var navigationTiming = (0, getNavigationTiming_1.getNavigationTiming)();

@@ -44,0 +50,0 @@ // Log Navigation Timing

@@ -6,2 +6,3 @@ "use strict";

var getNavigatorInfo_1 = require("./getNavigatorInfo");
var onVisibilityChange_1 = require("./onVisibilityChange");
var utils_1 = require("./utils");

@@ -13,3 +14,4 @@ /**

(0, utils_1.pushTask)(function () {
if (!config_1.config.analyticsTracker) {
// Doesn't send timing when page is hidden
if (onVisibilityChange_1.visibility.isHidden || !config_1.config.analyticsTracker) {
return;

@@ -16,0 +18,0 @@ }

@@ -1,2 +0,2 @@

var e,t,n,r,i,a={isResourceTiming:!1,isElementTiming:!1,maxTime:3e4},o=window,u=o.console,c=o.navigator,s=o.performance,f=function(){return c.deviceMemory},l=function(){return c.hardwareConcurrency},m=function(){return s&&!!s.getEntriesByType&&!!s.now&&!!s.mark},d="4g",v=!1,p={},T={value:0},g={value:{beacon:0,css:0,fetch:0,img:0,other:0,script:0,total:0,xmlhttprequest:0}},h={value:0},y={value:0},E=function(e,t){try{var n=new PerformanceObserver((function(e){t(e.getEntries())}));return n.observe({type:e,buffered:!0}),n}catch(e){u.warn("Perfume.js:",e)}return null},S=function(){return!!(l()&&l()<=4)||!!(f()&&f()<=4)},b=function(e,t){switch(e){case"slow-2g":case"2g":case"3g":return!0;default:return S()||t}},w=function(e){return parseFloat(e.toFixed(4))},k=function(e){return"number"!=typeof e?null:w(e/Math.pow(1024,2))},C=function(e,t,n,r){var i;i=function(){a.analyticsTracker&&a.analyticsTracker({attribution:r,metricName:e,data:t,navigatorInformation:c?{deviceMemory:f()||0,hardwareConcurrency:l()||0,serviceWorkerStatus:"serviceWorker"in c?c.serviceWorker.controller?"controlled":"supported":"unsupported",isLowEndDevice:S(),isLowEndExperience:b(d,v)}:{},rating:n})},"requestIdleCallback"in o?o.requestIdleCallback(i,{timeout:3e3}):i()},L=function(e){e.forEach((function(e){if(!("self"!==e.name||e.startTime<T.value)){var t=e.duration-50;t>0&&(h.value+=t,y.value+=t)}}))},B={RT:[100,200],TBT:[200,600],NTBT:[200,600]},M=function(e,t){return B[e]?t<=B[e][0]?"good":t<=B[e][1]?"needsImprovement":"poor":null},x=function(e,t,n){Object.keys(t).forEach((function(e){"number"==typeof t[e]&&(t[e]=w(t[e]))})),C(e,t,null,n||{})},F=function(e){var t=e.attribution,n=e.name,r=e.rating,i=e.value;"FCP"===n&&(T.value=i),["FCP","LCP"].includes(n)&&E("longtask",L),"FID"===n&&setTimeout((function(){F({attribution:t,name:"TBT",rating:M("TBT",h.value),value:h.value}),x("dataConsumption",g.value)}),1e4);var o=w(i);o<=a.maxTime&&o>=0&&C(n,o,r,t)},D=function(){return window.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0]},I=function(e){if("loading"===document.readyState)return"loading";var t=D();if(t){if(e<t.domInteractive)return"loading";if(0===t.domContentLoadedEventStart||e<t.domContentLoadedEventStart)return"dom-interactive";if(0===t.domComplete||e<t.domComplete)return"dom-content-loaded"}return"complete"},P=function(e){var t=e.nodeName;return 1===e.nodeType?t.toLowerCase():t.toUpperCase().replace(/^#/,"")},q=function(e,t){var n="";try{for(;e&&9!==e.nodeType;){var r=e,i=r.id?"#"+r.id:P(r)+(r.className&&r.className.length?"."+r.className.replace(/\s+/g,"."):"");if(n.length+i.length>(t||100)-1)return n||i;if(n=n?i+">"+n:i,r.id)break;e=r.parentNode}}catch(e){}return n},A=-1,R=function(){return A},N=function(e){addEventListener("pageshow",(function(t){t.persisted&&(A=t.timeStamp,e(t))}),!0)},_=function(){var e=D();return e&&e.activationStart||0},O=function(e,t){var n=D(),r="navigate";return R()>=0?r="back-forward-cache":n&&(r=document.prerendering||_()>0?"prerender":n.type.replace(/_/g,"-")),{name:e,value:void 0===t?-1:t,rating:"good",delta:0,entries:[],id:"v3-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:r}},z=function(e,t,n){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var r=new PerformanceObserver((function(e){t(e.getEntries())}));return r.observe(Object.assign({type:e,buffered:!0},n||{})),r}}catch(e){}},W=function(e,t){var n=function n(r){"pagehide"!==r.type&&"hidden"!==document.visibilityState||(e(r),t&&(removeEventListener("visibilitychange",n,!0),removeEventListener("pagehide",n,!0)))};addEventListener("visibilitychange",n,!0),addEventListener("pagehide",n,!0)},j=function(e,t,n,r){var i,a;return function(o){t.value>=0&&(o||r)&&((a=t.value-(i||0))||void 0===i)&&(i=t.value,t.delta=a,t.rating=function(e,t){return e>t[1]?"poor":e>t[0]?"needs-improvement":"good"}(t.value,n),e(t))}},H=-1,U=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},V=function(){W((function(e){var t=e.timeStamp;H=t}),!0)},G=function(){return H<0&&(H=U(),V(),N((function(){setTimeout((function(){H=U(),V()}),0)}))),{get firstHiddenTime(){return H}}},J=function(e,t){t=t||{};var n,r=[1800,3e3],i=G(),a=O("FCP"),o=function(e){e.forEach((function(e){"first-contentful-paint"===e.name&&(c&&c.disconnect(),e.startTime<i.firstHiddenTime&&(a.value=Math.max(e.startTime-_(),0),a.entries.push(e),n(!0)))}))},u=window.performance&&window.performance.getEntriesByName&&window.performance.getEntriesByName("first-contentful-paint")[0],c=u?null:z("paint",o);(u||c)&&(n=j(e,a,r,t.reportAllChanges),u&&o([u]),N((function(i){a=O("FCP"),n=j(e,a,r,t.reportAllChanges),requestAnimationFrame((function(){requestAnimationFrame((function(){a.value=performance.now()-i.timeStamp,n(!0)}))}))})))},K=!1,Q=-1,X={passive:!0,capture:!0},Y=new Date,Z=function(r,i){e||(e=i,t=r,n=new Date,te(removeEventListener),$())},$=function(){if(t>=0&&t<n-Y){var i={entryType:"first-input",name:e.type,target:e.target,cancelable:e.cancelable,startTime:e.timeStamp,processingStart:e.timeStamp+t};r.forEach((function(e){e(i)})),r=[]}},ee=function(e){if(e.cancelable){var t=(e.timeStamp>1e12?new Date:performance.now())-e.timeStamp;"pointerdown"==e.type?function(e,t){var n=function(){Z(e,t),i()},r=function(){i()},i=function(){removeEventListener("pointerup",n,X),removeEventListener("pointercancel",r,X)};addEventListener("pointerup",n,X),addEventListener("pointercancel",r,X)}(t,e):Z(t,e)}},te=function(e){["mousedown","keydown","touchstart","pointerdown"].forEach((function(t){return e(t,ee,X)}))},ne=function(n,i){i=i||{};var a,o=[100,300],u=G(),c=O("FID"),s=function(e){e.startTime<u.firstHiddenTime&&(c.value=e.processingStart-e.startTime,c.entries.push(e),a(!0))},f=function(e){e.forEach(s)},l=z("first-input",f);a=j(n,c,o,i.reportAllChanges),l&&W((function(){f(l.takeRecords()),l.disconnect()}),!0),l&&N((function(){var u;c=O("FID"),a=j(n,c,o,i.reportAllChanges),r=[],t=-1,e=null,te(addEventListener),u=s,r.push(u),$()}))},re=0,ie=1/0,ae=0,oe=function(e){e.forEach((function(e){e.interactionId&&(ie=Math.min(ie,e.interactionId),ae=Math.max(ae,e.interactionId),re=ae?(ae-ie)/7+1:0)}))},ue=function(){return i?re:performance.interactionCount||0},ce=function(){"interactionCount"in performance||i||(i=z("event",oe,{type:"event",buffered:!0,durationThreshold:0}))},se=0,fe=function(){return ue()-se},le=[],me={},de=function(e){var t=le[le.length-1],n=me[e.interactionId];if(n||le.length<10||e.duration>t.latency){if(n)n.entries.push(e),n.latency=Math.max(n.latency,e.duration);else{var r={id:e.interactionId,latency:e.duration,entries:[e]};me[r.id]=r,le.push(r)}le.sort((function(e,t){return t.latency-e.latency})),le.splice(10).forEach((function(e){delete me[e.id]}))}},ve=function(e,t){!function(e,t){t=t||{};var n=[200,500];ce();var r,i=O("INP"),a=function(e){e.forEach((function(e){e.interactionId&&de(e),"first-input"===e.entryType&&!le.some((function(t){return t.entries.some((function(t){return e.duration===t.duration&&e.startTime===t.startTime}))}))&&de(e)}));var t,n=(t=Math.min(le.length-1,Math.floor(fe()/50)),le[t]);n&&n.latency!==i.value&&(i.value=n.latency,i.entries=n.entries,r())},o=z("event",a,{durationThreshold:t.durationThreshold||40});r=j(e,i,n,t.reportAllChanges),o&&(o.observe({type:"first-input",buffered:!0}),W((function(){a(o.takeRecords()),i.value<0&&fe()>0&&(i.value=0,i.entries=[]),r(!0)})),N((function(){le=[],se=ue(),i=O("INP"),r=j(e,i,n,t.reportAllChanges)})))}((function(t){!function(e){if(e.entries.length){var t=e.entries.sort((function(e,t){return t.duration-e.duration||t.processingEnd-t.processingStart-(e.processingEnd-e.processingStart)}))[0];e.attribution={eventTarget:q(t.target),eventType:t.name,eventTime:t.startTime,eventEntry:t,loadState:I(t.startTime)}}else e.attribution={}}(t),e(t)}),t)},pe={},Te=function e(t){document.prerendering?addEventListener("prerenderingchange",(function(){return e(t)}),!0):"complete"!==document.readyState?addEventListener("load",(function(){return e(t)}),!0):setTimeout(t,0)},ge=function(e,t){t=t||{};var n=[800,1800],r=O("TTFB"),i=j(e,r,n,t.reportAllChanges);Te((function(){var a=D();if(a){if(r.value=Math.max(a.responseStart-_(),0),r.value<0||r.value>performance.now())return;r.entries=[a],i(!0),N((function(){r=O("TTFB",0),(i=j(e,r,n,t.reportAllChanges))(!0)}))}}))},he=function(e){e.forEach((function(e){e.identifier&&F({attribution:{identifier:e.identifier},name:"ET",rating:null,value:e.startTime})}))},ye=function(e){e.forEach((function(e){if(a.isResourceTiming&&x("resourceTiming",e),e.decodedBodySize&&e.initiatorType){var t=e.decodedBodySize/1e3;g.value[e.initiatorType]+=t,g.value.total+=t}}))},Ee=function(){!function(e,t){ge((function(t){!function(e){if(e.entries.length){var t=e.entries[0],n=t.activationStart||0,r=Math.max(t.domainLookupStart-n,0),i=Math.max(t.connectStart-n,0),a=Math.max(t.requestStart-n,0);e.attribution={waitingTime:r,dnsTime:i-r,connectionTime:a-i,requestTime:e.value-a,navigationEntry:t}}else e.attribution={waitingTime:0,dnsTime:0,connectionTime:0,requestTime:0}}(t),e(t)}),t)}((function(e){e.value=e.value-e.entries[0].requestStart,F(e)})),function(e,t){!function(e,t){t=t||{};var n=[.1,.25];K||(J((function(e){Q=e.value})),K=!0);var r,i=function(t){Q>-1&&e(t)},a=O("CLS",0),o=0,u=[],c=function(e){e.forEach((function(e){if(!e.hadRecentInput){var t=u[0],n=u[u.length-1];o&&e.startTime-n.startTime<1e3&&e.startTime-t.startTime<5e3?(o+=e.value,u.push(e)):(o=e.value,u=[e]),o>a.value&&(a.value=o,a.entries=u,r())}}))},s=z("layout-shift",c);s&&(r=j(i,a,n,t.reportAllChanges),W((function(){c(s.takeRecords()),r(!0)})),N((function(){o=0,Q=-1,a=O("CLS",0),r=j(i,a,n,t.reportAllChanges)})))}((function(t){!function(e){if(e.entries.length){var t=e.entries.reduce((function(e,t){return e&&e.value>t.value?e:t}));if(t&&t.sources&&t.sources.length){var n=(r=t.sources).find((function(e){return e.node&&1===e.node.nodeType}))||r[0];if(n)return void(e.attribution={largestShiftTarget:q(n.node),largestShiftTime:t.startTime,largestShiftValue:t.value,largestShiftSource:n,largestShiftEntry:t,loadState:I(t.startTime)})}}var r;e.attribution={}}(t),e(t)}),t)}((function(e){return F(e)})),function(e,t){J((function(t){!function(e){if(e.entries.length){var t=D(),n=e.entries[e.entries.length-1];if(t){var r=t.activationStart||0,i=Math.max(0,t.responseStart-r);return void(e.attribution={timeToFirstByte:i,firstByteToFCP:e.value-i,loadState:I(e.entries[0].startTime),navigationEntry:t,fcpEntry:n})}}e.attribution={timeToFirstByte:0,firstByteToFCP:e.value,loadState:I(R())}}(t),e(t)}),t)}((function(e){return F(e)})),function(e,t){ne((function(t){!function(e){var t=e.entries[0];e.attribution={eventTarget:q(t.target),eventType:t.name,eventTime:t.startTime,eventEntry:t,loadState:I(t.startTime)}}(t),e(t)}),t)}((function(e){return F(e)})),function(e,t){!function(e,t){t=t||{};var n,r=[2500,4e3],i=G(),a=O("LCP"),o=function(e){var t=e[e.length-1];if(t){var r=Math.max(t.startTime-_(),0);r<i.firstHiddenTime&&(a.value=r,a.entries=[t],n())}},u=z("largest-contentful-paint",o);if(u){n=j(e,a,r,t.reportAllChanges);var c=function(){pe[a.id]||(o(u.takeRecords()),u.disconnect(),pe[a.id]=!0,n(!0))};["keydown","click"].forEach((function(e){addEventListener(e,c,{once:!0,capture:!0})})),W(c,!0),N((function(i){a=O("LCP"),n=j(e,a,r,t.reportAllChanges),requestAnimationFrame((function(){requestAnimationFrame((function(){a.value=performance.now()-i.timeStamp,pe[a.id]=!0,n(!0)}))}))}))}}((function(t){!function(e){if(e.entries.length){var t=D();if(t){var n=t.activationStart||0,r=e.entries[e.entries.length-1],i=r.url&&performance.getEntriesByType("resource").filter((function(e){return e.name===r.url}))[0],a=Math.max(0,t.responseStart-n),o=Math.max(a,i?(i.requestStart||i.startTime)-n:0),u=Math.max(o,i?i.responseEnd-n:0),c=Math.max(u,r?r.startTime-n:0),s={element:q(r.element),timeToFirstByte:a,resourceLoadDelay:o-a,resourceLoadTime:u-o,elementRenderDelay:c-u,navigationEntry:t,lcpEntry:r};return r.url&&(s.url=r.url),i&&(s.lcpResourceEntry=i),void(e.attribution=s)}}e.attribution={timeToFirstByte:0,resourceLoadDelay:0,resourceLoadTime:0,elementRenderDelay:e.value}}(t),e(t)}),t)}((function(e){return F(e)})),ve((function(e){return F(e)})),a.isResourceTiming&&E("resource",ye),a.isElementTiming&&E("element",he)},Se=function(e){var t="usageDetails"in e?e.usageDetails:{};x("storageEstimate",{quota:k(e.quota),usage:k(e.usage),caches:k(t.caches),indexedDB:k(t.indexedDB),serviceWorker:k(t.serviceWorkerRegistrations)})},be=0,we=function(){function e(e){if(void 0===e&&(e={}),this.v="8.0.0",a.analyticsTracker=e.analyticsTracker,a.isResourceTiming=!!e.resourceTiming,a.isElementTiming=!!e.elementTiming,a.maxTime=e.maxMeasureTime||a.maxTime,m()){"PerformanceObserver"in o&&Ee();var t=function(){if(!m())return{};var e=s.getEntriesByType("navigation")[0];if(!e)return{};var t=e.responseStart,n=e.responseEnd;return{fetchTime:n-e.fetchStart,workerTime:e.workerStart>0?n-e.workerStart:0,totalTime:n-e.requestStart,downloadTime:n-t,timeToFirstByte:t-e.requestStart,headerSize:e.transferSize-e.encodedBodySize||0,dnsLookupTime:e.domainLookupEnd-e.domainLookupStart,redirectTime:e.redirectEnd-e.redirectStart}}();x("navigationTiming",t),t.redirectTime&&F({attribution:{},name:"RT",rating:M("RT",t.redirectTime),value:t.redirectTime}),x("networkInformation",function(){if("connection"in c){var e=c.connection;return"object"!=typeof e?{}:(d=e.effectiveType,v=!!e.saveData,{downlink:e.downlink,effectiveType:e.effectiveType,rtt:e.rtt,saveData:!!e.saveData})}return{}}()),c&&c.storage&&"function"==typeof c.storage.estimate&&c.storage.estimate().then(Se)}}return e.prototype.start=function(e){m()&&!p[e]&&(p[e]=!0,s.mark("mark_".concat(e,"_start")))},e.prototype.end=function(e,t,n){if(void 0===t&&(t={}),void 0===n&&(n=!0),m()&&p[e]){s.mark("mark_".concat(e,"_end")),delete p[e];var r=function(e){s.measure(e,"mark_".concat(e,"_start"),"mark_".concat(e,"_end"));var t=s.getEntriesByName(e).pop();return t&&"measure"===t.entryType?t.duration:-1}(e);n&&x(e,w(r),t)}},e.prototype.endPaint=function(e,t){var n=this;setTimeout((function(){n.end(e,t)}))},e.prototype.clear=function(e){delete p[e],s.clearMarks&&(s.clearMarks("mark_".concat(e,"_start")),s.clearMarks("mark_".concat(e,"_end")))},e.prototype.markNTBT=function(){var e=this;this.start("ntbt"),y.value=0,clearTimeout(be),be=setTimeout((function(){e.end("ntbt",{},!1),F({attribution:{},name:"NTBT",rating:M("NTBT",y.value),value:y.value}),y.value=0}),2e3)},e}();export{we as default};
var e,t,n,r,i,a={isResourceTiming:!1,isElementTiming:!1,maxTime:3e4},o=window,u=o.console,c=o.navigator,s=o.performance,f=function(){return c.deviceMemory},d=function(){return c.hardwareConcurrency},l=function(){return s&&!!s.getEntriesByType&&!!s.now&&!!s.mark},m="4g",v=!1,p={},T={value:0},g={value:{beacon:0,css:0,fetch:0,img:0,other:0,script:0,total:0,xmlhttprequest:0}},h={value:0},y={value:0},E=function(e,t){try{var n=new PerformanceObserver((function(e){t(e.getEntries())}));return n.observe({type:e,buffered:!0}),n}catch(e){u.warn("Perfume.js:",e)}return null},S=function(){return!!(d()&&d()<=4)||!!(f()&&f()<=4)},b=function(e,t){switch(e){case"slow-2g":case"2g":case"3g":return!0;default:return S()||t}},w={isHidden:!1},k=function(e){document.hidden&&(e(),w.isHidden=document.hidden)},C=function(e){return parseFloat(e.toFixed(4))},L=function(e){return"number"!=typeof e?null:C(e/Math.pow(1024,2))},B=function(e,t,n,r){var i;i=function(){!w.isHidden&&a.analyticsTracker&&a.analyticsTracker({attribution:r,metricName:e,data:t,navigatorInformation:c?{deviceMemory:f()||0,hardwareConcurrency:d()||0,serviceWorkerStatus:"serviceWorker"in c?c.serviceWorker.controller?"controlled":"supported":"unsupported",isLowEndDevice:S(),isLowEndExperience:b(m,v)}:{},rating:n})},"requestIdleCallback"in o?o.requestIdleCallback(i,{timeout:3e3}):i()},M=function(e){e.forEach((function(e){if(!("self"!==e.name||e.startTime<T.value)){var t=e.duration-50;t>0&&(h.value+=t,y.value+=t)}}))},x={RT:[100,200],TBT:[200,600],NTBT:[200,600]},F=function(e,t){return x[e]?t<=x[e][0]?"good":t<=x[e][1]?"needsImprovement":"poor":null},D=function(e,t,n){Object.keys(t).forEach((function(e){"number"==typeof t[e]&&(t[e]=C(t[e]))})),B(e,t,null,n||{})},I=function(e){var t=e.attribution,n=e.name,r=e.rating,i=e.value;"FCP"===n&&(T.value=i),["FCP","LCP"].includes(n)&&E("longtask",M),"FID"===n&&setTimeout((function(){I({attribution:t,name:"TBT",rating:F("TBT",h.value),value:h.value}),D("dataConsumption",g.value)}),1e4);var o=C(i);o<=a.maxTime&&o>=0&&B(n,o,r,t)},P=function(){return window.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0]},q=function(e){if("loading"===document.readyState)return"loading";var t=P();if(t){if(e<t.domInteractive)return"loading";if(0===t.domContentLoadedEventStart||e<t.domContentLoadedEventStart)return"dom-interactive";if(0===t.domComplete||e<t.domComplete)return"dom-content-loaded"}return"complete"},A=function(e){var t=e.nodeName;return 1===e.nodeType?t.toLowerCase():t.toUpperCase().replace(/^#/,"")},R=function(e,t){var n="";try{for(;e&&9!==e.nodeType;){var r=e,i=r.id?"#"+r.id:A(r)+(r.className&&r.className.length?"."+r.className.replace(/\s+/g,"."):"");if(n.length+i.length>(t||100)-1)return n||i;if(n=n?i+">"+n:i,r.id)break;e=r.parentNode}}catch(e){}return n},N=-1,_=function(){return N},H=function(e){addEventListener("pageshow",(function(t){t.persisted&&(N=t.timeStamp,e(t))}),!0)},O=function(){var e=P();return e&&e.activationStart||0},z=function(e,t){var n=P(),r="navigate";return _()>=0?r="back-forward-cache":n&&(r=document.prerendering||O()>0?"prerender":n.type.replace(/_/g,"-")),{name:e,value:void 0===t?-1:t,rating:"good",delta:0,entries:[],id:"v3-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:r}},W=function(e,t,n){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var r=new PerformanceObserver((function(e){t(e.getEntries())}));return r.observe(Object.assign({type:e,buffered:!0},n||{})),r}}catch(e){}},j=function(e,t){var n=function n(r){"pagehide"!==r.type&&"hidden"!==document.visibilityState||(e(r),t&&(removeEventListener("visibilitychange",n,!0),removeEventListener("pagehide",n,!0)))};addEventListener("visibilitychange",n,!0),addEventListener("pagehide",n,!0)},U=function(e,t,n,r){var i,a;return function(o){t.value>=0&&(o||r)&&((a=t.value-(i||0))||void 0===i)&&(i=t.value,t.delta=a,t.rating=function(e,t){return e>t[1]?"poor":e>t[0]?"needs-improvement":"good"}(t.value,n),e(t))}},V=-1,G=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},J=function(){j((function(e){var t=e.timeStamp;V=t}),!0)},K=function(){return V<0&&(V=G(),J(),H((function(){setTimeout((function(){V=G(),J()}),0)}))),{get firstHiddenTime(){return V}}},Q=function(e,t){t=t||{};var n,r=[1800,3e3],i=K(),a=z("FCP"),o=function(e){e.forEach((function(e){"first-contentful-paint"===e.name&&(c&&c.disconnect(),e.startTime<i.firstHiddenTime&&(a.value=Math.max(e.startTime-O(),0),a.entries.push(e),n(!0)))}))},u=window.performance&&window.performance.getEntriesByName&&window.performance.getEntriesByName("first-contentful-paint")[0],c=u?null:W("paint",o);(u||c)&&(n=U(e,a,r,t.reportAllChanges),u&&o([u]),H((function(i){a=z("FCP"),n=U(e,a,r,t.reportAllChanges),requestAnimationFrame((function(){requestAnimationFrame((function(){a.value=performance.now()-i.timeStamp,n(!0)}))}))})))},X=!1,Y=-1,Z={passive:!0,capture:!0},$=new Date,ee=function(r,i){e||(e=i,t=r,n=new Date,re(removeEventListener),te())},te=function(){if(t>=0&&t<n-$){var i={entryType:"first-input",name:e.type,target:e.target,cancelable:e.cancelable,startTime:e.timeStamp,processingStart:e.timeStamp+t};r.forEach((function(e){e(i)})),r=[]}},ne=function(e){if(e.cancelable){var t=(e.timeStamp>1e12?new Date:performance.now())-e.timeStamp;"pointerdown"==e.type?function(e,t){var n=function(){ee(e,t),i()},r=function(){i()},i=function(){removeEventListener("pointerup",n,Z),removeEventListener("pointercancel",r,Z)};addEventListener("pointerup",n,Z),addEventListener("pointercancel",r,Z)}(t,e):ee(t,e)}},re=function(e){["mousedown","keydown","touchstart","pointerdown"].forEach((function(t){return e(t,ne,Z)}))},ie=function(n,i){i=i||{};var a,o=[100,300],u=K(),c=z("FID"),s=function(e){e.startTime<u.firstHiddenTime&&(c.value=e.processingStart-e.startTime,c.entries.push(e),a(!0))},f=function(e){e.forEach(s)},d=W("first-input",f);a=U(n,c,o,i.reportAllChanges),d&&j((function(){f(d.takeRecords()),d.disconnect()}),!0),d&&H((function(){var u;c=z("FID"),a=U(n,c,o,i.reportAllChanges),r=[],t=-1,e=null,re(addEventListener),u=s,r.push(u),te()}))},ae=0,oe=1/0,ue=0,ce=function(e){e.forEach((function(e){e.interactionId&&(oe=Math.min(oe,e.interactionId),ue=Math.max(ue,e.interactionId),ae=ue?(ue-oe)/7+1:0)}))},se=function(){return i?ae:performance.interactionCount||0},fe=function(){"interactionCount"in performance||i||(i=W("event",ce,{type:"event",buffered:!0,durationThreshold:0}))},de=0,le=function(){return se()-de},me=[],ve={},pe=function(e){var t=me[me.length-1],n=ve[e.interactionId];if(n||me.length<10||e.duration>t.latency){if(n)n.entries.push(e),n.latency=Math.max(n.latency,e.duration);else{var r={id:e.interactionId,latency:e.duration,entries:[e]};ve[r.id]=r,me.push(r)}me.sort((function(e,t){return t.latency-e.latency})),me.splice(10).forEach((function(e){delete ve[e.id]}))}},Te=function(e,t){!function(e,t){t=t||{};var n=[200,500];fe();var r,i=z("INP"),a=function(e){e.forEach((function(e){e.interactionId&&pe(e),"first-input"===e.entryType&&!me.some((function(t){return t.entries.some((function(t){return e.duration===t.duration&&e.startTime===t.startTime}))}))&&pe(e)}));var t,n=(t=Math.min(me.length-1,Math.floor(le()/50)),me[t]);n&&n.latency!==i.value&&(i.value=n.latency,i.entries=n.entries,r())},o=W("event",a,{durationThreshold:t.durationThreshold||40});r=U(e,i,n,t.reportAllChanges),o&&(o.observe({type:"first-input",buffered:!0}),j((function(){a(o.takeRecords()),i.value<0&&le()>0&&(i.value=0,i.entries=[]),r(!0)})),H((function(){me=[],de=se(),i=z("INP"),r=U(e,i,n,t.reportAllChanges)})))}((function(t){!function(e){if(e.entries.length){var t=e.entries.sort((function(e,t){return t.duration-e.duration||t.processingEnd-t.processingStart-(e.processingEnd-e.processingStart)}))[0];e.attribution={eventTarget:R(t.target),eventType:t.name,eventTime:t.startTime,eventEntry:t,loadState:q(t.startTime)}}else e.attribution={}}(t),e(t)}),t)},ge={},he=function e(t){document.prerendering?addEventListener("prerenderingchange",(function(){return e(t)}),!0):"complete"!==document.readyState?addEventListener("load",(function(){return e(t)}),!0):setTimeout(t,0)},ye=function(e,t){t=t||{};var n=[800,1800],r=z("TTFB"),i=U(e,r,n,t.reportAllChanges);he((function(){var a=P();if(a){if(r.value=Math.max(a.responseStart-O(),0),r.value<0||r.value>performance.now())return;r.entries=[a],i(!0),H((function(){r=z("TTFB",0),(i=U(e,r,n,t.reportAllChanges))(!0)}))}}))},Ee=function(e){e.forEach((function(e){e.identifier&&I({attribution:{identifier:e.identifier},name:"ET",rating:null,value:e.startTime})}))},Se=function(e){e.forEach((function(e){if(a.isResourceTiming&&D("resourceTiming",e),e.decodedBodySize&&e.initiatorType){var t=e.decodedBodySize/1e3;g.value[e.initiatorType]+=t,g.value.total+=t}}))},be=function(){!function(e,t){ye((function(t){!function(e){if(e.entries.length){var t=e.entries[0],n=t.activationStart||0,r=Math.max(t.domainLookupStart-n,0),i=Math.max(t.connectStart-n,0),a=Math.max(t.requestStart-n,0);e.attribution={waitingTime:r,dnsTime:i-r,connectionTime:a-i,requestTime:e.value-a,navigationEntry:t}}else e.attribution={waitingTime:0,dnsTime:0,connectionTime:0,requestTime:0}}(t),e(t)}),t)}((function(e){e.value=e.value-e.entries[0].requestStart,I(e)})),function(e,t){!function(e,t){t=t||{};var n=[.1,.25];X||(Q((function(e){Y=e.value})),X=!0);var r,i=function(t){Y>-1&&e(t)},a=z("CLS",0),o=0,u=[],c=function(e){e.forEach((function(e){if(!e.hadRecentInput){var t=u[0],n=u[u.length-1];o&&e.startTime-n.startTime<1e3&&e.startTime-t.startTime<5e3?(o+=e.value,u.push(e)):(o=e.value,u=[e]),o>a.value&&(a.value=o,a.entries=u,r())}}))},s=W("layout-shift",c);s&&(r=U(i,a,n,t.reportAllChanges),j((function(){c(s.takeRecords()),r(!0)})),H((function(){o=0,Y=-1,a=z("CLS",0),r=U(i,a,n,t.reportAllChanges)})))}((function(t){!function(e){if(e.entries.length){var t=e.entries.reduce((function(e,t){return e&&e.value>t.value?e:t}));if(t&&t.sources&&t.sources.length){var n=(r=t.sources).find((function(e){return e.node&&1===e.node.nodeType}))||r[0];if(n)return void(e.attribution={largestShiftTarget:R(n.node),largestShiftTime:t.startTime,largestShiftValue:t.value,largestShiftSource:n,largestShiftEntry:t,loadState:q(t.startTime)})}}var r;e.attribution={}}(t),e(t)}),t)}((function(e){return I(e)})),function(e,t){Q((function(t){!function(e){if(e.entries.length){var t=P(),n=e.entries[e.entries.length-1];if(t){var r=t.activationStart||0,i=Math.max(0,t.responseStart-r);return void(e.attribution={timeToFirstByte:i,firstByteToFCP:e.value-i,loadState:q(e.entries[0].startTime),navigationEntry:t,fcpEntry:n})}}e.attribution={timeToFirstByte:0,firstByteToFCP:e.value,loadState:q(_())}}(t),e(t)}),t)}((function(e){return I(e)})),function(e,t){ie((function(t){!function(e){var t=e.entries[0];e.attribution={eventTarget:R(t.target),eventType:t.name,eventTime:t.startTime,eventEntry:t,loadState:q(t.startTime)}}(t),e(t)}),t)}((function(e){return I(e)})),function(e,t){!function(e,t){t=t||{};var n,r=[2500,4e3],i=K(),a=z("LCP"),o=function(e){var t=e[e.length-1];if(t){var r=Math.max(t.startTime-O(),0);r<i.firstHiddenTime&&(a.value=r,a.entries=[t],n())}},u=W("largest-contentful-paint",o);if(u){n=U(e,a,r,t.reportAllChanges);var c=function(){ge[a.id]||(o(u.takeRecords()),u.disconnect(),ge[a.id]=!0,n(!0))};["keydown","click"].forEach((function(e){addEventListener(e,c,{once:!0,capture:!0})})),j(c,!0),H((function(i){a=z("LCP"),n=U(e,a,r,t.reportAllChanges),requestAnimationFrame((function(){requestAnimationFrame((function(){a.value=performance.now()-i.timeStamp,ge[a.id]=!0,n(!0)}))}))}))}}((function(t){!function(e){if(e.entries.length){var t=P();if(t){var n=t.activationStart||0,r=e.entries[e.entries.length-1],i=r.url&&performance.getEntriesByType("resource").filter((function(e){return e.name===r.url}))[0],a=Math.max(0,t.responseStart-n),o=Math.max(a,i?(i.requestStart||i.startTime)-n:0),u=Math.max(o,i?i.responseEnd-n:0),c=Math.max(u,r?r.startTime-n:0),s={element:R(r.element),timeToFirstByte:a,resourceLoadDelay:o-a,resourceLoadTime:u-o,elementRenderDelay:c-u,navigationEntry:t,lcpEntry:r};return r.url&&(s.url=r.url),i&&(s.lcpResourceEntry=i),void(e.attribution=s)}}e.attribution={timeToFirstByte:0,resourceLoadDelay:0,resourceLoadTime:0,elementRenderDelay:e.value}}(t),e(t)}),t)}((function(e){return I(e)})),Te((function(e){return I(e)})),a.isResourceTiming&&E("resource",Se),a.isElementTiming&&E("element",Ee)},we=function(e){var t="usageDetails"in e?e.usageDetails:{};D("storageEstimate",{quota:L(e.quota),usage:L(e.usage),caches:L(t.caches),indexedDB:L(t.indexedDB),serviceWorker:L(t.serviceWorkerRegistrations)})},ke=0,Ce=function(){function e(e){if(void 0===e&&(e={}),this.v="8.1.0",a.analyticsTracker=e.analyticsTracker,a.isResourceTiming=!!e.resourceTiming,a.isElementTiming=!!e.elementTiming,a.maxTime=e.maxMeasureTime||a.maxTime,l()){"PerformanceObserver"in o&&be(),void 0!==document.hidden&&document.addEventListener("visibilitychange",(function(){return k}));var t=function(){if(!l())return{};var e=s.getEntriesByType("navigation")[0];if(!e)return{};var t=e.responseStart,n=e.responseEnd;return{fetchTime:n-e.fetchStart,workerTime:e.workerStart>0?n-e.workerStart:0,totalTime:n-e.requestStart,downloadTime:n-t,timeToFirstByte:t-e.requestStart,headerSize:e.transferSize-e.encodedBodySize||0,dnsLookupTime:e.domainLookupEnd-e.domainLookupStart,redirectTime:e.redirectEnd-e.redirectStart}}();D("navigationTiming",t),t.redirectTime&&I({attribution:{},name:"RT",rating:F("RT",t.redirectTime),value:t.redirectTime}),D("networkInformation",function(){if("connection"in c){var e=c.connection;return"object"!=typeof e?{}:(m=e.effectiveType,v=!!e.saveData,{downlink:e.downlink,effectiveType:e.effectiveType,rtt:e.rtt,saveData:!!e.saveData})}return{}}()),c&&c.storage&&"function"==typeof c.storage.estimate&&c.storage.estimate().then(we)}}return e.prototype.start=function(e){l()&&!p[e]&&(p[e]=!0,s.mark("mark_".concat(e,"_start")))},e.prototype.end=function(e,t,n){if(void 0===t&&(t={}),void 0===n&&(n=!0),l()&&p[e]){s.mark("mark_".concat(e,"_end")),delete p[e];var r=function(e){s.measure(e,"mark_".concat(e,"_start"),"mark_".concat(e,"_end"));var t=s.getEntriesByName(e).pop();return t&&"measure"===t.entryType?t.duration:-1}(e);n&&D(e,C(r),t)}},e.prototype.endPaint=function(e,t){var n=this;setTimeout((function(){n.end(e,t)}))},e.prototype.clear=function(e){delete p[e],s.clearMarks&&(s.clearMarks("mark_".concat(e,"_start")),s.clearMarks("mark_".concat(e,"_end")))},e.prototype.markNTBT=function(){var e=this;this.start("ntbt"),y.value=0,clearTimeout(ke),ke=setTimeout((function(){e.end("ntbt",{},!1),I({attribution:{},name:"NTBT",rating:F("NTBT",y.value),value:y.value}),y.value=0}),2e3)},e}();export{Ce as default};
//# sourceMappingURL=perfume.esm.min.js.map

@@ -1,2 +0,2 @@

var Perfume=function(){"use strict";var e,t,n,r,i,a={isResourceTiming:!1,isElementTiming:!1,maxTime:3e4},o=window,u=o.console,c=o.navigator,s=o.performance,f=function(){return c.deviceMemory},l=function(){return c.hardwareConcurrency},m=function(){return s&&!!s.getEntriesByType&&!!s.now&&!!s.mark},d="4g",v=!1,p={},T={value:0},g={value:{beacon:0,css:0,fetch:0,img:0,other:0,script:0,total:0,xmlhttprequest:0}},h={value:0},y={value:0},E=function(e,t){try{var n=new PerformanceObserver((function(e){t(e.getEntries())}));return n.observe({type:e,buffered:!0}),n}catch(e){u.warn("Perfume.js:",e)}return null},S=function(){return!!(l()&&l()<=4)||!!(f()&&f()<=4)},b=function(e,t){switch(e){case"slow-2g":case"2g":case"3g":return!0;default:return S()||t}},w=function(e){return parseFloat(e.toFixed(4))},k=function(e){return"number"!=typeof e?null:w(e/Math.pow(1024,2))},C=function(e,t,n,r){var i;i=function(){a.analyticsTracker&&a.analyticsTracker({attribution:r,metricName:e,data:t,navigatorInformation:c?{deviceMemory:f()||0,hardwareConcurrency:l()||0,serviceWorkerStatus:"serviceWorker"in c?c.serviceWorker.controller?"controlled":"supported":"unsupported",isLowEndDevice:S(),isLowEndExperience:b(d,v)}:{},rating:n})},"requestIdleCallback"in o?o.requestIdleCallback(i,{timeout:3e3}):i()},L=function(e){e.forEach((function(e){if(!("self"!==e.name||e.startTime<T.value)){var t=e.duration-50;t>0&&(h.value+=t,y.value+=t)}}))},B={RT:[100,200],TBT:[200,600],NTBT:[200,600]},M=function(e,t){return B[e]?t<=B[e][0]?"good":t<=B[e][1]?"needsImprovement":"poor":null},x=function(e,t,n){Object.keys(t).forEach((function(e){"number"==typeof t[e]&&(t[e]=w(t[e]))})),C(e,t,null,n||{})},F=function(e){var t=e.attribution,n=e.name,r=e.rating,i=e.value;"FCP"===n&&(T.value=i),["FCP","LCP"].includes(n)&&E("longtask",L),"FID"===n&&setTimeout((function(){F({attribution:t,name:"TBT",rating:M("TBT",h.value),value:h.value}),x("dataConsumption",g.value)}),1e4);var o=w(i);o<=a.maxTime&&o>=0&&C(n,o,r,t)},D=function(){return window.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0]},I=function(e){if("loading"===document.readyState)return"loading";var t=D();if(t){if(e<t.domInteractive)return"loading";if(0===t.domContentLoadedEventStart||e<t.domContentLoadedEventStart)return"dom-interactive";if(0===t.domComplete||e<t.domComplete)return"dom-content-loaded"}return"complete"},P=function(e){var t=e.nodeName;return 1===e.nodeType?t.toLowerCase():t.toUpperCase().replace(/^#/,"")},q=function(e,t){var n="";try{for(;e&&9!==e.nodeType;){var r=e,i=r.id?"#"+r.id:P(r)+(r.className&&r.className.length?"."+r.className.replace(/\s+/g,"."):"");if(n.length+i.length>(t||100)-1)return n||i;if(n=n?i+">"+n:i,r.id)break;e=r.parentNode}}catch(e){}return n},A=-1,R=function(){return A},N=function(e){addEventListener("pageshow",(function(t){t.persisted&&(A=t.timeStamp,e(t))}),!0)},_=function(){var e=D();return e&&e.activationStart||0},O=function(e,t){var n=D(),r="navigate";return R()>=0?r="back-forward-cache":n&&(r=document.prerendering||_()>0?"prerender":n.type.replace(/_/g,"-")),{name:e,value:void 0===t?-1:t,rating:"good",delta:0,entries:[],id:"v3-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:r}},z=function(e,t,n){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var r=new PerformanceObserver((function(e){t(e.getEntries())}));return r.observe(Object.assign({type:e,buffered:!0},n||{})),r}}catch(e){}},W=function(e,t){var n=function n(r){"pagehide"!==r.type&&"hidden"!==document.visibilityState||(e(r),t&&(removeEventListener("visibilitychange",n,!0),removeEventListener("pagehide",n,!0)))};addEventListener("visibilitychange",n,!0),addEventListener("pagehide",n,!0)},j=function(e,t,n,r){var i,a;return function(o){t.value>=0&&(o||r)&&((a=t.value-(i||0))||void 0===i)&&(i=t.value,t.delta=a,t.rating=function(e,t){return e>t[1]?"poor":e>t[0]?"needs-improvement":"good"}(t.value,n),e(t))}},H=-1,U=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},V=function(){W((function(e){var t=e.timeStamp;H=t}),!0)},G=function(){return H<0&&(H=U(),V(),N((function(){setTimeout((function(){H=U(),V()}),0)}))),{get firstHiddenTime(){return H}}},J=function(e,t){t=t||{};var n,r=[1800,3e3],i=G(),a=O("FCP"),o=function(e){e.forEach((function(e){"first-contentful-paint"===e.name&&(c&&c.disconnect(),e.startTime<i.firstHiddenTime&&(a.value=Math.max(e.startTime-_(),0),a.entries.push(e),n(!0)))}))},u=window.performance&&window.performance.getEntriesByName&&window.performance.getEntriesByName("first-contentful-paint")[0],c=u?null:z("paint",o);(u||c)&&(n=j(e,a,r,t.reportAllChanges),u&&o([u]),N((function(i){a=O("FCP"),n=j(e,a,r,t.reportAllChanges),requestAnimationFrame((function(){requestAnimationFrame((function(){a.value=performance.now()-i.timeStamp,n(!0)}))}))})))},K=!1,Q=-1,X={passive:!0,capture:!0},Y=new Date,Z=function(r,i){e||(e=i,t=r,n=new Date,te(removeEventListener),$())},$=function(){if(t>=0&&t<n-Y){var i={entryType:"first-input",name:e.type,target:e.target,cancelable:e.cancelable,startTime:e.timeStamp,processingStart:e.timeStamp+t};r.forEach((function(e){e(i)})),r=[]}},ee=function(e){if(e.cancelable){var t=(e.timeStamp>1e12?new Date:performance.now())-e.timeStamp;"pointerdown"==e.type?function(e,t){var n=function(){Z(e,t),i()},r=function(){i()},i=function(){removeEventListener("pointerup",n,X),removeEventListener("pointercancel",r,X)};addEventListener("pointerup",n,X),addEventListener("pointercancel",r,X)}(t,e):Z(t,e)}},te=function(e){["mousedown","keydown","touchstart","pointerdown"].forEach((function(t){return e(t,ee,X)}))},ne=function(n,i){i=i||{};var a,o=[100,300],u=G(),c=O("FID"),s=function(e){e.startTime<u.firstHiddenTime&&(c.value=e.processingStart-e.startTime,c.entries.push(e),a(!0))},f=function(e){e.forEach(s)},l=z("first-input",f);a=j(n,c,o,i.reportAllChanges),l&&W((function(){f(l.takeRecords()),l.disconnect()}),!0),l&&N((function(){var u;c=O("FID"),a=j(n,c,o,i.reportAllChanges),r=[],t=-1,e=null,te(addEventListener),u=s,r.push(u),$()}))},re=0,ie=1/0,ae=0,oe=function(e){e.forEach((function(e){e.interactionId&&(ie=Math.min(ie,e.interactionId),ae=Math.max(ae,e.interactionId),re=ae?(ae-ie)/7+1:0)}))},ue=function(){return i?re:performance.interactionCount||0},ce=function(){"interactionCount"in performance||i||(i=z("event",oe,{type:"event",buffered:!0,durationThreshold:0}))},se=0,fe=function(){return ue()-se},le=[],me={},de=function(e){var t=le[le.length-1],n=me[e.interactionId];if(n||le.length<10||e.duration>t.latency){if(n)n.entries.push(e),n.latency=Math.max(n.latency,e.duration);else{var r={id:e.interactionId,latency:e.duration,entries:[e]};me[r.id]=r,le.push(r)}le.sort((function(e,t){return t.latency-e.latency})),le.splice(10).forEach((function(e){delete me[e.id]}))}},ve=function(e,t){!function(e,t){t=t||{};var n=[200,500];ce();var r,i=O("INP"),a=function(e){e.forEach((function(e){e.interactionId&&de(e),"first-input"===e.entryType&&!le.some((function(t){return t.entries.some((function(t){return e.duration===t.duration&&e.startTime===t.startTime}))}))&&de(e)}));var t,n=(t=Math.min(le.length-1,Math.floor(fe()/50)),le[t]);n&&n.latency!==i.value&&(i.value=n.latency,i.entries=n.entries,r())},o=z("event",a,{durationThreshold:t.durationThreshold||40});r=j(e,i,n,t.reportAllChanges),o&&(o.observe({type:"first-input",buffered:!0}),W((function(){a(o.takeRecords()),i.value<0&&fe()>0&&(i.value=0,i.entries=[]),r(!0)})),N((function(){le=[],se=ue(),i=O("INP"),r=j(e,i,n,t.reportAllChanges)})))}((function(t){!function(e){if(e.entries.length){var t=e.entries.sort((function(e,t){return t.duration-e.duration||t.processingEnd-t.processingStart-(e.processingEnd-e.processingStart)}))[0];e.attribution={eventTarget:q(t.target),eventType:t.name,eventTime:t.startTime,eventEntry:t,loadState:I(t.startTime)}}else e.attribution={}}(t),e(t)}),t)},pe={},Te=function e(t){document.prerendering?addEventListener("prerenderingchange",(function(){return e(t)}),!0):"complete"!==document.readyState?addEventListener("load",(function(){return e(t)}),!0):setTimeout(t,0)},ge=function(e,t){t=t||{};var n=[800,1800],r=O("TTFB"),i=j(e,r,n,t.reportAllChanges);Te((function(){var a=D();if(a){if(r.value=Math.max(a.responseStart-_(),0),r.value<0||r.value>performance.now())return;r.entries=[a],i(!0),N((function(){r=O("TTFB",0),(i=j(e,r,n,t.reportAllChanges))(!0)}))}}))},he=function(e){e.forEach((function(e){e.identifier&&F({attribution:{identifier:e.identifier},name:"ET",rating:null,value:e.startTime})}))},ye=function(e){e.forEach((function(e){if(a.isResourceTiming&&x("resourceTiming",e),e.decodedBodySize&&e.initiatorType){var t=e.decodedBodySize/1e3;g.value[e.initiatorType]+=t,g.value.total+=t}}))},Ee=function(){!function(e,t){ge((function(t){!function(e){if(e.entries.length){var t=e.entries[0],n=t.activationStart||0,r=Math.max(t.domainLookupStart-n,0),i=Math.max(t.connectStart-n,0),a=Math.max(t.requestStart-n,0);e.attribution={waitingTime:r,dnsTime:i-r,connectionTime:a-i,requestTime:e.value-a,navigationEntry:t}}else e.attribution={waitingTime:0,dnsTime:0,connectionTime:0,requestTime:0}}(t),e(t)}),t)}((function(e){e.value=e.value-e.entries[0].requestStart,F(e)})),function(e,t){!function(e,t){t=t||{};var n=[.1,.25];K||(J((function(e){Q=e.value})),K=!0);var r,i=function(t){Q>-1&&e(t)},a=O("CLS",0),o=0,u=[],c=function(e){e.forEach((function(e){if(!e.hadRecentInput){var t=u[0],n=u[u.length-1];o&&e.startTime-n.startTime<1e3&&e.startTime-t.startTime<5e3?(o+=e.value,u.push(e)):(o=e.value,u=[e]),o>a.value&&(a.value=o,a.entries=u,r())}}))},s=z("layout-shift",c);s&&(r=j(i,a,n,t.reportAllChanges),W((function(){c(s.takeRecords()),r(!0)})),N((function(){o=0,Q=-1,a=O("CLS",0),r=j(i,a,n,t.reportAllChanges)})))}((function(t){!function(e){if(e.entries.length){var t=e.entries.reduce((function(e,t){return e&&e.value>t.value?e:t}));if(t&&t.sources&&t.sources.length){var n=(r=t.sources).find((function(e){return e.node&&1===e.node.nodeType}))||r[0];if(n)return void(e.attribution={largestShiftTarget:q(n.node),largestShiftTime:t.startTime,largestShiftValue:t.value,largestShiftSource:n,largestShiftEntry:t,loadState:I(t.startTime)})}}var r;e.attribution={}}(t),e(t)}),t)}((function(e){return F(e)})),function(e,t){J((function(t){!function(e){if(e.entries.length){var t=D(),n=e.entries[e.entries.length-1];if(t){var r=t.activationStart||0,i=Math.max(0,t.responseStart-r);return void(e.attribution={timeToFirstByte:i,firstByteToFCP:e.value-i,loadState:I(e.entries[0].startTime),navigationEntry:t,fcpEntry:n})}}e.attribution={timeToFirstByte:0,firstByteToFCP:e.value,loadState:I(R())}}(t),e(t)}),t)}((function(e){return F(e)})),function(e,t){ne((function(t){!function(e){var t=e.entries[0];e.attribution={eventTarget:q(t.target),eventType:t.name,eventTime:t.startTime,eventEntry:t,loadState:I(t.startTime)}}(t),e(t)}),t)}((function(e){return F(e)})),function(e,t){!function(e,t){t=t||{};var n,r=[2500,4e3],i=G(),a=O("LCP"),o=function(e){var t=e[e.length-1];if(t){var r=Math.max(t.startTime-_(),0);r<i.firstHiddenTime&&(a.value=r,a.entries=[t],n())}},u=z("largest-contentful-paint",o);if(u){n=j(e,a,r,t.reportAllChanges);var c=function(){pe[a.id]||(o(u.takeRecords()),u.disconnect(),pe[a.id]=!0,n(!0))};["keydown","click"].forEach((function(e){addEventListener(e,c,{once:!0,capture:!0})})),W(c,!0),N((function(i){a=O("LCP"),n=j(e,a,r,t.reportAllChanges),requestAnimationFrame((function(){requestAnimationFrame((function(){a.value=performance.now()-i.timeStamp,pe[a.id]=!0,n(!0)}))}))}))}}((function(t){!function(e){if(e.entries.length){var t=D();if(t){var n=t.activationStart||0,r=e.entries[e.entries.length-1],i=r.url&&performance.getEntriesByType("resource").filter((function(e){return e.name===r.url}))[0],a=Math.max(0,t.responseStart-n),o=Math.max(a,i?(i.requestStart||i.startTime)-n:0),u=Math.max(o,i?i.responseEnd-n:0),c=Math.max(u,r?r.startTime-n:0),s={element:q(r.element),timeToFirstByte:a,resourceLoadDelay:o-a,resourceLoadTime:u-o,elementRenderDelay:c-u,navigationEntry:t,lcpEntry:r};return r.url&&(s.url=r.url),i&&(s.lcpResourceEntry=i),void(e.attribution=s)}}e.attribution={timeToFirstByte:0,resourceLoadDelay:0,resourceLoadTime:0,elementRenderDelay:e.value}}(t),e(t)}),t)}((function(e){return F(e)})),ve((function(e){return F(e)})),a.isResourceTiming&&E("resource",ye),a.isElementTiming&&E("element",he)},Se=function(e){var t="usageDetails"in e?e.usageDetails:{};x("storageEstimate",{quota:k(e.quota),usage:k(e.usage),caches:k(t.caches),indexedDB:k(t.indexedDB),serviceWorker:k(t.serviceWorkerRegistrations)})},be=0,we=function(){function e(e){if(void 0===e&&(e={}),this.v="8.0.0",a.analyticsTracker=e.analyticsTracker,a.isResourceTiming=!!e.resourceTiming,a.isElementTiming=!!e.elementTiming,a.maxTime=e.maxMeasureTime||a.maxTime,m()){"PerformanceObserver"in o&&Ee();var t=function(){if(!m())return{};var e=s.getEntriesByType("navigation")[0];if(!e)return{};var t=e.responseStart,n=e.responseEnd;return{fetchTime:n-e.fetchStart,workerTime:e.workerStart>0?n-e.workerStart:0,totalTime:n-e.requestStart,downloadTime:n-t,timeToFirstByte:t-e.requestStart,headerSize:e.transferSize-e.encodedBodySize||0,dnsLookupTime:e.domainLookupEnd-e.domainLookupStart,redirectTime:e.redirectEnd-e.redirectStart}}();x("navigationTiming",t),t.redirectTime&&F({attribution:{},name:"RT",rating:M("RT",t.redirectTime),value:t.redirectTime}),x("networkInformation",function(){if("connection"in c){var e=c.connection;return"object"!=typeof e?{}:(d=e.effectiveType,v=!!e.saveData,{downlink:e.downlink,effectiveType:e.effectiveType,rtt:e.rtt,saveData:!!e.saveData})}return{}}()),c&&c.storage&&"function"==typeof c.storage.estimate&&c.storage.estimate().then(Se)}}return e.prototype.start=function(e){m()&&!p[e]&&(p[e]=!0,s.mark("mark_".concat(e,"_start")))},e.prototype.end=function(e,t,n){if(void 0===t&&(t={}),void 0===n&&(n=!0),m()&&p[e]){s.mark("mark_".concat(e,"_end")),delete p[e];var r=function(e){s.measure(e,"mark_".concat(e,"_start"),"mark_".concat(e,"_end"));var t=s.getEntriesByName(e).pop();return t&&"measure"===t.entryType?t.duration:-1}(e);n&&x(e,w(r),t)}},e.prototype.endPaint=function(e,t){var n=this;setTimeout((function(){n.end(e,t)}))},e.prototype.clear=function(e){delete p[e],s.clearMarks&&(s.clearMarks("mark_".concat(e,"_start")),s.clearMarks("mark_".concat(e,"_end")))},e.prototype.markNTBT=function(){var e=this;this.start("ntbt"),y.value=0,clearTimeout(be),be=setTimeout((function(){e.end("ntbt",{},!1),F({attribution:{},name:"NTBT",rating:M("NTBT",y.value),value:y.value}),y.value=0}),2e3)},e}();return we}();
var Perfume=function(){"use strict";var e,t,n,r,i,a={isResourceTiming:!1,isElementTiming:!1,maxTime:3e4},o=window,u=o.console,c=o.navigator,s=o.performance,f=function(){return c.deviceMemory},d=function(){return c.hardwareConcurrency},m=function(){return s&&!!s.getEntriesByType&&!!s.now&&!!s.mark},l="4g",v=!1,p={},T={value:0},g={value:{beacon:0,css:0,fetch:0,img:0,other:0,script:0,total:0,xmlhttprequest:0}},h={value:0},y={value:0},E=function(e,t){try{var n=new PerformanceObserver((function(e){t(e.getEntries())}));return n.observe({type:e,buffered:!0}),n}catch(e){u.warn("Perfume.js:",e)}return null},S=function(){return!!(d()&&d()<=4)||!!(f()&&f()<=4)},b=function(e,t){switch(e){case"slow-2g":case"2g":case"3g":return!0;default:return S()||t}},w={isHidden:!1},k=function(e){document.hidden&&(e(),w.isHidden=document.hidden)},C=function(e){return parseFloat(e.toFixed(4))},L=function(e){return"number"!=typeof e?null:C(e/Math.pow(1024,2))},B=function(e,t,n,r){var i;i=function(){!w.isHidden&&a.analyticsTracker&&a.analyticsTracker({attribution:r,metricName:e,data:t,navigatorInformation:c?{deviceMemory:f()||0,hardwareConcurrency:d()||0,serviceWorkerStatus:"serviceWorker"in c?c.serviceWorker.controller?"controlled":"supported":"unsupported",isLowEndDevice:S(),isLowEndExperience:b(l,v)}:{},rating:n})},"requestIdleCallback"in o?o.requestIdleCallback(i,{timeout:3e3}):i()},M=function(e){e.forEach((function(e){if(!("self"!==e.name||e.startTime<T.value)){var t=e.duration-50;t>0&&(h.value+=t,y.value+=t)}}))},x={RT:[100,200],TBT:[200,600],NTBT:[200,600]},F=function(e,t){return x[e]?t<=x[e][0]?"good":t<=x[e][1]?"needsImprovement":"poor":null},D=function(e,t,n){Object.keys(t).forEach((function(e){"number"==typeof t[e]&&(t[e]=C(t[e]))})),B(e,t,null,n||{})},I=function(e){var t=e.attribution,n=e.name,r=e.rating,i=e.value;"FCP"===n&&(T.value=i),["FCP","LCP"].includes(n)&&E("longtask",M),"FID"===n&&setTimeout((function(){I({attribution:t,name:"TBT",rating:F("TBT",h.value),value:h.value}),D("dataConsumption",g.value)}),1e4);var o=C(i);o<=a.maxTime&&o>=0&&B(n,o,r,t)},P=function(){return window.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0]},q=function(e){if("loading"===document.readyState)return"loading";var t=P();if(t){if(e<t.domInteractive)return"loading";if(0===t.domContentLoadedEventStart||e<t.domContentLoadedEventStart)return"dom-interactive";if(0===t.domComplete||e<t.domComplete)return"dom-content-loaded"}return"complete"},A=function(e){var t=e.nodeName;return 1===e.nodeType?t.toLowerCase():t.toUpperCase().replace(/^#/,"")},R=function(e,t){var n="";try{for(;e&&9!==e.nodeType;){var r=e,i=r.id?"#"+r.id:A(r)+(r.className&&r.className.length?"."+r.className.replace(/\s+/g,"."):"");if(n.length+i.length>(t||100)-1)return n||i;if(n=n?i+">"+n:i,r.id)break;e=r.parentNode}}catch(e){}return n},N=-1,_=function(){return N},H=function(e){addEventListener("pageshow",(function(t){t.persisted&&(N=t.timeStamp,e(t))}),!0)},O=function(){var e=P();return e&&e.activationStart||0},z=function(e,t){var n=P(),r="navigate";return _()>=0?r="back-forward-cache":n&&(r=document.prerendering||O()>0?"prerender":n.type.replace(/_/g,"-")),{name:e,value:void 0===t?-1:t,rating:"good",delta:0,entries:[],id:"v3-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:r}},W=function(e,t,n){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var r=new PerformanceObserver((function(e){t(e.getEntries())}));return r.observe(Object.assign({type:e,buffered:!0},n||{})),r}}catch(e){}},j=function(e,t){var n=function n(r){"pagehide"!==r.type&&"hidden"!==document.visibilityState||(e(r),t&&(removeEventListener("visibilitychange",n,!0),removeEventListener("pagehide",n,!0)))};addEventListener("visibilitychange",n,!0),addEventListener("pagehide",n,!0)},U=function(e,t,n,r){var i,a;return function(o){t.value>=0&&(o||r)&&((a=t.value-(i||0))||void 0===i)&&(i=t.value,t.delta=a,t.rating=function(e,t){return e>t[1]?"poor":e>t[0]?"needs-improvement":"good"}(t.value,n),e(t))}},V=-1,G=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},J=function(){j((function(e){var t=e.timeStamp;V=t}),!0)},K=function(){return V<0&&(V=G(),J(),H((function(){setTimeout((function(){V=G(),J()}),0)}))),{get firstHiddenTime(){return V}}},Q=function(e,t){t=t||{};var n,r=[1800,3e3],i=K(),a=z("FCP"),o=function(e){e.forEach((function(e){"first-contentful-paint"===e.name&&(c&&c.disconnect(),e.startTime<i.firstHiddenTime&&(a.value=Math.max(e.startTime-O(),0),a.entries.push(e),n(!0)))}))},u=window.performance&&window.performance.getEntriesByName&&window.performance.getEntriesByName("first-contentful-paint")[0],c=u?null:W("paint",o);(u||c)&&(n=U(e,a,r,t.reportAllChanges),u&&o([u]),H((function(i){a=z("FCP"),n=U(e,a,r,t.reportAllChanges),requestAnimationFrame((function(){requestAnimationFrame((function(){a.value=performance.now()-i.timeStamp,n(!0)}))}))})))},X=!1,Y=-1,Z={passive:!0,capture:!0},$=new Date,ee=function(r,i){e||(e=i,t=r,n=new Date,re(removeEventListener),te())},te=function(){if(t>=0&&t<n-$){var i={entryType:"first-input",name:e.type,target:e.target,cancelable:e.cancelable,startTime:e.timeStamp,processingStart:e.timeStamp+t};r.forEach((function(e){e(i)})),r=[]}},ne=function(e){if(e.cancelable){var t=(e.timeStamp>1e12?new Date:performance.now())-e.timeStamp;"pointerdown"==e.type?function(e,t){var n=function(){ee(e,t),i()},r=function(){i()},i=function(){removeEventListener("pointerup",n,Z),removeEventListener("pointercancel",r,Z)};addEventListener("pointerup",n,Z),addEventListener("pointercancel",r,Z)}(t,e):ee(t,e)}},re=function(e){["mousedown","keydown","touchstart","pointerdown"].forEach((function(t){return e(t,ne,Z)}))},ie=function(n,i){i=i||{};var a,o=[100,300],u=K(),c=z("FID"),s=function(e){e.startTime<u.firstHiddenTime&&(c.value=e.processingStart-e.startTime,c.entries.push(e),a(!0))},f=function(e){e.forEach(s)},d=W("first-input",f);a=U(n,c,o,i.reportAllChanges),d&&j((function(){f(d.takeRecords()),d.disconnect()}),!0),d&&H((function(){var u;c=z("FID"),a=U(n,c,o,i.reportAllChanges),r=[],t=-1,e=null,re(addEventListener),u=s,r.push(u),te()}))},ae=0,oe=1/0,ue=0,ce=function(e){e.forEach((function(e){e.interactionId&&(oe=Math.min(oe,e.interactionId),ue=Math.max(ue,e.interactionId),ae=ue?(ue-oe)/7+1:0)}))},se=function(){return i?ae:performance.interactionCount||0},fe=function(){"interactionCount"in performance||i||(i=W("event",ce,{type:"event",buffered:!0,durationThreshold:0}))},de=0,me=function(){return se()-de},le=[],ve={},pe=function(e){var t=le[le.length-1],n=ve[e.interactionId];if(n||le.length<10||e.duration>t.latency){if(n)n.entries.push(e),n.latency=Math.max(n.latency,e.duration);else{var r={id:e.interactionId,latency:e.duration,entries:[e]};ve[r.id]=r,le.push(r)}le.sort((function(e,t){return t.latency-e.latency})),le.splice(10).forEach((function(e){delete ve[e.id]}))}},Te=function(e,t){!function(e,t){t=t||{};var n=[200,500];fe();var r,i=z("INP"),a=function(e){e.forEach((function(e){e.interactionId&&pe(e),"first-input"===e.entryType&&!le.some((function(t){return t.entries.some((function(t){return e.duration===t.duration&&e.startTime===t.startTime}))}))&&pe(e)}));var t,n=(t=Math.min(le.length-1,Math.floor(me()/50)),le[t]);n&&n.latency!==i.value&&(i.value=n.latency,i.entries=n.entries,r())},o=W("event",a,{durationThreshold:t.durationThreshold||40});r=U(e,i,n,t.reportAllChanges),o&&(o.observe({type:"first-input",buffered:!0}),j((function(){a(o.takeRecords()),i.value<0&&me()>0&&(i.value=0,i.entries=[]),r(!0)})),H((function(){le=[],de=se(),i=z("INP"),r=U(e,i,n,t.reportAllChanges)})))}((function(t){!function(e){if(e.entries.length){var t=e.entries.sort((function(e,t){return t.duration-e.duration||t.processingEnd-t.processingStart-(e.processingEnd-e.processingStart)}))[0];e.attribution={eventTarget:R(t.target),eventType:t.name,eventTime:t.startTime,eventEntry:t,loadState:q(t.startTime)}}else e.attribution={}}(t),e(t)}),t)},ge={},he=function e(t){document.prerendering?addEventListener("prerenderingchange",(function(){return e(t)}),!0):"complete"!==document.readyState?addEventListener("load",(function(){return e(t)}),!0):setTimeout(t,0)},ye=function(e,t){t=t||{};var n=[800,1800],r=z("TTFB"),i=U(e,r,n,t.reportAllChanges);he((function(){var a=P();if(a){if(r.value=Math.max(a.responseStart-O(),0),r.value<0||r.value>performance.now())return;r.entries=[a],i(!0),H((function(){r=z("TTFB",0),(i=U(e,r,n,t.reportAllChanges))(!0)}))}}))},Ee=function(e){e.forEach((function(e){e.identifier&&I({attribution:{identifier:e.identifier},name:"ET",rating:null,value:e.startTime})}))},Se=function(e){e.forEach((function(e){if(a.isResourceTiming&&D("resourceTiming",e),e.decodedBodySize&&e.initiatorType){var t=e.decodedBodySize/1e3;g.value[e.initiatorType]+=t,g.value.total+=t}}))},be=function(){!function(e,t){ye((function(t){!function(e){if(e.entries.length){var t=e.entries[0],n=t.activationStart||0,r=Math.max(t.domainLookupStart-n,0),i=Math.max(t.connectStart-n,0),a=Math.max(t.requestStart-n,0);e.attribution={waitingTime:r,dnsTime:i-r,connectionTime:a-i,requestTime:e.value-a,navigationEntry:t}}else e.attribution={waitingTime:0,dnsTime:0,connectionTime:0,requestTime:0}}(t),e(t)}),t)}((function(e){e.value=e.value-e.entries[0].requestStart,I(e)})),function(e,t){!function(e,t){t=t||{};var n=[.1,.25];X||(Q((function(e){Y=e.value})),X=!0);var r,i=function(t){Y>-1&&e(t)},a=z("CLS",0),o=0,u=[],c=function(e){e.forEach((function(e){if(!e.hadRecentInput){var t=u[0],n=u[u.length-1];o&&e.startTime-n.startTime<1e3&&e.startTime-t.startTime<5e3?(o+=e.value,u.push(e)):(o=e.value,u=[e]),o>a.value&&(a.value=o,a.entries=u,r())}}))},s=W("layout-shift",c);s&&(r=U(i,a,n,t.reportAllChanges),j((function(){c(s.takeRecords()),r(!0)})),H((function(){o=0,Y=-1,a=z("CLS",0),r=U(i,a,n,t.reportAllChanges)})))}((function(t){!function(e){if(e.entries.length){var t=e.entries.reduce((function(e,t){return e&&e.value>t.value?e:t}));if(t&&t.sources&&t.sources.length){var n=(r=t.sources).find((function(e){return e.node&&1===e.node.nodeType}))||r[0];if(n)return void(e.attribution={largestShiftTarget:R(n.node),largestShiftTime:t.startTime,largestShiftValue:t.value,largestShiftSource:n,largestShiftEntry:t,loadState:q(t.startTime)})}}var r;e.attribution={}}(t),e(t)}),t)}((function(e){return I(e)})),function(e,t){Q((function(t){!function(e){if(e.entries.length){var t=P(),n=e.entries[e.entries.length-1];if(t){var r=t.activationStart||0,i=Math.max(0,t.responseStart-r);return void(e.attribution={timeToFirstByte:i,firstByteToFCP:e.value-i,loadState:q(e.entries[0].startTime),navigationEntry:t,fcpEntry:n})}}e.attribution={timeToFirstByte:0,firstByteToFCP:e.value,loadState:q(_())}}(t),e(t)}),t)}((function(e){return I(e)})),function(e,t){ie((function(t){!function(e){var t=e.entries[0];e.attribution={eventTarget:R(t.target),eventType:t.name,eventTime:t.startTime,eventEntry:t,loadState:q(t.startTime)}}(t),e(t)}),t)}((function(e){return I(e)})),function(e,t){!function(e,t){t=t||{};var n,r=[2500,4e3],i=K(),a=z("LCP"),o=function(e){var t=e[e.length-1];if(t){var r=Math.max(t.startTime-O(),0);r<i.firstHiddenTime&&(a.value=r,a.entries=[t],n())}},u=W("largest-contentful-paint",o);if(u){n=U(e,a,r,t.reportAllChanges);var c=function(){ge[a.id]||(o(u.takeRecords()),u.disconnect(),ge[a.id]=!0,n(!0))};["keydown","click"].forEach((function(e){addEventListener(e,c,{once:!0,capture:!0})})),j(c,!0),H((function(i){a=z("LCP"),n=U(e,a,r,t.reportAllChanges),requestAnimationFrame((function(){requestAnimationFrame((function(){a.value=performance.now()-i.timeStamp,ge[a.id]=!0,n(!0)}))}))}))}}((function(t){!function(e){if(e.entries.length){var t=P();if(t){var n=t.activationStart||0,r=e.entries[e.entries.length-1],i=r.url&&performance.getEntriesByType("resource").filter((function(e){return e.name===r.url}))[0],a=Math.max(0,t.responseStart-n),o=Math.max(a,i?(i.requestStart||i.startTime)-n:0),u=Math.max(o,i?i.responseEnd-n:0),c=Math.max(u,r?r.startTime-n:0),s={element:R(r.element),timeToFirstByte:a,resourceLoadDelay:o-a,resourceLoadTime:u-o,elementRenderDelay:c-u,navigationEntry:t,lcpEntry:r};return r.url&&(s.url=r.url),i&&(s.lcpResourceEntry=i),void(e.attribution=s)}}e.attribution={timeToFirstByte:0,resourceLoadDelay:0,resourceLoadTime:0,elementRenderDelay:e.value}}(t),e(t)}),t)}((function(e){return I(e)})),Te((function(e){return I(e)})),a.isResourceTiming&&E("resource",Se),a.isElementTiming&&E("element",Ee)},we=function(e){var t="usageDetails"in e?e.usageDetails:{};D("storageEstimate",{quota:L(e.quota),usage:L(e.usage),caches:L(t.caches),indexedDB:L(t.indexedDB),serviceWorker:L(t.serviceWorkerRegistrations)})},ke=0,Ce=function(){function e(e){if(void 0===e&&(e={}),this.v="8.1.0",a.analyticsTracker=e.analyticsTracker,a.isResourceTiming=!!e.resourceTiming,a.isElementTiming=!!e.elementTiming,a.maxTime=e.maxMeasureTime||a.maxTime,m()){"PerformanceObserver"in o&&be(),void 0!==document.hidden&&document.addEventListener("visibilitychange",(function(){return k}));var t=function(){if(!m())return{};var e=s.getEntriesByType("navigation")[0];if(!e)return{};var t=e.responseStart,n=e.responseEnd;return{fetchTime:n-e.fetchStart,workerTime:e.workerStart>0?n-e.workerStart:0,totalTime:n-e.requestStart,downloadTime:n-t,timeToFirstByte:t-e.requestStart,headerSize:e.transferSize-e.encodedBodySize||0,dnsLookupTime:e.domainLookupEnd-e.domainLookupStart,redirectTime:e.redirectEnd-e.redirectStart}}();D("navigationTiming",t),t.redirectTime&&I({attribution:{},name:"RT",rating:F("RT",t.redirectTime),value:t.redirectTime}),D("networkInformation",function(){if("connection"in c){var e=c.connection;return"object"!=typeof e?{}:(l=e.effectiveType,v=!!e.saveData,{downlink:e.downlink,effectiveType:e.effectiveType,rtt:e.rtt,saveData:!!e.saveData})}return{}}()),c&&c.storage&&"function"==typeof c.storage.estimate&&c.storage.estimate().then(we)}}return e.prototype.start=function(e){m()&&!p[e]&&(p[e]=!0,s.mark("mark_".concat(e,"_start")))},e.prototype.end=function(e,t,n){if(void 0===t&&(t={}),void 0===n&&(n=!0),m()&&p[e]){s.mark("mark_".concat(e,"_end")),delete p[e];var r=function(e){s.measure(e,"mark_".concat(e,"_start"),"mark_".concat(e,"_end"));var t=s.getEntriesByName(e).pop();return t&&"measure"===t.entryType?t.duration:-1}(e);n&&D(e,C(r),t)}},e.prototype.endPaint=function(e,t){var n=this;setTimeout((function(){n.end(e,t)}))},e.prototype.clear=function(e){delete p[e],s.clearMarks&&(s.clearMarks("mark_".concat(e,"_start")),s.clearMarks("mark_".concat(e,"_end")))},e.prototype.markNTBT=function(){var e=this;this.start("ntbt"),y.value=0,clearTimeout(ke),ke=setTimeout((function(){e.end("ntbt",{},!1),I({attribution:{},name:"NTBT",rating:F("NTBT",y.value),value:y.value}),y.value=0}),2e3)},e}();return Ce}();
//# sourceMappingURL=perfume.iife.min.js.map

@@ -1,2 +0,2 @@

"use strict";var e,t,n,r,i,a={isResourceTiming:!1,isElementTiming:!1,maxTime:3e4},o=window,u=o.console,c=o.navigator,s=o.performance,f=function(){return c.deviceMemory},l=function(){return c.hardwareConcurrency},m=function(){return s&&!!s.getEntriesByType&&!!s.now&&!!s.mark},d="4g",v=!1,p={},T={value:0},g={value:{beacon:0,css:0,fetch:0,img:0,other:0,script:0,total:0,xmlhttprequest:0}},h={value:0},y={value:0},E=function(e,t){try{var n=new PerformanceObserver((function(e){t(e.getEntries())}));return n.observe({type:e,buffered:!0}),n}catch(e){u.warn("Perfume.js:",e)}return null},S=function(){return!!(l()&&l()<=4)||!!(f()&&f()<=4)},b=function(e,t){switch(e){case"slow-2g":case"2g":case"3g":return!0;default:return S()||t}},w=function(e){return parseFloat(e.toFixed(4))},k=function(e){return"number"!=typeof e?null:w(e/Math.pow(1024,2))},C=function(e,t,n,r){var i;i=function(){a.analyticsTracker&&a.analyticsTracker({attribution:r,metricName:e,data:t,navigatorInformation:c?{deviceMemory:f()||0,hardwareConcurrency:l()||0,serviceWorkerStatus:"serviceWorker"in c?c.serviceWorker.controller?"controlled":"supported":"unsupported",isLowEndDevice:S(),isLowEndExperience:b(d,v)}:{},rating:n})},"requestIdleCallback"in o?o.requestIdleCallback(i,{timeout:3e3}):i()},L=function(e){e.forEach((function(e){if(!("self"!==e.name||e.startTime<T.value)){var t=e.duration-50;t>0&&(h.value+=t,y.value+=t)}}))},B={RT:[100,200],TBT:[200,600],NTBT:[200,600]},M=function(e,t){return B[e]?t<=B[e][0]?"good":t<=B[e][1]?"needsImprovement":"poor":null},x=function(e,t,n){Object.keys(t).forEach((function(e){"number"==typeof t[e]&&(t[e]=w(t[e]))})),C(e,t,null,n||{})},F=function(e){var t=e.attribution,n=e.name,r=e.rating,i=e.value;"FCP"===n&&(T.value=i),["FCP","LCP"].includes(n)&&E("longtask",L),"FID"===n&&setTimeout((function(){F({attribution:t,name:"TBT",rating:M("TBT",h.value),value:h.value}),x("dataConsumption",g.value)}),1e4);var o=w(i);o<=a.maxTime&&o>=0&&C(n,o,r,t)},D=function(){return window.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0]},I=function(e){if("loading"===document.readyState)return"loading";var t=D();if(t){if(e<t.domInteractive)return"loading";if(0===t.domContentLoadedEventStart||e<t.domContentLoadedEventStart)return"dom-interactive";if(0===t.domComplete||e<t.domComplete)return"dom-content-loaded"}return"complete"},P=function(e){var t=e.nodeName;return 1===e.nodeType?t.toLowerCase():t.toUpperCase().replace(/^#/,"")},q=function(e,t){var n="";try{for(;e&&9!==e.nodeType;){var r=e,i=r.id?"#"+r.id:P(r)+(r.className&&r.className.length?"."+r.className.replace(/\s+/g,"."):"");if(n.length+i.length>(t||100)-1)return n||i;if(n=n?i+">"+n:i,r.id)break;e=r.parentNode}}catch(e){}return n},A=-1,R=function(){return A},N=function(e){addEventListener("pageshow",(function(t){t.persisted&&(A=t.timeStamp,e(t))}),!0)},_=function(){var e=D();return e&&e.activationStart||0},O=function(e,t){var n=D(),r="navigate";return R()>=0?r="back-forward-cache":n&&(r=document.prerendering||_()>0?"prerender":n.type.replace(/_/g,"-")),{name:e,value:void 0===t?-1:t,rating:"good",delta:0,entries:[],id:"v3-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:r}},z=function(e,t,n){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var r=new PerformanceObserver((function(e){t(e.getEntries())}));return r.observe(Object.assign({type:e,buffered:!0},n||{})),r}}catch(e){}},W=function(e,t){var n=function n(r){"pagehide"!==r.type&&"hidden"!==document.visibilityState||(e(r),t&&(removeEventListener("visibilitychange",n,!0),removeEventListener("pagehide",n,!0)))};addEventListener("visibilitychange",n,!0),addEventListener("pagehide",n,!0)},j=function(e,t,n,r){var i,a;return function(o){t.value>=0&&(o||r)&&((a=t.value-(i||0))||void 0===i)&&(i=t.value,t.delta=a,t.rating=function(e,t){return e>t[1]?"poor":e>t[0]?"needs-improvement":"good"}(t.value,n),e(t))}},H=-1,U=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},V=function(){W((function(e){var t=e.timeStamp;H=t}),!0)},G=function(){return H<0&&(H=U(),V(),N((function(){setTimeout((function(){H=U(),V()}),0)}))),{get firstHiddenTime(){return H}}},J=function(e,t){t=t||{};var n,r=[1800,3e3],i=G(),a=O("FCP"),o=function(e){e.forEach((function(e){"first-contentful-paint"===e.name&&(c&&c.disconnect(),e.startTime<i.firstHiddenTime&&(a.value=Math.max(e.startTime-_(),0),a.entries.push(e),n(!0)))}))},u=window.performance&&window.performance.getEntriesByName&&window.performance.getEntriesByName("first-contentful-paint")[0],c=u?null:z("paint",o);(u||c)&&(n=j(e,a,r,t.reportAllChanges),u&&o([u]),N((function(i){a=O("FCP"),n=j(e,a,r,t.reportAllChanges),requestAnimationFrame((function(){requestAnimationFrame((function(){a.value=performance.now()-i.timeStamp,n(!0)}))}))})))},K=!1,Q=-1,X={passive:!0,capture:!0},Y=new Date,Z=function(r,i){e||(e=i,t=r,n=new Date,te(removeEventListener),$())},$=function(){if(t>=0&&t<n-Y){var i={entryType:"first-input",name:e.type,target:e.target,cancelable:e.cancelable,startTime:e.timeStamp,processingStart:e.timeStamp+t};r.forEach((function(e){e(i)})),r=[]}},ee=function(e){if(e.cancelable){var t=(e.timeStamp>1e12?new Date:performance.now())-e.timeStamp;"pointerdown"==e.type?function(e,t){var n=function(){Z(e,t),i()},r=function(){i()},i=function(){removeEventListener("pointerup",n,X),removeEventListener("pointercancel",r,X)};addEventListener("pointerup",n,X),addEventListener("pointercancel",r,X)}(t,e):Z(t,e)}},te=function(e){["mousedown","keydown","touchstart","pointerdown"].forEach((function(t){return e(t,ee,X)}))},ne=function(n,i){i=i||{};var a,o=[100,300],u=G(),c=O("FID"),s=function(e){e.startTime<u.firstHiddenTime&&(c.value=e.processingStart-e.startTime,c.entries.push(e),a(!0))},f=function(e){e.forEach(s)},l=z("first-input",f);a=j(n,c,o,i.reportAllChanges),l&&W((function(){f(l.takeRecords()),l.disconnect()}),!0),l&&N((function(){var u;c=O("FID"),a=j(n,c,o,i.reportAllChanges),r=[],t=-1,e=null,te(addEventListener),u=s,r.push(u),$()}))},re=0,ie=1/0,ae=0,oe=function(e){e.forEach((function(e){e.interactionId&&(ie=Math.min(ie,e.interactionId),ae=Math.max(ae,e.interactionId),re=ae?(ae-ie)/7+1:0)}))},ue=function(){return i?re:performance.interactionCount||0},ce=function(){"interactionCount"in performance||i||(i=z("event",oe,{type:"event",buffered:!0,durationThreshold:0}))},se=0,fe=function(){return ue()-se},le=[],me={},de=function(e){var t=le[le.length-1],n=me[e.interactionId];if(n||le.length<10||e.duration>t.latency){if(n)n.entries.push(e),n.latency=Math.max(n.latency,e.duration);else{var r={id:e.interactionId,latency:e.duration,entries:[e]};me[r.id]=r,le.push(r)}le.sort((function(e,t){return t.latency-e.latency})),le.splice(10).forEach((function(e){delete me[e.id]}))}},ve=function(e,t){!function(e,t){t=t||{};var n=[200,500];ce();var r,i=O("INP"),a=function(e){e.forEach((function(e){e.interactionId&&de(e),"first-input"===e.entryType&&!le.some((function(t){return t.entries.some((function(t){return e.duration===t.duration&&e.startTime===t.startTime}))}))&&de(e)}));var t,n=(t=Math.min(le.length-1,Math.floor(fe()/50)),le[t]);n&&n.latency!==i.value&&(i.value=n.latency,i.entries=n.entries,r())},o=z("event",a,{durationThreshold:t.durationThreshold||40});r=j(e,i,n,t.reportAllChanges),o&&(o.observe({type:"first-input",buffered:!0}),W((function(){a(o.takeRecords()),i.value<0&&fe()>0&&(i.value=0,i.entries=[]),r(!0)})),N((function(){le=[],se=ue(),i=O("INP"),r=j(e,i,n,t.reportAllChanges)})))}((function(t){!function(e){if(e.entries.length){var t=e.entries.sort((function(e,t){return t.duration-e.duration||t.processingEnd-t.processingStart-(e.processingEnd-e.processingStart)}))[0];e.attribution={eventTarget:q(t.target),eventType:t.name,eventTime:t.startTime,eventEntry:t,loadState:I(t.startTime)}}else e.attribution={}}(t),e(t)}),t)},pe={},Te=function e(t){document.prerendering?addEventListener("prerenderingchange",(function(){return e(t)}),!0):"complete"!==document.readyState?addEventListener("load",(function(){return e(t)}),!0):setTimeout(t,0)},ge=function(e,t){t=t||{};var n=[800,1800],r=O("TTFB"),i=j(e,r,n,t.reportAllChanges);Te((function(){var a=D();if(a){if(r.value=Math.max(a.responseStart-_(),0),r.value<0||r.value>performance.now())return;r.entries=[a],i(!0),N((function(){r=O("TTFB",0),(i=j(e,r,n,t.reportAllChanges))(!0)}))}}))},he=function(e){e.forEach((function(e){e.identifier&&F({attribution:{identifier:e.identifier},name:"ET",rating:null,value:e.startTime})}))},ye=function(e){e.forEach((function(e){if(a.isResourceTiming&&x("resourceTiming",e),e.decodedBodySize&&e.initiatorType){var t=e.decodedBodySize/1e3;g.value[e.initiatorType]+=t,g.value.total+=t}}))},Ee=function(){!function(e,t){ge((function(t){!function(e){if(e.entries.length){var t=e.entries[0],n=t.activationStart||0,r=Math.max(t.domainLookupStart-n,0),i=Math.max(t.connectStart-n,0),a=Math.max(t.requestStart-n,0);e.attribution={waitingTime:r,dnsTime:i-r,connectionTime:a-i,requestTime:e.value-a,navigationEntry:t}}else e.attribution={waitingTime:0,dnsTime:0,connectionTime:0,requestTime:0}}(t),e(t)}),t)}((function(e){e.value=e.value-e.entries[0].requestStart,F(e)})),function(e,t){!function(e,t){t=t||{};var n=[.1,.25];K||(J((function(e){Q=e.value})),K=!0);var r,i=function(t){Q>-1&&e(t)},a=O("CLS",0),o=0,u=[],c=function(e){e.forEach((function(e){if(!e.hadRecentInput){var t=u[0],n=u[u.length-1];o&&e.startTime-n.startTime<1e3&&e.startTime-t.startTime<5e3?(o+=e.value,u.push(e)):(o=e.value,u=[e]),o>a.value&&(a.value=o,a.entries=u,r())}}))},s=z("layout-shift",c);s&&(r=j(i,a,n,t.reportAllChanges),W((function(){c(s.takeRecords()),r(!0)})),N((function(){o=0,Q=-1,a=O("CLS",0),r=j(i,a,n,t.reportAllChanges)})))}((function(t){!function(e){if(e.entries.length){var t=e.entries.reduce((function(e,t){return e&&e.value>t.value?e:t}));if(t&&t.sources&&t.sources.length){var n=(r=t.sources).find((function(e){return e.node&&1===e.node.nodeType}))||r[0];if(n)return void(e.attribution={largestShiftTarget:q(n.node),largestShiftTime:t.startTime,largestShiftValue:t.value,largestShiftSource:n,largestShiftEntry:t,loadState:I(t.startTime)})}}var r;e.attribution={}}(t),e(t)}),t)}((function(e){return F(e)})),function(e,t){J((function(t){!function(e){if(e.entries.length){var t=D(),n=e.entries[e.entries.length-1];if(t){var r=t.activationStart||0,i=Math.max(0,t.responseStart-r);return void(e.attribution={timeToFirstByte:i,firstByteToFCP:e.value-i,loadState:I(e.entries[0].startTime),navigationEntry:t,fcpEntry:n})}}e.attribution={timeToFirstByte:0,firstByteToFCP:e.value,loadState:I(R())}}(t),e(t)}),t)}((function(e){return F(e)})),function(e,t){ne((function(t){!function(e){var t=e.entries[0];e.attribution={eventTarget:q(t.target),eventType:t.name,eventTime:t.startTime,eventEntry:t,loadState:I(t.startTime)}}(t),e(t)}),t)}((function(e){return F(e)})),function(e,t){!function(e,t){t=t||{};var n,r=[2500,4e3],i=G(),a=O("LCP"),o=function(e){var t=e[e.length-1];if(t){var r=Math.max(t.startTime-_(),0);r<i.firstHiddenTime&&(a.value=r,a.entries=[t],n())}},u=z("largest-contentful-paint",o);if(u){n=j(e,a,r,t.reportAllChanges);var c=function(){pe[a.id]||(o(u.takeRecords()),u.disconnect(),pe[a.id]=!0,n(!0))};["keydown","click"].forEach((function(e){addEventListener(e,c,{once:!0,capture:!0})})),W(c,!0),N((function(i){a=O("LCP"),n=j(e,a,r,t.reportAllChanges),requestAnimationFrame((function(){requestAnimationFrame((function(){a.value=performance.now()-i.timeStamp,pe[a.id]=!0,n(!0)}))}))}))}}((function(t){!function(e){if(e.entries.length){var t=D();if(t){var n=t.activationStart||0,r=e.entries[e.entries.length-1],i=r.url&&performance.getEntriesByType("resource").filter((function(e){return e.name===r.url}))[0],a=Math.max(0,t.responseStart-n),o=Math.max(a,i?(i.requestStart||i.startTime)-n:0),u=Math.max(o,i?i.responseEnd-n:0),c=Math.max(u,r?r.startTime-n:0),s={element:q(r.element),timeToFirstByte:a,resourceLoadDelay:o-a,resourceLoadTime:u-o,elementRenderDelay:c-u,navigationEntry:t,lcpEntry:r};return r.url&&(s.url=r.url),i&&(s.lcpResourceEntry=i),void(e.attribution=s)}}e.attribution={timeToFirstByte:0,resourceLoadDelay:0,resourceLoadTime:0,elementRenderDelay:e.value}}(t),e(t)}),t)}((function(e){return F(e)})),ve((function(e){return F(e)})),a.isResourceTiming&&E("resource",ye),a.isElementTiming&&E("element",he)},Se=function(e){var t="usageDetails"in e?e.usageDetails:{};x("storageEstimate",{quota:k(e.quota),usage:k(e.usage),caches:k(t.caches),indexedDB:k(t.indexedDB),serviceWorker:k(t.serviceWorkerRegistrations)})},be=0,we=function(){function e(e){if(void 0===e&&(e={}),this.v="8.0.0",a.analyticsTracker=e.analyticsTracker,a.isResourceTiming=!!e.resourceTiming,a.isElementTiming=!!e.elementTiming,a.maxTime=e.maxMeasureTime||a.maxTime,m()){"PerformanceObserver"in o&&Ee();var t=function(){if(!m())return{};var e=s.getEntriesByType("navigation")[0];if(!e)return{};var t=e.responseStart,n=e.responseEnd;return{fetchTime:n-e.fetchStart,workerTime:e.workerStart>0?n-e.workerStart:0,totalTime:n-e.requestStart,downloadTime:n-t,timeToFirstByte:t-e.requestStart,headerSize:e.transferSize-e.encodedBodySize||0,dnsLookupTime:e.domainLookupEnd-e.domainLookupStart,redirectTime:e.redirectEnd-e.redirectStart}}();x("navigationTiming",t),t.redirectTime&&F({attribution:{},name:"RT",rating:M("RT",t.redirectTime),value:t.redirectTime}),x("networkInformation",function(){if("connection"in c){var e=c.connection;return"object"!=typeof e?{}:(d=e.effectiveType,v=!!e.saveData,{downlink:e.downlink,effectiveType:e.effectiveType,rtt:e.rtt,saveData:!!e.saveData})}return{}}()),c&&c.storage&&"function"==typeof c.storage.estimate&&c.storage.estimate().then(Se)}}return e.prototype.start=function(e){m()&&!p[e]&&(p[e]=!0,s.mark("mark_".concat(e,"_start")))},e.prototype.end=function(e,t,n){if(void 0===t&&(t={}),void 0===n&&(n=!0),m()&&p[e]){s.mark("mark_".concat(e,"_end")),delete p[e];var r=function(e){s.measure(e,"mark_".concat(e,"_start"),"mark_".concat(e,"_end"));var t=s.getEntriesByName(e).pop();return t&&"measure"===t.entryType?t.duration:-1}(e);n&&x(e,w(r),t)}},e.prototype.endPaint=function(e,t){var n=this;setTimeout((function(){n.end(e,t)}))},e.prototype.clear=function(e){delete p[e],s.clearMarks&&(s.clearMarks("mark_".concat(e,"_start")),s.clearMarks("mark_".concat(e,"_end")))},e.prototype.markNTBT=function(){var e=this;this.start("ntbt"),y.value=0,clearTimeout(be),be=setTimeout((function(){e.end("ntbt",{},!1),F({attribution:{},name:"NTBT",rating:M("NTBT",y.value),value:y.value}),y.value=0}),2e3)},e}();module.exports=we;
"use strict";var e,t,n,r,i,a={isResourceTiming:!1,isElementTiming:!1,maxTime:3e4},o=window,u=o.console,c=o.navigator,s=o.performance,f=function(){return c.deviceMemory},d=function(){return c.hardwareConcurrency},m=function(){return s&&!!s.getEntriesByType&&!!s.now&&!!s.mark},l="4g",v=!1,p={},T={value:0},g={value:{beacon:0,css:0,fetch:0,img:0,other:0,script:0,total:0,xmlhttprequest:0}},h={value:0},y={value:0},E=function(e,t){try{var n=new PerformanceObserver((function(e){t(e.getEntries())}));return n.observe({type:e,buffered:!0}),n}catch(e){u.warn("Perfume.js:",e)}return null},S=function(){return!!(d()&&d()<=4)||!!(f()&&f()<=4)},b=function(e,t){switch(e){case"slow-2g":case"2g":case"3g":return!0;default:return S()||t}},w={isHidden:!1},k=function(e){document.hidden&&(e(),w.isHidden=document.hidden)},C=function(e){return parseFloat(e.toFixed(4))},L=function(e){return"number"!=typeof e?null:C(e/Math.pow(1024,2))},B=function(e,t,n,r){var i;i=function(){!w.isHidden&&a.analyticsTracker&&a.analyticsTracker({attribution:r,metricName:e,data:t,navigatorInformation:c?{deviceMemory:f()||0,hardwareConcurrency:d()||0,serviceWorkerStatus:"serviceWorker"in c?c.serviceWorker.controller?"controlled":"supported":"unsupported",isLowEndDevice:S(),isLowEndExperience:b(l,v)}:{},rating:n})},"requestIdleCallback"in o?o.requestIdleCallback(i,{timeout:3e3}):i()},M=function(e){e.forEach((function(e){if(!("self"!==e.name||e.startTime<T.value)){var t=e.duration-50;t>0&&(h.value+=t,y.value+=t)}}))},x={RT:[100,200],TBT:[200,600],NTBT:[200,600]},F=function(e,t){return x[e]?t<=x[e][0]?"good":t<=x[e][1]?"needsImprovement":"poor":null},D=function(e,t,n){Object.keys(t).forEach((function(e){"number"==typeof t[e]&&(t[e]=C(t[e]))})),B(e,t,null,n||{})},I=function(e){var t=e.attribution,n=e.name,r=e.rating,i=e.value;"FCP"===n&&(T.value=i),["FCP","LCP"].includes(n)&&E("longtask",M),"FID"===n&&setTimeout((function(){I({attribution:t,name:"TBT",rating:F("TBT",h.value),value:h.value}),D("dataConsumption",g.value)}),1e4);var o=C(i);o<=a.maxTime&&o>=0&&B(n,o,r,t)},P=function(){return window.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0]},q=function(e){if("loading"===document.readyState)return"loading";var t=P();if(t){if(e<t.domInteractive)return"loading";if(0===t.domContentLoadedEventStart||e<t.domContentLoadedEventStart)return"dom-interactive";if(0===t.domComplete||e<t.domComplete)return"dom-content-loaded"}return"complete"},A=function(e){var t=e.nodeName;return 1===e.nodeType?t.toLowerCase():t.toUpperCase().replace(/^#/,"")},R=function(e,t){var n="";try{for(;e&&9!==e.nodeType;){var r=e,i=r.id?"#"+r.id:A(r)+(r.className&&r.className.length?"."+r.className.replace(/\s+/g,"."):"");if(n.length+i.length>(t||100)-1)return n||i;if(n=n?i+">"+n:i,r.id)break;e=r.parentNode}}catch(e){}return n},N=-1,_=function(){return N},H=function(e){addEventListener("pageshow",(function(t){t.persisted&&(N=t.timeStamp,e(t))}),!0)},O=function(){var e=P();return e&&e.activationStart||0},z=function(e,t){var n=P(),r="navigate";return _()>=0?r="back-forward-cache":n&&(r=document.prerendering||O()>0?"prerender":n.type.replace(/_/g,"-")),{name:e,value:void 0===t?-1:t,rating:"good",delta:0,entries:[],id:"v3-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:r}},W=function(e,t,n){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var r=new PerformanceObserver((function(e){t(e.getEntries())}));return r.observe(Object.assign({type:e,buffered:!0},n||{})),r}}catch(e){}},j=function(e,t){var n=function n(r){"pagehide"!==r.type&&"hidden"!==document.visibilityState||(e(r),t&&(removeEventListener("visibilitychange",n,!0),removeEventListener("pagehide",n,!0)))};addEventListener("visibilitychange",n,!0),addEventListener("pagehide",n,!0)},U=function(e,t,n,r){var i,a;return function(o){t.value>=0&&(o||r)&&((a=t.value-(i||0))||void 0===i)&&(i=t.value,t.delta=a,t.rating=function(e,t){return e>t[1]?"poor":e>t[0]?"needs-improvement":"good"}(t.value,n),e(t))}},V=-1,G=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},J=function(){j((function(e){var t=e.timeStamp;V=t}),!0)},K=function(){return V<0&&(V=G(),J(),H((function(){setTimeout((function(){V=G(),J()}),0)}))),{get firstHiddenTime(){return V}}},Q=function(e,t){t=t||{};var n,r=[1800,3e3],i=K(),a=z("FCP"),o=function(e){e.forEach((function(e){"first-contentful-paint"===e.name&&(c&&c.disconnect(),e.startTime<i.firstHiddenTime&&(a.value=Math.max(e.startTime-O(),0),a.entries.push(e),n(!0)))}))},u=window.performance&&window.performance.getEntriesByName&&window.performance.getEntriesByName("first-contentful-paint")[0],c=u?null:W("paint",o);(u||c)&&(n=U(e,a,r,t.reportAllChanges),u&&o([u]),H((function(i){a=z("FCP"),n=U(e,a,r,t.reportAllChanges),requestAnimationFrame((function(){requestAnimationFrame((function(){a.value=performance.now()-i.timeStamp,n(!0)}))}))})))},X=!1,Y=-1,Z={passive:!0,capture:!0},$=new Date,ee=function(r,i){e||(e=i,t=r,n=new Date,re(removeEventListener),te())},te=function(){if(t>=0&&t<n-$){var i={entryType:"first-input",name:e.type,target:e.target,cancelable:e.cancelable,startTime:e.timeStamp,processingStart:e.timeStamp+t};r.forEach((function(e){e(i)})),r=[]}},ne=function(e){if(e.cancelable){var t=(e.timeStamp>1e12?new Date:performance.now())-e.timeStamp;"pointerdown"==e.type?function(e,t){var n=function(){ee(e,t),i()},r=function(){i()},i=function(){removeEventListener("pointerup",n,Z),removeEventListener("pointercancel",r,Z)};addEventListener("pointerup",n,Z),addEventListener("pointercancel",r,Z)}(t,e):ee(t,e)}},re=function(e){["mousedown","keydown","touchstart","pointerdown"].forEach((function(t){return e(t,ne,Z)}))},ie=function(n,i){i=i||{};var a,o=[100,300],u=K(),c=z("FID"),s=function(e){e.startTime<u.firstHiddenTime&&(c.value=e.processingStart-e.startTime,c.entries.push(e),a(!0))},f=function(e){e.forEach(s)},d=W("first-input",f);a=U(n,c,o,i.reportAllChanges),d&&j((function(){f(d.takeRecords()),d.disconnect()}),!0),d&&H((function(){var u;c=z("FID"),a=U(n,c,o,i.reportAllChanges),r=[],t=-1,e=null,re(addEventListener),u=s,r.push(u),te()}))},ae=0,oe=1/0,ue=0,ce=function(e){e.forEach((function(e){e.interactionId&&(oe=Math.min(oe,e.interactionId),ue=Math.max(ue,e.interactionId),ae=ue?(ue-oe)/7+1:0)}))},se=function(){return i?ae:performance.interactionCount||0},fe=function(){"interactionCount"in performance||i||(i=W("event",ce,{type:"event",buffered:!0,durationThreshold:0}))},de=0,me=function(){return se()-de},le=[],ve={},pe=function(e){var t=le[le.length-1],n=ve[e.interactionId];if(n||le.length<10||e.duration>t.latency){if(n)n.entries.push(e),n.latency=Math.max(n.latency,e.duration);else{var r={id:e.interactionId,latency:e.duration,entries:[e]};ve[r.id]=r,le.push(r)}le.sort((function(e,t){return t.latency-e.latency})),le.splice(10).forEach((function(e){delete ve[e.id]}))}},Te=function(e,t){!function(e,t){t=t||{};var n=[200,500];fe();var r,i=z("INP"),a=function(e){e.forEach((function(e){e.interactionId&&pe(e),"first-input"===e.entryType&&!le.some((function(t){return t.entries.some((function(t){return e.duration===t.duration&&e.startTime===t.startTime}))}))&&pe(e)}));var t,n=(t=Math.min(le.length-1,Math.floor(me()/50)),le[t]);n&&n.latency!==i.value&&(i.value=n.latency,i.entries=n.entries,r())},o=W("event",a,{durationThreshold:t.durationThreshold||40});r=U(e,i,n,t.reportAllChanges),o&&(o.observe({type:"first-input",buffered:!0}),j((function(){a(o.takeRecords()),i.value<0&&me()>0&&(i.value=0,i.entries=[]),r(!0)})),H((function(){le=[],de=se(),i=z("INP"),r=U(e,i,n,t.reportAllChanges)})))}((function(t){!function(e){if(e.entries.length){var t=e.entries.sort((function(e,t){return t.duration-e.duration||t.processingEnd-t.processingStart-(e.processingEnd-e.processingStart)}))[0];e.attribution={eventTarget:R(t.target),eventType:t.name,eventTime:t.startTime,eventEntry:t,loadState:q(t.startTime)}}else e.attribution={}}(t),e(t)}),t)},ge={},he=function e(t){document.prerendering?addEventListener("prerenderingchange",(function(){return e(t)}),!0):"complete"!==document.readyState?addEventListener("load",(function(){return e(t)}),!0):setTimeout(t,0)},ye=function(e,t){t=t||{};var n=[800,1800],r=z("TTFB"),i=U(e,r,n,t.reportAllChanges);he((function(){var a=P();if(a){if(r.value=Math.max(a.responseStart-O(),0),r.value<0||r.value>performance.now())return;r.entries=[a],i(!0),H((function(){r=z("TTFB",0),(i=U(e,r,n,t.reportAllChanges))(!0)}))}}))},Ee=function(e){e.forEach((function(e){e.identifier&&I({attribution:{identifier:e.identifier},name:"ET",rating:null,value:e.startTime})}))},Se=function(e){e.forEach((function(e){if(a.isResourceTiming&&D("resourceTiming",e),e.decodedBodySize&&e.initiatorType){var t=e.decodedBodySize/1e3;g.value[e.initiatorType]+=t,g.value.total+=t}}))},be=function(){!function(e,t){ye((function(t){!function(e){if(e.entries.length){var t=e.entries[0],n=t.activationStart||0,r=Math.max(t.domainLookupStart-n,0),i=Math.max(t.connectStart-n,0),a=Math.max(t.requestStart-n,0);e.attribution={waitingTime:r,dnsTime:i-r,connectionTime:a-i,requestTime:e.value-a,navigationEntry:t}}else e.attribution={waitingTime:0,dnsTime:0,connectionTime:0,requestTime:0}}(t),e(t)}),t)}((function(e){e.value=e.value-e.entries[0].requestStart,I(e)})),function(e,t){!function(e,t){t=t||{};var n=[.1,.25];X||(Q((function(e){Y=e.value})),X=!0);var r,i=function(t){Y>-1&&e(t)},a=z("CLS",0),o=0,u=[],c=function(e){e.forEach((function(e){if(!e.hadRecentInput){var t=u[0],n=u[u.length-1];o&&e.startTime-n.startTime<1e3&&e.startTime-t.startTime<5e3?(o+=e.value,u.push(e)):(o=e.value,u=[e]),o>a.value&&(a.value=o,a.entries=u,r())}}))},s=W("layout-shift",c);s&&(r=U(i,a,n,t.reportAllChanges),j((function(){c(s.takeRecords()),r(!0)})),H((function(){o=0,Y=-1,a=z("CLS",0),r=U(i,a,n,t.reportAllChanges)})))}((function(t){!function(e){if(e.entries.length){var t=e.entries.reduce((function(e,t){return e&&e.value>t.value?e:t}));if(t&&t.sources&&t.sources.length){var n=(r=t.sources).find((function(e){return e.node&&1===e.node.nodeType}))||r[0];if(n)return void(e.attribution={largestShiftTarget:R(n.node),largestShiftTime:t.startTime,largestShiftValue:t.value,largestShiftSource:n,largestShiftEntry:t,loadState:q(t.startTime)})}}var r;e.attribution={}}(t),e(t)}),t)}((function(e){return I(e)})),function(e,t){Q((function(t){!function(e){if(e.entries.length){var t=P(),n=e.entries[e.entries.length-1];if(t){var r=t.activationStart||0,i=Math.max(0,t.responseStart-r);return void(e.attribution={timeToFirstByte:i,firstByteToFCP:e.value-i,loadState:q(e.entries[0].startTime),navigationEntry:t,fcpEntry:n})}}e.attribution={timeToFirstByte:0,firstByteToFCP:e.value,loadState:q(_())}}(t),e(t)}),t)}((function(e){return I(e)})),function(e,t){ie((function(t){!function(e){var t=e.entries[0];e.attribution={eventTarget:R(t.target),eventType:t.name,eventTime:t.startTime,eventEntry:t,loadState:q(t.startTime)}}(t),e(t)}),t)}((function(e){return I(e)})),function(e,t){!function(e,t){t=t||{};var n,r=[2500,4e3],i=K(),a=z("LCP"),o=function(e){var t=e[e.length-1];if(t){var r=Math.max(t.startTime-O(),0);r<i.firstHiddenTime&&(a.value=r,a.entries=[t],n())}},u=W("largest-contentful-paint",o);if(u){n=U(e,a,r,t.reportAllChanges);var c=function(){ge[a.id]||(o(u.takeRecords()),u.disconnect(),ge[a.id]=!0,n(!0))};["keydown","click"].forEach((function(e){addEventListener(e,c,{once:!0,capture:!0})})),j(c,!0),H((function(i){a=z("LCP"),n=U(e,a,r,t.reportAllChanges),requestAnimationFrame((function(){requestAnimationFrame((function(){a.value=performance.now()-i.timeStamp,ge[a.id]=!0,n(!0)}))}))}))}}((function(t){!function(e){if(e.entries.length){var t=P();if(t){var n=t.activationStart||0,r=e.entries[e.entries.length-1],i=r.url&&performance.getEntriesByType("resource").filter((function(e){return e.name===r.url}))[0],a=Math.max(0,t.responseStart-n),o=Math.max(a,i?(i.requestStart||i.startTime)-n:0),u=Math.max(o,i?i.responseEnd-n:0),c=Math.max(u,r?r.startTime-n:0),s={element:R(r.element),timeToFirstByte:a,resourceLoadDelay:o-a,resourceLoadTime:u-o,elementRenderDelay:c-u,navigationEntry:t,lcpEntry:r};return r.url&&(s.url=r.url),i&&(s.lcpResourceEntry=i),void(e.attribution=s)}}e.attribution={timeToFirstByte:0,resourceLoadDelay:0,resourceLoadTime:0,elementRenderDelay:e.value}}(t),e(t)}),t)}((function(e){return I(e)})),Te((function(e){return I(e)})),a.isResourceTiming&&E("resource",Se),a.isElementTiming&&E("element",Ee)},we=function(e){var t="usageDetails"in e?e.usageDetails:{};D("storageEstimate",{quota:L(e.quota),usage:L(e.usage),caches:L(t.caches),indexedDB:L(t.indexedDB),serviceWorker:L(t.serviceWorkerRegistrations)})},ke=0,Ce=function(){function e(e){if(void 0===e&&(e={}),this.v="8.1.0",a.analyticsTracker=e.analyticsTracker,a.isResourceTiming=!!e.resourceTiming,a.isElementTiming=!!e.elementTiming,a.maxTime=e.maxMeasureTime||a.maxTime,m()){"PerformanceObserver"in o&&be(),void 0!==document.hidden&&document.addEventListener("visibilitychange",(function(){return k}));var t=function(){if(!m())return{};var e=s.getEntriesByType("navigation")[0];if(!e)return{};var t=e.responseStart,n=e.responseEnd;return{fetchTime:n-e.fetchStart,workerTime:e.workerStart>0?n-e.workerStart:0,totalTime:n-e.requestStart,downloadTime:n-t,timeToFirstByte:t-e.requestStart,headerSize:e.transferSize-e.encodedBodySize||0,dnsLookupTime:e.domainLookupEnd-e.domainLookupStart,redirectTime:e.redirectEnd-e.redirectStart}}();D("navigationTiming",t),t.redirectTime&&I({attribution:{},name:"RT",rating:F("RT",t.redirectTime),value:t.redirectTime}),D("networkInformation",function(){if("connection"in c){var e=c.connection;return"object"!=typeof e?{}:(l=e.effectiveType,v=!!e.saveData,{downlink:e.downlink,effectiveType:e.effectiveType,rtt:e.rtt,saveData:!!e.saveData})}return{}}()),c&&c.storage&&"function"==typeof c.storage.estimate&&c.storage.estimate().then(we)}}return e.prototype.start=function(e){m()&&!p[e]&&(p[e]=!0,s.mark("mark_".concat(e,"_start")))},e.prototype.end=function(e,t,n){if(void 0===t&&(t={}),void 0===n&&(n=!0),m()&&p[e]){s.mark("mark_".concat(e,"_end")),delete p[e];var r=function(e){s.measure(e,"mark_".concat(e,"_start"),"mark_".concat(e,"_end"));var t=s.getEntriesByName(e).pop();return t&&"measure"===t.entryType?t.duration:-1}(e);n&&D(e,C(r),t)}},e.prototype.endPaint=function(e,t){var n=this;setTimeout((function(){n.end(e,t)}))},e.prototype.clear=function(e){delete p[e],s.clearMarks&&(s.clearMarks("mark_".concat(e,"_start")),s.clearMarks("mark_".concat(e,"_end")))},e.prototype.markNTBT=function(){var e=this;this.start("ntbt"),y.value=0,clearTimeout(ke),ke=setTimeout((function(){e.end("ntbt",{},!1),I({attribution:{},name:"NTBT",rating:F("NTBT",y.value),value:y.value}),y.value=0}),2e3)},e}();module.exports=Ce;
//# sourceMappingURL=perfume.min.js.map

@@ -1,2 +0,2 @@

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).Perfume=t()}(this,(function(){"use strict";var e,t,n,r,i,a={isResourceTiming:!1,isElementTiming:!1,maxTime:3e4},o=window,u=o.console,c=o.navigator,s=o.performance,f=function(){return c.deviceMemory},l=function(){return c.hardwareConcurrency},d=function(){return s&&!!s.getEntriesByType&&!!s.now&&!!s.mark},m="4g",v=!1,p={},T={value:0},g={value:{beacon:0,css:0,fetch:0,img:0,other:0,script:0,total:0,xmlhttprequest:0}},h={value:0},y={value:0},E=function(e,t){try{var n=new PerformanceObserver((function(e){t(e.getEntries())}));return n.observe({type:e,buffered:!0}),n}catch(e){u.warn("Perfume.js:",e)}return null},S=function(){return!!(l()&&l()<=4)||!!(f()&&f()<=4)},b=function(e,t){switch(e){case"slow-2g":case"2g":case"3g":return!0;default:return S()||t}},w=function(e){return parseFloat(e.toFixed(4))},k=function(e){return"number"!=typeof e?null:w(e/Math.pow(1024,2))},C=function(e,t,n,r){var i;i=function(){a.analyticsTracker&&a.analyticsTracker({attribution:r,metricName:e,data:t,navigatorInformation:c?{deviceMemory:f()||0,hardwareConcurrency:l()||0,serviceWorkerStatus:"serviceWorker"in c?c.serviceWorker.controller?"controlled":"supported":"unsupported",isLowEndDevice:S(),isLowEndExperience:b(m,v)}:{},rating:n})},"requestIdleCallback"in o?o.requestIdleCallback(i,{timeout:3e3}):i()},L=function(e){e.forEach((function(e){if(!("self"!==e.name||e.startTime<T.value)){var t=e.duration-50;t>0&&(h.value+=t,y.value+=t)}}))},B={RT:[100,200],TBT:[200,600],NTBT:[200,600]},x=function(e,t){return B[e]?t<=B[e][0]?"good":t<=B[e][1]?"needsImprovement":"poor":null},M=function(e,t,n){Object.keys(t).forEach((function(e){"number"==typeof t[e]&&(t[e]=w(t[e]))})),C(e,t,null,n||{})},F=function(e){var t=e.attribution,n=e.name,r=e.rating,i=e.value;"FCP"===n&&(T.value=i),["FCP","LCP"].includes(n)&&E("longtask",L),"FID"===n&&setTimeout((function(){F({attribution:t,name:"TBT",rating:x("TBT",h.value),value:h.value}),M("dataConsumption",g.value)}),1e4);var o=w(i);o<=a.maxTime&&o>=0&&C(n,o,r,t)},D=function(){return window.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0]},I=function(e){if("loading"===document.readyState)return"loading";var t=D();if(t){if(e<t.domInteractive)return"loading";if(0===t.domContentLoadedEventStart||e<t.domContentLoadedEventStart)return"dom-interactive";if(0===t.domComplete||e<t.domComplete)return"dom-content-loaded"}return"complete"},P=function(e){var t=e.nodeName;return 1===e.nodeType?t.toLowerCase():t.toUpperCase().replace(/^#/,"")},q=function(e,t){var n="";try{for(;e&&9!==e.nodeType;){var r=e,i=r.id?"#"+r.id:P(r)+(r.className&&r.className.length?"."+r.className.replace(/\s+/g,"."):"");if(n.length+i.length>(t||100)-1)return n||i;if(n=n?i+">"+n:i,r.id)break;e=r.parentNode}}catch(e){}return n},A=-1,R=function(){return A},N=function(e){addEventListener("pageshow",(function(t){t.persisted&&(A=t.timeStamp,e(t))}),!0)},_=function(){var e=D();return e&&e.activationStart||0},O=function(e,t){var n=D(),r="navigate";return R()>=0?r="back-forward-cache":n&&(r=document.prerendering||_()>0?"prerender":n.type.replace(/_/g,"-")),{name:e,value:void 0===t?-1:t,rating:"good",delta:0,entries:[],id:"v3-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:r}},j=function(e,t,n){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var r=new PerformanceObserver((function(e){t(e.getEntries())}));return r.observe(Object.assign({type:e,buffered:!0},n||{})),r}}catch(e){}},z=function(e,t){var n=function n(r){"pagehide"!==r.type&&"hidden"!==document.visibilityState||(e(r),t&&(removeEventListener("visibilitychange",n,!0),removeEventListener("pagehide",n,!0)))};addEventListener("visibilitychange",n,!0),addEventListener("pagehide",n,!0)},W=function(e,t,n,r){var i,a;return function(o){t.value>=0&&(o||r)&&((a=t.value-(i||0))||void 0===i)&&(i=t.value,t.delta=a,t.rating=function(e,t){return e>t[1]?"poor":e>t[0]?"needs-improvement":"good"}(t.value,n),e(t))}},H=-1,U=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},V=function(){z((function(e){var t=e.timeStamp;H=t}),!0)},G=function(){return H<0&&(H=U(),V(),N((function(){setTimeout((function(){H=U(),V()}),0)}))),{get firstHiddenTime(){return H}}},J=function(e,t){t=t||{};var n,r=[1800,3e3],i=G(),a=O("FCP"),o=function(e){e.forEach((function(e){"first-contentful-paint"===e.name&&(c&&c.disconnect(),e.startTime<i.firstHiddenTime&&(a.value=Math.max(e.startTime-_(),0),a.entries.push(e),n(!0)))}))},u=window.performance&&window.performance.getEntriesByName&&window.performance.getEntriesByName("first-contentful-paint")[0],c=u?null:j("paint",o);(u||c)&&(n=W(e,a,r,t.reportAllChanges),u&&o([u]),N((function(i){a=O("FCP"),n=W(e,a,r,t.reportAllChanges),requestAnimationFrame((function(){requestAnimationFrame((function(){a.value=performance.now()-i.timeStamp,n(!0)}))}))})))},K=!1,Q=-1,X={passive:!0,capture:!0},Y=new Date,Z=function(r,i){e||(e=i,t=r,n=new Date,te(removeEventListener),$())},$=function(){if(t>=0&&t<n-Y){var i={entryType:"first-input",name:e.type,target:e.target,cancelable:e.cancelable,startTime:e.timeStamp,processingStart:e.timeStamp+t};r.forEach((function(e){e(i)})),r=[]}},ee=function(e){if(e.cancelable){var t=(e.timeStamp>1e12?new Date:performance.now())-e.timeStamp;"pointerdown"==e.type?function(e,t){var n=function(){Z(e,t),i()},r=function(){i()},i=function(){removeEventListener("pointerup",n,X),removeEventListener("pointercancel",r,X)};addEventListener("pointerup",n,X),addEventListener("pointercancel",r,X)}(t,e):Z(t,e)}},te=function(e){["mousedown","keydown","touchstart","pointerdown"].forEach((function(t){return e(t,ee,X)}))},ne=function(n,i){i=i||{};var a,o=[100,300],u=G(),c=O("FID"),s=function(e){e.startTime<u.firstHiddenTime&&(c.value=e.processingStart-e.startTime,c.entries.push(e),a(!0))},f=function(e){e.forEach(s)},l=j("first-input",f);a=W(n,c,o,i.reportAllChanges),l&&z((function(){f(l.takeRecords()),l.disconnect()}),!0),l&&N((function(){var u;c=O("FID"),a=W(n,c,o,i.reportAllChanges),r=[],t=-1,e=null,te(addEventListener),u=s,r.push(u),$()}))},re=0,ie=1/0,ae=0,oe=function(e){e.forEach((function(e){e.interactionId&&(ie=Math.min(ie,e.interactionId),ae=Math.max(ae,e.interactionId),re=ae?(ae-ie)/7+1:0)}))},ue=function(){return i?re:performance.interactionCount||0},ce=function(){"interactionCount"in performance||i||(i=j("event",oe,{type:"event",buffered:!0,durationThreshold:0}))},se=0,fe=function(){return ue()-se},le=[],de={},me=function(e){var t=le[le.length-1],n=de[e.interactionId];if(n||le.length<10||e.duration>t.latency){if(n)n.entries.push(e),n.latency=Math.max(n.latency,e.duration);else{var r={id:e.interactionId,latency:e.duration,entries:[e]};de[r.id]=r,le.push(r)}le.sort((function(e,t){return t.latency-e.latency})),le.splice(10).forEach((function(e){delete de[e.id]}))}},ve=function(e,t){!function(e,t){t=t||{};var n=[200,500];ce();var r,i=O("INP"),a=function(e){e.forEach((function(e){e.interactionId&&me(e),"first-input"===e.entryType&&!le.some((function(t){return t.entries.some((function(t){return e.duration===t.duration&&e.startTime===t.startTime}))}))&&me(e)}));var t,n=(t=Math.min(le.length-1,Math.floor(fe()/50)),le[t]);n&&n.latency!==i.value&&(i.value=n.latency,i.entries=n.entries,r())},o=j("event",a,{durationThreshold:t.durationThreshold||40});r=W(e,i,n,t.reportAllChanges),o&&(o.observe({type:"first-input",buffered:!0}),z((function(){a(o.takeRecords()),i.value<0&&fe()>0&&(i.value=0,i.entries=[]),r(!0)})),N((function(){le=[],se=ue(),i=O("INP"),r=W(e,i,n,t.reportAllChanges)})))}((function(t){!function(e){if(e.entries.length){var t=e.entries.sort((function(e,t){return t.duration-e.duration||t.processingEnd-t.processingStart-(e.processingEnd-e.processingStart)}))[0];e.attribution={eventTarget:q(t.target),eventType:t.name,eventTime:t.startTime,eventEntry:t,loadState:I(t.startTime)}}else e.attribution={}}(t),e(t)}),t)},pe={},Te=function e(t){document.prerendering?addEventListener("prerenderingchange",(function(){return e(t)}),!0):"complete"!==document.readyState?addEventListener("load",(function(){return e(t)}),!0):setTimeout(t,0)},ge=function(e,t){t=t||{};var n=[800,1800],r=O("TTFB"),i=W(e,r,n,t.reportAllChanges);Te((function(){var a=D();if(a){if(r.value=Math.max(a.responseStart-_(),0),r.value<0||r.value>performance.now())return;r.entries=[a],i(!0),N((function(){r=O("TTFB",0),(i=W(e,r,n,t.reportAllChanges))(!0)}))}}))},he=function(e){e.forEach((function(e){e.identifier&&F({attribution:{identifier:e.identifier},name:"ET",rating:null,value:e.startTime})}))},ye=function(e){e.forEach((function(e){if(a.isResourceTiming&&M("resourceTiming",e),e.decodedBodySize&&e.initiatorType){var t=e.decodedBodySize/1e3;g.value[e.initiatorType]+=t,g.value.total+=t}}))},Ee=function(){!function(e,t){ge((function(t){!function(e){if(e.entries.length){var t=e.entries[0],n=t.activationStart||0,r=Math.max(t.domainLookupStart-n,0),i=Math.max(t.connectStart-n,0),a=Math.max(t.requestStart-n,0);e.attribution={waitingTime:r,dnsTime:i-r,connectionTime:a-i,requestTime:e.value-a,navigationEntry:t}}else e.attribution={waitingTime:0,dnsTime:0,connectionTime:0,requestTime:0}}(t),e(t)}),t)}((function(e){e.value=e.value-e.entries[0].requestStart,F(e)})),function(e,t){!function(e,t){t=t||{};var n=[.1,.25];K||(J((function(e){Q=e.value})),K=!0);var r,i=function(t){Q>-1&&e(t)},a=O("CLS",0),o=0,u=[],c=function(e){e.forEach((function(e){if(!e.hadRecentInput){var t=u[0],n=u[u.length-1];o&&e.startTime-n.startTime<1e3&&e.startTime-t.startTime<5e3?(o+=e.value,u.push(e)):(o=e.value,u=[e]),o>a.value&&(a.value=o,a.entries=u,r())}}))},s=j("layout-shift",c);s&&(r=W(i,a,n,t.reportAllChanges),z((function(){c(s.takeRecords()),r(!0)})),N((function(){o=0,Q=-1,a=O("CLS",0),r=W(i,a,n,t.reportAllChanges)})))}((function(t){!function(e){if(e.entries.length){var t=e.entries.reduce((function(e,t){return e&&e.value>t.value?e:t}));if(t&&t.sources&&t.sources.length){var n=(r=t.sources).find((function(e){return e.node&&1===e.node.nodeType}))||r[0];if(n)return void(e.attribution={largestShiftTarget:q(n.node),largestShiftTime:t.startTime,largestShiftValue:t.value,largestShiftSource:n,largestShiftEntry:t,loadState:I(t.startTime)})}}var r;e.attribution={}}(t),e(t)}),t)}((function(e){return F(e)})),function(e,t){J((function(t){!function(e){if(e.entries.length){var t=D(),n=e.entries[e.entries.length-1];if(t){var r=t.activationStart||0,i=Math.max(0,t.responseStart-r);return void(e.attribution={timeToFirstByte:i,firstByteToFCP:e.value-i,loadState:I(e.entries[0].startTime),navigationEntry:t,fcpEntry:n})}}e.attribution={timeToFirstByte:0,firstByteToFCP:e.value,loadState:I(R())}}(t),e(t)}),t)}((function(e){return F(e)})),function(e,t){ne((function(t){!function(e){var t=e.entries[0];e.attribution={eventTarget:q(t.target),eventType:t.name,eventTime:t.startTime,eventEntry:t,loadState:I(t.startTime)}}(t),e(t)}),t)}((function(e){return F(e)})),function(e,t){!function(e,t){t=t||{};var n,r=[2500,4e3],i=G(),a=O("LCP"),o=function(e){var t=e[e.length-1];if(t){var r=Math.max(t.startTime-_(),0);r<i.firstHiddenTime&&(a.value=r,a.entries=[t],n())}},u=j("largest-contentful-paint",o);if(u){n=W(e,a,r,t.reportAllChanges);var c=function(){pe[a.id]||(o(u.takeRecords()),u.disconnect(),pe[a.id]=!0,n(!0))};["keydown","click"].forEach((function(e){addEventListener(e,c,{once:!0,capture:!0})})),z(c,!0),N((function(i){a=O("LCP"),n=W(e,a,r,t.reportAllChanges),requestAnimationFrame((function(){requestAnimationFrame((function(){a.value=performance.now()-i.timeStamp,pe[a.id]=!0,n(!0)}))}))}))}}((function(t){!function(e){if(e.entries.length){var t=D();if(t){var n=t.activationStart||0,r=e.entries[e.entries.length-1],i=r.url&&performance.getEntriesByType("resource").filter((function(e){return e.name===r.url}))[0],a=Math.max(0,t.responseStart-n),o=Math.max(a,i?(i.requestStart||i.startTime)-n:0),u=Math.max(o,i?i.responseEnd-n:0),c=Math.max(u,r?r.startTime-n:0),s={element:q(r.element),timeToFirstByte:a,resourceLoadDelay:o-a,resourceLoadTime:u-o,elementRenderDelay:c-u,navigationEntry:t,lcpEntry:r};return r.url&&(s.url=r.url),i&&(s.lcpResourceEntry=i),void(e.attribution=s)}}e.attribution={timeToFirstByte:0,resourceLoadDelay:0,resourceLoadTime:0,elementRenderDelay:e.value}}(t),e(t)}),t)}((function(e){return F(e)})),ve((function(e){return F(e)})),a.isResourceTiming&&E("resource",ye),a.isElementTiming&&E("element",he)},Se=function(e){var t="usageDetails"in e?e.usageDetails:{};M("storageEstimate",{quota:k(e.quota),usage:k(e.usage),caches:k(t.caches),indexedDB:k(t.indexedDB),serviceWorker:k(t.serviceWorkerRegistrations)})},be=0,we=function(){function e(e){if(void 0===e&&(e={}),this.v="8.0.0",a.analyticsTracker=e.analyticsTracker,a.isResourceTiming=!!e.resourceTiming,a.isElementTiming=!!e.elementTiming,a.maxTime=e.maxMeasureTime||a.maxTime,d()){"PerformanceObserver"in o&&Ee();var t=function(){if(!d())return{};var e=s.getEntriesByType("navigation")[0];if(!e)return{};var t=e.responseStart,n=e.responseEnd;return{fetchTime:n-e.fetchStart,workerTime:e.workerStart>0?n-e.workerStart:0,totalTime:n-e.requestStart,downloadTime:n-t,timeToFirstByte:t-e.requestStart,headerSize:e.transferSize-e.encodedBodySize||0,dnsLookupTime:e.domainLookupEnd-e.domainLookupStart,redirectTime:e.redirectEnd-e.redirectStart}}();M("navigationTiming",t),t.redirectTime&&F({attribution:{},name:"RT",rating:x("RT",t.redirectTime),value:t.redirectTime}),M("networkInformation",function(){if("connection"in c){var e=c.connection;return"object"!=typeof e?{}:(m=e.effectiveType,v=!!e.saveData,{downlink:e.downlink,effectiveType:e.effectiveType,rtt:e.rtt,saveData:!!e.saveData})}return{}}()),c&&c.storage&&"function"==typeof c.storage.estimate&&c.storage.estimate().then(Se)}}return e.prototype.start=function(e){d()&&!p[e]&&(p[e]=!0,s.mark("mark_".concat(e,"_start")))},e.prototype.end=function(e,t,n){if(void 0===t&&(t={}),void 0===n&&(n=!0),d()&&p[e]){s.mark("mark_".concat(e,"_end")),delete p[e];var r=function(e){s.measure(e,"mark_".concat(e,"_start"),"mark_".concat(e,"_end"));var t=s.getEntriesByName(e).pop();return t&&"measure"===t.entryType?t.duration:-1}(e);n&&M(e,w(r),t)}},e.prototype.endPaint=function(e,t){var n=this;setTimeout((function(){n.end(e,t)}))},e.prototype.clear=function(e){delete p[e],s.clearMarks&&(s.clearMarks("mark_".concat(e,"_start")),s.clearMarks("mark_".concat(e,"_end")))},e.prototype.markNTBT=function(){var e=this;this.start("ntbt"),y.value=0,clearTimeout(be),be=setTimeout((function(){e.end("ntbt",{},!1),F({attribution:{},name:"NTBT",rating:x("NTBT",y.value),value:y.value}),y.value=0}),2e3)},e}();return we}));
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).Perfume=t()}(this,(function(){"use strict";var e,t,n,r,i,a={isResourceTiming:!1,isElementTiming:!1,maxTime:3e4},o=window,u=o.console,c=o.navigator,s=o.performance,f=function(){return c.deviceMemory},d=function(){return c.hardwareConcurrency},l=function(){return s&&!!s.getEntriesByType&&!!s.now&&!!s.mark},m="4g",v=!1,p={},T={value:0},g={value:{beacon:0,css:0,fetch:0,img:0,other:0,script:0,total:0,xmlhttprequest:0}},h={value:0},y={value:0},E=function(e,t){try{var n=new PerformanceObserver((function(e){t(e.getEntries())}));return n.observe({type:e,buffered:!0}),n}catch(e){u.warn("Perfume.js:",e)}return null},S=function(){return!!(d()&&d()<=4)||!!(f()&&f()<=4)},b=function(e,t){switch(e){case"slow-2g":case"2g":case"3g":return!0;default:return S()||t}},w={isHidden:!1},k=function(e){document.hidden&&(e(),w.isHidden=document.hidden)},C=function(e){return parseFloat(e.toFixed(4))},L=function(e){return"number"!=typeof e?null:C(e/Math.pow(1024,2))},B=function(e,t,n,r){var i;i=function(){!w.isHidden&&a.analyticsTracker&&a.analyticsTracker({attribution:r,metricName:e,data:t,navigatorInformation:c?{deviceMemory:f()||0,hardwareConcurrency:d()||0,serviceWorkerStatus:"serviceWorker"in c?c.serviceWorker.controller?"controlled":"supported":"unsupported",isLowEndDevice:S(),isLowEndExperience:b(m,v)}:{},rating:n})},"requestIdleCallback"in o?o.requestIdleCallback(i,{timeout:3e3}):i()},x=function(e){e.forEach((function(e){if(!("self"!==e.name||e.startTime<T.value)){var t=e.duration-50;t>0&&(h.value+=t,y.value+=t)}}))},M={RT:[100,200],TBT:[200,600],NTBT:[200,600]},F=function(e,t){return M[e]?t<=M[e][0]?"good":t<=M[e][1]?"needsImprovement":"poor":null},D=function(e,t,n){Object.keys(t).forEach((function(e){"number"==typeof t[e]&&(t[e]=C(t[e]))})),B(e,t,null,n||{})},I=function(e){var t=e.attribution,n=e.name,r=e.rating,i=e.value;"FCP"===n&&(T.value=i),["FCP","LCP"].includes(n)&&E("longtask",x),"FID"===n&&setTimeout((function(){I({attribution:t,name:"TBT",rating:F("TBT",h.value),value:h.value}),D("dataConsumption",g.value)}),1e4);var o=C(i);o<=a.maxTime&&o>=0&&B(n,o,r,t)},P=function(){return window.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0]},q=function(e){if("loading"===document.readyState)return"loading";var t=P();if(t){if(e<t.domInteractive)return"loading";if(0===t.domContentLoadedEventStart||e<t.domContentLoadedEventStart)return"dom-interactive";if(0===t.domComplete||e<t.domComplete)return"dom-content-loaded"}return"complete"},A=function(e){var t=e.nodeName;return 1===e.nodeType?t.toLowerCase():t.toUpperCase().replace(/^#/,"")},R=function(e,t){var n="";try{for(;e&&9!==e.nodeType;){var r=e,i=r.id?"#"+r.id:A(r)+(r.className&&r.className.length?"."+r.className.replace(/\s+/g,"."):"");if(n.length+i.length>(t||100)-1)return n||i;if(n=n?i+">"+n:i,r.id)break;e=r.parentNode}}catch(e){}return n},N=-1,_=function(){return N},H=function(e){addEventListener("pageshow",(function(t){t.persisted&&(N=t.timeStamp,e(t))}),!0)},O=function(){var e=P();return e&&e.activationStart||0},j=function(e,t){var n=P(),r="navigate";return _()>=0?r="back-forward-cache":n&&(r=document.prerendering||O()>0?"prerender":n.type.replace(/_/g,"-")),{name:e,value:void 0===t?-1:t,rating:"good",delta:0,entries:[],id:"v3-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:r}},z=function(e,t,n){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var r=new PerformanceObserver((function(e){t(e.getEntries())}));return r.observe(Object.assign({type:e,buffered:!0},n||{})),r}}catch(e){}},W=function(e,t){var n=function n(r){"pagehide"!==r.type&&"hidden"!==document.visibilityState||(e(r),t&&(removeEventListener("visibilitychange",n,!0),removeEventListener("pagehide",n,!0)))};addEventListener("visibilitychange",n,!0),addEventListener("pagehide",n,!0)},U=function(e,t,n,r){var i,a;return function(o){t.value>=0&&(o||r)&&((a=t.value-(i||0))||void 0===i)&&(i=t.value,t.delta=a,t.rating=function(e,t){return e>t[1]?"poor":e>t[0]?"needs-improvement":"good"}(t.value,n),e(t))}},V=-1,G=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},J=function(){W((function(e){var t=e.timeStamp;V=t}),!0)},K=function(){return V<0&&(V=G(),J(),H((function(){setTimeout((function(){V=G(),J()}),0)}))),{get firstHiddenTime(){return V}}},Q=function(e,t){t=t||{};var n,r=[1800,3e3],i=K(),a=j("FCP"),o=function(e){e.forEach((function(e){"first-contentful-paint"===e.name&&(c&&c.disconnect(),e.startTime<i.firstHiddenTime&&(a.value=Math.max(e.startTime-O(),0),a.entries.push(e),n(!0)))}))},u=window.performance&&window.performance.getEntriesByName&&window.performance.getEntriesByName("first-contentful-paint")[0],c=u?null:z("paint",o);(u||c)&&(n=U(e,a,r,t.reportAllChanges),u&&o([u]),H((function(i){a=j("FCP"),n=U(e,a,r,t.reportAllChanges),requestAnimationFrame((function(){requestAnimationFrame((function(){a.value=performance.now()-i.timeStamp,n(!0)}))}))})))},X=!1,Y=-1,Z={passive:!0,capture:!0},$=new Date,ee=function(r,i){e||(e=i,t=r,n=new Date,re(removeEventListener),te())},te=function(){if(t>=0&&t<n-$){var i={entryType:"first-input",name:e.type,target:e.target,cancelable:e.cancelable,startTime:e.timeStamp,processingStart:e.timeStamp+t};r.forEach((function(e){e(i)})),r=[]}},ne=function(e){if(e.cancelable){var t=(e.timeStamp>1e12?new Date:performance.now())-e.timeStamp;"pointerdown"==e.type?function(e,t){var n=function(){ee(e,t),i()},r=function(){i()},i=function(){removeEventListener("pointerup",n,Z),removeEventListener("pointercancel",r,Z)};addEventListener("pointerup",n,Z),addEventListener("pointercancel",r,Z)}(t,e):ee(t,e)}},re=function(e){["mousedown","keydown","touchstart","pointerdown"].forEach((function(t){return e(t,ne,Z)}))},ie=function(n,i){i=i||{};var a,o=[100,300],u=K(),c=j("FID"),s=function(e){e.startTime<u.firstHiddenTime&&(c.value=e.processingStart-e.startTime,c.entries.push(e),a(!0))},f=function(e){e.forEach(s)},d=z("first-input",f);a=U(n,c,o,i.reportAllChanges),d&&W((function(){f(d.takeRecords()),d.disconnect()}),!0),d&&H((function(){var u;c=j("FID"),a=U(n,c,o,i.reportAllChanges),r=[],t=-1,e=null,re(addEventListener),u=s,r.push(u),te()}))},ae=0,oe=1/0,ue=0,ce=function(e){e.forEach((function(e){e.interactionId&&(oe=Math.min(oe,e.interactionId),ue=Math.max(ue,e.interactionId),ae=ue?(ue-oe)/7+1:0)}))},se=function(){return i?ae:performance.interactionCount||0},fe=function(){"interactionCount"in performance||i||(i=z("event",ce,{type:"event",buffered:!0,durationThreshold:0}))},de=0,le=function(){return se()-de},me=[],ve={},pe=function(e){var t=me[me.length-1],n=ve[e.interactionId];if(n||me.length<10||e.duration>t.latency){if(n)n.entries.push(e),n.latency=Math.max(n.latency,e.duration);else{var r={id:e.interactionId,latency:e.duration,entries:[e]};ve[r.id]=r,me.push(r)}me.sort((function(e,t){return t.latency-e.latency})),me.splice(10).forEach((function(e){delete ve[e.id]}))}},Te=function(e,t){!function(e,t){t=t||{};var n=[200,500];fe();var r,i=j("INP"),a=function(e){e.forEach((function(e){e.interactionId&&pe(e),"first-input"===e.entryType&&!me.some((function(t){return t.entries.some((function(t){return e.duration===t.duration&&e.startTime===t.startTime}))}))&&pe(e)}));var t,n=(t=Math.min(me.length-1,Math.floor(le()/50)),me[t]);n&&n.latency!==i.value&&(i.value=n.latency,i.entries=n.entries,r())},o=z("event",a,{durationThreshold:t.durationThreshold||40});r=U(e,i,n,t.reportAllChanges),o&&(o.observe({type:"first-input",buffered:!0}),W((function(){a(o.takeRecords()),i.value<0&&le()>0&&(i.value=0,i.entries=[]),r(!0)})),H((function(){me=[],de=se(),i=j("INP"),r=U(e,i,n,t.reportAllChanges)})))}((function(t){!function(e){if(e.entries.length){var t=e.entries.sort((function(e,t){return t.duration-e.duration||t.processingEnd-t.processingStart-(e.processingEnd-e.processingStart)}))[0];e.attribution={eventTarget:R(t.target),eventType:t.name,eventTime:t.startTime,eventEntry:t,loadState:q(t.startTime)}}else e.attribution={}}(t),e(t)}),t)},ge={},he=function e(t){document.prerendering?addEventListener("prerenderingchange",(function(){return e(t)}),!0):"complete"!==document.readyState?addEventListener("load",(function(){return e(t)}),!0):setTimeout(t,0)},ye=function(e,t){t=t||{};var n=[800,1800],r=j("TTFB"),i=U(e,r,n,t.reportAllChanges);he((function(){var a=P();if(a){if(r.value=Math.max(a.responseStart-O(),0),r.value<0||r.value>performance.now())return;r.entries=[a],i(!0),H((function(){r=j("TTFB",0),(i=U(e,r,n,t.reportAllChanges))(!0)}))}}))},Ee=function(e){e.forEach((function(e){e.identifier&&I({attribution:{identifier:e.identifier},name:"ET",rating:null,value:e.startTime})}))},Se=function(e){e.forEach((function(e){if(a.isResourceTiming&&D("resourceTiming",e),e.decodedBodySize&&e.initiatorType){var t=e.decodedBodySize/1e3;g.value[e.initiatorType]+=t,g.value.total+=t}}))},be=function(){!function(e,t){ye((function(t){!function(e){if(e.entries.length){var t=e.entries[0],n=t.activationStart||0,r=Math.max(t.domainLookupStart-n,0),i=Math.max(t.connectStart-n,0),a=Math.max(t.requestStart-n,0);e.attribution={waitingTime:r,dnsTime:i-r,connectionTime:a-i,requestTime:e.value-a,navigationEntry:t}}else e.attribution={waitingTime:0,dnsTime:0,connectionTime:0,requestTime:0}}(t),e(t)}),t)}((function(e){e.value=e.value-e.entries[0].requestStart,I(e)})),function(e,t){!function(e,t){t=t||{};var n=[.1,.25];X||(Q((function(e){Y=e.value})),X=!0);var r,i=function(t){Y>-1&&e(t)},a=j("CLS",0),o=0,u=[],c=function(e){e.forEach((function(e){if(!e.hadRecentInput){var t=u[0],n=u[u.length-1];o&&e.startTime-n.startTime<1e3&&e.startTime-t.startTime<5e3?(o+=e.value,u.push(e)):(o=e.value,u=[e]),o>a.value&&(a.value=o,a.entries=u,r())}}))},s=z("layout-shift",c);s&&(r=U(i,a,n,t.reportAllChanges),W((function(){c(s.takeRecords()),r(!0)})),H((function(){o=0,Y=-1,a=j("CLS",0),r=U(i,a,n,t.reportAllChanges)})))}((function(t){!function(e){if(e.entries.length){var t=e.entries.reduce((function(e,t){return e&&e.value>t.value?e:t}));if(t&&t.sources&&t.sources.length){var n=(r=t.sources).find((function(e){return e.node&&1===e.node.nodeType}))||r[0];if(n)return void(e.attribution={largestShiftTarget:R(n.node),largestShiftTime:t.startTime,largestShiftValue:t.value,largestShiftSource:n,largestShiftEntry:t,loadState:q(t.startTime)})}}var r;e.attribution={}}(t),e(t)}),t)}((function(e){return I(e)})),function(e,t){Q((function(t){!function(e){if(e.entries.length){var t=P(),n=e.entries[e.entries.length-1];if(t){var r=t.activationStart||0,i=Math.max(0,t.responseStart-r);return void(e.attribution={timeToFirstByte:i,firstByteToFCP:e.value-i,loadState:q(e.entries[0].startTime),navigationEntry:t,fcpEntry:n})}}e.attribution={timeToFirstByte:0,firstByteToFCP:e.value,loadState:q(_())}}(t),e(t)}),t)}((function(e){return I(e)})),function(e,t){ie((function(t){!function(e){var t=e.entries[0];e.attribution={eventTarget:R(t.target),eventType:t.name,eventTime:t.startTime,eventEntry:t,loadState:q(t.startTime)}}(t),e(t)}),t)}((function(e){return I(e)})),function(e,t){!function(e,t){t=t||{};var n,r=[2500,4e3],i=K(),a=j("LCP"),o=function(e){var t=e[e.length-1];if(t){var r=Math.max(t.startTime-O(),0);r<i.firstHiddenTime&&(a.value=r,a.entries=[t],n())}},u=z("largest-contentful-paint",o);if(u){n=U(e,a,r,t.reportAllChanges);var c=function(){ge[a.id]||(o(u.takeRecords()),u.disconnect(),ge[a.id]=!0,n(!0))};["keydown","click"].forEach((function(e){addEventListener(e,c,{once:!0,capture:!0})})),W(c,!0),H((function(i){a=j("LCP"),n=U(e,a,r,t.reportAllChanges),requestAnimationFrame((function(){requestAnimationFrame((function(){a.value=performance.now()-i.timeStamp,ge[a.id]=!0,n(!0)}))}))}))}}((function(t){!function(e){if(e.entries.length){var t=P();if(t){var n=t.activationStart||0,r=e.entries[e.entries.length-1],i=r.url&&performance.getEntriesByType("resource").filter((function(e){return e.name===r.url}))[0],a=Math.max(0,t.responseStart-n),o=Math.max(a,i?(i.requestStart||i.startTime)-n:0),u=Math.max(o,i?i.responseEnd-n:0),c=Math.max(u,r?r.startTime-n:0),s={element:R(r.element),timeToFirstByte:a,resourceLoadDelay:o-a,resourceLoadTime:u-o,elementRenderDelay:c-u,navigationEntry:t,lcpEntry:r};return r.url&&(s.url=r.url),i&&(s.lcpResourceEntry=i),void(e.attribution=s)}}e.attribution={timeToFirstByte:0,resourceLoadDelay:0,resourceLoadTime:0,elementRenderDelay:e.value}}(t),e(t)}),t)}((function(e){return I(e)})),Te((function(e){return I(e)})),a.isResourceTiming&&E("resource",Se),a.isElementTiming&&E("element",Ee)},we=function(e){var t="usageDetails"in e?e.usageDetails:{};D("storageEstimate",{quota:L(e.quota),usage:L(e.usage),caches:L(t.caches),indexedDB:L(t.indexedDB),serviceWorker:L(t.serviceWorkerRegistrations)})},ke=0,Ce=function(){function e(e){if(void 0===e&&(e={}),this.v="8.1.0",a.analyticsTracker=e.analyticsTracker,a.isResourceTiming=!!e.resourceTiming,a.isElementTiming=!!e.elementTiming,a.maxTime=e.maxMeasureTime||a.maxTime,l()){"PerformanceObserver"in o&&be(),void 0!==document.hidden&&document.addEventListener("visibilitychange",(function(){return k}));var t=function(){if(!l())return{};var e=s.getEntriesByType("navigation")[0];if(!e)return{};var t=e.responseStart,n=e.responseEnd;return{fetchTime:n-e.fetchStart,workerTime:e.workerStart>0?n-e.workerStart:0,totalTime:n-e.requestStart,downloadTime:n-t,timeToFirstByte:t-e.requestStart,headerSize:e.transferSize-e.encodedBodySize||0,dnsLookupTime:e.domainLookupEnd-e.domainLookupStart,redirectTime:e.redirectEnd-e.redirectStart}}();D("navigationTiming",t),t.redirectTime&&I({attribution:{},name:"RT",rating:F("RT",t.redirectTime),value:t.redirectTime}),D("networkInformation",function(){if("connection"in c){var e=c.connection;return"object"!=typeof e?{}:(m=e.effectiveType,v=!!e.saveData,{downlink:e.downlink,effectiveType:e.effectiveType,rtt:e.rtt,saveData:!!e.saveData})}return{}}()),c&&c.storage&&"function"==typeof c.storage.estimate&&c.storage.estimate().then(we)}}return e.prototype.start=function(e){l()&&!p[e]&&(p[e]=!0,s.mark("mark_".concat(e,"_start")))},e.prototype.end=function(e,t,n){if(void 0===t&&(t={}),void 0===n&&(n=!0),l()&&p[e]){s.mark("mark_".concat(e,"_end")),delete p[e];var r=function(e){s.measure(e,"mark_".concat(e,"_start"),"mark_".concat(e,"_end"));var t=s.getEntriesByName(e).pop();return t&&"measure"===t.entryType?t.duration:-1}(e);n&&D(e,C(r),t)}},e.prototype.endPaint=function(e,t){var n=this;setTimeout((function(){n.end(e,t)}))},e.prototype.clear=function(e){delete p[e],s.clearMarks&&(s.clearMarks("mark_".concat(e,"_start")),s.clearMarks("mark_".concat(e,"_end")))},e.prototype.markNTBT=function(){var e=this;this.start("ntbt"),y.value=0,clearTimeout(ke),ke=setTimeout((function(){e.end("ntbt",{},!1),I({attribution:{},name:"NTBT",rating:F("NTBT",y.value),value:y.value}),y.value=0}),2e3)},e}();return Ce}));
//# sourceMappingURL=perfume.umd.min.js.map
{
"name": "perfume.js",
"version": "8.0.0",
"version": "8.1.0",
"description": "Web performance library for measuring all User-centric performance metrics, including the latest Web Vitals.",

@@ -5,0 +5,0 @@ "keywords": [

@@ -6,3 +6,3 @@ <a href="http://www.perfumejs.com/">

# [Perfume.js v8.0.0](http://perfumejs.com)
# [Perfume.js v8.1.0](http://perfumejs.com)

@@ -28,3 +28,3 @@ [![Current version](https://img.shields.io/github/tag/zizzamia/perfume.js?color=3498DB&label=version)](https://www.npmjs.org/package/perfume.js) [![Test Coverage](https://api.codeclimate.com/v1/badges/f813d2f45b274d93b8c5/test_coverage)](https://codeclimate.com/github/Zizzamia/perfume.js/test_coverage) <img alt="No dependencies" src="https://img.shields.io/badge/dependencies-none-27ae60.svg"> [![Build Status](https://travis-ci.org/Zizzamia/perfume.js.svg?branch=master)](https://travis-ci.org/Zizzamia/perfume.js) [![NPM Downloads](http://img.shields.io/npm/dm/perfume.js.svg)](https://www.npmjs.org/package/perfume.js) [![gzip size](https://img.badgesize.io/https://unpkg.com/perfume.js?compression=gzip&label=JS+gzip+size)](https://unpkg.com/perfume.js) [![brotli size](https://img.badgesize.io/https://unpkg.com/perfume.js?compression=brotli&label=JS+brotli+size)](https://unpkg.com/perfume.js)

- 🚿 Filters out false positive/negative results
- 🤙 Only 2.2Kb gzip
- 🤙 Only 5.1Kb gzip
- 🏅 Web Vitals Score

@@ -45,2 +45,3 @@ - 🛰 Flexible analytics tool

- StorageManager interface
- Time to First Byte ([TTFB](https://web.dev/ttfb/#what-is-a-good-ttfb-score))
- First Contentful Paint ([FCP](https://web.dev/first-contentful-paint/))

@@ -50,10 +51,11 @@ - Largest Contentful Paint ([LCP](https://web.dev/lcp/))

- Cumulative Layout Shift ([CLS](https://web.dev/cls/))
- Interaction to Next Paint ([INP](https://web.dev/inp/))
- Total Blocking Time ([TBT](https://web.dev/tbt/))
- Navigation Total Blocking Time (NTBT)
- [Web Vitals Score](https://web.dev/vitals/)
<br />
At Coinbase, we use [Perfume.js to capture a high-level scoring system](https://www.coinbase.com/blog/performance-vitals-a-unified-scoring-system-to-guide-performance-health-and-prioritization) that is clear, trusted, and easy to understand.
At <a href="https://www.coinbase.com/blog/performance-vitals-a-unified-scoring-system-to-guide-performance-health-and-prioritization">Coinbase</a>, we use Perfume.js to capture a high-level scoring system that is clear, trusted, and easy to understand.
<br />
<br />
Summarizing the performance health of an application into a reliable and consistent score helps increase urgency and directs company attention and resources towards addressing each performance opportunity.

@@ -93,3 +95,3 @@ <br />

Metrics like **Navigation Timing**, **Network Information**, **FP**, **FCP**, **FID**, **LCP**, **CLS** and **TBT** are default reported with Perfume; All results will be reported to the `analyticsTracker` callback, and the code below is just one way for you to organize your tracking, feel free to tweak it suit your needs.
Metrics like **Navigation Timing**, **Network Information**, **TTFB**, **FCP**, **FID**, **LCP**, **CLS**, **INP** and **TBT** are default reported with Perfume; All results will be reported to the `analyticsTracker` callback, and the code below is just one way for you to organize your tracking, feel free to tweak it suit your needs.

@@ -140,2 +142,5 @@ 🚀 Visit [perfumejs.com](http://perfumejs.com/) for a live demo on how the metrics work. 🌕

break;
case 'INP':
myAnalyticsTool.track('interactionToNextPaint', { value: data });
break;
case 'TBT':

@@ -355,10 +360,11 @@ myAnalyticsTool.track('totalBlockingTime', { duration: data });

| ----------------------------------------- | -----: | ----------------: | --------: |
| Time to First Byte (ttfb) | 0-200 | 201-500 | Over 500 |
| Fist Paint (fp) | 0-2000 | 2001-4000 | Over 4000 |
| First Contentful Paint (fcp) | 0-2000 | 2001-4000 | Over 4000 |
| Largest Contentful Paint (lcp) | 0-2500 | 2501-4000 | Over 4000 |
| First Input Delay (fid) | 0-100 | 101-300 | Over 300 |
| Cumulative Layout Shift (cls) | 0-0.1 | 0.11-0.25 | Over 0.25 |
| Total Blocking Time (tbt) | 0-200 | 201-600 | Over 600 |
| Navigation Total Blocking Time (tbt) | 0-200 | 201-600 | Over 600 |
| Time to First Byte (TTFB) | 0-800 | 801-1800 | Over 1800 |
| Redirect Time (RT) | 0-100 | 101-200 | Over 200 |
| First Contentful Paint (FCP) | 0-2000 | 2001-4000 | Over 4000 |
| Largest Contentful Paint (LCP) | 0-2500 | 2501-4000 | Over 4000 |
| First Input Delay (FID) | 0-100 | 101-300 | Over 300 |
| Cumulative Layout Shift (CLS) | 0-0.1 | 0.11-0.25 | Over 0.25 |
| Interaction to Next Paint (INP) | 0-200 | 201-500 | Over 500 |
| Total Blocking Time (TBT) | 0-200 | 201-600 | Over 600 |
| Navigation Total Blocking Time (NTBT) | 0-200 | 201-600 | Over 600 |

@@ -365,0 +371,0 @@ ## Perfume custom options

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc