@fixback/sdk 0.5.0 → 0.6.0

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.
Files changed (41) hide show
  1. package/README.md +12 -2
  2. package/dist/capture/extract-dom.d.ts +33 -0
  3. package/dist/connect.d.ts +47 -0
  4. package/dist/dom.d.ts +7 -19
  5. package/dist/element-picker.d.ts +1 -1
  6. package/dist/error-capture.d.ts +21 -64
  7. package/dist/fixback.umd.js +36 -202
  8. package/dist/fixback.umd.js.map +1 -1
  9. package/dist/identity.d.ts +6 -1
  10. package/dist/index.d.ts +17 -15
  11. package/dist/index.mjs +3577 -3683
  12. package/dist/index.mjs.map +1 -1
  13. package/dist/init.d.ts +62 -96
  14. package/dist/mount.d.ts +46 -0
  15. package/dist/overlay/dom.d.ts +16 -0
  16. package/dist/overlay/icons.d.ts +23 -0
  17. package/dist/overlay/marking.d.ts +64 -0
  18. package/dist/overlay/send.d.ts +65 -0
  19. package/dist/overlay/view.d.ts +78 -0
  20. package/dist/overlay-styles.d.ts +1 -1
  21. package/dist/overlay.d.ts +40 -41
  22. package/dist/package.json +3 -0
  23. package/dist/report.d.ts +9 -13
  24. package/dist/reporter-session-store.d.ts +17 -0
  25. package/dist/session.d.ts +27 -0
  26. package/dist/submit.d.ts +51 -8
  27. package/dist/trace/instrument/beacon.d.ts +16 -0
  28. package/dist/trace/instrument/console.d.ts +11 -0
  29. package/dist/trace/instrument/fetch.d.ts +16 -0
  30. package/dist/trace/instrument/index.d.ts +64 -0
  31. package/dist/trace/instrument/navigation.d.ts +12 -0
  32. package/dist/trace/instrument/ui.d.ts +23 -0
  33. package/dist/trace/instrument/window.d.ts +66 -0
  34. package/dist/trace/instrument/xhr.d.ts +15 -0
  35. package/dist/version.d.ts +1 -1
  36. package/package.json +8 -5
  37. package/dist/boot.d.ts +0 -74
  38. package/dist/breadcrumbs.d.ts +0 -327
  39. package/dist/invite.d.ts +0 -104
  40. package/dist/onboarding-styles.d.ts +0 -8
  41. package/dist/onboarding.d.ts +0 -44
@@ -1,7 +1,7 @@
1
- (function(le,ze){typeof exports=="object"&&typeof module!="undefined"?ze(exports):typeof define=="function"&&define.amd?define(["exports"],ze):(le=typeof globalThis!="undefined"?globalThis:le||self,ze(le.Fixback={}))})(this,function(le){Object.defineProperty(le,Symbol.toStringTag,{value:"Module"});function ze(e){return`${e.replace(/\/+$/,"")}/api/ingest/boot`}function Wn(e){if(typeof e!="object"||e===null)return!1;const t=e;return typeof t.originAllowed=="boolean"&&typeof t.canSubmit=="boolean"&&typeof t.gate=="string"&&(t.tier===null||typeof t.tier=="string")}async function Hn(e,t,r=fetch){let n;try{n=await r(ze(e),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(t)})}catch{return null}if(!n.ok)return null;let o;try{o=await n.json()}catch{return null}return Wn(o)?o:null}var jn=/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/gi,Gn=/\bhttps?:\/\/[^\s"')]+/gi,Vn=/\b0x[0-9a-f]+\b/gi,qn=/\b[0-9a-f]{8,}\b/gi,Xn=/\d{4,}/g,Yn=5;function Kn(e){return typeof e!="string"||e.length===0?"":e.replace(jn,"<uuid>").replace(Gn,"<url>").replace(Vn,"<hex>").replace(qn,"<hex>").replace(Xn,"<n>").trim()}function Jn(e){let t=2166136261;for(let r=0;r<e.length;r++)t^=e.charCodeAt(r),t=Math.imul(t,16777619);return(t>>>0).toString(36)}function Mt(e){const t=e.replace(/\?[^:]*/,""),r=t.lastIndexOf("/");return r>=0?t.slice(r+1):t}function Zn(e){var t,r,n;const o=e.match(/^at\s+(.+?)\s+\((.+)\)$/);if(o)return`${(t=o[1])!==null&&t!==void 0?t:""}@${Mt((r=o[2])!==null&&r!==void 0?r:"")}`;const i=e.match(/^at\s+(.+)$/);if(i)return`@${Mt((n=i[1])!==null&&n!==void 0?n:"")}`;const l=e.indexOf("@");return l>=0?`${e.slice(0,l)}@${Mt(e.slice(l+1))}`:null}function Qn(e,t=Yn){if(typeof e!="string"||e.length===0)return"";const r=[];for(const n of e.split(`
2
- `)){const o=Zn(n.trim());if(o&&(r.push(o),r.length>=t))break}return r.join(" < ")}function eo(e,t,r){return Jn(`${e}|${Kn(t)}|${Qn(r)}`)}var to=7,Qt=/[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}/gi,er=new RegExp(`\\d{${to},}`,"g"),ro=/\b(bearer|token)\s+[\w.\-~+/]+=*/gi,no=/\bhttps?:\/\/[^\s"'<>]+/gi;function oo(e){return typeof e!="string"||e.length===0?e:e.replace(Qt,"[redacted-email]").replace(ro,(t,r)=>`${r} [redacted]`).replace(er,"[redacted-number]")}function Et(e){return e.replace(Qt,"[redacted-email]").replace(er,"[redacted-number]")}function oe(e){var t;if(typeof e!="string"||e.length===0)return e;let r=e;r=r.replace(/(^[a-z][a-z0-9+.-]*:\/\/)[^/@?#]*@/i,"$1"),r=r.replace(/\?[^#]*/,""),r=r.replace(/#.*$/,l=>l.includes("=")?"":l);const n=r.match(/^([a-z][a-z0-9+.-]*:\/\/[^/?#]*)([\s\S]*)$/i);if(n)return n[1]+Et((t=n[2])!==null&&t!==void 0?t:"");const o=r.match(/^(\/\/[^/?#]*)([\s\S]*)$/);if(o){var i;return o[1]+Et((i=o[2])!==null&&i!==void 0?i:"")}return Et(r)}function io(e){const t={...e};return typeof t.url=="string"&&(t.url=oe(t.url)),typeof t.from=="string"&&(t.from=oe(t.from)),typeof t.to=="string"&&(t.to=oe(t.to)),t}function $e(e){return oo(e.replace(no,t=>oe(t)))}function It(e){if(typeof e=="string")return $e(e);if(Array.isArray(e))return e.map(It);if(e&&typeof e=="object"){const t={};for(const[r,n]of Object.entries(e))t[r]=It(n);return t}return e}function so(e){switch(e.t){case"string":return typeof e.v=="string"?{t:"string",v:$e(e.v)}:e;case"json":return{t:"json",v:It(e.v)};case"error":{if(!e.v||typeof e.v!="object")return e;const t={...e.v};return typeof t.message=="string"&&(t.message=$e(t.message)),typeof t.stack=="string"&&(t.stack=$e(t.stack)),{t:"error",v:t}}default:return e}}function ao(e){const t={...e};return typeof t.message=="string"&&(t.message=$e(t.message)),t.data&&(t.data=io(t.data)),typeof t.url=="string"&&(t.url=oe(t.url)),Array.isArray(t.args)&&(t.args=t.args.map(so)),t}function lo(e){const t={...e};return typeof t.url=="string"&&(t.url=oe(t.url)),t.trace&&t.trace.length>0&&(t.trace=t.trace.map(ao)),t.errorFrames&&t.errorFrames.length>0&&(t.errorFrames=t.errorFrames.map(r=>({...r,file:oe(r.file)}))),t}function tr(e,t={}){const r=t.scrub===!1?e:lo(e),n=t.hook;if(!n)return r;try{const o=n(r);return o!=null?o:null}catch{return r}}function We(e){"@babel/helpers - typeof";return We=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},We(e)}function co(e,t){if(We(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(We(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function uo(e){var t=co(e,"string");return We(t)=="symbol"?t:t+""}function xe(e,t,r){return(t=uo(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Ya=60;function fo(e,t){if(e==null)return 60;const r=e.trim();if(r==="")return 60;if(/^\d+$/.test(r))return Number(r);const n=Date.parse(r);return Number.isNaN(n)?60:Math.max(0,Math.ceil((n-t)/1e3))}var po=class{constructor(e=Date.now){xe(this,"now",void 0),xe(this,"pausedUntil",0),this.now=e}isPaused(){return this.now()<this.pausedUntil}retryAfterSeconds(){return Math.max(0,Math.ceil((this.pausedUntil-this.now())/1e3))}hold(e){const t=this.now(),r=fo(e,t),n=t+r*1e3;return n>this.pausedUntil&&(this.pausedUntil=n),r}},rr=["data-fixback-root","data-fixback-overlay"],Ka=rr.map(e=>`[${e}]`).join(",");function Rt(e){let t=e instanceof Node?e:null;for(;t;){if(t instanceof Element){for(const n of rr)if(t.hasAttribute(n))return!0}const r=t.getRootNode();if(r instanceof ShadowRoot&&r!==t){t=r.host;continue}t=t.parentNode}return!1}function nr(e){const t=globalThis.CSS;return t!=null&&t.escape?t.escape(e):e.replace(/[^\w-]/g,r=>`\\${r}`)}function ho(e){let t=1,r=e.previousElementSibling;for(;r;)r.tagName===e.tagName&&(t+=1),r=r.previousElementSibling;return t}function or(e){if(e.id)return`#${nr(e.id)}`;const t=[];let r=e;for(;r&&r.tagName.toLowerCase()!=="html";){if(r.id){t.unshift(`#${nr(r.id)}`);break}const n=r.tagName.toLowerCase(),o=r.parentElement;if(o){const i=Array.from(o.children).filter(l=>l.tagName===r.tagName);t.unshift(i.length>1?`${n}:nth-of-type(${ho(r)})`:n)}else t.unshift(n);r=o}return t.join(" > ")}function mo(e){const t=e.tagName.toLowerCase();if(e.id)return`${t}#${e.id}`;const r=e.classList[0];return r?`${t}.${r}`:t}function bo(e){const t=[];let r=e;for(;r;)t.unshift(mo(r)),r=r.parentElement;return t.join(" > ")}function go(e){const t=e.getBoundingClientRect();return{x:Math.round(t.x),y:Math.round(t.y),width:Math.round(t.width),height:Math.round(t.height)}}function vo(e){return{selector:or(e),domPath:bo(e),tag:e.tagName.toLowerCase(),rect:go(e)}}function yo(e){var t,r;const n=(t=e.doc)!==null&&t!==void 0?t:document,o=(r=e.ignore)!==null&&r!==void 0?r:Rt;let i=null,l=!1;function c(h){var d;const u=(d=(typeof h.composedPath=="function"?h.composedPath():[])[0])!==null&&d!==void 0?d:h.target;return u instanceof Element?o(u)?null:u:null}function s(h){var d;l||(i=c(h),(d=e.onHover)===null||d===void 0||d.call(e,i))}function a(h){var d;if(l)return;const u=(d=c(h))!==null&&d!==void 0?d:i;u&&(h.preventDefault(),h.stopPropagation(),p(),e.onPick(u))}function f(h){if(!l&&h.key==="Escape"){var d;h.preventDefault(),p(),(d=e.onCancel)===null||d===void 0||d.call(e)}}function p(){l||(l=!0,n.removeEventListener("mouseover",s,!0),n.removeEventListener("click",a,!0),n.removeEventListener("keydown",f,!0),i=null)}return n.addEventListener("mouseover",s,!0),n.addEventListener("click",a,!0),n.addEventListener("keydown",f,!0),{stop:p}}var _t={network:100,console:80,breadcrumbs:40},So=18e4,wo=["log","info","warn","error","assert","debug"],ir=["warn","error","assert"];function xo(e){return e!==void 0&&ir.includes(e)}var ko=ir;function Co(e){return ko.includes(e)}function Mo(e){return e==="console"?"console":e==="fetch"||e==="xhr"||e==="beacon"?"network":"breadcrumbs"}function Tt(e,t){return typeof e!="number"||!Number.isFinite(e)||e<1?t:Math.floor(e)}function Ze(){return typeof performance!="undefined"&&typeof performance.now=="function"?performance.now():Date.now()}function Eo(){const e=Math.random().toString(36).slice(2,8);let t=0;return()=>`${e}${(t++).toString(36)}`}var sr=["network","console","breadcrumbs"];function Io(e,t){const r=e.length-t;if(r<=0)return e;const n=new Set;for(let o=0;o<e.length&&n.size<r;o+=1)xo(e[o].crumb.level)||n.add(o);for(let o=0;o<e.length&&n.size<r;o+=1)n.has(o)||n.add(o);return e.filter((o,i)=>!n.has(i))}function Ro(e={}){var t,r,n,o,i,l;const c={network:Tt((t=e.budgets)===null||t===void 0?void 0:t.network,_t.network),console:Tt((r=e.budgets)===null||r===void 0?void 0:r.console,_t.console),breadcrumbs:Tt((n=e.budgets)===null||n===void 0?void 0:n.breadcrumbs,_t.breadcrumbs)},s=e.maxAgeMs===void 0?So:e.maxAgeMs,a=e.beforeBreadcrumb,f=(o=e.now)!==null&&o!==void 0?o:Date.now,p=(i=e.mono)!==null&&i!==void 0?i:Ze,h=(l=e.nextId)!==null&&l!==void 0?l:Eo(),d={network:[],console:[],breadcrumbs:[]};let u=0;function m(){if(typeof s!="number"||s<=0)return;const b=f()-s;for(const g of sr){const v=d[g];v.length>0&&(d[g]=v.filter(y=>y.crumb.timestamp>=b))}}return{add(b){var g;let v=b;if(a)try{v=a(b)}catch{v=b}if(!v)return;const y={...v,id:(g=v.id)!==null&&g!==void 0?g:h(),timestamp:typeof v.timestamp=="number"?v.timestamp:f(),mono:typeof v.mono=="number"?v.mono:p()},x=Mo(y.category);d[x].push({crumb:y,seq:u++}),m();const _=d[x],R=c[x];_.length>R&&(d[x]=x==="console"?Io(_,R):_.slice(-R))},snapshot(){m();const b=[];for(const g of sr)b.push(...d[g]);return b.sort((g,v)=>(typeof g.crumb.mono=="number"?g.crumb.mono:g.crumb.timestamp)-(typeof v.crumb.mono=="number"?v.crumb.mono:v.crumb.timestamp)||g.seq-v.seq),b.map(g=>g.crumb)},clear(){d.network=[],d.console=[],d.breadcrumbs=[],u=0}}}var ar=300,Lt=2048,Ja=4,Za=100,Nt=1024,Qa=4096,_o=2048;function be(e,t){return e.length>t?`${e.slice(0,t)}…`:e}function lr(e){if(typeof e=="string")return e;if(e instanceof Error)return`${e.name}: ${e.message}`;if(e==null||typeof e=="number"||typeof e=="boolean")return String(e);try{var t;return(t=JSON.stringify(e))!==null&&t!==void 0?t:String(e)}catch{return"[object]"}}function To(e){const t=e.map(lr).join(" ");return t.length>ar?`${t.slice(0,ar)}…`:t}function cr(e){var t;const r={name:e.name||"Error",message:be(String((t=e.message)!==null&&t!==void 0?t:""),Nt)};return typeof e.stack=="string"&&e.stack.length>0&&(r.stack=be(e.stack,_o)),r}function Ot(e,t,r){if(e===null)return null;const n=typeof e;if(n==="string")return be(e,Nt);if(n==="number")return Number.isFinite(e)?e:String(e);if(n==="boolean")return e;if(n==="bigint")return`${e.toString()}n`;if(n==="symbol")return e.toString();if(n==="function")return"[Function]";if(n==="undefined")return null;const o=e;if(e instanceof Error){const{name:i,message:l}=cr(e);return{name:i,message:l}}if(r.has(o))return"[Circular]";if(t<=0)return Array.isArray(e)?"[Array]":"[Object]";r.add(o);try{if(Array.isArray(e)){const s=e.slice(0,100).map(a=>Ot(a,t-1,r));return e.length>100&&s.push(`… ${e.length-100} more`),s}const i=e,l=Object.keys(i),c={};for(const s of l.slice(0,100)){const a=i[s];typeof a=="undefined"||typeof a=="function"||(c[s]=Ot(a,t-1,r))}return l.length>100&&(c["…"]=`${l.length-100} more`),c}finally{r.delete(o)}}function Lo(e){if(e==null)return{t:"null",v:null};const t=typeof e;return t==="string"?{t:"string",v:be(e,Nt)}:t==="number"?Number.isFinite(e)?{t:"number",v:e}:{t:"string",v:String(e)}:t==="boolean"?{t:"bool",v:e}:t==="bigint"?{t:"string",v:`${e.toString()}n`}:t==="symbol"?{t:"string",v:e.toString()}:t==="function"?{t:"string",v:"[Function]"}:e instanceof Error?{t:"error",v:cr(e)}:{t:"json",v:Ot(e,4,new Set)}}function At(e){try{var t;const r=(t=JSON.stringify(e))!==null&&t!==void 0?t:"";return typeof TextEncoder!="undefined"?new TextEncoder().encode(r).length:r.length}catch{return Number.POSITIVE_INFINITY}}function No(e){if(At(e)<=4096)return e;let t=e.slice();for(;t.length>1&&At(t)>4096;)t=t.slice(0,-1);return t.length===1&&At(t)>4096?[{t:"string",v:"[trace: console argument omitted (too large)]"}]:t}function ur(e,t,r,n){const o=No(t.map(Lo));return{category:"console",level:e,message:To(t),timestamp:r,...o.length>0?{args:o}:{},...n?{source:n}:{}}}function Oo(e,t,r){const n=be(oe(e),Lt),o=be(oe(t),Lt);return{category:"navigation",message:`${n} → ${o}`,timestamp:r,data:{from:n,to:o}}}function Dt(e){return typeof e!="number"||e<=0?"network-error":e>=500?"http-5xx":e>=400?"http-4xx":"ok"}function Ft(e){if(typeof e=="string")return Ao(e);if(typeof Blob!="undefined"&&e instanceof Blob)return e.size;if(typeof ArrayBuffer!="undefined"&&(e instanceof ArrayBuffer||ArrayBuffer.isView(e)))return e.byteLength}function Ao(e){try{return typeof TextEncoder!="undefined"?new TextEncoder().encode(e).length:e.length}catch{return e.length}}function dr(e){if(typeof e!="string")return;const t=Number.parseInt(e,10);return Number.isFinite(t)&&t>=0?t:void 0}function fr(e){var t;if(typeof e!="string"||e.length===0)return;const r=(t=e.split(";")[0])===null||t===void 0?void 0:t.trim();return r&&r.length>0?r:void 0}function Qe(e,t){const r=be(oe(e.url),Lt),n=typeof e.status=="number"&&e.status>0,o=n?` → ${e.status}`:"",i=e.outcome!=="ok"?` (${e.outcome})`:"";return{category:e.api,api:e.api,method:e.method,url:r,message:`${e.method} ${r}${o}${i}`,timestamp:t,...n?{status:e.status}:{},...e.statusText?{statusText:e.statusText}:{},...typeof e.durationMs=="number"?{durationMs:e.durationMs}:{},...typeof e.reqSize=="number"?{reqSize:e.reqSize}:{},...typeof e.respSize=="number"?{respSize:e.respSize}:{},...e.contentType?{contentType:e.contentType}:{},outcome:e.outcome}}function pr(e){try{return or(e)}catch{return e.tagName?e.tagName.toLowerCase():"unknown"}}function Do(e,t){const r=pr(e);return{category:"ui.click",message:`click ${r}`,timestamp:t,data:{target:r}}}function Fo(e,t){const r=pr(e);return{category:"ui.input",message:`input ${r}`,timestamp:t,data:{target:r}}}function Po(e){return e instanceof Error?{name:e.name||"Error",message:e.message}:typeof e=="string"?{name:"Error",message:e}:{name:"Error",message:lr(e)}}function Bo(e,t,r){const{name:n,message:o}=Po(e),i={category:"error",level:"error",message:o?`${n}: ${o}`:n,timestamp:t,data:{errorType:n}};return r&&r.length>0?{...i,causedBy:r}:i}function et(){}function Uo(e){var t,r;let n;const o=e.match(/^at\s+.+?\s+\((.+)\)$/);if(o)n=o[1];else{const s=e.match(/^at\s+(.+)$/);if(s)n=s[1];else{const a=e.indexOf("@");a>=0&&(n=e.slice(a+1))}}if(!n)return;n=n.replace(/\?[^:]*/,"");const i=(t=n.match(/^(.*):(\d+):\d+$/))!==null&&t!==void 0?t:n.match(/^(.*):(\d+)$/);if(!i)return;const l=(r=i[1])!==null&&r!==void 0?r:"",c=Number(i[2]);if(!(!l||!Number.isFinite(c)))return{file:l,line:c}}function zo(e,t=0){if(typeof e!="string"||e.length===0)return;const r=[];for(const n of e.split(`
3
- `)){const o=Uo(n.trim());o&&r.push(o)}return r[t]}var $o=1;function Wo(e,t,r,n){const o=[];for(const i of r){const l=t[i];if(typeof l!="function")continue;const c=Co(i),s=(...a)=>{let f;if(c)try{f=zo(new Error().stack,$o)}catch{f=void 0}try{i==="assert"?a[0]||e.add(ur("assert",a.slice(1),n(),f)):e.add(ur(i,a,n(),f))}catch{}return l.apply(t,a)};t[i]=s,o.push(()=>{t[i]=l})}return()=>{for(const i of o)i()}}function Ho(e){return typeof e=="string"?e:e instanceof URL?e.toString():e.url}function jo(e,t){var r,n;return((r=(n=t==null?void 0:t.method)!==null&&n!==void 0?n:typeof e=="object"&&"method"in e?e.method:void 0)!==null&&r!==void 0?r:"GET").toUpperCase()}function hr(e,t){try{var r,n,o;return(r=(n=e.headers)===null||n===void 0||(o=n.get)===null||o===void 0?void 0:o.call(n,t))!==null&&r!==void 0?r:null}catch{return null}}function Go(e){return e.type==="opaque"||e.type==="opaqueredirect"?"opaque-cors":Dt(e.status)}function Vo(e){const t=typeof e=="object"&&e!==null&&"name"in e?String(e.name):"";return t==="AbortError"?"aborted":t==="TimeoutError"?"timeout":"network-error"}function qo(e,t,r,n,o=Ze){const i=t.fetch;if(typeof i!="function")return et;const l=(c,s)=>{const a=Ho(c),f=jo(c,s),p=Ft(s==null?void 0:s.body),h=o(),d=i.call(t,c,s);return r(a)?d:d.then(u=>{try{e.add(Qe({api:"fetch",method:f,url:a,status:u.status||void 0,statusText:u.statusText||void 0,durationMs:Math.max(0,o()-h),reqSize:p,respSize:dr(hr(u,"content-length")),contentType:fr(hr(u,"content-type")),outcome:Go(u)},n()))}catch{}return u},u=>{try{e.add(Qe({api:"fetch",method:f,url:a,durationMs:Math.max(0,o()-h),reqSize:p,outcome:Vo(u)},n()))}catch{}throw u})};return t.fetch=l,()=>{t.fetch=i}}function mr(e,t){try{return typeof e.getResponseHeader=="function"?e.getResponseHeader(t):null}catch{return null}}function Xo(e){try{return e.statusText||void 0}catch{return}}function Yo(e,t,r,n,o=Ze){const i=t.XMLHttpRequest;if(typeof i!="function")return et;const l=i.prototype,c=l.open,s=l.send;return l.open=function(a,f,...p){return this.__fixbackMeta={method:String(a).toUpperCase(),url:String(f)},c.call(this,a,f,...p)},l.send=function(a){const f=this.__fixbackMeta;if(f&&!r(f.url)){const p=o(),h=Ft(a);let d;const u=()=>{d=Dt(this.status||void 0)},m=()=>{d="network-error"},b=()=>{d="timeout"},g=()=>{d="aborted"},v=()=>{try{var y;e.add(Qe({api:"xhr",method:f.method,url:f.url,status:this.status||void 0,statusText:Xo(this),durationMs:Math.max(0,o()-p),reqSize:h,respSize:dr(mr(this,"content-length")),contentType:fr(mr(this,"content-type")),outcome:(y=d)!==null&&y!==void 0?y:Dt(this.status||void 0)},n()))}catch{}this.removeEventListener("load",u),this.removeEventListener("error",m),this.removeEventListener("timeout",b),this.removeEventListener("abort",g),this.removeEventListener("loadend",v)};this.addEventListener("load",u),this.addEventListener("error",m),this.addEventListener("timeout",b),this.addEventListener("abort",g),this.addEventListener("loadend",v)}return s.call(this,a)},()=>{l.open=c,l.send=s}}function Ko(e,t,r,n){const o=t.navigator;if(!o||typeof o.sendBeacon!="function")return et;const i=o.sendBeacon,l=(s,a,f)=>{if(!r(s))try{e.add(Qe({api:"beacon",method:"POST",url:s,reqSize:Ft(a),outcome:f},n()))}catch{}},c=function(s,a){const f=typeof s=="string"?s:String(s);let p;try{p=i.call(o,s,a)}catch(h){throw l(f,a,"network-error"),h}return l(f,a,p?"ok":"network-error"),p};return o.sendBeacon=c,()=>{o.sendBeacon=i}}function Jo(e,t,r){const n=t.history,o=t.location;if(!n||!o)return et;let i=o.href;const l=p=>{try{e.add(Oo(i,p,r()))}catch{}i=p},c=n.pushState,s=n.replaceState;n.pushState=function(p,h,d){const u=c.call(this,p,h,d);return l(o.href),u},n.replaceState=function(p,h,d){const u=s.call(this,p,h,d);return l(o.href),u};const a=()=>l(o.href),f=()=>l(o.href);return t.addEventListener("popstate",a),t.addEventListener("hashchange",f),()=>{n.pushState=c,n.replaceState=s,t.removeEventListener("popstate",a),t.removeEventListener("hashchange",f)}}function br(e){var t;const r=(t=(typeof e.composedPath=="function"?e.composedPath():[])[0])!==null&&t!==void 0?t:e.target;return r instanceof Element?r:null}function Zo(e,t,r){const n=i=>{const l=br(i);if(!(!l||Rt(l)))try{e.add(Do(l,r()))}catch{}},o=i=>{const l=br(i);if(!(!l||Rt(l)))try{e.add(Fo(l,r()))}catch{}};return t.addEventListener("click",n,!0),t.addEventListener("input",o,!0),()=>{t.removeEventListener("click",n,!0),t.removeEventListener("input",o,!0)}}function Qo(e,t={}){var r,n,o,i,l,c,s;const a=(r=t.win)!==null&&r!==void 0?r:globalThis,f=(n=t.doc)!==null&&n!==void 0?n:typeof document!="undefined"?document:void 0,p=(o=t.consoleObj)!==null&&o!==void 0?o:typeof console!="undefined"?console:void 0,h=(i=t.consoleLevels)!==null&&i!==void 0?i:wo,d=(l=t.ignoreUrl)!==null&&l!==void 0?l:(()=>!1),u=(c=t.now)!==null&&c!==void 0?c:Date.now,m=(s=t.mono)!==null&&s!==void 0?s:Ze,b=t.captureConsole!==!1,g=t.captureNetwork!==!1,v=[];return p&&b&&v.push(Wo(e,p,h,u)),a&&(g&&(v.push(qo(e,a,d,u,m)),v.push(Yo(e,a,d,u,m)),v.push(Ko(e,a,d,u))),v.push(Jo(e,a,u))),f&&v.push(Zo(e,f,u)),()=>{for(const y of v)try{y()}catch{}}}var ei="#e5484d";function gr(e,t,r,n){return{x:Math.round(Math.min(e,r)),y:Math.round(Math.min(t,n)),width:Math.round(Math.abs(r-e)),height:Math.round(Math.abs(n-t))}}function ti(e,t,r,n,o=14){const i=Math.atan2(n-t,r-e);return[{x:r,y:n},{x:r-o*Math.cos(i-Math.PI/6),y:n-o*Math.sin(i-Math.PI/6)},{x:r-o*Math.cos(i+Math.PI/6),y:n-o*Math.sin(i+Math.PI/6)}]}function ri(e){const t={};return e.element&&(t.element=e.element),e.region&&(t.region=e.region),e.marks&&e.marks.length>0&&(t.marks=e.marks.slice()),Object.keys(t).length>0?t:void 0}var ni=100,oi=new Set([".","..","latest"]);function ii(e){const t=e.trim();if(!(t.length===0||t.length>ni)&&!oi.has(t)&&!/[\s/\\\u0000-\u001f\u007f]/.test(t))return t}function vr(e,t,r){var n;const o={},i=e.innerWidth;typeof i=="number"&&i>0&&(o.viewportWidth=Math.round(i));const l=e.innerHeight;typeof l=="number"&&l>0&&(o.viewportHeight=Math.round(l));const c=(n=e.navigator)===null||n===void 0?void 0:n.userAgent;return typeof c=="string"&&c.length>0&&(o.browser=c),t.length>0&&(o.sdkVersion=t),r&&r.length>0&&(o.release=r),o}function yr(e){var t,r,n;const o={},i=(t=e.comment)===null||t===void 0?void 0:t.trim();i&&(o.comment=i);const l=(r=e.reporterName)===null||r===void 0?void 0:r.trim();l&&(o.reporterName=l);const c=(n=e.reporterEmail)===null||n===void 0?void 0:n.trim();c&&(o.reporterEmail=c),e.url&&(o.url=e.url),e.environment&&Object.keys(e.environment).length>0&&(o.environment=e.environment);const s=ri({element:e.element,region:e.region,marks:e.marks});return s&&(o.annotation=s),e.trace&&e.trace.length>0&&(o.trace=e.trace),o}var si="replay",ai=new po;function li(e){return`${e.replace(/\/+$/,"")}/api/ingest/feedback`}function ci(e){if(!e)return{};const t={};return e.signedIdentity&&(t.signedIdentity=e.signedIdentity),e.reporterId&&(t.reporterId=e.reporterId),e.anonymousId&&(t.anonymousId=e.anonymousId),t}async function Sr(e,t,r=fetch,n=ai){var o;const i=(o=t.content.source)!==null&&o!==void 0?o:"reporter",l=i==="error";if(l&&n.isPaused())return{ok:!1,reason:"backpressure",retryAfterSeconds:n.retryAfterSeconds()};const c={key:t.key,...ci(t.identity),...t.content,source:i},s=new FormData;if(s.append("payload",JSON.stringify(c)),t.replay&&t.replay.events.length>0)try{const f=JSON.stringify(t.replay.events);s.append(si,new Blob([f],{type:"application/json"}),"replay.json")}catch{}let a;try{a=await r(li(e),{method:"POST",body:s})}catch{return{ok:!1,reason:"unreachable"}}if(!a.ok)return l&&a.status===429?{ok:!1,reason:"backpressure",retryAfterSeconds:n.hold(a.headers.get("Retry-After"))}:{ok:!1,reason:"refused",status:a.status};try{return{ok:!0,feedback:await a.json()}}catch{return{ok:!0,feedback:null}}}var tt="0.5.0",el=5,ui=2e3,tl=20,di=5;function fi(e){if(!e||e.length===0)return[];const t=[];for(let n=e.length-1;n>=0&&t.length<di;n-=1){var r;const o=(r=e[n])===null||r===void 0?void 0:r.id;typeof o=="string"&&o.length>0&&t.unshift(o)}return t}var pi=30;function hi(e){var t;const r=e.match(/^(.*?):(\d+)(?::(\d+))?$/);if(!r)return null;const n=(t=r[1])!==null&&t!==void 0?t:"";if(n.length===0||n==="native"||n.includes("<anonymous>"))return null;const o=Number(r[2]);return Number.isFinite(o)?{file:n,line:o,column:r[3]!==void 0?Number(r[3]):null}:null}function mi(e,t=pi){if(typeof e!="string"||e.length===0)return[];const r=[];for(const l of e.split(`
4
- `)){if(r.length>=t)break;const c=l.trim();let s=null,a=null;const f=c.match(/^at\s+(.+?)\s+\((.+)\)$/),p=f?null:c.match(/^at\s+(.+)$/),h=f||p?-1:c.indexOf("@");if(f){var n,o;s=(n=f[1])!==null&&n!==void 0?n:null,a=(o=f[2])!==null&&o!==void 0?o:null}else if(p){var i;a=(i=p[1])!==null&&i!==void 0?i:null}else h>=0&&(s=h>0?c.slice(0,h):null,a=c.slice(h+1));if(!a)continue;const d=hi(a);d&&r.push({file:oe(d.file),line:d.line,column:d.column,function:s&&s.length>0?s:null})}return r}var bi=class{constructor(e){var t;xe(this,"options",void 0),xe(this,"tokens",void 0),xe(this,"last",void 0),xe(this,"now",void 0),this.options=e,this.now=(t=e.now)!==null&&t!==void 0?t:Date.now,this.tokens=Math.max(0,e.capacity),this.last=this.now()}take(){const e=this.now(),{capacity:t,refillIntervalMs:r}=this.options;if(r>0&&e>this.last){const n=Math.floor((e-this.last)/r);n>0&&(this.tokens=Math.min(t,this.tokens+n),this.last+=n*r)}return this.tokens>=1?(this.tokens-=1,!0):!1}};function pe(e){if(typeof e=="string")return e;if(e==null)return"";try{return String(e)}catch{return""}}function gi(e){const t=e,r=t.error;if(r&&typeof r=="object"){const o=r;return{type:pe(o.name)||"Error",value:pe(o.message)||pe(t.message),stack:typeof o.stack=="string"?o.stack:void 0,original:r}}const n=pe(t.message);return n?{type:"Error",value:n,original:n}:null}function vi(e){const t=e.reason;if(t&&typeof t=="object"){const n=t;return{type:pe(n.name)||"UnhandledRejection",value:pe(n.message)||pe(t),stack:typeof n.stack=="string"?n.stack:void 0,original:t}}const r=pe(t);return{type:"UnhandledRejection",value:r,original:t!=null?t:r}}var yi={destroy:()=>{},droppedCount:()=>0};function Si(e){var t,r,n,o,i,l,c,s,a,f;const p=(t=e.win)!==null&&t!==void 0?t:typeof window!="undefined"?window:void 0;if(!p)return yi;const h=p,d=(r=(n=e.doc)!==null&&n!==void 0?n:h.document)!==null&&r!==void 0?r:typeof document!="undefined"?document:void 0,u=(o=e.now)!==null&&o!==void 0?o:Date.now,m=(i=e.sdkVersion)!==null&&i!==void 0?i:tt,b=(l=e.maxDistinct)!==null&&l!==void 0?l:20,g=(c=(s=e.deps)===null||s===void 0?void 0:s.submitReport)!==null&&c!==void 0?c:Sr,v=new bi({capacity:(a=e.burstCapacity)!==null&&a!==void 0?a:5,refillIntervalMs:(f=e.burstRefillMs)!==null&&f!==void 0?f:ui,now:u}),y=new Map;let x=0;function _(L,C,K){var $,P,j,X,Y;const ae=yr({url:($=h.location)===null||$===void 0?void 0:$.href,environment:vr(h,m,e.release),trace:K.trace?(P=e.buffer)===null||P===void 0?void 0:P.snapshot():void 0,reporterName:(j=e.display)===null||j===void 0?void 0:j.name,reporterEmail:(X=e.display)===null||X===void 0?void 0:X.email}),re=(Y=y.get(L))===null||Y===void 0?void 0:Y.frames;return{...ae,source:"error",errorSignature:L,occurrences:C,...K.trace&&re&&re.length>0?{errorFrames:re}:{}}}async function R(L,C,K){const $=y.get(L);if(!$)return;const P=$.sentCount;$.sentCount=C;try{var j,X;const Y=_(L,C,K),ae=tr(Y,{hook:e.beforeSend,scrub:e.scrub});if(!ae)return;const re=K.trace&&(j=(X=e.replay)===null||X===void 0?void 0:X.snapshot())!==null&&j!==void 0?j:null;!(await g(e.apiUrl,{key:e.key,identity:e.identity,content:ae,replay:re})).ok&&$.sentCount===C&&($.sentCount=P)}catch{$.sentCount===C&&($.sentCount=P)}}function I(L){const C=eo(L.type,L.value,L.stack),K=y.get(C);if(K){K.count+=1,K.lastAt=u();return}if(!v.take()){x+=1;return}if(y.size>=b){x+=1;return}const $=u();y.set(C,{count:1,firstAt:$,lastAt:$,sentCount:0,frames:mi(L.stack)});try{var P,j;const X=fi((P=e.buffer)===null||P===void 0?void 0:P.snapshot());(j=e.buffer)===null||j===void 0||j.add(Bo(L.original,$,X))}catch{}R(C,1,{trace:!0})}const D=L=>{try{const C=gi(L);C&&I(C)}catch{}},N=L=>{try{const C=vi(L);C&&I(C)}catch{}},w=()=>{try{for(const[L,C]of y)C.count>C.sentCount&&R(L,C.count,{trace:!1})}catch{}},B=()=>{(d==null?void 0:d.visibilityState)==="hidden"&&w()};return h.addEventListener("error",D,!0),h.addEventListener("unhandledrejection",N,!0),h.addEventListener("pagehide",w),d==null||d.addEventListener("visibilitychange",B),{destroy:()=>{h.removeEventListener("error",D,!0),h.removeEventListener("unhandledrejection",N,!0),h.removeEventListener("pagehide",w),d==null||d.removeEventListener("visibilitychange",B)},droppedCount:()=>x}}var wr="fixback.anonymousId";function xr(){const e=globalThis.crypto;return e&&typeof e.randomUUID=="function"?e.randomUUID():`fb-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,10)}`}function wi(){try{const e=globalThis.localStorage,t=e.getItem(wr);if(t)return t;const r=xr();return e.setItem(wr,r),r}catch{return xr()}}var kr="fixback_invite",xi="fixback:reporter:";function ki(e){try{const t=new URL(e).searchParams.get(kr);return t&&t.length>0?t:null}catch{return null}}function Ci(e){try{const t=new URL(e.location.href);if(!t.searchParams.has("fixback_invite"))return;t.searchParams.delete(kr);const r=t.searchParams.toString(),n=`${t.pathname}${r?`?${r}`:""}${t.hash}`;e.history.replaceState(e.history.state,"",n)}catch{}}function Cr(e){return`${xi}${e}`}function Mr(){try{var e;return(e=globalThis.localStorage)!==null&&e!==void 0?e:null}catch{return null}}function rt(e){if(typeof e!="string")return;const t=e.trim();return t.length>0?t:void 0}function Mi(e,t,r=Mr()){if(!r)return;const n=rt(t.name),o=rt(t.email),i={reporterId:t.reporterId,...n?{name:n}:{},...o?{email:o}:{}};try{r.setItem(Cr(e),JSON.stringify(i))}catch{}}function Pt(e,t=Mr()){if(!t)return null;try{const r=t.getItem(Cr(e));if(!r)return null;const n=JSON.parse(r);if(typeof(n==null?void 0:n.reporterId)!="string"||n.reporterId.length===0)return null;const o=rt(n.name),i=rt(n.email);return{reporterId:n.reporterId,...o?{name:o}:{},...i?{email:i}:{}}}catch{return null}}function Er(e,t){return`${e.replace(/\/+$/,"")}/api/invites/${encodeURIComponent(t)}`}function Ei(e,t){return`${Er(e,t)}/redeem`}var Ir=new Set(["revoked","expired","exhausted","not_found"]);function Rr(e){return e==="public"||e==="invited"||e==="internal"}function Ii(e){if(typeof e!="object"||e===null)return!1;const t=e;return t.status==="pending"?typeof t.projectId=="string"&&(t.kind==="targeted"||t.kind==="shared")&&Rr(t.tier):typeof t.status=="string"&&Ir.has(t.status)}function Ri(e){if(typeof e!="object"||e===null)return!1;const t=e;return t.status==="redeemed"?typeof t.reporterId=="string"&&typeof t.projectId=="string"&&Rr(t.tier):typeof t.status=="string"&&Ir.has(t.status)}async function _r(e){try{return await e.json()}catch{return null}}async function _i(e,t,r=fetch){let n;try{n=await r(Er(e,t),{method:"GET",headers:{accept:"application/json"}})}catch{return null}const o=await _r(n);return Ii(o)?o:null}async function Ti(e,t,r=fetch){let n;try{n=await r(Ei(e,t),{method:"POST",headers:{accept:"application/json"}})}catch{return null}const o=await _r(n);return Ri(o)?o:null}var Li=`
1
+ (function(re,Me){typeof exports=="object"&&typeof module!="undefined"?Me(exports):typeof define=="function"&&define.amd?define(["exports"],Me):(re=typeof globalThis!="undefined"?globalThis:re||self,Me(re.Fixback={}))})(this,function(re){Object.defineProperty(re,Symbol.toStringTag,{value:"Module"});var Me=Object.defineProperty,lr=(e,t,n)=>t in e?Me(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Fe=(e,t,n)=>lr(e,typeof t!="symbol"?t+"":t,n),cr=7,At=/[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}/gi,Dt=new RegExp(`\\d{${cr},}`,"g"),ur=/\b(bearer|token)\s+[\w.\-~+/]+=*/gi,dr=/\bhttps?:\/\/[^\s"'<>]+/gi;function fr(e){return typeof e!="string"||e.length===0?e:e.replace(At,"[redacted-email]").replace(ur,(t,n)=>`${n} [redacted]`).replace(Dt,"[redacted-number]")}function st(e){return e.replace(At,"[redacted-email]").replace(Dt,"[redacted-number]")}function Z(e){var t;if(typeof e!="string"||e.length===0)return e;let n=e;n=n.replace(/(^[a-z][a-z0-9+.-]*:\/\/)[^/@?#]*@/i,"$1"),n=n.replace(/\?[^#]*/,""),n=n.replace(/#.*$/,s=>s.includes("=")?"":s);const r=n.match(/^([a-z][a-z0-9+.-]*:\/\/[^/?#]*)([\s\S]*)$/i);if(r)return r[1]+st((t=r[2])!==null&&t!==void 0?t:"");const o=n.match(/^(\/\/[^/?#]*)([\s\S]*)$/);if(o){var i;return o[1]+st((i=o[2])!==null&&i!==void 0?i:"")}return st(n)}function pr(e){const t={...e};return typeof t.url=="string"&&(t.url=Z(t.url)),typeof t.from=="string"&&(t.from=Z(t.from)),typeof t.to=="string"&&(t.to=Z(t.to)),t}function Ee(e){return fr(e.replace(dr,t=>Z(t)))}function at(e){if(typeof e=="string")return Ee(e);if(Array.isArray(e))return e.map(at);if(e&&typeof e=="object"){const t={};for(const[n,r]of Object.entries(e))t[n]=at(r);return t}return e}function hr(e){switch(e.t){case"string":return typeof e.v=="string"?{t:"string",v:Ee(e.v)}:e;case"json":return{t:"json",v:at(e.v)};case"error":{if(!e.v||typeof e.v!="object")return e;const t={...e.v};return typeof t.message=="string"&&(t.message=Ee(t.message)),typeof t.stack=="string"&&(t.stack=Ee(t.stack)),{t:"error",v:t}}default:return e}}function mr(e){const t={...e};return typeof t.message=="string"&&(t.message=Ee(t.message)),t.data&&(t.data=pr(t.data)),typeof t.url=="string"&&(t.url=Z(t.url)),Array.isArray(t.args)&&(t.args=t.args.map(hr)),t}function br(e){const t={...e};return typeof t.url=="string"&&(t.url=Z(t.url)),t.trace&&t.trace.length>0&&(t.trace=t.trace.map(mr)),t.errorFrames&&t.errorFrames.length>0&&(t.errorFrames=t.errorFrames.map(n=>({...n,file:Z(n.file)}))),t}function Ft(e,t={}){const n=t.scrub===!1?e:br(e),r=t.hook;if(!r)return n;try{const o=r(n);return o!=null?o:null}catch{return n}}var gr=30;function lt(e){var t,n,r;const o=e.match(/^at\s+(.+?)\s+\((.+)\)$/);if(o)return{fn:(t=o[1])!==null&&t!==void 0?t:null,location:(n=o[2])!==null&&n!==void 0?n:""};const i=e.match(/^at\s+(.+)$/);if(i)return{fn:null,location:(r=i[1])!==null&&r!==void 0?r:""};const s=e.indexOf("@");return s>=0?{fn:s>0?e.slice(0,s):null,location:e.slice(s+1)}:null}function vr(e){var t;const n=e.match(/^(.*?):(\d+)(?::(\d+))?$/);if(!n)return null;const r=(t=n[1])!==null&&t!==void 0?t:"";if(r.length===0||r==="native"||r.includes("<anonymous>"))return null;const o=Number(n[2]);return Number.isFinite(o)?{file:r,line:o,column:n[3]!==void 0?Number(n[3]):null}:null}function yr(e,t=gr){if(typeof e!="string"||e.length===0)return[];const n=[];for(const r of e.split(`
2
+ `)){if(n.length>=t)break;const o=lt(r.trim());if(!o||!o.location)continue;const i=vr(o.location);i&&n.push({file:Z(i.file),line:i.line,column:i.column,function:o.fn&&o.fn.length>0?o.fn:null})}return n}var Sr=/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/gi,wr=/\bhttps?:\/\/[^\s"')]+/gi,xr=/\b0x[0-9a-f]+\b/gi,kr=/\b[0-9a-f]{8,}\b/gi,Cr=/\d{4,}/g,Mr=5;function Er(e){return typeof e!="string"||e.length===0?"":e.replace(Sr,"<uuid>").replace(wr,"<url>").replace(xr,"<hex>").replace(kr,"<hex>").replace(Cr,"<n>").trim()}function Ir(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return(t>>>0).toString(36)}function _r(e){const t=e.replace(/\?[^:]*/,""),n=t.lastIndexOf("/");return n>=0?t.slice(n+1):t}function Rr(e){var t;const n=lt(e);return n?`${(t=n.fn)!==null&&t!==void 0?t:""}@${_r(n.location)}`:null}function Tr(e,t=Mr){if(typeof e!="string"||e.length===0)return"";const n=[];for(const r of e.split(`
3
+ `)){const o=Rr(r.trim());if(o&&(n.push(o),n.length>=t))break}return n.join(" < ")}function Lr(e,t,n){return Ir(`${e}|${Er(t)}|${Tr(n)}`)}var Sa=60;function Nr(e,t){if(e==null)return 60;const n=e.trim();if(n==="")return 60;if(/^\d+$/.test(n))return Number(n);const r=Date.parse(n);return Number.isNaN(r)?60:Math.max(0,Math.ceil((r-t)/1e3))}var Or=class{constructor(e=Date.now){this.now=e,Fe(this,"pausedUntil",0)}isPaused(){return this.now()<this.pausedUntil}retryAfterSeconds(){return Math.max(0,Math.ceil((this.pausedUntil-this.now())/1e3))}hold(e){const t=this.now(),n=Nr(e,t),r=t+n*1e3;return r>this.pausedUntil&&(this.pausedUntil=r),n}};function Pe(){const e=globalThis.performance;return e&&typeof e.now=="function"?e.now():Date.now()}function Ar(){return globalThis.TextEncoder}function Pt(e){try{const t=Ar();return t?new t().encode(e).length:e.length}catch{return e.length}}function ct(e){try{var t;return Pt((t=JSON.stringify(e))!==null&&t!==void 0?t:"")}catch{return Number.POSITIVE_INFINITY}}function ut(e){if(typeof e=="string")return Pt(e);const t=globalThis.Blob;if(t&&e instanceof t)return e.size;if(typeof ArrayBuffer!="undefined"&&(e instanceof ArrayBuffer||ArrayBuffer.isView(e)))return e.byteLength}function Ue(){const e=globalThis;if(typeof e.fetch!="function")return;const t=e.fetch.bind(globalThis);return(n,r)=>t(n,r)}function Dr(e,t){try{var n,r,o;return(n=(r=e.headers)===null||r===void 0||(o=r.get)===null||o===void 0?void 0:o.call(r,t))!==null&&n!==void 0?n:null}catch{return null}}function Fr(e){return`${e.replace(/\/+$/,"")}/api/ingest/boot`}function Pr(e){return`${e.replace(/\/+$/,"")}/api/ingest/feedback`}function Ur(e){if(typeof e!="object"||e===null)return!1;const t=e;return typeof t.originAllowed=="boolean"&&typeof t.canSubmit=="boolean"&&typeof t.gate=="string"&&(t.tier===null||typeof t.tier=="string")}function Ut(e){if(!e)return{};const t={};return e.hostIdentity&&(t.hostIdentity=e.hostIdentity),e.reporterSession&&(t.reporterSession=e.reporterSession),e.anonymousId&&(t.anonymousId=e.anonymousId),t}function $r(e,t){const n=e.replace(/\/+$/,"");return t.startsWith(`${n}/api/ingest/`)||t.startsWith(`${n}/api/connect/`)}async function Br(e,t,n={}){var r;const o=(r=n.fetch)!==null&&r!==void 0?r:Ue();if(!o)return null;let i;try{i=await o(Fr(e),{method:"POST",headers:{"content-type":"application/json",...n.origin?{origin:n.origin}:{}},body:JSON.stringify(t)})}catch{return null}if(!i.ok)return null;let s;try{var l;s=await((l=i.json)===null||l===void 0?void 0:l.call(i))}catch{return null}return Ur(s)?s:null}var wa="fixback-connect",$t="fixback";function zr(e){return`${e.replace(/\/+$/,"")}/api/connect/exchange`}function Wr(e){return`${e.replace(/\/+$/,"")}/api/connect/signout`}function Hr(e,t){var n;const r=(n=e.split("#")[0])!==null&&n!==void 0?n:e;return`${r}${r.includes("?")?"&":"?"}${`key=${encodeURIComponent(t.key)}&return=${encodeURIComponent(t.returnUrl)}`}`}function dt(e){return`fixback.reporterSession.${e}`}function jr(e){if(typeof e!="object"||e===null)return null;const t=e;return t.source!=="fixback-connect"?null:typeof t.code=="string"&&t.code.length>0?t.code:null}function Gr(e){if(typeof e!="object"||e===null)return!1;const t=e;if(typeof t.reporterSession!="string"||t.reporterSession.length===0)return!1;const n=t.account;return typeof n=="object"&&n!==null&&typeof n.name=="string"&&typeof n.email=="string"}async function Vr(e,t,n={}){var r;const o=(r=n.fetch)!==null&&r!==void 0?r:Ue();if(!o)return null;let i;try{i=await o(zr(e),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(t)})}catch{return null}if(!i.ok)return null;let s;try{var l;s=await((l=i.json)===null||l===void 0?void 0:l.call(i))}catch{return null}return Gr(s)?s:null}async function qr(e,t,n={}){var r;const o=(r=n.fetch)!==null&&r!==void 0?r:Ue();if(o)try{await o(Wr(e),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({reporterSession:t})})}catch{}}var Bt="fixback.anonymousId";function zt(){const e=globalThis.crypto;if(e&&typeof e.randomUUID=="function")try{return e.randomUUID()}catch{}return`fb-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,10)}`}var xa=100,Xr=new Set([".","..","latest"]);function Yr(e){const t=e.trim();if(!(t.length===0||t.length>100)&&!Xr.has(t)&&!/[\s/\\\u0000-\u001f\u007f]/.test(t))return t}var Wt="https://api.fixback.dev",ka=300,Ca=4,Ma=100,ft=1024,Ea=4096,Kr=2048;function ce(e,t){return e.length>t?`${e.slice(0,t)}…`:e}function Ht(e){if(typeof e=="string")return e;if(e instanceof Error)return`${e.name}: ${e.message}`;if(e==null||typeof e=="number"||typeof e=="boolean")return String(e);try{var t;return(t=JSON.stringify(e))!==null&&t!==void 0?t:String(e)}catch{return"[object]"}}function Jr(e){const t=e.map(Ht).join(" ");return t.length>300?`${t.slice(0,300)}…`:t}function jt(e){var t;const n={name:e.name||"Error",message:ce(String((t=e.message)!==null&&t!==void 0?t:""),ft)};return typeof e.stack=="string"&&e.stack.length>0&&(n.stack=ce(e.stack,Kr)),n}function pt(e,t,n){if(e===null)return null;const r=typeof e;if(r==="string")return ce(e,ft);if(r==="number")return Number.isFinite(e)?e:String(e);if(r==="boolean")return e;if(r==="bigint")return`${e.toString()}n`;if(r==="symbol")return e.toString();if(r==="function")return"[Function]";if(r==="undefined")return null;const o=e;if(e instanceof Error){const{name:i,message:s}=jt(e);return{name:i,message:s}}if(n.has(o))return"[Circular]";if(t<=0)return Array.isArray(e)?"[Array]":"[Object]";n.add(o);try{if(Array.isArray(e)){const a=e.slice(0,100).map(c=>pt(c,t-1,n));return e.length>100&&a.push(`… ${e.length-100} more`),a}const i=e,s=Object.keys(i),l={};for(const a of s.slice(0,100)){const c=i[a];typeof c=="undefined"||typeof c=="function"||(l[a]=pt(c,t-1,n))}return s.length>100&&(l["…"]=`${s.length-100} more`),l}finally{n.delete(o)}}function Zr(e){if(e==null)return{t:"null",v:null};const t=typeof e;return t==="string"?{t:"string",v:ce(e,ft)}:t==="number"?Number.isFinite(e)?{t:"number",v:e}:{t:"string",v:String(e)}:t==="boolean"?{t:"bool",v:e}:t==="bigint"?{t:"string",v:`${e.toString()}n`}:t==="symbol"?{t:"string",v:e.toString()}:t==="function"?{t:"string",v:"[Function]"}:e instanceof Error?{t:"error",v:jt(e)}:{t:"json",v:pt(e,4,new Set)}}function Qr(e){if(ct(e)<=4096)return e;let t=e.slice();for(;t.length>1&&ct(t)>4096;)t=t.slice(0,-1);return t.length===1&&ct(t)>4096?[{t:"string",v:"[trace: console argument omitted (too large)]"}]:t}var ht=2048;function Gt(e,t,n,r){const o=Qr(t.map(Zr));return{category:"console",level:e,message:Jr(t),timestamp:n,...o.length>0?{args:o}:{},...r?{source:r}:{}}}function eo(e,t,n){const r=ce(Z(e),ht),o=ce(Z(t),ht);return{category:"navigation",message:`${r} → ${o}`,timestamp:n,data:{from:r,to:o}}}function mt(e){return typeof e!="number"||e<=0?"network-error":e>=500?"http-5xx":e>=400?"http-4xx":"ok"}function Vt(e){if(typeof e!="string")return;const t=Number.parseInt(e,10);return Number.isFinite(t)&&t>=0?t:void 0}function qt(e){var t;if(typeof e!="string"||e.length===0)return;const n=(t=e.split(";")[0])===null||t===void 0?void 0:t.trim();return n&&n.length>0?n:void 0}function $e(e,t){const n=ce(Z(e.url),ht),r=typeof e.status=="number"&&e.status>0,o=r?` → ${e.status}`:"",i=e.outcome!=="ok"?` (${e.outcome})`:"";return{category:e.api,api:e.api,method:e.method,url:n,message:`${e.method} ${n}${o}${i}`,timestamp:t,...r?{status:e.status}:{},...e.statusText?{statusText:e.statusText}:{},...typeof e.durationMs=="number"?{durationMs:e.durationMs}:{},...typeof e.reqSize=="number"?{reqSize:e.reqSize}:{},...typeof e.respSize=="number"?{respSize:e.respSize}:{},...e.contentType?{contentType:e.contentType}:{},outcome:e.outcome}}function to(e){return e instanceof Error?{name:e.name||"Error",message:e.message}:typeof e=="string"?{name:"Error",message:e}:{name:"Error",message:Ht(e)}}function no(e,t,n){const{name:r,message:o}=to(e),i={category:"error",level:"error",message:o?`${r}: ${o}`:r,timestamp:t,data:{errorType:r}};return n&&n.length>0?{...i,causedBy:n}:i}var Ia=5,ro=2e3,_a=20,Ra=5;function ae(e){if(typeof e=="string")return e;if(e==null)return"";try{return String(e)}catch{return""}}function oo(e){if(!e||e.length===0)return[];const t=[];for(let r=e.length-1;r>=0&&t.length<5;r-=1){var n;const o=(n=e[r])===null||n===void 0?void 0:n.id;typeof o=="string"&&o.length>0&&t.unshift(o)}return t}var io=class{constructor(e){var t;this.options=e,Fe(this,"tokens"),Fe(this,"last"),Fe(this,"now"),this.now=(t=e.now)!==null&&t!==void 0?t:Date.now,this.tokens=Math.max(0,e.capacity),this.last=this.now()}take(){const e=this.now(),{capacity:t,refillIntervalMs:n}=this.options;if(n>0&&e>this.last){const r=Math.floor((e-this.last)/n);r>0&&(this.tokens=Math.min(t,this.tokens+r),this.last+=r*n)}return this.tokens>=1?(this.tokens-=1,!0):!1}};function so(e){var t,n,r,o;const i=(t=e.now)!==null&&t!==void 0?t:Date.now,s=(n=e.maxDistinct)!==null&&n!==void 0?n:20,l=new io({capacity:(r=e.burstCapacity)!==null&&r!==void 0?r:5,refillIntervalMs:(o=e.burstRefillMs)!==null&&o!==void 0?o:ro,now:i}),a=new Map;let c=0;async function p(h,u,d){const f=a.get(h);if(!f)return;const g=f.sentCount;f.sentCount=u;try{!await e.submit({fingerprint:h,occurrences:u,rich:d,frames:f.frames})&&f.sentCount===u&&(f.sentCount=g)}catch{f.sentCount===u&&(f.sentCount=g)}}function m(h){const u=Lr(h.type,h.value,h.stack),d=a.get(u);if(d){d.count+=1,d.lastAt=i();return}if(!l.take()){c+=1;return}if(a.size>=s){c+=1;return}const f=i();a.set(u,{count:1,firstAt:f,lastAt:f,sentCount:0,frames:yr(h.stack)});try{var g,v;const b=oo((g=e.buffer)===null||g===void 0?void 0:g.snapshot());(v=e.buffer)===null||v===void 0||v.add(no(h.original,f,b))}catch{}p(u,1,!0)}return{capture(h){try{const u=e.extract(h);u&&m(u)}catch{}},flush(){try{for(const[h,u]of a)u.count>u.sentCount&&p(h,u.count,!1)}catch{}},droppedCount:()=>c}}var bt={network:100,console:80,breadcrumbs:40},ao=18e4,lo=["log","info","warn","error","assert","debug"],Xt=["warn","error","assert"];function co(e){return e!==void 0&&Xt.includes(e)}var uo=Xt;function fo(e){return uo.includes(e)}function po(e){return e==="console"?"console":e==="fetch"||e==="xhr"||e==="beacon"?"network":"breadcrumbs"}function gt(e,t){return typeof e!="number"||!Number.isFinite(e)||e<1?t:Math.floor(e)}function ho(){const e=Math.random().toString(36).slice(2,8);let t=0;return()=>`${e}${(t++).toString(36)}`}var Yt=["network","console","breadcrumbs"];function mo(e,t){const n=e.length-t;if(n<=0)return e;const r=new Set;for(let o=0;o<e.length&&r.size<n;o+=1)co(e[o].crumb.level)||r.add(o);for(let o=0;o<e.length&&r.size<n;o+=1)r.has(o)||r.add(o);return e.filter((o,i)=>!r.has(i))}function bo(e={}){var t,n,r,o,i,s;const l={network:gt((t=e.budgets)===null||t===void 0?void 0:t.network,bt.network),console:gt((n=e.budgets)===null||n===void 0?void 0:n.console,bt.console),breadcrumbs:gt((r=e.budgets)===null||r===void 0?void 0:r.breadcrumbs,bt.breadcrumbs)},a=e.maxAgeMs===void 0?ao:e.maxAgeMs,c=e.beforeBreadcrumb,p=(o=e.now)!==null&&o!==void 0?o:Date.now,m=(i=e.mono)!==null&&i!==void 0?i:Pe,h=(s=e.nextId)!==null&&s!==void 0?s:ho(),u={network:[],console:[],breadcrumbs:[]};let d=0;function f(){if(typeof a!="number"||a<=0)return;const g=p()-a;for(const v of Yt){const b=u[v];b.length>0&&(u[v]=b.filter(y=>y.crumb.timestamp>=g))}}return{add(g){var v;let b=g;if(c)try{b=c(g)}catch{b=g}if(!b)return;const y={...b,id:(v=b.id)!==null&&v!==void 0?v:h(),timestamp:typeof b.timestamp=="number"?b.timestamp:p(),mono:typeof b.mono=="number"?b.mono:m()},k=po(y.category);u[k].push({crumb:y,seq:d++}),f();const E=u[k],C=l[k];E.length>C&&(u[k]=k==="console"?mo(E,C):E.slice(-C))},snapshot(){f();const g=[];for(const v of Yt)g.push(...u[v]);return g.sort((v,b)=>(typeof v.crumb.mono=="number"?v.crumb.mono:v.crumb.timestamp)-(typeof b.crumb.mono=="number"?b.crumb.mono:b.crumb.timestamp)||v.seq-b.seq),g.map(v=>v.crumb)},clear(){u.network=[],u.console=[],u.breadcrumbs=[],d=0}}}function go(e){var t,n;const r=lt(e);if(!r||!r.location)return;const o=r.location.replace(/\?[^:]*/,""),i=(t=o.match(/^(.*):(\d+):\d+$/))!==null&&t!==void 0?t:o.match(/^(.*):(\d+)$/);if(!i)return;const s=(n=i[1])!==null&&n!==void 0?n:"",l=Number(i[2]);if(!(!s||!Number.isFinite(l)))return{file:s,line:l}}function vo(e,t=0){if(typeof e!="string"||e.length===0)return;const n=[];for(const r of e.split(`
4
+ `)){const o=go(r.trim());o&&n.push(o)}return n[t]}var Ta=1;function yo(e,t,n,r){const o=[];for(const i of n){const s=t[i];if(typeof s!="function")continue;const l=fo(i),a=(...c)=>{let p;if(l)try{p=vo(new Error().stack,1)}catch{p=void 0}try{i==="assert"?c[0]||e.add(Gt("assert",c.slice(1),r(),p)):e.add(Gt(i,c,r(),p))}catch{}return s.apply(t,c)};t[i]=a,o.push(()=>{t[i]=s})}return()=>{for(const i of o)i()}}var So=3e5;function wo(e,t){try{return e.open(t,"fixback-connect","popup,width=480,height=680,menubar=no,toolbar=no,location=yes")}catch{return null}}function xo(e,t){const n=Hr(t.connectUrl,{key:t.key,returnUrl:t.returnUrl}),r=wo(e,n);if(!r){try{e.location.assign(n)}catch{}return Promise.resolve({kind:"redirected"})}return new Promise(o=>{let i=!1;const s=p=>{i||(i=!0,e.removeEventListener("message",l),clearInterval(a),clearTimeout(c),o(p))},l=p=>{const m=jr(p.data);if(m){try{r.close()}catch{}s({kind:"code",code:m})}};e.addEventListener("message",l);const a=setInterval(()=>{try{r.closed&&s({kind:"cancelled"})}catch{}},400),c=setTimeout(()=>s({kind:"cancelled"}),So)})}function ko(e){try{const t=new URL(e.location.href).searchParams.get($t);return t&&t.length>0?t:null}catch{return null}}function Co(e){try{const t=new URL(e.location.href);if(!t.searchParams.has("fixback"))return;t.searchParams.delete($t),e.history.replaceState(e.history.state,"",t.toString())}catch{}}function Mo(){try{const e=globalThis.localStorage,t=e.getItem(Bt);if(t)return t;const n=zt();return e.setItem(Bt,n),n}catch{return zt()}}function Eo(e){const t=e,n=t.error;if(n&&typeof n=="object"){const o=n;return{type:ae(o.name)||"Error",value:ae(o.message)||ae(t.message),stack:typeof o.stack=="string"?o.stack:void 0,original:n}}const r=ae(t.message);return r?{type:"Error",value:r,original:r}:null}function Io(e){const t=e.reason;if(t&&typeof t=="object"){const r=t;return{type:ae(r.name)||"UnhandledRejection",value:ae(r.message)||ae(t),stack:typeof r.stack=="string"?r.stack:void 0,original:t}}const n=ae(t);return{type:"UnhandledRejection",value:n,original:t!=null?t:n}}function _o(e){return e.type==="unhandledrejection"?Io(e):Eo(e)}var Ro="#e5484d";function Kt(e,t,n,r){return{x:Math.round(Math.min(e,n)),y:Math.round(Math.min(t,r)),width:Math.round(Math.abs(n-e)),height:Math.round(Math.abs(r-t))}}function To(e,t,n,r,o=14){const i=Math.atan2(r-t,n-e);return[{x:n,y:r},{x:n-o*Math.cos(i-Math.PI/6),y:r-o*Math.sin(i-Math.PI/6)},{x:n-o*Math.cos(i+Math.PI/6),y:r-o*Math.sin(i+Math.PI/6)}]}function Lo(e){const t={};return e.element&&(t.element=e.element),e.region&&(t.region=e.region),e.marks&&e.marks.length>0&&(t.marks=e.marks.slice()),Object.keys(t).length>0?t:void 0}function Jt(e,t,n){var r;const o={},i=e.innerWidth;typeof i=="number"&&i>0&&(o.viewportWidth=Math.round(i));const s=e.innerHeight;typeof s=="number"&&s>0&&(o.viewportHeight=Math.round(s));const l=(r=e.navigator)===null||r===void 0?void 0:r.userAgent;return typeof l=="string"&&l.length>0&&(o.browser=l),t.length>0&&(o.sdkVersion=t),n&&n.length>0&&(o.release=n),o}function Zt(e){var t,n;const r={},o=(t=e.comment)===null||t===void 0?void 0:t.trim();o&&(r.comment=o),e.url&&(r.url=e.url),e.environment&&Object.keys(e.environment).length>0&&(r.environment=e.environment);const i=(n=e.deployEnvironment)===null||n===void 0?void 0:n.trim();i&&(r.deployEnvironment=i);const s=Lo({element:e.element,region:e.region,marks:e.marks});return s&&(r.annotation=s),e.trace&&e.trace.length>0&&(r.trace=e.trace),r}var No="replay",Oo=3e4,Ao=new Or;async function Qt(e,t,n={}){var r,o,i,s;const l=(r=t.content.source)!==null&&r!==void 0?r:"reporter",a=l==="error",c=(o=n.backoff)!==null&&o!==void 0?o:Ao;if(a&&c.isPaused())return{ok:!1,reason:"backpressure",retryAfterSeconds:c.retryAfterSeconds()};const p=(i=n.fetch)!==null&&i!==void 0?i:Ue();if(!p)return{ok:!1,reason:"unreachable"};const m={key:t.key,...Ut(t.identity),...t.content,source:l},h=new FormData;if(h.append("payload",JSON.stringify(m)),t.replay&&t.replay.events.length>0)try{const v=JSON.stringify(t.replay.events);h.append(No,new Blob([v],{type:"application/json"}),"replay.json")}catch{}const u=(s=n.timeoutMs)!==null&&s!==void 0?s:Oo;let d,f;try{const v=p(Pr(e),{method:"POST",body:h});f=u>0?await Promise.race([v,new Promise((b,y)=>{d=setTimeout(()=>y(new Error("fixback: submission timed out")),u)})]):await v}catch{return{ok:!1,reason:"unreachable"}}finally{d!==void 0&&clearTimeout(d)}if(!f.ok)return a&&f.status===429?{ok:!1,reason:"backpressure",retryAfterSeconds:c.hold(Dr(f,"Retry-After"))}:{ok:!1,reason:"refused",status:f.status};try{var g;return{ok:!0,feedback:await((g=f.json)===null||g===void 0?void 0:g.call(f))}}catch{return{ok:!0,feedback:null}}}var Be="0.6.0",Do={destroy:()=>{},droppedCount:()=>0};function Fo(e){var t,n,r,o,i,s;const l=(t=e.win)!==null&&t!==void 0?t:typeof window!="undefined"?window:void 0;if(!l)return Do;const a=l,c=(n=(r=e.doc)!==null&&r!==void 0?r:a.document)!==null&&n!==void 0?n:typeof document!="undefined"?document:void 0,p=(o=e.sdkVersion)!==null&&o!==void 0?o:Be,m=(i=(s=e.deps)===null||s===void 0?void 0:s.submitReport)!==null&&i!==void 0?i:Qt;function h(v){var b,y;return{...Zt({url:(b=a.location)===null||b===void 0?void 0:b.href,environment:Jt(a,p,e.release),deployEnvironment:e.deployEnvironment,trace:v.rich?(y=e.buffer)===null||y===void 0?void 0:y.snapshot():void 0}),source:"error",errorSignature:v.fingerprint,occurrences:v.occurrences,...v.rich&&v.frames.length>0?{errorFrames:v.frames}:{}}}const u=so({extract:_o,buffer:e.buffer,burstCapacity:e.burstCapacity,burstRefillMs:e.burstRefillMs,maxDistinct:e.maxDistinct,now:e.now,submit:async v=>{var b,y,k;const E=Ft(h(v),{hook:e.beforeSend,scrub:e.scrub});if(!E)return!0;const C=v.rich&&(b=(y=e.replay)===null||y===void 0?void 0:y.snapshot())!==null&&b!==void 0?b:null;return(await m(e.apiUrl,{key:e.key,identity:(k=e.getIdentity)===null||k===void 0?void 0:k.call(e),content:E,replay:C})).ok}}),d=v=>u.capture(v),f=()=>u.flush(),g=()=>{(c==null?void 0:c.visibilityState)==="hidden"&&f()};return a.addEventListener("error",d,!0),a.addEventListener("unhandledrejection",d,!0),a.addEventListener("pagehide",f),c==null||c.addEventListener("visibilitychange",g),{destroy:()=>{a.removeEventListener("error",d,!0),a.removeEventListener("unhandledrejection",d,!0),a.removeEventListener("pagehide",f),c==null||c.removeEventListener("visibilitychange",g)},droppedCount:u.droppedCount}}var Po=`
5
5
  :host {
6
6
  /* Vendored Signal tokens (packages/ui/src/tokens.css). */
7
7
  --fb-color-accent: #2f6fed;
@@ -243,201 +243,7 @@
243
243
  animation: none;
244
244
  }
245
245
  }
246
- `,Tr="data-fixback-root",nt="fixback:launch",Ni="fixback:welcomed:",Oi=5e3,Ai=280,Di='<svg class="fb-launcher__icon" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><path fill="currentColor" d="M3.25 2h9.5A1.25 1.25 0 0 1 14 3.25v6.5A1.25 1.25 0 0 1 12.75 11H7.6l-3.19 2.55A.6.6 0 0 1 3.4 13.1V11h-.15A1.25 1.25 0 0 1 2 9.75v-6.5A1.25 1.25 0 0 1 3.25 2Z"/></svg>',Fi='<svg class="fb-launcher__tuck-icon" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M6 4l4 4-4 4"/></svg>';function Pi(e,t){const r=Ni+(t!=null?t:"default");try{const n=e==null?void 0:e.localStorage;return n?n.getItem(r)==="1"?!1:(n.setItem(r,"1"),!0):!0}catch{return!0}}function Bi(e,t={}){const r=e.ownerDocument,n=r.defaultView,o=r.querySelector(`[${Tr}]`);o&&o.remove();const i=r.createElement("div");i.setAttribute(Tr,""),i.style.cssText="position:fixed;right:20px;bottom:20px;z-index:2147483000;margin:0;padding:0;border:0;",t.reduceMotion&&i.setAttribute("data-fb-reduce-motion","true");const l=i.attachShadow({mode:"open"}),c=r.createElement("style");c.textContent=Li,l.appendChild(c);const s=r.createElement("div");s.className="fb-launcher";const a=r.createElement("button");a.type="button",a.className="fb-launcher__button",a.setAttribute("aria-haspopup","dialog"),a.setAttribute("aria-label","Give feedback"),a.innerHTML=`${Di}<span class="fb-launcher__label">Feedback</span>`,a.addEventListener("click",()=>{i.dispatchEvent(new CustomEvent(nt,{bubbles:!0,composed:!0}))});const f=r.createElement("span");f.className="fb-launcher__divider",f.setAttribute("aria-hidden","true");const p=r.createElement("button");p.type="button",p.className="fb-launcher__tuck",p.setAttribute("data-fb-tuck",""),p.setAttribute("aria-label","Hide feedback button"),p.title="Tuck away",p.innerHTML=Fi,s.append(a,f,p);const h=r.createElement("div");h.className="fb-launcher__peekzone",h.setAttribute("aria-hidden","true");const d=r.createElement("div");d.className="fb-launcher__nub",d.setAttribute("role","button"),d.setAttribute("tabindex","0"),d.setAttribute("aria-label","Show feedback button"),l.append(s,h,d);let u=!1,m=!1,b,g,v;const y=()=>{u?i.setAttribute("data-fb-hidden","true"):i.removeAttribute("data-fb-hidden"),u&&m?i.setAttribute("data-fb-peeking","true"):i.removeAttribute("data-fb-peeking"),p.setAttribute("aria-label",u?"Show feedback button":"Hide feedback button"),p.title=u?"Bring back":"Tuck away"},x=()=>{g!==void 0&&(clearTimeout(g),g=void 0),s.classList.remove("fb-launcher--pulse"),v==null||v.remove(),v=void 0},_=()=>{b!==void 0&&(clearTimeout(b),b=void 0),m||(m=!0,y())},R=()=>{b!==void 0&&clearTimeout(b),b=setTimeout(()=>{b=void 0,m=!1,y()},Ai)};for(const w of[s,h,d])w.addEventListener("mouseenter",_),w.addEventListener("mouseleave",R);const I=()=>{b!==void 0&&(clearTimeout(b),b=void 0),u=!1,m=!1,y()},D=()=>{x(),u=!0,m=!1,y()};return p.addEventListener("click",()=>{u?I():D()}),d.addEventListener("click",I),d.addEventListener("keydown",w=>{(w.key==="Enter"||w.key===" "||w.key==="Spacebar")&&(w.preventDefault(),I())}),Pi(n,t.key)&&(v=r.createElement("div"),v.className="fb-launcher__welcome",v.setAttribute("role","status"),v.innerHTML="You're all set — tap <strong>Feedback</strong> any time to report something.",l.appendChild(v),t.reduceMotion||s.classList.add("fb-launcher--pulse"),g=setTimeout(x,Oi)),e.appendChild(i),{host:i,dispose:()=>{b!==void 0&&clearTimeout(b),g!==void 0&&clearTimeout(g)}}}function Ui(e){e.dispose(),e.host.remove()}var zi=`
247
- :host {
248
- --fb-color-accent: #2f6fed;
249
- --fb-color-accent-hover: #245fd0;
250
- --fb-color-on-emphasis: #ffffff;
251
- --fb-color-ink: #0f1720;
252
- --fb-color-text: #1a2530;
253
- --fb-color-muted: #5a6875;
254
- --fb-color-faint: #9aa7b2;
255
- --fb-color-hint: #b7c1cb;
256
- --fb-color-border: #dce3ea;
257
- --fb-color-border-soft: #e6ebf0;
258
- --fb-color-surface: #ffffff;
259
- --fb-color-card: #f6f8fa;
260
- --fb-color-accent-bg: #eaf1fe;
261
- --fb-color-success: #2f9e5b;
262
- --fb-font-sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto,
263
- Helvetica, Arial, sans-serif;
264
- --fb-font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas,
265
- monospace;
266
- all: initial;
267
- }
268
-
269
- *, *::before, *::after { box-sizing: border-box; }
270
-
271
- .fb-ob-backdrop {
272
- position: fixed;
273
- inset: 0;
274
- z-index: 2147483010;
275
- display: flex;
276
- align-items: center;
277
- justify-content: center;
278
- padding: 24px;
279
- background: rgba(15, 23, 32, 0.55);
280
- backdrop-filter: blur(3px);
281
- font-family: var(--fb-font-sans);
282
- color: var(--fb-color-text);
283
- animation: fb-ob-fade 0.25s ease both;
284
- }
285
-
286
- .fb-ob-panel {
287
- width: 400px;
288
- max-width: 100%;
289
- background: var(--fb-color-surface);
290
- border-radius: 16px;
291
- box-shadow: 0 30px 70px rgba(15, 40, 70, 0.4);
292
- overflow: hidden;
293
- animation: fb-ob-pop 0.32s cubic-bezier(0.2, 0.8, 0.3, 1) both;
294
- }
295
-
296
- .fb-ob-head {
297
- padding: 22px 24px 0;
298
- display: flex;
299
- align-items: center;
300
- gap: 10px;
301
- }
302
- .fb-ob-mark {
303
- width: 22px;
304
- height: 22px;
305
- border-radius: 6px;
306
- background: var(--fb-color-accent);
307
- flex: none;
308
- display: flex;
309
- align-items: center;
310
- justify-content: center;
311
- }
312
- .fb-ob-mark::after {
313
- content: "";
314
- width: 7px;
315
- height: 7px;
316
- border-radius: 2px;
317
- background: #fff;
318
- }
319
- .fb-ob-brand { font-size: 15px; font-weight: 600; color: var(--fb-color-ink); }
320
- .fb-ob-chip {
321
- margin-left: auto;
322
- font-family: var(--fb-font-mono);
323
- font-size: 10px;
324
- color: #8a97a3;
325
- border: 1px solid var(--fb-color-border-soft);
326
- border-radius: 6px;
327
- padding: 2px 7px;
328
- }
329
-
330
- .fb-ob-body { padding: 16px 24px 8px; }
331
- .fb-ob-title {
332
- font-size: 19px;
333
- font-weight: 700;
334
- color: var(--fb-color-ink);
335
- letter-spacing: -0.01em;
336
- }
337
- .fb-ob-lede {
338
- font-size: 13.5px;
339
- color: var(--fb-color-muted);
340
- line-height: 1.5;
341
- margin: 7px 0 0;
342
- }
343
- .fb-ob-lede strong { color: var(--fb-color-text); }
344
-
345
- .fb-ob-card {
346
- margin: 16px 0;
347
- padding: 13px 14px;
348
- background: var(--fb-color-card);
349
- border: 1px solid var(--fb-color-border-soft);
350
- border-radius: 10px;
351
- display: flex;
352
- flex-direction: column;
353
- gap: 10px;
354
- }
355
- .fb-ob-row { display: flex; align-items: center; gap: 10px; }
356
- .fb-ob-row + .fb-ob-row {
357
- border-top: 1px solid #eef2f6;
358
- padding-top: 10px;
359
- }
360
- .fb-ob-rowlabel {
361
- font-family: var(--fb-font-mono);
362
- font-size: 10px;
363
- color: var(--fb-color-faint);
364
- width: 70px;
365
- flex: none;
366
- }
367
- .fb-ob-site { font-size: 13px; color: var(--fb-color-text); font-weight: 500; }
368
- .fb-ob-tier {
369
- font-size: 11px;
370
- font-weight: 600;
371
- color: var(--fb-color-accent);
372
- background: var(--fb-color-accent-bg);
373
- padding: 3px 9px;
374
- border-radius: 6px;
375
- }
376
- .fb-ob-tiernote { font-size: 11.5px; color: #8a97a3; }
377
-
378
- .fb-ob-fieldlabel {
379
- display: block;
380
- font-family: var(--fb-font-mono);
381
- font-size: 10px;
382
- letter-spacing: 0.05em;
383
- text-transform: uppercase;
384
- color: var(--fb-color-faint);
385
- margin-bottom: 6px;
386
- }
387
- .fb-ob-fields { display: flex; gap: 8px; }
388
- .fb-ob-input {
389
- height: 38px;
390
- padding: 0 12px;
391
- border: 1px solid var(--fb-color-border);
392
- border-radius: 9px;
393
- font-family: inherit;
394
- font-size: 13px;
395
- color: var(--fb-color-text);
396
- outline: none;
397
- min-width: 0;
398
- }
399
- .fb-ob-input:focus { border-color: var(--fb-color-accent); }
400
- .fb-ob-name { flex: 1; }
401
- .fb-ob-email { flex: 1.3; font-family: var(--fb-font-mono); font-size: 12.5px; color: var(--fb-color-muted); }
402
-
403
- .fb-ob-privacy {
404
- display: flex;
405
- align-items: flex-start;
406
- gap: 8px;
407
- margin-top: 14px;
408
- font-size: 11.5px;
409
- color: #8a97a3;
410
- line-height: 1.5;
411
- }
412
- .fb-ob-privacy svg { flex: none; margin-top: 1px; }
413
- .fb-ob-privacy strong { color: var(--fb-color-muted); }
414
-
415
- .fb-ob-foot { padding: 16px 24px 22px; }
416
- .fb-ob-confirm {
417
- width: 100%;
418
- height: 44px;
419
- border: 0;
420
- border-radius: 11px;
421
- background: var(--fb-color-accent);
422
- color: var(--fb-color-on-emphasis);
423
- font-family: inherit;
424
- font-size: 14px;
425
- font-weight: 600;
426
- cursor: pointer;
427
- }
428
- .fb-ob-confirm:hover { background: var(--fb-color-accent-hover); }
429
- .fb-ob-confirm:disabled { opacity: 0.6; cursor: default; }
430
-
431
- @keyframes fb-ob-fade { from { opacity: 0; } to { opacity: 1; } }
432
- @keyframes fb-ob-pop {
433
- from { opacity: 0; transform: translateY(8px) scale(0.98); }
434
- to { opacity: 1; transform: none; }
435
- }
436
-
437
- @media (prefers-reduced-motion: reduce) {
438
- .fb-ob-backdrop, .fb-ob-panel { animation: none; }
439
- }
440
- `,$i="data-fixback-onboard",Wi={invited:"Invited tester",internal:"Internal",public:"Public"},Hi={invited:"reviewed before it ships",internal:"ships straight through",public:"tracked, not auto-shipped"},ji='<svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="#2f9e5b" stroke-width="1.5" aria-hidden="true"><path d="M8 1.8 13.5 4v3.5c0 3.6-2.4 5.6-5.5 6.7C4.9 13.1 2.5 11.1 2.5 7.5V4z"/><path d="M5.8 8 7.3 9.5 10.3 6.2"/></svg>';function z(e,t,r={},n=[]){const o=e.createElement(t);for(const[i,l]of Object.entries(r))l!==void 0&&o.setAttribute(i,l);for(const i of n)o.appendChild(typeof i=="string"?e.createTextNode(i):i);return o}function ot(e){const t=e.trim();return t.length>0?t:void 0}function Gi(e){var t,r,n,o,i,l;const c=(t=e.target)!==null&&t!==void 0?t:document.body,s=(r=e.doc)!==null&&r!==void 0?r:c.ownerDocument;(n=s.querySelector("[data-fixback-onboard]"))===null||n===void 0||n.remove();const a=z(s,"div",{[$i]:""}),f=a.attachShadow({mode:"open"}),p=s.createElement("style");p.textContent=zi,f.appendChild(p);const h=z(s,"div",{class:"fb-ob-head"},[z(s,"span",{class:"fb-ob-mark"}),z(s,"span",{class:"fb-ob-brand"},["Fixback"]),z(s,"span",{class:"fb-ob-chip"},["invite link"])]),d=z(s,"p",{class:"fb-ob-lede"},["You've been invited to give feedback on ",z(s,"strong",{},[e.origin]),". Point, mark up, send."]),u=z(s,"div",{class:"fb-ob-card"},[z(s,"div",{class:"fb-ob-row"},[z(s,"span",{class:"fb-ob-rowlabel"},["SITE"]),z(s,"span",{class:"fb-ob-site"},[e.origin])]),z(s,"div",{class:"fb-ob-row"},[z(s,"span",{class:"fb-ob-rowlabel"},["ACCESS"]),z(s,"span",{class:"fb-ob-tier"},[Wi[e.tier]]),z(s,"span",{class:"fb-ob-tiernote"},[Hi[e.tier]])])]),m=z(s,"input",{class:"fb-ob-input fb-ob-name",type:"text","aria-label":"Name",placeholder:"Name"}),b=z(s,"input",{class:"fb-ob-input fb-ob-email",type:"email","aria-label":"Email",placeholder:"email@example.com"});!((o=e.defaults)===null||o===void 0)&&o.name&&(m.value=e.defaults.name),!((i=e.defaults)===null||i===void 0)&&i.email&&(b.value=e.defaults.email);const g=z(s,"div",{class:"fb-ob-privacy"}),v=z(s,"span");v.innerHTML=ji,g.appendChild((l=v.firstChild)!==null&&l!==void 0?l:s.createTextNode("")),g.appendChild(z(s,"span",{},[z(s,"strong",{},["Private by default."])," Anything you type is masked before it leaves your browser."]));const y=z(s,"div",{class:"fb-ob-body"},[z(s,"div",{class:"fb-ob-title"},["You're invited to give feedback"]),d,u,z(s,"label",{class:"fb-ob-fieldlabel",for:"fb-ob-name-input"},["Continue as"]),z(s,"div",{class:"fb-ob-fields"},[m,b]),g]);m.id="fb-ob-name-input";const x=z(s,"button",{type:"button",class:"fb-ob-confirm"},["Start giving feedback"]),_=z(s,"div",{class:"fb-ob-backdrop"},[z(s,"div",{class:"fb-ob-panel",role:"dialog","aria-modal":"true","aria-label":"Fixback invite"},[h,y,z(s,"div",{class:"fb-ob-foot"},[x])])]);f.appendChild(_);let R=!1;return x.addEventListener("click",()=>{if(R)return;R=!0,x.disabled=!0;const I={...ot(m.value)?{name:ot(m.value)}:{},...ot(b.value)?{email:ot(b.value)}:{}};e.onConfirm(I)}),c.appendChild(a),{host:a,destroy:()=>a.remove()}}var Vi="http://www.w3.org/2000/svg",Bt="3",Lr=4,qi='600 16px "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif';function Xi(e){var t,r;const n=(t=e.doc)!==null&&t!==void 0?t:document,{svg:o,textInput:i}=e,l=(r=e.color)!==null&&r!==void 0?r:ei;let c="arrow",s=e.initialMarks?e.initialMarks.slice():[],a=null,f=!1,p=null,h=!1;function d(){var w;(w=e.onChange)===null||w===void 0||w.call(e,s.slice())}function u(w){return{x:Math.round(w.clientX),y:Math.round(w.clientY)}}function m(w){const B=typeof w.composedPath=="function"?w.composedPath():[w.target];for(const L of B){if(L===n)break;if(L instanceof Element){const C=L.tagName;if(C==="BUTTON"||C==="INPUT"||C==="TEXTAREA")return!0}}return!1}function b(w){return w.type==="pen"?w.points.length>1:w.type==="text"?w.text.trim().length>0:Math.abs(w.x1-w.x0)>Lr||Math.abs(w.y1-w.y0)>Lr}function g(w){if(h||f||m(w))return;const B=u(w);if(c==="text"){x(B);return}w.cancelable&&w.preventDefault(),f=!0,a=c==="pen"?{type:"pen",points:[B],color:l}:{type:c,x0:B.x,y0:B.y,x1:B.x,y1:B.y,color:l},D()}function v(w){if(h||!f||!a)return;const B=u(w);a.type==="pen"?a={type:"pen",points:[...a.points,B],color:a.color}:a={...a,x1:B.x,y1:B.y},D()}function y(){if(h||!f)return;f=!1;const w=a;a=null,w&&b(w)&&(s=[...s,w],d()),D()}function x(w){p=w,i.value="",i.style.display="block",i.style.left=`${w.x}px`,i.style.top=`${w.y}px`,i.onkeydown=_,i.onblur=R,setTimeout(()=>{try{i.focus()}catch{}},0)}function _(w){w.key==="Enter"?(w.preventDefault(),w.stopPropagation(),R()):w.key==="Escape"&&(w.preventDefault(),w.stopPropagation(),I())}function R(){if(!p)return;const w=i.value.trim(),B=p;I(),w.length>0&&(s=[...s,{type:"text",x:B.x,y:B.y,text:w,color:l}],d(),D())}function I(){p=null,i.onkeydown=null,i.onblur=null,i.value="",i.style.display="none"}function D(){for(;o.firstChild;)o.removeChild(o.firstChild);for(const w of s)o.appendChild(Nr(n,w));a&&o.appendChild(Nr(n,a))}function N(){h||(h=!0,n.removeEventListener("mousedown",g,!0),n.removeEventListener("mousemove",v,!0),n.removeEventListener("mouseup",y,!0),I())}return n.addEventListener("mousedown",g,!0),n.addEventListener("mousemove",v,!0),n.addEventListener("mouseup",y,!0),D(),{setTool:w=>{c=w},getTool:()=>c,undo:()=>{s.length!==0&&(s=s.slice(0,-1),d(),D())},marks:()=>s.slice(),stop:N}}function Nr(e,t){switch(t.type){case"box":return ke(e,"rect",{x:String(Math.min(t.x0,t.x1)),y:String(Math.min(t.y0,t.y1)),width:String(Math.abs(t.x1-t.x0)),height:String(Math.abs(t.y1-t.y0)),rx:"2",fill:"none",stroke:t.color,"stroke-width":Bt});case"pen":return ke(e,"polyline",{points:t.points.map(r=>`${r.x},${r.y}`).join(" "),fill:"none",stroke:t.color,"stroke-width":Bt,"stroke-linecap":"round","stroke-linejoin":"round"});case"text":{const r=ke(e,"text",{x:String(t.x),y:String(t.y),fill:t.color,style:`font:${qi}`});return r.textContent=t.text,r}case"arrow":{const r=ke(e,"g",{});r.appendChild(ke(e,"line",{x1:String(t.x0),y1:String(t.y0),x2:String(t.x1),y2:String(t.y1),stroke:t.color,"stroke-width":Bt,"stroke-linecap":"round"}));const n=ti(t.x0,t.y0,t.x1,t.y1);return r.appendChild(ke(e,"polygon",{points:n.map(o=>`${o.x},${o.y}`).join(" "),fill:t.color})),r}}}function ke(e,t,r){const n=e.createElementNS(Vi,t);for(const[o,i]of Object.entries(r))n.setAttribute(o,i);return n}var Yi=12;function Ki(e){var t,r;const n=(t=e.doc)!==null&&t!==void 0?t:document,o=(r=e.minSize)!==null&&r!==void 0?r:Yi;let i=null,l=!1;function c(h){l||i||(i={x:h.clientX,y:h.clientY},h.cancelable&&h.preventDefault())}function s(h){var d;l||!i||(d=e.onProgress)===null||d===void 0||d.call(e,gr(i.x,i.y,h.clientX,h.clientY))}function a(h){if(l||!i)return;const d=gr(i.x,i.y,h.clientX,h.clientY);if(i=null,p(),d.width<o||d.height<o){var u;(u=e.onCancel)===null||u===void 0||u.call(e);return}e.onComplete(d)}function f(h){if(!l&&h.key==="Escape"){var d;h.preventDefault(),p(),(d=e.onCancel)===null||d===void 0||d.call(e)}}function p(){l||(l=!0,n.removeEventListener("mousedown",c,!0),n.removeEventListener("mousemove",s,!0),n.removeEventListener("mouseup",a,!0),n.removeEventListener("keydown",f,!0),i=null)}return n.addEventListener("mousedown",c,!0),n.addEventListener("mousemove",s,!0),n.addEventListener("mouseup",a,!0),n.addEventListener("keydown",f,!0),{stop:p}}var Ji=`
246
+ `,en="data-fixback-root",ze="fixback:launch",Uo="fixback:welcomed:",$o=5e3,Bo=280,zo='<svg class="fb-launcher__icon" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><path fill="currentColor" d="M3.25 2h9.5A1.25 1.25 0 0 1 14 3.25v6.5A1.25 1.25 0 0 1 12.75 11H7.6l-3.19 2.55A.6.6 0 0 1 3.4 13.1V11h-.15A1.25 1.25 0 0 1 2 9.75v-6.5A1.25 1.25 0 0 1 3.25 2Z"/></svg>',Wo='<svg class="fb-launcher__tuck-icon" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M6 4l4 4-4 4"/></svg>';function Ho(e,t){const n=Uo+(t!=null?t:"default");try{const r=e==null?void 0:e.localStorage;return r?r.getItem(n)==="1"?!1:(r.setItem(n,"1"),!0):!0}catch{return!0}}function jo(e,t={}){const n=e.ownerDocument,r=n.defaultView,o=n.querySelector(`[${en}]`);o&&o.remove();const i=n.createElement("div");i.setAttribute(en,""),i.style.cssText="position:fixed;right:20px;bottom:20px;z-index:2147483000;margin:0;padding:0;border:0;",t.reduceMotion&&i.setAttribute("data-fb-reduce-motion","true");const s=i.attachShadow({mode:"open"}),l=n.createElement("style");l.textContent=Po,s.appendChild(l);const a=n.createElement("div");a.className="fb-launcher";const c=n.createElement("button");c.type="button",c.className="fb-launcher__button",c.setAttribute("aria-haspopup","dialog"),c.setAttribute("aria-label","Give feedback"),c.innerHTML=`${zo}<span class="fb-launcher__label">Feedback</span>`,c.addEventListener("click",()=>{i.dispatchEvent(new CustomEvent(ze,{bubbles:!0,composed:!0}))});const p=n.createElement("span");p.className="fb-launcher__divider",p.setAttribute("aria-hidden","true");const m=n.createElement("button");m.type="button",m.className="fb-launcher__tuck",m.setAttribute("data-fb-tuck",""),m.setAttribute("aria-label","Hide feedback button"),m.title="Tuck away",m.innerHTML=Wo,a.append(c,p,m);const h=n.createElement("div");h.className="fb-launcher__peekzone",h.setAttribute("aria-hidden","true");const u=n.createElement("div");u.className="fb-launcher__nub",u.setAttribute("role","button"),u.setAttribute("tabindex","0"),u.setAttribute("aria-label","Show feedback button"),s.append(a,h,u);let d=!1,f=!1,g,v,b;const y=()=>{d?i.setAttribute("data-fb-hidden","true"):i.removeAttribute("data-fb-hidden"),d&&f?i.setAttribute("data-fb-peeking","true"):i.removeAttribute("data-fb-peeking"),m.setAttribute("aria-label",d?"Show feedback button":"Hide feedback button"),m.title=d?"Bring back":"Tuck away"},k=()=>{v!==void 0&&(clearTimeout(v),v=void 0),a.classList.remove("fb-launcher--pulse"),b==null||b.remove(),b=void 0},E=()=>{g!==void 0&&(clearTimeout(g),g=void 0),f||(f=!0,y())},C=()=>{g!==void 0&&clearTimeout(g),g=setTimeout(()=>{g=void 0,f=!1,y()},Bo)};for(const x of[a,h,u])x.addEventListener("mouseenter",E),x.addEventListener("mouseleave",C);const T=()=>{g!==void 0&&(clearTimeout(g),g=void 0),d=!1,f=!1,y()},w=()=>{k(),d=!0,f=!1,y()};return m.addEventListener("click",()=>{d?T():w()}),u.addEventListener("click",T),u.addEventListener("keydown",x=>{(x.key==="Enter"||x.key===" "||x.key==="Spacebar")&&(x.preventDefault(),T())}),Ho(r,t.key)&&(b=n.createElement("div"),b.className="fb-launcher__welcome",b.setAttribute("role","status"),b.innerHTML="You're all set — tap <strong>Feedback</strong> any time to report something.",s.appendChild(b),t.reduceMotion||a.classList.add("fb-launcher--pulse"),v=setTimeout(k,$o)),e.appendChild(i),{host:i,dispose:()=>{g!==void 0&&clearTimeout(g),v!==void 0&&clearTimeout(v)}}}function Go(e){e.dispose(),e.host.remove()}var Vo=["data-fixback-root","data-fixback-overlay"];function vt(e){let t=e instanceof Node?e:null;for(;t;){if(t instanceof Element){for(const r of Vo)if(t.hasAttribute(r))return!0}const n=t.getRootNode();if(n instanceof ShadowRoot&&n!==t){t=n.host;continue}t=t.parentNode}return!1}function tn(e){const t=globalThis.CSS;return t!=null&&t.escape?t.escape(e):e.replace(/[^\w-]/g,n=>`\\${n}`)}function qo(e){let t=1,n=e.previousElementSibling;for(;n;)n.tagName===e.tagName&&(t+=1),n=n.previousElementSibling;return t}function nn(e){if(e.id)return`#${tn(e.id)}`;const t=[];let n=e;for(;n&&n.tagName.toLowerCase()!=="html";){if(n.id){t.unshift(`#${tn(n.id)}`);break}const r=n.tagName.toLowerCase(),o=n.parentElement;if(o){const i=Array.from(o.children).filter(s=>s.tagName===n.tagName);t.unshift(i.length>1?`${r}:nth-of-type(${qo(n)})`:r)}else t.unshift(r);n=o}return t.join(" > ")}function Xo(e){const t=e.tagName.toLowerCase();if(e.id)return`${t}#${e.id}`;const n=e.classList[0];return n?`${t}.${n}`:t}function Yo(e){const t=[];let n=e;for(;n;)t.unshift(Xo(n)),n=n.parentElement;return t.join(" > ")}function Ko(e){const t=e.getBoundingClientRect();return{x:Math.round(t.x),y:Math.round(t.y),width:Math.round(t.width),height:Math.round(t.height)}}function Jo(e){return{selector:nn(e),domPath:Yo(e),tag:e.tagName.toLowerCase(),rect:Ko(e)}}function Zo(e){var t,n;const r=(t=e.doc)!==null&&t!==void 0?t:document,o=(n=e.ignore)!==null&&n!==void 0?n:vt;let i=null,s=!1;function l(h){var u;const d=(u=(typeof h.composedPath=="function"?h.composedPath():[])[0])!==null&&u!==void 0?u:h.target;return d instanceof Element?o(d)?null:d:null}function a(h){var u;s||(i=l(h),(u=e.onHover)===null||u===void 0||u.call(e,i))}function c(h){var u;if(s)return;const d=(u=l(h))!==null&&u!==void 0?u:i;d&&(h.preventDefault(),h.stopPropagation(),m(),e.onPick(d))}function p(h){if(!s&&h.key==="Escape"){var u;h.preventDefault(),m(),(u=e.onCancel)===null||u===void 0||u.call(e)}}function m(){s||(s=!0,r.removeEventListener("mouseover",a,!0),r.removeEventListener("click",c,!0),r.removeEventListener("keydown",p,!0),i=null)}return r.addEventListener("mouseover",a,!0),r.addEventListener("click",c,!0),r.addEventListener("keydown",p,!0),{stop:m}}var Qo="http://www.w3.org/2000/svg",yt="3",rn=4,ei='600 16px "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif';function ti(e){var t,n;const r=(t=e.doc)!==null&&t!==void 0?t:document,{svg:o,textInput:i}=e,s=(n=e.color)!==null&&n!==void 0?n:Ro;let l="arrow",a=e.initialMarks?e.initialMarks.slice():[],c=null,p=!1,m=null,h=!1;function u(){var x;(x=e.onChange)===null||x===void 0||x.call(e,a.slice())}function d(x){return{x:Math.round(x.clientX),y:Math.round(x.clientY)}}function f(x){const D=typeof x.composedPath=="function"?x.composedPath():[x.target];for(const j of D){if(j===r)break;if(j instanceof Element){const R=j.tagName;if(R==="BUTTON"||R==="INPUT"||R==="TEXTAREA")return!0}}return!1}function g(x){return x.type==="pen"?x.points.length>1:x.type==="text"?x.text.trim().length>0:Math.abs(x.x1-x.x0)>rn||Math.abs(x.y1-x.y0)>rn}function v(x){if(h||p||f(x))return;const D=d(x);if(l==="text"){k(D);return}x.cancelable&&x.preventDefault(),p=!0,c=l==="pen"?{type:"pen",points:[D],color:s}:{type:l,x0:D.x,y0:D.y,x1:D.x,y1:D.y,color:s},w()}function b(x){if(h||!p||!c)return;const D=d(x);c.type==="pen"?c={type:"pen",points:[...c.points,D],color:c.color}:c={...c,x1:D.x,y1:D.y},w()}function y(){if(h||!p)return;p=!1;const x=c;c=null,x&&g(x)&&(a=[...a,x],u()),w()}function k(x){m=x,i.value="",i.style.display="block",i.style.left=`${x.x}px`,i.style.top=`${x.y}px`,i.onkeydown=E,i.onblur=C,setTimeout(()=>{try{i.focus()}catch{}},0)}function E(x){x.key==="Enter"?(x.preventDefault(),x.stopPropagation(),C()):x.key==="Escape"&&(x.preventDefault(),x.stopPropagation(),T())}function C(){if(!m)return;const x=i.value.trim(),D=m;T(),x.length>0&&(a=[...a,{type:"text",x:D.x,y:D.y,text:x,color:s}],u(),w())}function T(){m=null,i.onkeydown=null,i.onblur=null,i.value="",i.style.display="none"}function w(){for(;o.firstChild;)o.removeChild(o.firstChild);for(const x of a)o.appendChild(on(r,x));c&&o.appendChild(on(r,c))}function L(){h||(h=!0,r.removeEventListener("mousedown",v,!0),r.removeEventListener("mousemove",b,!0),r.removeEventListener("mouseup",y,!0),T())}return r.addEventListener("mousedown",v,!0),r.addEventListener("mousemove",b,!0),r.addEventListener("mouseup",y,!0),w(),{setTool:x=>{l=x},getTool:()=>l,undo:()=>{a.length!==0&&(a=a.slice(0,-1),u(),w())},marks:()=>a.slice(),stop:L}}function on(e,t){switch(t.type){case"box":return be(e,"rect",{x:String(Math.min(t.x0,t.x1)),y:String(Math.min(t.y0,t.y1)),width:String(Math.abs(t.x1-t.x0)),height:String(Math.abs(t.y1-t.y0)),rx:"2",fill:"none",stroke:t.color,"stroke-width":yt});case"pen":return be(e,"polyline",{points:t.points.map(n=>`${n.x},${n.y}`).join(" "),fill:"none",stroke:t.color,"stroke-width":yt,"stroke-linecap":"round","stroke-linejoin":"round"});case"text":{const n=be(e,"text",{x:String(t.x),y:String(t.y),fill:t.color,style:`font:${ei}`});return n.textContent=t.text,n}case"arrow":{const n=be(e,"g",{});n.appendChild(be(e,"line",{x1:String(t.x0),y1:String(t.y0),x2:String(t.x1),y2:String(t.y1),stroke:t.color,"stroke-width":yt,"stroke-linecap":"round"}));const r=To(t.x0,t.y0,t.x1,t.y1);return n.appendChild(be(e,"polygon",{points:r.map(o=>`${o.x},${o.y}`).join(" "),fill:t.color})),n}}}function be(e,t,n){const r=e.createElementNS(Qo,t);for(const[o,i]of Object.entries(n))r.setAttribute(o,i);return r}var ni=12;function ri(e){var t,n;const r=(t=e.doc)!==null&&t!==void 0?t:document,o=(n=e.minSize)!==null&&n!==void 0?n:ni;let i=null,s=!1;function l(h){s||i||(i={x:h.clientX,y:h.clientY},h.cancelable&&h.preventDefault())}function a(h){var u;s||!i||(u=e.onProgress)===null||u===void 0||u.call(e,Kt(i.x,i.y,h.clientX,h.clientY))}function c(h){if(s||!i)return;const u=Kt(i.x,i.y,h.clientX,h.clientY);if(i=null,m(),u.width<o||u.height<o){var d;(d=e.onCancel)===null||d===void 0||d.call(e);return}e.onComplete(u)}function p(h){if(!s&&h.key==="Escape"){var u;h.preventDefault(),m(),(u=e.onCancel)===null||u===void 0||u.call(e)}}function m(){s||(s=!0,r.removeEventListener("mousedown",l,!0),r.removeEventListener("mousemove",a,!0),r.removeEventListener("mouseup",c,!0),r.removeEventListener("keydown",p,!0),i=null)}return r.addEventListener("mousedown",l,!0),r.addEventListener("mousemove",a,!0),r.addEventListener("mouseup",c,!0),r.addEventListener("keydown",p,!0),{stop:m}}function oi(e){const{doc:t,refs:n,onChange:r}=e;let o=null,i=null,s=null,l=null,a="compose";const c={selectedElement:null,region:null,marks:[]};function p(w){a=w;const L=w!=="compose";n.panel.classList.toggle("is-marking",L),n.pickLayer.classList.toggle("is-visible",w==="picking"),n.captureLayer.classList.toggle("is-visible",w==="capturing"),n.drawLayer.classList.toggle("is-visible",w==="drawing"),n.pickBtn.classList.toggle("is-active",w==="picking"),n.captureBtn.classList.toggle("is-active",w==="capturing"||w==="drawing")}function m(w){if(!w){n.highlight.style.display="none";return}const L=w.getBoundingClientRect();n.highlight.style.display="block",n.highlight.style.left=`${L.left}px`,n.highlight.style.top=`${L.top}px`,n.highlight.style.width=`${L.width}px`,n.highlight.style.height=`${L.height}px`}function h(){o==null||o.stop(),o=null}function u(){n.highlight.style.display="none",h(),a==="picking"&&p("compose")}function d(){T(),p("picking"),o=e.startElementPicker({doc:t,onHover:m,onPick:w=>{c.selectedElement=Jo(w),u(),r()},onCancel:u})}function f(w){const L=n.selBox;if(!w){L.style.display="none";return}L.style.display="block",L.style.left=`${w.x}px`,L.style.top=`${w.y}px`,L.style.width=`${w.width}px`,L.style.height=`${w.height}px`}function g(){i==null||i.stop(),i=null}function v(w){n.drawFrame.style.left=`${w.x}px`,n.drawFrame.style.top=`${w.y}px`,n.drawFrame.style.width=`${w.width}px`,n.drawFrame.style.height=`${w.height}px`}function b(w){s==null||s.setTool(w);for(const[L,x]of n.drawTools)x.classList.toggle("is-active",L===w)}function y(w){n.undoBtn.disabled=w.length===0}function k(){s==null||s.stop(),s=null}function E(w){l=w,v(w),p("drawing"),s=ti({doc:t,svg:n.drawSvg,textInput:n.drawText,initialMarks:c.marks,onChange:y}),b("arrow"),y(c.marks)}function C(){k(),l=null,a==="drawing"&&p("compose")}function T(){h(),g(),k(),l=null,f(null),n.highlight.style.display="none",a!=="compose"&&p("compose")}return{mode:()=>a,state:()=>({selectedElement:c.selectedElement,region:c.region,marks:c.marks}),togglePick(){a==="picking"?u():d()},beginCapture(){T(),f(null),p("capturing"),i=ri({doc:t,onProgress:f,onComplete:w=>{g(),f(null),E(w)},onCancel:()=>{g(),f(null),p("compose")}})},setTool:b,undo:()=>s==null?void 0:s.undo(),attachDraw(){s&&(c.marks=s.marks().slice(),l&&(c.region=l)),C(),r()},cancelDraw(){C(),r()},closeAll:T,reset(){c.selectedElement=null,c.region=null,c.marks=[]}}}var ii="http://www.w3.org/2000/svg",si="data-fixback-overlay";function I(e,t,n={},r=[]){const o=e.createElement(t);for(const[i,s]of Object.entries(n))s!==void 0&&o.setAttribute(i,s);for(const i of r)o.appendChild(typeof i=="string"?e.createTextNode(i):i);return o}function oe(e,t,n={},r=[]){const o=e.createElementNS(ii,t);for(const[i,s]of Object.entries(n))o.setAttribute(i,s);for(const i of r)o.appendChild(i);return o}var ai=[{tool:"arrow",label:"Arrow"},{tool:"box",label:"Box"},{tool:"pen",label:"Pen"},{tool:"text",label:"Text label"}];function St(e){return{class:"fb-ov-icon",width:e,height:e,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor","stroke-width":e==="14"?"1.5":"1.6","aria-hidden":"true"}}function li(e){return I(e,"span",{class:"fb-ov-pickbtn__glyph","aria-hidden":"true"},["⌖"])}function ci(e){return oe(e,"svg",St("14"),[oe(e,"path",{d:"M2 5V2h3M14 5V2h-3M2 11v3h3M14 11v3h-3"})])}function ui(e){return oe(e,"svg",St("15"),[oe(e,"path",{d:"M6 4 3 7l3 3M3 7h6a4 4 0 0 1 0 8H7"})])}function di(e,t){if(t==="text")return I(e,"span",{class:"fb-ov-drawtool__t","aria-hidden":"true"},["T"]);const n={arrow:oe(e,"path",{d:"M3 13 13 3M7 3h6v6"}),box:oe(e,"rect",{x:"2.5",y:"3.5",width:"11",height:"9",rx:"1"}),pen:oe(e,"path",{d:"M3 13l1-3 6-6 2 2-6 6-3 1Z"})};return oe(e,"svg",St("15"),[n[t]])}async function fi(e,t){var n,r,o,i,s,l,a;const{marking:c}=t,p=Zt({comment:t.comment,element:(n=c.selectedElement)!==null&&n!==void 0?n:void 0,region:(r=c.region)!==null&&r!==void 0?r:void 0,marks:c.marks.length>0?c.marks:void 0,url:(o=e.win.location)===null||o===void 0?void 0:o.href,environment:Jt(e.win,e.sdkVersion,e.release),deployEnvironment:e.deployEnvironment,trace:(i=e.buffer)===null||i===void 0?void 0:i.snapshot()}),m=Ft(p,{hook:e.beforeSend,scrub:e.scrub});if(!m)return{kind:"dropped"};const h=(s=(l=t.openedReplay)!==null&&l!==void 0?l:(a=e.replay)===null||a===void 0?void 0:a.snapshot())!==null&&s!==void 0?s:null;return{kind:"submitted",result:await e.submitReport(e.apiUrl,{key:e.key,identity:e.identity,content:m,replay:h})}}var pi=`
441
247
  :host {
442
248
  --fb-color-accent: #2f6fed;
443
249
  --fb-color-accent-hover: #245fd0;
@@ -503,6 +309,34 @@
503
309
  border-radius: 5px;
504
310
  padding: 1px 6px;
505
311
  }
312
+ /* The identity chip (ADR-0032): "Anonymous · Sign in", or "<name> · <tier> · Sign out". */
313
+ .fb-ov-identity {
314
+ display: inline-flex;
315
+ align-items: center;
316
+ gap: 6px;
317
+ }
318
+ .fb-ov-ident-name {
319
+ font-size: 11.5px;
320
+ color: var(--fb-color-faint);
321
+ max-width: 140px;
322
+ overflow: hidden;
323
+ text-overflow: ellipsis;
324
+ white-space: nowrap;
325
+ }
326
+ .fb-ov-signin,
327
+ .fb-ov-signout {
328
+ flex: none;
329
+ border: 1px solid var(--fb-color-border-soft);
330
+ background: none;
331
+ border-radius: 5px;
332
+ padding: 1px 7px;
333
+ font-size: 10.5px;
334
+ color: var(--fb-color-accent);
335
+ cursor: pointer;
336
+ }
337
+ .fb-ov-signin:hover,
338
+ .fb-ov-signout:hover { border-color: var(--fb-color-accent); }
339
+ .fb-ov-signout { color: var(--fb-color-faint); }
506
340
  .fb-ov-close {
507
341
  margin-left: auto;
508
342
  border: 0;
@@ -759,9 +593,9 @@
759
593
  @media (prefers-reduced-motion: reduce) {
760
594
  .fb-ov-highlight { transition: none; }
761
595
  }
762
- `,Zi="data-fixback-overlay",Qi="http://www.w3.org/2000/svg",es=[{tool:"arrow",label:"Arrow"},{tool:"box",label:"Box"},{tool:"pen",label:"Pen"},{tool:"text",label:"Text label"}],Or=1800;function T(e,t,r={},n=[]){const o=e.createElement(t);for(const[i,l]of Object.entries(r))l!==void 0&&o.setAttribute(i,l);for(const i of n)o.appendChild(typeof i=="string"?e.createTextNode(i):i);return o}function ce(e,t,r={},n=[]){const o=e.createElementNS(Qi,t);for(const[i,l]of Object.entries(r))o.setAttribute(i,l);for(const i of n)o.appendChild(i);return o}function ts(e){var t,r,n,o,i,l,c,s;const a=(t=e.doc)!==null&&t!==void 0?t:document,f=(r=(n=e.win)!==null&&n!==void 0?n:a.defaultView)!==null&&r!==void 0?r:window,p=(o=e.sdkVersion)!==null&&o!==void 0?o:tt,h={submitReport:(i=(l=e.deps)===null||l===void 0?void 0:l.submitReport)!==null&&i!==void 0?i:Sr,startElementPicker:(c=(s=e.deps)===null||s===void 0?void 0:s.startElementPicker)!==null&&c!==void 0?c:yo};let d=null,u=null,m=null,b=null,g=null,v=null,y=null,x=!1,_=null,R="compose";const I={selectedElement:null,region:null,marks:[],phase:"compose"};function D(k,M){u&&(u.status.textContent=k,u.status.classList.toggle("is-error",M))}function N(k){if(R=k,!u)return;const M=k!=="compose";u.panel.classList.toggle("is-marking",M),u.pickLayer.classList.toggle("is-visible",k==="picking"),u.captureLayer.classList.toggle("is-visible",k==="capturing"),u.drawLayer.classList.toggle("is-visible",k==="drawing"),u.pickBtn.classList.toggle("is-active",k==="picking"),u.captureBtn.classList.toggle("is-active",k==="capturing"||k==="drawing")}function w(){if(!u)return;const k=!!I.selectedElement,M=!!I.region,J=I.marks.length;u.mark.classList.toggle("has-element",k),u.selector.textContent=k?I.selectedElement.selector:"",u.pickBtn.textContent="",u.pickBtn.append(rs(a),a.createTextNode(k?"Change element":"Pick element")),u.captureBtn.classList.toggle("is-attached",M||J>0);const ne=[];k&&ne.push("Element"),M&&ne.push("Region"),J>0&&ne.push(`${J} mark${J===1?"":"s"}`),u.caption.textContent=ne.length?`${ne.join(" · ")} · masked session replay on Send`:"Masked session replay attached on Send"}function B(k){if(!u)return;if(!k){u.highlight.style.display="none";return}const M=k.getBoundingClientRect();u.highlight.style.display="block",u.highlight.style.left=`${M.left}px`,u.highlight.style.top=`${M.top}px`,u.highlight.style.width=`${M.width}px`,u.highlight.style.height=`${M.height}px`}function L(){m==null||m.stop(),m=null}function C(){u&&(u.highlight.style.display="none"),L(),R==="picking"&&N("compose")}function K(){u&&(me(),N("picking"),m=h.startElementPicker({doc:a,onHover:B,onPick:k=>{I.selectedElement=vo(k),C(),w()},onCancel:C}))}function $(k){if(!u)return;const M=u.selBox;if(!k){M.style.display="none";return}M.style.display="block",M.style.left=`${k.x}px`,M.style.top=`${k.y}px`,M.style.width=`${k.width}px`,M.style.height=`${k.height}px`}function P(){b==null||b.stop(),b=null}function j(){u&&(me(),$(null),N("capturing"),b=Ki({doc:a,onProgress:$,onComplete:k=>{P(),$(null),yt(k)},onCancel:()=>{P(),$(null),N("compose")}}))}function X(k){u&&(u.drawFrame.style.left=`${k.x}px`,u.drawFrame.style.top=`${k.y}px`,u.drawFrame.style.width=`${k.width}px`,u.drawFrame.style.height=`${k.height}px`)}function Y(k){if(g==null||g.setTool(k),!!u)for(const[M,J]of u.drawTools)J.classList.toggle("is-active",M===k)}function ae(k){u&&(u.undoBtn.disabled=k.length===0)}function re(){g==null||g.stop(),g=null}function yt(k){u&&(v=k,X(k),N("drawing"),g=Xi({doc:a,svg:u.drawSvg,textInput:u.drawText,initialMarks:I.marks,onChange:ae}),Y("arrow"),ae(I.marks))}function Le(){g&&(I.marks=g.marks().slice(),v&&(I.region=v)),Je(),w()}function St(){Je(),w()}function Je(){re(),v=null,R==="drawing"&&N("compose")}function me(){L(),P(),re(),v=null,$(null),u&&(u.highlight.style.display="none"),R!=="compose"&&N("compose")}function se(){y!==null&&(clearTimeout(y),y=null)}async function fe(){if(!(!u||I.phase==="sending")){me(),I.phase="sending",u.sendBtn.disabled=!0,u.sendBtn.textContent="Sending…",D("",!1);try{var k,M,J,ne,we,Oe,Ae,De,Fe;const wt=yr({comment:u.comment.value,element:(k=I.selectedElement)!==null&&k!==void 0?k:void 0,region:(M=I.region)!==null&&M!==void 0?M:void 0,marks:I.marks.length>0?I.marks:void 0,url:(J=f.location)===null||J===void 0?void 0:J.href,environment:vr(f,p,e.release),trace:(ne=e.buffer)===null||ne===void 0?void 0:ne.snapshot(),reporterName:(we=e.display)===null||we===void 0?void 0:we.name,reporterEmail:(Oe=e.display)===null||Oe===void 0?void 0:Oe.email}),Pe=tr(wt,{hook:e.beforeSend,scrub:e.scrub});if(!Pe){I.phase="sent",u.panel.classList.add("is-sent"),y=setTimeout(W,Or);return}const Be=(Ae=(De=_)!==null&&De!==void 0?De:(Fe=e.replay)===null||Fe===void 0?void 0:Fe.snapshot())!==null&&Ae!==void 0?Ae:null,Ue=await h.submitReport(e.apiUrl,{key:e.key,identity:e.identity,content:Pe,replay:Be});Ue.ok?(I.phase="sent",u.panel.classList.add("is-sent"),y=setTimeout(W,Or)):(Se(),D(Ue.reason==="unreachable"?"Couldn't reach Fixback — try again.":"Fixback couldn't accept this report.",!0))}catch{Se(),D("Something went wrong — try again.",!0)}}}function Se(){I.phase="compose",u&&(u.sendBtn.disabled=!1,u.sendBtn.textContent="Send")}function Ne(){var k;d=T(a,"div",{[Zi]:""}),d.style.cssText="position:fixed;right:20px;bottom:84px;z-index:2147483001;margin:0;padding:0;border:0;display:none;";const M=d.attachShadow({mode:"open"}),J=a.createElement("style");J.textContent=Ji,M.appendChild(J);const ne=T(a,"button",{type:"button",class:"fb-ov-close","aria-label":"Close"},["✕"]),we=T(a,"div",{class:"fb-ov-head"},[T(a,"span",{class:"fb-ov-mark-sq"}),T(a,"span",{class:"fb-ov-brand"},["Fixback"])]);e.tier!=null&&we.appendChild(T(a,"span",{class:"fb-ov-tier","aria-label":`Trust tier: ${e.tier}`},[e.tier])),we.appendChild(ne);const Oe=T(a,"span",{class:"fb-ov-selector"}),Ae=T(a,"span",{class:"fb-ov-mark-caption"}),De=T(a,"div",{class:"fb-ov-mark"},[Oe,Ae]),Fe=T(a,"textarea",{class:"fb-ov-comment",placeholder:"Describe what you saw or want…","aria-label":"Comment"}),wt=T(a,"div",{class:"fb-ov-status",role:"status","aria-live":"polite"}),Pe=T(a,"button",{type:"button",class:"fb-ov-pickbtn",title:"Point at an element"});Pe.addEventListener("click",()=>{I.phase!=="sending"&&(R==="picking"?C():K())});const Be=T(a,"button",{type:"button",class:"fb-ov-capturebtn",title:"Capture a region and draw","aria-label":"Capture a region and draw"});Be.appendChild(ns(a)),Be.addEventListener("click",()=>{I.phase!=="sending"&&j()});const Ue=T(a,"button",{type:"button",class:"fb-ov-send"},["Send"]);Ue.addEventListener("click",()=>{fe()});const Ga=T(a,"div",{class:"fb-ov-tools"},[Pe,Be,Ue]),Va=T(a,"div",{class:"fb-ov-form"},[De,Fe,wt,Ga]),qa=T(a,"div",{class:"fb-ov-done"},[T(a,"div",{class:"fb-ov-done__check"},["✓"]),T(a,"div",{class:"fb-ov-done__title"},["Report sent"]),T(a,"div",{class:"fb-ov-done__sub"},["Thanks — the team can see it now."])]),Tn=T(a,"div",{class:"fb-ov-panel",role:"dialog","aria-label":"Fixback feedback"},[we,Va,qa]),Kt=T(a,"div",{class:"fb-ov-highlight"});Kt.style.display="none";const Ln=T(a,"div",{class:"fb-ov-pick"},[T(a,"div",{class:"fb-ov-hint"},["Click the element you mean · Esc to cancel"]),Kt]),Jt=T(a,"div",{class:"fb-ov-capture-sel"});Jt.style.display="none";const Nn=T(a,"div",{class:"fb-ov-capture"},[T(a,"div",{class:"fb-ov-capture-dim"}),T(a,"div",{class:"fb-ov-hint"},["Drag to capture an area · Esc to cancel"]),Jt]),On=ce(a,"svg",{class:"fb-ov-draw-svg",width:"100%",height:"100%"}),Zt=T(a,"input",{class:"fb-ov-draw-text",placeholder:"label…","aria-label":"Mark label"});Zt.style.display="none";const An=T(a,"div",{class:"fb-ov-draw-frame"}),Dn=new Map,Fn=[];for(const{tool:kt,label:zn}of es){const Ct=T(a,"button",{type:"button",class:"fb-ov-drawtool","data-tool":kt,title:zn,"aria-label":zn});Ct.appendChild(is(a,kt)),Ct.addEventListener("click",()=>Y(kt)),Dn.set(kt,Ct),Fn.push(Ct)}const xt=T(a,"button",{type:"button",class:"fb-ov-draw-undo",title:"Undo","aria-label":"Undo"});xt.appendChild(os(a)),xt.addEventListener("click",()=>g==null?void 0:g.undo());const Pn=T(a,"button",{type:"button",class:"fb-ov-draw-cancel"},["Cancel"]);Pn.addEventListener("click",()=>St());const Bn=T(a,"button",{type:"button",class:"fb-ov-draw-attach"},["Attach"]);Bn.addEventListener("click",()=>Le());const Xa=T(a,"div",{class:"fb-ov-draw-toolbar"},[...Fn,T(a,"span",{class:"fb-ov-draw-divider"}),xt,Pn,Bn]),Un=T(a,"div",{class:"fb-ov-draw"},[An,On,Zt,Xa]);M.append(Tn,Ln,Nn,Un),ne.addEventListener("click",W),((k=e.target)!==null&&k!==void 0?k:a.body).appendChild(d),u={panel:Tn,mark:De,selector:Oe,caption:Ae,comment:Fe,status:wt,pickBtn:Pe,captureBtn:Be,sendBtn:Ue,highlight:Kt,pickLayer:Ln,captureLayer:Nn,selBox:Jt,drawLayer:Un,drawSvg:On,drawText:Zt,drawFrame:An,drawTools:Dn,undoBtn:xt}}function U(){(!d||!u)&&Ne()}function te(){var k,M;if(U(),!(!d||!u)){se(),me(),_=(k=(M=e.replay)===null||M===void 0?void 0:M.snapshot())!==null&&k!==void 0?k:null,I.phase="compose",I.selectedElement=null,I.region=null,I.marks=[],u.panel.classList.remove("is-sent"),u.comment.value="",Se(),D("",!1),w(),d.style.display="block",x=!0;try{u.comment.focus()}catch{}}}function W(){se(),me(),d&&(d.style.display="none"),x=!1,_=null}function G(){se(),me(),d==null||d.remove(),d=null,u=null,x=!1}return{open:te,close:W,destroy:G,get isOpen(){return x}}}function rs(e){return T(e,"span",{class:"fb-ov-pickbtn__glyph","aria-hidden":"true"},["⌖"])}function ns(e){return ce(e,"svg",{class:"fb-ov-icon",width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor","stroke-width":"1.5","aria-hidden":"true"},[ce(e,"path",{d:"M2 5V2h3M14 5V2h-3M2 11v3h3M14 11v3h-3"})])}function os(e){return ce(e,"svg",{class:"fb-ov-icon",width:"15",height:"15",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor","stroke-width":"1.6","aria-hidden":"true"},[ce(e,"path",{d:"M6 4 3 7l3 3M3 7h6a4 4 0 0 1 0 8H7"})])}function is(e,t){return t==="text"?T(e,"span",{class:"fb-ov-drawtool__t","aria-hidden":"true"},["T"]):ce(e,"svg",{class:"fb-ov-icon",width:"15",height:"15",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor","stroke-width":"1.6","aria-hidden":"true"},[{arrow:ce(e,"path",{d:"M3 13 13 3M7 3h6v6"}),box:ce(e,"rect",{x:"2.5",y:"3.5",width:"11",height:"9",rx:"1"}),pen:ce(e,"path",{d:"M3 13l1-3 6-6 2 2-6 6-3 1Z"})}[t]])}var ss=Object.defineProperty,as=(e,t,r)=>t in e?ss(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,S=(e,t,r)=>as(e,typeof t!="symbol"?t+"":t,r),Ar,F=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e[e.Asset=7]="Asset",e))(F||{}),O=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(O||{}),ee=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(ee||{}),ue=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(ue||{}),Ce=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(Ce||{}),Me=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e[e.RateChange=4]="RateChange",e))(Me||{}),q=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(q||{}),Dr={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Fr={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},it={},Pr={},ls=()=>!!globalThis.Zone;function Ut(e){if(it[e])return it[e];const t=globalThis[e],r=t.prototype,n=e in Dr?Dr[e]:void 0,o=!!(n&&n.every(c=>{var s,a;return!!((a=(s=Object.getOwnPropertyDescriptor(r,c))==null?void 0:s.get)!=null&&a.toString().includes("[native code]"))})),i=e in Fr?Fr[e]:void 0,l=!!(i&&i.every(c=>{var s;return typeof r[c]=="function"&&((s=r[c])==null?void 0:s.toString().includes("[native code]"))}));if(o&&l&&!ls())return it[e]=t.prototype,t.prototype;try{const c=document.createElement("iframe");c.style.display="none",document.body.appendChild(c);const s=c.contentWindow;if(!s)return t.prototype;const a=s[e].prototype;if(!a)return c.remove(),r;const f=navigator.userAgent;return f.includes("Safari")&&!f.includes("Chrome")?(c.classList.add("rr-block"),c.setAttribute("__rrwebUntaintedMutationObserver",""),Pr[e]=()=>c.remove()):c.remove(),it[e]=a}catch{return r}}var zt={};function de(e,t,r){var n;const o=`${e}.${String(r)}`;if(zt[o])return zt[o].call(t);const i=Ut(e),l=(n=Object.getOwnPropertyDescriptor(i,r))==null?void 0:n.get;return l?(zt[o]=l,l.call(t)):t[r]}var $t={};function Br(e,t,r){const n=`${e}.${String(r)}`;if($t[n])return $t[n].bind(t);const o=Ut(e)[r];return typeof o!="function"?t[r]:($t[n]=o,o.bind(t))}function cs(e){return de("Node",e,"ownerDocument")}function us(e){return de("Node",e,"childNodes")}function ds(e){return de("Node",e,"parentNode")}function fs(e){return de("Node",e,"parentElement")}function ps(e){return de("Node",e,"textContent")}function hs(e,t){return Br("Node",e,"contains")(t)}function ms(e){return Br("Node",e,"getRootNode")()}function bs(e){return!e||!("host"in e)?null:de("ShadowRoot",e,"host")}function gs(e){return e.styleSheets}function vs(e){return!e||!("shadowRoot"in e)?null:de("Element",e,"shadowRoot")}function ys(e,t){return de("Element",e,"querySelector")(t)}function Ss(e,t){return de("Element",e,"querySelectorAll")(t)}function Ur(){var e;return[Ut("MutationObserver").constructor,(e=Pr.MutationObserver)!==null&&e!==void 0?e:(()=>{})]}var He=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(He=()=>new Date().getTime());function ge(e,t,r){try{if(!(t in e))return()=>{};const n=e[t],o=r(n);return typeof o=="function"&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:n}})),e[t]=o,()=>{e[t]=n}}catch{return()=>{}}}var E={ownerDocument:cs,childNodes:us,parentNode:ds,parentElement:fs,textContent:ps,contains:hs,getRootNode:ms,host:bs,styleSheets:gs,shadowRoot:vs,querySelector:ys,querySelectorAll:Ss,nowTimestamp:He,mutationObserverCtor:Ur,patch:ge};function zr(e){return e.nodeType===e.ELEMENT_NODE}function je(e){const t=e&&"host"in e&&"mode"in e&&E.host(e)||null;return!!(t&&"shadowRoot"in t&&E.shadowRoot(t)===e)}function Ge(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}function ws(e){return e.includes(" background-clip: text;")&&!e.includes(" -webkit-background-clip: text;")&&(e=e.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),e}function xs(e){const{cssText:t}=e;if(t.split('"').length<3)return t;const r=["@import",`url(${JSON.stringify(e.href)})`];return e.layerName===""?r.push("layer"):e.layerName&&r.push(`layer(${e.layerName})`),e.supportsText&&r.push(`supports(${e.supportsText})`),e.media.length&&r.push(e.media.mediaText),r.join(" ")+";"}function Wt(e){try{const t=e.rules||e.cssRules;if(!t)return null;let r=e.href;return!r&&e.ownerNode&&(r=e.ownerNode.baseURI),ws(Array.from(t,n=>$r(n,r)).join(""))}catch{return null}}function $r(e,t){if(Cs(e)){let r;try{r=Wt(e.styleSheet)||xs(e)}catch{r=e.cssText}return e.styleSheet.href?lt(r,e.styleSheet.href):r}else{let r=e.cssText;return Ms(e)&&e.selectorText.includes(":")&&(r=ks(r)),t?lt(r,t):r}}function ks(e){return e.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")}function Cs(e){return"styleSheet"in e}function Ms(e){return"selectorText"in e}var Wr=class{constructor(){S(this,"idNodeMap",new Map),S(this,"nodeMetaMap",new WeakMap)}getId(e){var t;if(!e)return-1;const r=(t=this.getMeta(e))==null?void 0:t.id;return r!=null?r:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){const t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach(r=>this.removeNodeFromMap(r))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){const r=t.id;this.idNodeMap.set(r,e),this.nodeMetaMap.set(e,t)}replace(e,t){const r=this.getNode(e);if(r){const n=this.nodeMetaMap.get(r);n&&this.nodeMetaMap.set(t,n)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function Es(){return new Wr}function st({element:e,maskInputOptions:t,tagName:r,type:n,value:o,maskInputFn:i}){let l=o||"";const c=n&&ve(n);return(t[r.toLowerCase()]||c&&t[c])&&(i?l=i(l,e):l="*".repeat(l.length)),l}function ve(e){return e.toLowerCase()}var Hr="__rrweb_original__";function Is(e){const t=e.getContext("2d");if(!t)return!0;const r=50;for(let n=0;n<e.width;n+=r)for(let o=0;o<e.height;o+=r){const i=t.getImageData,l=Hr in i?i[Hr]:i;if(new Uint32Array(l.call(t,n,o,Math.min(r,e.width-n),Math.min(r,e.height-o)).data.buffer).some(c=>c!==0))return!1}return!0}function at(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?ve(t):null}function jr(e,t){var r;let n;try{n=new URL(e,t!=null?t:window.location.href)}catch{return null}const o=n.pathname.match(/\.([0-9a-z]+)(?:$)/i);return(r=o==null?void 0:o[1])!==null&&r!==void 0?r:null}function Rs(e){let t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}var _s=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,Ts=/^(?:[a-z+]+:)?\/\//i,Ls=/^www\..*/i,Ns=/^(data:)([^,]*),(.*)/i;function lt(e,t){return(e||"").replace(_s,(r,n,o,i,l,c)=>{const s=o||l||c,a=n||i||"";if(!s)return r;if(Ts.test(s)||Ls.test(s))return`url(${a}${s}${a})`;if(Ns.test(s))return`url(${a}${s}${a})`;if(s[0]==="/")return`url(${a}${Rs(t)+s}${a})`;const f=s.split("#")[0],p=s.substring(f.length),h=t.split("#")[0].split("/"),d=f.split("/");h.pop();for(const u of d)u!=="."&&(u===".."?h.pop():h.push(u));return`url(${a}${h.join("/")}${p}${a})`})}function ct(e,t=!1){return t?e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,""):e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"").replace(/0px/g,"0")}function Os(e,t,r=!1){const n=Array.from(t.childNodes),o=[];let i=0;if(n.length>1&&e&&typeof e=="string"){let l=ct(e,r);const c=l.length/e.length;for(let s=1;s<n.length;s++)if(n[s].textContent&&typeof n[s].textContent=="string"){const a=ct(n[s].textContent,r),f=100;let p=3;for(;p<a.length&&(a[p].match(/[a-zA-Z0-9]/)||a.indexOf(a.substring(0,p),1)!==-1);p++);for(;p<a.length;p++){let h=a.substring(0,p),d=l.split(h),u=-1;if(d.length===2)u=d[0].length;else if(d.length>2&&d[0]===""&&n[s-1].textContent!=="")u=l.indexOf(h,1);else if(d.length===1){if(h=h.substring(0,h.length-1),d=l.split(h),d.length<=1)return o.push(e),o;p=101}else p===a.length-1&&(u=l.indexOf(h));if(d.length>=2&&p>f){const m=n[s-1].textContent;if(m&&typeof m=="string"){const b=ct(m).length;u=l.indexOf(h,b)}u===-1&&(u=d[0].length)}if(u!==-1){let m=Math.floor(u/c);for(;m>0&&m<e.length;){if(i+=1,i>50*n.length)return o.push(e),o;const b=ct(e.substring(0,m),r);if(b.length===u){o.push(e.substring(0,m)),e=e.substring(m),l=l.substring(u);break}else b.length<u?m+=Math.max(1,Math.floor((u-b.length)/c)):m-=Math.max(1,Math.floor((b.length-u)*c))}break}}}}return o.push(e),o}function As(e,t){return Os(e,t).join("/* rr_split */")}var Ds=1,Fs=new RegExp("[^a-z0-9-_:]"),Ve=-2;function Gr(){return Ds++}function Ps(e){if(e instanceof HTMLFormElement)return"form";const t=ve(e.tagName);return Fs.test(t)?"div":t}var Ee,Vr,Bs=/^[^ \t\n\r\u000c]+/,Us=/^[, \t\n\r\u000c]+/;function zs(e,t){if(t.trim()==="")return t;let r=0;function n(i){let l;const c=i.exec(t.substring(r));return c?(l=c[0],r+=l.length,l):""}const o=[];for(;n(Us),!(r>=t.length);){let i=n(Bs);if(i.slice(-1)===",")i=Ie(e,i.substring(0,i.length-1)),o.push(i);else{let l="";i=Ie(e,i);let c=!1;for(;;){const s=t.charAt(r);if(s===""){o.push((i+l).trim());break}else if(c)s===")"&&(c=!1);else if(s===","){r+=1,o.push((i+l).trim());break}else s==="("&&(c=!0);l+=s,r+=1}}}return o.join(", ")}var qr=new WeakMap;function Ie(e,t){return!t||t.trim()===""?t:Ht(e,t)}function $s(e){return!!(e.tagName==="svg"||e.ownerSVGElement)}function Ht(e,t){let r=qr.get(e);if(r||(r=e.createElement("a"),qr.set(e,r)),!t)t="";else if(t.startsWith("blob:")||t.startsWith("data:"))return t;return r.setAttribute("href",t),r.href}function Xr(e,t,r,n){return n&&(r==="src"||r==="href"&&!(t==="use"&&n[0]==="#")||r==="xlink:href"&&n[0]!=="#"||r==="background"&&["table","td","th"].includes(t)?Ie(e,n):r==="srcset"?zs(e,n):r==="style"?lt(n,Ht(e)):t==="object"&&r==="data"?Ie(e,n):n)}function Yr(e,t,r){return["video","audio"].includes(e)&&t==="autoplay"}function Ws(e,t,r){try{if(typeof t=="string"){if(e.classList.contains(t))return!0}else for(let n=e.classList.length;n--;){const o=e.classList[n];if(t.test(o))return!0}if(r)return e.matches(r)}catch{}return!1}function ut(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return r?ut(E.parentNode(e),t,r):!1;for(let n=e.classList.length;n--;){const o=e.classList[n];if(t.test(o))return!0}return r?ut(E.parentNode(e),t,r):!1}function Kr(e,t,r,n){let o;if(zr(e)){if(o=e,!E.childNodes(o).length)return!1}else{if(E.parentElement(e)===null)return!1;o=E.parentElement(e)}try{if(typeof t=="string"){if(n){if(o.closest(`.${t}`))return!0}else if(o.classList.contains(t))return!0}else if(ut(o,t,n))return!0;if(r){if(n){if(o.closest(r))return!0}else if(o.matches(r))return!0}}catch{}return!1}function Hs(e,t,r){const n=e.contentWindow;if(!n)return;let o=!1,i;try{i=n.document.readyState}catch{return}if(i!=="complete"){const c=setTimeout(()=>{o||(t(),o=!0)},r);e.addEventListener("load",()=>{clearTimeout(c),o=!0,t()});return}const l="about:blank";if(n.location.href!==l||e.src===l||e.src==="")return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}function js(e,t,r){let n=!1,o;try{o=e.sheet}catch{return}if(o)return;const i=setTimeout(()=>{n||(t(),n=!0)},r);e.addEventListener("load",()=>{clearTimeout(i),n=!0,t()})}function Gs(e,t){const{doc:r,mirror:n,blockClass:o,blockSelector:i,needsMask:l,inlineStylesheet:c,maskInputOptions:s={},maskTextFn:a,maskInputFn:f,dataURLOptions:p={},inlineImages:h,recordCanvas:d,keepIframeSrcFn:u,newlyAddedElement:m=!1,cssCaptured:b=!1}=t,g=Vs(r,n);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:q.Document,childNodes:[],compatMode:e.compatMode}:{type:q.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:q.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:g};case e.ELEMENT_NODE:return Xs(e,{doc:r,blockClass:o,blockSelector:i,inlineStylesheet:c,maskInputOptions:s,maskInputFn:f,dataURLOptions:p,inlineImages:h,recordCanvas:d,keepIframeSrcFn:u,newlyAddedElement:m,rootId:g});case e.TEXT_NODE:return qs(e,{doc:r,needsMask:l,maskTextFn:a,rootId:g,cssCaptured:b});case e.CDATA_SECTION_NODE:return{type:q.CDATA,textContent:"",rootId:g};case e.COMMENT_NODE:return{type:q.Comment,textContent:E.textContent(e)||"",rootId:g};default:return!1}}function Vs(e,t){if(!t.hasNode(e))return;const r=t.getId(e);return r===1?void 0:r}function qs(e,t){const{needsMask:r,maskTextFn:n,rootId:o,cssCaptured:i}=t,l=E.parentNode(e),c=l&&l.tagName;let s="";const a=c==="STYLE"?!0:void 0,f=c==="SCRIPT"?!0:void 0;return f?s="SCRIPT_PLACEHOLDER":i||(s=E.textContent(e),a&&s&&(s=lt(s,Ht(t.doc)))),!a&&!f&&s&&r&&(s=n?n(s,E.parentElement(e)):s.replace(/[\S]/g,"*")),{type:q.Text,textContent:s||"",rootId:o}}function Xs(e,t){const{doc:r,blockClass:n,blockSelector:o,inlineStylesheet:i,maskInputOptions:l={},maskInputFn:c,dataURLOptions:s={},inlineImages:a,recordCanvas:f,keepIframeSrcFn:p,newlyAddedElement:h=!1,rootId:d}=t,u=Ws(e,n,o),m=Ps(e);let b={};const g=e.attributes.length;for(let y=0;y<g;y++){const x=e.attributes[y];Yr(m,x.name,x.value)||(b[x.name]=Xr(r,m,ve(x.name),x.value))}if(m==="link"&&i){const y=Array.from(r.styleSheets).find(_=>_.href===e.href);let x=null;y&&(x=Wt(y)),x&&(delete b.rel,delete b.href,b._cssText=x)}if(m==="style"&&e.sheet){let y=Wt(e.sheet);y&&(e.childNodes.length>1&&(y=As(y,e)),b._cssText=y)}if(["input","textarea","select"].includes(m)){const y=e.value,x=e.checked;b.type!=="radio"&&b.type!=="checkbox"&&b.type!=="submit"&&b.type!=="button"&&y?b.value=st({element:e,type:at(e),tagName:m,value:y,maskInputOptions:l,maskInputFn:c}):x&&(b.checked=x)}if(m==="option"&&(e.selected&&!l.select?b.selected=!0:delete b.selected),m==="dialog"&&e.open&&(b.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal"),m==="canvas"&&f){if(e.__context==="2d")Is(e)||(b.rr_dataURL=e.toDataURL(s.type,s.quality));else if(!("__context"in e)){const y=e.toDataURL(s.type,s.quality),x=r.createElement("canvas");x.width=e.width,x.height=e.height,y!==x.toDataURL(s.type,s.quality)&&(b.rr_dataURL=y)}}if(m==="img"&&a){Ee||(Ee=r.createElement("canvas"),Vr=Ee.getContext("2d"));const y=e,x=y.currentSrc||y.getAttribute("src")||"<unknown-src>",_=y.crossOrigin,R=()=>{y.removeEventListener("load",R);try{Ee.width=y.naturalWidth,Ee.height=y.naturalHeight,Vr.drawImage(y,0,0),b.rr_dataURL=Ee.toDataURL(s.type,s.quality)}catch(I){if(y.crossOrigin!=="anonymous"){y.crossOrigin="anonymous",y.complete&&y.naturalWidth!==0?R():y.addEventListener("load",R);return}else console.warn(`Cannot inline img src=${x}! Error: ${I}`)}y.crossOrigin==="anonymous"&&(_?b.crossOrigin=_:y.removeAttribute("crossorigin"))};y.complete&&y.naturalWidth!==0?R():y.addEventListener("load",R)}if(["audio","video"].includes(m)){const y=b;y.rr_mediaState=e.paused?"paused":"played",y.rr_mediaCurrentTime=e.currentTime,y.rr_mediaPlaybackRate=e.playbackRate,y.rr_mediaMuted=e.muted,y.rr_mediaLoop=e.loop,y.rr_mediaVolume=e.volume}if(h||(e.scrollLeft&&(b.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(b.rr_scrollTop=e.scrollTop)),u){const{width:y,height:x}=e.getBoundingClientRect();b={class:b.class,rr_width:`${y}px`,rr_height:`${x}px`}}m==="iframe"&&!p(b.src)&&(e.contentDocument||(b.rr_src=b.src),delete b.src);let v;try{customElements.get(m)&&(v=!0)}catch{}return{type:q.Element,tagName:m,attributes:b,childNodes:[],isSVG:$s(e)||void 0,needBlock:u,rootId:d,isCustom:v}}function H(e){return e==null?"":e.toLowerCase()}function Jr(e){return e===!0||e==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:e==="all",headMetaDescKeywords:e==="all",headTitleMutations:e==="all"}:e||{}}function Ys(e,t){if(t.comment&&e.type===q.Comment)return!0;if(e.type===q.Element){if(t.script&&(e.tagName==="script"||e.tagName==="link"&&(e.attributes.rel==="preload"&&e.attributes.as==="script"||e.attributes.rel==="modulepreload")||e.tagName==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&jr(e.attributes.href)==="js"))return!0;if(t.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&(H(e.attributes.name).match(/^msapplication-tile(image|color)$/)||H(e.attributes.name)==="application-name"||H(e.attributes.rel)==="icon"||H(e.attributes.rel)==="apple-touch-icon"||H(e.attributes.rel)==="shortcut icon")))return!0;if(e.tagName==="meta"){if(t.headMetaDescKeywords&&H(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(H(e.attributes.property).match(/^(og|twitter|fb):/)||H(e.attributes.name).match(/^(og|twitter):/)||H(e.attributes.name)==="pinterest"))return!0;if(t.headMetaRobots&&(H(e.attributes.name)==="robots"||H(e.attributes.name)==="googlebot"||H(e.attributes.name)==="bingbot"))return!0;if(t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0)return!0;if(t.headMetaAuthorship&&(H(e.attributes.name)==="author"||H(e.attributes.name)==="generator"||H(e.attributes.name)==="framework"||H(e.attributes.name)==="publisher"||H(e.attributes.name)==="progid"||H(e.attributes.property).match(/^article:/)||H(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&(H(e.attributes.name)==="google-site-verification"||H(e.attributes.name)==="yandex-verification"||H(e.attributes.name)==="csrf-token"||H(e.attributes.name)==="p:domain_verify"||H(e.attributes.name)==="verify-v1"||H(e.attributes.name)==="verification"||H(e.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function Re(e,t){const{doc:r,mirror:n,blockClass:o,blockSelector:i,maskTextClass:l,maskTextSelector:c,skipChild:s=!1,inlineStylesheet:a=!0,maskInputOptions:f={},maskTextFn:p,maskInputFn:h,slimDOMOptions:d,dataURLOptions:u={},inlineImages:m=!1,recordCanvas:b=!1,onSerialize:g,onIframeLoad:v,iframeLoadTimeout:y=5e3,onStylesheetLoad:x,stylesheetLoadTimeout:_=5e3,keepIframeSrcFn:R=()=>!1,newlyAddedElement:I=!1,cssCaptured:D=!1}=t;let{needsMask:N}=t,{preserveWhiteSpace:w=!0}=t;N||(N=Kr(e,l,c,N===void 0));const B=Gs(e,{doc:r,mirror:n,blockClass:o,blockSelector:i,needsMask:N,inlineStylesheet:a,maskInputOptions:f,maskTextFn:p,maskInputFn:h,dataURLOptions:u,inlineImages:m,recordCanvas:b,keepIframeSrcFn:R,newlyAddedElement:I,cssCaptured:D});if(!B)return console.warn(e,"not serialized"),null;let L;n.hasNode(e)?L=n.getId(e):Ys(B,d)||!w&&B.type===q.Text&&!B.textContent.replace(/^\s+|\s+$/gm,"").length?L=Ve:L=Gr();const C=Object.assign(B,{id:L});if(n.add(e,C),L===Ve)return null;g&&g(e);let K=!s;if(C.type===q.Element){K=K&&!C.needBlock,delete C.needBlock;const P=E.shadowRoot(e);P&&Ge(P)&&(C.isShadowHost=!0)}if((C.type===q.Document||C.type===q.Element)&&K){d.headWhitespace&&C.type===q.Element&&C.tagName==="head"&&(w=!1);const P={doc:r,mirror:n,blockClass:o,blockSelector:i,needsMask:N,maskTextClass:l,maskTextSelector:c,skipChild:s,inlineStylesheet:a,maskInputOptions:f,maskTextFn:p,maskInputFn:h,slimDOMOptions:d,dataURLOptions:u,inlineImages:m,recordCanvas:b,preserveWhiteSpace:w,onSerialize:g,onIframeLoad:v,iframeLoadTimeout:y,onStylesheetLoad:x,stylesheetLoadTimeout:_,keepIframeSrcFn:R,cssCaptured:!1};if(!(C.type===q.Element&&C.tagName==="textarea"&&C.attributes.value!==void 0)){C.type===q.Element&&C.attributes._cssText!==void 0&&typeof C.attributes._cssText=="string"&&(P.cssCaptured=!0);for(const X of Array.from(E.childNodes(e))){const Y=Re(X,P);Y&&C.childNodes.push(Y)}}let j=null;if(zr(e)&&(j=E.shadowRoot(e)))for(const X of Array.from(E.childNodes(j))){const Y=Re(X,P);Y&&(Ge(j)&&(Y.isShadow=!0),C.childNodes.push(Y))}}const $=E.parentNode(e);return $&&je($)&&Ge($)&&(C.isShadow=!0),C.type===q.Element&&C.tagName==="iframe"&&Hs(e,()=>{const P=e.contentDocument;if(P&&v){const j=Re(P,{doc:P,mirror:n,blockClass:o,blockSelector:i,needsMask:N,maskTextClass:l,maskTextSelector:c,skipChild:!1,inlineStylesheet:a,maskInputOptions:f,maskTextFn:p,maskInputFn:h,slimDOMOptions:d,dataURLOptions:u,inlineImages:m,recordCanvas:b,preserveWhiteSpace:w,onSerialize:g,onIframeLoad:v,iframeLoadTimeout:y,onStylesheetLoad:x,stylesheetLoadTimeout:_,keepIframeSrcFn:R});j&&v(e,j)}},y),C.type===q.Element&&C.tagName==="link"&&typeof C.attributes.rel=="string"&&(C.attributes.rel==="stylesheet"||C.attributes.rel==="preload"&&typeof C.attributes.href=="string"&&jr(C.attributes.href)==="css")&&js(e,()=>{if(x){const P=Re(e,{doc:r,mirror:n,blockClass:o,blockSelector:i,needsMask:N,maskTextClass:l,maskTextSelector:c,skipChild:!1,inlineStylesheet:a,maskInputOptions:f,maskTextFn:p,maskInputFn:h,slimDOMOptions:d,dataURLOptions:u,inlineImages:m,recordCanvas:b,preserveWhiteSpace:w,onSerialize:g,onIframeLoad:v,iframeLoadTimeout:y,onStylesheetLoad:x,stylesheetLoadTimeout:_,keepIframeSrcFn:R});P&&x(e,P)}},_),C}function Ks(e,t){const{mirror:r=new Wr,blockClass:n="rr-block",blockSelector:o=null,maskTextClass:i="rr-mask",maskTextSelector:l=null,inlineStylesheet:c=!0,inlineImages:s=!1,recordCanvas:a=!1,maskAllInputs:f=!1,maskTextFn:p,maskInputFn:h,slimDOM:d=!1,dataURLOptions:u,preserveWhiteSpace:m,onSerialize:b,onIframeLoad:g,iframeLoadTimeout:v,onStylesheetLoad:y,stylesheetLoadTimeout:x,keepIframeSrcFn:_=()=>!1}=t;return Re(e,{doc:e,mirror:r,blockClass:n,blockSelector:o,maskTextClass:i,maskTextSelector:l,skipChild:!1,inlineStylesheet:c,maskInputOptions:f===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:f===!1?{password:!0}:f,maskTextFn:p,maskInputFn:h,slimDOMOptions:Jr(d),dataURLOptions:u,inlineImages:s,recordCanvas:a,preserveWhiteSpace:m,onSerialize:b,onIframeLoad:g,iframeLoadTimeout:v,onStylesheetLoad:y,stylesheetLoadTimeout:x,keepIframeSrcFn:_,newlyAddedElement:!1})}var Js=class $n{constructor(...t){S(this,"parentElement",null),S(this,"parentNode",null),S(this,"ownerDocument"),S(this,"firstChild",null),S(this,"lastChild",null),S(this,"previousSibling",null),S(this,"nextSibling",null),S(this,"ELEMENT_NODE",1),S(this,"TEXT_NODE",3),S(this,"nodeType"),S(this,"nodeName"),S(this,"RRNodeType")}get childNodes(){const t=[];let r=this.firstChild;for(;r;)t.push(r),r=r.nextSibling;return t}contains(t){if(t instanceof $n){if(t.ownerDocument!==this.ownerDocument)return!1;if(t===this)return!0}else return!1;for(;t.parentNode;){if(t.parentNode===this)return!0;t=t.parentNode}return!1}appendChild(t){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(t,r){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(t){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}};function Z(e,t,r=document){const n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}var _e=`Please stop import mirror directly. Instead of that,\r
596
+ `;function sn(e,t,n,r){if(t.textContent="",n.status==="connected"){t.appendChild(I(e,"span",{class:"fb-ov-ident-name"},[n.name||n.email])),n.tier&&t.appendChild(I(e,"span",{class:"fb-ov-tier","aria-label":`Trust tier: ${n.tier}`},[n.tier]));const o=I(e,"button",{type:"button",class:"fb-ov-signout"},["Sign out"]);o.addEventListener("click",r.onSignOut),t.appendChild(o)}else{t.appendChild(I(e,"span",{class:"fb-ov-ident-name"},["Anonymous"]));const o=I(e,"button",{type:"button",class:"fb-ov-signin"},["Sign in"]);o.addEventListener("click",r.onSignIn),t.appendChild(o)}}function hi(e,t){var n;const{doc:r}=e,o=I(r,"div",{[si]:""});o.style.cssText="position:fixed;right:20px;bottom:84px;z-index:2147483001;margin:0;padding:0;border:0;display:none;";const i=o.attachShadow({mode:"open"}),s=r.createElement("style");s.textContent=pi,i.appendChild(s);const l=I(r,"button",{type:"button",class:"fb-ov-close","aria-label":"Close"},["✕"]);l.addEventListener("click",t.onClose);const a=I(r,"span",{class:"fb-ov-identity"});sn(r,a,e.identity,t);const c=I(r,"div",{class:"fb-ov-head"},[I(r,"span",{class:"fb-ov-mark-sq"}),I(r,"span",{class:"fb-ov-brand"},["Fixback"]),a]);c.appendChild(l);const p=I(r,"span",{class:"fb-ov-selector"}),m=I(r,"span",{class:"fb-ov-mark-caption"}),h=I(r,"div",{class:"fb-ov-mark"},[p,m]),u=I(r,"textarea",{class:"fb-ov-comment",placeholder:"Describe what you saw or want…","aria-label":"Comment"}),d=I(r,"div",{class:"fb-ov-status",role:"status","aria-live":"polite"}),f=I(r,"button",{type:"button",class:"fb-ov-pickbtn",title:"Point at an element"});f.addEventListener("click",t.onTogglePick);const g=I(r,"button",{type:"button",class:"fb-ov-capturebtn",title:"Capture a region and draw","aria-label":"Capture a region and draw"});g.appendChild(ci(r)),g.addEventListener("click",t.onBeginCapture);const v=I(r,"button",{type:"button",class:"fb-ov-send"},["Send"]);v.addEventListener("click",t.onSend);const b=I(r,"div",{class:"fb-ov-tools"},[f,g,v]),y=I(r,"div",{class:"fb-ov-form"},[h,u,d,b]),k=I(r,"div",{class:"fb-ov-done"},[I(r,"div",{class:"fb-ov-done__check"},["✓"]),I(r,"div",{class:"fb-ov-done__title"},["Report sent"]),I(r,"div",{class:"fb-ov-done__sub"},["Thanks — the team can see it now."])]),E=I(r,"div",{class:"fb-ov-panel",role:"dialog","aria-label":"Fixback feedback"},[c,y,k]),C=I(r,"div",{class:"fb-ov-highlight"});C.style.display="none";const T=I(r,"div",{class:"fb-ov-pick"},[I(r,"div",{class:"fb-ov-hint"},["Click the element you mean · Esc to cancel"]),C]),w=I(r,"div",{class:"fb-ov-capture-sel"});w.style.display="none";const L=I(r,"div",{class:"fb-ov-capture"},[I(r,"div",{class:"fb-ov-capture-dim"}),I(r,"div",{class:"fb-ov-hint"},["Drag to capture an area · Esc to cancel"]),w]),x=oe(r,"svg",{class:"fb-ov-draw-svg",width:"100%",height:"100%"}),D=I(r,"input",{class:"fb-ov-draw-text",placeholder:"label…","aria-label":"Mark label"});D.style.display="none";const j=I(r,"div",{class:"fb-ov-draw-frame"}),R=new Map,ne=[];for(const{tool:Y,label:Ce}of ai){const pe=I(r,"button",{type:"button",class:"fb-ov-drawtool","data-tool":Y,title:Ce,"aria-label":Ce});pe.appendChild(di(r,Y)),pe.addEventListener("click",()=>t.onSelectTool(Y)),R.set(Y,pe),ne.push(pe)}const J=I(r,"button",{type:"button",class:"fb-ov-draw-undo",title:"Undo","aria-label":"Undo"});J.appendChild(ui(r)),J.addEventListener("click",t.onUndo);const _=I(r,"button",{type:"button",class:"fb-ov-draw-cancel"},["Cancel"]);_.addEventListener("click",t.onCancelDraw);const F=I(r,"button",{type:"button",class:"fb-ov-draw-attach"},["Attach"]);F.addEventListener("click",t.onAttachDraw);const ee=I(r,"div",{class:"fb-ov-draw-toolbar"},[...ne,I(r,"span",{class:"fb-ov-draw-divider"}),J,_,F]),G=I(r,"div",{class:"fb-ov-draw"},[j,x,D,ee]);return i.append(E,T,L,G),((n=e.target)!==null&&n!==void 0?n:r.body).appendChild(o),{host:o,refs:{panel:E,identity:a,mark:h,selector:p,caption:m,comment:u,status:d,pickBtn:f,captureBtn:g,sendBtn:v,highlight:C,pickLayer:T,captureLayer:L,selBox:w,drawLayer:G,drawSvg:x,drawText:D,drawFrame:j,drawTools:R,undoBtn:J}}}var mi=1800;function bi(e){var t,n,r,o,i,s,l,a;const c=(t=e.doc)!==null&&t!==void 0?t:document,p=(n=(r=e.win)!==null&&r!==void 0?r:c.defaultView)!==null&&n!==void 0?n:window,m=(o=e.sdkVersion)!==null&&o!==void 0?o:Be,h={submitReport:(i=(s=e.deps)===null||s===void 0?void 0:s.submitReport)!==null&&i!==void 0?i:Qt,startElementPicker:(l=(a=e.deps)===null||a===void 0?void 0:a.startElementPicker)!==null&&l!==void 0?l:Zo};let u=null,d=null,f=null,g=e.reporterIdentity,v=null,b=!1,y=null,k="compose";function E(_,F){d&&(d.status.textContent=_,d.status.classList.toggle("is-error",F))}function C(){if(!d||!f)return;const{selectedElement:_,region:F,marks:ee}=f.state(),G=ee.length;d.mark.classList.toggle("has-element",!!_),d.selector.textContent=_?_.selector:"",d.pickBtn.textContent="",d.pickBtn.append(li(c),c.createTextNode(_?"Change element":"Pick element")),d.captureBtn.classList.toggle("is-attached",!!F||G>0);const Y=[];_&&Y.push("Element"),F&&Y.push("Region"),G>0&&Y.push(`${G} mark${G===1?"":"s"}`),d.caption.textContent=Y.length?`${Y.join(" · ")} · masked session replay on Send`:"Masked session replay attached on Send"}function T(){v!==null&&(clearTimeout(v),v=null)}function w(){k="compose",d&&(d.sendBtn.disabled=!1,d.sendBtn.textContent="Send")}function L(){k="sent",d==null||d.panel.classList.add("is-sent"),v=setTimeout(R,mi)}async function x(){if(!(!d||!f||k==="sending")){f.closeAll(),k="sending",d.sendBtn.disabled=!0,d.sendBtn.textContent="Sending…",E("",!1);try{var _;const F=await fi({apiUrl:e.apiUrl,key:e.key,identity:(_=e.getIdentity)===null||_===void 0?void 0:_.call(e),sdkVersion:m,release:e.release,deployEnvironment:e.deployEnvironment,win:p,buffer:e.buffer,replay:e.replay,beforeSend:e.beforeSend,scrub:e.scrub,submitReport:h.submitReport},{comment:d.comment.value,marking:f.state(),openedReplay:y});if(F.kind==="dropped"||F.result.ok){L();return}w(),E(F.result.reason==="unreachable"?"Couldn't reach Fixback — try again.":"Fixback couldn't accept this report.",!0)}catch{w(),E("Something went wrong — try again.",!0)}}}function D(){if(u&&d&&f)return;const _=hi({doc:c,target:e.target,identity:g},{onClose:R,onTogglePick:()=>{k!=="sending"&&(f==null||f.togglePick())},onBeginCapture:()=>{k!=="sending"&&(f==null||f.beginCapture())},onSend:()=>{x()},onSelectTool:F=>f==null?void 0:f.setTool(F),onUndo:()=>f==null?void 0:f.undo(),onCancelDraw:()=>f==null?void 0:f.cancelDraw(),onAttachDraw:()=>f==null?void 0:f.attachDraw(),onSignIn:e.onSignIn,onSignOut:e.onSignOut});u=_.host,d=_.refs,f=oi({doc:c,refs:_.refs,startElementPicker:h.startElementPicker,onChange:C})}function j(){var _,F;if(D(),!(!u||!d||!f)){T(),f.closeAll(),y=(_=(F=e.replay)===null||F===void 0?void 0:F.snapshot())!==null&&_!==void 0?_:null,f.reset(),d.panel.classList.remove("is-sent"),d.comment.value="",w(),E("",!1),C(),u.style.display="block",b=!0;try{d.comment.focus()}catch{}}}function R(){T(),f==null||f.closeAll(),u&&(u.style.display="none"),b=!1,y=null}function ne(){T(),f==null||f.closeAll(),u==null||u.remove(),u=null,d=null,f=null,b=!1}function J(_){g=_,d&&sn(c,d.identity,_,{onSignIn:e.onSignIn,onSignOut:e.onSignOut})}return{open:j,close:R,destroy:ne,setIdentity:J,get isOpen(){return b}}}var gi=Object.defineProperty,vi=(e,t,n)=>t in e?gi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,S=(e,t,n)=>vi(e,typeof t!="symbol"?t+"":t,n),an,A=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e[e.Asset=7]="Asset",e))(A||{}),N=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(N||{}),X=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(X||{}),ie=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(ie||{}),ge=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(ge||{}),ve=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e[e.RateChange=4]="RateChange",e))(ve||{}),H=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(H||{}),ln={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},cn={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},We={},un={},yi=()=>!!globalThis.Zone;function wt(e){if(We[e])return We[e];const t=globalThis[e],n=t.prototype,r=e in ln?ln[e]:void 0,o=!!(r&&r.every(l=>{var a,c;return!!((c=(a=Object.getOwnPropertyDescriptor(n,l))==null?void 0:a.get)!=null&&c.toString().includes("[native code]"))})),i=e in cn?cn[e]:void 0,s=!!(i&&i.every(l=>{var a;return typeof n[l]=="function"&&((a=n[l])==null?void 0:a.toString().includes("[native code]"))}));if(o&&s&&!yi())return We[e]=t.prototype,t.prototype;try{const l=document.createElement("iframe");l.style.display="none",document.body.appendChild(l);const a=l.contentWindow;if(!a)return t.prototype;const c=a[e].prototype;if(!c)return l.remove(),n;const p=navigator.userAgent;return p.includes("Safari")&&!p.includes("Chrome")?(l.classList.add("rr-block"),l.setAttribute("__rrwebUntaintedMutationObserver",""),un[e]=()=>l.remove()):l.remove(),We[e]=c}catch{return n}}var xt={};function se(e,t,n){var r;const o=`${e}.${String(n)}`;if(xt[o])return xt[o].call(t);const i=wt(e),s=(r=Object.getOwnPropertyDescriptor(i,n))==null?void 0:r.get;return s?(xt[o]=s,s.call(t)):t[n]}var kt={};function dn(e,t,n){const r=`${e}.${String(n)}`;if(kt[r])return kt[r].bind(t);const o=wt(e)[n];return typeof o!="function"?t[n]:(kt[r]=o,o.bind(t))}function Si(e){return se("Node",e,"ownerDocument")}function wi(e){return se("Node",e,"childNodes")}function xi(e){return se("Node",e,"parentNode")}function ki(e){return se("Node",e,"parentElement")}function Ci(e){return se("Node",e,"textContent")}function Mi(e,t){return dn("Node",e,"contains")(t)}function Ei(e){return dn("Node",e,"getRootNode")()}function Ii(e){return!e||!("host"in e)?null:se("ShadowRoot",e,"host")}function _i(e){return e.styleSheets}function Ri(e){return!e||!("shadowRoot"in e)?null:se("Element",e,"shadowRoot")}function Ti(e,t){return se("Element",e,"querySelector")(t)}function Li(e,t){return se("Element",e,"querySelectorAll")(t)}function fn(){var e;return[wt("MutationObserver").constructor,(e=un.MutationObserver)!==null&&e!==void 0?e:(()=>{})]}var Ie=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(Ie=()=>new Date().getTime());function ue(e,t,n){try{if(!(t in e))return()=>{};const r=e[t],o=n(r);return typeof o=="function"&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=o,()=>{e[t]=r}}catch{return()=>{}}}var M={ownerDocument:Si,childNodes:wi,parentNode:xi,parentElement:ki,textContent:Ci,contains:Mi,getRootNode:Ei,host:Ii,styleSheets:_i,shadowRoot:Ri,querySelector:Ti,querySelectorAll:Li,nowTimestamp:Ie,mutationObserverCtor:fn,patch:ue};function pn(e){return e.nodeType===e.ELEMENT_NODE}function _e(e){const t=e&&"host"in e&&"mode"in e&&M.host(e)||null;return!!(t&&"shadowRoot"in t&&M.shadowRoot(t)===e)}function Re(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}function Ni(e){return e.includes(" background-clip: text;")&&!e.includes(" -webkit-background-clip: text;")&&(e=e.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),e}function Oi(e){const{cssText:t}=e;if(t.split('"').length<3)return t;const n=["@import",`url(${JSON.stringify(e.href)})`];return e.layerName===""?n.push("layer"):e.layerName&&n.push(`layer(${e.layerName})`),e.supportsText&&n.push(`supports(${e.supportsText})`),e.media.length&&n.push(e.media.mediaText),n.join(" ")+";"}function Ct(e){try{const t=e.rules||e.cssRules;if(!t)return null;let n=e.href;return!n&&e.ownerNode&&(n=e.ownerNode.baseURI),Ni(Array.from(t,r=>hn(r,n)).join(""))}catch{return null}}function hn(e,t){if(Di(e)){let n;try{n=Ct(e.styleSheet)||Oi(e)}catch{n=e.cssText}return e.styleSheet.href?Ge(n,e.styleSheet.href):n}else{let n=e.cssText;return Fi(e)&&e.selectorText.includes(":")&&(n=Ai(n)),t?Ge(n,t):n}}function Ai(e){return e.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")}function Di(e){return"styleSheet"in e}function Fi(e){return"selectorText"in e}var mn=class{constructor(){S(this,"idNodeMap",new Map),S(this,"nodeMetaMap",new WeakMap)}getId(e){var t;if(!e)return-1;const n=(t=this.getMeta(e))==null?void 0:t.id;return n!=null?n:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){const t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach(n=>this.removeNodeFromMap(n))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){const n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)}replace(e,t){const n=this.getNode(e);if(n){const r=this.nodeMetaMap.get(n);r&&this.nodeMetaMap.set(t,r)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function Pi(){return new mn}function He({element:e,maskInputOptions:t,tagName:n,type:r,value:o,maskInputFn:i}){let s=o||"";const l=r&&de(r);return(t[n.toLowerCase()]||l&&t[l])&&(i?s=i(s,e):s="*".repeat(s.length)),s}function de(e){return e.toLowerCase()}var bn="__rrweb_original__";function Ui(e){const t=e.getContext("2d");if(!t)return!0;const n=50;for(let r=0;r<e.width;r+=n)for(let o=0;o<e.height;o+=n){const i=t.getImageData,s=bn in i?i[bn]:i;if(new Uint32Array(s.call(t,r,o,Math.min(n,e.width-r),Math.min(n,e.height-o)).data.buffer).some(l=>l!==0))return!1}return!0}function je(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?de(t):null}function gn(e,t){var n;let r;try{r=new URL(e,t!=null?t:window.location.href)}catch{return null}const o=r.pathname.match(/\.([0-9a-z]+)(?:$)/i);return(n=o==null?void 0:o[1])!==null&&n!==void 0?n:null}function $i(e){let t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}var Bi=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,zi=/^(?:[a-z+]+:)?\/\//i,Wi=/^www\..*/i,Hi=/^(data:)([^,]*),(.*)/i;function Ge(e,t){return(e||"").replace(Bi,(n,r,o,i,s,l)=>{const a=o||s||l,c=r||i||"";if(!a)return n;if(zi.test(a)||Wi.test(a))return`url(${c}${a}${c})`;if(Hi.test(a))return`url(${c}${a}${c})`;if(a[0]==="/")return`url(${c}${$i(t)+a}${c})`;const p=a.split("#")[0],m=a.substring(p.length),h=t.split("#")[0].split("/"),u=p.split("/");h.pop();for(const d of u)d!=="."&&(d===".."?h.pop():h.push(d));return`url(${c}${h.join("/")}${m}${c})`})}function Ve(e,t=!1){return t?e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,""):e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"").replace(/0px/g,"0")}function ji(e,t,n=!1){const r=Array.from(t.childNodes),o=[];let i=0;if(r.length>1&&e&&typeof e=="string"){let s=Ve(e,n);const l=s.length/e.length;for(let a=1;a<r.length;a++)if(r[a].textContent&&typeof r[a].textContent=="string"){const c=Ve(r[a].textContent,n),p=100;let m=3;for(;m<c.length&&(c[m].match(/[a-zA-Z0-9]/)||c.indexOf(c.substring(0,m),1)!==-1);m++);for(;m<c.length;m++){let h=c.substring(0,m),u=s.split(h),d=-1;if(u.length===2)d=u[0].length;else if(u.length>2&&u[0]===""&&r[a-1].textContent!=="")d=s.indexOf(h,1);else if(u.length===1){if(h=h.substring(0,h.length-1),u=s.split(h),u.length<=1)return o.push(e),o;m=101}else m===c.length-1&&(d=s.indexOf(h));if(u.length>=2&&m>p){const f=r[a-1].textContent;if(f&&typeof f=="string"){const g=Ve(f).length;d=s.indexOf(h,g)}d===-1&&(d=u[0].length)}if(d!==-1){let f=Math.floor(d/l);for(;f>0&&f<e.length;){if(i+=1,i>50*r.length)return o.push(e),o;const g=Ve(e.substring(0,f),n);if(g.length===d){o.push(e.substring(0,f)),e=e.substring(f),s=s.substring(d);break}else g.length<d?f+=Math.max(1,Math.floor((d-g.length)/l)):f-=Math.max(1,Math.floor((g.length-d)*l))}break}}}}return o.push(e),o}function Gi(e,t){return ji(e,t).join("/* rr_split */")}var Vi=1,qi=new RegExp("[^a-z0-9-_:]"),Te=-2;function vn(){return Vi++}function Xi(e){if(e instanceof HTMLFormElement)return"form";const t=de(e.tagName);return qi.test(t)?"div":t}var ye,yn,Yi=/^[^ \t\n\r\u000c]+/,Ki=/^[, \t\n\r\u000c]+/;function Ji(e,t){if(t.trim()==="")return t;let n=0;function r(i){let s;const l=i.exec(t.substring(n));return l?(s=l[0],n+=s.length,s):""}const o=[];for(;r(Ki),!(n>=t.length);){let i=r(Yi);if(i.slice(-1)===",")i=Se(e,i.substring(0,i.length-1)),o.push(i);else{let s="";i=Se(e,i);let l=!1;for(;;){const a=t.charAt(n);if(a===""){o.push((i+s).trim());break}else if(l)a===")"&&(l=!1);else if(a===","){n+=1,o.push((i+s).trim());break}else a==="("&&(l=!0);s+=a,n+=1}}}return o.join(", ")}var Sn=new WeakMap;function Se(e,t){return!t||t.trim()===""?t:Mt(e,t)}function Zi(e){return!!(e.tagName==="svg"||e.ownerSVGElement)}function Mt(e,t){let n=Sn.get(e);if(n||(n=e.createElement("a"),Sn.set(e,n)),!t)t="";else if(t.startsWith("blob:")||t.startsWith("data:"))return t;return n.setAttribute("href",t),n.href}function wn(e,t,n,r){return r&&(n==="src"||n==="href"&&!(t==="use"&&r[0]==="#")||n==="xlink:href"&&r[0]!=="#"||n==="background"&&["table","td","th"].includes(t)?Se(e,r):n==="srcset"?Ji(e,r):n==="style"?Ge(r,Mt(e)):t==="object"&&n==="data"?Se(e,r):r)}function xn(e,t,n){return["video","audio"].includes(e)&&t==="autoplay"}function Qi(e,t,n){try{if(typeof t=="string"){if(e.classList.contains(t))return!0}else for(let r=e.classList.length;r--;){const o=e.classList[r];if(t.test(o))return!0}if(n)return e.matches(n)}catch{}return!1}function qe(e,t,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return n?qe(M.parentNode(e),t,n):!1;for(let r=e.classList.length;r--;){const o=e.classList[r];if(t.test(o))return!0}return n?qe(M.parentNode(e),t,n):!1}function kn(e,t,n,r){let o;if(pn(e)){if(o=e,!M.childNodes(o).length)return!1}else{if(M.parentElement(e)===null)return!1;o=M.parentElement(e)}try{if(typeof t=="string"){if(r){if(o.closest(`.${t}`))return!0}else if(o.classList.contains(t))return!0}else if(qe(o,t,r))return!0;if(n){if(r){if(o.closest(n))return!0}else if(o.matches(n))return!0}}catch{}return!1}function es(e,t,n){const r=e.contentWindow;if(!r)return;let o=!1,i;try{i=r.document.readyState}catch{return}if(i!=="complete"){const l=setTimeout(()=>{o||(t(),o=!0)},n);e.addEventListener("load",()=>{clearTimeout(l),o=!0,t()});return}const s="about:blank";if(r.location.href!==s||e.src===s||e.src==="")return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}function ts(e,t,n){let r=!1,o;try{o=e.sheet}catch{return}if(o)return;const i=setTimeout(()=>{r||(t(),r=!0)},n);e.addEventListener("load",()=>{clearTimeout(i),r=!0,t()})}function ns(e,t){const{doc:n,mirror:r,blockClass:o,blockSelector:i,needsMask:s,inlineStylesheet:l,maskInputOptions:a={},maskTextFn:c,maskInputFn:p,dataURLOptions:m={},inlineImages:h,recordCanvas:u,keepIframeSrcFn:d,newlyAddedElement:f=!1,cssCaptured:g=!1}=t,v=rs(n,r);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:H.Document,childNodes:[],compatMode:e.compatMode}:{type:H.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:H.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:v};case e.ELEMENT_NODE:return is(e,{doc:n,blockClass:o,blockSelector:i,inlineStylesheet:l,maskInputOptions:a,maskInputFn:p,dataURLOptions:m,inlineImages:h,recordCanvas:u,keepIframeSrcFn:d,newlyAddedElement:f,rootId:v});case e.TEXT_NODE:return os(e,{doc:n,needsMask:s,maskTextFn:c,rootId:v,cssCaptured:g});case e.CDATA_SECTION_NODE:return{type:H.CDATA,textContent:"",rootId:v};case e.COMMENT_NODE:return{type:H.Comment,textContent:M.textContent(e)||"",rootId:v};default:return!1}}function rs(e,t){if(!t.hasNode(e))return;const n=t.getId(e);return n===1?void 0:n}function os(e,t){const{needsMask:n,maskTextFn:r,rootId:o,cssCaptured:i}=t,s=M.parentNode(e),l=s&&s.tagName;let a="";const c=l==="STYLE"?!0:void 0,p=l==="SCRIPT"?!0:void 0;return p?a="SCRIPT_PLACEHOLDER":i||(a=M.textContent(e),c&&a&&(a=Ge(a,Mt(t.doc)))),!c&&!p&&a&&n&&(a=r?r(a,M.parentElement(e)):a.replace(/[\S]/g,"*")),{type:H.Text,textContent:a||"",rootId:o}}function is(e,t){const{doc:n,blockClass:r,blockSelector:o,inlineStylesheet:i,maskInputOptions:s={},maskInputFn:l,dataURLOptions:a={},inlineImages:c,recordCanvas:p,keepIframeSrcFn:m,newlyAddedElement:h=!1,rootId:u}=t,d=Qi(e,r,o),f=Xi(e);let g={};const v=e.attributes.length;for(let y=0;y<v;y++){const k=e.attributes[y];xn(f,k.name,k.value)||(g[k.name]=wn(n,f,de(k.name),k.value))}if(f==="link"&&i){const y=Array.from(n.styleSheets).find(E=>E.href===e.href);let k=null;y&&(k=Ct(y)),k&&(delete g.rel,delete g.href,g._cssText=k)}if(f==="style"&&e.sheet){let y=Ct(e.sheet);y&&(e.childNodes.length>1&&(y=Gi(y,e)),g._cssText=y)}if(["input","textarea","select"].includes(f)){const y=e.value,k=e.checked;g.type!=="radio"&&g.type!=="checkbox"&&g.type!=="submit"&&g.type!=="button"&&y?g.value=He({element:e,type:je(e),tagName:f,value:y,maskInputOptions:s,maskInputFn:l}):k&&(g.checked=k)}if(f==="option"&&(e.selected&&!s.select?g.selected=!0:delete g.selected),f==="dialog"&&e.open&&(g.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal"),f==="canvas"&&p){if(e.__context==="2d")Ui(e)||(g.rr_dataURL=e.toDataURL(a.type,a.quality));else if(!("__context"in e)){const y=e.toDataURL(a.type,a.quality),k=n.createElement("canvas");k.width=e.width,k.height=e.height,y!==k.toDataURL(a.type,a.quality)&&(g.rr_dataURL=y)}}if(f==="img"&&c){ye||(ye=n.createElement("canvas"),yn=ye.getContext("2d"));const y=e,k=y.currentSrc||y.getAttribute("src")||"<unknown-src>",E=y.crossOrigin,C=()=>{y.removeEventListener("load",C);try{ye.width=y.naturalWidth,ye.height=y.naturalHeight,yn.drawImage(y,0,0),g.rr_dataURL=ye.toDataURL(a.type,a.quality)}catch(T){if(y.crossOrigin!=="anonymous"){y.crossOrigin="anonymous",y.complete&&y.naturalWidth!==0?C():y.addEventListener("load",C);return}else console.warn(`Cannot inline img src=${k}! Error: ${T}`)}y.crossOrigin==="anonymous"&&(E?g.crossOrigin=E:y.removeAttribute("crossorigin"))};y.complete&&y.naturalWidth!==0?C():y.addEventListener("load",C)}if(["audio","video"].includes(f)){const y=g;y.rr_mediaState=e.paused?"paused":"played",y.rr_mediaCurrentTime=e.currentTime,y.rr_mediaPlaybackRate=e.playbackRate,y.rr_mediaMuted=e.muted,y.rr_mediaLoop=e.loop,y.rr_mediaVolume=e.volume}if(h||(e.scrollLeft&&(g.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(g.rr_scrollTop=e.scrollTop)),d){const{width:y,height:k}=e.getBoundingClientRect();g={class:g.class,rr_width:`${y}px`,rr_height:`${k}px`}}f==="iframe"&&!m(g.src)&&(e.contentDocument||(g.rr_src=g.src),delete g.src);let b;try{customElements.get(f)&&(b=!0)}catch{}return{type:H.Element,tagName:f,attributes:g,childNodes:[],isSVG:Zi(e)||void 0,needBlock:d,rootId:u,isCustom:b}}function $(e){return e==null?"":e.toLowerCase()}function Cn(e){return e===!0||e==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:e==="all",headMetaDescKeywords:e==="all",headTitleMutations:e==="all"}:e||{}}function ss(e,t){if(t.comment&&e.type===H.Comment)return!0;if(e.type===H.Element){if(t.script&&(e.tagName==="script"||e.tagName==="link"&&(e.attributes.rel==="preload"&&e.attributes.as==="script"||e.attributes.rel==="modulepreload")||e.tagName==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&gn(e.attributes.href)==="js"))return!0;if(t.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&($(e.attributes.name).match(/^msapplication-tile(image|color)$/)||$(e.attributes.name)==="application-name"||$(e.attributes.rel)==="icon"||$(e.attributes.rel)==="apple-touch-icon"||$(e.attributes.rel)==="shortcut icon")))return!0;if(e.tagName==="meta"){if(t.headMetaDescKeywords&&$(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&($(e.attributes.property).match(/^(og|twitter|fb):/)||$(e.attributes.name).match(/^(og|twitter):/)||$(e.attributes.name)==="pinterest"))return!0;if(t.headMetaRobots&&($(e.attributes.name)==="robots"||$(e.attributes.name)==="googlebot"||$(e.attributes.name)==="bingbot"))return!0;if(t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0)return!0;if(t.headMetaAuthorship&&($(e.attributes.name)==="author"||$(e.attributes.name)==="generator"||$(e.attributes.name)==="framework"||$(e.attributes.name)==="publisher"||$(e.attributes.name)==="progid"||$(e.attributes.property).match(/^article:/)||$(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&($(e.attributes.name)==="google-site-verification"||$(e.attributes.name)==="yandex-verification"||$(e.attributes.name)==="csrf-token"||$(e.attributes.name)==="p:domain_verify"||$(e.attributes.name)==="verify-v1"||$(e.attributes.name)==="verification"||$(e.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function we(e,t){const{doc:n,mirror:r,blockClass:o,blockSelector:i,maskTextClass:s,maskTextSelector:l,skipChild:a=!1,inlineStylesheet:c=!0,maskInputOptions:p={},maskTextFn:m,maskInputFn:h,slimDOMOptions:u,dataURLOptions:d={},inlineImages:f=!1,recordCanvas:g=!1,onSerialize:v,onIframeLoad:b,iframeLoadTimeout:y=5e3,onStylesheetLoad:k,stylesheetLoadTimeout:E=5e3,keepIframeSrcFn:C=()=>!1,newlyAddedElement:T=!1,cssCaptured:w=!1}=t;let{needsMask:L}=t,{preserveWhiteSpace:x=!0}=t;L||(L=kn(e,s,l,L===void 0));const D=ns(e,{doc:n,mirror:r,blockClass:o,blockSelector:i,needsMask:L,inlineStylesheet:c,maskInputOptions:p,maskTextFn:m,maskInputFn:h,dataURLOptions:d,inlineImages:f,recordCanvas:g,keepIframeSrcFn:C,newlyAddedElement:T,cssCaptured:w});if(!D)return console.warn(e,"not serialized"),null;let j;r.hasNode(e)?j=r.getId(e):ss(D,u)||!x&&D.type===H.Text&&!D.textContent.replace(/^\s+|\s+$/gm,"").length?j=Te:j=vn();const R=Object.assign(D,{id:j});if(r.add(e,R),j===Te)return null;v&&v(e);let ne=!a;if(R.type===H.Element){ne=ne&&!R.needBlock,delete R.needBlock;const _=M.shadowRoot(e);_&&Re(_)&&(R.isShadowHost=!0)}if((R.type===H.Document||R.type===H.Element)&&ne){u.headWhitespace&&R.type===H.Element&&R.tagName==="head"&&(x=!1);const _={doc:n,mirror:r,blockClass:o,blockSelector:i,needsMask:L,maskTextClass:s,maskTextSelector:l,skipChild:a,inlineStylesheet:c,maskInputOptions:p,maskTextFn:m,maskInputFn:h,slimDOMOptions:u,dataURLOptions:d,inlineImages:f,recordCanvas:g,preserveWhiteSpace:x,onSerialize:v,onIframeLoad:b,iframeLoadTimeout:y,onStylesheetLoad:k,stylesheetLoadTimeout:E,keepIframeSrcFn:C,cssCaptured:!1};if(!(R.type===H.Element&&R.tagName==="textarea"&&R.attributes.value!==void 0)){R.type===H.Element&&R.attributes._cssText!==void 0&&typeof R.attributes._cssText=="string"&&(_.cssCaptured=!0);for(const ee of Array.from(M.childNodes(e))){const G=we(ee,_);G&&R.childNodes.push(G)}}let F=null;if(pn(e)&&(F=M.shadowRoot(e)))for(const ee of Array.from(M.childNodes(F))){const G=we(ee,_);G&&(Re(F)&&(G.isShadow=!0),R.childNodes.push(G))}}const J=M.parentNode(e);return J&&_e(J)&&Re(J)&&(R.isShadow=!0),R.type===H.Element&&R.tagName==="iframe"&&es(e,()=>{const _=e.contentDocument;if(_&&b){const F=we(_,{doc:_,mirror:r,blockClass:o,blockSelector:i,needsMask:L,maskTextClass:s,maskTextSelector:l,skipChild:!1,inlineStylesheet:c,maskInputOptions:p,maskTextFn:m,maskInputFn:h,slimDOMOptions:u,dataURLOptions:d,inlineImages:f,recordCanvas:g,preserveWhiteSpace:x,onSerialize:v,onIframeLoad:b,iframeLoadTimeout:y,onStylesheetLoad:k,stylesheetLoadTimeout:E,keepIframeSrcFn:C});F&&b(e,F)}},y),R.type===H.Element&&R.tagName==="link"&&typeof R.attributes.rel=="string"&&(R.attributes.rel==="stylesheet"||R.attributes.rel==="preload"&&typeof R.attributes.href=="string"&&gn(R.attributes.href)==="css")&&ts(e,()=>{if(k){const _=we(e,{doc:n,mirror:r,blockClass:o,blockSelector:i,needsMask:L,maskTextClass:s,maskTextSelector:l,skipChild:!1,inlineStylesheet:c,maskInputOptions:p,maskTextFn:m,maskInputFn:h,slimDOMOptions:u,dataURLOptions:d,inlineImages:f,recordCanvas:g,preserveWhiteSpace:x,onSerialize:v,onIframeLoad:b,iframeLoadTimeout:y,onStylesheetLoad:k,stylesheetLoadTimeout:E,keepIframeSrcFn:C});_&&k(e,_)}},E),R}function as(e,t){const{mirror:n=new mn,blockClass:r="rr-block",blockSelector:o=null,maskTextClass:i="rr-mask",maskTextSelector:s=null,inlineStylesheet:l=!0,inlineImages:a=!1,recordCanvas:c=!1,maskAllInputs:p=!1,maskTextFn:m,maskInputFn:h,slimDOM:u=!1,dataURLOptions:d,preserveWhiteSpace:f,onSerialize:g,onIframeLoad:v,iframeLoadTimeout:b,onStylesheetLoad:y,stylesheetLoadTimeout:k,keepIframeSrcFn:E=()=>!1}=t;return we(e,{doc:e,mirror:n,blockClass:r,blockSelector:o,maskTextClass:i,maskTextSelector:s,skipChild:!1,inlineStylesheet:l,maskInputOptions:p===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:p===!1?{password:!0}:p,maskTextFn:m,maskInputFn:h,slimDOMOptions:Cn(u),dataURLOptions:d,inlineImages:a,recordCanvas:c,preserveWhiteSpace:f,onSerialize:g,onIframeLoad:v,iframeLoadTimeout:b,onStylesheetLoad:y,stylesheetLoadTimeout:k,keepIframeSrcFn:E,newlyAddedElement:!1})}var ls=class ar{constructor(...t){S(this,"parentElement",null),S(this,"parentNode",null),S(this,"ownerDocument"),S(this,"firstChild",null),S(this,"lastChild",null),S(this,"previousSibling",null),S(this,"nextSibling",null),S(this,"ELEMENT_NODE",1),S(this,"TEXT_NODE",3),S(this,"nodeType"),S(this,"nodeName"),S(this,"RRNodeType")}get childNodes(){const t=[];let n=this.firstChild;for(;n;)t.push(n),n=n.nextSibling;return t}contains(t){if(t instanceof ar){if(t.ownerDocument!==this.ownerDocument)return!1;if(t===this)return!0}else return!1;for(;t.parentNode;){if(t.parentNode===this)return!0;t=t.parentNode}return!1}appendChild(t){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(t,n){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(t){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}};function V(e,t,n=document){const r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)}var xe=`Please stop import mirror directly. Instead of that,\r
763
597
  now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
764
- or you can use record.mirror to access the mirror instance during recording.`,Zr={map:{},getId(){return console.error(_e),-1},getNode(){return console.error(_e),null},removeNodeFromMap(){console.error(_e)},has(){return console.error(_e),!1},reset(){console.error(_e)}};typeof window!="undefined"&&window.Proxy&&window.Reflect&&(Zr=new Proxy(Zr,{get(e,t,r){return t==="map"&&console.error(_e),Reflect.get(e,t,r)}}));function qe(e,t,r={}){let n=null,o=0;return function(...i){const l=Date.now();!o&&r.leading===!1&&(o=l);const c=t-(l-o),s=this;c<=0||c>t?(n&&(clearTimeout(n),n=null),o=l,e.apply(s,i)):!n&&r.trailing!==!1&&(n=setTimeout(()=>{o=r.leading===!1?0:Date.now(),n=null,e.apply(s,i)},c))}}function dt(e,t,r,n,o=window){const i=o.Object.getOwnPropertyDescriptor(e,t);return o.Object.defineProperty(e,t,n?r:{set(l){setTimeout(()=>{r.set.call(this,l)},0),i&&i.set&&i.set.call(this,l)}}),()=>dt(e,t,i||{},!0)}function Qr(e){var t,r,n,o;const i=e.document;return{left:i.scrollingElement?i.scrollingElement.scrollLeft:e.pageXOffset!==void 0?e.pageXOffset:i.documentElement.scrollLeft||(i==null?void 0:i.body)&&((t=E.parentElement(i.body))==null?void 0:t.scrollLeft)||((r=i==null?void 0:i.body)==null?void 0:r.scrollLeft)||0,top:i.scrollingElement?i.scrollingElement.scrollTop:e.pageYOffset!==void 0?e.pageYOffset:(i==null?void 0:i.documentElement.scrollTop)||(i==null?void 0:i.body)&&((n=E.parentElement(i.body))==null?void 0:n.scrollTop)||((o=i==null?void 0:i.body)==null?void 0:o.scrollTop)||0}}function en(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function tn(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function rn(e){return e?e.nodeType===e.ELEMENT_NODE?e:E.parentElement(e):null}function Q(e,t,r,n){if(!e)return!1;const o=rn(e);if(!o)return!1;try{if(typeof t=="string"){if(o.classList.contains(t)||n&&o.closest("."+t)!==null)return!0}else if(ut(o,t,n))return!0}catch{}return!!(r&&(o.matches(r)||n&&o.closest(r)!==null))}function Zs(e,t){return t.getId(e)!==-1}function jt(e,t,r){return e.tagName==="TITLE"&&r.headTitleMutations?!0:t.getId(e)===Ve}function nn(e,t){if(je(e))return!1;const r=t.getId(e);if(!t.has(r))return!0;const n=E.parentNode(e);return n&&n.nodeType===e.DOCUMENT_NODE?!1:n?nn(n,t):!0}function Gt(e){return!!e.changedTouches}function Qs(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach)}function on(e,t){return!!(e.nodeName==="IFRAME"&&t.getMeta(e))}function sn(e,t){return!!(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function Vt(e){return e?e instanceof Js&&"shadowRoot"in e?!!e.shadowRoot:!!E.shadowRoot(e):!1}var ea=class{constructor(){S(this,"id",1),S(this,"styleIDMap",new WeakMap),S(this,"idStyleMap",new Map)}getId(e){var t;return(t=this.styleIDMap.get(e))!==null&&t!==void 0?t:-1}has(e){return this.styleIDMap.has(e)}add(e,t){if(this.has(e))return this.getId(e);let r;return t===void 0?r=this.id++:r=t,this.styleIDMap.set(e,r),this.idStyleMap.set(r,e),r}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}};function an(e){var t;let r=null;return"getRootNode"in e&&((t=E.getRootNode(e))==null?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&E.host(E.getRootNode(e))&&(r=E.host(E.getRootNode(e))),r}function ta(e){let t=e,r;for(;r=an(t);)t=r;return t}function ra(e){const t=E.ownerDocument(e);if(!t)return!1;const r=ta(e);return E.contains(t,r)}function ln(e){const t=E.ownerDocument(e);return t?E.contains(t,e)||ra(e):!1}function cn(e){return"__ln"in e}var na=class{constructor(){S(this,"length",0),S(this,"head",null),S(this,"tail",null)}get(e){if(e>=this.length)throw new Error("Position outside of list range");let t=this.head;for(let r=0;r<e;r++)t=(t==null?void 0:t.next)||null;return t}addNode(e){const t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&cn(e.previousSibling)){const r=e.previousSibling.__ln.next;t.next=r,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,r&&(r.previous=t)}else if(e.nextSibling&&cn(e.nextSibling)&&e.nextSibling.__ln.previous){const r=e.nextSibling.__ln.previous;t.previous=r,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,r&&(r.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;t.next===null&&(this.tail=t),this.length++}removeNode(e){const t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next?t.next.previous=t.previous:this.tail=t.previous):(this.head=t.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)}},un=(e,t)=>`${e}@${t}`,oa=class{constructor(){S(this,"frozen",!1),S(this,"locked",!1),S(this,"texts",[]),S(this,"attributes",[]),S(this,"attributeMap",new WeakMap),S(this,"removes",[]),S(this,"mapRemoves",[]),S(this,"movedMap",{}),S(this,"addedSet",new Set),S(this,"movedSet",new Set),S(this,"droppedSet",new Set),S(this,"removesSubTreeCache",new Set),S(this,"mutationCb"),S(this,"blockClass"),S(this,"blockSelector"),S(this,"maskTextClass"),S(this,"maskTextSelector"),S(this,"inlineStylesheet"),S(this,"maskInputOptions"),S(this,"maskTextFn"),S(this,"maskInputFn"),S(this,"keepIframeSrcFn"),S(this,"recordCanvas"),S(this,"inlineImages"),S(this,"slimDOMOptions"),S(this,"dataURLOptions"),S(this,"doc"),S(this,"mirror"),S(this,"iframeManager"),S(this,"stylesheetManager"),S(this,"shadowDomManager"),S(this,"canvasManager"),S(this,"processedNodeManager"),S(this,"unattachedDoc"),S(this,"processMutations",e=>{e.forEach(this.processMutation),this.emit()}),S(this,"emit",()=>{if(this.frozen||this.locked)return;const e=[],t=new Set,r=new na,n=c=>{let s=c,a=Ve;for(;a===Ve;)s=s&&s.nextSibling,a=s&&this.mirror.getId(s);return a},o=c=>{const s=E.parentNode(c);if(!s||!ln(c))return;let a=!1;if(c.nodeType===Node.TEXT_NODE){const d=s.tagName;if(d==="TEXTAREA")return;d==="STYLE"&&this.addedSet.has(s)&&(a=!0)}const f=je(s)?this.mirror.getId(an(c)):this.mirror.getId(s),p=n(c);if(f===-1||p===-1)return r.addNode(c);const h=Re(c,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:d=>{on(d,this.mirror)&&this.iframeManager.addIframe(d),sn(d,this.mirror)&&this.stylesheetManager.trackLinkElement(d),Vt(c)&&this.shadowDomManager.addShadowRoot(E.shadowRoot(c),this.doc)},onIframeLoad:(d,u)=>{this.iframeManager.attachIframe(d,u),this.shadowDomManager.observeAttachShadow(d)},onStylesheetLoad:(d,u)=>{this.stylesheetManager.attachLinkElement(d,u)},cssCaptured:a});h&&(e.push({parentId:f,nextId:p,node:h}),t.add(h.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const c of this.movedSet)dn(this.removesSubTreeCache,c,this.mirror)&&!this.movedSet.has(E.parentNode(c))||o(c);for(const c of this.addedSet)!fn(this.droppedSet,c)&&!dn(this.removesSubTreeCache,c,this.mirror)||fn(this.movedSet,c)?o(c):this.droppedSet.add(c);let i=null;for(;r.length;){let c=null;if(i){const s=this.mirror.getId(E.parentNode(i.value)),a=n(i.value);s!==-1&&a!==-1&&(c=i)}if(!c){let s=r.tail;for(;s;){const a=s;if(s=s.previous,a){const f=this.mirror.getId(E.parentNode(a.value));if(n(a.value)===-1)continue;if(f!==-1){c=a;break}else{const p=a.value,h=E.parentNode(p);if(h&&h.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const d=E.host(h);if(this.mirror.getId(d)!==-1){c=a;break}}}}}}if(!c){for(;r.head;)r.removeNode(r.head.value);break}i=c.previous,r.removeNode(c.value),o(c.value)}const l={texts:this.texts.map(c=>{const s=c.node,a=E.parentNode(s);return a&&a.tagName==="TEXTAREA"&&this.genTextAreaValueMutation(a),{id:this.mirror.getId(s),value:c.value}}).filter(c=>!t.has(c.id)).filter(c=>this.mirror.has(c.id)),attributes:this.attributes.map(c=>{const{attributes:s}=c;if(typeof s.style=="string"){const a=JSON.stringify(c.styleDiff),f=JSON.stringify(c._unchangedStyles);a.length<s.style.length&&(a+f).split("var(").length===s.style.split("var(").length&&(s.style=c.styleDiff)}return{id:this.mirror.getId(c.node),attributes:s}}).filter(c=>!t.has(c.id)).filter(c=>this.mirror.has(c.id)),removes:this.removes,adds:e};!l.texts.length&&!l.attributes.length&&!l.removes.length&&!l.adds.length||(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.removesSubTreeCache=new Set,this.movedMap={},this.mutationCb(l))}),S(this,"genTextAreaValueMutation",e=>{let t=this.attributeMap.get(e);t||(t={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(t),this.attributeMap.set(e,t));const r=Array.from(E.childNodes(e),n=>E.textContent(n)||"").join("");t.attributes.value=st({element:e,maskInputOptions:this.maskInputOptions,tagName:e.tagName,type:at(e),value:r,maskInputFn:this.maskInputFn})}),S(this,"processMutation",e=>{if(!jt(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":{const t=E.textContent(e.target);!Q(e.target,this.blockClass,this.blockSelector,!1)&&t!==e.oldValue&&this.texts.push({value:Kr(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,rn(e.target)):t.replace(/[\S]/g,"*"):t,node:e.target});break}case"attributes":{const t=e.target;let r=e.attributeName,n=e.target.getAttribute(r);if(r==="value"){const i=at(t);n=st({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:i,value:n,maskInputFn:this.maskInputFn})}if(Q(e.target,this.blockClass,this.blockSelector,!1)||n===e.oldValue)return;let o=this.attributeMap.get(e.target);if(t.tagName==="IFRAME"&&r==="src"&&!this.keepIframeSrcFn(n))if(!t.contentDocument)r="rr_src";else return;if(o||(o={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(o),this.attributeMap.set(e.target,o)),r==="type"&&t.tagName==="INPUT"&&(e.oldValue||"").toLowerCase()==="password"&&t.setAttribute("data-rr-is-password","true"),!Yr(t.tagName,r))if(o.attributes[r]=Xr(this.doc,ve(t.tagName),ve(r),n),r==="style"){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch{this.unattachedDoc=this.doc}const i=this.unattachedDoc.createElement("span");e.oldValue&&i.setAttribute("style",e.oldValue);for(const l of Array.from(t.style)){const c=t.style.getPropertyValue(l),s=t.style.getPropertyPriority(l);c!==i.style.getPropertyValue(l)||s!==i.style.getPropertyPriority(l)?s===""?o.styleDiff[l]=c:o.styleDiff[l]=[c,s]:o._unchangedStyles[l]=[c,s]}for(const l of Array.from(i.style))t.style.getPropertyValue(l)===""&&(o.styleDiff[l]=!1)}else r==="open"&&t.tagName==="DIALOG"&&(t.matches("dialog:modal")?o.attributes.rr_open_mode="modal":o.attributes.rr_open_mode="non-modal");break}case"childList":if(Q(e.target,this.blockClass,this.blockSelector,!0))return;if(e.target.tagName==="TEXTAREA"){this.genTextAreaValueMutation(e.target);return}e.addedNodes.forEach(t=>this.genAdds(t,e.target)),e.removedNodes.forEach(t=>{const r=this.mirror.getId(t),n=je(e.target)?this.mirror.getId(E.host(e.target)):this.mirror.getId(e.target);Q(e.target,this.blockClass,this.blockSelector,!1)||jt(t,this.mirror,this.slimDOMOptions)||!Zs(t,this.mirror)||(this.addedSet.has(t)?(qt(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&r===-1||nn(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[un(r,n)]?qt(this.movedSet,t):(this.removes.push({parentId:n,id:r,isShadow:je(e.target)&&Ge(e.target)?!0:void 0}),ia(t,this.removesSubTreeCache))),this.mapRemoves.push(t))})}}),S(this,"genAdds",(e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!(this.addedSet.has(e)||this.movedSet.has(e))){if(this.mirror.hasNode(e)){if(jt(e,this.mirror,this.slimDOMOptions))return;this.movedSet.add(e);let r=null;t&&this.mirror.hasNode(t)&&(r=this.mirror.getId(t)),r&&r!==-1&&(this.movedMap[un(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);Q(e,this.blockClass,this.blockSelector,!1)||(E.childNodes(e).forEach(r=>this.genAdds(r)),Vt(e)&&E.childNodes(E.shadowRoot(e)).forEach(r=>{this.processedNodeManager.add(r,this),this.genAdds(r,e)}))}})}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(t=>{this[t]=e[t]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}};function qt(e,t){e.delete(t),E.childNodes(t).forEach(r=>qt(e,r))}function ia(e,t){const r=[e];for(;r.length;){const n=r.pop();t.has(n)||(t.add(n),E.childNodes(n).forEach(o=>r.push(o)))}}function dn(e,t,r){return e.size===0?!1:sa(e,t)}function sa(e,t,r){const n=E.parentNode(t);return n?e.has(n):!1}function fn(e,t){return e.size===0?!1:pn(e,t)}function pn(e,t){const r=E.parentNode(t);return r?e.has(r)?!0:pn(e,r):!1}var Xe;function aa(e){Xe=e}function la(){Xe=void 0}var A=e=>Xe?(...r)=>{try{return e(...r)}catch(n){if(Xe&&Xe(n)===!0)return;throw n}}:e,ye=[];function Ye(e){try{if("composedPath"in e){const t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch{}return e&&e.target}function hn(e,t){const r=new oa;ye.push(r),r.init(e);const[n,o]=Ur(),i=new n(A(r.processMutations.bind(r)));return i.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),[i,o]}function ca({mousemoveCb:e,sampling:t,doc:r,mirror:n}){if(t.mousemove===!1)return()=>{};const o=typeof t.mousemove=="number"?t.mousemove:50,i=typeof t.mousemoveCallback=="number"?t.mousemoveCallback:500;let l=[],c;const s=qe(A(p=>{const h=Date.now()-c;e(l.map(d=>(d.timeOffset-=h,d)),p),l=[],c=null}),i),a=A(qe(A(p=>{const h=Ye(p),{clientX:d,clientY:u}=Gt(p)?p.changedTouches[0]:p;c||(c=He()),l.push({x:d,y:u,id:n.getId(h),timeOffset:He()-c}),s(typeof DragEvent!="undefined"&&p instanceof DragEvent?O.Drag:p instanceof MouseEvent?O.MouseMove:O.TouchMove)}),o,{trailing:!1})),f=[Z("mousemove",a,r),Z("touchmove",a,r),Z("drag",a,r)];return A(()=>{f.forEach(p=>p())})}function ua({mouseInteractionCb:e,doc:t,mirror:r,blockClass:n,blockSelector:o,sampling:i}){if(i.mouseInteraction===!1)return()=>{};const l=i.mouseInteraction===!0||i.mouseInteraction===void 0?{}:i.mouseInteraction,c=[];let s=null;const a=f=>p=>{const h=Ye(p);if(Q(h,n,o,!0))return;let d=null,u=f;if("pointerType"in p){switch(p.pointerType){case"mouse":d=ue.Mouse;break;case"touch":d=ue.Touch;break;case"pen":d=ue.Pen}d===ue.Touch?ee[f]===ee.MouseDown?u="TouchStart":ee[f]===ee.MouseUp&&(u="TouchEnd"):ue.Pen}else Gt(p)&&(d=ue.Touch);d!==null?(s=d,(u.startsWith("Touch")&&d===ue.Touch||u.startsWith("Mouse")&&d===ue.Mouse)&&(d=null)):ee[f]===ee.Click&&(d=s,s=null);const m=Gt(p)?p.changedTouches[0]:p;if(!m)return;const b=r.getId(h),{clientX:g,clientY:v}=m;A(e)({type:ee[u],id:b,x:g,y:v,...d!==null&&{pointerType:d}})};return Object.keys(ee).filter(f=>Number.isNaN(Number(f))&&!f.endsWith("_Departed")&&l[f]!==!1).forEach(f=>{let p=ve(f);const h=a(f);if(window.PointerEvent)switch(ee[f]){case ee.MouseDown:case ee.MouseUp:p=p.replace("mouse","pointer");break;case ee.TouchStart:case ee.TouchEnd:return}c.push(Z(p,h,t))}),A(()=>{c.forEach(f=>f())})}function mn({scrollCb:e,doc:t,mirror:r,blockClass:n,blockSelector:o,sampling:i}){return Z("scroll",A(qe(A(l=>{const c=Ye(l);if(!c||Q(c,n,o,!0))return;const s=r.getId(c);if(c===t&&t.defaultView){const a=Qr(t.defaultView);e({id:s,x:a.left,y:a.top})}else e({id:s,x:c.scrollLeft,y:c.scrollTop})}),i.scroll||100)),t)}function da({viewportResizeCb:e},{win:t}){let r=-1,n=-1;return Z("resize",A(qe(A(()=>{const o=en(),i=tn();(r!==o||n!==i)&&(e({width:Number(i),height:Number(o)}),r=o,n=i)}),200)),t)}var fa=["INPUT","TEXTAREA","SELECT"],bn=new WeakMap;function pa({inputCb:e,doc:t,mirror:r,blockClass:n,blockSelector:o,ignoreClass:i,ignoreSelector:l,maskInputOptions:c,maskInputFn:s,sampling:a,userTriggeredOnInput:f}){function p(g){let v=Ye(g);const y=g.isTrusted,x=v&&v.tagName;if(v&&x==="OPTION"&&(v=E.parentElement(v)),!v||!x||fa.indexOf(x)<0||Q(v,n,o,!0)||v.classList.contains(i)||l&&v.matches(l))return;let _=v.value,R=!1;const I=at(v)||"";I==="radio"||I==="checkbox"?R=v.checked:(c[x.toLowerCase()]||c[I])&&(_=st({element:v,maskInputOptions:c,tagName:x,type:I,value:_,maskInputFn:s})),h(v,f?{text:_,isChecked:R,userTriggered:y}:{text:_,isChecked:R});const D=v.name;I==="radio"&&D&&R&&t.querySelectorAll(`input[type="radio"][name="${D}"]`).forEach(N=>{if(N!==v){const w=N.value;h(N,f?{text:w,isChecked:!R,userTriggered:!1}:{text:w,isChecked:!R})}})}function h(g,v){const y=bn.get(g);if(!y||y.text!==v.text||y.isChecked!==v.isChecked){bn.set(g,v);const x=r.getId(g);A(e)({...v,id:x})}}const d=(a.input==="last"?["change"]:["input","change"]).map(g=>Z(g,A(p),t)),u=t.defaultView;if(!u)return()=>{d.forEach(g=>g())};const m=u.Object.getOwnPropertyDescriptor(u.HTMLInputElement.prototype,"value"),b=[[u.HTMLInputElement.prototype,"value"],[u.HTMLInputElement.prototype,"checked"],[u.HTMLSelectElement.prototype,"value"],[u.HTMLTextAreaElement.prototype,"value"],[u.HTMLSelectElement.prototype,"selectedIndex"],[u.HTMLOptionElement.prototype,"selected"]];return m&&m.set&&d.push(...b.map(g=>dt(g[0],g[1],{set(){A(p)({target:this,isTrusted:!1})}},!1,u))),A(()=>{d.forEach(g=>g())})}function ft(e){const t=[];function r(n,o){if(pt("CSSGroupingRule")&&n.parentRule instanceof CSSGroupingRule||pt("CSSMediaRule")&&n.parentRule instanceof CSSMediaRule||pt("CSSSupportsRule")&&n.parentRule instanceof CSSSupportsRule||pt("CSSConditionRule")&&n.parentRule instanceof CSSConditionRule){const i=Array.from(n.parentRule.cssRules).indexOf(n);return o.unshift(i),r(n.parentRule,o)}else if(n.parentStyleSheet){const i=Array.from(n.parentStyleSheet.cssRules).indexOf(n);o.unshift(i)}return o}return r(e,t)}function he(e,t,r){let n,o;return e?(e.ownerNode?n=t.getId(e.ownerNode):o=r.getId(e),{styleId:o,id:n}):{}}function ha({styleSheetRuleCb:e,mirror:t,stylesheetManager:r},{win:n}){if(!n.CSSStyleSheet||!n.CSSStyleSheet.prototype)return()=>{};const o=n.CSSStyleSheet.prototype.insertRule;n.CSSStyleSheet.prototype.insertRule=new Proxy(o,{apply:A((f,p,h)=>{const[d,u]=h,{id:m,styleId:b}=he(p,t,r.styleMirror);return(m&&m!==-1||b&&b!==-1)&&e({id:m,styleId:b,adds:[{rule:d,index:u}]}),f.apply(p,h)})}),n.CSSStyleSheet.prototype.addRule=function(f,p,h=this.cssRules.length){const d=`${f} { ${p} }`;return n.CSSStyleSheet.prototype.insertRule.apply(this,[d,h])};const i=n.CSSStyleSheet.prototype.deleteRule;n.CSSStyleSheet.prototype.deleteRule=new Proxy(i,{apply:A((f,p,h)=>{const[d]=h,{id:u,styleId:m}=he(p,t,r.styleMirror);return(u&&u!==-1||m&&m!==-1)&&e({id:u,styleId:m,removes:[{index:d}]}),f.apply(p,h)})}),n.CSSStyleSheet.prototype.removeRule=function(f){return n.CSSStyleSheet.prototype.deleteRule.apply(this,[f])};let l;n.CSSStyleSheet.prototype.replace&&(l=n.CSSStyleSheet.prototype.replace,n.CSSStyleSheet.prototype.replace=new Proxy(l,{apply:A((f,p,h)=>{const[d]=h,{id:u,styleId:m}=he(p,t,r.styleMirror);return(u&&u!==-1||m&&m!==-1)&&e({id:u,styleId:m,replace:d}),f.apply(p,h)})}));let c;n.CSSStyleSheet.prototype.replaceSync&&(c=n.CSSStyleSheet.prototype.replaceSync,n.CSSStyleSheet.prototype.replaceSync=new Proxy(c,{apply:A((f,p,h)=>{const[d]=h,{id:u,styleId:m}=he(p,t,r.styleMirror);return(u&&u!==-1||m&&m!==-1)&&e({id:u,styleId:m,replaceSync:d}),f.apply(p,h)})}));const s={};ht("CSSGroupingRule")?s.CSSGroupingRule=n.CSSGroupingRule:(ht("CSSMediaRule")&&(s.CSSMediaRule=n.CSSMediaRule),ht("CSSConditionRule")&&(s.CSSConditionRule=n.CSSConditionRule),ht("CSSSupportsRule")&&(s.CSSSupportsRule=n.CSSSupportsRule));const a={};return Object.entries(s).forEach(([f,p])=>{a[f]={insertRule:p.prototype.insertRule,deleteRule:p.prototype.deleteRule},p.prototype.insertRule=new Proxy(a[f].insertRule,{apply:A((h,d,u)=>{const[m,b]=u,{id:g,styleId:v}=he(d.parentStyleSheet,t,r.styleMirror);return(g&&g!==-1||v&&v!==-1)&&e({id:g,styleId:v,adds:[{rule:m,index:[...ft(d),b||0]}]}),h.apply(d,u)})}),p.prototype.deleteRule=new Proxy(a[f].deleteRule,{apply:A((h,d,u)=>{const[m]=u,{id:b,styleId:g}=he(d.parentStyleSheet,t,r.styleMirror);return(b&&b!==-1||g&&g!==-1)&&e({id:b,styleId:g,removes:[{index:[...ft(d),m]}]}),h.apply(d,u)})})}),A(()=>{n.CSSStyleSheet.prototype.insertRule=o,n.CSSStyleSheet.prototype.deleteRule=i,l&&(n.CSSStyleSheet.prototype.replace=l),c&&(n.CSSStyleSheet.prototype.replaceSync=c),Object.entries(s).forEach(([f,p])=>{p.prototype.insertRule=a[f].insertRule,p.prototype.deleteRule=a[f].deleteRule})})}function gn({mirror:e,stylesheetManager:t},r){var n,o,i;let l=null;r.nodeName==="#document"?l=e.getId(r):l=e.getId(E.host(r));const c=r.nodeName==="#document"?(n=r.defaultView)==null?void 0:n.Document:(i=(o=r.ownerDocument)==null?void 0:o.defaultView)==null?void 0:i.ShadowRoot,s=c!=null&&c.prototype?Object.getOwnPropertyDescriptor(c==null?void 0:c.prototype,"adoptedStyleSheets"):void 0;return l===null||l===-1||!c||!s?()=>{}:(Object.defineProperty(r,"adoptedStyleSheets",{configurable:s.configurable,enumerable:s.enumerable,get(){var a;return(a=s.get)==null?void 0:a.call(this)},set(a){var f;const p=(f=s.set)==null?void 0:f.call(this,a);if(l!==null&&l!==-1)try{t.adoptStyleSheets(a,l)}catch{}return p}}),A(()=>{Object.defineProperty(r,"adoptedStyleSheets",{configurable:s.configurable,enumerable:s.enumerable,get:s.get,set:s.set})}))}function ma({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:r,stylesheetManager:n},{win:o}){const i=o.CSSStyleDeclaration.prototype.setProperty;o.CSSStyleDeclaration.prototype.setProperty=new Proxy(i,{apply:A((c,s,a)=>{var f;const[p,h,d]=a;if(r.has(p))return i.apply(s,[p,h,d]);const{id:u,styleId:m}=he((f=s.parentRule)==null?void 0:f.parentStyleSheet,t,n.styleMirror);return(u&&u!==-1||m&&m!==-1)&&e({id:u,styleId:m,set:{property:p,value:h,priority:d},index:ft(s.parentRule)}),c.apply(s,a)})});const l=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=new Proxy(l,{apply:A((c,s,a)=>{var f;const[p]=a;if(r.has(p))return l.apply(s,[p]);const{id:h,styleId:d}=he((f=s.parentRule)==null?void 0:f.parentStyleSheet,t,n.styleMirror);return(h&&h!==-1||d&&d!==-1)&&e({id:h,styleId:d,remove:{property:p},index:ft(s.parentRule)}),c.apply(s,a)})}),A(()=>{o.CSSStyleDeclaration.prototype.setProperty=i,o.CSSStyleDeclaration.prototype.removeProperty=l})}function ba({mediaInteractionCb:e,blockClass:t,blockSelector:r,mirror:n,sampling:o,doc:i}){const l=A(s=>qe(A(a=>{const f=Ye(a);if(!f||Q(f,t,r,!0))return;const{currentTime:p,volume:h,muted:d,playbackRate:u,loop:m}=f;e({type:s,id:n.getId(f),currentTime:p,volume:h,muted:d,playbackRate:u,loop:m})}),o.media||500)),c=[Z("play",l(Me.Play),i),Z("pause",l(Me.Pause),i),Z("seeked",l(Me.Seeked),i),Z("volumechange",l(Me.VolumeChange),i),Z("ratechange",l(Me.RateChange),i)];return A(()=>{c.forEach(s=>s())})}function ga({fontCb:e,doc:t}){const r=t.defaultView;if(!r)return()=>{};const n=[],o=new WeakMap,i=r.FontFace;r.FontFace=function(s,a,f){const p=new i(s,a,f);return o.set(p,{family:s,buffer:typeof a!="string",descriptors:f,fontSource:typeof a=="string"?a:JSON.stringify(Array.from(new Uint8Array(a)))}),p};const l=ge(t.fonts,"add",function(c){return function(s){return setTimeout(A(()=>{const a=o.get(s);a&&(e(a),o.delete(s))}),0),c.apply(this,[s])}});return n.push(()=>{r.FontFace=i}),n.push(l),A(()=>{n.forEach(c=>c())})}function va(e){const{doc:t,mirror:r,blockClass:n,blockSelector:o,selectionCb:i}=e;let l=!0;const c=A(()=>{const s=t.getSelection();if(!s||l&&(s!=null&&s.isCollapsed))return;l=s.isCollapsed||!1;const a=[],f=s.rangeCount||0;for(let p=0;p<f;p++){const{startContainer:h,startOffset:d,endContainer:u,endOffset:m}=s.getRangeAt(p);Q(h,n,o,!0)||Q(u,n,o,!0)||a.push({start:r.getId(h),startOffset:d,end:r.getId(u),endOffset:m})}i({ranges:a})});return c(),Z("selectionchange",c)}function ya({doc:e,customElementCb:t}){const r=e.defaultView;return!r||!r.customElements?()=>{}:ge(r.customElements,"define",function(n){return function(o,i,l){try{t({define:{name:o}})}catch{console.warn(`Custom element callback failed for ${o}`)}return n.apply(this,[o,i,l])}})}function Sa(e,t){const{mutationCb:r,mousemoveCb:n,mouseInteractionCb:o,scrollCb:i,viewportResizeCb:l,inputCb:c,mediaInteractionCb:s,styleSheetRuleCb:a,styleDeclarationCb:f,canvasMutationCb:p,fontCb:h,selectionCb:d,customElementCb:u}=e;e.mutationCb=(...m)=>{t.mutation&&t.mutation(...m),r(...m)},e.mousemoveCb=(...m)=>{t.mousemove&&t.mousemove(...m),n(...m)},e.mouseInteractionCb=(...m)=>{t.mouseInteraction&&t.mouseInteraction(...m),o(...m)},e.scrollCb=(...m)=>{t.scroll&&t.scroll(...m),i(...m)},e.viewportResizeCb=(...m)=>{t.viewportResize&&t.viewportResize(...m),l(...m)},e.inputCb=(...m)=>{t.input&&t.input(...m),c(...m)},e.mediaInteractionCb=(...m)=>{t.mediaInteaction&&t.mediaInteaction(...m),s(...m)},e.styleSheetRuleCb=(...m)=>{t.styleSheetRule&&t.styleSheetRule(...m),a(...m)},e.styleDeclarationCb=(...m)=>{t.styleDeclaration&&t.styleDeclaration(...m),f(...m)},e.canvasMutationCb=(...m)=>{t.canvasMutation&&t.canvasMutation(...m),p(...m)},e.fontCb=(...m)=>{t.font&&t.font(...m),h(...m)},e.selectionCb=(...m)=>{t.selection&&t.selection(...m),d(...m)},e.customElementCb=(...m)=>{t.customElement&&t.customElement(...m),u(...m)}}function wa(e,t={}){const r=e.doc.defaultView;if(!r)return()=>{};Sa(e,t);let n,o=()=>{};e.recordDOM&&([n,o]=hn(e,e.doc));const i=ca(e),l=ua(e),c=mn(e),s=da(e,{win:r}),a=pa(e),f=ba(e);let p=()=>{},h=()=>{},d=()=>{},u=()=>{};e.recordDOM&&(p=ha(e,{win:r}),h=gn(e,e.doc),d=ma(e,{win:r}),e.collectFonts&&(u=ga(e)));const m=va(e),b=ya(e),g=[];for(const v of e.plugins)g.push(v.observer(v.callback,r,v.options));return A(()=>{ye.forEach(v=>v.reset()),n==null||n.disconnect(),o(),i(),l(),c(),s(),a(),f(),p(),h(),d(),u(),m(),b(),g.forEach(v=>v())})}function pt(e){return typeof window[e]!="undefined"}function ht(e){return!!(typeof window[e]!="undefined"&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}for(var vn=class{constructor(e){S(this,"iframeIdToRemoteIdMap",new WeakMap),S(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=e}getId(e,t,r,n){const o=r||this.getIdToRemoteIdMap(e),i=n||this.getRemoteIdToIdMap(e);let l=o.get(t);return l||(l=this.generateIdFn(),o.set(t,l),i.set(l,t)),l}getIds(e,t){const r=this.getIdToRemoteIdMap(e),n=this.getRemoteIdToIdMap(e);return t.map(o=>this.getId(e,o,r,n))}getRemoteId(e,t,r){const n=r||this.getRemoteIdToIdMap(e);if(typeof t!="number")return t;const o=n.get(t);return o||-1}getRemoteIds(e,t){const r=this.getRemoteIdToIdMap(e);return t.map(n=>this.getRemoteId(e,n,r))}reset(e){if(!e){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){let t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}getRemoteIdToIdMap(e){let t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}},xa=class{constructor(e){S(this,"iframes",new WeakMap),S(this,"crossOriginIframeMap",new WeakMap),S(this,"crossOriginIframeMirror",new vn(Gr)),S(this,"crossOriginIframeStyleMirror"),S(this,"crossOriginIframeRootIdMap",new WeakMap),S(this,"mirror"),S(this,"mutationCb"),S(this,"wrappedEmit"),S(this,"loadListener"),S(this,"stylesheetManager"),S(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new vn(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,t){var r,n;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&((r=e.contentWindow)==null||r.addEventListener("message",this.handleMessage.bind(this))),(n=this.loadListener)==null||n.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){const t=e;if(t.data.type!=="rrweb"||t.origin!==t.data.origin||!e.source)return;const r=this.crossOriginIframeMap.get(e.source);if(!r)return;const n=this.transformCrossOriginEvent(r,t.data.event);n&&this.wrappedEmit(n,t.data.isCheckout)}transformCrossOriginEvent(e,t){var r;switch(t.type){case F.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);const n=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,n),this.patchRootIdOnNode(t.data.node,n),{timestamp:t.timestamp,type:F.IncrementalSnapshot,data:{source:O.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case F.Meta:case F.Load:case F.DomContentLoaded:return!1;case F.Plugin:return t;case F.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case F.IncrementalSnapshot:switch(t.data.source){case O.Mutation:return t.data.adds.forEach(n=>{this.replaceIds(n,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(n.node,e);const o=this.crossOriginIframeRootIdMap.get(e);o&&this.patchRootIdOnNode(n.node,o)}),t.data.removes.forEach(n=>{this.replaceIds(n,e,["parentId","id"])}),t.data.attributes.forEach(n=>{this.replaceIds(n,e,["id"])}),t.data.texts.forEach(n=>{this.replaceIds(n,e,["id"])}),t;case O.Drag:case O.TouchMove:case O.MouseMove:return t.data.positions.forEach(n=>{this.replaceIds(n,e,["id"])}),t;case O.ViewportResize:return!1;case O.MediaInteraction:case O.MouseInteraction:case O.Scroll:case O.CanvasMutation:case O.Input:return this.replaceIds(t.data,e,["id"]),t;case O.StyleSheetRule:case O.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case O.Font:return t;case O.Selection:return t.data.ranges.forEach(n=>{this.replaceIds(n,e,["start","end"])}),t;case O.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),(r=t.data.styles)==null||r.forEach(n=>{this.replaceStyleIds(n,e,["styleId"])}),t}}return!1}replace(e,t,r,n){for(const o of n)!Array.isArray(t[o])&&typeof t[o]!="number"||(Array.isArray(t[o])?t[o]=e.getIds(r,t[o]):t[o]=e.getId(r,t[o]));return t}replaceIds(e,t,r){return this.replace(this.crossOriginIframeMirror,e,t,r)}replaceStyleIds(e,t,r){return this.replace(this.crossOriginIframeStyleMirror,e,t,r)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach(r=>{this.replaceIdOnNode(r,t)})}patchRootIdOnNode(e,t){e.type!==q.Document&&!e.rootId&&(e.rootId=t),"childNodes"in e&&e.childNodes.forEach(r=>{this.patchRootIdOnNode(r,t)})}},ka=class{constructor(e){S(this,"shadowDoms",new WeakSet),S(this,"mutationCb"),S(this,"scrollCb"),S(this,"bypassOptions"),S(this,"mirror"),S(this,"restoreHandlers",[]),this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(e,t){if(!Ge(e)||this.shadowDoms.has(e))return;this.shadowDoms.add(e);const[r]=hn({...this.bypassOptions,doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(mn({...this.bypassOptions,scrollCb:this.scrollCb,doc:e,mirror:this.mirror})),setTimeout(()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(E.host(e))),this.restoreHandlers.push(gn({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))},0)}observeAttachShadow(e){!e.contentWindow||!e.contentDocument||this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}patchAttachShadow(e,t){const r=this;this.restoreHandlers.push(ge(e.prototype,"attachShadow",function(n){return function(o){const i=n.call(this,o),l=E.shadowRoot(this);return l&&ln(this)&&r.addShadowRoot(l,t),i}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch{}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}},Te="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ca=typeof Uint8Array=="undefined"?[]:new Uint8Array(256),mt=0;mt<Te.length;mt++)Ca[Te.charCodeAt(mt)]=mt;var Ma=function(e){var t=new Uint8Array(e),r,n=t.length,o="";for(r=0;r<n;r+=3)o+=Te[t[r]>>2],o+=Te[(t[r]&3)<<4|t[r+1]>>4],o+=Te[(t[r+1]&15)<<2|t[r+2]>>6],o+=Te[t[r+2]&63];return n%3===2?o=o.substring(0,o.length-1)+"=":n%3===1&&(o=o.substring(0,o.length-2)+"=="),o},yn=new Map;function Ea(e,t){let r=yn.get(e);return r||(r=new Map,yn.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}var Sn=(e,t,r)=>{if(!e||!(xn(e,t)||typeof e=="object"))return;const n=e.constructor.name,o=Ea(r,n);let i=o.indexOf(e);return i===-1&&(i=o.length,o.push(e)),i};function bt(e,t,r){if(e instanceof Array)return e.map(n=>bt(n,t,r));if(e===null)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray)return{rr_type:e.constructor.name,args:[Object.values(e)]};if(e instanceof ArrayBuffer)return{rr_type:e.constructor.name,base64:Ma(e)};if(e instanceof DataView)return{rr_type:e.constructor.name,args:[bt(e.buffer,t,r),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){const n=e.constructor.name,{src:o}=e;return{rr_type:n,src:o}}else{if(e instanceof HTMLCanvasElement)return{rr_type:"HTMLImageElement",src:e.toDataURL()};if(e instanceof ImageData)return{rr_type:e.constructor.name,args:[bt(e.data,t,r),e.width,e.height]};if(xn(e,t)||typeof e=="object")return{rr_type:e.constructor.name,index:Sn(e,t,r)}}return e}var wn=(e,t,r)=>e.map(n=>bt(n,t,r)),xn=(e,t)=>!!["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(n=>typeof t[n]=="function").find(n=>e instanceof t[n]);function Ia(e,t,r,n){const o=[],i=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const l of i)try{if(typeof t.CanvasRenderingContext2D.prototype[l]!="function")continue;const c=ge(t.CanvasRenderingContext2D.prototype,l,function(s){return function(...a){return Q(this.canvas,r,n,!0)||setTimeout(()=>{const f=wn(a,t,this);e(this.canvas,{type:Ce["2D"],property:l,args:f})},0),s.apply(this,a)}});o.push(c)}catch{const c=dt(t.CanvasRenderingContext2D.prototype,l,{set(s){e(this.canvas,{type:Ce["2D"],property:l,args:[s],setter:!0})}});o.push(c)}return()=>{o.forEach(l=>l())}}function Ra(e){return e==="experimental-webgl"?"webgl":e}function kn(e,t,r,n){const o=[];try{const i=ge(e.HTMLCanvasElement.prototype,"getContext",function(l){return function(c,...s){if(!Q(this,t,r,!0)){const a=Ra(c);if("__context"in this||(this.__context=a),n&&["webgl","webgl2"].includes(a))if(s[0]&&typeof s[0]=="object"){const f=s[0];f.preserveDrawingBuffer||(f.preserveDrawingBuffer=!0)}else s.splice(0,1,{preserveDrawingBuffer:!0})}return l.apply(this,[c,...s])}});o.push(i)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{o.forEach(i=>i())}}function Cn(e,t,r,n,o,i){const l=[],c=Object.getOwnPropertyNames(e);for(const s of c)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(s))try{if(typeof e[s]!="function")continue;const a=ge(e,s,function(f){return function(...p){const h=f.apply(this,p);if(Sn(h,i,this),"tagName"in this.canvas&&!Q(this.canvas,n,o,!0)){const d=wn(p,i,this),u={type:t,property:s,args:d};r(this.canvas,u)}return h}});l.push(a)}catch{const a=dt(e,s,{set(f){r(this.canvas,{type:t,property:s,args:[f],setter:!0})}});l.push(a)}return l}function _a(e,t,r,n){const o=[];return typeof t.WebGLRenderingContext!="undefined"&&o.push(...Cn(t.WebGLRenderingContext.prototype,Ce.WebGL,e,r,n,t)),typeof t.WebGL2RenderingContext!="undefined"&&o.push(...Cn(t.WebGL2RenderingContext.prototype,Ce.WebGL2,e,r,n,t)),()=>{o.forEach(i=>i())}}var Mn=`(function() {
598
+ or you can use record.mirror to access the mirror instance during recording.`,Mn={map:{},getId(){return console.error(xe),-1},getNode(){return console.error(xe),null},removeNodeFromMap(){console.error(xe)},has(){return console.error(xe),!1},reset(){console.error(xe)}};typeof window!="undefined"&&window.Proxy&&window.Reflect&&(Mn=new Proxy(Mn,{get(e,t,n){return t==="map"&&console.error(xe),Reflect.get(e,t,n)}}));function Le(e,t,n={}){let r=null,o=0;return function(...i){const s=Date.now();!o&&n.leading===!1&&(o=s);const l=t-(s-o),a=this;l<=0||l>t?(r&&(clearTimeout(r),r=null),o=s,e.apply(a,i)):!r&&n.trailing!==!1&&(r=setTimeout(()=>{o=n.leading===!1?0:Date.now(),r=null,e.apply(a,i)},l))}}function Xe(e,t,n,r,o=window){const i=o.Object.getOwnPropertyDescriptor(e,t);return o.Object.defineProperty(e,t,r?n:{set(s){setTimeout(()=>{n.set.call(this,s)},0),i&&i.set&&i.set.call(this,s)}}),()=>Xe(e,t,i||{},!0)}function En(e){var t,n,r,o;const i=e.document;return{left:i.scrollingElement?i.scrollingElement.scrollLeft:e.pageXOffset!==void 0?e.pageXOffset:i.documentElement.scrollLeft||(i==null?void 0:i.body)&&((t=M.parentElement(i.body))==null?void 0:t.scrollLeft)||((n=i==null?void 0:i.body)==null?void 0:n.scrollLeft)||0,top:i.scrollingElement?i.scrollingElement.scrollTop:e.pageYOffset!==void 0?e.pageYOffset:(i==null?void 0:i.documentElement.scrollTop)||(i==null?void 0:i.body)&&((r=M.parentElement(i.body))==null?void 0:r.scrollTop)||((o=i==null?void 0:i.body)==null?void 0:o.scrollTop)||0}}function In(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function _n(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Rn(e){return e?e.nodeType===e.ELEMENT_NODE?e:M.parentElement(e):null}function q(e,t,n,r){if(!e)return!1;const o=Rn(e);if(!o)return!1;try{if(typeof t=="string"){if(o.classList.contains(t)||r&&o.closest("."+t)!==null)return!0}else if(qe(o,t,r))return!0}catch{}return!!(n&&(o.matches(n)||r&&o.closest(n)!==null))}function cs(e,t){return t.getId(e)!==-1}function Et(e,t,n){return e.tagName==="TITLE"&&n.headTitleMutations?!0:t.getId(e)===Te}function Tn(e,t){if(_e(e))return!1;const n=t.getId(e);if(!t.has(n))return!0;const r=M.parentNode(e);return r&&r.nodeType===e.DOCUMENT_NODE?!1:r?Tn(r,t):!0}function It(e){return!!e.changedTouches}function us(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach)}function Ln(e,t){return!!(e.nodeName==="IFRAME"&&t.getMeta(e))}function Nn(e,t){return!!(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function _t(e){return e?e instanceof ls&&"shadowRoot"in e?!!e.shadowRoot:!!M.shadowRoot(e):!1}var ds=class{constructor(){S(this,"id",1),S(this,"styleIDMap",new WeakMap),S(this,"idStyleMap",new Map)}getId(e){var t;return(t=this.styleIDMap.get(e))!==null&&t!==void 0?t:-1}has(e){return this.styleIDMap.has(e)}add(e,t){if(this.has(e))return this.getId(e);let n;return t===void 0?n=this.id++:n=t,this.styleIDMap.set(e,n),this.idStyleMap.set(n,e),n}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}};function On(e){var t;let n=null;return"getRootNode"in e&&((t=M.getRootNode(e))==null?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&M.host(M.getRootNode(e))&&(n=M.host(M.getRootNode(e))),n}function fs(e){let t=e,n;for(;n=On(t);)t=n;return t}function ps(e){const t=M.ownerDocument(e);if(!t)return!1;const n=fs(e);return M.contains(t,n)}function An(e){const t=M.ownerDocument(e);return t?M.contains(t,e)||ps(e):!1}function Dn(e){return"__ln"in e}var hs=class{constructor(){S(this,"length",0),S(this,"head",null),S(this,"tail",null)}get(e){if(e>=this.length)throw new Error("Position outside of list range");let t=this.head;for(let n=0;n<e;n++)t=(t==null?void 0:t.next)||null;return t}addNode(e){const t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&Dn(e.previousSibling)){const n=e.previousSibling.__ln.next;t.next=n,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,n&&(n.previous=t)}else if(e.nextSibling&&Dn(e.nextSibling)&&e.nextSibling.__ln.previous){const n=e.nextSibling.__ln.previous;t.previous=n,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,n&&(n.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;t.next===null&&(this.tail=t),this.length++}removeNode(e){const t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next?t.next.previous=t.previous:this.tail=t.previous):(this.head=t.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)}},Fn=(e,t)=>`${e}@${t}`,ms=class{constructor(){S(this,"frozen",!1),S(this,"locked",!1),S(this,"texts",[]),S(this,"attributes",[]),S(this,"attributeMap",new WeakMap),S(this,"removes",[]),S(this,"mapRemoves",[]),S(this,"movedMap",{}),S(this,"addedSet",new Set),S(this,"movedSet",new Set),S(this,"droppedSet",new Set),S(this,"removesSubTreeCache",new Set),S(this,"mutationCb"),S(this,"blockClass"),S(this,"blockSelector"),S(this,"maskTextClass"),S(this,"maskTextSelector"),S(this,"inlineStylesheet"),S(this,"maskInputOptions"),S(this,"maskTextFn"),S(this,"maskInputFn"),S(this,"keepIframeSrcFn"),S(this,"recordCanvas"),S(this,"inlineImages"),S(this,"slimDOMOptions"),S(this,"dataURLOptions"),S(this,"doc"),S(this,"mirror"),S(this,"iframeManager"),S(this,"stylesheetManager"),S(this,"shadowDomManager"),S(this,"canvasManager"),S(this,"processedNodeManager"),S(this,"unattachedDoc"),S(this,"processMutations",e=>{e.forEach(this.processMutation),this.emit()}),S(this,"emit",()=>{if(this.frozen||this.locked)return;const e=[],t=new Set,n=new hs,r=l=>{let a=l,c=Te;for(;c===Te;)a=a&&a.nextSibling,c=a&&this.mirror.getId(a);return c},o=l=>{const a=M.parentNode(l);if(!a||!An(l))return;let c=!1;if(l.nodeType===Node.TEXT_NODE){const u=a.tagName;if(u==="TEXTAREA")return;u==="STYLE"&&this.addedSet.has(a)&&(c=!0)}const p=_e(a)?this.mirror.getId(On(l)):this.mirror.getId(a),m=r(l);if(p===-1||m===-1)return n.addNode(l);const h=we(l,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:u=>{Ln(u,this.mirror)&&this.iframeManager.addIframe(u),Nn(u,this.mirror)&&this.stylesheetManager.trackLinkElement(u),_t(l)&&this.shadowDomManager.addShadowRoot(M.shadowRoot(l),this.doc)},onIframeLoad:(u,d)=>{this.iframeManager.attachIframe(u,d),this.shadowDomManager.observeAttachShadow(u)},onStylesheetLoad:(u,d)=>{this.stylesheetManager.attachLinkElement(u,d)},cssCaptured:c});h&&(e.push({parentId:p,nextId:m,node:h}),t.add(h.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const l of this.movedSet)Pn(this.removesSubTreeCache,l,this.mirror)&&!this.movedSet.has(M.parentNode(l))||o(l);for(const l of this.addedSet)!Un(this.droppedSet,l)&&!Pn(this.removesSubTreeCache,l,this.mirror)||Un(this.movedSet,l)?o(l):this.droppedSet.add(l);let i=null;for(;n.length;){let l=null;if(i){const a=this.mirror.getId(M.parentNode(i.value)),c=r(i.value);a!==-1&&c!==-1&&(l=i)}if(!l){let a=n.tail;for(;a;){const c=a;if(a=a.previous,c){const p=this.mirror.getId(M.parentNode(c.value));if(r(c.value)===-1)continue;if(p!==-1){l=c;break}else{const m=c.value,h=M.parentNode(m);if(h&&h.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const u=M.host(h);if(this.mirror.getId(u)!==-1){l=c;break}}}}}}if(!l){for(;n.head;)n.removeNode(n.head.value);break}i=l.previous,n.removeNode(l.value),o(l.value)}const s={texts:this.texts.map(l=>{const a=l.node,c=M.parentNode(a);return c&&c.tagName==="TEXTAREA"&&this.genTextAreaValueMutation(c),{id:this.mirror.getId(a),value:l.value}}).filter(l=>!t.has(l.id)).filter(l=>this.mirror.has(l.id)),attributes:this.attributes.map(l=>{const{attributes:a}=l;if(typeof a.style=="string"){const c=JSON.stringify(l.styleDiff),p=JSON.stringify(l._unchangedStyles);c.length<a.style.length&&(c+p).split("var(").length===a.style.split("var(").length&&(a.style=l.styleDiff)}return{id:this.mirror.getId(l.node),attributes:a}}).filter(l=>!t.has(l.id)).filter(l=>this.mirror.has(l.id)),removes:this.removes,adds:e};!s.texts.length&&!s.attributes.length&&!s.removes.length&&!s.adds.length||(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.removesSubTreeCache=new Set,this.movedMap={},this.mutationCb(s))}),S(this,"genTextAreaValueMutation",e=>{let t=this.attributeMap.get(e);t||(t={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(t),this.attributeMap.set(e,t));const n=Array.from(M.childNodes(e),r=>M.textContent(r)||"").join("");t.attributes.value=He({element:e,maskInputOptions:this.maskInputOptions,tagName:e.tagName,type:je(e),value:n,maskInputFn:this.maskInputFn})}),S(this,"processMutation",e=>{if(!Et(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":{const t=M.textContent(e.target);!q(e.target,this.blockClass,this.blockSelector,!1)&&t!==e.oldValue&&this.texts.push({value:kn(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,Rn(e.target)):t.replace(/[\S]/g,"*"):t,node:e.target});break}case"attributes":{const t=e.target;let n=e.attributeName,r=e.target.getAttribute(n);if(n==="value"){const i=je(t);r=He({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:i,value:r,maskInputFn:this.maskInputFn})}if(q(e.target,this.blockClass,this.blockSelector,!1)||r===e.oldValue)return;let o=this.attributeMap.get(e.target);if(t.tagName==="IFRAME"&&n==="src"&&!this.keepIframeSrcFn(r))if(!t.contentDocument)n="rr_src";else return;if(o||(o={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(o),this.attributeMap.set(e.target,o)),n==="type"&&t.tagName==="INPUT"&&(e.oldValue||"").toLowerCase()==="password"&&t.setAttribute("data-rr-is-password","true"),!xn(t.tagName,n))if(o.attributes[n]=wn(this.doc,de(t.tagName),de(n),r),n==="style"){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch{this.unattachedDoc=this.doc}const i=this.unattachedDoc.createElement("span");e.oldValue&&i.setAttribute("style",e.oldValue);for(const s of Array.from(t.style)){const l=t.style.getPropertyValue(s),a=t.style.getPropertyPriority(s);l!==i.style.getPropertyValue(s)||a!==i.style.getPropertyPriority(s)?a===""?o.styleDiff[s]=l:o.styleDiff[s]=[l,a]:o._unchangedStyles[s]=[l,a]}for(const s of Array.from(i.style))t.style.getPropertyValue(s)===""&&(o.styleDiff[s]=!1)}else n==="open"&&t.tagName==="DIALOG"&&(t.matches("dialog:modal")?o.attributes.rr_open_mode="modal":o.attributes.rr_open_mode="non-modal");break}case"childList":if(q(e.target,this.blockClass,this.blockSelector,!0))return;if(e.target.tagName==="TEXTAREA"){this.genTextAreaValueMutation(e.target);return}e.addedNodes.forEach(t=>this.genAdds(t,e.target)),e.removedNodes.forEach(t=>{const n=this.mirror.getId(t),r=_e(e.target)?this.mirror.getId(M.host(e.target)):this.mirror.getId(e.target);q(e.target,this.blockClass,this.blockSelector,!1)||Et(t,this.mirror,this.slimDOMOptions)||!cs(t,this.mirror)||(this.addedSet.has(t)?(Rt(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&n===-1||Tn(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[Fn(n,r)]?Rt(this.movedSet,t):(this.removes.push({parentId:r,id:n,isShadow:_e(e.target)&&Re(e.target)?!0:void 0}),bs(t,this.removesSubTreeCache))),this.mapRemoves.push(t))})}}),S(this,"genAdds",(e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!(this.addedSet.has(e)||this.movedSet.has(e))){if(this.mirror.hasNode(e)){if(Et(e,this.mirror,this.slimDOMOptions))return;this.movedSet.add(e);let n=null;t&&this.mirror.hasNode(t)&&(n=this.mirror.getId(t)),n&&n!==-1&&(this.movedMap[Fn(this.mirror.getId(e),n)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);q(e,this.blockClass,this.blockSelector,!1)||(M.childNodes(e).forEach(n=>this.genAdds(n)),_t(e)&&M.childNodes(M.shadowRoot(e)).forEach(n=>{this.processedNodeManager.add(n,this),this.genAdds(n,e)}))}})}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(t=>{this[t]=e[t]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}};function Rt(e,t){e.delete(t),M.childNodes(t).forEach(n=>Rt(e,n))}function bs(e,t){const n=[e];for(;n.length;){const r=n.pop();t.has(r)||(t.add(r),M.childNodes(r).forEach(o=>n.push(o)))}}function Pn(e,t,n){return e.size===0?!1:gs(e,t)}function gs(e,t,n){const r=M.parentNode(t);return r?e.has(r):!1}function Un(e,t){return e.size===0?!1:$n(e,t)}function $n(e,t){const n=M.parentNode(t);return n?e.has(n)?!0:$n(e,n):!1}var Ne;function vs(e){Ne=e}function ys(){Ne=void 0}var O=e=>Ne?(...n)=>{try{return e(...n)}catch(r){if(Ne&&Ne(r)===!0)return;throw r}}:e,fe=[];function Oe(e){try{if("composedPath"in e){const t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch{}return e&&e.target}function Bn(e,t){const n=new ms;fe.push(n),n.init(e);const[r,o]=fn(),i=new r(O(n.processMutations.bind(n)));return i.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),[i,o]}function Ss({mousemoveCb:e,sampling:t,doc:n,mirror:r}){if(t.mousemove===!1)return()=>{};const o=typeof t.mousemove=="number"?t.mousemove:50,i=typeof t.mousemoveCallback=="number"?t.mousemoveCallback:500;let s=[],l;const a=Le(O(m=>{const h=Date.now()-l;e(s.map(u=>(u.timeOffset-=h,u)),m),s=[],l=null}),i),c=O(Le(O(m=>{const h=Oe(m),{clientX:u,clientY:d}=It(m)?m.changedTouches[0]:m;l||(l=Ie()),s.push({x:u,y:d,id:r.getId(h),timeOffset:Ie()-l}),a(typeof DragEvent!="undefined"&&m instanceof DragEvent?N.Drag:m instanceof MouseEvent?N.MouseMove:N.TouchMove)}),o,{trailing:!1})),p=[V("mousemove",c,n),V("touchmove",c,n),V("drag",c,n)];return O(()=>{p.forEach(m=>m())})}function ws({mouseInteractionCb:e,doc:t,mirror:n,blockClass:r,blockSelector:o,sampling:i}){if(i.mouseInteraction===!1)return()=>{};const s=i.mouseInteraction===!0||i.mouseInteraction===void 0?{}:i.mouseInteraction,l=[];let a=null;const c=p=>m=>{const h=Oe(m);if(q(h,r,o,!0))return;let u=null,d=p;if("pointerType"in m){switch(m.pointerType){case"mouse":u=ie.Mouse;break;case"touch":u=ie.Touch;break;case"pen":u=ie.Pen}u===ie.Touch?X[p]===X.MouseDown?d="TouchStart":X[p]===X.MouseUp&&(d="TouchEnd"):ie.Pen}else It(m)&&(u=ie.Touch);u!==null?(a=u,(d.startsWith("Touch")&&u===ie.Touch||d.startsWith("Mouse")&&u===ie.Mouse)&&(u=null)):X[p]===X.Click&&(u=a,a=null);const f=It(m)?m.changedTouches[0]:m;if(!f)return;const g=n.getId(h),{clientX:v,clientY:b}=f;O(e)({type:X[d],id:g,x:v,y:b,...u!==null&&{pointerType:u}})};return Object.keys(X).filter(p=>Number.isNaN(Number(p))&&!p.endsWith("_Departed")&&s[p]!==!1).forEach(p=>{let m=de(p);const h=c(p);if(window.PointerEvent)switch(X[p]){case X.MouseDown:case X.MouseUp:m=m.replace("mouse","pointer");break;case X.TouchStart:case X.TouchEnd:return}l.push(V(m,h,t))}),O(()=>{l.forEach(p=>p())})}function zn({scrollCb:e,doc:t,mirror:n,blockClass:r,blockSelector:o,sampling:i}){return V("scroll",O(Le(O(s=>{const l=Oe(s);if(!l||q(l,r,o,!0))return;const a=n.getId(l);if(l===t&&t.defaultView){const c=En(t.defaultView);e({id:a,x:c.left,y:c.top})}else e({id:a,x:l.scrollLeft,y:l.scrollTop})}),i.scroll||100)),t)}function xs({viewportResizeCb:e},{win:t}){let n=-1,r=-1;return V("resize",O(Le(O(()=>{const o=In(),i=_n();(n!==o||r!==i)&&(e({width:Number(i),height:Number(o)}),n=o,r=i)}),200)),t)}var ks=["INPUT","TEXTAREA","SELECT"],Wn=new WeakMap;function Cs({inputCb:e,doc:t,mirror:n,blockClass:r,blockSelector:o,ignoreClass:i,ignoreSelector:s,maskInputOptions:l,maskInputFn:a,sampling:c,userTriggeredOnInput:p}){function m(v){let b=Oe(v);const y=v.isTrusted,k=b&&b.tagName;if(b&&k==="OPTION"&&(b=M.parentElement(b)),!b||!k||ks.indexOf(k)<0||q(b,r,o,!0)||b.classList.contains(i)||s&&b.matches(s))return;let E=b.value,C=!1;const T=je(b)||"";T==="radio"||T==="checkbox"?C=b.checked:(l[k.toLowerCase()]||l[T])&&(E=He({element:b,maskInputOptions:l,tagName:k,type:T,value:E,maskInputFn:a})),h(b,p?{text:E,isChecked:C,userTriggered:y}:{text:E,isChecked:C});const w=b.name;T==="radio"&&w&&C&&t.querySelectorAll(`input[type="radio"][name="${w}"]`).forEach(L=>{if(L!==b){const x=L.value;h(L,p?{text:x,isChecked:!C,userTriggered:!1}:{text:x,isChecked:!C})}})}function h(v,b){const y=Wn.get(v);if(!y||y.text!==b.text||y.isChecked!==b.isChecked){Wn.set(v,b);const k=n.getId(v);O(e)({...b,id:k})}}const u=(c.input==="last"?["change"]:["input","change"]).map(v=>V(v,O(m),t)),d=t.defaultView;if(!d)return()=>{u.forEach(v=>v())};const f=d.Object.getOwnPropertyDescriptor(d.HTMLInputElement.prototype,"value"),g=[[d.HTMLInputElement.prototype,"value"],[d.HTMLInputElement.prototype,"checked"],[d.HTMLSelectElement.prototype,"value"],[d.HTMLTextAreaElement.prototype,"value"],[d.HTMLSelectElement.prototype,"selectedIndex"],[d.HTMLOptionElement.prototype,"selected"]];return f&&f.set&&u.push(...g.map(v=>Xe(v[0],v[1],{set(){O(m)({target:this,isTrusted:!1})}},!1,d))),O(()=>{u.forEach(v=>v())})}function Ye(e){const t=[];function n(r,o){if(Ke("CSSGroupingRule")&&r.parentRule instanceof CSSGroupingRule||Ke("CSSMediaRule")&&r.parentRule instanceof CSSMediaRule||Ke("CSSSupportsRule")&&r.parentRule instanceof CSSSupportsRule||Ke("CSSConditionRule")&&r.parentRule instanceof CSSConditionRule){const i=Array.from(r.parentRule.cssRules).indexOf(r);return o.unshift(i),n(r.parentRule,o)}else if(r.parentStyleSheet){const i=Array.from(r.parentStyleSheet.cssRules).indexOf(r);o.unshift(i)}return o}return n(e,t)}function le(e,t,n){let r,o;return e?(e.ownerNode?r=t.getId(e.ownerNode):o=n.getId(e),{styleId:o,id:r}):{}}function Ms({styleSheetRuleCb:e,mirror:t,stylesheetManager:n},{win:r}){if(!r.CSSStyleSheet||!r.CSSStyleSheet.prototype)return()=>{};const o=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=new Proxy(o,{apply:O((p,m,h)=>{const[u,d]=h,{id:f,styleId:g}=le(m,t,n.styleMirror);return(f&&f!==-1||g&&g!==-1)&&e({id:f,styleId:g,adds:[{rule:u,index:d}]}),p.apply(m,h)})}),r.CSSStyleSheet.prototype.addRule=function(p,m,h=this.cssRules.length){const u=`${p} { ${m} }`;return r.CSSStyleSheet.prototype.insertRule.apply(this,[u,h])};const i=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=new Proxy(i,{apply:O((p,m,h)=>{const[u]=h,{id:d,styleId:f}=le(m,t,n.styleMirror);return(d&&d!==-1||f&&f!==-1)&&e({id:d,styleId:f,removes:[{index:u}]}),p.apply(m,h)})}),r.CSSStyleSheet.prototype.removeRule=function(p){return r.CSSStyleSheet.prototype.deleteRule.apply(this,[p])};let s;r.CSSStyleSheet.prototype.replace&&(s=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(s,{apply:O((p,m,h)=>{const[u]=h,{id:d,styleId:f}=le(m,t,n.styleMirror);return(d&&d!==-1||f&&f!==-1)&&e({id:d,styleId:f,replace:u}),p.apply(m,h)})}));let l;r.CSSStyleSheet.prototype.replaceSync&&(l=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(l,{apply:O((p,m,h)=>{const[u]=h,{id:d,styleId:f}=le(m,t,n.styleMirror);return(d&&d!==-1||f&&f!==-1)&&e({id:d,styleId:f,replaceSync:u}),p.apply(m,h)})}));const a={};Je("CSSGroupingRule")?a.CSSGroupingRule=r.CSSGroupingRule:(Je("CSSMediaRule")&&(a.CSSMediaRule=r.CSSMediaRule),Je("CSSConditionRule")&&(a.CSSConditionRule=r.CSSConditionRule),Je("CSSSupportsRule")&&(a.CSSSupportsRule=r.CSSSupportsRule));const c={};return Object.entries(a).forEach(([p,m])=>{c[p]={insertRule:m.prototype.insertRule,deleteRule:m.prototype.deleteRule},m.prototype.insertRule=new Proxy(c[p].insertRule,{apply:O((h,u,d)=>{const[f,g]=d,{id:v,styleId:b}=le(u.parentStyleSheet,t,n.styleMirror);return(v&&v!==-1||b&&b!==-1)&&e({id:v,styleId:b,adds:[{rule:f,index:[...Ye(u),g||0]}]}),h.apply(u,d)})}),m.prototype.deleteRule=new Proxy(c[p].deleteRule,{apply:O((h,u,d)=>{const[f]=d,{id:g,styleId:v}=le(u.parentStyleSheet,t,n.styleMirror);return(g&&g!==-1||v&&v!==-1)&&e({id:g,styleId:v,removes:[{index:[...Ye(u),f]}]}),h.apply(u,d)})})}),O(()=>{r.CSSStyleSheet.prototype.insertRule=o,r.CSSStyleSheet.prototype.deleteRule=i,s&&(r.CSSStyleSheet.prototype.replace=s),l&&(r.CSSStyleSheet.prototype.replaceSync=l),Object.entries(a).forEach(([p,m])=>{m.prototype.insertRule=c[p].insertRule,m.prototype.deleteRule=c[p].deleteRule})})}function Hn({mirror:e,stylesheetManager:t},n){var r,o,i;let s=null;n.nodeName==="#document"?s=e.getId(n):s=e.getId(M.host(n));const l=n.nodeName==="#document"?(r=n.defaultView)==null?void 0:r.Document:(i=(o=n.ownerDocument)==null?void 0:o.defaultView)==null?void 0:i.ShadowRoot,a=l!=null&&l.prototype?Object.getOwnPropertyDescriptor(l==null?void 0:l.prototype,"adoptedStyleSheets"):void 0;return s===null||s===-1||!l||!a?()=>{}:(Object.defineProperty(n,"adoptedStyleSheets",{configurable:a.configurable,enumerable:a.enumerable,get(){var c;return(c=a.get)==null?void 0:c.call(this)},set(c){var p;const m=(p=a.set)==null?void 0:p.call(this,c);if(s!==null&&s!==-1)try{t.adoptStyleSheets(c,s)}catch{}return m}}),O(()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:a.configurable,enumerable:a.enumerable,get:a.get,set:a.set})}))}function Es({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:n,stylesheetManager:r},{win:o}){const i=o.CSSStyleDeclaration.prototype.setProperty;o.CSSStyleDeclaration.prototype.setProperty=new Proxy(i,{apply:O((l,a,c)=>{var p;const[m,h,u]=c;if(n.has(m))return i.apply(a,[m,h,u]);const{id:d,styleId:f}=le((p=a.parentRule)==null?void 0:p.parentStyleSheet,t,r.styleMirror);return(d&&d!==-1||f&&f!==-1)&&e({id:d,styleId:f,set:{property:m,value:h,priority:u},index:Ye(a.parentRule)}),l.apply(a,c)})});const s=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=new Proxy(s,{apply:O((l,a,c)=>{var p;const[m]=c;if(n.has(m))return s.apply(a,[m]);const{id:h,styleId:u}=le((p=a.parentRule)==null?void 0:p.parentStyleSheet,t,r.styleMirror);return(h&&h!==-1||u&&u!==-1)&&e({id:h,styleId:u,remove:{property:m},index:Ye(a.parentRule)}),l.apply(a,c)})}),O(()=>{o.CSSStyleDeclaration.prototype.setProperty=i,o.CSSStyleDeclaration.prototype.removeProperty=s})}function Is({mediaInteractionCb:e,blockClass:t,blockSelector:n,mirror:r,sampling:o,doc:i}){const s=O(a=>Le(O(c=>{const p=Oe(c);if(!p||q(p,t,n,!0))return;const{currentTime:m,volume:h,muted:u,playbackRate:d,loop:f}=p;e({type:a,id:r.getId(p),currentTime:m,volume:h,muted:u,playbackRate:d,loop:f})}),o.media||500)),l=[V("play",s(ve.Play),i),V("pause",s(ve.Pause),i),V("seeked",s(ve.Seeked),i),V("volumechange",s(ve.VolumeChange),i),V("ratechange",s(ve.RateChange),i)];return O(()=>{l.forEach(a=>a())})}function _s({fontCb:e,doc:t}){const n=t.defaultView;if(!n)return()=>{};const r=[],o=new WeakMap,i=n.FontFace;n.FontFace=function(a,c,p){const m=new i(a,c,p);return o.set(m,{family:a,buffer:typeof c!="string",descriptors:p,fontSource:typeof c=="string"?c:JSON.stringify(Array.from(new Uint8Array(c)))}),m};const s=ue(t.fonts,"add",function(l){return function(a){return setTimeout(O(()=>{const c=o.get(a);c&&(e(c),o.delete(a))}),0),l.apply(this,[a])}});return r.push(()=>{n.FontFace=i}),r.push(s),O(()=>{r.forEach(l=>l())})}function Rs(e){const{doc:t,mirror:n,blockClass:r,blockSelector:o,selectionCb:i}=e;let s=!0;const l=O(()=>{const a=t.getSelection();if(!a||s&&(a!=null&&a.isCollapsed))return;s=a.isCollapsed||!1;const c=[],p=a.rangeCount||0;for(let m=0;m<p;m++){const{startContainer:h,startOffset:u,endContainer:d,endOffset:f}=a.getRangeAt(m);q(h,r,o,!0)||q(d,r,o,!0)||c.push({start:n.getId(h),startOffset:u,end:n.getId(d),endOffset:f})}i({ranges:c})});return l(),V("selectionchange",l)}function Ts({doc:e,customElementCb:t}){const n=e.defaultView;return!n||!n.customElements?()=>{}:ue(n.customElements,"define",function(r){return function(o,i,s){try{t({define:{name:o}})}catch{console.warn(`Custom element callback failed for ${o}`)}return r.apply(this,[o,i,s])}})}function Ls(e,t){const{mutationCb:n,mousemoveCb:r,mouseInteractionCb:o,scrollCb:i,viewportResizeCb:s,inputCb:l,mediaInteractionCb:a,styleSheetRuleCb:c,styleDeclarationCb:p,canvasMutationCb:m,fontCb:h,selectionCb:u,customElementCb:d}=e;e.mutationCb=(...f)=>{t.mutation&&t.mutation(...f),n(...f)},e.mousemoveCb=(...f)=>{t.mousemove&&t.mousemove(...f),r(...f)},e.mouseInteractionCb=(...f)=>{t.mouseInteraction&&t.mouseInteraction(...f),o(...f)},e.scrollCb=(...f)=>{t.scroll&&t.scroll(...f),i(...f)},e.viewportResizeCb=(...f)=>{t.viewportResize&&t.viewportResize(...f),s(...f)},e.inputCb=(...f)=>{t.input&&t.input(...f),l(...f)},e.mediaInteractionCb=(...f)=>{t.mediaInteaction&&t.mediaInteaction(...f),a(...f)},e.styleSheetRuleCb=(...f)=>{t.styleSheetRule&&t.styleSheetRule(...f),c(...f)},e.styleDeclarationCb=(...f)=>{t.styleDeclaration&&t.styleDeclaration(...f),p(...f)},e.canvasMutationCb=(...f)=>{t.canvasMutation&&t.canvasMutation(...f),m(...f)},e.fontCb=(...f)=>{t.font&&t.font(...f),h(...f)},e.selectionCb=(...f)=>{t.selection&&t.selection(...f),u(...f)},e.customElementCb=(...f)=>{t.customElement&&t.customElement(...f),d(...f)}}function Ns(e,t={}){const n=e.doc.defaultView;if(!n)return()=>{};Ls(e,t);let r,o=()=>{};e.recordDOM&&([r,o]=Bn(e,e.doc));const i=Ss(e),s=ws(e),l=zn(e),a=xs(e,{win:n}),c=Cs(e),p=Is(e);let m=()=>{},h=()=>{},u=()=>{},d=()=>{};e.recordDOM&&(m=Ms(e,{win:n}),h=Hn(e,e.doc),u=Es(e,{win:n}),e.collectFonts&&(d=_s(e)));const f=Rs(e),g=Ts(e),v=[];for(const b of e.plugins)v.push(b.observer(b.callback,n,b.options));return O(()=>{fe.forEach(b=>b.reset()),r==null||r.disconnect(),o(),i(),s(),l(),a(),c(),p(),m(),h(),u(),d(),f(),g(),v.forEach(b=>b())})}function Ke(e){return typeof window[e]!="undefined"}function Je(e){return!!(typeof window[e]!="undefined"&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}for(var jn=class{constructor(e){S(this,"iframeIdToRemoteIdMap",new WeakMap),S(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=e}getId(e,t,n,r){const o=n||this.getIdToRemoteIdMap(e),i=r||this.getRemoteIdToIdMap(e);let s=o.get(t);return s||(s=this.generateIdFn(),o.set(t,s),i.set(s,t)),s}getIds(e,t){const n=this.getIdToRemoteIdMap(e),r=this.getRemoteIdToIdMap(e);return t.map(o=>this.getId(e,o,n,r))}getRemoteId(e,t,n){const r=n||this.getRemoteIdToIdMap(e);if(typeof t!="number")return t;const o=r.get(t);return o||-1}getRemoteIds(e,t){const n=this.getRemoteIdToIdMap(e);return t.map(r=>this.getRemoteId(e,r,n))}reset(e){if(!e){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){let t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}getRemoteIdToIdMap(e){let t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}},Os=class{constructor(e){S(this,"iframes",new WeakMap),S(this,"crossOriginIframeMap",new WeakMap),S(this,"crossOriginIframeMirror",new jn(vn)),S(this,"crossOriginIframeStyleMirror"),S(this,"crossOriginIframeRootIdMap",new WeakMap),S(this,"mirror"),S(this,"mutationCb"),S(this,"wrappedEmit"),S(this,"loadListener"),S(this,"stylesheetManager"),S(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new jn(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,t){var n,r;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&((n=e.contentWindow)==null||n.addEventListener("message",this.handleMessage.bind(this))),(r=this.loadListener)==null||r.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){const t=e;if(t.data.type!=="rrweb"||t.origin!==t.data.origin||!e.source)return;const n=this.crossOriginIframeMap.get(e.source);if(!n)return;const r=this.transformCrossOriginEvent(n,t.data.event);r&&this.wrappedEmit(r,t.data.isCheckout)}transformCrossOriginEvent(e,t){var n;switch(t.type){case A.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);const r=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,r),this.patchRootIdOnNode(t.data.node,r),{timestamp:t.timestamp,type:A.IncrementalSnapshot,data:{source:N.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case A.Meta:case A.Load:case A.DomContentLoaded:return!1;case A.Plugin:return t;case A.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case A.IncrementalSnapshot:switch(t.data.source){case N.Mutation:return t.data.adds.forEach(r=>{this.replaceIds(r,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(r.node,e);const o=this.crossOriginIframeRootIdMap.get(e);o&&this.patchRootIdOnNode(r.node,o)}),t.data.removes.forEach(r=>{this.replaceIds(r,e,["parentId","id"])}),t.data.attributes.forEach(r=>{this.replaceIds(r,e,["id"])}),t.data.texts.forEach(r=>{this.replaceIds(r,e,["id"])}),t;case N.Drag:case N.TouchMove:case N.MouseMove:return t.data.positions.forEach(r=>{this.replaceIds(r,e,["id"])}),t;case N.ViewportResize:return!1;case N.MediaInteraction:case N.MouseInteraction:case N.Scroll:case N.CanvasMutation:case N.Input:return this.replaceIds(t.data,e,["id"]),t;case N.StyleSheetRule:case N.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case N.Font:return t;case N.Selection:return t.data.ranges.forEach(r=>{this.replaceIds(r,e,["start","end"])}),t;case N.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),(n=t.data.styles)==null||n.forEach(r=>{this.replaceStyleIds(r,e,["styleId"])}),t}}return!1}replace(e,t,n,r){for(const o of r)!Array.isArray(t[o])&&typeof t[o]!="number"||(Array.isArray(t[o])?t[o]=e.getIds(n,t[o]):t[o]=e.getId(n,t[o]));return t}replaceIds(e,t,n){return this.replace(this.crossOriginIframeMirror,e,t,n)}replaceStyleIds(e,t,n){return this.replace(this.crossOriginIframeStyleMirror,e,t,n)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach(n=>{this.replaceIdOnNode(n,t)})}patchRootIdOnNode(e,t){e.type!==H.Document&&!e.rootId&&(e.rootId=t),"childNodes"in e&&e.childNodes.forEach(n=>{this.patchRootIdOnNode(n,t)})}},As=class{constructor(e){S(this,"shadowDoms",new WeakSet),S(this,"mutationCb"),S(this,"scrollCb"),S(this,"bypassOptions"),S(this,"mirror"),S(this,"restoreHandlers",[]),this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(e,t){if(!Re(e)||this.shadowDoms.has(e))return;this.shadowDoms.add(e);const[n]=Bn({...this.bypassOptions,doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push(()=>n.disconnect()),this.restoreHandlers.push(zn({...this.bypassOptions,scrollCb:this.scrollCb,doc:e,mirror:this.mirror})),setTimeout(()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(M.host(e))),this.restoreHandlers.push(Hn({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))},0)}observeAttachShadow(e){!e.contentWindow||!e.contentDocument||this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}patchAttachShadow(e,t){const n=this;this.restoreHandlers.push(ue(e.prototype,"attachShadow",function(r){return function(o){const i=r.call(this,o),s=M.shadowRoot(this);return s&&An(this)&&n.addShadowRoot(s,t),i}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch{}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}},ke="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ds=typeof Uint8Array=="undefined"?[]:new Uint8Array(256),Ze=0;Ze<ke.length;Ze++)Ds[ke.charCodeAt(Ze)]=Ze;var Fs=function(e){var t=new Uint8Array(e),n,r=t.length,o="";for(n=0;n<r;n+=3)o+=ke[t[n]>>2],o+=ke[(t[n]&3)<<4|t[n+1]>>4],o+=ke[(t[n+1]&15)<<2|t[n+2]>>6],o+=ke[t[n+2]&63];return r%3===2?o=o.substring(0,o.length-1)+"=":r%3===1&&(o=o.substring(0,o.length-2)+"=="),o},Gn=new Map;function Ps(e,t){let n=Gn.get(e);return n||(n=new Map,Gn.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}var Vn=(e,t,n)=>{if(!e||!(Xn(e,t)||typeof e=="object"))return;const r=e.constructor.name,o=Ps(n,r);let i=o.indexOf(e);return i===-1&&(i=o.length,o.push(e)),i};function Qe(e,t,n){if(e instanceof Array)return e.map(r=>Qe(r,t,n));if(e===null)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray)return{rr_type:e.constructor.name,args:[Object.values(e)]};if(e instanceof ArrayBuffer)return{rr_type:e.constructor.name,base64:Fs(e)};if(e instanceof DataView)return{rr_type:e.constructor.name,args:[Qe(e.buffer,t,n),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){const r=e.constructor.name,{src:o}=e;return{rr_type:r,src:o}}else{if(e instanceof HTMLCanvasElement)return{rr_type:"HTMLImageElement",src:e.toDataURL()};if(e instanceof ImageData)return{rr_type:e.constructor.name,args:[Qe(e.data,t,n),e.width,e.height]};if(Xn(e,t)||typeof e=="object")return{rr_type:e.constructor.name,index:Vn(e,t,n)}}return e}var qn=(e,t,n)=>e.map(r=>Qe(r,t,n)),Xn=(e,t)=>!!["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(r=>typeof t[r]=="function").find(r=>e instanceof t[r]);function Us(e,t,n,r){const o=[],i=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const s of i)try{if(typeof t.CanvasRenderingContext2D.prototype[s]!="function")continue;const l=ue(t.CanvasRenderingContext2D.prototype,s,function(a){return function(...c){return q(this.canvas,n,r,!0)||setTimeout(()=>{const p=qn(c,t,this);e(this.canvas,{type:ge["2D"],property:s,args:p})},0),a.apply(this,c)}});o.push(l)}catch{const l=Xe(t.CanvasRenderingContext2D.prototype,s,{set(a){e(this.canvas,{type:ge["2D"],property:s,args:[a],setter:!0})}});o.push(l)}return()=>{o.forEach(s=>s())}}function $s(e){return e==="experimental-webgl"?"webgl":e}function Yn(e,t,n,r){const o=[];try{const i=ue(e.HTMLCanvasElement.prototype,"getContext",function(s){return function(l,...a){if(!q(this,t,n,!0)){const c=$s(l);if("__context"in this||(this.__context=c),r&&["webgl","webgl2"].includes(c))if(a[0]&&typeof a[0]=="object"){const p=a[0];p.preserveDrawingBuffer||(p.preserveDrawingBuffer=!0)}else a.splice(0,1,{preserveDrawingBuffer:!0})}return s.apply(this,[l,...a])}});o.push(i)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{o.forEach(i=>i())}}function Kn(e,t,n,r,o,i){const s=[],l=Object.getOwnPropertyNames(e);for(const a of l)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(a))try{if(typeof e[a]!="function")continue;const c=ue(e,a,function(p){return function(...m){const h=p.apply(this,m);if(Vn(h,i,this),"tagName"in this.canvas&&!q(this.canvas,r,o,!0)){const u=qn(m,i,this),d={type:t,property:a,args:u};n(this.canvas,d)}return h}});s.push(c)}catch{const c=Xe(e,a,{set(p){n(this.canvas,{type:t,property:a,args:[p],setter:!0})}});s.push(c)}return s}function Bs(e,t,n,r){const o=[];return typeof t.WebGLRenderingContext!="undefined"&&o.push(...Kn(t.WebGLRenderingContext.prototype,ge.WebGL,e,n,r,t)),typeof t.WebGL2RenderingContext!="undefined"&&o.push(...Kn(t.WebGL2RenderingContext.prototype,ge.WebGL2,e,n,r,t)),()=>{o.forEach(i=>i())}}var Jn=`(function() {
765
599
  "use strict";
766
600
  var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
767
601
  var lookup = typeof Uint8Array === "undefined" ? [] : new Uint8Array(256);
@@ -836,6 +670,6 @@ or you can use record.mirror to access the mirror instance during recording.`,Zr
836
670
  };
837
671
  })();
838
672
  //# sourceMappingURL=image-bitmap-data-url-worker-IJpC7g_b.js.map
839
- `,En=typeof self!="undefined"&&self.Blob&&new Blob([Mn],{type:"text/javascript;charset=utf-8"});function Ta(e){let t;try{if(t=En&&(self.URL||self.webkitURL).createObjectURL(En),!t)throw"";const r=new Worker(t,{name:e==null?void 0:e.name});return r.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),r}catch{return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(Mn),{name:e==null?void 0:e.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}var La=class{constructor(e){S(this,"pendingCanvasMutations",new Map),S(this,"rafStamps",{latestId:0,invokeId:null}),S(this,"mirror"),S(this,"mutationCb"),S(this,"resetObservers"),S(this,"frozen",!1),S(this,"locked",!1),S(this,"processMutation",(c,s)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(c)||this.pendingCanvasMutations.set(c,[]),this.pendingCanvasMutations.get(c).push(s)});const{sampling:t="all",win:r,blockClass:n,blockSelector:o,recordCanvas:i,dataURLOptions:l}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,i&&t==="all"&&this.initCanvasMutationObserver(r,n,o),i&&typeof t=="number"&&this.initCanvasFPSObserver(t,r,n,o,{dataURLOptions:l})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(e,t,r,n,o){const i=kn(t,r,n,!0),l=new Map,c=new Ta;c.onmessage=d=>{const{id:u}=d.data;if(l.set(u,!1),!("base64"in d.data))return;const{base64:m,type:b,width:g,height:v}=d.data;this.mutationCb({id:u,type:Ce["2D"],commands:[{property:"clearRect",args:[0,0,g,v]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:m}],type:b}]},0,0]}]})};const s=1e3/e;let a=0,f;const p=()=>{const d=[];return t.document.querySelectorAll("canvas").forEach(u=>{Q(u,r,n,!0)||d.push(u)}),d},h=d=>{if(a&&d-a<s){f=requestAnimationFrame(h);return}a=d,p().forEach(async u=>{var m;const b=this.mirror.getId(u);if(l.get(b)||u.width===0||u.height===0)return;if(l.set(b,!0),["webgl","webgl2"].includes(u.__context)){const v=u.getContext(u.__context);((m=v==null?void 0:v.getContextAttributes())==null?void 0:m.preserveDrawingBuffer)===!1&&v.clear(v.COLOR_BUFFER_BIT)}const g=await createImageBitmap(u);c.postMessage({id:b,bitmap:g,width:u.width,height:u.height,dataURLOptions:o.dataURLOptions},[g])}),f=requestAnimationFrame(h)};f=requestAnimationFrame(h),this.resetObservers=()=>{i(),cancelAnimationFrame(f)}}initCanvasMutationObserver(e,t,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const n=kn(e,t,r,!1),o=Ia(this.processMutation.bind(this),e,t,r),i=_a(this.processMutation.bind(this),e,t,r);this.resetObservers=()=>{n(),o(),i()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const e=t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((e,t)=>{const r=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,r)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;const r=this.pendingCanvasMutations.get(e);if(!r||t===-1)return;const n=r.map(i=>{const{type:l,...c}=i;return c}),{type:o}=r[0];this.mutationCb({id:t,type:o,commands:n}),this.pendingCanvasMutations.delete(e)}},Na=class{constructor(e){S(this,"trackedLinkElements",new WeakSet),S(this,"mutationCb"),S(this,"adoptedStyleSheetCb"),S(this,"styleMirror",new ea),this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){if(e.length===0)return;const r={id:t,styleIds:[]},n=[];for(const o of e){let i;this.styleMirror.has(o)?i=this.styleMirror.getId(o):(i=this.styleMirror.add(o),n.push({styleId:i,rules:Array.from(o.rules||CSSRule,(l,c)=>({rule:$r(l,o.href),index:c}))})),r.styleIds.push(i)}n.length>0&&(r.styles=n),this.adoptedStyleSheetCb(r)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}},Oa=class{constructor(){S(this,"nodeMap",new WeakMap),S(this,"active",!1)}inOtherBuffer(e,t){const r=this.nodeMap.get(e);return r&&Array.from(r).some(n=>n!==t)}add(e,t){this.active||(this.active=!0,requestAnimationFrame(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}destroy(){}},V,gt,Xt,vt=!1;try{if(Array.from([1],e=>e*2)[0]!==2){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=((Ar=e.contentWindow)==null?void 0:Ar.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}var ie=Es();function Ke(e={}){const{emit:t,checkoutEveryNms:r,checkoutEveryNth:n,blockClass:o="rr-block",blockSelector:i=null,ignoreClass:l="rr-ignore",ignoreSelector:c=null,maskTextClass:s="rr-mask",maskTextSelector:a=null,inlineStylesheet:f=!0,maskAllInputs:p,maskInputOptions:h,slimDOMOptions:d,maskInputFn:u,maskTextFn:m,hooks:b,packFn:g,sampling:v={},dataURLOptions:y={},mousemoveWait:x,recordDOM:_=!0,recordCanvas:R=!1,recordCrossOriginIframes:I=!1,recordAfter:D=e.recordAfter==="DOMContentLoaded"?e.recordAfter:"load",userTriggeredOnInput:N=!1,collectFonts:w=!1,inlineImages:B=!1,plugins:L,keepIframeSrcFn:C=()=>!1,ignoreCSSAttributes:K=new Set([]),errorHandler:$}=e;aa($);const P=I?window.parent===window:!0;let j=!1;if(!P)try{window.parent.document&&(j=!1)}catch{j=!0}if(P&&!t)throw new Error("emit function is required");if(!P&&!j)return()=>{};x!==void 0&&v.mousemove===void 0&&(v.mousemove=x),ie.reset();const X=p===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:h!==void 0?h:{password:!0},Y=Jr(d);Qs();let ae,re=0;const yt=U=>{for(const te of L||[])te.eventProcessor&&(U=te.eventProcessor(U));return g&&!j&&(U=g(U)),U};V=(U,te)=>{var W;const G=U;if(G.timestamp=He(),(W=ye[0])!=null&&W.isFrozen()&&G.type!==F.FullSnapshot&&!(G.type===F.IncrementalSnapshot&&G.data.source===O.Mutation)&&ye.forEach(k=>k.unfreeze()),P)t==null||t(yt(G),te);else if(j){const k={type:"rrweb",event:yt(G),origin:window.location.origin,isCheckout:te};window.parent.postMessage(k,"*")}if(G.type===F.FullSnapshot)ae=G,re=0;else if(G.type===F.IncrementalSnapshot){if(G.data.source===O.Mutation&&G.data.isAttachIframe)return;re++;const k=n&&re>=n,M=r&&G.timestamp-ae.timestamp>r;(k||M)&&gt(!0)}};const Le=U=>{V({type:F.IncrementalSnapshot,data:{source:O.Mutation,...U}})},St=U=>V({type:F.IncrementalSnapshot,data:{source:O.Scroll,...U}}),Je=U=>V({type:F.IncrementalSnapshot,data:{source:O.CanvasMutation,...U}}),me=U=>V({type:F.IncrementalSnapshot,data:{source:O.AdoptedStyleSheet,...U}}),se=new Na({mutationCb:Le,adoptedStyleSheetCb:me}),fe=new xa({mirror:ie,mutationCb:Le,stylesheetManager:se,recordCrossOriginIframes:I,wrappedEmit:V});for(const U of L||[])U.getMirror&&U.getMirror({nodeMirror:ie,crossOriginIframeMirror:fe.crossOriginIframeMirror,crossOriginIframeStyleMirror:fe.crossOriginIframeStyleMirror});const Se=new Oa;Xt=new La({recordCanvas:R,mutationCb:Je,win:window,blockClass:o,blockSelector:i,mirror:ie,sampling:v.canvas,dataURLOptions:y});const Ne=new ka({mutationCb:Le,scrollCb:St,bypassOptions:{blockClass:o,blockSelector:i,maskTextClass:s,maskTextSelector:a,inlineStylesheet:f,maskInputOptions:X,dataURLOptions:y,maskTextFn:m,maskInputFn:u,recordCanvas:R,inlineImages:B,sampling:v,slimDOMOptions:Y,iframeManager:fe,stylesheetManager:se,canvasManager:Xt,keepIframeSrcFn:C,processedNodeManager:Se},mirror:ie});gt=(U=!1)=>{if(!_)return;V({type:F.Meta,data:{href:window.location.href,width:tn(),height:en()}},U),se.reset(),Ne.init(),ye.forEach(W=>W.lock());const te=Ks(document,{mirror:ie,blockClass:o,blockSelector:i,maskTextClass:s,maskTextSelector:a,inlineStylesheet:f,maskAllInputs:X,maskTextFn:m,maskInputFn:u,slimDOM:Y,dataURLOptions:y,recordCanvas:R,inlineImages:B,onSerialize:W=>{on(W,ie)&&fe.addIframe(W),sn(W,ie)&&se.trackLinkElement(W),Vt(W)&&Ne.addShadowRoot(E.shadowRoot(W),document)},onIframeLoad:(W,G)=>{fe.attachIframe(W,G),Ne.observeAttachShadow(W)},onStylesheetLoad:(W,G)=>{se.attachLinkElement(W,G)},keepIframeSrcFn:C});if(!te)return console.warn("Failed to snapshot the document");V({type:F.FullSnapshot,data:{node:te,initialOffset:Qr(window)}},U),ye.forEach(W=>W.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&se.adoptStyleSheets(document.adoptedStyleSheets,ie.getId(document))};try{const U=[],te=G=>{var k;return A(wa)({mutationCb:Le,mousemoveCb:(M,J)=>V({type:F.IncrementalSnapshot,data:{source:J,positions:M}}),mouseInteractionCb:M=>V({type:F.IncrementalSnapshot,data:{source:O.MouseInteraction,...M}}),scrollCb:St,viewportResizeCb:M=>V({type:F.IncrementalSnapshot,data:{source:O.ViewportResize,...M}}),inputCb:M=>V({type:F.IncrementalSnapshot,data:{source:O.Input,...M}}),mediaInteractionCb:M=>V({type:F.IncrementalSnapshot,data:{source:O.MediaInteraction,...M}}),styleSheetRuleCb:M=>V({type:F.IncrementalSnapshot,data:{source:O.StyleSheetRule,...M}}),styleDeclarationCb:M=>V({type:F.IncrementalSnapshot,data:{source:O.StyleDeclaration,...M}}),canvasMutationCb:Je,fontCb:M=>V({type:F.IncrementalSnapshot,data:{source:O.Font,...M}}),selectionCb:M=>{V({type:F.IncrementalSnapshot,data:{source:O.Selection,...M}})},customElementCb:M=>{V({type:F.IncrementalSnapshot,data:{source:O.CustomElement,...M}})},blockClass:o,ignoreClass:l,ignoreSelector:c,maskTextClass:s,maskTextSelector:a,maskInputOptions:X,inlineStylesheet:f,sampling:v,recordDOM:_,recordCanvas:R,inlineImages:B,userTriggeredOnInput:N,collectFonts:w,doc:G,maskInputFn:u,maskTextFn:m,keepIframeSrcFn:C,blockSelector:i,slimDOMOptions:Y,dataURLOptions:y,mirror:ie,iframeManager:fe,stylesheetManager:se,shadowDomManager:Ne,processedNodeManager:Se,canvasManager:Xt,ignoreCSSAttributes:K,plugins:((k=L==null?void 0:L.filter(M=>M.observer))==null?void 0:k.map(M=>({observer:M.observer,options:M.options,callback:J=>V({type:F.Plugin,data:{plugin:M.name,payload:J}})})))||[]},b)};fe.addLoadListener(G=>{try{U.push(te(G.contentDocument))}catch(k){console.warn(k)}});const W=()=>{gt(),U.push(te(document)),vt=!0};return["interactive","complete"].includes(document.readyState)?W():(U.push(Z("DOMContentLoaded",()=>{V({type:F.DomContentLoaded,data:{}}),D==="DOMContentLoaded"&&W()})),U.push(Z("load",()=>{V({type:F.Load,data:{}}),D==="load"&&W()},window))),()=>{U.forEach(G=>{try{G()}catch(k){String(k).toLowerCase().includes("cross-origin")||console.warn(k)}}),Se.destroy(),vt=!1,la()}}catch(U){console.warn(U)}}Ke.addCustomEvent=(e,t)=>{if(!vt)throw new Error("please add custom event after start recording");V({type:F.Custom,data:{tag:e,payload:t}})},Ke.freezePage=()=>{ye.forEach(e=>e.freeze())},Ke.takeFullSnapshot=e=>{if(!vt)throw new Error("please take full snapshot after start recording");gt(e)},Ke.mirror=ie;var In=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e[e.Asset=7]="Asset",e))(In||{}),Aa=3e4,Da="[data-fixback-root],[data-fixback-overlay]",Fa="img,image,svg,video,object,picture,embed,map,audio",Pa={snapshot:()=>null,stop:()=>{}};function Ba(e={},t=Ke){let r=[],n=[],o=!1;const i=e.maskText!==!1,l=[Da,...e.blockMedia!==!1?[Fa]:[],...e.blockSelector?[e.blockSelector]:[]].join(",");let c;try{var s;c=t({emit:(p,h)=>{h&&!o&&(r=n,n=[]),o=h===!0,n.push(p)},checkoutEveryNms:Aa,maskAllInputs:!0,...i?{maskTextSelector:(s=e.maskTextSelector)!==null&&s!==void 0?s:"*"}:{},blockSelector:l,slimDOMOptions:"all"})}catch{c=void 0}if(typeof c!="function")return Pa;const a=c;let f=!0;return{snapshot(){if(!f)return null;const p=[...r,...n];return p.some(h=>h.type===In.FullSnapshot)?{events:p}:null},stop(){if(f){f=!1;try{a()}catch{}r=[],n=[]}}}}var Rn="https://api.fixback.dev";function Ua(e,t){const r=e.replace(/\/+$/,"");return t.startsWith(`${r}/api/ingest/`)||t.startsWith(`${r}/api/invites/`)}var Yt={destroy(){}};function za(){try{const e=window.location;return e.host||e.hostname||"this site"}catch{return"this site"}}function $a(){try{return window.location.href}catch{return""}}function Wa(e){const{options:t,apiUrl:r,key:n,identity:o,display:i,target:l,answer:c}=e,s=t.release?ii(t.release):void 0;t.release&&!s&&console.warn(`[fixback] ignoring invalid release ${JSON.stringify(t.release)} — use 1-100 visible characters with no whitespace or slashes (e.g. a git SHA or semver).`);const a=Bi(l,{key:n,reduceMotion:t.reduceMotion});let f=null,p=()=>{};if(t.trace!==!1){var h,d,u,m,b;const D=(h=t.trace)!==null&&h!==void 0?h:{},N=e.answer.capture,w=(d=(u=t.capture)===null||u===void 0?void 0:u.console)!==null&&d!==void 0?d:typeof(N==null?void 0:N.console)=="boolean"?N.console:!0,B=(m=(b=t.capture)===null||b===void 0?void 0:b.network)!==null&&m!==void 0?m:typeof(N==null?void 0:N.network)=="boolean"?N.network:!0;f=Ro({budgets:D.budgets,maxAgeMs:D.maxAgeMs,beforeBreadcrumb:D.beforeBreadcrumb}),p=Qo(f,{consoleLevels:D.consoleLevels,ignoreUrl:L=>Ua(r,L),captureConsole:w,captureNetwork:B})}let g=null;if(t.replay!==!1){var v,y;const D=e.answer.capture;if((v=(y=t.capture)===null||y===void 0?void 0:y.replay)!==null&&v!==void 0?v:typeof(D==null?void 0:D.replay)!="boolean"||D.replay){var x;g=Ba((x=t.replay)!==null&&x!==void 0?x:{})}}const _=ts({apiUrl:r,key:n,identity:o,display:i,gate:c.gate,tier:c.tier,sdkVersion:tt,release:s,target:l,buffer:f,replay:g,beforeSend:t.beforeSend,scrub:t.scrub}),R=()=>_.open();a.host.addEventListener(nt,R);let I=()=>{};return t.autoCapture!==!1&&(I=Si({apiUrl:r,key:n,identity:o,display:i,sdkVersion:tt,release:s,buffer:f,replay:g,beforeSend:t.beforeSend,scrub:t.scrub}).destroy),()=>{a.host.removeEventListener(nt,R),_.destroy(),Ui(a),p(),g==null||g.stop(),I()}}async function _n(e,t){try{var r,n,o;if(typeof document=="undefined")return Yt;const i=e==null?void 0:e.key;if(typeof i!="string"||i.length===0)return Yt;const l=(r=e.apiUrl)!==null&&r!==void 0?r:Rn,c=(n=e.anonymousId)!==null&&n!==void 0?n:wi(),s=(o=e.target)!==null&&o!==void 0?o:document.body;let a=!1,f=()=>{},p=()=>{};const h={destroy:()=>{a=!0,p(),p=()=>{},f(),f=()=>{}}},d=()=>{var b;const g=Pt(i);return{signedIdentity:e.signedIdentity,reporterId:(b=e.reporterId)!==null&&b!==void 0?b:g==null?void 0:g.reporterId,anonymousId:c}},u=()=>{const b=Pt(i);if(!b)return;const g={...b.name?{name:b.name}:{},...b.email?{email:b.email}:{}};return g.name||g.email?g:void 0},m=async(b,g)=>{const v=await Hn(l,{key:i,...b});a||!(v!=null&&v.canSubmit)||(f=Wa({options:e,apiUrl:l,key:i,identity:b,display:g,target:s,answer:v}))};if(t){const b=await _i(l,t);if(a)return h;if(b&&b.status==="pending"){const g=Pt(i),v=async x=>{const _=await Ti(l,t);a||(p(),p=()=>{},_&&_.status==="redeemed"?(Mi(i,{reporterId:_.reporterId,name:x.name,email:x.email}),Ci(window),await m({signedIdentity:e.signedIdentity,reporterId:_.reporterId,anonymousId:c},x.name||x.email?x:void 0)):await m(d(),u()))},y=Gi({origin:za(),tier:b.tier,defaults:g?{name:g.name,email:g.email}:void 0,target:s,onConfirm:x=>{v(x)}});return p=()=>y.destroy(),h}}return await m(d(),u()),h}catch{return Yt}}function Ha(e){return _n(e,typeof window!="undefined"?ki($a()):null)}function ja(e){return _n(e,typeof(e==null?void 0:e.token)=="string"&&e.token.length>0?e.token:null)}le.DEFAULT_API_URL=Rn,le.LAUNCH_EVENT=nt,le.init=Ha,le.redeem=ja});
673
+ `,Zn=typeof self!="undefined"&&self.Blob&&new Blob([Jn],{type:"text/javascript;charset=utf-8"});function zs(e){let t;try{if(t=Zn&&(self.URL||self.webkitURL).createObjectURL(Zn),!t)throw"";const n=new Worker(t,{name:e==null?void 0:e.name});return n.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),n}catch{return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(Jn),{name:e==null?void 0:e.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}var Ws=class{constructor(e){S(this,"pendingCanvasMutations",new Map),S(this,"rafStamps",{latestId:0,invokeId:null}),S(this,"mirror"),S(this,"mutationCb"),S(this,"resetObservers"),S(this,"frozen",!1),S(this,"locked",!1),S(this,"processMutation",(l,a)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(l)||this.pendingCanvasMutations.set(l,[]),this.pendingCanvasMutations.get(l).push(a)});const{sampling:t="all",win:n,blockClass:r,blockSelector:o,recordCanvas:i,dataURLOptions:s}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,i&&t==="all"&&this.initCanvasMutationObserver(n,r,o),i&&typeof t=="number"&&this.initCanvasFPSObserver(t,n,r,o,{dataURLOptions:s})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(e,t,n,r,o){const i=Yn(t,n,r,!0),s=new Map,l=new zs;l.onmessage=u=>{const{id:d}=u.data;if(s.set(d,!1),!("base64"in u.data))return;const{base64:f,type:g,width:v,height:b}=u.data;this.mutationCb({id:d,type:ge["2D"],commands:[{property:"clearRect",args:[0,0,v,b]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:f}],type:g}]},0,0]}]})};const a=1e3/e;let c=0,p;const m=()=>{const u=[];return t.document.querySelectorAll("canvas").forEach(d=>{q(d,n,r,!0)||u.push(d)}),u},h=u=>{if(c&&u-c<a){p=requestAnimationFrame(h);return}c=u,m().forEach(async d=>{var f;const g=this.mirror.getId(d);if(s.get(g)||d.width===0||d.height===0)return;if(s.set(g,!0),["webgl","webgl2"].includes(d.__context)){const b=d.getContext(d.__context);((f=b==null?void 0:b.getContextAttributes())==null?void 0:f.preserveDrawingBuffer)===!1&&b.clear(b.COLOR_BUFFER_BIT)}const v=await createImageBitmap(d);l.postMessage({id:g,bitmap:v,width:d.width,height:d.height,dataURLOptions:o.dataURLOptions},[v])}),p=requestAnimationFrame(h)};p=requestAnimationFrame(h),this.resetObservers=()=>{i(),cancelAnimationFrame(p)}}initCanvasMutationObserver(e,t,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const r=Yn(e,t,n,!1),o=Us(this.processMutation.bind(this),e,t,n),i=Bs(this.processMutation.bind(this),e,t,n);this.resetObservers=()=>{r(),o(),i()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const e=t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((e,t)=>{const n=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,n)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;const n=this.pendingCanvasMutations.get(e);if(!n||t===-1)return;const r=n.map(i=>{const{type:s,...l}=i;return l}),{type:o}=n[0];this.mutationCb({id:t,type:o,commands:r}),this.pendingCanvasMutations.delete(e)}},Hs=class{constructor(e){S(this,"trackedLinkElements",new WeakSet),S(this,"mutationCb"),S(this,"adoptedStyleSheetCb"),S(this,"styleMirror",new ds),this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){if(e.length===0)return;const n={id:t,styleIds:[]},r=[];for(const o of e){let i;this.styleMirror.has(o)?i=this.styleMirror.getId(o):(i=this.styleMirror.add(o),r.push({styleId:i,rules:Array.from(o.rules||CSSRule,(s,l)=>({rule:hn(s,o.href),index:l}))})),n.styleIds.push(i)}r.length>0&&(n.styles=r),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}},js=class{constructor(){S(this,"nodeMap",new WeakMap),S(this,"active",!1)}inOtherBuffer(e,t){const n=this.nodeMap.get(e);return n&&Array.from(n).some(r=>r!==t)}add(e,t){this.active||(this.active=!0,requestAnimationFrame(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}destroy(){}},B,et,Tt,tt=!1;try{if(Array.from([1],e=>e*2)[0]!==2){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=((an=e.contentWindow)==null?void 0:an.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}var Q=Pi();function Ae(e={}){const{emit:t,checkoutEveryNms:n,checkoutEveryNth:r,blockClass:o="rr-block",blockSelector:i=null,ignoreClass:s="rr-ignore",ignoreSelector:l=null,maskTextClass:a="rr-mask",maskTextSelector:c=null,inlineStylesheet:p=!0,maskAllInputs:m,maskInputOptions:h,slimDOMOptions:u,maskInputFn:d,maskTextFn:f,hooks:g,packFn:v,sampling:b={},dataURLOptions:y={},mousemoveWait:k,recordDOM:E=!0,recordCanvas:C=!1,recordCrossOriginIframes:T=!1,recordAfter:w=e.recordAfter==="DOMContentLoaded"?e.recordAfter:"load",userTriggeredOnInput:L=!1,collectFonts:x=!1,inlineImages:D=!1,plugins:j,keepIframeSrcFn:R=()=>!1,ignoreCSSAttributes:ne=new Set([]),errorHandler:J}=e;vs(J);const _=T?window.parent===window:!0;let F=!1;if(!_)try{window.parent.document&&(F=!1)}catch{F=!0}if(_&&!t)throw new Error("emit function is required");if(!_&&!F)return()=>{};k!==void 0&&b.mousemove===void 0&&(b.mousemove=k),Q.reset();const ee=m===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:h!==void 0?h:{password:!0},G=Cn(u);us();let Y,Ce=0;const pe=P=>{for(const te of j||[])te.eventProcessor&&(P=te.eventProcessor(P));return v&&!F&&(P=v(P)),P};B=(P,te)=>{var z;const W=P;if(W.timestamp=Ie(),(z=fe[0])!=null&&z.isFrozen()&&W.type!==A.FullSnapshot&&!(W.type===A.IncrementalSnapshot&&W.data.source===N.Mutation)&&fe.forEach(K=>K.unfreeze()),_)t==null||t(pe(W),te);else if(F){const K={type:"rrweb",event:pe(W),origin:window.location.origin,isCheckout:te};window.parent.postMessage(K,"*")}if(W.type===A.FullSnapshot)Y=W,Ce=0;else if(W.type===A.IncrementalSnapshot){if(W.data.source===N.Mutation&&W.data.isAttachIframe)return;Ce++;const K=r&&Ce>=r,U=n&&W.timestamp-Y.timestamp>n;(K||U)&&et(!0)}};const ot=P=>{B({type:A.IncrementalSnapshot,data:{source:N.Mutation,...P}})},ir=P=>B({type:A.IncrementalSnapshot,data:{source:N.Scroll,...P}}),sr=P=>B({type:A.IncrementalSnapshot,data:{source:N.CanvasMutation,...P}}),ya=P=>B({type:A.IncrementalSnapshot,data:{source:N.AdoptedStyleSheet,...P}}),he=new Hs({mutationCb:ot,adoptedStyleSheetCb:ya}),me=new Os({mirror:Q,mutationCb:ot,stylesheetManager:he,recordCrossOriginIframes:T,wrappedEmit:B});for(const P of j||[])P.getMirror&&P.getMirror({nodeMirror:Q,crossOriginIframeMirror:me.crossOriginIframeMirror,crossOriginIframeStyleMirror:me.crossOriginIframeStyleMirror});const Nt=new js;Tt=new Ws({recordCanvas:C,mutationCb:sr,win:window,blockClass:o,blockSelector:i,mirror:Q,sampling:b.canvas,dataURLOptions:y});const it=new As({mutationCb:ot,scrollCb:ir,bypassOptions:{blockClass:o,blockSelector:i,maskTextClass:a,maskTextSelector:c,inlineStylesheet:p,maskInputOptions:ee,dataURLOptions:y,maskTextFn:f,maskInputFn:d,recordCanvas:C,inlineImages:D,sampling:b,slimDOMOptions:G,iframeManager:me,stylesheetManager:he,canvasManager:Tt,keepIframeSrcFn:R,processedNodeManager:Nt},mirror:Q});et=(P=!1)=>{if(!E)return;B({type:A.Meta,data:{href:window.location.href,width:_n(),height:In()}},P),he.reset(),it.init(),fe.forEach(z=>z.lock());const te=as(document,{mirror:Q,blockClass:o,blockSelector:i,maskTextClass:a,maskTextSelector:c,inlineStylesheet:p,maskAllInputs:ee,maskTextFn:f,maskInputFn:d,slimDOM:G,dataURLOptions:y,recordCanvas:C,inlineImages:D,onSerialize:z=>{Ln(z,Q)&&me.addIframe(z),Nn(z,Q)&&he.trackLinkElement(z),_t(z)&&it.addShadowRoot(M.shadowRoot(z),document)},onIframeLoad:(z,W)=>{me.attachIframe(z,W),it.observeAttachShadow(z)},onStylesheetLoad:(z,W)=>{he.attachLinkElement(z,W)},keepIframeSrcFn:R});if(!te)return console.warn("Failed to snapshot the document");B({type:A.FullSnapshot,data:{node:te,initialOffset:En(window)}},P),fe.forEach(z=>z.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&he.adoptStyleSheets(document.adoptedStyleSheets,Q.getId(document))};try{const P=[],te=W=>{var K;return O(Ns)({mutationCb:ot,mousemoveCb:(U,Ot)=>B({type:A.IncrementalSnapshot,data:{source:Ot,positions:U}}),mouseInteractionCb:U=>B({type:A.IncrementalSnapshot,data:{source:N.MouseInteraction,...U}}),scrollCb:ir,viewportResizeCb:U=>B({type:A.IncrementalSnapshot,data:{source:N.ViewportResize,...U}}),inputCb:U=>B({type:A.IncrementalSnapshot,data:{source:N.Input,...U}}),mediaInteractionCb:U=>B({type:A.IncrementalSnapshot,data:{source:N.MediaInteraction,...U}}),styleSheetRuleCb:U=>B({type:A.IncrementalSnapshot,data:{source:N.StyleSheetRule,...U}}),styleDeclarationCb:U=>B({type:A.IncrementalSnapshot,data:{source:N.StyleDeclaration,...U}}),canvasMutationCb:sr,fontCb:U=>B({type:A.IncrementalSnapshot,data:{source:N.Font,...U}}),selectionCb:U=>{B({type:A.IncrementalSnapshot,data:{source:N.Selection,...U}})},customElementCb:U=>{B({type:A.IncrementalSnapshot,data:{source:N.CustomElement,...U}})},blockClass:o,ignoreClass:s,ignoreSelector:l,maskTextClass:a,maskTextSelector:c,maskInputOptions:ee,inlineStylesheet:p,sampling:b,recordDOM:E,recordCanvas:C,inlineImages:D,userTriggeredOnInput:L,collectFonts:x,doc:W,maskInputFn:d,maskTextFn:f,keepIframeSrcFn:R,blockSelector:i,slimDOMOptions:G,dataURLOptions:y,mirror:Q,iframeManager:me,stylesheetManager:he,shadowDomManager:it,processedNodeManager:Nt,canvasManager:Tt,ignoreCSSAttributes:ne,plugins:((K=j==null?void 0:j.filter(U=>U.observer))==null?void 0:K.map(U=>({observer:U.observer,options:U.options,callback:Ot=>B({type:A.Plugin,data:{plugin:U.name,payload:Ot}})})))||[]},g)};me.addLoadListener(W=>{try{P.push(te(W.contentDocument))}catch(K){console.warn(K)}});const z=()=>{et(),P.push(te(document)),tt=!0};return["interactive","complete"].includes(document.readyState)?z():(P.push(V("DOMContentLoaded",()=>{B({type:A.DomContentLoaded,data:{}}),w==="DOMContentLoaded"&&z()})),P.push(V("load",()=>{B({type:A.Load,data:{}}),w==="load"&&z()},window))),()=>{P.forEach(W=>{try{W()}catch(K){String(K).toLowerCase().includes("cross-origin")||console.warn(K)}}),Nt.destroy(),tt=!1,ys()}}catch(P){console.warn(P)}}Ae.addCustomEvent=(e,t)=>{if(!tt)throw new Error("please add custom event after start recording");B({type:A.Custom,data:{tag:e,payload:t}})},Ae.freezePage=()=>{fe.forEach(e=>e.freeze())},Ae.takeFullSnapshot=e=>{if(!tt)throw new Error("please take full snapshot after start recording");et(e)},Ae.mirror=Q;var Qn=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e[e.Asset=7]="Asset",e))(Qn||{}),Gs=3e4,Vs="[data-fixback-root],[data-fixback-overlay]",qs="img,image,svg,video,object,picture,embed,map,audio",Xs={snapshot:()=>null,stop:()=>{}};function Ys(e={},t=Ae){let n=[],r=[],o=!1;const i=e.maskText!==!1,s=[Vs,...e.blockMedia!==!1?[qs]:[],...e.blockSelector?[e.blockSelector]:[]].join(",");let l;try{var a;l=t({emit:(m,h)=>{h&&!o&&(n=r,r=[]),o=h===!0,r.push(m)},checkoutEveryNms:Gs,maskAllInputs:!0,...i?{maskTextSelector:(a=e.maskTextSelector)!==null&&a!==void 0?a:"*"}:{},blockSelector:s,slimDOMOptions:"all"})}catch{l=void 0}if(typeof l!="function")return Xs;const c=l;let p=!0;return{snapshot(){if(!p)return null;const m=[...n,...r];return m.some(h=>h.type===Qn.FullSnapshot)?{events:m}:null},stop(){if(p){p=!1;try{c()}catch{}n=[],r=[]}}}}function nt(){}function Ks(){return typeof window!="undefined"?window:void 0}function Js(){return typeof document!="undefined"?document:void 0}function Zs(){return typeof console!="undefined"?console:void 0}function Qs(e,t,n,r){const o=t.navigator;if(!o||typeof o.sendBeacon!="function")return nt;const i=o.sendBeacon,s=(a,c,p)=>{if(!n(a))try{e.add($e({api:"beacon",method:"POST",url:a,reqSize:ut(c),outcome:p},r()))}catch{}},l=function(a,c){const p=typeof a=="string"?a:String(a);let m;try{m=i.call(o,a,c)}catch(h){throw s(p,c,"network-error"),h}return s(p,c,m?"ok":"network-error"),m};return o.sendBeacon=l,()=>{o.sendBeacon=i}}function ea(e){return typeof e=="string"?e:e instanceof URL?e.toString():e.url}function ta(e,t){var n,r;return((n=(r=t==null?void 0:t.method)!==null&&r!==void 0?r:typeof e=="object"&&"method"in e?e.method:void 0)!==null&&n!==void 0?n:"GET").toUpperCase()}function er(e,t){try{var n,r,o;return(n=(r=e.headers)===null||r===void 0||(o=r.get)===null||o===void 0?void 0:o.call(r,t))!==null&&n!==void 0?n:null}catch{return null}}function na(e){return e.type==="opaque"||e.type==="opaqueredirect"?"opaque-cors":mt(e.status)}function ra(e){const t=typeof e=="object"&&e!==null&&"name"in e?String(e.name):"";return t==="AbortError"?"aborted":t==="TimeoutError"?"timeout":"network-error"}function oa(e,t,n,r,o=Pe){const i=t.fetch;if(typeof i!="function")return nt;const s=(l,a)=>{const c=ea(l),p=ta(l,a),m=ut(a==null?void 0:a.body),h=o(),u=i.call(t,l,a);return n(c)?u:u.then(d=>{try{e.add($e({api:"fetch",method:p,url:c,status:d.status||void 0,statusText:d.statusText||void 0,durationMs:Math.max(0,o()-h),reqSize:m,respSize:Vt(er(d,"content-length")),contentType:qt(er(d,"content-type")),outcome:na(d)},r()))}catch{}return d},d=>{try{e.add($e({api:"fetch",method:p,url:c,durationMs:Math.max(0,o()-h),reqSize:m,outcome:ra(d)},r()))}catch{}throw d})};return t.fetch=s,()=>{t.fetch=i}}function ia(e,t,n){const r=t.history,o=t.location;if(!r||!o)return nt;let i=o.href;const s=m=>{try{e.add(eo(i,m,n()))}catch{}i=m},l=r.pushState,a=r.replaceState;r.pushState=function(m,h,u){const d=l.call(this,m,h,u);return s(o.href),d},r.replaceState=function(m,h,u){const d=a.call(this,m,h,u);return s(o.href),d};const c=()=>s(o.href),p=()=>s(o.href);return t.addEventListener("popstate",c),t.addEventListener("hashchange",p),()=>{r.pushState=l,r.replaceState=a,t.removeEventListener("popstate",c),t.removeEventListener("hashchange",p)}}function tr(e){try{return nn(e)}catch{return e.tagName?e.tagName.toLowerCase():"unknown"}}function sa(e,t){const n=tr(e);return{category:"ui.click",message:`click ${n}`,timestamp:t,data:{target:n}}}function aa(e,t){const n=tr(e);return{category:"ui.input",message:`input ${n}`,timestamp:t,data:{target:n}}}function nr(e){var t;const n=(t=(typeof e.composedPath=="function"?e.composedPath():[])[0])!==null&&t!==void 0?t:e.target;return n instanceof Element?n:null}function la(e,t,n){const r=i=>{const s=nr(i);if(!(!s||vt(s)))try{e.add(sa(s,n()))}catch{}},o=i=>{const s=nr(i);if(!(!s||vt(s)))try{e.add(aa(s,n()))}catch{}};return t.addEventListener("click",r,!0),t.addEventListener("input",o,!0),()=>{t.removeEventListener("click",r,!0),t.removeEventListener("input",o,!0)}}function rr(e,t){try{return typeof e.getResponseHeader=="function"?e.getResponseHeader(t):null}catch{return null}}function ca(e){try{return e.statusText||void 0}catch{return}}function ua(e,t,n,r,o=Pe){const i=t.XMLHttpRequest;if(typeof i!="function")return nt;const s=i.prototype,l=s.open,a=s.send;return s.open=function(c,p,...m){return this.__fixbackMeta={method:String(c).toUpperCase(),url:String(p)},l.call(this,c,p,...m)},s.send=function(c){const p=this.__fixbackMeta;if(p&&!n(p.url)){const m=o(),h=ut(c);let u;const d=()=>{u=mt(this.status||void 0)},f=()=>{u="network-error"},g=()=>{u="timeout"},v=()=>{u="aborted"},b=()=>{try{var y;e.add($e({api:"xhr",method:p.method,url:p.url,status:this.status||void 0,statusText:ca(this),durationMs:Math.max(0,o()-m),reqSize:h,respSize:Vt(rr(this,"content-length")),contentType:qt(rr(this,"content-type")),outcome:(y=u)!==null&&y!==void 0?y:mt(this.status||void 0)},r()))}catch{}this.removeEventListener("load",d),this.removeEventListener("error",f),this.removeEventListener("timeout",g),this.removeEventListener("abort",v),this.removeEventListener("loadend",b)};this.addEventListener("load",d),this.addEventListener("error",f),this.addEventListener("timeout",g),this.addEventListener("abort",v),this.addEventListener("loadend",b)}return a.call(this,c)},()=>{s.open=l,s.send=a}}function da(e,t={}){var n,r,o,i,s,l,a;const c=(n=t.win)!==null&&n!==void 0?n:Ks(),p=(r=t.doc)!==null&&r!==void 0?r:Js(),m=(o=t.consoleObj)!==null&&o!==void 0?o:Zs(),h=(i=t.consoleLevels)!==null&&i!==void 0?i:lo,u=(s=t.ignoreUrl)!==null&&s!==void 0?s:(()=>!1),d=(l=t.now)!==null&&l!==void 0?l:Date.now,f=(a=t.mono)!==null&&a!==void 0?a:Pe,g=t.captureConsole!==!1,v=t.captureNetwork!==!1,b=[];return m&&g&&b.push(yo(e,m,h,d)),c&&(v&&(b.push(oa(e,c,u,d,f)),b.push(ua(e,c,u,d,f)),b.push(Qs(e,c,u,d))),b.push(ia(e,c,d))),p&&b.push(la(e,p,d)),()=>{for(const y of b)try{y()}catch{}}}function Lt(e,t){return e!=null?e:typeof t=="boolean"?t:!0}function fa(e){var t,n,r,o;const{options:i,apiUrl:s,key:l,getIdentity:a,reporterIdentity:c,target:p,answer:m}=e,h=i.release?Yr(i.release):void 0;i.release&&!h&&console.warn(`[fixback] ignoring invalid release ${JSON.stringify(i.release)} — use 1-100 visible characters with no whitespace or slashes (e.g. a git SHA or semver).`);const u=jo(p,{key:l,reduceMotion:i.reduceMotion}),d=m.capture,f=(t=i.trace)!==null&&t!==void 0?t:{},g=bo({budgets:f.budgets,maxAgeMs:f.maxAgeMs,beforeBreadcrumb:i.beforeBreadcrumb}),v=da(g,{consoleLevels:f.consoleLevels,ignoreUrl:T=>$r(s,T),captureConsole:Lt((n=i.capture)===null||n===void 0?void 0:n.console,d==null?void 0:d.console),captureNetwork:Lt((r=i.capture)===null||r===void 0?void 0:r.network,d==null?void 0:d.network)});let b=null;if(Lt((o=i.capture)===null||o===void 0?void 0:o.replay,d==null?void 0:d.replay)){var y;b=Ys((y=i.replay)!==null&&y!==void 0?y:{})}const k=bi({apiUrl:s,key:l,getIdentity:a,reporterIdentity:c,onSignIn:e.onSignIn,onSignOut:e.onSignOut,gate:m.gate,sdkVersion:Be,release:h,deployEnvironment:i.environment,target:p,buffer:g,replay:b,beforeSend:i.beforeSend,scrub:i.scrub}),E=()=>k.open();u.host.addEventListener(ze,E);let C=()=>{};return i.autoCapture!==!1&&(C=Fo({apiUrl:s,key:l,getIdentity:a,sdkVersion:Be,release:h,deployEnvironment:i.environment,buffer:g,replay:b,beforeSend:i.beforeSend,scrub:i.scrub}).destroy),{teardown:()=>{u.host.removeEventListener(ze,E),k.destroy(),Go(u),v(),b==null||b.stop(),C()},setIdentity:T=>k.setIdentity(T)}}function pa(e){try{return globalThis.localStorage.getItem(dt(e))}catch{return null}}function or(e,t){try{globalThis.localStorage.setItem(dt(e),t)}catch{}}function ha(e){try{globalThis.localStorage.removeItem(dt(e))}catch{}}var De={destroy(){},signIn:()=>Promise.resolve({status:"anonymous"}),signOut:()=>Promise.resolve(),identity:()=>({status:"anonymous"})};function ma(){try{return window.location.href}catch{return""}}async function ba(e,t){try{var n,r;if(typeof document=="undefined")return De;const o=e==null?void 0:e.key;if(typeof o!="string"||o.length===0)return De;const i=window,s=(n=e.anonymousId)!==null&&n!==void 0?n:Mo(),l=(r=e.target)!==null&&r!==void 0?r:document.body;let a=!1,c=pa(o),p=null,m=null,h=null,u;const d=()=>{var C;return{hostIdentity:e.hostIdentity,reporterSession:(C=c)!==null&&C!==void 0?C:void 0,anonymousId:s}},f=()=>{var C;return h?{status:"connected",name:h.name,email:h.email,tier:(C=m)!==null&&C!==void 0?C:null}:{status:"anonymous"}},g=async C=>{const T=await Vr(t,{key:o,code:C,anonymousId:s,platform:"browser"});T&&(c=T.reporterSession,or(o,c))},v=async()=>{var C,T;const w=await Br(t,{key:o,...Ut(d())});a||(w!=null&&w.reporterSession&&(c=w.reporterSession,or(o,c)),m=(C=w==null?void 0:w.tier)!==null&&C!==void 0?C:null,h=(T=w==null?void 0:w.account)!==null&&T!==void 0?T:null,u=w==null?void 0:w.connectUrl,w!=null&&w.canSubmit?p?p.setIdentity(f()):p=fa({options:e,apiUrl:t,key:o,getIdentity:d,reporterIdentity:f(),onSignIn:()=>{b()},onSignOut:()=>{y()},target:l,answer:w}):p&&(p.teardown(),p=null))},b=async()=>{if(a||!u)return f();const C=await xo(i,{connectUrl:u,key:o,returnUrl:ma()});return C.kind==="code"&&(await g(C.code),await v()),f()},y=async()=>{c&&await qr(t,c),ha(o),c=null,await v()},k={destroy:()=>{a=!0,p==null||p.teardown(),p=null},signIn:b,signOut:y,identity:()=>f()},E=ko(i);if(E){if(await g(E),a)return k;Co(i)}return await v(),k}catch{return De}}var rt=De,ga={signIn:()=>rt.signIn(),signOut:()=>rt.signOut(),identity:()=>rt.identity()};function va(e){var t;if((e==null?void 0:e.enabled)===!1)return Promise.resolve(De);const n=(t=e==null?void 0:e.apiUrl)!==null&&t!==void 0?t:Wt;return ba(e,n).then(r=>(rt=r,r))}re.DEFAULT_API_URL=Wt,re.Fixback=ga,re.LAUNCH_EVENT=ze,re.init=va});
840
674
 
841
675
  //# sourceMappingURL=fixback.umd.js.map