1import{a as Je,b as Ke,c as Ze,d as Qe}from"./chunk-AJY5KSTL.js";import{$ as Ge,A as _e,B as N,C as ze,E as De,G as Pe,H as P,I as k,N as Ve,P as Oe,S as Fe,T as He,U as Be,V as B,W as Ue,X as U,Y as Q,_ as h,aa as Ye,ba as G,ca as ee,d as Ne,da as E,ea as $e,f as y,fa as Xe,ga as M,ha as We,i as Ce,ia as Y,ja as $,ka as X,l as we,la as je,m as be,ma as qe,p as ve,q as Me,s as v,t as T,v as Re,w as Ae,x as ke,z as Le}from"./chunk-CX7YYXQV.js";import{a as I}from"./chunk-BMIYOSOG.js";var S={FullSnapshot:2,IncrementalSnapshot:3,Meta:4,Focus:6,ViewEnd:7,VisualViewport:8,FrustrationRecord:9,Change:12};var m={AddString:0,AddNode:1,RemoveNode:2,Attribute:3,Text:4,Size:5,ScrollPosition:6,AddStyleSheet:7,AttachedStyleSheets:8,MediaPlaybackState:9,VisualViewport:10};var g={Mutation:0,MouseMove:1,MouseInteraction:2,Scroll:3,ViewportResize:4,Input:5,TouchMove:6,MediaInteraction:7,StyleSheetRule:8},C={MouseUp:0,MouseDown:1,Click:2,ContextMenu:3,DblClick:4,Focus:5,Blur:6,TouchStart:7,TouchEnd:9},L={Play:0,Pause:1},et={V1:0,Change:1};function W(e){return tt(void 0,void 0,e)}function te(e,t,o){return tt(e,t,o)}function tt(e,t,o){let r={container:void 0,parentId:e,previousSiblingId:void 0,nextSiblingId:t},n=i=>r.previousSiblingId===i-1?0:r.nextSiblingId!==void 0?r.nextSiblingId-i:r.parentId!==void 0?i-r.parentId:null;return{advance(i){let s=o.getOrInsert(i),a=n(s);return r.previousSiblingId=s,{nodeId:s,insertionPoint:a}},ascend(){r.container&&(r=r.container)},descend(){r.previousSiblingId!==void 0&&(r={container:r,parentId:r.previousSiblingId,previousSiblingId:void 0,nextSiblingId:void 0})}}}function R(e,t){let o=e.tagName,r=e.value;if(M(e,t)){let n=e.type;return o==="INPUT"&&(n==="button"||n==="submit"||n==="reset")?r:!r||o==="OPTION"?void 0:G}if(o==="OPTION"||o==="SELECT")return e.value;if(!(o!=="INPUT"&&o!=="TEXTAREA"))return r}var Ct=/url\((?:(')([^']*)'|(")([^"]*)"|([^)]*))\)/gm,wt=/^[A-Za-z]+:|^\/\//,bt=/^["']?data:.*,/i;function ot(e,t){return e.replace(Ct,(o,r,n,i,s,a)=>{let c=n||s||a;if(!t||!c||wt.test(c)||bt.test(c))return o;let u=r||i||"";return`url(${u}${vt(c,t)}${u})`})}function vt(e,t){try{return we(e,t).href}catch(o){return e}}function oe(e){return e.tagName.toLowerCase()}function re(e,t){return`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${e}' height='${t}' style='background-color:silver'%3E%3C/svg%3E`}function _(){return{cssText:{count:0,max:0,sum:0},serializationDuration:{count:0,max:0,sum:0}}}function j(e,t,o){e[t].count+=1,e[t].max=Math.max(e[t].max,o),e[t].sum+=o}function q(e,t){for(let o of["cssText","serializationDuration"])e[o].count+=t[o].count,e[o].max=Math.max(e[o].max,t[o].max),e[o].sum+=t[o].sum}function rt(e){let t={},o=i=>{for(let s=0,a=i.length;s<a;s++){let c=i[s];if(typeof c=="string"){let u=e.size;u<1e6?(i[s]=e.getOrInsert(c),e.size>u&&r(m.AddString,c)):i[s]=e.get(c)??c}else Array.isArray(c)&&o(c)}},r=(i,s)=>{i in t||(t[i]=[i]),i!==m.AddString&&Array.isArray(s)&&o(s),t[i].push(s)};return{add:r,flush:()=>{let i=[];return[m.AddString,m.AddNode,m.RemoveNode,m.Attribute,m.Text,m.Size,m.ScrollPosition,m.AddStyleSheet,m.AttachedStyleSheets,m.MediaPlaybackState,m.VisualViewport].forEach(s=>{let a=t[s];a&&i.push(a)}),t={},i}}}function z(e,t,o,r,n,i){let s=rt(r.stringIds),a=_(),c={addMetric(d,p){j(a,d,p)},addNode(...d){s.add(m.AddNode,d)},addStyleSheet(d,p,f){f?s.add(m.AddStyleSheet,[d,p||[],f]):p?s.add(m.AddStyleSheet,[d,p]):s.add(m.AddStyleSheet,[d])},attachStyleSheets(d,p){let f=[d];for(let b of p)f.push(b);s.add(m.AttachedStyleSheets,f)},removeNode(d){s.add(m.RemoveNode,d)},setAttributes(d){s.add(m.Attribute,d)},setMediaPlaybackState(d,p){s.add(m.MediaPlaybackState,[d,p])},setScrollPosition(d,p,f){s.add(m.ScrollPosition,[d,p,f])},setSize(d,p,f){s.add(m.Size,[d,p,f])},setText(d,p){s.add(m.Text,[d,p])},kind:e,scope:r},u=y();i(c),j(a,"serializationDuration",Ce(u,y()));let l=s.flush();l.length>0&&t(e===0||e===1?{data:l,format:et.Change,type:S.FullSnapshot,timestamp:n}:{data:l,type:S.Change,timestamp:n}),o(a)}var Mt=1e6;function V(e,t,o,r){if(t===h.HIDDEN)return null;let n=e.getAttribute(o),i=e.tagName;if(We(i,o,n,t,r)){if(i==="IMG"){let s=e;
1if(s.naturalWidth>0)return re(s.naturalWidth,s.naturalHeight);let{width:a,height:c}=e.getBoundingClientRect();return a>0||c>0?re(a,c):ee}return i==="SOURCE"?ee:G}return n&&He(n,Mt)}function nt(e,t,o){if(t===h.HIDDEN)return{};let r={},n=oe(e);for(let s=0;s<e.attributes.length;s+=1){let c=e.attributes.item(s).name,u=V(e,t,c,o.scope.configuration);u!==null&&(r[c]=u)}if(e.value&&(n==="textarea"||n==="select"||n==="option"||n==="input")){let s=R(e,t);s!==void 0&&(r.value=s)}if(n==="option"){let s=e;s.selected&&!M(s,t)?r.selected="":delete r.selected}let i=e;return n==="input"&&(i.type==="radio"||i.type==="checkbox")&&(i.checked&&!M(i,t)?r.checked="":delete r.checked),r}function it(e,t,o){if(t===h.HIDDEN)return{};let r={},n=e.ownerDocument,i=oe(e);if(i==="link"){let c=Array.from(n.styleSheets).find(l=>l.href===e.href),u=ne(c);u&&c&&(o.addMetric("cssText",u.length),r._cssText=u)}if(i==="style"&&e.sheet){let c=ne(e.sheet);c&&(o.addMetric("cssText",c.length),r._cssText=c)}if(i==="audio"||i==="video"){let c=e;r.rr_mediaState=c.paused?"paused":"played"}let s,a;switch(o.kind){case 0:s=Math.round(e.scrollTop),a=Math.round(e.scrollLeft),(s||a)&&o.scope.elementsScrollPositions.set(e,{scrollTop:s,scrollLeft:a});break;case 1:o.scope.elementsScrollPositions.has(e)&&({scrollTop:s,scrollLeft:a}=o.scope.elementsScrollPositions.get(e));break}return a&&(r.rr_scrollLeft=a),s&&(r.rr_scrollTop=s),r}function ne(e){if(!e)return null;let t;try{t=e.rules||e.cssRules}catch(r){}if(!t)return null;let o=Array.from(t,Ve()?Rt:st).join("");return ot(o,e.href)}function Rt(e){if(kt(e)&&e.selectorText.includes(":")){let t=/(\[[\w-]+[^\\])(:[^\]]+\])/g;return e.cssText.replace(t,"$1\\$2")}return st(e)}function st(e){return At(e)&&ne(e.styleSheet)||e.cssText}function At(e){return"styleSheet"in e}function kt(e){return"selectorText"in e}function A(e,t,o,r){if(t.parentNode?.nodeName==="STYLE"||o===h.HIDDEN||o===h.IGNORE)return;let n,i=Xe(t);if(i?n=$e(i,o):n=o,n===h.HIDDEN){Ot(e,t,r);return}if(n!==h.IGNORE){switch(t.nodeType){case t.CDATA_SECTION_NODE:Vt(e,t,r);break;case t.DOCUMENT_NODE:Lt(e,t,r);break;case t.DOCUMENT_FRAGMENT_NODE:_t(e,t,r);break;case t.DOCUMENT_TYPE_NODE:zt(e,t,r);break;case t.ELEMENT_NODE:Dt(e,t,n,r);break;case t.TEXT_NODE:Pt(e,t,n,r);break;default:return}switch(t.nodeType){case t.CDATA_SECTION_NODE:case t.DOCUMENT_TYPE_NODE:case t.TEXT_NODE:return}e.descend(),U(t,s=>{A(e,s,n,r)}),e.ascend()}}function Lt(e,t,o){let{nodeId:r,insertionPoint:n}=e.advance(t);o.addNode(n,"#document"),o.setScrollPosition(r,$(),X()),at(t.adoptedStyleSheets,r,o)}function _t(e,t,o){let{nodeId:r,insertionPoint:n}=e.advance(t);if(!Ue(t)){o.addNode(n,"#document-fragment");return}o.addNode(n,"#shadow-root"),o.scope.shadowRootsController.addShadowRoot(t,o.scope),at(t.adoptedStyleSheets,r,o)}function zt(e,t,o){let{insertionPoint:r}=e.advance(t);o.addNode(r,"#doctype",t.name,t.publicId,t.systemId)}function Dt(e,t,o,r){let{nodeId:n,insertionPoint:i}=e.advance(t),s=Object.entries(nt(t,o,r));r.addNode(i,ct(t),...s);let{_cssText:a,rr_mediaState:c,rr_scrollLeft:u,rr_scrollTop:l}=it(t,o,r),d=t;if(a!==void 0&&d.sheet){let p=r.scope.styleSheetIds.getOrInsert(d.sheet);r.addStyleSheet(a),r.attachStyleSheets(n,[p])}c==="played"?r.setMediaPlaybackState(n,L.Play):c==="paused"&&r.setMediaPlaybackState(n,L.Pause),(u!==void 0||l!==void 0)&&r.setScrollPosition(n,u||0,l||0)}function Pt(e,t,o,r){let n=Y(t,o);if(n===void 0)return;let{insertionPoint:i}=e.advance(t);r.addNode(i,"#text",n)}function Vt(e,t,o){let{insertionPoint:r}=e.advance(t);o.addNode(r,"#cdata-section")}function Ot(e,t,o){if(!Be(t))return;let{nodeId:r,insertionPoint:n}=e.advance(t);o.addNode(n,ct(t),[Ge,Ye]);let{width:i,height:s}=t.getBoundingClientRect();o.setSize(r,i,s)}function at(e,t,o){!e||e.length===0||o.attachStyleSheets(t,e.map(r=>Ft(r,o)))}function Ft(e,t){let o=Array.from(e.cssRules||e.rules,n=>n.cssText),r=e.media.length>0?Array.from(e.media):void 0;return t.addMetric("cssText",o.reduce((n,i)=>n+i.length,0)),t.addStyleSheet(o,r,e.disabled),t.scope.styleSheetIds.getOrInsert(e)}function ct(e){let t=e.nodeName;return Ht(e)?`svg>${t}`:t}function Ht(e){return e.namespaceURI==="http://www.w3.org/2000/svg"}function ie(e,t,o,r,n,i){i.resetIds(),z(t,r,n,i,e,s=>{A(W(i.nodeIds),o,i.configuration.defaultPrivacyLevel,s)})}function se(e,t,o,r,n){z(2,o,r,n,e,i=>Bt(t,i))}function Bt(e,t){let o=new Set,r=new Map,n=new Map,i=new Set;for(let c of e)switch(c.type){case"attributes":{let u=c.target,l=r.get(u);l||(l=new Map,r.set(u,l));let d=c.attributeName;l.has(d)||l.set(d,c.oldValue);break}case"characterData":n.has(c.target)||n.set(c.target,c.oldValue);break;case"childList":for(let u=0;u<c.addedNodes.length;u++)o.add(c.addedNodes[u]);for(let u=0;u<c.removedNodes.length;u++)i.add(c.removedNodes[u]);break}let s=t.scope.nodeIds.nextId,a=new Map;Ut(i,t),Gt(o,a,t),Yt(n,s,a,t),$t(r,s,a,t)}function Ut(e,t){let o=t.scope.nodeIds;for(let r of e){let n=o.get(r);n!==void 0&&(ut(r,i=>{B(i)&&t.scope.shadowRootsController.removeShadowRoot(i.shadowRoot),o.delete(i)}),t.removeNode(n))}}function Gt(e,t,o){let r=o.scope.nodeIds;for(let n of e){if(!n.isConnected||r.get(n)!==void 0)continue;let s=Q(n);if(!s)continue;let a=r.get(s);if(a===void 0)continue;let c=E(s,o.scope.configuration.defaultPrivacyLevel,t),u=Xt(n,r);
1A(te(a,u,r),n,c,o)}}function Yt(e,t,o,r){let n=r.scope.nodeIds;for(let[i,s]of e){if(i.textContent===s||!i.isConnected)continue;let a=n.get(i);if(a===void 0||a>=t)continue;let c=Q(i);if(!c)continue;let u=E(c,r.scope.configuration.defaultPrivacyLevel,o);if(u===h.HIDDEN||u===h.IGNORE)continue;let l=Y(i,u)??"";r.setText(a,l)}}function $t(e,t,o,r){let n=r.scope.nodeIds;for(let[i,s]of e){if(!i.isConnected)continue;let a=n.get(i);if(a===void 0||a>=t)continue;let c=E(i,r.scope.configuration.defaultPrivacyLevel,o);if(c===h.HIDDEN||c===h.IGNORE)continue;let u=[a];for(let[l,d]of s){if(i.getAttribute(l)===d)continue;if(l==="value"){let f=R(i,c);f!==void 0&&u.push([l,f]);continue}let p=V(i,c,l,r.scope.configuration);p===null?u.push([l]):u.push([l,p])}u.length>1&&r.setAttributes(u)}}function Xt(e,t){let o=e.nextSibling;for(;o;){let r=t.get(o);if(r!==void 0)return r;o=o.nextSibling}}function ut(e,t){t(e),U(e,o=>ut(o,t))}function jt(e){return Math.abs(e.pageTop-e.offsetTop-window.scrollY)>25||Math.abs(e.pageLeft-e.offsetLeft-window.scrollX)>25}var dt=(e,t)=>{let o=window.visualViewport,r={layoutViewportX:e,layoutViewportY:t,visualViewportX:e,visualViewportY:t};if(o)jt(o)?(r.layoutViewportX=Math.round(e+o.offsetLeft),r.layoutViewportY=Math.round(t+o.offsetTop)):(r.visualViewportX=Math.round(e-o.offsetLeft),r.visualVie
1wportY=Math.round(t-o.offsetTop));else return r;return r},J=e=>({scale:e.scale,offsetLeft:e.offsetLeft,offsetTop:e.offsetTop,pageLeft:e.pageLeft,pageTop:e.pageTop,height:e.height,width:e.width});function lt(e,t,o,r,n){ae(y(),0,t,o,n);let{unsubscribe:i}=e.subscribe(2,s=>{r(),ae(s.startClocks.timeStamp,1,t,o,n)});return{stop:i}}function ae(e,t,o,r,n){let{width:i,height:s}=qe();o({data:{height:s,href:window.location.href,width:i},type:S.Meta,timestamp:e}),o({data:{has_focus:document.hasFocus()},type:S.Focus,timestamp:e}),ie(e,t,document,o,r,n),window.visualViewport&&o({data:J(window.visualViewport),type:S.VisualViewport,timestamp:e})}function pt(){return ce(1)}function ft(){return ce(0)}function mt(){return qt(0)}function ht(){return ce(0)}function qt(e){return St(()=>new Map,e)}function ce(e){return St(()=>new WeakMap,e)}function St(e,t){let o=e(),r=t,n=i=>o.get(i);return{clear(){r!==t&&(o=e(),r=t)},delete(i){o.delete(i)},get:n,getOrInsert(i){let s=n(i);return s===void 0&&(s=r++,o.set(i,s)),s},get nextId(){return r},get size(){return r-t}}}function ue(e,t,o){let r=pt(),n=ft(),i=mt(),s=ht(),a={resetIds(){a.eventIds.clear(),a.nodeIds.clear(),a.stringIds.clear(),a.styleSheetIds.clear()},configuration:e,elementsScrollPositions:t,eventIds:r,nodeIds:n,shadowRootsController:o,stringIds:i,styleSheetIds:s};return a}function K(){let e=new WeakMap;return{set(t,o){t===document&&!document.scrollingElement||e.set(t===document?document.scrollingElement:t,o)},get(t){return e.get(t)},has(t){return e.has(t)}}}function de(e){return!!e.changedTouches}function w(e){return e.composed===!0&&B(e.target)?e.composedPath()[0]:e.target}function x(e,t,o=y()){return{data:I({source:e},t),type:S.IncrementalSnapshot,timestamp:o}}var Jt=50;function le(e,t){let{throttled:o,cancel:r}=v(i=>{let s=w(i),a=t.nodeIds.get(s);if(a===void 0)return;let c=pe(i);if(!c)return;let u={id:a,timeOffset:0,x:c.x,y:c.y};e(x(de(i)?g.TouchMove:g.MouseMove,{positions:[u]}))},Jt,{trailing:!1}),{stop:n}=N(t.configuration,document,["mousemove","touchmove"],o,{capture:!0,passive:!0});return{stop:()=>{n(),r()}}}function pe(e){let{clientX:t,clientY:o}=de(e)?e.changedTouches[0]:e;if(window.visualViewport){let{visualViewportX:r,visualViewportY:n}=dt(t,o);t=r,o=n}if(!(!Number.isFinite(t)||!Number.isFinite(o)))return{x:t,y:o}}var gt={pointerup:C.MouseUp,mousedown:C.MouseDown,click:C.Click,contextmenu:C.ContextMenu,dblclick:C.DblClick,focus:C.Focus,blur:C.Blur,touchstart:C.TouchStart,touchend:C.TouchEnd};function fe(e,t){let o=r=>{let n=w(r),i=t.nodeIds.get(n);if(i===void 0||E(n,t.configuration.defaultPrivacyLevel)===h.HIDDEN)return;let s=gt[r.type],a;if(s!==C.Blur&&s!==C.Focus){let c=pe(r);if(!c)return;a={id:i,type:s,x:c.x,y:c.y}}else a={id:i,type:s};e(I({id:t.eventIds.getOrInsert(r)},x(g.MouseInteraction,a)))};return N(t.configuration,document,Object.keys(gt),o,{capture:!0,passive:!0})}var Kt=100;function O(e,t,o){let{throttled:r,cancel:n}=v(s=>{let a=w(s);if(!a)return;let c=o.nodeIds.get(a);if(c===void 0||E(a,o.configuration.defaultPrivacyLevel)===h.HIDDEN)return;let u=a===document?{scrollTop:X(),scrollLeft:$()}:{scrollTop:Math.round(a.scrollTop),scrollLeft:Math.round(a.scrollLeft)};o.elementsScrollPositions.set(a,u),t(x(g.Scroll,{id:c,x:u.scrollLeft,y:u.scrollTop}))},Kt),{stop:i}=_e(o.configuration,e,"scroll",r,{capture:!0,passive:!0});return{stop:()=>{i(),n()}}}var Zt=200;function me(e,t){let o=je(t.configuration).subscribe(r=>{e(x(g.ViewportResize,r))});return{stop:()=>{o.unsubscribe()}}}function he(e,t){let o=window.visualViewport;if(!o)return{stop:T};let{throttled:r,cancel:n}=v(()=>{e({data:J(o),type:S.VisualViewport,timestamp:y()})},Zt,{trailing:!1}),{stop:i}=N(t.configuration,o,["resize","scroll"],r,{capture:!0,passive:!0});return{stop:()=>{i(),n()}}}function Se(e,t){return N(t.configuration,document,["play","pause"],o=>{let r=w(o);if(!r)return;let n=t.nodeIds.get(r);n===void 0||E(r,t.configuration.defaultPrivacyLevel)===h.HIDDEN||e(x(g.MediaInteraction,{id:n,type:o.type==="play"?L.Play:L.Pause}))},{capture:!0,passive:!0})}function ge(e,t){function o(i,s){if(!i||!i.ownerNode)return;let a=t.nodeIds.get(i.ownerNode);a!==void 0&&s(a)}let r=[P(CSSStyleSheet.prototype,"insertRule",({target:i,parameters:[s,a]})=>{o(i,c=>e(x(g.StyleSheetRule,{id:c,adds:[{rule:s,index:a}]})))}),P(CSSStyleSheet.prototype,"deleteRule",({target:i,parameters:[s]})=>{o(i,a=>e(x(g.StyleSheetRule,{id:a,removes:[{index:s}]})))})];typeof CSSGroupingRule<"u"?n(CSSGroupingRule):(n(CSSMediaRule),n(CSSSupportsRule));function n(i){r.push(P(i.prototype,"insertRule",({target:s,parameters:[a,c]})=>{o(s.parentStyleSheet,u=>{let l=xt(s);l&&(l.push(c||0),e(x(g.StyleSheetRule,{id:u,adds:[{rule:a,index:l}]})))})}),P(i.prototype,"deleteRule",({target:s,parameters:[a]})=>{o(s.parentStyleSheet,c=>{let u=xt(s);u&&(u.push(a),e(x(g.StyleSheetRule,{id:c,removes:[{index:u}]})))})}))}return{stop:()=>{r.forEach(i=>
1i.stop())}}}function xt(e){let t=[],o=e;for(;o.parentRule;){let s=Array.from(o.parentRule.cssRules).indexOf(o);t.unshift(s),o=o.parentRule}if(!o.parentStyleSheet)return;let n=Array.from(o.parentStyleSheet.cssRules).indexOf(o);return t.unshift(n),t}function xe(e,t){return N(t.configuration,window,["focus","blur"],()=>{e({data:{has_focus:document.hasFocus()},type:S.Focus,timestamp:y()})})}function ye(e,t,o){let r=e.subscribe(5,()=>{o(),t({timestamp:y(),type:S.ViewEnd})});return{stop:()=>{r.unsubscribe()}}}function F(e,t,o){let r=o.configuration.defaultPrivacyLevel,n=new WeakMap,i=e!==document,{stop:s}=N(o.configuration,e,i?["change"]:["input","change"],l=>{let d=w(l);(d instanceof HTMLInputElement||d instanceof HTMLTextAreaElement||d instanceof HTMLSelectElement)&&c(d)},{capture:!0,passive:!0}),a;if(i)a=T;else{let l=[k(HTMLInputElement.prototype,"value",c),k(HTMLInputElement.prototype,"checked",c),k(HTMLSelectElement.prototype,"value",c),k(HTMLTextAreaElement.prototype,"value",c),k(HTMLSelectElement.prototype,"selectedIndex",c)];a=()=>{l.forEach(d=>d.stop())}}return{stop:()=>{a(),s()}};function c(l){let d=E(l,r);if(d===h.HIDDEN)return;let p=l.type,f;if(p==="radio"||p==="checkbox"){if(M(l,d))return;f={isChecked:l.checked}}else{let D=R(l,d);if(D===void 0)return;f={text:D}}u(l,f);let b=l.name;p==="radio"&&b&&l.checked&&document.querySelectorAll(`input[type="radio"][name="${CSS.escape(b)}"]`).forEach(D=>{D!==l&&u(D,{isChecked:!1})})}function u(l,d){let p=o.nodeIds.get(l);if(p===void 0)return;let f=n.get(l);(!f||f.text!==d.text||f.isChecked!==d.isChecked)&&(n.set(l,d),t(x(g.Input,I({id:p},d))))}}var Qt=100,eo=16;function yt(e){let t=T,o=[];function r(){t(),e(o),o=[]}let{throttled:n,cancel:i}=v(r,eo,{leading:!1});return{addMutations:s=>{o.length===0&&(t=Oe(n,{timeout:Qt})),o.push(...s)},flush:r,stop:()=>{t(),i()}}}function H(e,t,o,r){let n=Fe();if(!n)return{stop:T,flush:T};let i=yt(a=>{se(y(),a.concat(s.takeRecords()),t,o,r)}),s=new n(be(i.addMutations));return s.observe(e,{attributeOldValue:!0,attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),{stop:()=>{s.disconnect(),i.stop()},flush:()=>{i.flush()}}}var It=(e,t)=>{let o=new Map;return{addShadowRoot:(n,i)=>{if(o.has(n))return;let s=H(n,e,t,i),a=F(n,e,i),c=O(n,e,i);o.set(n,{flush:()=>s.flush(),stop:()=>{s.stop(),a.stop(),c.stop()}})},removeShadowRoot:n=>{let i=o.get(n);i&&(i.stop(),o.delete(n))},stop:()=>{o.forEach(({stop:n})=>n())},flush:()=>{o.forEach(({flush:n})=>n())}}};function Ie(e){let{emitRecord:t,emitStats:o,configuration:r,lifeCycle:n}=e;if(!t||!o)throw new Error("emit functions are required");let i=p=>{t(p),Re("record",{record:p});let f=e.viewHistory.findView();Ze(f.id)},s=It(i,o),a=ue(r,K(),s),{stop:c}=lt(n,i,o,u,a);function u(){s.flush(),l.flush()}let l=H(document,i,o,a),d=[l,le(i,a),fe(i,a),O(document,i,a),me(i,a),F(document,i,a),Se(i,a),ge(i,a),xe(i,a),he(i,a),ye(n,i,u)];return{stop:()=>{s.stop(),d.forEach(p=>p.stop()),c()},flushMutations:u,shadowRootsController:s}}function Tt(e,t,o,r){let n=new FormData;n.append("segment",new Blob([e],{type:"application/octet-stream"}),`${t.session.id}-${t.start}`);let i=I({raw_segment_size:r,compressed_segment_size:e.byteLength},t),s=JSON.stringify(i);return n.append("event",new Blob([s],{type:"application/json"})),{data:n,bytesCount:e.byteLength,cssText:o.cssText,isFullSnapshot:t.index_in_view===0,rawSize:r,recordCount:t.records_count,serializationDuration:o.serializationDuration}}function Et({context:e,creationReason:t,encoder:o}){let r=0,n=e.view.id,i=Je(n),s=I({start:1/0,end:-1/0,creation_reason:t,records_count:0,has_full_snapshot:!1,index_in_view:i,source:"browser"},e),a=_();Ke(n);function c(d,p){s.start=Math.min(s.start,d.timestamp),s.end=Math.max(s.end,d.timestamp),s.records_count+=1,s.has_full_snapshot||(s.has_full_snapshot=d.type===S.FullSnapshot||d.type===S.Change&&s.index_in_view===0);let f=o.isEmpty?'{"records":[':",";o.write(f+JSON.stringify(d),b=>{r+=b,p(r)})}function u(d){q(a,d)}function l(d){if(o.isEmpty)throw new Error("Empty segment flushed");o.write(`],${JSON.stringify(s).slice(1)} 2`),o.finish(p=>{Qe(s.view.id,p.rawBytesCount),d(s,a,p)})}return{addRecord:c,addStats:u,flush:l}}var oo=5*Ne,Z=6e4;function Te(e,t,o,r,n,i){return ro(e,()=>no(t.applicationId,o,r),n,i)}function ro(e,t,o,r){let n={status:0,nextSegmentCreationReason:"init"},{unsubscribe:i}=e.subscribe(2,()=>{a("view_change")}),{unsubscribe:s}=e.subscribe(11,c=>{a(c.reason)});function a(c){n.status===1&&(n.segment.flush((u,l,d)=>{let p=Tt(d.output,u,l,d.rawBytesCount);ze(c)?o.sendOnExit(p):o.send(p)}),Me(n.expirationTimeoutId)),c!=="stop"?n={status:0,nextSegmentCreationReason:c}:n={status:2}}return{addRecord:c=>{if(n.status!==2){if(n.status===0){let u=t();if(!u)return;n={status:1,segment:Et({encoder:r,context:u,creationReason:n.nextSegmentCreationReason}),expirationTimeoutId:ve(()=>{a("segment_duration_limit")},oo)}}n.segment.addRecord(c,u=>{u>Z&&a("segment_bytes_limit")})}},addStats:c=>{n.status===1&&n.segment.addStats(c)},stop:()=>{a("stop"),i(),s()}}}function no(e,t,o){let r=t.findTrackedSession(),n=o.findView();if(!(!r||!n))return{application:{id:e},session:{id:r.id},view:{id:n.id}}}function Ee(e,t){if(!e.metricsEnabled)return{stop:T};let{unsubscribe:o}=t.subscribe(r=>{if(r.type==="failure"||r.type==="queue-full"||r.type==="success"&&r.payload.isFullSnapshot){let n=io(r.type,r.bandwidth,r.payload);Pe("Segment network request metrics",{metrics:n})}});return{stop:o}}function io(e,t,o){return{cssText:{count:o.cssText.count,max:o.cssText.max,sum:o.cssText.sum},encoding:{fullSnapshot:"change",incrementalSnapshot:"change"},isFullSnapshot:o.isFullSnapshot,ongoingRequests:{count:t.ongoingRequestCount,totalSize:t.ongoingByteCount},recordCount:o.recordCount,result:e,serializationDuration:{count:o.serializationDuration.count,max:o.serializationDuration.max,sum:o.serializationDuration.sum},size:{compressed:o.bytesCount,raw:o.rawSize}}}function Nt(e){let t=ke();return{addRecord:o=>{let r=e.findView();t.send("record",o,r.id)}}}function _i(e,t,o,r,n,i,s){let a=[],c=f=>{e.notify(14,{error:f}),De("Error reported to customer",{"error.message":f.message})},u=s||Ae([t.sessionReplayEndpointBuilder],c,Z),l,d;if(Le())({addRecord:l}=Nt(r)),d=T;else{let f=Te(e,t,o,r,u,n);l=f.addRecord,d=f.addStats,a.push(f.stop);let b=Ee(i,u.observable);a.push(b.stop)}let{stop:p}=Ie({emitRecord:l,emitStats:d,configuration:t,lifeCycle:e,viewHistory:r});return a.push(p),{stop:()=>{a.forEach(f=>f())}}}export{_i as startRecording};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.