@fixback/sdk 0.4.0 → 0.5.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.
- package/dist/annotation.d.ts +10 -73
- package/dist/breadcrumbs.d.ts +2 -123
- package/dist/error-capture.d.ts +3 -32
- package/dist/fixback.umd.js +9 -22
- package/dist/fixback.umd.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +2381 -3358
- package/dist/index.mjs.map +1 -1
- package/dist/init.d.ts +2 -2
- package/dist/overlay.d.ts +9 -11
- package/dist/report.d.ts +14 -99
- package/dist/submit.d.ts +6 -12
- package/dist/version.d.ts +1 -1
- package/package.json +2 -2
- package/dist/auto-report-backoff.d.ts +0 -47
- package/dist/screenshot.d.ts +0 -73
- package/dist/scrub.d.ts +0 -61
package/dist/fixback.umd.js
CHANGED
|
@@ -1,20 +1,7 @@
|
|
|
1
|
-
(function(me,Xe){typeof exports=="object"&&typeof module!="undefined"?Xe(exports):typeof define=="function"&&define.amd?define(["exports"],Xe):(me=typeof globalThis!="undefined"?globalThis:me||self,Xe(me.Fixback={}))})(this,function(me){Object.defineProperty(me,Symbol.toStringTag,{value:"Module"});function Xe(e){return`${e.replace(/\/+$/,"")}/api/ingest/boot`}function Wo(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 Ho(e,t,r=fetch){let n;try{n=await r(Xe(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 Wo(o)?o:null}var zt=["data-fixback-root","data-fixback-overlay"],gu=zt.map(e=>`[${e}]`).join(",");function jo(e){return e instanceof Element&&zt.some(t=>e.hasAttribute(t))}function $t(e){let t=e instanceof Node?e:null;for(;t;){if(t instanceof Element){for(const n of zt)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 kr(e){const t=globalThis.CSS;return t!=null&&t.escape?t.escape(e):e.replace(/[^\w-]/g,r=>`\\${r}`)}function Vo(e){let t=1,r=e.previousElementSibling;for(;r;)r.tagName===e.tagName&&(t+=1),r=r.previousElementSibling;return t}function Mr(e){if(e.id)return`#${kr(e.id)}`;const t=[];let r=e;for(;r&&r.tagName.toLowerCase()!=="html";){if(r.id){t.unshift(`#${kr(r.id)}`);break}const n=r.tagName.toLowerCase(),o=r.parentElement;if(o){const i=Array.from(o.children).filter(a=>a.tagName===r.tagName);t.unshift(i.length>1?`${n}:nth-of-type(${Vo(r)})`:n)}else t.unshift(n);r=o}return t.join(" > ")}function Go(e){const t=e.tagName.toLowerCase();if(e.id)return`${t}#${e.id}`;const r=e.classList[0];return r?`${t}.${r}`:t}function qo(e){const t=[];let r=e;for(;r;)t.unshift(Go(r)),r=r.parentElement;return t.join(" > ")}function Xo(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 Yo(e){return{selector:Mr(e),domPath:qo(e),tag:e.tagName.toLowerCase(),rect:Xo(e)}}function Ko(e){var t,r;const n=(t=e.doc)!==null&&t!==void 0?t:document,o=(r=e.ignore)!==null&&r!==void 0?r:$t;let i=null,a=!1;function l(b){var d;const h=(d=(typeof b.composedPath=="function"?b.composedPath():[])[0])!==null&&d!==void 0?d:b.target;return h instanceof Element?o(h)?null:h:null}function s(b){var d;a||(i=l(b),(d=e.onHover)===null||d===void 0||d.call(e,i))}function u(b){var d;if(a)return;const h=(d=l(b))!==null&&d!==void 0?d:i;h&&(b.preventDefault(),b.stopPropagation(),c(),e.onPick(h))}function f(b){if(!a&&b.key==="Escape"){var d;b.preventDefault(),c(),(d=e.onCancel)===null||d===void 0||d.call(e)}}function c(){a||(a=!0,n.removeEventListener("mouseover",s,!0),n.removeEventListener("click",u,!0),n.removeEventListener("keydown",f,!0),i=null)}return n.addEventListener("mouseover",s,!0),n.addEventListener("click",u,!0),n.addEventListener("keydown",f,!0),{stop:c}}var Jo=7,Ir=/[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}/gi,Rr=new RegExp(`\\d{${Jo},}`,"g"),Zo=/\b(bearer|token)\s+[\w.\-~+/]+=*/gi,Qo=/\bhttps?:\/\/[^\s"'<>]+/gi;function ei(e){return typeof e!="string"||e.length===0?e:e.replace(Ir,"[redacted-email]").replace(Zo,(t,r)=>`${r} [redacted]`).replace(Rr,"[redacted-number]")}function Wt(e){return e.replace(Ir,"[redacted-email]").replace(Rr,"[redacted-number]")}function le(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(/#.*$/,a=>a.includes("=")?"":a);const n=r.match(/^([a-z][a-z0-9+.-]*:\/\/[^/?#]*)([\s\S]*)$/i);if(n)return n[1]+Wt((t=n[2])!==null&&t!==void 0?t:"");const o=r.match(/^(\/\/[^/?#]*)([\s\S]*)$/);if(o){var i;return o[1]+Wt((i=o[2])!==null&&i!==void 0?i:"")}return Wt(r)}function ti(e){const t={...e};return typeof t.url=="string"&&(t.url=le(t.url)),typeof t.from=="string"&&(t.from=le(t.from)),typeof t.to=="string"&&(t.to=le(t.to)),t}function Ye(e){return ei(e.replace(Qo,t=>le(t)))}function Ht(e){if(typeof e=="string")return Ye(e);if(Array.isArray(e))return e.map(Ht);if(e&&typeof e=="object"){const t={};for(const[r,n]of Object.entries(e))t[r]=Ht(n);return t}return e}function ri(e){switch(e.t){case"string":return typeof e.v=="string"?{t:"string",v:Ye(e.v)}:e;case"json":return{t:"json",v:Ht(e.v)};case"error":{if(!e.v||typeof e.v!="object")return e;const t={...e.v};return typeof t.message=="string"&&(t.message=Ye(t.message)),typeof t.stack=="string"&&(t.stack=Ye(t.stack)),{t:"error",v:t}}default:return e}}function ni(e){const t={...e};return typeof t.message=="string"&&(t.message=Ye(t.message)),t.data&&(t.data=ti(t.data)),typeof t.url=="string"&&(t.url=le(t.url)),Array.isArray(t.args)&&(t.args=t.args.map(ri)),t}function oi(e){const t={...e};return typeof t.url=="string"&&(t.url=le(t.url)),t.trace&&t.trace.length>0&&(t.trace=t.trace.map(ni)),t.errorFrames&&t.errorFrames.length>0&&(t.errorFrames=t.errorFrames.map(r=>({...r,file:le(r.file)}))),t}function Tr(e,t={}){const r=t.scrub===!1?e:oi(e),n=t.hook;if(!n)return r;try{const o=n(r);return o!=null?o:null}catch{return r}}var jt={network:100,console:80,breadcrumbs:40},ii=18e4,ai=["log","info","warn","error","assert","debug"],Nr=["warn","error","assert"];function si(e){return e!==void 0&&Nr.includes(e)}var li=Nr;function ci(e){return li.includes(e)}function ui(e){return e==="console"?"console":e==="fetch"||e==="xhr"||e==="beacon"?"network":"breadcrumbs"}function Vt(e,t){return typeof e!="number"||!Number.isFinite(e)||e<1?t:Math.floor(e)}function ut(){return typeof performance!="undefined"&&typeof performance.now=="function"?performance.now():Date.now()}function di(){const e=Math.random().toString(36).slice(2,8);let t=0;return()=>`${e}${(t++).toString(36)}`}var _r=["network","console","breadcrumbs"];function fi(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)si(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 hi(e={}){var t,r,n,o,i,a;const l={network:Vt((t=e.budgets)===null||t===void 0?void 0:t.network,jt.network),console:Vt((r=e.budgets)===null||r===void 0?void 0:r.console,jt.console),breadcrumbs:Vt((n=e.budgets)===null||n===void 0?void 0:n.breadcrumbs,jt.breadcrumbs)},s=e.maxAgeMs===void 0?ii:e.maxAgeMs,u=e.beforeBreadcrumb,f=(o=e.now)!==null&&o!==void 0?o:Date.now,c=(i=e.mono)!==null&&i!==void 0?i:ut,b=(a=e.nextId)!==null&&a!==void 0?a:di(),d={network:[],console:[],breadcrumbs:[]};let h=0;function m(){if(typeof s!="number"||s<=0)return;const p=f()-s;for(const y of _r){const g=d[y];g.length>0&&(d[y]=g.filter(v=>v.crumb.timestamp>=p))}}return{add(p){var y;let g=p;if(u)try{g=u(p)}catch{g=p}if(!g)return;const v={...g,id:(y=g.id)!==null&&y!==void 0?y:b(),timestamp:typeof g.timestamp=="number"?g.timestamp:f(),mono:typeof g.mono=="number"?g.mono:c()},w=ui(v.category);d[w].push({crumb:v,seq:h++}),m();const C=d[w],E=l[w];C.length>E&&(d[w]=w==="console"?fi(C,E):C.slice(-E))},snapshot(){m();const p=[];for(const y of _r)p.push(...d[y]);return p.sort((y,g)=>(typeof y.crumb.mono=="number"?y.crumb.mono:y.crumb.timestamp)-(typeof g.crumb.mono=="number"?g.crumb.mono:g.crumb.timestamp)||y.seq-g.seq),p.map(y=>y.crumb)},clear(){d.network=[],d.console=[],d.breadcrumbs=[],h=0}}}var Lr=300,Gt=2048,vu=4,yu=100,qt=1024,wu=4096,pi=2048;function Ee(e,t){return e.length>t?`${e.slice(0,t)}…`:e}function Ar(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 mi(e){const t=e.map(Ar).join(" ");return t.length>Lr?`${t.slice(0,Lr)}…`:t}function Or(e){var t;const r={name:e.name||"Error",message:Ee(String((t=e.message)!==null&&t!==void 0?t:""),qt)};return typeof e.stack=="string"&&e.stack.length>0&&(r.stack=Ee(e.stack,pi)),r}function Xt(e,t,r){if(e===null)return null;const n=typeof e;if(n==="string")return Ee(e,qt);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:a}=Or(e);return{name:i,message:a}}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(u=>Xt(u,t-1,r));return e.length>100&&s.push(`… ${e.length-100} more`),s}const i=e,a=Object.keys(i),l={};for(const s of a.slice(0,100)){const u=i[s];typeof u=="undefined"||typeof u=="function"||(l[s]=Xt(u,t-1,r))}return a.length>100&&(l["…"]=`${a.length-100} more`),l}finally{r.delete(o)}}function bi(e){if(e==null)return{t:"null",v:null};const t=typeof e;return t==="string"?{t:"string",v:Ee(e,qt)}: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:Or(e)}:{t:"json",v:Xt(e,4,new Set)}}function Yt(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 gi(e){if(Yt(e)<=4096)return e;let t=e.slice();for(;t.length>1&&Yt(t)>4096;)t=t.slice(0,-1);return t.length===1&&Yt(t)>4096?[{t:"string",v:"[trace: console argument omitted (too large)]"}]:t}function Dr(e,t,r,n){const o=gi(t.map(bi));return{category:"console",level:e,message:mi(t),timestamp:r,...o.length>0?{args:o}:{},...n?{source:n}:{}}}function vi(e,t,r){const n=Ee(le(e),Gt),o=Ee(le(t),Gt);return{category:"navigation",message:`${n} → ${o}`,timestamp:r,data:{from:n,to:o}}}function Kt(e){return typeof e!="number"||e<=0?"network-error":e>=500?"http-5xx":e>=400?"http-4xx":"ok"}function Jt(e){if(typeof e=="string")return yi(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 yi(e){try{return typeof TextEncoder!="undefined"?new TextEncoder().encode(e).length:e.length}catch{return e.length}}function Fr(e){if(typeof e!="string")return;const t=Number.parseInt(e,10);return Number.isFinite(t)&&t>=0?t:void 0}function Pr(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 dt(e,t){const r=Ee(le(e.url),Gt),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 Ur(e){try{return Mr(e)}catch{return e.tagName?e.tagName.toLowerCase():"unknown"}}function wi(e,t){const r=Ur(e);return{category:"ui.click",message:`click ${r}`,timestamp:t,data:{target:r}}}function Si(e,t){const r=Ur(e);return{category:"ui.input",message:`input ${r}`,timestamp:t,data:{target:r}}}function xi(e){return e instanceof Error?{name:e.name||"Error",message:e.message}:typeof e=="string"?{name:"Error",message:e}:{name:"Error",message:Ar(e)}}function Ei(e,t,r){const{name:n,message:o}=xi(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 ft(){}function Ci(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 u=e.indexOf("@");u>=0&&(n=e.slice(u+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 a=(r=i[1])!==null&&r!==void 0?r:"",l=Number(i[2]);if(!(!a||!Number.isFinite(l)))return{file:a,line:l}}function ki(e,t=0){if(typeof e!="string"||e.length===0)return;const r=[];for(const n of e.split(`
|
|
2
|
-
`)){const o=Ci(n.trim());o&&r.push(o)}return r[t]}var Mi=1;function Ii(e,t,r,n){const o=[];for(const i of r){const a=t[i];if(typeof a!="function")continue;const l=ci(i),s=(...u)=>{let f;if(l)try{f=ki(new Error().stack,Mi)}catch{f=void 0}try{i==="assert"?u[0]||e.add(Dr("assert",u.slice(1),n(),f)):e.add(Dr(i,u,n(),f))}catch{}return a.apply(t,u)};t[i]=s,o.push(()=>{t[i]=a})}return()=>{for(const i of o)i()}}function Ri(e){return typeof e=="string"?e:e instanceof URL?e.toString():e.url}function Ti(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 Br(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 Ni(e){return e.type==="opaque"||e.type==="opaqueredirect"?"opaque-cors":Kt(e.status)}function _i(e){const t=typeof e=="object"&&e!==null&&"name"in e?String(e.name):"";return t==="AbortError"?"aborted":t==="TimeoutError"?"timeout":"network-error"}function Li(e,t,r,n,o=ut){const i=t.fetch;if(typeof i!="function")return ft;const a=(l,s)=>{const u=Ri(l),f=Ti(l,s),c=Jt(s==null?void 0:s.body),b=o(),d=i.call(t,l,s);return r(u)?d:d.then(h=>{try{e.add(dt({api:"fetch",method:f,url:u,status:h.status||void 0,statusText:h.statusText||void 0,durationMs:Math.max(0,o()-b),reqSize:c,respSize:Fr(Br(h,"content-length")),contentType:Pr(Br(h,"content-type")),outcome:Ni(h)},n()))}catch{}return h},h=>{try{e.add(dt({api:"fetch",method:f,url:u,durationMs:Math.max(0,o()-b),reqSize:c,outcome:_i(h)},n()))}catch{}throw h})};return t.fetch=a,()=>{t.fetch=i}}function zr(e,t){try{return typeof e.getResponseHeader=="function"?e.getResponseHeader(t):null}catch{return null}}function Ai(e){try{return e.statusText||void 0}catch{return}}function Oi(e,t,r,n,o=ut){const i=t.XMLHttpRequest;if(typeof i!="function")return ft;const a=i.prototype,l=a.open,s=a.send;return a.open=function(u,f,...c){return this.__fixbackMeta={method:String(u).toUpperCase(),url:String(f)},l.call(this,u,f,...c)},a.send=function(u){const f=this.__fixbackMeta;if(f&&!r(f.url)){const c=o(),b=Jt(u);let d;const h=()=>{d=Kt(this.status||void 0)},m=()=>{d="network-error"},p=()=>{d="timeout"},y=()=>{d="aborted"},g=()=>{try{var v;e.add(dt({api:"xhr",method:f.method,url:f.url,status:this.status||void 0,statusText:Ai(this),durationMs:Math.max(0,o()-c),reqSize:b,respSize:Fr(zr(this,"content-length")),contentType:Pr(zr(this,"content-type")),outcome:(v=d)!==null&&v!==void 0?v:Kt(this.status||void 0)},n()))}catch{}this.removeEventListener("load",h),this.removeEventListener("error",m),this.removeEventListener("timeout",p),this.removeEventListener("abort",y),this.removeEventListener("loadend",g)};this.addEventListener("load",h),this.addEventListener("error",m),this.addEventListener("timeout",p),this.addEventListener("abort",y),this.addEventListener("loadend",g)}return s.call(this,u)},()=>{a.open=l,a.send=s}}function Di(e,t,r,n){const o=t.navigator;if(!o||typeof o.sendBeacon!="function")return ft;const i=o.sendBeacon,a=(s,u,f)=>{if(!r(s))try{e.add(dt({api:"beacon",method:"POST",url:s,reqSize:Jt(u),outcome:f},n()))}catch{}},l=function(s,u){const f=typeof s=="string"?s:String(s);let c;try{c=i.call(o,s,u)}catch(b){throw a(f,u,"network-error"),b}return a(f,u,c?"ok":"network-error"),c};return o.sendBeacon=l,()=>{o.sendBeacon=i}}function Fi(e,t,r){const n=t.history,o=t.location;if(!n||!o)return ft;let i=o.href;const a=c=>{try{e.add(vi(i,c,r()))}catch{}i=c},l=n.pushState,s=n.replaceState;n.pushState=function(c,b,d){const h=l.call(this,c,b,d);return a(o.href),h},n.replaceState=function(c,b,d){const h=s.call(this,c,b,d);return a(o.href),h};const u=()=>a(o.href),f=()=>a(o.href);return t.addEventListener("popstate",u),t.addEventListener("hashchange",f),()=>{n.pushState=l,n.replaceState=s,t.removeEventListener("popstate",u),t.removeEventListener("hashchange",f)}}function $r(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 Pi(e,t,r){const n=i=>{const a=$r(i);if(!(!a||$t(a)))try{e.add(wi(a,r()))}catch{}},o=i=>{const a=$r(i);if(!(!a||$t(a)))try{e.add(Si(a,r()))}catch{}};return t.addEventListener("click",n,!0),t.addEventListener("input",o,!0),()=>{t.removeEventListener("click",n,!0),t.removeEventListener("input",o,!0)}}function Ui(e,t={}){var r,n,o,i,a,l,s;const u=(r=t.win)!==null&&r!==void 0?r:globalThis,f=(n=t.doc)!==null&&n!==void 0?n:typeof document!="undefined"?document:void 0,c=(o=t.consoleObj)!==null&&o!==void 0?o:typeof console!="undefined"?console:void 0,b=(i=t.consoleLevels)!==null&&i!==void 0?i:ai,d=(a=t.ignoreUrl)!==null&&a!==void 0?a:(()=>!1),h=(l=t.now)!==null&&l!==void 0?l:Date.now,m=(s=t.mono)!==null&&s!==void 0?s:ut,p=t.captureConsole!==!1,y=t.captureNetwork!==!1,g=[];return c&&p&&g.push(Ii(e,c,b,h)),u&&(y&&(g.push(Li(e,u,d,h,m)),g.push(Oi(e,u,d,h,m)),g.push(Di(e,u,d,h))),g.push(Fi(e,u,h))),f&&g.push(Pi(e,f,h)),()=>{for(const v of g)try{v()}catch{}}}var Bi="#e5484d";function Wr(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 zi(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 $i(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 Wi=100,Hi=new Set([".","..","latest"]);function ji(e){const t=e.trim();if(!(t.length===0||t.length>Wi)&&!Hi.has(t)&&!/[\s/\\\u0000-\u001f\u007f]/.test(t))return t}function Hr(e,t,r){var n;const o={},i=e.innerWidth;typeof i=="number"&&i>0&&(o.viewportWidth=Math.round(i));const a=e.innerHeight;typeof a=="number"&&a>0&&(o.viewportHeight=Math.round(a));const l=(n=e.navigator)===null||n===void 0?void 0:n.userAgent;return typeof l=="string"&&l.length>0&&(o.browser=l),t.length>0&&(o.sdkVersion=t),r&&r.length>0&&(o.release=r),o}function jr(e){var t,r,n;const o={},i=(t=e.comment)===null||t===void 0?void 0:t.trim();i&&(o.comment=i);const a=(r=e.reporterName)===null||r===void 0?void 0:r.trim();a&&(o.reporterName=a);const l=(n=e.reporterEmail)===null||n===void 0?void 0:n.trim();l&&(o.reporterEmail=l),e.url&&(o.url=e.url),e.environment&&Object.keys(e.environment).length>0&&(o.environment=e.environment);const s=$i({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 Zt;function Vi(e,t){return e[13]=1,e[14]=t>>8,e[15]=t&255,e[16]=t>>8,e[17]=t&255,e}var Vr=112,Gr=72,qr=89,Xr=115,Qt;function Gi(){const e=new Int32Array(256);for(let t=0;t<256;t++){let r=t;for(let n=0;n<8;n++)r=r&1?3988292384^r>>>1:r>>>1;e[t]=r}return e}function qi(e){let t=-1;Qt||(Qt=Gi());for(let r=0;r<e.length;r++)t=Qt[(t^e[r])&255]^t>>>8;return t^-1}function Xi(e){const t=e.length-1;for(let r=t;r>=4;r--)if(e[r-4]===9&&e[r-3]===Vr&&e[r-2]===Gr&&e[r-1]===qr&&e[r]===Xr)return r-3;return 0}function Yi(e,t,r=!1){const n=new Uint8Array(13);t*=39.3701,n[0]=Vr,n[1]=Gr,n[2]=qr,n[3]=Xr,n[4]=t>>>24,n[5]=t>>>16,n[6]=t>>>8,n[7]=t&255,n[8]=n[4],n[9]=n[5],n[10]=n[6],n[11]=n[7],n[12]=1;const o=qi(n),i=new Uint8Array(4);if(i[0]=o>>>24,i[1]=o>>>16,i[2]=o>>>8,i[3]=o&255,r){const a=Xi(e);return e.set(n,a),e.set(i,a+13),e}else{const a=new Uint8Array(4);a[0]=0,a[1]=0,a[2]=0,a[3]=9;const l=new Uint8Array(54);return l.set(e,0),l.set(a,33),l.set(n,37),l.set(i,50),l}}var Yr="[modern-screenshot]",ye=typeof window!="undefined",Ki=ye&&"Worker"in window,Ji=ye&&"atob"in window,Su=ye&&"btoa"in window,er=ye?(Zt=window.navigator)===null||Zt===void 0?void 0:Zt.userAgent:"",Kr=er.includes("Chrome"),ht=er.includes("AppleWebKit")&&!Kr,tr=er.includes("Firefox"),Zi=e=>e&&"__CONTEXT__"in e,Qi=e=>e.constructor.name==="CSSFontFaceRule",ea=e=>e.constructor.name==="CSSImportRule",ta=e=>e.constructor.name==="CSSLayerBlockRule",he=e=>e.nodeType===1,Ke=e=>typeof e.className=="object",Jr=e=>e.tagName==="image",ra=e=>e.tagName==="use",Je=e=>he(e)&&typeof e.style!="undefined"&&!Ke(e),na=e=>e.nodeType===8,oa=e=>e.nodeType===3,Ne=e=>e.tagName==="IMG",pt=e=>e.tagName==="VIDEO",ia=e=>e.tagName==="CANVAS",aa=e=>e.tagName==="TEXTAREA",sa=e=>e.tagName==="INPUT",la=e=>e.tagName==="STYLE",ca=e=>e.tagName==="SCRIPT",ua=e=>e.tagName==="SELECT",da=e=>e.tagName==="SLOT",fa=e=>e.tagName==="IFRAME",ha=(...e)=>console.warn(Yr,...e);function pa(e){var t;const r=e==null||(t=e.createElement)===null||t===void 0?void 0:t.call(e,"canvas");return r&&(r.height=r.width=1),!!r&&"toDataURL"in r&&!!r.toDataURL("image/webp").includes("image/webp")}var rr=e=>e.startsWith("data:");function Zr(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(ye&&e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i)||!ye)return e;const r=mt().implementation.createHTMLDocument(),n=r.createElement("base"),o=r.createElement("a");return r.head.appendChild(n),r.body.appendChild(o),t&&(n.href=t),o.href=e,o.href}function mt(e){var t;return(t=e&&he(e)?e==null?void 0:e.ownerDocument:e)!==null&&t!==void 0?t:window.document}var bt="http://www.w3.org/2000/svg";function ma(e,t,r){const n=mt(r).createElementNS(bt,"svg");return n.setAttributeNS(null,"width",e.toString()),n.setAttributeNS(null,"height",t.toString()),n.setAttributeNS(null,"viewBox",`0 0 ${e} ${t}`),n}function ba(e,t){let r=new XMLSerializer().serializeToString(e);return t&&(r=r.replace(/[\u0000-\u0008\v\f\u000E-\u001F\uD800-\uDFFF\uFFFE\uFFFF]/gu,"")),`data:image/svg+xml;charset=utf-8,${encodeURIComponent(r)}`}async function ga(e,t="image/png",r=1){try{return await new Promise((n,o)=>{e.toBlob(i=>{i?n(i):o(new Error("Blob is null"))},t,r)})}catch(n){if(Ji)return va(e.toDataURL(t,r));throw n}}function va(e){var t,r;const[n,o]=e.split(","),i=(t=(r=n.match(/data:(.+);/))===null||r===void 0?void 0:r[1])!==null&&t!==void 0?t:void 0,a=window.atob(o),l=a.length,s=new Uint8Array(l);for(let u=0;u<l;u+=1)s[u]=a.charCodeAt(u);return new Blob([s],{type:i})}function Qr(e,t){return new Promise((r,n)=>{const o=new FileReader;o.onload=()=>r(o.result),o.onerror=()=>n(o.error),o.onabort=()=>n(new Error(`Failed read blob to ${t}`)),t==="dataUrl"?o.readAsDataURL(e):t==="arrayBuffer"&&o.readAsArrayBuffer(e)})}var ya=e=>Qr(e,"dataUrl"),wa=e=>Qr(e,"arrayBuffer");function _e(e,t){const r=mt(t).createElement("img");return r.decoding="sync",r.loading="eager",r.src=e,r}function Ze(e,t){return new Promise(r=>{const{timeout:n,ownerDocument:o,onError:i,onWarn:a}=t!=null?t:{},l=typeof e=="string"?_e(e,mt(o)):e;let s=null,u=null;function f(){r(l),s&&clearTimeout(s),u==null||u()}if(n&&(s=setTimeout(f,n)),pt(l)){const c=l.currentSrc||l.src;if(!c)return l.poster?Ze(l.poster,t).then(r):f();if(l.readyState>=2)return f();const b=f,d=h=>{a==null||a("Failed video load",c,h),i==null||i(h),f()};u=()=>{l.removeEventListener("loadeddata",b),l.removeEventListener("error",d)},l.addEventListener("loadeddata",b,{once:!0}),l.addEventListener("error",d,{once:!0})}else{const c=Jr(l)?l.href.baseVal:l.currentSrc||l.src;if(!c)return f();const b=async()=>{if(Ne(l)&&"decode"in l)try{await l.decode()}catch(h){a==null||a("Failed to decode image, trying to render anyway",l.dataset.originalSrc||c,h)}f()},d=h=>{a==null||a("Failed image load",l.dataset.originalSrc||c,h),f()};if(Ne(l)&&l.complete)return b();u=()=>{l.removeEventListener("load",b),l.removeEventListener("error",d)},l.addEventListener("load",b,{once:!0}),l.addEventListener("error",d,{once:!0})}})}async function Sa(e,t){Je(e)&&(Ne(e)||pt(e)?await Ze(e,t):await Promise.all(["img","video"].flatMap(r=>Array.from(e.querySelectorAll(r)).map(n=>Ze(n,t)))))}var en=(function(){let t=0;const r=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(t+=1,`u${r()}${t}`)})();function tn(e){return e==null?void 0:e.split(",").map(t=>t.trim().replace(/"|'/g,"").toLowerCase()).filter(Boolean)}var rn=0;function xa(e){const t=`${Yr}[#${rn}]`;return rn++,{time:r=>e&&console.time(`${t} ${r}`),timeEnd:r=>e&&console.timeEnd(`${t} ${r}`),warn:(...r)=>e&&ha(...r)}}function Ea(e){return{cache:e?"no-cache":"force-cache"}}async function nr(e,t){return Zi(e)?e:Ca(e,{...t,autoDestruct:!0})}async function Ca(e,t){var r,n,o,i,a;const{scale:l=1,workerUrl:s,workerNumber:u=1}=t||{},f=!!(t!=null&&t.debug),c=(r=t==null?void 0:t.features)!==null&&r!==void 0?r:!0,b=(n=e.ownerDocument)!==null&&n!==void 0?n:ye?window.document:void 0,d=(o=(i=e.ownerDocument)===null||i===void 0?void 0:i.defaultView)!==null&&o!==void 0?o:ye?window:void 0,h=new Map,m={width:0,height:0,quality:1,type:"image/png",scale:l,backgroundColor:null,style:null,filter:null,maximumCanvasSize:0,timeout:3e4,progress:null,debug:f,fetch:{requestInit:Ea(t==null||(a=t.fetch)===null||a===void 0?void 0:a.bypassingCache),placeholderImage:"data:image/png;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",bypassingCache:!1,...t==null?void 0:t.fetch},fetchFn:null,font:{},drawImageInterval:100,workerUrl:null,workerNumber:u,onCloneEachNode:null,onCloneNode:null,onEmbedNode:null,onCreateForeignObjectSvg:null,includeStyleProperties:null,autoDestruct:!1,...t,__CONTEXT__:!0,log:xa(f),node:e,ownerDocument:b,ownerWindow:d,dpi:l===1?null:96*l,svgStyleElement:nn(b),svgDefsElement:b==null?void 0:b.createElementNS(bt,"defs"),svgStyles:new Map,defaultComputedStyles:new Map,workers:[...Array.from({length:Ki&&s&&u?u:0})].map(()=>{try{const g=new Worker(s);return g.onmessage=async v=>{const{url:w,result:C}=v.data;if(C){var E,T;(E=h.get(w))===null||E===void 0||(T=E.resolve)===null||T===void 0||T.call(E,C)}else{var L,k;(L=h.get(w))===null||L===void 0||(k=L.reject)===null||k===void 0||k.call(L,new Error(`Error receiving message from worker: ${w}`))}},g.onmessageerror=v=>{var w,C;const{url:E}=v.data;(w=h.get(E))===null||w===void 0||(C=w.reject)===null||C===void 0||C.call(w,new Error(`Error receiving message from worker: ${E}`))},g}catch(g){return m.log.warn("Failed to new Worker",g),null}}).filter(Boolean),fontFamilies:new Map,fontCssTexts:new Map,acceptOfImage:`${[pa(b)&&"image/webp","image/svg+xml","image/*","*/*"].filter(Boolean).join(",")};q=0.8`,requests:h,drawImageCount:0,tasks:[],features:c,isEnable:g=>{var v;if(g==="restoreScrollPosition"){var w;return typeof c=="boolean"?!1:(w=c[g])!==null&&w!==void 0?w:!1}return typeof c=="boolean"?c:(v=c[g])!==null&&v!==void 0?v:!0},shadowRoots:[]};m.log.time("wait until load"),await Sa(e,{timeout:m.timeout,onWarn:m.log.warn}),m.log.timeEnd("wait until load");const{width:p,height:y}=ka(e,m);return m.width=p,m.height=y,m}function nn(e){if(!e)return;const t=e.createElement("style"),r=t.ownerDocument.createTextNode(`
|
|
3
|
-
.
|
|
4
|
-
|
|
5
|
-
-webkit-background-clip: text;
|
|
6
|
-
}
|
|
7
|
-
`);return t.appendChild(r),t}function ka(e,t){let{width:r,height:n}=t;if(he(e)&&(!r||!n)){const o=e.getBoundingClientRect();r=r||o.width||Number(e.getAttribute("width"))||0,n=n||o.height||Number(e.getAttribute("height"))||0}return{width:r,height:n}}async function Ma(e,t){const{log:r,timeout:n,drawImageCount:o,drawImageInterval:i}=t;r.time("image to canvas");const a=await Ze(e,{timeout:n,onWarn:t.log.warn}),{canvas:l,context2d:s}=Ia(e.ownerDocument,t),u=()=>{try{s==null||s.drawImage(a,0,0,l.width,l.height)}catch(f){t.log.warn("Failed to drawImage",f)}};if(u(),t.isEnable("fixSvgXmlDecode"))for(let f=0;f<o;f++)await new Promise(c=>{setTimeout(()=>{s==null||s.clearRect(0,0,l.width,l.height),u(),c()},f+i)});return t.drawImageCount=0,r.timeEnd("image to canvas"),l}function Ia(e,t){const{width:r,height:n,scale:o,backgroundColor:i,maximumCanvasSize:a}=t,l=e.createElement("canvas");l.width=Math.floor(r*o),l.height=Math.floor(n*o),l.style.width=`${r}px`,l.style.height=`${n}px`,a&&(l.width>a||l.height>a)&&(l.width>a&&l.height>a?l.width>l.height?(l.height*=a/l.width,l.width=a):(l.width*=a/l.height,l.height=a):l.width>a?(l.height*=a/l.width,l.width=a):(l.width*=a/l.height,l.height=a));const s=l.getContext("2d");return s&&i&&(s.fillStyle=i,s.fillRect(0,0,l.width,l.height)),{canvas:l,context2d:s}}function on(e,t){if(e.ownerDocument)try{const i=e.toDataURL();if(i!=="data:,")return _e(i,e.ownerDocument)}catch(i){t.log.warn("Failed to clone canvas",i)}const r=e.cloneNode(!1),n=e.getContext("2d"),o=r.getContext("2d");try{return n&&o&&o.putImageData(n.getImageData(0,0,e.width,e.height),0,0),r}catch(i){t.log.warn("Failed to clone canvas",i)}return r}function Ra(e,t){try{var r;if(!(e==null||(r=e.contentDocument)===null||r===void 0)&&r.documentElement)return or(e.contentDocument.documentElement,t)}catch(n){t.log.warn("Failed to clone iframe",n)}return e.cloneNode(!1)}function Ta(e){const t=e.cloneNode(!1);return e.currentSrc&&e.currentSrc!==e.src&&(t.src=e.currentSrc,t.srcset=""),t.loading==="lazy"&&(t.loading="eager"),t}async function Na(e,t){if(e.ownerDocument&&!e.currentSrc&&e.poster)return _e(e.poster,e.ownerDocument);const r=e.cloneNode(!1);r.crossOrigin="anonymous",e.currentSrc&&e.currentSrc!==e.src&&(r.src=e.currentSrc);const n=r.ownerDocument;if(n){let o=!0;if(await Ze(r,{onError:()=>o=!1,onWarn:t.log.warn}),!o)return e.poster?_e(e.poster,e.ownerDocument):r;r.currentTime=e.currentTime,await new Promise(a=>{r.addEventListener("seeked",a,{once:!0})});const i=n.createElement("canvas");i.width=e.offsetWidth,i.height=e.offsetHeight;try{const a=i.getContext("2d");a&&a.drawImage(r,0,0,i.width,i.height)}catch(a){return t.log.warn("Failed to clone video",a),e.poster?_e(e.poster,e.ownerDocument):r}return on(i,t)}return r}function _a(e,t){return ia(e)?on(e,t):fa(e)?Ra(e,t):Ne(e)?Ta(e):pt(e)?Na(e,t):e.cloneNode(!1)}function La(e){let t=e.sandbox;if(!t){const{ownerDocument:r}=e;try{r&&(t=r.createElement("iframe"),t.id=`__SANDBOX__${en()}`,t.width="0",t.height="0",t.style.visibility="hidden",t.style.position="fixed",r.body.appendChild(t),t.srcdoc='<!DOCTYPE html><meta charset="UTF-8"><title></title><body>',e.sandbox=t)}catch(n){e.log.warn("Failed to getSandBox",n)}}return t}var Aa=["width","height","-webkit-text-fill-color"],Oa=["stroke","fill"];function an(e,t,r){const{defaultComputedStyles:n}=r,o=e.nodeName.toLowerCase(),i=Ke(e)&&o!=="svg",a=i?Oa.map(m=>[m,e.getAttribute(m)]).filter(([,m])=>m!==null):[],l=[i&&"svg",o,a.map((m,p)=>`${m}=${p}`).join(","),t].filter(Boolean).join(":");if(n.has(l))return n.get(l);const s=La(r),u=s==null?void 0:s.contentWindow;if(!u)return new Map;const f=u==null?void 0:u.document;let c,b;i?(c=f.createElementNS(bt,"svg"),b=c.ownerDocument.createElementNS(c.namespaceURI,o),a.forEach(([m,p])=>{b.setAttributeNS(null,m,p)}),c.appendChild(b)):c=b=f.createElement(o),b.textContent=" ",f.body.appendChild(c);const d=u.getComputedStyle(b,t),h=new Map;for(let m=d.length,p=0;p<m;p++){const y=d.item(p);Aa.includes(y)||h.set(y,d.getPropertyValue(y))}return f.body.removeChild(c),n.set(l,h),h}function sn(e,t,r){const n=new Map,o=[],i=new Map;if(r)for(const s of r)l(s);else for(let s=e.length,u=0;u<s;u++)l(e.item(u));for(let s=o.length,u=0;u<s;u++){var a;(a=i.get(o[u]))===null||a===void 0||a.forEach((f,c)=>n.set(c,f))}function l(s){const u=e.getPropertyValue(s),f=e.getPropertyPriority(s),c=s.lastIndexOf("-"),b=c>-1?s.substring(0,c):void 0;if(b){let d=i.get(b);d||(d=new Map,i.set(b,d)),d.set(s,[u,f])}t.get(s)===u&&!f||(b?o.push(b):n.set(s,[u,f]))}return n}function Da(e,t,r,n){var o;const{ownerWindow:i,includeStyleProperties:a,currentParentNodeStyle:l}=n,s=t.style,u=i.getComputedStyle(e),f=an(e,null,n);l==null||l.forEach((m,p)=>{f.delete(p)});const c=sn(u,f,a);if(c.delete("transition-property"),c.delete("all"),c.delete("d"),c.delete("content"),r&&(c.delete("position"),c.delete("margin-top"),c.delete("margin-right"),c.delete("margin-bottom"),c.delete("margin-left"),c.delete("margin-block-start"),c.delete("margin-block-end"),c.delete("margin-inline-start"),c.delete("margin-inline-end"),c.set("box-sizing",["border-box",""])),((o=c.get("background-clip"))===null||o===void 0?void 0:o[0])==="text"&&t.classList.add("______background-clip--text"),Kr){var b,d,h;c.has("font-kerning")||c.set("font-kerning",["normal",""]),(((b=c.get("overflow-x"))===null||b===void 0?void 0:b[0])==="hidden"||((d=c.get("overflow-y"))===null||d===void 0?void 0:d[0])==="hidden")&&((h=c.get("text-overflow"))===null||h===void 0?void 0:h[0])==="ellipsis"&&e.scrollWidth===e.clientWidth&&c.set("text-overflow",["clip",""])}for(let m=s.length,p=0;p<m;p++)s.removeProperty(s.item(p));return c.forEach(([m,p],y)=>{s.setProperty(y,m,p)}),c}function Fa(e,t){(aa(e)||sa(e)||ua(e))&&t.setAttribute("value",e.value)}var Pa=["::before","::after"],Ua=["::-webkit-scrollbar","::-webkit-scrollbar-button","::-webkit-scrollbar-thumb","::-webkit-scrollbar-track","::-webkit-scrollbar-track-piece","::-webkit-scrollbar-corner","::-webkit-resizer"];function Ba(e,t,r,n,o){const{ownerWindow:i,svgStyleElement:a,svgStyles:l,currentNodeStyle:s}=n;if(!a||!i)return;function u(f){var c;const b=i.getComputedStyle(e,f);let d=b.getPropertyValue("content");if(!d||d==="none")return;o==null||o(d),d=d.replace(/(')|(")|(counter\(.+\))/g,"");const h=[en()],m=an(e,f,n);s==null||s.forEach((w,C)=>{m.delete(C)});const p=sn(b,m,n.includeStyleProperties);p.delete("content"),p.delete("-webkit-locale"),((c=p.get("background-clip"))===null||c===void 0?void 0:c[0])==="text"&&t.classList.add("______background-clip--text");const y=[`content: '${d}';`];if(p.forEach(([w,C],E)=>{y.push(`${E}: ${w}${C?" !important":""};`)}),y.length===1)return;try{t.className=[t.className,...h].join(" ")}catch(w){n.log.warn("Failed to copyPseudoClass",w);return}const g=y.join(`
|
|
8
|
-
`);let v=l.get(g);v||(v=[],l.set(g,v)),v.push(`.${h[0]}${f}`)}Pa.forEach(u),r&&Ua.forEach(u)}var ln=new Set(["symbol"]);async function cn(e,t,r,n,o){if(he(r)&&(la(r)||ca(r))||n.filter&&!n.filter(r))return;ln.has(t.nodeName)||ln.has(r.nodeName)?n.currentParentNodeStyle=void 0:n.currentParentNodeStyle=n.currentNodeStyle;const i=await or(r,n,!1,o);n.isEnable("restoreScrollPosition")&&za(e,i),t.appendChild(i)}async function un(e,t,r,n){let o=e.firstChild;if(he(e)&&e.shadowRoot){var i;o=(i=e.shadowRoot)===null||i===void 0?void 0:i.firstChild,r.shadowRoots.push(e.shadowRoot)}for(let a=o;a;a=a.nextSibling)if(!na(a))if(he(a)&&da(a)&&typeof a.assignedNodes=="function"){const l=a.assignedNodes();for(let s=0;s<l.length;s++)await cn(e,t,l[s],r,n)}else await cn(e,t,a,r,n)}function za(e,t){if(!Je(e)||!Je(t))return;const{scrollTop:r,scrollLeft:n}=e;if(!r&&!n)return;const{transform:o}=t.style,i=new DOMMatrix(o),{a,b:l,c:s,d:u}=i;i.a=1,i.b=0,i.c=0,i.d=1,i.translateSelf(-n,-r),i.a=a,i.b=l,i.c=s,i.d=u,t.style.transform=i.toString()}function $a(e,t){const{backgroundColor:r,width:n,height:o,style:i}=t,a=e.style;if(r&&a.setProperty("background-color",r,"important"),n&&a.setProperty("width",`${n}px`,"important"),o&&a.setProperty("height",`${o}px`,"important"),i)for(const l in i)a[l]=i[l]}var Wa=/^[\w-:]+$/;async function or(e,t,r=!1,n){const{ownerDocument:o,ownerWindow:i,fontFamilies:a,onCloneEachNode:l}=t;if(o&&oa(e))return n&&/\S/.test(e.data)&&n(e.data),o.createTextNode(e.data);if(o&&i&&he(e)&&(Je(e)||Ke(e))){var s,u;const d=await _a(e,t);if(t.isEnable("removeAbnormalAttributes")){const v=d.getAttributeNames();for(let w=v.length,C=0;C<w;C++){const E=v[C];Wa.test(E)||d.removeAttribute(E)}}const h=t.currentNodeStyle=Da(e,d,r,t);r&&$a(d,t);let m=!1;if(t.isEnable("copyScrollbar")){var f,c;const v=[(f=h.get("overflow-x"))===null||f===void 0?void 0:f[0],(c=h.get("overflow-y"))===null||c===void 0?void 0:c[0]];m=v.includes("scroll")||(v.includes("auto")||v.includes("overlay"))&&(e.scrollHeight>e.clientHeight||e.scrollWidth>e.clientWidth)}const p=(s=h.get("text-transform"))===null||s===void 0?void 0:s[0],y=tn((u=h.get("font-family"))===null||u===void 0?void 0:u[0]),g=y?v=>{p==="uppercase"?v=v.toUpperCase():p==="lowercase"?v=v.toLowerCase():p==="capitalize"&&(v=v[0].toUpperCase()+v.substring(1)),y.forEach(w=>{let C=a.get(w);C||a.set(w,C=new Set),v.split("").forEach(E=>C.add(E))})}:void 0;return Ba(e,d,m,t,g),Fa(e,d),pt(e)||await un(e,d,t,g),await(l==null?void 0:l(d)),d}const b=e.cloneNode(!1);return await un(e,b,t),await(l==null?void 0:l(b)),b}function Ha(e){if(e.ownerDocument=void 0,e.ownerWindow=void 0,e.svgStyleElement=void 0,e.svgDefsElement=void 0,e.svgStyles.clear(),e.defaultComputedStyles.clear(),e.sandbox){try{e.sandbox.remove()}catch(t){e.log.warn("Failed to destroyContext",t)}e.sandbox=void 0}e.workers=[],e.fontFamilies.clear(),e.fontCssTexts.clear(),e.requests.clear(),e.tasks=[],e.shadowRoots=[]}function ja(e){const{url:t,timeout:r,responseType:n,...o}=e,i=new AbortController,a=r?setTimeout(()=>i.abort(),r):void 0;return fetch(t,{signal:i.signal,...o}).then(l=>{if(!l.ok)throw new Error("Failed fetch, not 2xx response",{cause:l});switch(n){case"arrayBuffer":return l.arrayBuffer();case"dataUrl":return l.blob().then(ya);default:return l.text()}}).finally(()=>clearTimeout(a))}function Qe(e,t){const{url:r,requestType:n="text",responseType:o="text",imageDom:i}=t;let a=r;const{timeout:l,acceptOfImage:s,requests:u,fetchFn:f,fetch:{requestInit:c,bypassingCache:b,placeholderImage:d},font:h,workers:m,fontFamilies:p}=e;n==="image"&&(ht||tr)&&e.drawImageCount++;let y=u.get(r);if(!y){b&&b instanceof RegExp&&b.test(a)&&(a+=(/\?/.test(a)?"&":"?")+new Date().getTime());const g=n.startsWith("font")&&h&&h.minify,v=new Set;g&&n.split(";")[1].split(",").forEach(E=>{p.has(E)&&p.get(E).forEach(T=>v.add(T))});const w=g&&v.size,C={url:a,timeout:l,responseType:w?"arrayBuffer":o,headers:n==="image"?{accept:s}:void 0,...c};y={type:n,resolve:void 0,reject:void 0,response:null},y.response=(async()=>{if(f&&n==="image"){const E=await f(r);if(E)return E}return!ht&&r.startsWith("http")&&m.length?new Promise((E,T)=>{m[u.size&m.length-1].postMessage({rawUrl:r,...C}),y.resolve=E,y.reject=T}):ja(C)})().catch(E=>{if(u.delete(r),n==="image"&&d)return e.log.warn("Failed to fetch image base64, trying to use placeholder image",a),typeof d=="string"?d:d(i);throw E}),u.set(r,y)}return y.response}async function dn(e,t,r,n){if(!fn(e))return e;for(const[o,i]of Va(e,t))try{const a=await Qe(r,{url:i,requestType:n?"image":"text",responseType:"dataUrl"});e=e.replace(Ga(o),`$1${a}$3`)}catch(a){r.log.warn("Failed to fetch css data url",o,a)}return e}function fn(e){return/url\((['"]?)([^'"]+?)\1\)/.test(e)}var hn=/url\((['"]?)([^'"]+?)\1\)/g;function Va(e,t){const r=[];return e.replace(hn,(n,o,i)=>(r.push([i,Zr(i,t)]),n)),r.filter(([n])=>!rr(n))}function Ga(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}var qa=["background-image","border-image-source","-webkit-border-image","-webkit-mask-image","list-style-image"];function Xa(e,t){return qa.map(r=>{const n=e.getPropertyValue(r);return!n||n==="none"?null:((ht||tr)&&t.drawImageCount++,dn(n,null,t,!0).then(o=>{!o||n===o||e.setProperty(r,o,e.getPropertyPriority(r))}))}).filter(Boolean)}function Ya(e,t){if(Ne(e)){const r=e.currentSrc||e.src;if(!rr(r))return[Qe(t,{url:r,imageDom:e,requestType:"image",responseType:"dataUrl"}).then(n=>{n&&(e.srcset="",e.dataset.originalSrc=r,e.src=n||"")})];(ht||tr)&&t.drawImageCount++}else if(Ke(e)&&!rr(e.href.baseVal)){const r=e.href.baseVal;return[Qe(t,{url:r,imageDom:e,requestType:"image",responseType:"dataUrl"}).then(n=>{n&&(e.dataset.originalSrc=r,e.href.baseVal=n||"")})]}return[]}function Ka(e,t){var r;const{ownerDocument:n,svgDefsElement:o}=t,i=(r=e.getAttribute("href"))!==null&&r!==void 0?r:e.getAttribute("xlink:href");if(!i)return[];const[a,l]=i.split("#");if(l){const s=`#${l}`,u=t.shadowRoots.reduce((f,c)=>f!=null?f:c.querySelector(`svg ${s}`),n==null?void 0:n.querySelector(`svg ${s}`));if(a&&e.setAttribute("href",s),o!=null&&o.querySelector(s))return[];if(u)return o==null||o.appendChild(u.cloneNode(!0)),[];if(a)return[Qe(t,{url:a,responseType:"text"}).then(f=>{o==null||o.insertAdjacentHTML("beforeend",f)})]}return[]}function pn(e,t){const{tasks:r}=t;he(e)&&((Ne(e)||Jr(e))&&r.push(...Ya(e,t)),ra(e)&&r.push(...Ka(e,t))),Je(e)&&r.push(...Xa(e.style,t)),e.childNodes.forEach(n=>{pn(n,t)})}async function Ja(e,t){const{ownerDocument:r,svgStyleElement:n,fontFamilies:o,fontCssTexts:i,tasks:a,font:l}=t;if(!(!r||!n||!o.size))if(l&&l.cssText){const s=bn(l.cssText,t);n.appendChild(r.createTextNode(`${s}
|
|
9
|
-
`))}else{const s=Array.from(r.styleSheets).filter(d=>{try{return"cssRules"in d&&!!d.cssRules.length}catch(h){return t.log.warn(`Error while reading CSS rules from ${d.href}`,h),!1}}),u=r.implementation.createHTMLDocument(""),f=u.createElement("style");u.head.appendChild(f);const c=f.sheet;await Promise.all(s.flatMap(d=>Array.from(d.cssRules).map(async h=>{if(ea(h)){const m=h.href;let p="";try{p=await Qe(t,{url:m,requestType:"text",responseType:"text"})}catch(g){t.log.warn(`Error fetch remote css import from ${m}`,g)}const y=p.replace(hn,(g,v,w)=>g.replace(w,Zr(w,m)));for(const g of Qa(y))try{c.insertRule(g,c.cssRules.length)}catch(v){t.log.warn("Error inserting rule from remote css import",{rule:g,error:v})}}}))),c.cssRules.length&&s.push(c);const b=[];s.forEach(d=>{ir(d.cssRules,b)}),b.filter(d=>{var h;return Qi(d)&&fn(d.style.getPropertyValue("src"))&&((h=tn(d.style.getPropertyValue("font-family")))===null||h===void 0?void 0:h.some(m=>o.has(m)))}).forEach(d=>{const h=d,m=i.get(h.cssText);m?n.appendChild(r.createTextNode(`${m}
|
|
10
|
-
`)):a.push(dn(h.cssText,h.parentStyleSheet?h.parentStyleSheet.href:null,t).then(p=>{p=bn(p,t),i.set(h.cssText,p),n.appendChild(r.createTextNode(`${p}
|
|
11
|
-
`))}))})}}var Za=/(\/\*[\s\S]*?\*\/)/g,mn=/((@.*?keyframes [\s\S]*?){([\s\S]*?}\s*?)})/gi;function Qa(e){if(e==null)return[];const t=[];let r=e.replace(Za,"");for(;;){const i=mn.exec(r);if(!i)break;t.push(i[0])}r=r.replace(mn,"");const n=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,o=new RegExp("((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})","gi");for(;;){let i=n.exec(r);if(i)o.lastIndex=n.lastIndex;else if(i=o.exec(r),i)n.lastIndex=o.lastIndex;else break;t.push(i[0])}return t}var es=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,ts=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function bn(e,t){const{font:r}=t,n=r?r==null?void 0:r.preferredFormat:void 0;return n?e.replace(ts,o=>{for(;;){const[i,,a]=es.exec(o)||[];if(!a)return"";if(a===n)return`src: ${i};`}}):e}function ir(e,t=[]){for(const r of Array.from(e))ta(r)?t.push(...ir(r.cssRules)):"cssRules"in r?ir(r.cssRules,t):t.push(r);return t}var rs=/\bx?link:?href\s*=\s*["'](?!data:)[^"']+["']/i;function ns(e){return rs.test(e.innerHTML)}async function os(e,t){const r=await nr(e,t);if(he(r.node)&&Ke(r.node)&&!ns(r.node))return r.node;const{ownerDocument:n,log:o,tasks:i,svgStyleElement:a,svgDefsElement:l,svgStyles:s,font:u,progress:f,autoDestruct:c,onCloneNode:b,onEmbedNode:d,onCreateForeignObjectSvg:h}=r;o.time("clone node");const m=await or(r.node,r,!0);if(a&&n){let w="";s.forEach((C,E)=>{w+=`${C.join(`,
|
|
12
|
-
`)} {
|
|
13
|
-
${E}
|
|
14
|
-
}
|
|
15
|
-
`}),a.appendChild(n.createTextNode(w))}o.timeEnd("clone node"),await(b==null?void 0:b(m)),u!==!1&&he(m)&&(o.time("embed web font"),await Ja(m,r),o.timeEnd("embed web font")),o.time("embed node"),pn(m,r);const p=i.length;let y=0;const g=async()=>{for(;;){const w=i.pop();if(!w)break;try{await w}catch(C){r.log.warn("Failed to run task",C)}f==null||f(++y,p)}};f==null||f(y,p),await Promise.all([...Array.from({length:4})].map(g)),o.timeEnd("embed node"),await(d==null?void 0:d(m));const v=is(m,r);return l&&v.insertBefore(l,v.children[0]),a&&v.insertBefore(a,v.children[0]),c&&Ha(r),await(h==null?void 0:h(v)),v}function is(e,t){const{width:r,height:n}=t,o=ma(r,n,e.ownerDocument),i=o.ownerDocument.createElementNS(o.namespaceURI,"foreignObject");return i.setAttributeNS(null,"x","0%"),i.setAttributeNS(null,"y","0%"),i.setAttributeNS(null,"width","100%"),i.setAttributeNS(null,"height","100%"),i.append(e),o.appendChild(i),o}async function as(e,t){const r=await nr(e,t),n=await os(r),o=ba(n,r.isEnable("removeControlCharacter"));if(!r.autoDestruct){var i;r.svgStyleElement=nn(r.ownerDocument),r.svgDefsElement=(i=r.ownerDocument)===null||i===void 0?void 0:i.createElementNS(bt,"defs"),r.svgStyles.clear()}return await Ma(_e(o,n.ownerDocument),r)}async function ss(e,t){const r=await nr(e,t),{log:n,type:o,quality:i,dpi:a}=r,l=await as(r);n.time("canvas to blob");const s=await ga(l,o,i);if(["image/png","image/jpeg"].includes(o)&&a){const u=await wa(s.slice(0,33));let f=new Uint8Array(u);return o==="image/png"?f=Yi(f,a):o==="image/jpeg"&&(f=Vi(f,a)),n.timeEnd("canvas to blob"),new Blob([f,s.slice(33)],{type:o})}return n.timeEnd("canvas to blob"),s}var xu="•",ls=32,cs=new Set(["button","submit","reset","checkbox","radio","range","color","file","image","hidden"]);function ar(e){const t=Math.min(Math.max(e,1),ls);return"•".repeat(t)}function us(e){for(const n of Array.from(e.querySelectorAll("input"))){var t;const o=((t=n.getAttribute("type"))!==null&&t!==void 0?t:"text").toLowerCase();if(cs.has(o))continue;const i=n.value;if(!i)continue;const a=ar(i.length);n.value=a,n.setAttribute("value",a)}for(const n of Array.from(e.querySelectorAll("textarea"))){const o=n.value||n.textContent||"";if(!o)continue;const i=ar(o.length);n.value=i,n.textContent=i,n.setAttribute("value",i)}for(const n of Array.from(e.querySelectorAll("[contenteditable]"))){var r;if(n.getAttribute("contenteditable")==="false")continue;const o=(r=n.textContent)!==null&&r!==void 0?r:"";o.trim()&&(n.textContent=ar(o.length))}}var ds={"image/png":"png","image/jpeg":"jpg","image/webp":"webp","image/gif":"gif"};function gn(e){var t;return(t=ds[e])!==null&&t!==void 0?t:"png"}function vn(e,t,r){const n=e==null?void 0:e[`inner${r}`],o=t.documentElement[`client${r}`];return Math.max(1,Math.round((typeof n=="number"&&n>0?n:o)||0)||1)}var fs=6e3,hs=(e,t)=>ss(e,{width:t.width,height:t.height,type:t.type,timeout:fs,filter:t.filter,onCloneNode:t.onCloneNode});async function yn(e={}){try{var t,r,n,o,i,a;const l=(t=e.doc)!==null&&t!==void 0?t:document,s=(r=(n=e.win)!==null&&n!==void 0?n:l.defaultView)!==null&&r!==void 0?r:void 0,u=(o=e.target)!==null&&o!==void 0?o:l.documentElement,f=(i=e.type)!==null&&i!==void 0?i:"image/png",c=vn(s,l,"Width"),b=vn(s,l,"Height"),d=await((a=e.capture)!==null&&a!==void 0?a:hs)(u,{width:c,height:b,type:f,filter:h=>!jo(h),onCloneNode:h=>us(h)});return d?{blob:d,width:c,height:b,type:f}:null}catch{return null}}function et(e){"@babel/helpers - typeof";return et=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},et(e)}function ps(e,t){if(et(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(et(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ms(e){var t=ps(e,"string");return et(t)=="symbol"?t:t+""}function Le(e,t,r){return(t=ms(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Eu=60;function bs(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 gs=class{constructor(e=Date.now){Le(this,"now",void 0),Le(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=bs(e,t),n=t+r*1e3;return n>this.pausedUntil&&(this.pausedUntil=n),r}},vs="screenshot",ys="replay",ws=new gs;function Ss(e){return`${e.replace(/\/+$/,"")}/api/ingest/feedback`}function xs(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 wn(e,t,r=fetch,n=ws){var o,i;const a=(o=t.content.source)!==null&&o!==void 0?o:"reporter",l=a==="auto";if(l&&n.isPaused())return{ok:!1,reason:"backpressure",retryAfterSeconds:n.retryAfterSeconds()};const s={key:t.key,...xs(t.identity),...t.content,source:a},u=new FormData;if(u.append("payload",JSON.stringify(s)),!((i=t.screenshot)===null||i===void 0)&&i.blob){var f;u.append(vs,t.screenshot.blob,(f=t.screenshot.filename)!==null&&f!==void 0?f:"screenshot.png")}if(t.replay&&t.replay.events.length>0)try{const b=JSON.stringify(t.replay.events);u.append(ys,new Blob([b],{type:"application/json"}),"replay.json")}catch{}let c;try{c=await r(Ss(e),{method:"POST",body:u})}catch{return{ok:!1,reason:"unreachable"}}if(!c.ok)return l&&c.status===429?{ok:!1,reason:"backpressure",retryAfterSeconds:n.hold(c.headers.get("Retry-After"))}:{ok:!1,reason:"refused",status:c.status};try{return{ok:!0,feedback:await c.json()}}catch{return{ok:!0,feedback:null}}}var gt="0.4.0",Cu=5,Es=2e3,ku=20,Cs=5,ks=5;function Ms(e){if(!e||e.length===0)return[];const t=[];for(let n=e.length-1;n>=0&&t.length<ks;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 Is=/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/gi,Rs=/\bhttps?:\/\/[^\s"')]+/gi,Ts=/\b0x[0-9a-f]+\b/gi,Ns=/\b[0-9a-f]{8,}\b/gi,_s=/\d{4,}/g;function Ls(e){return typeof e!="string"||e.length===0?"":e.replace(Is,"<uuid>").replace(Rs,"<url>").replace(Ts,"<hex>").replace(Ns,"<hex>").replace(_s,"<n>").trim()}function As(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 sr(e){const t=e.replace(/\?[^:]*/,""),r=t.lastIndexOf("/");return r>=0?t.slice(r+1):t}function Os(e){var t,r,n;const o=e.match(/^at\s+(.+?)\s+\((.+)\)$/);if(o)return`${(t=o[1])!==null&&t!==void 0?t:""}@${sr((r=o[2])!==null&&r!==void 0?r:"")}`;const i=e.match(/^at\s+(.+)$/);if(i)return`@${sr((n=i[1])!==null&&n!==void 0?n:"")}`;const a=e.indexOf("@");return a>=0?`${e.slice(0,a)}@${sr(e.slice(a+1))}`:null}function Ds(e,t=Cs){if(typeof e!="string"||e.length===0)return"";const r=[];for(const n of e.split(`
|
|
16
|
-
`)){const o=Os(n.trim());if(o&&(r.push(o),r.length>=t))break}return r.join(" < ")}var Fs=30;function Ps(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 Us(e,t=Fs){if(typeof e!="string"||e.length===0)return[];const r=[];for(const a of e.split(`
|
|
17
|
-
`)){if(r.length>=t)break;const l=a.trim();let s=null,u=null;const f=l.match(/^at\s+(.+?)\s+\((.+)\)$/),c=f?null:l.match(/^at\s+(.+)$/),b=f||c?-1:l.indexOf("@");if(f){var n,o;s=(n=f[1])!==null&&n!==void 0?n:null,u=(o=f[2])!==null&&o!==void 0?o:null}else if(c){var i;u=(i=c[1])!==null&&i!==void 0?i:null}else b>=0&&(s=b>0?l.slice(0,b):null,u=l.slice(b+1));if(!u)continue;const d=Ps(u);d&&r.push({file:le(d.file),line:d.line,column:d.column,function:s&&s.length>0?s:null})}return r}function Bs(e,t,r){return As(`${e}|${Ls(t)}|${Ds(r)}`)}var zs=class{constructor(e){var t;Le(this,"options",void 0),Le(this,"tokens",void 0),Le(this,"last",void 0),Le(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 we(e){if(typeof e=="string")return e;if(e==null)return"";try{return String(e)}catch{return""}}function $s(e){const t=e,r=t.error;if(r&&typeof r=="object"){const o=r;return{type:we(o.name)||"Error",value:we(o.message)||we(t.message),stack:typeof o.stack=="string"?o.stack:void 0,original:r}}const n=we(t.message);return n?{type:"Error",value:n,original:n}:null}function Ws(e){const t=e.reason;if(t&&typeof t=="object"){const n=t;return{type:we(n.name)||"UnhandledRejection",value:we(n.message)||we(t),stack:typeof n.stack=="string"?n.stack:void 0,original:t}}const r=we(t);return{type:"UnhandledRejection",value:r,original:t!=null?t:r}}var Hs={destroy:()=>{},droppedCount:()=>0};function js(e){var t,r,n,o,i,a,l,s,u,f,c,b;const d=(t=e.win)!==null&&t!==void 0?t:typeof window!="undefined"?window:void 0;if(!d)return Hs;const h=d,m=(r=(n=e.doc)!==null&&n!==void 0?n:h.document)!==null&&r!==void 0?r:typeof document!="undefined"?document:void 0,p=(o=e.now)!==null&&o!==void 0?o:Date.now,y=(i=e.sdkVersion)!==null&&i!==void 0?i:gt,g=(a=e.maxDistinct)!==null&&a!==void 0?a:20,v=(l=(s=e.deps)===null||s===void 0?void 0:s.captureView)!==null&&l!==void 0?l:yn,w=(u=(f=e.deps)===null||f===void 0?void 0:f.submitReport)!==null&&u!==void 0?u:wn,C=new zs({capacity:(c=e.burstCapacity)!==null&&c!==void 0?c:5,refillIntervalMs:(b=e.burstRefillMs)!==null&&b!==void 0?b:Es,now:p}),E=new Map;let T=0;function L(W,N,z){var H,X,Z,Q,de;const ae=jr({url:(H=h.location)===null||H===void 0?void 0:H.href,environment:Hr(h,y,e.release),trace:z.trace?(X=e.buffer)===null||X===void 0?void 0:X.snapshot():void 0,reporterName:(Z=e.display)===null||Z===void 0?void 0:Z.name,reporterEmail:(Q=e.display)===null||Q===void 0?void 0:Q.email}),fe=(de=E.get(W))===null||de===void 0?void 0:de.frames;return{...ae,source:"auto",errorSignature:W,occurrences:N,...z.trace&&fe&&fe.length>0?{errorFrames:fe}:{}}}async function k(W,N,z){const H=E.get(W);if(!H)return;const X=H.sentCount;H.sentCount=N;try{var Z,Q;const de=L(W,N,z),ae=Tr(de,{hook:e.beforeSend,scrub:e.scrub});if(!ae)return;let fe=null;if(z.screenshot){const Ie=await v({doc:m,win:h});fe=Ie?{blob:Ie.blob,filename:`screenshot.${gn(Ie.type)}`}:null}const $e=z.trace&&(Z=(Q=e.replay)===null||Q===void 0?void 0:Q.snapshot())!==null&&Z!==void 0?Z:null;!(await w(e.apiUrl,{key:e.key,identity:e.identity,content:ae,screenshot:fe,replay:$e})).ok&&H.sentCount===N&&(H.sentCount=X)}catch{H.sentCount===N&&(H.sentCount=X)}}function x(W){const N=Bs(W.type,W.value,W.stack),z=E.get(N);if(z){z.count+=1,z.lastAt=p();return}if(!C.take()){T+=1;return}if(E.size>=g){T+=1;return}const H=p();E.set(N,{count:1,firstAt:H,lastAt:H,sentCount:0,frames:Us(W.stack)});try{var X,Z;const Q=Ms((X=e.buffer)===null||X===void 0?void 0:X.snapshot());(Z=e.buffer)===null||Z===void 0||Z.add(Ei(W.original,H,Q))}catch{}k(N,1,{screenshot:!0,trace:!0})}const A=W=>{try{const N=$s(W);N&&x(N)}catch{}},V=W=>{try{const N=Ws(W);N&&x(N)}catch{}},R=()=>{try{for(const[W,N]of E)N.count>N.sentCount&&k(W,N.count,{screenshot:!1,trace:!1})}catch{}},ue=()=>{(m==null?void 0:m.visibilityState)==="hidden"&&R()};return h.addEventListener("error",A,!0),h.addEventListener("unhandledrejection",V,!0),h.addEventListener("pagehide",R),m==null||m.addEventListener("visibilitychange",ue),{destroy:()=>{h.removeEventListener("error",A,!0),h.removeEventListener("unhandledrejection",V,!0),h.removeEventListener("pagehide",R),m==null||m.removeEventListener("visibilitychange",ue)},droppedCount:()=>T}}var Sn="fixback.anonymousId";function xn(){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 Vs(){try{const e=globalThis.localStorage,t=e.getItem(Sn);if(t)return t;const r=xn();return e.setItem(Sn,r),r}catch{return xn()}}var En="fixback_invite",Gs="fixback:reporter:";function qs(e){try{const t=new URL(e).searchParams.get(En);return t&&t.length>0?t:null}catch{return null}}function Xs(e){try{const t=new URL(e.location.href);if(!t.searchParams.has("fixback_invite"))return;t.searchParams.delete(En);const r=t.searchParams.toString(),n=`${t.pathname}${r?`?${r}`:""}${t.hash}`;e.history.replaceState(e.history.state,"",n)}catch{}}function Cn(e){return`${Gs}${e}`}function kn(){try{var e;return(e=globalThis.localStorage)!==null&&e!==void 0?e:null}catch{return null}}function vt(e){if(typeof e!="string")return;const t=e.trim();return t.length>0?t:void 0}function Ys(e,t,r=kn()){if(!r)return;const n=vt(t.name),o=vt(t.email),i={reporterId:t.reporterId,...n?{name:n}:{},...o?{email:o}:{}};try{r.setItem(Cn(e),JSON.stringify(i))}catch{}}function lr(e,t=kn()){if(!t)return null;try{const r=t.getItem(Cn(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=vt(n.name),i=vt(n.email);return{reporterId:n.reporterId,...o?{name:o}:{},...i?{email:i}:{}}}catch{return null}}function Mn(e,t){return`${e.replace(/\/+$/,"")}/api/invites/${encodeURIComponent(t)}`}function Ks(e,t){return`${Mn(e,t)}/redeem`}var In=new Set(["revoked","expired","exhausted","not_found"]);function Rn(e){return e==="public"||e==="invited"||e==="internal"}function Js(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")&&Rn(t.tier):typeof t.status=="string"&&In.has(t.status)}function Zs(e){if(typeof e!="object"||e===null)return!1;const t=e;return t.status==="redeemed"?typeof t.reporterId=="string"&&typeof t.projectId=="string"&&Rn(t.tier):typeof t.status=="string"&&In.has(t.status)}async function Tn(e){try{return await e.json()}catch{return null}}async function Qs(e,t,r=fetch){let n;try{n=await r(Mn(e,t),{method:"GET",headers:{accept:"application/json"}})}catch{return null}const o=await Tn(n);return Js(o)?o:null}async function el(e,t,r=fetch){let n;try{n=await r(Ks(e,t),{method:"POST",headers:{accept:"application/json"}})}catch{return null}const o=await Tn(n);return Zs(o)?o:null}var tl=`
|
|
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=`
|
|
18
5
|
:host {
|
|
19
6
|
/* Vendored Signal tokens (packages/ui/src/tokens.css). */
|
|
20
7
|
--fb-color-accent: #2f6fed;
|
|
@@ -256,7 +243,7 @@
|
|
|
256
243
|
animation: none;
|
|
257
244
|
}
|
|
258
245
|
}
|
|
259
|
-
`,
|
|
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=`
|
|
260
247
|
:host {
|
|
261
248
|
--fb-color-accent: #2f6fed;
|
|
262
249
|
--fb-color-accent-hover: #245fd0;
|
|
@@ -450,7 +437,7 @@
|
|
|
450
437
|
@media (prefers-reduced-motion: reduce) {
|
|
451
438
|
.fb-ob-backdrop, .fb-ob-panel { animation: none; }
|
|
452
439
|
}
|
|
453
|
-
|
|
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=`
|
|
454
441
|
:host {
|
|
455
442
|
--fb-color-accent: #2f6fed;
|
|
456
443
|
--fb-color-accent-hover: #245fd0;
|
|
@@ -772,9 +759,9 @@
|
|
|
772
759
|
@media (prefers-reduced-motion: reduce) {
|
|
773
760
|
.fb-ov-highlight { transition: none; }
|
|
774
761
|
}
|
|
775
|
-
`,xl="data-fixback-overlay",El="http://www.w3.org/2000/svg",Cl=[{tool:"arrow",label:"Arrow"},{tool:"box",label:"Box"},{tool:"pen",label:"Pen"},{tool:"text",label:"Text label"}],An=1800;function _(e,t,r={},n=[]){const o=e.createElement(t);for(const[i,a]of Object.entries(r))a!==void 0&&o.setAttribute(i,a);for(const i of n)o.appendChild(typeof i=="string"?e.createTextNode(i):i);return o}function be(e,t,r={},n=[]){const o=e.createElementNS(El,t);for(const[i,a]of Object.entries(r))o.setAttribute(i,a);for(const i of n)o.appendChild(i);return o}function kl(e){var t,r,n,o,i,a,l,s,u,f;const c=(t=e.doc)!==null&&t!==void 0?t:document,b=(r=(n=e.win)!==null&&n!==void 0?n:c.defaultView)!==null&&r!==void 0?r:window,d=(o=e.sdkVersion)!==null&&o!==void 0?o:gt,h={captureView:(i=(a=e.deps)===null||a===void 0?void 0:a.captureView)!==null&&i!==void 0?i:yn,submitReport:(l=(s=e.deps)===null||s===void 0?void 0:s.submitReport)!==null&&l!==void 0?l:wn,startElementPicker:(u=(f=e.deps)===null||f===void 0?void 0:f.startElementPicker)!==null&&u!==void 0?u:Ko};let m=null,p=null,y=null,g=null,v=null,w=null,C=null,E=!1,T=null,L="compose";const k={selectedElement:null,region:null,marks:[],phase:"compose"};function x(M,U){p&&(p.status.textContent=M,p.status.classList.toggle("is-error",U))}function A(M){if(L=M,!p)return;const U=M!=="compose";p.panel.classList.toggle("is-marking",U),p.pickLayer.classList.toggle("is-visible",M==="picking"),p.captureLayer.classList.toggle("is-visible",M==="capturing"),p.drawLayer.classList.toggle("is-visible",M==="drawing"),p.pickBtn.classList.toggle("is-active",M==="picking"),p.captureBtn.classList.toggle("is-active",M==="capturing"||M==="drawing")}function V(){if(!p)return;const M=!!k.selectedElement,U=!!k.region,ie=k.marks.length;p.mark.classList.toggle("has-element",M),p.selector.textContent=M?k.selectedElement.selector:"",p.pickBtn.textContent="",p.pickBtn.append(Ml(c),c.createTextNode(M?"Change element":"Pick element")),p.captureBtn.classList.toggle("is-attached",U||ie>0);const se=[];M&&se.push("Element"),U&&se.push("Region"),ie>0&&se.push(`${ie} mark${ie===1?"":"s"}`),p.caption.textContent=se.length?`${se.join(" · ")} · masked screenshot on Send`:"Masked screenshot attached on Send"}function R(M){if(!p)return;if(!M){p.highlight.style.display="none";return}const U=M.getBoundingClientRect();p.highlight.style.display="block",p.highlight.style.left=`${U.left}px`,p.highlight.style.top=`${U.top}px`,p.highlight.style.width=`${U.width}px`,p.highlight.style.height=`${U.height}px`}function ue(){y==null||y.stop(),y=null}function W(){p&&(p.highlight.style.display="none"),ue(),L==="picking"&&A("compose")}function N(){p&&(ne(),A("picking"),y=h.startElementPicker({doc:c,onHover:R,onPick:M=>{k.selectedElement=Yo(M),W(),V()},onCancel:W}))}function z(M){if(!p)return;const U=p.selBox;if(!M){U.style.display="none";return}U.style.display="block",U.style.left=`${M.x}px`,U.style.top=`${M.y}px`,U.style.width=`${M.width}px`,U.style.height=`${M.height}px`}function H(){g==null||g.stop(),g=null}function X(){p&&(ne(),z(null),A("capturing"),g=wl({doc:c,onProgress:z,onComplete:M=>{H(),z(null),fe(M)},onCancel:()=>{H(),z(null),A("compose")}}))}function Z(M){p&&(p.drawFrame.style.left=`${M.x}px`,p.drawFrame.style.top=`${M.y}px`,p.drawFrame.style.width=`${M.width}px`,p.drawFrame.style.height=`${M.height}px`)}function Q(M){if(v==null||v.setTool(M),!!p)for(const[U,ie]of p.drawTools)ie.classList.toggle("is-active",U===M)}function de(M){p&&(p.undoBtn.disabled=M.length===0)}function ae(){v==null||v.stop(),v=null}function fe(M){p&&(w=M,Z(M),A("drawing"),v=vl({doc:c,svg:p.drawSvg,textInput:p.drawText,initialMarks:k.marks,onChange:de}),Q("arrow"),de(k.marks))}function $e(){v&&(k.marks=v.marks().slice(),w&&(k.region=w)),pe(),V()}function Ie(){pe(),V()}function pe(){ae(),w=null,L==="drawing"&&A("compose")}function ne(){ue(),H(),ae(),w=null,z(null),p&&(p.highlight.style.display="none"),L!=="compose"&&A("compose")}function Re(){C!==null&&(clearTimeout(C),C=null)}async function We(){if(!(!p||k.phase==="sending")){ne(),k.phase="sending",p.sendBtn.disabled=!0,p.sendBtn.textContent="Sending…",x("",!1);try{var M,U,ie,se,Te,He,je,Ve,Ge;const Dt=jr({comment:p.comment.value,element:(M=k.selectedElement)!==null&&M!==void 0?M:void 0,region:(U=k.region)!==null&&U!==void 0?U:void 0,marks:k.marks.length>0?k.marks:void 0,url:(ie=b.location)===null||ie===void 0?void 0:ie.href,environment:Hr(b,d,e.release),trace:(se=e.buffer)===null||se===void 0?void 0:se.snapshot(),reporterName:(Te=e.display)===null||Te===void 0?void 0:Te.name,reporterEmail:(He=e.display)===null||He===void 0?void 0:He.email}),qe=Tr(Dt,{hook:e.beforeSend,scrub:e.scrub});if(!qe){k.phase="sent",p.panel.classList.add("is-sent"),C=setTimeout(J,An);return}const xe=await h.captureView({doc:c,win:b}),ct=xe?{blob:xe.blob,filename:`screenshot.${gn(xe.type)}`}:null,Sr=(je=(Ve=T)!==null&&Ve!==void 0?Ve:(Ge=e.replay)===null||Ge===void 0?void 0:Ge.snapshot())!==null&&je!==void 0?je:null,Ft=await h.submitReport(e.apiUrl,{key:e.key,identity:e.identity,content:qe,screenshot:ct,replay:Sr});Ft.ok?(k.phase="sent",p.panel.classList.add("is-sent"),C=setTimeout(J,An)):(F(),x(Ft.reason==="unreachable"?"Couldn't reach Fixback — try again.":"Fixback couldn't accept this report.",!0))}catch{F(),x("Something went wrong — try again.",!0)}}}function F(){k.phase="compose",p&&(p.sendBtn.disabled=!1,p.sendBtn.textContent="Send")}function oe(){var M;m=_(c,"div",{[xl]:""}),m.style.cssText="position:fixed;right:20px;bottom:84px;z-index:2147483001;margin:0;padding:0;border:0;display:none;";const U=m.attachShadow({mode:"open"}),ie=c.createElement("style");ie.textContent=Sl,U.appendChild(ie);const se=_(c,"button",{type:"button",class:"fb-ov-close","aria-label":"Close"},["✕"]),Te=_(c,"div",{class:"fb-ov-head"},[_(c,"span",{class:"fb-ov-mark-sq"}),_(c,"span",{class:"fb-ov-brand"},["Fixback"])]);e.tier!=null&&Te.appendChild(_(c,"span",{class:"fb-ov-tier","aria-label":`Trust tier: ${e.tier}`},[e.tier])),Te.appendChild(se);const He=_(c,"span",{class:"fb-ov-selector"}),je=_(c,"span",{class:"fb-ov-mark-caption"}),Ve=_(c,"div",{class:"fb-ov-mark"},[He,je]),Ge=_(c,"textarea",{class:"fb-ov-comment",placeholder:"Describe what you saw or want…","aria-label":"Comment"}),Dt=_(c,"div",{class:"fb-ov-status",role:"status","aria-live":"polite"}),qe=_(c,"button",{type:"button",class:"fb-ov-pickbtn",title:"Point at an element"});qe.addEventListener("click",()=>{k.phase!=="sending"&&(L==="picking"?W():N())});const xe=_(c,"button",{type:"button",class:"fb-ov-capturebtn",title:"Capture a region and draw","aria-label":"Capture a region and draw"});xe.appendChild(Il(c)),xe.addEventListener("click",()=>{k.phase!=="sending"&&X()});const ct=_(c,"button",{type:"button",class:"fb-ov-send"},["Send"]);ct.addEventListener("click",()=>{We()});const Sr=_(c,"div",{class:"fb-ov-tools"},[qe,xe,ct]),Ft=_(c,"div",{class:"fb-ov-form"},[Ve,Ge,Dt,Sr]),mu=_(c,"div",{class:"fb-ov-done"},[_(c,"div",{class:"fb-ov-done__check"},["✓"]),_(c,"div",{class:"fb-ov-done__title"},["Report sent"]),_(c,"div",{class:"fb-ov-done__sub"},["Thanks — the team can see it now."])]),No=_(c,"div",{class:"fb-ov-panel",role:"dialog","aria-label":"Fixback feedback"},[Te,Ft,mu]),xr=_(c,"div",{class:"fb-ov-highlight"});xr.style.display="none";const _o=_(c,"div",{class:"fb-ov-pick"},[_(c,"div",{class:"fb-ov-hint"},["Click the element you mean · Esc to cancel"]),xr]),Er=_(c,"div",{class:"fb-ov-capture-sel"});Er.style.display="none";const Lo=_(c,"div",{class:"fb-ov-capture"},[_(c,"div",{class:"fb-ov-capture-dim"}),_(c,"div",{class:"fb-ov-hint"},["Drag to capture an area · Esc to cancel"]),Er]),Ao=be(c,"svg",{class:"fb-ov-draw-svg",width:"100%",height:"100%"}),Cr=_(c,"input",{class:"fb-ov-draw-text",placeholder:"label…","aria-label":"Mark label"});Cr.style.display="none";const Oo=_(c,"div",{class:"fb-ov-draw-frame"}),Do=new Map,Fo=[];for(const{tool:Ut,label:zo}of Cl){const Bt=_(c,"button",{type:"button",class:"fb-ov-drawtool","data-tool":Ut,title:zo,"aria-label":zo});Bt.appendChild(Tl(c,Ut)),Bt.addEventListener("click",()=>Q(Ut)),Do.set(Ut,Bt),Fo.push(Bt)}const Pt=_(c,"button",{type:"button",class:"fb-ov-draw-undo",title:"Undo","aria-label":"Undo"});Pt.appendChild(Rl(c)),Pt.addEventListener("click",()=>v==null?void 0:v.undo());const Po=_(c,"button",{type:"button",class:"fb-ov-draw-cancel"},["Cancel"]);Po.addEventListener("click",()=>Ie());const Uo=_(c,"button",{type:"button",class:"fb-ov-draw-attach"},["Attach"]);Uo.addEventListener("click",()=>$e());const bu=_(c,"div",{class:"fb-ov-draw-toolbar"},[...Fo,_(c,"span",{class:"fb-ov-draw-divider"}),Pt,Po,Uo]),Bo=_(c,"div",{class:"fb-ov-draw"},[Oo,Ao,Cr,bu]);U.append(No,_o,Lo,Bo),se.addEventListener("click",J),((M=e.target)!==null&&M!==void 0?M:c.body).appendChild(m),p={panel:No,mark:Ve,selector:He,caption:je,comment:Ge,status:Dt,pickBtn:qe,captureBtn:xe,sendBtn:ct,highlight:xr,pickLayer:_o,captureLayer:Lo,selBox:Er,drawLayer:Bo,drawSvg:Ao,drawText:Cr,drawFrame:Oo,drawTools:Do,undoBtn:Pt}}function G(){(!m||!p)&&oe()}function q(){var M,U;if(G(),!(!m||!p)){Re(),ne(),T=(M=(U=e.replay)===null||U===void 0?void 0:U.snapshot())!==null&&M!==void 0?M:null,k.phase="compose",k.selectedElement=null,k.region=null,k.marks=[],p.panel.classList.remove("is-sent"),p.comment.value="",F(),x("",!1),V(),m.style.display="block",E=!0;try{p.comment.focus()}catch{}}}function J(){Re(),ne(),m&&(m.style.display="none"),E=!1,T=null}function $(){Re(),ne(),m==null||m.remove(),m=null,p=null,E=!1}return{open:q,close:J,destroy:$,get isOpen(){return E}}}function Ml(e){return _(e,"span",{class:"fb-ov-pickbtn__glyph","aria-hidden":"true"},["⌖"])}function Il(e){return be(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"},[be(e,"path",{d:"M2 5V2h3M14 5V2h-3M2 11v3h3M14 11v3h-3"})])}function Rl(e){return be(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"},[be(e,"path",{d:"M6 4 3 7l3 3M3 7h6a4 4 0 0 1 0 8H7"})])}function Tl(e,t){return t==="text"?_(e,"span",{class:"fb-ov-drawtool__t","aria-hidden":"true"},["T"]):be(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:be(e,"path",{d:"M3 13 13 3M7 3h6v6"}),box:be(e,"rect",{x:"2.5",y:"3.5",width:"11",height:"9",rx:"1"}),pen:be(e,"path",{d:"M3 13l1-3 6-6 2 2-6 6-3 1Z"})}[t]])}var Nl=Object.defineProperty,_l=(e,t,r)=>t in e?Nl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,S=(e,t,r)=>_l(e,typeof t!="symbol"?t+"":t,r),On,P=(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))(P||{}),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||{}),re=(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))(re||{}),ge=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(ge||{}),Oe=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(Oe||{}),De=(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))(De||{}),K=(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))(K||{}),Dn={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Fn={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},St={},Pn={},Ll=()=>!!globalThis.Zone;function ur(e){if(St[e])return St[e];const t=globalThis[e],r=t.prototype,n=e in Dn?Dn[e]:void 0,o=!!(n&&n.every(l=>{var s,u;return!!((u=(s=Object.getOwnPropertyDescriptor(r,l))==null?void 0:s.get)!=null&&u.toString().includes("[native code]"))})),i=e in Fn?Fn[e]:void 0,a=!!(i&&i.every(l=>{var s;return typeof r[l]=="function"&&((s=r[l])==null?void 0:s.toString().includes("[native code]"))}));if(o&&a&&!Ll())return St[e]=t.prototype,t.prototype;try{const l=document.createElement("iframe");l.style.display="none",document.body.appendChild(l);const s=l.contentWindow;if(!s)return t.prototype;const u=s[e].prototype;if(!u)return l.remove(),r;const f=navigator.userAgent;return f.includes("Safari")&&!f.includes("Chrome")?(l.classList.add("rr-block"),l.setAttribute("__rrwebUntaintedMutationObserver",""),Pn[e]=()=>l.remove()):l.remove(),St[e]=u}catch{return r}}var dr={};function ve(e,t,r){var n;const o=`${e}.${String(r)}`;if(dr[o])return dr[o].call(t);const i=ur(e),a=(n=Object.getOwnPropertyDescriptor(i,r))==null?void 0:n.get;return a?(dr[o]=a,a.call(t)):t[r]}var fr={};function Un(e,t,r){const n=`${e}.${String(r)}`;if(fr[n])return fr[n].bind(t);const o=ur(e)[r];return typeof o!="function"?t[r]:(fr[n]=o,o.bind(t))}function Al(e){return ve("Node",e,"ownerDocument")}function Ol(e){return ve("Node",e,"childNodes")}function Dl(e){return ve("Node",e,"parentNode")}function Fl(e){return ve("Node",e,"parentElement")}function Pl(e){return ve("Node",e,"textContent")}function Ul(e,t){return Un("Node",e,"contains")(t)}function Bl(e){return Un("Node",e,"getRootNode")()}function zl(e){return!e||!("host"in e)?null:ve("ShadowRoot",e,"host")}function $l(e){return e.styleSheets}function Wl(e){return!e||!("shadowRoot"in e)?null:ve("Element",e,"shadowRoot")}function Hl(e,t){return ve("Element",e,"querySelector")(t)}function jl(e,t){return ve("Element",e,"querySelectorAll")(t)}function Bn(){var e;return[ur("MutationObserver").constructor,(e=Pn.MutationObserver)!==null&&e!==void 0?e:(()=>{})]}var tt=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(tt=()=>new Date().getTime());function Ce(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 I={ownerDocument:Al,childNodes:Ol,parentNode:Dl,parentElement:Fl,textContent:Pl,contains:Ul,getRootNode:Bl,host:zl,styleSheets:$l,shadowRoot:Wl,querySelector:Hl,querySelectorAll:jl,nowTimestamp:tt,mutationObserverCtor:Bn,patch:Ce};function zn(e){return e.nodeType===e.ELEMENT_NODE}function rt(e){const t=e&&"host"in e&&"mode"in e&&I.host(e)||null;return!!(t&&"shadowRoot"in t&&I.shadowRoot(t)===e)}function nt(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}function Vl(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 Gl(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 hr(e){try{const t=e.rules||e.cssRules;if(!t)return null;let r=e.href;return!r&&e.ownerNode&&(r=e.ownerNode.baseURI),Vl(Array.from(t,n=>$n(n,r)).join(""))}catch{return null}}function $n(e,t){if(Xl(e)){let r;try{r=hr(e.styleSheet)||Gl(e)}catch{r=e.cssText}return e.styleSheet.href?Ct(r,e.styleSheet.href):r}else{let r=e.cssText;return Yl(e)&&e.selectorText.includes(":")&&(r=ql(r)),t?Ct(r,t):r}}function ql(e){return e.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")}function Xl(e){return"styleSheet"in e}function Yl(e){return"selectorText"in e}var Wn=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 Kl(){return new Wn}function xt({element:e,maskInputOptions:t,tagName:r,type:n,value:o,maskInputFn:i}){let a=o||"";const l=n&&ke(n);return(t[r.toLowerCase()]||l&&t[l])&&(i?a=i(a,e):a="*".repeat(a.length)),a}function ke(e){return e.toLowerCase()}var Hn="__rrweb_original__";function Jl(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,a=Hn in i?i[Hn]:i;if(new Uint32Array(a.call(t,n,o,Math.min(r,e.width-n),Math.min(r,e.height-o)).data.buffer).some(l=>l!==0))return!1}return!0}function Et(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?ke(t):null}function jn(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 Zl(e){let t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}var Ql=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,ec=/^(?:[a-z+]+:)?\/\//i,tc=/^www\..*/i,rc=/^(data:)([^,]*),(.*)/i;function Ct(e,t){return(e||"").replace(Ql,(r,n,o,i,a,l)=>{const s=o||a||l,u=n||i||"";if(!s)return r;if(ec.test(s)||tc.test(s))return`url(${u}${s}${u})`;if(rc.test(s))return`url(${u}${s}${u})`;if(s[0]==="/")return`url(${u}${Zl(t)+s}${u})`;const f=s.split("#")[0],c=s.substring(f.length),b=t.split("#")[0].split("/"),d=f.split("/");b.pop();for(const h of d)h!=="."&&(h===".."?b.pop():b.push(h));return`url(${u}${b.join("/")}${c}${u})`})}function kt(e,t=!1){return t?e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,""):e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"").replace(/0px/g,"0")}function nc(e,t,r=!1){const n=Array.from(t.childNodes),o=[];let i=0;if(n.length>1&&e&&typeof e=="string"){let a=kt(e,r);const l=a.length/e.length;for(let s=1;s<n.length;s++)if(n[s].textContent&&typeof n[s].textContent=="string"){const u=kt(n[s].textContent,r),f=100;let c=3;for(;c<u.length&&(u[c].match(/[a-zA-Z0-9]/)||u.indexOf(u.substring(0,c),1)!==-1);c++);for(;c<u.length;c++){let b=u.substring(0,c),d=a.split(b),h=-1;if(d.length===2)h=d[0].length;else if(d.length>2&&d[0]===""&&n[s-1].textContent!=="")h=a.indexOf(b,1);else if(d.length===1){if(b=b.substring(0,b.length-1),d=a.split(b),d.length<=1)return o.push(e),o;c=101}else c===u.length-1&&(h=a.indexOf(b));if(d.length>=2&&c>f){const m=n[s-1].textContent;if(m&&typeof m=="string"){const p=kt(m).length;h=a.indexOf(b,p)}h===-1&&(h=d[0].length)}if(h!==-1){let m=Math.floor(h/l);for(;m>0&&m<e.length;){if(i+=1,i>50*n.length)return o.push(e),o;const p=kt(e.substring(0,m),r);if(p.length===h){o.push(e.substring(0,m)),e=e.substring(m),a=a.substring(h);break}else p.length<h?m+=Math.max(1,Math.floor((h-p.length)/l)):m-=Math.max(1,Math.floor((p.length-h)*l))}break}}}}return o.push(e),o}function oc(e,t){return nc(e,t).join("/* rr_split */")}var ic=1,ac=new RegExp("[^a-z0-9-_:]"),ot=-2;function Vn(){return ic++}function sc(e){if(e instanceof HTMLFormElement)return"form";const t=ke(e.tagName);return ac.test(t)?"div":t}var Fe,Gn,lc=/^[^ \t\n\r\u000c]+/,cc=/^[, \t\n\r\u000c]+/;function uc(e,t){if(t.trim()==="")return t;let r=0;function n(i){let a;const l=i.exec(t.substring(r));return l?(a=l[0],r+=a.length,a):""}const o=[];for(;n(cc),!(r>=t.length);){let i=n(lc);if(i.slice(-1)===",")i=Pe(e,i.substring(0,i.length-1)),o.push(i);else{let a="";i=Pe(e,i);let l=!1;for(;;){const s=t.charAt(r);if(s===""){o.push((i+a).trim());break}else if(l)s===")"&&(l=!1);else if(s===","){r+=1,o.push((i+a).trim());break}else s==="("&&(l=!0);a+=s,r+=1}}}return o.join(", ")}var qn=new WeakMap;function Pe(e,t){return!t||t.trim()===""?t:pr(e,t)}function dc(e){return!!(e.tagName==="svg"||e.ownerSVGElement)}function pr(e,t){let r=qn.get(e);if(r||(r=e.createElement("a"),qn.set(e,r)),!t)t="";else if(t.startsWith("blob:")||t.startsWith("data:"))return t;return r.setAttribute("href",t),r.href}function Xn(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)?Pe(e,n):r==="srcset"?uc(e,n):r==="style"?Ct(n,pr(e)):t==="object"&&r==="data"?Pe(e,n):n)}function Yn(e,t,r){return["video","audio"].includes(e)&&t==="autoplay"}function fc(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 Mt(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return r?Mt(I.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?Mt(I.parentNode(e),t,r):!1}function Kn(e,t,r,n){let o;if(zn(e)){if(o=e,!I.childNodes(o).length)return!1}else{if(I.parentElement(e)===null)return!1;o=I.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(Mt(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 hc(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 l=setTimeout(()=>{o||(t(),o=!0)},r);e.addEventListener("load",()=>{clearTimeout(l),o=!0,t()});return}const a="about:blank";if(n.location.href!==a||e.src===a||e.src==="")return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}function pc(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 mc(e,t){const{doc:r,mirror:n,blockClass:o,blockSelector:i,needsMask:a,inlineStylesheet:l,maskInputOptions:s={},maskTextFn:u,maskInputFn:f,dataURLOptions:c={},inlineImages:b,recordCanvas:d,keepIframeSrcFn:h,newlyAddedElement:m=!1,cssCaptured:p=!1}=t,y=bc(r,n);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:K.Document,childNodes:[],compatMode:e.compatMode}:{type:K.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:K.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:y};case e.ELEMENT_NODE:return vc(e,{doc:r,blockClass:o,blockSelector:i,inlineStylesheet:l,maskInputOptions:s,maskInputFn:f,dataURLOptions:c,inlineImages:b,recordCanvas:d,keepIframeSrcFn:h,newlyAddedElement:m,rootId:y});case e.TEXT_NODE:return gc(e,{doc:r,needsMask:a,maskTextFn:u,rootId:y,cssCaptured:p});case e.CDATA_SECTION_NODE:return{type:K.CDATA,textContent:"",rootId:y};case e.COMMENT_NODE:return{type:K.Comment,textContent:I.textContent(e)||"",rootId:y};default:return!1}}function bc(e,t){if(!t.hasNode(e))return;const r=t.getId(e);return r===1?void 0:r}function gc(e,t){const{needsMask:r,maskTextFn:n,rootId:o,cssCaptured:i}=t,a=I.parentNode(e),l=a&&a.tagName;let s="";const u=l==="STYLE"?!0:void 0,f=l==="SCRIPT"?!0:void 0;return f?s="SCRIPT_PLACEHOLDER":i||(s=I.textContent(e),u&&s&&(s=Ct(s,pr(t.doc)))),!u&&!f&&s&&r&&(s=n?n(s,I.parentElement(e)):s.replace(/[\S]/g,"*")),{type:K.Text,textContent:s||"",rootId:o}}function vc(e,t){const{doc:r,blockClass:n,blockSelector:o,inlineStylesheet:i,maskInputOptions:a={},maskInputFn:l,dataURLOptions:s={},inlineImages:u,recordCanvas:f,keepIframeSrcFn:c,newlyAddedElement:b=!1,rootId:d}=t,h=fc(e,n,o),m=sc(e);let p={};const y=e.attributes.length;for(let v=0;v<y;v++){const w=e.attributes[v];Yn(m,w.name,w.value)||(p[w.name]=Xn(r,m,ke(w.name),w.value))}if(m==="link"&&i){const v=Array.from(r.styleSheets).find(C=>C.href===e.href);let w=null;v&&(w=hr(v)),w&&(delete p.rel,delete p.href,p._cssText=w)}if(m==="style"&&e.sheet){let v=hr(e.sheet);v&&(e.childNodes.length>1&&(v=oc(v,e)),p._cssText=v)}if(["input","textarea","select"].includes(m)){const v=e.value,w=e.checked;p.type!=="radio"&&p.type!=="checkbox"&&p.type!=="submit"&&p.type!=="button"&&v?p.value=xt({element:e,type:Et(e),tagName:m,value:v,maskInputOptions:a,maskInputFn:l}):w&&(p.checked=w)}if(m==="option"&&(e.selected&&!a.select?p.selected=!0:delete p.selected),m==="dialog"&&e.open&&(p.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal"),m==="canvas"&&f){if(e.__context==="2d")Jl(e)||(p.rr_dataURL=e.toDataURL(s.type,s.quality));else if(!("__context"in e)){const v=e.toDataURL(s.type,s.quality),w=r.createElement("canvas");w.width=e.width,w.height=e.height,v!==w.toDataURL(s.type,s.quality)&&(p.rr_dataURL=v)}}if(m==="img"&&u){Fe||(Fe=r.createElement("canvas"),Gn=Fe.getContext("2d"));const v=e,w=v.currentSrc||v.getAttribute("src")||"<unknown-src>",C=v.crossOrigin,E=()=>{v.removeEventListener("load",E);try{Fe.width=v.naturalWidth,Fe.height=v.naturalHeight,Gn.drawImage(v,0,0),p.rr_dataURL=Fe.toDataURL(s.type,s.quality)}catch(T){if(v.crossOrigin!=="anonymous"){v.crossOrigin="anonymous",v.complete&&v.naturalWidth!==0?E():v.addEventListener("load",E);return}else console.warn(`Cannot inline img src=${w}! Error: ${T}`)}v.crossOrigin==="anonymous"&&(C?p.crossOrigin=C:v.removeAttribute("crossorigin"))};v.complete&&v.naturalWidth!==0?E():v.addEventListener("load",E)}if(["audio","video"].includes(m)){const v=p;v.rr_mediaState=e.paused?"paused":"played",v.rr_mediaCurrentTime=e.currentTime,v.rr_mediaPlaybackRate=e.playbackRate,v.rr_mediaMuted=e.muted,v.rr_mediaLoop=e.loop,v.rr_mediaVolume=e.volume}if(b||(e.scrollLeft&&(p.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(p.rr_scrollTop=e.scrollTop)),h){const{width:v,height:w}=e.getBoundingClientRect();p={class:p.class,rr_width:`${v}px`,rr_height:`${w}px`}}m==="iframe"&&!c(p.src)&&(e.contentDocument||(p.rr_src=p.src),delete p.src);let g;try{customElements.get(m)&&(g=!0)}catch{}return{type:K.Element,tagName:m,attributes:p,childNodes:[],isSVG:dc(e)||void 0,needBlock:h,rootId:d,isCustom:g}}function j(e){return e==null?"":e.toLowerCase()}function Jn(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 yc(e,t){if(t.comment&&e.type===K.Comment)return!0;if(e.type===K.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"&&jn(e.attributes.href)==="js"))return!0;if(t.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&(j(e.attributes.name).match(/^msapplication-tile(image|color)$/)||j(e.attributes.name)==="application-name"||j(e.attributes.rel)==="icon"||j(e.attributes.rel)==="apple-touch-icon"||j(e.attributes.rel)==="shortcut icon")))return!0;if(e.tagName==="meta"){if(t.headMetaDescKeywords&&j(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(j(e.attributes.property).match(/^(og|twitter|fb):/)||j(e.attributes.name).match(/^(og|twitter):/)||j(e.attributes.name)==="pinterest"))return!0;if(t.headMetaRobots&&(j(e.attributes.name)==="robots"||j(e.attributes.name)==="googlebot"||j(e.attributes.name)==="bingbot"))return!0;if(t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0)return!0;if(t.headMetaAuthorship&&(j(e.attributes.name)==="author"||j(e.attributes.name)==="generator"||j(e.attributes.name)==="framework"||j(e.attributes.name)==="publisher"||j(e.attributes.name)==="progid"||j(e.attributes.property).match(/^article:/)||j(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&(j(e.attributes.name)==="google-site-verification"||j(e.attributes.name)==="yandex-verification"||j(e.attributes.name)==="csrf-token"||j(e.attributes.name)==="p:domain_verify"||j(e.attributes.name)==="verify-v1"||j(e.attributes.name)==="verification"||j(e.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function Ue(e,t){const{doc:r,mirror:n,blockClass:o,blockSelector:i,maskTextClass:a,maskTextSelector:l,skipChild:s=!1,inlineStylesheet:u=!0,maskInputOptions:f={},maskTextFn:c,maskInputFn:b,slimDOMOptions:d,dataURLOptions:h={},inlineImages:m=!1,recordCanvas:p=!1,onSerialize:y,onIframeLoad:g,iframeLoadTimeout:v=5e3,onStylesheetLoad:w,stylesheetLoadTimeout:C=5e3,keepIframeSrcFn:E=()=>!1,newlyAddedElement:T=!1,cssCaptured:L=!1}=t;let{needsMask:k}=t,{preserveWhiteSpace:x=!0}=t;k||(k=Kn(e,a,l,k===void 0));const A=mc(e,{doc:r,mirror:n,blockClass:o,blockSelector:i,needsMask:k,inlineStylesheet:u,maskInputOptions:f,maskTextFn:c,maskInputFn:b,dataURLOptions:h,inlineImages:m,recordCanvas:p,keepIframeSrcFn:E,newlyAddedElement:T,cssCaptured:L});if(!A)return console.warn(e,"not serialized"),null;let V;n.hasNode(e)?V=n.getId(e):yc(A,d)||!x&&A.type===K.Text&&!A.textContent.replace(/^\s+|\s+$/gm,"").length?V=ot:V=Vn();const R=Object.assign(A,{id:V});if(n.add(e,R),V===ot)return null;y&&y(e);let ue=!s;if(R.type===K.Element){ue=ue&&!R.needBlock,delete R.needBlock;const N=I.shadowRoot(e);N&&nt(N)&&(R.isShadowHost=!0)}if((R.type===K.Document||R.type===K.Element)&&ue){d.headWhitespace&&R.type===K.Element&&R.tagName==="head"&&(x=!1);const N={doc:r,mirror:n,blockClass:o,blockSelector:i,needsMask:k,maskTextClass:a,maskTextSelector:l,skipChild:s,inlineStylesheet:u,maskInputOptions:f,maskTextFn:c,maskInputFn:b,slimDOMOptions:d,dataURLOptions:h,inlineImages:m,recordCanvas:p,preserveWhiteSpace:x,onSerialize:y,onIframeLoad:g,iframeLoadTimeout:v,onStylesheetLoad:w,stylesheetLoadTimeout:C,keepIframeSrcFn:E,cssCaptured:!1};if(!(R.type===K.Element&&R.tagName==="textarea"&&R.attributes.value!==void 0)){R.type===K.Element&&R.attributes._cssText!==void 0&&typeof R.attributes._cssText=="string"&&(N.cssCaptured=!0);for(const H of Array.from(I.childNodes(e))){const X=Ue(H,N);X&&R.childNodes.push(X)}}let z=null;if(zn(e)&&(z=I.shadowRoot(e)))for(const H of Array.from(I.childNodes(z))){const X=Ue(H,N);X&&(nt(z)&&(X.isShadow=!0),R.childNodes.push(X))}}const W=I.parentNode(e);return W&&rt(W)&&nt(W)&&(R.isShadow=!0),R.type===K.Element&&R.tagName==="iframe"&&hc(e,()=>{const N=e.contentDocument;if(N&&g){const z=Ue(N,{doc:N,mirror:n,blockClass:o,blockSelector:i,needsMask:k,maskTextClass:a,maskTextSelector:l,skipChild:!1,inlineStylesheet:u,maskInputOptions:f,maskTextFn:c,maskInputFn:b,slimDOMOptions:d,dataURLOptions:h,inlineImages:m,recordCanvas:p,preserveWhiteSpace:x,onSerialize:y,onIframeLoad:g,iframeLoadTimeout:v,onStylesheetLoad:w,stylesheetLoadTimeout:C,keepIframeSrcFn:E});z&&g(e,z)}},v),R.type===K.Element&&R.tagName==="link"&&typeof R.attributes.rel=="string"&&(R.attributes.rel==="stylesheet"||R.attributes.rel==="preload"&&typeof R.attributes.href=="string"&&jn(R.attributes.href)==="css")&&pc(e,()=>{if(w){const N=Ue(e,{doc:r,mirror:n,blockClass:o,blockSelector:i,needsMask:k,maskTextClass:a,maskTextSelector:l,skipChild:!1,inlineStylesheet:u,maskInputOptions:f,maskTextFn:c,maskInputFn:b,slimDOMOptions:d,dataURLOptions:h,inlineImages:m,recordCanvas:p,preserveWhiteSpace:x,onSerialize:y,onIframeLoad:g,iframeLoadTimeout:v,onStylesheetLoad:w,stylesheetLoadTimeout:C,keepIframeSrcFn:E});N&&w(e,N)}},C),R}function wc(e,t){const{mirror:r=new Wn,blockClass:n="rr-block",blockSelector:o=null,maskTextClass:i="rr-mask",maskTextSelector:a=null,inlineStylesheet:l=!0,inlineImages:s=!1,recordCanvas:u=!1,maskAllInputs:f=!1,maskTextFn:c,maskInputFn:b,slimDOM:d=!1,dataURLOptions:h,preserveWhiteSpace:m,onSerialize:p,onIframeLoad:y,iframeLoadTimeout:g,onStylesheetLoad:v,stylesheetLoadTimeout:w,keepIframeSrcFn:C=()=>!1}=t;return Ue(e,{doc:e,mirror:r,blockClass:n,blockSelector:o,maskTextClass:i,maskTextSelector:a,skipChild:!1,inlineStylesheet:l,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:c,maskInputFn:b,slimDOMOptions:Jn(d),dataURLOptions:h,inlineImages:s,recordCanvas:u,preserveWhiteSpace:m,onSerialize:p,onIframeLoad:y,iframeLoadTimeout:g,onStylesheetLoad:v,stylesheetLoadTimeout:w,keepIframeSrcFn:C,newlyAddedElement:!1})}var Sc=class $o{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 $o){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 ee(e,t,r=document){const n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}var Be=`Please stop import mirror directly. Instead of that,\r
|
|
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
|
|
776
763
|
now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
|
|
777
|
-
or you can use record.mirror to access the mirror instance during recording.`,Zn={map:{},getId(){return console.error(Be),-1},getNode(){return console.error(Be),null},removeNodeFromMap(){console.error(Be)},has(){return console.error(Be),!1},reset(){console.error(Be)}};typeof window!="undefined"&&window.Proxy&&window.Reflect&&(Zn=new Proxy(Zn,{get(e,t,r){return t==="map"&&console.error(Be),Reflect.get(e,t,r)}}));function it(e,t,r={}){let n=null,o=0;return function(...i){const a=Date.now();!o&&r.leading===!1&&(o=a);const l=t-(a-o),s=this;l<=0||l>t?(n&&(clearTimeout(n),n=null),o=a,e.apply(s,i)):!n&&r.trailing!==!1&&(n=setTimeout(()=>{o=r.leading===!1?0:Date.now(),n=null,e.apply(s,i)},l))}}function It(e,t,r,n,o=window){const i=o.Object.getOwnPropertyDescriptor(e,t);return o.Object.defineProperty(e,t,n?r:{set(a){setTimeout(()=>{r.set.call(this,a)},0),i&&i.set&&i.set.call(this,a)}}),()=>It(e,t,i||{},!0)}function Qn(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=I.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=I.parentElement(i.body))==null?void 0:n.scrollTop)||((o=i==null?void 0:i.body)==null?void 0:o.scrollTop)||0}}function eo(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function to(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function ro(e){return e?e.nodeType===e.ELEMENT_NODE?e:I.parentElement(e):null}function te(e,t,r,n){if(!e)return!1;const o=ro(e);if(!o)return!1;try{if(typeof t=="string"){if(o.classList.contains(t)||n&&o.closest("."+t)!==null)return!0}else if(Mt(o,t,n))return!0}catch{}return!!(r&&(o.matches(r)||n&&o.closest(r)!==null))}function xc(e,t){return t.getId(e)!==-1}function mr(e,t,r){return e.tagName==="TITLE"&&r.headTitleMutations?!0:t.getId(e)===ot}function no(e,t){if(rt(e))return!1;const r=t.getId(e);if(!t.has(r))return!0;const n=I.parentNode(e);return n&&n.nodeType===e.DOCUMENT_NODE?!1:n?no(n,t):!0}function br(e){return!!e.changedTouches}function Ec(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 oo(e,t){return!!(e.nodeName==="IFRAME"&&t.getMeta(e))}function io(e,t){return!!(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function gr(e){return e?e instanceof Sc&&"shadowRoot"in e?!!e.shadowRoot:!!I.shadowRoot(e):!1}var Cc=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 ao(e){var t;let r=null;return"getRootNode"in e&&((t=I.getRootNode(e))==null?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&I.host(I.getRootNode(e))&&(r=I.host(I.getRootNode(e))),r}function kc(e){let t=e,r;for(;r=ao(t);)t=r;return t}function Mc(e){const t=I.ownerDocument(e);if(!t)return!1;const r=kc(e);return I.contains(t,r)}function so(e){const t=I.ownerDocument(e);return t?I.contains(t,e)||Mc(e):!1}function lo(e){return"__ln"in e}var Ic=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&&lo(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&&lo(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--)}},co=(e,t)=>`${e}@${t}`,Rc=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 Ic,n=l=>{let s=l,u=ot;for(;u===ot;)s=s&&s.nextSibling,u=s&&this.mirror.getId(s);return u},o=l=>{const s=I.parentNode(l);if(!s||!so(l))return;let u=!1;if(l.nodeType===Node.TEXT_NODE){const d=s.tagName;if(d==="TEXTAREA")return;d==="STYLE"&&this.addedSet.has(s)&&(u=!0)}const f=rt(s)?this.mirror.getId(ao(l)):this.mirror.getId(s),c=n(l);if(f===-1||c===-1)return r.addNode(l);const b=Ue(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:d=>{oo(d,this.mirror)&&this.iframeManager.addIframe(d),io(d,this.mirror)&&this.stylesheetManager.trackLinkElement(d),gr(l)&&this.shadowDomManager.addShadowRoot(I.shadowRoot(l),this.doc)},onIframeLoad:(d,h)=>{this.iframeManager.attachIframe(d,h),this.shadowDomManager.observeAttachShadow(d)},onStylesheetLoad:(d,h)=>{this.stylesheetManager.attachLinkElement(d,h)},cssCaptured:u});b&&(e.push({parentId:f,nextId:c,node:b}),t.add(b.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const l of this.movedSet)uo(this.removesSubTreeCache,l,this.mirror)&&!this.movedSet.has(I.parentNode(l))||o(l);for(const l of this.addedSet)!fo(this.droppedSet,l)&&!uo(this.removesSubTreeCache,l,this.mirror)||fo(this.movedSet,l)?o(l):this.droppedSet.add(l);let i=null;for(;r.length;){let l=null;if(i){const s=this.mirror.getId(I.parentNode(i.value)),u=n(i.value);s!==-1&&u!==-1&&(l=i)}if(!l){let s=r.tail;for(;s;){const u=s;if(s=s.previous,u){const f=this.mirror.getId(I.parentNode(u.value));if(n(u.value)===-1)continue;if(f!==-1){l=u;break}else{const c=u.value,b=I.parentNode(c);if(b&&b.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const d=I.host(b);if(this.mirror.getId(d)!==-1){l=u;break}}}}}}if(!l){for(;r.head;)r.removeNode(r.head.value);break}i=l.previous,r.removeNode(l.value),o(l.value)}const a={texts:this.texts.map(l=>{const s=l.node,u=I.parentNode(s);return u&&u.tagName==="TEXTAREA"&&this.genTextAreaValueMutation(u),{id:this.mirror.getId(s),value:l.value}}).filter(l=>!t.has(l.id)).filter(l=>this.mirror.has(l.id)),attributes:this.attributes.map(l=>{const{attributes:s}=l;if(typeof s.style=="string"){const u=JSON.stringify(l.styleDiff),f=JSON.stringify(l._unchangedStyles);u.length<s.style.length&&(u+f).split("var(").length===s.style.split("var(").length&&(s.style=l.styleDiff)}return{id:this.mirror.getId(l.node),attributes:s}}).filter(l=>!t.has(l.id)).filter(l=>this.mirror.has(l.id)),removes:this.removes,adds:e};!a.texts.length&&!a.attributes.length&&!a.removes.length&&!a.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(a))}),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(I.childNodes(e),n=>I.textContent(n)||"").join("");t.attributes.value=xt({element:e,maskInputOptions:this.maskInputOptions,tagName:e.tagName,type:Et(e),value:r,maskInputFn:this.maskInputFn})}),S(this,"processMutation",e=>{if(!mr(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":{const t=I.textContent(e.target);!te(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,ro(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=Et(t);n=xt({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:i,value:n,maskInputFn:this.maskInputFn})}if(te(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"),!Yn(t.tagName,r))if(o.attributes[r]=Xn(this.doc,ke(t.tagName),ke(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 a of Array.from(t.style)){const l=t.style.getPropertyValue(a),s=t.style.getPropertyPriority(a);l!==i.style.getPropertyValue(a)||s!==i.style.getPropertyPriority(a)?s===""?o.styleDiff[a]=l:o.styleDiff[a]=[l,s]:o._unchangedStyles[a]=[l,s]}for(const a of Array.from(i.style))t.style.getPropertyValue(a)===""&&(o.styleDiff[a]=!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(te(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=rt(e.target)?this.mirror.getId(I.host(e.target)):this.mirror.getId(e.target);te(e.target,this.blockClass,this.blockSelector,!1)||mr(t,this.mirror,this.slimDOMOptions)||!xc(t,this.mirror)||(this.addedSet.has(t)?(vr(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&r===-1||no(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[co(r,n)]?vr(this.movedSet,t):(this.removes.push({parentId:n,id:r,isShadow:rt(e.target)&&nt(e.target)?!0:void 0}),Tc(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(mr(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[co(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);te(e,this.blockClass,this.blockSelector,!1)||(I.childNodes(e).forEach(r=>this.genAdds(r)),gr(e)&&I.childNodes(I.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 vr(e,t){e.delete(t),I.childNodes(t).forEach(r=>vr(e,r))}function Tc(e,t){const r=[e];for(;r.length;){const n=r.pop();t.has(n)||(t.add(n),I.childNodes(n).forEach(o=>r.push(o)))}}function uo(e,t,r){return e.size===0?!1:Nc(e,t)}function Nc(e,t,r){const n=I.parentNode(t);return n?e.has(n):!1}function fo(e,t){return e.size===0?!1:ho(e,t)}function ho(e,t){const r=I.parentNode(t);return r?e.has(r)?!0:ho(e,r):!1}var at;function _c(e){at=e}function Lc(){at=void 0}var D=e=>at?(...r)=>{try{return e(...r)}catch(n){if(at&&at(n)===!0)return;throw n}}:e,Me=[];function st(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 po(e,t){const r=new Rc;Me.push(r),r.init(e);const[n,o]=Bn(),i=new n(D(r.processMutations.bind(r)));return i.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),[i,o]}function Ac({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 a=[],l;const s=it(D(c=>{const b=Date.now()-l;e(a.map(d=>(d.timeOffset-=b,d)),c),a=[],l=null}),i),u=D(it(D(c=>{const b=st(c),{clientX:d,clientY:h}=br(c)?c.changedTouches[0]:c;l||(l=tt()),a.push({x:d,y:h,id:n.getId(b),timeOffset:tt()-l}),s(typeof DragEvent!="undefined"&&c instanceof DragEvent?O.Drag:c instanceof MouseEvent?O.MouseMove:O.TouchMove)}),o,{trailing:!1})),f=[ee("mousemove",u,r),ee("touchmove",u,r),ee("drag",u,r)];return D(()=>{f.forEach(c=>c())})}function Oc({mouseInteractionCb:e,doc:t,mirror:r,blockClass:n,blockSelector:o,sampling:i}){if(i.mouseInteraction===!1)return()=>{};const a=i.mouseInteraction===!0||i.mouseInteraction===void 0?{}:i.mouseInteraction,l=[];let s=null;const u=f=>c=>{const b=st(c);if(te(b,n,o,!0))return;let d=null,h=f;if("pointerType"in c){switch(c.pointerType){case"mouse":d=ge.Mouse;break;case"touch":d=ge.Touch;break;case"pen":d=ge.Pen}d===ge.Touch?re[f]===re.MouseDown?h="TouchStart":re[f]===re.MouseUp&&(h="TouchEnd"):ge.Pen}else br(c)&&(d=ge.Touch);d!==null?(s=d,(h.startsWith("Touch")&&d===ge.Touch||h.startsWith("Mouse")&&d===ge.Mouse)&&(d=null)):re[f]===re.Click&&(d=s,s=null);const m=br(c)?c.changedTouches[0]:c;if(!m)return;const p=r.getId(b),{clientX:y,clientY:g}=m;D(e)({type:re[h],id:p,x:y,y:g,...d!==null&&{pointerType:d}})};return Object.keys(re).filter(f=>Number.isNaN(Number(f))&&!f.endsWith("_Departed")&&a[f]!==!1).forEach(f=>{let c=ke(f);const b=u(f);if(window.PointerEvent)switch(re[f]){case re.MouseDown:case re.MouseUp:c=c.replace("mouse","pointer");break;case re.TouchStart:case re.TouchEnd:return}l.push(ee(c,b,t))}),D(()=>{l.forEach(f=>f())})}function mo({scrollCb:e,doc:t,mirror:r,blockClass:n,blockSelector:o,sampling:i}){return ee("scroll",D(it(D(a=>{const l=st(a);if(!l||te(l,n,o,!0))return;const s=r.getId(l);if(l===t&&t.defaultView){const u=Qn(t.defaultView);e({id:s,x:u.left,y:u.top})}else e({id:s,x:l.scrollLeft,y:l.scrollTop})}),i.scroll||100)),t)}function Dc({viewportResizeCb:e},{win:t}){let r=-1,n=-1;return ee("resize",D(it(D(()=>{const o=eo(),i=to();(r!==o||n!==i)&&(e({width:Number(i),height:Number(o)}),r=o,n=i)}),200)),t)}var Fc=["INPUT","TEXTAREA","SELECT"],bo=new WeakMap;function Pc({inputCb:e,doc:t,mirror:r,blockClass:n,blockSelector:o,ignoreClass:i,ignoreSelector:a,maskInputOptions:l,maskInputFn:s,sampling:u,userTriggeredOnInput:f}){function c(y){let g=st(y);const v=y.isTrusted,w=g&&g.tagName;if(g&&w==="OPTION"&&(g=I.parentElement(g)),!g||!w||Fc.indexOf(w)<0||te(g,n,o,!0)||g.classList.contains(i)||a&&g.matches(a))return;let C=g.value,E=!1;const T=Et(g)||"";T==="radio"||T==="checkbox"?E=g.checked:(l[w.toLowerCase()]||l[T])&&(C=xt({element:g,maskInputOptions:l,tagName:w,type:T,value:C,maskInputFn:s})),b(g,f?{text:C,isChecked:E,userTriggered:v}:{text:C,isChecked:E});const L=g.name;T==="radio"&&L&&E&&t.querySelectorAll(`input[type="radio"][name="${L}"]`).forEach(k=>{if(k!==g){const x=k.value;b(k,f?{text:x,isChecked:!E,userTriggered:!1}:{text:x,isChecked:!E})}})}function b(y,g){const v=bo.get(y);if(!v||v.text!==g.text||v.isChecked!==g.isChecked){bo.set(y,g);const w=r.getId(y);D(e)({...g,id:w})}}const d=(u.input==="last"?["change"]:["input","change"]).map(y=>ee(y,D(c),t)),h=t.defaultView;if(!h)return()=>{d.forEach(y=>y())};const m=h.Object.getOwnPropertyDescriptor(h.HTMLInputElement.prototype,"value"),p=[[h.HTMLInputElement.prototype,"value"],[h.HTMLInputElement.prototype,"checked"],[h.HTMLSelectElement.prototype,"value"],[h.HTMLTextAreaElement.prototype,"value"],[h.HTMLSelectElement.prototype,"selectedIndex"],[h.HTMLOptionElement.prototype,"selected"]];return m&&m.set&&d.push(...p.map(y=>It(y[0],y[1],{set(){D(c)({target:this,isTrusted:!1})}},!1,h))),D(()=>{d.forEach(y=>y())})}function Rt(e){const t=[];function r(n,o){if(Tt("CSSGroupingRule")&&n.parentRule instanceof CSSGroupingRule||Tt("CSSMediaRule")&&n.parentRule instanceof CSSMediaRule||Tt("CSSSupportsRule")&&n.parentRule instanceof CSSSupportsRule||Tt("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 Se(e,t,r){let n,o;return e?(e.ownerNode?n=t.getId(e.ownerNode):o=r.getId(e),{styleId:o,id:n}):{}}function Uc({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:D((f,c,b)=>{const[d,h]=b,{id:m,styleId:p}=Se(c,t,r.styleMirror);return(m&&m!==-1||p&&p!==-1)&&e({id:m,styleId:p,adds:[{rule:d,index:h}]}),f.apply(c,b)})}),n.CSSStyleSheet.prototype.addRule=function(f,c,b=this.cssRules.length){const d=`${f} { ${c} }`;return n.CSSStyleSheet.prototype.insertRule.apply(this,[d,b])};const i=n.CSSStyleSheet.prototype.deleteRule;n.CSSStyleSheet.prototype.deleteRule=new Proxy(i,{apply:D((f,c,b)=>{const[d]=b,{id:h,styleId:m}=Se(c,t,r.styleMirror);return(h&&h!==-1||m&&m!==-1)&&e({id:h,styleId:m,removes:[{index:d}]}),f.apply(c,b)})}),n.CSSStyleSheet.prototype.removeRule=function(f){return n.CSSStyleSheet.prototype.deleteRule.apply(this,[f])};let a;n.CSSStyleSheet.prototype.replace&&(a=n.CSSStyleSheet.prototype.replace,n.CSSStyleSheet.prototype.replace=new Proxy(a,{apply:D((f,c,b)=>{const[d]=b,{id:h,styleId:m}=Se(c,t,r.styleMirror);return(h&&h!==-1||m&&m!==-1)&&e({id:h,styleId:m,replace:d}),f.apply(c,b)})}));let l;n.CSSStyleSheet.prototype.replaceSync&&(l=n.CSSStyleSheet.prototype.replaceSync,n.CSSStyleSheet.prototype.replaceSync=new Proxy(l,{apply:D((f,c,b)=>{const[d]=b,{id:h,styleId:m}=Se(c,t,r.styleMirror);return(h&&h!==-1||m&&m!==-1)&&e({id:h,styleId:m,replaceSync:d}),f.apply(c,b)})}));const s={};Nt("CSSGroupingRule")?s.CSSGroupingRule=n.CSSGroupingRule:(Nt("CSSMediaRule")&&(s.CSSMediaRule=n.CSSMediaRule),Nt("CSSConditionRule")&&(s.CSSConditionRule=n.CSSConditionRule),Nt("CSSSupportsRule")&&(s.CSSSupportsRule=n.CSSSupportsRule));const u={};return Object.entries(s).forEach(([f,c])=>{u[f]={insertRule:c.prototype.insertRule,deleteRule:c.prototype.deleteRule},c.prototype.insertRule=new Proxy(u[f].insertRule,{apply:D((b,d,h)=>{const[m,p]=h,{id:y,styleId:g}=Se(d.parentStyleSheet,t,r.styleMirror);return(y&&y!==-1||g&&g!==-1)&&e({id:y,styleId:g,adds:[{rule:m,index:[...Rt(d),p||0]}]}),b.apply(d,h)})}),c.prototype.deleteRule=new Proxy(u[f].deleteRule,{apply:D((b,d,h)=>{const[m]=h,{id:p,styleId:y}=Se(d.parentStyleSheet,t,r.styleMirror);return(p&&p!==-1||y&&y!==-1)&&e({id:p,styleId:y,removes:[{index:[...Rt(d),m]}]}),b.apply(d,h)})})}),D(()=>{n.CSSStyleSheet.prototype.insertRule=o,n.CSSStyleSheet.prototype.deleteRule=i,a&&(n.CSSStyleSheet.prototype.replace=a),l&&(n.CSSStyleSheet.prototype.replaceSync=l),Object.entries(s).forEach(([f,c])=>{c.prototype.insertRule=u[f].insertRule,c.prototype.deleteRule=u[f].deleteRule})})}function go({mirror:e,stylesheetManager:t},r){var n,o,i;let a=null;r.nodeName==="#document"?a=e.getId(r):a=e.getId(I.host(r));const l=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=l!=null&&l.prototype?Object.getOwnPropertyDescriptor(l==null?void 0:l.prototype,"adoptedStyleSheets"):void 0;return a===null||a===-1||!l||!s?()=>{}:(Object.defineProperty(r,"adoptedStyleSheets",{configurable:s.configurable,enumerable:s.enumerable,get(){var u;return(u=s.get)==null?void 0:u.call(this)},set(u){var f;const c=(f=s.set)==null?void 0:f.call(this,u);if(a!==null&&a!==-1)try{t.adoptStyleSheets(u,a)}catch{}return c}}),D(()=>{Object.defineProperty(r,"adoptedStyleSheets",{configurable:s.configurable,enumerable:s.enumerable,get:s.get,set:s.set})}))}function Bc({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:r,stylesheetManager:n},{win:o}){const i=o.CSSStyleDeclaration.prototype.setProperty;o.CSSStyleDeclaration.prototype.setProperty=new Proxy(i,{apply:D((l,s,u)=>{var f;const[c,b,d]=u;if(r.has(c))return i.apply(s,[c,b,d]);const{id:h,styleId:m}=Se((f=s.parentRule)==null?void 0:f.parentStyleSheet,t,n.styleMirror);return(h&&h!==-1||m&&m!==-1)&&e({id:h,styleId:m,set:{property:c,value:b,priority:d},index:Rt(s.parentRule)}),l.apply(s,u)})});const a=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=new Proxy(a,{apply:D((l,s,u)=>{var f;const[c]=u;if(r.has(c))return a.apply(s,[c]);const{id:b,styleId:d}=Se((f=s.parentRule)==null?void 0:f.parentStyleSheet,t,n.styleMirror);return(b&&b!==-1||d&&d!==-1)&&e({id:b,styleId:d,remove:{property:c},index:Rt(s.parentRule)}),l.apply(s,u)})}),D(()=>{o.CSSStyleDeclaration.prototype.setProperty=i,o.CSSStyleDeclaration.prototype.removeProperty=a})}function zc({mediaInteractionCb:e,blockClass:t,blockSelector:r,mirror:n,sampling:o,doc:i}){const a=D(s=>it(D(u=>{const f=st(u);if(!f||te(f,t,r,!0))return;const{currentTime:c,volume:b,muted:d,playbackRate:h,loop:m}=f;e({type:s,id:n.getId(f),currentTime:c,volume:b,muted:d,playbackRate:h,loop:m})}),o.media||500)),l=[ee("play",a(De.Play),i),ee("pause",a(De.Pause),i),ee("seeked",a(De.Seeked),i),ee("volumechange",a(De.VolumeChange),i),ee("ratechange",a(De.RateChange),i)];return D(()=>{l.forEach(s=>s())})}function $c({fontCb:e,doc:t}){const r=t.defaultView;if(!r)return()=>{};const n=[],o=new WeakMap,i=r.FontFace;r.FontFace=function(s,u,f){const c=new i(s,u,f);return o.set(c,{family:s,buffer:typeof u!="string",descriptors:f,fontSource:typeof u=="string"?u:JSON.stringify(Array.from(new Uint8Array(u)))}),c};const a=Ce(t.fonts,"add",function(l){return function(s){return setTimeout(D(()=>{const u=o.get(s);u&&(e(u),o.delete(s))}),0),l.apply(this,[s])}});return n.push(()=>{r.FontFace=i}),n.push(a),D(()=>{n.forEach(l=>l())})}function Wc(e){const{doc:t,mirror:r,blockClass:n,blockSelector:o,selectionCb:i}=e;let a=!0;const l=D(()=>{const s=t.getSelection();if(!s||a&&(s!=null&&s.isCollapsed))return;a=s.isCollapsed||!1;const u=[],f=s.rangeCount||0;for(let c=0;c<f;c++){const{startContainer:b,startOffset:d,endContainer:h,endOffset:m}=s.getRangeAt(c);te(b,n,o,!0)||te(h,n,o,!0)||u.push({start:r.getId(b),startOffset:d,end:r.getId(h),endOffset:m})}i({ranges:u})});return l(),ee("selectionchange",l)}function Hc({doc:e,customElementCb:t}){const r=e.defaultView;return!r||!r.customElements?()=>{}:Ce(r.customElements,"define",function(n){return function(o,i,a){try{t({define:{name:o}})}catch{console.warn(`Custom element callback failed for ${o}`)}return n.apply(this,[o,i,a])}})}function jc(e,t){const{mutationCb:r,mousemoveCb:n,mouseInteractionCb:o,scrollCb:i,viewportResizeCb:a,inputCb:l,mediaInteractionCb:s,styleSheetRuleCb:u,styleDeclarationCb:f,canvasMutationCb:c,fontCb:b,selectionCb:d,customElementCb:h}=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),a(...m)},e.inputCb=(...m)=>{t.input&&t.input(...m),l(...m)},e.mediaInteractionCb=(...m)=>{t.mediaInteaction&&t.mediaInteaction(...m),s(...m)},e.styleSheetRuleCb=(...m)=>{t.styleSheetRule&&t.styleSheetRule(...m),u(...m)},e.styleDeclarationCb=(...m)=>{t.styleDeclaration&&t.styleDeclaration(...m),f(...m)},e.canvasMutationCb=(...m)=>{t.canvasMutation&&t.canvasMutation(...m),c(...m)},e.fontCb=(...m)=>{t.font&&t.font(...m),b(...m)},e.selectionCb=(...m)=>{t.selection&&t.selection(...m),d(...m)},e.customElementCb=(...m)=>{t.customElement&&t.customElement(...m),h(...m)}}function Vc(e,t={}){const r=e.doc.defaultView;if(!r)return()=>{};jc(e,t);let n,o=()=>{};e.recordDOM&&([n,o]=po(e,e.doc));const i=Ac(e),a=Oc(e),l=mo(e),s=Dc(e,{win:r}),u=Pc(e),f=zc(e);let c=()=>{},b=()=>{},d=()=>{},h=()=>{};e.recordDOM&&(c=Uc(e,{win:r}),b=go(e,e.doc),d=Bc(e,{win:r}),e.collectFonts&&(h=$c(e)));const m=Wc(e),p=Hc(e),y=[];for(const g of e.plugins)y.push(g.observer(g.callback,r,g.options));return D(()=>{Me.forEach(g=>g.reset()),n==null||n.disconnect(),o(),i(),a(),l(),s(),u(),f(),c(),b(),d(),h(),m(),p(),y.forEach(g=>g())})}function Tt(e){return typeof window[e]!="undefined"}function Nt(e){return!!(typeof window[e]!="undefined"&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}for(var vo=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 a=o.get(t);return a||(a=this.generateIdFn(),o.set(t,a),i.set(a,t)),a}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}},Gc=class{constructor(e){S(this,"iframes",new WeakMap),S(this,"crossOriginIframeMap",new WeakMap),S(this,"crossOriginIframeMirror",new vo(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 vo(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 P.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:P.IncrementalSnapshot,data:{source:O.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case P.Meta:case P.Load:case P.DomContentLoaded:return!1;case P.Plugin:return t;case P.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case P.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!==K.Document&&!e.rootId&&(e.rootId=t),"childNodes"in e&&e.childNodes.forEach(r=>{this.patchRootIdOnNode(r,t)})}},qc=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(!nt(e)||this.shadowDoms.has(e))return;this.shadowDoms.add(e);const[r]=po({...this.bypassOptions,doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(mo({...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(I.host(e))),this.restoreHandlers.push(go({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(Ce(e.prototype,"attachShadow",function(n){return function(o){const i=n.call(this,o),a=I.shadowRoot(this);return a&&so(this)&&r.addShadowRoot(a,t),i}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch{}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}},ze="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Xc=typeof Uint8Array=="undefined"?[]:new Uint8Array(256),_t=0;_t<ze.length;_t++)Xc[ze.charCodeAt(_t)]=_t;var Yc=function(e){var t=new Uint8Array(e),r,n=t.length,o="";for(r=0;r<n;r+=3)o+=ze[t[r]>>2],o+=ze[(t[r]&3)<<4|t[r+1]>>4],o+=ze[(t[r+1]&15)<<2|t[r+2]>>6],o+=ze[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},yo=new Map;function Kc(e,t){let r=yo.get(e);return r||(r=new Map,yo.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}var wo=(e,t,r)=>{if(!e||!(xo(e,t)||typeof e=="object"))return;const n=e.constructor.name,o=Kc(r,n);let i=o.indexOf(e);return i===-1&&(i=o.length,o.push(e)),i};function Lt(e,t,r){if(e instanceof Array)return e.map(n=>Lt(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:Yc(e)};if(e instanceof DataView)return{rr_type:e.constructor.name,args:[Lt(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:[Lt(e.data,t,r),e.width,e.height]};if(xo(e,t)||typeof e=="object")return{rr_type:e.constructor.name,index:wo(e,t,r)}}return e}var So=(e,t,r)=>e.map(n=>Lt(n,t,r)),xo=(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 Jc(e,t,r,n){const o=[],i=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const a of i)try{if(typeof t.CanvasRenderingContext2D.prototype[a]!="function")continue;const l=Ce(t.CanvasRenderingContext2D.prototype,a,function(s){return function(...u){return te(this.canvas,r,n,!0)||setTimeout(()=>{const f=So(u,t,this);e(this.canvas,{type:Oe["2D"],property:a,args:f})},0),s.apply(this,u)}});o.push(l)}catch{const l=It(t.CanvasRenderingContext2D.prototype,a,{set(s){e(this.canvas,{type:Oe["2D"],property:a,args:[s],setter:!0})}});o.push(l)}return()=>{o.forEach(a=>a())}}function Zc(e){return e==="experimental-webgl"?"webgl":e}function Eo(e,t,r,n){const o=[];try{const i=Ce(e.HTMLCanvasElement.prototype,"getContext",function(a){return function(l,...s){if(!te(this,t,r,!0)){const u=Zc(l);if("__context"in this||(this.__context=u),n&&["webgl","webgl2"].includes(u))if(s[0]&&typeof s[0]=="object"){const f=s[0];f.preserveDrawingBuffer||(f.preserveDrawingBuffer=!0)}else s.splice(0,1,{preserveDrawingBuffer:!0})}return a.apply(this,[l,...s])}});o.push(i)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{o.forEach(i=>i())}}function Co(e,t,r,n,o,i){const a=[],l=Object.getOwnPropertyNames(e);for(const s of l)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(s))try{if(typeof e[s]!="function")continue;const u=Ce(e,s,function(f){return function(...c){const b=f.apply(this,c);if(wo(b,i,this),"tagName"in this.canvas&&!te(this.canvas,n,o,!0)){const d=So(c,i,this),h={type:t,property:s,args:d};r(this.canvas,h)}return b}});a.push(u)}catch{const u=It(e,s,{set(f){r(this.canvas,{type:t,property:s,args:[f],setter:!0})}});a.push(u)}return a}function Qc(e,t,r,n){const o=[];return typeof t.WebGLRenderingContext!="undefined"&&o.push(...Co(t.WebGLRenderingContext.prototype,Oe.WebGL,e,r,n,t)),typeof t.WebGL2RenderingContext!="undefined"&&o.push(...Co(t.WebGL2RenderingContext.prototype,Oe.WebGL2,e,r,n,t)),()=>{o.forEach(i=>i())}}var ko=`(function() {
|
|
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() {
|
|
778
765
|
"use strict";
|
|
779
766
|
var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
780
767
|
var lookup = typeof Uint8Array === "undefined" ? [] : new Uint8Array(256);
|
|
@@ -849,6 +836,6 @@ or you can use record.mirror to access the mirror instance during recording.`,Zn
|
|
|
849
836
|
};
|
|
850
837
|
})();
|
|
851
838
|
//# sourceMappingURL=image-bitmap-data-url-worker-IJpC7g_b.js.map
|
|
852
|
-
`,Mo=typeof self!="undefined"&&self.Blob&&new Blob([ko],{type:"text/javascript;charset=utf-8"});function eu(e){let t;try{if(t=Mo&&(self.URL||self.webkitURL).createObjectURL(Mo),!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(ko),{name:e==null?void 0:e.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}var tu=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,s)=>{(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(s)});const{sampling:t="all",win:r,blockClass:n,blockSelector:o,recordCanvas:i,dataURLOptions:a}=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:a})}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=Eo(t,r,n,!0),a=new Map,l=new eu;l.onmessage=d=>{const{id:h}=d.data;if(a.set(h,!1),!("base64"in d.data))return;const{base64:m,type:p,width:y,height:g}=d.data;this.mutationCb({id:h,type:Oe["2D"],commands:[{property:"clearRect",args:[0,0,y,g]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:m}],type:p}]},0,0]}]})};const s=1e3/e;let u=0,f;const c=()=>{const d=[];return t.document.querySelectorAll("canvas").forEach(h=>{te(h,r,n,!0)||d.push(h)}),d},b=d=>{if(u&&d-u<s){f=requestAnimationFrame(b);return}u=d,c().forEach(async h=>{var m;const p=this.mirror.getId(h);if(a.get(p)||h.width===0||h.height===0)return;if(a.set(p,!0),["webgl","webgl2"].includes(h.__context)){const g=h.getContext(h.__context);((m=g==null?void 0:g.getContextAttributes())==null?void 0:m.preserveDrawingBuffer)===!1&&g.clear(g.COLOR_BUFFER_BIT)}const y=await createImageBitmap(h);l.postMessage({id:p,bitmap:y,width:h.width,height:h.height,dataURLOptions:o.dataURLOptions},[y])}),f=requestAnimationFrame(b)};f=requestAnimationFrame(b),this.resetObservers=()=>{i(),cancelAnimationFrame(f)}}initCanvasMutationObserver(e,t,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const n=Eo(e,t,r,!1),o=Jc(this.processMutation.bind(this),e,t,r),i=Qc(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:a,...l}=i;return l}),{type:o}=r[0];this.mutationCb({id:t,type:o,commands:n}),this.pendingCanvasMutations.delete(e)}},ru=class{constructor(e){S(this,"trackedLinkElements",new WeakSet),S(this,"mutationCb"),S(this,"adoptedStyleSheetCb"),S(this,"styleMirror",new Cc),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,(a,l)=>({rule:$n(a,o.href),index:l}))})),r.styleIds.push(i)}n.length>0&&(r.styles=n),this.adoptedStyleSheetCb(r)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}},nu=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(){}},Y,At,yr,Ot=!1;try{if(Array.from([1],e=>e*2)[0]!==2){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=((On=e.contentWindow)==null?void 0:On.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}var ce=Kl();function lt(e={}){const{emit:t,checkoutEveryNms:r,checkoutEveryNth:n,blockClass:o="rr-block",blockSelector:i=null,ignoreClass:a="rr-ignore",ignoreSelector:l=null,maskTextClass:s="rr-mask",maskTextSelector:u=null,inlineStylesheet:f=!0,maskAllInputs:c,maskInputOptions:b,slimDOMOptions:d,maskInputFn:h,maskTextFn:m,hooks:p,packFn:y,sampling:g={},dataURLOptions:v={},mousemoveWait:w,recordDOM:C=!0,recordCanvas:E=!1,recordCrossOriginIframes:T=!1,recordAfter:L=e.recordAfter==="DOMContentLoaded"?e.recordAfter:"load",userTriggeredOnInput:k=!1,collectFonts:x=!1,inlineImages:A=!1,plugins:V,keepIframeSrcFn:R=()=>!1,ignoreCSSAttributes:ue=new Set([]),errorHandler:W}=e;_c(W);const N=T?window.parent===window:!0;let z=!1;if(!N)try{window.parent.document&&(z=!1)}catch{z=!0}if(N&&!t)throw new Error("emit function is required");if(!N&&!z)return()=>{};w!==void 0&&g.mousemove===void 0&&(g.mousemove=w),ce.reset();const H=c===!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}:b!==void 0?b:{password:!0},X=Jn(d);Ec();let Z,Q=0;const de=F=>{for(const oe of V||[])oe.eventProcessor&&(F=oe.eventProcessor(F));return y&&!z&&(F=y(F)),F};Y=(F,oe)=>{var G;const q=F;if(q.timestamp=tt(),(G=Me[0])!=null&&G.isFrozen()&&q.type!==P.FullSnapshot&&!(q.type===P.IncrementalSnapshot&&q.data.source===O.Mutation)&&Me.forEach(J=>J.unfreeze()),N)t==null||t(de(q),oe);else if(z){const J={type:"rrweb",event:de(q),origin:window.location.origin,isCheckout:oe};window.parent.postMessage(J,"*")}if(q.type===P.FullSnapshot)Z=q,Q=0;else if(q.type===P.IncrementalSnapshot){if(q.data.source===O.Mutation&&q.data.isAttachIframe)return;Q++;const J=n&&Q>=n,$=r&&q.timestamp-Z.timestamp>r;(J||$)&&At(!0)}};const ae=F=>{Y({type:P.IncrementalSnapshot,data:{source:O.Mutation,...F}})},fe=F=>Y({type:P.IncrementalSnapshot,data:{source:O.Scroll,...F}}),$e=F=>Y({type:P.IncrementalSnapshot,data:{source:O.CanvasMutation,...F}}),Ie=F=>Y({type:P.IncrementalSnapshot,data:{source:O.AdoptedStyleSheet,...F}}),pe=new ru({mutationCb:ae,adoptedStyleSheetCb:Ie}),ne=new Gc({mirror:ce,mutationCb:ae,stylesheetManager:pe,recordCrossOriginIframes:T,wrappedEmit:Y});for(const F of V||[])F.getMirror&&F.getMirror({nodeMirror:ce,crossOriginIframeMirror:ne.crossOriginIframeMirror,crossOriginIframeStyleMirror:ne.crossOriginIframeStyleMirror});const Re=new nu;yr=new tu({recordCanvas:E,mutationCb:$e,win:window,blockClass:o,blockSelector:i,mirror:ce,sampling:g.canvas,dataURLOptions:v});const We=new qc({mutationCb:ae,scrollCb:fe,bypassOptions:{blockClass:o,blockSelector:i,maskTextClass:s,maskTextSelector:u,inlineStylesheet:f,maskInputOptions:H,dataURLOptions:v,maskTextFn:m,maskInputFn:h,recordCanvas:E,inlineImages:A,sampling:g,slimDOMOptions:X,iframeManager:ne,stylesheetManager:pe,canvasManager:yr,keepIframeSrcFn:R,processedNodeManager:Re},mirror:ce});At=(F=!1)=>{if(!C)return;Y({type:P.Meta,data:{href:window.location.href,width:to(),height:eo()}},F),pe.reset(),We.init(),Me.forEach(G=>G.lock());const oe=wc(document,{mirror:ce,blockClass:o,blockSelector:i,maskTextClass:s,maskTextSelector:u,inlineStylesheet:f,maskAllInputs:H,maskTextFn:m,maskInputFn:h,slimDOM:X,dataURLOptions:v,recordCanvas:E,inlineImages:A,onSerialize:G=>{oo(G,ce)&&ne.addIframe(G),io(G,ce)&&pe.trackLinkElement(G),gr(G)&&We.addShadowRoot(I.shadowRoot(G),document)},onIframeLoad:(G,q)=>{ne.attachIframe(G,q),We.observeAttachShadow(G)},onStylesheetLoad:(G,q)=>{pe.attachLinkElement(G,q)},keepIframeSrcFn:R});if(!oe)return console.warn("Failed to snapshot the document");Y({type:P.FullSnapshot,data:{node:oe,initialOffset:Qn(window)}},F),Me.forEach(G=>G.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&pe.adoptStyleSheets(document.adoptedStyleSheets,ce.getId(document))};try{const F=[],oe=q=>{var J;return D(Vc)({mutationCb:ae,mousemoveCb:($,M)=>Y({type:P.IncrementalSnapshot,data:{source:M,positions:$}}),mouseInteractionCb:$=>Y({type:P.IncrementalSnapshot,data:{source:O.MouseInteraction,...$}}),scrollCb:fe,viewportResizeCb:$=>Y({type:P.IncrementalSnapshot,data:{source:O.ViewportResize,...$}}),inputCb:$=>Y({type:P.IncrementalSnapshot,data:{source:O.Input,...$}}),mediaInteractionCb:$=>Y({type:P.IncrementalSnapshot,data:{source:O.MediaInteraction,...$}}),styleSheetRuleCb:$=>Y({type:P.IncrementalSnapshot,data:{source:O.StyleSheetRule,...$}}),styleDeclarationCb:$=>Y({type:P.IncrementalSnapshot,data:{source:O.StyleDeclaration,...$}}),canvasMutationCb:$e,fontCb:$=>Y({type:P.IncrementalSnapshot,data:{source:O.Font,...$}}),selectionCb:$=>{Y({type:P.IncrementalSnapshot,data:{source:O.Selection,...$}})},customElementCb:$=>{Y({type:P.IncrementalSnapshot,data:{source:O.CustomElement,...$}})},blockClass:o,ignoreClass:a,ignoreSelector:l,maskTextClass:s,maskTextSelector:u,maskInputOptions:H,inlineStylesheet:f,sampling:g,recordDOM:C,recordCanvas:E,inlineImages:A,userTriggeredOnInput:k,collectFonts:x,doc:q,maskInputFn:h,maskTextFn:m,keepIframeSrcFn:R,blockSelector:i,slimDOMOptions:X,dataURLOptions:v,mirror:ce,iframeManager:ne,stylesheetManager:pe,shadowDomManager:We,processedNodeManager:Re,canvasManager:yr,ignoreCSSAttributes:ue,plugins:((J=V==null?void 0:V.filter($=>$.observer))==null?void 0:J.map($=>({observer:$.observer,options:$.options,callback:M=>Y({type:P.Plugin,data:{plugin:$.name,payload:M}})})))||[]},p)};ne.addLoadListener(q=>{try{F.push(oe(q.contentDocument))}catch(J){console.warn(J)}});const G=()=>{At(),F.push(oe(document)),Ot=!0};return["interactive","complete"].includes(document.readyState)?G():(F.push(ee("DOMContentLoaded",()=>{Y({type:P.DomContentLoaded,data:{}}),L==="DOMContentLoaded"&&G()})),F.push(ee("load",()=>{Y({type:P.Load,data:{}}),L==="load"&&G()},window))),()=>{F.forEach(q=>{try{q()}catch(J){String(J).toLowerCase().includes("cross-origin")||console.warn(J)}}),Re.destroy(),Ot=!1,Lc()}}catch(F){console.warn(F)}}lt.addCustomEvent=(e,t)=>{if(!Ot)throw new Error("please add custom event after start recording");Y({type:P.Custom,data:{tag:e,payload:t}})},lt.freezePage=()=>{Me.forEach(e=>e.freeze())},lt.takeFullSnapshot=e=>{if(!Ot)throw new Error("please take full snapshot after start recording");At(e)},lt.mirror=ce;var Io=(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))(Io||{}),ou=3e4,iu="[data-fixback-root],[data-fixback-overlay]",au="img,image,svg,video,object,picture,embed,map,audio",su={snapshot:()=>null,stop:()=>{}};function lu(e={},t=lt){let r=[],n=[],o=!1;const i=e.maskText!==!1,a=[iu,...e.blockMedia!==!1?[au]:[],...e.blockSelector?[e.blockSelector]:[]].join(",");let l;try{var s;l=t({emit:(c,b)=>{b&&!o&&(r=n,n=[]),o=b===!0,n.push(c)},checkoutEveryNms:ou,maskAllInputs:!0,...i?{maskTextSelector:(s=e.maskTextSelector)!==null&&s!==void 0?s:"*"}:{},blockSelector:a,slimDOMOptions:"all"})}catch{l=void 0}if(typeof l!="function")return su;const u=l;let f=!0;return{snapshot(){if(!f)return null;const c=[...r,...n];return c.some(b=>b.type===Io.FullSnapshot)?{events:c}:null},stop(){if(f){f=!1;try{u()}catch{}r=[],n=[]}}}}var Ro="https://api.fixback.dev";function cu(e,t){const r=e.replace(/\/+$/,"");return t.startsWith(`${r}/api/ingest/`)||t.startsWith(`${r}/api/invites/`)}var wr={destroy(){}};function uu(){try{const e=window.location;return e.host||e.hostname||"this site"}catch{return"this site"}}function du(){try{return window.location.href}catch{return""}}function fu(e){const{options:t,apiUrl:r,key:n,identity:o,display:i,target:a,answer:l}=e,s=t.release?ji(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 u=ll(a,{key:n,reduceMotion:t.reduceMotion});let f=null,c=()=>{};if(t.trace!==!1){var b,d,h,m,p;const L=(b=t.trace)!==null&&b!==void 0?b:{},k=e.answer.capture,x=(d=(h=t.capture)===null||h===void 0?void 0:h.console)!==null&&d!==void 0?d:typeof(k==null?void 0:k.console)=="boolean"?k.console:!0,A=(m=(p=t.capture)===null||p===void 0?void 0:p.network)!==null&&m!==void 0?m:typeof(k==null?void 0:k.network)=="boolean"?k.network:!0;f=hi({budgets:L.budgets,maxAgeMs:L.maxAgeMs,beforeBreadcrumb:L.beforeBreadcrumb}),c=Ui(f,{consoleLevels:L.consoleLevels,ignoreUrl:V=>cu(r,V),captureConsole:x,captureNetwork:A})}let y=null;if(t.replay!==!1){var g,v;const L=e.answer.capture;if((g=(v=t.capture)===null||v===void 0?void 0:v.replay)!==null&&g!==void 0?g:typeof(L==null?void 0:L.replay)!="boolean"||L.replay){var w;y=lu((w=t.replay)!==null&&w!==void 0?w:{})}}const C=kl({apiUrl:r,key:n,identity:o,display:i,gate:l.gate,tier:l.tier,sdkVersion:gt,release:s,target:a,buffer:f,replay:y,beforeSend:t.beforeSend,scrub:t.scrub}),E=()=>C.open();u.host.addEventListener(yt,E);let T=()=>{};return t.autoCapture!==!1&&(T=js({apiUrl:r,key:n,identity:o,display:i,sdkVersion:gt,release:s,buffer:f,replay:y,beforeSend:t.beforeSend,scrub:t.scrub}).destroy),()=>{u.host.removeEventListener(yt,E),C.destroy(),cl(u),c(),y==null||y.stop(),T()}}async function To(e,t){try{var r,n,o;if(typeof document=="undefined")return wr;const i=e==null?void 0:e.key;if(typeof i!="string"||i.length===0)return wr;const a=(r=e.apiUrl)!==null&&r!==void 0?r:Ro,l=(n=e.anonymousId)!==null&&n!==void 0?n:Vs(),s=(o=e.target)!==null&&o!==void 0?o:document.body;let u=!1,f=()=>{},c=()=>{};const b={destroy:()=>{u=!0,c(),c=()=>{},f(),f=()=>{}}},d=()=>{var p;const y=lr(i);return{signedIdentity:e.signedIdentity,reporterId:(p=e.reporterId)!==null&&p!==void 0?p:y==null?void 0:y.reporterId,anonymousId:l}},h=()=>{const p=lr(i);if(!p)return;const y={...p.name?{name:p.name}:{},...p.email?{email:p.email}:{}};return y.name||y.email?y:void 0},m=async(p,y)=>{const g=await Ho(a,{key:i,...p});u||!(g!=null&&g.canSubmit)||(f=fu({options:e,apiUrl:a,key:i,identity:p,display:y,target:s,answer:g}))};if(t){const p=await Qs(a,t);if(u)return b;if(p&&p.status==="pending"){const y=lr(i),g=async w=>{const C=await el(a,t);u||(c(),c=()=>{},C&&C.status==="redeemed"?(Ys(i,{reporterId:C.reporterId,name:w.name,email:w.email}),Xs(window),await m({signedIdentity:e.signedIdentity,reporterId:C.reporterId,anonymousId:l},w.name||w.email?w:void 0)):await m(d(),h()))},v=ml({origin:uu(),tier:p.tier,defaults:y?{name:y.name,email:y.email}:void 0,target:s,onConfirm:w=>{g(w)}});return c=()=>v.destroy(),b}}return await m(d(),h()),b}catch{return wr}}function hu(e){return To(e,typeof window!="undefined"?qs(du()):null)}function pu(e){return To(e,typeof(e==null?void 0:e.token)=="string"&&e.token.length>0?e.token:null)}me.DEFAULT_API_URL=Ro,me.LAUNCH_EVENT=yt,me.init=hu,me.redeem=pu});
|
|
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)&>(!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});
|
|
853
840
|
|
|
854
841
|
//# sourceMappingURL=fixback.umd.js.map
|