@speakeasy-api/docs-mcp-playground 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{index-n6vdNekm.js → index-Idv3uxDb.js} +2 -2
- package/dist/client/assets/{profiler-D6ndqfsd-Dhb01evK.js → profiler-D6ndqfsd-BFvhpC6v.js} +1 -1
- package/dist/client/assets/{startRecording-B_9CRZ_P-5fxd2OhI.js → startRecording-B_9CRZ_P-B2U8u87w.js} +1 -1
- package/dist/client/index.html +1 -1
- package/package.json +1 -1
|
@@ -471,7 +471,7 @@ ${d}`,m=>{n.notifyAfterAddMessage(m-f)})}function o(d){return d!==void 0&&r[d]!=
|
|
|
471
471
|
`);r={};const h=U$t(d.reason),m=h?t.sendOnExit:t.send;if(h&&e.isAsync){const v=e.finishSync();v.outputBytesCount&&m(hne(v));const y=[v.pendingData,f].filter(Boolean).join(`
|
|
472
472
|
`);y&&m({data:y,bytesCount:aSe(y)})}else f&&e.write(e.isEmpty?f:`
|
|
473
473
|
${f}`),e.finish(v=>{m(hne(v))})}return{flushController:n,add:l,upsert:l,stop:i.unsubscribe}}function hne(e){let t;return typeof e.output=="string"?t=e.output:t=new Blob([e.output],{type:"text/plain"}),{data:t,bytesCount:e.outputBytesCount,encoding:e.encoding}}const B$t=30*_i,V$t=K$?1:50;function kSe({pageMayExitObservable:e,sessionExpireObservable:t}){const n=e.subscribe(f=>s(f.reason)),r=t.subscribe(()=>s("session_expire")),i=new Gt(()=>()=>{n.unsubscribe(),r.unsubscribe()});let a=0,o=0;function s(f){if(o===0)return;const h=o,m=a;o=0,a=0,d(),i.notify({reason:f,messagesCount:h,bytesCount:m})}let l;function u(){l===void 0&&(l=yi(()=>{s("duration_limit")},B$t))}function d(){ho(l),l=void 0}return{flushObservable:i,get messagesCount(){return o},notifyBeforeAddMessage(f){a+f>=mL&&s("bytes_limit"),o+=1,a+=f,u()},notifyAfterAddMessage(f=0){a+=f,o>=V$t?s("messages_limit"):a>=mL&&s("bytes_limit")},notifyAfterRemoveMessage(f){a-=f,o-=1,o===0&&d()}}}const Dc="DISCARDED",Da="SKIPPED";function F$t(){const e={};return{register(t,n){return e[t]||(e[t]=[]),e[t].push(n),{unregister:()=>{e[t]=e[t].filter(r=>r!==n)}}},triggerHook(t,n){const r=e[t]||[],i=[];for(const a of r){const o=a(n);if(o===Dc)return Dc;o!==Da&&i.push(o)}return ru(...i)}}}const kc={LOG:"log",CONFIGURATION:"configuration",USAGE:"usage"},q$t=["https://www.datadoghq-browser-agent.com","https://www.datad0g-browser-agent.com","https://d3uc069fcn7uxw.cloudfront.net","https://d20xtzwzcl0ceb.cloudfront.net","http://localhost","<anonymous>"],Z$t=1,H$t=[kTt],G$t=15;let m2;function Kg(){return m2||(m2=new R_e(100)),m2}function K$t(e,t,n,r,i,a){const o=new Gt,{stop:s}=J$t(t,r,i,a,o),{enabled:l,metricsEnabled:u}=W$t(e,t,n,o);return{stop:s,enabled:l,metricsEnabled:u}}function W$t(e,t,n,r,i=Z$t,a=G$t){const o={},s=!H$t.includes(t.site)&&Xd(t.telemetrySampleRate),l={[kc.LOG]:s,[kc.CONFIGURATION]:s&&Xd(t.telemetryConfigurationSampleRate),[kc.USAGE]:s&&Xd(t.telemetryUsageSampleRate),metric:s&&Xd(i)},u=Y$t(),d=Kg();return d.subscribe(({rawEvent:h,metricName:m})=>{if(m&&!l.metric||!l[h.type])return;const v=m||h.status||h.type;let y=o[v];if(y||(y=o[v]=new Set),y.size>=a)return;const w=Kw(h);if(y.has(w))return;const x=n.triggerHook(1,{startTime:Hr().relative});if(x===Dc)return;const k=f(x,e,h,u);r.notify(k),fSe("telemetry",k),y.add(w)}),d.unbuffer(),$Et(yB),{enabled:s,metricsEnabled:l.metric};function f(h,m,v,y){const w={type:"telemetry",date:Hr().timeStamp,service:m,version:"6.24.1",source:"browser",_dd:{format_version:2},telemetry:ru(v,{runtime_env:y,connectivity:pSe(),sdk_setup:"npm"}),ddtags:dSe(t).join(","),experimental_features:Array.from(LTt())};return ru(w,h)}}function J$t(e,t,n,r,i){const a=[];if(og()){const o=Ww(),s=i.subscribe(l=>o.send("internal_telemetry",l));a.push(s.unsubscribe)}else{const o=[e.rumEndpointBuilder];e.replica&&X$t(e)&&o.push(e.replica.rumEndpointBuilder);const s=SSe({encoder:r(4),request:xSe(o,t),flushController:kSe({pageMayExitObservable:n,sessionExpireObservable:new Gt})});a.push(s.stop);const l=i.subscribe(s.add);a.push(l.unsubscribe)}return{stop:()=>a.forEach(o=>o())}}function Y$t(){var e;return{is_local_file:((e=Ws.location)===null||e===void 0?void 0:e.protocol)==="file:",is_worker:K$}}function X$t(e){return e.site===Q_e}function Jw(e,t){cL(H$.debug,e,t),Kg().notify({rawEvent:{type:kc.LOG,message:e,status:"debug",...t}})}function yB(e,t){Kg().notify({rawEvent:{type:kc.LOG,status:"error",...eOt(e),...t}})}function Q$t(e){Kg().notify({rawEvent:{type:kc.CONFIGURATION,configuration:e}})}function rO(e,t){Kg().notify({rawEvent:{type:kc.LOG,message:e,status:"debug",...t},metricName:e})}function Ur(e){Kg().notify({rawEvent:{type:kc.USAGE,usage:e}})}function eOt(e){if(np(e)){const t=Hw(e);return{error:{kind:t.name,stack:Gw(tOt(t))},message:t.message}}return{error:{stack:sSe},message:`Uncaught ${Kw(e)}`}}function tOt(e){return e.stack=e.stack.filter(t=>!t.url||q$t.some(n=>t.url.startsWith(n))),e}function ESe(e,t){const n=e.indexOf(t);n>=0&&e.splice(n,1)}function yf(e){return Array.isArray(e)&&e.length>0}const h_=1/0,nOt=Ji;let ov=null;const Z_=new Set;function rOt(){Z_.forEach(e=>e())}function Wg({expireDelay:e,maxEntries:t}){let n=[];ov||(ov=Zg(()=>rOt(),nOt));const r=()=>{const d=Ma()-e;for(;n.length>0&&n[n.length-1].endTime<d;)n.pop()};Z_.add(r);function i(d,f){const h={value:d,startTime:f,endTime:h_,remove:()=>{ESe(n,h)},close:m=>{h.endTime=m}};return t&&n.length>=t&&n.pop(),n.unshift(h),h}function a(d=h_,f={returnInactive:!1}){for(const h of n)if(h.startTime<=d){if(f.returnInactive||d<=h.endTime)return h.value;break}}function o(d){const f=n[0];f&&f.endTime===h_&&f.close(d)}function s(d=h_,f=0){const h=Hg(d,f);return n.filter(m=>m.startTime<=h&&d<=m.endTime).map(m=>m.value)}function l(){n=[]}function u(){Z_.delete(r),Z_.size===0&&ov&&(W$(ov),ov=null)}return{add:i,find:a,closeActive:o,findAll:s,reset:l,stop:u}}const iOt="datadog-synthetics-public-id",aOt="datadog-synthetics-result-id",oOt="datadog-synthetics-injects-rum";function TSe(){return K$?!1:!!(Ws._DATADOG_SYNTHETICS_INJECTS_RUM||fc(oOt))}function $Se(){const e=window._DATADOG_SYNTHETICS_PUBLIC_ID||fc(iOt);return typeof e=="string"?e:void 0}function OSe(){const e=window._DATADOG_SYNTHETICS_RESULT_ID||fc(aOt);return typeof e=="string"?e:void 0}function ASe(){return!!($Se()&&OSe())}const sOt=Ji,lOt=Qf;function uOt(e,t,n,r){const i=new Gt,a=new Gt,o=mTt(e.sessionStoreStrategyType,e,t,n),s=Wg({expireDelay:lOt});if(o.renewObservable.subscribe(()=>{s.add(l(),Ma()),i.notify()}),o.expireObservable.subscribe(()=>{a.notify(),s.closeActive(Ma())}),o.expandOrRenewSession(),s.add(l(),M_e().relative),Zw(Nc.SHORT_SESSION_INVESTIGATION)){const u=o.getSession();u&&hOt(e,u)}r.observable.subscribe(()=>{r.isGranted()?o.expandOrRenewSession():o.expire(!1)}),cOt(e,()=>{r.isGranted()&&o.expandOrRenewSession()}),dOt(e,()=>o.expandSession()),fOt(e,()=>o.restartSession());function l(){const u=o.getSession();return u?{id:u.id,trackingType:u[t],isReplayForced:!!u.forcedReplay,anonymousId:u.anonymousId}:(pOt(e).catch(()=>{}),{id:"invalid",trackingType:F_e,isReplayForced:!1,anonymousId:void 0})}return{findSession:(u,d)=>s.find(u,d),renewObservable:i,expireObservable:a,sessionStateUpdateObservable:o.sessionStateUpdateObservable,expire:o.expire,updateSessionState:o.updateSessionState}}function cOt(e,t){const{stop:n}=Mc(e,window,["click","touchstart","keydown","scroll"],t,{capture:!0,passive:!0})}function dOt(e,t){const n=()=>{document.visibilityState==="visible"&&t()},{stop:r}=Xn(e,document,"visibilitychange",n);Zg(n,sOt)}function fOt(e,t){const{stop:n}=Xn(e,window,"resume",t,{capture:!0})}async function pOt(e){const t=e.sessionStoreStrategyType;if(!t)return;let n,r;t.type===rg.COOKIE?(n=G_e(t.cookieOptions,e),r={cookie:await CSe(),currentDomain:`${window.location.protocol}//${window.location.hostname}`}):n=J_e(),Jw("Unexpected session state",{sessionStoreStrategyType:t.type,session:n,isSyntheticsTest:ASe(),createdTimestamp:n==null?void 0:n.created,expireTimestamp:n==null?void 0:n.expire,...r})}function hOt(e,t){if(!window.cookieStore||!t.created)return;const n=Number(t.created),r=Ki(),{stop:i}=Xn(e,cookieStore,"change",a);function a(o){const s=U_e(o.changed,u=>u.name===nu);if(!s)return;const l=Ki()-n;if(l>14*Ji)i();else{const u=tO(s.value);if(u.id&&u.id!==t.id){i();const d=Ki()-r;CSe().then(f=>{Jw("Session cookie changed",{time:d,session_age:l,old:t,new:u,cookie:f})}).catch(Pc)}}}}async function CSe(){let e;return"cookieStore"in window?e=await window.cookieStore.getAll(nu):e=document.cookie.split(/\s*;\s*/).filter(t=>t.startsWith(nu)),{count:e.length,domain:L_e()||"undefined",...e}}function mOt(){let e="",t=0;return{isAsync:!1,get isEmpty(){return!e},write(n,r){const i=aSe(n);t+=i,e+=n,r&&r(i)},finish(n){n(this.finishSync())},finishSync(){const n={output:e,outputBytesCount:t,rawBytesCount:t,pendingData:""};return e="",t=0,n},estimateEncodedBytesCount(n){return n.length}}}class gOt{constructor(){this.callbacks={}}notify(t,n){const r=this.callbacks[t];r&&r.forEach(i=>i(n))}subscribe(t,n){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(n),{unsubscribe:()=>{this.callbacks[t]=this.callbacks[t].filter(r=>n!==r)}}}}const yOt=3e3;function g2(e,t,n=yOt){let r=0,i=!1;return{isLimitReached(){if(r===0&&yi(()=>{r=0},Ji),r+=1,r<=n||i)return i=!1,!1;if(r===n+1){i=!0;try{t({message:`Reached max number of ${e}s by minute: ${n}`,source:Gg.AGENT,startClocks:Hr()})}finally{i=!1}}return!0}}}function vB(e,t,n){return document.readyState===t||document.readyState==="complete"?(n(),{stop:fn}):Xn(e,window,t==="complete"?"load":"DOMContentLoaded",n,{once:!0})}function vOt(e,t){return new Promise(n=>{vB(e,t,n)})}let y2;const bB=new WeakMap;function bOt(e){return y2||(y2=wOt(e)),y2}function wOt(e){return new Gt(t=>{const{stop:n}=Vs(XMLHttpRequest.prototype,"open",xOt),{stop:r}=Vs(XMLHttpRequest.prototype,"send",a=>{_Ot(a,e,t)},{computeHandlingStack:!0}),{stop:i}=Vs(XMLHttpRequest.prototype,"abort",SOt);return()=>{n(),r(),i()}})}function xOt({target:e,parameters:[t,n]}){bB.set(e,{state:"open",method:String(t).toUpperCase(),url:dB(String(n))})}function _Ot({target:e,parameters:[t],handlingStack:n},r,i){const a=bB.get(e);if(!a)return;const o=a;o.state="start",o.startClocks=Hr(),o.isAborted=!1,o.xhr=e,o.handlingStack=n,o.requestBody=t;let s=!1;const{stop:l}=Vs(e,"onreadystatechange",()=>{e.readyState===XMLHttpRequest.DONE&&u()}),u=()=>{if(d(),l(),s)return;s=!0;const f=a;f.state="complete",f.duration=fr(o.startClocks.timeStamp,ii()),f.status=e.status,typeof e.response=="string"&&(f.responseBody=e.response),i.notify(g0(f))},{stop:d}=Xn(r,e,"loadend",u);i.notify(o)}function SOt({target:e}){const t=bB.get(e);t&&(t.isAborted=!0)}async function kOt(e,t){const n=e.getReader(),r=[];for(;;){const i=await n.read();if(i.done)break;t.collectStreamBody&&r.push(i.value)}return n.cancel().catch(fn),t.collectStreamBody?oSe(r):void 0}let v2;const ISe=[];function jSe({responseBodyAction:e}={}){return e&&ISe.push(e),v2||(v2=EOt()),v2}function EOt(){return new Gt(e=>{if(!Ws.fetch)return;const{stop:t}=Vs(Ws,"fetch",n=>TOt(n,e),{computeHandlingStack:!0});return t})}function TOt({parameters:e,onPostCall:t,handlingStack:n},r){const[i,a]=e;let o=a&&a.method;o===void 0&&i instanceof Request&&(o=i.method);const s=o!==void 0?String(o).toUpperCase():"GET",l=i instanceof Request?i.url:dB(String(i)),u=Hr(),d={state:"start",init:a,input:i,method:s,startClocks:u,url:l,handlingStack:n};r.notify(d),e[0]=d.input,e[1]=d.init,t(f=>{$Ot(r,f,d).catch(Pc)})}async function $Ot(e,t,n){var r,i;const a=n;a.state="resolve";let o;try{o=await t}catch(l){a.status=0,a.isAborted=((i=(r=a.init)===null||r===void 0?void 0:r.signal)===null||i===void 0?void 0:i.aborted)||l instanceof DOMException&&l.code===DOMException.ABORT_ERR,a.error=l,e.notify(a);return}a.response=o,a.status=o.status,a.responseType=o.type,a.isAborted=!1;const s=ISe.reduce((l,u)=>Math.max(l,u(a)),0);if(s!==0){const l=$$t(o);if(l&&l.body)try{const u=await kOt(l.body,{collectStreamBody:s===2});a.responseBody=u&&new TextDecoder().decode(u)}catch{}}e.notify(a)}function OOt(e,t){if(window.requestIdleCallback&&window.cancelIdleCallback){const n=window.requestIdleCallback($t(e),t);return()=>window.cancelIdleCallback(n)}return COt(e)}const AOt=50;function COt(e){const t=Ki(),n=yi(()=>{e({didTimeout:!1,timeRemaining:()=>Math.max(0,AOt-(Ki()-t))})},0);return()=>ho(n)}const IOt=_i,jOt=30;function ROt(){const e=[];function t(r){let i;if(r.didTimeout){const a=performance.now();i=()=>jOt-(performance.now()-a)}else i=r.timeRemaining.bind(r);for(;i()>0&&e.length;)e.shift()();e.length&&n()}function n(){OOt(t,{timeout:IOt})}return{push(r){e.push(r)===1&&n()},stop(){e.length=0}}}let b2={};function POt(e){const t=e.map(n=>(b2[n]||(b2[n]=NOt(n)),b2[n]));return j_e(...t)}function NOt(e){return new Gt(t=>{const n=Nl[e];return Nl[e]=(...r)=>{n.apply(console,r);const i=fE("console error");Sc(()=>{t.notify(MOt(r,e,i))})},()=>{Nl[e]=n}})}function MOt(e,t,n){const r=e.map(i=>DOt(i)).join(" ");if(t===H$.error){const i=e.find(np),a=mB({originalError:i,handlingStack:n,startClocks:Hr(),source:Gg.CONSOLE,handling:"handled",nonErrorPrefix:"Provided",useFallbackStack:!1});return a.message=r,{api:t,message:r,handlingStack:n,error:a}}return{api:t,message:r,error:void 0,handlingStack:n}}function DOt(e){return typeof e=="string"?Un(e):np(e)?rSe(Hw(e)):Kw(Un(e),void 0,2)}const zOt=500;function LOt(){const e=[];return{add:t=>{e.push(t)>zOt&&e.splice(0,1)},remove:t=>{ESe(e,t)},drain:t=>{e.forEach(n=>n(t)),e.length=0}}}function UOt(e){const t=ep(e)==="object";return t||xt.error("Unsupported context:",e),t}function w2(e,t,n){const r={...e};for(const[i,{required:a,type:o}]of Object.entries(t))o==="string"&&!mne(r[i])&&(r[i]=String(r[i])),a&&mne(r[i])&&xt.warn(`The property ${i} of ${n} is required; context will not be sent to the intake.`);return r}function mne(e){return e==null||e===""}function iO(e="",{propertiesConfig:t={}}={}){let n={};const r=new Gt,i={getContext:()=>gB(n),setContext:a=>{UOt(a)?n=Un(w2(a,t,e)):i.clearContext(),r.notify()},setContextProperty:(a,o)=>{n=Un(w2({...n,[a]:o},t,e)),r.notify()},removeContextProperty:a=>{delete n[a],w2(n,t,e),r.notify()},clearContext:()=>{n={},r.notify()},changeObservable:r};return i}function $i(e,t,n,r){return $t((...i)=>(r&&Ur({feature:r}),e()[t][n](...i)))}const BOt="_dd_c",VOt=[];function wB(e,t,n,r){const i=FOt(n,r);VOt.push(Xn(e,window,"storage",({key:u})=>{i===u&&o()})),t.changeObservable.subscribe(s);const a=ru(l(),t.getContext());ed(a)||t.setContext(a);function o(){t.setContext(l())}function s(){localStorage.setItem(i,JSON.stringify(t.getContext()))}function l(){const u=localStorage.getItem(i);return u?JSON.parse(u):{}}}function FOt(e,t){return`${BOt}_${e}_${t}`}function qOt(e,t,n){const r=RSe();return t.storeContextsAcrossPages&&wB(t,r,n,4),e.register(0,()=>{const i=r.getContext();return ed(i)||!i.id?Da:{account:i}}),r}function RSe(){return iO("account",{propertiesConfig:{id:{type:"string",required:!0},name:{type:"string"}}})}function ZOt(e,t,n,r){const i=PSe();return t.storeContextsAcrossPages&&wB(t,i,n,2),e.register(0,()=>({context:i.getContext()})),i}function PSe(){return iO("global context")}function HOt(e,t,n,r){const i=NSe();return t.storeContextsAcrossPages&&wB(t,i,r,1),e.register(0,({eventType:a,startTime:o})=>{const s=i.getContext(),l=n.findTrackedSession(o);return l&&l.anonymousId&&!s.anonymous_id&&t.trackAnonymousUser&&(s.anonymous_id=l.anonymousId),ed(s)?Da:{type:a,usr:s}}),e.register(1,({startTime:a})=>{var o;return{anonymous_id:(o=n.findTrackedSession(a))===null||o===void 0?void 0:o.anonymousId}}),i}function NSe(){return iO("user",{propertiesConfig:{id:{type:"string"},name:{type:"string"},email:{type:"string"}}})}const Br={userContext:"userContext",globalContext:"globalContext",accountContext:"accountContext"},Oi={getContext:"getContext",setContext:"setContext",setContextProperty:"setContextProperty",removeContextProperty:"removeContextProperty",clearContext:"clearContext"},Mi={DOCUMENT:"document",XHR:"xhr",BEACON:"beacon",FETCH:"fetch",CSS:"css",JS:"js",IMAGE:"image",FONT:"font",MEDIA:"media",OTHER:"other"},aO={FETCH:Mi.FETCH,XHR:Mi.XHR},GOt=500;function KOt(e=d$t){const t=new R_e(GOt),n=e().subscribe(r=>{t.notify({type:0,error:r})});return{observable:t,stop:()=>{n.unsubscribe()}}}function WOt(){try{return new Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}const Et={ACTION:"action",ERROR:"error",LONG_TASK:"long_task",VIEW:"view",RESOURCE:"resource",VITAL:"vital"},MSe={LONG_TASK:"long-task",LONG_ANIMATION_FRAME:"long-animation-frame"},Ml={INITIAL_LOAD:"initial_load",ROUTE_CHANGE:"route_change",BF_CACHE:"bf_cache"},xB={CLICK:"click",CUSTOM:"custom"},sv={RAGE_CLICK:"rage_click",ERROR_CLICK:"error_click",DEAD_CLICK:"dead_click"},w0={DURATION:"duration",OPERATION_STEP:"operation_step"};function JOt(){return{vitalsByName:new Map,vitalsByReference:new WeakMap}}function YOt(e,t,n){function r(o){return!t.wasInPageStateDuringPeriod("frozen",o.startClocks.relative,o.duration)}function i(o){r(o)&&e.notify(12,gne(o))}function a(o,s,l,u){if(!Zw(Nc.FEATURE_OPERATION_VITAL))return;const{operationKey:d,context:f,description:h}=l||{},m={name:o,type:w0.OPERATION_STEP,operationKey:d,failureReason:u,stepType:s,startClocks:Hr(),context:Un(f),description:h};e.notify(12,gne(m))}return{addOperationStepVital:a,addDurationVital:i,startDurationVital:(o,s={})=>DSe(n,o,s),stopDurationVital:(o,s={})=>{zSe(i,n,o,s)}}}function DSe({vitalsByName:e,vitalsByReference:t},n,r={}){const i={name:n,startClocks:Hr(),...r},a={__dd_vital_reference:!0};return e.set(n,i),t.set(a,i),a}function zSe(e,{vitalsByName:t,vitalsByReference:n},r,i={}){const a=typeof r=="string"?t.get(r):n.get(r);a&&(e(XOt(a,a.startClocks,i,Hr())),typeof r=="string"?t.delete(r):n.delete(r))}function XOt(e,t,n,r){var i;return{name:e.name,type:w0.DURATION,startClocks:t,duration:fr(t.timeStamp,r.timeStamp),context:ru(e.context,n.context),description:(i=n.description)!==null&&i!==void 0?i:e.description}}function gne(e){const{startClocks:t,type:n,name:r,description:i,context:a}=e,o={id:wi(),type:n,name:r,description:i,...n===w0.DURATION?{duration:kt(e.duration)}:{step_type:e.stepType,operation_key:e.operationKey,failure_reason:e.failureReason}};return{rawRumEvent:{date:t.timeStamp,vital:o,type:Et.VITAL,context:a},startTime:t.relative,duration:n===w0.DURATION?e.duration:void 0,domainContext:{}}}function LSe(e,t,n){if(e)for(const r of e){const i=r[t];i&&i(n)}}const yne=new Map;function USe(e,t){if(t===100)return!0;if(t===0)return!1;const n=yne.get(t);if(n&&e===n.sessionId)return n.decision;let r;return window.BigInt?r=QOt(BigInt(`0x${e.split("-")[4]}`),t):r=Xd(t),yne.set(t,{sessionId:e,decision:r}),r}function QOt(e,t){const n=BigInt("1111111111111111111"),r=BigInt("0x10000000000000000"),i=e*n%r;return Number(i)<=t/100*Number(r)}function eAt(){return VSe(64)}function BSe(){return VSe(63)}function VSe(e){const t=crypto.getRandomValues(new Uint32Array(2));return e===63&&(t[t.length-1]>>>=1),{toString(n=10){let r=t[1],i=t[0],a="";do{const o=r%n*4294967296+i;r=Math.floor(r/n),i=Math.floor(o/n),a=(o%n).toString(n)+a}while(r||i);return a}}}function oh(e){return e.toString(16).padStart(16,"0")}function tAt(e){const t=e;return ep(t)==="object"&&v0(t.match)&&Array.isArray(t.propagatorTypes)}function nAt(e){e.status===0&&!e.isAborted&&(e.traceId=void 0,e.spanId=void 0,e.traceSampled=void 0)}function rAt(e,t,n,r){return{clearTracingIfNeeded:nAt,traceFetch:i=>vne(e,i,t,n,r,a=>{var o;if(i.input instanceof Request&&!(!((o=i.init)===null||o===void 0)&&o.headers))i.input=new Request(i.input),Object.keys(a).forEach(s=>{i.input.headers.append(s,a[s])});else{i.init=g0(i.init);const s=[];i.init.headers instanceof Headers?i.init.headers.forEach((l,u)=>{s.push([u,l])}):Array.isArray(i.init.headers)?i.init.headers.forEach(l=>{s.push(l)}):i.init.headers&&Object.keys(i.init.headers).forEach(l=>{s.push([l,i.init.headers[l]])}),i.init.headers=s.concat(fB(a))}}),traceXhr:(i,a)=>vne(e,i,t,n,r,o=>{Object.keys(o).forEach(s=>{a.setRequestHeader(s,o[s])})})}}function vne(e,t,n,r,i,a){const o=n.findTrackedSession();if(!o)return;const s=e.allowedTracingUrls.find(u=>nO([u.match],t.url,!0));if(!s)return;const l=USe(o.id,e.traceSampleRate);(l||e.traceContextInjection===pL.ALL)&&(t.traceSampled=l,t.traceId=eAt(),t.spanId=BSe(),a(iAt(t.traceId,t.spanId,t.traceSampled,o.id,s.propagatorTypes,r,i,e)))}function iAt(e,t,n,r,i,a,o,s){const l={};if(i.forEach(u=>{switch(u){case"datadog":{Object.assign(l,{"x-datadog-origin":"rum","x-datadog-parent-id":t.toString(),"x-datadog-sampling-priority":n?"1":"0","x-datadog-trace-id":e.toString()});break}case"tracecontext":{Object.assign(l,{traceparent:`00-0000000000000000${oh(e)}-${oh(t)}-0${n?"1":"0"}`,tracestate:`dd=s:${n?"1":"0"};o:rum`});break}case"b3":{Object.assign(l,{b3:`${oh(e)}-${oh(t)}-${n?"1":"0"}`});break}case"b3multi":{Object.assign(l,{"X-B3-TraceId":oh(e),"X-B3-SpanId":oh(t),"X-B3-Sampled":n?"1":"0"});break}}}),s.propagateTraceBaggage){const u={"session.id":r},d=a.getContext().id;typeof d=="string"&&(u["user.id"]=d);const f=o.getContext().id;typeof f=="string"&&(u["account.id"]=f);const h=Object.entries(u).map(([m,v])=>`${m}=${encodeURIComponent(v)}`).join(",");h&&(l.baggage=h)}return l}const FSe=["tracecontext","datadog"];function aAt(e,t){var n,r,i,a,o,s,l;if(e.trackFeatureFlagsForEvents!==void 0&&!Array.isArray(e.trackFeatureFlagsForEvents)&&xt.warn("trackFeatureFlagsForEvents should be an array"),!e.applicationId){xt.error("Application ID is not configured, no RUM data will be collected.");return}if(!Ah(e.sessionReplaySampleRate,"Session Replay")||!Ah(e.traceSampleRate,"Trace"))return;if(e.excludedActivityUrls!==void 0&&!Array.isArray(e.excludedActivityUrls)){xt.error("Excluded Activity Urls should be an array");return}const u=oAt(e);if(!u)return;const d=NTt(e,t),f=lAt(e);if(!d)return;const h=(n=e.sessionReplaySampleRate)!==null&&n!==void 0?n:0;return{applicationId:e.applicationId,actionNameAttribute:e.actionNameAttribute,sessionReplaySampleRate:h,startSessionReplayRecordingManually:e.startSessionReplayRecordingManually!==void 0?!!e.startSessionReplayRecordingManually:h===0,traceSampleRate:(r=e.traceSampleRate)!==null&&r!==void 0?r:100,rulePsr:Fw(e.traceSampleRate)?e.traceSampleRate/100:void 0,allowedTracingUrls:u,excludedActivityUrls:(i=e.excludedActivityUrls)!==null&&i!==void 0?i:[],workerUrl:e.workerUrl,compressIntakeRequests:!!e.compressIntakeRequests,trackUserInteractions:!!(!((a=e.trackUserInteractions)!==null&&a!==void 0)||a),trackViewsManually:!!e.trackViewsManually,trackResources:!!(!((o=e.trackResources)!==null&&o!==void 0)||o),trackLongTasks:!!(!((s=e.trackLongTasks)!==null&&s!==void 0)||s),trackBfcacheViews:!!e.trackBfcacheViews,trackEarlyRequests:!!e.trackEarlyRequests,subdomain:e.subdomain,defaultPrivacyLevel:dE(Oh,e.defaultPrivacyLevel)?e.defaultPrivacyLevel:Oh.MASK,enablePrivacyForActionName:!!e.enablePrivacyForActionName,traceContextInjection:dE(pL,e.traceContextInjection)?e.traceContextInjection:pL.SAMPLED,plugins:e.plugins||[],trackFeatureFlagsForEvents:e.trackFeatureFlagsForEvents||[],profilingSampleRate:(l=e.profilingSampleRate)!==null&&l!==void 0?l:0,propagateTraceBaggage:!!e.propagateTraceBaggage,allowedGraphQlUrls:f,...d}}function oAt(e){if(e.allowedTracingUrls===void 0)return[];if(!Array.isArray(e.allowedTracingUrls)){xt.error("Allowed Tracing URLs should be an array");return}if(e.allowedTracingUrls.length!==0&&e.service===void 0){xt.error("Service needs to be configured when tracing is enabled");return}const t=[];return e.allowedTracingUrls.forEach(n=>{v0(n)?t.push({match:n,propagatorTypes:FSe}):tAt(n)?t.push(n):xt.warn("Allowed Tracing Urls parameters should be a string, RegExp, function, or an object. Ignoring parameter",n)}),t}function sAt(e){const t=new Set;return yf(e.allowedTracingUrls)&&e.allowedTracingUrls.forEach(n=>{v0(n)?FSe.forEach(r=>t.add(r)):ep(n)==="object"&&Array.isArray(n.propagatorTypes)&&n.propagatorTypes.forEach(r=>t.add(r))}),Array.from(t)}function lAt(e){if(!e.allowedGraphQlUrls)return[];if(!Array.isArray(e.allowedGraphQlUrls))return xt.warn("allowedGraphQlUrls should be an array"),[];const t=[];return e.allowedGraphQlUrls.forEach(n=>{v0(n)?t.push({match:n,trackPayload:!1,trackResponseErrors:!1}):n&&typeof n=="object"&&"match"in n&&v0(n.match)&&t.push({match:n.match,trackPayload:!!n.trackPayload,trackResponseErrors:!!n.trackResponseErrors})}),t}function uAt(e){return yf(e)&&e.some(t=>typeof t=="object"&&"trackPayload"in t?!!t.trackPayload:!1)}function cAt(e){return yf(e)&&e.some(t=>typeof t=="object"&&"trackResponseErrors"in t?!!t.trackResponseErrors:!1)}function dAt(e){var t;const n=MTt(e);return{session_replay_sample_rate:e.sessionReplaySampleRate,start_session_replay_recording_manually:e.startSessionReplayRecordingManually,trace_sample_rate:e.traceSampleRate,trace_context_injection:e.traceContextInjection,propagate_trace_baggage:e.propagateTraceBaggage,action_name_attribute:e.actionNameAttribute,use_allowed_tracing_urls:yf(e.allowedTracingUrls),use_allowed_graph_ql_urls:yf(e.allowedGraphQlUrls),use_track_graph_ql_payload:uAt(e.allowedGraphQlUrls),use_track_graph_ql_response_errors:cAt(e.allowedGraphQlUrls),selected_tracing_propagators:sAt(e),default_privacy_level:e.defaultPrivacyLevel,enable_privacy_for_action_name:e.enablePrivacyForActionName,use_excluded_activity_urls:yf(e.excludedActivityUrls),use_worker_url:!!e.workerUrl,compress_intake_requests:e.compressIntakeRequests,track_views_manually:e.trackViewsManually,track_user_interactions:e.trackUserInteractions,track_resources:e.trackResources,track_long_task:e.trackLongTasks,track_bfcache_views:e.trackBfcacheViews,track_early_requests:e.trackEarlyRequests,plugins:(t=e.plugins)===null||t===void 0?void 0:t.map(r=>{var i;return{name:r.name,...(i=r.getConfigurationTelemetry)===null||i===void 0?void 0:i.call(r)}}),track_feature_flags_for_events:e.trackFeatureFlagsForEvents,remote_configuration_id:e.remoteConfigurationId,profiling_sample_rate:e.profilingSampleRate,use_remote_configuration_proxy:!!e.remoteConfigurationProxy,...n}}function fAt(e){const t=[];let n=0,r;const i={quote:void 0,escapeSequence:void 0};let a="";for(const o of e){if(r=bne[n].find(s=>vAt[s](o,i)),!r)return[];if(i.escapeSequence!==void 0&&r!==12){if(!xAt(i.escapeSequence))return[];a+=SAt(i.escapeSequence),i.escapeSequence=void 0}bAt.includes(r)?a+=o:wAt.includes(r)&&a!==""?(t.push(a),a=""):r===12?i.escapeSequence=i.escapeSequence?`${i.escapeSequence}${o}`:o:r===8?i.quote=o:r===9&&(i.quote=void 0),n=r}return bne[n].includes(1)?(a!==""&&t.push(a),t):[]}const pAt=/[a-zA-Z_$]/,hAt=/[a-zA-Z0-9_$]/,mAt=/[0-9]/,gAt=/[a-fA-F0-9]/,yAt=`'"`,vAt={0:()=>!1,1:()=>!1,2:e=>pAt.test(e),3:e=>hAt.test(e),4:e=>e===".",5:e=>e==="[",6:e=>e==="]",7:e=>mAt.test(e),8:e=>yAt.includes(e),9:(e,t)=>e===t.quote,10:()=>!0,11:e=>e==="\\",12:(e,t)=>t.escapeSequence===void 0?`${t.quote}/\\bfnrtu`.includes(e):t.escapeSequence.startsWith("u")&&t.escapeSequence.length<5?gAt.test(e):!1},bne={0:[2,5],1:[],2:[3,4,5,1],3:[3,4,5,1],4:[2],5:[8,7],6:[4,5,1],7:[7,6],8:[11,9,10],9:[6],10:[11,9,10],11:[12],12:[12,11,9,10]},bAt=[2,3,7,10],wAt=[4,5,6];function xAt(e){return`"'/\\bfnrt`.includes(e)||e.startsWith("u")&&e.length===5}const _At={'"':'"',"'":"'","/":"/","\\":"\\",b:"\b",f:"\f",n:`
|
|
474
|
-
`,r:"\r",t:" "};function SAt(e){return e.startsWith("u")?String.fromCharCode(parseInt(e.slice(1),16)):_At[e]}const kAt="v1",EAt=["applicationId","service","env","version","sessionSampleRate","sessionReplaySampleRate","defaultPrivacyLevel","enablePrivacyForActionName","traceSampleRate","trackSessionAcrossSubdomains","allowedTracingUrls","allowedTrackingOrigins"];async function TAt(e,t){let n;const r=OAt(),i=await jAt(e);return i.ok?(r.increment("fetch","success"),n=$At(e,i.value,t,r)):(r.increment("fetch","failure"),xt.error(i.error)),rO("remote configuration metrics",{metrics:r.get()}),n}function $At(e,t,n,r){const i={...e};return EAt.forEach(h=>{h in t&&(i[h]=a(t[h]))}),Object.keys(n).forEach(h=>{t[h]!==void 0&&o(n[h],t[h])}),i;function a(h){if(Array.isArray(h))return h.map(a);if(AAt(h)){if(CAt(h)){const m=h.rcSerializedType;switch(m){case"string":return h.value;case"regex":return qSe(h.value);case"dynamic":return s(h);default:xt.error(`Unsupported remote configuration: "rcSerializedType": "${m}"`);return}}return C_e(h,a)}return h}function o(h,m){m.forEach(({key:v,value:y})=>{h.setContextProperty(v,a(y))})}function s(h){const m=h.strategy;let v;switch(m){case"cookie":v=l(h);break;case"dom":v=u(h);break;case"js":v=f(h);break;default:xt.error(`Unsupported remote configuration: "strategy": "${m}"`);return}const y=h.extractor;return y!==void 0&&typeof v=="string"?IAt(y,v):v}function l({name:h}){const m=eO(h);return r.increment("cookie",m!==void 0?"success":"missing"),m}function u({selector:h,attribute:m}){let v;try{v=document.querySelector(h)}catch{xt.error(`Invalid selector in the remote configuration: '${h}'`),r.increment("dom","failure");return}if(!v){r.increment("dom","missing");return}if(d(v,m)){xt.error(`Forbidden element selected by the remote configuration: '${h}'`),r.increment("dom","failure");return}const y=m!==void 0?v.getAttribute(m):v.textContent;if(y===null){r.increment("dom","missing");return}return r.increment("dom","success"),y}function d(h,m){return h.getAttribute("type")==="password"&&m==="value"}function f({path:h}){let m=window;const v=fAt(h);if(v.length===0){xt.error(`Invalid JSON path in the remote configuration: '${h}'`),r.increment("js","failure");return}for(const y of v){if(!(y in m)){r.increment("js","missing");return}try{m=m[y]}catch(w){xt.error(`Error accessing: '${h}'`,w),r.increment("js","failure");return}}return r.increment("js","success"),m}}function OAt(){const e={fetch:{}};return{get:()=>e,increment:(t,n)=>{e[t]||(e[t]={}),e[t][n]||(e[t][n]=0),e[t][n]=e[t][n]+1}}}function AAt(e){return typeof e=="object"&&e!==null}function CAt(e){return"rcSerializedType"in e}function qSe(e){try{return new RegExp(e)}catch{xt.error(`Invalid regex in the remote configuration: '${e}'`)}}function IAt(e,t){const n=qSe(e.value);if(n===void 0)return;const r=n.exec(t);if(r===null)return;const[i,a]=r;return a||i}async function jAt(e){let t;try{t=await fetch(RAt(e))}catch{t=void 0}if(!t||!t.ok)return{ok:!1,error:new Error("Error fetching the remote configuration.")};const n=await t.json();return n.rum?{ok:!0,value:n.rum}:{ok:!1,error:new Error("No remote configuration for RUM.")}}function RAt(e){return e.remoteConfigurationProxy?e.remoteConfigurationProxy:`https://sdk-configuration.${eSe("rum",e)}/${kAt}/${encodeURIComponent(e.remoteConfigurationId)}.json`}function PAt({ignoreInitIfSyntheticsWillInjectRum:e=!0,startDeflateWorker:t},n,r,i){const a=LOt(),o=PSe();x2(o,Br.globalContext,a);const s=NSe();x2(s,Br.userContext,a);const l=RSe();x2(l,Br.accountContext,a);let u,d,f,h;const m=n.observable.subscribe(y),v={};function y(){if(!f||!h||!n.isGranted())return;m.unsubscribe();let k;if(h.trackViewsManually){if(!u)return;a.remove(u.callback),k=u.options}const S=i(h,d,k);a.drain(S)}function w(k,S){const E=og();if(E&&(k=NAt(k)),f=k,Q$t(dAt(k)),h){lSe("DD_RUM",k);return}const C=aAt(k,S);if(C){if(!E&&!C.sessionStoreStrategyType){xt.warn("No storage available for session. We will not send any data.");return}C.compressIntakeRequests&&!E&&t&&(d=t(C,"Datadog RUM",fn),!d)||(h=C,jSe().subscribe(fn),n.tryToInit(C.trackingConsent),y())}}const x=k=>{a.add(S=>S.addDurationVital(k))};return{init(k,S,E){if(!k){xt.error("Missing configuration");return}DTt(k.enableExperimentalFeatures),f=k,!(e&&TSe())&&(LSe(k.plugins,"onInit",{initConfiguration:k,publicApi:S}),k.remoteConfigurationId?TAt(k,{user:s,context:o}).then(C=>{C&&w(C,E)}).catch(Pc):w(k,E))},get initConfiguration(){return f},getInternalContext:fn,stopSession:fn,addTiming(k,S=ii()){a.add(E=>E.addTiming(k,S))},startView(k,S=Hr()){const E=C=>{C.startView(k,S)};a.add(E),u||(u={options:k,callback:E},y())},setViewName(k){a.add(S=>S.setViewName(k))},setViewContext(k){a.add(S=>S.setViewContext(k))},setViewContextProperty(k,S){a.add(E=>E.setViewContextProperty(k,S))},getViewContext:()=>v,globalContext:o,userContext:s,accountContext:l,addAction(k){a.add(S=>S.addAction(k))},addError(k){a.add(S=>S.addError(k))},addFeatureFlagEvaluation(k,S){a.add(E=>E.addFeatureFlagEvaluation(k,S))},startDurationVital(k,S){return DSe(r,k,S)},stopDurationVital(k,S){zSe(x,r,k,S)},addDurationVital:x,addOperationStepVital:(k,S,E,C)=>{a.add(A=>A.addOperationStepVital(Un(k),S,Un(E),Un(C)))}}}function NAt(e){var t,n;return{...e,applicationId:"00000000-aaaa-0000-aaaa-000000000000",clientToken:"empty",sessionSampleRate:100,defaultPrivacyLevel:(t=e.defaultPrivacyLevel)!==null&&t!==void 0?t:(n=Ww())===null||n===void 0?void 0:n.getPrivacyLevel()}}function x2(e,t,n){e.changeObservable.subscribe(()=>{const r=e.getContext();n.add(i=>i[t].setContext(r))})}function MAt(e,t,n,r={}){const i=gTt(),a=JOt(),o=KOt().observable;let s=PAt(r,i,a,(f,h,m)=>{const v=h&&r.createDeflateEncoder?w=>r.createDeflateEncoder(f,h,w):mOt,y=e(f,t,n,m,v,i,a,o,r.sdkName);return t.onRumStart(y.lifeCycle,f,y.session,y.viewHistory,h,y.telemetry),n.onRumStart(y.lifeCycle,y.hooks,f,y.session,y.viewHistory,v),s=DAt(s,y),LSe(f.plugins,"onRumStart",{strategy:s,addEvent:y.addEvent}),y});const l=()=>s,u=$t(f=>{const h=typeof f=="object"?f:{name:f};s.startView(h),Ur({feature:"start-view"})}),d=h$t({init:f=>{const h=new Error().stack;Sc(()=>s.init(f,d,h))},setTrackingConsent:$t(f=>{i.update(f),Ur({feature:"set-tracking-consent",tracking_consent:f})}),setViewName:$t(f=>{s.setViewName(f),Ur({feature:"set-view-name"})}),setViewContext:$t(f=>{s.setViewContext(f),Ur({feature:"set-view-context"})}),setViewContextProperty:$t((f,h)=>{s.setViewContextProperty(f,h),Ur({feature:"set-view-context-property"})}),getViewContext:$t(()=>(Ur({feature:"set-view-context-property"}),s.getViewContext())),getInternalContext:$t(f=>s.getInternalContext(f)),getInitConfiguration:$t(()=>gB(s.initConfiguration)),addAction:(f,h)=>{const m=fE("action");Sc(()=>{s.addAction({name:Un(f),context:Un(h),startClocks:Hr(),type:xB.CUSTOM,handlingStack:m}),Ur({feature:"add-action"})})},addError:(f,h)=>{const m=fE("error");Sc(()=>{s.addError({error:f,handlingStack:m,context:Un(h),startClocks:Hr()}),Ur({feature:"add-error"})})},addTiming:$t((f,h)=>{s.addTiming(Un(f),h)}),setGlobalContext:$i(l,Br.globalContext,Oi.setContext,"set-global-context"),getGlobalContext:$i(l,Br.globalContext,Oi.getContext,"get-global-context"),setGlobalContextProperty:$i(l,Br.globalContext,Oi.setContextProperty,"set-global-context-property"),removeGlobalContextProperty:$i(l,Br.globalContext,Oi.removeContextProperty,"remove-global-context-property"),clearGlobalContext:$i(l,Br.globalContext,Oi.clearContext,"clear-global-context"),setUser:$i(l,Br.userContext,Oi.setContext,"set-user"),getUser:$i(l,Br.userContext,Oi.getContext,"get-user"),setUserProperty:$i(l,Br.userContext,Oi.setContextProperty,"set-user-property"),removeUserProperty:$i(l,Br.userContext,Oi.removeContextProperty,"remove-user-property"),clearUser:$i(l,Br.userContext,Oi.clearContext,"clear-user"),setAccount:$i(l,Br.accountContext,Oi.setContext,"set-account"),getAccount:$i(l,Br.accountContext,Oi.getContext,"get-account"),setAccountProperty:$i(l,Br.accountContext,Oi.setContextProperty,"set-account-property"),removeAccountProperty:$i(l,Br.accountContext,Oi.removeContextProperty,"remove-account-property"),clearAccount:$i(l,Br.accountContext,Oi.clearContext,"clear-account"),startView:u,stopSession:$t(()=>{s.stopSession(),Ur({feature:"stop-session"})}),addFeatureFlagEvaluation:$t((f,h)=>{s.addFeatureFlagEvaluation(Un(f),Un(h)),Ur({feature:"add-feature-flag-evaluation"})}),getSessionReplayLink:$t(()=>t.getSessionReplayLink()),startSessionReplayRecording:$t(f=>{t.start(f),Ur({feature:"start-session-replay-recording",force:f&&f.force})}),stopSessionReplayRecording:$t(()=>t.stop()),addDurationVital:$t((f,h)=>{Ur({feature:"add-duration-vital"}),s.addDurationVital({name:Un(f),type:w0.DURATION,startClocks:CEt(h.startTime),duration:h.duration,context:Un(h&&h.context),description:Un(h&&h.description)})}),startDurationVital:$t((f,h)=>(Ur({feature:"start-duration-vital"}),s.startDurationVital(Un(f),{context:Un(h&&h.context),description:Un(h&&h.description)}))),stopDurationVital:$t((f,h)=>{Ur({feature:"stop-duration-vital"}),s.stopDurationVital(typeof f=="string"?Un(f):f,{context:Un(h&&h.context),description:Un(h&&h.description)})}),startFeatureOperation:$t((f,h)=>{Ur({feature:"add-operation-step-vital",action_type:"start"}),s.addOperationStepVital(f,"start",h)}),succeedFeatureOperation:$t((f,h)=>{Ur({feature:"add-operation-step-vital",action_type:"succeed"}),s.addOperationStepVital(f,"end",h)}),failFeatureOperation:$t((f,h,m)=>{Ur({feature:"add-operation-step-vital",action_type:"fail"}),s.addOperationStepVital(f,"end",m,h)})});return d}function DAt(e,t){return{init:n=>{lSe("DD_RUM",n)},initConfiguration:e.initConfiguration,...t}}function zAt(){const e=LAt();return new Gt(t=>{if(!e)return;const n=new e($t(r=>t.notify(r)));return n.observe(document,{attributes:!0,characterData:!0,childList:!0,subtree:!0}),()=>n.disconnect()})}function LAt(){let e;const t=window;if(t.Zone&&(e=Rc(t,"MutationObserver"),t.MutationObserver&&e===t.MutationObserver)){const n=new t.MutationObserver(fn),r=Rc(n,"originalInstance");e=r&&r.constructor}return e||(e=t.MutationObserver),e}function UAt(){const e=new Gt,{stop:t}=Vs(window,"open",()=>e.notify());return{observable:e,stop:t}}function BAt(e,t,n,r,i){return{get:a=>{const o=n.findView(a),s=i.findUrl(a),l=t.findTrackedSession(a);if(l&&o&&s){const u=r.findActionId(a);return{application_id:e,session_id:l.id,user_action:u?{id:u}:void 0,view:{id:o.id,name:o.name,referrer:s.referrer,url:s.url}}}}}}const VAt=gOt,FAt=Qf;function qAt(e){const t=Wg({expireDelay:FAt});e.subscribe(1,r=>{t.add(n(r),r.startClocks.relative)}),e.subscribe(6,({endClocks:r})=>{t.closeActive(r.relative)}),e.subscribe(3,r=>{const i=t.find(r.startClocks.relative);i&&(r.name&&(i.name=r.name),r.context&&(i.context=r.context),i.sessionIsActive=r.sessionIsActive)}),e.subscribe(10,()=>{t.reset()});function n(r){return{service:r.service,version:r.version,context:r.context,id:r.id,name:r.name,startClocks:r.startClocks}}return{findView:r=>t.find(r),stop:()=>{t.stop()}}}const ZSe="initial_document",ZAt=[[Mi.DOCUMENT,e=>ZSe===e],[Mi.XHR,e=>e==="xmlhttprequest"],[Mi.FETCH,e=>e==="fetch"],[Mi.BEACON,e=>e==="beacon"],[Mi.CSS,(e,t)=>/\.css$/i.test(t)],[Mi.JS,(e,t)=>/\.js$/i.test(t)],[Mi.IMAGE,(e,t)=>["image","img","icon"].includes(e)||/\.(gif|jpg|jpeg|tiff|png|svg|ico)$/i.exec(t)!==null],[Mi.FONT,(e,t)=>/\.(woff|eot|woff2|ttf)$/i.exec(t)!==null],[Mi.MEDIA,(e,t)=>["audio","video"].includes(e)||/\.(mp3|mp4)$/i.exec(t)!==null]];function HAt(e){const t=e.name;if(!LEt(t))return Mi.OTHER;const n=UEt(t);for(const[r,i]of ZAt)if(i(e.initiatorType,n))return r;return Mi.OTHER}function wne(...e){for(let t=1;t<e.length;t+=1)if(e[t-1]>e[t])return!1;return!0}function HSe(e){return e.initiatorType==="xmlhttprequest"||e.initiatorType==="fetch"}function GAt(e){const{duration:t,startTime:n,responseEnd:r}=e;return t===0&&n<r?fr(n,r):t}function KAt(e){if(!KSe(e))return;const{startTime:t,fetchStart:n,workerStart:r,redirectStart:i,redirectEnd:a,domainLookupStart:o,domainLookupEnd:s,connectStart:l,secureConnectionStart:u,connectEnd:d,requestStart:f,responseStart:h,responseEnd:m}=e,v={download:Id(t,h,m),first_byte:Id(t,f,h)};return 0<r&&r<n&&(v.worker=Id(t,r,n)),n<d&&(v.connect=Id(t,l,d),l<=u&&u<=d&&(v.ssl=Id(t,u,d))),n<s&&(v.dns=Id(t,o,s)),t<a&&(v.redirect=Id(t,i,a)),v}function GSe(e){return e.duration>=0}function KSe(e){const t=wne(e.startTime,e.fetchStart,e.domainLookupStart,e.domainLookupEnd,e.connectStart,e.connectEnd,e.requestStart,e.responseStart,e.responseEnd),n=WAt(e)?wne(e.startTime,e.redirectStart,e.redirectEnd,e.fetchStart):!0;return t&&n}function WAt(e){return e.redirectEnd>e.startTime}function Id(e,t,n){if(e<=t&&t<=n)return{duration:kt(fr(t,n)),start:kt(fr(e,t))}}function JAt(e){return e.nextHopProtocol===""?void 0:e.nextHopProtocol}function YAt(e){return e.deliveryType===""?"other":e.deliveryType}function XAt(e){if(e.startTime<e.responseStart){const{encodedBodySize:t,decodedBodySize:n,transferSize:r}=e;return{size:n,encoded_body_size:t,decoded_body_size:n,transfer_size:r}}return{size:void 0,encoded_body_size:void 0,decoded_body_size:void 0,transfer_size:void 0}}function _B(e){return e&&(!RTt(e)||Zw(Nc.TRACK_INTAKE_REQUESTS))}const QAt=/data:(.+)?(;base64)?,/g,eCt=24e3;function tCt(e,t=eCt){if(e.length<=t||!e.startsWith("data:"))return e;const n=e.substring(0,100).match(QAt);return n?`${n[0]}[...]`:e}const nCt=32*tp;function rCt(e,t){const n=aCt(e.requestBody,t.trackPayload);if(n){if(t.trackResponseErrors&&e.responseBody){const r=iCt(e.responseBody);r&&(n.errors_count=r.length,n.errors=r)}return n}}function iCt(e){let t;try{t=JSON.parse(e)}catch{return}if(!t||typeof t!="object")return;const n=t;return yf(n.errors)?n.errors.map(r=>{var i;return{message:r.message,path:r.path,locations:r.locations,code:(i=r.extensions)===null||i===void 0?void 0:i.code}}):void 0}function WSe(e,t){return t.allowedGraphQlUrls.find(n=>nO([n.match],e))}function aCt(e,t=!1){if(!e||typeof e!="string")return;let n;try{n=JSON.parse(e)}catch{return}if(!n||!n.query)return;const r=n.query.trim(),i=oCt(r),a=n.operationName;if(!i)return;let o;return n.variables&&(o=JSON.stringify(n.variables)),{operationType:i,operationName:a,variables:o,payload:t?cB(r,nCt,"..."):void 0}}function oCt(e){var t;return(t=e.match(/^\s*(query|mutation|subscription)\b/i))===null||t===void 0?void 0:t[1]}let xne=1;function sCt(e,t,n,r,i){const a=rAt(t,n,r,i);lCt(e,t,a),uCt(e,t,a)}function lCt(e,t,n){const r=bOt(t).subscribe(i=>{const a=i;if(_B(a.url))switch(a.state){case"start":n.traceXhr(a,a.xhr),a.requestIndex=JSe(),e.notify(7,{requestIndex:a.requestIndex,url:a.url});break;case"complete":n.clearTracingIfNeeded(a),e.notify(8,{duration:a.duration,method:a.method,requestIndex:a.requestIndex,spanId:a.spanId,startClocks:a.startClocks,status:a.status,traceId:a.traceId,traceSampled:a.traceSampled,type:aO.XHR,url:a.url,xhr:a.xhr,isAborted:a.isAborted,handlingStack:a.handlingStack,requestBody:a.requestBody,responseBody:a.responseBody});break}});return{stop:()=>r.unsubscribe()}}function uCt(e,t,n){const r=jSe({responseBodyAction:i=>{var a;return!((a=WSe(i.url,t))===null||a===void 0)&&a.trackResponseErrors?2:1}}).subscribe(i=>{var a;const o=i;if(_B(o.url))switch(o.state){case"start":n.traceFetch(o),o.requestIndex=JSe(),e.notify(7,{requestIndex:o.requestIndex,url:o.url});break;case"resolve":n.clearTracingIfNeeded(o),e.notify(8,{duration:fr(o.startClocks.timeStamp,ii()),method:o.method,requestIndex:o.requestIndex,responseType:o.responseType,spanId:o.spanId,startClocks:o.startClocks,status:o.status,traceId:o.traceId,traceSampled:o.traceSampled,type:aO.FETCH,url:o.url,response:o.response,init:o.init,input:o.input,isAborted:o.isAborted,handlingStack:o.handlingStack,requestBody:(a=o.init)===null||a===void 0?void 0:a.body,responseBody:o.responseBody});break}});return{stop:()=>r.unsubscribe()}}function JSe(){const e=xne;return xne+=1,e}function YSe(e){return Fw(e)&&e<0?void 0:e}function XSe({lifeCycle:e,isChildEvent:t,onChange:n=fn}){const r={errorCount:0,longTaskCount:0,resourceCount:0,actionCount:0,frustrationCount:0},i=e.subscribe(13,a=>{var o;if(!(a.type==="view"||a.type==="vital"||!t(a)))switch(a.type){case Et.ERROR:r.errorCount+=1,n();break;case Et.ACTION:r.actionCount+=1,a.action.frustration&&(r.frustrationCount+=a.action.frustration.type.length),n();break;case Et.LONG_TASK:r.longTaskCount+=1,n();break;case Et.RESOURCE:!((o=a._dd)===null||o===void 0)&&o.discarded||(r.resourceCount+=1,n());break}});return{stop:()=>{i.unsubscribe()},eventCounts:r}}function cCt(e,t){const n=Ki();let r=!1;const{stop:i}=Mc(e,window,["click","mousedown","keydown","touchstart","pointerdown"],s=>{if(!s.cancelable)return;const l={entryType:"first-input",processingStart:Ma(),processingEnd:Ma(),startTime:s.timeStamp,duration:0,name:"",cancelable:!1,target:null,toJSON:()=>({})};s.type==="pointerdown"?a(e,l):o(l)},{passive:!0,capture:!0});return{stop:i};function a(s,l){Mc(s,window,["pointerup","pointercancel"],u=>{u.type==="pointerup"&&o(l)},{once:!0})}function o(s){if(!r){r=!0,i();const l=s.processingStart-s.startTime;l>=0&&l<Ki()-n&&t(s)}}}var Jt;(function(e){e.EVENT="event",e.FIRST_INPUT="first-input",e.LARGEST_CONTENTFUL_PAINT="largest-contentful-paint",e.LAYOUT_SHIFT="layout-shift",e.LONG_TASK="longtask",e.LONG_ANIMATION_FRAME="long-animation-frame",e.NAVIGATION="navigation",e.PAINT="paint",e.RESOURCE="resource",e.VISIBILITY_STATE="visibility-state"})(Jt||(Jt={}));function Js(e,t){return new Gt(n=>{if(!window.PerformanceObserver)return;const r=l=>{const u=pCt(l);u.length>0&&n.notify(u)};let i,a=!0;const o=new PerformanceObserver($t(l=>{a?i=yi(()=>r(l.getEntries())):r(l.getEntries())}));try{o.observe(t)}catch{if([Jt.RESOURCE,Jt.NAVIGATION,Jt.LONG_TASK,Jt.PAINT].includes(t.type)){t.buffered&&(i=yi(()=>r(performance.getEntriesByType(t.type))));try{o.observe({entryTypes:[t.type]})}catch{return}}}a=!1,dCt(e);let s;return!rp(Jt.FIRST_INPUT)&&t.type===Jt.FIRST_INPUT&&({stop:s}=cCt(e,l=>{r([l])})),()=>{o.disconnect(),s&&s(),ho(i)}})}let lv;function dCt(e){return!lv&&fCt()&&"addEventListener"in performance&&(lv=Xn(e,performance,"resourcetimingbufferfull",()=>{performance.clearResourceTimings()})),()=>{lv==null||lv.stop()}}function fCt(){return window.performance!==void 0&&"getEntries"in performance}function rp(e){return window.PerformanceObserver&&PerformanceObserver.supportedEntryTypes!==void 0&&PerformanceObserver.supportedEntryTypes.includes(e)}function pCt(e){return e.filter(t=>!hCt(t))}function hCt(e){return e.entryType===Jt.RESOURCE&&(!_B(e.name)||!GSe(e))}function gL(e){return e.nodeType===Node.TEXT_NODE}function mCt(e){return e.nodeType===Node.COMMENT_NODE}function iu(e){return e.nodeType===Node.ELEMENT_NODE}function QSe(e){return iu(e)&&!!e.shadowRoot}function gCt(e){const t=e;return!!t.host&&t.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&iu(t.host)}function n3t(e){return e.childNodes.length>0||QSe(e)}function r3t(e,t){let n=e.firstChild;for(;n;)t(n),n=n.nextSibling;QSe(e)&&t(e.shadowRoot)}function yCt(e){return gCt(e)?e.host:e.parentNode}const eke=100,vCt=100,_ne="data-dd-excluded-activity-mutations";function SB(e,t,n,r,i,a){const o=wCt(e,t,n,r);return bCt(o,i,a)}function bCt(e,t,n){let r,i=!1;const a=yi($t(()=>u({hadActivity:!1})),eke),o=n!==void 0?yi($t(()=>u({hadActivity:!0,end:ii()})),n):void 0,s=e.subscribe(({isBusy:d})=>{ho(a),ho(r);const f=ii();d||(r=yi($t(()=>u({hadActivity:!0,end:f})),vCt))}),l=()=>{i=!0,ho(a),ho(r),ho(o),s.unsubscribe()};function u(d){i||(l(),t(d))}return{stop:l}}function wCt(e,t,n,r){return new Gt(i=>{const a=[];let o,s=0;return a.push(t.subscribe(u=>{u.every(xCt)||l()}),n.subscribe(l),Js(r,{type:Jt.RESOURCE}).subscribe(u=>{u.some(d=>!_2(r,d.name))&&l()}),e.subscribe(7,u=>{_2(r,u.url)||(o===void 0&&(o=u.requestIndex),s+=1,l())}),e.subscribe(8,u=>{_2(r,u.url)||o===void 0||u.requestIndex<o||(s-=1,l())})),()=>{a.forEach(u=>u.unsubscribe())};function l(){i.notify({isBusy:s>0})}})}function _2(e,t){return nO(e.excludedActivityUrls,t)}function xCt(e){const t=e.type==="characterData"?e.target.parentElement:e.target;return!!(t&&iu(t)&&t.matches(`[${_ne}], [${_ne}] *`))}const oO="data-dd-action-name",tke="Masked Element",nke=[oO,"data-testid","data-test","data-qa","data-cy","data-test-id","data-qa-id","data-testing","data-component","data-element","data-source-file"],_Ct=[ike,kCt],SCt=[ike,ECt,TCt];function Yw(e,t){if(!e.isConnected)return;let n,r=e;for(;r&&r.nodeName!=="HTML";){const i=Sne(r,_Ct,OCt,t,n);if(i)return i;n=Sne(r,SCt,ACt,t,n)||sO($Ct(r),n),r=r.parentElement}return n}function rke(e){return/[0-9]/.test(e)}function kCt(e){if(e.id&&!rke(e.id))return`#${CSS.escape(e.id)}`}function ECt(e){if(e.tagName==="BODY")return;const t=e.classList;for(let n=0;n<t.length;n+=1){const r=t[n];if(!rke(r))return`${CSS.escape(e.tagName)}.${CSS.escape(r)}`}}function TCt(e){return CSS.escape(e.tagName)}function ike(e,t){if(t){const r=n(t);if(r)return r}for(const r of nke){const i=n(r);if(i)return i}function n(r){if(e.hasAttribute(r))return`${CSS.escape(e.tagName)}[${r}="${CSS.escape(e.getAttribute(r))}"]`}}function $Ct(e){let t=e.parentElement.firstElementChild,n=1;for(;t&&t!==e;)t.tagName===e.tagName&&(n+=1),t=t.nextElementSibling;return`${CSS.escape(e.tagName)}:nth-of-type(${n})`}function Sne(e,t,n,r,i){for(const a of t){const o=a(e,r);if(o&&n(e,o,i))return sO(o,i)}}function OCt(e,t,n){return e.ownerDocument.querySelectorAll(sO(t,n)).length===1}function ACt(e,t,n){let r;if(n===void 0)r=a=>a.matches(t);else{const a=sO(`${t}:scope`,n);r=o=>o.querySelector(a)!==null}let i=e.parentElement.firstElementChild;for(;i;){if(i!==e&&r(i))return!1;i=i.nextElementSibling}return!0}function sO(e,t){return t?`${e}>${t}`:e}const jt={IGNORE:"ignore",HIDDEN:"hidden",ALLOW:Oh.ALLOW,MASK:Oh.MASK,MASK_USER_INPUT:Oh.MASK_USER_INPUT,MASK_UNLESS_ALLOWLISTED:Oh.MASK_UNLESS_ALLOWLISTED},ake="data-dd-privacy",i3t="hidden",CCt="dd-privacy-",S2="***",a3t="data:image/gif;base64,R0lGODlhAQABAIAAAMLCwgAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==",ICt={INPUT:!0,OUTPUT:!0,TEXTAREA:!0,SELECT:!0,OPTION:!0,DATALIST:!0,OPTGROUP:!0},jCt="x";function Ud(e){return`[${ake}="${e}"], .${CCt}${e}`}function lO(e,t,n){if(n&&n.has(e))return n.get(e);const r=yCt(e),i=r?lO(r,t,n):t,a=PCt(e),o=RCt(a,i);return n&&n.set(e,o),o}function RCt(e,t){switch(t){case jt.HIDDEN:case jt.IGNORE:return t}switch(e){case jt.ALLOW:case jt.MASK:case jt.MASK_USER_INPUT:case jt.MASK_UNLESS_ALLOWLISTED:case jt.HIDDEN:case jt.IGNORE:return e;default:return t}}function PCt(e){if(iu(e)){if(e.tagName==="BASE")return jt.ALLOW;if(e.tagName==="INPUT"){const t=e;if(t.type==="password"||t.type==="email"||t.type==="tel"||t.type==="hidden")return jt.MASK;const n=t.getAttribute("autocomplete");if(n&&(n.startsWith("cc-")||n.endsWith("-password")))return jt.MASK}if(e.matches(Ud(jt.HIDDEN)))return jt.HIDDEN;if(e.matches(Ud(jt.MASK)))return jt.MASK;if(e.matches(Ud(jt.MASK_UNLESS_ALLOWLISTED)))return jt.MASK_UNLESS_ALLOWLISTED;if(e.matches(Ud(jt.MASK_USER_INPUT)))return jt.MASK_USER_INPUT;if(e.matches(Ud(jt.ALLOW)))return jt.ALLOW;if(MCt(e))return jt.IGNORE}}function oke(e,t){switch(t){case jt.MASK:case jt.HIDDEN:case jt.IGNORE:return!0;case jt.MASK_UNLESS_ALLOWLISTED:return gL(e)?m_(e.parentNode)?!0:!lke(e.textContent||""):m_(e);case jt.MASK_USER_INPUT:return gL(e)?m_(e.parentNode):m_(e);default:return!1}}function NCt(e,t,n,r,i){if(r!==jt.MASK&&r!==jt.MASK_UNLESS_ALLOWLISTED||t===ake||nke.includes(t)||t===i.actionNameAttribute)return!1;switch(t){case"title":case"alt":case"placeholder":return!0}return!!(e==="A"&&t==="href"||e==="IFRAME"&&t==="srcdoc"||n&&t.startsWith("data-")||(e==="IMG"||e==="SOURCE")&&(t==="src"||t==="srcset"))}function m_(e){if(!e||e.nodeType!==e.ELEMENT_NODE)return!1;const t=e;if(t.tagName==="INPUT")switch(t.type){case"button":case"color":case"reset":case"submit":return!1}return!!ICt[t.tagName]}const ske=e=>e.replace(/\S/g,jCt);function o3t(e,t){var n;const r=(n=e.parentElement)===null||n===void 0?void 0:n.tagName;let i=e.textContent||"";if(r==="HEAD"&&!i.trim())return;const a=t;if(r==="SCRIPT")i=S2;else if(a===jt.HIDDEN)i=S2;else if(oke(e,a))if(r==="DATALIST"||r==="SELECT"||r==="OPTGROUP"){if(!i.trim())return}else r==="OPTION"?i=S2:a===jt.MASK_UNLESS_ALLOWLISTED?i=uke(i):i=ske(i);return i}function MCt(e){if(e.nodeName==="SCRIPT")return!0;if(e.nodeName==="LINK"){const n=t("rel");return/preload|prefetch/i.test(n)&&t("as")==="script"||n==="shortcut icon"||n==="icon"}if(e.nodeName==="META"){const n=t("name"),r=t("rel"),i=t("property");return/^msapplication-tile(image|color)$/.test(n)||n==="application-name"||r==="icon"||r==="apple-touch-icon"||r==="shortcut icon"||n==="keywords"||n==="description"||/^(og|twitter|fb):/.test(i)||/^(og|twitter):/.test(n)||n==="pinterest"||n==="robots"||n==="googlebot"||n==="bingbot"||e.hasAttribute("http-equiv")||n==="author"||n==="generator"||n==="framework"||n==="publisher"||n==="progid"||/^article:/.test(i)||/^product:/.test(i)||n==="google-site-verification"||n==="yandex-verification"||n==="csrf-token"||n==="p:domain_verify"||n==="verify-v1"||n==="verification"||n==="shopify-checkout-api-token"}function t(n){return(e.getAttribute(n)||"").toLowerCase()}return!1}function lke(e){var t;return!e||!e.trim()?!0:((t=window.$DD_ALLOW)===null||t===void 0?void 0:t.has(e.toLocaleLowerCase()))||!1}function uke(e,t){return lke(e)?e:t||ske(e)}const cke=_i,DCt=100;function zCt(e,t){const n=[];let r=0,i;a(e);function a(l){l.stopObservable.subscribe(o),n.push(l),ho(i),i=yi(s,cke)}function o(){r===1&&n.every(l=>l.isStopped())&&(r=2,t(n))}function s(){ho(i),r===0&&(r=1,o())}return{tryAppend:l=>r!==0?!1:n.length>0&&!LCt(n[n.length-1].event,l.event)?(s(),!1):(a(l),!0),stop:()=>{s()}}}function LCt(e,t){return e.target===t.target&&UCt(e,t)<=DCt&&e.timeStamp-t.timeStamp<=cke}function UCt(e,t){return Math.sqrt(Math.pow(e.clientX-t.clientX,2)+Math.pow(e.clientY-t.clientY,2))}function BCt(e,t,n=jt.ALLOW){const r=new Map,{actionNameAttribute:i}=t,a=kne(e,oO)||i&&kne(e,i);return a?{name:a,nameSource:"custom_attribute"}:n===jt.MASK?{name:tke,nameSource:"mask_placeholder"}:Ene(e,VCt,t,r)||Ene(e,FCt,t,r)||{name:"",nameSource:"blank"}}function kne(e,t){const n=e.closest(`[${t}]`);if(!n)return;const r=n.getAttribute(t);return fke(dke(r.trim()))}const VCt=[(e,t,n)=>{if("labels"in e&&e.labels&&e.labels.length>0)return H_(e.labels[0],t,n)},e=>{if(e.nodeName==="INPUT"){const t=e,n=t.getAttribute("type");if(n==="button"||n==="submit"||n==="reset")return{name:t.value,nameSource:"text_content"}}},(e,t,n)=>{if(e.nodeName==="BUTTON"||e.nodeName==="LABEL"||e.getAttribute("role")==="button")return H_(e,t,n)},(e,t,n)=>uv(e,"aria-label",t,n),(e,t,n)=>{const r=e.getAttribute("aria-labelledby");if(r)return{name:r.split(/\s+/).map(i=>ZCt(e,i)).filter(i=>!!i).map(i=>pke(i,t,n)).join(" "),nameSource:"text_content"}},(e,t,n)=>uv(e,"alt",t,n),(e,t,n)=>uv(e,"name",t,n),(e,t,n)=>uv(e,"title",t,n),(e,t,n)=>uv(e,"placeholder",t,n),(e,t,n)=>{if("options"in e&&e.options.length>0)return H_(e.options[0],t,n)}],FCt=[(e,t,n)=>H_(e,t,n)],qCt=10;function Ene(e,t,n,r){let i=e,a=0;for(;a<=qCt&&i&&i.nodeName!=="BODY"&&i.nodeName!=="HTML"&&i.nodeName!=="HEAD";){for(const o of t){const s=o(i,n,r);if(s){const{name:l,nameSource:u}=s,d=l&&l.trim();if(d)return{name:fke(dke(d)),nameSource:u}}}if(i.nodeName==="FORM")break;i=i.parentElement,a+=1}}function dke(e){return e.replace(/\s+/g," ")}function fke(e){return e.length>100?`${cB(e,100)} [...]`:e}function ZCt(e,t){return e.ownerDocument?e.ownerDocument.getElementById(t):null}function uv(e,t,n,r){const{enablePrivacyForActionName:i,defaultPrivacyLevel:a}=n;let o=e.getAttribute(t);if(o&&i){const s=lO(e,a,r);NCt(e.tagName,t,o,s,n)&&(o=uke(o,tke))}else o||(o="");return{name:o,nameSource:"standard_attribute"}}function H_(e,t,n){return{name:pke(e,t,n)||"",nameSource:"text_content"}}function pke(e,t,n){if(e.isContentEditable)return;const{enablePrivacyForActionName:r,actionNameAttribute:i,defaultPrivacyLevel:a}=t;if(Zw(Nc.USE_TREE_WALKER_FOR_ACTION_NAME))return HCt(e,i,r,a,n);if("innerText"in e){let o=e.innerText;const s=l=>{const u=e.querySelectorAll(l);for(let d=0;d<u.length;d+=1){const f=u[d];if("innerText"in f){const h=f.innerText;h&&h.trim().length>0&&(o=o.replace(h,""))}}};return s(`[${oO}]`),i&&s(`[${i}]`),r&&s(`${Ud(jt.HIDDEN)}, ${Ud(jt.MASK)}`),o}return e.textContent}function HCt(e,t,n,r,i){const a=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT,s);let o="";for(;a.nextNode();){const l=a.currentNode;if(iu(l)){(l.nodeName==="BR"||l.nodeName==="P"||["block","flex","grid","list-item","table","table-caption"].includes(getComputedStyle(l).display))&&(o+=" ");continue}o+=l.textContent||""}return o.replace(/\s+/g," ").trim();function s(l){const u=lO(l,r,i);if(n&&u&&oke(l,u))return NodeFilter.FILTER_REJECT;if(iu(l)){if(l.hasAttribute(oO)||t&&l.hasAttribute(t))return NodeFilter.FILTER_REJECT;const d=getComputedStyle(l);if(d.visibility!=="visible"||d.display==="none"||d.contentVisibility&&d.contentVisibility!=="visible")return NodeFilter.FILTER_REJECT}return NodeFilter.FILTER_ACCEPT}}function GCt(e,{onPointerDown:t,onPointerUp:n}){let r,i={selection:!1,input:!1,scroll:!1},a;const o=[Xn(e,window,"pointerdown",s=>{$ne(s)&&(r=Tne(),i={selection:!1,input:!1,scroll:!1},a=t(s))},{capture:!0}),Xn(e,window,"selectionchange",()=>{(!r||!Tne())&&(i.selection=!0)},{capture:!0}),Xn(e,window,"scroll",()=>{i.scroll=!0},{capture:!0,passive:!0}),Xn(e,window,"pointerup",s=>{if($ne(s)&&a){const l=i;n(a,s,()=>l),a=void 0}},{capture:!0}),Xn(e,window,"input",()=>{i.input=!0},{capture:!0})];return{stop:()=>{o.forEach(s=>s.stop())}}}function Tne(){const e=window.getSelection();return!e||e.isCollapsed}function $ne(e){return e.target instanceof Element&&e.isPrimary!==!1}const One=3;function KCt(e,t){if(WCt(e))return t.addFrustration(sv.RAGE_CLICK),e.some(Ane)&&t.addFrustration(sv.DEAD_CLICK),t.hasError&&t.addFrustration(sv.ERROR_CLICK),{isRage:!0};const n=e.some(r=>r.getUserActivity().selection);return e.forEach(r=>{r.hasError&&r.addFrustration(sv.ERROR_CLICK),Ane(r)&&!n&&r.addFrustration(sv.DEAD_CLICK)}),{isRage:!1}}function WCt(e){if(e.some(t=>t.getUserActivity().selection||t.getUserActivity().scroll))return!1;for(let t=0;t<e.length-(One-1);t+=1)if(e[t+One-1].event.timeStamp-e[t].event.timeStamp<=_i)return!0;return!1}const JCt='input:not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="range"]),textarea,select,[contenteditable],[contenteditable] *,canvas,a[href],a[href] *';function Ane(e){if(e.hasPageActivity||e.getUserActivity().input||e.getUserActivity().scroll)return!1;let t=e.event.target;return t.tagName==="LABEL"&&t.hasAttribute("for")&&(t=document.getElementById(t.getAttribute("for"))),!t||!t.matches(JCt)}const hke=10*_i,Yv=new Map;function YCt(e){const t=Yv.get(e);return Yv.delete(e),t}function mke(e,t){Yv.set(e,t),Yv.forEach((n,r)=>{fr(r,Ma())>hke&&Yv.delete(r)})}const XCt=5*Ji;function QCt(e,t,n,r){const i=Wg({expireDelay:XCt}),a=new Gt;let o;e.subscribe(10,()=>{i.reset()}),e.subscribe(5,u),e.subscribe(11,d=>{d.reason===Vh.UNLOADING&&u()});const{stop:s}=GCt(r,{onPointerDown:d=>eIt(r,e,t,d,n),onPointerUp:({clickActionBase:d,hadActivityOnPointerDown:f},h,m)=>{tIt(r,e,t,n,i,a,l,d,h,m,f)}});return{stop:()=>{u(),a.notify(),s()},actionContexts:{findActionId:d=>i.findAll(d)}};function l(d){if(!o||!o.tryAppend(d)){const f=d.clone();o=zCt(d,h=>{rIt(h,f)})}}function u(){o&&o.stop()}}function eIt(e,t,n,r,i){let a;if(e.enablePrivacyForActionName?a=lO(r.target,e.defaultPrivacyLevel):a=jt.ALLOW,a===jt.HIDDEN)return;const o=nIt(r,a,e);let s=!1;return SB(t,n,i,e,l=>{s=l.hadActivity},eke),{clickActionBase:o,hadActivityOnPointerDown:()=>s}}function tIt(e,t,n,r,i,a,o,s,l,u,d){var f;const h=gke(t,i,u,s,l);o(h);const m=(f=s==null?void 0:s.target)===null||f===void 0?void 0:f.selector;m&&mke(l.timeStamp,m);const{stop:v}=SB(t,n,r,e,x=>{x.hadActivity&&x.end<h.startClocks.timeStamp?h.discard():x.hadActivity?h.stop(x.end):d()?h.stop(h.startClocks.timeStamp):h.stop()},hke),y=t.subscribe(5,({endClocks:x})=>{h.stop(x.timeStamp)}),w=a.subscribe(()=>{h.stop()});h.stopObservable.subscribe(()=>{y.unsubscribe(),v(),w.unsubscribe()})}function nIt(e,t,n){const r=e.target.getBoundingClientRect(),i=Yw(e.target,n.actionNameAttribute);i&&mke(e.timeStamp,i);const{name:a,nameSource:o}=BCt(e.target,n,t);return{type:xB.CLICK,target:{width:Math.round(r.width),height:Math.round(r.height),selector:i},position:{x:Math.round(e.clientX-r.left),y:Math.round(e.clientY-r.top)},name:a,nameSource:o}}function gke(e,t,n,r,i){const a=wi(),o=Hr(),s=t.add(a,o.relative),l=XSe({lifeCycle:e,isChildEvent:v=>v.action!==void 0&&(Array.isArray(v.action.id)?v.action.id.includes(a):v.action.id===a)});let u=0,d;const f=[],h=new Gt;function m(v){u===0&&(d=v,u=1,d?s.close(uB(d)):s.remove(),l.stop(),h.notify())}return{event:i,stop:m,stopObservable:h,get hasError(){return l.eventCounts.errorCount>0},get hasPageActivity(){return d!==void 0},getUserActivity:n,addFrustration:v=>{f.push(v)},startClocks:o,isStopped:()=>u===1||u===2,clone:()=>gke(e,t,n,r,i),validate:v=>{if(m(),u!==1)return;const{resourceCount:y,errorCount:w,longTaskCount:x}=l.eventCounts,k={duration:d&&fr(o.timeStamp,d),startClocks:o,id:a,frustrationTypes:f,counts:{resourceCount:y,errorCount:w,longTaskCount:x},events:v??[i],event:i,...r};e.notify(0,k),u=2},discard:()=>{m(),u=2}}}function rIt(e,t){const{isRage:n}=KCt(e,t);n?(e.forEach(r=>r.discard()),t.stop(ii()),t.validate(e.map(r=>r.event))):(t.discard(),e.forEach(r=>r.validate()))}function iIt(e,t,n,r,i){const{unsubscribe:a}=e.subscribe(0,l=>{e.notify(12,Cne(l))});t.register(0,({startTime:l,eventType:u})=>{if(u!==Et.ERROR&&u!==Et.RESOURCE&&u!==Et.LONG_TASK)return Da;const d=o.findActionId(l);return d?{type:u,action:{id:d}}:Da}),t.register(1,({startTime:l})=>({action:{id:o.findActionId(l)}}));let o={findActionId:fn},s=fn;return i.trackUserInteractions&&({actionContexts:o,stop:s}=QCt(e,n,r,i)),{addAction:l=>{e.notify(12,Cne(l))},actionContexts:o,stop:()=>{a(),s()}}}function Cne(e){const t=k2(e)?{action:{id:e.id,loading_time:YSe(kt(e.duration)),frustration:{type:e.frustrationTypes},error:{count:e.counts.errorCount},long_task:{count:e.counts.longTaskCount},resource:{count:e.counts.resourceCount}},_dd:{action:{target:e.target,position:e.position,name_source:e.nameSource}}}:{context:e.context},n=ru({action:{id:wi(),target:{name:e.name},type:e.type},date:e.startClocks.timeStamp,type:Et.ACTION},t),r=k2(e)?e.duration:void 0,i=k2(e)?{events:e.events}:{handlingStack:e.handlingStack};return{rawRumEvent:n,duration:r,startTime:e.startClocks.relative,domainContext:i}}function k2(e){return e.type!==xB.CUSTOM}function aIt(e){const t=POt([H$.error]).subscribe(n=>e.notify(n.error));return{stop:()=>{t.unsubscribe()}}}function oIt(e,t){const n=g$t(e,[b0.cspViolation,b0.intervention]).subscribe(r=>t.notify(r));return{stop:()=>{n.unsubscribe()}}}function sIt(e,t,n){const r=new Gt;return n.subscribe(i=>{i.type===0&&r.notify(i.error)}),aIt(r),oIt(t,r),r.subscribe(i=>e.notify(14,{error:i})),lIt(e)}function lIt(e){return e.subscribe(14,({error:t})=>{e.notify(12,uIt(t))}),{addError:({error:t,handlingStack:n,componentStack:r,startClocks:i,context:a})=>{const o=mB({originalError:t,handlingStack:n,componentStack:r,startClocks:i,nonErrorPrefix:"Provided",source:Gg.CUSTOM,handling:"handled"});o.context=ru(o.context,a),e.notify(14,{error:o})}}}function uIt(e){const t={date:e.startClocks.timeStamp,error:{id:wi(),message:e.message,source:e.source,stack:e.stack,handling_stack:e.handlingStack,component_stack:e.componentStack,type:e.type,handling:e.handling,causes:e.causes,source_type:"browser",fingerprint:e.fingerprint,csp:e.csp},type:Et.ERROR,context:e.context},n={error:e.originalError,handlingStack:e.handlingStack};return{rawRumEvent:t,startTime:e.startClocks.relative,domainContext:n}}const Ine=new WeakSet;function cIt(e){if(!performance||!("getEntriesByName"in performance))return;const t=performance.getEntriesByName(e.url,"resource");if(!t.length||!("toJSON"in t[0]))return;const n=t.filter(r=>!Ine.has(r)).filter(r=>GSe(r)&&KSe(r)).filter(r=>dIt(r,e.startClocks.relative,yke({startTime:e.startClocks.relative,duration:e.duration})));if(n.length===1)return Ine.add(n[0]),n[0].toJSON()}function yke(e){return Hg(e.startTime,e.duration)}function dIt(e,t,n){return e.startTime>=t-1&&yke(e)<=Hg(n,1)}const fIt=2*Ji;function pIt(e){const t=hIt(e)||mIt(e);if(!(!t||t.traceTime<=Ki()-fIt))return t.traceId}function hIt(e){const t=e.querySelector("meta[name=dd-trace-id]"),n=e.querySelector("meta[name=dd-trace-time]");return vke(t&&t.content,n&&n.content)}function mIt(e){const t=gIt(e);if(t)return vke(y0(t,"trace-id"),y0(t,"trace-time"))}function vke(e,t){const n=t&&Number(t);if(!(!e||!n))return{traceId:e,traceTime:n}}function gIt(e){for(let t=0;t<e.childNodes.length;t+=1){const n=jne(e.childNodes[t]);if(n)return n}if(e.body)for(let t=e.body.childNodes.length-1;t>=0;t-=1){const n=e.body.childNodes[t],r=jne(n);if(r)return r;if(!gL(n))break}}function jne(e){if(e&&mCt(e)){const t=/^\s*DATADOG;(.*?)\s*$/.exec(e.data);if(t)return t[1]}}function bke(){if(rp(Jt.NAVIGATION)){const n=performance.getEntriesByType(Jt.NAVIGATION)[0];if(n)return n}const e=yIt(),t={entryType:Jt.NAVIGATION,initiatorType:"navigation",name:window.location.href,startTime:0,duration:e.loadEventEnd,decodedBodySize:0,encodedBodySize:0,transferSize:0,workerStart:0,toJSON:()=>({...t,toJSON:void 0}),...e};return t}function yIt(){const e={},t=performance.timing;for(const n in t)if(Fw(t[n])){const r=n,i=t[r];e[r]=i===0?0:uB(i)}return e}function vIt(e,t,n=bke){vB(e,"interactive",()=>{const r=n(),i=Object.assign(r.toJSON(),{entryType:Jt.RESOURCE,initiatorType:ZSe,duration:r.responseEnd,traceId:pIt(document),toJSON:()=>({...i,toJSON:void 0})});t(i)})}const bIt=1e3;function wIt(e){const t=new Set,n=e.subscribe(8,r=>{t.add(r),t.size>bIt&&(Jw("Too many requests"),t.delete(t.values().next().value))});return{getMatchingRequest(r){let i=1/0,a;for(const o of t){const s=r.startTime-o.startClocks.relative;0<=s&&s<i&&o.url===r.name&&(i=Math.abs(s),a=o)}return a&&t.delete(a),a},stop(){n.unsubscribe()}}}function xIt(e,t,n,r=ROt(),i=vIt){let a;const o=t.trackEarlyRequests;o?a=wIt(e):e.subscribe(8,u=>{l(()=>_It(u,t,n))});const s=Js(t,{type:Jt.RESOURCE,buffered:!0}).subscribe(u=>{for(const d of u)(o||!HSe(d))&&l(()=>Rne(d,t,n,a))});i(t,u=>{l(()=>Rne(u,t,n,a))});function l(u){r.push(()=>{const d=u();d&&e.notify(12,d)})}return{stop:()=>{r.stop(),s.unsubscribe()}}}function _It(e,t,n){const r=cIt(e);return wke(r,e,n,t)}function Rne(e,t,n,r){const i=HSe(e)&&r?r.getMatchingRequest(e):void 0;return wke(e,i,n,t)}function wke(e,t,n,r){if(!e&&!t)return;const i=t?TIt(t,r):$It(e,r);if(!r.trackResources&&!i)return;const a=e?J$(e.startTime):t.startClocks,o=e?GAt(e):OIt(n,a,t.duration),s=t&&SIt(t,r),l=ru({date:a.timeStamp,resource:{id:wi(),duration:kt(o),type:t?t.type===aO.XHR?Mi.XHR:Mi.FETCH:HAt(e),method:t?t.method:void 0,status_code:t?t.status:AIt(e.responseStatus),url:t?tCt(t.url):e.name,protocol:e&&JAt(e),delivery_type:e&&YAt(e),graphql:s},type:Et.RESOURCE,_dd:{discarded:!r.trackResources}},i,e&&EIt(e));return{startTime:a.relative,duration:o,rawRumEvent:l,domainContext:kIt(e,t)}}function SIt(e,t){const n=WSe(e.url,t);if(n)return rCt(e,n)}function kIt(e,t){if(t){const n={performanceEntry:e,isAborted:t.isAborted,handlingStack:t.handlingStack};return t.type===aO.XHR?{xhr:t.xhr,...n}:{requestInput:t.input,requestInit:t.init,response:t.response,error:t.error,...n}}return{performanceEntry:e}}function EIt(e){const{renderBlockingStatus:t}=e;return{resource:{render_blocking_status:t,...XAt(e),...KAt(e)}}}function TIt(e,t){if(e.traceSampled&&e.traceId&&e.spanId)return{_dd:{span_id:e.spanId.toString(),trace_id:e.traceId.toString(),rule_psr:t.rulePsr}}}function $It(e,t){if(e.traceId)return{_dd:{trace_id:e.traceId,span_id:BSe().toString(),rule_psr:t.rulePsr}}}function OIt(e,t,n){return e.wasInPageStateDuringPeriod("frozen",t.relative,n)?void 0:n}function AIt(e){return e===0?void 0:e}function CIt(e,t,n){const{stop:r,eventCounts:i}=XSe({lifeCycle:e,isChildEvent:a=>a.view.id===t,onChange:n});return{stop:r,eventCounts:i}}const IIt=10*Ji;function jIt(e,t,n){return{stop:Js(e,{type:Jt.PAINT,buffered:!0}).subscribe(r=>{const i=r.find(a=>a.name==="first-contentful-paint"&&a.startTime<t.timeStamp&&a.startTime<IIt);i&&n(i.startTime)}).unsubscribe}}function RIt(e,t){requestAnimationFrame(()=>{requestAnimationFrame(()=>{t(fr(e,Ma()))})})}function PIt(e,t,n){const r=Js(e,{type:Jt.FIRST_INPUT,buffered:!0}).subscribe(i=>{const a=i.find(o=>o.startTime<t.timeStamp);if(a){const o=fr(a.startTime,a.processingStart);let s;a.target&&iu(a.target)&&(s=Yw(a.target,e.actionNameAttribute)),n({delay:o>=0?o:0,time:a.startTime,targetSelector:s})}});return{stop:()=>{r.unsubscribe()}}}function NIt(e,t,n=bke){return zIt(e,()=>{const r=n();DIt(r)||t(MIt(r))})}function MIt(e){return{domComplete:e.domComplete,domContentLoaded:e.domContentLoadedEventEnd,domInteractive:e.domInteractive,loadEvent:e.loadEventEnd,firstByte:e.responseStart>=0&&e.responseStart<=Ma()?e.responseStart:void 0}}function DIt(e){return e.loadEventEnd<=0}function zIt(e,t){let n;const{stop:r}=vB(e,"complete",()=>{n=yi(()=>t())});return{stop:()=>{r(),ho(n)}}}const LIt=10*Ji;function UIt(e,t,n,r){let i=1/0;const{stop:a}=Mc(e,n,["pointerdown","keydown"],l=>{i=l.timeStamp},{capture:!0,once:!0});let o=0;const s=Js(e,{type:Jt.LARGEST_CONTENTFUL_PAINT,buffered:!0}).subscribe(l=>{const u=U_e(l,d=>d.entryType===Jt.LARGEST_CONTENTFUL_PAINT&&d.startTime<i&&d.startTime<t.timeStamp&&d.startTime<LIt&&d.size>o);if(u){let d;u.element&&(d=Yw(u.element,e.actionNameAttribute)),r({value:u.startTime,targetSelector:d,resourceUrl:BIt(u)}),o=u.size}});return{stop:()=>{a(),s.unsubscribe()}}}function BIt(e){return e.url===""?void 0:e.url}function xke(e,t,n=window){if(document.visibilityState==="hidden")return{timeStamp:0,stop:fn};if(rp(Jt.VISIBILITY_STATE)){const a=performance.getEntriesByType(Jt.VISIBILITY_STATE).filter(o=>o.name==="hidden").find(o=>o.startTime>=t.relative);if(a)return{timeStamp:a.startTime,stop:fn}}let r=1/0;const{stop:i}=Mc(e,n,["pagehide","visibilitychange"],a=>{(a.type==="pagehide"||document.visibilityState==="hidden")&&(r=a.timeStamp,i())},{capture:!0});return{get timeStamp(){return r},stop:i}}function VIt(e,t,n,r){const i={},{stop:a}=NIt(e,f=>{n(f.loadEvent),i.navigationTimings=f,r()}),o=xke(e,t),{stop:s}=jIt(e,o,f=>{i.firstContentfulPaint=f,r()}),{stop:l}=UIt(e,o,window,f=>{i.largestContentfulPaint=f,r()}),{stop:u}=PIt(e,o,f=>{i.firstInput=f,r()});function d(){a(),s(),l(),u(),o.stop()}return{stop:d,initialViewMetrics:i}}const yL=(e,t)=>e*t,FIt=(e,t)=>{const n=Math.max(e.left,t.left),r=Math.max(e.top,t.top),i=Math.min(e.right,t.right),a=Math.min(e.bottom,t.bottom);return n>=i||r>=a?0:yL(i-n,a-r)},Pne=e=>{const t=yL(e.previousRect.width,e.previousRect.height),n=yL(e.currentRect.width,e.currentRect.height),r=FIt(e.previousRect,e.currentRect);return t+n-r};function qIt(e,t,n){if(!WIt())return{stop:fn};let r=0,i;n({value:0});const a=KIt(),o=Js(e,{type:Jt.LAYOUT_SHIFT,buffered:!0}).subscribe(s=>{var l;for(const u of s){if(u.hadRecentInput||u.startTime<t)continue;const{cumulatedValue:d,isMaxValue:f}=a.update(u);if(f){const h=ZIt(u.sources);i={target:h!=null&&h.node?new WeakRef(h.node):void 0,time:fr(t,u.startTime),previousRect:h==null?void 0:h.previousRect,currentRect:h==null?void 0:h.currentRect,devicePixelRatio:window.devicePixelRatio}}if(d>r){r=d;const h=(l=i==null?void 0:i.target)===null||l===void 0?void 0:l.deref();n({value:Wv(r,4),targetSelector:h&&Yw(h,e.actionNameAttribute),time:i==null?void 0:i.time,previousRect:i!=null&&i.previousRect?Nne(i.previousRect):void 0,currentRect:i!=null&&i.currentRect?Nne(i.currentRect):void 0,devicePixelRatio:i==null?void 0:i.devicePixelRatio})}}});return{stop:()=>{o.unsubscribe()}}}function ZIt(e){let t;for(const n of e)if(n.node&&iu(n.node)){const r=Pne(n);(!t||Pne(t)<r)&&(t=n)}return t}function Nne({x:e,y:t,width:n,height:r}){return{x:e,y:t,width:n,height:r}}const HIt=5*_i,GIt=_i;function KIt(){let e=0,t,n,r=0;return{update:i=>{const a=t===void 0||i.startTime-n>=GIt||i.startTime-t>=HIt;let o;return a?(t=n=i.startTime,r=e=i.value,o=!0):(e+=i.value,n=i.startTime,o=i.value>r,o&&(r=i.value)),{cumulatedValue:e,isMaxValue:o}}}}function WIt(){return rp(Jt.LAYOUT_SHIFT)&&"WeakRef"in window}let G_,_ke=0,E2=1/0,T2=0;function JIt(){"interactionCount"in performance||G_||(G_=new window.PerformanceObserver($t(e=>{e.getEntries().forEach(t=>{const n=t;n.interactionId&&(E2=Math.min(E2,n.interactionId),T2=Math.max(T2,n.interactionId),_ke=(T2-E2)/7+1)})})),G_.observe({type:"event",buffered:!0,durationThreshold:0}))}const Mne=()=>G_?_ke:window.performance.interactionCount||0,Dne=10,YIt=1*Ji;function XIt(e,t,n){if(!tjt())return{getInteractionToNextPaint:()=>{},setViewEnd:fn,stop:fn};const{getViewInteractionCount:r,stopViewInteractionCount:i}=ejt(n);let a=1/0;const o=QIt(r);let s=-1,l,u;function d(m){for(const y of m)y.interactionId&&y.startTime>=t&&y.startTime<=a&&o.process(y);const v=o.estimateP98Interaction();v&&v.duration!==s&&(s=v.duration,u=fr(t,v.startTime),l=YCt(v.startTime),!l&&v.target&&iu(v.target)&&(l=Yw(v.target,e.actionNameAttribute)))}const f=Js(e,{type:Jt.FIRST_INPUT,buffered:!0}).subscribe(d),h=Js(e,{type:Jt.EVENT,durationThreshold:40,buffered:!0}).subscribe(d);return{getInteractionToNextPaint:()=>{if(s>=0)return{value:Math.min(s,YIt),targetSelector:l,time:u};if(r())return{value:0}},setViewEnd:m=>{a=m,i()},stop:()=>{h.unsubscribe(),f.unsubscribe()}}}function QIt(e){const t=[];function n(){t.sort((r,i)=>i.duration-r.duration).splice(Dne)}return{process(r){const i=t.findIndex(o=>r.interactionId===o.interactionId),a=t[t.length-1];i!==-1?r.duration>t[i].duration&&(t[i]=r,n()):(t.length<Dne||r.duration>a.duration)&&(t.push(r),n())},estimateP98Interaction(){const r=Math.min(t.length-1,Math.floor(e()/50));return t[r]}}}function ejt(e){JIt();const t=e===Ml.INITIAL_LOAD?0:Mne();let n={stopped:!1};function r(){return Mne()-t}return{getViewInteractionCount:()=>n.stopped?n.interactionCount:r(),stopViewInteractionCount:()=>{n={stopped:!0,interactionCount:r()}}}}function tjt(){return rp(Jt.EVENT)&&window.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype}function njt(e,t,n,r,i,a,o){let s=i===Ml.INITIAL_LOAD,l=!0;const u=[],d=xke(r,a);function f(){if(!l&&!s&&u.length>0){const m=Math.max(...u);m<d.timeStamp-a.relative&&o(m)}}const{stop:h}=SB(e,t,n,r,m=>{l&&(l=!1,m.hadActivity&&u.push(fr(a.timeStamp,m.end)),f())});return{stop:()=>{h(),d.stop()},setLoadEvent:m=>{s&&(s=!1,u.push(m),f())}}}function s3t(){let e;const t=window.visualViewport;return t?e=t.pageLeft-t.offsetLeft:window.scrollX!==void 0?e=window.scrollX:e=window.pageXOffset||0,Math.round(e)}function rjt(){let e;const t=window.visualViewport;return t?e=t.pageTop-t.offsetTop:window.scrollY!==void 0?e=window.scrollY:e=window.pageYOffset||0,Math.round(e)}let $2;function ijt(e){return $2||($2=ajt(e)),$2}function ajt(e){return new Gt(t=>{const{throttled:n}=Y$(()=>{t.notify(kB())},200);return Xn(e,window,"resize",n,{capture:!0,passive:!0}).stop})}function kB(){const e=window.visualViewport;return e?{width:Number(e.width*e.scale),height:Number(e.height*e.scale)}:{width:Number(window.innerWidth||0),height:Number(window.innerHeight||0)}}const ojt=_i;function sjt(e,t,n,r=ujt(e)){let i=0,a=0,o=0;const s=r.subscribe(({scrollDepth:l,scrollTop:u,scrollHeight:d})=>{let f=!1;if(l>i&&(i=l,f=!0),d>a){a=d;const h=Ma();o=fr(t.relative,h),f=!0}f&&n({maxDepth:Math.min(i,a),maxDepthScrollTop:u,maxScrollHeight:a,maxScrollHeightTime:o})});return{stop:()=>s.unsubscribe()}}function ljt(){const e=rjt(),{height:t}=kB(),n=Math.round((document.scrollingElement||document.documentElement).scrollHeight),r=Math.round(t+e);return{scrollHeight:n,scrollDepth:r,scrollTop:e}}function ujt(e,t=ojt){return new Gt(n=>{function r(){n.notify(ljt())}if(window.ResizeObserver){const i=Y$(r,t,{leading:!1,trailing:!0}),a=document.scrollingElement||document.documentElement,o=new ResizeObserver($t(i.throttled));a&&o.observe(a);const s=Xn(e,window,"scroll",i.throttled,{passive:!0});return()=>{i.cancel(),o.disconnect(),s.stop()}}})}function cjt(e,t,n,r,i,a,o){const s={},{stop:l,setLoadEvent:u}=njt(e,t,n,r,a,o,y=>{s.loadingTime=y,i()}),{stop:d}=sjt(r,o,y=>{s.scroll=y}),{stop:f}=qIt(r,o.relative,y=>{s.cumulativeLayoutShift=y,i()}),{stop:h,getInteractionToNextPaint:m,setViewEnd:v}=XIt(r,o.relative,a);return{stop:()=>{l(),f(),d()},stopINPTracking:h,setLoadEvent:u,setViewEnd:v,getCommonViewMetrics:()=>(s.interactionToNextPaint=m(),s)}}function djt(e,t){const{stop:n}=Xn(e,window,"pageshow",r=>{r.persisted&&t(r)},{capture:!0});return n}function fjt(e,t,n){RIt(e.relative,r=>{t.firstContentfulPaint=r,t.largestContentfulPaint={value:r},n()})}const pjt=3e3,hjt=5*Ji,mjt=5*Ji;function gjt(e,t,n,r,i,a,o,s){const l=new Set;let u=h(Ml.INITIAL_LOAD,M_e(),s),d;m();let f;o&&(f=v(a),i.trackBfcacheViews&&(d=djt(i,y=>{u.end();const w=J$(y.timeStamp);u=h(Ml.BF_CACHE,w,void 0)})));function h(y,w,x){const k=yjt(t,n,r,i,e,y,w,x);return l.add(k),k.stopObservable.subscribe(()=>{l.delete(k)}),k}function m(){t.subscribe(10,()=>{u=h(Ml.ROUTE_CHANGE,void 0,{name:u.name,service:u.service,version:u.version,context:u.contextManager.getContext()})}),t.subscribe(9,()=>{u.end({sessionIsActive:!1})})}function v(y){return y.subscribe(({oldLocation:w,newLocation:x})=>{bjt(w,x)&&(u.end(),u=h(Ml.ROUTE_CHANGE))})}return{addTiming:(y,w=ii())=>{u.addTiming(y,w)},startView:(y,w)=>{u.end({endClocks:w}),u=h(Ml.ROUTE_CHANGE,w,y)},setViewContext:y=>{u.contextManager.setContext(y)},setViewContextProperty:(y,w)=>{u.contextManager.setContextProperty(y,w)},setViewName:y=>{u.setViewName(y)},getViewContext:()=>u.contextManager.getContext(),stop:()=>{f&&f.unsubscribe(),d&&d(),u.end(),l.forEach(y=>y.stop())}}}function yjt(e,t,n,r,i,a,o=Hr(),s){const l=wi(),u=new Gt,d={};let f=0,h;const m=g0(i),v=iO();let y=!0,w=s==null?void 0:s.name;const x=(s==null?void 0:s.service)||r.service,k=(s==null?void 0:s.version)||r.version,S=s==null?void 0:s.context;S&&v.setContext(S);const E={id:l,name:w,startClocks:o,service:x,version:k,context:S};e.notify(1,E),e.notify(2,E);const{throttled:C,cancel:A}=Y$(z,pjt,{leading:!1}),{setLoadEvent:I,setViewEnd:j,stop:N,stopINPTracking:P,getCommonViewMetrics:M}=cjt(e,t,n,r,ne,a,o),{stop:B,initialViewMetrics:K}=a===Ml.INITIAL_LOAD?VIt(r,o,I,ne):{stop:fn,initialViewMetrics:{}};a===Ml.BF_CACHE&&fjt(o,K,ne);const{stop:Z,eventCounts:W}=CIt(e,l,ne),U=Zg(z,hjt),G=e.subscribe(11,V=>{V.reason===Vh.UNLOADING&&z()});z(),v.changeObservable.subscribe(ne);function J(){e.notify(3,{id:l,name:w,context:v.getContext(),startClocks:o,sessionIsActive:y})}function ne(){J(),C()}function z(){A(),J(),f+=1;const V=h===void 0?ii():h.timeStamp;e.notify(4,{customTimings:d,documentVersion:f,id:l,name:w,service:x,version:k,context:v.getContext(),loadingType:a,location:m,startClocks:o,commonViewMetrics:M(),initialViewMetrics:K,duration:fr(o.timeStamp,V),isActive:h===void 0,sessionIsActive:y,eventCounts:W})}return{get name(){return w},service:x,version:k,contextManager:v,stopObservable:u,end(V={}){var Y,D;h||(h=(Y=V.endClocks)!==null&&Y!==void 0?Y:Hr(),y=(D=V.sessionIsActive)!==null&&D!==void 0?D:!0,e.notify(5,{endClocks:h}),e.notify(6,{endClocks:h}),W$(U),j(h.relative),N(),G.unsubscribe(),z(),yi(()=>{this.stop()},mjt))},stop(){B(),Z(),P(),u.notify()},addTiming(V,Y){if(h)return;const D=PEt(Y)?Y:fr(o.timeStamp,Y);d[vjt(V)]=D,ne()},setViewName(V){w=V,z()}}}function vjt(e){const t=e.replace(/[^a-zA-Z0-9-_.@$]/g,"_");return t!==e&&xt.warn(`Invalid timing name: ${e}, sanitized to: ${t}`),t}function bjt(e,t){return e.pathname!==t.pathname||!wjt(t.hash)&&zne(t.hash)!==zne(e.hash)}function wjt(e){const t=e.substring(1);return t!==""&&!!document.getElementById(t)}function zne(e){const t=e.indexOf("?");return t<0?e:e.slice(0,t)}function xjt(e,t,n,r,i,a,o,s,l,u){return e.subscribe(4,d=>e.notify(12,_jt(d,n,s))),t.register(0,({startTime:d,eventType:f})=>{const h=l.findView(d);return h?{type:f,service:h.service,version:h.version,context:h.context,view:{id:h.id,name:h.name}}:Dc}),t.register(1,({startTime:d})=>{var f;return{view:{id:(f=l.findView(d))===null||f===void 0?void 0:f.id}}}),gjt(r,e,i,a,n,o,!n.trackViewsManually,u)}function _jt(e,t,n){var r,i,a,o,s,l,u,d,f,h,m,v,y,w,x,k,S,E;const C=n.getReplayStats(e.id),A=(i=(r=e.commonViewMetrics)===null||r===void 0?void 0:r.cumulativeLayoutShift)===null||i===void 0?void 0:i.devicePixelRatio,I={_dd:{document_version:e.documentVersion,replay_stats:C,cls:A?{device_pixel_ratio:A}:void 0,configuration:{start_session_replay_recording_manually:t.startSessionReplayRecordingManually}},date:e.startClocks.timeStamp,type:Et.VIEW,view:{action:{count:e.eventCounts.actionCount},frustration:{count:e.eventCounts.frustrationCount},cumulative_layout_shift:(a=e.commonViewMetrics.cumulativeLayoutShift)===null||a===void 0?void 0:a.value,cumulative_layout_shift_time:kt((o=e.commonViewMetrics.cumulativeLayoutShift)===null||o===void 0?void 0:o.time),cumulative_layout_shift_target_selector:(s=e.commonViewMetrics.cumulativeLayoutShift)===null||s===void 0?void 0:s.targetSelector,first_byte:kt((l=e.initialViewMetrics.navigationTimings)===null||l===void 0?void 0:l.firstByte),dom_complete:kt((u=e.initialViewMetrics.navigationTimings)===null||u===void 0?void 0:u.domComplete),dom_content_loaded:kt((d=e.initialViewMetrics.navigationTimings)===null||d===void 0?void 0:d.domContentLoaded),dom_interactive:kt((f=e.initialViewMetrics.navigationTimings)===null||f===void 0?void 0:f.domInteractive),error:{count:e.eventCounts.errorCount},first_contentful_paint:kt(e.initialViewMetrics.firstContentfulPaint),first_input_delay:kt((h=e.initialViewMetrics.firstInput)===null||h===void 0?void 0:h.delay),first_input_time:kt((m=e.initialViewMetrics.firstInput)===null||m===void 0?void 0:m.time),first_input_target_selector:(v=e.initialViewMetrics.firstInput)===null||v===void 0?void 0:v.targetSelector,interaction_to_next_paint:kt((y=e.commonViewMetrics.interactionToNextPaint)===null||y===void 0?void 0:y.value),interaction_to_next_paint_time:kt((w=e.commonViewMetrics.interactionToNextPaint)===null||w===void 0?void 0:w.time),interaction_to_next_paint_target_selector:(x=e.commonViewMetrics.interactionToNextPaint)===null||x===void 0?void 0:x.targetSelector,is_active:e.isActive,name:e.name,largest_contentful_paint:kt((k=e.initialViewMetrics.largestContentfulPaint)===null||k===void 0?void 0:k.value),largest_contentful_paint_target_selector:(S=e.initialViewMetrics.largestContentfulPaint)===null||S===void 0?void 0:S.targetSelector,load_event:kt((E=e.initialViewMetrics.navigationTimings)===null||E===void 0?void 0:E.loadEvent),loading_time:YSe(kt(e.commonViewMetrics.loadingTime)),loading_type:e.loadingType,long_task:{count:e.eventCounts.longTaskCount},performance:Sjt(e.commonViewMetrics,e.initialViewMetrics),resource:{count:e.eventCounts.resourceCount},time_spent:kt(e.duration)},display:e.commonViewMetrics.scroll?{scroll:{max_depth:e.commonViewMetrics.scroll.maxDepth,max_depth_scroll_top:e.commonViewMetrics.scroll.maxDepthScrollTop,max_scroll_height:e.commonViewMetrics.scroll.maxScrollHeight,max_scroll_height_time:kt(e.commonViewMetrics.scroll.maxScrollHeightTime)}}:void 0,privacy:{replay_level:t.defaultPrivacyLevel},device:{locale:navigator.language,locales:navigator.languages,time_zone:WOt()}};return ed(e.customTimings)||(I.view.custom_timings=C_e(e.customTimings,kt)),{rawRumEvent:I,startTime:e.startClocks.relative,duration:e.duration,domainContext:{location:e.location}}}function Sjt({cumulativeLayoutShift:e,interactionToNextPaint:t},{firstContentfulPaint:n,firstInput:r,largestContentfulPaint:i}){return{cls:e&&{score:e.value,timestamp:kt(e.time),target_selector:e.targetSelector,previous_rect:e.previousRect,current_rect:e.currentRect},fcp:n&&{timestamp:kt(n)},fid:r&&{duration:kt(r.delay),timestamp:kt(r.time),target_selector:r.targetSelector},inp:t&&{duration:kt(t.value),timestamp:kt(t.time),target_selector:t.targetSelector},lcp:i&&{timestamp:kt(i.value),target_selector:i.targetSelector,resource_url:i.resourceUrl}}}const kjt="rum";function Ejt(e,t,n){const r=uOt(e,kjt,i=>$jt(e,i),n);return r.expireObservable.subscribe(()=>{t.notify(9)}),r.renewObservable.subscribe(()=>{t.notify(10)}),r.sessionStateUpdateObservable.subscribe(({previousState:i,newState:a})=>{if(!i.forcedReplay&&a.forcedReplay){const o=r.findSession();o&&(o.isReplayForced=!0)}}),{findTrackedSession:i=>{const a=r.findSession(i);if(!(!a||a.trackingType==="0"))return{id:a.id,sessionReplay:a.trackingType==="1"?1:a.isReplayForced?2:0,anonymousId:a.anonymousId}},expire:r.expire,expireObservable:r.expireObservable,setForcedReplay:()=>r.updateSessionState({forcedReplay:"1"})}}function Tjt(){const e={id:"00000000-aaaa-0000-aaaa-000000000000",sessionReplay:_Se("records")?1:0};return{findTrackedSession:()=>e,expire:fn,expireObservable:new Gt,setForcedReplay:fn}}function $jt(e,t){return Ojt(t)?t:Xd(e.sessionSampleRate)?Xd(e.sessionReplaySampleRate)?"1":"2":"0"}function Ojt(e){return e==="0"||e==="1"||e==="2"}function Ajt(e,t,n,r,i,a){const o=[e.rumEndpointBuilder];e.replica&&o.push(e.replica.rumEndpointBuilder);const s=SSe({encoder:a(2),request:xSe(o,n),flushController:kSe({pageMayExitObservable:r,sessionExpireObservable:i})});return t.subscribe(13,l=>{l.type===Et.VIEW?s.upsert(l,l.view.id):s.add(l)}),s}function Cjt(e){const t=Ww();e.subscribe(13,n=>{t.send("rum",n)})}const Ijt=Qf;function jjt(e,t,n,r){const i=Wg({expireDelay:Ijt});let a;e.subscribe(1,({startClocks:l})=>{const u=r.href;i.add(s({url:u,referrer:a||document.referrer}),l.relative),a=u}),e.subscribe(6,({endClocks:l})=>{i.closeActive(l.relative)});const o=n.subscribe(({newLocation:l})=>{const u=i.find();if(u){const d=Ma();i.closeActive(d),i.add(s({url:l.href,referrer:u.referrer}),d)}});function s({url:l,referrer:u}){return{url:l,referrer:u}}return t.register(0,({startTime:l,eventType:u})=>{const d=i.find(l);return d?{type:u,view:{url:d.url,referrer:d.referrer}}:Dc}),{findUrl:l=>i.find(l),stop:()=>{o.unsubscribe(),i.stop()}}}function Rjt(e,t){let n=g0(t);return new Gt(r=>{const{stop:i}=Pjt(e,o),{stop:a}=Njt(e,o);function o(){if(n.href===t.href)return;const s=g0(t);r.notify({newLocation:s,oldLocation:n}),n=s}return()=>{i(),a()}})}function Pjt(e,t){const{stop:n}=Vs(Lne("pushState"),"pushState",({onPostCall:a})=>{a(t)}),{stop:r}=Vs(Lne("replaceState"),"replaceState",({onPostCall:a})=>{a(t)}),{stop:i}=Xn(e,window,"popstate",t);return{stop:()=>{n(),r(),i()}}}function Njt(e,t){return Xn(e,window,"hashchange",t)}function Lne(e){return Object.prototype.hasOwnProperty.call(history,e)?history:History.prototype}const Mjt=Qf;function Djt(e,t,n){const r=Wg({expireDelay:Mjt});return e.subscribe(1,({startClocks:i})=>{r.add({},i.relative)}),e.subscribe(6,({endClocks:i})=>{r.closeActive(i.relative)}),t.register(0,({startTime:i,eventType:a})=>{if(!n.trackFeatureFlagsForEvents.concat([Et.VIEW,Et.ERROR]).includes(a))return Da;const o=r.find(i);return!o||ed(o)?Da:{type:a,feature_flags:o}}),{addFeatureFlagEvaluation:(i,a)=>{const o=r.find();o&&(o[i]=a)}}}const zjt=10*_i;let Fh,g_;function Ljt(e,t,n){e.metricsEnabled&&(Ske(),g_=!1,t.subscribe(13,()=>{g_=!0}),n.subscribe(({bytesCount:r,messagesCount:i})=>{g_&&(g_=!1,Fh.batchCount+=1,Bne(Fh.batchBytesCount,r),Bne(Fh.batchMessagesCount,i))}),Zg(Ujt,zjt))}function Ujt(){Fh.batchCount!==0&&(rO("Customer data measures",Fh),Ske())}function Une(){return{min:1/0,max:0,sum:0}}function Bne(e,t){e.sum+=t,e.min=Math.min(e.min,t),e.max=Math.max(e.max,t)}function Ske(){Fh={batchCount:0,batchBytesCount:Une(),batchMessagesCount:Une()}}const Bjt=4e3,Vjt=500,Fjt=Qf;function qjt(e,t,n=Vjt){const r=Wg({expireDelay:Fjt,maxEntries:Bjt});let i;rp(Jt.VISIBILITY_STATE)&&performance.getEntriesByType(Jt.VISIBILITY_STATE).forEach(l=>{const u=l.name==="hidden"?"hidden":"active";o(u,l.startTime)}),o(kke(),Ma());const{stop:a}=Mc(t,window,["pageshow","focus","blur","visibilitychange","resume","freeze","pagehide"],l=>{o(Hjt(l),l.timeStamp)},{capture:!0});function o(l,u=Ma()){l!==i&&(i=l,r.closeActive(u),r.add({state:i,startTime:u},u))}function s(l,u,d){return r.findAll(u,d).some(f=>f.state===l)}return e.register(0,({startTime:l,duration:u=0,eventType:d})=>{if(d===Et.VIEW){const f=r.findAll(l,u);return{type:d,_dd:{page_states:Zjt(f,l,n)}}}return d===Et.ACTION||d===Et.ERROR?{type:d,view:{in_foreground:s("active",l,0)}}:Da}),{wasInPageStateDuringPeriod:s,addPageState:o,stop:()=>{a(),r.stop()}}}function Zjt(e,t,n){if(e.length!==0)return e.slice(-n).reverse().map(({state:r,startTime:i})=>({state:r,start:kt(fr(t,i))}))}function Hjt(e){return e.type==="freeze"?"frozen":e.type==="pagehide"?e.persisted?"frozen":"terminated":kke()}function kke(){return document.visibilityState==="hidden"?"hidden":document.hasFocus()?"active":"passive"}function Gjt(e,t){let n;const r=requestAnimationFrame($t(()=>{n=kB()})),i=ijt(t).subscribe(a=>{n=a}).unsubscribe;return e.register(0,({eventType:a})=>({type:a,display:n?{viewport:n}:void 0})),{stop:()=>{i(),r&&cancelAnimationFrame(r)}}}function Kjt(e,t){const n=window.cookieStore?Wjt(e):Yjt;return new Gt(r=>n(t,i=>r.notify(i)))}function Wjt(e){return(t,n)=>Xn(e,window.cookieStore,"change",r=>{const i=r.changed.find(a=>a.name===t)||r.deleted.find(a=>a.name===t);i&&n(i.value)}).stop}const Jjt=_i;function Yjt(e,t){const n=y0(document.cookie,e),r=Zg(()=>{const i=y0(document.cookie,e);i!==n&&t(i)},Jjt);return()=>{W$(r)}}const Vne="datadog-ci-visibility-test-execution-id";function Xjt(e,t,n=Kjt(e,Vne)){var r;let i=fc(Vne)||((r=window.Cypress)===null||r===void 0?void 0:r.env("traceId"));const a=n.subscribe(o=>{i=o});return t.register(0,({eventType:o})=>typeof i!="string"?Da:{type:o,session:{type:"ci_test"},ci_test:{test_execution_id:i}}),{stop:()=>{a.unsubscribe()}}}function Qjt(e,t){const n=Js(t,{type:Jt.LONG_ANIMATION_FRAME,buffered:!0}).subscribe(r=>{for(const i of r){const a=J$(i.startTime),o={date:a.timeStamp,long_task:{id:wi(),entry_type:MSe.LONG_ANIMATION_FRAME,duration:kt(i.duration),blocking_duration:kt(i.blockingDuration),first_ui_event_timestamp:kt(i.firstUIEventTimestamp),render_start:kt(i.renderStart),style_and_layout_start:kt(i.styleAndLayoutStart),start_time:kt(i.startTime),scripts:i.scripts.map(s=>({duration:kt(s.duration),pause_duration:kt(s.pauseDuration),forced_style_and_layout_duration:kt(s.forcedStyleAndLayoutDuration),start_time:kt(s.startTime),execution_start:kt(s.executionStart),source_url:s.sourceURL,source_function_name:s.sourceFunctionName,source_char_position:s.sourceCharPosition,invoker:s.invoker,invoker_type:s.invokerType,window_attribution:s.windowAttribution}))},type:Et.LONG_TASK,_dd:{discarded:!1}};e.notify(12,{rawRumEvent:o,startTime:a.relative,duration:i.duration,domainContext:{performanceEntry:i}})}});return{stop:()=>n.unsubscribe()}}function eRt(e,t){const n=Js(t,{type:Jt.LONG_TASK,buffered:!0}).subscribe(r=>{for(const i of r){if(i.entryType!==Jt.LONG_TASK||!t.trackLongTasks)break;const a=J$(i.startTime),o={date:a.timeStamp,long_task:{id:wi(),entry_type:MSe.LONG_TASK,duration:kt(i.duration)},type:Et.LONG_TASK,_dd:{discarded:!1}};e.notify(12,{rawRumEvent:o,startTime:a.relative,duration:i.duration,domainContext:{performanceEntry:i}})}});return{stop(){n.unsubscribe()}}}function tRt(e){e.register(0,({eventType:t})=>{if(!ASe())return Da;const n=$Se(),r=OSe();return{type:t,session:{type:"synthetics"},synthetics:{test_id:n,result_id:r,injected:TSe()}}})}function nRt(e,t,n){const r=gB(e),i=n(r);return fB(t).forEach(([a,o])=>vL(e,r,a.split(/\.|(?=\[\])/),o)),i}function vL(e,t,n,r){const[i,...a]=n;if(i==="[]"){Array.isArray(e)&&Array.isArray(t)&&e.forEach((o,s)=>vL(o,t[s],a,r));return}if(!(!Fne(e)||!Fne(t))){if(a.length>0)return vL(e[i],t[i],a,r);rRt(e,i,t[i],r)}}function rRt(e,t,n,r){const i=ep(n);i===r?e[t]=Un(n):r==="object"&&(i==="undefined"||i==="null")&&(e[t]={})}function Fne(e){return ep(e)==="object"}const sh={"view.name":"string","view.url":"string","view.referrer":"string"},lh={context:"object"},uh={service:"string",version:"string"};let Eke;function iRt(e,t,n,r,i){Eke={[Et.VIEW]:{"view.performance.lcp.resource_url":"string",...lh,...sh,...uh},[Et.ERROR]:{"error.message":"string","error.stack":"string","error.resource.url":"string","error.fingerprint":"string",...lh,...sh,...uh},[Et.RESOURCE]:{"resource.url":"string","resource.graphql.variables":"string",...lh,...sh,...uh},[Et.ACTION]:{"action.target.name":"string",...lh,...sh,...uh},[Et.LONG_TASK]:{"long_task.scripts[].source_url":"string","long_task.scripts[].invoker":"string",...lh,...sh,...uh},[Et.VITAL]:{...lh,...sh,...uh}};const a={[Et.ERROR]:g2(Et.ERROR,r,i),[Et.ACTION]:g2(Et.ACTION,r,i),[Et.VITAL]:g2(Et.VITAL,r,i)};t.subscribe(12,({startTime:o,duration:s,rawRumEvent:l,domainContext:u})=>{const d=n.triggerHook(0,{eventType:l.type,startTime:o,duration:s});if(d===Dc)return;const f=ru(d,l,{ddtags:dSe(e).join(",")});aRt(f,e.beforeSend,u,a)&&(ed(f.context)&&delete f.context,t.notify(13,f))})}function aRt(e,t,n,r){var i;if(t){const a=nRt(e,Eke[e.type],o=>t(o,n));if(a===!1&&e.type!==Et.VIEW)return!1;a===!1&&xt.warn("Can't dismiss view events using beforeSend!")}return!(!((i=r[e.type])===null||i===void 0)&&i.isLimitReached())}function oRt(e,t,n,r){e.register(0,({eventType:i,startTime:a})=>{const o=t.findTrackedSession(a),s=r.findView(a);if(!o||!s)return Dc;let l,u,d;return i===Et.VIEW?(l=n.getReplayStats(s.id)?!0:void 0,u=o.sessionReplay===1,d=s.sessionIsActive?void 0:!1):l=n.isRecording()?!0:void 0,{type:i,session:{id:o.id,type:"user",has_replay:l,sampled_for_replay:u,is_active:d}}}),e.register(1,({startTime:i})=>{const a=t.findTrackedSession(i);return a?{session:{id:a.id}}:Da})}function sRt(e){e.register(0,({eventType:t})=>({type:t,connectivity:pSe()}))}function lRt(e,t,n){e.register(0,({eventType:r})=>{const i=t.source;return{type:r,_dd:{format_version:2,drift:jEt(),configuration:{session_sample_rate:Wv(t.sessionSampleRate,3),session_replay_sample_rate:Wv(t.sessionReplaySampleRate,3),profiling_sample_rate:Wv(t.profilingSampleRate,3),beta_encode_cookie_options:t.betaEncodeCookieOptions},browser_sdk_version:og()?"6.24.1":void 0,sdk_name:n},application:{id:t.applicationId},date:ii(),source:i}}),e.register(1,()=>({application:{id:t.applicationId}}))}function uRt(e,t){e.register(1,()=>t.isGranted()?Da:Dc)}const cRt=F$t,dRt=[Et.ACTION,Et.ERROR,Et.LONG_TASK,Et.RESOURCE,Et.VITAL];function fRt(e){return{addEvent:(t,n,r,i)=>{dRt.includes(n.type)&&e.notify(12,{startTime:t,rawRumEvent:n,domainContext:r,duration:i})}}}function pRt(e,t){if(!t.metricsEnabled)return{stop:fn};const{unsubscribe:n}=e.subscribe(4,({initialViewMetrics:r})=>{!r.largestContentfulPaint||!r.navigationTimings||(rO("Initial view metrics",{metrics:hRt(r.largestContentfulPaint,r.navigationTimings)}),n())});return{stop:n}}function hRt(e,t){return{lcp:{value:e.value},navigation:{domComplete:t.domComplete,domContentLoaded:t.domContentLoaded,domInteractive:t.domInteractive,firstByte:t.firstByte,loadEvent:t.loadEvent}}}function mRt(e,t,n,r,i,a,o,s,l){const u=[],d=new VAt,f=cRt();d.subscribe(13,Ce=>fSe("rum",Ce));const h=Ce=>{d.notify(14,{error:Ce}),Jw("Error reported to customer",{"error.message":Ce.message})},m=L$t(e),v=m.subscribe(Ce=>{d.notify(11,Ce)});u.push(()=>v.unsubscribe());const y=K$t("browser-rum-sdk",e,f,h,m,i);u.push(y.stop);const w=og()?Tjt():Ejt(e,d,a);if(og())Cjt(d);else{const Ce=Ajt(e,d,h,m,w.expireObservable,i);u.push(()=>Ce.stop()),Ljt(y,d,Ce.flushController.flushObservable)}const x=zAt(),k=Rjt(e,location),{observable:S,stop:E}=UAt();u.push(E),lRt(f,e,l);const C=qjt(f,e),A=qAt(d);u.push(()=>A.stop());const I=jjt(d,f,k,location);u.push(()=>I.stop());const j=Djt(d,f,e);oRt(f,w,t,A),sRt(f),uRt(f,a);const N=ZOt(f,e,"rum"),P=HOt(f,e,w,"rum"),M=qOt(f,e,"rum"),{actionContexts:B,addAction:K,addEvent:Z,stop:W}=gRt(d,f,e,C,x,S,h);u.push(W);const{addTiming:U,startView:G,setViewName:J,setViewContext:ne,setViewContextProperty:z,getViewContext:V,stop:Y}=xjt(d,f,e,location,x,S,k,t,A,r);u.push(Y);const{stop:D}=pRt(d,y);u.push(D);const{stop:ie}=xIt(d,e,C);if(u.push(ie),e.trackLongTasks)if(rp(Jt.LONG_ANIMATION_FRAME)){const{stop:Ce}=Qjt(d,e);u.push(Ce)}else eRt(d,e);const{addError:me}=sIt(d,e,s);s.unbuffer(),sCt(d,e,w,P,M);const Se=YOt(d,C,o),be=BAt(e.applicationId,w,A,B,I);return u.push(()=>n.stop()),{addAction:K,addEvent:Z,addError:me,addTiming:U,addFeatureFlagEvaluation:j.addFeatureFlagEvaluation,startView:G,setViewContext:ne,setViewContextProperty:z,getViewContext:V,setViewName:J,lifeCycle:d,viewHistory:A,session:w,stopSession:()=>w.expire(),getInternalContext:be.get,startDurationVital:Se.startDurationVital,stopDurationVital:Se.stopDurationVital,addDurationVital:Se.addDurationVital,addOperationStepVital:Se.addOperationStepVital,globalContext:N,userContext:P,accountContext:M,telemetry:y,stop:()=>{u.forEach(Ce=>Ce())},hooks:f}}function gRt(e,t,n,r,i,a,o){const s=iIt(e,t,i,a,n),l=fRt(e),u=Gjt(t,n),d=Xjt(n,t);return tRt(t),iRt(n,e,t,o),{pageStateHistory:r,addAction:s.addAction,addEvent:l.addEvent,actionContexts:s.actionContexts,stop:()=>{s.stop(),d.stop(),u.stop(),r.stop()}}}function yRt(e,{session:t,viewContext:n,errorType:r}){const i=t?t.id:"no-session-id",a=[];r!==void 0&&a.push(`error-type=${r}`),n&&(a.push(`seed=${n.id}`),a.push(`from=${n.startClocks.timeStamp}`));const o=vRt(e),s=`/rum/replay/sessions/${i}`;return`${o}${s}?${a.join("&")}`}function vRt(e){const t=e.site,n=e.subdomain||bRt(e);return`https://${n?`${n}.`:""}${t}`}function bRt(e){switch(e.site){case Qd:case STt:return"app";case Q_e:return"dd";default:return}}const wRt=1e3;let co;function l3t(e){return uO(e).segments_count}function u3t(e){uO(e).segments_count+=1}function c3t(e){uO(e).records_count+=1}function d3t(e,t){uO(e).segments_total_raw_size+=t}function xRt(e){return co==null?void 0:co.get(e)}function uO(e){co||(co=new Map);let t;return co.has(e)?t=co.get(e):(t={records_count:0,segments_count:0,segments_total_raw_size:0},co.set(e,t),co.size>wRt&&_Rt()),t}function _Rt(){if(!co)return;const e=co.keys().next().value;e&&co.delete(e)}function Tke(e,t,n){let r=0,i=[],a,o=!0,s=0;const l=[],{stop:u}=Xn(e,t,"message",({data:h})=>{if(h.type!=="wrote"||h.streamId!==n)return;const m=l[0];m&&(m.id===h.id?(l.shift(),r+=h.additionalBytesCount,i.push(h.result),a=h.trailer,m.writeCallback?m.writeCallback(h.result.byteLength):m.finishCallback&&m.finishCallback()):m.id<h.id&&u())});function d(){const h=i.length===0?new Uint8Array(0):oSe(i.concat(a)),m={rawBytesCount:r,output:h,outputBytesCount:h.byteLength,encoding:"deflate"};return r=0,i=[],m}function f(){o||(t.postMessage({action:"reset",streamId:n}),o=!0)}return{isAsync:!0,get isEmpty(){return o},write(h,m){t.postMessage({action:"write",id:s,data:h,streamId:n}),l.push({id:s,writeCallback:m,data:h}),o=!1,s+=1},finish(h){f(),l.length?(l.forEach(m=>{delete m.writeCallback}),l[l.length-1].finishCallback=()=>h(d())):h(d())},finishSync(){f();const h=l.map(m=>m.data).join("");return l.length=0,{...d(),pendingData:h}},estimateEncodedBytesCount(h){return h.length/8},stop(){u()}}}function EB({configuredUrl:e,error:t,source:n,scriptType:r}){if(xt.error(`${n} failed to start: an error occurred while initializing the ${r}:`,t),t instanceof Event||t instanceof Error&&SRt(t.message)){let i;e?i=`Please make sure the ${r} URL ${e} is correct and CSP is correctly configured.`:i="Please make sure CSP is correctly configured.",xt.error(`${i} See documentation at ${G$}/integrations/content_security_policy_logs/#use-csp-with-real-user-monitoring-and-session-replay`)}else r==="worker"&&yB(t)}function SRt(e){return e.includes("Content Security Policy")||e.includes("requires 'TrustedScriptURL'")}const kRt=30*_i;function $ke(e){return new Worker(e.workerUrl||URL.createObjectURL(new Blob(['(()=>{function t(t){if(1===t.length)return t[0];const e=t.reduce((t,e)=>t+e.length,0),a=new Uint8Array(e);let n=0;for(const e of t)a.set(e,n),n+=e.length;return a}function e(t){for(var e=t.length;--e>=0;)t[e]=0}var a=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),n=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),r=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),i=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),s=Array(576);e(s);var h=Array(60);e(h);var l=Array(512);e(l);var _=Array(256);e(_);var o=Array(29);e(o);var d,u,f,c=Array(30);function p(t,e,a,n,r){this.static_tree=t,this.extra_bits=e,this.extra_base=a,this.elems=n,this.max_length=r,this.has_stree=t&&t.length}function g(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}e(c);var v=function(t){return t<256?l[t]:l[256+(t>>>7)]},w=function(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255},m=function(t,e,a){t.bi_valid>16-a?(t.bi_buf|=e<<t.bi_valid&65535,w(t,t.bi_buf),t.bi_buf=e>>16-t.bi_valid,t.bi_valid+=a-16):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=a)},b=function(t,e,a){m(t,a[2*e],a[2*e+1])},y=function(t,e){var a=0;do{a|=1&t,t>>>=1,a<<=1}while(--e>0);return a>>>1},z=function(t,e,a){var n,r,i=Array(16),s=0;for(n=1;n<=15;n++)i[n]=s=s+a[n-1]<<1;for(r=0;r<=e;r++){var h=t[2*r+1];0!==h&&(t[2*r]=y(i[h]++,h))}},k=function(t){var e;for(e=0;e<286;e++)t.dyn_ltree[2*e]=0;for(e=0;e<30;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0},x=function(t){t.bi_valid>8?w(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},A=function(t,e,a,n){var r=2*e,i=2*a;return t[r]<t[i]||t[r]===t[i]&&n[e]<=n[a]},U=function(t,e,a){for(var n=t.heap[a],r=a<<1;r<=t.heap_len&&(r<t.heap_len&&A(e,t.heap[r+1],t.heap[r],t.depth)&&r++,!A(e,n,t.heap[r],t.depth));)t.heap[a]=t.heap[r],a=r,r<<=1;t.heap[a]=n},B=function(t,e,r){var i,s,h,l,d=0;if(0!==t.last_lit)do{i=t.pending_buf[t.d_buf+2*d]<<8|t.pending_buf[t.d_buf+2*d+1],s=t.pending_buf[t.l_buf+d],d++,0===i?b(t,s,e):(h=_[s],b(t,h+256+1,e),0!==(l=a[h])&&(s-=o[h],m(t,s,l)),i--,h=v(i),b(t,h,r),0!==(l=n[h])&&(i-=c[h],m(t,i,l)))}while(d<t.last_lit);b(t,256,e)},I=function(t,e){var a,n,r,i=e.dyn_tree,s=e.stat_desc.static_tree,h=e.stat_desc.has_stree,l=e.stat_desc.elems,_=-1;for(t.heap_len=0,t.heap_max=573,a=0;a<l;a++)0!==i[2*a]?(t.heap[++t.heap_len]=_=a,t.depth[a]=0):i[2*a+1]=0;for(;t.heap_len<2;)i[2*(r=t.heap[++t.heap_len]=_<2?++_:0)]=1,t.depth[r]=0,t.opt_len--,h&&(t.static_len-=s[2*r+1]);for(e.max_code=_,a=t.heap_len>>1;a>=1;a--)U(t,i,a);r=l;do{a=t.heap[1],t.heap[1]=t.heap[t.heap_len--],U(t,i,1),n=t.heap[1],t.heap[--t.heap_max]=a,t.heap[--t.heap_max]=n,i[2*r]=i[2*a]+i[2*n],t.depth[r]=(t.depth[a]>=t.depth[n]?t.depth[a]:t.depth[n])+1,i[2*a+1]=i[2*n+1]=r,t.heap[1]=r++,U(t,i,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],function(t,e){var a,n,r,i,s,h,l=e.dyn_tree,_=e.max_code,o=e.stat_desc.static_tree,d=e.stat_desc.has_stree,u=e.stat_desc.extra_bits,f=e.stat_desc.extra_base,c=e.stat_desc.max_length,p=0;for(i=0;i<=15;i++)t.bl_count[i]=0;for(l[2*t.heap[t.heap_max]+1]=0,a=t.heap_max+1;a<573;a++)(i=l[2*l[2*(n=t.heap[a])+1]+1]+1)>c&&(i=c,p++),l[2*n+1]=i,n>_||(t.bl_count[i]++,s=0,n>=f&&(s=u[n-f]),h=l[2*n],t.opt_len+=h*(i+s),d&&(t.static_len+=h*(o[2*n+1]+s)));if(0!==p){do{for(i=c-1;0===t.bl_count[i];)i--;t.bl_count[i]--,t.bl_count[i+1]+=2,t.bl_count[c]--,p-=2}while(p>0);for(i=c;0!==i;i--)for(n=t.bl_count[i];0!==n;)(r=t.heap[--a])>_||(l[2*r+1]!==i&&(t.opt_len+=(i-l[2*r+1])*l[2*r],l[2*r+1]=i),n--)}}(t,e),z(i,_,t.bl_count)},E=function(t,e,a){var n,r,i=-1,s=e[1],h=0,l=7,_=4;for(0===s&&(l=138,_=3),e[2*(a+1)+1]=65535,n=0;n<=a;n++)r=s,s=e[2*(n+1)+1],++h<l&&r===s||(h<_?t.bl_tree[2*r]+=h:0!==r?(r!==i&&t.bl_tree[2*r]++,t.bl_tree[32]++):h<=10?t.bl_tree[34]++:t.bl_tree[36]++,h=0,i=r,0===s?(l=138,_=3):r===s?(l=6,_=3):(l=7,_=4))},C=function(t,e,a){var n,r,i=-1,s=e[1],h=0,l=7,_=4;for(0===s&&(l=138,_=3),n=0;n<=a;n++)if(r=s,s=e[2*(n+1)+1],!(++h<l&&r===s)){if(h<_)do{b(t,r,t.bl_tree)}while(0!==--h);else 0!==r?(r!==i&&(b(t,r,t.bl_tree),h--),b(t,16,t.bl_tree),m(t,h-3,2)):h<=10?(b(t,17,t.bl_tree),m(t,h-3,3)):(b(t,18,t.bl_tree),m(t,h-11,7));h=0,i=r,0===s?(l=138,_=3):r===s?(l=6,_=3):(l=7,_=4)}},D=!1,M=function(t,e,a,n){m(t,0+(n?1:0),3),function(t,e,a){x(t),w(t,a),w(t,~a),t.pending_buf.set(t.window.subarray(e,e+a),t.pending),t.pending+=a}(t,e,a)},j=M,L=function(t,e,a,n){for(var r=65535&t,i=t>>>16&65535,s=0;0!==a;){a-=s=a>2e3?2e3:a;do{i=i+(r=r+e[n++]|0)|0}while(--s);r%=65521,i%=65521}return r|i<<16},S=new Uint32Array(function(){for(var t,e=[],a=0;a<256;a++){t=a;for(var n=0;n<8;n++)t=1&t?3988292384^t>>>1:t>>>1;e[a]=t}return e}()),T=function(t,e,a,n){var r=S,i=n+a;t^=-1;for(var s=n;s<i;s++)t=t>>>8^r[255&(t^e[s])];return-1^t},O={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},q=j,F=function(t,e,a){return t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&a,t.last_lit++,0===e?t.dyn_ltree[2*a]++:(t.matches++,e--,t.dyn_ltree[2*(_[a]+256+1)]++,t.dyn_dtree[2*v(e)]++),t.last_lit===t.lit_bufsize-1},G=-2,H=258,J=262,K=103,N=113,P=666,Q=function(t,e){return t.msg=O[e],e},R=function(t){return(t<<1)-(t>4?9:0)},V=function(t){for(var e=t.length;--e>=0;)t[e]=0},W=function(t,e,a){return(e<<t.hash_shift^a)&t.hash_mask},X=function(t){var e=t.state,a=e.pending;a>t.avail_out&&(a=t.avail_out),0!==a&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+a),t.next_out),t.next_out+=a,e.pending_out+=a,t.total_out+=a,t.avail_out-=a,e.pending-=a,0===e.pending&&(e.pending_out=0))},Y=function(t,e){(function(t,e,a,n){var r,l,_=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=function(t){var e,a=4093624447;for(e=0;e<=31;e++,a>>>=1)if(1&a&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<256;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0}(t)),I(t,t.l_desc),I(t,t.d_desc),_=function(t){var e;for(E(t,t.dyn_ltree,t.l_desc.max_code),E(t,t.dyn_dtree,t.d_desc.max_code),I(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*i[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),r=t.opt_len+3+7>>>3,(l=t.static_len+3+7>>>3)<=r&&(r=l)):r=l=a+5,a+4<=r&&-1!==e?M(t,e,a,n):4===t.strategy||l===r?(m(t,2+(n?1:0),3),B(t,s,h)):(m(t,4+(n?1:0),3),function(t,e,a,n){var r;for(m(t,e-257,5),m(t,a-1,5),m(t,n-4,4),r=0;r<n;r++)m(t,t.bl_tree[2*i[r]+1],3);C(t,t.dyn_ltree,e-1),C(t,t.dyn_dtree,a-1)}(t,t.l_desc.max_code+1,t.d_desc.max_code+1,_+1),B(t,t.dyn_ltree,t.dyn_dtree)),k(t),n&&x(t)})(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,X(t.strm)},Z=function(t,e){t.pending_buf[t.pending++]=e},$=function(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e},tt=function(t,e,a,n){var r=t.avail_in;return r>n&&(r=n),0===r?0:(t.avail_in-=r,e.set(t.input.subarray(t.next_in,t.next_in+r),a),1===t.state.wrap?t.adler=L(t.adler,e,r,a):2===t.state.wrap&&(t.adler=T(t.adler,e,r,a)),t.next_in+=r,t.total_in+=r,r)},et=function(t,e){var a,n,r=t.max_chain_length,i=t.strstart,s=t.prev_length,h=t.nice_match,l=t.strstart>t.w_size-J?t.strstart-(t.w_size-J):0,_=t.window,o=t.w_mask,d=t.prev,u=t.strstart+H,f=_[i+s-1],c=_[i+s];t.prev_length>=t.good_match&&(r>>=2),h>t.lookahead&&(h=t.lookahead);do{if(_[(a=e)+s]===c&&_[a+s-1]===f&&_[a]===_[i]&&_[++a]===_[i+1]){i+=2,a++;do{}while(_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&i<u);if(n=H-(u-i),i=u-H,n>s){if(t.match_start=e,s=n,n>=h)break;f=_[i+s-1],c=_[i+s]}}}while((e=d[e&o])>l&&0!==--r);return s<=t.lookahead?s:t.lookahead},at=function(t){var e,a,n,r,i,s=t.w_size;do{if(r=t.window_size-t.lookahead-t.strstart,t.strstart>=s+(s-J)){t.window.set(t.window.subarray(s,s+s),0),t.match_start-=s,t.strstart-=s,t.block_start-=s,e=a=t.hash_size;do{n=t.head[--e],t.head[e]=n>=s?n-s:0}while(--a);e=a=s;do{n=t.prev[--e],t.prev[e]=n>=s?n-s:0}while(--a);r+=s}if(0===t.strm.avail_in)break;if(a=tt(t.strm,t.window,t.strstart+t.lookahead,r),t.lookahead+=a,t.lookahead+t.insert>=3)for(i=t.strstart-t.insert,t.ins_h=t.window[i],t.ins_h=W(t,t.ins_h,t.window[i+1]);t.insert&&(t.ins_h=W(t,t.ins_h,t.window[i+3-1]),t.prev[i&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=i,i++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead<J&&0!==t.strm.avail_in)},nt=function(t,e){for(var a,n;;){if(t.lookahead<J){if(at(t),t.lookahead<J&&0===e)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=W(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==a&&t.strstart-a<=t.w_size-J&&(t.match_length=et(t,a)),t.match_length>=3)if(n=F(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=W(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!==--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=W(t,t.ins_h,t.window[t.strstart+1]);else n=F(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(n&&(Y(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Y(t,!1),0===t.strm.avail_out)?1:2},rt=function(t,e){for(var a,n,r;;){if(t.lookahead<J){if(at(t),t.lookahead<J&&0===e)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=W(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==a&&t.prev_length<t.max_lazy_match&&t.strstart-a<=t.w_size-J&&(t.match_length=et(t,a),t.match_length<=5&&(1===t.strategy||3===t.match_length&&t.strstart-t.match_start>4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){r=t.strstart+t.lookahead-3,n=F(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=r&&(t.ins_h=W(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!==--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,n&&(Y(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if((n=F(t,0,t.window[t.strstart-1]))&&Y(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(n=F(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Y(t,!1),0===t.strm.avail_out)?1:2};function it(t,e,a,n,r){this.good_length=t,this.max_lazy=e,this.nice_length=a,this.max_chain=n,this.func=r}var st=[new it(0,0,0,0,function(t,e){var a=65535;for(a>t.pending_buf_size-5&&(a=t.pending_buf_size-5);;){if(t.lookahead<=1){if(at(t),0===t.lookahead&&0===e)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var n=t.block_start+a;if((0===t.strstart||t.strstart>=n)&&(t.lookahead=t.strstart-n,t.strstart=n,Y(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-J&&(Y(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(Y(t,!1),t.strm.avail_out),1)}),new it(4,4,8,4,nt),new it(4,5,16,8,nt),new it(4,6,32,32,nt),new it(4,4,16,16,rt),new it(8,16,32,32,rt),new it(8,16,128,128,rt),new it(8,32,128,256,rt),new it(32,128,258,1024,rt),new it(32,258,258,4096,rt)];function ht(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=8,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),V(this.dyn_ltree),V(this.dyn_dtree),V(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),V(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),V(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}for(var lt=function(t){var e,i=function(t){if(!t||!t.state)return Q(t,G);t.total_in=t.total_out=0,t.data_type=2;var e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?42:N,t.adler=2===e.wrap?0:1,e.last_flush=0,function(t){D||(function(){var t,e,i,g,v,w=Array(16);for(i=0,g=0;g<28;g++)for(o[g]=i,t=0;t<1<<a[g];t++)_[i++]=g;for(_[i-1]=g,v=0,g=0;g<16;g++)for(c[g]=v,t=0;t<1<<n[g];t++)l[v++]=g;for(v>>=7;g<30;g++)for(c[g]=v<<7,t=0;t<1<<n[g]-7;t++)l[256+v++]=g;for(e=0;e<=15;e++)w[e]=0;for(t=0;t<=143;)s[2*t+1]=8,t++,w[8]++;for(;t<=255;)s[2*t+1]=9,t++,w[9]++;for(;t<=279;)s[2*t+1]=7,t++,w[7]++;for(;t<=287;)s[2*t+1]=8,t++,w[8]++;for(z(s,287,w),t=0;t<30;t++)h[2*t+1]=5,h[2*t]=y(t,5);d=new p(s,a,257,286,15),u=new p(h,n,0,30,15),f=new p([],r,0,19,7)}(),D=!0),t.l_desc=new g(t.dyn_ltree,d),t.d_desc=new g(t.dyn_dtree,u),t.bl_desc=new g(t.bl_tree,f),t.bi_buf=0,t.bi_valid=0,k(t)}(e),0}(t);return 0===i&&((e=t.state).window_size=2*e.w_size,V(e.head),e.max_lazy_match=st[e.level].max_lazy,e.good_match=st[e.level].good_length,e.nice_match=st[e.level].nice_length,e.max_chain_length=st[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=2,e.match_available=0,e.ins_h=0),i},_t=function(t,e){var a,n;if(!t||!t.state||e>5||e<0)return t?Q(t,G):G;var r=t.state;if(!t.output||!t.input&&0!==t.avail_in||r.status===P&&4!==e)return Q(t,0===t.avail_out?-5:G);r.strm=t;var i=r.last_flush;if(r.last_flush=e,42===r.status)if(2===r.wrap)t.adler=0,Z(r,31),Z(r,139),Z(r,8),r.gzhead?(Z(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),Z(r,255&r.gzhead.time),Z(r,r.gzhead.time>>8&255),Z(r,r.gzhead.time>>16&255),Z(r,r.gzhead.time>>24&255),Z(r,9===r.level?2:r.strategy>=2||r.level<2?4:0),Z(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(Z(r,255&r.gzhead.extra.length),Z(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(t.adler=T(t.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=69):(Z(r,0),Z(r,0),Z(r,0),Z(r,0),Z(r,0),Z(r,9===r.level?2:r.strategy>=2||r.level<2?4:0),Z(r,3),r.status=N);else{var h=8+(r.w_bits-8<<4)<<8;h|=(r.strategy>=2||r.level<2?0:r.level<6?1:6===r.level?2:3)<<6,0!==r.strstart&&(h|=32),h+=31-h%31,r.status=N,$(r,h),0!==r.strstart&&($(r,t.adler>>>16),$(r,65535&t.adler)),t.adler=1}if(69===r.status)if(r.gzhead.extra){for(a=r.pending;r.gzindex<(65535&r.gzhead.extra.length)&&(r.pending!==r.pending_buf_size||(r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),X(t),a=r.pending,r.pending!==r.pending_buf_size));)Z(r,255&r.gzhead.extra[r.gzindex]),r.gzindex++;r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),r.gzindex===r.gzhead.extra.length&&(r.gzindex=0,r.status=73)}else r.status=73;if(73===r.status)if(r.gzhead.name){a=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),X(t),a=r.pending,r.pending===r.pending_buf_size)){n=1;break}n=r.gzindex<r.gzhead.name.length?255&r.gzhead.name.charCodeAt(r.gzindex++):0,Z(r,n)}while(0!==n);r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),0===n&&(r.gzindex=0,r.status=91)}else r.status=91;if(91===r.status)if(r.gzhead.comment){a=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),X(t),a=r.pending,r.pending===r.pending_buf_size)){n=1;break}n=r.gzindex<r.gzhead.comment.length?255&r.gzhead.comment.charCodeAt(r.gzindex++):0,Z(r,n)}while(0!==n);r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),0===n&&(r.status=K)}else r.status=K;if(r.status===K&&(r.gzhead.hcrc?(r.pending+2>r.pending_buf_size&&X(t),r.pending+2<=r.pending_buf_size&&(Z(r,255&t.adler),Z(r,t.adler>>8&255),t.adler=0,r.status=N)):r.status=N),0!==r.pending){if(X(t),0===t.avail_out)return r.last_flush=-1,0}else if(0===t.avail_in&&R(e)<=R(i)&&4!==e)return Q(t,-5);if(r.status===P&&0!==t.avail_in)return Q(t,-5);if(0!==t.avail_in||0!==r.lookahead||0!==e&&r.status!==P){var l=2===r.strategy?function(t,e){for(var a;;){if(0===t.lookahead&&(at(t),0===t.lookahead)){if(0===e)return 1;break}if(t.match_length=0,a=F(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,a&&(Y(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Y(t,!1),0===t.strm.avail_out)?1:2}(r,e):3===r.strategy?function(t,e){for(var a,n,r,i,s=t.window;;){if(t.lookahead<=H){if(at(t),t.lookahead<=H&&0===e)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(n=s[r=t.strstart-1])===s[++r]&&n===s[++r]&&n===s[++r]){i=t.strstart+H;do{}while(n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&r<i);t.match_length=H-(i-r),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(a=F(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(a=F(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),a&&(Y(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Y(t,!1),0===t.strm.avail_out)?1:2}(r,e):st[r.level].func(r,e);if(3!==l&&4!==l||(r.status=P),1===l||3===l)return 0===t.avail_out&&(r.last_flush=-1),0;if(2===l&&(1===e?function(t){m(t,2,3),b(t,256,s),function(t){16===t.bi_valid?(w(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}(t)}(r):5!==e&&(q(r,0,0,!1),3===e&&(V(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),X(t),0===t.avail_out))return r.last_flush=-1,0}return 4!==e?0:r.wrap<=0?1:(2===r.wrap?(Z(r,255&t.adler),Z(r,t.adler>>8&255),Z(r,t.adler>>16&255),Z(r,t.adler>>24&255),Z(r,255&t.total_in),Z(r,t.total_in>>8&255),Z(r,t.total_in>>16&255),Z(r,t.total_in>>24&255)):($(r,t.adler>>>16),$(r,65535&t.adler)),X(t),r.wrap>0&&(r.wrap=-r.wrap),0!==r.pending?0:1)},ot=function(t){if(!t||!t.state)return G;var e=t.state.status;return 42!==e&&69!==e&&73!==e&&91!==e&&e!==K&&e!==N&&e!==P?Q(t,G):(t.state=null,e===N?Q(t,-3):0)},dt=new Uint8Array(256),ut=0;ut<256;ut++)dt[ut]=ut>=252?6:ut>=248?5:ut>=240?4:ut>=224?3:ut>=192?2:1;dt[254]=dt[254]=1;var ft=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0},ct=Object.prototype.toString;function pt(){this.options={level:-1,method:8,chunkSize:16384,windowBits:15,memLevel:8,strategy:0};var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new ft,this.strm.avail_out=0;var e,a,n=function(t,e,a,n,r,i){if(!t)return G;var s=1;if(-1===e&&(e=6),n<0?(s=0,n=-n):n>15&&(s=2,n-=16),r<1||r>9||8!==a||n<8||n>15||e<0||e>9||i<0||i>4)return Q(t,G);8===n&&(n=9);var h=new ht;return t.state=h,h.strm=t,h.wrap=s,h.gzhead=null,h.w_bits=n,h.w_size=1<<h.w_bits,h.w_mask=h.w_size-1,h.hash_bits=r+7,h.hash_size=1<<h.hash_bits,h.hash_mask=h.hash_size-1,h.hash_shift=~~((h.hash_bits+3-1)/3),h.window=new Uint8Array(2*h.w_size),h.head=new Uint16Array(h.hash_size),h.prev=new Uint16Array(h.w_size),h.lit_bufsize=1<<r+6,h.pending_buf_size=4*h.lit_bufsize,h.pending_buf=new Uint8Array(h.pending_buf_size),h.d_buf=1*h.lit_bufsize,h.l_buf=3*h.lit_bufsize,h.level=e,h.strategy=i,h.method=a,lt(t)}(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(0!==n)throw Error(O[n]);if(t.header&&(e=this.strm,a=t.header,e&&e.state&&(2!==e.state.wrap||(e.state.gzhead=a))),t.dictionary){var r;if(r="[object ArrayBuffer]"===ct.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,0!==(n=function(t,e){var a=e.length;if(!t||!t.state)return G;var n=t.state,r=n.wrap;if(2===r||1===r&&42!==n.status||n.lookahead)return G;if(1===r&&(t.adler=L(t.adler,e,a,0)),n.wrap=0,a>=n.w_size){0===r&&(V(n.head),n.strstart=0,n.block_start=0,n.insert=0);var i=new Uint8Array(n.w_size);i.set(e.subarray(a-n.w_size,a),0),e=i,a=n.w_size}var s=t.avail_in,h=t.next_in,l=t.input;for(t.avail_in=a,t.next_in=0,t.input=e,at(n);n.lookahead>=3;){var _=n.strstart,o=n.lookahead-2;do{n.ins_h=W(n,n.ins_h,n.window[_+3-1]),n.prev[_&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=_,_++}while(--o);n.strstart=_,n.lookahead=2,at(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=2,n.match_available=0,t.next_in=h,t.input=l,t.avail_in=s,n.wrap=r,0}(this.strm,r)))throw Error(O[n]);this._dict_set=!0}}function gt(t,e,a){try{t.postMessage({type:"errored",error:e,streamId:a})}catch(n){t.postMessage({type:"errored",error:e+"",streamId:a})}}function vt(t){const e=t.strm.adler;return new Uint8Array([3,0,e>>>24&255,e>>>16&255,e>>>8&255,255&e])}pt.prototype.push=function(t,e){var a,n,r=this.strm,i=this.options.chunkSize;if(this.ended)return!1;for(n=e===~~e?e:!0===e?4:0,"[object ArrayBuffer]"===ct.call(t)?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;;)if(0===r.avail_out&&(r.output=new Uint8Array(i),r.next_out=0,r.avail_out=i),(2===n||3===n)&&r.avail_out<=6)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else{if(1===(a=_t(r,n)))return r.next_out>0&&this.onData(r.output.subarray(0,r.next_out)),a=ot(this.strm),this.onEnd(a),this.ended=!0,0===a;if(0!==r.avail_out){if(n>0&&r.next_out>0)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else if(0===r.avail_in)break}else this.onData(r.output)}return!0},pt.prototype.onData=function(t){this.chunks.push(t)},pt.prototype.onEnd=function(t){0===t&&(this.result=function(t){for(var e=0,a=0,n=t.length;a<n;a++)e+=t[a].length;for(var r=new Uint8Array(e),i=0,s=0,h=t.length;i<h;i++){var l=t[i];r.set(l,s),s+=l.length}return r}(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},function(e=self){try{const a=new Map;e.addEventListener("message",n=>{try{const r=function(e,a){switch(a.action){case"init":return{type:"initialized",version:"6.24.1"};case"write":{let n=e.get(a.streamId);n||(n=new pt,e.set(a.streamId,n));const r=n.chunks.length,i=function(t){if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(t);let e,a,n,r,i,s=t.length,h=0;for(r=0;r<s;r++)a=t.charCodeAt(r),55296==(64512&a)&&r+1<s&&(n=t.charCodeAt(r+1),56320==(64512&n)&&(a=65536+(a-55296<<10)+(n-56320),r++)),h+=a<128?1:a<2048?2:a<65536?3:4;for(e=new Uint8Array(h),i=0,r=0;i<h;r++)a=t.charCodeAt(r),55296==(64512&a)&&r+1<s&&(n=t.charCodeAt(r+1),56320==(64512&n)&&(a=65536+(a-55296<<10)+(n-56320),r++)),a<128?e[i++]=a:a<2048?(e[i++]=192|a>>>6,e[i++]=128|63&a):a<65536?(e[i++]=224|a>>>12,e[i++]=128|a>>>6&63,e[i++]=128|63&a):(e[i++]=240|a>>>18,e[i++]=128|a>>>12&63,e[i++]=128|a>>>6&63,e[i++]=128|63&a);return e}(a.data);return n.push(i,2),{type:"wrote",id:a.id,streamId:a.streamId,result:t(n.chunks.slice(r)),trailer:vt(n),additionalBytesCount:i.length}}case"reset":e.delete(a.streamId)}}(a,n.data);r&&e.postMessage(r)}catch(t){gt(e,t,n.data&&"streamId"in n.data?n.data.streamId:void 0)}})}catch(t){gt(e,t)}}()})();'])))}let dr={status:0};function Oke(e,t,n,r=$ke){switch(dr.status===0&&ERt(e,t,r),dr.status){case 1:return dr.initializationFailureCallbacks.push(n),dr.worker;case 3:return dr.worker}}function qne(){return dr.status}function ERt(e,t,n=$ke){try{const r=n(e),{stop:i}=Xn(e,r,"error",o=>{O2(e,t,o)}),{stop:a}=Xn(e,r,"message",({data:o})=>{o.type==="errored"?O2(e,t,o.error,o.streamId):o.type==="initialized"&&$Rt(o.version)});r.postMessage({action:"init"}),yi(()=>TRt(t),kRt),dr={status:1,worker:r,stop:()=>{i(),a()},initializationFailureCallbacks:[]}}catch(r){O2(e,t,r)}}function TRt(e){dr.status===1&&(xt.error(`${e} failed to start: a timeout occurred while initializing the Worker`),dr.initializationFailureCallbacks.forEach(t=>t()),dr={status:2})}function $Rt(e){dr.status===1&&(dr={status:3,worker:dr.worker,stop:dr.stop,version:e})}function O2(e,t,n,r){dr.status===1||dr.status===0?(EB({configuredUrl:e.workerUrl,error:n,source:t,scriptType:"worker"}),dr.status===1&&dr.initializationFailureCallbacks.forEach(i=>i()),dr={status:2}):yB(n,{worker_version:dr.status===3&&dr.version,stream_id:r})}function Ake(){return typeof Array.from=="function"&&typeof CSSSupportsRule=="function"&&typeof URL.createObjectURL=="function"&&"forEach"in NodeList.prototype}function ORt(e,t,n,r){const i=t.findTrackedSession(),a=ARt(i,r),o=n.findView();return yRt(e,{viewContext:o,errorType:a,session:i})}function ARt(e,t){if(!Ake())return"browser-not-supported";if(!e)return"rum-not-tracked";if(e.sessionReplay===0)return"incorrect-session-plan";if(!t)return"replay-not-started"}function CRt(e,t){if(!e.metricsEnabled)return{stop:fn};let n,r,i;const{unsubscribe:a}=t.subscribe(o=>{switch(o.type){case"start":n={forced:o.forced,timestamp:ii()},r=void 0,i=void 0;break;case"document-ready":n&&(r=fr(n.timestamp,ii()));break;case"recorder-settled":n&&(i=fr(n.timestamp,ii()));break;case"aborted":case"deflate-encoder-load-failed":case"recorder-load-failed":case"succeeded":a(),n&&rO("Recorder init metrics",{metrics:IRt(n.forced,i,fr(n.timestamp,ii()),o.type,r)});break}});return{stop:a}}function IRt(e,t,n,r,i){return{forced:e,loadRecorderModuleDuration:t,recorderInitDuration:n,result:r,waitForDocReadyDuration:i}}function jRt(e,t,n,r,i,a,o){let s=0,l;t.subscribe(9,()=>{(s===2||s===3)&&(h(),s=1)}),t.subscribe(10,()=>{s===1&&f()});const u=new Gt;CRt(o,u);const d=async m=>{u.notify({type:"start",forced:m});const[v]=await Promise.all([Zne(u,{type:"recorder-settled"},i()),Zne(u,{type:"document-ready"},vOt(e,"interactive"))]);if(s!==2){u.notify({type:"aborted"});return}if(!v){s=0,u.notify({type:"recorder-load-failed"});return}const y=a();if(!y){s=0,u.notify({type:"deflate-encoder-load-failed"});return}({stop:l}=v(t,e,n,r,y,o)),s=3,u.notify({type:"succeeded"})};function f(m){const v=n.findTrackedSession();if(RRt(v,m)){s=1;return}if(PRt(s))return;s=2;const y=NRt(v,m)||!1;d(y).catch(Pc),y&&n.setForcedReplay()}function h(){s===3&&(l==null||l()),s=0}return{start:f,stop:h,getSessionReplayLink(){return ORt(e,n,r,s!==0)},isRecording:()=>s===3}}function RRt(e,t){return!e||e.sessionReplay===0&&(!t||!t.force)}function PRt(e){return e===2||e===3}function NRt(e,t){return t&&t.force&&e.sessionReplay===0}async function Zne(e,t,n){try{return await n}finally{e.notify(t)}}function MRt(){let e=0;return{strategy:{start(){e=1},stop(){e=2},isRecording:()=>!1,getSessionReplayLink:fn},shouldStartImmediately(t){return e===1||e===0&&!t.startSessionReplayRecordingManually}}}function DRt(e,t){if(og()&&!_Se("records")||!Ake())return{start:fn,stop:fn,getReplayStats:()=>{},onRumStart:fn,isRecording:()=>!1,getSessionReplayLink:()=>{}};let{strategy:n,shouldStartImmediately:r}=MRt();return{start:a=>n.start(a),stop:()=>n.stop(),getSessionReplayLink:()=>n.getSessionReplayLink(),onRumStart:i,isRecording:()=>qne()===3&&n.isRecording(),getReplayStats:a=>qne()===3?xRt(a):void 0};function i(a,o,s,l,u,d){let f;function h(){return f||(u??(u=Oke(o,"Datadog Session Replay",()=>{n.stop()},t)),u&&(f=Tke(o,u,1))),f}n=jRt(o,a,s,l,e,h,d),r(o)&&n.start()}}async function zRt(e=LRt){try{return await e()}catch(t){EB({error:t,source:"Recorder",scriptType:"module"})}}async function LRt(){return(await H(async()=>{const{startRecording:e}=await import("./startRecording-B_9CRZ_P-5fxd2OhI.js");return{startRecording:e}},[])).startRecording}function URt(){return Ao().Profiler!==void 0}const BRt=e=>{let t={status:"starting"};return e.register(0,({eventType:n})=>n!==Et.VIEW&&n!==Et.LONG_TASK?Da:{type:n,_dd:{profiling:t}}),{get:()=>t,set:n=>{t=n}}};async function VRt(e=FRt){try{return await e()}catch(t){EB({error:t,source:"Profiler",scriptType:"module"})}}async function FRt(){return(await H(async()=>{const{createRumProfiler:e}=await import("./profiler-D6ndqfsd-Dhb01evK.js");return{createRumProfiler:e}},[])).createRumProfiler}function qRt(){let e;function t(n,r,i,a,o,s){const l=a.findTrackedSession();if(!l||!USe(l.id,i.profilingSampleRate))return;const u=BRt(r);if(!URt()){u.set({status:"error",error_reason:"not-supported-by-browser"});return}VRt().then(d=>{if(!d){Jw("[DD_RUM] Failed to lazy load the RUM Profiler"),u.set({status:"error",error_reason:"failed-to-lazy-load"});return}e=d(i,n,a,u,s),e.start(o.findView())}).catch(Pc)}return{onRumStart:t,stop:()=>{e==null||e.stop().catch(Pc)}}}const ZRt=DRt(zRt),HRt=qRt(),Xv=MAt(mRt,ZRt,HRt,{startDeflateWorker:Oke,createDeflateEncoder:Tke,sdkName:"rum"});m$t(Ao(),"DD_RUM",Xv);const y_={applicationId:"0b0a19b9-099b-4812-b342-930518330975",clientToken:"puba92c09799d321f572535176e9fe08256",site:"datadoghq.com",service:"gram-elements"};let bL=!1,wL=!0;function GRt(e={}){if(e.enabled===!1){wL=!1;return}if(!bL)try{Xv.init({applicationId:y_.applicationId,clientToken:y_.clientToken,site:y_.site,service:y_.service,env:"production",sessionSampleRate:100,sessionReplaySampleRate:100,trackUserInteractions:!0,trackResources:!0,trackLongTasks:!0,defaultPrivacyLevel:"mask"}),e.projectSlug&&Xv.setGlobalContextProperty("projectSlug",e.projectSlug),e.variant&&Xv.setGlobalContextProperty("variant",e.variant),bL=!0}catch(t){console.warn("[Elements] Failed to initialize Datadog RUM:",t),wL=!1}}function xL(e,t){if(!wL||!bL)return;const n=e instanceof Error?e:new Error(String(e));try{Xv.addError(n,{...t,timestamp:new Date().toISOString()})}catch(r){console.warn("[Elements] Failed to track error:",r)}}const Cke=["anthropic/claude-opus-4.6","anthropic/claude-sonnet-4.5","anthropic/claude-haiku-4.5","anthropic/claude-sonnet-4","anthropic/claude-opus-4.5","openai/gpt-4o","openai/gpt-4o-mini","openai/gpt-5.1-codex","openai/gpt-5","openai/gpt-5.1","openai/gpt-4.1","anthropic/claude-3.7-sonnet","anthropic/claude-opus-4","google/gemini-2.5-pro-preview","google/gemini-3-pro-preview","moonshotai/kimi-k2","mistralai/mistral-medium-3","mistralai/mistral-medium-3.1","mistralai/codestral-2501"],KRt=e=>Object.fromEntries(Object.entries(e).map(([t,n])=>[t,{...n.description?{description:n.description}:void 0,parameters:n.parameters instanceof Dte.ZodType?Dte.toJSONSchema(n.parameters):n.parameters}])),WRt=e=>Object.fromEntries(Object.entries(e).filter(([,t])=>!t.disabled&&t.type!=="backend"));function JRt(e,t){Ike(t)}function Ike(e){if(!e)return()=>!1;if(typeof e=="function")return n=>e({toolName:n});const t=new Set(e);return n=>t.has(n)}function YRt(e,t,n){if(!t||Array.isArray(t)&&t.length===0)return e;const r=Ike(t);return Object.fromEntries(Object.entries(e).map(([i,a])=>{if(!r(i))return[i,a];const o=a.execute;return o?[i,{...a,execute:async(s,l)=>{const u=l??{},d=u.toolCallId??"";return n.isToolApproved(i)||await n.requestApproval(i,d,s)?o(s,u):{content:[{type:"text",text:`Tool "${i}" execution was denied by the user. Please acknowledge this and continue without using this tool's result.`}],isError:!0}}}]:[i,a]}))}const XRt=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],QRt=gn("arrow-down",XRt),ePt=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],tPt=gn("arrow-up",ePt),nPt=[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]],rPt=gn("brain",nPt),iPt=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]];gn("calendar",iPt);const aPt=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],oPt=gn("chevron-left",aPt),sPt=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],jke=gn("chevron-right",sPt),lPt=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],TB=gn("copy",lPt),uPt=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],cPt=gn("file-text",uPt),dPt=[["path",{d:"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5",key:"mvr1a0"}]],fPt=gn("heart",dPt),pPt=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]];gn("link",pPt);const hPt=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],mPt=gn("loader-circle",hPt),gPt=[["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m16.2 7.8 2.9-2.9",key:"r700ao"}],["path",{d:"M18 12h4",key:"wj9ykh"}],["path",{d:"m16.2 16.2 2.9 2.9",key:"1bxg5t"}],["path",{d:"M12 18v4",key:"jadmvz"}],["path",{d:"m4.9 19.1 2.9-2.9",key:"bwix9q"}],["path",{d:"M2 12h4",key:"j09sii"}],["path",{d:"m4.9 4.9 2.9 2.9",key:"giyufr"}]],mE=gn("loader",gPt),yPt=[["path",{d:"M8 3H5a2 2 0 0 0-2 2v3",key:"1dcmit"}],["path",{d:"M21 8V5a2 2 0 0 0-2-2h-3",key:"1e4gt3"}],["path",{d:"M3 16v3a2 2 0 0 0 2 2h3",key:"wsl5sc"}],["path",{d:"M16 21h3a2 2 0 0 0 2-2v-3",key:"18trek"}]],vPt=gn("maximize",yPt),bPt=[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}]],wPt=gn("message-circle",bPt),xPt=[["path",{d:"M8 3v3a2 2 0 0 1-2 2H3",key:"hohbtr"}],["path",{d:"M21 8h-3a2 2 0 0 1-2-2V3",key:"5jw1f3"}],["path",{d:"M3 16h3a2 2 0 0 1 2 2v3",key:"198tvr"}],["path",{d:"M16 21v-3a2 2 0 0 1 2-2h3",key:"ph8mxp"}]],_Pt=gn("minimize",xPt),SPt=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}],["path",{d:"m8 9 3 3-3 3",key:"12hl5m"}]],kPt=gn("panel-right-close",SPt),EPt=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}],["path",{d:"m10 15-3-3 3-3",key:"1pgupc"}]],TPt=gn("panel-right-open",EPt),$Pt=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],OPt=gn("pencil",$Pt),APt=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Rke=gn("plus",APt),CPt=[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],IPt=gn("settings-2",CPt),jPt=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],RPt=gn("square",jPt),PPt=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],Hne=gn("wifi-off",PPt),NPt=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],Pke=gn("wrench",NPt),MPt=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],ip=gn("x",MPt),DPt=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]];gn("zap",DPt);var cO="Dialog",[Nke]=Ua(cO),[zPt,ms]=Nke(cO),Mke=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=$.useRef(null),l=$.useRef(null),[u,d]=ss({prop:r,defaultProp:i??!1,onChange:a,caller:cO});return _.jsx(zPt,{scope:t,triggerRef:s,contentRef:l,contentId:wo(),titleId:wo(),descriptionId:wo(),open:u,onOpenChange:d,onOpenToggle:$.useCallback(()=>d(f=>!f),[d]),modal:o,children:n})};Mke.displayName=cO;var Dke="DialogTrigger",zke=$.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=ms(Dke,n),a=on(t,i.triggerRef);return _.jsx(ut.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":AB(i.open),...r,ref:a,onClick:ct(e.onClick,i.onOpenToggle)})});zke.displayName=Dke;var $B="DialogPortal",[LPt,Lke]=Nke($B,{forceMount:void 0}),Uke=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=ms($B,t);return _.jsx(LPt,{scope:t,forceMount:n,children:$.Children.map(r,o=>_.jsx(ps,{present:n||a.open,children:_.jsx(iw,{asChild:!0,container:i,children:o})}))})};Uke.displayName=$B;var gE="DialogOverlay",Bke=$.forwardRef((e,t)=>{const n=Lke(gE,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=ms(gE,e.__scopeDialog);return a.modal?_.jsx(ps,{present:r||a.open,children:_.jsx(BPt,{...i,ref:t})}):null});Bke.displayName=gE;var UPt=Tf("DialogOverlay.RemoveScroll"),BPt=$.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=ms(gE,n);return _.jsx(kT,{as:UPt,allowPinchZoom:!0,shards:[i.contentRef],children:_.jsx(ut.div,{"data-state":AB(i.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Nf="DialogContent",Vke=$.forwardRef((e,t)=>{const n=Lke(Nf,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=ms(Nf,e.__scopeDialog);return _.jsx(ps,{present:r||a.open,children:a.modal?_.jsx(VPt,{...i,ref:t}):_.jsx(FPt,{...i,ref:t})})});Vke.displayName=Nf;var VPt=$.forwardRef((e,t)=>{const n=ms(Nf,e.__scopeDialog),r=$.useRef(null),i=on(t,n.contentRef,r);return $.useEffect(()=>{const a=r.current;if(a)return j6(a)},[]),_.jsx(Fke,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ct(e.onCloseAutoFocus,a=>{var o;a.preventDefault(),(o=n.triggerRef.current)==null||o.focus()}),onPointerDownOutside:ct(e.onPointerDownOutside,a=>{const o=a.detail.originalEvent,s=o.button===0&&o.ctrlKey===!0;(o.button===2||s)&&a.preventDefault()}),onFocusOutside:ct(e.onFocusOutside,a=>a.preventDefault())})}),FPt=$.forwardRef((e,t)=>{const n=ms(Nf,e.__scopeDialog),r=$.useRef(!1),i=$.useRef(!1);return _.jsx(Fke,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var o,s;(o=e.onCloseAutoFocus)==null||o.call(e,a),a.defaultPrevented||(r.current||((s=n.triggerRef.current)==null||s.focus()),a.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:a=>{var s,l;(s=e.onInteractOutside)==null||s.call(e,a),a.defaultPrevented||(r.current=!0,a.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const o=a.target;(l=n.triggerRef.current)!=null&&l.contains(o)&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&i.current&&a.preventDefault()}})}),Fke=$.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=ms(Nf,n),l=$.useRef(null),u=on(t,l);return I6(),_.jsxs(_.Fragment,{children:[_.jsx(_T,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:_.jsx(rw,{role:"dialog",id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":AB(s.open),...o,ref:u,onDismiss:()=>s.onOpenChange(!1)})}),_.jsxs(_.Fragment,{children:[_.jsx(ZPt,{titleId:s.titleId}),_.jsx(GPt,{contentRef:l,descriptionId:s.descriptionId})]})]})}),OB="DialogTitle",qke=$.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=ms(OB,n);return _.jsx(ut.h2,{id:i.titleId,...r,ref:t})});qke.displayName=OB;var Zke="DialogDescription",qPt=$.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=ms(Zke,n);return _.jsx(ut.p,{id:i.descriptionId,...r,ref:t})});qPt.displayName=Zke;var Hke="DialogClose",Gke=$.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=ms(Hke,n);return _.jsx(ut.button,{type:"button",...r,ref:t,onClick:ct(e.onClick,()=>i.onOpenChange(!1))})});Gke.displayName=Hke;function AB(e){return e?"open":"closed"}var Kke="DialogTitleWarning",[f3t,Wke]=WQe(Kke,{contentName:Nf,titleName:OB,docsSlug:"dialog"}),ZPt=({titleId:e})=>{const t=Wke(Kke),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
474
|
+
`,r:"\r",t:" "};function SAt(e){return e.startsWith("u")?String.fromCharCode(parseInt(e.slice(1),16)):_At[e]}const kAt="v1",EAt=["applicationId","service","env","version","sessionSampleRate","sessionReplaySampleRate","defaultPrivacyLevel","enablePrivacyForActionName","traceSampleRate","trackSessionAcrossSubdomains","allowedTracingUrls","allowedTrackingOrigins"];async function TAt(e,t){let n;const r=OAt(),i=await jAt(e);return i.ok?(r.increment("fetch","success"),n=$At(e,i.value,t,r)):(r.increment("fetch","failure"),xt.error(i.error)),rO("remote configuration metrics",{metrics:r.get()}),n}function $At(e,t,n,r){const i={...e};return EAt.forEach(h=>{h in t&&(i[h]=a(t[h]))}),Object.keys(n).forEach(h=>{t[h]!==void 0&&o(n[h],t[h])}),i;function a(h){if(Array.isArray(h))return h.map(a);if(AAt(h)){if(CAt(h)){const m=h.rcSerializedType;switch(m){case"string":return h.value;case"regex":return qSe(h.value);case"dynamic":return s(h);default:xt.error(`Unsupported remote configuration: "rcSerializedType": "${m}"`);return}}return C_e(h,a)}return h}function o(h,m){m.forEach(({key:v,value:y})=>{h.setContextProperty(v,a(y))})}function s(h){const m=h.strategy;let v;switch(m){case"cookie":v=l(h);break;case"dom":v=u(h);break;case"js":v=f(h);break;default:xt.error(`Unsupported remote configuration: "strategy": "${m}"`);return}const y=h.extractor;return y!==void 0&&typeof v=="string"?IAt(y,v):v}function l({name:h}){const m=eO(h);return r.increment("cookie",m!==void 0?"success":"missing"),m}function u({selector:h,attribute:m}){let v;try{v=document.querySelector(h)}catch{xt.error(`Invalid selector in the remote configuration: '${h}'`),r.increment("dom","failure");return}if(!v){r.increment("dom","missing");return}if(d(v,m)){xt.error(`Forbidden element selected by the remote configuration: '${h}'`),r.increment("dom","failure");return}const y=m!==void 0?v.getAttribute(m):v.textContent;if(y===null){r.increment("dom","missing");return}return r.increment("dom","success"),y}function d(h,m){return h.getAttribute("type")==="password"&&m==="value"}function f({path:h}){let m=window;const v=fAt(h);if(v.length===0){xt.error(`Invalid JSON path in the remote configuration: '${h}'`),r.increment("js","failure");return}for(const y of v){if(!(y in m)){r.increment("js","missing");return}try{m=m[y]}catch(w){xt.error(`Error accessing: '${h}'`,w),r.increment("js","failure");return}}return r.increment("js","success"),m}}function OAt(){const e={fetch:{}};return{get:()=>e,increment:(t,n)=>{e[t]||(e[t]={}),e[t][n]||(e[t][n]=0),e[t][n]=e[t][n]+1}}}function AAt(e){return typeof e=="object"&&e!==null}function CAt(e){return"rcSerializedType"in e}function qSe(e){try{return new RegExp(e)}catch{xt.error(`Invalid regex in the remote configuration: '${e}'`)}}function IAt(e,t){const n=qSe(e.value);if(n===void 0)return;const r=n.exec(t);if(r===null)return;const[i,a]=r;return a||i}async function jAt(e){let t;try{t=await fetch(RAt(e))}catch{t=void 0}if(!t||!t.ok)return{ok:!1,error:new Error("Error fetching the remote configuration.")};const n=await t.json();return n.rum?{ok:!0,value:n.rum}:{ok:!1,error:new Error("No remote configuration for RUM.")}}function RAt(e){return e.remoteConfigurationProxy?e.remoteConfigurationProxy:`https://sdk-configuration.${eSe("rum",e)}/${kAt}/${encodeURIComponent(e.remoteConfigurationId)}.json`}function PAt({ignoreInitIfSyntheticsWillInjectRum:e=!0,startDeflateWorker:t},n,r,i){const a=LOt(),o=PSe();x2(o,Br.globalContext,a);const s=NSe();x2(s,Br.userContext,a);const l=RSe();x2(l,Br.accountContext,a);let u,d,f,h;const m=n.observable.subscribe(y),v={};function y(){if(!f||!h||!n.isGranted())return;m.unsubscribe();let k;if(h.trackViewsManually){if(!u)return;a.remove(u.callback),k=u.options}const S=i(h,d,k);a.drain(S)}function w(k,S){const E=og();if(E&&(k=NAt(k)),f=k,Q$t(dAt(k)),h){lSe("DD_RUM",k);return}const C=aAt(k,S);if(C){if(!E&&!C.sessionStoreStrategyType){xt.warn("No storage available for session. We will not send any data.");return}C.compressIntakeRequests&&!E&&t&&(d=t(C,"Datadog RUM",fn),!d)||(h=C,jSe().subscribe(fn),n.tryToInit(C.trackingConsent),y())}}const x=k=>{a.add(S=>S.addDurationVital(k))};return{init(k,S,E){if(!k){xt.error("Missing configuration");return}DTt(k.enableExperimentalFeatures),f=k,!(e&&TSe())&&(LSe(k.plugins,"onInit",{initConfiguration:k,publicApi:S}),k.remoteConfigurationId?TAt(k,{user:s,context:o}).then(C=>{C&&w(C,E)}).catch(Pc):w(k,E))},get initConfiguration(){return f},getInternalContext:fn,stopSession:fn,addTiming(k,S=ii()){a.add(E=>E.addTiming(k,S))},startView(k,S=Hr()){const E=C=>{C.startView(k,S)};a.add(E),u||(u={options:k,callback:E},y())},setViewName(k){a.add(S=>S.setViewName(k))},setViewContext(k){a.add(S=>S.setViewContext(k))},setViewContextProperty(k,S){a.add(E=>E.setViewContextProperty(k,S))},getViewContext:()=>v,globalContext:o,userContext:s,accountContext:l,addAction(k){a.add(S=>S.addAction(k))},addError(k){a.add(S=>S.addError(k))},addFeatureFlagEvaluation(k,S){a.add(E=>E.addFeatureFlagEvaluation(k,S))},startDurationVital(k,S){return DSe(r,k,S)},stopDurationVital(k,S){zSe(x,r,k,S)},addDurationVital:x,addOperationStepVital:(k,S,E,C)=>{a.add(A=>A.addOperationStepVital(Un(k),S,Un(E),Un(C)))}}}function NAt(e){var t,n;return{...e,applicationId:"00000000-aaaa-0000-aaaa-000000000000",clientToken:"empty",sessionSampleRate:100,defaultPrivacyLevel:(t=e.defaultPrivacyLevel)!==null&&t!==void 0?t:(n=Ww())===null||n===void 0?void 0:n.getPrivacyLevel()}}function x2(e,t,n){e.changeObservable.subscribe(()=>{const r=e.getContext();n.add(i=>i[t].setContext(r))})}function MAt(e,t,n,r={}){const i=gTt(),a=JOt(),o=KOt().observable;let s=PAt(r,i,a,(f,h,m)=>{const v=h&&r.createDeflateEncoder?w=>r.createDeflateEncoder(f,h,w):mOt,y=e(f,t,n,m,v,i,a,o,r.sdkName);return t.onRumStart(y.lifeCycle,f,y.session,y.viewHistory,h,y.telemetry),n.onRumStart(y.lifeCycle,y.hooks,f,y.session,y.viewHistory,v),s=DAt(s,y),LSe(f.plugins,"onRumStart",{strategy:s,addEvent:y.addEvent}),y});const l=()=>s,u=$t(f=>{const h=typeof f=="object"?f:{name:f};s.startView(h),Ur({feature:"start-view"})}),d=h$t({init:f=>{const h=new Error().stack;Sc(()=>s.init(f,d,h))},setTrackingConsent:$t(f=>{i.update(f),Ur({feature:"set-tracking-consent",tracking_consent:f})}),setViewName:$t(f=>{s.setViewName(f),Ur({feature:"set-view-name"})}),setViewContext:$t(f=>{s.setViewContext(f),Ur({feature:"set-view-context"})}),setViewContextProperty:$t((f,h)=>{s.setViewContextProperty(f,h),Ur({feature:"set-view-context-property"})}),getViewContext:$t(()=>(Ur({feature:"set-view-context-property"}),s.getViewContext())),getInternalContext:$t(f=>s.getInternalContext(f)),getInitConfiguration:$t(()=>gB(s.initConfiguration)),addAction:(f,h)=>{const m=fE("action");Sc(()=>{s.addAction({name:Un(f),context:Un(h),startClocks:Hr(),type:xB.CUSTOM,handlingStack:m}),Ur({feature:"add-action"})})},addError:(f,h)=>{const m=fE("error");Sc(()=>{s.addError({error:f,handlingStack:m,context:Un(h),startClocks:Hr()}),Ur({feature:"add-error"})})},addTiming:$t((f,h)=>{s.addTiming(Un(f),h)}),setGlobalContext:$i(l,Br.globalContext,Oi.setContext,"set-global-context"),getGlobalContext:$i(l,Br.globalContext,Oi.getContext,"get-global-context"),setGlobalContextProperty:$i(l,Br.globalContext,Oi.setContextProperty,"set-global-context-property"),removeGlobalContextProperty:$i(l,Br.globalContext,Oi.removeContextProperty,"remove-global-context-property"),clearGlobalContext:$i(l,Br.globalContext,Oi.clearContext,"clear-global-context"),setUser:$i(l,Br.userContext,Oi.setContext,"set-user"),getUser:$i(l,Br.userContext,Oi.getContext,"get-user"),setUserProperty:$i(l,Br.userContext,Oi.setContextProperty,"set-user-property"),removeUserProperty:$i(l,Br.userContext,Oi.removeContextProperty,"remove-user-property"),clearUser:$i(l,Br.userContext,Oi.clearContext,"clear-user"),setAccount:$i(l,Br.accountContext,Oi.setContext,"set-account"),getAccount:$i(l,Br.accountContext,Oi.getContext,"get-account"),setAccountProperty:$i(l,Br.accountContext,Oi.setContextProperty,"set-account-property"),removeAccountProperty:$i(l,Br.accountContext,Oi.removeContextProperty,"remove-account-property"),clearAccount:$i(l,Br.accountContext,Oi.clearContext,"clear-account"),startView:u,stopSession:$t(()=>{s.stopSession(),Ur({feature:"stop-session"})}),addFeatureFlagEvaluation:$t((f,h)=>{s.addFeatureFlagEvaluation(Un(f),Un(h)),Ur({feature:"add-feature-flag-evaluation"})}),getSessionReplayLink:$t(()=>t.getSessionReplayLink()),startSessionReplayRecording:$t(f=>{t.start(f),Ur({feature:"start-session-replay-recording",force:f&&f.force})}),stopSessionReplayRecording:$t(()=>t.stop()),addDurationVital:$t((f,h)=>{Ur({feature:"add-duration-vital"}),s.addDurationVital({name:Un(f),type:w0.DURATION,startClocks:CEt(h.startTime),duration:h.duration,context:Un(h&&h.context),description:Un(h&&h.description)})}),startDurationVital:$t((f,h)=>(Ur({feature:"start-duration-vital"}),s.startDurationVital(Un(f),{context:Un(h&&h.context),description:Un(h&&h.description)}))),stopDurationVital:$t((f,h)=>{Ur({feature:"stop-duration-vital"}),s.stopDurationVital(typeof f=="string"?Un(f):f,{context:Un(h&&h.context),description:Un(h&&h.description)})}),startFeatureOperation:$t((f,h)=>{Ur({feature:"add-operation-step-vital",action_type:"start"}),s.addOperationStepVital(f,"start",h)}),succeedFeatureOperation:$t((f,h)=>{Ur({feature:"add-operation-step-vital",action_type:"succeed"}),s.addOperationStepVital(f,"end",h)}),failFeatureOperation:$t((f,h,m)=>{Ur({feature:"add-operation-step-vital",action_type:"fail"}),s.addOperationStepVital(f,"end",m,h)})});return d}function DAt(e,t){return{init:n=>{lSe("DD_RUM",n)},initConfiguration:e.initConfiguration,...t}}function zAt(){const e=LAt();return new Gt(t=>{if(!e)return;const n=new e($t(r=>t.notify(r)));return n.observe(document,{attributes:!0,characterData:!0,childList:!0,subtree:!0}),()=>n.disconnect()})}function LAt(){let e;const t=window;if(t.Zone&&(e=Rc(t,"MutationObserver"),t.MutationObserver&&e===t.MutationObserver)){const n=new t.MutationObserver(fn),r=Rc(n,"originalInstance");e=r&&r.constructor}return e||(e=t.MutationObserver),e}function UAt(){const e=new Gt,{stop:t}=Vs(window,"open",()=>e.notify());return{observable:e,stop:t}}function BAt(e,t,n,r,i){return{get:a=>{const o=n.findView(a),s=i.findUrl(a),l=t.findTrackedSession(a);if(l&&o&&s){const u=r.findActionId(a);return{application_id:e,session_id:l.id,user_action:u?{id:u}:void 0,view:{id:o.id,name:o.name,referrer:s.referrer,url:s.url}}}}}}const VAt=gOt,FAt=Qf;function qAt(e){const t=Wg({expireDelay:FAt});e.subscribe(1,r=>{t.add(n(r),r.startClocks.relative)}),e.subscribe(6,({endClocks:r})=>{t.closeActive(r.relative)}),e.subscribe(3,r=>{const i=t.find(r.startClocks.relative);i&&(r.name&&(i.name=r.name),r.context&&(i.context=r.context),i.sessionIsActive=r.sessionIsActive)}),e.subscribe(10,()=>{t.reset()});function n(r){return{service:r.service,version:r.version,context:r.context,id:r.id,name:r.name,startClocks:r.startClocks}}return{findView:r=>t.find(r),stop:()=>{t.stop()}}}const ZSe="initial_document",ZAt=[[Mi.DOCUMENT,e=>ZSe===e],[Mi.XHR,e=>e==="xmlhttprequest"],[Mi.FETCH,e=>e==="fetch"],[Mi.BEACON,e=>e==="beacon"],[Mi.CSS,(e,t)=>/\.css$/i.test(t)],[Mi.JS,(e,t)=>/\.js$/i.test(t)],[Mi.IMAGE,(e,t)=>["image","img","icon"].includes(e)||/\.(gif|jpg|jpeg|tiff|png|svg|ico)$/i.exec(t)!==null],[Mi.FONT,(e,t)=>/\.(woff|eot|woff2|ttf)$/i.exec(t)!==null],[Mi.MEDIA,(e,t)=>["audio","video"].includes(e)||/\.(mp3|mp4)$/i.exec(t)!==null]];function HAt(e){const t=e.name;if(!LEt(t))return Mi.OTHER;const n=UEt(t);for(const[r,i]of ZAt)if(i(e.initiatorType,n))return r;return Mi.OTHER}function wne(...e){for(let t=1;t<e.length;t+=1)if(e[t-1]>e[t])return!1;return!0}function HSe(e){return e.initiatorType==="xmlhttprequest"||e.initiatorType==="fetch"}function GAt(e){const{duration:t,startTime:n,responseEnd:r}=e;return t===0&&n<r?fr(n,r):t}function KAt(e){if(!KSe(e))return;const{startTime:t,fetchStart:n,workerStart:r,redirectStart:i,redirectEnd:a,domainLookupStart:o,domainLookupEnd:s,connectStart:l,secureConnectionStart:u,connectEnd:d,requestStart:f,responseStart:h,responseEnd:m}=e,v={download:Id(t,h,m),first_byte:Id(t,f,h)};return 0<r&&r<n&&(v.worker=Id(t,r,n)),n<d&&(v.connect=Id(t,l,d),l<=u&&u<=d&&(v.ssl=Id(t,u,d))),n<s&&(v.dns=Id(t,o,s)),t<a&&(v.redirect=Id(t,i,a)),v}function GSe(e){return e.duration>=0}function KSe(e){const t=wne(e.startTime,e.fetchStart,e.domainLookupStart,e.domainLookupEnd,e.connectStart,e.connectEnd,e.requestStart,e.responseStart,e.responseEnd),n=WAt(e)?wne(e.startTime,e.redirectStart,e.redirectEnd,e.fetchStart):!0;return t&&n}function WAt(e){return e.redirectEnd>e.startTime}function Id(e,t,n){if(e<=t&&t<=n)return{duration:kt(fr(t,n)),start:kt(fr(e,t))}}function JAt(e){return e.nextHopProtocol===""?void 0:e.nextHopProtocol}function YAt(e){return e.deliveryType===""?"other":e.deliveryType}function XAt(e){if(e.startTime<e.responseStart){const{encodedBodySize:t,decodedBodySize:n,transferSize:r}=e;return{size:n,encoded_body_size:t,decoded_body_size:n,transfer_size:r}}return{size:void 0,encoded_body_size:void 0,decoded_body_size:void 0,transfer_size:void 0}}function _B(e){return e&&(!RTt(e)||Zw(Nc.TRACK_INTAKE_REQUESTS))}const QAt=/data:(.+)?(;base64)?,/g,eCt=24e3;function tCt(e,t=eCt){if(e.length<=t||!e.startsWith("data:"))return e;const n=e.substring(0,100).match(QAt);return n?`${n[0]}[...]`:e}const nCt=32*tp;function rCt(e,t){const n=aCt(e.requestBody,t.trackPayload);if(n){if(t.trackResponseErrors&&e.responseBody){const r=iCt(e.responseBody);r&&(n.errors_count=r.length,n.errors=r)}return n}}function iCt(e){let t;try{t=JSON.parse(e)}catch{return}if(!t||typeof t!="object")return;const n=t;return yf(n.errors)?n.errors.map(r=>{var i;return{message:r.message,path:r.path,locations:r.locations,code:(i=r.extensions)===null||i===void 0?void 0:i.code}}):void 0}function WSe(e,t){return t.allowedGraphQlUrls.find(n=>nO([n.match],e))}function aCt(e,t=!1){if(!e||typeof e!="string")return;let n;try{n=JSON.parse(e)}catch{return}if(!n||!n.query)return;const r=n.query.trim(),i=oCt(r),a=n.operationName;if(!i)return;let o;return n.variables&&(o=JSON.stringify(n.variables)),{operationType:i,operationName:a,variables:o,payload:t?cB(r,nCt,"..."):void 0}}function oCt(e){var t;return(t=e.match(/^\s*(query|mutation|subscription)\b/i))===null||t===void 0?void 0:t[1]}let xne=1;function sCt(e,t,n,r,i){const a=rAt(t,n,r,i);lCt(e,t,a),uCt(e,t,a)}function lCt(e,t,n){const r=bOt(t).subscribe(i=>{const a=i;if(_B(a.url))switch(a.state){case"start":n.traceXhr(a,a.xhr),a.requestIndex=JSe(),e.notify(7,{requestIndex:a.requestIndex,url:a.url});break;case"complete":n.clearTracingIfNeeded(a),e.notify(8,{duration:a.duration,method:a.method,requestIndex:a.requestIndex,spanId:a.spanId,startClocks:a.startClocks,status:a.status,traceId:a.traceId,traceSampled:a.traceSampled,type:aO.XHR,url:a.url,xhr:a.xhr,isAborted:a.isAborted,handlingStack:a.handlingStack,requestBody:a.requestBody,responseBody:a.responseBody});break}});return{stop:()=>r.unsubscribe()}}function uCt(e,t,n){const r=jSe({responseBodyAction:i=>{var a;return!((a=WSe(i.url,t))===null||a===void 0)&&a.trackResponseErrors?2:1}}).subscribe(i=>{var a;const o=i;if(_B(o.url))switch(o.state){case"start":n.traceFetch(o),o.requestIndex=JSe(),e.notify(7,{requestIndex:o.requestIndex,url:o.url});break;case"resolve":n.clearTracingIfNeeded(o),e.notify(8,{duration:fr(o.startClocks.timeStamp,ii()),method:o.method,requestIndex:o.requestIndex,responseType:o.responseType,spanId:o.spanId,startClocks:o.startClocks,status:o.status,traceId:o.traceId,traceSampled:o.traceSampled,type:aO.FETCH,url:o.url,response:o.response,init:o.init,input:o.input,isAborted:o.isAborted,handlingStack:o.handlingStack,requestBody:(a=o.init)===null||a===void 0?void 0:a.body,responseBody:o.responseBody});break}});return{stop:()=>r.unsubscribe()}}function JSe(){const e=xne;return xne+=1,e}function YSe(e){return Fw(e)&&e<0?void 0:e}function XSe({lifeCycle:e,isChildEvent:t,onChange:n=fn}){const r={errorCount:0,longTaskCount:0,resourceCount:0,actionCount:0,frustrationCount:0},i=e.subscribe(13,a=>{var o;if(!(a.type==="view"||a.type==="vital"||!t(a)))switch(a.type){case Et.ERROR:r.errorCount+=1,n();break;case Et.ACTION:r.actionCount+=1,a.action.frustration&&(r.frustrationCount+=a.action.frustration.type.length),n();break;case Et.LONG_TASK:r.longTaskCount+=1,n();break;case Et.RESOURCE:!((o=a._dd)===null||o===void 0)&&o.discarded||(r.resourceCount+=1,n());break}});return{stop:()=>{i.unsubscribe()},eventCounts:r}}function cCt(e,t){const n=Ki();let r=!1;const{stop:i}=Mc(e,window,["click","mousedown","keydown","touchstart","pointerdown"],s=>{if(!s.cancelable)return;const l={entryType:"first-input",processingStart:Ma(),processingEnd:Ma(),startTime:s.timeStamp,duration:0,name:"",cancelable:!1,target:null,toJSON:()=>({})};s.type==="pointerdown"?a(e,l):o(l)},{passive:!0,capture:!0});return{stop:i};function a(s,l){Mc(s,window,["pointerup","pointercancel"],u=>{u.type==="pointerup"&&o(l)},{once:!0})}function o(s){if(!r){r=!0,i();const l=s.processingStart-s.startTime;l>=0&&l<Ki()-n&&t(s)}}}var Jt;(function(e){e.EVENT="event",e.FIRST_INPUT="first-input",e.LARGEST_CONTENTFUL_PAINT="largest-contentful-paint",e.LAYOUT_SHIFT="layout-shift",e.LONG_TASK="longtask",e.LONG_ANIMATION_FRAME="long-animation-frame",e.NAVIGATION="navigation",e.PAINT="paint",e.RESOURCE="resource",e.VISIBILITY_STATE="visibility-state"})(Jt||(Jt={}));function Js(e,t){return new Gt(n=>{if(!window.PerformanceObserver)return;const r=l=>{const u=pCt(l);u.length>0&&n.notify(u)};let i,a=!0;const o=new PerformanceObserver($t(l=>{a?i=yi(()=>r(l.getEntries())):r(l.getEntries())}));try{o.observe(t)}catch{if([Jt.RESOURCE,Jt.NAVIGATION,Jt.LONG_TASK,Jt.PAINT].includes(t.type)){t.buffered&&(i=yi(()=>r(performance.getEntriesByType(t.type))));try{o.observe({entryTypes:[t.type]})}catch{return}}}a=!1,dCt(e);let s;return!rp(Jt.FIRST_INPUT)&&t.type===Jt.FIRST_INPUT&&({stop:s}=cCt(e,l=>{r([l])})),()=>{o.disconnect(),s&&s(),ho(i)}})}let lv;function dCt(e){return!lv&&fCt()&&"addEventListener"in performance&&(lv=Xn(e,performance,"resourcetimingbufferfull",()=>{performance.clearResourceTimings()})),()=>{lv==null||lv.stop()}}function fCt(){return window.performance!==void 0&&"getEntries"in performance}function rp(e){return window.PerformanceObserver&&PerformanceObserver.supportedEntryTypes!==void 0&&PerformanceObserver.supportedEntryTypes.includes(e)}function pCt(e){return e.filter(t=>!hCt(t))}function hCt(e){return e.entryType===Jt.RESOURCE&&(!_B(e.name)||!GSe(e))}function gL(e){return e.nodeType===Node.TEXT_NODE}function mCt(e){return e.nodeType===Node.COMMENT_NODE}function iu(e){return e.nodeType===Node.ELEMENT_NODE}function QSe(e){return iu(e)&&!!e.shadowRoot}function gCt(e){const t=e;return!!t.host&&t.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&iu(t.host)}function n3t(e){return e.childNodes.length>0||QSe(e)}function r3t(e,t){let n=e.firstChild;for(;n;)t(n),n=n.nextSibling;QSe(e)&&t(e.shadowRoot)}function yCt(e){return gCt(e)?e.host:e.parentNode}const eke=100,vCt=100,_ne="data-dd-excluded-activity-mutations";function SB(e,t,n,r,i,a){const o=wCt(e,t,n,r);return bCt(o,i,a)}function bCt(e,t,n){let r,i=!1;const a=yi($t(()=>u({hadActivity:!1})),eke),o=n!==void 0?yi($t(()=>u({hadActivity:!0,end:ii()})),n):void 0,s=e.subscribe(({isBusy:d})=>{ho(a),ho(r);const f=ii();d||(r=yi($t(()=>u({hadActivity:!0,end:f})),vCt))}),l=()=>{i=!0,ho(a),ho(r),ho(o),s.unsubscribe()};function u(d){i||(l(),t(d))}return{stop:l}}function wCt(e,t,n,r){return new Gt(i=>{const a=[];let o,s=0;return a.push(t.subscribe(u=>{u.every(xCt)||l()}),n.subscribe(l),Js(r,{type:Jt.RESOURCE}).subscribe(u=>{u.some(d=>!_2(r,d.name))&&l()}),e.subscribe(7,u=>{_2(r,u.url)||(o===void 0&&(o=u.requestIndex),s+=1,l())}),e.subscribe(8,u=>{_2(r,u.url)||o===void 0||u.requestIndex<o||(s-=1,l())})),()=>{a.forEach(u=>u.unsubscribe())};function l(){i.notify({isBusy:s>0})}})}function _2(e,t){return nO(e.excludedActivityUrls,t)}function xCt(e){const t=e.type==="characterData"?e.target.parentElement:e.target;return!!(t&&iu(t)&&t.matches(`[${_ne}], [${_ne}] *`))}const oO="data-dd-action-name",tke="Masked Element",nke=[oO,"data-testid","data-test","data-qa","data-cy","data-test-id","data-qa-id","data-testing","data-component","data-element","data-source-file"],_Ct=[ike,kCt],SCt=[ike,ECt,TCt];function Yw(e,t){if(!e.isConnected)return;let n,r=e;for(;r&&r.nodeName!=="HTML";){const i=Sne(r,_Ct,OCt,t,n);if(i)return i;n=Sne(r,SCt,ACt,t,n)||sO($Ct(r),n),r=r.parentElement}return n}function rke(e){return/[0-9]/.test(e)}function kCt(e){if(e.id&&!rke(e.id))return`#${CSS.escape(e.id)}`}function ECt(e){if(e.tagName==="BODY")return;const t=e.classList;for(let n=0;n<t.length;n+=1){const r=t[n];if(!rke(r))return`${CSS.escape(e.tagName)}.${CSS.escape(r)}`}}function TCt(e){return CSS.escape(e.tagName)}function ike(e,t){if(t){const r=n(t);if(r)return r}for(const r of nke){const i=n(r);if(i)return i}function n(r){if(e.hasAttribute(r))return`${CSS.escape(e.tagName)}[${r}="${CSS.escape(e.getAttribute(r))}"]`}}function $Ct(e){let t=e.parentElement.firstElementChild,n=1;for(;t&&t!==e;)t.tagName===e.tagName&&(n+=1),t=t.nextElementSibling;return`${CSS.escape(e.tagName)}:nth-of-type(${n})`}function Sne(e,t,n,r,i){for(const a of t){const o=a(e,r);if(o&&n(e,o,i))return sO(o,i)}}function OCt(e,t,n){return e.ownerDocument.querySelectorAll(sO(t,n)).length===1}function ACt(e,t,n){let r;if(n===void 0)r=a=>a.matches(t);else{const a=sO(`${t}:scope`,n);r=o=>o.querySelector(a)!==null}let i=e.parentElement.firstElementChild;for(;i;){if(i!==e&&r(i))return!1;i=i.nextElementSibling}return!0}function sO(e,t){return t?`${e}>${t}`:e}const jt={IGNORE:"ignore",HIDDEN:"hidden",ALLOW:Oh.ALLOW,MASK:Oh.MASK,MASK_USER_INPUT:Oh.MASK_USER_INPUT,MASK_UNLESS_ALLOWLISTED:Oh.MASK_UNLESS_ALLOWLISTED},ake="data-dd-privacy",i3t="hidden",CCt="dd-privacy-",S2="***",a3t="data:image/gif;base64,R0lGODlhAQABAIAAAMLCwgAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==",ICt={INPUT:!0,OUTPUT:!0,TEXTAREA:!0,SELECT:!0,OPTION:!0,DATALIST:!0,OPTGROUP:!0},jCt="x";function Ud(e){return`[${ake}="${e}"], .${CCt}${e}`}function lO(e,t,n){if(n&&n.has(e))return n.get(e);const r=yCt(e),i=r?lO(r,t,n):t,a=PCt(e),o=RCt(a,i);return n&&n.set(e,o),o}function RCt(e,t){switch(t){case jt.HIDDEN:case jt.IGNORE:return t}switch(e){case jt.ALLOW:case jt.MASK:case jt.MASK_USER_INPUT:case jt.MASK_UNLESS_ALLOWLISTED:case jt.HIDDEN:case jt.IGNORE:return e;default:return t}}function PCt(e){if(iu(e)){if(e.tagName==="BASE")return jt.ALLOW;if(e.tagName==="INPUT"){const t=e;if(t.type==="password"||t.type==="email"||t.type==="tel"||t.type==="hidden")return jt.MASK;const n=t.getAttribute("autocomplete");if(n&&(n.startsWith("cc-")||n.endsWith("-password")))return jt.MASK}if(e.matches(Ud(jt.HIDDEN)))return jt.HIDDEN;if(e.matches(Ud(jt.MASK)))return jt.MASK;if(e.matches(Ud(jt.MASK_UNLESS_ALLOWLISTED)))return jt.MASK_UNLESS_ALLOWLISTED;if(e.matches(Ud(jt.MASK_USER_INPUT)))return jt.MASK_USER_INPUT;if(e.matches(Ud(jt.ALLOW)))return jt.ALLOW;if(MCt(e))return jt.IGNORE}}function oke(e,t){switch(t){case jt.MASK:case jt.HIDDEN:case jt.IGNORE:return!0;case jt.MASK_UNLESS_ALLOWLISTED:return gL(e)?m_(e.parentNode)?!0:!lke(e.textContent||""):m_(e);case jt.MASK_USER_INPUT:return gL(e)?m_(e.parentNode):m_(e);default:return!1}}function NCt(e,t,n,r,i){if(r!==jt.MASK&&r!==jt.MASK_UNLESS_ALLOWLISTED||t===ake||nke.includes(t)||t===i.actionNameAttribute)return!1;switch(t){case"title":case"alt":case"placeholder":return!0}return!!(e==="A"&&t==="href"||e==="IFRAME"&&t==="srcdoc"||n&&t.startsWith("data-")||(e==="IMG"||e==="SOURCE")&&(t==="src"||t==="srcset"))}function m_(e){if(!e||e.nodeType!==e.ELEMENT_NODE)return!1;const t=e;if(t.tagName==="INPUT")switch(t.type){case"button":case"color":case"reset":case"submit":return!1}return!!ICt[t.tagName]}const ske=e=>e.replace(/\S/g,jCt);function o3t(e,t){var n;const r=(n=e.parentElement)===null||n===void 0?void 0:n.tagName;let i=e.textContent||"";if(r==="HEAD"&&!i.trim())return;const a=t;if(r==="SCRIPT")i=S2;else if(a===jt.HIDDEN)i=S2;else if(oke(e,a))if(r==="DATALIST"||r==="SELECT"||r==="OPTGROUP"){if(!i.trim())return}else r==="OPTION"?i=S2:a===jt.MASK_UNLESS_ALLOWLISTED?i=uke(i):i=ske(i);return i}function MCt(e){if(e.nodeName==="SCRIPT")return!0;if(e.nodeName==="LINK"){const n=t("rel");return/preload|prefetch/i.test(n)&&t("as")==="script"||n==="shortcut icon"||n==="icon"}if(e.nodeName==="META"){const n=t("name"),r=t("rel"),i=t("property");return/^msapplication-tile(image|color)$/.test(n)||n==="application-name"||r==="icon"||r==="apple-touch-icon"||r==="shortcut icon"||n==="keywords"||n==="description"||/^(og|twitter|fb):/.test(i)||/^(og|twitter):/.test(n)||n==="pinterest"||n==="robots"||n==="googlebot"||n==="bingbot"||e.hasAttribute("http-equiv")||n==="author"||n==="generator"||n==="framework"||n==="publisher"||n==="progid"||/^article:/.test(i)||/^product:/.test(i)||n==="google-site-verification"||n==="yandex-verification"||n==="csrf-token"||n==="p:domain_verify"||n==="verify-v1"||n==="verification"||n==="shopify-checkout-api-token"}function t(n){return(e.getAttribute(n)||"").toLowerCase()}return!1}function lke(e){var t;return!e||!e.trim()?!0:((t=window.$DD_ALLOW)===null||t===void 0?void 0:t.has(e.toLocaleLowerCase()))||!1}function uke(e,t){return lke(e)?e:t||ske(e)}const cke=_i,DCt=100;function zCt(e,t){const n=[];let r=0,i;a(e);function a(l){l.stopObservable.subscribe(o),n.push(l),ho(i),i=yi(s,cke)}function o(){r===1&&n.every(l=>l.isStopped())&&(r=2,t(n))}function s(){ho(i),r===0&&(r=1,o())}return{tryAppend:l=>r!==0?!1:n.length>0&&!LCt(n[n.length-1].event,l.event)?(s(),!1):(a(l),!0),stop:()=>{s()}}}function LCt(e,t){return e.target===t.target&&UCt(e,t)<=DCt&&e.timeStamp-t.timeStamp<=cke}function UCt(e,t){return Math.sqrt(Math.pow(e.clientX-t.clientX,2)+Math.pow(e.clientY-t.clientY,2))}function BCt(e,t,n=jt.ALLOW){const r=new Map,{actionNameAttribute:i}=t,a=kne(e,oO)||i&&kne(e,i);return a?{name:a,nameSource:"custom_attribute"}:n===jt.MASK?{name:tke,nameSource:"mask_placeholder"}:Ene(e,VCt,t,r)||Ene(e,FCt,t,r)||{name:"",nameSource:"blank"}}function kne(e,t){const n=e.closest(`[${t}]`);if(!n)return;const r=n.getAttribute(t);return fke(dke(r.trim()))}const VCt=[(e,t,n)=>{if("labels"in e&&e.labels&&e.labels.length>0)return H_(e.labels[0],t,n)},e=>{if(e.nodeName==="INPUT"){const t=e,n=t.getAttribute("type");if(n==="button"||n==="submit"||n==="reset")return{name:t.value,nameSource:"text_content"}}},(e,t,n)=>{if(e.nodeName==="BUTTON"||e.nodeName==="LABEL"||e.getAttribute("role")==="button")return H_(e,t,n)},(e,t,n)=>uv(e,"aria-label",t,n),(e,t,n)=>{const r=e.getAttribute("aria-labelledby");if(r)return{name:r.split(/\s+/).map(i=>ZCt(e,i)).filter(i=>!!i).map(i=>pke(i,t,n)).join(" "),nameSource:"text_content"}},(e,t,n)=>uv(e,"alt",t,n),(e,t,n)=>uv(e,"name",t,n),(e,t,n)=>uv(e,"title",t,n),(e,t,n)=>uv(e,"placeholder",t,n),(e,t,n)=>{if("options"in e&&e.options.length>0)return H_(e.options[0],t,n)}],FCt=[(e,t,n)=>H_(e,t,n)],qCt=10;function Ene(e,t,n,r){let i=e,a=0;for(;a<=qCt&&i&&i.nodeName!=="BODY"&&i.nodeName!=="HTML"&&i.nodeName!=="HEAD";){for(const o of t){const s=o(i,n,r);if(s){const{name:l,nameSource:u}=s,d=l&&l.trim();if(d)return{name:fke(dke(d)),nameSource:u}}}if(i.nodeName==="FORM")break;i=i.parentElement,a+=1}}function dke(e){return e.replace(/\s+/g," ")}function fke(e){return e.length>100?`${cB(e,100)} [...]`:e}function ZCt(e,t){return e.ownerDocument?e.ownerDocument.getElementById(t):null}function uv(e,t,n,r){const{enablePrivacyForActionName:i,defaultPrivacyLevel:a}=n;let o=e.getAttribute(t);if(o&&i){const s=lO(e,a,r);NCt(e.tagName,t,o,s,n)&&(o=uke(o,tke))}else o||(o="");return{name:o,nameSource:"standard_attribute"}}function H_(e,t,n){return{name:pke(e,t,n)||"",nameSource:"text_content"}}function pke(e,t,n){if(e.isContentEditable)return;const{enablePrivacyForActionName:r,actionNameAttribute:i,defaultPrivacyLevel:a}=t;if(Zw(Nc.USE_TREE_WALKER_FOR_ACTION_NAME))return HCt(e,i,r,a,n);if("innerText"in e){let o=e.innerText;const s=l=>{const u=e.querySelectorAll(l);for(let d=0;d<u.length;d+=1){const f=u[d];if("innerText"in f){const h=f.innerText;h&&h.trim().length>0&&(o=o.replace(h,""))}}};return s(`[${oO}]`),i&&s(`[${i}]`),r&&s(`${Ud(jt.HIDDEN)}, ${Ud(jt.MASK)}`),o}return e.textContent}function HCt(e,t,n,r,i){const a=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT,s);let o="";for(;a.nextNode();){const l=a.currentNode;if(iu(l)){(l.nodeName==="BR"||l.nodeName==="P"||["block","flex","grid","list-item","table","table-caption"].includes(getComputedStyle(l).display))&&(o+=" ");continue}o+=l.textContent||""}return o.replace(/\s+/g," ").trim();function s(l){const u=lO(l,r,i);if(n&&u&&oke(l,u))return NodeFilter.FILTER_REJECT;if(iu(l)){if(l.hasAttribute(oO)||t&&l.hasAttribute(t))return NodeFilter.FILTER_REJECT;const d=getComputedStyle(l);if(d.visibility!=="visible"||d.display==="none"||d.contentVisibility&&d.contentVisibility!=="visible")return NodeFilter.FILTER_REJECT}return NodeFilter.FILTER_ACCEPT}}function GCt(e,{onPointerDown:t,onPointerUp:n}){let r,i={selection:!1,input:!1,scroll:!1},a;const o=[Xn(e,window,"pointerdown",s=>{$ne(s)&&(r=Tne(),i={selection:!1,input:!1,scroll:!1},a=t(s))},{capture:!0}),Xn(e,window,"selectionchange",()=>{(!r||!Tne())&&(i.selection=!0)},{capture:!0}),Xn(e,window,"scroll",()=>{i.scroll=!0},{capture:!0,passive:!0}),Xn(e,window,"pointerup",s=>{if($ne(s)&&a){const l=i;n(a,s,()=>l),a=void 0}},{capture:!0}),Xn(e,window,"input",()=>{i.input=!0},{capture:!0})];return{stop:()=>{o.forEach(s=>s.stop())}}}function Tne(){const e=window.getSelection();return!e||e.isCollapsed}function $ne(e){return e.target instanceof Element&&e.isPrimary!==!1}const One=3;function KCt(e,t){if(WCt(e))return t.addFrustration(sv.RAGE_CLICK),e.some(Ane)&&t.addFrustration(sv.DEAD_CLICK),t.hasError&&t.addFrustration(sv.ERROR_CLICK),{isRage:!0};const n=e.some(r=>r.getUserActivity().selection);return e.forEach(r=>{r.hasError&&r.addFrustration(sv.ERROR_CLICK),Ane(r)&&!n&&r.addFrustration(sv.DEAD_CLICK)}),{isRage:!1}}function WCt(e){if(e.some(t=>t.getUserActivity().selection||t.getUserActivity().scroll))return!1;for(let t=0;t<e.length-(One-1);t+=1)if(e[t+One-1].event.timeStamp-e[t].event.timeStamp<=_i)return!0;return!1}const JCt='input:not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="range"]),textarea,select,[contenteditable],[contenteditable] *,canvas,a[href],a[href] *';function Ane(e){if(e.hasPageActivity||e.getUserActivity().input||e.getUserActivity().scroll)return!1;let t=e.event.target;return t.tagName==="LABEL"&&t.hasAttribute("for")&&(t=document.getElementById(t.getAttribute("for"))),!t||!t.matches(JCt)}const hke=10*_i,Yv=new Map;function YCt(e){const t=Yv.get(e);return Yv.delete(e),t}function mke(e,t){Yv.set(e,t),Yv.forEach((n,r)=>{fr(r,Ma())>hke&&Yv.delete(r)})}const XCt=5*Ji;function QCt(e,t,n,r){const i=Wg({expireDelay:XCt}),a=new Gt;let o;e.subscribe(10,()=>{i.reset()}),e.subscribe(5,u),e.subscribe(11,d=>{d.reason===Vh.UNLOADING&&u()});const{stop:s}=GCt(r,{onPointerDown:d=>eIt(r,e,t,d,n),onPointerUp:({clickActionBase:d,hadActivityOnPointerDown:f},h,m)=>{tIt(r,e,t,n,i,a,l,d,h,m,f)}});return{stop:()=>{u(),a.notify(),s()},actionContexts:{findActionId:d=>i.findAll(d)}};function l(d){if(!o||!o.tryAppend(d)){const f=d.clone();o=zCt(d,h=>{rIt(h,f)})}}function u(){o&&o.stop()}}function eIt(e,t,n,r,i){let a;if(e.enablePrivacyForActionName?a=lO(r.target,e.defaultPrivacyLevel):a=jt.ALLOW,a===jt.HIDDEN)return;const o=nIt(r,a,e);let s=!1;return SB(t,n,i,e,l=>{s=l.hadActivity},eke),{clickActionBase:o,hadActivityOnPointerDown:()=>s}}function tIt(e,t,n,r,i,a,o,s,l,u,d){var f;const h=gke(t,i,u,s,l);o(h);const m=(f=s==null?void 0:s.target)===null||f===void 0?void 0:f.selector;m&&mke(l.timeStamp,m);const{stop:v}=SB(t,n,r,e,x=>{x.hadActivity&&x.end<h.startClocks.timeStamp?h.discard():x.hadActivity?h.stop(x.end):d()?h.stop(h.startClocks.timeStamp):h.stop()},hke),y=t.subscribe(5,({endClocks:x})=>{h.stop(x.timeStamp)}),w=a.subscribe(()=>{h.stop()});h.stopObservable.subscribe(()=>{y.unsubscribe(),v(),w.unsubscribe()})}function nIt(e,t,n){const r=e.target.getBoundingClientRect(),i=Yw(e.target,n.actionNameAttribute);i&&mke(e.timeStamp,i);const{name:a,nameSource:o}=BCt(e.target,n,t);return{type:xB.CLICK,target:{width:Math.round(r.width),height:Math.round(r.height),selector:i},position:{x:Math.round(e.clientX-r.left),y:Math.round(e.clientY-r.top)},name:a,nameSource:o}}function gke(e,t,n,r,i){const a=wi(),o=Hr(),s=t.add(a,o.relative),l=XSe({lifeCycle:e,isChildEvent:v=>v.action!==void 0&&(Array.isArray(v.action.id)?v.action.id.includes(a):v.action.id===a)});let u=0,d;const f=[],h=new Gt;function m(v){u===0&&(d=v,u=1,d?s.close(uB(d)):s.remove(),l.stop(),h.notify())}return{event:i,stop:m,stopObservable:h,get hasError(){return l.eventCounts.errorCount>0},get hasPageActivity(){return d!==void 0},getUserActivity:n,addFrustration:v=>{f.push(v)},startClocks:o,isStopped:()=>u===1||u===2,clone:()=>gke(e,t,n,r,i),validate:v=>{if(m(),u!==1)return;const{resourceCount:y,errorCount:w,longTaskCount:x}=l.eventCounts,k={duration:d&&fr(o.timeStamp,d),startClocks:o,id:a,frustrationTypes:f,counts:{resourceCount:y,errorCount:w,longTaskCount:x},events:v??[i],event:i,...r};e.notify(0,k),u=2},discard:()=>{m(),u=2}}}function rIt(e,t){const{isRage:n}=KCt(e,t);n?(e.forEach(r=>r.discard()),t.stop(ii()),t.validate(e.map(r=>r.event))):(t.discard(),e.forEach(r=>r.validate()))}function iIt(e,t,n,r,i){const{unsubscribe:a}=e.subscribe(0,l=>{e.notify(12,Cne(l))});t.register(0,({startTime:l,eventType:u})=>{if(u!==Et.ERROR&&u!==Et.RESOURCE&&u!==Et.LONG_TASK)return Da;const d=o.findActionId(l);return d?{type:u,action:{id:d}}:Da}),t.register(1,({startTime:l})=>({action:{id:o.findActionId(l)}}));let o={findActionId:fn},s=fn;return i.trackUserInteractions&&({actionContexts:o,stop:s}=QCt(e,n,r,i)),{addAction:l=>{e.notify(12,Cne(l))},actionContexts:o,stop:()=>{a(),s()}}}function Cne(e){const t=k2(e)?{action:{id:e.id,loading_time:YSe(kt(e.duration)),frustration:{type:e.frustrationTypes},error:{count:e.counts.errorCount},long_task:{count:e.counts.longTaskCount},resource:{count:e.counts.resourceCount}},_dd:{action:{target:e.target,position:e.position,name_source:e.nameSource}}}:{context:e.context},n=ru({action:{id:wi(),target:{name:e.name},type:e.type},date:e.startClocks.timeStamp,type:Et.ACTION},t),r=k2(e)?e.duration:void 0,i=k2(e)?{events:e.events}:{handlingStack:e.handlingStack};return{rawRumEvent:n,duration:r,startTime:e.startClocks.relative,domainContext:i}}function k2(e){return e.type!==xB.CUSTOM}function aIt(e){const t=POt([H$.error]).subscribe(n=>e.notify(n.error));return{stop:()=>{t.unsubscribe()}}}function oIt(e,t){const n=g$t(e,[b0.cspViolation,b0.intervention]).subscribe(r=>t.notify(r));return{stop:()=>{n.unsubscribe()}}}function sIt(e,t,n){const r=new Gt;return n.subscribe(i=>{i.type===0&&r.notify(i.error)}),aIt(r),oIt(t,r),r.subscribe(i=>e.notify(14,{error:i})),lIt(e)}function lIt(e){return e.subscribe(14,({error:t})=>{e.notify(12,uIt(t))}),{addError:({error:t,handlingStack:n,componentStack:r,startClocks:i,context:a})=>{const o=mB({originalError:t,handlingStack:n,componentStack:r,startClocks:i,nonErrorPrefix:"Provided",source:Gg.CUSTOM,handling:"handled"});o.context=ru(o.context,a),e.notify(14,{error:o})}}}function uIt(e){const t={date:e.startClocks.timeStamp,error:{id:wi(),message:e.message,source:e.source,stack:e.stack,handling_stack:e.handlingStack,component_stack:e.componentStack,type:e.type,handling:e.handling,causes:e.causes,source_type:"browser",fingerprint:e.fingerprint,csp:e.csp},type:Et.ERROR,context:e.context},n={error:e.originalError,handlingStack:e.handlingStack};return{rawRumEvent:t,startTime:e.startClocks.relative,domainContext:n}}const Ine=new WeakSet;function cIt(e){if(!performance||!("getEntriesByName"in performance))return;const t=performance.getEntriesByName(e.url,"resource");if(!t.length||!("toJSON"in t[0]))return;const n=t.filter(r=>!Ine.has(r)).filter(r=>GSe(r)&&KSe(r)).filter(r=>dIt(r,e.startClocks.relative,yke({startTime:e.startClocks.relative,duration:e.duration})));if(n.length===1)return Ine.add(n[0]),n[0].toJSON()}function yke(e){return Hg(e.startTime,e.duration)}function dIt(e,t,n){return e.startTime>=t-1&&yke(e)<=Hg(n,1)}const fIt=2*Ji;function pIt(e){const t=hIt(e)||mIt(e);if(!(!t||t.traceTime<=Ki()-fIt))return t.traceId}function hIt(e){const t=e.querySelector("meta[name=dd-trace-id]"),n=e.querySelector("meta[name=dd-trace-time]");return vke(t&&t.content,n&&n.content)}function mIt(e){const t=gIt(e);if(t)return vke(y0(t,"trace-id"),y0(t,"trace-time"))}function vke(e,t){const n=t&&Number(t);if(!(!e||!n))return{traceId:e,traceTime:n}}function gIt(e){for(let t=0;t<e.childNodes.length;t+=1){const n=jne(e.childNodes[t]);if(n)return n}if(e.body)for(let t=e.body.childNodes.length-1;t>=0;t-=1){const n=e.body.childNodes[t],r=jne(n);if(r)return r;if(!gL(n))break}}function jne(e){if(e&&mCt(e)){const t=/^\s*DATADOG;(.*?)\s*$/.exec(e.data);if(t)return t[1]}}function bke(){if(rp(Jt.NAVIGATION)){const n=performance.getEntriesByType(Jt.NAVIGATION)[0];if(n)return n}const e=yIt(),t={entryType:Jt.NAVIGATION,initiatorType:"navigation",name:window.location.href,startTime:0,duration:e.loadEventEnd,decodedBodySize:0,encodedBodySize:0,transferSize:0,workerStart:0,toJSON:()=>({...t,toJSON:void 0}),...e};return t}function yIt(){const e={},t=performance.timing;for(const n in t)if(Fw(t[n])){const r=n,i=t[r];e[r]=i===0?0:uB(i)}return e}function vIt(e,t,n=bke){vB(e,"interactive",()=>{const r=n(),i=Object.assign(r.toJSON(),{entryType:Jt.RESOURCE,initiatorType:ZSe,duration:r.responseEnd,traceId:pIt(document),toJSON:()=>({...i,toJSON:void 0})});t(i)})}const bIt=1e3;function wIt(e){const t=new Set,n=e.subscribe(8,r=>{t.add(r),t.size>bIt&&(Jw("Too many requests"),t.delete(t.values().next().value))});return{getMatchingRequest(r){let i=1/0,a;for(const o of t){const s=r.startTime-o.startClocks.relative;0<=s&&s<i&&o.url===r.name&&(i=Math.abs(s),a=o)}return a&&t.delete(a),a},stop(){n.unsubscribe()}}}function xIt(e,t,n,r=ROt(),i=vIt){let a;const o=t.trackEarlyRequests;o?a=wIt(e):e.subscribe(8,u=>{l(()=>_It(u,t,n))});const s=Js(t,{type:Jt.RESOURCE,buffered:!0}).subscribe(u=>{for(const d of u)(o||!HSe(d))&&l(()=>Rne(d,t,n,a))});i(t,u=>{l(()=>Rne(u,t,n,a))});function l(u){r.push(()=>{const d=u();d&&e.notify(12,d)})}return{stop:()=>{r.stop(),s.unsubscribe()}}}function _It(e,t,n){const r=cIt(e);return wke(r,e,n,t)}function Rne(e,t,n,r){const i=HSe(e)&&r?r.getMatchingRequest(e):void 0;return wke(e,i,n,t)}function wke(e,t,n,r){if(!e&&!t)return;const i=t?TIt(t,r):$It(e,r);if(!r.trackResources&&!i)return;const a=e?J$(e.startTime):t.startClocks,o=e?GAt(e):OIt(n,a,t.duration),s=t&&SIt(t,r),l=ru({date:a.timeStamp,resource:{id:wi(),duration:kt(o),type:t?t.type===aO.XHR?Mi.XHR:Mi.FETCH:HAt(e),method:t?t.method:void 0,status_code:t?t.status:AIt(e.responseStatus),url:t?tCt(t.url):e.name,protocol:e&&JAt(e),delivery_type:e&&YAt(e),graphql:s},type:Et.RESOURCE,_dd:{discarded:!r.trackResources}},i,e&&EIt(e));return{startTime:a.relative,duration:o,rawRumEvent:l,domainContext:kIt(e,t)}}function SIt(e,t){const n=WSe(e.url,t);if(n)return rCt(e,n)}function kIt(e,t){if(t){const n={performanceEntry:e,isAborted:t.isAborted,handlingStack:t.handlingStack};return t.type===aO.XHR?{xhr:t.xhr,...n}:{requestInput:t.input,requestInit:t.init,response:t.response,error:t.error,...n}}return{performanceEntry:e}}function EIt(e){const{renderBlockingStatus:t}=e;return{resource:{render_blocking_status:t,...XAt(e),...KAt(e)}}}function TIt(e,t){if(e.traceSampled&&e.traceId&&e.spanId)return{_dd:{span_id:e.spanId.toString(),trace_id:e.traceId.toString(),rule_psr:t.rulePsr}}}function $It(e,t){if(e.traceId)return{_dd:{trace_id:e.traceId,span_id:BSe().toString(),rule_psr:t.rulePsr}}}function OIt(e,t,n){return e.wasInPageStateDuringPeriod("frozen",t.relative,n)?void 0:n}function AIt(e){return e===0?void 0:e}function CIt(e,t,n){const{stop:r,eventCounts:i}=XSe({lifeCycle:e,isChildEvent:a=>a.view.id===t,onChange:n});return{stop:r,eventCounts:i}}const IIt=10*Ji;function jIt(e,t,n){return{stop:Js(e,{type:Jt.PAINT,buffered:!0}).subscribe(r=>{const i=r.find(a=>a.name==="first-contentful-paint"&&a.startTime<t.timeStamp&&a.startTime<IIt);i&&n(i.startTime)}).unsubscribe}}function RIt(e,t){requestAnimationFrame(()=>{requestAnimationFrame(()=>{t(fr(e,Ma()))})})}function PIt(e,t,n){const r=Js(e,{type:Jt.FIRST_INPUT,buffered:!0}).subscribe(i=>{const a=i.find(o=>o.startTime<t.timeStamp);if(a){const o=fr(a.startTime,a.processingStart);let s;a.target&&iu(a.target)&&(s=Yw(a.target,e.actionNameAttribute)),n({delay:o>=0?o:0,time:a.startTime,targetSelector:s})}});return{stop:()=>{r.unsubscribe()}}}function NIt(e,t,n=bke){return zIt(e,()=>{const r=n();DIt(r)||t(MIt(r))})}function MIt(e){return{domComplete:e.domComplete,domContentLoaded:e.domContentLoadedEventEnd,domInteractive:e.domInteractive,loadEvent:e.loadEventEnd,firstByte:e.responseStart>=0&&e.responseStart<=Ma()?e.responseStart:void 0}}function DIt(e){return e.loadEventEnd<=0}function zIt(e,t){let n;const{stop:r}=vB(e,"complete",()=>{n=yi(()=>t())});return{stop:()=>{r(),ho(n)}}}const LIt=10*Ji;function UIt(e,t,n,r){let i=1/0;const{stop:a}=Mc(e,n,["pointerdown","keydown"],l=>{i=l.timeStamp},{capture:!0,once:!0});let o=0;const s=Js(e,{type:Jt.LARGEST_CONTENTFUL_PAINT,buffered:!0}).subscribe(l=>{const u=U_e(l,d=>d.entryType===Jt.LARGEST_CONTENTFUL_PAINT&&d.startTime<i&&d.startTime<t.timeStamp&&d.startTime<LIt&&d.size>o);if(u){let d;u.element&&(d=Yw(u.element,e.actionNameAttribute)),r({value:u.startTime,targetSelector:d,resourceUrl:BIt(u)}),o=u.size}});return{stop:()=>{a(),s.unsubscribe()}}}function BIt(e){return e.url===""?void 0:e.url}function xke(e,t,n=window){if(document.visibilityState==="hidden")return{timeStamp:0,stop:fn};if(rp(Jt.VISIBILITY_STATE)){const a=performance.getEntriesByType(Jt.VISIBILITY_STATE).filter(o=>o.name==="hidden").find(o=>o.startTime>=t.relative);if(a)return{timeStamp:a.startTime,stop:fn}}let r=1/0;const{stop:i}=Mc(e,n,["pagehide","visibilitychange"],a=>{(a.type==="pagehide"||document.visibilityState==="hidden")&&(r=a.timeStamp,i())},{capture:!0});return{get timeStamp(){return r},stop:i}}function VIt(e,t,n,r){const i={},{stop:a}=NIt(e,f=>{n(f.loadEvent),i.navigationTimings=f,r()}),o=xke(e,t),{stop:s}=jIt(e,o,f=>{i.firstContentfulPaint=f,r()}),{stop:l}=UIt(e,o,window,f=>{i.largestContentfulPaint=f,r()}),{stop:u}=PIt(e,o,f=>{i.firstInput=f,r()});function d(){a(),s(),l(),u(),o.stop()}return{stop:d,initialViewMetrics:i}}const yL=(e,t)=>e*t,FIt=(e,t)=>{const n=Math.max(e.left,t.left),r=Math.max(e.top,t.top),i=Math.min(e.right,t.right),a=Math.min(e.bottom,t.bottom);return n>=i||r>=a?0:yL(i-n,a-r)},Pne=e=>{const t=yL(e.previousRect.width,e.previousRect.height),n=yL(e.currentRect.width,e.currentRect.height),r=FIt(e.previousRect,e.currentRect);return t+n-r};function qIt(e,t,n){if(!WIt())return{stop:fn};let r=0,i;n({value:0});const a=KIt(),o=Js(e,{type:Jt.LAYOUT_SHIFT,buffered:!0}).subscribe(s=>{var l;for(const u of s){if(u.hadRecentInput||u.startTime<t)continue;const{cumulatedValue:d,isMaxValue:f}=a.update(u);if(f){const h=ZIt(u.sources);i={target:h!=null&&h.node?new WeakRef(h.node):void 0,time:fr(t,u.startTime),previousRect:h==null?void 0:h.previousRect,currentRect:h==null?void 0:h.currentRect,devicePixelRatio:window.devicePixelRatio}}if(d>r){r=d;const h=(l=i==null?void 0:i.target)===null||l===void 0?void 0:l.deref();n({value:Wv(r,4),targetSelector:h&&Yw(h,e.actionNameAttribute),time:i==null?void 0:i.time,previousRect:i!=null&&i.previousRect?Nne(i.previousRect):void 0,currentRect:i!=null&&i.currentRect?Nne(i.currentRect):void 0,devicePixelRatio:i==null?void 0:i.devicePixelRatio})}}});return{stop:()=>{o.unsubscribe()}}}function ZIt(e){let t;for(const n of e)if(n.node&&iu(n.node)){const r=Pne(n);(!t||Pne(t)<r)&&(t=n)}return t}function Nne({x:e,y:t,width:n,height:r}){return{x:e,y:t,width:n,height:r}}const HIt=5*_i,GIt=_i;function KIt(){let e=0,t,n,r=0;return{update:i=>{const a=t===void 0||i.startTime-n>=GIt||i.startTime-t>=HIt;let o;return a?(t=n=i.startTime,r=e=i.value,o=!0):(e+=i.value,n=i.startTime,o=i.value>r,o&&(r=i.value)),{cumulatedValue:e,isMaxValue:o}}}}function WIt(){return rp(Jt.LAYOUT_SHIFT)&&"WeakRef"in window}let G_,_ke=0,E2=1/0,T2=0;function JIt(){"interactionCount"in performance||G_||(G_=new window.PerformanceObserver($t(e=>{e.getEntries().forEach(t=>{const n=t;n.interactionId&&(E2=Math.min(E2,n.interactionId),T2=Math.max(T2,n.interactionId),_ke=(T2-E2)/7+1)})})),G_.observe({type:"event",buffered:!0,durationThreshold:0}))}const Mne=()=>G_?_ke:window.performance.interactionCount||0,Dne=10,YIt=1*Ji;function XIt(e,t,n){if(!tjt())return{getInteractionToNextPaint:()=>{},setViewEnd:fn,stop:fn};const{getViewInteractionCount:r,stopViewInteractionCount:i}=ejt(n);let a=1/0;const o=QIt(r);let s=-1,l,u;function d(m){for(const y of m)y.interactionId&&y.startTime>=t&&y.startTime<=a&&o.process(y);const v=o.estimateP98Interaction();v&&v.duration!==s&&(s=v.duration,u=fr(t,v.startTime),l=YCt(v.startTime),!l&&v.target&&iu(v.target)&&(l=Yw(v.target,e.actionNameAttribute)))}const f=Js(e,{type:Jt.FIRST_INPUT,buffered:!0}).subscribe(d),h=Js(e,{type:Jt.EVENT,durationThreshold:40,buffered:!0}).subscribe(d);return{getInteractionToNextPaint:()=>{if(s>=0)return{value:Math.min(s,YIt),targetSelector:l,time:u};if(r())return{value:0}},setViewEnd:m=>{a=m,i()},stop:()=>{h.unsubscribe(),f.unsubscribe()}}}function QIt(e){const t=[];function n(){t.sort((r,i)=>i.duration-r.duration).splice(Dne)}return{process(r){const i=t.findIndex(o=>r.interactionId===o.interactionId),a=t[t.length-1];i!==-1?r.duration>t[i].duration&&(t[i]=r,n()):(t.length<Dne||r.duration>a.duration)&&(t.push(r),n())},estimateP98Interaction(){const r=Math.min(t.length-1,Math.floor(e()/50));return t[r]}}}function ejt(e){JIt();const t=e===Ml.INITIAL_LOAD?0:Mne();let n={stopped:!1};function r(){return Mne()-t}return{getViewInteractionCount:()=>n.stopped?n.interactionCount:r(),stopViewInteractionCount:()=>{n={stopped:!0,interactionCount:r()}}}}function tjt(){return rp(Jt.EVENT)&&window.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype}function njt(e,t,n,r,i,a,o){let s=i===Ml.INITIAL_LOAD,l=!0;const u=[],d=xke(r,a);function f(){if(!l&&!s&&u.length>0){const m=Math.max(...u);m<d.timeStamp-a.relative&&o(m)}}const{stop:h}=SB(e,t,n,r,m=>{l&&(l=!1,m.hadActivity&&u.push(fr(a.timeStamp,m.end)),f())});return{stop:()=>{h(),d.stop()},setLoadEvent:m=>{s&&(s=!1,u.push(m),f())}}}function s3t(){let e;const t=window.visualViewport;return t?e=t.pageLeft-t.offsetLeft:window.scrollX!==void 0?e=window.scrollX:e=window.pageXOffset||0,Math.round(e)}function rjt(){let e;const t=window.visualViewport;return t?e=t.pageTop-t.offsetTop:window.scrollY!==void 0?e=window.scrollY:e=window.pageYOffset||0,Math.round(e)}let $2;function ijt(e){return $2||($2=ajt(e)),$2}function ajt(e){return new Gt(t=>{const{throttled:n}=Y$(()=>{t.notify(kB())},200);return Xn(e,window,"resize",n,{capture:!0,passive:!0}).stop})}function kB(){const e=window.visualViewport;return e?{width:Number(e.width*e.scale),height:Number(e.height*e.scale)}:{width:Number(window.innerWidth||0),height:Number(window.innerHeight||0)}}const ojt=_i;function sjt(e,t,n,r=ujt(e)){let i=0,a=0,o=0;const s=r.subscribe(({scrollDepth:l,scrollTop:u,scrollHeight:d})=>{let f=!1;if(l>i&&(i=l,f=!0),d>a){a=d;const h=Ma();o=fr(t.relative,h),f=!0}f&&n({maxDepth:Math.min(i,a),maxDepthScrollTop:u,maxScrollHeight:a,maxScrollHeightTime:o})});return{stop:()=>s.unsubscribe()}}function ljt(){const e=rjt(),{height:t}=kB(),n=Math.round((document.scrollingElement||document.documentElement).scrollHeight),r=Math.round(t+e);return{scrollHeight:n,scrollDepth:r,scrollTop:e}}function ujt(e,t=ojt){return new Gt(n=>{function r(){n.notify(ljt())}if(window.ResizeObserver){const i=Y$(r,t,{leading:!1,trailing:!0}),a=document.scrollingElement||document.documentElement,o=new ResizeObserver($t(i.throttled));a&&o.observe(a);const s=Xn(e,window,"scroll",i.throttled,{passive:!0});return()=>{i.cancel(),o.disconnect(),s.stop()}}})}function cjt(e,t,n,r,i,a,o){const s={},{stop:l,setLoadEvent:u}=njt(e,t,n,r,a,o,y=>{s.loadingTime=y,i()}),{stop:d}=sjt(r,o,y=>{s.scroll=y}),{stop:f}=qIt(r,o.relative,y=>{s.cumulativeLayoutShift=y,i()}),{stop:h,getInteractionToNextPaint:m,setViewEnd:v}=XIt(r,o.relative,a);return{stop:()=>{l(),f(),d()},stopINPTracking:h,setLoadEvent:u,setViewEnd:v,getCommonViewMetrics:()=>(s.interactionToNextPaint=m(),s)}}function djt(e,t){const{stop:n}=Xn(e,window,"pageshow",r=>{r.persisted&&t(r)},{capture:!0});return n}function fjt(e,t,n){RIt(e.relative,r=>{t.firstContentfulPaint=r,t.largestContentfulPaint={value:r},n()})}const pjt=3e3,hjt=5*Ji,mjt=5*Ji;function gjt(e,t,n,r,i,a,o,s){const l=new Set;let u=h(Ml.INITIAL_LOAD,M_e(),s),d;m();let f;o&&(f=v(a),i.trackBfcacheViews&&(d=djt(i,y=>{u.end();const w=J$(y.timeStamp);u=h(Ml.BF_CACHE,w,void 0)})));function h(y,w,x){const k=yjt(t,n,r,i,e,y,w,x);return l.add(k),k.stopObservable.subscribe(()=>{l.delete(k)}),k}function m(){t.subscribe(10,()=>{u=h(Ml.ROUTE_CHANGE,void 0,{name:u.name,service:u.service,version:u.version,context:u.contextManager.getContext()})}),t.subscribe(9,()=>{u.end({sessionIsActive:!1})})}function v(y){return y.subscribe(({oldLocation:w,newLocation:x})=>{bjt(w,x)&&(u.end(),u=h(Ml.ROUTE_CHANGE))})}return{addTiming:(y,w=ii())=>{u.addTiming(y,w)},startView:(y,w)=>{u.end({endClocks:w}),u=h(Ml.ROUTE_CHANGE,w,y)},setViewContext:y=>{u.contextManager.setContext(y)},setViewContextProperty:(y,w)=>{u.contextManager.setContextProperty(y,w)},setViewName:y=>{u.setViewName(y)},getViewContext:()=>u.contextManager.getContext(),stop:()=>{f&&f.unsubscribe(),d&&d(),u.end(),l.forEach(y=>y.stop())}}}function yjt(e,t,n,r,i,a,o=Hr(),s){const l=wi(),u=new Gt,d={};let f=0,h;const m=g0(i),v=iO();let y=!0,w=s==null?void 0:s.name;const x=(s==null?void 0:s.service)||r.service,k=(s==null?void 0:s.version)||r.version,S=s==null?void 0:s.context;S&&v.setContext(S);const E={id:l,name:w,startClocks:o,service:x,version:k,context:S};e.notify(1,E),e.notify(2,E);const{throttled:C,cancel:A}=Y$(z,pjt,{leading:!1}),{setLoadEvent:I,setViewEnd:j,stop:N,stopINPTracking:P,getCommonViewMetrics:M}=cjt(e,t,n,r,ne,a,o),{stop:B,initialViewMetrics:K}=a===Ml.INITIAL_LOAD?VIt(r,o,I,ne):{stop:fn,initialViewMetrics:{}};a===Ml.BF_CACHE&&fjt(o,K,ne);const{stop:Z,eventCounts:W}=CIt(e,l,ne),U=Zg(z,hjt),G=e.subscribe(11,V=>{V.reason===Vh.UNLOADING&&z()});z(),v.changeObservable.subscribe(ne);function J(){e.notify(3,{id:l,name:w,context:v.getContext(),startClocks:o,sessionIsActive:y})}function ne(){J(),C()}function z(){A(),J(),f+=1;const V=h===void 0?ii():h.timeStamp;e.notify(4,{customTimings:d,documentVersion:f,id:l,name:w,service:x,version:k,context:v.getContext(),loadingType:a,location:m,startClocks:o,commonViewMetrics:M(),initialViewMetrics:K,duration:fr(o.timeStamp,V),isActive:h===void 0,sessionIsActive:y,eventCounts:W})}return{get name(){return w},service:x,version:k,contextManager:v,stopObservable:u,end(V={}){var Y,D;h||(h=(Y=V.endClocks)!==null&&Y!==void 0?Y:Hr(),y=(D=V.sessionIsActive)!==null&&D!==void 0?D:!0,e.notify(5,{endClocks:h}),e.notify(6,{endClocks:h}),W$(U),j(h.relative),N(),G.unsubscribe(),z(),yi(()=>{this.stop()},mjt))},stop(){B(),Z(),P(),u.notify()},addTiming(V,Y){if(h)return;const D=PEt(Y)?Y:fr(o.timeStamp,Y);d[vjt(V)]=D,ne()},setViewName(V){w=V,z()}}}function vjt(e){const t=e.replace(/[^a-zA-Z0-9-_.@$]/g,"_");return t!==e&&xt.warn(`Invalid timing name: ${e}, sanitized to: ${t}`),t}function bjt(e,t){return e.pathname!==t.pathname||!wjt(t.hash)&&zne(t.hash)!==zne(e.hash)}function wjt(e){const t=e.substring(1);return t!==""&&!!document.getElementById(t)}function zne(e){const t=e.indexOf("?");return t<0?e:e.slice(0,t)}function xjt(e,t,n,r,i,a,o,s,l,u){return e.subscribe(4,d=>e.notify(12,_jt(d,n,s))),t.register(0,({startTime:d,eventType:f})=>{const h=l.findView(d);return h?{type:f,service:h.service,version:h.version,context:h.context,view:{id:h.id,name:h.name}}:Dc}),t.register(1,({startTime:d})=>{var f;return{view:{id:(f=l.findView(d))===null||f===void 0?void 0:f.id}}}),gjt(r,e,i,a,n,o,!n.trackViewsManually,u)}function _jt(e,t,n){var r,i,a,o,s,l,u,d,f,h,m,v,y,w,x,k,S,E;const C=n.getReplayStats(e.id),A=(i=(r=e.commonViewMetrics)===null||r===void 0?void 0:r.cumulativeLayoutShift)===null||i===void 0?void 0:i.devicePixelRatio,I={_dd:{document_version:e.documentVersion,replay_stats:C,cls:A?{device_pixel_ratio:A}:void 0,configuration:{start_session_replay_recording_manually:t.startSessionReplayRecordingManually}},date:e.startClocks.timeStamp,type:Et.VIEW,view:{action:{count:e.eventCounts.actionCount},frustration:{count:e.eventCounts.frustrationCount},cumulative_layout_shift:(a=e.commonViewMetrics.cumulativeLayoutShift)===null||a===void 0?void 0:a.value,cumulative_layout_shift_time:kt((o=e.commonViewMetrics.cumulativeLayoutShift)===null||o===void 0?void 0:o.time),cumulative_layout_shift_target_selector:(s=e.commonViewMetrics.cumulativeLayoutShift)===null||s===void 0?void 0:s.targetSelector,first_byte:kt((l=e.initialViewMetrics.navigationTimings)===null||l===void 0?void 0:l.firstByte),dom_complete:kt((u=e.initialViewMetrics.navigationTimings)===null||u===void 0?void 0:u.domComplete),dom_content_loaded:kt((d=e.initialViewMetrics.navigationTimings)===null||d===void 0?void 0:d.domContentLoaded),dom_interactive:kt((f=e.initialViewMetrics.navigationTimings)===null||f===void 0?void 0:f.domInteractive),error:{count:e.eventCounts.errorCount},first_contentful_paint:kt(e.initialViewMetrics.firstContentfulPaint),first_input_delay:kt((h=e.initialViewMetrics.firstInput)===null||h===void 0?void 0:h.delay),first_input_time:kt((m=e.initialViewMetrics.firstInput)===null||m===void 0?void 0:m.time),first_input_target_selector:(v=e.initialViewMetrics.firstInput)===null||v===void 0?void 0:v.targetSelector,interaction_to_next_paint:kt((y=e.commonViewMetrics.interactionToNextPaint)===null||y===void 0?void 0:y.value),interaction_to_next_paint_time:kt((w=e.commonViewMetrics.interactionToNextPaint)===null||w===void 0?void 0:w.time),interaction_to_next_paint_target_selector:(x=e.commonViewMetrics.interactionToNextPaint)===null||x===void 0?void 0:x.targetSelector,is_active:e.isActive,name:e.name,largest_contentful_paint:kt((k=e.initialViewMetrics.largestContentfulPaint)===null||k===void 0?void 0:k.value),largest_contentful_paint_target_selector:(S=e.initialViewMetrics.largestContentfulPaint)===null||S===void 0?void 0:S.targetSelector,load_event:kt((E=e.initialViewMetrics.navigationTimings)===null||E===void 0?void 0:E.loadEvent),loading_time:YSe(kt(e.commonViewMetrics.loadingTime)),loading_type:e.loadingType,long_task:{count:e.eventCounts.longTaskCount},performance:Sjt(e.commonViewMetrics,e.initialViewMetrics),resource:{count:e.eventCounts.resourceCount},time_spent:kt(e.duration)},display:e.commonViewMetrics.scroll?{scroll:{max_depth:e.commonViewMetrics.scroll.maxDepth,max_depth_scroll_top:e.commonViewMetrics.scroll.maxDepthScrollTop,max_scroll_height:e.commonViewMetrics.scroll.maxScrollHeight,max_scroll_height_time:kt(e.commonViewMetrics.scroll.maxScrollHeightTime)}}:void 0,privacy:{replay_level:t.defaultPrivacyLevel},device:{locale:navigator.language,locales:navigator.languages,time_zone:WOt()}};return ed(e.customTimings)||(I.view.custom_timings=C_e(e.customTimings,kt)),{rawRumEvent:I,startTime:e.startClocks.relative,duration:e.duration,domainContext:{location:e.location}}}function Sjt({cumulativeLayoutShift:e,interactionToNextPaint:t},{firstContentfulPaint:n,firstInput:r,largestContentfulPaint:i}){return{cls:e&&{score:e.value,timestamp:kt(e.time),target_selector:e.targetSelector,previous_rect:e.previousRect,current_rect:e.currentRect},fcp:n&&{timestamp:kt(n)},fid:r&&{duration:kt(r.delay),timestamp:kt(r.time),target_selector:r.targetSelector},inp:t&&{duration:kt(t.value),timestamp:kt(t.time),target_selector:t.targetSelector},lcp:i&&{timestamp:kt(i.value),target_selector:i.targetSelector,resource_url:i.resourceUrl}}}const kjt="rum";function Ejt(e,t,n){const r=uOt(e,kjt,i=>$jt(e,i),n);return r.expireObservable.subscribe(()=>{t.notify(9)}),r.renewObservable.subscribe(()=>{t.notify(10)}),r.sessionStateUpdateObservable.subscribe(({previousState:i,newState:a})=>{if(!i.forcedReplay&&a.forcedReplay){const o=r.findSession();o&&(o.isReplayForced=!0)}}),{findTrackedSession:i=>{const a=r.findSession(i);if(!(!a||a.trackingType==="0"))return{id:a.id,sessionReplay:a.trackingType==="1"?1:a.isReplayForced?2:0,anonymousId:a.anonymousId}},expire:r.expire,expireObservable:r.expireObservable,setForcedReplay:()=>r.updateSessionState({forcedReplay:"1"})}}function Tjt(){const e={id:"00000000-aaaa-0000-aaaa-000000000000",sessionReplay:_Se("records")?1:0};return{findTrackedSession:()=>e,expire:fn,expireObservable:new Gt,setForcedReplay:fn}}function $jt(e,t){return Ojt(t)?t:Xd(e.sessionSampleRate)?Xd(e.sessionReplaySampleRate)?"1":"2":"0"}function Ojt(e){return e==="0"||e==="1"||e==="2"}function Ajt(e,t,n,r,i,a){const o=[e.rumEndpointBuilder];e.replica&&o.push(e.replica.rumEndpointBuilder);const s=SSe({encoder:a(2),request:xSe(o,n),flushController:kSe({pageMayExitObservable:r,sessionExpireObservable:i})});return t.subscribe(13,l=>{l.type===Et.VIEW?s.upsert(l,l.view.id):s.add(l)}),s}function Cjt(e){const t=Ww();e.subscribe(13,n=>{t.send("rum",n)})}const Ijt=Qf;function jjt(e,t,n,r){const i=Wg({expireDelay:Ijt});let a;e.subscribe(1,({startClocks:l})=>{const u=r.href;i.add(s({url:u,referrer:a||document.referrer}),l.relative),a=u}),e.subscribe(6,({endClocks:l})=>{i.closeActive(l.relative)});const o=n.subscribe(({newLocation:l})=>{const u=i.find();if(u){const d=Ma();i.closeActive(d),i.add(s({url:l.href,referrer:u.referrer}),d)}});function s({url:l,referrer:u}){return{url:l,referrer:u}}return t.register(0,({startTime:l,eventType:u})=>{const d=i.find(l);return d?{type:u,view:{url:d.url,referrer:d.referrer}}:Dc}),{findUrl:l=>i.find(l),stop:()=>{o.unsubscribe(),i.stop()}}}function Rjt(e,t){let n=g0(t);return new Gt(r=>{const{stop:i}=Pjt(e,o),{stop:a}=Njt(e,o);function o(){if(n.href===t.href)return;const s=g0(t);r.notify({newLocation:s,oldLocation:n}),n=s}return()=>{i(),a()}})}function Pjt(e,t){const{stop:n}=Vs(Lne("pushState"),"pushState",({onPostCall:a})=>{a(t)}),{stop:r}=Vs(Lne("replaceState"),"replaceState",({onPostCall:a})=>{a(t)}),{stop:i}=Xn(e,window,"popstate",t);return{stop:()=>{n(),r(),i()}}}function Njt(e,t){return Xn(e,window,"hashchange",t)}function Lne(e){return Object.prototype.hasOwnProperty.call(history,e)?history:History.prototype}const Mjt=Qf;function Djt(e,t,n){const r=Wg({expireDelay:Mjt});return e.subscribe(1,({startClocks:i})=>{r.add({},i.relative)}),e.subscribe(6,({endClocks:i})=>{r.closeActive(i.relative)}),t.register(0,({startTime:i,eventType:a})=>{if(!n.trackFeatureFlagsForEvents.concat([Et.VIEW,Et.ERROR]).includes(a))return Da;const o=r.find(i);return!o||ed(o)?Da:{type:a,feature_flags:o}}),{addFeatureFlagEvaluation:(i,a)=>{const o=r.find();o&&(o[i]=a)}}}const zjt=10*_i;let Fh,g_;function Ljt(e,t,n){e.metricsEnabled&&(Ske(),g_=!1,t.subscribe(13,()=>{g_=!0}),n.subscribe(({bytesCount:r,messagesCount:i})=>{g_&&(g_=!1,Fh.batchCount+=1,Bne(Fh.batchBytesCount,r),Bne(Fh.batchMessagesCount,i))}),Zg(Ujt,zjt))}function Ujt(){Fh.batchCount!==0&&(rO("Customer data measures",Fh),Ske())}function Une(){return{min:1/0,max:0,sum:0}}function Bne(e,t){e.sum+=t,e.min=Math.min(e.min,t),e.max=Math.max(e.max,t)}function Ske(){Fh={batchCount:0,batchBytesCount:Une(),batchMessagesCount:Une()}}const Bjt=4e3,Vjt=500,Fjt=Qf;function qjt(e,t,n=Vjt){const r=Wg({expireDelay:Fjt,maxEntries:Bjt});let i;rp(Jt.VISIBILITY_STATE)&&performance.getEntriesByType(Jt.VISIBILITY_STATE).forEach(l=>{const u=l.name==="hidden"?"hidden":"active";o(u,l.startTime)}),o(kke(),Ma());const{stop:a}=Mc(t,window,["pageshow","focus","blur","visibilitychange","resume","freeze","pagehide"],l=>{o(Hjt(l),l.timeStamp)},{capture:!0});function o(l,u=Ma()){l!==i&&(i=l,r.closeActive(u),r.add({state:i,startTime:u},u))}function s(l,u,d){return r.findAll(u,d).some(f=>f.state===l)}return e.register(0,({startTime:l,duration:u=0,eventType:d})=>{if(d===Et.VIEW){const f=r.findAll(l,u);return{type:d,_dd:{page_states:Zjt(f,l,n)}}}return d===Et.ACTION||d===Et.ERROR?{type:d,view:{in_foreground:s("active",l,0)}}:Da}),{wasInPageStateDuringPeriod:s,addPageState:o,stop:()=>{a(),r.stop()}}}function Zjt(e,t,n){if(e.length!==0)return e.slice(-n).reverse().map(({state:r,startTime:i})=>({state:r,start:kt(fr(t,i))}))}function Hjt(e){return e.type==="freeze"?"frozen":e.type==="pagehide"?e.persisted?"frozen":"terminated":kke()}function kke(){return document.visibilityState==="hidden"?"hidden":document.hasFocus()?"active":"passive"}function Gjt(e,t){let n;const r=requestAnimationFrame($t(()=>{n=kB()})),i=ijt(t).subscribe(a=>{n=a}).unsubscribe;return e.register(0,({eventType:a})=>({type:a,display:n?{viewport:n}:void 0})),{stop:()=>{i(),r&&cancelAnimationFrame(r)}}}function Kjt(e,t){const n=window.cookieStore?Wjt(e):Yjt;return new Gt(r=>n(t,i=>r.notify(i)))}function Wjt(e){return(t,n)=>Xn(e,window.cookieStore,"change",r=>{const i=r.changed.find(a=>a.name===t)||r.deleted.find(a=>a.name===t);i&&n(i.value)}).stop}const Jjt=_i;function Yjt(e,t){const n=y0(document.cookie,e),r=Zg(()=>{const i=y0(document.cookie,e);i!==n&&t(i)},Jjt);return()=>{W$(r)}}const Vne="datadog-ci-visibility-test-execution-id";function Xjt(e,t,n=Kjt(e,Vne)){var r;let i=fc(Vne)||((r=window.Cypress)===null||r===void 0?void 0:r.env("traceId"));const a=n.subscribe(o=>{i=o});return t.register(0,({eventType:o})=>typeof i!="string"?Da:{type:o,session:{type:"ci_test"},ci_test:{test_execution_id:i}}),{stop:()=>{a.unsubscribe()}}}function Qjt(e,t){const n=Js(t,{type:Jt.LONG_ANIMATION_FRAME,buffered:!0}).subscribe(r=>{for(const i of r){const a=J$(i.startTime),o={date:a.timeStamp,long_task:{id:wi(),entry_type:MSe.LONG_ANIMATION_FRAME,duration:kt(i.duration),blocking_duration:kt(i.blockingDuration),first_ui_event_timestamp:kt(i.firstUIEventTimestamp),render_start:kt(i.renderStart),style_and_layout_start:kt(i.styleAndLayoutStart),start_time:kt(i.startTime),scripts:i.scripts.map(s=>({duration:kt(s.duration),pause_duration:kt(s.pauseDuration),forced_style_and_layout_duration:kt(s.forcedStyleAndLayoutDuration),start_time:kt(s.startTime),execution_start:kt(s.executionStart),source_url:s.sourceURL,source_function_name:s.sourceFunctionName,source_char_position:s.sourceCharPosition,invoker:s.invoker,invoker_type:s.invokerType,window_attribution:s.windowAttribution}))},type:Et.LONG_TASK,_dd:{discarded:!1}};e.notify(12,{rawRumEvent:o,startTime:a.relative,duration:i.duration,domainContext:{performanceEntry:i}})}});return{stop:()=>n.unsubscribe()}}function eRt(e,t){const n=Js(t,{type:Jt.LONG_TASK,buffered:!0}).subscribe(r=>{for(const i of r){if(i.entryType!==Jt.LONG_TASK||!t.trackLongTasks)break;const a=J$(i.startTime),o={date:a.timeStamp,long_task:{id:wi(),entry_type:MSe.LONG_TASK,duration:kt(i.duration)},type:Et.LONG_TASK,_dd:{discarded:!1}};e.notify(12,{rawRumEvent:o,startTime:a.relative,duration:i.duration,domainContext:{performanceEntry:i}})}});return{stop(){n.unsubscribe()}}}function tRt(e){e.register(0,({eventType:t})=>{if(!ASe())return Da;const n=$Se(),r=OSe();return{type:t,session:{type:"synthetics"},synthetics:{test_id:n,result_id:r,injected:TSe()}}})}function nRt(e,t,n){const r=gB(e),i=n(r);return fB(t).forEach(([a,o])=>vL(e,r,a.split(/\.|(?=\[\])/),o)),i}function vL(e,t,n,r){const[i,...a]=n;if(i==="[]"){Array.isArray(e)&&Array.isArray(t)&&e.forEach((o,s)=>vL(o,t[s],a,r));return}if(!(!Fne(e)||!Fne(t))){if(a.length>0)return vL(e[i],t[i],a,r);rRt(e,i,t[i],r)}}function rRt(e,t,n,r){const i=ep(n);i===r?e[t]=Un(n):r==="object"&&(i==="undefined"||i==="null")&&(e[t]={})}function Fne(e){return ep(e)==="object"}const sh={"view.name":"string","view.url":"string","view.referrer":"string"},lh={context:"object"},uh={service:"string",version:"string"};let Eke;function iRt(e,t,n,r,i){Eke={[Et.VIEW]:{"view.performance.lcp.resource_url":"string",...lh,...sh,...uh},[Et.ERROR]:{"error.message":"string","error.stack":"string","error.resource.url":"string","error.fingerprint":"string",...lh,...sh,...uh},[Et.RESOURCE]:{"resource.url":"string","resource.graphql.variables":"string",...lh,...sh,...uh},[Et.ACTION]:{"action.target.name":"string",...lh,...sh,...uh},[Et.LONG_TASK]:{"long_task.scripts[].source_url":"string","long_task.scripts[].invoker":"string",...lh,...sh,...uh},[Et.VITAL]:{...lh,...sh,...uh}};const a={[Et.ERROR]:g2(Et.ERROR,r,i),[Et.ACTION]:g2(Et.ACTION,r,i),[Et.VITAL]:g2(Et.VITAL,r,i)};t.subscribe(12,({startTime:o,duration:s,rawRumEvent:l,domainContext:u})=>{const d=n.triggerHook(0,{eventType:l.type,startTime:o,duration:s});if(d===Dc)return;const f=ru(d,l,{ddtags:dSe(e).join(",")});aRt(f,e.beforeSend,u,a)&&(ed(f.context)&&delete f.context,t.notify(13,f))})}function aRt(e,t,n,r){var i;if(t){const a=nRt(e,Eke[e.type],o=>t(o,n));if(a===!1&&e.type!==Et.VIEW)return!1;a===!1&&xt.warn("Can't dismiss view events using beforeSend!")}return!(!((i=r[e.type])===null||i===void 0)&&i.isLimitReached())}function oRt(e,t,n,r){e.register(0,({eventType:i,startTime:a})=>{const o=t.findTrackedSession(a),s=r.findView(a);if(!o||!s)return Dc;let l,u,d;return i===Et.VIEW?(l=n.getReplayStats(s.id)?!0:void 0,u=o.sessionReplay===1,d=s.sessionIsActive?void 0:!1):l=n.isRecording()?!0:void 0,{type:i,session:{id:o.id,type:"user",has_replay:l,sampled_for_replay:u,is_active:d}}}),e.register(1,({startTime:i})=>{const a=t.findTrackedSession(i);return a?{session:{id:a.id}}:Da})}function sRt(e){e.register(0,({eventType:t})=>({type:t,connectivity:pSe()}))}function lRt(e,t,n){e.register(0,({eventType:r})=>{const i=t.source;return{type:r,_dd:{format_version:2,drift:jEt(),configuration:{session_sample_rate:Wv(t.sessionSampleRate,3),session_replay_sample_rate:Wv(t.sessionReplaySampleRate,3),profiling_sample_rate:Wv(t.profilingSampleRate,3),beta_encode_cookie_options:t.betaEncodeCookieOptions},browser_sdk_version:og()?"6.24.1":void 0,sdk_name:n},application:{id:t.applicationId},date:ii(),source:i}}),e.register(1,()=>({application:{id:t.applicationId}}))}function uRt(e,t){e.register(1,()=>t.isGranted()?Da:Dc)}const cRt=F$t,dRt=[Et.ACTION,Et.ERROR,Et.LONG_TASK,Et.RESOURCE,Et.VITAL];function fRt(e){return{addEvent:(t,n,r,i)=>{dRt.includes(n.type)&&e.notify(12,{startTime:t,rawRumEvent:n,domainContext:r,duration:i})}}}function pRt(e,t){if(!t.metricsEnabled)return{stop:fn};const{unsubscribe:n}=e.subscribe(4,({initialViewMetrics:r})=>{!r.largestContentfulPaint||!r.navigationTimings||(rO("Initial view metrics",{metrics:hRt(r.largestContentfulPaint,r.navigationTimings)}),n())});return{stop:n}}function hRt(e,t){return{lcp:{value:e.value},navigation:{domComplete:t.domComplete,domContentLoaded:t.domContentLoaded,domInteractive:t.domInteractive,firstByte:t.firstByte,loadEvent:t.loadEvent}}}function mRt(e,t,n,r,i,a,o,s,l){const u=[],d=new VAt,f=cRt();d.subscribe(13,Ce=>fSe("rum",Ce));const h=Ce=>{d.notify(14,{error:Ce}),Jw("Error reported to customer",{"error.message":Ce.message})},m=L$t(e),v=m.subscribe(Ce=>{d.notify(11,Ce)});u.push(()=>v.unsubscribe());const y=K$t("browser-rum-sdk",e,f,h,m,i);u.push(y.stop);const w=og()?Tjt():Ejt(e,d,a);if(og())Cjt(d);else{const Ce=Ajt(e,d,h,m,w.expireObservable,i);u.push(()=>Ce.stop()),Ljt(y,d,Ce.flushController.flushObservable)}const x=zAt(),k=Rjt(e,location),{observable:S,stop:E}=UAt();u.push(E),lRt(f,e,l);const C=qjt(f,e),A=qAt(d);u.push(()=>A.stop());const I=jjt(d,f,k,location);u.push(()=>I.stop());const j=Djt(d,f,e);oRt(f,w,t,A),sRt(f),uRt(f,a);const N=ZOt(f,e,"rum"),P=HOt(f,e,w,"rum"),M=qOt(f,e,"rum"),{actionContexts:B,addAction:K,addEvent:Z,stop:W}=gRt(d,f,e,C,x,S,h);u.push(W);const{addTiming:U,startView:G,setViewName:J,setViewContext:ne,setViewContextProperty:z,getViewContext:V,stop:Y}=xjt(d,f,e,location,x,S,k,t,A,r);u.push(Y);const{stop:D}=pRt(d,y);u.push(D);const{stop:ie}=xIt(d,e,C);if(u.push(ie),e.trackLongTasks)if(rp(Jt.LONG_ANIMATION_FRAME)){const{stop:Ce}=Qjt(d,e);u.push(Ce)}else eRt(d,e);const{addError:me}=sIt(d,e,s);s.unbuffer(),sCt(d,e,w,P,M);const Se=YOt(d,C,o),be=BAt(e.applicationId,w,A,B,I);return u.push(()=>n.stop()),{addAction:K,addEvent:Z,addError:me,addTiming:U,addFeatureFlagEvaluation:j.addFeatureFlagEvaluation,startView:G,setViewContext:ne,setViewContextProperty:z,getViewContext:V,setViewName:J,lifeCycle:d,viewHistory:A,session:w,stopSession:()=>w.expire(),getInternalContext:be.get,startDurationVital:Se.startDurationVital,stopDurationVital:Se.stopDurationVital,addDurationVital:Se.addDurationVital,addOperationStepVital:Se.addOperationStepVital,globalContext:N,userContext:P,accountContext:M,telemetry:y,stop:()=>{u.forEach(Ce=>Ce())},hooks:f}}function gRt(e,t,n,r,i,a,o){const s=iIt(e,t,i,a,n),l=fRt(e),u=Gjt(t,n),d=Xjt(n,t);return tRt(t),iRt(n,e,t,o),{pageStateHistory:r,addAction:s.addAction,addEvent:l.addEvent,actionContexts:s.actionContexts,stop:()=>{s.stop(),d.stop(),u.stop(),r.stop()}}}function yRt(e,{session:t,viewContext:n,errorType:r}){const i=t?t.id:"no-session-id",a=[];r!==void 0&&a.push(`error-type=${r}`),n&&(a.push(`seed=${n.id}`),a.push(`from=${n.startClocks.timeStamp}`));const o=vRt(e),s=`/rum/replay/sessions/${i}`;return`${o}${s}?${a.join("&")}`}function vRt(e){const t=e.site,n=e.subdomain||bRt(e);return`https://${n?`${n}.`:""}${t}`}function bRt(e){switch(e.site){case Qd:case STt:return"app";case Q_e:return"dd";default:return}}const wRt=1e3;let co;function l3t(e){return uO(e).segments_count}function u3t(e){uO(e).segments_count+=1}function c3t(e){uO(e).records_count+=1}function d3t(e,t){uO(e).segments_total_raw_size+=t}function xRt(e){return co==null?void 0:co.get(e)}function uO(e){co||(co=new Map);let t;return co.has(e)?t=co.get(e):(t={records_count:0,segments_count:0,segments_total_raw_size:0},co.set(e,t),co.size>wRt&&_Rt()),t}function _Rt(){if(!co)return;const e=co.keys().next().value;e&&co.delete(e)}function Tke(e,t,n){let r=0,i=[],a,o=!0,s=0;const l=[],{stop:u}=Xn(e,t,"message",({data:h})=>{if(h.type!=="wrote"||h.streamId!==n)return;const m=l[0];m&&(m.id===h.id?(l.shift(),r+=h.additionalBytesCount,i.push(h.result),a=h.trailer,m.writeCallback?m.writeCallback(h.result.byteLength):m.finishCallback&&m.finishCallback()):m.id<h.id&&u())});function d(){const h=i.length===0?new Uint8Array(0):oSe(i.concat(a)),m={rawBytesCount:r,output:h,outputBytesCount:h.byteLength,encoding:"deflate"};return r=0,i=[],m}function f(){o||(t.postMessage({action:"reset",streamId:n}),o=!0)}return{isAsync:!0,get isEmpty(){return o},write(h,m){t.postMessage({action:"write",id:s,data:h,streamId:n}),l.push({id:s,writeCallback:m,data:h}),o=!1,s+=1},finish(h){f(),l.length?(l.forEach(m=>{delete m.writeCallback}),l[l.length-1].finishCallback=()=>h(d())):h(d())},finishSync(){f();const h=l.map(m=>m.data).join("");return l.length=0,{...d(),pendingData:h}},estimateEncodedBytesCount(h){return h.length/8},stop(){u()}}}function EB({configuredUrl:e,error:t,source:n,scriptType:r}){if(xt.error(`${n} failed to start: an error occurred while initializing the ${r}:`,t),t instanceof Event||t instanceof Error&&SRt(t.message)){let i;e?i=`Please make sure the ${r} URL ${e} is correct and CSP is correctly configured.`:i="Please make sure CSP is correctly configured.",xt.error(`${i} See documentation at ${G$}/integrations/content_security_policy_logs/#use-csp-with-real-user-monitoring-and-session-replay`)}else r==="worker"&&yB(t)}function SRt(e){return e.includes("Content Security Policy")||e.includes("requires 'TrustedScriptURL'")}const kRt=30*_i;function $ke(e){return new Worker(e.workerUrl||URL.createObjectURL(new Blob(['(()=>{function t(t){if(1===t.length)return t[0];const e=t.reduce((t,e)=>t+e.length,0),a=new Uint8Array(e);let n=0;for(const e of t)a.set(e,n),n+=e.length;return a}function e(t){for(var e=t.length;--e>=0;)t[e]=0}var a=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),n=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),r=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),i=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),s=Array(576);e(s);var h=Array(60);e(h);var l=Array(512);e(l);var _=Array(256);e(_);var o=Array(29);e(o);var d,u,f,c=Array(30);function p(t,e,a,n,r){this.static_tree=t,this.extra_bits=e,this.extra_base=a,this.elems=n,this.max_length=r,this.has_stree=t&&t.length}function g(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}e(c);var v=function(t){return t<256?l[t]:l[256+(t>>>7)]},w=function(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255},m=function(t,e,a){t.bi_valid>16-a?(t.bi_buf|=e<<t.bi_valid&65535,w(t,t.bi_buf),t.bi_buf=e>>16-t.bi_valid,t.bi_valid+=a-16):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=a)},b=function(t,e,a){m(t,a[2*e],a[2*e+1])},y=function(t,e){var a=0;do{a|=1&t,t>>>=1,a<<=1}while(--e>0);return a>>>1},z=function(t,e,a){var n,r,i=Array(16),s=0;for(n=1;n<=15;n++)i[n]=s=s+a[n-1]<<1;for(r=0;r<=e;r++){var h=t[2*r+1];0!==h&&(t[2*r]=y(i[h]++,h))}},k=function(t){var e;for(e=0;e<286;e++)t.dyn_ltree[2*e]=0;for(e=0;e<30;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0},x=function(t){t.bi_valid>8?w(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},A=function(t,e,a,n){var r=2*e,i=2*a;return t[r]<t[i]||t[r]===t[i]&&n[e]<=n[a]},U=function(t,e,a){for(var n=t.heap[a],r=a<<1;r<=t.heap_len&&(r<t.heap_len&&A(e,t.heap[r+1],t.heap[r],t.depth)&&r++,!A(e,n,t.heap[r],t.depth));)t.heap[a]=t.heap[r],a=r,r<<=1;t.heap[a]=n},B=function(t,e,r){var i,s,h,l,d=0;if(0!==t.last_lit)do{i=t.pending_buf[t.d_buf+2*d]<<8|t.pending_buf[t.d_buf+2*d+1],s=t.pending_buf[t.l_buf+d],d++,0===i?b(t,s,e):(h=_[s],b(t,h+256+1,e),0!==(l=a[h])&&(s-=o[h],m(t,s,l)),i--,h=v(i),b(t,h,r),0!==(l=n[h])&&(i-=c[h],m(t,i,l)))}while(d<t.last_lit);b(t,256,e)},I=function(t,e){var a,n,r,i=e.dyn_tree,s=e.stat_desc.static_tree,h=e.stat_desc.has_stree,l=e.stat_desc.elems,_=-1;for(t.heap_len=0,t.heap_max=573,a=0;a<l;a++)0!==i[2*a]?(t.heap[++t.heap_len]=_=a,t.depth[a]=0):i[2*a+1]=0;for(;t.heap_len<2;)i[2*(r=t.heap[++t.heap_len]=_<2?++_:0)]=1,t.depth[r]=0,t.opt_len--,h&&(t.static_len-=s[2*r+1]);for(e.max_code=_,a=t.heap_len>>1;a>=1;a--)U(t,i,a);r=l;do{a=t.heap[1],t.heap[1]=t.heap[t.heap_len--],U(t,i,1),n=t.heap[1],t.heap[--t.heap_max]=a,t.heap[--t.heap_max]=n,i[2*r]=i[2*a]+i[2*n],t.depth[r]=(t.depth[a]>=t.depth[n]?t.depth[a]:t.depth[n])+1,i[2*a+1]=i[2*n+1]=r,t.heap[1]=r++,U(t,i,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],function(t,e){var a,n,r,i,s,h,l=e.dyn_tree,_=e.max_code,o=e.stat_desc.static_tree,d=e.stat_desc.has_stree,u=e.stat_desc.extra_bits,f=e.stat_desc.extra_base,c=e.stat_desc.max_length,p=0;for(i=0;i<=15;i++)t.bl_count[i]=0;for(l[2*t.heap[t.heap_max]+1]=0,a=t.heap_max+1;a<573;a++)(i=l[2*l[2*(n=t.heap[a])+1]+1]+1)>c&&(i=c,p++),l[2*n+1]=i,n>_||(t.bl_count[i]++,s=0,n>=f&&(s=u[n-f]),h=l[2*n],t.opt_len+=h*(i+s),d&&(t.static_len+=h*(o[2*n+1]+s)));if(0!==p){do{for(i=c-1;0===t.bl_count[i];)i--;t.bl_count[i]--,t.bl_count[i+1]+=2,t.bl_count[c]--,p-=2}while(p>0);for(i=c;0!==i;i--)for(n=t.bl_count[i];0!==n;)(r=t.heap[--a])>_||(l[2*r+1]!==i&&(t.opt_len+=(i-l[2*r+1])*l[2*r],l[2*r+1]=i),n--)}}(t,e),z(i,_,t.bl_count)},E=function(t,e,a){var n,r,i=-1,s=e[1],h=0,l=7,_=4;for(0===s&&(l=138,_=3),e[2*(a+1)+1]=65535,n=0;n<=a;n++)r=s,s=e[2*(n+1)+1],++h<l&&r===s||(h<_?t.bl_tree[2*r]+=h:0!==r?(r!==i&&t.bl_tree[2*r]++,t.bl_tree[32]++):h<=10?t.bl_tree[34]++:t.bl_tree[36]++,h=0,i=r,0===s?(l=138,_=3):r===s?(l=6,_=3):(l=7,_=4))},C=function(t,e,a){var n,r,i=-1,s=e[1],h=0,l=7,_=4;for(0===s&&(l=138,_=3),n=0;n<=a;n++)if(r=s,s=e[2*(n+1)+1],!(++h<l&&r===s)){if(h<_)do{b(t,r,t.bl_tree)}while(0!==--h);else 0!==r?(r!==i&&(b(t,r,t.bl_tree),h--),b(t,16,t.bl_tree),m(t,h-3,2)):h<=10?(b(t,17,t.bl_tree),m(t,h-3,3)):(b(t,18,t.bl_tree),m(t,h-11,7));h=0,i=r,0===s?(l=138,_=3):r===s?(l=6,_=3):(l=7,_=4)}},D=!1,M=function(t,e,a,n){m(t,0+(n?1:0),3),function(t,e,a){x(t),w(t,a),w(t,~a),t.pending_buf.set(t.window.subarray(e,e+a),t.pending),t.pending+=a}(t,e,a)},j=M,L=function(t,e,a,n){for(var r=65535&t,i=t>>>16&65535,s=0;0!==a;){a-=s=a>2e3?2e3:a;do{i=i+(r=r+e[n++]|0)|0}while(--s);r%=65521,i%=65521}return r|i<<16},S=new Uint32Array(function(){for(var t,e=[],a=0;a<256;a++){t=a;for(var n=0;n<8;n++)t=1&t?3988292384^t>>>1:t>>>1;e[a]=t}return e}()),T=function(t,e,a,n){var r=S,i=n+a;t^=-1;for(var s=n;s<i;s++)t=t>>>8^r[255&(t^e[s])];return-1^t},O={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},q=j,F=function(t,e,a){return t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&a,t.last_lit++,0===e?t.dyn_ltree[2*a]++:(t.matches++,e--,t.dyn_ltree[2*(_[a]+256+1)]++,t.dyn_dtree[2*v(e)]++),t.last_lit===t.lit_bufsize-1},G=-2,H=258,J=262,K=103,N=113,P=666,Q=function(t,e){return t.msg=O[e],e},R=function(t){return(t<<1)-(t>4?9:0)},V=function(t){for(var e=t.length;--e>=0;)t[e]=0},W=function(t,e,a){return(e<<t.hash_shift^a)&t.hash_mask},X=function(t){var e=t.state,a=e.pending;a>t.avail_out&&(a=t.avail_out),0!==a&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+a),t.next_out),t.next_out+=a,e.pending_out+=a,t.total_out+=a,t.avail_out-=a,e.pending-=a,0===e.pending&&(e.pending_out=0))},Y=function(t,e){(function(t,e,a,n){var r,l,_=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=function(t){var e,a=4093624447;for(e=0;e<=31;e++,a>>>=1)if(1&a&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<256;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0}(t)),I(t,t.l_desc),I(t,t.d_desc),_=function(t){var e;for(E(t,t.dyn_ltree,t.l_desc.max_code),E(t,t.dyn_dtree,t.d_desc.max_code),I(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*i[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),r=t.opt_len+3+7>>>3,(l=t.static_len+3+7>>>3)<=r&&(r=l)):r=l=a+5,a+4<=r&&-1!==e?M(t,e,a,n):4===t.strategy||l===r?(m(t,2+(n?1:0),3),B(t,s,h)):(m(t,4+(n?1:0),3),function(t,e,a,n){var r;for(m(t,e-257,5),m(t,a-1,5),m(t,n-4,4),r=0;r<n;r++)m(t,t.bl_tree[2*i[r]+1],3);C(t,t.dyn_ltree,e-1),C(t,t.dyn_dtree,a-1)}(t,t.l_desc.max_code+1,t.d_desc.max_code+1,_+1),B(t,t.dyn_ltree,t.dyn_dtree)),k(t),n&&x(t)})(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,X(t.strm)},Z=function(t,e){t.pending_buf[t.pending++]=e},$=function(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e},tt=function(t,e,a,n){var r=t.avail_in;return r>n&&(r=n),0===r?0:(t.avail_in-=r,e.set(t.input.subarray(t.next_in,t.next_in+r),a),1===t.state.wrap?t.adler=L(t.adler,e,r,a):2===t.state.wrap&&(t.adler=T(t.adler,e,r,a)),t.next_in+=r,t.total_in+=r,r)},et=function(t,e){var a,n,r=t.max_chain_length,i=t.strstart,s=t.prev_length,h=t.nice_match,l=t.strstart>t.w_size-J?t.strstart-(t.w_size-J):0,_=t.window,o=t.w_mask,d=t.prev,u=t.strstart+H,f=_[i+s-1],c=_[i+s];t.prev_length>=t.good_match&&(r>>=2),h>t.lookahead&&(h=t.lookahead);do{if(_[(a=e)+s]===c&&_[a+s-1]===f&&_[a]===_[i]&&_[++a]===_[i+1]){i+=2,a++;do{}while(_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&i<u);if(n=H-(u-i),i=u-H,n>s){if(t.match_start=e,s=n,n>=h)break;f=_[i+s-1],c=_[i+s]}}}while((e=d[e&o])>l&&0!==--r);return s<=t.lookahead?s:t.lookahead},at=function(t){var e,a,n,r,i,s=t.w_size;do{if(r=t.window_size-t.lookahead-t.strstart,t.strstart>=s+(s-J)){t.window.set(t.window.subarray(s,s+s),0),t.match_start-=s,t.strstart-=s,t.block_start-=s,e=a=t.hash_size;do{n=t.head[--e],t.head[e]=n>=s?n-s:0}while(--a);e=a=s;do{n=t.prev[--e],t.prev[e]=n>=s?n-s:0}while(--a);r+=s}if(0===t.strm.avail_in)break;if(a=tt(t.strm,t.window,t.strstart+t.lookahead,r),t.lookahead+=a,t.lookahead+t.insert>=3)for(i=t.strstart-t.insert,t.ins_h=t.window[i],t.ins_h=W(t,t.ins_h,t.window[i+1]);t.insert&&(t.ins_h=W(t,t.ins_h,t.window[i+3-1]),t.prev[i&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=i,i++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead<J&&0!==t.strm.avail_in)},nt=function(t,e){for(var a,n;;){if(t.lookahead<J){if(at(t),t.lookahead<J&&0===e)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=W(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==a&&t.strstart-a<=t.w_size-J&&(t.match_length=et(t,a)),t.match_length>=3)if(n=F(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=W(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!==--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=W(t,t.ins_h,t.window[t.strstart+1]);else n=F(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(n&&(Y(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Y(t,!1),0===t.strm.avail_out)?1:2},rt=function(t,e){for(var a,n,r;;){if(t.lookahead<J){if(at(t),t.lookahead<J&&0===e)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=W(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==a&&t.prev_length<t.max_lazy_match&&t.strstart-a<=t.w_size-J&&(t.match_length=et(t,a),t.match_length<=5&&(1===t.strategy||3===t.match_length&&t.strstart-t.match_start>4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){r=t.strstart+t.lookahead-3,n=F(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=r&&(t.ins_h=W(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!==--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,n&&(Y(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if((n=F(t,0,t.window[t.strstart-1]))&&Y(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(n=F(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Y(t,!1),0===t.strm.avail_out)?1:2};function it(t,e,a,n,r){this.good_length=t,this.max_lazy=e,this.nice_length=a,this.max_chain=n,this.func=r}var st=[new it(0,0,0,0,function(t,e){var a=65535;for(a>t.pending_buf_size-5&&(a=t.pending_buf_size-5);;){if(t.lookahead<=1){if(at(t),0===t.lookahead&&0===e)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var n=t.block_start+a;if((0===t.strstart||t.strstart>=n)&&(t.lookahead=t.strstart-n,t.strstart=n,Y(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-J&&(Y(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(Y(t,!1),t.strm.avail_out),1)}),new it(4,4,8,4,nt),new it(4,5,16,8,nt),new it(4,6,32,32,nt),new it(4,4,16,16,rt),new it(8,16,32,32,rt),new it(8,16,128,128,rt),new it(8,32,128,256,rt),new it(32,128,258,1024,rt),new it(32,258,258,4096,rt)];function ht(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=8,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),V(this.dyn_ltree),V(this.dyn_dtree),V(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),V(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),V(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}for(var lt=function(t){var e,i=function(t){if(!t||!t.state)return Q(t,G);t.total_in=t.total_out=0,t.data_type=2;var e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?42:N,t.adler=2===e.wrap?0:1,e.last_flush=0,function(t){D||(function(){var t,e,i,g,v,w=Array(16);for(i=0,g=0;g<28;g++)for(o[g]=i,t=0;t<1<<a[g];t++)_[i++]=g;for(_[i-1]=g,v=0,g=0;g<16;g++)for(c[g]=v,t=0;t<1<<n[g];t++)l[v++]=g;for(v>>=7;g<30;g++)for(c[g]=v<<7,t=0;t<1<<n[g]-7;t++)l[256+v++]=g;for(e=0;e<=15;e++)w[e]=0;for(t=0;t<=143;)s[2*t+1]=8,t++,w[8]++;for(;t<=255;)s[2*t+1]=9,t++,w[9]++;for(;t<=279;)s[2*t+1]=7,t++,w[7]++;for(;t<=287;)s[2*t+1]=8,t++,w[8]++;for(z(s,287,w),t=0;t<30;t++)h[2*t+1]=5,h[2*t]=y(t,5);d=new p(s,a,257,286,15),u=new p(h,n,0,30,15),f=new p([],r,0,19,7)}(),D=!0),t.l_desc=new g(t.dyn_ltree,d),t.d_desc=new g(t.dyn_dtree,u),t.bl_desc=new g(t.bl_tree,f),t.bi_buf=0,t.bi_valid=0,k(t)}(e),0}(t);return 0===i&&((e=t.state).window_size=2*e.w_size,V(e.head),e.max_lazy_match=st[e.level].max_lazy,e.good_match=st[e.level].good_length,e.nice_match=st[e.level].nice_length,e.max_chain_length=st[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=2,e.match_available=0,e.ins_h=0),i},_t=function(t,e){var a,n;if(!t||!t.state||e>5||e<0)return t?Q(t,G):G;var r=t.state;if(!t.output||!t.input&&0!==t.avail_in||r.status===P&&4!==e)return Q(t,0===t.avail_out?-5:G);r.strm=t;var i=r.last_flush;if(r.last_flush=e,42===r.status)if(2===r.wrap)t.adler=0,Z(r,31),Z(r,139),Z(r,8),r.gzhead?(Z(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),Z(r,255&r.gzhead.time),Z(r,r.gzhead.time>>8&255),Z(r,r.gzhead.time>>16&255),Z(r,r.gzhead.time>>24&255),Z(r,9===r.level?2:r.strategy>=2||r.level<2?4:0),Z(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(Z(r,255&r.gzhead.extra.length),Z(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(t.adler=T(t.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=69):(Z(r,0),Z(r,0),Z(r,0),Z(r,0),Z(r,0),Z(r,9===r.level?2:r.strategy>=2||r.level<2?4:0),Z(r,3),r.status=N);else{var h=8+(r.w_bits-8<<4)<<8;h|=(r.strategy>=2||r.level<2?0:r.level<6?1:6===r.level?2:3)<<6,0!==r.strstart&&(h|=32),h+=31-h%31,r.status=N,$(r,h),0!==r.strstart&&($(r,t.adler>>>16),$(r,65535&t.adler)),t.adler=1}if(69===r.status)if(r.gzhead.extra){for(a=r.pending;r.gzindex<(65535&r.gzhead.extra.length)&&(r.pending!==r.pending_buf_size||(r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),X(t),a=r.pending,r.pending!==r.pending_buf_size));)Z(r,255&r.gzhead.extra[r.gzindex]),r.gzindex++;r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),r.gzindex===r.gzhead.extra.length&&(r.gzindex=0,r.status=73)}else r.status=73;if(73===r.status)if(r.gzhead.name){a=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),X(t),a=r.pending,r.pending===r.pending_buf_size)){n=1;break}n=r.gzindex<r.gzhead.name.length?255&r.gzhead.name.charCodeAt(r.gzindex++):0,Z(r,n)}while(0!==n);r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),0===n&&(r.gzindex=0,r.status=91)}else r.status=91;if(91===r.status)if(r.gzhead.comment){a=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),X(t),a=r.pending,r.pending===r.pending_buf_size)){n=1;break}n=r.gzindex<r.gzhead.comment.length?255&r.gzhead.comment.charCodeAt(r.gzindex++):0,Z(r,n)}while(0!==n);r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),0===n&&(r.status=K)}else r.status=K;if(r.status===K&&(r.gzhead.hcrc?(r.pending+2>r.pending_buf_size&&X(t),r.pending+2<=r.pending_buf_size&&(Z(r,255&t.adler),Z(r,t.adler>>8&255),t.adler=0,r.status=N)):r.status=N),0!==r.pending){if(X(t),0===t.avail_out)return r.last_flush=-1,0}else if(0===t.avail_in&&R(e)<=R(i)&&4!==e)return Q(t,-5);if(r.status===P&&0!==t.avail_in)return Q(t,-5);if(0!==t.avail_in||0!==r.lookahead||0!==e&&r.status!==P){var l=2===r.strategy?function(t,e){for(var a;;){if(0===t.lookahead&&(at(t),0===t.lookahead)){if(0===e)return 1;break}if(t.match_length=0,a=F(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,a&&(Y(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Y(t,!1),0===t.strm.avail_out)?1:2}(r,e):3===r.strategy?function(t,e){for(var a,n,r,i,s=t.window;;){if(t.lookahead<=H){if(at(t),t.lookahead<=H&&0===e)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(n=s[r=t.strstart-1])===s[++r]&&n===s[++r]&&n===s[++r]){i=t.strstart+H;do{}while(n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&r<i);t.match_length=H-(i-r),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(a=F(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(a=F(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),a&&(Y(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Y(t,!1),0===t.strm.avail_out)?1:2}(r,e):st[r.level].func(r,e);if(3!==l&&4!==l||(r.status=P),1===l||3===l)return 0===t.avail_out&&(r.last_flush=-1),0;if(2===l&&(1===e?function(t){m(t,2,3),b(t,256,s),function(t){16===t.bi_valid?(w(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}(t)}(r):5!==e&&(q(r,0,0,!1),3===e&&(V(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),X(t),0===t.avail_out))return r.last_flush=-1,0}return 4!==e?0:r.wrap<=0?1:(2===r.wrap?(Z(r,255&t.adler),Z(r,t.adler>>8&255),Z(r,t.adler>>16&255),Z(r,t.adler>>24&255),Z(r,255&t.total_in),Z(r,t.total_in>>8&255),Z(r,t.total_in>>16&255),Z(r,t.total_in>>24&255)):($(r,t.adler>>>16),$(r,65535&t.adler)),X(t),r.wrap>0&&(r.wrap=-r.wrap),0!==r.pending?0:1)},ot=function(t){if(!t||!t.state)return G;var e=t.state.status;return 42!==e&&69!==e&&73!==e&&91!==e&&e!==K&&e!==N&&e!==P?Q(t,G):(t.state=null,e===N?Q(t,-3):0)},dt=new Uint8Array(256),ut=0;ut<256;ut++)dt[ut]=ut>=252?6:ut>=248?5:ut>=240?4:ut>=224?3:ut>=192?2:1;dt[254]=dt[254]=1;var ft=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0},ct=Object.prototype.toString;function pt(){this.options={level:-1,method:8,chunkSize:16384,windowBits:15,memLevel:8,strategy:0};var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new ft,this.strm.avail_out=0;var e,a,n=function(t,e,a,n,r,i){if(!t)return G;var s=1;if(-1===e&&(e=6),n<0?(s=0,n=-n):n>15&&(s=2,n-=16),r<1||r>9||8!==a||n<8||n>15||e<0||e>9||i<0||i>4)return Q(t,G);8===n&&(n=9);var h=new ht;return t.state=h,h.strm=t,h.wrap=s,h.gzhead=null,h.w_bits=n,h.w_size=1<<h.w_bits,h.w_mask=h.w_size-1,h.hash_bits=r+7,h.hash_size=1<<h.hash_bits,h.hash_mask=h.hash_size-1,h.hash_shift=~~((h.hash_bits+3-1)/3),h.window=new Uint8Array(2*h.w_size),h.head=new Uint16Array(h.hash_size),h.prev=new Uint16Array(h.w_size),h.lit_bufsize=1<<r+6,h.pending_buf_size=4*h.lit_bufsize,h.pending_buf=new Uint8Array(h.pending_buf_size),h.d_buf=1*h.lit_bufsize,h.l_buf=3*h.lit_bufsize,h.level=e,h.strategy=i,h.method=a,lt(t)}(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(0!==n)throw Error(O[n]);if(t.header&&(e=this.strm,a=t.header,e&&e.state&&(2!==e.state.wrap||(e.state.gzhead=a))),t.dictionary){var r;if(r="[object ArrayBuffer]"===ct.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,0!==(n=function(t,e){var a=e.length;if(!t||!t.state)return G;var n=t.state,r=n.wrap;if(2===r||1===r&&42!==n.status||n.lookahead)return G;if(1===r&&(t.adler=L(t.adler,e,a,0)),n.wrap=0,a>=n.w_size){0===r&&(V(n.head),n.strstart=0,n.block_start=0,n.insert=0);var i=new Uint8Array(n.w_size);i.set(e.subarray(a-n.w_size,a),0),e=i,a=n.w_size}var s=t.avail_in,h=t.next_in,l=t.input;for(t.avail_in=a,t.next_in=0,t.input=e,at(n);n.lookahead>=3;){var _=n.strstart,o=n.lookahead-2;do{n.ins_h=W(n,n.ins_h,n.window[_+3-1]),n.prev[_&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=_,_++}while(--o);n.strstart=_,n.lookahead=2,at(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=2,n.match_available=0,t.next_in=h,t.input=l,t.avail_in=s,n.wrap=r,0}(this.strm,r)))throw Error(O[n]);this._dict_set=!0}}function gt(t,e,a){try{t.postMessage({type:"errored",error:e,streamId:a})}catch(n){t.postMessage({type:"errored",error:e+"",streamId:a})}}function vt(t){const e=t.strm.adler;return new Uint8Array([3,0,e>>>24&255,e>>>16&255,e>>>8&255,255&e])}pt.prototype.push=function(t,e){var a,n,r=this.strm,i=this.options.chunkSize;if(this.ended)return!1;for(n=e===~~e?e:!0===e?4:0,"[object ArrayBuffer]"===ct.call(t)?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;;)if(0===r.avail_out&&(r.output=new Uint8Array(i),r.next_out=0,r.avail_out=i),(2===n||3===n)&&r.avail_out<=6)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else{if(1===(a=_t(r,n)))return r.next_out>0&&this.onData(r.output.subarray(0,r.next_out)),a=ot(this.strm),this.onEnd(a),this.ended=!0,0===a;if(0!==r.avail_out){if(n>0&&r.next_out>0)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else if(0===r.avail_in)break}else this.onData(r.output)}return!0},pt.prototype.onData=function(t){this.chunks.push(t)},pt.prototype.onEnd=function(t){0===t&&(this.result=function(t){for(var e=0,a=0,n=t.length;a<n;a++)e+=t[a].length;for(var r=new Uint8Array(e),i=0,s=0,h=t.length;i<h;i++){var l=t[i];r.set(l,s),s+=l.length}return r}(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},function(e=self){try{const a=new Map;e.addEventListener("message",n=>{try{const r=function(e,a){switch(a.action){case"init":return{type:"initialized",version:"6.24.1"};case"write":{let n=e.get(a.streamId);n||(n=new pt,e.set(a.streamId,n));const r=n.chunks.length,i=function(t){if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(t);let e,a,n,r,i,s=t.length,h=0;for(r=0;r<s;r++)a=t.charCodeAt(r),55296==(64512&a)&&r+1<s&&(n=t.charCodeAt(r+1),56320==(64512&n)&&(a=65536+(a-55296<<10)+(n-56320),r++)),h+=a<128?1:a<2048?2:a<65536?3:4;for(e=new Uint8Array(h),i=0,r=0;i<h;r++)a=t.charCodeAt(r),55296==(64512&a)&&r+1<s&&(n=t.charCodeAt(r+1),56320==(64512&n)&&(a=65536+(a-55296<<10)+(n-56320),r++)),a<128?e[i++]=a:a<2048?(e[i++]=192|a>>>6,e[i++]=128|63&a):a<65536?(e[i++]=224|a>>>12,e[i++]=128|a>>>6&63,e[i++]=128|63&a):(e[i++]=240|a>>>18,e[i++]=128|a>>>12&63,e[i++]=128|a>>>6&63,e[i++]=128|63&a);return e}(a.data);return n.push(i,2),{type:"wrote",id:a.id,streamId:a.streamId,result:t(n.chunks.slice(r)),trailer:vt(n),additionalBytesCount:i.length}}case"reset":e.delete(a.streamId)}}(a,n.data);r&&e.postMessage(r)}catch(t){gt(e,t,n.data&&"streamId"in n.data?n.data.streamId:void 0)}})}catch(t){gt(e,t)}}()})();'])))}let dr={status:0};function Oke(e,t,n,r=$ke){switch(dr.status===0&&ERt(e,t,r),dr.status){case 1:return dr.initializationFailureCallbacks.push(n),dr.worker;case 3:return dr.worker}}function qne(){return dr.status}function ERt(e,t,n=$ke){try{const r=n(e),{stop:i}=Xn(e,r,"error",o=>{O2(e,t,o)}),{stop:a}=Xn(e,r,"message",({data:o})=>{o.type==="errored"?O2(e,t,o.error,o.streamId):o.type==="initialized"&&$Rt(o.version)});r.postMessage({action:"init"}),yi(()=>TRt(t),kRt),dr={status:1,worker:r,stop:()=>{i(),a()},initializationFailureCallbacks:[]}}catch(r){O2(e,t,r)}}function TRt(e){dr.status===1&&(xt.error(`${e} failed to start: a timeout occurred while initializing the Worker`),dr.initializationFailureCallbacks.forEach(t=>t()),dr={status:2})}function $Rt(e){dr.status===1&&(dr={status:3,worker:dr.worker,stop:dr.stop,version:e})}function O2(e,t,n,r){dr.status===1||dr.status===0?(EB({configuredUrl:e.workerUrl,error:n,source:t,scriptType:"worker"}),dr.status===1&&dr.initializationFailureCallbacks.forEach(i=>i()),dr={status:2}):yB(n,{worker_version:dr.status===3&&dr.version,stream_id:r})}function Ake(){return typeof Array.from=="function"&&typeof CSSSupportsRule=="function"&&typeof URL.createObjectURL=="function"&&"forEach"in NodeList.prototype}function ORt(e,t,n,r){const i=t.findTrackedSession(),a=ARt(i,r),o=n.findView();return yRt(e,{viewContext:o,errorType:a,session:i})}function ARt(e,t){if(!Ake())return"browser-not-supported";if(!e)return"rum-not-tracked";if(e.sessionReplay===0)return"incorrect-session-plan";if(!t)return"replay-not-started"}function CRt(e,t){if(!e.metricsEnabled)return{stop:fn};let n,r,i;const{unsubscribe:a}=t.subscribe(o=>{switch(o.type){case"start":n={forced:o.forced,timestamp:ii()},r=void 0,i=void 0;break;case"document-ready":n&&(r=fr(n.timestamp,ii()));break;case"recorder-settled":n&&(i=fr(n.timestamp,ii()));break;case"aborted":case"deflate-encoder-load-failed":case"recorder-load-failed":case"succeeded":a(),n&&rO("Recorder init metrics",{metrics:IRt(n.forced,i,fr(n.timestamp,ii()),o.type,r)});break}});return{stop:a}}function IRt(e,t,n,r,i){return{forced:e,loadRecorderModuleDuration:t,recorderInitDuration:n,result:r,waitForDocReadyDuration:i}}function jRt(e,t,n,r,i,a,o){let s=0,l;t.subscribe(9,()=>{(s===2||s===3)&&(h(),s=1)}),t.subscribe(10,()=>{s===1&&f()});const u=new Gt;CRt(o,u);const d=async m=>{u.notify({type:"start",forced:m});const[v]=await Promise.all([Zne(u,{type:"recorder-settled"},i()),Zne(u,{type:"document-ready"},vOt(e,"interactive"))]);if(s!==2){u.notify({type:"aborted"});return}if(!v){s=0,u.notify({type:"recorder-load-failed"});return}const y=a();if(!y){s=0,u.notify({type:"deflate-encoder-load-failed"});return}({stop:l}=v(t,e,n,r,y,o)),s=3,u.notify({type:"succeeded"})};function f(m){const v=n.findTrackedSession();if(RRt(v,m)){s=1;return}if(PRt(s))return;s=2;const y=NRt(v,m)||!1;d(y).catch(Pc),y&&n.setForcedReplay()}function h(){s===3&&(l==null||l()),s=0}return{start:f,stop:h,getSessionReplayLink(){return ORt(e,n,r,s!==0)},isRecording:()=>s===3}}function RRt(e,t){return!e||e.sessionReplay===0&&(!t||!t.force)}function PRt(e){return e===2||e===3}function NRt(e,t){return t&&t.force&&e.sessionReplay===0}async function Zne(e,t,n){try{return await n}finally{e.notify(t)}}function MRt(){let e=0;return{strategy:{start(){e=1},stop(){e=2},isRecording:()=>!1,getSessionReplayLink:fn},shouldStartImmediately(t){return e===1||e===0&&!t.startSessionReplayRecordingManually}}}function DRt(e,t){if(og()&&!_Se("records")||!Ake())return{start:fn,stop:fn,getReplayStats:()=>{},onRumStart:fn,isRecording:()=>!1,getSessionReplayLink:()=>{}};let{strategy:n,shouldStartImmediately:r}=MRt();return{start:a=>n.start(a),stop:()=>n.stop(),getSessionReplayLink:()=>n.getSessionReplayLink(),onRumStart:i,isRecording:()=>qne()===3&&n.isRecording(),getReplayStats:a=>qne()===3?xRt(a):void 0};function i(a,o,s,l,u,d){let f;function h(){return f||(u??(u=Oke(o,"Datadog Session Replay",()=>{n.stop()},t)),u&&(f=Tke(o,u,1))),f}n=jRt(o,a,s,l,e,h,d),r(o)&&n.start()}}async function zRt(e=LRt){try{return await e()}catch(t){EB({error:t,source:"Recorder",scriptType:"module"})}}async function LRt(){return(await H(async()=>{const{startRecording:e}=await import("./startRecording-B_9CRZ_P-B2U8u87w.js");return{startRecording:e}},[])).startRecording}function URt(){return Ao().Profiler!==void 0}const BRt=e=>{let t={status:"starting"};return e.register(0,({eventType:n})=>n!==Et.VIEW&&n!==Et.LONG_TASK?Da:{type:n,_dd:{profiling:t}}),{get:()=>t,set:n=>{t=n}}};async function VRt(e=FRt){try{return await e()}catch(t){EB({error:t,source:"Profiler",scriptType:"module"})}}async function FRt(){return(await H(async()=>{const{createRumProfiler:e}=await import("./profiler-D6ndqfsd-BFvhpC6v.js");return{createRumProfiler:e}},[])).createRumProfiler}function qRt(){let e;function t(n,r,i,a,o,s){const l=a.findTrackedSession();if(!l||!USe(l.id,i.profilingSampleRate))return;const u=BRt(r);if(!URt()){u.set({status:"error",error_reason:"not-supported-by-browser"});return}VRt().then(d=>{if(!d){Jw("[DD_RUM] Failed to lazy load the RUM Profiler"),u.set({status:"error",error_reason:"failed-to-lazy-load"});return}e=d(i,n,a,u,s),e.start(o.findView())}).catch(Pc)}return{onRumStart:t,stop:()=>{e==null||e.stop().catch(Pc)}}}const ZRt=DRt(zRt),HRt=qRt(),Xv=MAt(mRt,ZRt,HRt,{startDeflateWorker:Oke,createDeflateEncoder:Tke,sdkName:"rum"});m$t(Ao(),"DD_RUM",Xv);const y_={applicationId:"0b0a19b9-099b-4812-b342-930518330975",clientToken:"puba92c09799d321f572535176e9fe08256",site:"datadoghq.com",service:"gram-elements"};let bL=!1,wL=!0;function GRt(e={}){if(e.enabled===!1){wL=!1;return}if(!bL)try{Xv.init({applicationId:y_.applicationId,clientToken:y_.clientToken,site:y_.site,service:y_.service,env:"production",sessionSampleRate:100,sessionReplaySampleRate:100,trackUserInteractions:!0,trackResources:!0,trackLongTasks:!0,defaultPrivacyLevel:"mask"}),e.projectSlug&&Xv.setGlobalContextProperty("projectSlug",e.projectSlug),e.variant&&Xv.setGlobalContextProperty("variant",e.variant),bL=!0}catch(t){console.warn("[Elements] Failed to initialize Datadog RUM:",t),wL=!1}}function xL(e,t){if(!wL||!bL)return;const n=e instanceof Error?e:new Error(String(e));try{Xv.addError(n,{...t,timestamp:new Date().toISOString()})}catch(r){console.warn("[Elements] Failed to track error:",r)}}const Cke=["anthropic/claude-opus-4.6","anthropic/claude-sonnet-4.5","anthropic/claude-haiku-4.5","anthropic/claude-sonnet-4","anthropic/claude-opus-4.5","openai/gpt-4o","openai/gpt-4o-mini","openai/gpt-5.1-codex","openai/gpt-5","openai/gpt-5.1","openai/gpt-4.1","anthropic/claude-3.7-sonnet","anthropic/claude-opus-4","google/gemini-2.5-pro-preview","google/gemini-3-pro-preview","moonshotai/kimi-k2","mistralai/mistral-medium-3","mistralai/mistral-medium-3.1","mistralai/codestral-2501"],KRt=e=>Object.fromEntries(Object.entries(e).map(([t,n])=>[t,{...n.description?{description:n.description}:void 0,parameters:n.parameters instanceof Dte.ZodType?Dte.toJSONSchema(n.parameters):n.parameters}])),WRt=e=>Object.fromEntries(Object.entries(e).filter(([,t])=>!t.disabled&&t.type!=="backend"));function JRt(e,t){Ike(t)}function Ike(e){if(!e)return()=>!1;if(typeof e=="function")return n=>e({toolName:n});const t=new Set(e);return n=>t.has(n)}function YRt(e,t,n){if(!t||Array.isArray(t)&&t.length===0)return e;const r=Ike(t);return Object.fromEntries(Object.entries(e).map(([i,a])=>{if(!r(i))return[i,a];const o=a.execute;return o?[i,{...a,execute:async(s,l)=>{const u=l??{},d=u.toolCallId??"";return n.isToolApproved(i)||await n.requestApproval(i,d,s)?o(s,u):{content:[{type:"text",text:`Tool "${i}" execution was denied by the user. Please acknowledge this and continue without using this tool's result.`}],isError:!0}}}]:[i,a]}))}const XRt=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],QRt=gn("arrow-down",XRt),ePt=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],tPt=gn("arrow-up",ePt),nPt=[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]],rPt=gn("brain",nPt),iPt=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]];gn("calendar",iPt);const aPt=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],oPt=gn("chevron-left",aPt),sPt=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],jke=gn("chevron-right",sPt),lPt=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],TB=gn("copy",lPt),uPt=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],cPt=gn("file-text",uPt),dPt=[["path",{d:"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5",key:"mvr1a0"}]],fPt=gn("heart",dPt),pPt=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]];gn("link",pPt);const hPt=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],mPt=gn("loader-circle",hPt),gPt=[["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m16.2 7.8 2.9-2.9",key:"r700ao"}],["path",{d:"M18 12h4",key:"wj9ykh"}],["path",{d:"m16.2 16.2 2.9 2.9",key:"1bxg5t"}],["path",{d:"M12 18v4",key:"jadmvz"}],["path",{d:"m4.9 19.1 2.9-2.9",key:"bwix9q"}],["path",{d:"M2 12h4",key:"j09sii"}],["path",{d:"m4.9 4.9 2.9 2.9",key:"giyufr"}]],mE=gn("loader",gPt),yPt=[["path",{d:"M8 3H5a2 2 0 0 0-2 2v3",key:"1dcmit"}],["path",{d:"M21 8V5a2 2 0 0 0-2-2h-3",key:"1e4gt3"}],["path",{d:"M3 16v3a2 2 0 0 0 2 2h3",key:"wsl5sc"}],["path",{d:"M16 21h3a2 2 0 0 0 2-2v-3",key:"18trek"}]],vPt=gn("maximize",yPt),bPt=[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}]],wPt=gn("message-circle",bPt),xPt=[["path",{d:"M8 3v3a2 2 0 0 1-2 2H3",key:"hohbtr"}],["path",{d:"M21 8h-3a2 2 0 0 1-2-2V3",key:"5jw1f3"}],["path",{d:"M3 16h3a2 2 0 0 1 2 2v3",key:"198tvr"}],["path",{d:"M16 21v-3a2 2 0 0 1 2-2h3",key:"ph8mxp"}]],_Pt=gn("minimize",xPt),SPt=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}],["path",{d:"m8 9 3 3-3 3",key:"12hl5m"}]],kPt=gn("panel-right-close",SPt),EPt=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}],["path",{d:"m10 15-3-3 3-3",key:"1pgupc"}]],TPt=gn("panel-right-open",EPt),$Pt=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],OPt=gn("pencil",$Pt),APt=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Rke=gn("plus",APt),CPt=[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],IPt=gn("settings-2",CPt),jPt=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],RPt=gn("square",jPt),PPt=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],Hne=gn("wifi-off",PPt),NPt=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],Pke=gn("wrench",NPt),MPt=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],ip=gn("x",MPt),DPt=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]];gn("zap",DPt);var cO="Dialog",[Nke]=Ua(cO),[zPt,ms]=Nke(cO),Mke=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=$.useRef(null),l=$.useRef(null),[u,d]=ss({prop:r,defaultProp:i??!1,onChange:a,caller:cO});return _.jsx(zPt,{scope:t,triggerRef:s,contentRef:l,contentId:wo(),titleId:wo(),descriptionId:wo(),open:u,onOpenChange:d,onOpenToggle:$.useCallback(()=>d(f=>!f),[d]),modal:o,children:n})};Mke.displayName=cO;var Dke="DialogTrigger",zke=$.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=ms(Dke,n),a=on(t,i.triggerRef);return _.jsx(ut.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":AB(i.open),...r,ref:a,onClick:ct(e.onClick,i.onOpenToggle)})});zke.displayName=Dke;var $B="DialogPortal",[LPt,Lke]=Nke($B,{forceMount:void 0}),Uke=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=ms($B,t);return _.jsx(LPt,{scope:t,forceMount:n,children:$.Children.map(r,o=>_.jsx(ps,{present:n||a.open,children:_.jsx(iw,{asChild:!0,container:i,children:o})}))})};Uke.displayName=$B;var gE="DialogOverlay",Bke=$.forwardRef((e,t)=>{const n=Lke(gE,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=ms(gE,e.__scopeDialog);return a.modal?_.jsx(ps,{present:r||a.open,children:_.jsx(BPt,{...i,ref:t})}):null});Bke.displayName=gE;var UPt=Tf("DialogOverlay.RemoveScroll"),BPt=$.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=ms(gE,n);return _.jsx(kT,{as:UPt,allowPinchZoom:!0,shards:[i.contentRef],children:_.jsx(ut.div,{"data-state":AB(i.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Nf="DialogContent",Vke=$.forwardRef((e,t)=>{const n=Lke(Nf,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=ms(Nf,e.__scopeDialog);return _.jsx(ps,{present:r||a.open,children:a.modal?_.jsx(VPt,{...i,ref:t}):_.jsx(FPt,{...i,ref:t})})});Vke.displayName=Nf;var VPt=$.forwardRef((e,t)=>{const n=ms(Nf,e.__scopeDialog),r=$.useRef(null),i=on(t,n.contentRef,r);return $.useEffect(()=>{const a=r.current;if(a)return j6(a)},[]),_.jsx(Fke,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ct(e.onCloseAutoFocus,a=>{var o;a.preventDefault(),(o=n.triggerRef.current)==null||o.focus()}),onPointerDownOutside:ct(e.onPointerDownOutside,a=>{const o=a.detail.originalEvent,s=o.button===0&&o.ctrlKey===!0;(o.button===2||s)&&a.preventDefault()}),onFocusOutside:ct(e.onFocusOutside,a=>a.preventDefault())})}),FPt=$.forwardRef((e,t)=>{const n=ms(Nf,e.__scopeDialog),r=$.useRef(!1),i=$.useRef(!1);return _.jsx(Fke,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var o,s;(o=e.onCloseAutoFocus)==null||o.call(e,a),a.defaultPrevented||(r.current||((s=n.triggerRef.current)==null||s.focus()),a.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:a=>{var s,l;(s=e.onInteractOutside)==null||s.call(e,a),a.defaultPrevented||(r.current=!0,a.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const o=a.target;(l=n.triggerRef.current)!=null&&l.contains(o)&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&i.current&&a.preventDefault()}})}),Fke=$.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=ms(Nf,n),l=$.useRef(null),u=on(t,l);return I6(),_.jsxs(_.Fragment,{children:[_.jsx(_T,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:_.jsx(rw,{role:"dialog",id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":AB(s.open),...o,ref:u,onDismiss:()=>s.onOpenChange(!1)})}),_.jsxs(_.Fragment,{children:[_.jsx(ZPt,{titleId:s.titleId}),_.jsx(GPt,{contentRef:l,descriptionId:s.descriptionId})]})]})}),OB="DialogTitle",qke=$.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=ms(OB,n);return _.jsx(ut.h2,{id:i.titleId,...r,ref:t})});qke.displayName=OB;var Zke="DialogDescription",qPt=$.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=ms(Zke,n);return _.jsx(ut.p,{id:i.descriptionId,...r,ref:t})});qPt.displayName=Zke;var Hke="DialogClose",Gke=$.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=ms(Hke,n);return _.jsx(ut.button,{type:"button",...r,ref:t,onClick:ct(e.onClick,()=>i.onOpenChange(!1))})});Gke.displayName=Hke;function AB(e){return e?"open":"closed"}var Kke="DialogTitleWarning",[f3t,Wke]=WQe(Kke,{contentName:Nf,titleName:OB,docsSlug:"dialog"}),ZPt=({titleId:e})=>{const t=Wke(Kke),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
475
475
|
|
|
476
476
|
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
477
477
|
|
|
@@ -628,4 +628,4 @@ ${E}`,abortSignal:S.signal});d.current===S&&o(I.object.suggestions.slice(0,C).ma
|
|
|
628
628
|
}
|
|
629
629
|
}
|
|
630
630
|
}`}]}function P5t({serverUrl:e,serverName:t="speakeasy-docs",token:n}){const r=R5t(e,t,n),[i,a]=$.useState(null),o=r.find(s=>s.id===i);return _.jsxs("div",{className:"pg-section",children:[_.jsx("h2",{className:"pg-heading",children:"Add to your client"}),_.jsx("div",{className:"pg-grid",children:r.map(s=>{const l=j5t[s.id];return _.jsxs("button",{className:"pg-client-btn","data-active":i===s.id,onClick:()=>a(i===s.id?null:s.id),children:[l?_.jsx(l,{}):_.jsx("span",{className:"pg-client-icon",children:s.name[0]}),s.name]},s.id)})}),o&&_.jsxs("div",{className:"pg-config-panel",children:[_.jsxs("div",{className:"pg-config-header",children:[_.jsx("h3",{className:"pg-config-title",children:o.name}),_.jsxs("div",{className:"pg-config-actions",children:[o.deepLink&&_.jsx("a",{href:o.deepLink,className:"pg-deep-link",target:"_blank",rel:"noopener noreferrer",children:"Install ↗"}),_.jsx(sOe,{text:o.snippet})]})]}),_.jsx("div",{className:"pg-config-code",children:_.jsx("pre",{children:_.jsx("code",{children:o.snippet})})})]})]})}function zL({name:e,schema:t,required:n,depth:r}){var a,o;const i=t.enum?`enum(${t.enum.join(" | ")})`:t.type==="array"&&((a=t.items)!=null&&a.type)?`${t.items.type}[]`:t.type||"unknown";return _.jsxs("div",{className:"pg-schema-prop",style:{paddingLeft:r*16},children:[_.jsxs("div",{className:"pg-schema-row",children:[_.jsx("code",{className:"pg-schema-name",children:e}),_.jsx("span",{className:"pg-schema-type",children:i}),n&&_.jsx("span",{className:"pg-badge",children:"required"}),t.default!==void 0&&_.jsxs("span",{className:"pg-schema-default",children:["= ",JSON.stringify(t.default)]})]}),t.description&&_.jsx("p",{className:"pg-schema-desc",children:t.description}),t.type==="object"&&t.properties&&_.jsx("div",{className:"pg-schema-nested",children:Object.entries(t.properties).map(([s,l])=>{var u;return _.jsx(zL,{name:s,schema:l,required:((u=t.required)==null?void 0:u.includes(s))??!1,depth:r+1},s)})}),t.type==="array"&&((o=t.items)==null?void 0:o.type)==="object"&&t.items.properties&&_.jsx("div",{className:"pg-schema-nested",children:Object.entries(t.items.properties).map(([s,l])=>{var u;return _.jsx(zL,{name:s,schema:l,required:((u=t.items.required)==null?void 0:u.includes(s))??!1,depth:r+1},s)})})]})}function N5t({schema:e}){return e.properties?_.jsx("div",{className:"pg-schema",children:Object.entries(e.properties).map(([t,n])=>{var r;return _.jsx(zL,{name:t,schema:n,required:((r=e.required)==null?void 0:r.includes(t))??!1,depth:0},t)})}):null}function M5t(){const{mcpTools:e}=kr(),[t,n]=$.useState();return $.useEffect(()=>{if(!e)return;const r=Object.entries(e);Promise.all(r.map(async([i,a])=>{var l;const o=a;let s;return(l=o.inputSchema)!=null&&l.jsonSchema&&(s=await o.inputSchema.jsonSchema),{name:i,description:o.description,jsonSchema:s}})).then(n)},[e]),t}function D5t(){const[e,t]=$.useState();return $.useEffect(()=>{fetch("/mcp",{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json, text/event-stream"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:"tools/list",params:{}})}).then(async n=>{if((n.headers.get("content-type")??"").includes("text/event-stream")){const i=await n.text();for(const a of i.split(`
|
|
631
|
-
`))if(a.startsWith("data: "))return JSON.parse(a.slice(6));return null}return n.json()}).then(n=>{var i;if(!n)return t([]);const r=((i=n.result)==null?void 0:i.tools)??[];t(r.map(a=>({name:a.name,description:a.description,jsonSchema:a.inputSchema})))}).catch(()=>t([]))},[]),e}function lOe({tools:e}){const[t,n]=$.useState(null),r=e===void 0,i=(e==null?void 0:e.some(a=>{var o;return(o=a.description)==null?void 0:o.includes("lexical query")}))??!1;return _.jsxs("div",{className:"pg-section",children:[_.jsx("h2",{className:"pg-heading",children:"Available Tools"}),i&&_.jsx("p",{className:"pg-warning",children:"Semantic search is unavailable — set OPENAI_API_KEY to enable semantic search results."}),r&&_.jsx("div",{className:"pg-skeleton-list",children:[1,2].map(a=>_.jsx("div",{className:"pg-skeleton"},a))}),!r&&e.length===0&&_.jsx("p",{className:"pg-muted",children:"No tools available."}),_.jsx("div",{className:"pg-tools-grid",children:(e??[]).map(a=>_.jsxs("div",{className:"pg-tool-card",children:[_.jsxs("button",{className:"pg-tool-header",onClick:()=>n(t===a.name?null:a.name),"aria-expanded":t===a.name,children:[_.jsxs("div",{children:[_.jsx("span",{className:"pg-tool-name",children:a.name}),a.description&&_.jsx("p",{className:"pg-tool-desc",children:a.description})]}),_.jsx("span",{className:"pg-tool-chevron","data-expanded":t===a.name,children:"▶"})]}),t===a.name&&a.jsonSchema&&_.jsx("div",{className:"pg-tool-body",children:_.jsx(N5t,{schema:a.jsonSchema})})]},a.name))})]})}function z5t(){const e=M5t();return _.jsx(lOe,{tools:e})}function L5t(){const e=D5t();return _.jsx(lOe,{tools:e})}function U5t({chatEnabled:e}){return e?_.jsx(z5t,{}):_.jsx(L5t,{})}const B5t=async()=>fetch("/chat/session",{method:"POST",headers:{"Gram-Project":"thomas"}}).then(e=>e.json()).then(e=>e.client_token);function V5t(){const e=`${window.location.origin}/mcp`,[t,n]=$.useState(),[r,i]=$.useState(),[a,o]=$.useState(!1);$.useEffect(()=>{fetch("/api/config").then(u=>u.json()).then(u=>{n(u.token),u.serverName&&i(u.serverName),o(!!u.chatEnabled)}).catch(()=>{})},[]);const s=_.jsxs("div",{className:"pg-info-panel",children:[_.jsx($5t,{url:e}),_.jsx(P5t,{serverUrl:e,serverName:r,token:t}),_.jsx(U5t,{chatEnabled:a})]});if(!a)return s;const l={projectSlug:"thomas",mcp:e,variant:"standalone",api:{session:B5t}};return _.jsxs(_4t,{config:l,children:[s,_.jsx(T5t,{})]})}ICe.createRoot(document.getElementById("root")).render(_.jsx($.StrictMode,{children:_.jsx(V5t,{})}));export{fB as $,lO as A,n3t as B,gCt as C,r3t as D,rO as E,Xn as F,NCt as G,tCt as H,LAt as I,t3t as J,Jw as K,Mc as L,xSe as M,e3t as N,fSe as O,X$ as P,Et as Q,yCt as R,rp as S,Jt as T,ho as U,Kw as V,Ww as W,a3t as X,i3t as Y,rjt as Z,fn as _,og as a,Hr as a0,Ao as a1,Pc as a2,xt as a3,M_e as a4,J$ as a5,dSe as a6,jEt as a7,U$t as b,$t as c,_i as d,s3t as e,u3t as f,kB as g,OOt as h,jt as i,QSe as j,oke as k,Vs as l,S2 as m,c3t as n,xB as o,d3t as p,ijt as q,ii as r,yi as s,l3t as t,fr as u,o3t as v,Y$ as w,PCt as x,RCt as y,ake as z};
|
|
631
|
+
`))if(a.startsWith("data: "))return JSON.parse(a.slice(6));return null}return n.json()}).then(n=>{var i;if(!n)return t([]);const r=((i=n.result)==null?void 0:i.tools)??[];t(r.map(a=>({name:a.name,description:a.description,jsonSchema:a.inputSchema})))}).catch(()=>t([]))},[]),e}function lOe({tools:e}){const[t,n]=$.useState(null),r=e===void 0,i=(e==null?void 0:e.some(a=>{var o;return(o=a.description)==null?void 0:o.includes("lexical query")}))??!1;return _.jsxs("div",{className:"pg-section",children:[_.jsx("h2",{className:"pg-heading",children:"Available Tools"}),i&&_.jsx("p",{className:"pg-warning",children:"Semantic search is unavailable — set OPENAI_API_KEY to enable semantic search results."}),r&&_.jsx("div",{className:"pg-skeleton-list",children:[1,2].map(a=>_.jsx("div",{className:"pg-skeleton"},a))}),!r&&e.length===0&&_.jsx("p",{className:"pg-muted",children:"No tools available."}),_.jsx("div",{className:"pg-tools-grid",children:(e??[]).map(a=>_.jsxs("div",{className:"pg-tool-card",children:[_.jsxs("button",{className:"pg-tool-header",onClick:()=>n(t===a.name?null:a.name),"aria-expanded":t===a.name,children:[_.jsxs("div",{children:[_.jsx("span",{className:"pg-tool-name",children:a.name}),a.description&&_.jsx("p",{className:"pg-tool-desc",children:a.description})]}),_.jsx("span",{className:"pg-tool-chevron","data-expanded":t===a.name,children:"▶"})]}),t===a.name&&a.jsonSchema&&_.jsx("div",{className:"pg-tool-body",children:_.jsx(N5t,{schema:a.jsonSchema})})]},a.name))})]})}function z5t(){const e=M5t();return _.jsx(lOe,{tools:e})}function L5t(){const e=D5t();return _.jsx(lOe,{tools:e})}function U5t({chatEnabled:e}){return e?_.jsx(z5t,{}):_.jsx(L5t,{})}const B5t=async()=>fetch("/chat/session",{method:"POST",headers:{"Gram-Project":"thomas"}}).then(e=>e.json()).then(e=>e.client_token);function V5t(){const e=`${window.location.origin}/mcp`,[t,n]=$.useState(),[r,i]=$.useState(),[a,o]=$.useState(!1);$.useEffect(()=>{fetch("/api/config").then(u=>u.json()).then(u=>{n(u.token),u.serverName&&i(u.serverName),o(!!u.chatEnabled)}).catch(()=>{})},[]);const s=_.jsxs("div",{className:"pg-info-panel",children:[_.jsx($5t,{url:e}),_.jsx(P5t,{serverUrl:e,serverName:r,token:t}),_.jsx(U5t,{chatEnabled:a})]});if(!a)return s;const l={projectSlug:"thomas",mcp:e,variant:"standalone",model:{showModelPicker:!0},api:{session:B5t}};return _.jsxs(_4t,{config:l,children:[s,_.jsx(T5t,{})]})}ICe.createRoot(document.getElementById("root")).render(_.jsx($.StrictMode,{children:_.jsx(V5t,{})}));export{fB as $,lO as A,n3t as B,gCt as C,r3t as D,rO as E,Xn as F,NCt as G,tCt as H,LAt as I,t3t as J,Jw as K,Mc as L,xSe as M,e3t as N,fSe as O,X$ as P,Et as Q,yCt as R,rp as S,Jt as T,ho as U,Kw as V,Ww as W,a3t as X,i3t as Y,rjt as Z,fn as _,og as a,Hr as a0,Ao as a1,Pc as a2,xt as a3,M_e as a4,J$ as a5,dSe as a6,jEt as a7,U$t as b,$t as c,_i as d,s3t as e,u3t as f,kB as g,OOt as h,jt as i,QSe as j,oke as k,Vs as l,S2 as m,c3t as n,xB as o,d3t as p,ijt as q,ii as r,yi as s,l3t as t,fr as u,o3t as v,Y$ as w,PCt as x,RCt as y,ake as z};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{S as H,T as $,M as J,V as R,$ as X,a0 as y,F as N,a1 as Y,a2 as M,a3 as Z,s as W,U as ee,u as te,a4 as ne,a5 as se,Q as re,a6 as oe,a7 as ae,K as ie}from"./index-
|
|
1
|
+
import{S as H,T as $,M as J,V as R,$ as X,a0 as y,F as N,a1 as Y,a2 as M,a3 as Z,s as W,U as ee,u as te,a4 as ne,a5 as se,Q as re,a6 as oe,a7 as ae,K as ie}from"./index-Idv3uxDb.js";function ce(e,t,o,i){const f=p=>{t.notify(14,{error:p}),ie("Error reported to customer",{"error.message":p.message})},c=J([e.profilingEndpointBuilder],f),m=o(i);return{async send({event:p,...g}){const v=new FormData,s=R(p);if(!s)throw new Error("Failed to serialize event");v.append("event",new Blob([s],{type:"application/json"}),"event.json");let b=s.length;for(const[k,I]of X(g)){const d=R(I);if(!d)throw new Error("Failed to serialize attachment");const h=await ue(m,d);b+=h.outputBytesCount,v.append(k,new Blob([h.output]),k)}c.send({data:v,bytesCount:b})}}}function ue(e,t){return new Promise(o=>{e.write(t),e.finish(i=>{o(i)})})}function le(e){let t=0;for(const o of e)o.stackId!==void 0&&t++;return t}const T=new Map;function pe(e,t){T.set(t,e)}function fe(e){return T.get(e)}function j(e){for(const t of T.keys())t<e&&T.delete(t)}function de({rawRumEvent:e,startTime:t}){if(e.type!==re.LONG_TASK)return;const o=e.long_task.id;pe(o,t)}const me=/\/(?![vV]\d{1,2}\/)([^/\d?]*\d+[^/?]*)/g;function ve(e){return e?e.replace(me,"/?"):"/"}const D=(e,t)=>e||ve(t);function we(e,t,o){const i={application:{id:t}};o&&(i.session={id:o});const{ids:f,names:c}=ge(e.views);f.length&&(i.view={id:f,name:c});const m=e.longTasks.map(p=>p.id).filter(p=>p!==void 0);return m.length&&(i.long_task={id:m}),i}function ge(e){const t={ids:[],names:[]};for(const o of e)t.ids.push(o.viewId),o.viewName&&t.names.push(o.viewName);return t.names=Array.from(new Set(t.names)),t}function he(e,t,o){return{event:be(e,t,o),"wall-time.json":e}}function be(e,t,o){const i=oe(t),f=we(e,t.applicationId,o),c=ke(i);return{...f,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:c.join(","),_dd:{clock_drift:ae()}}}function ke(e){return e.concat(["language:javascript","runtime:chrome","family:chrome","host:browser"])}const ye={sampleIntervalMs:10,collectIntervalMs:6e4,minProfileDurationMs:5e3,minNumberOfSamples:50};function Ie(e,t,o,i,f,c=ye){const m=ce(e,t,f,6),p=H($.LONG_ANIMATION_FRAME);let g;const v=[];let s={state:"stopped"};function b(n){s.state!=="running"&&(g=n?{startClocks:n.startClocks,viewId:n.id,viewName:D(n.name,document.location.pathname)}:void 0,v.push(N(e,window,"visibilitychange",A).stop,N(e,window,"beforeunload",U).stop),d())}async function k(){await E("stopped"),v.forEach(n=>n()),j(y().relative),i.set({status:"stopped",error_reason:void 0})}function I(n){if(n.state==="running")return{cleanupTasks:n.cleanupTasks,observer:n.observer};const r=[];let a;if(e.trackLongTasks){a=new PerformanceObserver(L),a.observe({entryTypes:[B()]});const l=t.subscribe(12,w=>{de(w)});r.push(()=>a==null?void 0:a.disconnect()),r.push(l.unsubscribe)}const u=t.subscribe(2,l=>{const w={viewId:l.id,viewName:D(l.name,document.location.pathname),startClocks:l.startClocks};S(w),g=w});return r.push(u.unsubscribe),{cleanupTasks:r,observer:a}}function d(){const n=Y().Profiler;if(!n)throw i.set({status:"error",error_reason:"not-supported-by-browser"}),new Error("RUM Profiler is not supported in this browser.");h(s).catch(M);const{cleanupTasks:r,observer:a}=I(s);let u;try{u=new n({sampleInterval:c.sampleIntervalMs,maxBufferSize:Math.round(c.collectIntervalMs*1.5/c.sampleIntervalMs)})}catch(l){l instanceof Error&&l.message.includes("disabled by Document Policy")?(Z.warn("[DD_RUM] Profiler startup failed. Ensure your server includes the `Document-Policy: js-profiling` response header when serving HTML pages.",l),i.set({status:"error",error_reason:"missing-document-policy-header"})):i.set({status:"error",error_reason:"unexpected-exception"});return}i.set({status:"running",error_reason:void 0}),s={state:"running",startClocks:y(),profiler:u,timeoutId:W(d,c.collectIntervalMs),longTasks:[],views:[],cleanupTasks:r,observer:a},S(g),u.addEventListener("samplebufferfull",_)}async function h(n){var r,a;if(n.state!=="running")return;C((a=(r=n.observer)===null||r===void 0?void 0:r.takeRecords())!==null&&a!==void 0?a:[]),ee(n.timeoutId),n.profiler.removeEventListener("samplebufferfull",_);const{startClocks:u,longTasks:l,views:w}=n,G=y();await n.profiler.stop().then(O=>{const P=y(),Q=l.length>0,V=te(u.timeStamp,P.timeStamp)<c.minProfileDurationMs,q=le(O.samples)<c.minNumberOfSamples;!Q&&(V||q)||(F(Object.assign(O,{startClocks:u,endClocks:P,clocksOrigin:ne(),longTasks:l,views:w,sampleInterval:c.sampleIntervalMs})),j(G.relative))}).catch(M)}async function E(n){s.state==="running"&&(s.cleanupTasks.forEach(r=>r()),await h(s),s={state:n})}function S(n){s.state!=="running"||!n||s.views.push(n)}function F(n){var r;const a=(r=o.findTrackedSession())===null||r===void 0?void 0:r.id,u=he(n,e,a);m.send(u)}function _(){d()}function L(n){C(n.getEntries())}function C(n){if(s.state==="running")for(const r of n){if(r.duration<c.sampleIntervalMs)continue;const a=se(r.startTime),u=fe(a.relative);s.longTasks.push({id:u,duration:r.duration,entryType:r.entryType,startClocks:a})}}function A(){document.visibilityState==="hidden"&&s.state==="running"?E("paused").catch(M):document.visibilityState==="visible"&&s.state==="paused"&&d()}function U(){d()}function B(){return p?"long-animation-frame":"longtask"}function x(){return s.state==="stopped"}function K(){return s.state==="running"}function z(){return s.state==="paused"}return{start:b,stop:k,isStopped:x,isRunning:K,isPaused:z}}export{ye as DEFAULT_RUM_PROFILER_CONFIGURATION,Ie as createRumProfiler};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{M as he,a as me,K as ge,W as ye,_ as I,E as we,b as ve,U as Se,s as Ee,r as x,I as xe,c as Te,w as L,L as C,A as T,i as y,Z as X,e as q,F as be,q as Ne,J as D,k,l as _,Q as Ie,o as Ce,d as Me,t as De,f as Re,g as _e,h as Oe,O as Le,n as ze,j,m as J,p as ke,u as K,v as Z,y as Ae,x as Ve,Y as Fe,z as Pe,B as He,C as Q,D as ee,G as $e,X as $,H as Be,N as Ue,P as Ge,R as A}from"./index-n6vdNekm.js";const E={FullSnapshot:2,IncrementalSnapshot:3,Meta:4,Focus:6,ViewEnd:7,VisualViewport:8,FrustrationRecord:9},N={Document:0,DocumentType:1,Element:2,Text:3,CDATA:4,DocumentFragment:11},w={Mutation:0,MouseMove:1,MouseInteraction:2,Scroll:3,ViewportResize:4,Input:5,TouchMove:6,MediaInteraction:7,StyleSheetRule:8},v={MouseUp:0,MouseDown:1,Click:2,ContextMenu:3,DblClick:4,Focus:5,Blur:6,TouchStart:7,TouchEnd:9},B={Play:0,Pause:1};function te(e){return!!e.changedTouches}function R(e){return e.composed===!0&&j(e.target)?e.composedPath()[0]:e.target}const U=25;function We(e){return Math.abs(e.pageTop-e.offsetTop-window.scrollY)>U||Math.abs(e.pageLeft-e.offsetLeft-window.scrollX)>U}const Ye=(e,o)=>{const t=window.visualViewport,s={layoutViewportX:e,layoutViewportY:o,visualViewportX:e,visualViewportY:o};if(t)We(t)?(s.layoutViewportX=Math.round(e+t.offsetLeft),s.layoutViewportY=Math.round(o+t.offsetTop)):(s.visualViewportX=Math.round(e-t.offsetLeft),s.visualViewportY=Math.round(o-t.offsetTop));else return s;return s},oe=e=>({scale:e.scale,offsetLeft:e.offsetLeft,offsetTop:e.offsetTop,pageLeft:e.pageLeft,pageTop:e.pageTop,height:e.height,width:e.width});function S(e,o){return{data:{source:e,...o},type:E.IncrementalSnapshot,timestamp:x()}}const Xe=50;function qe(e,o,t){const{throttled:s,cancel:n}=L(r=>{const u=R(r),a=o.nodeIds.get(u);if(a===void 0)return;const c=ne(r);if(!c)return;const l={id:a,timeOffset:0,x:c.x,y:c.y};t(S(te(r)?w.TouchMove:w.MouseMove,{positions:[l]}))},Xe,{trailing:!1}),{stop:i}=C(e,document,["mousemove","touchmove"],s,{capture:!0,passive:!0});return{stop:()=>{i(),n()}}}function ne(e){let{clientX:o,clientY:t}=te(e)?e.changedTouches[0]:e;if(window.visualViewport){const{visualViewportX:s,visualViewportY:n}=Ye(o,t);o=s,t=n}if(!(!Number.isFinite(o)||!Number.isFinite(t)))return{x:o,y:t}}const G={pointerup:v.MouseUp,mousedown:v.MouseDown,click:v.Click,contextmenu:v.ContextMenu,dblclick:v.DblClick,focus:v.Focus,blur:v.Blur,touchstart:v.TouchStart,touchend:v.TouchEnd};function je(e,o,t,s){const n=i=>{const r=R(i),u=o.nodeIds.get(r);if(u===void 0||T(r,e.defaultPrivacyLevel)===y.HIDDEN)return;const a=G[i.type];let c;if(a!==v.Blur&&a!==v.Focus){const d=ne(i);if(!d)return;c={id:u,type:a,x:d.x,y:d.y}}else c={id:u,type:a};const l={id:s.getIdForEvent(i),...S(w.MouseInteraction,c)};t(l)};return C(e,document,Object.keys(G),n,{capture:!0,passive:!0})}const Je=100;function se(e,o,t,s,n=document){const{throttled:i,cancel:r}=L(a=>{const c=R(a);if(!c)return;const l=o.nodeIds.get(c);if(l===void 0||T(c,e.defaultPrivacyLevel)===y.HIDDEN)return;const d=c===document?{scrollTop:X(),scrollLeft:q()}:{scrollTop:Math.round(c.scrollTop),scrollLeft:Math.round(c.scrollLeft)};s.set(c,d),t(S(w.Scroll,{id:l,x:d.scrollLeft,y:d.scrollTop}))},Je),{stop:u}=be(e,n,"scroll",i,{capture:!0,passive:!0});return{stop:()=>{u(),r()}}}const Ke=200;function Ze(e,o){const t=Ne(e).subscribe(s=>{o(S(w.ViewportResize,s))});return{stop:()=>{t.unsubscribe()}}}function Qe(e,o){const t=window.visualViewport;if(!t)return{stop:I};const{throttled:s,cancel:n}=L(()=>{o({data:oe(t),type:E.VisualViewport,timestamp:x()})},Ke,{trailing:!1}),{stop:i}=C(e,t,["resize","scroll"],s,{capture:!0,passive:!0});return{stop:()=>{i(),n()}}}function et(e,o,t){return C(e,document,["play","pause"],s=>{const n=R(s);if(!n)return;const i=o.nodeIds.get(n);i===void 0||T(n,e.defaultPrivacyLevel)===y.HIDDEN||t(S(w.MediaInteraction,{id:i,type:s.type==="play"?B.Play:B.Pause}))},{capture:!0,passive:!0})}function tt(e,o){function t(i,r){if(!i||!i.ownerNode)return;const u=e.nodeIds.get(i.ownerNode);u!==void 0&&r(u)}const s=[_(CSSStyleSheet.prototype,"insertRule",({target:i,parameters:[r,u]})=>{t(i,a=>o(S(w.StyleSheetRule,{id:a,adds:[{rule:r,index:u}]})))}),_(CSSStyleSheet.prototype,"deleteRule",({target:i,parameters:[r]})=>{t(i,u=>o(S(w.StyleSheetRule,{id:u,removes:[{index:r}]})))})];typeof CSSGroupingRule<"u"?n(CSSGroupingRule):(n(CSSMediaRule),n(CSSSupportsRule));function n(i){s.push(_(i.prototype,"insertRule",({target:r,parameters:[u,a]})=>{t(r.parentStyleSheet,c=>{const l=W(r);l&&(l.push(a||0),o(S(w.StyleSheetRule,{id:c,adds:[{rule:u,index:l}]})))})}),_(i.prototype,"deleteRule",({target:r,parameters:[u]})=>{t(r.parentStyleSheet,a=>{const c=W(r);c&&(c.push(u),o(S(w.StyleSheetRule,{id:a,removes:[{index:c}]})))})}))}return{stop:()=>{s.forEach(i=>i.stop())}}}function W(e){const o=[];let t=e;for(;t.parentRule;){const n=Array.from(t.parentRule.cssRules).indexOf(t);o.unshift(n),t=t.parentRule}if(!t.parentStyleSheet)return;const s=Array.from(t.parentStyleSheet.cssRules).indexOf(t);return o.unshift(s),o}function ot(e,o){return C(e,window,["focus","blur"],()=>{o({data:{has_focus:document.hasFocus()},type:E.Focus,timestamp:x()})})}function nt(e,o,t){const s=e.subscribe(12,n=>{var i,r;n.rawRumEvent.type===Ie.ACTION&&n.rawRumEvent.action.type===Ce.CLICK&&!((r=(i=n.rawRumEvent.action.frustration)===null||i===void 0?void 0:i.type)===null||r===void 0)&&r.length&&"events"in n.domainContext&&n.domainContext.events&&n.domainContext.events.length&&o({timestamp:n.rawRumEvent.date,type:E.FrustrationRecord,data:{frustrationTypes:n.rawRumEvent.action.frustration.type,recordIds:n.domainContext.events.map(u=>t.getIdForEvent(u))}})});return{stop:()=>{s.unsubscribe()}}}function st(e,o){const t=e.subscribe(5,()=>{o({timestamp:x(),type:E.ViewEnd})});return{stop:()=>{t.unsubscribe()}}}function V(e,o){const t=e.tagName,s=e.value;if(k(e,o)){const n=e.type;return t==="INPUT"&&(n==="button"||n==="submit"||n==="reset")?s:!s||t==="OPTION"?void 0:J}if(t==="OPTION"||t==="SELECT")return e.value;if(!(t!=="INPUT"&&t!=="TEXTAREA"))return s}const rt=/url\((?:(')([^']*)'|(")([^"]*)"|([^)]*))\)/gm,it=/^[A-Za-z]+:|^\/\//,at=/^["']?data:.*,/i;function ut(e,o){return e.replace(rt,(t,s,n,i,r,u)=>{const a=n||r||u;if(!o||!a||it.test(a)||at.test(a))return t;const c=s||i||"";return`url(${c}${ct(a,o)}${c})`})}function ct(e,o){try{return Ge(e,o).href}catch{return e}}const lt=/[^a-z1-6-_]/;function re(e){const o=e.toLowerCase().trim();return lt.test(o)?"div":o}function Y(e,o){return`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${e}' height='${o}' style='background-color:silver'%3E%3C/svg%3E`}function ie(e){if(!(e===void 0||e.length===0))return e.map(o=>{const t=o.cssRules||o.rules;return{cssRules:Array.from(t,s=>s.cssText),disabled:o.disabled||void 0,media:o.media.length>0?Array.from(o.media):void 0}})}const dt=1e6;function ae(e,o,t,s){if(o===y.HIDDEN)return null;const n=e.getAttribute(t),i=e.tagName;if($e(i,t,n,o,s)){if(i==="IMG"){const r=e;if(r.naturalWidth>0)return Y(r.naturalWidth,r.naturalHeight);const{width:u,height:a}=e.getBoundingClientRect();return u>0||a>0?Y(u,a):$}return i==="SOURCE"?$:J}return!n||typeof n!="string"?n:Be(n,dt)}function F(){return{cssText:{count:0,max:0,sum:0},serializationDuration:{count:0,max:0,sum:0}}}function O(e,o,t){e[o].count+=1,e[o].max=Math.max(e[o].max,t),e[o].sum+=t}function ft(e,o){for(const t of["cssText","serializationDuration"])e[t].count+=o[t].count,e[t].max=Math.max(e[t].max,o[t].max),e[t].sum+=o[t].sum}function pt(e,o,t){if(o===y.HIDDEN)return{};const s={},n=re(e.tagName),i=e.ownerDocument;for(let l=0;l<e.attributes.length;l+=1){const d=e.attributes.item(l).name,f=ae(e,o,d,t.configuration);f!==null&&(s[d]=f)}if(e.value&&(n==="textarea"||n==="select"||n==="option"||n==="input")){const l=V(e,o);l!==void 0&&(s.value=l)}if(n==="option"&&o===y.ALLOW){const l=e;l.selected&&(s.selected=l.selected)}if(n==="link"){const l=Array.from(i.styleSheets).find(f=>f.href===e.href),d=z(l);d&&l&&(O(t.serializationContext.serializationStats,"cssText",d.length),s._cssText=d)}if(n==="style"&&e.sheet){const l=z(e.sheet);l&&(O(t.serializationContext.serializationStats,"cssText",l.length),s._cssText=l)}const r=e;if(n==="input"&&(r.type==="radio"||r.type==="checkbox")&&(o===y.ALLOW?s.checked=!!r.checked:k(r,o)&&delete s.checked),n==="audio"||n==="video"){const l=e;s.rr_mediaState=l.paused?"paused":"played"}let u,a;const c=t.serializationContext;switch(c.status){case 0:u=Math.round(e.scrollTop),a=Math.round(e.scrollLeft),(u||a)&&c.elementsScrollPositions.set(e,{scrollTop:u,scrollLeft:a});break;case 1:c.elementsScrollPositions.has(e)&&({scrollTop:u,scrollLeft:a}=c.elementsScrollPositions.get(e));break}return a&&(s.rr_scrollLeft=a),u&&(s.rr_scrollTop=u),s}function z(e){if(!e)return null;let o;try{o=e.rules||e.cssRules}catch{}if(!o)return null;const t=Array.from(o,Ue()?ht:ue).join("");return ut(t,e.href)}function ht(e){if(gt(e)&&e.selectorText.includes(":")){const o=/(\[[\w-]+[^\\])(:[^\]]+\])/g;return e.cssText.replace(o,"$1\\$2")}return ue(e)}function ue(e){return mt(e)&&z(e.styleSheet)||e.cssText}function mt(e){return"styleSheet"in e}function gt(e){return"selectorText"in e}function P(e,o,t){const s=yt(e,o,t);if(!s)return null;const n=t.scope.nodeIds.assign(e),i=s;return i.id=n,t.serializedNodeIds&&t.serializedNodeIds.add(n),i}function H(e,o,t){const s=[];return ee(e,n=>{const i=P(n,o,t);i&&s.push(i)}),s}function yt(e,o,t){switch(e.nodeType){case e.DOCUMENT_NODE:return wt(e,o,t);case e.DOCUMENT_FRAGMENT_NODE:return vt(e,o,t);case e.DOCUMENT_TYPE_NODE:return St(e);case e.ELEMENT_NODE:return Et(e,o,t);case e.TEXT_NODE:return Tt(e,o);case e.CDATA_SECTION_NODE:return bt()}}function wt(e,o,t){return{type:N.Document,childNodes:H(e,o,t),adoptedStyleSheets:ie(e.adoptedStyleSheets)}}function vt(e,o,t){const s=Q(e);return s&&t.serializationContext.shadowRootsController.addShadowRoot(e),{type:N.DocumentFragment,childNodes:H(e,o,t),isShadowRoot:s,adoptedStyleSheets:s?ie(e.adoptedStyleSheets):void 0}}function St(e){return{type:N.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId}}function Et(e,o,t){const s=re(e.tagName),n=xt(e)||void 0,i=Ae(Ve(e),o);if(i===y.HIDDEN){const{width:a,height:c}=e.getBoundingClientRect();return{type:N.Element,tagName:s,attributes:{rr_width:`${a}px`,rr_height:`${c}px`,[Pe]:Fe},childNodes:[],isSVG:n}}if(i===y.IGNORE)return;const r=pt(e,i,t);let u=[];return He(e)&&s!=="style"&&(u=H(e,i,t)),{type:N.Element,tagName:s,attributes:r,childNodes:u,isSVG:n}}function xt(e){return e.tagName==="svg"||e instanceof SVGElement}function Tt(e,o){const t=Z(e,o);if(t!==void 0)return{type:N.Text,textContent:t}}function bt(){return{type:N.CDATA,textContent:""}}function Nt(e,o,t,s){const n=x(),i=P(e,o.defaultPrivacyLevel,{serializationContext:s,configuration:o,scope:t});return O(s.serializationStats,"serializationDuration",K(n,x())),i}function It(e){return{nodeIds:e}}function ce(e,o,t,s=document){const n=e.defaultPrivacyLevel,i=new WeakMap,r=s!==document,{stop:u}=C(e,s,r?["change"]:["input","change"],d=>{const f=R(d);(f instanceof HTMLInputElement||f instanceof HTMLTextAreaElement||f instanceof HTMLSelectElement)&&c(f)},{capture:!0,passive:!0});let a;if(r)a=I;else{const d=[D(HTMLInputElement.prototype,"value",c),D(HTMLInputElement.prototype,"checked",c),D(HTMLSelectElement.prototype,"value",c),D(HTMLTextAreaElement.prototype,"value",c),D(HTMLSelectElement.prototype,"selectedIndex",c)];a=()=>{d.forEach(f=>f.stop())}}return{stop:()=>{a(),u()}};function c(d){const f=T(d,n);if(f===y.HIDDEN)return;const p=d.type;let g;if(p==="radio"||p==="checkbox"){if(k(d,f))return;g={isChecked:d.checked}}else{const h=V(d,f);if(h===void 0)return;g={text:h}}l(d,g,o);const m=d.name;p==="radio"&&m&&d.checked&&document.querySelectorAll(`input[type="radio"][name="${CSS.escape(m)}"]`).forEach(h=>{h!==d&&l(h,{isChecked:!1},o)})}function l(d,f,p){const g=p.nodeIds.get(d);if(g===void 0)return;const m=i.get(d);(!m||m.text!==f.text||m.isChecked!==f.isChecked)&&(i.set(d,f),t(S(w.Input,{id:g,...f})))}}const Ct=100,Mt=16;function Dt(e){let o=I,t=[];function s(){o(),e(t),t=[]}const{throttled:n,cancel:i}=L(s,Mt,{leading:!1});return{addMutations:r=>{t.length===0&&(o=Oe(n,{timeout:Ct})),t.push(...r)},flush:s,stop:()=>{o(),i()}}}function le(e,o,t,s,n){const i=xe();if(!i)return{stop:I,flush:I};const r=Dt(a=>{Rt(a.concat(u.takeRecords()),e,o,t,s)}),u=new i(Te(r.addMutations));return u.observe(n,{attributeOldValue:!0,attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),{stop:()=>{u.disconnect(),r.stop()},flush:()=>{r.flush()}}}function Rt(e,o,t,s,n){const i=new Map;e.filter(p=>p.type==="childList").forEach(p=>{p.removedNodes.forEach(g=>{de(g,n.removeShadowRoot)})});const r=e.filter(p=>p.target.isConnected&&s.nodeIds.areAssignedForNodeAndAncestors(p.target)&&T(p.target,t.defaultPrivacyLevel,i)!==y.HIDDEN),u=F(),{adds:a,removes:c,hasBeenSerialized:l}=_t(r.filter(p=>p.type==="childList"),t,s,u,n,i),d=Ot(r.filter(p=>p.type==="characterData"&&!l(p.target)),t,s,i),f=Lt(r.filter(p=>p.type==="attributes"&&!l(p.target)),t,s,i);!d.length&&!f.length&&!c.length&&!a.length||o(S(w.Mutation,{adds:a,removes:c,texts:d,attributes:f}),u)}function _t(e,o,t,s,n,i){const r=new Set,u=new Map;for(const m of e)m.addedNodes.forEach(h=>{r.add(h)}),m.removedNodes.forEach(h=>{r.has(h)||u.set(h,m.target),r.delete(h)});const a=Array.from(r);zt(a);const c=new Set,l={status:2,serializationStats:s,shadowRootsController:n},d=[];for(const m of a){if(p(m))continue;const h=T(m.parentNode,o.defaultPrivacyLevel,i);if(h===y.HIDDEN||h===y.IGNORE)continue;const b=x(),M=P(m,h,{serializedNodeIds:c,serializationContext:l,configuration:o,scope:t});if(O(s,"serializationDuration",K(b,x())),!M)continue;const pe=A(m);d.push({nextId:g(m),parentId:t.nodeIds.get(pe),node:M})}const f=[];return u.forEach((m,h)=>{const b=t.nodeIds.get(m),M=t.nodeIds.get(h);b!==void 0&&M!==void 0&&f.push({parentId:b,id:M})}),{adds:d,removes:f,hasBeenSerialized:p};function p(m){const h=t.nodeIds.get(m);return h!==void 0&&c.has(h)}function g(m){let h=m.nextSibling;for(;h;){const b=t.nodeIds.get(h);if(b!==void 0)return b;h=h.nextSibling}return null}}function Ot(e,o,t,s){var n;const i=[],r=new Set,u=e.filter(a=>r.has(a.target)?!1:(r.add(a.target),!0));for(const a of u){if(a.target.textContent===a.oldValue)continue;const c=t.nodeIds.get(a.target);if(c===void 0)continue;const l=T(A(a.target),o.defaultPrivacyLevel,s);l===y.HIDDEN||l===y.IGNORE||i.push({id:c,value:(n=Z(a.target,l))!==null&&n!==void 0?n:null})}return i}function Lt(e,o,t,s){const n=[],i=new Map,r=e.filter(a=>{const c=i.get(a.target);return c&&c.has(a.attributeName)?!1:(c?c.add(a.attributeName):i.set(a.target,new Set([a.attributeName])),!0)}),u=new Map;for(const a of r){if(a.target.getAttribute(a.attributeName)===a.oldValue)continue;const c=t.nodeIds.get(a.target);if(c===void 0)continue;const l=T(a.target,o.defaultPrivacyLevel,s),d=ae(a.target,l,a.attributeName,o);let f;if(a.attributeName==="value"){const g=V(a.target,l);if(g===void 0)continue;f=g}else typeof d=="string"?f=d:f=null;let p=u.get(a.target);p||(p={id:c,attributes:{}},n.push(p),u.set(a.target,p)),p.attributes[a.attributeName]=f}return n}function zt(e){e.sort((o,t)=>{const s=o.compareDocumentPosition(t);return s&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:s&Node.DOCUMENT_POSITION_CONTAINS||s&Node.DOCUMENT_POSITION_FOLLOWING?1:s&Node.DOCUMENT_POSITION_PRECEDING?-1:0})}function de(e,o){j(e)&&o(e.shadowRoot),ee(e,t=>de(t,o))}function kt(){const e=new WeakMap;return{set(o,t){o===document&&!document.scrollingElement||e.set(o===document?document.scrollingElement:o,t)},get(o){return e.get(o)},has(o){return e.has(o)}}}const At=(e,o,t,s)=>{const n=new Map,i={addShadowRoot:r=>{if(n.has(r))return;const u=le(t,e,o,i,r),a=ce(e,o,t,r),c=se(e,o,t,s,r);n.set(r,{flush:()=>u.flush(),stop:()=>{u.stop(),a.stop(),c.stop()}})},removeShadowRoot:r=>{const u=n.get(r);u&&(u.stop(),n.delete(r))},stop:()=>{n.forEach(({stop:r})=>r())},flush:()=>{n.forEach(({flush:r})=>r())}};return i};function Vt(e,o,t,s,n,i,r){const u=(c,l)=>{const{width:d,height:f}=_e();r({data:{height:f,href:window.location.href,width:d},type:E.Meta,timestamp:c}),r({data:{has_focus:document.hasFocus()},type:E.Focus,timestamp:c});const p=F();r({data:{node:Nt(document,s,n,{status:l,elementsScrollPositions:e,serializationStats:p,shadowRootsController:o}),initialOffset:{left:q(),top:X()}},type:E.FullSnapshot,timestamp:c},p),window.visualViewport&&r({data:oe(window.visualViewport),type:E.VisualViewport,timestamp:c})};u(x(),0);const{unsubscribe:a}=t.subscribe(2,c=>{i(),u(c.startClocks.timeStamp,1)});return{stop:a}}function Ft(){const e=new WeakMap;let o=1;return{getIdForEvent(t){return e.has(t)||e.set(t,o++),e.get(t)}}}function Pt(){const e=new WeakMap;let o=1;const t=s=>e.get(s);return{assign:s=>{let n=t(s);return n===void 0&&(n=o++,e.set(s,n)),n},get:t,areAssignedForNodeAndAncestors:s=>{let n=s;for(;n;){if(t(n)===void 0&&!Q(n))return!1;n=A(n)}return!0}}}function Ht(e){const{emit:o,configuration:t,lifeCycle:s}=e;if(!o)throw new Error("emit function is required");const n=(p,g)=>{o(p,g),Le("record",{record:p});const m=e.viewHistory.findView();ze(m.id)},i=kt(),r=It(Pt()),u=At(t,r,n,i),{stop:a}=Vt(i,u,s,t,r,c,n);function c(){u.flush(),d.flush()}const l=Ft(),d=le(n,t,r,u,document),f=[d,qe(t,r,n),je(t,r,n,l),se(t,r,n,i,document),Ze(t,n),ce(t,r,n),et(t,r,n),tt(r,n),ot(t,n),Qe(t,n),nt(s,n,l),st(s,p=>{c(),n(p)})];return{stop:()=>{u.stop(),f.forEach(p=>p.stop()),a()},flushMutations:c,shadowRootsController:u}}function $t(e,o,t,s){const n=new FormData;n.append("segment",new Blob([e],{type:"application/octet-stream"}),`${o.session.id}-${o.start}`);const i={raw_segment_size:s,compressed_segment_size:e.byteLength,...o},r=JSON.stringify(i);return n.append("event",new Blob([r],{type:"application/json"})),{data:n,bytesCount:e.byteLength,cssText:t.cssText,isFullSnapshot:o.index_in_view===0,rawSize:s,recordCount:o.records_count,serializationDuration:t.serializationDuration}}function Bt({context:e,creationReason:o,encoder:t}){let s=0;const n=e.view.id,i=De(n),r={start:1/0,end:-1/0,creation_reason:o,records_count:0,has_full_snapshot:!1,index_in_view:i,source:"browser",...e},u=F();Re(n);function a(l,d,f){r.start=Math.min(r.start,l.timestamp),r.end=Math.max(r.end,l.timestamp),r.records_count+=1,r.has_full_snapshot||(r.has_full_snapshot=l.type===E.FullSnapshot),d&&ft(u,d);const p=t.isEmpty?'{"records":[':",";t.write(p+JSON.stringify(l),g=>{s+=g,f(s)})}function c(l){if(t.isEmpty)throw new Error("Empty segment flushed");t.write(`],${JSON.stringify(r).slice(1)}
|
|
1
|
+
import{M as he,a as me,K as ge,W as ye,_ as I,E as we,b as ve,U as Se,s as Ee,r as x,I as xe,c as Te,w as L,L as C,A as T,i as y,Z as X,e as q,F as be,q as Ne,J as D,k,l as _,Q as Ie,o as Ce,d as Me,t as De,f as Re,g as _e,h as Oe,O as Le,n as ze,j,m as J,p as ke,u as K,v as Z,y as Ae,x as Ve,Y as Fe,z as Pe,B as He,C as Q,D as ee,G as $e,X as $,H as Be,N as Ue,P as Ge,R as A}from"./index-Idv3uxDb.js";const E={FullSnapshot:2,IncrementalSnapshot:3,Meta:4,Focus:6,ViewEnd:7,VisualViewport:8,FrustrationRecord:9},N={Document:0,DocumentType:1,Element:2,Text:3,CDATA:4,DocumentFragment:11},w={Mutation:0,MouseMove:1,MouseInteraction:2,Scroll:3,ViewportResize:4,Input:5,TouchMove:6,MediaInteraction:7,StyleSheetRule:8},v={MouseUp:0,MouseDown:1,Click:2,ContextMenu:3,DblClick:4,Focus:5,Blur:6,TouchStart:7,TouchEnd:9},B={Play:0,Pause:1};function te(e){return!!e.changedTouches}function R(e){return e.composed===!0&&j(e.target)?e.composedPath()[0]:e.target}const U=25;function We(e){return Math.abs(e.pageTop-e.offsetTop-window.scrollY)>U||Math.abs(e.pageLeft-e.offsetLeft-window.scrollX)>U}const Ye=(e,o)=>{const t=window.visualViewport,s={layoutViewportX:e,layoutViewportY:o,visualViewportX:e,visualViewportY:o};if(t)We(t)?(s.layoutViewportX=Math.round(e+t.offsetLeft),s.layoutViewportY=Math.round(o+t.offsetTop)):(s.visualViewportX=Math.round(e-t.offsetLeft),s.visualViewportY=Math.round(o-t.offsetTop));else return s;return s},oe=e=>({scale:e.scale,offsetLeft:e.offsetLeft,offsetTop:e.offsetTop,pageLeft:e.pageLeft,pageTop:e.pageTop,height:e.height,width:e.width});function S(e,o){return{data:{source:e,...o},type:E.IncrementalSnapshot,timestamp:x()}}const Xe=50;function qe(e,o,t){const{throttled:s,cancel:n}=L(r=>{const u=R(r),a=o.nodeIds.get(u);if(a===void 0)return;const c=ne(r);if(!c)return;const l={id:a,timeOffset:0,x:c.x,y:c.y};t(S(te(r)?w.TouchMove:w.MouseMove,{positions:[l]}))},Xe,{trailing:!1}),{stop:i}=C(e,document,["mousemove","touchmove"],s,{capture:!0,passive:!0});return{stop:()=>{i(),n()}}}function ne(e){let{clientX:o,clientY:t}=te(e)?e.changedTouches[0]:e;if(window.visualViewport){const{visualViewportX:s,visualViewportY:n}=Ye(o,t);o=s,t=n}if(!(!Number.isFinite(o)||!Number.isFinite(t)))return{x:o,y:t}}const G={pointerup:v.MouseUp,mousedown:v.MouseDown,click:v.Click,contextmenu:v.ContextMenu,dblclick:v.DblClick,focus:v.Focus,blur:v.Blur,touchstart:v.TouchStart,touchend:v.TouchEnd};function je(e,o,t,s){const n=i=>{const r=R(i),u=o.nodeIds.get(r);if(u===void 0||T(r,e.defaultPrivacyLevel)===y.HIDDEN)return;const a=G[i.type];let c;if(a!==v.Blur&&a!==v.Focus){const d=ne(i);if(!d)return;c={id:u,type:a,x:d.x,y:d.y}}else c={id:u,type:a};const l={id:s.getIdForEvent(i),...S(w.MouseInteraction,c)};t(l)};return C(e,document,Object.keys(G),n,{capture:!0,passive:!0})}const Je=100;function se(e,o,t,s,n=document){const{throttled:i,cancel:r}=L(a=>{const c=R(a);if(!c)return;const l=o.nodeIds.get(c);if(l===void 0||T(c,e.defaultPrivacyLevel)===y.HIDDEN)return;const d=c===document?{scrollTop:X(),scrollLeft:q()}:{scrollTop:Math.round(c.scrollTop),scrollLeft:Math.round(c.scrollLeft)};s.set(c,d),t(S(w.Scroll,{id:l,x:d.scrollLeft,y:d.scrollTop}))},Je),{stop:u}=be(e,n,"scroll",i,{capture:!0,passive:!0});return{stop:()=>{u(),r()}}}const Ke=200;function Ze(e,o){const t=Ne(e).subscribe(s=>{o(S(w.ViewportResize,s))});return{stop:()=>{t.unsubscribe()}}}function Qe(e,o){const t=window.visualViewport;if(!t)return{stop:I};const{throttled:s,cancel:n}=L(()=>{o({data:oe(t),type:E.VisualViewport,timestamp:x()})},Ke,{trailing:!1}),{stop:i}=C(e,t,["resize","scroll"],s,{capture:!0,passive:!0});return{stop:()=>{i(),n()}}}function et(e,o,t){return C(e,document,["play","pause"],s=>{const n=R(s);if(!n)return;const i=o.nodeIds.get(n);i===void 0||T(n,e.defaultPrivacyLevel)===y.HIDDEN||t(S(w.MediaInteraction,{id:i,type:s.type==="play"?B.Play:B.Pause}))},{capture:!0,passive:!0})}function tt(e,o){function t(i,r){if(!i||!i.ownerNode)return;const u=e.nodeIds.get(i.ownerNode);u!==void 0&&r(u)}const s=[_(CSSStyleSheet.prototype,"insertRule",({target:i,parameters:[r,u]})=>{t(i,a=>o(S(w.StyleSheetRule,{id:a,adds:[{rule:r,index:u}]})))}),_(CSSStyleSheet.prototype,"deleteRule",({target:i,parameters:[r]})=>{t(i,u=>o(S(w.StyleSheetRule,{id:u,removes:[{index:r}]})))})];typeof CSSGroupingRule<"u"?n(CSSGroupingRule):(n(CSSMediaRule),n(CSSSupportsRule));function n(i){s.push(_(i.prototype,"insertRule",({target:r,parameters:[u,a]})=>{t(r.parentStyleSheet,c=>{const l=W(r);l&&(l.push(a||0),o(S(w.StyleSheetRule,{id:c,adds:[{rule:u,index:l}]})))})}),_(i.prototype,"deleteRule",({target:r,parameters:[u]})=>{t(r.parentStyleSheet,a=>{const c=W(r);c&&(c.push(u),o(S(w.StyleSheetRule,{id:a,removes:[{index:c}]})))})}))}return{stop:()=>{s.forEach(i=>i.stop())}}}function W(e){const o=[];let t=e;for(;t.parentRule;){const n=Array.from(t.parentRule.cssRules).indexOf(t);o.unshift(n),t=t.parentRule}if(!t.parentStyleSheet)return;const s=Array.from(t.parentStyleSheet.cssRules).indexOf(t);return o.unshift(s),o}function ot(e,o){return C(e,window,["focus","blur"],()=>{o({data:{has_focus:document.hasFocus()},type:E.Focus,timestamp:x()})})}function nt(e,o,t){const s=e.subscribe(12,n=>{var i,r;n.rawRumEvent.type===Ie.ACTION&&n.rawRumEvent.action.type===Ce.CLICK&&!((r=(i=n.rawRumEvent.action.frustration)===null||i===void 0?void 0:i.type)===null||r===void 0)&&r.length&&"events"in n.domainContext&&n.domainContext.events&&n.domainContext.events.length&&o({timestamp:n.rawRumEvent.date,type:E.FrustrationRecord,data:{frustrationTypes:n.rawRumEvent.action.frustration.type,recordIds:n.domainContext.events.map(u=>t.getIdForEvent(u))}})});return{stop:()=>{s.unsubscribe()}}}function st(e,o){const t=e.subscribe(5,()=>{o({timestamp:x(),type:E.ViewEnd})});return{stop:()=>{t.unsubscribe()}}}function V(e,o){const t=e.tagName,s=e.value;if(k(e,o)){const n=e.type;return t==="INPUT"&&(n==="button"||n==="submit"||n==="reset")?s:!s||t==="OPTION"?void 0:J}if(t==="OPTION"||t==="SELECT")return e.value;if(!(t!=="INPUT"&&t!=="TEXTAREA"))return s}const rt=/url\((?:(')([^']*)'|(")([^"]*)"|([^)]*))\)/gm,it=/^[A-Za-z]+:|^\/\//,at=/^["']?data:.*,/i;function ut(e,o){return e.replace(rt,(t,s,n,i,r,u)=>{const a=n||r||u;if(!o||!a||it.test(a)||at.test(a))return t;const c=s||i||"";return`url(${c}${ct(a,o)}${c})`})}function ct(e,o){try{return Ge(e,o).href}catch{return e}}const lt=/[^a-z1-6-_]/;function re(e){const o=e.toLowerCase().trim();return lt.test(o)?"div":o}function Y(e,o){return`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${e}' height='${o}' style='background-color:silver'%3E%3C/svg%3E`}function ie(e){if(!(e===void 0||e.length===0))return e.map(o=>{const t=o.cssRules||o.rules;return{cssRules:Array.from(t,s=>s.cssText),disabled:o.disabled||void 0,media:o.media.length>0?Array.from(o.media):void 0}})}const dt=1e6;function ae(e,o,t,s){if(o===y.HIDDEN)return null;const n=e.getAttribute(t),i=e.tagName;if($e(i,t,n,o,s)){if(i==="IMG"){const r=e;if(r.naturalWidth>0)return Y(r.naturalWidth,r.naturalHeight);const{width:u,height:a}=e.getBoundingClientRect();return u>0||a>0?Y(u,a):$}return i==="SOURCE"?$:J}return!n||typeof n!="string"?n:Be(n,dt)}function F(){return{cssText:{count:0,max:0,sum:0},serializationDuration:{count:0,max:0,sum:0}}}function O(e,o,t){e[o].count+=1,e[o].max=Math.max(e[o].max,t),e[o].sum+=t}function ft(e,o){for(const t of["cssText","serializationDuration"])e[t].count+=o[t].count,e[t].max=Math.max(e[t].max,o[t].max),e[t].sum+=o[t].sum}function pt(e,o,t){if(o===y.HIDDEN)return{};const s={},n=re(e.tagName),i=e.ownerDocument;for(let l=0;l<e.attributes.length;l+=1){const d=e.attributes.item(l).name,f=ae(e,o,d,t.configuration);f!==null&&(s[d]=f)}if(e.value&&(n==="textarea"||n==="select"||n==="option"||n==="input")){const l=V(e,o);l!==void 0&&(s.value=l)}if(n==="option"&&o===y.ALLOW){const l=e;l.selected&&(s.selected=l.selected)}if(n==="link"){const l=Array.from(i.styleSheets).find(f=>f.href===e.href),d=z(l);d&&l&&(O(t.serializationContext.serializationStats,"cssText",d.length),s._cssText=d)}if(n==="style"&&e.sheet){const l=z(e.sheet);l&&(O(t.serializationContext.serializationStats,"cssText",l.length),s._cssText=l)}const r=e;if(n==="input"&&(r.type==="radio"||r.type==="checkbox")&&(o===y.ALLOW?s.checked=!!r.checked:k(r,o)&&delete s.checked),n==="audio"||n==="video"){const l=e;s.rr_mediaState=l.paused?"paused":"played"}let u,a;const c=t.serializationContext;switch(c.status){case 0:u=Math.round(e.scrollTop),a=Math.round(e.scrollLeft),(u||a)&&c.elementsScrollPositions.set(e,{scrollTop:u,scrollLeft:a});break;case 1:c.elementsScrollPositions.has(e)&&({scrollTop:u,scrollLeft:a}=c.elementsScrollPositions.get(e));break}return a&&(s.rr_scrollLeft=a),u&&(s.rr_scrollTop=u),s}function z(e){if(!e)return null;let o;try{o=e.rules||e.cssRules}catch{}if(!o)return null;const t=Array.from(o,Ue()?ht:ue).join("");return ut(t,e.href)}function ht(e){if(gt(e)&&e.selectorText.includes(":")){const o=/(\[[\w-]+[^\\])(:[^\]]+\])/g;return e.cssText.replace(o,"$1\\$2")}return ue(e)}function ue(e){return mt(e)&&z(e.styleSheet)||e.cssText}function mt(e){return"styleSheet"in e}function gt(e){return"selectorText"in e}function P(e,o,t){const s=yt(e,o,t);if(!s)return null;const n=t.scope.nodeIds.assign(e),i=s;return i.id=n,t.serializedNodeIds&&t.serializedNodeIds.add(n),i}function H(e,o,t){const s=[];return ee(e,n=>{const i=P(n,o,t);i&&s.push(i)}),s}function yt(e,o,t){switch(e.nodeType){case e.DOCUMENT_NODE:return wt(e,o,t);case e.DOCUMENT_FRAGMENT_NODE:return vt(e,o,t);case e.DOCUMENT_TYPE_NODE:return St(e);case e.ELEMENT_NODE:return Et(e,o,t);case e.TEXT_NODE:return Tt(e,o);case e.CDATA_SECTION_NODE:return bt()}}function wt(e,o,t){return{type:N.Document,childNodes:H(e,o,t),adoptedStyleSheets:ie(e.adoptedStyleSheets)}}function vt(e,o,t){const s=Q(e);return s&&t.serializationContext.shadowRootsController.addShadowRoot(e),{type:N.DocumentFragment,childNodes:H(e,o,t),isShadowRoot:s,adoptedStyleSheets:s?ie(e.adoptedStyleSheets):void 0}}function St(e){return{type:N.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId}}function Et(e,o,t){const s=re(e.tagName),n=xt(e)||void 0,i=Ae(Ve(e),o);if(i===y.HIDDEN){const{width:a,height:c}=e.getBoundingClientRect();return{type:N.Element,tagName:s,attributes:{rr_width:`${a}px`,rr_height:`${c}px`,[Pe]:Fe},childNodes:[],isSVG:n}}if(i===y.IGNORE)return;const r=pt(e,i,t);let u=[];return He(e)&&s!=="style"&&(u=H(e,i,t)),{type:N.Element,tagName:s,attributes:r,childNodes:u,isSVG:n}}function xt(e){return e.tagName==="svg"||e instanceof SVGElement}function Tt(e,o){const t=Z(e,o);if(t!==void 0)return{type:N.Text,textContent:t}}function bt(){return{type:N.CDATA,textContent:""}}function Nt(e,o,t,s){const n=x(),i=P(e,o.defaultPrivacyLevel,{serializationContext:s,configuration:o,scope:t});return O(s.serializationStats,"serializationDuration",K(n,x())),i}function It(e){return{nodeIds:e}}function ce(e,o,t,s=document){const n=e.defaultPrivacyLevel,i=new WeakMap,r=s!==document,{stop:u}=C(e,s,r?["change"]:["input","change"],d=>{const f=R(d);(f instanceof HTMLInputElement||f instanceof HTMLTextAreaElement||f instanceof HTMLSelectElement)&&c(f)},{capture:!0,passive:!0});let a;if(r)a=I;else{const d=[D(HTMLInputElement.prototype,"value",c),D(HTMLInputElement.prototype,"checked",c),D(HTMLSelectElement.prototype,"value",c),D(HTMLTextAreaElement.prototype,"value",c),D(HTMLSelectElement.prototype,"selectedIndex",c)];a=()=>{d.forEach(f=>f.stop())}}return{stop:()=>{a(),u()}};function c(d){const f=T(d,n);if(f===y.HIDDEN)return;const p=d.type;let g;if(p==="radio"||p==="checkbox"){if(k(d,f))return;g={isChecked:d.checked}}else{const h=V(d,f);if(h===void 0)return;g={text:h}}l(d,g,o);const m=d.name;p==="radio"&&m&&d.checked&&document.querySelectorAll(`input[type="radio"][name="${CSS.escape(m)}"]`).forEach(h=>{h!==d&&l(h,{isChecked:!1},o)})}function l(d,f,p){const g=p.nodeIds.get(d);if(g===void 0)return;const m=i.get(d);(!m||m.text!==f.text||m.isChecked!==f.isChecked)&&(i.set(d,f),t(S(w.Input,{id:g,...f})))}}const Ct=100,Mt=16;function Dt(e){let o=I,t=[];function s(){o(),e(t),t=[]}const{throttled:n,cancel:i}=L(s,Mt,{leading:!1});return{addMutations:r=>{t.length===0&&(o=Oe(n,{timeout:Ct})),t.push(...r)},flush:s,stop:()=>{o(),i()}}}function le(e,o,t,s,n){const i=xe();if(!i)return{stop:I,flush:I};const r=Dt(a=>{Rt(a.concat(u.takeRecords()),e,o,t,s)}),u=new i(Te(r.addMutations));return u.observe(n,{attributeOldValue:!0,attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),{stop:()=>{u.disconnect(),r.stop()},flush:()=>{r.flush()}}}function Rt(e,o,t,s,n){const i=new Map;e.filter(p=>p.type==="childList").forEach(p=>{p.removedNodes.forEach(g=>{de(g,n.removeShadowRoot)})});const r=e.filter(p=>p.target.isConnected&&s.nodeIds.areAssignedForNodeAndAncestors(p.target)&&T(p.target,t.defaultPrivacyLevel,i)!==y.HIDDEN),u=F(),{adds:a,removes:c,hasBeenSerialized:l}=_t(r.filter(p=>p.type==="childList"),t,s,u,n,i),d=Ot(r.filter(p=>p.type==="characterData"&&!l(p.target)),t,s,i),f=Lt(r.filter(p=>p.type==="attributes"&&!l(p.target)),t,s,i);!d.length&&!f.length&&!c.length&&!a.length||o(S(w.Mutation,{adds:a,removes:c,texts:d,attributes:f}),u)}function _t(e,o,t,s,n,i){const r=new Set,u=new Map;for(const m of e)m.addedNodes.forEach(h=>{r.add(h)}),m.removedNodes.forEach(h=>{r.has(h)||u.set(h,m.target),r.delete(h)});const a=Array.from(r);zt(a);const c=new Set,l={status:2,serializationStats:s,shadowRootsController:n},d=[];for(const m of a){if(p(m))continue;const h=T(m.parentNode,o.defaultPrivacyLevel,i);if(h===y.HIDDEN||h===y.IGNORE)continue;const b=x(),M=P(m,h,{serializedNodeIds:c,serializationContext:l,configuration:o,scope:t});if(O(s,"serializationDuration",K(b,x())),!M)continue;const pe=A(m);d.push({nextId:g(m),parentId:t.nodeIds.get(pe),node:M})}const f=[];return u.forEach((m,h)=>{const b=t.nodeIds.get(m),M=t.nodeIds.get(h);b!==void 0&&M!==void 0&&f.push({parentId:b,id:M})}),{adds:d,removes:f,hasBeenSerialized:p};function p(m){const h=t.nodeIds.get(m);return h!==void 0&&c.has(h)}function g(m){let h=m.nextSibling;for(;h;){const b=t.nodeIds.get(h);if(b!==void 0)return b;h=h.nextSibling}return null}}function Ot(e,o,t,s){var n;const i=[],r=new Set,u=e.filter(a=>r.has(a.target)?!1:(r.add(a.target),!0));for(const a of u){if(a.target.textContent===a.oldValue)continue;const c=t.nodeIds.get(a.target);if(c===void 0)continue;const l=T(A(a.target),o.defaultPrivacyLevel,s);l===y.HIDDEN||l===y.IGNORE||i.push({id:c,value:(n=Z(a.target,l))!==null&&n!==void 0?n:null})}return i}function Lt(e,o,t,s){const n=[],i=new Map,r=e.filter(a=>{const c=i.get(a.target);return c&&c.has(a.attributeName)?!1:(c?c.add(a.attributeName):i.set(a.target,new Set([a.attributeName])),!0)}),u=new Map;for(const a of r){if(a.target.getAttribute(a.attributeName)===a.oldValue)continue;const c=t.nodeIds.get(a.target);if(c===void 0)continue;const l=T(a.target,o.defaultPrivacyLevel,s),d=ae(a.target,l,a.attributeName,o);let f;if(a.attributeName==="value"){const g=V(a.target,l);if(g===void 0)continue;f=g}else typeof d=="string"?f=d:f=null;let p=u.get(a.target);p||(p={id:c,attributes:{}},n.push(p),u.set(a.target,p)),p.attributes[a.attributeName]=f}return n}function zt(e){e.sort((o,t)=>{const s=o.compareDocumentPosition(t);return s&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:s&Node.DOCUMENT_POSITION_CONTAINS||s&Node.DOCUMENT_POSITION_FOLLOWING?1:s&Node.DOCUMENT_POSITION_PRECEDING?-1:0})}function de(e,o){j(e)&&o(e.shadowRoot),ee(e,t=>de(t,o))}function kt(){const e=new WeakMap;return{set(o,t){o===document&&!document.scrollingElement||e.set(o===document?document.scrollingElement:o,t)},get(o){return e.get(o)},has(o){return e.has(o)}}}const At=(e,o,t,s)=>{const n=new Map,i={addShadowRoot:r=>{if(n.has(r))return;const u=le(t,e,o,i,r),a=ce(e,o,t,r),c=se(e,o,t,s,r);n.set(r,{flush:()=>u.flush(),stop:()=>{u.stop(),a.stop(),c.stop()}})},removeShadowRoot:r=>{const u=n.get(r);u&&(u.stop(),n.delete(r))},stop:()=>{n.forEach(({stop:r})=>r())},flush:()=>{n.forEach(({flush:r})=>r())}};return i};function Vt(e,o,t,s,n,i,r){const u=(c,l)=>{const{width:d,height:f}=_e();r({data:{height:f,href:window.location.href,width:d},type:E.Meta,timestamp:c}),r({data:{has_focus:document.hasFocus()},type:E.Focus,timestamp:c});const p=F();r({data:{node:Nt(document,s,n,{status:l,elementsScrollPositions:e,serializationStats:p,shadowRootsController:o}),initialOffset:{left:q(),top:X()}},type:E.FullSnapshot,timestamp:c},p),window.visualViewport&&r({data:oe(window.visualViewport),type:E.VisualViewport,timestamp:c})};u(x(),0);const{unsubscribe:a}=t.subscribe(2,c=>{i(),u(c.startClocks.timeStamp,1)});return{stop:a}}function Ft(){const e=new WeakMap;let o=1;return{getIdForEvent(t){return e.has(t)||e.set(t,o++),e.get(t)}}}function Pt(){const e=new WeakMap;let o=1;const t=s=>e.get(s);return{assign:s=>{let n=t(s);return n===void 0&&(n=o++,e.set(s,n)),n},get:t,areAssignedForNodeAndAncestors:s=>{let n=s;for(;n;){if(t(n)===void 0&&!Q(n))return!1;n=A(n)}return!0}}}function Ht(e){const{emit:o,configuration:t,lifeCycle:s}=e;if(!o)throw new Error("emit function is required");const n=(p,g)=>{o(p,g),Le("record",{record:p});const m=e.viewHistory.findView();ze(m.id)},i=kt(),r=It(Pt()),u=At(t,r,n,i),{stop:a}=Vt(i,u,s,t,r,c,n);function c(){u.flush(),d.flush()}const l=Ft(),d=le(n,t,r,u,document),f=[d,qe(t,r,n),je(t,r,n,l),se(t,r,n,i,document),Ze(t,n),ce(t,r,n),et(t,r,n),tt(r,n),ot(t,n),Qe(t,n),nt(s,n,l),st(s,p=>{c(),n(p)})];return{stop:()=>{u.stop(),f.forEach(p=>p.stop()),a()},flushMutations:c,shadowRootsController:u}}function $t(e,o,t,s){const n=new FormData;n.append("segment",new Blob([e],{type:"application/octet-stream"}),`${o.session.id}-${o.start}`);const i={raw_segment_size:s,compressed_segment_size:e.byteLength,...o},r=JSON.stringify(i);return n.append("event",new Blob([r],{type:"application/json"})),{data:n,bytesCount:e.byteLength,cssText:t.cssText,isFullSnapshot:o.index_in_view===0,rawSize:s,recordCount:o.records_count,serializationDuration:t.serializationDuration}}function Bt({context:e,creationReason:o,encoder:t}){let s=0;const n=e.view.id,i=De(n),r={start:1/0,end:-1/0,creation_reason:o,records_count:0,has_full_snapshot:!1,index_in_view:i,source:"browser",...e},u=F();Re(n);function a(l,d,f){r.start=Math.min(r.start,l.timestamp),r.end=Math.max(r.end,l.timestamp),r.records_count+=1,r.has_full_snapshot||(r.has_full_snapshot=l.type===E.FullSnapshot),d&&ft(u,d);const p=t.isEmpty?'{"records":[':",";t.write(p+JSON.stringify(l),g=>{s+=g,f(s)})}function c(l){if(t.isEmpty)throw new Error("Empty segment flushed");t.write(`],${JSON.stringify(r).slice(1)}
|
|
2
2
|
`),t.finish(d=>{ke(r.view.id,d.rawBytesCount),l(r,u,d)})}return{addRecord:a,flush:c}}const Ut=5*Me;let fe=6e4;function Gt(e,o,t,s,n,i){return Wt(e,()=>Yt(o.applicationId,t,s),n,i)}function Wt(e,o,t,s){let n={status:0,nextSegmentCreationReason:"init"};const{unsubscribe:i}=e.subscribe(2,()=>{u("view_change")}),{unsubscribe:r}=e.subscribe(11,a=>{u(a.reason)});function u(a){n.status===1&&(n.segment.flush((c,l,d)=>{const f=$t(d.output,c,l,d.rawBytesCount);ve(a)?t.sendOnExit(f):t.send(f)}),Se(n.expirationTimeoutId)),a!=="stop"?n={status:0,nextSegmentCreationReason:a}:n={status:2}}return{addRecord:(a,c)=>{if(n.status!==2){if(n.status===0){const l=o();if(!l)return;n={status:1,segment:Bt({encoder:s,context:l,creationReason:n.nextSegmentCreationReason}),expirationTimeoutId:Ee(()=>{u("segment_duration_limit")},Ut)}}n.segment.addRecord(a,c,l=>{l>fe&&u("segment_bytes_limit")})}},stop:()=>{u("stop"),i(),r()}}}function Yt(e,o,t){const s=o.findTrackedSession(),n=t.findView();if(!(!s||!n))return{application:{id:e},session:{id:s.id},view:{id:n.id}}}function Xt(e,o){if(!e.metricsEnabled)return{stop:I};const{unsubscribe:t}=o.subscribe(s=>{if(s.type==="failure"||s.type==="queue-full"||s.type==="success"&&s.payload.isFullSnapshot){const n=qt(s.type,s.bandwidth,s.payload);we("Segment network request metrics",{metrics:n})}});return{stop:t}}function qt(e,o,t){return{cssText:{count:t.cssText.count,max:t.cssText.max,sum:t.cssText.sum},isFullSnapshot:t.isFullSnapshot,ongoingRequests:{count:o.ongoingRequestCount,totalSize:o.ongoingByteCount},recordCount:t.recordCount,result:e,serializationDuration:{count:t.serializationDuration.count,max:t.serializationDuration.max,sum:t.serializationDuration.sum},size:{compressed:t.bytesCount,raw:t.rawSize}}}function jt(e){const o=ye();return{addRecord:t=>{const s=e.findView();o.send("record",t,s.id)}}}function Kt(e,o,t,s,n,i,r){const u=[],a=f=>{e.notify(14,{error:f}),ge("Error reported to customer",{"error.message":f.message})},c=r||he([o.sessionReplayEndpointBuilder],a,fe);let l;if(me())({addRecord:l}=jt(s));else{const f=Gt(e,o,t,s,c,n);l=f.addRecord,u.push(f.stop);const p=Xt(i,c.observable);u.push(p.stop)}const{stop:d}=Ht({emit:l,configuration:o,lifeCycle:e,viewHistory:s});return u.push(d),{stop:()=>{u.forEach(f=>f())}}}export{Kt as startRecording};
|
package/dist/client/index.html
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<title>Docs MCP Playground</title>
|
|
7
|
-
<script type="module" crossorigin src="/assets/index-
|
|
7
|
+
<script type="module" crossorigin src="/assets/index-Idv3uxDb.js"></script>
|
|
8
8
|
<link rel="stylesheet" crossorigin href="/assets/index-DJQH3QKQ.css">
|
|
9
9
|
</head>
|
|
10
10
|
<body>
|
package/package.json
CHANGED