PageSourceSearch

https://www.bricodepot.fr/_nuxt/profiler-HPdCAW-3.js

js bricodepot.fr collected 2026-10-03 19:09:27 UTC 5,584 bytes, 1 lines download raw bytes

1import{c as G,j as P,o as x,a as q,b as K,d as Y,e as X,R as D,f as C,g as J,S as Q,m as W,h as N,i as Z,k as $,s as ee,l as O,n as te,p as se,q as ne,r as re}from"./main-d-kGtrH3.js";import"./entry-BWUks8i_.js";import"./vendor-vue-De3KLw0c.js";import"./commerce-core-Bo0Nw9lS.js";import"./vendor-interop-BosuxZz1.js";function oe(e,t,r,o){const u=d=>{t.notify(14,{error:d}),q("Error reported to customer",{"error.message":d.message})},p=G([e.profilingEndpointBuilder],u),i=r(o);return{async send({event:d,...m}){const f=new FormData,v=P(d);if(!v)throw new Error("Failed to serialize event");f.append("event",new Blob([v],{type:"application/json"}),"event.json");let n=v.length;for(const[b,E]of x(m)){const h=P(E);if(!h)throw new Error("Failed to serialize attachment");const y=await ae(i,h);n+=y.outputBytesCount,f.append(b,new Blob([y.output]),b)}p.send({data:f,bytesCount:n})}}}function ae(e,t){return new Promise(r=>{e.write(t),e.finish(o=>{r(o)})})}function ie(e){let t=0;for(const r of e)r.stackId!==void 0&&t++;return t}const le=/\/(?![vV]\d{1,2}\/)([^/\d?]*\d+[^/?]*)/g;function ce(e){return e?e.replace(le,"/?"):"/"}const A=(e,t)=>e||ce(t);function ue(e,t,r){const{ids:o,names:u}=de(e.views),p=e.longTasks.map(d=>d.id).filter(d=>d!==void 0),i={application:{id:t}};return r&&(i.session={id:r}),o.length&&(i.view={id:o,name:u}),p.length&&(i.long_task={id:p}),i}function de(e){const t={ids:[],names:[]};for(const r of e)t.ids.push(r.viewId),r.viewName&&t.names.push(r.viewName);return t.names=Array.from(new Set(t.names)),t}function pe(e,t,r){return{event:fe(e,t,r),"wall-time.json":e}}function fe(e,t,r){const o=K(t),u=ue(e,t.applicationId,r),p=me(o);return{...u,attachments:["wall-time.json"],start:new Date(e.startClocks.timeStamp).toISOString(),end:new Date(e.endClocks.timeStamp).toISOString(),family:"chrome",runtime:"chrome",format:"json",version:4,tags_profiler:p.join(","),_dd:{clock_drift:Y()}}}function me(e){return e.concat(["language:javascript","runtime:chrome","family:chrome","host:browser"])}const ve=Q;function be(e){const t=X({expireDelay:ve});return e.subscribe(12,({rawRumEvent:r,startClocks:o,duration:u})=>{r.type==="long_task"&&t.add({id:r.long_task.id,startClocks:o,duration:u,entryType:r.long_task.entry_type===C.LONG_TASK?D.LONG_TASK:D.LONG_ANIMATION_FRAME},o.relative).close(J(o.relative,u))}),t}const he={sampleIntervalMs:10,collectIntervalMs:6e4,minProfileDurationMs:5e3,minNumberOfSamples:50};function ke(e,t,r,o,u,p,i=he){const d=oe(e,t,u,6);let m;const f=[],v=W(be)(t);let n={state:"stopped",stateReason:"initializing"};t.subscribe(9,()=>{h("session-expired")}),t.subscribe(10,()=>{n.state==="stopped"&&n.stateReason==="session-expired"&&b()});function b(){if(n.state==="running")return;const s=p.findView();m=s?{startClocks:s.startClocks,viewId:s.id,viewName:A(s.name,document.location.pathname)}:void 0,f.push(N(e,window,"visibilitychange",j).stop,N(e,window,"beforeunload",V).stop),w()}function E(){h("stopped-by-user")}function h(s){L(s),f.forEach(a=>a()),f.length=0,o.set({status:"stopped",error_reason:void 0})}function y(s){if(s.state==="running")return{cleanupTasks:s.cleanupTasks};const a=[],c=t.subscribe(2,l=>{const g={viewId:l.id,viewName:A(l.name,document.location.pathname),startClocks:l.startClocks};k(g),m=g});return a.push(c.unsubscribe),{cleanupTasks:a}}function w(){const s=Z().Profiler;if(!s)throw o.set({status:"error",error_reason:"not-supported-by-browser"}),new Error("RUM Profiler is not supported in this browser.");n.state==="running"&&T(n);const{cleanupTasks:a}=y(n);let c;try{c=new s({sampleInterval:i.sampleIntervalMs,maxBufferSize:Math.round(i.collectIntervalMs*1.5/i.sampleIntervalMs)})}catch(l){l instanceof Error&&l.message.includes("disabled by Document Policy")?($.warn("[DD_RUM] Profiler startup failed. Ensure your server includes the `Document-Policy: js-profiling` response header when serving HTML pages.",l),o.set({status:"error",error_reason:"missing-document-policy-header"})):o.set({status:"error",error_reason:"unexpected-exception"});return}o.set({status:"running",error_reason:void 0}),n={state:"running",startClocks:O(),profiler:c,timeoutId:ee(w,i.collectIntervalMs),views:[],cleanupTasks:a,longTasks:[]},k(m),c.addEventListener("samplebufferfull",I)}function T(s){te(s.timeoutId),s.profiler.removeEventListener("samplebufferfull",I);const{startClocks:a,views:c}=s;s.profiler.stop().then(l=>
1{const g=O(),_=se(a.timeStamp,g.timeStamp),S=v.findAll(a.relative,_),U=_<i.minProfileDurationMs,z=ie(l.samples)<i.minNumberOfSamples;S.length===0&&(U||z)||R(Object.assign(l,{startClocks:a,endClocks:g,clocksOrigin:ne(),longTasks:S,views:c,sampleInterval:i.sampleIntervalMs}))}).catch(re)}function L(s){if(n.state!=="running"){(n.state==="paused"||n.state==="stopped"&&s==="stopped-by-user")&&(n={state:"stopped",stateReason:s});return}const a=n;n={state:"stopped",stateReason:s},a.cleanupTasks.forEach(c=>c()),T(a)}function M(){if(n.state!=="running")return;const s=n;n={state:"paused"},s.cleanupTasks.forEach(a=>a()),T(s)}function k(s){n.state!=="running"||!s||n.views.push(s)}function R(s){var a;const c=(a=r.findTrackedSession())===null||a===void 0?void 0:a.id,l=pe(s,e,c);d.send(l)}function I(){w()}function j(){document.visibilityState==="hidden"&&n.state==="running"?M():document.visibilityState==="visible"&&n.state==="paused"&&w()}function V(){w()}function B(){return n.state==="stopped"}function F(){return n.state==="running"}function H(){return n.state==="paused"}return{start:b,stop:E,isStopped:B,isRunning:F,isPaused:H}}export{he as DEFAULT_RUM_PROFILER_CONFIGURATION,ke as createRumProfiler};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.