posthog-js 1.455.0 → 1.455.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/all-external-dependencies.js +1 -1
- package/dist/all-external-dependencies.js.map +1 -1
- package/dist/array.full.es5.js +1 -1
- package/dist/array.full.es5.js.map +1 -1
- package/dist/array.full.js +1 -1
- package/dist/array.full.js.map +1 -1
- package/dist/array.full.no-external.js +1 -1
- package/dist/array.full.no-external.js.map +1 -1
- package/dist/array.js +1 -1
- package/dist/array.no-external.js +1 -1
- package/dist/customizations.full.js +1 -1
- package/dist/customizations.js +1 -1
- package/dist/default-extensions.js +1 -1
- package/dist/exception-autocapture.d.ts +4 -3
- package/dist/exception-autocapture.js +1 -1
- package/dist/exception-autocapture.js.map +1 -1
- package/dist/extension-bundles.js +1 -1
- package/dist/external-scripts-loader.js +1 -1
- package/dist/integrity.json +28 -28
- package/dist/lazy-recorder.js +1 -1
- package/dist/main.js +1 -1
- package/dist/module.full.cjs +1 -1
- package/dist/module.full.js +1 -1
- package/dist/module.full.js.map +1 -1
- package/dist/module.full.no-external.cjs +1 -1
- package/dist/module.full.no-external.js +1 -1
- package/dist/module.full.no-external.js.map +1 -1
- package/dist/module.js +1 -1
- package/dist/module.mjs +1 -1
- package/dist/module.no-external.cjs +1 -1
- package/dist/module.no-external.js +1 -1
- package/dist/module.slim.js +1 -1
- package/dist/module.slim.no-external.js +1 -1
- package/dist/posthog-recorder.js +1 -1
- package/dist/src/entrypoints/exception-autocapture.d.ts +4 -3
- package/dist/surveys-preview.js +1 -1
- package/dist/surveys.js +1 -1
- package/lib/package.json +1 -1
- package/lib/src/entrypoints/exception-autocapture.d.ts +4 -3
- package/lib/src/entrypoints/exception-autocapture.js +92 -42
- package/lib/src/entrypoints/exception-autocapture.js.map +1 -1
- package/package.json +4 -4
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(){const t="u">typeof window?window:void 0,e="u">typeof globalThis?globalThis:t,n=null==e?void 0:e.document,i=null==e?void 0:e.location;null!=e&&e.XMLHttpRequest&&new e.XMLHttpRequest;const r="undefined"!=typeof globalThis?globalThis:t;r&&"undefined"==typeof self&&(r.self=r),r&&"undefined"==typeof File&&(r.File=function(){});const o=null!=t?t:{},s="$stored_person_properties",a="$surveys",l="$replay_override_sampling",u="$replay_override_linked_flag",c="$replay_override_url_trigger",d="$replay_override_event_trigger",h="$session_is_sampled",f="$session_recording_url_trigger_activated_session",v="$session_recording_event_trigger_activated_session",p="$posthog_sr_group_event_trigger_",m="$posthog_sr_group_url_trigger_",g="$sess_rec_flush_size",y="$sdk_debug_replay_event_trigger_status",b="$sdk_debug_replay_linked_flag_trigger_status",w="$sdk_debug_replay_matched_recording_trigger_groups",k="$sdk_debug_replay_pending_trigger_conditions",S="$sdk_debug_replay_remote_trigger_matching_config",_="$sdk_debug_replay_trigger_groups_count",x="$sdk_debug_replay_url_trigger_status",C="$sdk_debug_rrweb_attached",M="$sdk_debug_rrweb_start_attempted",T="$session_recording_start_reason";function I(t,e,n,i,r,o,s){try{var a=t[o](s),l=a.value}catch(t){return void n(t)}a.done?e(l):Promise.resolve(l).then(i,r)}function A(t){return function(){var e=this,n=arguments;return new Promise(function(i,r){var o=t.apply(e,n);function s(t){I(o,i,r,s,a,"next",t)}function a(t){I(o,i,r,s,a,"throw",t)}s(void 0)})}}function R(t){return R="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},R(t)}function E(t,e,n){return(e=function(t){var e=function(t){if("object"!=R(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=R(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==R(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function O(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,i)}return n}function L(t){for(var e=1;arguments.length>e;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?O(Object(n),!0).forEach(function(e){E(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):O(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}var D=function(t){return t.GZipJS="gzip-js",t.Base64="base64",t}({});const F="min_length",P="max_length";function N(t,e){return-1!==t.indexOf(e)}const q=function(t){return t.trim()},j=Object.prototype,B=j.hasOwnProperty,z=j.toString,U=Array.isArray||function(t){return"[object Array]"===z.call(t)},W=t=>"function"==typeof t,H=t=>t===Object(t)&&!U(t),G=t=>void 0===t,V=t=>"[object String]"==z.call(t),Q=t=>V(t)&&0===t.trim().length,Z=t=>null===t,J=t=>G(t)||Z(t),Y=t=>"[object Number]"==z.call(t)&&t==t,K=t=>"[object Boolean]"===z.call(t),X=t=>t instanceof FormData;function tt(t){return null===t||"object"!=typeof t}function et(t,e){return{}.toString.call(t)===`[object ${e}]`}function nt(t){switch({}.toString.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object DOMError]":case"[object WebAssembly.Exception]":return!0;default:return rt(t,Error)}}function it(t){return"u">typeof Event&&rt(t,Event)}function rt(t,e){try{return t instanceof e}catch(t){return!1}}function ot(t,e,n,i,r){return e>n&&(i.warn("min cannot be greater than max."),e=n),Y(t)?t>n?(i.warn(" cannot be greater than max: "+n+". Using max value instead."),n):e>t?(i.warn(" cannot be less than min: "+e+". Using min value instead."),e):t:(i.warn(" must be a number. using max or fallback. max: "+n+", fallback: "+r),ot(null!=r?r:n,e,n,i))}var st=class{constructor(t){this.C={},this.I=t.I,this.A=ot(t.bucketSize,0,100,t.R),this.O=ot(t.refillRate,0,this.A,t.R),this.$=ot(t.refillInterval,0,864e5,t.R)}F(t,e){const n=Math.floor((e-t.lastAccess)/this.$);n>0&&(t.tokens=Math.min(t.tokens+n*this.O,this.A),t.lastAccess=t.lastAccess+n*this.$)}consumeRateLimit(t){var e;const n=Date.now(),i=String(t);let r=this.C[i];return r?this.F(r,n):(r={tokens:this.A,lastAccess:n},this.C[i]=r),0===r.tokens||(r.tokens--,0===r.tokens&&(null===(e=this.I)||void 0===e||e.call(this,t)),0===r.tokens)}stop(){this.C={}}};const at="Mobile",lt="Tablet",ut="Android Tablet",ct="iPad",dt="Apple Watch",ht="Nintendo",ft="PlayStation",vt="Xbox",pt="Nokia",mt="Ouya",gt="Generic tablet",yt=new RegExp(vt,"i"),bt=new RegExp("PlayStation \\w+","i"),wt=new RegExp("Nintendo \\w+","i"),kt=new RegExp("BlackBerry|PlayBook|BB10","i");function St(t){return t?t.split("#")[0]:t}function _t(t){try{return t()}catch(t){return}}let xt,Ct,Mt,Tt;function It(t){var e;const n=globalThis._posthogChunkIds,i=globalThis._debugIds;if(!n&&!i)return;const r=n?Object.keys(n):[],o=i?Object.keys(i):[];if(Tt&&At(n,r,Ct)&&At(i,o,Mt))return Tt;Ct=n?L({},n):void 0,Mt=i?L({},i):void 0,Tt={},null!==(e=xt)&&void 0!==e||(xt={});const s=(e,n)=>{for(const r of e){const e=n[r];if(!e)continue;const o=null==xt?void 0:xt[r];if(o){Tt[o]=e;continue}const s=t(r);for(let t=s.length-1;t>=0;t--){var i;const n=null===(i=s[t])||void 0===i?void 0:i.filename;if(n){Tt[n]=e,xt[r]=n;break}}}};return i&&s(o,i),n&&s(r,n),Tt}function At(t,e,n){return t&&n?e.length===Object.keys(n).length&&e.every(e=>t[e]===n[e]):t===n}const Rt=/^([a-z][a-z0-9.+-]+):/i,Et=["http","https","file","blob","app","capacitor","ionic","webpack","webpack-internal","ng"];function Ot(t){if(!t||"<anonymous>"===t)return!1;const e=Rt.exec(t);return!e||Et.includes(e[1].toLowerCase())}function $t(t,e,n,i,r){const o={platform:t,filename:e,function:"<anonymous>"===n?"?":n,in_app:Ot(e)};return G(i)||(o.lineno=i),G(r)||(o.colno=r),o}const Lt=(t,e)=>{const n=-1!==t.indexOf("safari-extension"),i=-1!==t.indexOf("safari-web-extension");return n||i?[-1!==t.indexOf("@")?t.split("@")[0]:"?",n?`safari-extension:${e}`:`safari-web-extension:${e}`]:[t,e]},Dt=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,Ft=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Pt=/\((\S*)(?::(\d+))(?::(\d+))\)/,Nt=(t,e)=>{const n=Dt.exec(t);if(n){const[,t,i,r]=n;return $t(e,t,"?",+i,+r)}const i=Ft.exec(t);if(i){if(i[2]&&0===i[2].indexOf("eval")){const t=Pt.exec(i[2]);t&&(i[2]=t[1],i[3]=t[2],i[4]=t[3])}const[t,n]=Lt(i[1]||"?",i[2]);return $t(e,n,t,i[3]?+i[3]:void 0,i[4]?+i[4]:void 0)}},qt=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,jt=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Bt=(t,e)=>{const n=qt.exec(t);if(n){if(n[3]&&n[3].indexOf(" > eval")>-1){const t=jt.exec(n[3]);t&&(n[1]=n[1]||"eval",n[3]=t[1],n[4]=t[2],n[5]="")}let t=n[3],i=n[1]||"?";return[i,t]=Lt(i,t),$t(e,t,i,n[4]?+n[4]:void 0,n[5]?+n[5]:void 0)}},zt=/\(error: (.*)\)/;function Ut(t,e){return t.filename===e.filename&&t.function===e.function&&t.module===e.module&&t.lineno===e.lineno&&t.colno===e.colno}function Wt(t){for(let e=1;10>=e;e++){const n=t.length-2*e;if(0>n)break;let i=!0;for(let r=0;e>r;r++)if(!Ut(t[n+r],t[n+e+r])){i=!1;break}if(i){for(let i=0;e>i;i++)t[n+i]=t[n+e+i];return t.length=n+e,{start:n,length:e}}}}function Ht(t,e){const n=e.start+e.length,i=Vt(t,e);i&&t.splice(n+i===t.length?n:e.start,i)}function Gt(t,e){let n=e.start;for(;n>0&&Ut(t[n-1],t[n-1+e.length]);)n--;return e.start-n}function Vt(t,e){const n=e.start+e.length;let i=n;for(;t.length>i&&Ut(t[i],t[i-e.length]);)i++;return i-n}function Qt(t,e){const n=e[0];let i=t.length-(n?Gt(t,n):0);for(const n of e)i-=Vt(t,n);return i}function Zt(t,e,n){for(let i=0;t.length>i;i++){const r=t[(e+i)%t.length],o=t[(n+i)%t.length];if(r!==o)return o>r}return!1}const Jt=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;const Yt=["fatal","error","warning","log","info","debug"];function Kt(t,e=40){const n=Object.keys(t);if(n.sort(),!n.length)return"[object has no keys]";let i="";for(const t of n){const n=i?`${i}, ${t}`:t;if(n.length>e)break;i=n}return i}const Xt="NativeGzipValidationError";let te;const ee=t=>{throw function(t,e){const n=new Error(e);try{Object.defineProperty(n,"name",{value:t,writable:!0,enumerable:!0,configurable:!0})}catch(t){}return n}(Xt,`Native gzip produced invalid output: ${t}`)};let ne=0,ie=!1;const re=function(){var t=A(function*(t,e){18>t.size&&ee("too-short");const n=new Uint8Array(yield t.slice(0,10).arrayBuffer());var i;(2>(i=n).length||31!==i[0]||139!==i[1]||8!==n[2])&&ee("invalid-header");const r=new DataView(yield t.slice(t.size-8).arrayBuffer()),o=e.length>>>0;r.getUint32(4,!0)!==o&&ee("invalid-size"),(ie||3>ne)&&(r.getUint32(0,!0)!==(t=>{const e=(()=>{if(te)return te;te=[];for(let t=0;256>t;t++){let e=t;for(let t=0;8>t;t++)e=1&e?3988292384^e>>>1:e>>>1;te[t]=e>>>0}return te})();let n=4294967295;for(let i=0;t.length>i;i++)n=e[255&(n^t[i])]^n>>>8;return(4294967295^n)>>>0})(e)&&(ie=!0,ee("invalid-crc")),ne++)});return function(e,n){return t.apply(this,arguments)}}();function oe(t){return se.apply(this,arguments)}function se(){return se=A(function*(t,e=!0,n){try{const e=(new TextEncoder).encode(t),n=new globalThis.CompressionStream("gzip"),r=n.writable.getWriter(),o=r.write(e).then(()=>r.close()).catch((i=A(function*(t){try{yield r.abort(t)}catch(t){}throw t}),function(t){return i.apply(this,arguments)})),s=new Response(n.readable).blob(),[a]=yield Promise.all([s,o]);return yield re(a,e),a}catch(t){if(null==n?void 0:n.rethrow)throw t;return e&&console.error("Failed to gzip compress data",t),null}var i}),se.apply(this,arguments)}function ae(t,e){if(!t)return;const n=t.find(t=>t.type===e);return null==n?void 0:n.value}const le="0.14.1",ue={DEBUG:!1,LIB_VERSION:le,LIB_NAME:"browser-common",JS_SDK_VERSION:le},ce=(t,{debugEnabled:e}={})=>{const n={N(n,...i){let r;try{r=typeof window>"u"?void 0:window}catch(t){return}r&&(ue.DEBUG||r.POSTHOG_DEBUG||e)&&!G(r.console)&&r.console&&("__rrweb_original__"in r.console[n]?r.console[n].__rrweb_original__:r.console[n])(t,...i)},debug(...t){n.N("debug",...t)},info(...t){n.N("log",...t)},warn(...t){n.N("warn",...t)},error(...t){n.N("error",...t)},critical(...e){console.error(t,...e)},uninitializedWarning(t){n.error(`You must initialize PostHog before calling ${t}`)},createLogger:(e,n)=>ce(`${t} ${e}`,n)};return n},de=ce("[PostHog.js]"),he=(t,e)=>de.createLogger(t,e);function fe(t,e){if(!J(t))if(U(t))t.forEach(e);else if(X(t))t.forEach((t,n)=>e(t,n));else for(const n in t)B.call(t,n)&&e(t[n],n)}const ve=function(t,...e){for(const n of e)for(const e in n)void 0!==n[e]&&(t[e]=n[e]);return t};function pe(t){const e=Object.keys(t);let n=e.length;const i=new Array(n);for(;n--;)i[n]=[e[n],t[e[n]]];return i}function me(t,e,n,i){const{capture:r=!1,passive:o=!0}=null!=i?i:{};null==t||t.addEventListener(e,n,{capture:r,passive:o})}const ge=t=>{const e=typeof document>"u"?void 0:document,n=null==e?void 0:e.createElement("a");return G(n)?null:(n.href=t,n)},ye=["localhost","127.0.0.1"],be=(t,e)=>{try{let n;return JSON.stringify(t,(t,e)=>{var i;return nt(e)?(null!==(i=n)&&void 0!==i||(n=new WeakMap),n.has(e)||n.set(e,function(t){const e=L({},t);for(const n of["name","message","stack","cause","errors"])try{n in t&&(e[n]=t[n])}catch(t){}return e}(e)),n.get(e)):"bigint"==typeof e?e.toString():e},e)}catch(e){return function(t){var e;const n=[];return null!==(e=JSON.stringify(t,function(t,e){if("bigint"==typeof e)return e.toString();if("function"!=typeof e&&"symbol"!=typeof e){if(e instanceof Error)return{name:e.name,message:e.message,stack:e.stack};if(e&&"object"==typeof e){for(;n.length>0&&n[n.length-1]!==this;)n.pop();if(n.includes(e))return"[Circular]";n.push(e)}return e}}))&&void 0!==e?e:"null"}(t)}},we=function(t,e="&"){let n,i;const r=[];return fe(t,function(t,e){G(t)||G(e)||"undefined"===e||(n=encodeURIComponent((t=>t instanceof File)(t)?t.name:t.toString()),i=encodeURIComponent(e),r[r.length]=i+"="+n)}),r.join(e)};function ke(t){var e;const n=typeof window>"u"?void 0:window,i=null==n||null===(e=n.location)||void 0===e?void 0:e.href;return G(i)?void 0:function(t,e){var n;const i=null==t||null===(n=t.config)||void 0===n?void 0:n.get_current_url;if(!W(i))return e;try{const t=i(e);return V(t)&&t?t:e}catch(t){return de.error("Error in get_current_url, falling back to window.location.href",t),e}}(t,i)}function Se(t){return!!t&&1===t.nodeType}function _e(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function xe(t){return!!t&&11===t.nodeType&&Se(t.host)}function Ce(t){return t?q(t).split(/\s+/):[]}function Me(t){let e="";switch(typeof t.className){case"string":e=t.className;break;case"object":e=(t.className&&"baseVal"in t.className?t.className.baseVal:null)||t.getAttribute("class")||"";break;default:e=""}return Ce(e)}function Te(t){let e="";return Pe(t)&&!Ne(t)&&t.childNodes&&t.childNodes.length&&fe(t.childNodes,function(t){var n;(function(t){return!!t&&3===t.nodeType})(t)&&t.textContent&&(e+=null!==(n=function(t){return J(t)?null:q(t).split(/(\s+)/).filter(t=>Ge(t)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}(t.textContent))&&void 0!==n?n:"")}),q(e)}function Ie(t){var e;return G(t.target)?t.srcElement||null:(null===(e=t.target)||void 0===e?void 0:e.shadowRoot)?t.composedPath()[0]||null:t.target||null}const Ae=["a","button","form","input","select","textarea","label"];function Re(t,e){const n=t.matches||t.matchesSelector||t.msMatchesSelector||t.mozMatchesSelector||t.webkitMatchesSelector||t.oMatchesSelector;try{return!!n&&n.call(t,e)}catch(t){return!1}}const Ee=[".ph-no-deadclick",".ph-no-capture"];const Oe=["","text","search","email","password","url","tel","number"];function $e(t){return!(!t||!Se(t))&&(!!_e(t,"textarea")||(_e(t,"input")?N(Oe,(t.getAttribute("type")||"").toLowerCase()):function(t){var e;if(t.isContentEditable)return!0;const n=null===(e=t.getAttribute)||void 0===e?void 0:e.call(t,"contenteditable");return"true"===n||""===n}(t)))}const Le=t=>!t||_e(t,"html")||!Se(t),De=(t,e)=>{const n=typeof window>"u"?void 0:window;if(!n||Le(t))return{parentIsUsefulElement:!1,targetElementList:[],isComplete:!1};let i=!1;const r=[t];let o=t;const s=new Set([t]);for(;!_e(o,"body");){const t=o.assignedSlot||o.parentNode,a=xe(t)?t.host:t&&Se(t)?t:null;if(!a)break;if(s.has(a)||s.size>=1e3)return{parentIsUsefulElement:i,targetElementList:r,isComplete:!1};if(s.add(a),xe(t))r.push(a),o=a;else{if(e||Ae.indexOf(a.tagName.toLowerCase())>-1)i=!0;else try{const t=n.getComputedStyle(a);t&&"pointer"===t.getPropertyValue("cursor")&&(i=!0)}catch(t){}r.push(a),o=a}}return{parentIsUsefulElement:i,targetElementList:r,isComplete:!0}};function Fe(t){const e=new Set;let n=0,i=t;for(;i;){if(n++>=1e3||e.has(i))return!0;e.add(i);const t=Me(i);if(N(t,"ph-sensitive")||N(t,"ph-no-capture"))return!0;const r=i.assignedSlot||i.parentNode;i=xe(r)?r.host:r&&Se(r)?r:null}return!1}function Pe(t){if(Fe(t))return!1;if(N(Me(t),"ph-include"))return!0;const e=t.type||"";if(V(e))switch(e.toLowerCase()){case"hidden":case"password":return!1}const n=t.name||t.id||"";return!V(n)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(n.replace(/[^a-zA-Z0-9]/g,""))}function Ne(t){return!!(_e(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||_e(t,"select")||_e(t,"textarea")||"true"===t.getAttribute("contenteditable"))}const qe=new RegExp("^(?:(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11}))$"),je=/(^|[^0-9A-Za-z_])([0-9][0-9 -]*[0-9])(?=$|[^0-9A-Za-z_])/g,Be=[16,15,14,13],ze=new RegExp("^(\\d{3}-?\\d{2}-?\\d{4})$"),Ue=new RegExp("(^|[^0-9])((?!000|666)[0-9]{3}-?(?!00)[0-9]{2}-?(?!0000)[0-9]{4})(?=$|([^0-9]))","g"),We=/[0-9A-Za-z_]/;function He(t){let e=0,n=!1;for(let i=t.length-1;i>=0;i--){let r=t.charCodeAt(i)-48;n&&(r*=2,r>9&&(r-=9)),e+=r,n=!n}return e%10==0}function Ge(t,e=!0){if(J(t))return!1;if(V(t)){if(t=q(t),e?qe.test((t||"").replace(/[- ]/g,"")):function(t){let e;for(je.lastIndex=0;e=je.exec(t);){const t=e[2];if(!t)continue;const n=t.replace(/[- ]/g,"");for(let t=0;n.length>t;t++)for(const e of Be){const i=t+e;if(n.length>=i){const e=n.slice(t,i);if(qe.test(e)&&He(e))return!0}}}return!1}(t))return!1;if(e?ze.test(t):function(t){let e;for(Ue.lastIndex=0;e=Ue.exec(t);){const t=e[1],n=e[3];if(!(t&&n&&We.test(t)&&We.test(n)))return!0}return!1}(t))return!1}return!0}function Ve(t){let e=Te(t);return e=`${e} ${Qe(t)}`.trim(),Ge(e)?e:""}function Qe(t){let e="";return t&&t.childNodes&&t.childNodes.length&&fe(t.childNodes,function(t){var n;if(t&&"span"===(null===(n=t.tagName)||void 0===n?void 0:n.toLowerCase()))try{const n=Te(t);e=`${e} ${n}`.trim(),t.childNodes&&t.childNodes.length&&(e=`${e} ${Qe(t)}`.trim())}catch(t){de.error("[AutoCapture]",t)}}),e}function Ze(t){return t.replace(/"|\\"/g,'\\"')}function Je(t){const e=t.attr__class;if(e)return U(e)?e:Ce(e)}const Ye=1e6;function Ke(t){var e;return Math.min(Ye,null!==(e=t.payloadSizeLimitBytes)&&void 0!==e?e:Ye)}const Xe={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:t=>t,recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:Ye,payloadHostDenyList:[".lr-ingest.io",".ingest.sentry.io",".clarity.ms","google-analytics.com","analytics.google.com","nr-data.net","datadoghq.com","datadoghq.eu","ddog-gov.com","segment.io","rudderstack.com","amplitude.com","mixpanel.com","hotjar.com","hotjar.io","fullstory.com"],streamNetworkBody:!1},tn=["authorization","x-forwarded-for","authorization","cookie","set-cookie","x-api-key","x-real-ip","remote-addr","forwarded","proxy-authorization","x-csrf-token","x-csrftoken","x-xsrf-token"],en=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],nn=["auth","token","secret","session","api-key","apikey","api_key","credential","password","passwd","cookie","csrf","xsrf"],rn=t=>{J(t)||fe(Object.keys(t),e=>{(t=>{const e=t.toLowerCase();return tn.includes(e)||nn.some(t=>e.includes(t))})(e)&&(t[e]="redacted")})},on=["/s/","/e/","/i/"];function sn(t,e,n,i){if(J(t))return t;let r=(null==e?void 0:e["content-length"])||function(t){return new Blob([t]).size}(t);return V(r)&&(r=parseInt(r)),r>n?`[SessionRecording] ${i} body too large to record (${r} bytes)`:t}function an(t,e){if(J(t))return t;let n=t;return Ge(n,!1)||(n="[SessionRecording] "+e+" body redacted"),fe(en,t=>{(null==n?void 0:n.length)&&-1!==(null==n?void 0:n.indexOf(t))&&(n="[SessionRecording] "+e+" body redacted as might contain: "+t)}),n}const ln=new WeakSet,un="disabled",cn="sampled",dn="active",hn="buffering",fn="paused",vn="rrweb_error",pn="trigger_activated",mn="trigger_pending",gn="trigger_disabled";function yn(t,e,n,i,r,o){return 0===e?gn:(null==t?void 0:t.get_property(n?i+n:r))===o?pn:mn}function bn(t,e,n){return e.some(e=>{var i;return"regex"===e.matching&&(null!==(i=null==n?void 0:n.get(e.url))&&void 0!==i?i:new RegExp(e.url)).test(t)})}function wn(t){return t.includes("trigger_activated")?pn:t.includes("trigger_pending")?mn:gn}function kn(t){const e=new Set(t);switch(e.delete(gn),e.size){case 0:return gn;case 1:return Array.from(e)[0];default:return mn}}var Sn=class{constructor(t){this.j=t}triggerStatus(t){return wn(this.j.map(e=>e.triggerStatus(t)))}triggerStatusNoSideEffects(t){return wn(this.j.map(e=>e.triggerStatusNoSideEffects(t)))}stop(){this.j.forEach(t=>t.stop())}},_n=class{constructor(t){this.j=t}triggerStatus(t){return kn(this.j.map(e=>e.triggerStatus(t)))}triggerStatusNoSideEffects(t){return kn(this.j.map(e=>e.triggerStatusNoSideEffects(t)))}stop(){this.j.forEach(t=>t.stop())}},xn=class{triggerStatus(){return this.triggerStatusNoSideEffects()}triggerStatusNoSideEffects(){return pn}stop(){}};const Cn=t=>"sessionRecording"in t;var Mn=class{constructor(t,e){this._instance=t,this.B=[],this.U=[],this.W=new Map,this.H=new Map,this.G="",this.urlBlocked=!1,this.V=e}onConfig(t){var e,n;this.B=(Cn(t)?H(t.sessionRecording)?null===(e=t.sessionRecording)||void 0===e?void 0:e.urlTriggers:[]:null==t?void 0:t.urlTriggers)||[],this.U=(Cn(t)?H(t.sessionRecording)?null===(n=t.sessionRecording)||void 0===n?void 0:n.urlBlocklist:[]:null==t?void 0:t.urlBlocklist)||[],this.Z()}Z(){this.W.clear(),this.H.clear();for(const t of this.B)if("regex"===t.matching&&!this.W.has(t.url))try{this.W.set(t.url,new RegExp(t.url))}catch(e){de.error("Invalid URL trigger regex pattern:",t.url,e)}for(const t of this.U)if("regex"===t.matching&&!this.H.has(t.url))try{this.H.set(t.url,new RegExp(t.url))}catch(e){de.error("Invalid URL blocklist regex pattern:",t.url,e)}}onRemoteConfig(t){this.onConfig(t)}J(t){return yn(this._instance,this.B.length,this.V,m,f,t)}triggerStatus(t){const e=this.triggerStatusNoSideEffects(t);return this._instance.register_for_session({[x]:e}),e}triggerStatusNoSideEffects(t){return this.J(t)}isCurrentUrlBlocked(){const t=ke(this._instance);if(!t)return!1;try{return bn(t,this.U,this.H)}catch(t){return!0}}checkUrlBlocklist(t,e){const n=ke(this._instance);if(!n)return;if(n===this.G)return;this.G=n;const i=this.urlBlocked,r=bn(n,this.U,this.H);i&&r||(r&&!i?t():!r&&i&&e())}checkUrlTriggerConditions(t,e,n,i){const r=ke(this._instance);if(!r)return;if(r===this.G)return;this.G=r;const o=this.urlBlocked,s=bn(r,this.U,this.H);s&&!o?t():!s&&o&&e();const a=this.J(i)===pn,l=bn(r,this.B,this.W);!a&&l&&n("url",r)}stop(){this.G=""}},Tn=class{constructor(t){this._instance=t,this.linkedFlag=null,this.linkedFlagSeen=!1,this.Y=()=>{}}triggerStatus(){const t=this.triggerStatusNoSideEffects();return this._instance.register_for_session({[b]:t}),t}triggerStatusNoSideEffects(){let t=mn;return J(this.linkedFlag)&&(t=gn),this.linkedFlagSeen&&(t=pn),t}onConfig(t,e){var n;if(this.linkedFlag=(Cn(t)?H(t.sessionRecording)?null===(n=t.sessionRecording)||void 0===n?void 0:n.linkedFlag:null:null==t?void 0:t.linkedFlag)||null,!J(this.linkedFlag)&&!this.linkedFlagSeen){const t=V(this.linkedFlag)?this.linkedFlag:this.linkedFlag.flag,n=V(this.linkedFlag)?null:this.linkedFlag.variant;this.Y=this._instance.onFeatureFlags((i,r)=>{let o=!1;if(H(r)&&t in r){const e=r[t];o=K(e)?!0===e:n?e===n:!!e}const s=o&&!this.linkedFlagSeen;this.linkedFlagSeen=o,s&&e(t,n)})}}onRemoteConfig(t,e){this.onConfig(t,e)}stop(){this.Y()}},In=class{constructor(t,e){this._instance=t,this.K=[],this.V=e}onConfig(t){var e;this.K=(Cn(t)?H(t.sessionRecording)?null===(e=t.sessionRecording)||void 0===e?void 0:e.eventTriggers:[]:null==t?void 0:t.eventTriggers)||[]}onRemoteConfig(t){this.onConfig(t)}X(t){return yn(this._instance,this.K.length,this.V,p,v,t)}triggerStatus(t){const e=this.triggerStatusNoSideEffects(t);return this._instance.register_for_session({[y]:e}),e}triggerStatusNoSideEffects(t){return this.X(t)}checkEventTriggerConditions(t,e,n){if(0===this.K.length)return;const i=this.X(n)===pn,r=this.K.includes(t);!i&&r&&e("event",t)}stop(){}},An=class{constructor(t,e,n){if(this._instance=t,this.group=e,this.tt=new Mn(t,e.id),this.et=new In(t,e.id),this.nt=new Tn(t),e.conditions.events&&e.conditions.events.length>0||e.conditions.urls&&e.conditions.urls.length>0||e.conditions.flag){const t=(e.conditions.events||[]).map(t=>t.name),i={urlTriggers:e.conditions.urls||[],eventTriggers:t,linkedFlag:e.conditions.flag||null,urlBlocklist:[]};this.tt.onConfig(i),this.et.onConfig(i),this.nt.onConfig(i,n);const r=[this.et,this.tt,this.nt];this.it="any"===e.conditions.matchType?new Sn(r):new _n(r)}else this.it=new xn}triggerStatus(t){return this.it.triggerStatus(t)}triggerStatusNoSideEffects(t){return this.it.triggerStatusNoSideEffects(t)}getPendingTriggerConditions(t){return"trigger_pending"!==this.triggerStatusNoSideEffects(t)?[]:[{label:"URL condition not matched",status:this.tt.triggerStatusNoSideEffects(t)},{label:"event condition not matched",status:this.et.triggerStatusNoSideEffects(t)},{label:"linked flag condition not matched",status:this.nt.triggerStatusNoSideEffects()}].filter(({status:t})=>t===mn).map(({label:t})=>t)}checkEventTriggerConditions(t,e,n){this.et.checkEventTriggerConditions(t,e,n)}checkUrlTriggerConditions(t,e,n,i){this.tt.checkUrlTriggerConditions(t,e,n,i)}activateTrigger(t,e){var n;const i="url"===t?m+this.group.id:p+this.group.id;null===(n=this._instance.persistence)||void 0===n||n.register({[i]:e})}stop(){this.tt.stop(),this.et.stop(),this.nt.stop()}};function Rn(t){if(t.rrwebError)return vn;if(!t.receivedFlags)return hn;if(!t.isRecordingEnabled)return un;if(t.urlTriggerMatching.urlBlocked)return fn;const e=!0===t.isSampled,n=new Sn([t.eventTriggerMatching,t.urlTriggerMatching,t.linkedFlagMatching]).triggerStatus(t.sessionId);return e?cn:"trigger_activated"===n?dn:"trigger_pending"===n?hn:!1===t.isSampled?un:dn}function En(t){if(t.rrwebError)return vn;if(!t.receivedFlags)return hn;if(!t.isRecordingEnabled)return un;if(t.urlTriggerMatching.urlBlocked)return fn;const e=new _n([t.eventTriggerMatching,t.urlTriggerMatching,t.linkedFlagMatching]).triggerStatus(t.sessionId),n=e!==gn,i=K(t.isSampled);return n&&"trigger_pending"===e?hn:n&&"trigger_disabled"===e||i&&!t.isSampled?un:!0===t.isSampled?cn:dn}function On(){const t=[];return function(e,n){if(H(n)||U(n)){for(;t.length>0&&t[t.length-1]!==this;)t.pop();return t.includes(n)?"[Circular]":(t.push(n),n)}return n}}function $n(t){try{const e=JSON.stringify(t,On());return e?new Blob([e]).size:0}catch(t){return-1}}function Ln(t){if(Z(t))return 4;if(G(t))return 0;switch(typeof t){case"string":return t.length+2;case"number":return String(t).length;case"boolean":return t?4:5;case"object":{if(U(t)){let e=2;for(let n=0;t.length>n;n++){n>0&&(e+=1);const i=t[n];e+=G(i)||Z(i)?4:Ln(i)}return e}const e=t;let n=2,i=!0;for(const t in e){if(!{}.hasOwnProperty.call(e,t))continue;const r=e[t];G(r)||(i||(n+=1),i=!1,n+=t.length+3+Ln(r))}return n}default:return 0}}function Dn(t,e=6606028.8){if(t.size>=e&&t.data.length>1){const e=Math.floor(t.data.length/2),n=t.sizes.slice(0,e),i=t.sizes.slice(e);return[Dn({size:n.reduce((t,e)=>t+e,0),data:t.data.slice(0,e),sizes:n,sessionId:t.sessionId,windowId:t.windowId}),Dn({size:i.reduce((t,e)=>t+e,0),data:t.data.slice(e),sizes:i,sessionId:t.sessionId,windowId:t.windowId})].flatMap(t=>t)}return[t]}var Fn=Uint8Array,Pn=Uint16Array,Nn=Uint32Array,qn=new Fn([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),jn=new Fn([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Bn=new Fn([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),zn=function(t,e){for(var n=new Pn(31),i=0;31>i;++i)n[i]=e+=1<<t[i-1];var r=new Nn(n[30]);for(i=1;30>i;++i)for(var o=n[i];n[i+1]>o;++o)r[o]=o-n[i]<<5|i;return[n,r]},Un=zn(qn,2),Wn=Un[1];Un[0][28]=258,Wn[258]=28;for(var Hn=zn(jn,0)[1],Gn=new Pn(32768),Vn=0;32768>Vn;++Vn){var Qn=(43690&Vn)>>>1|(21845&Vn)<<1;Gn[Vn]=((65280&(Qn=(61680&(Qn=(52428&Qn)>>>2|(13107&Qn)<<2))>>>4|(3855&Qn)<<4))>>>8|(255&Qn)<<8)>>>1}var Zn=function(t,e,n){for(var i=t.length,r=0,o=new Pn(e);i>r;++r)++o[t[r]-1];var s,a=new Pn(e);for(r=0;e>r;++r)a[r]=a[r-1]+o[r-1]<<1;if(n){s=new Pn(1<<e);var l=15-e;for(r=0;i>r;++r)if(t[r])for(var u=r<<4|t[r],c=e-t[r],d=a[t[r]-1]++<<c,h=d|(1<<c)-1;h>=d;++d)s[Gn[d]>>>l]=u}else for(s=new Pn(i),r=0;i>r;++r)s[r]=Gn[a[t[r]-1]++]>>>15-t[r];return s},Jn=new Fn(288);for(Vn=0;144>Vn;++Vn)Jn[Vn]=8;for(Vn=144;256>Vn;++Vn)Jn[Vn]=9;for(Vn=256;280>Vn;++Vn)Jn[Vn]=7;for(Vn=280;288>Vn;++Vn)Jn[Vn]=8;var Yn=new Fn(32);for(Vn=0;32>Vn;++Vn)Yn[Vn]=5;var Kn=Zn(Jn,9,0),Xn=Zn(Yn,5,0),ti=function(t){return(t/8|0)+(7&t&&1)},ei=function(t,e,n){(null==e||0>e)&&(e=0),(null==n||n>t.length)&&(n=t.length);var i=new(t instanceof Pn?Pn:t instanceof Nn?Nn:Fn)(n-e);return i.set(t.subarray(e,n)),i},ni=function(t,e,n){var i=e/8|0;t[i]|=n<<=7&e,t[i+1]|=n>>>8},ii=function(t,e,n){var i=e/8|0;t[i]|=n<<=7&e,t[i+1]|=n>>>8,t[i+2]|=n>>>16},ri=function(t,e){for(var n=[],i=0;t.length>i;++i)t[i]&&n.push({s:i,f:t[i]});var r=n.length,o=n.slice();if(!r)return[new Fn(0),0];if(1==r){var s=new Fn(n[0].s+1);return s[n[0].s]=1,[s,1]}n.sort(function(t,e){return t.f-e.f}),n.push({s:-1,f:25001});var a=n[0],l=n[1],u=0,c=1,d=2;for(n[0]={s:-1,f:a.f+l.f,l:a,r:l};c!=r-1;)a=n[n[d].f>n[u].f?u++:d++],l=n[u!=c&&n[d].f>n[u].f?u++:d++],n[c++]={s:-1,f:a.f+l.f,l:a,r:l};var h=o[0].s;for(i=1;r>i;++i)o[i].s>h&&(h=o[i].s);var f=new Pn(h+1),v=oi(n[c-1],f,0);if(v>e){i=0;var p=0,m=v-e,g=1<<m;for(o.sort(function(t,e){return f[e.s]-f[t.s]||t.f-e.f});r>i;++i){var y=o[i].s;if(e>=f[y])break;p+=g-(1<<v-f[y]),f[y]=e}for(p>>>=m;p>0;){var b=o[i].s;e>f[b]?p-=1<<e-f[b]++-1:++i}for(;i>=0&&p;--i){var w=o[i].s;f[w]==e&&(--f[w],++p)}v=e}return[new Fn(f),v]},oi=function(t,e,n){return-1==t.s?Math.max(oi(t.l,e,n+1),oi(t.r,e,n+1)):e[t.s]=n},si=function(t){for(var e=t.length;e&&!t[--e];);for(var n=new Pn(++e),i=0,r=t[0],o=1,s=function(t){n[i++]=t},a=1;e>=a;++a)if(t[a]==r&&a!=e)++o;else{if(!r&&o>2){for(;o>138;o-=138)s(32754);o>2&&(s(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(s(r),--o;o>6;o-=6)s(8304);o>2&&(s(o-3<<5|8208),o=0)}for(;o--;)s(r);o=1,r=t[a]}return[n.subarray(0,i),e]},ai=function(t,e){for(var n=0,i=0;e.length>i;++i)n+=t[i]*e[i];return n},li=function(t,e,n){var i=n.length,r=ti(e+2);t[r]=255&i,t[r+1]=i>>>8,t[r+2]=255^t[r],t[r+3]=255^t[r+1];for(var o=0;i>o;++o)t[r+o+4]=n[o];return 8*(r+4+i)},ui=function(t,e,n,i,r,o,s,a,l,u,c){ni(e,c++,n),++r[256];for(var d=ri(r,15),h=d[0],f=d[1],v=ri(o,15),p=v[0],m=v[1],g=si(h),y=g[0],b=g[1],w=si(p),k=w[0],S=w[1],_=new Pn(19),x=0;y.length>x;++x)_[31&y[x]]++;for(x=0;k.length>x;++x)_[31&k[x]]++;for(var C=ri(_,7),M=C[0],T=C[1],I=19;I>4&&!M[Bn[I-1]];--I);var A,R,E,O,L=u+5<<3,D=ai(r,Jn)+ai(o,Yn)+s,F=ai(r,h)+ai(o,p)+s+14+3*I+ai(_,M)+(2*_[16]+3*_[17]+7*_[18]);if(D>=L&&F>=L)return li(e,c,t.subarray(l,l+u));if(ni(e,c,1+(D>F)),c+=2,D>F){A=Zn(h,f,0),R=h,E=Zn(p,m,0),O=p;var P=Zn(M,T,0);for(ni(e,c,b-257),ni(e,c+5,S-1),ni(e,c+10,I-4),c+=14,x=0;I>x;++x)ni(e,c+3*x,M[Bn[x]]);c+=3*I;for(var N=[y,k],q=0;2>q;++q){var j=N[q];for(x=0;j.length>x;++x)ni(e,c,P[B=31&j[x]]),c+=M[B],B>15&&(ni(e,c,j[x]>>>5&127),c+=j[x]>>>12)}}else A=Kn,R=Jn,E=Xn,O=Yn;for(x=0;a>x;++x)if(i[x]>255){var B;ii(e,c,A[257+(B=i[x]>>>18&31)]),c+=R[B+257],B>7&&(ni(e,c,i[x]>>>23&31),c+=qn[B]);var z=31&i[x];ii(e,c,E[z]),c+=O[z],z>3&&(ii(e,c,i[x]>>>5&8191),c+=jn[z])}else ii(e,c,A[i[x]]),c+=R[i[x]];return ii(e,c,A[256]),c+R[256]},ci=new Nn([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),di=new Fn(0),hi=function(){for(var t=new Nn(256),e=0;256>e;++e){for(var n=e,i=9;--i;)n=(1&n&&3988292384)^n>>>1;t[e]=n}return t}(),fi=function(t,e,n){for(;n;++e)t[e]=n,n>>>=8};function vi(t,e){void 0===e&&(e={});var n=function(){var t=4294967295;return{p(e){for(var n=t,i=0;e.length>i;++i)n=hi[255&n^e[i]]^n>>>8;t=n},d(){return 4294967295^t}}}(),i=t.length;n.p(t);var r,o,s,a,l,u=(r=t,o=e,s=function(t){return 10+(t.filename&&t.filename.length+1||0)}(e),a=8,function(t,e,n,i,r,o){var s=t.length,a=new Fn(i+s+5*(1+Math.floor(s/7e3))+r),l=a.subarray(i,a.length-r),u=0;if(!e||8>s)for(var c=0;s>=c;c+=65535){var d=c+65535;s>d?u=li(l,u,t.subarray(c,d)):(l[c]=o,u=li(l,u,t.subarray(c,s)))}else{for(var h=ci[e-1],f=h>>>13,v=8191&h,p=(1<<n)-1,m=new Pn(32768),g=new Pn(p+1),y=Math.ceil(n/3),b=2*y,w=function(e){return(t[e]^t[e+1]<<y^t[e+2]<<b)&p},k=new Nn(25e3),S=new Pn(288),_=new Pn(32),x=0,C=0,M=(c=0,0),T=0,I=0;s>c;++c){var A=w(c),R=32767&c,E=g[A];if(m[R]=E,g[A]=R,c>=T){var O=s-c;if((x>7e3||M>24576)&&O>423){u=ui(t,l,0,k,S,_,C,M,I,c-I,u),M=x=C=0,I=c;for(var L=0;286>L;++L)S[L]=0;for(L=0;30>L;++L)_[L]=0}var D=2,F=0,P=v,N=R-E&32767;if(O>2&&A==w(c-N))for(var q=Math.min(f,O)-1,j=Math.min(32767,c),B=Math.min(258,O);j>=N&&--P&&R!=E;){if(t[c+D]==t[c+D-N]){for(var z=0;B>z&&t[c+z]==t[c+z-N];++z);if(z>D){if(D=z,F=N,z>q)break;var U=Math.min(N,z-2),W=0;for(L=0;U>L;++L){var H=c-N+L+32768&32767,G=H-m[H]+32768&32767;G>W&&(W=G,E=H)}}}N+=(R=E)-(E=m[R])+32768&32767}if(F){k[M++]=268435456|Wn[D]<<18|Hn[F];var V=31&Wn[D],Q=31&Hn[F];C+=qn[V]+jn[Q],++S[257+V],++_[Q],T=c+D,++x}else k[M++]=t[c],++S[t[c]]}}u=ui(t,l,o,k,S,_,C,M,I,c-I,u),o||(u=li(l,u,di))}return ei(a,0,i+ti(u)+r)}(r,null==o.level?6:o.level,null==o.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(r.length)))):12+o.mem,s,a,!l)),c=u.length;return function(t,e){var n=e.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=2>e.level?4:9==e.level?2:0,t[9]=3,0!=e.mtime&&fi(t,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),n){t[3]=8;for(var i=0;n.length>=i;++i)t[i+10]=n.charCodeAt(i)}}(u,e),fi(u,c-8,n.d()),fi(u,c-4,i),u}function pi(t,e){var n="";if(!e&&"undefined"!=typeof TextDecoder)return(new TextDecoder).decode(t);for(var i=0;t.length>i;){var r=t[i++];128>r||e?n+=String.fromCharCode(r):224>r?n+=String.fromCharCode((31&r)<<6|63&t[i++]):240>r?n+=String.fromCharCode((15&r)<<12|(63&t[i++])<<6|63&t[i++]):(r=((15&r)<<18|(63&t[i++])<<12|(63&t[i++])<<6|63&t[i++])-65536,n+=String.fromCharCode(55296|r>>10,56320|1023&r))}return n}var mi=class{constructor(t,e={}){var n,i,r,o;this._rrweb=t,this.rt=e,this.ot={},this.st=Date.now(),this.ut=-1/0,this.ct=()=>{const t=Date.now(),e=t-this.st;e>0?(this.dt=Math.min(this.ht,this.dt+e/1e3*this.ft),this.st=t):this.st=t},this.vt=t=>{if(!this.ot[t]){var e,n;this.ot[t]=!0;const i=this.yt(t);null===(e=(n=this.rt).onBlockedNode)||void 0===e||e.call(n,t,i)}},this.bt=t=>{const e=this.yt(t);if("svg"!==(null==e?void 0:e.nodeName)&&e instanceof Element){const t=e.closest("svg");if(t)return[this._rrweb.mirror.getId(t),t]}return[t,e]},this.yt=t=>this._rrweb.mirror.getNode(t),this.wt=t=>{var e,n,i,r,o,s,a,l;return(null!==(e=null===(n=t.removes)||void 0===n?void 0:n.length)&&void 0!==e?e:0)+(null!==(i=null===(r=t.attributes)||void 0===r?void 0:r.length)&&void 0!==i?i:0)+(null!==(o=null===(s=t.texts)||void 0===s?void 0:s.length)&&void 0!==o?o:0)+(null!==(a=null===(l=t.adds)||void 0===l?void 0:l.length)&&void 0!==a?a:0)},this.throttleMutations=t=>{if(3!==t.type||0!==t.data.source)return t;const e=t.data,n=this.wt(e);if(e.attributes){const t=e.attributes.length;e.attributes=e.attributes.filter(t=>{const[e]=this.bt(t.id);return!this.kt.consumeRateLimit(e)&&t});const n=t-e.attributes.length;var i,r;n>0&&(null===(i=(r=this.rt).onDroppedAttributeMutations)||void 0===i||i.call(r,n))}const o=this.wt(e);if(0===o&&n!==o)return;if(this.St)return t;this.ct();const s=Ln(t);var a,l;return s>this.dt?(null===(a=(l=this.rt).onDroppedOversizedMutation)||void 0===a||a.call(l,s),void this._t()):(this.dt-=s,t)},this._t=()=>{if(this.xt)return;const t=Math.max(0,this.Ct-(Date.now()-this.ut));this.xt=setTimeout(()=>{var t,e;this.xt=void 0,this.ut=Date.now(),null===(t=(e=this.rt).requestFullSnapshot)||void 0===t||t.call(e)},t)},this.kt=new st({bucketSize:null!==(n=this.rt.bucketSize)&&void 0!==n?n:100,refillRate:null!==(i=this.rt.refillRate)&&void 0!==i?i:10,refillInterval:1e3,I:this.vt,R:de}),this.ht=null!==(r=this.rt.bytesBucketSize)&&void 0!==r?r:0,this.ft=null!==(o=this.rt.bytesRefillRate)&&void 0!==o?o:25600,this.St=!Number.isFinite(this.ht)||0>=this.ht,this.dt=this.ht;const s=this.rt.resyncIntervalMs;this.Ct=Y(s)&&Number.isFinite(s)&&s>0?s:3e5}reset(){this.ot={},this.xt&&(clearTimeout(this.xt),this.xt=void 0),this.ut=Date.now()}stop(){this.kt.stop(),this.reset(),this.dt=this.ht,this.st=Date.now(),this.ut=-1/0}},gi=class t{constructor(t){if(this.bytes=t,16!==t.length)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,n,i,r){if(!Number.isInteger(e)||!Number.isInteger(n)||!Number.isInteger(i)||!Number.isInteger(r)||0>e||0>n||0>i||0>r||e>0xffffffffffff||n>4095||i>1073741823||r>4294967295)throw new RangeError("invalid field value");const o=new Uint8Array(16);return o[0]=e/Math.pow(2,40),o[1]=e/Math.pow(2,32),o[2]=e/Math.pow(2,24),o[3]=e/Math.pow(2,16),o[4]=e/256,o[5]=e,o[6]=112|n>>>8,o[7]=n,o[8]=128|i>>>24,o[9]=i>>>16,o[10]=i>>>8,o[11]=i,o[12]=r>>>24,o[13]=r>>>16,o[14]=r>>>8,o[15]=r,new t(o)}toString(){let t="";for(let e=0;this.bytes.length>e;e++)t=t+(this.bytes[e]>>>4).toString(16)+(15&this.bytes[e]).toString(16),3!==e&&5!==e&&7!==e&&9!==e||(t+="-");if(36!==t.length)throw new Error("Invalid UUIDv7 was generated");return t}clone(){return new t(this.bytes.slice(0))}equals(t){return 0===this.compareTo(t)}compareTo(t){for(let e=0;16>e;e++){const n=this.bytes[e]-t.bytes[e];if(0!==n)return Math.sign(n)}return 0}},yi=class{generate(){const t=this.generateOrAbort();if(!G(t))return t;{this.Mt=0;const t=this.generateOrAbort();if(G(t))throw new Error("Could not generate UUID after timestamp reset");return t}}generateOrAbort(){const t=(()=>{const t=Date.now();return Y(t)&&isFinite(t)?Math.min(Math.max(Math.floor(t),0),0xffffffffffff):0})();if(t>this.Mt)this.Mt=t,this.Tt();else{if(this.Mt>=t+1e4)return;this.It++,this.It>4398046511103&&(this.Mt++,this.Tt())}return gi.fromFieldsV7(this.Mt,Math.trunc(this.It/Math.pow(2,30)),this.It&Math.pow(2,30)-1,this.At.nextUint32())}Tt(){this.It=1024*this.At.nextUint32()+(1023&this.At.nextUint32())}constructor(){this.Mt=0,this.It=0,this.At=new ki}};const bi=t=>{if("u">typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(let e=0;t.length>e;e++)t[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return t};let wi;var ki=class{nextUint32(){var t;return this.Rt.length>this.Et||((null!==(t=wi)&&void 0!==t?t:wi="u">typeof window&&!G(window.crypto)&&crypto.getRandomValues?t=>{try{return crypto.getRandomValues(t)}catch(e){return bi(t)}}:bi)(this.Rt),this.Et=0),this.Rt[this.Et++]}constructor(){this.Rt=new Uint32Array(8),this.Et=1/0}};let Si;const _i=()=>xi().toString(),xi=()=>(Si||(Si=new yi)).generate();let Ci=null;const Mi={Ot(){if(!Z(Ci))return Ci;if(Ci=!0,G(t))Ci=!1;else try{const t="__support__";Mi.$t(t,"xyz"),'"xyz"'!==Mi.Lt(t)&&(Ci=!1),Mi.Dt(t)}catch(t){Ci=!1}return Ci},Ft(t){de.error("sessionStorage error: ",t)},Lt(e){try{return null==t?void 0:t.sessionStorage.getItem(e)}catch(t){Mi.Ft(t)}return null},Pt(t){try{return JSON.parse(Mi.Lt(t))||null}catch(t){}return null},$t(e,n){try{return null==t||t.sessionStorage.setItem(e,JSON.stringify(n)),!0}catch(t){Mi.Ft(t)}return!1},Dt(e){try{null==t||t.sessionStorage.removeItem(e)}catch(t){Mi.Ft(t)}}};ue.DEBUG=!1,ue.LIB_VERSION="1.455.0",ue.LIB_NAME="web";var Ti=ue,Ii=class{constructor(t){if(!t.persistence)throw new Error("it is not valid to not have persistence and be this far into setting up the application");this.Nt=t.get_property.bind(t),this.qt=t.persistence.set_property.bind(t.persistence)}trackSize(t,e){this.qt(g,{sessionId:t,size:this.currentTrackedSize(t)+e})}currentTrackedSize(t){const e=this.Nt(g);return H(n=e)&&V(n.sessionId)&&Y(n.size)&&e.sessionId===t?e.size:0;var n}};function Ai(t,e){return function(t){let e=0;for(let n=0;t.length>n;n++)e=(e<<5)-e+t.charCodeAt(n),e|=0;return Math.abs(e)}(t)%100<ot(100*e,0,100,de)}function Ri(t){return`$survey_response_${t}`}function Ei(t,e){if(!e)return null;const n=t[Ri(e)];return U(n)?[...n]:n}function Oi({event:t,survey:e,responses:n={},submissionId:i,completed:r,surveyLanguage:o,questionSnapshots:s}){return L(L(L(L({},!G(i)&&{$survey_submission_id:i}),"sent"===t?!G(r)&&{$survey_completed:r}:{$survey_partially_completed:$i(n)}),o&&{$survey_language:o}),function(t={},e,n){const i={};return e.questions.forEach(e=>{if(G(e.originalQuestionIndex))return;const n=0===(r=e.originalQuestionIndex)?"$survey_response":`$survey_response_${r}`;var r;const o=Ei(t,e.id);G(o)||(i[n]=o)}),L(L({$survey_questions:e.questions.map(e=>{var i,r;return{id:e.id,question:null!==(i=null==n?void 0:n[null!==(r=e.id)&&void 0!==r?r:""])&&void 0!==i?i:e.question,response:Ei(t,e.id)}})},t),i)}(n,e,s))}function $i(t={}){return Object.values(t).some(t=>!J(t))}function Li(t,e){let n=`$survey_${e}/${t.id}`;return t.current_iteration&&t.current_iteration>0&&(n=`$survey_${e}/${t.id}/${t.current_iteration}`),n}function Di(t){return"string"==typeof t&&t.trim()?t.trim():null}function Fi(t){return t.toLowerCase()}function Pi(t,e,n){if(!t||!e)return null;const i=Fi(e),r=Object.keys(t).find(t=>Fi(t)===i);if(r)return null==n||n.debug(`Found exact translation match: ${r}`),r;if(i.includes("-")){const r=i.split("-")[0],o=Object.keys(t).find(t=>Fi(t)===r);if(o)return null==n||n.debug(`Found base language translation match: ${o} (from ${e})`),o}return null}const Ni=["thankYouMessageHeader","thankYouMessageDescription","thankYouMessageCloseButtonText","introScreenHeader","introScreenDescription","introScreenButtonText","submitButtonText","backButtonText"];function qi(t,e,n){var i;const r=Pi(t.translations,e,n),o=L({},t);let s=!1;if(r){var a;const e=null===(a=t.translations)||void 0===a?void 0:a[r];if(e)if(null==n||n.info(`Applying survey-level translation for language: ${r}`),G(e.name)||(o.name=e.name,s=!0),o.appearance){const t=L({},o.appearance);for(const n of Ni){const i=e[n];G(i)||(t[n]=i,s=!0)}o.appearance=t}else(function(t){return Ni.some(e=>!G(t[e]))})(e)&&(s=!0)}const l=t.questions.map(t=>function(t,e,n){var i;const r=Pi(t.translations,e,n);if(!r)return{question:t,matchedKey:null,hasChanges:!1};const o=null===(i=t.translations)||void 0===i?void 0:i[r];if(!o)return{question:t,matchedKey:null,hasChanges:!1};const s=L({},t);let a=!1;return G(o.question)||(s.question=o.question,a=!0),G(o.description)||(s.description=o.description,a=!0),G(o.buttonText)||(s.buttonText=o.buttonText,a=!0),"link"in s&&!G(o.link)&&(s.link=o.link,a=!0),"lowerBoundLabel"in s&&!G(o.lowerBoundLabel)&&(s.lowerBoundLabel=o.lowerBoundLabel,a=!0),"upperBoundLabel"in s&&!G(o.upperBoundLabel)&&(s.upperBoundLabel=o.upperBoundLabel,a=!0),"choices"in s&&function(t){return U(t.choices)}(o)&&(s.choices=o.choices,a=!0),{question:a?s:t,matchedKey:a?r:null,hasChanges:a}}(t,e,n)),u=l.map(t=>t.question),c=l.some(t=>t.hasChanges);let d=null;return r||(d=(null===(i=l.find(t=>t.matchedKey))||void 0===i?void 0:i.matchedKey)||null),c&&(o.questions=u,s=!0,null==n||n.info(`Applied question-level translations for language: ${e}`)),{survey:o,matchedKey:s?r||d:null}}function ji(t){var e;return!!(null===(e=t.conditions)||void 0===e||null===(e=e.events)||void 0===e||null===(e=e.values)||void 0===e?void 0:e.length)}const Bi=(t,e)=>{if(!(t=>{try{new RegExp(t)}catch(t){return!1}return!0})(e))return!1;try{return new RegExp(e).test(t)}catch(t){return!1}},zi=t=>t.toLowerCase(),Ui={exact:(t,e)=>e.some(e=>t.some(t=>e===t)),is_not:(t,e)=>e.every(e=>t.every(t=>e!==t)),regex:(t,e)=>e.some(e=>t.some(t=>Bi(e,t))),not_regex:(t,e)=>e.every(e=>t.every(t=>!Bi(e,t))),icontains:(t,e)=>e.map(zi).some(e=>t.map(zi).some(t=>e.includes(t))),not_icontains:(t,e)=>e.map(zi).every(e=>t.map(zi).every(t=>!e.includes(t))),gt:(t,e)=>e.some(e=>{const n=parseFloat(e);return!isNaN(n)&&t.some(t=>n>parseFloat(t))}),lt:(t,e)=>e.some(e=>{const n=parseFloat(e);return!isNaN(n)&&t.some(t=>n<parseFloat(t))})},Wi=t=>{const e=[...t];for(let t=e.length-1;t>0;t--){const n=Math.floor(Math.random()*(t+1));[e[t],e[n]]=[e[n],e[t]]}return e},Hi=new Set(["is_not","not_icontains","not_regex"]);function Gi(t,e,n){return!t||0===t.length||t.every(t=>{const i="person"===t.type?n:e,r=null==i?void 0:i[t.key],o=t.operator||"exact";if(G(r)||Z(r))return Hi.has(o);const s=Ui[o];return!!s&&!G(t.value)&&!Z(t.value)&&s(U(t.value)?t.value.map(String):[String(t.value)],U(r)?r.map(String):[String(r)])})}const Vi=he("[SessionRecording]");function Qi(t,e){return e?t:"x"+t}function Zi(t,e){return t===e||t!=="x"+e&&null}var Ji=class{constructor(t,e,n,i,r,o,s){this._instance=t,this.tt=e,this.et=n,this.nt=i,this.jt=r,this.Bt=o,this.zt=s,this.Ut=null,this.Wt=En}onRemoteConfig(t){this.Ut=Y(t.sampleRate)?t.sampleRate:null,"any"===t.triggerMatchType?(this.Ht=new Sn([this.et,this.tt]),this.Wt=Rn):(this.Ht=new _n([this.et,this.tt]),this.Wt=En),this._instance.register_for_session({[S]:t.triggerMatchType}),this.tt.onConfig(t),this.et.onConfig(t),this.nt.onConfig(t,(t,e)=>{this.jt("linked_flag_matched",{flag:t,variant:e}),this.zt()})}getStatus(t){return this.Wt({receivedFlags:!0,isRecordingEnabled:!0,isSampled:t.isSampled,rrwebError:t.rrwebError,urlTriggerMatching:t.urlTriggerMatching,eventTriggerMatching:t.eventTriggerMatching,linkedFlagMatching:t.linkedFlagMatching,sessionId:t.sessionId})}getMinimumDuration(t){const e=this._instance.get_property("$session_recording_remote_config"),n=null==e?void 0:e.minimumDurationMilliseconds;return Y(n)?n:null}checkUrlTriggers(t,e,n,i){this.tt.checkUrlTriggerConditions(e,n,i,t)}setupEventTriggerListeners(t,e,n){if(0!==this.et.K.length&&J(this.Gt))return this.Gt=t(t=>{try{this.et.checkEventTriggerConditions(t.event,n,e)}catch(t){Vi.error("Could not activate event trigger",t)}}),this.Gt}makeSamplingDecisions(t){var e;const n=this.Ut;var i,r;if(!Y(n))return null===(i=this._instance.persistence)||void 0===i||i.unregister("$session_is_sampled"),void(null===(r=this._instance.persistence)||void 0===r||r.unregister("$replay_sample_rate"));const o=this._instance.get_property(h),s=this._instance.get_property("$replay_sample_rate"),a=Zi(o,t),l=Y(s)&&s!==n,u=G(s)&&o===t,c=l||u||!K(a),d=c?Ai(t,n):a;c&&(d?this.jt("sampled"):Vi.warn(`Sample rate (${n}) has determined that this sessionId (${t}) will not be sent to the server.`)),null===(e=this._instance.persistence)||void 0===e||e.register({$session_is_sampled:Qi(t,d),$replay_sample_rate:Z(s)&&o===t?null:n})}ensureSamplingDecision(t){if(!Y(this.Ut))return;const e=this._instance.get_property(h);K(Zi(e,t))||this.makeSamplingDecisions(t)}onFlushComplete(){}clearConditionalRecordingPersistence(){var t,e,n,i,r;null===(t=this._instance.persistence)||void 0===t||t.unregister("$session_recording_event_trigger_activated_session"),null===(e=this._instance.persistence)||void 0===e||e.unregister("$session_recording_url_trigger_activated_session"),null===(n=this._instance.persistence)||void 0===n||n.unregister("$session_is_sampled"),null===(i=this._instance.persistence)||void 0===i||i.unregister("$replay_sample_rate"),null===(r=this._instance.persistence)||void 0===r||r.unregister("$session_past_minimum_duration")}updateActiveTriggers(t){}hasPendingTriggers(t){var e;return(null===(e=this.Ht)||void 0===e?void 0:e.triggerStatus(t))===mn}getPendingTriggerConditions(t){return[{label:"URL condition not matched",status:this.tt.triggerStatusNoSideEffects(t)},{label:"event condition not matched",status:this.et.triggerStatusNoSideEffects(t)},{label:"linked flag condition not matched",status:this.nt.triggerStatusNoSideEffects()}].filter(({status:t})=>t===mn).map(({label:t})=>t)}stop(){var t;null===(t=this.Gt)||void 0===t||t.call(this),this.Gt=void 0,this.et.stop(),this.tt.stop(),this.nt.stop()}},Yi=class{constructor(t,e,n,i,r){this._instance=t,this.tt=e,this.jt=n,this.Vt=i,this.zt=r,this.Qt=[],this.Zt=new Map,this.Jt=!1}onRemoteConfig(t){t.triggerGroups&&0!==t.triggerGroups.length?(this.Yt(t.triggerGroups),this._instance.register_for_session({[S]:"v2_trigger_groups",[_]:t.triggerGroups.length}),this.tt.onConfig(t)):Vi.warn("[V2Strategy] No trigger groups configured")}getStatus(t){return function(t){if(t.rrwebError)return vn;if(!t.receivedFlags)return hn;if(!t.isRecordingEnabled)return un;if(t.urlTriggerMatching.urlBlocked)return fn;const e=t.triggerGroupMatchers,n=t.triggerGroupSamplingResults;if(0===e.length)return un;let i=!1,r=!1;for(const o of e){const e=o.triggerStatus(t.sessionId);if("trigger_activated"===e){const t=o.group.id,e=n.get(t);G(e)?de.warn("[V2 Triggers] Group activated but no sampling decision found",{groupId:t}):!0===e&&(r=!0)}else"trigger_pending"===e&&(i=!0)}return r?cn:i?hn:un}({receivedFlags:!0,isRecordingEnabled:!0,isSampled:t.isSampled,rrwebError:t.rrwebError,urlTriggerMatching:t.urlTriggerMatching,eventTriggerMatching:t.eventTriggerMatching,linkedFlagMatching:t.linkedFlagMatching,sessionId:t.sessionId,triggerGroupMatchers:this.Qt,triggerGroupSamplingResults:this.Zt,minimumDuration:this.getMinimumDuration(t.sessionId)})}getMinimumDuration(t){let e=null;for(const n of this.Qt)if("trigger_activated"===n.triggerStatus(t)){const t=n.group.minDurationMs;Y(t)&&(Z(e)||e>t)&&(e=t)}return e}checkUrlTriggers(t,e,n,i){this.tt.checkUrlBlocklist(e,n);for(const i of this.Qt)i.checkUrlTriggerConditions(e,n,e=>{this.Kt(i,void 0)&&(i.activateTrigger(e,t),this.updateActiveTriggers(t),this.zt(e))},t)}setupEventTriggerListeners(t,e,n){return this.Gt=t(t=>{var n;if(this.Jt)return Vi.info("[SessionRecorder] Stopping trigger checks - initial buffer flushed"),null===(n=this.Gt)||void 0===n||n.call(this),void(this.Gt=void 0);try{for(const n of this.Qt)n.checkEventTriggerConditions(t.event,i=>{if(!this.Kt(n,t.properties))return;const r=(n.group.conditions.events||[]).filter(e=>e.name===t.event),o=this._instance.get_property(s);r.some(e=>!e.properties||0===e.properties.length||Gi(e.properties,t.properties,o))&&(n.activateTrigger(i,e),this.updateActiveTriggers(e),this.zt(i))},e)}catch(t){Vi.error("Could not activate event trigger for trigger groups",t)}}),this.Gt}makeSamplingDecisions(t){for(const n of this.Qt){var e;const i=n.group,r=i.id,o=i.sampleRate,s="$posthog_sr_group_sampling_"+r,a=this._instance.get_property(s);let l=null,u=!1,c=!1,d=!1;if(H(a)){const e=a.sessionId,n=a.sampleRate,i=a.sampled;u="string"==typeof e&&e!==t,c=Y(n)&&n!==o,l=e===t&&Y(n)&&n===o&&K(i)?i:null}else l=a===t||null,u="string"==typeof a&&a!==t,d=a===t;const h=u||c||d||!K(l),f=h?Ai(t+r,o):l;h&&this.Vt("triggerGroupSamplingDecisionMade",{group_id:r,group_name:i.name,sampleRate:o,isSampled:f}),this.Zt.set(r,f),null===(e=this._instance.persistence)||void 0===e||e.register({[s]:{sessionId:t,sampleRate:o,sampled:f}})}this.updateActiveTriggers(t)}ensureSamplingDecision(t){}onFlushComplete(){this.Jt=!0}clearConditionalRecordingPersistence(){var t,e,n;null===(t=this._instance.persistence)||void 0===t||t.unregister("$session_is_sampled"),null===(e=this._instance.persistence)||void 0===e||e.unregister("$replay_sample_rate"),null===(n=this._instance.persistence)||void 0===n||n.unregister("$session_past_minimum_duration");for(const t of this.Qt){var i,r,o;const e=t.group.id;null===(i=this._instance.persistence)||void 0===i||i.unregister("$posthog_sr_group_event_trigger_"+e),null===(r=this._instance.persistence)||void 0===r||r.unregister("$posthog_sr_group_url_trigger_"+e),null===(o=this._instance.persistence)||void 0===o||o.unregister("$posthog_sr_group_sampling_"+e)}}updateActiveTriggers(t){const e=[];for(const n of this.Qt){const i=n.group,r=i.id,o="trigger_activated"===n.triggerStatus(t),s=!0===this.Zt.get(r);o&&e.push({id:r,name:i.name,matched:!0,sampled:s})}this._instance.register_for_session({[w]:e})}hasPendingTriggers(t){for(const e of this.Qt)if("trigger_pending"===e.triggerStatus(t))return!0;return!1}getPendingTriggerConditions(t){return this.Qt.flatMap(e=>"trigger_pending"!==e.triggerStatusNoSideEffects(t)?[]:e.getPendingTriggerConditions(t).map(t=>`trigger group "${e.group.name}": ${t}`))}stop(){var t;null===(t=this.Gt)||void 0===t||t.call(this),this.Gt=void 0,this.Qt.forEach(t=>t.stop()),this.Qt=[],this.Zt.clear(),this.tt.stop()}Kt(t,e){const n=t.group.conditions.properties;return!n||0===n.length||Gi(n,e,this._instance.get_property(s))}Yt(t){this.Qt.forEach(t=>t.stop()),this.Qt=[],this.Zt.clear();for(const e of t){const t=new An(this._instance,e,(t,n)=>{this.jt("linked_flag_matched",{flag:t,variant:n,group_id:e.id,group_name:e.name}),this.zt()});this.Qt.push(t)}}};const Ki=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","oppref","bfcid","irclid","_kx"],Xi=["ScCid","SsCid"],tr=(()=>[...Ki,...Xi,"sscid"])(),er=1e5,nr=/^[A-Za-z0-9]*[A-Za-z][A-Za-z0-9]*$/,ir=[],rr=()=>!1,or="@type @id actionStatus availability bestRating contentRating encodingFormat eventAttendanceMode eventStatus highPrice inLanguage isAccessibleForFree isFamilyFriendly itemCondition itemListOrder lowPrice maximumAttendeeCapacity nonprofitStatus numberOfItems offerCount position price priceCurrency priceValidUntil publicAccess ratingCount ratingValue reviewCount smokingAllowed worstRating".split(" "),sr="Action BorrowAction ReadAction SearchAction SeekToAction SolveMathAction WatchAction".split(" "),ar="AutoDealer Bakery BarOrPub CafeOrCoffeeShop CollegeOrUniversity Corporation DaySpa Dentist EducationalOrganization Electrician FoodEstablishment GovernmentOrganization HealthClub Hotel LegalService Library LibrarySystem LocalBusiness Locksmith LodgingBusiness MedicalBusiness NGO OnlineStore Organization PerformingGroup Pharmacy Physician Plumber RealEstateAgent Restaurant School SportsOrganization Store".split(" "),lr="Accommodation AdministrativeArea Country Place State".split(" "),ur={AggregateOffer:{offers:["Offer"]},Brand:{name:!0},BreadcrumbList:{itemListElement:["ListItem"]},CreativeWork:{genre:!0,dateCreated:!0,dateModified:!0,datePublished:!0,expires:!0,learningResourceType:!0,educationalLevel:!0,educationalUse:!0,interactivityType:!0,aggregateRating:["AggregateRating"],potentialAction:sr,publisher:ar},Event:{startDate:!0,endDate:!0,previousStartDate:!0,aggregateRating:["AggregateRating"],offers:["AggregateOffer","Offer"]},ItemList:{itemListElement:["ListItem"]},ListItem:{item:ir},Offer:{seller:ar},Organization:{name:!0,legalName:!0,foundingDate:!0,dissolutionDate:!0,aggregateRating:["AggregateRating"],brand:["Brand"]},Place:{aggregateRating:["AggregateRating"]},Product:{name:!0,sku:!0,mpn:!0,gtin:!0,gtin8:!0,gtin12:!0,gtin13:!0,gtin14:!0,productID:!0,productGroupID:!0,asin:!0,model:!0,category:!0,color:!0,material:!0,pattern:!0,size:!0,productionDate:!0,releaseDate:!0,brand:["Brand","Organization"],manufacturer:ar,offers:["Offer","AggregateOffer"],aggregateRating:["AggregateRating"]},Service:{name:!0,serviceType:!0,category:!0,provider:ar,areaServed:lr,offers:["AggregateOffer","Offer"],aggregateRating:["AggregateRating"]},OfferCatalog:{name:!0,itemListElement:ir}},cr=[["3DModel AboutPage Answer Article AudioObject Blog BlogPosting Book Clip CollectionPage Comment ContactPage Course CreativeWorkSeason CreativeWorkSeries DataCatalog DataDownload DataFeed Dataset DiscussionForumPosting Episode FAQPage Game HowTo HowToDirection HowToSection HowToStep HowToTip ImageObject LearningResource MediaObject Message MobileApplication Movie MusicPlaylist MusicRecording NewsArticle Photograph PodcastEpisode PodcastSeries ProfilePage QAPage Question Quiz Recipe Review ScholarlyArticle SearchResultsPage SiteNavigationElement SocialMediaPosting SoftwareApplication TVEpisode TVSeries TechArticle VacationRental VideoGame VideoObject WebApplication WebPage WebPageElement WebSite".split(" "),ur.CreativeWork],["BroadcastEvent BusinessEvent EducationEvent Festival MusicEvent SportsEvent TheaterEvent".split(" "),ur.Event],[ar,ur.Organization],[lr,ur.Place],["Car IndividualProduct ProductGroup ProductModel".split(" "),ur.Product]];function dr(t,e){return B.call(t,e)?t[e]:void 0}function hr(t){const e=typeof t;return Z(t)||"string"===e||"number"===e||"boolean"===e}function fr(t,e){return e&&function(t){return V(t)&&/^(https?:\/\/|\/|\.\.?\/)/i.test(t.trim())}(t)?e(t.trim())||void 0:t}function vr(t,e){return U(t)&&t.every(hr)?t.map(t=>fr(t,e)).filter(t=>!G(t)):hr(t)?fr(t,e):void 0}function pr(t,e){if("string"!=typeof t)return;const n=t.trim(),i=n.indexOf("#"),r=0>i?n:n.slice(i+1);if(!(!r||0>i&&(/^[a-z][a-z\d+.-]*:/i.test(n)||n.includes("/")||n.includes("?"))))try{return e(r)?r:void 0}catch(t){return}}function mr(t){if(B.call(ur,t))return ur[t];for(const[e,n]of cr)if(e.includes(t))return n}function gr(t,e,n){Object.defineProperty(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0})}function yr(t,e,n,i){if(U(t)){const r=t.map(t=>yr(t,e,n,i)).filter(t=>!G(t));return r.length?r:void 0}return br(t,e,n,i)||void 0}function br(t,e,n,i){if(!H(t)||!function(t){return t.remainingNodes?(t.remainingNodes--,!0):(t.exceeded=!0,!1)}(n))return null;const r=dr(t,"@type"),o=function(t){const e=new Set,n="string"==typeof t?[t]:U(t)?t:[],i=[];for(const t of n){if("string"!=typeof t)continue;const n=t.replace(/^https?:\/\/schema\.org\//,"");if(100>=n.length&&nr.test(n)&&!e.has(n)&&(e.add(n),i.push(n),20===i.length))break}return i}(r),s=o.filter(t=>!!mr(t)&&(!i||!i.length||i.includes(t))),a={};for(const i of or){const s="@type"===i?o.length?"string"==typeof r?o[0]:o:void 0:"@id"===i?pr(dr(t,i),e):vr(dr(t,i),n.maskUrl);G(s)||gr(a,i,s)}for(const i of s){const r=mr(i);for(const i of Object.keys(r)){const o=dr(t,i),s=r[i];if(!0===s){const t=vr(o,n.maskUrl);G(t)||gr(a,i,t)}else{const t=yr(o,e,n,s);G(t)||gr(a,i,t)}}}const l=yr(dr(t,"@graph"),e,n);return G(l)||gr(a,"@graph",l),Object.keys(a).length?a:null}function wr(t,e,n){if(!H(t))return null;const i=dr(t,"@context");if("string"!=typeof i||!/^https?:\/\/schema\.org\/?$/.test(i))return null;const r=br(t,e,n);return r?L({"@context":"https://schema.org"},r):null}function kr(t){var e;return"SCRIPT"===t.nodeName&&"application/ld+json"===(null===(e=t.getAttribute("type"))||void 0===e?void 0:e.trim().toLowerCase())}function Sr(t,e,n){if("string"==typeof e?t.classList.contains(e):e&&Array.from(t.classList).some(t=>(e.lastIndex=0,e.test(t))))return!0;try{return!!n&&t.matches(n)}catch(t){return!1}}function _r(t,e,n){for(let i=t;i;){if(Sr(i,e,n))return!0;const t=i.parentNode;i=i.parentElement||(t&&t.nodeType===t.DOCUMENT_FRAGMENT_NODE?t.host:null)}return!1}function xr(t){return kr(t)?[t]:t.nodeType!==t.ELEMENT_NODE?[]:Array.from(t.querySelectorAll("script")).filter(kr)}const Cr=3e5;function Mr(t){return H(t)?t.network_timing:t}const Tr=/^please (take full snapshot|add custom event) after start recording$/,Ir=he("[SessionRecording]"),Ar=[1,2,3,4,5,6,7,12],Rr=t=>({rrwebMethod:t,enqueuedAt:Date.now(),attempt:1});function Er(){var t;return null==o||null===(t=o.__PosthogExtensions__)||void 0===t?void 0:t.rrweb}function Or(){var t;return null===(t=Er())||void 0===t?void 0:t.record}function $r(t){try{return JSON.stringify(t)}catch(e){if(e instanceof RangeError)throw e;return JSON.stringify(t,On())}}function Lr(t){return pi(vi(function(t){var e=t.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(t);for(var n=new Fn(t.length+(t.length>>>1)),i=0,r=function(t){n[i++]=t},o=0;e>o;++o){if(i+5>n.length){var s=new Fn(i+8+(e-o<<1));s.set(n),n=s}var a=t.charCodeAt(o);128>a?r(a):2048>a?(r(192|a>>>6),r(128|63&a)):a>55295&&57344>a?(r(240|(a=65536+(1047552&a)|1023&t.charCodeAt(++o))>>>18),r(128|a>>>12&63),r(128|a>>>6&63),r(128|63&a)):(r(224|a>>>12),r(128|a>>>6&63),r(128|63&a))}return ei(n,0,i)}($r(t))),!0)}function Dr(t){return Fr.apply(this,arguments)}function Fr(){return(Fr=A(function*(t){const e=yield oe($r(t),Ti.DEBUG,{rethrow:!0});return pi(new Uint8Array(yield e.arrayBuffer()),!0)})).apply(this,arguments)}let Pr,Nr;const qr="undefined"!=typeof globalThis&&"CompressionStream"in globalThis&&"TextEncoder"in globalThis&&"Response"in globalThis&&"function"==typeof Response.prototype.blob;let jr=!1;function Br(t){var e;return U(t)&&0===t.length?(Pr=null!==(e=Pr)&&void 0!==e?e:Lr([]),Pr):Lr(t)}function zr(t){return Ur.apply(this,arguments)}function Ur(){return(Ur=A(function*(t){var e;return U(t)&&0===t.length?Pr||(Nr=null!==(e=Nr)&&void 0!==e?e:Dr([]).then(t=>(Pr=t,t)).catch(t=>{throw Pr=void 0,Nr=void 0,t}),Nr):Dr(t)})).apply(this,arguments)}function Wr(t){return qr&&!jr&&function(t){return 2===t.type||3===t.type&&(0===t.data.source||8===t.data.source)}(t)}function Hr(t){return{event:t,size:Ln(t)}}function Gr(t,e){return L(L({},t),{},{data:e,cv:"2024-10"})}function Vr(t,e){return L(L({},t),{},{cv:"2024-10",data:L(L({},t.data),e)})}function Qr(t){try{if(2===t.type)return Hr(Gr(t,Lr(t.data)));if(3===t.type&&0===t.data.source)return Hr(Vr(t,{texts:Br(t.data.texts),attributes:Br(t.data.attributes),removes:Br(t.data.removes),adds:Br(t.data.adds)}));if(3===t.type&&8===t.data.source)return Hr(Vr(t,{adds:t.data.adds?Lr(t.data.adds):void 0,removes:t.data.removes?Lr(t.data.removes):void 0}))}catch(t){Ir.warn("could not compress event - will use uncompressed event",t)}return{event:t,size:$n(t)}}function Zr(){return Zr=A(function*(t){try{if(2===t.type)return Hr(Gr(t,yield Dr(t.data)));if(3===t.type&&0===t.data.source){const[e,n,i,r]=yield Promise.all([zr(t.data.texts),zr(t.data.attributes),zr(t.data.removes),zr(t.data.adds)]);return Hr(Vr(t,{texts:e,attributes:n,removes:i,adds:r}))}if(3===t.type&&8===t.data.source){const[e,n]=yield Promise.all([t.data.adds?Dr(t.data.adds):void 0,t.data.removes?Dr(t.data.removes):void 0]);return Hr(Vr(t,{adds:e,removes:n}))}}catch(e){return(t=>{if(!t||"object"!=typeof t)return!1;const e="name"in t?String(t.name):"";return(t=>!(!t||"object"!=typeof t)&&"NotReadableError"===("name"in t?String(t.name):""))(t)||e===Xt})(e)&&(jr=!0),Ir.warn("could not compress event asynchronously - trying synchronous compression",e),Qr(t)}return{event:t,size:$n(t)}}),Zr.apply(this,arguments)}function Jr(t,e){return 5===t.type&&t.data.tag===e}function Yr(t){return Jr(t,"sessionIdle")}function Kr(t){return Jr(t,"$session_ending")}function Xr(t){return Jr(t,"$session_starting")}var to=class{get sessionId(){return this.Xt}get te(){if(!this._instance.sessionManager)throw new Error("[SessionRecording] must be started with a valid sessionManager.");return this._instance.sessionManager}get ee(){return this._instance.config.session_recording.session_idle_threshold_ms||3e5}get ne(){return Zi(this._instance.get_property(h),this.sessionId)}get Ut(){var t;const e=null===(t=this.ie)||void 0===t?void 0:t.sampleRate;return Y(e)?e:null}get re(){var t,e;return null!==(t=null===(e=this.oe)||void 0===e?void 0:e.getMinimumDuration(this.sessionId))&&void 0!==t?t:null}constructor(t,e){this._instance=t,this.supportsSelectMasking=!0,this.se="/s/",this._forceAllowLocalhostNetworkCapture=!1,this.ae=void 0,this.le=void 0,this.ue=!1,this.ce=Date.now(),this.de=!1,this.he=[],this.fe="unknown",this.ve=0,this.pe=0,this.me=0,this.ge=0,this.ye=0,this.be=!1,this.we=!1,this.ke=!1,this.Se=!1,this._e=!1,this.xe=!1,this.Ce=0,this.Me=void 0,this.Te=void 0,this.Ie=0,this.Ae=void 0,this.Re=void 0,this.Ee=0,this.Oe=!1,this.$e=!1,this.Le=!1,this.De=!1,this.Fe=!1,this.Pe=!1,this.Ne=!1,this.qe=void 0,this.je=void 0,this.Be=!1,this.ze=[],this.Ue=0,this.We=0,this.He=!1,this.Ge=void 0,this.Gt=void 0,this.Ve=void 0,this.Qe=void 0,this.Ze=void 0,this.Je=(t,e,n)=>{var i,r,o,s;if(!n)return;if(t===this.Xt&&e===this.Ye)return;const a=!n.noSessionId&&(n.activityTimeout||n.sessionPastMaximumLength),l=this.Xt,u=this.Ye;var c;if(a&&this.Vt("$session_ending",{currentSessionId:l,currentWindowId:u,nextSessionId:t,nextWindowId:e,changeReason:n,lastActivityTimestamp:this.ce,flushed_size:null===(c=this.Ke)||void 0===c?void 0:c.currentTrackedSize(l)}),null===(i=this._instance.persistence)||void 0===i||i.unregister("$debug_first_full_snapshot_timestamp"),null===(r=Er())||void 0===r||null===(o=r.resetMaxDepthState)||void 0===o||o.call(r),this.Vt("$session_id_change",{sessionId:t,windowId:e,changeReason:n}),this.Xe(),!(!1===this.fe&&this.isStarted||this.Xt===t&&this.Ye===e)){const e=this.Xt!==t&&!1!==this.fe;this.fe="unknown",this.tn(e)}a&&this.Vt("$session_starting",{previousSessionId:l,previousWindowId:u,nextSessionId:t,nextWindowId:e,changeReason:n,lastActivityTimestamp:this.ce}),null===(s=this.oe)||void 0===s||s.makeSamplingDecisions(t)},this.en=!1,this.nn=()=>{var t;return(null===(t=this._instance.persistence)||void 0===t?void 0:t.props.$session_past_minimum_duration)===this.Xt},this.rn=()=>{var t,e;if(0===this.Rt.data.length)return null;const n=null===(t=this.Rt.data[0])||void 0===t?void 0:t.timestamp,i=null===(e=this.Rt.data[this.Rt.data.length-1])||void 0===e?void 0:e.timestamp;return Y(n)&&Y(i)?i-n:null},this.sn=()=>{var t,e;const n=this.re;if(!Y(n))return!1;if(null===(t=null===(e=this._instance.config.session_recording)||void 0===e?void 0:e.strictMinimumDuration)||void 0===t||!t){const t=this.an;return Y(t)&&t>=0&&n>t}if(this.nn())return!1;const i=this.rn();return!!Z(i)||n>i||(null===(r=this._instance.persistence)||void 0===r||r.register({$session_past_minimum_duration:this.Xt}),!1);var r},this.ln=()=>{"buffering"!==this.status?(this.be&&this.we&&this.un&&(this.cn(void 0),this.ke&&(this.ke=!1,this.Bt())),this.dn(),this.hn(!0)):this.fn()},this.vn=()=>{this.ln()},this.pn=()=>{this.Vt("browser offline",{})},this.mn=()=>{this.Vt("browser online",{})},this.gn=()=>{(null==n?void 0:n.visibilityState)&&("visible"===n.visibilityState&&(this.un=!0),this.Vt("window "+n.visibilityState,{}))},this.un=null==e||e;const{sessionId:i,windowId:r,sessionStartTimestamp:o}=this.te.checkAndGetSessionAndWindowId();this.Xt=i,this.Ye=r,this._sessionStartTimestamp=o,this.nt=new Tn(this._instance),this.tt=new Mn(this._instance),this.et=new In(this._instance),this.Rt=this.fn(),this.yn=function(t){return"ph_replay_pending_buffer_"+JSON.stringify([t.persistence_name||t.token,t.token])}(this._instance.config),this.te.sessionTimeoutMs>this.ee||Ir.warn(`session_idle_threshold_ms (${this.ee}) is greater than the session timeout (${this.te.sessionTimeoutMs}). Session will never be detected as idle`),this.Ke=new Ii(this._instance)}setDocumentWasEverVisible(t){t&&(this.un=!0)}get bn(){var t,e,n,i,r,o,s,a,l;const u=null===(t=this.ie)||void 0===t?void 0:t.masking,c={maskAllInputs:null===(e=this._instance.config.session_recording)||void 0===e?void 0:e.maskAllInputs,maskTextSelector:null===(n=this._instance.config.session_recording)||void 0===n?void 0:n.maskTextSelector,blockSelector:null===(i=this._instance.config.session_recording)||void 0===i?void 0:i.blockSelector,maskAllElementAttributes:null===(r=this._instance.config.session_recording)||void 0===r?void 0:r.maskAllElementAttributes},d=null!==(o=null==c?void 0:c.maskAllInputs)&&void 0!==o?o:null==u?void 0:u.maskAllInputs,h=null!==(s=null==c?void 0:c.maskTextSelector)&&void 0!==s?s:null==u?void 0:u.maskTextSelector,f=null!==(a=null==c?void 0:c.blockSelector)&&void 0!==a?a:null==u?void 0:u.blockSelector,v=null!==(l=null==c?void 0:c.maskAllElementAttributes)&&void 0!==l?l:null==u?void 0:u.maskAllElementAttributes;return G(d)&&G(h)&&G(f)&&G(v)?void 0:{maskAllInputs:null==d||d,maskTextSelector:h,blockSelector:f,maskAllElementAttributes:v}}wn(){var t;if(this.Le)return;const e=null===(t=this.ie)||void 0===t?void 0:t.masking;if(J(e))return;const n=this._instance.config.session_recording,i=["maskAllInputs","maskTextSelector","blockSelector","maskAllElementAttributes"].filter(t=>{const i=null==n?void 0:n[t],r=e[t];return!G(i)&&i!==r});0!==i.length&&(this.Le=!0,Ir.warn('Session recording masking is configured both in `posthog.init` and in your project settings, and they differ. The `session_recording` options in `posthog.init` take precedence, so the project ("Privacy and masking") setting is ignored for: '+i.join(", ")+". Remove these masking options from `posthog.init` to use the project setting instead. See https://posthog.com/docs/session-replay/privacy",{client:{maskAllInputs:null==n?void 0:n.maskAllInputs,maskTextSelector:null==n?void 0:n.maskTextSelector,blockSelector:null==n?void 0:n.blockSelector,maskAllElementAttributes:null==n?void 0:n.maskAllElementAttributes},project:e}))}get kn(){var t;return ot(null===(t=this._instance.config.session_recording.canvasCapture)||void 0===t?void 0:t.resolutionScale,.1,1,he("canvas recording resolution scale"),1)}get Sn(){var t,e,n,i,r,o,s;const a=this._instance.config.session_recording.captureCanvas,l=null===(t=this.ie)||void 0===t?void 0:t.canvasRecording,u=null!==(e=null!==(n=null==a?void 0:a.recordCanvas)&&void 0!==n?n:null==l?void 0:l.enabled)&&void 0!==e&&e,c=null!==(i=null!==(r=null==a?void 0:a.canvasFps)&&void 0!==r?r:null==l?void 0:l.fps)&&void 0!==i?i:4;let d=null!==(o=null!==(s=null==a?void 0:a.canvasQuality)&&void 0!==s?s:null==l?void 0:l.quality)&&void 0!==o?o:.4;if("string"==typeof d){const t=parseFloat(d);d=isNaN(t)?.4:t}return{enabled:u,fps:ot(c,0,12,he("canvas recording fps"),4),quality:ot(d,0,1,he("canvas recording quality"),.4)}}get _n(){var t;const e=!!(null===(t=this.ie)||void 0===t?void 0:t.consoleLogRecordingEnabled),n=this._instance.config.enable_recording_console_log;return null!=n?n:e}get xn(){var t,e,n;const i=null===(t=this.ie)||void 0===t?void 0:t.networkPayloadCapture,r={recordHeaders:null===(e=this._instance.config.session_recording)||void 0===e?void 0:e.recordHeaders,recordBody:null===(n=this._instance.config.session_recording)||void 0===n?void 0:n.recordBody},o=!1!==r.recordHeaders&&(r.recordHeaders||(null==i?void 0:i.recordHeaders)),s=!1!==r.recordBody&&(r.recordBody||(null==i?void 0:i.recordBody)),a=Mr(this._instance.config.capture_performance),l=Mr(null==i?void 0:i.capturePerformance),u=!!(K(a)?a:l);return o||s||u?{recordHeaders:o,recordBody:s,recordPerformance:u}:void 0}Cn(){var t,e;const n=[],r=null===(t=o.__PosthogExtensions__)||void 0===t||null===(t=t.rrwebPlugins)||void 0===t?void 0:t.getRecordConsolePlugin;r&&this._n&&n.push(r());const s=null===(e=o.__PosthogExtensions__)||void 0===e||null===(e=e.rrwebPlugins)||void 0===e?void 0:e.getRecordNetworkPlugin;if(this.xn&&W(s))if(!ye.includes(i.hostname)||this._forceAllowLocalhostNetworkCapture){const t=W(this._instance.requestRouter.isIngestionEndpoint)?this._instance.requestRouter.isIngestionEndpoint.bind(this._instance.requestRouter):void 0;n.push(s(L(L({},((t,e,n)=>{const i={payloadSizeLimitBytes:Xe.payloadSizeLimitBytes,performanceEntryTypeToObserve:[...Xe.performanceEntryTypeToObserve],payloadHostDenyList:[...e.payloadHostDenyList||[],...Xe.payloadHostDenyList]},r=!1!==t.session_recording.recordHeaders&&e.recordHeaders,o=!1!==t.session_recording.recordBody&&e.recordBody,s=!1!==t.capture_performance&&e.recordPerformance,a=(t=>{const e=Ke(t);return t=>((null==t?void 0:t.requestBody)&&(t.requestBody=sn(t.requestBody,t.requestHeaders,e,"Request")),(null==t?void 0:t.responseBody)&&(t.responseBody=sn(t.responseBody,t.responseHeaders,e,"Response")),t)})(i),l=e=>{return a(((t,e,n)=>{var i;if(null==n?void 0:n(t.name))return;const r=ge(t.name);let o=0===e.indexOf("http")?null===(i=ge(e))||void 0===i?void 0:i.pathname:e;"/"===o&&(o="");const s=null==r?void 0:r.pathname.replace(o||"","");return r&&s&&on.some(t=>0===s.indexOf(t))?void 0:t})((rn((i=e).requestHeaders),rn(i.responseHeaders),i),t.api_host,n));var i},u=W(t.session_recording.maskNetworkRequestFn);return u&&W(t.session_recording.maskCapturedNetworkRequestFn)?de.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."):u&&(t.session_recording.maskCapturedNetworkRequestFn=e=>{const n=t.session_recording.maskNetworkRequestFn({url:e.name});if(n||!e.isInitial)return L(L({},e),{},{name:null==n?void 0:n.url})}),i.maskRequestFn=W(t.session_recording.maskCapturedNetworkRequestFn)?e=>{var n,i;const r=l(e);if(!r)return;const o=r.isInitial?{name:"",entryType:r.entryType,startTime:r.startTime,duration:r.duration,endTime:r.endTime,timeOrigin:r.timeOrigin,timestamp:r.timestamp,isInitial:!0}:void 0,s=null===(n=(i=t.session_recording).maskCapturedNetworkRequestFn)||void 0===n?void 0:n.call(i,r);return J(s)&&o?(ln.add(o),o):null!=s?s:void 0}:t=>function(t){if(!G(t))return t.requestBody=an(t.requestBody,"Request"),t.responseBody=an(t.responseBody,"Response"),t}(l(t)),L(L(L({},Xe),i),{},{recordHeaders:r,recordBody:o,recordPerformance:s,recordInitialRequests:s,streamNetworkBody:!0===t.session_recording.streamNetworkBody})})(this._instance.config,this.xn,t)),{},{captureFetchSynchronously:!0===this._instance.config.__preview_replay_sync_fetch,returnFetchResponseEarly:!0===this._instance.config.__preview_replay_early_fetch_response})))}else Ir.info("NetworkCapture not started because we are on localhost.");return n}Mn(t){return this._instance.config.disable_capture_url_hashes?St(t):t}Tn(t,e=!1){const n=e?St(t):this.Mn(t),i=this._instance.config.mask_personal_data_properties?[...tr,...this._instance.config.custom_personal_data_properties||[]]:[];return this.In(function(t,e){if(!t||!e||!e.length)return t;const n=t.split(/#(.*)/),i=n[1],r=(n[0]||"").split(/\?(.*)/),o=r[1],s=r[0],a=(o||"").split("&"),l=[];for(let t=0;a.length>t;t++){const n=a[t].split("?");let i=0;for(;n.length>i&&!e.includes(n[i].split("=")[0]);)i++;l.push(n.length>i?n.slice(0,i).concat(n[i].split("=")[0]+"=<masked>").join("?"):a[t])}let u=s;return null!=o&&(u+="?"+l.join("&")),null!=i&&(u+="#"+i),u}(n,i))}In(t){const e=this._instance.config.session_recording;if(e.maskCapturedNetworkRequestFn){var n;const i=e.maskCapturedNetworkRequestFn({name:t});return null!==(n=null==i?void 0:i.name)&&void 0!==n?n:null==i?void 0:i.url}if(e.maskNetworkRequestFn){const n=e.maskNetworkRequestFn({url:t});return null==n?void 0:n.url}return t}An(t){try{return t.rrwebMethod(),!0}catch(r){var e,n,i;this.Ce+=1;const o=String(null!==(e=null==r?void 0:r.message)&&void 0!==e?e:r);return this.Me=Tr.test(o)?o:"other",this.Te=null===(n=Or())||void 0===n||null===(i=n.isRecording)||void 0===i?void 0:i.call(n),10>this.he.length?this.he.push({enqueuedAt:t.enqueuedAt||Date.now(),attempt:t.attempt+1,rrwebMethod:t.rrwebMethod}):Ir.warn("could not emit queued rrweb event.",r,t),!1}}Vt(t,e){return this.An(Rr(()=>Or().addCustomEvent(t,e)))}Rn(){var t;return this.ue&&!0===(null===(t=this._instance.config.session_recording)||void 0===t?void 0:t.captureJsonLd)&&!this.tt.urlBlocked&&!0!==this.fe}En(t){if(!this.Rn())return!1;try{const e=Or();return!!e&&(e.addCustomEvent("$json_ld",t),this.Rn())}catch(t){return!1}}On(t=!1){Promise.resolve().then(()=>{var e;return null===(e=this.$n)||void 0===e?void 0:e.scan(t)})}Ln(){try{if(this._instance.config.capture_pageview||!t)return;const e=new URL(t.location.href),n=this.Tn(e.origin+e.pathname+e.search);this.Dn!==n&&(this.Dn=n,this.Vt("$url_changed",{href:n}))}catch(t){}}Fn(){if(this.he.length){const t=[...this.he];this.he=[],t.forEach(t=>{Date.now()-t.enqueuedAt>2e3||this.An(t)})}}Bt(){const t=this.An(Rr(()=>Or().takeFullSnapshot())),e=this.ae;return!t&&e&&setTimeout(()=>this.Pn(e),0),t}Pn(t){var e,i;const r=Date.now();if(this.ae!==t||this.Ae||G(this.qe)||this.Nn||!["interactive","complete"].includes(null!==(e=null==n?void 0:n.readyState)&&void 0!==e?e:"")||!G(this.Re)&&Cr>r-this.Re)return;this.Re=r,this.Ee+=1,Ir.warn("rrweb stopped recording while replay was started, restarting it");const o=()=>{this.ae=void 0;const e={stopRequested:!1,startRequested:!1};this.Ae=e;try{this.qn(t)}finally{this.Ae=void 0}this.he=[],e.stopRequested&&!e.startRequested||this._instance.config.disable_session_recording||this._instance.has_opted_out_capturing()||this.jn()},s=null===(i=Or())||void 0===i?void 0:i.withStyleRuleSourceHandoff;this.Oe=!0;try{s?s(t,o):o()}finally{this.Oe=!1}this.isStarted&&this.Vt("$replay_recorder_restarted",{reason:"rrweb_not_recording"})}get Bn(){var t,e,n;if((null===(t=this.oe)||void 0===t?void 0:t.hasPendingTriggers(this.sessionId))&&!["sampled","active"].includes(this.status)){var i;const t=null===(i=this._instance.config.session_recording)||void 0===i?void 0:i.trigger_pending_buffer_interval_millis;return Y(t)&&Number.isFinite(t)&&t>=1e3&&36e5>=t?t:6e4}return null!==(e=null===(n=this._instance.config.session_recording)||void 0===n?void 0:n.full_snapshot_interval_millis)&&void 0!==e?e:Cr}zn(){if(this.Un&&clearInterval(this.Un),!0===this.fe)return;const t=this.Bn;t&&(this.Un=setInterval(()=>{this.Bt()},t))}zt(t){"event"===t&&this.Wn(),!this.tt.urlBlocked&&["sampled","active"].includes(this.status)&&this.zn()}Hn(){var t;this.tt.urlBlocked||(this.tt.urlBlocked=!0,null===(t=this.$n)||void 0===t||t.scan(),clearInterval(this.Un),Ir.info("recording paused due to URL blocker"),this.Vt("recording paused",{reason:"url blocker"}))}Gn(){var t;this.tt.urlBlocked&&(null===(t=this.$n)||void 0===t||t.scan(),this.tt.urlBlocked=!1,this.Bt(),this.On(),this.zn(),this.Vt("recording resumed",{reason:"left blocked url"}),Ir.info("recording resumed"))}Vn(t,e){var n;if("event"===t&&this.Wn(),!this.de&&(null===(n=this.oe)||void 0===n?void 0:n.hasPendingTriggers(this.sessionId))){this.de=!0;try{var i,r;const n="url"===t?f:v;null===(i=this._instance.persistence)||void 0===i||i.register({[n]:this.sessionId}),null===(r=this.oe)||void 0===r||r.updateActiveTriggers(this.sessionId),this.zt(),this.hn(),this.jt(t+"_trigger_matched",{["url"===t?"matchedUrl":"matchedEvent"]:e})}finally{this.de=!1}}}get isStarted(){return!!this.ae}get ie(){const t=this._instance.get_property("$session_recording_remote_config");if(!t)return;let e;try{e=H(t)?t:JSON.parse(t)}catch(t){return void Ir.warn("persisted remote config for session recording is invalid and will be ignored",t)}if(!this.isStarted&&!this.en&&!this.Oe){var n;const i=null!==(n=e.cache_timestamp)&&void 0!==n?n:Date.now();if(Date.now()-i>36e5)return void Ir.info("persisted remote config for session recording is stale and will be ignored",{cacheTimestamp:i,persistedConfig:t})}return e}Qn(t,e,n){this._instance.get_property(t)&&(e(),n())}start(e){var i,r;const o=this.ie;if(!o)return void Ir.info("remote config must be stored in persistence before recording can start");if(!this.isStarted){const t=!1!==this.fe&&!this.Se;this.cn(t?"no_interaction_since_recording_started":void 0),this.Se=!1,this.we=t,this.ke=!1}this.He&&(this.Zn(),this.fn());const{sessionId:s,windowId:a,sessionStartTimestamp:h}=this.te.checkAndGetSessionAndWindowId();this.Xt=s,this.Ye=a,this._sessionStartTimestamp=h,this.Jn(),null===(i=this._instance.persistence)||void 0===i||i.unregister("$debug_first_full_snapshot_timestamp"),(null==o?void 0:o.endpoint)&&(this.se=null==o?void 0:o.endpoint),this.oe=2===(null==o?void 0:o.version)&&(null==o?void 0:o.triggerGroups)&&o.triggerGroups.length>0?new Yi(this._instance,this.tt,this.jt.bind(this),this.Vt.bind(this),this.zt.bind(this)):new Ji(this._instance,this.tt,this.et,this.nt,this.jt.bind(this),this.Bt.bind(this),this.zt.bind(this)),this.oe.onRemoteConfig(o),null===(r=this.Gt)||void 0===r||r.call(this),this.Gt=this.oe.setupEventTriggerListeners(this._instance.on.bind(this._instance,"eventCaptured"),this.sessionId,(t,e)=>this.Vn(t,e)),this.Qn(l,()=>{this.overrideSampling()},()=>{var t;return null===(t=this._instance.persistence)||void 0===t?void 0:t.unregister(l)}),this.Qn(u,()=>{this.overrideLinkedFlag()},()=>{var t;return null===(t=this._instance.persistence)||void 0===t?void 0:t.unregister(u)}),this.Qn(d,()=>{this.overrideTrigger("event")},()=>{var t;return null===(t=this._instance.persistence)||void 0===t?void 0:t.unregister(d)}),this.Qn(c,()=>{this.overrideTrigger("url")},()=>{var t;return null===(t=this._instance.persistence)||void 0===t?void 0:t.unregister(c)}),this.oe.makeSamplingDecisions(this.sessionId),this.jn(),!this._e&&this.isStarted&&(me(t,"beforeunload",this.ln),me(t,"pagehide",this.vn),me(t,"offline",this.pn),me(t,"online",this.mn),me(n,"visibilitychange",this.gn),!this.Ve&&W(this.te.onSessionId)&&(this.Ve=this.te.onSessionId(this.Je)),!this.Qe&&W(this.te.on)?this.Qe=this.te.on("forcedIdleReset",()=>{this.Xe(),this.fe="unknown",this.stop(),this.Ze=this.te.onSessionId((t,e,n)=>{var i;null===(i=this.Ze)||void 0===i||i.call(this),this.Ze=void 0,this.Je(t,e,n)})}):W(this.te.on)||Ir.warn("bundled core has no SessionIdManager.on (requires posthog-js >= 1.268.6); recording will start but skip forced-idle-reset handling"),J(this.Ge)&&(this.Ge=this._instance.on("eventCaptured",t=>{try{if("$pageview"===t.event){const e=(null==t?void 0:t.properties.$current_url)?this.Tn(t.properties.$current_url):"";if(!e)return;this.Vt("$pageview",{href:e})}}catch(t){Ir.error("Could not add $pageview to rrweb session",t)}})),"active"===this.status&&this.jt(e||"recording_initialized"))}Yn(e=!1){var i,r,o,s,a,l;null==t||t.removeEventListener("beforeunload",this.ln),null==t||t.removeEventListener("pagehide",this.vn),null==t||t.removeEventListener("offline",this.pn),null==t||t.removeEventListener("online",this.mn),null==n||n.removeEventListener("visibilitychange",this.gn),clearInterval(this.Un),this.Kn(),null===(i=this.Ge)||void 0===i||i.call(this),this.Ge=void 0,null===(r=this.Gt)||void 0===r||r.call(this),this.Gt=void 0,null===(o=this.Ve)||void 0===o||o.call(this),this.Ve=void 0,null===(s=this.Qe)||void 0===s||s.call(this),this.Qe=void 0,null===(a=this.Ze)||void 0===a||a.call(this),this.Ze=void 0,null===(l=this.oe)||void 0===l||l.stop(),this.Xn(e),this.Zn()}Zn(){this.We+=1,this.ze=[],this.Ue=0,this.ti=void 0,this.He=!1}Xn(t=!1){var e,n,i;t||null===(i=this.le)||void 0===i||i.cancel(),null===(e=this.ei)||void 0===e||e.stop(),this.he=[],null===(n=this.$n)||void 0===n||n.stop(),this.$n=void 0,this.ue=!1,this.Ae&&(this.Ae.stopRequested=!0,this.Ae.startRequested=!1),this.ae&&this.qn(this.ae),this.ae=void 0}qn(t){this.Ie-=1;try{t()}catch(t){Ir.warn("could not stop rrweb",t)}}ni(){if(!this.ti||0===this.Ue)return!1;if(this.He)return!0;this.He=!0,this.ii=void 0;const t=this.We;return this.Kn(),this.Xn(),this.ti.catch(()=>{}).then(()=>{t===this.We&&(this.He=!1,this.hn(),this.fn(),this.ri(),this.Yn(),Ir.info("stopped"))}).catch(()=>{this.He=!1,this.ri(),this.Yn(),Ir.info("stopped")}),!0}stop(t=!1){if(this.Xn(t),this.en)this.dn();else if(this.ni())return;this.hn(),this.fn(),this.ri(),this.Yn(t),Ir.info("stopped")}ri(){this.cn(void 0,{preserveLogDedup:this.en}),this.we=!1}flushBeforeIdentityReset(){(this.isStarted||this.He)&&(this.dn(),this.hn())}tn(t){const e=this.le,n=this.en;let i;this.en=!0,this.ce=Date.now();const r={cancelled:!1,cancel(){r.cancelled=!0,null==e||e.cancel(),null==i||i()}};this.le=r;const o=()=>{var t,e;this.stop(!0),r.cancelled||this._instance.config.disable_session_recording||this._instance.has_opted_out_capturing()?r.cancel():(this.oi=void 0,this.ye=0,this.pe=0,this.me=0,this.ge=0,this.Ce=0,this.Me=void 0,this.Te=void 0,null===(t=Er())||void 0===t||null===(e=t.resetSnapshotCostState)||void 0===e||e.call(t),this.start("session_id_changed"),(r.cancelled&&!this.isStarted||this._instance.config.disable_session_recording||this._instance.has_opted_out_capturing())&&(r.cancel(),this.discard({discardProducerEvents:!0})))};try{var s;const t=null===(s=Or())||void 0===s?void 0:s.withStyleRuleSourceHandoff;t&&this.ae?t(this.ae,t=>{i=t,o()}):o()}finally{this.le=e,this.en=n}r.cancelled||(this.cn(t?"no_interaction_since_session_rotated":void 0),this.we=!1)}cn(t,{preserveLogDedup:e=!1}={}){if(this.be=!G(t),this.ii=t,G(t))return void(e||(this.si=void 0));if(this.en)return;const n=`${this.sessionId}:${t}`;n!==this.si&&(this.si=n,Ir.info(`holding buffer: ${t}. nothing is uploaded until the user interacts with the page`))}Wn(){this.isStarted||(this.Se=!0),this.be&&(this.cn(void 0),this.we=!1,this.ke&&(this.ke=!1,this.Bt()),this.ai())}discard({discardProducerEvents:t=!1}={}){t&&(this.li||this._instance.config.session_recording.selectMaskingFn)&&Mi.Dt(this.yn),this.be=!0,t&&(this.fn(),this.Xn()),this.fn(),this.Yn(),this.fn(),this.ri(),Ir.info("discarded")}ui(t,e,n,i,r){if(-1===n)return this.ye+=1,void Ir.warn("could not stringify event - dropping it to keep the rest of the recording");const o={$snapshot_bytes:n,$snapshot_data:e,$session_id:i,$window_id:r};"disabled"!==this.status?(this.ci(t,i),this.di(o)):this.fn()}hi(){try{this.fi()}catch(t){this.$e||(this.$e=!0,Ir.error("could not track full snapshot cost",t))}}fi(){var t,e;const n=null===(t=Er())||void 0===t||null===(e=t.getLastSnapshotCost)||void 0===e?void 0:e.call(t);n&&n!==this.oi&&(this.oi=n,500>n.durationMs||Ir.warn("full snapshot was slow, the page may have been unresponsive while it ran",{durationMs:Math.round(n.durationMs),stylesheetMs:Math.round(n.stylesheetMs),nodeCount:n.nodeCount,cssRuleCount:n.cssRuleCount,nonDeferrableCssRuleCount:n.nonDeferrableCssRuleCount,deferredStylesheetCount:n.deferredStylesheetCount}))}ci(t,e){2!==t.type?3===t.type&&(G(this.qe)||this.qe===e||this.je===e||(this.je=e,Ir.info("incremental snapshot for a session with no full snapshot - requesting one",{sessionId:e}),this.Bt())):this.qe=e}pi(t){t.counted&&t.generation===this.We&&(this.Ue=Math.max(0,this.Ue-1)),t.counted=!1,this.ze=this.ze.filter(e=>e!==t)}mi(t,e,n){t.processed||t.generation!==this.We||(t.processed=!0,this.ui(t.event,e,n,t.targetSessionId,t.targetWindowId))}gi(t){try{let e,n=t.event;if(t.compressionEnabled)try{({event:n,size:e}=Qr(t.event))}catch(t){Ir.warn("could not process queued compression event - will use uncompressed event",t)}G(e)&&(e=$n(t.event));try{this.mi(t,n,e)}catch(t){Ir.warn("could not capture queued compression event",t)}}finally{this.pi(t)}}dn(){[...this.ze].forEach(t=>{try{this.gi(t)}catch(t){Ir.warn("could not drain queued compression event",t)}})}yi(t,e,n,i){var r=this;const o={event:t,compressionEnabled:e,targetSessionId:n,targetWindowId:i,generation:this.We,processed:!1,counted:!0};this.ze.push(o),this.Ue+=1;const s=(a=A(function*(){try{if(o.processed)return;let n,i;try{const r=e?Wr(t)?yield function(t){return Zr.apply(this,arguments)}(t):Qr(t):{event:t,size:$n(t)};n=r.event,i=r.size}catch(e){Ir.warn("could not process queued compression event - will use uncompressed event",e),n=t,i=$n(t)}r.mi(o,n,i)}finally{r.pi(o)}}),function(){return a.apply(this,arguments)});var a;this.ti=this.ti?this.ti.catch(()=>{}).then(s):s()}onRRwebEmit(e,n){var i,r,o,s,a,l,u,c,d,h,f;if(!this._instance.sessionManager)return;if(this.Fn(),!e||!H(e))return;if(4===e.type){const t=this.Tn(e.data.href);if(this.Dn=t,!t)return;e.data.href=t}else this.Ln();if(null===(i=this.oe)||void 0===i||i.checkUrlTriggers(this.sessionId,()=>this.Hn(),()=>this.Gn(),(t,e)=>this.Vn(t,e)),this.tt.urlBlocked&&!function(t){return 5===t.type&&"recording paused"===t.data.tag}(e))return;2===e.type&&(this.hi(),Promise.resolve().then(()=>this.hi()),this.zn(),null===(h=this.ei)||void 0===h||h.reset(),null===(f=this._instance.persistence)||void 0===f||f.register_once({$debug_first_full_snapshot_timestamp:e.timestamp},void 0));const v=2===e.type&&(null===(r=this.oe)||void 0===r?void 0:r.hasPendingTriggers(this.sessionId));v&&this.bi();const p=this.ei?this.ei.throttleMutations(e):e;if(!p)return void(!0===this.fe&&this.ve++);const m=function(t){const e=t;if(e&&H(e)&&6===e.type&&H(e.data)&&"rrweb/console@1"===e.data.plugin){e.data.payload.payload.length>10&&(e.data.payload.payload=e.data.payload.payload.slice(0,10),e.data.payload.payload.push("...[truncated]"));const n=[];for(let t=0;e.data.payload.payload.length>t;t++)n.push(e.data.payload.payload[t]&&e.data.payload.payload[t].length>2e3?e.data.payload.payload[t].slice(0,2e3)+"...[truncated]":e.data.payload.payload[t]);return e.data.payload.payload=n,t}return t}(p),g=function(t){return Kr(t)?t.data.payload:null}(m),y=function(t){return Xr(t)?t.data.payload:null}(m),b=function(t){return Yr(t)?t.data.payload:null}(m);g||y?(null==g?void 0:g.lastActivityTimestamp)&&(m.timestamp=g.lastActivityTimestamp):(null==b?void 0:b.sessionId)||this.wi(m,n);const w=null!==(o=null!==(s=null!==(a=null==g?void 0:g.currentSessionId)&&void 0!==a?a:null==y?void 0:y.nextSessionId)&&void 0!==s?s:null==b?void 0:b.sessionId)&&void 0!==o?o:this.Xt,k=null!==(l=null!==(u=null!==(c=null==g?void 0:g.currentWindowId)&&void 0!==c?c:null==y?void 0:y.nextWindowId)&&void 0!==u?u:null==b?void 0:b.windowId)&&void 0!==l?l:this.Ye;if(!0===this.fe&&!function(t){return Yr(t)||Kr(t)||Xr(t)}(m))return void(function(t){return 2===t.type||4===t.type||3===t.type&&9!==t.data.source}(m)&&this.ve++);2===m.type&&(this.ve=0),b&&(m.timestamp=b.lastActivityTimestamp+b.threshold);const S=this.ue;this.ue=!0,v?this.On(!0):S||this.On();const _=null===(d=this._instance.config.session_recording.compress_events)||void 0===d||d;if(5===m.type&&"$json_ld"===m.data.tag){let e;try{e=t?this.Tn(t.location.href):void 0}catch(t){}m.data.href=e}if(this.Ue>0||_&&Wr(m))return void this.yi(m,_,w,k);const{event:x,size:C}=_?Qr(m):{event:m,size:$n(m)};this.ui(m,x,C,w,k)}get status(){return this.oe?this.oe.getStatus({instance:this._instance,sessionId:this.sessionId,isSampled:this.ne,rrwebError:this._e,urlTriggerMatching:this.tt,eventTriggerMatching:this.et,linkedFlagMatching:this.nt,remoteConfig:this.ie}):un}log(t,e="log"){var n;null===(n=this._instance.sessionRecording)||void 0===n||n.onRRwebEmit({type:6,data:{plugin:"rrweb/console@1",payload:{level:e,trace:[],payload:[JSON.stringify(t)]}},timestamp:Date.now()})}overrideLinkedFlag(){this.nt.linkedFlagSeen=!0,this.Bt(),this.Wn(),this.jt("linked_flag_overridden")}overrideSampling(){var t;null===(t=this._instance.persistence)||void 0===t||t.register({$session_is_sampled:this.sessionId,$replay_sample_rate:null}),this.Bt(),this.Wn(),this.jt("sampling_overridden")}overrideTrigger(t){this.Vn(t),this.Wn()}ki(){try{var e;const n=null==t||null===(e=t.location)||void 0===e?void 0:e.href;if(!n)return;const i=this.Tn(n);if(!i)return;return new URL(i).hostname||void 0}catch(t){return}}Kn(){this.Si&&(clearTimeout(this.Si),this.Si=void 0)}ai(){this.Si||(this.Si=setTimeout(()=>{this.hn()},2e3))}xi(){return this.qe!==this.Rt.sessionId&&0!==this.Rt.data.length&&this.Rt.data.every(t=>5===(null==t?void 0:t.type)&&!Kr(t)&&!Xr(t))}Ci(){var t,e;return null!==(t=null===(e=this.oe)||void 0===e?void 0:e.getPendingTriggerConditions(this.sessionId))&&void 0!==t?t:[]}Mi(t){if("buffering"!==t)return G(this.Ti)||this._instance.register_for_session({[k]:[]}),void(this.Ti=void 0);const e=this.Ci();if(0===e.length)return G(this.Ti)||this._instance.register_for_session({[k]:[]}),void(this.Ti=void 0);const n=e.join(", "),i=`${this.sessionId}:${n}`;i!==this.Ti&&(this.Ti=i,this._instance.register_for_session({[k]:e}),Ir.info(`buffering: ${n}`))}Ii(){var t;return"memory"!==this._instance.config.persistence&&!0!==(null===(t=this._instance.persistence)||void 0===t?void 0:t.Ai)&&Mi.Ot()}Ri(){this.li||this._instance.config.session_recording.selectMaskingFn||0!==this.Rt.data.length&&this.Rt.size!==this.Ei&&943718.4>=this.Rt.size&&this.Ii()&&(this.Ei=this.Rt.size,Mi.$t(this.yn,this.Rt))}Jn(){if(this.Be||!this.Ii())return;this.Be=!0;const t=Mi.Pt(this.yn);Mi.Dt(this.yn),!this._instance.config.session_recording.selectMaskingFn&&H(t)&&U(t.data)&&0!==t.data.length&&U(t.sizes)&&t.sizes.length===t.data.length&&Y(t.size)&&t.sessionId===this.Xt&&t.windowId===this.Ye&&(this.Rt.data.length>0||(this.Rt=t))}hn(t=!1){var e;if(this.Kn(),this.be)return this.Rt;if(this.xi())return this.Rt.size>943718.4?this.fn():(t&&this.Ri(),this.Rt);const n=this.Rt;null===(e=this.oe)||void 0===e||e.ensureSamplingDecision(this.sessionId);const i=this.sn(),r=this.status;if(this.Mi(r),"buffering"===r||"paused"===r||"disabled"===r||i)return!t||"active"!==r&&"sampled"!==r||this.Ri(),this.ai(),this.Rt;if(this.Rt!==n)return this.Rt;if(n.data.length>0){var o;const t=this.ki();Dn(n).forEach(e=>{try{var n;null===(n=this.Ke)||void 0===n||n.trackSize(e.sessionId,e.size),this.Oi(L(L(L(L({$snapshot_bytes:e.size,$snapshot_data:e.data,$session_id:e.sessionId,$window_id:e.windowId,$lib:Ti.LIB_NAME,$lib_version:Ti.LIB_VERSION,$snapshot_host:t},this.pe>0?{$sdk_debug_replay_throttled_mutations_dropped:this.pe}:{}),this.me>0?{$sdk_debug_replay_oversized_mutations_dropped:this.me}:{}),this.ge>0?{$sdk_debug_replay_oversized_mutation_bytes_dropped:this.ge}:{}),this.ye>0?{$sdk_debug_replay_unstringifiable_events_dropped:this.ye}:{}))}catch(t){Ir.warn("could not capture snapshot chunk - skipping it",t)}}),G(this.Ei)||(Mi.Dt(this.yn),this.Ei=void 0),null===(o=this.oe)||void 0===o||o.onFlushComplete()}return this.fn()}di(t){var e;const n=2+((null===(e=this.Rt)||void 0===e?void 0:e.data.length)||0),i=t.$session_id,r=this.Rt.sessionId!==i;if(r||!0!==this.fe&&!this.be&&this.Rt.size+t.$snapshot_bytes+n>943718.4){const e=this.Xt;if(this.Rt=this.hn(),this.Xt!==e)return;r&&this.Rt.data.length>0&&(this.Rt=this.fn()),this.Rt.sessionId=i,this.Rt.windowId=t.$window_id}this.be&&(this.ke||this.Rt.size+t.$snapshot_bytes+n>943718.4)?this.ke=!0:(this.Rt.size+=t.$snapshot_bytes,this.Rt.data.push(t.$snapshot_data),this.Rt.sizes.push(t.$snapshot_bytes),!0===this.fe||this.be||this.ai())}Oi(t){this._instance.capture("$snapshot",t,{_url:this._instance.requestRouter.endpointFor("api",this.se),_noTruncate:!0,_batchKey:"recordings",skip_client_rate_limiting:!0})}get an(){var t,e;const n=null===(t=this.Rt)||void 0===t?void 0:t.data[(null===(e=this.Rt)||void 0===e?void 0:e.data.length)-1];return n?n.timestamp-this._sessionStartTimestamp:null}bi(){if(!this.Rt||0===this.Rt.data.length)return this.fn();let t=-1;for(let e=this.Rt.data.length-1;e>=0;e--)if(4===this.Rt.data[e].type){t=e;break}return 0>t?this.fn():(this.Rt.data=this.Rt.data.slice(t),this.Rt.sizes=this.Rt.sizes.slice(t),this.Rt.size=this.Rt.sizes.reduce((t,e)=>t+e,0),this.Rt)}fn(){return this.Rt={size:0,data:[],sizes:[],sessionId:this.Xt,windowId:this.Ye},this.Rt}jt(t,e){this._instance.register_for_session({[T]:t}),Ir.info(t.replace("_"," "),e),"session_id_changed"!==t&&this.Vt("$recording_started",L({reason:t},e))}$i(t,e){var n;return!e&&3===t.type&&-1!==Ar.indexOf(null===(n=t.data)||void 0===n?void 0:n.source)}wi(t,e){const n=this.$i(t,e);n||!0===this.fe||t.timestamp-this.ce>this.ee&&(this.fe=!0,clearInterval(this.Un),this.Vt("sessionIdle",{eventTimestamp:t.timestamp,lastActivityTimestamp:this.ce,threshold:this.ee,bufferLength:this.Rt.data.length,bufferSize:this.Rt.size,sessionId:this.Xt,windowId:this.Ye}),this.hn());const{windowId:i,sessionId:r}=this.te.checkAndGetSessionAndWindowId(!n,t.timestamp);let o=!1;if(n&&(this.ce=t.timestamp,this.fe)){const e="unknown"===this.fe;this.fe=!1,e||(this.Vt("sessionNoLongerIdle",{reason:"user activity",type:t.type}),o=!0)}const s=this.Xt!==r,a=this.Ye!==i;if(this.Ye=i,this.Xt=r,s||a){const t=s&&!1!==this.fe;t&&(this.fe="unknown"),this.tn(t)}else if(n&&this.Wn(),o){var l;const t=["sampled","active"].includes(this.status)||(null===(l=this.oe)||void 0===l?void 0:l.hasPendingTriggers(this.sessionId));this.ve>0&&t&&this.Bt(),this.On(),this.zn()}}Xe(){var t;null===(t=this.oe)||void 0===t||t.clearConditionalRecordingPersistence()}get sdkDebugProperties(){var t;return L(L({$recording_status:this.status,$sdk_debug_replay_flush_hold_reason:this.ii,$sdk_debug_replay_internal_buffer_length:this.Rt.data.length,$sdk_debug_replay_internal_buffer_size:this.Rt.size,$sdk_debug_session_start:this._sessionStartTimestamp,$sdk_debug_replay_flushed_size:null===(t=this.Ke)||void 0===t?void 0:t.currentTrackedSize(this.sessionId),$sdk_debug_replay_rrweb_error:this._e,[C]:this.Nn,[M]:this.xe},this.Ce>0?{$sdk_debug_replay_rrweb_method_failures:this.Ce,$sdk_debug_replay_rrweb_last_method_error:this.Me,$sdk_debug_replay_rrweb_recording_at_failure:this.Te,$sdk_debug_replay_rrweb_live_recorders:this.Ie}:{}),this.Ee>0?{$sdk_debug_replay_rrweb_restarts:this.Ee}:{})}get Nn(){var t,e,n;return!!this.ae&&(null===(t=null===(e=Or())||void 0===e||null===(n=e.isRecording)||void 0===n?void 0:n.call(e))||void 0===t||t)}jn(){var e;if(this.ae)return;if(this.Ae)return void(this.Ae.startRequested=this.Ae.stopRequested);this.xe=!0;const i={blockClass:"ph-no-capture",blockSelector:void 0,ignoreClass:"ph-ignore-input",maskTextClass:"ph-mask",maskTextSelector:void 0,maskTextFn:void 0,maskAllInputs:!0,maskInputOptions:{password:!0},maskInputFn:void 0,selectMaskingFn:void 0,maskAllElementAttributes:!1,maskAttributeFn:void 0,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0,inlineStylesheetBudgetRules:1e4,recordCrossOriginIframes:!1,sampling:void 0,attributeFilter:void 0},r=this._instance.config.session_recording;for(const[t,e]of Object.entries(r||{}))if(t in i)if("maskInputOptions"===t)i.maskInputOptions=L({password:!0},e);else if("sampling"===t){const t=null!=e?e:{},n={};G(t.mousemove)||(n.mousemove=t.mousemove),G(t.mouseInteraction)||(n.mouseInteraction=t.mouseInteraction),i.sampling=n}else i[t]=e;var o,s,a,l;!0===(null==r?void 0:r.captureJsonLd)&&!0!==i.slimDOMOptions&&"all"!==i.slimDOMOptions&&(i.slimDOMOptions=L(L({},i.slimDOMOptions),{},{script:!0})),this.Sn&&this.Sn.enabled&&(i.recordCanvas=!0,i.sampling=L(L({},i.sampling),{},{canvas:this.Sn.fps}),i.dataURLOptions={type:"image/webp",quality:this.Sn.quality},i.canvasResolutionScale=this.kn,i.canvasMasking={configured:()=>{var t;return W(null===(t=this._instance.config.session_recording)||void 0===t||null===(t=t.canvasCapture)||void 0===t?void 0:t.maskRegionsFn)},regionsFn:t=>{var e;const n=null===(e=this._instance.config.session_recording)||void 0===e||null===(e=e.canvasCapture)||void 0===e?void 0:e.maskRegionsFn;if(W(n))try{var i;return null!==(i=n(t))&&void 0!==i?i:null}catch(t){return this.Fe||(this.Fe=!0,Ir.warn("canvasCapture.maskRegionsFn threw, canvas frames will be skipped",t)),null}}}),this.bn&&(i.maskAllInputs=null===(o=this.bn.maskAllInputs)||void 0===o||o,i.maskTextSelector=null!==(s=this.bn.maskTextSelector)&&void 0!==s?s:void 0,i.blockSelector=null!==(a=this.bn.blockSelector)&&void 0!==a?a:void 0,i.maskAllElementAttributes=null!==(l=this.bn.maskAllElementAttributes)&&void 0!==l&&l),i.maskAllElementAttributes&&i.maskAttributeFn&&(i.maskAttributeFn=void 0,this.De||(this.De=!0,Ir.warn('`maskAllElementAttributes` and `maskAttributeFn` are mutually exclusive, and `maskAttributeFn` is being ignored. Remove one of the two. Note that `maskAllElementAttributes` can also come from your project\'s "Privacy and masking" settings. See https://posthog.com/docs/session-replay/privacy'))),this.wn();const u=Or();if(!u)return void Ir.error("_startRecorder was called but rrwebRecord is not available. This indicates something has gone wrong.");if(i.selectMaskingFn&&!0!==u.supportsSelectMasking)return void Ir.error("Session recording has not started: the recorder does not support selectMaskingFn.");this.ei=null!==(e=this.ei)&&void 0!==e?e:new mi(u,{refillRate:this._instance.config.session_recording.__mutationThrottlerRefillRate,bucketSize:this._instance.config.session_recording.__mutationThrottlerBucketSize,onBlockedNode:(t,e)=>{const n=`Too many mutations on node '${t}'. Rate limiting. This could be due to SVG animations or something similar`;Ir.info(n,{node:e}),this.log("[SessionRecording] "+n,"warn")},onDroppedAttributeMutations:t=>this.pe+=t,bytesRefillRate:this._instance.config.session_recording.__mutationBytesRefillRate,bytesBucketSize:this._instance.config.session_recording.__mutationBytesBucketSize,resyncIntervalMs:this.Bn,onDroppedOversizedMutation:t=>{0===this.me&&this.log("[SessionRecording] Dropped an oversized DOM mutation to keep the recording playable. The recording will resync with a full snapshot.","warn"),this.me+=1,this.ge+=t},requestFullSnapshot:()=>this.Bt()});const c=i.selectMaskingFn;this.li=c,c&&(i.selectMaskingFn=t=>{try{return c(t)}catch(t){throw this.Ne||(this.Ne=!0,Ir.warn("selectMaskingFn threw; affected selects are recorded as masked.",t)),t}});const d=this.Cn(),h=this.le,f={stopRequested:!1,startRequested:!1};let v;this.Ae=f;try{v=u(L(L({emit:(t,e,n)=>{(null==h?void 0:h.cancelled)||f.stopRequested||(h&&this.le===h&&(this._instance.config.disable_session_recording||this._instance.has_opted_out_capturing())?h.cancel():this.onRRwebEmit(t,n))},plugins:d,errorHandler:(t,e)=>"rrweb"===e&&(this.Pe||(this.Pe=!0,Ir.error("rrweb internal error - recording will continue but may be incomplete",t)),!0)},i),{},{recordAfter:"DOMContentLoaded"}))}finally{this.Ae=void 0}if(v&&(this.Ie+=1),f.stopRequested){if(v&&this.qn(v),f.startRequested){const t=this.le;(null==t?void 0:t.cancelled)&&(this.le=void 0),this.jn(),this.le=t}}else{if(this.ae=v,!this.ae)return this._e=!0,void Ir.error("rrweb failed to start - Loss of recording data is possible. Check the browser console for rrweb errors.");this._e=!1,!0===(null==r?void 0:r.captureJsonLd)&&n&&(null==t?void 0:t.MutationObserver)&&!this.$n&&(this.$n=function(t,e,n){const i=new WeakMap,r=n.getCaptureState||(()=>!0);let o=er;const s=function(t,e){const n=e.attributeFilter;return e.maskAllElementAttributes||e.maskAttributeFn||(null==n?void 0:n.length)&&!n.includes("id")?rr:n=>{const i=t.getElementById(n);return!!i&&"SCRIPT"!==i.nodeName&&(!e.isRecordedElement||e.isRecordedElement(i))&&!_r(i,e.blockClass,e.blockSelector)}}(t,n),a=e=>{try{const a=r();if(!o||!1===a||!e.isConnected||e.ownerDocument!==t||function(t,e){return _r(t,e.blockClass,e.blockSelector)||_r(t,e.maskTextClass,e.maskTextSelector)}(e,n))return;const l=function(t,e=rr,n){if(!t||t.length>er)return null;try{const i=JSON.parse(t),r={maskUrl:n,remainingNodes:2048,exceeded:!1},o=U(i)?i.map(t=>wr(t,e,r)):wr(i,e,r);if(r.exceeded||Z(o)||U(o)&&(!o.length||o.some(Z)))return null;const s=JSON.stringify(o);return s.length>2e4?null:[o,s]}catch(t){return null}}(e.text,s,n.maskUrl);if(!l)return void i.delete(e);const[u,c]=l;if(Z(a))return void i.set(e,c);if(i.get(e)!==c){if(c.length>o)return void(o=0);n.emit(u)&&(i.set(e,c),o-=c.length)}}catch(t){return}};try{const n=new e(t=>{try{if(!o||!1===r())return;const e=t=>{for(const e of xr(t))a(e)};for(const n of t)if("childList"===n.type)kr(n.target)&&a(n.target),n.addedNodes.forEach(e);else if("characterData"===n.type){const t=n.target.parentNode;t&&kr(t)&&a(t)}else"attributes"===n.type&&kr(n.target)&&a(n.target)}catch(t){return}});return n.observe(t,{attributes:!0,attributeFilter:["type"],characterData:!0,childList:!0,subtree:!0}),{scan(e=!1){o&&!1!==r()&&xr(t.documentElement).forEach(t=>{e&&i.delete(t),a(t)})},stop(){return n.disconnect()}}}catch(t){return{scan(){},stop(){}}}}(n,t.MutationObserver,{maskUrl:t=>this.Tn(t),attributeFilter:i.attributeFilter,blockClass:i.blockClass,blockSelector:i.blockSelector,isRecordedElement:t=>u.mirror.getId(t)>0,maskAllElementAttributes:i.maskAllElementAttributes,maskAttributeFn:i.maskAttributeFn,maskTextClass:i.maskTextClass,maskTextSelector:i.maskTextSelector,getCaptureState:()=>{var t;return!0!==(null===(t=this._instance.config.session_recording)||void 0===t?void 0:t.captureJsonLd)||this.tt.urlBlocked||this.tt.isCurrentUrlBlocked()?null:this.Rn()},emit:t=>this.En(t)}),this.tt.isCurrentUrlBlocked()&&this.$n.scan()),this.ce=Date.now(),this.fe=K(this.fe)?this.fe:"unknown",this.tryAddCustomEvent("$remote_config_received",this.ie),this.Vt("$session_options",{sessionRecordingOptions:i,activePlugins:d.map(t=>null==t?void 0:t.name)}),this.Vt("$posthog_config",{config:this._instance.config})}}tryAddCustomEvent(t,e){return this.Vt(t,e)}};const eo=["type"];var no=function(t){return t[t.DomContentLoaded=0]="DomContentLoaded",t[t.Load=1]="Load",t[t.FullSnapshot=2]="FullSnapshot",t[t.IncrementalSnapshot=3]="IncrementalSnapshot",t[t.Meta=4]="Meta",t[t.Custom=5]="Custom",t[t.Plugin=6]="Plugin",t}({}),io=function(t){return t[t.Mutation=0]="Mutation",t[t.MouseMove=1]="MouseMove",t[t.MouseInteraction=2]="MouseInteraction",t[t.Scroll=3]="Scroll",t[t.ViewportResize=4]="ViewportResize",t[t.Input=5]="Input",t[t.TouchMove=6]="TouchMove",t[t.MediaInteraction=7]="MediaInteraction",t[t.StyleSheetRule=8]="StyleSheetRule",t[t.CanvasMutation=9]="CanvasMutation",t[t.Font=10]="Font",t[t.Log=11]="Log",t[t.Drag=12]="Drag",t[t.StyleDeclaration=13]="StyleDeclaration",t[t.Selection=14]="Selection",t[t.AdoptedStyleSheet=15]="AdoptedStyleSheet",t[t.CustomElement=16]="CustomElement",t}({}),ro=function(t){return t[t.MouseUp=0]="MouseUp",t[t.MouseDown=1]="MouseDown",t[t.Click=2]="Click",t[t.ContextMenu=3]="ContextMenu",t[t.DblClick=4]="DblClick",t[t.Focus=5]="Focus",t[t.Blur=6]="Blur",t[t.TouchStart=7]="TouchStart",t[t.TouchMove_Departed=8]="TouchMove_Departed",t[t.TouchEnd=9]="TouchEnd",t[t.TouchCancel=10]="TouchCancel",t}({}),oo=function(t){return t[t.Mouse=0]="Mouse",t[t.Pen=1]="Pen",t[t.Touch=2]="Touch",t}({}),so=function(t){return t[t["2D"]=0]="2D",t[t.WebGL=1]="WebGL",t[t.WebGL2=2]="WebGL2",t}({}),ao=function(t){return t[t.Play=0]="Play",t[t.Pause=1]="Pause",t[t.Seeked=2]="Seeked",t[t.VolumeChange=3]="VolumeChange",t[t.RateChange=4]="RateChange",t}({}),lo=function(t){return t[t.Document=0]="Document",t[t.DocumentType=1]="DocumentType",t[t.Element=2]="Element",t[t.Text=3]="Text",t[t.CDATA=4]="CDATA",t[t.Comment=5]="Comment",t}({});function uo(t,e){return-1!==t.indexOf(e)}Date,Date;var co={Node:["childNodes","parentNode","parentElement","textContent","previousSibling","nextSibling","lastChild"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot"],MutationObserver:[]},ho={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:["querySelector","querySelectorAll"],MutationObserver:["constructor"]},fo={};function vo(t){if(fo[t])return fo[t];const e=function(t){var e,n;const i=null===(e=globalThis)||void 0===e||null===(e=e.Zone)||void 0===e||null===(n=e.__symbol__)||void 0===n?void 0:n.call(e,t);return i&&globalThis[i]?globalThis[i]:void 0}(t)||globalThis[t],n=e.prototype,i=t in co?co[t]:void 0,r=Boolean(i&&i.every(t=>{var e;return Boolean(null===(e=Object.getOwnPropertyDescriptor(n,t))||void 0===e||null===(e=e.get)||void 0===e?void 0:e.toString().includes("[native code]"))})),o=t in ho?ho[t]:void 0,s=Boolean(o&&o.every(t=>{var e;return"function"==typeof n[t]&&(null===(e=n[t])||void 0===e?void 0:e.toString().includes("[native code]"))}));if(r&&s)return fo[t]=e.prototype,e.prototype;const a=document.createElement("iframe");a.style.display="none";let l=!1;try{document.body.appendChild(a);const i=a.contentWindow;if(!i)return e.prototype;const r=i[t].prototype;return r?(uo(u=navigator.userAgent,"AppleWebKit")&&!uo(u,"Chrome")&&(a.classList.add("rr-block","ph-no-capture"),a.setAttribute("__rrwebUntaintedPrototype",t),l=!0),fo[t]=r):n}catch(t){return n}finally{!l&&a.parentNode&&document.body.removeChild(a)}var u}var po=Object.create(null);function mo(t,e,n){var i;const r=po[t],o=r[n];if(o)return o.call(e);const s=vo(t),a=null===(i=Object.getOwnPropertyDescriptor(s,n))||void 0===i?void 0:i.get;return a?(r[n]=a,a.call(e)):e[n]}po.Node=Object.create(null),po.ShadowRoot=Object.create(null),po.MutationObserver=Object.create(null),po.Element=Object.create(null);var go,yo={};function bo(t,e,n){const i=`${t}.${String(n)}`;if(yo[i])return yo[i].bind(e);const r=vo(t)[n];return"function"!=typeof r?e[n]:(yo[i]=r,r.bind(e))}function wo(){return vo("MutationObserver").constructor}function ko(t,e,n){try{if(!(e in t))return()=>{};const i=t[e],r={next:i},o=n(function(...t){return r.next.apply(this,t)});return"function"==typeof o&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:i},__rrweb_layer__:{enumerable:!1,value:r}})),t[e]=o,()=>{if(t[e]===o)return void(t[e]=r.next);const n=t=>{var e;return"function"==typeof t?null!==(e=t.__rrweb_layer__)&&void 0!==e?e:t.__posthog_layer__:void 0};let i=t[e],s=n(i);for(;s;){if(s.next===o)return void(s.next=r.next);i=s.next,s=n(i)}}}catch(t){return()=>{}}}var So={childNodes:t=>mo("Node",t,"childNodes"),parentNode:t=>mo("Node",t,"parentNode"),parentElement:t=>mo("Node",t,"parentElement"),textContent:t=>mo("Node",t,"textContent"),previousSibling:t=>mo("Node",t,"previousSibling"),nextSibling:t=>mo("Node",t,"nextSibling"),lastChild:t=>mo("Node",t,"lastChild"),isConnected(t){if(void 0===go){var e;const t=null===(e=Object.getOwnPropertyDescriptor(vo("Node"),"isConnected"))||void 0===e?void 0:e.get;go=(null==t?void 0:t.toString().includes("[native code]"))?t:null}return null==go?void 0:go.call(t)},contains:(t,e)=>bo("Node",t,"contains")(e),getRootNode:t=>bo("Node",t,"getRootNode")(),host:t=>t&&"host"in t?mo("ShadowRoot",t,"host"):null,styleSheets:t=>t.styleSheets,shadowRoot:t=>t&&"shadowRoot"in t?mo("Element",t,"shadowRoot"):null,querySelector:(t,e)=>bo("Element",t,"querySelector")(e),querySelectorAll:(t,e)=>bo("Element",t,"querySelectorAll")(e),mutationObserver:wo,patch:ko},_o=new WeakMap;function xo(t){let e=Object.getPrototypeOf(t);for(;e;){const t=_o.get(e);if(t)return t;e=Object.getPrototypeOf(e)}}var Co=new WeakMap,Mo=new WeakSet,To=new WeakSet,Io=!1;function Ao(t){return/(?:^|[\s;{}])-?[a-zA-Z][\w-]*\s*:\s*;/.test(t)}function Ro(t){return!!t.includes("var(")&&(!!/["'\\]|\/\*|url\(/i.test(t)||t.replace(/\{[^{};]*(?:;\s*)?\}/g,"{}").replace(/(^|[;{])\s*(?:--[\w-]+|color|background-color|width|height|min-width|max-width|min-height|max-height|font-size|font-weight|line-height|opacity|z-index|top|right|bottom|left)\s*:[^;{}]*/gi,"$1").includes("var("))}function Eo(t){try{for(;t;)Co.delete(t),t=t.parentRule}catch(t){Po()}}function Oo(t,e){try{if(Eo(t),Io||To.has(t)||"string"!=typeof e||!Ro(e))return;if("cssRules"in t&&t.cssRules.length>0){var n;let e=t.parentStyleSheet;for(;null==e?void 0:e.ownerRule;)e=e.ownerRule.parentStyleSheet;if("LINK"===(null==e||null===(n=e.ownerNode)||void 0===n?void 0:n.nodeName))return}const i=t.cssText;if(Ao(i)){Co.set(t,{text:e,cssText:i,realm:xo(t)});let n=t.parentRule;for(;n;)Mo.add(n),n=n.parentRule}}catch(t){}}function $o(t,e){try{if(Io||"string"!=typeof e||!Ro(e))return;const n=Array.from(t.cssRules);if(!n.some(t=>Ao(t.cssText)))return;const i=function(t){const e=[];let n=0,i=0,r=0,o=0,s="",a=!1,l=!1;for(let u=0;t.length>u;u++){const c=t[u];if(a)"*"===c&&"/"===t[u+1]&&(a=!1,u++);else if("\\"!==c)if(s)c===s&&(s="");else if("/"!==c||"*"!==t[u+1]){if(!l){const e=t.startsWith("\x3c!--",u)?4:t.startsWith("--\x3e",u)?3:0;if(e){u+=e-1,n=u+1;continue}}-1===" \t\n\r\f".indexOf(c)&&(l=!0),'"'!==c&&"'"!==c?("("===c?r++:")"===c?r--:"["===c?o++:"]"===c&&o--,r||o||("{"===c?i++:"}"===c&&i--,("}"===c&&0===i||";"===c&&0===i)&&(e.push(t.slice(n,u+1).trim()),n=u+1,l=!1))):s=c}else a=!0,u++;else l=!0,u++}return i||r||o||s||a?[]:e}(e);if(i.length!==n.length)return;n.forEach((t,e)=>Oo(t,i[e]))}catch(t){}}function Lo(t){var e;const n=Co.get(t);if(n){if(!1!==(null===(e=n.realm)||void 0===e?void 0:e.active)&&n.cssText===t.cssText)return n.text;Co.delete(t)}}function Do(t){Eo(t);try{let e=t;for(;e;)To.add(e),e=e.parentRule}catch(t){Po()}}function Fo(){Co=new WeakMap,Mo=new WeakSet}function Po(){Fo(),Io=!0}function No(){try{if("undefined"!=typeof performance&&performance.now)return performance.now()}catch(t){}return Date.now()}var qo=0;function jo(){qo+=1}function Bo(){return qo}function zo(t,e){return(e!==qo||t>6e4)&&!0}var Uo=0,Wo=0,Ho=0,Go={durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0},Vo=null,Qo=null,Zo=[],Jo=0,Yo=0,Ko={slowestBatchMs:0},Xo={deferredCount:0,failedCount:0,abandonedCount:0,totalMs:0,slowestSliceMs:0};function ts(t){(Uo+=1)>1||(Go={durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0},Zo=[],Jo=0,Qo=(t=>t&&t>0?t:null)(t),Wo=No(),Ho=qo)}function es(){return 0===Uo?Vo||{durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0}:(Uo-=1)>0?Go:(Go.durationMs=No()-Wo,Go.deferredStylesheetCount=Jo,Xo.deferredCount+=Jo,Qo=null,zo(Go.durationMs,Ho)?Go:Vo=Go)}function ns(t,e,n){let i=t.length;if(n>=32)return i;for(let r=0;t.length>r;r++){const o=t[r];try{const t=o.cssRules;if(t&&t.length)i+=ns(t,e,n+1);else if(e&&o.styleSheet){const t=o.styleSheet;if(!e.has(t)){e.add(t);const r=t.rules||t.cssRules;r&&(i+=ns(r,e,n+1))}}}catch(t){}}return i}function is(t){if(0===Uo)return;const e=ns(t,null,0);Go.cssRuleCount+=e,Yo>0&&(Go.nonDeferrableCssRuleCount+=e)}function rs(t){Yo+=1;try{return t()}finally{Yo-=1}}function os(t){Uo>0&&(Go.stylesheetMs+=t)}function ss(t){if(0===Uo||null===Qo)return!1;const e=Go.cssRuleCount-Go.nonDeferrableCssRuleCount;return e>=Qo||e+function(t){try{const e=t&&(t.rules||t.cssRules);if(!e)return 0;const n=new WeakSet;return n.add(t),ns(e,n,0)}catch(t){return 0}}(t)>Qo}function as(){const t=Zo;return Zo=[],t}function ls(){Xo.failedCount+=1}function us(t){t>0&&(Xo.abandonedCount+=t)}function cs(t){return cs="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},cs(t)}function ds(t,e,n){return(e=function(t){var e=function(t){if("object"!=cs(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=cs(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==cs(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function hs(t){return t.nodeType===t.ELEMENT_NODE}function fs(t){const e=t&&"host"in t&&"mode"in t&&So.host(t)||null;return Boolean(e&&"shadowRoot"in e&&So.shadowRoot(e)===t)}function vs(t){return"[object ShadowRoot]"==={}.toString.call(t)}function ps(t){return t.includes(" background-clip: text;")&&!t.includes(" -webkit-background-clip: text;")&&(t=t.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),t}function ms(t){const{cssText:e}=t;if(3>e.split('"').length)return e;const n=["@import",`url(${JSON.stringify(t.href)})`];return""===t.layerName?n.push("layer"):t.layerName&&n.push(`layer(${t.layerName})`),t.supportsText&&n.push(`supports(${t.supportsText})`),t.media.length&&n.push(t.media.mediaText),n.join(" ")+";"}var gs=0;function ys(t){const e=0===gs,n=e?No():0;gs+=1;try{const e=t.rules||t.cssRules;if(!e)return null;is(e);let n=t.href;return!n&&t.ownerNode&&(n=t.ownerNode.baseURI),ps(Array.from(e,t=>bs(t,n)).join(""))}catch(t){return null}finally{gs-=1,e&&os(No()-n)}}function bs(t,e){if(ks(t)){let e;try{e=ys(t.styleSheet)||ms(t)}catch(n){e=t.cssText}try{var n;if(e&&(null===(n=t.styleSheet)||void 0===n?void 0:n.href))return Ps(e,t.styleSheet.href)}catch(t){}return e}{var i;let n=Lo(t);if(void 0===n&&function(t){return Mo.has(t)}(t)){const e=Cs(t);null!==e&&(n=e+Array.from(t.cssRules,t=>bs(t,null)).join("")+"}")}return null!==(i=n)&&void 0!==i||(n=t.cssText),Ss(t)&&t.selectorText.includes(":")&&(n=ws(n)),e?Ps(n,e):n}}function ws(t){return t.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")}function ks(t){return"styleSheet"in t}function Ss(t){return"selectorText"in t}var _s=/^-?[A-Za-z_][\w-]*$/,xs=/^-?[A-Za-z_][\w-]*(\.-?[A-Za-z_][\w-]*)*$/;function Cs(t){const e=t;if(!e.cssRules||0===e.cssRules.length)return null;if(e.media&&"string"==typeof e.media.mediaText)return`@media ${e.media.mediaText} {`;if(Ss(t)){if("number"==typeof e.type&&1!==e.type)return null;const n=e.style?e.style.cssText:"";return`${t.selectorText} {${n?" "+n:""}`}if("containerName"in e)return"string"!=typeof e.containerQuery||e.containerName&&!_s.test(e.containerName)?null:`@container ${e.containerName?`${e.containerName} `:""}${e.containerQuery} {`;if("string"==typeof e.conditionText){let i="";try{var n;i=(null===(n=t.constructor)||void 0===n?void 0:n.name)||""}catch(t){return null}return""===i||"Object"===i||"CSSSupportsRule"===i?`@supports ${e.conditionText} {`:null}return"string"==typeof e.name?"keyText"in e.cssRules[0]?_s.test(e.name)?`@keyframes ${e.name} {`:null:""===e.name?"@layer {":xs.test(e.name)?`@layer ${e.name} {`:null:null}var Ms=class{constructor(){ds(this,"idNodeMap",new Map),ds(this,"nodeMetaMap",new WeakMap)}getId(t){var e,n;return t&&null!==(e=null===(n=this.getMeta(t))||void 0===n?void 0:n.id)&&void 0!==e?e:-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){const e=this.getId(t);if(this.idNodeMap.delete(e),t.childNodes&&t.childNodes.forEach(t=>this.removeNodeFromMap(t)),hs(t)){const e=So.shadowRoot(t);e&&this.removeNodeFromMap(e),"IFRAME"===t.nodeName&&t.contentDocument&&this.removeNodeFromMap(t.contentDocument)}}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,e){this.idNodeMap.set(e.id,t),this.nodeMetaMap.set(t,e)}replace(t,e){const n=this.getNode(t);if(n){const t=this.nodeMetaMap.get(n);t&&this.nodeMetaMap.set(e,t)}this.idNodeMap.set(t,e)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function Ts({element:t,maskInputOptions:e,tagName:n,type:i,value:r,maskInputFn:o}){let s=r||"";const a=i&&Is(i);return(e[n.toLowerCase()]||a&&e[a])&&(s=o?o(s,t):"*".repeat(s.length)),s}function Is(t){return t.toLowerCase()}var As=new Set(["rr_width","rr_height","rr_left","rr_top","rr_position","rr_transform","rr_display","rr_scrollleft","rr_scrolltop","rr_mediastate","rr_open_mode"]);function Rs({element:t,name:e,value:n,maskAllElementAttributes:i,maskAttributeFn:r,isGenerated:o=!1}){return n?i?o&&As.has(Is(e))?n:"*".repeat(n.length):r?r(e,n,t):n:n}var Es="__rrweb_original__";function Os(t){try{const e=t.type;return t.hasAttribute("data-rr-is-password")?"password":e?Is(e):null}catch(t){return null}}var $s=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,Ls=/^(?:[a-z+]+:)?\/\//i,Ds=/^www\..*/i,Fs=/^(data:)([^,]*),(.*)/i;function Ps(t,e){return(t||"").replace($s,(t,n,i,r,o,s)=>{const a=i||o||s,l=n||r||"";if(!a)return t;if(Ls.test(a)||Ds.test(a))return`url(${l}${a}${l})`;if(Fs.test(a))return`url(${l}${a}${l})`;if("/"===a[0])return`url(${l}${function(t){let e="";return e=t.indexOf("//")>-1?t.split("/").slice(0,3).join("/"):t.split("/")[0],e=e.split("?")[0],e}(e)+a}${l})`;const u=a.split("#")[0],c=a.substring(u.length),d=e.split("#")[0].split("/"),h=u.split("/");d.pop();for(const t of h)"."!==t&&(".."===t?d.pop():d.push(t));return`url(${l}${d.join("/")}${c}${l})`})}var Ns=new Map;function qs(t){return"http://www.w3.org/1999/xhtml"===t.namespaceURI?t.localName:void 0}function js(t,e,n,i=void 0){if(!n||"select"!==qs(t))return e;const r=null==i?void 0:i.input.get(t);if(r)return r;let o;try{o="unmasked"!==n(t)}catch(t){o=!0}const s=L(L({},e),{},{select:o});return null==i||i.input.set(t,s),s}function Bs(t,e,n,i){if(!n)return!1;let r=So.parentNode(t);const o=[];let s=!1;for(;r;){const t=null==i?void 0:i.content.get(r);if(void 0!==t){s=t;break}if(o.push(r),hs(r)&&"selectedcontent"===qs(r)){let t=So.parentElement(r);for(;t;){const r=t.localName;if("option"===r)break;if("select"===r){"select"===qs(t)&&js(t,e,n,i).select&&(s=!0);break}t=So.parentElement(t)}if(s)break}r=fs(r)?So.host(r):So.parentNode(r)}for(const t of o)null==i||i.content.set(t,s);return s}var zs,Us,Ws=1,Hs=new RegExp("[^a-z0-9-_:]");function Gs(){return Ws++}var Vs=!1,Qs=/^[^ \t\n\r\u000c]+/,Zs=/^[, \t\n\r\u000c]+/,Js=new WeakMap;function Ys(t,e){return e&&""!==e.trim()?Ks(t,e):e}function Ks(t,e){let n=Js.get(t);if(n||(n=t.createElement("a"),Js.set(t,n)),e){if(e.startsWith("blob:")||e.startsWith("data:"))return e}else e="";return n.setAttribute("href",e),n.href}function Xs(t,e){return(null==e?void 0:e.maxBase64ImageLength)?function(t,e){return e&&t.length>e?"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxkZWZzPgogICAgPHBhdHRlcm4gaWQ9InN0cmlwZXMiIHBhdHRlcm5Vbml0cz0idXNlclNwYWNlT25Vc2UiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+CiAgICAgIDxyZWN0IHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgZmlsbD0iYmxhY2siLz4KICAgICAgPHBhdGggZD0iTTggMEgxNkwwIDE2VjhMOCAwWiIgZmlsbD0iIzJEMkQyRCIvPgogICAgICA8cGF0aCBkPSJNMTYgOFYxNkg4TDE2IDhaIiBmaWxsPSIjMkQyRDJEIi8+CiAgICA8L3BhdHRlcm4+CiAgPC9kZWZzPgogIDxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjc3RyaXBlcykiLz4KPC9zdmc+Cg==":t}(t,e.maxBase64ImageLength):t}function ta(t,e,n,i,r,o){if(!i)return i;if("src"===n||"href"===n&&("use"!==e||"#"!==i[0])){const n=Ys(t,i);if(n.startsWith("data:")){if("img"===e&&r){let t=n;return((null==o?void 0:o.type)||void 0!==(null==o?void 0:o.quality))&&(t=function(t,e,n,i){if(1e5>e.length)return e;if(!t.complete||0===t.naturalWidth)return e;if(t.naturalWidth>4096||t.naturalHeight>4096)return e;const r=Ns.get(e);if(r&&r.type===n&&r.quality===i)return r.result;try{const r=document.createElement("canvas");r.width=t.naturalWidth,r.height=t.naturalHeight;const o=r.getContext("2d");if(!o)return e;o.drawImage(t,0,0);const s=r.toDataURL(n||"image/webp",null!=i?i:.4),a=e.length>s.length?s:e;if(Ns.size>=10){const t=Ns.keys().next().value;void 0!==t&&Ns.delete(t)}return Ns.set(e,{type:n,quality:i,result:a}),a}catch(t){return e}}(r,n,o.type,o.quality)),Xs(t,o)}if("image"===e)return Xs(n,o)}return n}if("xlink:href"===n&&"#"!==i[0]){const n=Ys(t,i);return"image"===e&&n.startsWith("data:")?Xs(n,o):n}return"background"!==n||"table"!==e&&"td"!==e&&"th"!==e?"srcset"===n?function(t,e){if(""===e.trim())return e;let n=0;function i(t){let i;const r=t.exec(e.substring(n));return r?(i=r[0],n+=i.length,i):""}const r=[];for(;i(Zs),e.length>n;){let o=i(Qs);if(","===o.slice(-1))o=Ys(t,o.substring(0,o.length-1)),r.push(o);else{let i="";o=Ys(t,o);let s=!1;for(;;){const t=e.charAt(n);if(""===t){r.push((o+i).trim());break}if(s)")"===t&&(s=!1);else{if(","===t){n+=1,r.push((o+i).trim());break}"("===t&&(s=!0)}i+=t,n+=1}}}return r.join(", ")}(t,i):"style"===n?Ps(i,Ks(t)):"object"===e&&"data"===n?Ys(t,i):i:Ys(t,i)}function ea(t,e,n){return("video"===t||"audio"===t)&&"autoplay"===Is(e)}function na(t){return"string"==typeof t&&Is(t).split(/\s+/).includes("stylesheet")}function ia(t,e,n){try{if("string"==typeof e){if(t.classList.contains(e))return!0}else if(ra(t,e,!1))return!0;if(n)return t.matches(n)}catch(t){}return!1}function ra(t,e,n){if(!t||!e)return!1;if(t.nodeType!==t.ELEMENT_NODE)return!!n&&ra(So.parentNode(t),e,n);const i=e.global||e.sticky?new RegExp(e):e;for(let e=t.classList.length;e--;)if(i.test(t.classList[e]))return!0;return!!n&&ra(So.parentNode(t),e,n)}function oa(t,e,n,i){let r;if(hs(t)){if(r=t,!So.childNodes(r).length)return!1}else{if(null===So.parentElement(t))return!1;r=So.parentElement(t)}try{if("string"==typeof e){if(i){if(r.closest(`.${e}`))return!0}else if(r.classList.contains(e))return!0}else if(ra(r,e,i))return!0;if(n)if(i){if(r.closest(n))return!0}else if(r.matches(n))return!0}catch(t){}return!1}function sa(t,e,n){const i=t.removeEventListener;"function"==typeof i&&i.call(t,e,n)}var aa=new Map;function la(t={}){aa.forEach((e,n)=>{t.keepChangedLinks&&e.changedLinkBaseline||(e.controller.abort(),aa.delete(n))})}function ua(t){try{return t.sheet}catch(t){return null}}function ca(t,e,n,i,r){const o=new AbortController,s=()=>{var e;(null===(e=aa.get(t))||void 0===e?void 0:e.controller)===o&&aa.delete(t),o.abort()};let a=!1;const l=()=>{if(!a){a=!0;try{e()}finally{s()}}};t.addEventListener("load",l,{signal:o.signal,once:!0}),t.addEventListener("error",s,{signal:o.signal,once:!0});const u=Date.now()+6e4;let c;const d=e=>{const r=i.length>e?i[e]:Math.max(i[i.length-1],1e3);c=setTimeout(()=>{t.isConnected?n()?l():Date.now()<u?d(e+1):s():s()},r)};o.signal.addEventListener("abort",()=>clearTimeout(c),{once:!0}),d(0),aa.set(t,{controller:o,changedLinkBaseline:r})}var da=[100,200,400,800,1600,3200,6400,12800,25600];function ha(t,e){return Array.from(t.styleSheets).find(t=>t.href===e)}function fa(t){return null==t?"":t.toLowerCase()}var va=!1,pa=!1;function ma(t,e,n=void 0){const{doc:i,mirror:r,blockClass:o,blockSelector:s,maskTextClass:a,maskTextSelector:l,skipChild:u=!1,inlineStylesheet:c=!0,maskInputOptions:d={},maskTextFn:h,maskInputFn:f,selectMaskingFn:v,maskAllElementAttributes:p=!1,maskAttributeFn:m,slimDOMOptions:g,dataURLOptions:y={},inlineImages:b=!1,recordCanvas:w=!1,canvasMaskingConfigured:k,onSerialize:S,onIframeLoad:_,iframeLoadTimeout:x=5e3,onIframeListenerRegistered:C,onStylesheetLoad:M,stylesheetLoadTimeout:T=5e3,keepIframeSrcFn:I=()=>!1,newlyAddedElement:A=!1,depth:R=0,maxDepth:E=50}=e;let{needsMask:O}=e,{preserveWhiteSpace:L=!0}=e;if(v&&!n&&(n={input:new WeakMap,content:new WeakMap,owner:new WeakMap}),v&&Bs(t,d,v,n))return null;if(R>=E)return pa=!0,va||(va=!0,console.warn(`[rrweb-snapshot] DOM tree depth exceeded max depth of ${E}. Children beyond this depth will not be recorded. This may indicate deeply nested DOM structures.`)),null;O||(O=oa(t,a,l,void 0===O)),Uo>0&&(Go.nodeCount+=1);const D=function(t,e,n){const{doc:i,mirror:r,blockClass:o,blockSelector:s,needsMask:a,inlineStylesheet:l,maskInputOptions:u={},maskTextFn:c,maskInputFn:d,selectMaskingFn:h,maskAllElementAttributes:f=!1,maskAttributeFn:v,dataURLOptions:p={},inlineImages:m,recordCanvas:g,canvasMaskingConfigured:y,keepIframeSrcFn:b,newlyAddedElement:w=!1}=e,k=function(t,e){if(!e.hasNode(t))return;const n=e.getId(t);return 1===n?void 0:n}(i,r);switch(t.nodeType){case t.DOCUMENT_NODE:return"CSS1Compat"!==t.compatMode?{type:lo.Document,childNodes:[],compatMode:t.compatMode}:{type:lo.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:lo.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:k};case t.ELEMENT_NODE:return function(t,e,n){const{doc:i,blockClass:r,blockSelector:o,inlineStylesheet:s,maskInputOptions:a={},maskInputFn:l,selectMaskingFn:u,maskAllElementAttributes:c=!1,maskAttributeFn:d,dataURLOptions:h={},inlineImages:f,recordCanvas:v,canvasMaskingConfigured:p,keepIframeSrcFn:m,newlyAddedElement:g=!1,rootId:y}=e,b=ia(t,r,o),w=u&&qs(t),k="select"===w||"option"===w||"selectedcontent"===w?w:function(t){if(t instanceof HTMLFormElement)return"form";const e=Is(t.tagName);return Hs.test(e)?"div":e}(t);let S=a;if(u&&!b&&("select"===k||"option"===k)){const e="option"===k?function(t,e){let n=So.parentElement(t);const i=[];for(;n&&"select"!==qs(n);){const t=null==e?void 0:e.owner.get(n);if(void 0!==t){n=t;break}i.push(n),n=So.parentElement(n)}for(const t of i)null==e||e.owner.set(t,n);return n}(t,n):t;e&&(S=js(e,a,u,n))}const _=new Set;let x={};const C=t.attributes.length;for(let e=0;C>e;e++){const n=t.attributes[e];ea(k,n.name)||(x[n.name]=ta(i,k,Is(n.name),n.value,t,h))}if("link"===k&&"string"==typeof x.href){var M;const e=null===(M=ua(t))||void 0===M?void 0:M.href;e&&(x.href=e)}if("link"===k&&s&&!b&&na(x.rel)){let e=t.sheet;if(!e){const n=function(t){return t.href}(t);n&&(e=ha(i,n),!e&&n.includes(".css"))&&(e=ha(i,window.location.origin+"/"+n.replace(window.location.href,"")))}let n=null;e&&(ss(e)?Uo>0&&(Zo.push(t),Jo+=1):n=ys(e)),n&&(delete x.rel,delete x.href,x._cssText=n)}var T;if("style"===k&&t.sheet&&!(t.innerText||So.textContent(t)||"").trim().length){const e=rs(()=>ys(t.sheet));e&&(x._cssText=e)}if("input"===k||"textarea"===k||"select"===k){var I;const e="select"===k?t.selectedOptions:void 0,n=e?(null===(I=Array.from(e).find(e=>{let n=e;for(;n&&n!==t;){if(ia(n,r,o))return!1;n=So.parentElement(n)}return!0}))||void 0===I?void 0:I.value)||"":t.value,i=t.checked;"radio"!==x.type&&"checkbox"!==x.type&&"submit"!==x.type&&"button"!==x.type&&(e||n)?x.value=n?Ts({element:t,type:Os(t),tagName:k,value:n,maskInputOptions:S,maskInputFn:l}):"":i&&(x.checked=i)}if("select"===k&&(u||S.select&&!l)&&(x.rr_maskedSelect=!!S.select||null,_.add("rr_maskedSelect")),"option"===k&&(t.selected&&!S.select?x.selected=!0:delete x.selected),"dialog"===k&&t.open){try{x.rr_open_mode=t.matches("dialog:modal")?"modal":"non-modal"}catch(t){x.rr_open_mode="modal",x.ph_rr_could_not_detect_modal=!0}_.add("rr_open_mode")}if("canvas"===k&&v&&!(null==p?void 0:p()))try{if("2d"===t.__context)(function(t){const e=t.getContext("2d");if(!e)return!0;for(let n=0;t.width>n;n+=50)for(let i=0;t.height>i;i+=50){const r=e.getImageData,o=Es in r?r[Es]:r;let s;try{s=o.call(e,n,i,Math.min(50,t.width-n),Math.min(50,t.height-i))}catch(t){return!1}if(new Uint32Array(s.data.buffer).some(t=>0!==t))return!1}return!0})(t)||(x.rr_dataURL=t.toDataURL(h.type,h.quality));else if(!("__context"in t)){const e=t.toDataURL(h.type,h.quality),n=i.createElement("canvas");n.width=t.width,n.height=t.height,e!==n.toDataURL(h.type,h.quality)&&(x.rr_dataURL=e)}}catch(t){"SecurityError"===(null==(T=t)?void 0:T.name)?Vs||(Vs=!0,console.warn("Cannot read canvas pixels, so this canvas is left out of the recording. A cross-origin image or video drawn into it taints it.",T)):console.warn("Cannot read canvas pixels, so this canvas is left out of the recording.",T)}let A,R=!1;if("img"===k&&f){zs||(zs=i.createElement("canvas"),Us=zs.getContext("2d"));const e=t,n=e.currentSrc||e.getAttribute("src")||"<unknown-src>",r=e.crossOrigin,o=(e,n)=>R?Rs({element:t,name:e,value:n,maskAllElementAttributes:c,maskAttributeFn:d}):n,s=()=>{sa(e,"load",s);try{zs.width=e.naturalWidth,zs.height=e.naturalHeight,Us.drawImage(e,0,0);const t=zs.toDataURL(h.type,h.quality);x.rr_dataURL=o("rr_dataURL",t)}catch(t){if("anonymous"!==e.crossOrigin)return e.crossOrigin="anonymous",void(e.complete&&0!==e.naturalWidth?s():e.addEventListener("load",s));console.warn(`Cannot inline img src=${n}! Error: ${t}`)}"anonymous"===e.crossOrigin&&(r?x.crossOrigin=o("crossOrigin",r):e.removeAttribute("crossorigin"))};e.complete&&0!==e.naturalWidth?s():e.addEventListener("load",s)}if("audio"===k||"video"===k){const e=x;e.rr_mediaState=t.paused?"paused":"played",_.add("rr_mediaState"),e.rr_mediaCurrentTime=t.currentTime,e.rr_mediaPlaybackRate=t.playbackRate,e.rr_mediaMuted=t.muted,e.rr_mediaLoop=t.loop,e.rr_mediaVolume=t.volume}if(g||function(t){return"function"!=typeof t.checkVisibility||t.checkVisibility({contentVisibilityAuto:!0})}(t)&&(t.scrollLeft&&(x.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(x.rr_scrollTop=t.scrollTop)),b){var E,O,L;const{width:e,height:n,left:r,top:o}=t.getBoundingClientRect(),s=null===(E=i.defaultView)||void 0===E?void 0:E.getComputedStyle(t);x={class:x.class,rr_width:`${e}px`,rr_height:`${n}px`,rr_left:`${Math.floor(r+((null===(O=i.defaultView)||void 0===O?void 0:O.scrollX)||0))}px`,rr_top:`${Math.floor(o+((null===(L=i.defaultView)||void 0===L?void 0:L.scrollY)||0))}px`},_.add("rr_width"),_.add("rr_height"),_.add("rr_left"),_.add("rr_top"),s&&(x.rr_position=s.position||"static",_.add("rr_position"),s.transform&&"none"!==s.transform&&(x.rr_transform=s.transform,_.add("rr_transform")),s.display&&s.display.startsWith("inline")&&(x.rr_display=s.display,_.add("rr_display")))}if("iframe"!==k||m(x.src)||(t.contentDocument||(x.rr_src=x.src),delete x.src),c||d)for(const[e,n]of Object.entries(x))"string"!=typeof n&&null!==n||(x[e]=Rs({element:t,name:e,value:n,maskAllElementAttributes:c,maskAttributeFn:d,isGenerated:_.has(e)}));R=!0;try{customElements.get(k)&&(A=!0)}catch(t){}return{type:lo.Element,tagName:k,attributes:x,childNodes:[],isSVG:(D=t,Boolean("svg"===D.tagName||D.ownerSVGElement)||void 0),needBlock:b,rootId:y,isCustom:A};var D}(t,{doc:i,blockClass:o,blockSelector:s,inlineStylesheet:l,maskInputOptions:u,maskInputFn:d,selectMaskingFn:h,maskAllElementAttributes:f,maskAttributeFn:v,dataURLOptions:p,inlineImages:m,recordCanvas:g,canvasMaskingConfigured:y,keepIframeSrcFn:b,newlyAddedElement:w,rootId:k},n);case t.TEXT_NODE:case t.CDATA_SECTION_NODE:return function(t,e){const{needsMask:n,maskTextFn:i,rootId:r}=e,o=So.parentNode(t),s=o&&o.tagName;let a=So.textContent(t);const l="STYLE"===s||void 0,u="string"==typeof s&&"SCRIPT"===s.toUpperCase();if(l&&a){try{var c;if(t.nextSibling||t.previousSibling);else if(ss(o.sheet));else if(null===(c=o.sheet)||void 0===c?void 0:c.cssRules){const t=ys(o.sheet);t&&!Ao(t)&&(a=t)}}catch(e){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${e}`,t)}a=Ps(a,Ks(e.doc))}return u&&(a="SCRIPT_PLACEHOLDER"),!l&&!u&&a&&n&&(a=i?i(a,So.parentElement(t)):a.replace(/[\S]/g,"*")),{type:lo.Text,textContent:a||"",isStyle:l,rootId:r}}(t,{doc:i,needsMask:a,maskTextFn:c,rootId:k});case t.COMMENT_NODE:return{type:lo.Comment,textContent:So.textContent(t)||"",rootId:k};default:return!1}}(t,{doc:i,mirror:r,blockClass:o,blockSelector:s,needsMask:O,inlineStylesheet:c,maskInputOptions:d,maskTextFn:h,maskInputFn:f,selectMaskingFn:v,maskAllElementAttributes:p,maskAttributeFn:m,dataURLOptions:y,inlineImages:b,recordCanvas:w,canvasMaskingConfigured:k,keepIframeSrcFn:I,newlyAddedElement:A},n);if(!D)return console.warn(t,"not serialized"),null;let F;F=r.hasNode(t)?r.getId(t):function(t,e){if(e.comment&&t.type===lo.Comment)return!0;if(t.type===lo.Element){if(e.script&&("script"===t.tagName||"link"===t.tagName&&("preload"===t.attributes.rel&&"script"===t.attributes.as||"modulepreload"===t.attributes.rel)||"link"===t.tagName&&"prefetch"===t.attributes.rel&&"string"==typeof t.attributes.href&&"js"===function(t){var e;let n;try{n=new URL(t,window.location.href)}catch(t){return null}const i=n.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!==(e=null==i?void 0:i[1])&&void 0!==e?e:null}(t.attributes.href)))return!0;if(e.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(fa(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===fa(t.attributes.name)||["icon","apple-touch-icon","shortcut icon"].includes(fa(t.attributes.rel)))))return!0;if("meta"===t.tagName){if(e.headMetaDescKeywords&&fa(t.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(fa(t.attributes.property).match(/^(og|twitter|fb):/)||fa(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===fa(t.attributes.name)))return!0;if(e.headMetaRobots&&["robots","googlebot","bingbot"].includes(fa(t.attributes.name)))return!0;if(e.headMetaHttpEquiv&&void 0!==t.attributes["http-equiv"])return!0;if(e.headMetaAuthorship&&(["author","generator","framework","publisher","progid"].includes(fa(t.attributes.name))||fa(t.attributes.property).match(/^article:/)||fa(t.attributes.property).match(/^product:/)))return!0;if(e.headMetaVerification&&["google-site-verification","yandex-verification","csrf-token","p:domain_verify","verify-v1","verification","shopify-checkout-api-token"].includes(fa(t.attributes.name)))return!0}}return!1}(D,g)||!L&&D.type===lo.Text&&!D.isStyle&&!D.textContent.replace(/^\s+|\s+$/gm,"").length?-2:Gs();const P=Object.assign(D,{id:F});if(r.add(t,P),-2===F)return null;S&&S(t);let N=!u;if(P.type===lo.Element){N=N&&!P.needBlock,delete P.needBlock;const e=So.shadowRoot(t);e&&vs(e)&&(P.isShadowHost=!0)}if((P.type===lo.Document||P.type===lo.Element)&&N){g.headWhitespace&&P.type===lo.Element&&"head"===P.tagName&&(L=!1);const e={doc:i,mirror:r,blockClass:o,blockSelector:s,needsMask:O,maskTextClass:a,maskTextSelector:l,skipChild:u,inlineStylesheet:c,maskInputOptions:d,maskTextFn:h,maskInputFn:f,selectMaskingFn:v,maskAllElementAttributes:p,maskAttributeFn:m,slimDOMOptions:g,dataURLOptions:y,inlineImages:b,recordCanvas:w,canvasMaskingConfigured:k,preserveWhiteSpace:L,onSerialize:S,onIframeLoad:_,iframeLoadTimeout:x,onIframeListenerRegistered:C,onStylesheetLoad:M,stylesheetLoadTimeout:T,keepIframeSrcFn:I,depth:R+1,maxDepth:E};if(P.type===lo.Element&&"textarea"===P.tagName&&void 0!==P.attributes.value);else for(const i of Array.from(So.childNodes(t))){const t=ma(i,e,n);t&&P.childNodes.push(t)}let A=null;if(hs(t)&&(A=So.shadowRoot(t)))for(const t of Array.from(So.childNodes(A))){const i=ma(t,e,n);i&&(vs(A)&&(i.isShadow=!0),P.childNodes.push(i))}}const q=So.parentNode(t);if(q&&fs(q)&&vs(q)&&(P.isShadow=!0),P.type===lo.Element&&"iframe"===P.tagName&&!ia(t,o,s)){const e=function(t,e,n){const i=()=>{},r=t.contentWindow;if(!r)return i;let o;try{o=r.document.readyState}catch(t){return i}const s=()=>e();if("complete"!==o){let i=!1,r=null;const o=()=>{i||(i=!0,null!==r&&(clearTimeout(r),r=null),sa(t,"load",a),t.addEventListener("load",s),e())},a=()=>o();return r=setTimeout(o,n),t.addEventListener("load",a),()=>{null!==r&&(clearTimeout(r),r=null),i?sa(t,"load",s):(i=!0,sa(t,"load",a))}}const a="about:blank";let l;try{l=r.location.href}catch(t){return i}if(l!==a||t.src===a||""===t.src){const n=setTimeout(e,0);return t.addEventListener("load",s),()=>{clearTimeout(n),sa(t,"load",s)}}return t.addEventListener("load",s),()=>{sa(t,"load",s)}}(t,()=>{const e=t.contentDocument;if(e&&_){const n=ma(e,{doc:e,mirror:r,blockClass:o,blockSelector:s,needsMask:O,maskTextClass:a,maskTextSelector:l,skipChild:!1,inlineStylesheet:c,maskInputOptions:d,maskTextFn:h,maskInputFn:f,selectMaskingFn:v,maskAllElementAttributes:p,maskAttributeFn:m,slimDOMOptions:g,dataURLOptions:y,inlineImages:b,recordCanvas:w,canvasMaskingConfigured:k,preserveWhiteSpace:L,onSerialize:S,onIframeLoad:_,iframeLoadTimeout:x,onIframeListenerRegistered:C,onStylesheetLoad:M,stylesheetLoadTimeout:T,keepIframeSrcFn:I,depth:R+1,maxDepth:E});n&&_(t,n)}},x);null==C||C(t,e)}var j,B,z;return P.type===lo.Element&&"link"===P.tagName&&na(P.attributes.rel)&&(B=()=>{if(M){const e=r.getMeta(t),n=ma(t,{doc:i,mirror:r,blockClass:o,blockSelector:s,needsMask:O,maskTextClass:a,maskTextSelector:l,skipChild:!1,inlineStylesheet:c,maskInputOptions:d,maskTextFn:h,maskInputFn:f,selectMaskingFn:v,maskAllElementAttributes:p,maskAttributeFn:m,slimDOMOptions:g,dataURLOptions:y,inlineImages:b,recordCanvas:w,canvasMaskingConfigured:k,preserveWhiteSpace:L,onSerialize:S,onIframeLoad:_,iframeLoadTimeout:x,onStylesheetLoad:M,stylesheetLoadTimeout:T,keepIframeSrcFn:I,depth:R,maxDepth:E});n&&M(t,n,e)}},z=T,aa.has(j=t)||ua(j)||ca(j,B,()=>Boolean(ua(j)),[z])),P}function ga(t){return!0===t||"all"===t?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===t,headMetaDescKeywords:"all"===t,headTitleMutations:"all"===t}:!1===t?{}:t}var ya=class t{constructor(...t){ds(this,"parentElement",null),ds(this,"parentNode",null),ds(this,"ownerDocument",void 0),ds(this,"firstChild",null),ds(this,"lastChild",null),ds(this,"previousSibling",null),ds(this,"nextSibling",null),ds(this,"ELEMENT_NODE",1),ds(this,"TEXT_NODE",3),ds(this,"nodeType",void 0),ds(this,"nodeName",void 0),ds(this,"RRNodeType",void 0)}get childNodes(){const t=[];let e=this.firstChild;for(;e;)t.push(e),e=e.nextSibling;return t}contains(e){if(!(e instanceof t))return!1;if(e.ownerDocument!==this.ownerDocument)return!1;if(e===this)return!0;for(;e.parentNode;){if(e.parentNode===this)return!0;e=e.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,e){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 ba(t,e,n=document){const i={capture:!0,passive:!0};return n.addEventListener(t,e,i),()=>wa(n,t,e,i)}function wa(t,e,n,i){ka(()=>{const r=t.removeEventListener;"function"==typeof r&&(void 0!==i?r.call(t,e,n,i):r.call(t,e,n))})}function ka(t){try{t()}catch(t){if(!(t instanceof DOMException&&"SecurityError"===t.name))throw t}}function Sa(t){t.forEach(t=>{if("function"==typeof t)try{t()}catch(t){}})}var _a="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.",xa={map:{},getId(){return console.warn(_a),-1},getNode(){return console.warn(_a),null},removeNodeFromMap(){console.warn(_a)},has(){return console.warn(_a),!1},reset(){console.warn(_a)}};function Ca(t,e,n={}){let i=null,r=0;return function(...o){const s=Date.now();r||!1!==n.leading||(r=s);const a=e-(s-r),l=this;0>=a||a>e?(i&&(clearTimeout(i),i=null),r=s,t.apply(l,o)):i||!1===n.trailing||(i=setTimeout(()=>{r=!1===n.leading?0:Date.now(),i=null,t.apply(l,o)},a))}}function Ma(t){let e="function"==typeof t.setTimeout?t.setTimeout:void 0;try{var n,i;const r=null===(n=t.Zone)||void 0===n||null===(i=n.__symbol__)||void 0===i?void 0:i.call(n,"setTimeout"),o=r?t[r]:void 0;"function"==typeof o&&(e=o)}catch(t){}if(!e)return()=>{};const r=e;return e=>{try{r.call(t,e,0)}catch(t){}}}function Ta(t,e,n,i,r=window){const o=r.Object.getOwnPropertyDescriptor(t,e),s=()=>Ta(t,e,o||{},!0);if(i)return r.Object.defineProperty(t,e,n),s;const a=Ma(r);return r.Object.defineProperty(t,e,{set(t){if(a(()=>{try{n.set.call(this,t)}catch(t){}}),o&&o.set){if(o.get)try{o.get.call(this)}catch(t){return}o.set.call(this,t)}}}),s}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(xa=new Proxy(xa,{get(t,e,n){return"map"===e&&console.warn(_a),Reflect.get(t,e,n)}}));var Ia=Date.now;function Aa(t){var e,n,i,r;const o=t.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:void 0!==t.pageXOffset?t.pageXOffset:o.documentElement.scrollLeft||(null==o?void 0:o.body)&&(null===(e=So.parentElement(o.body))||void 0===e?void 0:e.scrollLeft)||(null==o||null===(n=o.body)||void 0===n?void 0:n.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:void 0!==t.pageYOffset?t.pageYOffset:(null==o?void 0:o.documentElement.scrollTop)||(null==o?void 0:o.body)&&(null===(i=So.parentElement(o.body))||void 0===i?void 0:i.scrollTop)||(null==o||null===(r=o.body)||void 0===r?void 0:r.scrollTop)||0}}function Ra(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Ea(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Oa(t){return t?t.nodeType===t.ELEMENT_NODE?t:So.parentElement(t):null}function $a(t,e,n,i){if(!t)return!1;const r=Oa(t);if(!r)return!1;try{if("string"==typeof e){if(r.classList.contains(e))return!0;if(i&&null!==r.closest("."+e))return!0}else if(ra(r,e,i))return!0}catch(t){}if(n){if(r.matches(n))return!0;if(i&&null!==r.closest(n))return!0}return!1}function La(t,e,n){const i=e&&"string"!=typeof e&&(e.global||e.sticky)?new RegExp(e):null;for(;t;){if(i&&(i.lastIndex=0),$a(t,i||e,n,!0))return!0;const r="getRootNode"in t?So.getRootNode(t):null;t=(null==r?void 0:r.nodeType)===Node.DOCUMENT_FRAGMENT_NODE?So.host(r):null}return!1}function Da(t,e,n){return!("TITLE"!==t.tagName||!n.headTitleMutations)||-2===e.getId(t)}function Fa(t,e){if(fs(t))return!1;const n=e.getId(t);if(!e.has(n))return!0;const i=So.parentNode(t);return(!i||i.nodeType!==t.DOCUMENT_NODE)&&(!i||Fa(i,e))}function Pa(t){return Boolean(t.changedTouches)}function Na(t,e){return Boolean("IFRAME"===t.nodeName&&e.getMeta(t))}function qa(t,e){return Boolean("LINK"===t.nodeName&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&"stylesheet"===t.getAttribute("rel")&&e.getMeta(t))}function ja(t){return!!t&&(t instanceof ya&&"shadowRoot"in t?Boolean(t.shadowRoot):Boolean(So.shadowRoot(t)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(Ia=()=>(new Date).getTime());var Ba=class{constructor(){ds(this,"id",1),ds(this,"styleIDMap",new WeakMap),ds(this,"idStyleMap",new Map)}getId(t){var e;return null!==(e=this.styleIDMap.get(t))&&void 0!==e?e:-1}has(t){return this.styleIDMap.has(t)}add(t,e){if(this.has(t))return this.getId(t);let n;return n=void 0===e?this.id++:e,this.styleIDMap.set(t,n),this.idStyleMap.set(n,t),n}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}};function za(t){var e;let n=null;return"getRootNode"in t&&(null===(e=So.getRootNode(t))||void 0===e?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&So.host(So.getRootNode(t))&&(n=So.host(So.getRootNode(t))),n}function Ua(t){const e=t.ownerDocument;if(!e)return!1;if(So.contains(e,t))return!0;const n=So.isConnected(t);return"boolean"==typeof n?n:function(t){const e=t.ownerDocument;if(!e)return!1;const n=function(t){let e,n=t;for(;e=za(n);)n=e;return n}(t);return So.contains(e,n)}(t)}var Wa,Ha=new WeakMap,Ga=(t,e)=>`${t}@${e}`,Va=class{constructor(){ds(this,"frozen",!1),ds(this,"locked",!1),ds(this,"takePendingRecords",void 0),ds(this,"texts",new Map),ds(this,"attributes",new Map),ds(this,"generatedAttributes",new WeakMap),ds(this,"selectedAttributeChanges",new Set),ds(this,"removes",[]),ds(this,"mapRemoves",new Set),ds(this,"movedMap",{}),ds(this,"addedSet",new Set),ds(this,"movedSet",new Set),ds(this,"droppedSet",new Set),ds(this,"removesSubTreeCache",new Set),ds(this,"mutationCb",void 0),ds(this,"blockClass",void 0),ds(this,"blockSelector",void 0),ds(this,"maskTextClass",void 0),ds(this,"maskTextSelector",void 0),ds(this,"inlineStylesheet",void 0),ds(this,"maskInputOptions",void 0),ds(this,"maskTextFn",void 0),ds(this,"maskInputFn",void 0),ds(this,"selectMaskingFn",void 0),ds(this,"maskAllElementAttributes",void 0),ds(this,"maskAttributeFn",void 0),ds(this,"keepIframeSrcFn",void 0),ds(this,"recordCanvas",void 0),ds(this,"canvasMaskingConfigured",void 0),ds(this,"inlineImages",void 0),ds(this,"slimDOMOptions",void 0),ds(this,"dataURLOptions",void 0),ds(this,"doc",void 0),ds(this,"mirror",void 0),ds(this,"iframeManager",void 0),ds(this,"stylesheetManager",void 0),ds(this,"shadowDomManager",void 0),ds(this,"canvasManager",void 0),ds(this,"processedNodeManager",void 0),ds(this,"unattachedDoc",void 0),ds(this,"canvasManagerReleased",!1),ds(this,"processMutations",t=>{t.forEach(this.processMutation),this.emit()}),ds(this,"emit",()=>{if(this.frozen||this.locked)return;const t=No(),e=Bo();try{this.processBufferedMutations()}finally{n=No()-t,i=e,Uo>0||zo(n,null!=i?i:qo)||n>Ko.slowestBatchMs&&(Ko.slowestBatchMs=n)}var n,i}),ds(this,"processBufferedMutations",()=>{const t=[],e=new Set,n=this.selectMaskingFn?{input:new WeakMap,content:new WeakMap,owner:new WeakMap}:void 0,i=t=>{let e=t,n=-2;for(;-2===n;)e=e&&So.nextSibling(e),n=e&&this.mirror.getId(e);return n};let r;const o=o=>{var s;const a=So.parentNode(o);if(!a||!Ua(o)||"TEXTAREA"===a.tagName)return!0;if(this.isBlockedAtEmission(a,n))return!0;if(this.selectMaskingFn&&Bs(o,this.maskInputOptions,this.selectMaskingFn,n))return!0;const l=fs(a)?this.mirror.getId(za(o)):this.mirror.getId(a),u=i(o);if(-1===l||-1===u)return!1;null!==(s=r)&&void 0!==s||(r=this.buildSerializationOptions());const c=ma(o,r,n);return c&&(t.push({parentId:l,nextId:u,node:c}),e.add(c.id)),!0};for(const t of this.mapRemoves)this.mapRemoves.delete(t),this.mirror.removeNodeFromMap(t);for(const t of this.movedSet)Za(this.removesSubTreeCache,t)&&!this.movedSet.has(So.parentNode(t))||this.addedSet.add(t);for(const t of Array.from(this.addedSet)){const e=Ja(this.droppedSet,t),n=Za(this.removesSubTreeCache,t),i=this.movedSet.has(t)||Ja(this.movedSet,t);!e&&!n||i||(this.droppedSet.add(t),this.addedSet.delete(t))}const s=new Set;let a=null;const l=this.addedSet.values();let u=l.next();for(;this.addedSet.size;){let t=null;if(null!==a)for(t=So.previousSibling(a);t&&-2===this.mirror.getId(t);)t=So.previousSibling(t);if(t&&this.addedSet.has(t))a=t;else{for(this.addedSet.has(u.value)||(u=l.next()),a=u.value;;){const t=So.parentNode(a),e=t&&t.nodeType===Node.DOCUMENT_FRAGMENT_NODE?So.host(t):t;if(!e||!this.addedSet.has(e))break;a=e}const t=So.parentNode(a);if(t&&this.addedSet.has(So.lastChild(t)))a=So.lastChild(t);else if(t)for(;;){let t=So.nextSibling(a);for(;t&&-2===this.mirror.getId(t);)t=So.nextSibling(t);if(!t||!this.addedSet.has(t))break;a=t}}this.addedSet.delete(a);const e=So.parentNode(a),n=e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE?So.host(e):e;n&&s.has(n)?s.add(a):o(a)||s.add(a)}s.size>0&&console.warn(`[rrweb] dropped ${s.size} node(s) with unresolved parent at emit`);const c={texts:Array.from(this.texts,([t,e])=>({node:t,value:e})).filter(t=>!this.isBlockedAtEmission(t.node,n)).map(t=>{const e=t.node,n=So.parentNode(e);return n&&"TEXTAREA"===n.tagName&&this.genTextAreaValueMutation(n),{id:this.mirror.getId(e),value:t.value}}).filter(t=>!e.has(t.id)).filter(t=>this.mirror.has(t.id)),attributes:Array.from(this.attributes.values()).filter(t=>!this.isBlockedAtEmission(t.node,n)).map(t=>{const{attributes:e}=t;if(!this.maskAllElementAttributes&&!this.maskAttributeFn&&"string"==typeof e.style){const n=JSON.stringify(t.styleDiff),i=JSON.stringify(t._unchangedStyles);e.style.length>n.length&&(n+i).split("var(").length===e.style.split("var(").length&&(e.style=t.styleDiff)}if(this.maskAllElementAttributes||this.maskAttributeFn)for(const[i,r]of Object.entries(e))if("string"==typeof r||null===r){var n;e[i]=Rs({element:t.node,name:i,value:r,maskAllElementAttributes:this.maskAllElementAttributes,maskAttributeFn:this.maskAttributeFn,isGenerated:null===(n=this.generatedAttributes.get(t.node))||void 0===n?void 0:n.has(i)})}return{id:this.mirror.getId(t.node),attributes:e}}).filter(t=>!e.has(t.id)).filter(t=>this.mirror.has(t.id)),removes:this.removes,adds:t},d=[];if(this.inlineStylesheet)for(const{id:t,attributes:e}of c.attributes){if(!("rel"in e)&&!("href"in e))continue;const n=this.mirror.getNode(t);n&&"link"===Is(n.nodeName)&&na(n.getAttribute("rel"))&&n.getAttribute("href")&&!n.disabled&&d.push(n)}this.texts.clear(),this.attributes.clear(),this.generatedAttributes=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.removesSubTreeCache=new Set,this.movedMap={};const h=this.selectedAttributeChanges;this.selectedAttributeChanges=new Set,(c.texts.length||c.attributes.length||c.removes.length||c.adds.length)&&this.mutationCb(c);for(const t of h){var f;null===(f=Ha.get(t.ownerDocument))||void 0===f||f.forEach(e=>e(t))}for(const t of d)this.stylesheetManager.inlineLinkStylesheetAfterChange(t,{currentId:()=>this.mirror.getId(t),reserializeWithoutCss:()=>({previous:this.mirror.getMeta(t),current:ma(t,L(L({},this.buildSerializationOptions()),{},{inlineStylesheet:!1}))}),lastSerialization:()=>this.mirror.getMeta(t),readdAsMove:()=>this.recordReinsertion(t)})}),ds(this,"bufferBelongsToIframe",t=>this.doc===t.contentDocument),ds(this,"genTextAreaValueMutation",t=>{let e=this.attributes.get(t);e||(e={node:t,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.set(t,e));const n=Array.from(So.childNodes(t),t=>So.textContent(t)||"").join("");e.attributes.value=Ts({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:Os(t),value:n,maskInputFn:this.maskInputFn})}),ds(this,"processMutation",t=>{if(!Da(t.target,this.mirror,this.slimDOMOptions)){if(this.selectMaskingFn){var e;const n=null===(e=Oa(t.target))||void 0===e?void 0:e.closest("select");n&&this.selectedAttributeChanges.add(n)}switch(t.type){case"characterData":{const e=So.textContent(t.target);$a(t.target,this.blockClass,this.blockSelector,!1)||e===t.oldValue||this.texts.set(t.target,oa(t.target,this.maskTextClass,this.maskTextSelector,!0)&&e?this.maskTextFn?this.maskTextFn(e,Oa(t.target)):e.replace(/[\S]/g,"*"):e);break}case"attributes":{var n;const e=t.target,r=!this.selectMaskingFn||"http://www.w3.org/1999/xhtml"!==e.namespaceURI||"select"!==e.localName&&"option"!==e.localName?Is(e.tagName):e.localName,o=t.attributeName,s=null!==(n=t.attributeNamespace)&&void 0!==n?n:null;let a=function(t,e,n){if(!n)return e;const i=t.getAttributeNodeNS(n,e);if(i)return i.name;if("http://www.w3.org/1999/xlink"===n)return`xlink:${e}`;if("http://www.w3.org/XML/1998/namespace"===n)return`xml:${e}`;if("http://www.w3.org/2000/xmlns/"===n)return"xmlns"===e?e:`xmlns:${e}`;const r=t.lookupPrefix(n);return r?`${r}:${e}`:e}(e,o,s),l=s?e.getAttributeNS(s,o):t.target.getAttribute(o);if("option"===r&&"selected"===a&&(this.selectMaskingFn||this.maskInputOptions.select)){let n=So.parentElement(e);if("OPTGROUP"===(null==n?void 0:n.tagName)&&(n=So.parentElement(n)),this.selectMaskingFn||!this.maskInputFn||"SELECT"!==(null==n?void 0:n.tagName)||!n.multiple)return void(l!==t.oldValue&&"SELECT"===(null==n?void 0:n.tagName)&&this.selectedAttributeChanges.add(n))}if("value"===a){const t=e,n=Os(t);l=Ts({element:t,maskInputOptions:js(t,this.maskInputOptions,this.selectMaskingFn),tagName:this.selectMaskingFn&&"select"===r?"select":e.tagName,type:n,value:l,maskInputFn:this.maskInputFn})}if($a(t.target,this.blockClass,this.blockSelector,!1)||l===t.oldValue)return;let u=this.attributes.get(t.target);const c="iframe"===r&&"src"===a;if(c&&!this.keepIframeSrcFn(l)&&e.contentDocument)return;if("type"===a&&"input"===r&&"password"===(t.oldValue||"").toLowerCase()&&e.setAttribute("data-rr-is-password","true"),!ea(r,a)){var i;u||(u={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.set(t.target,u));const n=ta(this.doc,r,Is(a),l,e,this.dataURLOptions);if(c&&!this.keepIframeSrcFn(l)&&(a="rr_src"),u.attributes[a]=n,null===(i=this.generatedAttributes.get(t.target))||void 0===i||i.delete(a),"style"===a){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(t){this.unattachedDoc=this.doc}const n=this.unattachedDoc.createElement("span"),i=e.style;t.oldValue&&(n.style.cssText=t.oldValue);for(const t of Array.from(i)){const e=i.getPropertyValue(t),r=i.getPropertyPriority(t);e!==n.style.getPropertyValue(t)||r!==n.style.getPropertyPriority(t)?u.styleDiff[t]=""===r?e:[e,r]:u._unchangedStyles[t]=[e,r]}for(const t of Array.from(n.style))""===i.getPropertyValue(t)&&(u.styleDiff[t]=!1)}else if("open"===a&&"dialog"===r){u.attributes.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal";let n=this.generatedAttributes.get(t.target);n||(n=new Set,this.generatedAttributes.set(t.target,n)),n.add("rr_open_mode")}}break}case"childList":if(t.removedNodes.forEach(t=>{Ua(t)||this.shadowDomManager.removeShadowRootsIn(t)}),$a(t.target,this.blockClass,this.blockSelector,!0))return;if("TEXTAREA"===t.target.tagName)return void this.genTextAreaValueMutation(t.target);t.addedNodes.forEach(e=>this.genAdds(e,t.target)),t.removedNodes.forEach(e=>{const n=this.mirror.getId(e),i=fs(t.target)?this.mirror.getId(So.host(t.target)):this.mirror.getId(t.target);$a(t.target,this.blockClass,this.blockSelector,!1)||Da(e,this.mirror,this.slimDOMOptions)||!function(t,e){return-1!==e.getId(t)}(e,this.mirror)||(this.addedSet.has(e)?(Qa(this.addedSet,e),this.droppedSet.add(e)):this.addedSet.has(t.target)&&-1===n||Fa(t.target,this.mirror)||(this.movedSet.has(e)&&this.movedMap[Ga(n,i)]?Qa(this.movedSet,e):(this.removes.push({parentId:i,id:n,isShadow:!(!fs(t.target)||!vs(t.target))||void 0}),function(t,e){const n=[t];for(;n.length;){const t=n.pop();e.has(t)||(e.add(t),So.childNodes(t).forEach(t=>n.push(t)))}}(e,this.removesSubTreeCache))),this.mapRemoves.add(e))})}}}),ds(this,"genAdds",(t,e)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)){if(this.addedSet.has(t))return this.addedSet.delete(t),void this.addedSet.add(t);if(!this.movedSet.has(t)){if(this.mirror.hasNode(t)){if(Da(t,this.mirror,this.slimDOMOptions))return;this.movedSet.add(t);let n=null;e&&this.mirror.hasNode(e)&&(n=this.mirror.getId(e)),n&&-1!==n&&(this.movedMap[Ga(this.mirror.getId(t),n)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);if(!$a(t,this.blockClass,this.blockSelector,!1)){if(t.nodeType===t.TEXT_NODE)return;const e=So.childNodes(t);for(let t=0,n=e.length;n>t;t++){const n=e[t];n&&this.genAdds(n)}if(ja(t)){const e=So.childNodes(So.shadowRoot(t));for(let n=0,i=e.length;i>n;n++){const i=e[n];i&&(this.processedNodeManager.add(i,this),this.genAdds(i,t))}}}}}})}init(t){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","selectMaskingFn","maskAllElementAttributes","maskAttributeFn","keepIframeSrcFn","recordCanvas","canvasMaskingConfigured","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(e=>{this[e]=t[e]}),this.canvasManager.acquire()}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()}readPendingRecordsFrom(t){this.takePendingRecords=()=>t.takeRecords()}reset(){this.releaseCanvasManager()}releaseCanvasManager(){this.canvasManagerReleased||(this.canvasManagerReleased=!0,this.canvasManager.reset())}bufferDoc(){return this.doc}destroy(){this.selectedAttributeChanges.clear();for(const t of this.mapRemoves)this.mapRemoves.delete(t),this.mirror.removeNodeFromMap(t)}isBlockedAtEmission(t,e){return La(t,this.blockClass,this.blockSelector)||!!this.selectMaskingFn&&!!t&&Bs(t,this.maskInputOptions,this.selectMaskingFn,e)}recordReinsertion(t){var e;const n=So.parentNode(t);if(!n)return;null===(e=this.takePendingRecords)||void 0===e||e.call(this).forEach(this.processMutation);const i=(t,e)=>({type:"childList",target:n,removedNodes:t,addedNodes:e,oldValue:null,attributeName:null});this.processMutation(i([t],[])),this.processMutation(i([],[t])),this.emit()}buildSerializationOptions(){return{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,selectMaskingFn:this.selectMaskingFn,maskAllElementAttributes:this.maskAllElementAttributes,maskAttributeFn:this.maskAttributeFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,canvasMaskingConfigured:this.canvasMaskingConfigured,inlineImages:this.inlineImages,onSerialize:t=>{Na(t,this.mirror)&&this.iframeManager.addIframe(t),qa(t,this.mirror)&&this.stylesheetManager.trackLinkElement(t),ja(t)&&!$a(t,this.blockClass,this.blockSelector,!0)&&this.shadowDomManager.addShadowRoot(So.shadowRoot(t),this.doc)},onIframeLoad:(t,e)=>{this.iframeManager.attachIframe(t,e),this.shadowDomManager.observeAttachShadow(t)},onIframeListenerRegistered:(t,e)=>{this.iframeManager.registerLoadListenerDisposer(t,e)},onStylesheetLoad:(t,e,n)=>{this.stylesheetManager.attachLinkElement(t,e,n)}}}};function Qa(t,e){const n=[e];for(;n.length;){const e=n.pop();if(t.delete(e),e.nodeType===e.TEXT_NODE)continue;const i=So.childNodes(e);for(let t=0,e=i.length;e>t;t++){const e=i[t];e&&n.push(e)}}}function Za(t,e,n){return 0!==t.size&&function(t,e){const n=So.parentNode(e);return!!n&&t.has(n)}(t,e)}function Ja(t,e){if(0===t.size)return!1;let n=So.parentNode(e);for(;n;){if(t.has(n))return!0;n=So.parentNode(n)}return!1}function Ya(t){Wa=t}function Ka(){Wa=void 0}var Xa=(t,e="rrweb")=>Wa?(...n)=>{try{return t(...n)}catch(t){if(Wa&&!0===Wa(t,e))return;throw t}}:t,tl=[];function el(t){try{if("composedPath"in t){const e=t.composedPath();if(e.length)return e[0]}else if("path"in t&&t.path.length)return t.path[0]}catch(t){}return t&&t.target}function nl(t,e){const n=new Va;let i;n.init(t);try{i=new(wo())(Xa(n.processMutations.bind(n)));const r={attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0};return t.attributeFilter&&t.attributeFilter.length>0&&(r.attributeFilter=t.attributeFilter),i.observe(e,r),n.readPendingRecordsFrom(i),tl.push(n),{observer:i,buffer:n}}catch(t){try{null==i||i.disconnect(),n.destroy(),n.reset()}catch(t){}throw t}}function il({scrollCb:t,doc:e,mirror:n,blockClass:i,blockSelector:r,sampling:o}){const s=new Map,a=o=>{const a=el(o);if(!a||$a(a,i,r,!0))return;const l=n.getId(a);let u,c;if(a===e&&e.defaultView){const t=Aa(e.defaultView);u=t.left,c=t.top}else u=a.scrollLeft,c=a.scrollTop;const d=`${u},${c}`;s.get(l)!==d&&(s.set(l,d),t({id:l,x:u,y:c}))},l=Xa(a),u=new WeakMap,c=[ba("scroll",Xa(t=>{const e=t.target;if(!e)return;let n=u.get(e);n||(n=Ca(l,o.scroll||100),u.set(e,n)),n(t)}),e)];return"onscrollend"in e&&c.push(ba("scrollend",Xa(a),e)),()=>c.forEach(t=>t())}function rl(t,e){for(let n=tl.length-1;n>=0;n--){const i=tl[n];if(!i)continue;let r=i.bufferBelongsToIframe(t);!r&&e&&e.has(i.bufferDoc())&&(r=!0),r&&(i.reset(),tl.splice(n,1))}}var ol=["INPUT","TEXTAREA","SELECT"],sl=new WeakMap,al=new WeakMap;function ll(t){return function t(e,n){if(pl("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||pl("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||pl("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||pl("CSSConditionRule")&&e.parentRule instanceof CSSConditionRule){const i=Array.from(e.parentRule.cssRules).indexOf(e);return n.unshift(i),t(e.parentRule,n)}if(e.parentStyleSheet){const t=Array.from(e.parentStyleSheet.cssRules).indexOf(e);n.unshift(t)}return n}(t,[])}function ul(t,e,n){let i,r;return t?(t.ownerNode?i=e.getId(t.ownerNode):r=n.getId(t),{styleId:r,id:i}):{}}var cl=Symbol.for("rrweb.adoptedStyleSheets.rejected"),dl=new WeakMap;function hl({mirror:t,stylesheetManager:e},n){var i,r;let o=null;o=t.getId("#document"===n.nodeName?n:So.host(n));const s="#document"===n.nodeName?null===(i=n.defaultView)||void 0===i?void 0:i.Document:null===(r=n.ownerDocument)||void 0===r||null===(r=r.defaultView)||void 0===r?void 0:r.ShadowRoot,a=Object.getOwnPropertyDescriptor(n,"adoptedStyleSheets"),l=null!=a?a:(null==s?void 0:s.prototype)?Object.getOwnPropertyDescriptor(s.prototype,"adoptedStyleSheets"):void 0;if(null===o||-1===o||!s||!1===(null==a?void 0:a.configurable)||!(null==l?void 0:l.get)||!(null==l?void 0:l.set))return()=>{};const u={stylesheetManager:e,previousDescriptor:a,get:void 0},c={configurable:!0,enumerable:l.enumerable,get(){var t;return null===(t=l.get)||void 0===t?void 0:t.call(this)},set(t){let e;try{var n;e=null===(n=l.set)||void 0===n?void 0:n.call(this,t)}catch(t){if(t&&"object"==typeof t&&"NotAllowedError"===t.name)return cl;throw t}if(e===cl)return e;if(u.stylesheetManager&&null!==o&&-1!==o)try{u.stylesheetManager.adoptStyleSheets(t,o)}catch(t){}return e}};try{Object.defineProperty(n,"adoptedStyleSheets",c)}catch(t){return()=>{}}return u.get=c.get,dl.set(c.set,u),Xa(()=>{u.stylesheetManager=void 0;const t=Object.getOwnPropertyDescriptor(n,"adoptedStyleSheets");if(!(null==t?void 0:t.configurable)||t.get!==c.get||t.set!==c.set)return;let e=a;for(;null==e?void 0:e.set;){const t=dl.get(e.set);if(!t||t.stylesheetManager||t.get!==e.get)break;e=t.previousDescriptor}e?Object.defineProperty(n,"adoptedStyleSheets",e):delete n.adoptedStyleSheets})}var fl=new Set;function vl(t,e={}){const n=t.doc.defaultView;if(!n)return()=>{};let i,r;!function(t,e){const{mutationCb:n,mousemoveCb:i,mouseInteractionCb:r,scrollCb:o,viewportResizeCb:s,inputCb:a,mediaInteractionCb:l,styleSheetRuleCb:u,styleDeclarationCb:c,canvasMutationCb:d,fontCb:h,selectionCb:f,customElementCb:v}=t;t.mutationCb=(...t)=>{e.mutation&&e.mutation(...t),n(...t)},t.mousemoveCb=(...t)=>{e.mousemove&&e.mousemove(...t),i(...t)},t.mouseInteractionCb=(...t)=>{e.mouseInteraction&&e.mouseInteraction(...t),r(...t)},t.scrollCb=(...t)=>{e.scroll&&e.scroll(...t),o(...t)},t.viewportResizeCb=(...t)=>{e.viewportResize&&e.viewportResize(...t),s(...t)},t.inputCb=(...t)=>{e.input&&e.input(...t),a(...t)},t.mediaInteractionCb=(...t)=>{e.mediaInteaction&&e.mediaInteaction(...t),l(...t)},t.styleSheetRuleCb=(...t)=>{e.styleSheetRule&&e.styleSheetRule(...t),u(...t)},t.styleDeclarationCb=(...t)=>{e.styleDeclaration&&e.styleDeclaration(...t),c(...t)},t.canvasMutationCb=(...t)=>{e.canvasMutation&&e.canvasMutation(...t),d(...t)},t.fontCb=(...t)=>{e.font&&e.font(...t),h(...t)},t.selectionCb=(...t)=>{e.selection&&e.selection(...t),f(...t)},t.customElementCb=(...t)=>{e.customElement&&e.customElement(...t),v(...t)}}(t,e);const o=[],s=Xa(()=>{try{if(r)try{r.destroy(),r.reset()}finally{const t=tl.indexOf(r);-1!==t&&tl.splice(t,1)}t.shadowDomManager.resetForDoc(t.doc),null==i||i.disconnect()}finally{Sa(o)}}),a=(t,e)=>{const n=Xa(()=>{try{return e()}catch(e){throw fl.add(t),e}})();"function"==typeof n&&o.push(n)};try{if(t.recordDOM&&a("mutation",()=>{const e=nl(t,t.doc);i=e.observer,r=e.buffer}),a("move",()=>function({mousemoveCb:t,sampling:e,doc:n,mirror:i}){if(!1===e.mousemove)return()=>{};const r="number"==typeof e.mousemove?e.mousemove:50,o="number"==typeof e.mousemoveCallback?e.mousemoveCallback:500;let s,a=[];const l=Ca(Xa(e=>{const n=Date.now()-s;t(a.map(t=>(t.timeOffset-=n,t)),e),a=[],s=null}),o),u=Xa(Ca(Xa(t=>{const e=el(t),{clientX:n,clientY:r}=Pa(t)?t.changedTouches[0]:t;s||(s=Ia()),a.push({x:n,y:r,id:i.getId(e),timeOffset:Ia()-s}),l("drag"===t.type?io.Drag:"touchmove"===t.type?io.TouchMove:io.MouseMove)}),r,{trailing:!1})),c=[ba("mousemove",u,n),ba("touchmove",u,n),ba("drag",u,n)];return Xa(()=>{c.forEach(t=>t())})}(t)),a("mouseInteraction",()=>function({mouseInteractionCb:t,doc:e,mirror:n,blockClass:i,blockSelector:r,sampling:o}){if(!1===o.mouseInteraction)return()=>{};const s=!0===o.mouseInteraction||void 0===o.mouseInteraction?{}:o.mouseInteraction,a=[];let l=null;return Object.keys(ro).filter(t=>Number.isNaN(Number(t))&&!t.endsWith("_Departed")&&!1!==s[t]).forEach(o=>{let s=Is(o);const u=(e=>o=>{const s=el(o);if($a(s,i,r,!0))return;let a=null,u=e;if("pointerType"in o){switch(o.pointerType){case"mouse":a=oo.Mouse;break;case"touch":a=oo.Touch;break;case"pen":a=oo.Pen}a===oo.Touch&&(ro[e]===ro.MouseDown?u="TouchStart":ro[e]===ro.MouseUp&&(u="TouchEnd"))}else Pa(o)&&(a=oo.Touch);null!==a?(l=a,(u.startsWith("Touch")&&a===oo.Touch||u.startsWith("Mouse")&&a===oo.Mouse)&&(a=null)):ro[e]===ro.Click&&(a=l,l=null);const c=Pa(o)?o.changedTouches[0]:o;if(!c)return;const d=n.getId(s),{clientX:h,clientY:f}=c;Xa(t)(L({type:ro[u],id:d,x:h,y:f},null!==a&&{pointerType:a}))})(o);if(window.PointerEvent)switch(ro[o]){case ro.MouseDown:case ro.MouseUp:s=s.replace("mouse","pointer");break;case ro.TouchStart:case ro.TouchEnd:return}a.push(ba(s,u,e))}),Xa(()=>{a.forEach(t=>t())})}(t)),a("scroll",()=>il(t)),a("viewportResize",()=>function({viewportResizeCb:t},{win:e}){let n=-1,i=-1;return ba("resize",Xa(Ca(Xa(()=>{const e=Ra(),r=Ea();n===e&&i===r||(t({width:Number(r),height:Number(e)}),n=e,i=r)}),200)),e)}(t,{win:n})),a("input",()=>function({inputCb:t,doc:e,mirror:n,blockClass:i,blockSelector:r,ignoreClass:o,ignoreSelector:s,maskInputOptions:a,maskInputFn:l,selectMaskingFn:u,sampling:c,userTriggeredOnInput:d}){let h=!0;const f=new Map;let v=!1;function p(t){return"SELECT"===t.tagName||!!u&&"select"===t.localName&&"http://www.w3.org/1999/xhtml"===t.namespaceURI}function m(t){const n=e.defaultView;if(t&&n&&!(t instanceof n.HTMLElement))return null;if(u&&"option"===(null==t?void 0:t.localName)&&"http://www.w3.org/1999/xhtml"===t.namespaceURI){let e=So.parentElement(t);for(;e&&("select"!==e.localName||"http://www.w3.org/1999/xhtml"!==e.namespaceURI);)e=So.parentElement(e);return e}return t&&"OPTION"===t.tagName&&(t=So.parentElement(t))&&"OPTGROUP"===t.tagName&&(t=So.parentElement(t)),t}function g(t){b(m(el(t)),t.isTrusted)}function y(t){return Array.from(t.selectedOptions).filter(t=>!$a(t,i,r,!0))}function b(t,c,f=!1,v=!1){var m;const g=t&&(p(t)?"SELECT":t.tagName);var b;if(u&&"SELECT"===g&&((null===(b=tl[0])||void 0===b?void 0:b.isFrozen())&&tl.forEach(t=>t.unfreeze()),!h))return;if(!t||!g||0>ol.indexOf(g)||$a(t,i,r,!0))return;if(t.classList.contains(o)||s&&t.matches(s))return;const k=Os(t)||"",_=js(t,a,u);if(u&&(!h||$a(t,i,r,!0)))return;const x=_[g.toLowerCase()]||_[k];let C="SELECT"===g?y(t):void 0;if(C&&(0>=n.getId(t)||C.some(t=>0>=n.getId(t)))){var M;if(null===(M=tl[0])||void 0===M?void 0:M.isFrozen()){if(tl.forEach(t=>t.unfreeze()),!h)return;C=y(t)}if(!f)return void w(t,c,v);if(0>=n.getId(t)||!x&&C.some(t=>0>=n.getId(t)))return}let T,I=C?(null===(m=C[0])||void 0===m?void 0:m.value)||"":t.value,A=!1;"radio"===k||"checkbox"===k?A=t.checked:x?I=Ts({element:t,maskInputOptions:_,tagName:g,type:k,value:I,maskInputFn:l}):C&&(T=C.map(t=>n.getId(t)));const R={text:I,isChecked:A};T&&(R.selectedOptionIds=T),u&&C&&function(t,e,n){if("SELECT"!==t.nodeName)return;const i=e.getMeta(t),r=!!n||null;(null==i?void 0:i.type)!==lo.Element||!0!==i.attributes.rr_maskedSelect&&null!==i.attributes.rr_maskedSelect||i.attributes.rr_maskedSelect===r||e.add(t,L(L({},i),{},{attributes:L(L({},i.attributes),{},{rr_maskedSelect:r})}))}(t,n,!!x),d&&(R.userTriggered=c),S(t,R,v);const E=t.name;"radio"===k&&E&&A&&e.querySelectorAll(`input[type="radio"][name="${E}"]`).forEach(e=>{if(e!==t){const t=e.value;S(e,d?{text:t,isChecked:!A,userTriggered:!1}:{text:t,isChecked:!A})}})}function w(t,e,n=!1){var i;const r=f.get(t);f.set(t,{userTriggered:e||(null==r?void 0:r.userTriggered)||!1,fromMutation:n&&(null===(i=null==r?void 0:r.fromMutation)||void 0===i||i)}),v||(v=!0,C(k))}function k(){v=!1;const t=Array.from(f);f.clear(),Sa(t.map(([t,{userTriggered:e,fromMutation:n}])=>()=>{h&&Xa(b)(t,e,!0,n)}))}function S(e,i,r=!1){var o,s,a;const l=p(e)?al:sl,u=l.get(e);if(!u||u.text!==i.text||u.isChecked!==i.isChecked||(null===(o=u.selectedOptionIds)||void 0===o?void 0:o.length)!==(null===(s=i.selectedOptionIds)||void 0===s?void 0:s.length)||(null===(a=i.selectedOptionIds)||void 0===a?void 0:a.some((t,e)=>{var n;return t!==(null===(n=u.selectedOptionIds)||void 0===n?void 0:n[e])}))){l.set(e,i);const o=n.getId(e);Xa(t)(L(L({},i),{},{id:o}),r)}}const _=("last"===c.input?["change"]:["input","change"]).map(t=>ba(t,Xa(g),e)),x=e.defaultView;if(!x)return()=>{_.forEach(t=>t())};const C=Ma(x),M=x.Object.getOwnPropertyDescriptor(x.HTMLInputElement.prototype,"value");return M&&M.set&&_.push(...[[x.HTMLInputElement.prototype,"value"],[x.HTMLInputElement.prototype,"checked"],[x.HTMLSelectElement.prototype,"value"],[x.HTMLTextAreaElement.prototype,"value"],[x.HTMLSelectElement.prototype,"selectedIndex"],[x.HTMLOptionElement.prototype,"selected"]].map(t=>Ta(t[0],t[1],{set(){if(!h)return;const t=Xa(m)(this);t&&(p(t)?w(t,!1):Xa(b)(t,!1))}},!1,x))),_.unshift(function(t,e){const n=Ha.get(t)||new Set;return Ha.set(t,n),n.add(e),()=>{n.delete(e),n.size||Ha.get(t)!==n||Ha.delete(t)}}(e,Xa(t=>{n.getId(t)>0&&Ua(t)&&!La(t,i,r)&&b(t,!1,!1,!!u)}))),Xa(()=>{Sa([k]),h=!1,f.clear(),Sa(_)})}(t)),a("mediaInteraction",()=>function({mediaInteractionCb:t,blockClass:e,blockSelector:n,mirror:i,sampling:r,doc:o}){const s=Xa(o=>Ca(Xa(r=>{const s=el(r);if(!function(t){const e=null==t?void 0:t.tagName;if("string"!=typeof e)return!1;const n=Is(e);return"video"===n||"audio"===n}(s)||$a(s,e,n,!0))return;const{currentTime:a,volume:l,muted:u,playbackRate:c,loop:d}=s;t({type:o,id:i.getId(s),currentTime:a,volume:l,muted:u,playbackRate:c,loop:d})}),r.media||500)),a=[ba("play",s(ao.Play),o),ba("pause",s(ao.Pause),o),ba("seeked",s(ao.Seeked),o),ba("volumechange",s(ao.VolumeChange),o),ba("ratechange",s(ao.RateChange),o)];return Xa(()=>{a.forEach(t=>t())})}(t)),t.recordDOM){const e=function(t){const e=new Map,n=new Set;let i=!0;const r=t=>{if(i)try{t()}catch(t){}},o=t=>{var n;const i=e.get(t);if(i){for(;null===(n=i[0])||void 0===n?void 0:n.ready;){const t=i.shift();(null==t?void 0:t.emit)&&r(t.emit)}0===i.length&&e.delete(t)}};return{queueMutation(t,n){if(!t)return void r(n);const i=e.get(t);i?(i.push({emit:n,ready:!0}),o(t)):r(n)},queuePendingMutation(s,a,l){if(!i)return()=>{};let u=e.get(s);u||(u=[],e.set(s,u));const c={emit:a,ready:!1};u.push(c);let d,h=!1,f=!1;const v=()=>{h||f||(h=!0,void 0!==d&&n.delete(d),c.ready=!0,c.emit=void 0,o(s))};try{d=t.setTimeout(v,5e3),h||f?t.clearTimeout(d):n.add(d)}catch(t){v()}return e=>{!f&&i&&(f=!0,void 0!==d&&(t.clearTimeout(d),n.delete(d)),h?e&&r(l):(c.ready=!0,e||(c.emit=void 0),o(s)))}},reset(){i=!1,n.forEach(e=>t.clearTimeout(e)),n.clear(),e.clear()}}}(n);o.push(e.reset),a("styleSheet",()=>function({styleSheetRuleCb:t,mirror:e,stylesheetManager:n},{win:i,mutationQueue:r}){if(!i.CSSStyleSheet||!i.CSSStyleSheet.prototype)return()=>{};const o=i.CSSStyleSheet.prototype.insertRule;i.CSSStyleSheet.prototype.insertRule=new Proxy(o,{apply:Xa((i,o,s)=>{const[a]=s,l=i.apply(o,s);Oo(o.cssRules[l],a),n.onCssomSheetMutation(o);const{id:u,styleId:c}=ul(o,e,n.styleMirror);return(u&&-1!==u||c&&-1!==c)&&r.queueMutation(o,()=>t({id:u,styleId:c,adds:[{rule:a,index:l}]})),l},"host")}),i.CSSStyleSheet.prototype.addRule=function(t,e,n=this.cssRules.length){return i.CSSStyleSheet.prototype.insertRule.apply(this,[`${t} { ${e} }`,n])};const s=i.CSSStyleSheet.prototype.deleteRule;let a,l;i.CSSStyleSheet.prototype.deleteRule=new Proxy(s,{apply:Xa((i,o,s)=>{const[a]=s,l=i.apply(o,s);n.onCssomSheetMutation(o);const{id:u,styleId:c}=ul(o,e,n.styleMirror);return(u&&-1!==u||c&&-1!==c)&&r.queueMutation(o,()=>t({id:u,styleId:c,removes:[{index:a}]})),l},"host")}),i.CSSStyleSheet.prototype.removeRule=function(t){return i.CSSStyleSheet.prototype.deleteRule.apply(this,[t])},i.CSSStyleSheet.prototype.replace&&(a=i.CSSStyleSheet.prototype.replace,i.CSSStyleSheet.prototype.replace=new Proxy(a,{apply:Xa((i,o,s)=>{const[a]=s,l=i.apply(o,s);try{const i=null==l?void 0:l.then;if(o.ownerNode||!l||"function"!=typeof i)return l;const s=n.onCssomSheetMutation(o),{id:u,styleId:c}=ul(o,e,n.styleMirror),d=u&&-1!==u||c&&-1!==c?r.queuePendingMutation(o,()=>t({id:u,styleId:c,replace:a}),()=>{const e=ys(o);null!==e&&t({id:u,styleId:c,replace:e})}):void 0;try{i.call(l,()=>{n.isCurrentCssomMutation(o,s)&&$o(o,a),null==d||d(!0)},()=>null==d?void 0:d(!1))}catch(t){null==d||d(!1)}}catch(t){}return l},"host")})),i.CSSStyleSheet.prototype.replaceSync&&(l=i.CSSStyleSheet.prototype.replaceSync,i.CSSStyleSheet.prototype.replaceSync=new Proxy(l,{apply:Xa((i,o,s)=>{const[a]=s,l=i.apply(o,s);$o(o,a),n.onCssomSheetMutation(o);const{id:u,styleId:c}=ul(o,e,n.styleMirror);return(u&&-1!==u||c&&-1!==c)&&r.queueMutation(o,()=>t({id:u,styleId:c,replaceSync:a})),l},"host")}));const u={};ml("CSSGroupingRule")?u.CSSGroupingRule=i.CSSGroupingRule:(ml("CSSMediaRule")&&(u.CSSMediaRule=i.CSSMediaRule),ml("CSSConditionRule")&&(u.CSSConditionRule=i.CSSConditionRule),ml("CSSSupportsRule")&&(u.CSSSupportsRule=i.CSSSupportsRule));const c={};return Object.entries(u).forEach(([i,o])=>{c[i]={insertRule:o.prototype.insertRule,deleteRule:o.prototype.deleteRule},o.prototype.insertRule=new Proxy(c[i].insertRule,{apply:Xa((i,o,s)=>{const[a]=s,l=i.apply(o,s);Oo(o.cssRules[l],a),n.onCssomSheetMutation(o.parentStyleSheet);const{id:u,styleId:c}=ul(o.parentStyleSheet,e,n.styleMirror);if(o.parentStyleSheet&&(u&&-1!==u||c&&-1!==c)){const e=[...ll(o),l];r.queueMutation(o.parentStyleSheet,()=>t({id:u,styleId:c,adds:[{rule:a,index:e}]}))}return l},"host")}),o.prototype.deleteRule=new Proxy(c[i].deleteRule,{apply:Xa((i,o,s)=>{const[a]=s,l=i.apply(o,s);Eo(o),n.onCssomSheetMutation(o.parentStyleSheet);const{id:u,styleId:c}=ul(o.parentStyleSheet,e,n.styleMirror);if(o.parentStyleSheet&&(u&&-1!==u||c&&-1!==c)){const e=[...ll(o),a];r.queueMutation(o.parentStyleSheet,()=>t({id:u,styleId:c,removes:[{index:e}]}))}return l},"host")})}),Xa(()=>{i.CSSStyleSheet.prototype.insertRule=o,i.CSSStyleSheet.prototype.deleteRule=s,a&&(i.CSSStyleSheet.prototype.replace=a),l&&(i.CSSStyleSheet.prototype.replaceSync=l),Object.entries(u).forEach(([t,e])=>{e.prototype.insertRule=c[t].insertRule,e.prototype.deleteRule=c[t].deleteRule})})}(t,{win:n,mutationQueue:e})),a("adoptedStyleSheet",()=>hl(t,t.doc)),a("styleDeclaration",()=>function({styleDeclarationCb:t,mirror:e,ignoreCSSAttributes:n,stylesheetManager:i},{win:r,mutationQueue:o}){const s=r.CSSStyleDeclaration.prototype.setProperty;r.CSSStyleDeclaration.prototype.setProperty=new Proxy(s,{apply:Xa((r,s,a)=>{var l;const[u,c,d]=a,h=r.apply(s,a);if(Eo(s.parentRule),n.has(u))return h;const f=null===(l=s.parentRule)||void 0===l?void 0:l.parentStyleSheet;i.onCssomSheetMutation(f);const{id:v,styleId:p}=ul(f,e,i.styleMirror);if(v&&-1!==v||p&&-1!==p){const e=ll(s.parentRule);o.queueMutation(f,()=>t({id:v,styleId:p,set:{property:u,value:c,priority:d},index:e}))}return h},"host")});const a=r.CSSStyleDeclaration.prototype.removeProperty;return r.CSSStyleDeclaration.prototype.removeProperty=new Proxy(a,{apply:Xa((r,s,a)=>{var l;const[u]=a,c=r.apply(s,a);if(Eo(s.parentRule),n.has(u))return c;const d=null===(l=s.parentRule)||void 0===l?void 0:l.parentStyleSheet;i.onCssomSheetMutation(d);const{id:h,styleId:f}=ul(d,e,i.styleMirror);if(h&&-1!==h||f&&-1!==f){const e=ll(s.parentRule);o.queueMutation(d,()=>t({id:h,styleId:f,remove:{property:u},index:e}))}return c},"host")}),Xa(()=>{r.CSSStyleDeclaration.prototype.setProperty=s,r.CSSStyleDeclaration.prototype.removeProperty=a})}(t,{win:n,mutationQueue:e})),t.collectFonts&&a("font",()=>function({fontCb:t,doc:e}){const n=e.defaultView;if(!n)return()=>{};const i=[],r=new WeakMap,o=n.FontFace;n.FontFace=function(t,e,n){const i=new o(t,e,n);return r.set(i,{family:t,buffer:"string"!=typeof e,descriptors:n,fontSource:"string"==typeof e?e:JSON.stringify(Array.from(new Uint8Array(e)))}),i};const s=ko(e.fonts,"add",function(e){return function(n){return setTimeout(Xa(()=>{const e=r.get(n);e&&(t(e),r.delete(n))}),0),e.apply(this,[n])}});return i.push(()=>{n.FontFace=o}),i.push(s),Xa(()=>{i.forEach(t=>t())})}(t))}a("selection",()=>function(t){const{doc:e,mirror:n,blockClass:i,blockSelector:r,selectionCb:o}=t;let s=!0;const a=Xa(()=>{const t=e.getSelection();if(!t||s&&(null==t?void 0:t.isCollapsed))return;s=t.isCollapsed||!1;const a=[],l=t.rangeCount||0;for(let e=0;l>e;e++){const{startContainer:o,startOffset:s,endContainer:l,endOffset:u}=t.getRangeAt(e);$a(o,i,r,!0)||$a(l,i,r,!0)||a.push({start:n.getId(o),startOffset:s,end:n.getId(l),endOffset:u})}o({ranges:a})});return a(),ba("selectionchange",a)}(t)),a("customElement",()=>function({doc:t,customElementCb:e}){const n=t.defaultView;return n&&n.customElements?ko(n.customElements,"define",function(t){return function(n,i,r){try{e({define:{name:n}})}catch(t){console.warn(`Custom element callback failed for ${n}`)}return t.apply(this,[n,i,r])}}):()=>{}}(t));for(const e of t.plugins)a(`plugin:${e.name}`,()=>e.observer(e.callback,n,e.options))}catch(t){try{s()}catch(t){}throw t}return s}function pl(t){return void 0!==window[t]}function ml(t){return Boolean(void 0!==window[t]&&window[t].prototype&&"insertRule"in window[t].prototype&&"deleteRule"in window[t].prototype)}function gl(t){const e=window;if("function"==typeof e.requestIdleCallback){const n=e.requestIdleCallback(t,{timeout:2e3});return{cancel(){var t;return null===(t=e.cancelIdleCallback)||void 0===t?void 0:t.call(e,n)}}}const n=setTimeout(t,250);return{cancel:()=>clearTimeout(n)}}var yl,bl,wl=class{constructor(t){ds(this,"generateIdFn",void 0),ds(this,"iframeRemoteIdToLocalIdMap",new WeakMap),ds(this,"iframeLocalIdToRemoteIdMap",new WeakMap),this.generateIdFn=t}getId(t,e,n,i){if(0>e)return e;const r=n||this.getRemoteIdToLocalIdMap(t),o=i||this.getLocalIdToRemoteIdMap(t);let s=r.get(e);return void 0===s&&(s=this.generateIdFn(),r.set(e,s),o.set(s,e)),s}getIds(t,e){const n=this.getRemoteIdToLocalIdMap(t),i=this.getLocalIdToRemoteIdMap(t);return e.map(e=>this.getId(t,e,n,i))}getRemoteId(t,e,n){var i;return"number"!=typeof e||0>e?e:null!==(i=(n||this.getLocalIdToRemoteIdMap(t)).get(e))&&void 0!==i?i:-1}getRemoteIds(t,e){const n=this.getLocalIdToRemoteIdMap(t);return e.map(e=>this.getRemoteId(t,e,n))}reset(t){if(!t)return this.iframeRemoteIdToLocalIdMap=new WeakMap,void(this.iframeLocalIdToRemoteIdMap=new WeakMap);this.iframeRemoteIdToLocalIdMap.delete(t),this.iframeLocalIdToRemoteIdMap.delete(t)}getRemoteIdToLocalIdMap(t){let e=this.iframeRemoteIdToLocalIdMap.get(t);return e||(e=new Map,this.iframeRemoteIdToLocalIdMap.set(t,e)),e}getLocalIdToRemoteIdMap(t){let e=this.iframeLocalIdToRemoteIdMap.get(t);return e||(e=new Map,this.iframeLocalIdToRemoteIdMap.set(t,e)),e}},kl=class{constructor(t){ds(this,"iframes",new WeakMap),ds(this,"crossOriginIframeMap",new WeakMap),ds(this,"crossOriginIframeMirror",new wl(Gs)),ds(this,"crossOriginIframeStyleMirror",void 0),ds(this,"crossOriginIframeRootIdMap",new WeakMap),ds(this,"mirror",void 0),ds(this,"mutationCb",void 0),ds(this,"wrappedEmit",void 0),ds(this,"loadListener",void 0),ds(this,"pageHideListener",void 0),ds(this,"stylesheetManager",void 0),ds(this,"recordCrossOriginIframes",void 0),ds(this,"blockClass",void 0),ds(this,"blockSelector",void 0),ds(this,"messageHandler",void 0),ds(this,"nestedIframeListeners",new Map),ds(this,"attachedWindows",new WeakMap),ds(this,"attachedDocuments",new WeakMap),ds(this,"attachedIframes",new Map),ds(this,"loadListenerDisposers",new WeakMap),ds(this,"iframeElementsById",new Map),ds(this,"pageHideHandlers",new WeakMap),this.blockClass=t.blockClass,this.blockSelector=t.blockSelector,this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new wl(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.messageHandler=this.handleMessage.bind(this),this.recordCrossOriginIframes&&window.addEventListener("message",this.messageHandler)}addIframe(t){ia(t,this.blockClass,this.blockSelector)||(this.iframes.set(t,!0),t.contentWindow&&this.crossOriginIframeMap.set(t.contentWindow,t))}registerLoadListenerDisposer(t,e){let n=this.loadListenerDisposers.get(t);n||(n=new Set,this.loadListenerDisposers.set(t,n)),n.add(e);const i=this.mirror.getId(t);-1!==i&&this.iframeElementsById.set(i,t)}getIframeElementById(t){var e,n,i;return null!==(e=null!==(n=null===(i=this.attachedIframes.get(t))||void 0===i?void 0:i.element)&&void 0!==n?n:this.iframeElementsById.get(t))&&void 0!==e?e:null}forgetIframeId(t){this.attachedIframes.delete(t),this.iframeElementsById.delete(t)}disposeLoadListeners(t){const e=this.loadListenerDisposers.get(t);e&&(e.forEach(t=>ka(t)),this.loadListenerDisposers.delete(t))}removePageHideListener(t){const e=this.pageHideHandlers.get(t);e&&(e.forEach(({win:t,handler:e})=>{wa(t,"pagehide",e)}),this.pageHideHandlers.delete(t))}addLoadListener(t){this.loadListener=t}addPageHideListener(t){this.pageHideListener=t}removeLoadListener(){this.loadListener=void 0}trackIframeContent(t,e){const n=this.mirror.getId(t);return this.attachedIframes.set(n,{element:t,content:e}),n}attachIframe(t,e){var n;const i=this.trackIframeContent(t,e);if(t.contentDocument){let e=this.attachedDocuments.get(t);e||(e=new Set,this.attachedDocuments.set(t,e)),e.add(t.contentDocument)}this.mutationCb({adds:[{parentId:i,nextId:null,node:e}],removes:[],texts:[],attributes:[],isAttachIframe:!0});const r=t.contentWindow;if(this.recordCrossOriginIframes&&r&&!this.nestedIframeListeners.has(r)){const e=this.handleMessage.bind(this);ka(()=>{r.addEventListener("message",e),this.nestedIframeListeners.set(r,e);let n=this.attachedWindows.get(t);n||(n=new Set,this.attachedWindows.set(t,n)),n.add(r)})}ka(()=>{const e=t.contentWindow;if(!e)return;let n=this.pageHideHandlers.get(t);if(n)for(const t of n)if(t.win===e)return;const i=()=>{var e;null===(e=this.pageHideListener)||void 0===e||e.call(this,t),t.contentDocument&&this.mirror.removeNodeFromMap(t.contentDocument)};e.addEventListener("pagehide",i),n||(n=new Set,this.pageHideHandlers.set(t,n)),n.add({win:e,handler:i})}),null===(n=this.loadListener)||void 0===n||n.call(this,t),t.contentDocument&&t.contentDocument.adoptedStyleSheets&&t.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(t.contentDocument.adoptedStyleSheets,this.mirror.getId(t.contentDocument))}handleMessage(t){const e=t;if("rrweb"!==e.data.type||e.origin!==e.data.origin)return;if(!t.source)return;const n=this.crossOriginIframeMap.get(t.source);if(!n)return;const i=this.transformCrossOriginEvent(n,e.data.event);i&&this.wrappedEmit(i,e.data.isCheckout,!0===e.data.nonInteractive)}transformCrossOriginEvent(t,e){switch(e.type){case no.FullSnapshot:{this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(e.data.node,t);const n=e.data.node.id;return this.crossOriginIframeRootIdMap.set(t,n),this.patchRootIdOnNode(e.data.node,n),this.trackIframeContent(t,e.data.node),{timestamp:e.timestamp,type:no.IncrementalSnapshot,data:{source:io.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:e.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case no.Meta:case no.Load:case no.DomContentLoaded:return!1;case no.Plugin:return e;case no.Custom:return this.replaceIds(e.data.payload,t,["id","parentId","previousId","nextId"]),e;case no.IncrementalSnapshot:switch(e.data.source){case io.Mutation:return e.data.adds.forEach(e=>{this.replaceIds(e,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(e.node,t);const n=this.crossOriginIframeRootIdMap.get(t);n&&this.patchRootIdOnNode(e.node,n)}),e.data.removes.forEach(e=>{this.replaceIds(e,t,["parentId","id"])}),e.data.attributes.forEach(e=>{this.replaceIds(e,t,["id"])}),e.data.texts.forEach(e=>{this.replaceIds(e,t,["id"])}),e;case io.Drag:case io.TouchMove:case io.MouseMove:return e.data.positions.forEach(e=>{this.replaceIds(e,t,["id"])}),e;case io.ViewportResize:return!1;case io.MediaInteraction:case io.MouseInteraction:case io.Scroll:case io.CanvasMutation:return this.replaceIds(e.data,t,["id"]),e;case io.Input:return this.replaceIds(e.data,t,["id","selectedOptionIds"]),e;case io.StyleSheetRule:case io.StyleDeclaration:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleId"]),e;case io.Font:return e;case io.Selection:return e.data.ranges.forEach(e=>{this.replaceIds(e,t,["start","end"])}),e;case io.AdoptedStyleSheet:var n;return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleIds"]),null===(n=e.data.styles)||void 0===n||n.forEach(e=>{this.replaceStyleIds(e,t,["styleId"])}),e}}return!1}replace(t,e,n,i){for(const r of i)(Array.isArray(e[r])||"number"==typeof e[r])&&(e[r]=Array.isArray(e[r])?t.getIds(n,e[r]):t.getId(n,e[r]));return e}replaceIds(t,e,n){return this.replace(this.crossOriginIframeMirror,t,e,n)}replaceStyleIds(t,e,n){return this.replace(this.crossOriginIframeStyleMirror,t,e,n)}replaceIdOnNode(t,e){this.replaceIds(t,e,["id","rootId"]),"childNodes"in t&&t.childNodes.forEach(t=>{this.replaceIdOnNode(t,e)})}patchRootIdOnNode(t,e){t.type===lo.Document||t.rootId||(t.rootId=e),"childNodes"in t&&t.childNodes.forEach(t=>{this.patchRootIdOnNode(t,e)})}removeIframeById(t){const e=this.attachedIframes.get(t),n=(null==e?void 0:e.element)||this.iframeElementsById.get(t)||this.mirror.getNode(t);if(this.iframeElementsById.delete(t),n){const t=n.contentWindow,e=this.attachedWindows.get(n);e&&(e.forEach(t=>{const e=this.nestedIframeListeners.get(t);e&&(wa(t,"message",e),this.nestedIframeListeners.delete(t)),this.crossOriginIframeMap.delete(t)}),this.attachedWindows.delete(n)),t&&this.nestedIframeListeners.has(t)&&(wa(t,"message",this.nestedIframeListeners.get(t)),this.nestedIframeListeners.delete(t)),t&&this.crossOriginIframeMap.delete(t),this.iframes.delete(n),this.disposeLoadListeners(n),this.removePageHideListener(n);const i=this.attachedDocuments.get(n);i&&(i.forEach(t=>{ka(()=>this.mirror.removeNodeFromMap(t))}),ka(()=>rl(n,i)),this.attachedDocuments.delete(n))}e&&this.attachedIframes.delete(t)}cleanupDetachedIframes(){if(0===this.attachedIframes.size)return;const t=[];this.attachedIframes.forEach((e,n)=>{this.mirror.has(n)||t.push(n)}),t.forEach(t=>this.removeIframeById(t))}reattachIframes(){this.attachedIframes.forEach(({content:t},e)=>{this.mirror.has(e)?this.mutationCb({adds:[{parentId:e,nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}):this.attachedIframes.delete(e)})}destroy(){this.recordCrossOriginIframes&&wa(window,"message",this.messageHandler),this.nestedIframeListeners.forEach((t,e)=>{wa(e,"message",t)}),this.nestedIframeListeners.clear();const t=new Set;this.iframeElementsById.forEach(e=>t.add(e)),this.attachedIframes.forEach(({element:e})=>t.add(e)),t.forEach(t=>{this.disposeLoadListeners(t),this.removePageHideListener(t)}),this.crossOriginIframeMirror.reset(),this.crossOriginIframeStyleMirror.reset(),this.attachedIframes.clear(),this.crossOriginIframeMap=new WeakMap,this.iframes=new WeakMap,this.crossOriginIframeRootIdMap=new WeakMap,this.loadListenerDisposers=new WeakMap,this.pageHideHandlers=new WeakMap,this.attachedDocuments=new WeakMap,this.attachedWindows=new WeakMap,this.iframeElementsById=new Map}},Sl=new Map,_l=new WeakMap;function xl(t){t.dispose(),Sl.get(t.win)===t&&Sl.delete(t.win)}function Cl(){(null==bl?void 0:bl.valid)&&(bl.valid=!1,(null==yl?void 0:yl.stopped)?Po():Fo())}var Ml=class{constructor(t,e){ds(this,"win",void 0),ds(this,"owned",new Map),ds(this,"pending",new Set),ds(this,"stopped",!1),ds(this,"ready",!1),this.win=t;try{const i=bl;if(e&&(null==i?void 0:i.valid)&&i.stopCompleted&&!i.next&&["interactive","complete"].includes(t.document.readyState)){i.next=this;for(const e of i.retained)try{var n;e.win.CSSRule.prototype!==e.prototype||e.win!==t&&!(null===(n=e.win.frameElement)||void 0===n?void 0:n.isConnected)||(this.acquire(e.win),e.win!==t&&this.pending.add(e.win))}catch(t){}}else{if(Cl(),i){for(const t of i.retained)0===t.owners&&xl(t);i.retained.clear()}Fo(),To=new WeakSet,Io=!1}yl=this,e&&this.acquire(t)}catch(t){throw this.stop(),t}}acquire(t){if(!t.CSSRule)return Po(),()=>{};const e=this.owned.get(t);if(e)return e;let n=Sl.get(t);if(!n){const e=function(t){const e={active:!0};return _o.set(t,e),()=>{e.active=!1,_o.get(t)===e&&_o.delete(t)}}(t.CSSRule.prototype);let i;try{i=function(t){const e=[],n=(t,n)=>{const i="appendRule"===n||"deleteRule"===n||"insertRule"===n,r=Object.getOwnPropertyDescriptor(t,n);if(!r)return void(("style"===n||i)&&Po());const o="style"===n||"styleMap"===n||"media"===n;if(!r.configurable||o&&!r.get||i&&"function"!=typeof r.value)return void Po();const s=L({},r);if(i&&(s.value=new Proxy(r.value,{apply(t,e,n){const i=t.apply(e,n);return Do(e),i}})),r.get&&o){const t=r.get;s.get=function(){const e=t.call(this);return Do(this),e}}if(r.set){const t=r.set;s.set=function(e){const n=t.call(this,e);return Do(this),n}}try{Object.defineProperty(t,n,s),e.push(()=>{const e=Object.getOwnPropertyDescriptor(t,n);(null==e?void 0:e.get)===s.get&&(null==e?void 0:e.set)===s.set&&(null==e?void 0:e.value)===s.value&&Object.defineProperty(t,n,r)})}catch(t){Po()}};try{var i,r,o;const s=t;for(const e of[t.CSSStyleRule,t.CSSKeyframeRule,t.CSSPageRule,t.CSSFontFaceRule,s.CSSNestedDeclarations,s.CSSMarginRule,s.CSSPositionTryRule])e&&(n(e.prototype,"style"),n(e.prototype,"styleMap"));for(const e of[t.CSSMediaRule,t.CSSImportRule])e&&n(e.prototype,"media");t.CSSStyleRule&&n(t.CSSStyleRule.prototype,"selectorText"),t.CSSKeyframeRule&&n(t.CSSKeyframeRule.prototype,"keyText"),t.CSSKeyframesRule&&(n(t.CSSKeyframesRule.prototype,"name"),n(t.CSSKeyframesRule.prototype,"appendRule"),n(t.CSSKeyframesRule.prototype,"deleteRule"));const a=t.CSSGroupingRule?[t.CSSGroupingRule]:[t.CSSMediaRule,t.CSSConditionRule,t.CSSSupportsRule];for(const t of a)t&&(n(t.prototype,"insertRule"),n(t.prototype,"deleteRule"));const l=null===(i=t.CSSStyleRule)||void 0===i?void 0:i.prototype;for(const t of["insertRule","deleteRule"])l&&{}.hasOwnProperty.call(l,t)&&n(l,t);const u=null===(r=t.CSSRule)||void 0===r?void 0:r.prototype;return u&&(null===(o=Object.getOwnPropertyDescriptor(u,"cssText"))||void 0===o?void 0:o.set)&&n(u,"cssText"),()=>Sa(e)}catch(t){throw Sa(e),Po(),t}}(t)}catch(t){throw e(),t}n={win:t,prototype:t.CSSRule.prototype,owners:0,dispose:()=>Sa([e,i])},Sl.set(t,n)}const i=n;i.owners++;const r=()=>{this.owned.get(t)===r&&(this.owned.delete(t),this.pending.delete(t),i.owners--,0===i.owners&&((null==bl?void 0:bl.valid)&&bl.previous===this&&bl.stopStarted?bl.retained.add(i):xl(i)))};return this.owned.set(t,r),r}observe(t){return this.prune(),this.pending.delete(t),t===this.win?()=>{}:this.acquire(t)}prune(){for(const n of this.pending){var t;try{var e;const t=Sl.get(n);if((null===(e=n.frameElement)||void 0===e?void 0:e.isConnected)&&n.CSSRule.prototype===(null==t?void 0:t.prototype))continue}catch(t){}null===(t=this.owned.get(n))||void 0===t||t()}}beforeStop(){(null==bl?void 0:bl.previous)===this&&bl.valid&&!bl.stopStarted?bl.stopStarted=!0:Cl()}stop(){if(!this.stopped){for(const t of[...this.owned.values()])t();this.stopped=!0,(null==bl?void 0:bl.valid)&&bl.previous===this?bl.stopCompleted=!0:yl===this&&(Po(),yl=void 0)}}},Tl=class{constructor(t){ds(this,"shadowDoms",new Map),ds(this,"mutationCb",void 0),ds(this,"scrollCb",void 0),ds(this,"bypassOptions",void 0),ds(this,"mirror",void 0),ds(this,"restoreHandlers",[]),this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(t,e){var n,i;if(!vs(t))return;if(this.shadowDoms.has(t))return;const r=null!==(n=null===(i=So.host(t))||void 0===i?void 0:i.ownerDocument)&&void 0!==n?n:e,o={doc:r,handlers:[]};this.shadowDoms.set(t,o);const{observer:s,buffer:a}=nl(L(L({},this.bypassOptions),{},{doc:r,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t);o.handlers.push(()=>{s.disconnect(),a.destroy(),a.releaseCanvasManager();const t=tl.indexOf(a);-1!==t&&tl.splice(t,1)}),o.handlers.push(il(L(L({},this.bypassOptions),{},{scrollCb:this.scrollCb,doc:t,mirror:this.mirror}))),setTimeout(()=>{this.shadowDoms.get(t)===o&&(t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(So.host(t))),o.handlers.push(hl({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t)))},0)}removeShadowRootsIn(t){if(0===this.shadowDoms.size)return;const e=So.shadowRoot(t);e&&(this.shadowDoms.has(e)&&this.removeShadowRoot(e),this.removeShadowRootsIn(e)),So.childNodes(t).forEach(t=>this.removeShadowRootsIn(t))}removeShadowRoot(t){const e=this.shadowDoms.get(t);this.shadowDoms.delete(t),null==e||e.handlers.forEach(Il)}observeAttachShadow(t){ka(()=>{const e=t.contentWindow,n=t.contentDocument;e&&n&&this.patchAttachShadow(e.Element,n)})}patchAttachShadow(t,e){const n=this;this.restoreHandlers.push({doc:e,handler:ko(t.prototype,"attachShadow",function(t){return function(i){const r=t.call(this,i),o=So.shadowRoot(this);return o&&Ua(this)&&n.addShadowRoot(o,e),r}})})}reset(){this.restoreHandlers.forEach(({handler:t})=>Il(t)),this.restoreHandlers=[];const t=this.shadowDoms;this.shadowDoms=new Map,t.forEach(({handlers:t})=>t.forEach(Il))}resetForDoc(t){const e=[];for(const n of this.restoreHandlers)n.doc===t?Il(n.handler):e.push(n);this.restoreHandlers=e,this.shadowDoms.forEach((e,n)=>{e.doc===t&&this.removeShadowRoot(n)})}};function Il(t){try{t()}catch(t){}}var Al="skip-frame";function Rl(t){if("object"!=typeof t||null===t)return!1;const{x:e,y:n,width:i,height:r}=t;return Number.isFinite(e)&&Number.isFinite(n)&&Number.isFinite(i)&&Number.isFinite(r)&&i>=0&&r>=0}for(var El="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ol="undefined"==typeof Uint8Array?[]:new Uint8Array(256),$l=0;64>$l;$l++)Ol[El.charCodeAt($l)]=$l;var Ll=function(t){var e,n=new Uint8Array(t),i=n.length,r="";for(e=0;i>e;e+=3)r+=El[n[e]>>2],r+=El[(3&n[e])<<4|n[e+1]>>4],r+=El[(15&n[e+1])<<2|n[e+2]>>6],r+=El[63&n[e+2]];return i%3==2?r=r.substring(0,r.length-1)+"=":i%3==1&&(r=r.substring(0,r.length-2)+"=="),r},Dl=!1,Fl=new Map,Pl=(t,e,n)=>{if(!t||!jl(t,e)&&"object"!=typeof t)return;const i=function(t,e){let n=Fl.get(t);return n||(n=new Map,Fl.set(t,n)),n.has(e)||n.set(e,[]),n.get(e)}(n,t.constructor.name);let r=i.indexOf(t);return-1===r&&(r=i.length,i.push(t)),r};function Nl(t,e,n,i){if(t instanceof Array)return t.map(t=>Nl(t,e,n,i));if(null===t)return t;if(t instanceof Float32Array||t instanceof Float64Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Uint8Array||t instanceof Uint16Array||t instanceof Int16Array||t instanceof Int8Array||t instanceof Uint8ClampedArray)return{rr_type:t.constructor.name,args:[Object.values(t)]};if(t instanceof ArrayBuffer)return{rr_type:t.constructor.name,base64:Ll(t)};if(t instanceof DataView)return{rr_type:t.constructor.name,args:[Nl(t.buffer,e,n,i),t.byteOffset,t.byteLength]};if(t instanceof HTMLImageElement){const e=t.constructor.name,{src:n}=t;return{rr_type:e,src:n}}if(t instanceof HTMLCanvasElement){const e="HTMLImageElement";let n;try{n=t.toDataURL(i.type,i.quality)}catch(t){throw function(t){"SecurityError"===(null==t?void 0:t.name)?Dl||(Dl=!0,console.warn("[replay] canvas capture: skipping a canvas draw because its pixels cannot be read. A cross-origin image or video drawn into it taints it.",t)):console.warn("[replay] canvas capture: skipping a canvas draw because its pixels cannot be read.",t)}(t),t}return{rr_type:e,src:n}}return t instanceof ImageData?{rr_type:t.constructor.name,args:[Nl(t.data,e,n,i),t.width,t.height]}:jl(t,e)||"object"==typeof t?{rr_type:t.constructor.name,index:Pl(t,e,n)}:t}var ql=(t,e,n,i)=>t.map(t=>Nl(t,e,n,i)),jl=(t,e)=>{const n=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(t=>"function"==typeof e[t]);return Boolean(n.find(n=>t instanceof e[n]))},Bl=["webgl","webgl2"];function zl(t){return"nodeType"in t}function Ul(t,e,n,i){const r=[];try{if(i){const i=function(t,e,n){const i=t.GPUCanvasContext;if((null==i?void 0:i.prototype)&&"function"==typeof i.prototype.configure)return ko(i.prototype,"configure",function(i){return function(r){const o=function(t){const{canvas:e}=t;return e&&"object"==typeof e?e:null}(this);if(!o||zl(o)&&$a(o,e,n,!0))return i.call(this,r);zl(o)&&!("__context"in o)&&(o.__context="webgpu");const s=function(t){const e=t.GPUTextureUsage;return e?e.COPY_SRC|e.RENDER_ATTACHMENT:null}(t);return i.call(this,null!==s&&r?L(L({},r),{},{usage:"number"==typeof r.usage?r.usage|s:s}):r)}})}(t,e,n);i&&r.push(i)}const o=ko(t.HTMLCanvasElement.prototype,"getContext",function(t){return function(r,...o){const s=function(t){return"experimental-webgl"===t?"webgl":t}(r);if(!$a(this,e,n,!0)&&("__context"in this||(this.__context=s),i&&Bl.includes(s)))if(o[0]&&"object"==typeof o[0]){const t=o[0];t.preserveDrawingBuffer||(t.preserveDrawingBuffer=!0)}else o.splice(0,1,{preserveDrawingBuffer:!0});return t.apply(this,[r,...o])}});r.push(o)}catch(t){console.warn("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{r.forEach(t=>t())}}function Wl(t,e,n,i,r,o,s){const a=[],l=Object.getOwnPropertyNames(t);for(const u of l)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(u))try{if("function"!=typeof t[u])continue;const l=ko(t,u,function(t){return function(...a){const l=t.apply(this,a);if(Pl(l,o,this),this.canvas&&"tagName"in this.canvas&&!$a(this.canvas,i,r,!0)){let t;try{t=ql(a,o,this,s)}catch(t){}t&&n(this.canvas,{type:e,property:u,args:t})}return l}});a.push(l)}catch(o){const s=Ta(t,u,{set(t){this.canvas&&"tagName"in this.canvas&&!$a(this.canvas,i,r,!0)&&n(this.canvas,{type:e,property:u,args:[t],setter:!0})}});a.push(s)}return a}var Hl='(function() {\n\t//#region ../../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/base64-arraybuffer/1.0.2/f63fa6b5c318cf1c9f6bdd1d4292ad2f15f76f2ec78475025a2d44070e896fe9/node_modules/base64-arraybuffer/dist/base64-arraybuffer.es5.js\n\tvar chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";\n\tvar lookup = typeof Uint8Array === "undefined" ? [] : /* @__PURE__ */ new Uint8Array(256);\n\tfor (var i = 0; i < chars.length; i++) lookup[chars.charCodeAt(i)] = i;\n\tvar encode = function(arraybuffer) {\n\t\tvar bytes = new Uint8Array(arraybuffer), i, len = bytes.length, base64 = "";\n\t\tfor (i = 0; i < len; i += 3) {\n\t\t\tbase64 += chars[bytes[i] >> 2];\n\t\t\tbase64 += chars[(bytes[i] & 3) << 4 | bytes[i + 1] >> 4];\n\t\t\tbase64 += chars[(bytes[i + 1] & 15) << 2 | bytes[i + 2] >> 6];\n\t\t\tbase64 += chars[bytes[i + 2] & 63];\n\t\t}\n\t\tif (len % 3 === 2) base64 = base64.substring(0, base64.length - 1) + "=";\n\t\telse if (len % 3 === 1) base64 = base64.substring(0, base64.length - 2) + "==";\n\t\treturn base64;\n\t};\n\t//#endregion\n\t//#region ../rrweb/src/record/workers/image-bitmap-data-url-worker.ts\n\tconst lastFingerprintMap = /* @__PURE__ */ new Map();\n\tconst transparentFingerprintMap = /* @__PURE__ */ new Map();\n\tconst lastSentAtMap = /* @__PURE__ */ new Map();\n\tconst PROVIDER_KEYFRAME_INTERVAL_MS = 3e4;\n\tfunction hashPixels(data) {\n\t\tconst view = new Uint32Array(data.buffer, data.byteOffset, data.byteLength >>> 2);\n\t\tlet primaryHash = 2166136261;\n\t\tlet secondaryHash = 2654435769;\n\t\tfor (let i = 0; i < view.length; i++) {\n\t\t\tprimaryHash ^= view[i];\n\t\t\tprimaryHash = Math.imul(primaryHash, 16777619);\n\t\t\tsecondaryHash ^= view[i];\n\t\t\tsecondaryHash = Math.imul(secondaryHash, 2246822507);\n\t\t}\n\t\treturn `${(primaryHash >>> 0).toString(16)}:${(secondaryHash >>> 0).toString(16)}`;\n\t}\n\tfunction frameFingerprint(width, height, data) {\n\t\treturn `${width}x${height}:${hashPixels(data)}`;\n\t}\n\tfunction transparentFingerprint(width, height) {\n\t\tconst pixelCount = width * height;\n\t\tlet hash = transparentFingerprintMap.get(pixelCount);\n\t\tif (hash === void 0) {\n\t\t\thash = hashPixels(new Uint8ClampedArray(pixelCount * 4));\n\t\t\ttransparentFingerprintMap.set(pixelCount, hash);\n\t\t}\n\t\treturn `${width}x${height}:${hash}`;\n\t}\n\tlet webpProbeStarted = false;\n\tlet noWebpEncoder = false;\n\tfunction probeWebpEncoder() {\n\t\twebpProbeStarted = true;\n\t\tnew OffscreenCanvas(1, 1).convertToBlob({ type: "image/webp" }).then((blob) => {\n\t\t\tnoWebpEncoder = blob.type !== "image/webp";\n\t\t}).catch(() => void 0);\n\t}\n\tfunction isOpaque(pixels) {\n\t\tfor (let i = 3; i < pixels.length; i += 4) if (pixels[i] !== 255) return false;\n\t\treturn true;\n\t}\n\tfunction encodeOptions(options, pixels) {\n\t\tif (options.type !== "image/webp") return options;\n\t\tif (!webpProbeStarted) probeWebpEncoder();\n\t\treturn noWebpEncoder && isOpaque(pixels) ? {\n\t\t\t...options,\n\t\t\ttype: "image/jpeg"\n\t\t} : options;\n\t}\n\tconst worker = self;\n\tlet reusableCanvas = null;\n\tlet reusableCtx = null;\n\tworker.onmessage = async function(e) {\n\t\tif ("resetFrameDedup" in e.data) {\n\t\t\tlastFingerprintMap.clear();\n\t\t\treturn;\n\t\t}\n\t\tif ("OffscreenCanvas" in globalThis) {\n\t\t\tconst { id, bitmap, width, height, displayWidth, displayHeight, dataURLOptions, maskRegions } = e.data;\n\t\t\ttry {\n\t\t\t\tif (!reusableCanvas || reusableCanvas.width !== width || reusableCanvas.height !== height) {\n\t\t\t\t\treusableCanvas = new OffscreenCanvas(width, height);\n\t\t\t\t\treusableCtx = reusableCanvas.getContext("2d", { willReadFrequently: true });\n\t\t\t\t}\n\t\t\t\tconst ctx = reusableCtx;\n\t\t\t\tctx.clearRect(0, 0, width, height);\n\t\t\t\tctx.drawImage(bitmap, 0, 0);\n\t\t\t\tbitmap.close();\n\t\t\t\tif (maskRegions) {\n\t\t\t\t\tctx.fillStyle = "black";\n\t\t\t\t\tfor (const region of maskRegions) ctx.fillRect(region.x, region.y, region.width, region.height);\n\t\t\t\t}\n\t\t\t\tconst pixels = ctx.getImageData(0, 0, width, height).data;\n\t\t\t\tconst fingerprint = frameFingerprint(width, height, pixels);\n\t\t\t\tif (fingerprint === (lastFingerprintMap.get(id) ?? transparentFingerprint(width, height))) {\n\t\t\t\t\tconst lastSentAt = lastSentAtMap.get(id);\n\t\t\t\t\tif (!(maskRegions !== void 0 && lastSentAt !== void 0 && Date.now() - lastSentAt >= PROVIDER_KEYFRAME_INTERVAL_MS)) return worker.postMessage({ id });\n\t\t\t\t}\n\t\t\t\tconst blob = await reusableCanvas.convertToBlob(encodeOptions(dataURLOptions, pixels));\n\t\t\t\tconst arrayBuffer = await blob.arrayBuffer();\n\t\t\t\tworker.postMessage({\n\t\t\t\t\tid,\n\t\t\t\t\ttype: blob.type,\n\t\t\t\t\tbase64: encode(arrayBuffer),\n\t\t\t\t\tdisplayWidth,\n\t\t\t\t\tdisplayHeight\n\t\t\t\t});\n\t\t\t\tlastFingerprintMap.set(id, fingerprint);\n\t\t\t\tlastSentAtMap.set(id, Date.now());\n\t\t\t} catch {\n\t\t\t\tworker.postMessage({ id });\n\t\t\t}\n\t\t} else {\n\t\t\te.data.bitmap.close();\n\t\t\treturn worker.postMessage({ id: e.data.id });\n\t\t}\n\t};\n\t//#endregion\n})();\n',Gl="undefined"!=typeof self&&self.Blob&&new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);",Hl],{type:"text/javascript;charset=utf-8"});function Vl(t){let e;try{if(e=Gl&&(self.URL||self.webkitURL).createObjectURL(Gl),!e)throw"";const n=new Worker(e,{name:null==t?void 0:t.name});return n.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(e)}),n}catch(e){return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(Hl),{name:null==t?void 0:t.name})}}var Ql="A page CSP that omits blob: from worker-src or script-src blocks it";function Zl(t,...e){console.warn(`[replay] canvas capture: ${t}`,...e)}var Jl=class{onFullSnapshot(){var t;null===(t=this.resetFrameDedup)||void 0===t||t.call(this)}acquire(){this.refCount+=1}reset(){this.refCount>0&&(this.refCount-=1),this.refCount>0||this.teardown()}teardown(){this.torndown||(this.torndown=!0,this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers(),null!==this.rafIdTimestamp&&(cancelAnimationFrame(this.rafIdTimestamp),this.rafIdTimestamp=null),null!==this.rafIdFlush&&(cancelAnimationFrame(this.rafIdFlush),this.rafIdFlush=null))}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}constructor(t){ds(this,"pendingCanvasMutations",new Map),ds(this,"rafStamps",{latestId:0,invokeId:null}),ds(this,"mirror",void 0),ds(this,"mutationCb",void 0),ds(this,"resetObservers",void 0),ds(this,"frozen",!1),ds(this,"locked",!1),ds(this,"rafIdTimestamp",null),ds(this,"rafIdFlush",null),ds(this,"refCount",0),ds(this,"torndown",!1),ds(this,"resetFrameDedup",null),ds(this,"processMutation",(t,e)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(t)||this.pendingCanvasMutations.set(t,[]),this.pendingCanvasMutations.get(t).push(e)});const{sampling:e="all",win:n,blockClass:i,blockSelector:r,recordCanvas:o,dataURLOptions:s,resolutionScale:a,canvasMasking:l}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,o&&"all"===e&&this.initCanvasMutationObserver(n,i,r,s),o&&"number"==typeof e&&this.initCanvasFPSObserver(e,n,i,r,{dataURLOptions:s,resolutionScale:a,canvasMasking:l})}initCanvasFPSObserver(t,e,n,i,r){var o=this;if(!("OffscreenCanvas"in e))return void Zl("disabled because this browser does not support OffscreenCanvas");const s="number"==typeof r.resolutionScale&&Number.isFinite(r.resolutionScale)?Math.min(1,Math.max(.1,r.resolutionScale)):1,a=Ul(e,n,i,!0),l=new Map;let u;try{u=new Vl}catch(t){return Zl(`disabled because the encode worker did not start. ${Ql}`,t),void a()}let c=!1;u.onerror=t=>{var e;c=!0,Zl(`stopped because the encode worker failed. ${Ql}`,t),cancelAnimationFrame(v),null===(e=u.terminate)||void 0===e||e.call(u),this.resetFrameDedup=null},this.resetFrameDedup=()=>{u.postMessage({resetFrameDedup:!0})},u.onmessage=t=>{const{id:e}=t.data;if(l.set(e,!1),!("base64"in t.data))return;const{base64:n,type:i,displayWidth:r,displayHeight:o}=t.data;this.mutationCb({id:e,type:so["2D"],commands:[{property:"clearRect",args:[0,0,r,o]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:n}],type:i}]},0,0,r,o]}],displayWidth:r,displayHeight:o})};let d=!1,h=!1;const f=1e3/t;let v,p=0;const m=t=>{var a;c||(p&&f>t-p||(p=t,(()=>{const t=[],r=e=>{try{e.querySelectorAll("canvas").forEach(e=>{$a(e,n,i,!0)||t.push(e)}),e.querySelectorAll("*").forEach(t=>{t.shadowRoot&&r(t.shadowRoot)})}catch(t){}};return r(e.document),t})().forEach((a=A(function*(t){const e=o.mirror.getId(t);if(-1!==e&&!l.get(e)&&0!==t.width&&0!==t.height){l.set(e,!0);try{if(["webgl","webgl2"].includes(t.__context)){var n,i;const r=t.getContext(t.__context);if(null==r||null===(n=r.isContextLost)||void 0===n?void 0:n.call(r))return void l.set(e,!1);!1===(null==r||null===(i=r.getContextAttributes())||void 0===i?void 0:i.preserveDrawingBuffer)&&r.clear(r.COLOR_BUFFER_BIT)}const o=t.clientWidth||t.width,a=t.clientHeight||t.height,c=Math.max(1,Math.round(o*s)),h=Math.max(1,Math.round(a*s)),f=function(t,e,n,i,r,o){if(!t||"function"!=typeof t.regionsFn)return;let s;try{s=t.regionsFn(e)}catch(t){return Al}if(void 0===s)return;if(!Array.isArray(s)||!s.every(Rl))return Al;const a=n/r,l=i/o;return s.filter(t=>t.width>0&&t.height>0).map(t=>{const e=Math.floor(t.x*a),n=Math.floor(t.y*l);return{x:e,y:n,width:Math.ceil((t.x+t.width)*a)-e,height:Math.ceil((t.y+t.height)*l)-n}})}(r.canvasMasking,t,c,h,o,a);if("skip-frame"===f)return d||(d=!0,Zl("dropped a frame because the mask provider did not return valid regions. A provider that always fails records no canvas frames at all")),void l.set(e,!1);const v=yield createImageBitmap(t,1>s?{resizeWidth:c,resizeHeight:h,resizeQuality:"medium"}:{resizeWidth:c,resizeHeight:h});u.postMessage({id:e,bitmap:v,width:c,height:h,displayWidth:o,displayHeight:a,dataURLOptions:r.dataURLOptions,maskRegions:f},[v])}catch(t){h||(h=!0,Zl("dropped a frame because the snapshot failed. A canvas that fails every frame records no canvas frames at all",t)),l.set(e,!1)}}}),function(t){return a.apply(this,arguments)}))),v=requestAnimationFrame(m))};v=requestAnimationFrame(m),this.resetObservers=()=>{var t;a(),cancelAnimationFrame(v),null===(t=u.terminate)||void 0===t||t.call(u),this.resetFrameDedup=null}}initCanvasMutationObserver(t,e,n,i){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const r=Ul(t,e,n,!1),o=function(t,e,n,i,r){const o=[],s=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype);for(const a of s)try{if("function"!=typeof e.CanvasRenderingContext2D.prototype[a])continue;const s=ko(e.CanvasRenderingContext2D.prototype,a,function(o){return function(...s){return $a(this.canvas,n,i,!0)||setTimeout(()=>{let n;try{n=ql(s,e,this,r)}catch(t){return}t(this.canvas,{type:so["2D"],property:a,args:n})},0),o.apply(this,s)}});o.push(s)}catch(r){const s=Ta(e.CanvasRenderingContext2D.prototype,a,{set(e){$a(this.canvas,n,i,!0)||t(this.canvas,{type:so["2D"],property:a,args:[e],setter:!0})}});o.push(s)}return()=>{o.forEach(t=>t())}}(this.processMutation.bind(this),t,e,n,i),s=function(t,e,n,i,r){const o=[];return void 0!==e.WebGLRenderingContext&&o.push(...Wl(e.WebGLRenderingContext.prototype,so.WebGL,t,n,i,e,r)),void 0!==e.WebGL2RenderingContext&&o.push(...Wl(e.WebGL2RenderingContext.prototype,so.WebGL2,t,n,i,e,r)),()=>{o.forEach(t=>t())}}(this.processMutation.bind(this),t,e,n,i);this.resetObservers=()=>{r(),o(),s()}}startPendingCanvasMutationFlusher(){this.rafIdFlush=requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const t=e=>{this.rafStamps.latestId=e,this.rafIdTimestamp=requestAnimationFrame(t)};this.rafIdTimestamp=requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((t,e)=>{const n=this.mirror.getId(e);this.flushPendingCanvasMutationFor(e,n)}),this.rafIdFlush=requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(t,e){if(this.frozen||this.locked)return;const n=this.pendingCanvasMutations.get(t);if(!n||-1===e)return;const i=n.map(t=>function(t,e){if(null==t)return{};var n,i,r=function(t,e){if(null==t)return{};var n={};for(var i in t)if({}.hasOwnProperty.call(t,i)){if(e.includes(i))continue;n[i]=t[i]}return n}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;o.length>i;i++)e.includes(n=o[i])||{}.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}(t,eo)),{type:r}=n[0];this.mutationCb({id:e,type:r,commands:i}),this.pendingCanvasMutations.delete(t)}};function Yl(t){var e,n,i;const r={};for(const i of Object.keys(null!==(e=null===(n=t.previous)||void 0===n?void 0:n.attributes)&&void 0!==e?e:{}))r[i]=null;return Object.assign(r,null===(i=t.current)||void 0===i?void 0:i.attributes),delete r.rel,delete r.href,r}var Kl,Xl,tu,eu=class{constructor(t){var e,n,i;ds(this,"trackedLinkElements",new WeakSet),ds(this,"pendingDeferredSheets",new Set),ds(this,"cssomRevisions",new WeakMap),ds(this,"stopped",!1),ds(this,"changedLinkJobs",new Map),ds(this,"linksInlinedSinceSnapshot",new WeakSet),ds(this,"mutationCb",void 0),ds(this,"adoptedStyleSheetCb",void 0),ds(this,"maskAllElementAttributes",void 0),ds(this,"maskAttributeFn",void 0),ds(this,"blockClass",void 0),ds(this,"blockSelector",void 0),ds(this,"styleMirror",new Ba),this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb,this.maskAllElementAttributes=null!==(e=t.maskAllElementAttributes)&&void 0!==e&&e,this.maskAttributeFn=t.maskAttributeFn,this.blockClass=null!==(n=t.blockClass)&&void 0!==n?n:"rr-block",this.blockSelector=null!==(i=t.blockSelector)&&void 0!==i?i:null}isLinkBlocked(t){return La(t,this.blockClass,this.blockSelector)}attachLinkElement(t,e,n=null){this.stopped||!("_cssText"in e.attributes)||this.isLinkBlocked(t)||(this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:e.id,attributes:Yl({previous:n,current:e})}]}),this.linksInlinedSinceSnapshot.add(t)),this.trackLinkElement(t)}beginDeferredLinkInlining(t,e,n={}){var i;const r=null!==(i=n.emitCssText)&&void 0!==i?i:n=>this.emitCssTextMutation(t,e,n);if(-1===e||!t.isConnected)return null;let o=null,s=null;try{s=t.sheet,s&&(o=function(t){const e=[];let n=!1,i=null;const r=new Map;function o(t){const r=e.pop();if("group"===r.kind){if(null===t){for(;e.length>0&&"group"===e[e.length-1].kind;)e.pop();return void o(null)}const n=e[e.length-1];return n.parts.push(t),void(n.index+=1)}if(!r.importRule)return n=!0,void(i=t);s(e[e.length-1],r.importRule,t)}function s(t,e,n){try{let r;try{r=n||ms(e)}catch(t){r=e.cssText}try{var i;r&&(null===(i=e.styleSheet)||void 0===i?void 0:i.href)&&(r=Ps(r,e.styleSheet.href))}catch(t){}r&&t.parts.push(r),t.index+=1}catch(t){o(null)}}function a(t){var n;const i=t.rules[t.index];if("sheet"===t.kind&&ks(i)){const n=r.get(i);return null===n?(t.parts.push(i.cssText),void(t.index+=1)):n?void e.push({kind:"sheet",sheet:n.sheet,rules:n.rules,sheetHref:n.sheetHref,index:0,parts:[],importRule:i}):void s(t,i,null)}if(function(t,n){try{if(void 0!==Lo(t))return!1;const i=Cs(t);if(null===i)return!1;const r=n.sheetHref;return e.push({kind:"group",rules:Array.from(t.cssRules),sheetHref:r,index:0,parts:[],prelude:r?Ps(i,r):i,fixColons:"sheet"===n.kind&&Ss(t)&&t.selectorText.includes(":")}),!0}catch(t){return!1}}(i,t))return;let o=null!==(n=Lo(i))&&void 0!==n?n:i.cssText;"sheet"===t.kind&&Ss(i)&&i.selectorText.includes(":")&&(o=ws(o)),t.parts.push(t.sheetHref?Ps(o,t.sheetHref):o),t.index+=1}return function(t){try{const n=t.rules||t.cssRules;if(!n)return!1;is(n);let i=t.href;!i&&t.ownerNode&&(i=t.ownerNode.baseURI);const o=Array.from(n);return e.push({kind:"sheet",sheet:t,rules:o,sheetHref:i,index:0,parts:[],importRule:null}),function(t,e){const n=[{sheet:e,rules:t,index:0}];for(;n.length>0;){const t=n[n.length-1];if(t.index>=t.rules.length){n.pop();continue}const e=t.rules[t.index];if(t.index+=1,!ks(e)||r.has(e))continue;let i=null;try{i=e.styleSheet}catch(t){r.set(e,null);continue}if(i&&!n.some(t=>t.sheet===i))try{const t=i.rules||i.cssRules;if(!t)continue;is(t);let o=i.href;!o&&i.ownerNode&&(o=i.ownerNode.baseURI);const s=Array.from(t);r.set(e,{sheet:i,rules:s,sheetHref:o}),n.push({sheet:i,rules:s,index:0})}catch(t){}}}(o,t),!0}catch(t){return!1}}(t)||(n=!0),{advance(t){if(n)return!0;const r=No();let s=t>0?t:1;try{for(;!n&&s>0;){const t=e[e.length-1];if(t.index>=t.rules.length){let e=null;try{if("group"===t.kind){const n=t.prelude+t.parts.join("")+"}";e=t.fixColons?ws(n):n}else e=ps(t.parts.join(""))}catch(t){}o(e);continue}s-=1;try{a(t)}catch(t){o(null)}}}catch(t){n=!0,i=null}finally{os(No()-r)}return n},text(){return n?i:null},remainingRules(){if(n)return 0;let t=0;for(const n of e)t+=n.rules.length-n.index;return t}}}(s))}catch(t){}var a;if(!o||!s)return ls(),null===(a=n.onUninlinable)||void 0===a||a.call(n),null;const l=o;let u=!1;const c={sheet:s,invalidate(){u=!0}};this.pendingDeferredSheets.add(c);let d=!1;return{advance:e=>{if(d)return!0;const i=No(),o=Bo();let a=!0;try{if(u)return d=!0,n.onInvalidatedBySheetMutation?n.onInvalidatedBySheetMutation():ls(),!0;if(!l.advance(e))return a=!1,!1;d=!0;const i=l.text();if(!t.isConnected)return!0;let o=null;try{o=t.sheet}catch(t){}return o!==s?(ls(),!0):i?(this.isLinkBlocked(t)||r(i),!0):(ls(),null===(h=n.onUninlinable)||void 0===h||h.call(n),!0);var h}finally{a&&this.pendingDeferredSheets.delete(c),zo(f=No()-i,null!=(v=o)?v:qo)||(Xo.totalMs+=f,f>Xo.slowestSliceMs&&(Xo.slowestSliceMs=f))}var f,v},remainingRules:()=>l.remainingRules(),discard:()=>{this.pendingDeferredSheets.delete(c)}}}onCssomSheetMutation(t){var e;if(!t)return;const n=(null!==(e=this.cssomRevisions.get(t))&&void 0!==e?e:0)+1;this.cssomRevisions.set(t,n);for(const e of this.pendingDeferredSheets)e.sheet===t&&(this.pendingDeferredSheets.delete(e),e.invalidate());return n}isCurrentCssomMutation(t,e){return!this.stopped&&this.cssomRevisions.get(t)===e}inlineLinkStylesheetAfterChange(t,e){this.stopped||-1===e.currentId()||function(t,e){const n=ua(t),i=aa.get(t);if(i)return void(i.changedLinkBaseline&&(i.changedLinkBaseline.sheetAtLatestChange=n));const r={sheetAtLatestChange:n},o=()=>{const e=ua(t);return Boolean(e&&(e!==r.sheetAtLatestChange||e.href===t.href))};o()?e():ca(t,e,o,da,r)}(t,()=>this.inlineChangedLinkStylesheet(t,e,3))}inlineChangedLinkStylesheet(t,e,n){var i;const r=e.currentId();if(this.stopped||!t.isConnected||-1===r||this.isLinkBlocked(t))return;null===(i=this.changedLinkJobs.get(t))||void 0===i||i.drop();let o=!1;const s=this.beginDeferredLinkInlining(t,r,{emitCssText:n=>this.emitCssTextMutation(t,r,n,Yl(e.reserializeWithoutCss())),onInvalidatedBySheetMutation(){o=!0},onUninlinable:()=>this.readdAsPlainLink(t,e)});if(!s)return;let a=null;const l=()=>{s.discard(),null==a||a.cancel(),a=null,this.changedLinkJobs.get(t)===u&&this.changedLinkJobs.delete(t)},u={remainingRules:()=>s.remainingRules(),runSlice:()=>{try{return this.stopped||this.changedLinkJobs.get(t)!==u||-1===e.currentId()||this.isLinkBlocked(t)?(l(),!0):!!s.advance(200)&&(l(),!o||(n>0?this.inlineChangedLinkStylesheet(t,e,n-1):ls(),!0))}catch(t){return l(),!0}},drop:l};this.changedLinkJobs.set(t,u);const c=t=>{a=null;let e,n=0;do{e=u.runSlice(),n+=1}while(!e&&(t?!t.didTimeout&&t.timeRemaining()>5:10>n));e||(a=gl(c))};a=gl(c)}flushChangedLinkInlining(t){let e=0;for(const n of this.changedLinkJobs.values()){let i=!1;for(;!i;){if(Math.floor(n.remainingRules()/200)+1>t-e){n.drop(),us(1);break}i=n.runSlice(),e+=1}}return e}inlineDeferredLinkElement(t,e){var n;null===(n=this.beginDeferredLinkInlining(t,e))||void 0===n||n.advance(1/0)}emitCssTextMutation(t,e,n,i={}){this.stopped||(this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:e,attributes:L(L({},i),{},{_cssText:Rs({element:t,name:"_cssText",value:n,maskAllElementAttributes:this.maskAllElementAttributes,maskAttributeFn:this.maskAttributeFn})})}]}),this.linksInlinedSinceSnapshot.add(t))}readdAsPlainLink(t,e){try{var n,i;if(this.stopped||!t.isConnected||this.isLinkBlocked(t))return;if(!this.linksInlinedSinceSnapshot.has(t)&&!("_cssText"in(null!==(n=null===(i=e.lastSerialization())||void 0===i?void 0:i.attributes)&&void 0!==n?n:{})))return;this.linksInlinedSinceSnapshot.delete(t),e.readdAsMove()}catch(t){}}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,e){if(0===t.length)return;const n={id:e,styleIds:[]},i=[];for(const e of t){let t;if(this.styleMirror.has(e))t=this.styleMirror.getId(e);else{const n=this.styleMirror.add(e);t=n;const r=No();try{rs(()=>{try{const t=e.rules||e.cssRules;t&&is(t)}catch(t){}i.push({styleId:n,rules:Array.from(e.rules||CSSRule,(t,n)=>({rule:bs(t,e.href),index:n}))})})}finally{os(No()-r)}}n.styleIds.push(t)}i.length>0&&(n.styles=i),this.adoptedStyleSheetCb(n)}stop(){this.stopped=!0,this.dropChangedLinkJobs(),la()}dropChangedLinkJobs(){Array.from(this.changedLinkJobs.values()).forEach(t=>t.drop())}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet,this.pendingDeferredSheets.clear(),this.dropChangedLinkJobs(),this.linksInlinedSinceSnapshot=new WeakSet,la({keepChangedLinks:!0})}trackStylesheetInLinkElement(t){}},nu=class{constructor(){ds(this,"nodeMap",new WeakMap),ds(this,"active",!1)}inOtherBuffer(t,e){const n=this.nodeMap.get(t);return n&&Array.from(n).some(t=>t!==e)}add(t,e){this.active||(this.active=!0,requestAnimationFrame(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(e))}destroy(){}},iu=!1;try{if(2!==Array.from([1],t=>2*t)[0]){var ru;const t=document.createElement("iframe");document.body.appendChild(t),Array.from=(null===(ru=t.contentWindow)||void 0===ru?void 0:ru.Array.from)||Array.from,document.body.removeChild(t)}}catch(t){console.debug("Unable to override Array.from",t)}var ou=new Ms,su=new Set([io.Mutation,io.MediaInteraction,io.StyleSheetRule,io.CanvasMutation,io.Font,io.Log,io.StyleDeclaration,io.AdoptedStyleSheet]);function au(t={}){let e,n=!1,i=!1;const{emit:r,checkoutEveryNms:o,checkoutEveryNth:s,blockClass:a="rr-block",blockSelector:l=null,ignoreClass:u="rr-ignore",ignoreSelector:c=null,maskTextClass:d="rr-mask",maskTextSelector:h=null,inlineStylesheet:f=!0,inlineStylesheetBudgetRules:v,maskAllInputs:p,maskInputOptions:m,slimDOMOptions:g,maskInputFn:y,selectMaskingFn:b,maskTextFn:w,maskAllElementAttributes:k=!1,maskAttributeFn:S,hooks:_,packFn:x,sampling:C={},dataURLOptions:M={},canvasResolutionScale:T,canvasMasking:I,mousemoveWait:A,recordDOM:R=!0,recordCanvas:E=!1,recordCrossOriginIframes:O=!1,recordAfter:D=("DOMContentLoaded"===t.recordAfter?t.recordAfter:"load"),userTriggeredOnInput:F=!1,collectFonts:P=!1,inlineImages:N=!1,plugins:q,keepIframeSrcFn:j=()=>!1,ignoreCSSAttributes:B=new Set([]),attributeFilter:z,errorHandler:U}=t;Ya(U);const W=L({type:"image/webp",quality:.4,maxBase64ImageLength:1048576},M),H=!O||window.parent===window;let G=!1;if(!H)try{window.parent.document&&(G=!1)}catch(t){G=!0}if(H&&!r)throw new Error("emit function is required");if(!H&&!G)return()=>{};void 0!==A&&void 0===C.mousemove&&(C.mousemove=A),ou.reset(),la();const V=!0===p?{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,hidden:!0}:void 0!==m?m:{password:!0},Q=ga(void 0!==g&&g);let Z;!function(t=window){"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=[].forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=[].forEach)}();let J=0;const Y=new Map;let K,X;const tt=t=>{for(const e of q||[])e.eventProcessor&&(t=e.eventProcessor(t));return x&&!G&&(t=x(t)),t};Kl=(t,e,n)=>{var i;const a=t;if(a.timestamp=Ia(),!(null===(i=tl[0])||void 0===i?void 0:i.isFrozen())||a.type===no.FullSnapshot||a.type===no.IncrementalSnapshot&&su.has(a.data.source)||tl.forEach(t=>t.unfreeze()),H)n?null==r||r(tt(a),e,!0):null==r||r(tt(a),e);else if(G){const t={type:"rrweb",event:tt(a),origin:window.location.origin,isCheckout:e};n&&(t.nonInteractive=!0),window.parent.postMessage(t,"*")}if(a.type===no.FullSnapshot)Z=a,J=0;else if(a.type===no.IncrementalSnapshot){if(a.data.source===io.Mutation&&a.data.isAttachIframe)return;J++,(s&&J>=s||o&&a.timestamp-Z.timestamp>o)&&Xl(!0)}};const et=t=>{if(t.removes&&t.removes.length>0){const e=t.adds.length>0?new Set(t.adds.map(t=>t.node.id)):null,n=new Set;if(t.adds.length>0)for(const e of t.adds){const t=ou.getNode(e.node.id);t&&"IFRAME"===t.nodeName&&n.add(t)}t.removes.forEach(({id:t})=>{if(e&&e.has(t))return;const i=at.getIframeElementById(t);i&&n.has(i)?at.forgetIframeId(t):(null==K||K(t),at.removeIframeById(t))}),null==X||X(),at.cleanupDetachedIframes()}Kl({type:no.IncrementalSnapshot,data:L({source:io.Mutation},t)})},nt=t=>Kl({type:no.IncrementalSnapshot,data:L({source:io.Scroll},t)}),it=t=>Kl({type:no.IncrementalSnapshot,data:L({source:io.CanvasMutation},t)}),rt=new eu({mutationCb:et,adoptedStyleSheetCb:t=>Kl({type:no.IncrementalSnapshot,data:L({source:io.AdoptedStyleSheet},t)}),maskAllElementAttributes:k,maskAttributeFn:S,blockClass:a,blockSelector:l});let ot=!1;const st=()=>{if(!ot){ot=!0;try{var t;const n=null!==(t=null==e?void 0:e.flush())&&void 0!==t?t:0;rt.flushChangedLinkInlining(50-n)}finally{ot=!1}}},at=new kl({mirror:ou,mutationCb:et,stylesheetManager:rt,recordCrossOriginIframes:O,wrappedEmit:Kl,blockClass:a,blockSelector:l});for(const t of q||[])t.getMirror&&t.getMirror({nodeMirror:ou,crossOriginIframeMirror:at.crossOriginIframeMirror,crossOriginIframeStyleMirror:at.crossOriginIframeStyleMirror});const lt=new nu,ut=null==I?void 0:I.configured;tu=new Jl({recordCanvas:E,mutationCb:it,win:window,blockClass:a,blockSelector:l,mirror:ou,sampling:C.canvas,dataURLOptions:W,resolutionScale:T,canvasMasking:I});const ct=new Tl({mutationCb:et,scrollCb:nt,bypassOptions:{blockClass:a,blockSelector:l,maskTextClass:d,maskTextSelector:h,inlineStylesheet:f,maskInputOptions:V,dataURLOptions:W,maskTextFn:w,maskInputFn:y,selectMaskingFn:b,maskAllElementAttributes:k,maskAttributeFn:S,recordCanvas:E,canvasMaskingConfigured:ut,inlineImages:N,sampling:C,slimDOMOptions:Q,iframeManager:at,stylesheetManager:rt,canvasManager:tu,keepIframeSrcFn:j,processedNodeManager:lt,attributeFilter:z},mirror:ou});Xl=(t=!1)=>{if(R){ts(v);try{if(Kl({type:no.Meta,data:{href:window.location.href,width:Ea(),height:Ra()}},t),n)return;null==e||e.cancel(),e=void 0,rt.reset(),ct.init(),tl.forEach(t=>t.lock());let i=null,r=[];try{i=function(t,e){const{mirror:n=new Ms,blockClass:i="rr-block",blockSelector:r=null,maskTextClass:o="rr-mask",maskTextSelector:s=null,inlineStylesheet:a=!0,inlineImages:l=!1,recordCanvas:u=!1,canvasMaskingConfigured:c,maskAllInputs:d=!1,maskTextFn:h,maskInputFn:f,selectMaskingFn:v,maskAllElementAttributes:p=!1,maskAttributeFn:m,slimDOM:g=!1,dataURLOptions:y,preserveWhiteSpace:b,onSerialize:w,onIframeLoad:k,iframeLoadTimeout:S,onIframeListenerRegistered:_,onStylesheetLoad:x,stylesheetLoadTimeout:C,keepIframeSrcFn:M=()=>!1,maxDepth:T,inlineStylesheetBudgetRules:I}=e||{},A=!0===d?{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,hidden:!0}:!1===d?{password:!0}:d,R=ga(g);ts(I);try{return ma(t,{doc:t,mirror:n,blockClass:i,blockSelector:r,maskTextClass:o,maskTextSelector:s,skipChild:!1,inlineStylesheet:a,maskInputOptions:A,maskTextFn:h,maskInputFn:f,selectMaskingFn:v,maskAllElementAttributes:p,maskAttributeFn:m,slimDOMOptions:R,dataURLOptions:y,inlineImages:l,recordCanvas:u,canvasMaskingConfigured:c,preserveWhiteSpace:b,onSerialize:w,onIframeLoad:k,iframeLoadTimeout:S,onIframeListenerRegistered:_,onStylesheetLoad:x,stylesheetLoadTimeout:C,keepIframeSrcFn:M,newlyAddedElement:!1,maxDepth:T})}finally{es()}}(document,{mirror:ou,blockClass:a,blockSelector:l,maskTextClass:d,maskTextSelector:h,inlineStylesheet:f,maskAllInputs:V,inlineStylesheetBudgetRules:v,maskTextFn:w,maskInputFn:y,selectMaskingFn:b,maskAllElementAttributes:k,maskAttributeFn:S,slimDOM:Q,dataURLOptions:W,recordCanvas:E,canvasMaskingConfigured:ut,inlineImages:N,onSerialize(t){Na(t,ou)&&at.addIframe(t),qa(t,ou)&&rt.trackLinkElement(t),ja(t)&&ct.addShadowRoot(So.shadowRoot(t),document)},onIframeLoad(t,e){at.attachIframe(t,e),ct.observeAttachShadow(t)},onIframeListenerRegistered(t,e){at.registerLoadListenerDisposer(t,e)},onStylesheetLoad(t,e,n){rt.attachLinkElement(t,e,n)},keepIframeSrcFn:j})}finally{r=as()}if(n)return;if(!i)return console.warn("Failed to snapshot the document");if(al=new WeakMap,Kl({type:no.FullSnapshot,data:{node:i,initialOffset:Aa(window)}},t),n)return;if(tl.forEach(t=>t.unlock()),tu.onFullSnapshot(),r.length){const t=function(t,e,n){let i=!1,r=null,o=0,s=null;const a=()=>null!==s||t.length>o,l=()=>{const n=t[o];t[o]=null,o+=1,n&&ka(()=>{s=e.beginDeferredLinkInlining(n,ou.getId(n))})},u=()=>{if(!s)return;const t=s;let e=!0;ka(()=>{e=t.advance(200)}),e&&(s=null)},c=()=>{s||l(),u()},d=t=>{if(r=null,i)return;let e=0;do{try{c()}catch(t){null==s||s.discard(),s=null,us(1)}e+=1}while(!i&&a()&&(t?!t.didTimeout&&t.timeRemaining()>5:10>e));i||(a()?r=gl(d):n())};return r=gl(d),{cancel(){i=!0,null==s||s.discard(),s=null,null==r||r.cancel(),r=null},flush(){if(i)return 0;i=!0,null==r||r.cancel(),r=null;let e=0,c=0;for(;a()&&50>e;){s||l();const t=s;if(t)if(Math.floor(t.remainingRules()/200)+1>50-e)t.discard(),s=null,c+=1;else{try{u()}catch(t){null==s||s.discard(),s=null,c+=1}e+=1}}if(a()||c>0){let e=c+(null!==s?1:0);for(let n=o;t.length>n;n++)null!==t[n]&&(e+=1);us(e),null==s||s.discard(),s=null}return n(),e}}}(r,rt,()=>{e===t&&(e=void 0)});e=t}O&&at.reattachIframes(),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&rt.adoptStyleSheets(document.adoptedStyleSheets,ou.getId(document))}finally{es()}}};const dt=[];let ht;try{ht=new Ml(window,R),dt.push(ba("pagehide",()=>{try{st()}catch(t){}e=void 0},window));for(const t of["visibilitychange","freeze","resume"])dt.push(ba(t,jo,document));K=t=>{const e=Y.get(t);e&&(e.forEach(t=>{ka(t);const e=dt.indexOf(t);-1!==e&&dt.splice(e,1)}),Y.delete(t))},X=()=>{null==ht||ht.prune();for(const[t]of Y){const e=ou.getNode(t);if(e)try{e.contentDocument&&e.contentDocument.defaultView||null==K||K(t)}catch(e){null==K||K(t)}else null==K||K(t)}};const t=t=>{var e;return Xa(vl)({mutationCb:et,mousemoveCb:(t,e)=>Kl({type:no.IncrementalSnapshot,data:{source:e,positions:t}}),mouseInteractionCb:t=>Kl({type:no.IncrementalSnapshot,data:L({source:io.MouseInteraction},t)}),scrollCb:nt,viewportResizeCb:t=>Kl({type:no.IncrementalSnapshot,data:L({source:io.ViewportResize},t)}),inputCb:(t,e)=>Kl({type:no.IncrementalSnapshot,data:L({source:io.Input},t)},void 0,e),mediaInteractionCb:t=>Kl({type:no.IncrementalSnapshot,data:L({source:io.MediaInteraction},t)}),styleSheetRuleCb:t=>Kl({type:no.IncrementalSnapshot,data:L({source:io.StyleSheetRule},t)}),styleDeclarationCb:t=>Kl({type:no.IncrementalSnapshot,data:L({source:io.StyleDeclaration},t)}),canvasMutationCb:it,fontCb:t=>Kl({type:no.IncrementalSnapshot,data:L({source:io.Font},t)}),selectionCb(t){Kl({type:no.IncrementalSnapshot,data:L({source:io.Selection},t)})},customElementCb(t){Kl({type:no.IncrementalSnapshot,data:L({source:io.CustomElement},t)})},blockClass:a,ignoreClass:u,ignoreSelector:c,maskTextClass:d,maskTextSelector:h,maskInputOptions:V,inlineStylesheet:f,sampling:C,recordDOM:R,recordCanvas:E,canvasMaskingConfigured:ut,inlineImages:N,userTriggeredOnInput:F,collectFonts:P,doc:t,maskInputFn:y,selectMaskingFn:b,maskTextFn:w,maskAllElementAttributes:k,maskAttributeFn:S,keepIframeSrcFn:j,blockSelector:l,slimDOMOptions:Q,dataURLOptions:W,mirror:ou,iframeManager:at,stylesheetManager:rt,shadowDomManager:ct,processedNodeManager:lt,canvasManager:tu,ignoreCSSAttributes:B,attributeFilter:z,plugins:(null==q||null===(e=q.filter(t=>t.observer))||void 0===e?void 0:e.map(t=>({name:t.name,observer:t.observer,options:t.options,callback:e=>Kl({type:no.Plugin,data:{plugin:t.name,payload:e}})})))||[]},_)},r=e=>{const n=e.defaultView?null==ht?void 0:ht.observe(e.defaultView):void 0;try{const i=t(e);return()=>Sa([()=>null==i?void 0:i(),()=>null==n?void 0:n()])}catch(t){throw null==n||n(),t}},o=new WeakMap,s=new WeakMap;at.addLoadListener(t=>{null==ht||ht.prune();try{const e=t.contentDocument,n=ou.getId(t);if(!e)return;const i=s.get(t);if(i){s.delete(t),ka(i);const e=dt.indexOf(i);-1!==e&&dt.splice(e,1)}const a=o.get(e);if(-1!==n&&a){if(a())return;null==K||K(n)}const l=r(e);if("function"==typeof l){let i=!1;const r=ba("rrweb-check-iframe-observers",()=>{i=!0},e);-1!==n&&o.set(e,()=>{i=!1;const t=e.createEvent("Event");return t.initEvent("rrweb-check-iframe-observers",!1,!1),e.dispatchEvent(t),i});const a=()=>{o.delete(e),r(),l()};if(dt.push(a),-1!==n){let t=Y.get(n);t||(t=new Set,Y.set(n,t)),t.add(a)}else s.set(t,a)}}catch(t){console.warn(t)}}),at.addPageHideListener(t=>{const e=ou.getId(t);null==K||K(e),rl(t)});let v=-1;const p=t=>Kl({type:no.Custom,data:{tag:"rrweb/fullscreen",payload:t}}),m=()=>{var t,e,n,i;const r=document,o=null!==(t=null!==(e=null!==(n=null!==(i=r.fullscreenElement)&&void 0!==i?i:r.webkitFullscreenElement)&&void 0!==n?n:r.mozFullScreenElement)&&void 0!==e?e:r.msFullscreenElement)&&void 0!==t?t:null,s=o?ou.getId(o):-1;s!==v&&(-1!==v&&p({id:v,enter:!1}),v=s,-1!==s&&p({id:s,enter:!0}))},g=()=>{if(n||i)return;if(i=!0,Xl(),n)return;const t=r(document);n?"function"==typeof t&&Sa([t]):("function"==typeof t&&dt.push(t),dt.push(ba("fullscreenchange",m)),dt.push(ba("webkitfullscreenchange",m)),dt.push(ba("mozfullscreenchange",m)),dt.push(ba("MSFullscreenChange",m)),iu=!0,ht&&(ht.ready=!0))};["interactive","complete"].includes(document.readyState)?g():(dt.push(ba("DOMContentLoaded",()=>{Kl({type:no.DomContentLoaded,data:{}}),"DOMContentLoaded"===D&&setTimeout(g,0)})),dt.push(ba("load",()=>{Kl({type:no.Load,data:{}}),"load"===D&&g()},window)));const x=()=>{if(null==ht||ht.beforeStop(),!n){n=!0;try{st()}catch(t){}e=void 0,rt.stop(),Sa(dt),lt.destroy(),at.removeLoadListener(),at.destroy(),Y.clear(),ct.reset(),ou.reset(),iu=!1,Ka(),null==ht||ht.stop()}};return ht&&function(t,e){_l.set(t,e)}(x,ht),x}catch(t){n=!0,Sa(dt),null==ht||ht.stop(),console.warn(t)}}au.withStyleRuleSourceHandoff=function(t,e){const n=_l.get(t);if(!n||n.stopped||yl!==n||bl)return Cl(),void e(()=>{});const i={previous:n,next:void 0,valid:!0,stopStarted:!1,stopCompleted:!1,retained:new Set};bl=i;try{e(()=>{bl===i&&Cl()})}finally{var r;(null===(r=i.next)||void 0===r?void 0:r.ready)||Cl();for(const t of i.retained)0===t.owners&&xl(t);i.retained.clear(),bl===i&&(bl=void 0)}},au.addCustomEvent=(t,e)=>{if(!iu)throw new Error("please add custom event after start recording");Kl({type:no.Custom,data:{tag:t,payload:e}})},au.freezePage=()=>{tl.forEach(t=>t.freeze())},au.takeFullSnapshot=t=>{if(!iu)throw new Error("please take full snapshot after start recording");Xl(t)},au.isRecording=()=>iu,au.supportsSelectMasking=!0,au.mirror=ou,Date,Date;var lu=Object.create(null);function uu(t){return uu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},uu(t)}function cu(t,e,n){return(e=function(t){var e=function(t){if("object"!=uu(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=uu(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==uu(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}lu.Node=Object.create(null),lu.ShadowRoot=Object.create(null),lu.MutationObserver=Object.create(null),lu.Element=Object.create(null);var du=class{constructor(t){cu(this,"fileName",void 0),cu(this,"functionName",void 0),cu(this,"lineNumber",void 0),cu(this,"columnNumber",void 0),this.fileName=t.fileName||"",this.functionName=t.functionName||"",this.lineNumber=t.lineNumber,this.columnNumber=t.columnNumber}toString(){const t=this.lineNumber||"",e=this.columnNumber||"";return this.functionName?`${this.functionName} (${this.fileName}:${t}:${e})`:`${this.fileName}:${t}:${e}`}},hu=/(^|@)\S+:\d+/,fu=/^\s*at .*(\S+:\d+|\(native\))/m,vu=/^(eval@)?(\[native code])?$/,pu={parse(t){return t?void 0!==t.stacktrace||void 0!==t["opera#sourceloc"]?this.parseOpera(t):t.stack&&t.stack.match(fu)?this.parseV8OrIE(t):t.stack?this.parseFFOrSafari(t):[]:[]},extractLocation(t){if(-1===t.indexOf(":"))return[t];const e=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(t.replace(/[()]/g,""));if(!e)throw new Error(`Cannot parse given url: ${t}`);return[e[1],e[2]||void 0,e[3]||void 0]},parseV8OrIE(t){return t.stack.split("\n").filter(function(t){return!!t.match(fu)},this).map(function(t){t.indexOf("(eval ")>-1&&(t=t.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));let e=t.replace(/^\s+/,"").replace(/\(eval code/g,"(");const n=e.match(/ (\((.+):(\d+):(\d+)\)$)/);e=n?e.replace(n[0],""):e;const i=e.split(/\s+/).slice(1),r=this.extractLocation(n?n[1]:i.pop());return new du({functionName:i.join(" ")||void 0,fileName:["eval","<anonymous>"].indexOf(r[0])>-1?void 0:r[0],lineNumber:r[1],columnNumber:r[2]})},this)},parseFFOrSafari(t){return t.stack.split("\n").filter(function(t){return!t.match(vu)},this).map(function(t){if(t.indexOf(" > eval")>-1&&(t=t.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===t.indexOf("@")&&-1===t.indexOf(":"))return new du({functionName:t});{const e=/((.*".+"[^@]*)?[^@]*)(?:@)/,n=t.match(e),i=n&&n[1]?n[1]:void 0,r=this.extractLocation(t.replace(e,""));return new du({functionName:i,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})}},this)},parseOpera(t){return!t.stacktrace||t.message.indexOf("\n")>-1&&t.message.split("\n").length>t.stacktrace.split("\n").length?this.parseOpera9(t):t.stack?this.parseOpera11(t):this.parseOpera10(t)},parseOpera9(t){const e=/Line (\d+).*script (?:in )?(\S+)/i,n=t.message.split("\n"),i=[];for(let t=2,r=n.length;r>t;t+=2){const r=e.exec(n[t]);r&&i.push(new du({fileName:r[2],lineNumber:parseFloat(r[1])}))}return i},parseOpera10(t){const e=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,n=t.stacktrace.split("\n"),i=[];for(let t=0,r=n.length;r>t;t+=2){const r=e.exec(n[t]);r&&i.push(new du({functionName:r[3]||void 0,fileName:r[2],lineNumber:parseFloat(r[1])}))}return i},parseOpera11(t){return t.stack.split("\n").filter(function(t){return!!t.match(hu)&&!t.match(/^Error created at/)},this).map(function(t){const e=t.split("@"),n=this.extractLocation(e.pop());return new du({functionName:(e.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})},this)}};function mu(t){if(!t||!t.outerHTML)return"";let e="";for(;t.parentElement;){let n=t.localName;if(!n)break;n=n.toLowerCase();const i=t.parentElement,r=[];if(i.children&&i.children.length>0)for(let t=0;i.children.length>t;t++){const e=i.children[t];e.localName&&e.localName.toLowerCase&&e.localName.toLowerCase()===n&&r.push(e)}r.length>1&&(n+=`:eq(${r.indexOf(t)})`),e=n+(e?">"+e:""),t=i}return e}function gu(t){return Array.isArray(t)}function yu(t){return"object"==typeof t&&null!==t&&!gu(t)}function bu(t,e){if(0===e)return!0;const n=Object.keys(t);for(const i of n)if(yu(t[i])&&bu(t[i],e-1))return!0;return!1}function wu(t,e){const n={numOfKeysLimit:50,depthOfLimit:4};Object.assign(n,e);const i=[],r=[];return JSON.stringify(t,function(t,e){if(i.length>0){const n=i.indexOf(this);~n?i.splice(n+1):i.push(this),~n?r.splice(n,1/0,t):r.push(t),~i.indexOf(e)&&(e=i[0]===e?"[Circular ~]":"[Circular ~."+r.slice(0,i.indexOf(e)).join(".")+"]")}else i.push(e);if(null===e)return e;if(void 0===e)return"undefined";if(yu(o=e)&&Object.keys(o).length>n.numOfKeysLimit||"function"==typeof o||yu(o)&&bu(o,n.depthOfLimit))return function(t){let e=t.toString();return n.stringLengthLimit&&e.length>n.stringLengthLimit&&(e=`${e.slice(0,n.stringLengthLimit)}...`),e}(e);var o;if("bigint"==typeof e)return e.toString()+"n";if(e instanceof Event){const t={};for(const n in e){const i=e[n];t[n]=gu(i)?mu(i.length?i[0]:null):i}return t}return e instanceof Node?e instanceof HTMLElement?e?e.outerHTML:"":e.nodeName:e instanceof Error?e.stack?e.stack+"\nEnd of stack for Error object":e.name+": "+e.message:e})}var ku={level:["assert","clear","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"],lengthThreshold:1e3,logger:"console"};function Su(t,e,n){const i=n?Object.assign({},ku,n):ku,r=i.logger;if(!r)return()=>{};let o;o="string"==typeof r?e[r]:r;let s=0,a=!1,l=!0;const u=[];if(i.level.includes("error")){const n=e=>{const n=e.message;t({level:"error",trace:pu.parse(e.error).map(t=>t.toString()),payload:[wu(n,i.stringifyOptions)]})};e.addEventListener("error",n),u.push(()=>{e.removeEventListener("error",n)});const r=e=>{let n,r;e.reason instanceof Error?(n=e.reason,r=[wu(`Uncaught (in promise) ${n.name}: ${n.message}`,i.stringifyOptions)]):(n=new Error,r=[wu("Uncaught (in promise)",i.stringifyOptions),wu(e.reason,i.stringifyOptions)]),t({level:"error",trace:pu.parse(n).map(t=>t.toString()),payload:r})};e.addEventListener("unhandledrejection",r),u.push(()=>{e.removeEventListener("unhandledrejection",r)})}for(const t of i.level)u.push(c(o,t));return()=>{l=!1,u.forEach(t=>t())};function c(e,n){return e[n]?function(r,o){try{if(!(o in r))return()=>{};const u=r[o],c={next:u},d=(r=>(...o)=>{if(r.apply(e,o),l&&!("assert"===n&&o[0]||a)){a=!0;try{const e=pu.parse(new Error).map(t=>t.toString()).splice(1),r=("assert"===n?o.slice(1):o).map(t=>wu(t,i.stringifyOptions));s++,i.lengthThreshold>s?t({level:n,trace:e,payload:r}):s===i.lengthThreshold&&t({level:"warn",trace:[],payload:[wu("The number of log records reached the threshold.")]})}catch(t){r.apply(e,["rrweb logger error:",t,...o])}finally{a=!1}}})(function(...t){return c.next.apply(this,t)});return"function"==typeof d&&(d.prototype=d.prototype||{},Object.defineProperties(d,{__rrweb_original__:{enumerable:!1,value:u},__rrweb_layer__:{enumerable:!1,value:c}})),r[o]=d,()=>{if(r[o]===d)return void(r[o]=c.next);const t=t=>{var e;return"function"==typeof t?null!==(e=t.__rrweb_layer__)&&void 0!==e?e:t.__posthog_layer__:void 0};let e=r[o],n=t(e);for(;n;){if(n.next===d)return void(n.next=c.next);e=n.next,n=t(e)}}}catch(t){return()=>{}}}(e,n):()=>{}}}var _u=t=>({name:"rrweb/console@1",observer:Su,options:t});const xu=()=>{},Cu=t=>{var e;if(W(t))return null!==(e=t.__posthog_layer__)&&void 0!==e?e:t.__rrweb_layer__};function Mu(t,e,n){try{if(!(e in t))return xu;const i={next:t[e]},r=n(function(...t){return i.next.apply(this,t)});return W(r)&&(r.prototype=r.prototype||{},Object.defineProperties(r,{__posthog_wrapped__:{enumerable:!1,value:!0},__posthog_layer__:{enumerable:!1,value:i}})),t[e]=r,()=>{if(t[e]===r)return void(t[e]=i.next);let n=t[e],o=Cu(n);for(;o;){if(o.next===r)return void(o.next=i.next);n=o.next,o=Cu(n)}}}catch(t){return xu}}function Tu(t,e){var n;const i=function(t){try{return"string"==typeof t?new URL(t).hostname:"url"in t?new URL(t.url).hostname:t.hostname}catch(t){return null}}(t),r={hostname:i,isHostDenied:!1};if(!(null===(n=e.payloadHostDenyList)||void 0===n?void 0:n.length)||!(null==i?void 0:i.trim().length))return r;for(const t of e.payloadHostDenyList)if(i.endsWith(t))return{hostname:i,isHostDenied:!0};return r}const Iu=he("[Recorder]"),Au=t=>"navigation"===t.entryType,Ru=t=>"resource"===t.entryType,Eu=()=>{};function Ou(t,e){var n;return Au(e)&&"complete"===(null===(n=t.document)||void 0===n?void 0:n.readyState)&&e.loadEventEnd>0}function $u(t,e){return e.recordInitialRequests?t.performance.getEntries().filter(n=>Ou(t,n)||Ru(n)&&e.initiatorTypes.includes(n.initiatorType)):e.performanceEntryTypeToObserve.includes("navigation")?function(t){var e;return"complete"!==(null===(e=t.document)||void 0===e?void 0:e.readyState)?[]:t.performance.getEntriesByType("navigation").filter(e=>Ou(t,e))}(t):[]}function Lu(t,e){return!!e&&(K(e)||e[t])}function Du(t){if("undefined"==typeof Request)return!1;if(t instanceof Request)return!0;try{return"[object Request]"==={}.toString.call(t)}catch(t){return!1}}const Fu=["image/","video/","audio/","font/","application/octet-stream","application/pdf","application/zip","application/wasm"];function Pu({type:t,recordBody:e,headers:n,url:i}){function r(t){const e=Object.keys(n).find(t=>"content-type"===t.toLowerCase()),i=e&&n[e];return t.some(t=>null==i?void 0:i.toLowerCase().includes(t))}if(!e)return!1;if(function t(e){try{return"string"==typeof e?e.startsWith("blob:"):e instanceof URL?"blob:"===e.protocol:!!Du(e)&&t(e.url)}catch(t){return!1}}(i))return!1;if(r(Fu))return!1;if(K(e))return!0;if(U(e))return r(e);const o=e[t];return K(o)?o:r(o)}function Nu(t,e,n,i,r){return qu.apply(this,arguments)}function qu(){return qu=A(function*(t,e,n,i,r,o=0){if(o>10)return Iu.warn("Failed to get performance entry for request",{url:n,initiatorType:e}),null;const s=function(t,e){for(let n=t.length-1;n>=0;n-=1)if(e(t[n]))return t[n]}(t.performance.getEntriesByName(n),t=>Ru(t)&&t.initiatorType===e&&(G(i)||t.startTime>=i)&&(G(r)||r>=t.startTime));return s||(yield new Promise(t=>setTimeout(t,50*o)),Nu(t,e,n,i,r,o+1))}),qu.apply(this,arguments)}function ju({body:t,options:e,url:n}){if(J(t))return null;const{hostname:i,isHostDenied:r}=Tu(n,e);if(r)return i+" is in deny list";if(V(t))return t;if((t=>"u">typeof Document&&t instanceof Document)(t))return t.textContent;if(X(t))return we(t);if(H(t))try{return JSON.stringify(t)}catch(t){return"[SessionReplay] Failed to stringify response object"}return"[SessionReplay] Cannot read body of type "+toString.call(t)}const Bu=t=>!Z(t)&&("navigation"===t.entryType||"resource"===t.entryType);function zu(t,{entry:e,method:n,status:i,networkRequest:r,isInitial:o,start:s,end:a,url:l,initiatorType:u}){s=e?e.startTime:s,a=e?e.responseEnd:a;const c=Math.floor(Date.now()-t.performance.now()),d=Math.floor(c+(s||0)),h=[L(L({},e?JSON.parse(JSON.stringify(e.toJSON())):{name:l}),{},{startTime:G(s)?void 0:Math.round(s),endTime:G(a)?void 0:Math.round(a),timeOrigin:c,timestamp:d,method:n,initiatorType:u||(e?e.initiatorType:void 0),status:i,requestHeaders:r.requestHeaders,requestBody:r.requestBody,responseHeaders:r.responseHeaders,responseBody:r.responseBody,isInitial:o})];if(Bu(e))for(const t of e.serverTiming||[])h.push({timeOrigin:c,timestamp:d,startTime:Math.round(e.startTime),name:t.name,duration:t.duration,entryType:"serverTiming"});return h}const Uu=["video/","audio/"];function Wu(t){return H(t)&&W(t.getReader)&&W(t.tee)}const Hu="[SessionReplay] Timeout while trying to read body",Gu="[SessionReplay] Failed to read body";function Vu(t){return`${Gu}: ${t}`}function Qu(t){return`[SessionReplay] Body too large to record (> ${t} bytes)`}function Zu(t,e){if(!e.streamNetworkBody)return function(t){return new Promise(e=>{const n=setTimeout(()=>e(Hu),500);try{t.clone().text().then(t=>e(t),t=>e(Vu(t))).finally(()=>clearTimeout(n))}catch(t){clearTimeout(n),e(Gu)}})}(t);const n=Ke(e);return function(t,e){try{var n,i;const r=null===(n=t.headers)||void 0===n||null===(i=n.get)||void 0===i?void 0:i.call(n,"content-length");if(!r)return!1;const o=parseInt(r,10);return Number.isFinite(o)&&o>e}catch(t){return!1}}(t,n)?Promise.resolve(Qu(n)):function(t,e){return new Promise(n=>{let i,r=!1;function o(){try{null==i||i.cancel().catch(()=>{})}catch(t){}}function s(t){r||(r=!0,clearTimeout(a),o(),n(t))}const a=setTimeout(()=>s(Hu),500);let l;try{l=t.clone()}catch(t){return void s(Gu)}const u=l.body;if(!Wu(u)||"undefined"==typeof TextDecoder){try{l.text().then(t=>s(t),t=>s(Vu(t)))}catch(t){s(Gu)}return}try{i=u.getReader()}catch(t){return void s(Gu)}const c=[];let d=0;!function t(){i.read().then(({done:n,value:i})=>{if(r)o();else if(n)s((new TextDecoder).decode(function(t,e){const n=new Uint8Array(e);let i=0;for(const e of t)n.set(e,i),i+=e.byteLength;return n}(c,d)));else{if(i){if(d+i.byteLength>e)return void s(Qu(e));d+=i.byteLength,c.push(i)}t()}},t=>s(Vu(t)))}()})}(t,n)}function Ju(t){return Yu.apply(this,arguments)}function Yu(){return Yu=A(function*({r:t,options:e,url:n}){const{hostname:i,isHostDenied:r}=Tu(n,e);return r?Promise.resolve(i+" is in deny list"):Zu(t,e)}),Yu.apply(this,arguments)}function Ku(t){return Xu.apply(this,arguments)}function Xu(){return Xu=A(function*({r:t,options:e,url:n}){const i=function({r:t,options:e,url:n}){var i;if("chunked"===t.headers.get("Transfer-Encoding"))return"Chunked Transfer-Encoding is not supported";const r=null===(i=t.headers.get("Content-Type"))||void 0===i?void 0:i.toLowerCase(),o=Uu.some(t=>null==r?void 0:r.startsWith(t));if(r&&o)return`Content-Type ${r} is not supported`;const{hostname:s,isHostDenied:a}=Tu(n,e);return a?s+" is in deny list":null}({r:t,options:e,url:n});return Z(i)?Zu(t,e):Promise.resolve(i)}),Xu.apply(this,arguments)}let tc=null;function ec(t,e,n){if(!("performance"in e))return()=>{};if(tc)return Iu.warn("Network observer already initialised, doing nothing"),()=>{};const i=n?Object.assign({},Xe,n):Xe;let r=!0,o=!1;const s=e=>{if(!r)return;const n=[];let s=!1;e.requests.forEach(t=>{const e="serverTiming"===t.entryType;if(e&&s)return;let r;try{r=i.maskRequestFn(t)}catch(t){return o||(o=!0,Iu.warn("Network capture masking callback failed; dropping the record. Further masking failures will not be logged for this observer.")),void(e||(s=!0))}e||(s=!r||(t=>!!t&&ln.has(t))(r)),r&&n.push(r)}),n.length>0&&t(L(L({},e),{},{requests:n}))},a=function(t,e,n){try{t({requests:$u(e,n).flatMap(t=>zu(e,{entry:t,method:void 0,status:void 0,networkRequest:{},isInitial:!0})),isInitial:!0})}catch(t){Iu.error("Failed to capture initial performance entries for network capture",t)}const i=e.PerformanceObserver,r=null==i?void 0:i.supportedEntryTypes;if(!i||!U(r))return;const o=r.filter(t=>n.performanceEntryTypeToObserve.includes(t));if(!o.length)return;const s=new i(i=>{t({requests:i.getEntries().filter(t=>Au(t)||Ru(t)&&n.initiatorTypes.includes(t.initiatorType)&&(t=>!n.recordBody&&!n.recordHeaders||"xmlhttprequest"!==t.initiatorType&&"fetch"!==t.initiatorType)(t)).flatMap(t=>zu(e,{entry:t,method:void 0,status:void 0,networkRequest:{}}))})});return s.observe({entryTypes:o}),()=>{s.disconnect()}}(s,e,i),l=i.recordHeaders||i.recordBody;if(!a&&!l)return r=!1,Eu;let u=()=>{},c=()=>{};return l&&(u=function(t,e,n){if(!n.initiatorTypes.includes("xmlhttprequest"))return()=>{};const i=Lu("request",n.recordHeaders),r=Lu("response",n.recordHeaders),o=Mu(e.XMLHttpRequest.prototype,"open",o=>function(s,a,l=!0,u,c){const d=this;try{const o=new Request(a),l={};let u,c;const h={},f=d.setRequestHeader.bind(d);d.setRequestHeader=(t,e)=>(h[t]=e,f(t,e)),i&&(l.requestHeaders=h);const v=d.send.bind(d);d.send=t=>(Pu({type:"request",headers:h,url:a,recordBody:n.recordBody})&&(l.requestBody=ju({body:t,options:n,url:a})),u=e.performance.now(),v(t));const p=()=>{d.removeEventListener("readystatechange",m),d.removeEventListener("error",p),d.removeEventListener("abort",p),d.removeEventListener("timeout",p)},m=()=>{if(d.readyState!==d.DONE)return;p(),c=e.performance.now();const i={};d.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach(t=>{const e=t.split(": "),n=e.shift(),r=e.join(": ");n&&(i[n]=r)}),r&&(l.responseHeaders=i),Pu({type:"response",headers:i,url:a,recordBody:n.recordBody})&&(l.responseBody=ju({body:d.response,options:n,url:a})),Nu(e,"xmlhttprequest",o.url,u,c).then(n=>{t({requests:zu(e,{entry:n,method:s,status:null==d?void 0:d.status,networkRequest:l,start:u,end:c,url:a.toString(),initiatorType:"xmlhttprequest"})})}).catch(()=>{})};d.addEventListener("readystatechange",m),d.addEventListener("error",p),d.addEventListener("abort",p),d.addEventListener("timeout",p)}catch(t){Iu.error("Failed to instrument XHR for network capture",t)}o.call(d,s,a.toString(),l,u,c)});return()=>{o()}}(s,e,i),c=!0===i.captureFetchSynchronously?function(t,e,n){if(!n.initiatorTypes.includes("fetch"))return()=>{};const i=Lu("request",n.recordHeaders),r=Lu("response",n.recordHeaders),o=Mu(e,"fetch",o=>function(s,a){let l;try{l=new Request(s,a)}catch(t){Iu.error("Failed to instrument fetch for network capture",t);try{return Promise.resolve(o(s,a))}catch(t){return new Promise((e,n)=>n(t))}}const u={};let c,d;const h=A(function*(){try{const t={};l.headers.forEach((e,n)=>{t[n]=e}),i&&(u.requestHeaders=t),!Wu(null==a?void 0:a.body)&&Pu({type:"request",headers:t,url:s,recordBody:n.recordBody})&&(u.requestBody=yield Ju({r:l,options:n,url:s}))}catch(t){Iu.error("Failed to record fetch request for network capture",t)}})(),f=(v=A(function*(t){try{const e={};t.headers.forEach((t,n)=>{e[n]=t}),r&&(u.responseHeaders=e),Pu({type:"response",headers:e,url:s,recordBody:n.recordBody})&&(u.responseBody=yield Ku({r:t,options:n,url:s}))}catch(t){Iu.error("Failed to record fetch response for network capture",t)}}),function(t){return v.apply(this,arguments)});var v;try{c=e.performance.now()}catch(t){}let p;try{p=Du(s)?o(l):o(s,a)}catch(t){p=new Promise((e,n)=>n(t))}const m=Promise.resolve(p).then(t=>{try{d=e.performance.now()}catch(t){}return{status:"fulfilled",response:t}},t=>({status:"rejected",error:t})),g=n=>{(n=>Nu(e,"fetch",l.url,c,d).then(i=>{t({requests:zu(e,{entry:i,method:l.method,status:null==n?void 0:n.status,networkRequest:u,start:c,end:d,url:l.url,initiatorType:"fetch"})})}))(n).catch(()=>{})};return A(function*(){let t,e=!1;try{yield h;const i=yield m;if("rejected"===i.status)throw i.error;if(t=i.response,!0===n.returnFetchResponseEarly){const n=t;e=!0;const i=()=>g(n);return f(n).then(i,i),n}return yield f(t),t}finally{e||g(t)}})()});return()=>{o()}}(s,e,i):function(t,e,n){if(!n.initiatorTypes.includes("fetch"))return()=>{};const i=Lu("request",n.recordHeaders),r=Lu("response",n.recordHeaders),o=Mu(e,"fetch",o=>function(){var s=A(function*(s,a){let l,u;try{l=new Request(s,a)}catch(t){return Iu.error("Failed to instrument fetch for network capture",t),o(s,a)}const c={};let d,h;try{try{const t={};l.headers.forEach((e,n)=>{t[n]=e}),i&&(c.requestHeaders=t),!Wu(null==a?void 0:a.body)&&Pu({type:"request",headers:t,url:s,recordBody:n.recordBody})&&(c.requestBody=yield Ju({r:l,options:n,url:s}))}catch(t){Iu.error("Failed to record fetch request for network capture",t)}d=e.performance.now(),u=Du(s)?yield o(l):yield o(s,a),h=e.performance.now();try{const t={};u.headers.forEach((e,n)=>{t[n]=e}),r&&(c.responseHeaders=t),Pu({type:"response",headers:t,url:s,recordBody:n.recordBody})&&(c.responseBody=yield Ku({r:u,options:n,url:s}))}catch(t){Iu.error("Failed to record fetch response for network capture",t)}return u}finally{Nu(e,"fetch",l.url,d,h).then(n=>{t({requests:zu(e,{entry:n,method:l.method,status:null==u?void 0:u.status,networkRequest:c,start:d,end:h,url:l.url,initiatorType:"fetch"})})}).catch(()=>{})}});return function(t,e){return s.apply(this,arguments)}}());return()=>{o()}}(s,e,i)),tc=()=>{r=!1,null==a||a(),u(),c(),tc=null},tc}const nc=t=>({name:"rrweb/network@1",observer:ec,options:t});var ic,rc,oc,sc,ac,lc,uc,cc,dc,hc,fc,vc,pc,mc,gc;o.__PosthogExtensions__=o.__PosthogExtensions__||{},o.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:_u,getRecordNetworkPlugin:nc},o.__PosthogExtensions__.rrweb={record:au,version:"v2",wasMaxDepthReached:()=>pa,resetMaxDepthState(){pa=!1,va=!1},getLastSnapshotCost:()=>Vo,getMutationCost:()=>L({},Ko),getObserverInitFailures:()=>fl.size?Array.from(fl):void 0,resetSnapshotCostState(){Uo=0,Wo=0,Ho=0,qo=0,Go={durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0},Vo=null,Qo=null,Zo=[],Jo=0,Yo=0,Ko={slowestBatchMs:0},Xo={deferredCount:0,failedCount:0,abandonedCount:0,totalMs:0,slowestSliceMs:0}}},o.rrweb={record:au,version:"v2"},o.rrwebConsoleRecord={getRecordConsolePlugin:_u},o.getRecordNetworkPlugin=nc,o.__PosthogExtensions__=o.__PosthogExtensions__||{},o.__PosthogExtensions__.initSessionRecording=(t,e)=>new to(t,e),o.__PosthogExtensions__.initSessionRecording.supportsSelectMasking=!0;var yc={},bc=[],wc=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,kc=Array.isArray;function Sc(t,e){for(var n in e)t[n]=e[n];return t}function _c(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function xc(t,e,n){var i,r,o,s={};for(o in e)"key"==o?i=e[o]:"ref"==o?r=e[o]:s[o]=e[o];if(arguments.length>2&&(s.children=arguments.length>3?ic.call(arguments,2):n),"function"==typeof t&&null!=t.defaultProps)for(o in t.defaultProps)void 0===s[o]&&(s[o]=t.defaultProps[o]);return Cc(t,s,i,r,null)}function Cc(t,e,n,i,r){var o={type:t,props:e,key:n,ref:i,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==r?++oc:r,__i:-1,__u:0};return null==r&&null!=rc.vnode&&rc.vnode(o),o}function Mc(t){return t.children}function Tc(t,e){this.props=t,this.context=e}function Ic(t,e){if(null==e)return t.__?Ic(t.__,t.__i+1):null;for(var n;t.__k.length>e;e++)if(null!=(n=t.__k[e])&&null!=n.__e)return n.__e;return"function"==typeof t.type?Ic(t):null}function Ac(t){if(t.__P&&t.__d){var e=t.__v,n=e.__e,i=[],r=[],o=Sc({},e);o.__v=e.__v+1,rc.vnode&&rc.vnode(o),qc(t.__P,o,e,t.__n,t.__P.namespaceURI,32&e.__u?[n]:null,i,null==n?Ic(e):n,!!(32&e.__u),r),o.__v=e.__v,o.__.__k[o.__i]=o,Bc(i,o,r),e.__e=e.__=null,o.__e!=n&&Rc(o)}}function Rc(t){if(null!=(t=t.__)&&null!=t.__c)return t.__e=t.__c.base=null,t.__k.some(function(e){if(null!=e&&null!=e.__e)return t.__e=t.__c.base=e.__e}),Rc(t)}function Ec(t){(!t.__d&&(t.__d=!0)&&sc.push(t)&&!Oc.__r++||ac!=rc.debounceRendering)&&((ac=rc.debounceRendering)||lc)(Oc)}function Oc(){try{for(var t,e=1;sc.length;)sc.length>e&&sc.sort(uc),t=sc.shift(),e=sc.length,Ac(t)}finally{sc.length=Oc.__r=0}}function $c(t,e,n,i,r,o,s,a,l,u,c){var d,h,f,v,p,m,g,y=i&&i.__k||bc,b=e.length;for(l=function(t,e,n,i,r){var o,s,a,l,u,c=n.length,d=c,h=0;for(t.__k=new Array(r),o=0;r>o;o++)null!=(s=e[o])&&"boolean"!=typeof s&&"function"!=typeof s?("string"==typeof s||"number"==typeof s||"bigint"==typeof s||s.constructor==String?s=t.__k[o]=Cc(null,s,null,null,null):kc(s)?s=t.__k[o]=Cc(Mc,{children:s},null,null,null):void 0===s.constructor&&s.__b>0?s=t.__k[o]=Cc(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):t.__k[o]=s,l=o+h,s.__=t,s.__b=t.__b+1,a=null,-1!=(u=s.__i=Dc(s,n,l,d))&&(d--,(a=n[u])&&(a.__u|=2)),null==a||null==a.__v?(-1==u&&(r>c?h--:c>r&&h++),"function"!=typeof s.type&&(s.__u|=4)):u!=l&&(u==l-1?h--:u==l+1?h++:(u>l?h--:h++,s.__u|=4))):t.__k[o]=null;if(d)for(o=0;c>o;o++)null!=(a=n[o])&&!(2&a.__u)&&(a.__e==i&&(i=Ic(a)),Wc(a,a));return i}(n,e,y,l,b),d=0;b>d;d++)null!=(f=n.__k[d])&&(h=-1!=f.__i&&y[f.__i]||yc,f.__i=d,m=qc(t,f,h,r,o,s,a,l,u,c),v=f.__e,f.ref&&h.ref!=f.ref&&(h.ref&&Uc(h.ref,null,f),c.push(f.ref,f.__c||v,f)),null==p&&null!=v&&(p=v),(g=!!(4&f.__u))||h.__k===f.__k?(l=Lc(f,l,t,g),g&&h.__e&&(h.__e=null)):"function"==typeof f.type&&void 0!==m?l=m:v&&(l=v.nextSibling),f.__u&=-7);return n.__e=p,l}function Lc(t,e,n,i){var r,o;if("function"==typeof t.type){for(r=t.__k,o=0;r&&r.length>o;o++)r[o]&&(r[o].__=t,e=Lc(r[o],e,n,i));return e}t.__e!=e&&(i&&(e&&t.type&&!e.parentNode&&(e=Ic(t)),n.insertBefore(t.__e,e||null)),e=t.__e);do{e=e&&e.nextSibling}while(null!=e&&8==e.nodeType);return e}function Dc(t,e,n,i){var r,o,s,a=t.key,l=t.type,u=e[n],c=null!=u&&!(2&u.__u);if(null===u&&null==a||c&&a==u.key&&l==u.type)return n;if(i>(c?1:0))for(r=n-1,o=n+1;r>=0||e.length>o;)if(null!=(u=e[s=0>r?o++:r--])&&!(2&u.__u)&&a==u.key&&l==u.type)return s;return-1}function Fc(t,e,n){"-"==e[0]?t.setProperty(e,null==n?"":n):t[e]=null==n?"":"number"!=typeof n||wc.test(e)?n:n+"px"}function Pc(t,e,n,i,r){var o,s;t:if("style"==e)if("string"==typeof n)t.style.cssText=n;else{if("string"==typeof i&&(t.style.cssText=i=""),i)for(e in i)n&&e in n||Fc(t.style,e,"");if(n)for(e in n)i&&n[e]==i[e]||Fc(t.style,e,n[e])}else if("o"==e[0]&&"n"==e[1])o=e!=(e=e.replace(fc,"$1")),s=e.toLowerCase(),e=s in t||"onFocusOut"==e||"onFocusIn"==e?s.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+o]=n,n?i?n[hc]=i[hc]:(n[hc]=vc,t.addEventListener(e,o?mc:pc,o)):t.removeEventListener(e,o?mc:pc,o);else{if("http://www.w3.org/2000/svg"==r)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=e&&"height"!=e&&"href"!=e&&"list"!=e&&"form"!=e&&"tabIndex"!=e&&"download"!=e&&"rowSpan"!=e&&"colSpan"!=e&&"role"!=e&&"popover"!=e&&e in t)try{t[e]=null==n?"":n;break t}catch(t){}"function"==typeof n||(null==n||!1===n&&"-"!=e[4]?t.removeAttribute(e):t.setAttribute(e,"popover"==e&&1==n?"":n))}}function Nc(t){return function(e){if(this.l){var n=this.l[e.type+t];if(null==e[dc])e[dc]=vc++;else if(n[hc]>e[dc])return;return n(rc.event?rc.event(e):e)}}}function qc(t,e,n,i,r,o,s,a,l,u){var c,d,h,f,v,p,m,g,y,b,$,w,k,S,_,x,C=e.type;if(void 0!==e.constructor)return null;128&n.__u&&(l=!!(32&n.__u),o=[a=e.__e=n.__e]),(c=rc.__b)&&c(e);t:if("function"==typeof C){d=s.length;try{if(y=e.props,b=C.prototype&&C.prototype.render,$=(c=C.contextType)&&i[c.__c],w=c?$?$.props.value:c.__:i,n.__c?g=(h=e.__c=n.__c).__=h.__E:(b?e.__c=h=new C(y,w):(e.__c=h=new Tc(y,w),h.constructor=C,h.render=Hc),$&&$.sub(h),h.state||(h.state={}),h.__n=i,f=h.__d=!0,h.__h=[],h._sb=[]),b&&null==h.__s&&(h.__s=h.state),b&&null!=C.getDerivedStateFromProps&&(h.__s==h.state&&(h.__s=Sc({},h.__s)),Sc(h.__s,C.getDerivedStateFromProps(y,h.__s))),v=h.props,p=h.state,h.__v=e,f)b&&null==C.getDerivedStateFromProps&&null!=h.componentWillMount&&h.componentWillMount(),b&&null!=h.componentDidMount&&h.__h.push(h.componentDidMount);else{if(b&&null==C.getDerivedStateFromProps&&y!==v&&null!=h.componentWillReceiveProps&&h.componentWillReceiveProps(y,w),e.__v==n.__v||!h.__e&&null!=h.shouldComponentUpdate&&!1===h.shouldComponentUpdate(y,h.__s,w)){e.__v!=n.__v&&(h.props=y,h.state=h.__s,h.__d=!1),e.__e=n.__e,e.__k=n.__k,e.__k.some(function(t){t&&(t.__=e)}),bc.push.apply(h.__h,h._sb),h._sb=[],h.__h.length&&s.push(h);break t}null!=h.componentWillUpdate&&h.componentWillUpdate(y,h.__s,w),b&&null!=h.componentDidUpdate&&h.__h.push(function(){h.componentDidUpdate(v,p,m)})}if(h.context=w,h.props=y,h.__P=t,h.__e=!1,k=rc.__r,S=0,b)h.state=h.__s,h.__d=!1,k&&k(e),c=h.render(h.props,h.state,h.context),bc.push.apply(h.__h,h._sb),h._sb=[];else do{h.__d=!1,k&&k(e),c=h.render(h.props,h.state,h.context),h.state=h.__s}while(h.__d&&25>++S);h.state=h.__s,null!=h.getChildContext&&(i=Sc(Sc({},i),h.getChildContext())),b&&!f&&null!=h.getSnapshotBeforeUpdate&&(m=h.getSnapshotBeforeUpdate(v,p)),_=null!=c&&c.type===Mc&&null==c.key?zc(c.props.children):c,a=$c(t,kc(_)?_:[_],e,n,i,r,o,s,a,l,u),h.base=e.__e,e.__u&=-161,h.__h.length&&s.push(h),g&&(h.__E=h.__=null)}catch(t){if(s.length=d,e.__v=null,l||null!=o)if(t.then){for(e.__u|=l?160:128;a&&8==a.nodeType&&a.nextSibling;)a=a.nextSibling;null!=o&&(o[o.indexOf(a)]=null),e.__e=a}else{if(null!=o)for(x=o.length;x--;)_c(o[x]);jc(e)}else e.__e=n.__e,!e.__k&&n.__k&&(e.__k=n.__k),t.then||jc(e);rc.__e(t,e,n)}}else null==o&&e.__v==n.__v?(e.__k=n.__k,e.__e=n.__e):a=e.__e=function(t,e,n,i,r,o,s,a,l){var u,c,d,h,f,v,p,m=n.props||yc,g=e.props,y=e.type;if("svg"==y?r="http://www.w3.org/2000/svg":"math"==y?r="http://www.w3.org/1998/Math/MathML":r||(r="http://www.w3.org/1999/xhtml"),null!=o)for(u=0;o.length>u;u++)if((f=o[u])&&"setAttribute"in f==!!y&&(y?f.localName==y:3==f.nodeType)){t=f,o[u]=null;break}if(null==t){if(null==y)return document.createTextNode(g);t=document.createElementNS(r,y,g.is&&g),a&&(rc.__m&&rc.__m(e,o),a=!1),o=null}if(null==y)m===g||a&&t.data==g||(t.data=g);else{if(o="textarea"==y&&null!=g.defaultValue?null:o&&ic.call(t.childNodes),!a&&null!=o)for(m={},u=0;t.attributes.length>u;u++)m[(f=t.attributes[u]).name]=f.value;for(u in m)f=m[u],"dangerouslySetInnerHTML"==u?d=f:"children"==u||u in g||"value"==u&&"defaultValue"in g||"checked"==u&&"defaultChecked"in g||Pc(t,u,null,f,r);for(u in g)f=g[u],"children"==u?h=f:"dangerouslySetInnerHTML"==u?c=f:"value"==u?v=f:"checked"==u?p=f:a&&"function"!=typeof f||m[u]===f||Pc(t,u,f,m[u],r);if(c)a||d&&(c.__html==d.__html||c.__html==t.innerHTML)||(t.innerHTML=c.__html),e.__k=[];else if(d&&(t.innerHTML=""),$c("template"==e.type?t.content:t,kc(h)?h:[h],e,n,i,"foreignObject"==y?"http://www.w3.org/1999/xhtml":r,o,s,o?o[0]:n.__k&&Ic(n,0),a,l),null!=o)for(u=o.length;u--;)_c(o[u]);a&&"textarea"!=y||(u="value","progress"==y&&null==v?t.removeAttribute("value"):null!=v&&(v!==t[u]||"progress"==y&&!v||"option"==y&&v!=m[u])&&Pc(t,u,v,m[u],r),u="checked",null!=p&&p!=t[u]&&Pc(t,u,p,m[u],r))}return t}(n.__e,e,n,i,r,o,s,l,u);return(c=rc.diffed)&&c(e),128&e.__u?void 0:a}function jc(t){t&&(t.__c&&(t.__c.__e=!0),t.__k&&t.__k.some(jc))}function Bc(t,e,n){for(var i=0;n.length>i;i++)Uc(n[i],n[++i],n[++i]);rc.__c&&rc.__c(e,t),t.some(function(e){try{t=e.__h,e.__h=[],t.some(function(t){t.call(e)})}catch(t){rc.__e(t,e.__v)}})}function zc(t){return"object"!=typeof t||null==t||t.__b>0?t:kc(t)?t.map(zc):void 0!==t.constructor?null:Sc({},t)}function Uc(t,e,n){try{if("function"==typeof t){var i="function"==typeof t.__u;i&&t.__u(),i&&null==e||(t.__u=t(e))}else t.current=e}catch(t){rc.__e(t,n)}}function Wc(t,e,n){var i,r;if(rc.unmount&&rc.unmount(t),(i=t.ref)&&(i.current&&i.current!=t.__e||Uc(i,null,e)),null!=(i=t.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(t){rc.__e(t,e)}i.base=i.__P=i.__n=null}if(i=t.__k)for(r=0;i.length>r;r++)i[r]&&Wc(i[r],e,n||"function"!=typeof t.type);n||_c(t.__e),t.__c=t.__=t.__e=void 0}function Hc(t,e,n){return this.constructor(t,n)}function Gc(t,e,n){var i,r,o,s;e==document&&(e=document.documentElement),rc.__&&rc.__(t,e),r=(i="function"==typeof n)?null:n&&n.__k||e.__k,o=[],s=[],qc(e,t=(!i&&n||e).__k=xc(Mc,null,[t]),r||yc,yc,e.namespaceURI,!i&&n?[n]:r?null:e.firstChild?ic.call(e.childNodes):null,o,!i&&n?n:r?r.__e:e.firstChild,i,s),Bc(o,t,s),t.props.children=null}ic=bc.slice,rc={__e(t,e,n,i){for(var r,o,s;e=e.__;)if((r=e.__c)&&!r.__)try{if((o=r.constructor)&&null!=o.getDerivedStateFromError&&(r.setState(o.getDerivedStateFromError(t)),s=r.__d),null!=r.componentDidCatch&&(r.componentDidCatch(t,i||{}),s=r.__d),s)return r.__E=r}catch(e){t=e}throw t}},oc=0,Tc.prototype.setState=function(t,e){var n=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=Sc({},this.state);"function"==typeof t&&(t=t(Sc({},n),this.props)),t&&Sc(n,t),null!=t&&this.__v&&(e&&this._sb.push(e),Ec(this))},Tc.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),Ec(this))},Tc.prototype.render=Mc,sc=[],lc="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,uc=function(t,e){return t.__v.__b-e.__v.__b},Oc.__r=0,cc=Math.random().toString(8),dc="__d"+cc,hc="__a"+cc,fc=/(PointerCapture)$|Capture$/i,vc=0,pc=Nc(!1),mc=Nc(!0),gc=0;var Vc=0;function Qc(t,e,n,i,r,o){e||(e={});var s,a,l=e;if("ref"in l)for(a in l={},e)"ref"==a?s=e[a]:l[a]=e[a];var u={type:t,props:l,key:n,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Vc,__i:-1,__u:0,__source:r,__self:o};if("function"==typeof t&&(s=t.defaultProps))for(a in s)void 0===l[a]&&(l[a]=s[a]);return rc.vnode&&rc.vnode(u),u}const Zc="featureFlagsCommon";function Jc({client:t,config:e}){var n;if(!t||!e.uiHost)return;const i=null===(n=t.session)||void 0===n?void 0:n.sessionId;return i?`${e.uiHost}/project/${t.projectToken}/replay/${i}`:void 0}var Yc,Kc,Xc,td,ed=0,nd=[],id=rc,rd=id.__b,od=id.__r,sd=id.diffed,ad=id.__c,ld=id.unmount,ud=id.__;function cd(t,e){id.__h&&id.__h(Kc,t,ed||e),ed=0;var n=Kc.__H||(Kc.__H={__:[],__h:[]});return t>=n.__.length&&n.__.push({}),n.__[t]}function dd(t){return ed=1,function(t,e){var n=cd(Yc++,2);if(n.t=t,!n.__c&&(n.__=[Sd(void 0,e),function(t){var e=n.__N?n.__N[0]:n.__[0],i=n.t(e,t);e!==i&&(n.__N=[i,n.__[1]],n.__c.setState({}))}],n.__c=Kc,!Kc.__f)){var i=function(t,e,i){if(!n.__c.__H)return!0;var o=!1,s=n.__c.props!==t;if(n.__c.__H.__.some(function(t){if(t.__N){o=!0;var e=t.__[0];t.__=t.__N,t.__N=void 0,e!==t.__[0]&&(s=!0)}}),r){var a=r.call(this,t,e,i);return o?a||s:a}return!o||s};Kc.__f=!0;var r=Kc.shouldComponentUpdate,o=Kc.componentWillUpdate;Kc.componentWillUpdate=function(t,e,n){if(this.__e){var s=r;r=void 0,i(t,e,n),r=s}o&&o.call(this,t,e,n)},Kc.shouldComponentUpdate=i}return n.__N||n.__}(Sd,t)}function hd(t,e){var n=cd(Yc++,3);!id.__s&&kd(n.__H,e)&&(n.__=t,n.u=e,Kc.__H.__h.push(n))}function fd(t){return ed=5,vd(function(){return{current:t}},[])}function vd(t,e){var n=cd(Yc++,7);return kd(n.__H,e)&&(n.__=t(),n.__H=e,n.__h=t),n.__}function pd(t){var e=Kc.context[t.__c],n=cd(Yc++,9);return n.c=t,e?(null==n.__&&(n.__=!0,e.sub(Kc)),e.props.value):t.__}function md(){for(var t;t=nd.shift();){var e=t.__H;if(t.__P&&e)try{e.__h.some(bd),e.__h.some(wd),e.__h=[]}catch(n){e.__h=[],id.__e(n,t.__v)}}}id.__b=function(t){Kc=null,rd&&rd(t)},id.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),ud&&ud(t,e)},id.__r=function(t){od&&od(t),Yc=0;var e=(Kc=t.__c).__H;e&&(Xc===Kc?(e.__h=[],Kc.__h=[],e.__.some(function(t){t.__N&&(t.__=t.__N),t.u=t.__N=void 0})):(e.__h.length&&md(),Yc=0)),Xc=Kc},id.diffed=function(t){sd&&sd(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(1!==nd.push(e)&&td===id.requestAnimationFrame||((td=id.requestAnimationFrame)||yd)(md)),e.__H.__.some(function(t){t.u&&(t.__H=t.u,t.u=void 0)})),Xc=Kc=null},id.__c=function(t,e){e.some(function(t){try{t.__h.some(bd),t.__h=t.__h.filter(function(t){return!t.__||wd(t)})}catch(n){e.some(function(t){t.__h&&(t.__h=[])}),e=[],id.__e(n,t.__v)}}),ad&&ad(t,e)},id.unmount=function(t){ld&&ld(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.some(function(t){try{bd(t)}catch(t){e=t}}),n.__H=void 0,e&&id.__e(e,n.__v))};var gd="function"==typeof requestAnimationFrame;function yd(t){var e,n=function(){clearTimeout(i),gd&&cancelAnimationFrame(e),setTimeout(t)},i=setTimeout(n,35);gd&&(e=requestAnimationFrame(n))}function bd(t){var e=Kc,n=t.__c;"function"==typeof n&&(t.__c=void 0,n()),Kc=e}function wd(t){var e=Kc;t.__c=t.__(),Kc=e}function kd(t,e){return!t||t.length!==e.length||e.some(function(e,n){return e!==t[n]})}function Sd(t,e){return"function"==typeof e?e(t):e}const _d="tab",xd="left",Cd="center",Md="right",Td="next_to_trigger",Id="popover",Ad="widget",Rd="external_survey",Ed="open",Od="multiple_choice",$d="single_choice",Ld="rating",Dd="end",Fd="always",Pd="survey shown",Nd="survey dismissed",qd="survey sent",jd="$survey_id",Bd="$survey_name",zd="$survey_iteration",Ud="$survey_iteration_start_date",Wd="$survey_language",Hd=he("[Surveys]"),Gd=(t,e)=>`${t}${function(t){return t.current_iteration&&t.current_iteration>0?`${t.id}_${t.current_iteration}`:t.id}(e)}`,Vd=t=>Gd("seenSurvey_",t),Qd=[Id,Ad,"api"];function Zd(t,e){this.v=t,this.k=e}function Jd(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=Array(e);e>n;n++)i[n]=t[n];return i}function Yd(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var i,r,o,s,a=[],l=!0,u=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(i=o.call(n)).done)&&(a.push(i.value),a.length!==e);l=!0);}catch(t){u=!0,r=t}finally{try{if(!l&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw r}}return a}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Jd(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Jd(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Kd(t){var e,n;function i(e,n){try{var o=t[e](n),s=o.value,a=s instanceof Zd;Promise.resolve(a?s.v:s).then(function(n){if(a){var l="return"===e&&s.k?e:"next";if(!s.k||n.done)return i(l,n);n=t[l](n).value}r(!!o.done,n)},function(t){i("throw",t)})}catch(t){r(2,t)}}function r(t,r){2===t?e.reject(r):e.resolve({value:r,done:t}),(e=e.next)?i(e.key,e.arg):n=null}this._invoke=function(t,r){return new Promise(function(o,s){var a={key:t,arg:r,resolve:o,reject:s,next:null};n?n=n.next=a:(e=n=a,i(t,r))})},"function"!=typeof t.return&&(this.return=void 0)}Kd.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},Kd.prototype.next=function(t){return this._invoke("next",t)},Kd.prototype.throw=function(t){return this._invoke("throw",t)},Kd.prototype.return=function(t){return this._invoke("return",t)};const Xd=Object.entries,th=Object.keys,eh=Object.setPrototypeOf,nh=Object.isFrozen,ih=Object.getPrototypeOf,rh=Object.getOwnPropertyDescriptor;let oh=Object.freeze,sh=Object.seal,ah=Object.create,lh="undefined"!=typeof Reflect&&Reflect,uh=lh.apply,ch=lh.construct;oh||(oh=function(t){return t}),sh||(sh=function(t){return t}),uh||(uh=function(t,e){for(var n=arguments.length,i=new Array(n>2?n-2:0),r=2;n>r;r++)i[r-2]=arguments[r];return t.apply(e,i)}),ch||(ch=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;e>i;i++)n[i-1]=arguments[i];return new t(...n)});const dh=Fh([].forEach),hh=Fh([].lastIndexOf),fh=Fh([].pop),vh=Fh([].push),ph=Fh([].slice),mh=Fh([].splice),gh=Array.isArray,yh=Ph(Set),bh=Fh(Set.prototype.add),wh=Fh(Set.prototype.has),kh=Fh("".toLowerCase),Sh=Fh("".toString),_h=Fh("".match),xh=Fh("".replace),Ch=Fh("".indexOf),Mh=Fh("".trim),Th=Fh((0).toString),Ih=Fh(Boolean.prototype.toString),Ah="undefined"==typeof BigInt?null:Fh(BigInt.prototype.toString),Rh="undefined"==typeof Symbol?null:Fh(Symbol.prototype.toString),Eh=Fh({}.hasOwnProperty),Oh=Fh({}.toString),$h=/t/.test,Lh=function(t,e){return t instanceof RegExp&&(t.lastIndex=0),uh($h,t,[e])},Dh=Ph(TypeError);function Fh(t){return function(e){for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;n>r;r++)i[r-1]=arguments[r];return uh(t,e,i)}}function Ph(t){return function(){for(var e=arguments.length,n=new Array(e),i=0;e>i;i++)n[i]=arguments[i];return ch(t,n)}}function Nh(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:kh;if(eh&&eh(t,null),!gh(e))return t;let i=e.length;for(;i--;){let r=e[i];if("string"==typeof r){const t=n(r);t!==r&&(nh(e)||(e[i]=t),r=t)}t[r]=!0}return t}function qh(t){for(let e=0;t.length>e;e++)Eh(t,e)||(t[e]=null);return t}function jh(t){const e=ah(null);for(const i of Xd(t)){var n=Yd(i,2);const r=n[0],o=n[1];Eh(t,r)&&(e[r]=gh(o)?qh(o):o&&"object"==typeof o&&o.constructor===Object?jh(o):o)}return e}function Bh(t){const e=ah(null),n=th(t);let i=n.length;for(;i--;)e[n[i]]=t[n[i]];return e}function zh(t,e){for(;null!==t;){const n=rh(t,e);if(n){if(n.get)return Fh(n.get);if("function"==typeof n.value)return Fh(n.value)}t=ih(t)}return function(){return null}}const Uh=oh(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Wh=oh(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Hh=oh(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Gh=oh(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Vh=oh(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Qh=oh(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Zh=oh(["#text"]),Jh=oh(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),Yh=oh(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","pointer-events","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","vector-effect","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Kh=oh(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Xh=oh(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),tf=sh(/{{[\w\W]*|^[\w\W]*}}/g),ef=sh(/<%[\w\W]*|^[\w\W]*%>/g),nf=sh(/\${[\w\W]*/g),rf=sh(/{{|}}|\${|<%|%>|<%|%>/),of=sh(/^data-[\-\w.\u00B7-\uFFFF]+$/),sf=sh(/^aria-[\-\w]+$/),af=sh(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),lf=sh(/^(?:\w+script|data):/i),uf=sh(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),cf=sh(/^html$/i),df=sh(/^[a-z][.\w]*(-[.\w]+)+$/i),hf=sh(/<[/\w!]/g),ff=sh(/<[/\w]/g),vf=sh(/<\/no(script|embed|frames)/i),pf=sh(/\/>/i),mf=sh(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i),gf=sh(/^[\r\n\t ]+/),yf=oh(Nh({},["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"])),bf=function(){return"undefined"==typeof window?null:window},wf=function(t,e,n,i){return Eh(t,e)&&gh(t[e])?Nh(i.base?Bh(i.base):{},t[e],i.transform):n},kf=function(t,e,n){const i=Eh(t,e)?t[e]:void 0;return i&&"object"==typeof i?jh(i):n};var Sf=function t(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:bf();const n=e=>t(e);if(n.version="3.4.18",n.removed=[],!e||!e.document||9!==e.document.nodeType||!e.Element)return n.isSupported=!1,n;let i=e.document;const r=i,o=r.currentScript,s=e.HTMLTemplateElement,a=e.Node,l=e.NodeFilter,u=e.DOMParser,c=e.trustedTypes,d=e.Element.prototype,h=zh(d,"cloneNode"),f=zh(d,"remove"),v=zh(d,"removeAttributeNode"),p=zh(d,"nextSibling"),m=zh(d,"childNodes"),g=zh(d,"parentNode"),y=zh(d,"shadowRoot"),b=zh(d,"attributes"),w=a&&a.prototype?zh(a.prototype,"nodeType"):null,k=a&&a.prototype?zh(a.prototype,"nodeName"):null,S=a&&a.prototype?zh(a.prototype,"ownerDocument"):null,_=function(t){return w?w(t):t.nodeType},x=function(t){return k?k(t):t.nodeName},C=function(t){for(;null!==t;){const e=rh(t,"namespaceURI");if(e)return e.get?Fh(e.get):null;t=ih(t)}return null}(d),M=function(t){return C?C(t):t.namespaceURI};if("function"==typeof s){const t=i.createElement("template");t.content&&t.content.ownerDocument&&(i=t.content.ownerDocument)}let T,I,A="",R=!1,E=0;const O=function(){if(E>0)throw Dh('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},L=function(t){O(),E++;try{return T.createHTML(t)}finally{E--}},D=function(t){return T&&yt?L(t):t},F=i.implementation,P=i.createNodeIterator,N=i.createDocumentFragment,q=i.getElementsByTagName,j=r.importNode;let B={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};n.isSupported="function"==typeof Xd&&"function"==typeof g&&F&&void 0!==F.createHTMLDocument;const z=tf,U=ef,W=nf,H=of,G=sf,V=lf,Q=uf,Z=df;let J=af,Y=null;const K=Nh({},[...Uh,...Wh,...Hh,...Vh,...Zh]);let X=null;const tt=Nh({},[...Jh,...Yh,...Kh,...Xh]);let et=null,nt=null,it=null;const rt=Object.seal(ah(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let ot=!0,st=!0,at=!1,lt=!0,ut=!1,ct=!0,dt=!1,ht=!1,ft=null,vt=null,pt=!1,mt=!1,gt=!1,yt=!1,bt=!0,wt=!1;const kt="user-content-";let St=!0,_t=!1,xt=null,Ct=!1,Mt=null;const Tt=Nh({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let It=null;const At=Nh({},["audio","video","img","source","image","track"]);let Rt=null;const Et=Nh({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Ot="http://www.w3.org/1998/Math/MathML",$t="http://www.w3.org/2000/svg",Lt="http://www.w3.org/1999/xhtml";let Dt=Lt,Ft=!1,Pt=null;const Nt=Nh({},[Ot,$t,Lt],Sh),qt=oh(Nh({},["mi","mo","mn","ms","mtext"]));let jt=null;const Bt=oh(Nh({},["annotation-xml"]));let zt=null;const Ut=oh(ah(null)),Wt=Nh({},["title","style","font","a","script"]);let Ht=null;const Gt=["application/xhtml+xml","text/html"];let Vt=null,Qt=null;const Zt=i.createElement("form"),Jt=function(t){return t instanceof RegExp||t instanceof Function},Yt=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t&&"object"==typeof t||(t={}),t=jh(t),Ht=-1===Gt.indexOf(t.PARSER_MEDIA_TYPE)?"text/html":t.PARSER_MEDIA_TYPE,Vt="application/xhtml+xml"===Ht?Sh:kh,Y=wf(t,"ALLOWED_TAGS",K,{transform:Vt}),X=wf(t,"ALLOWED_ATTR",tt,{transform:Vt}),Pt=wf(t,"ALLOWED_NAMESPACES",Nt,{transform:Sh}),Rt=wf(t,"ADD_URI_SAFE_ATTR",Et,{transform:Vt,base:Et}),It=wf(t,"ADD_DATA_URI_TAGS",At,{transform:Vt,base:At}),Mt=wf(t,"FORBID_CONTENTS",Tt,{transform:Vt}),nt=wf(t,"FORBID_TAGS",ah(null),{transform:Vt}),it=wf(t,"FORBID_ATTR",ah(null),{transform:Vt}),Ct=!!Eh(t,"USE_PROFILES")&&(t.USE_PROFILES&&"object"==typeof t.USE_PROFILES?jh(t.USE_PROFILES):t.USE_PROFILES),ot=!1!==t.ALLOW_ARIA_ATTR,st=!1!==t.ALLOW_DATA_ATTR,at=t.ALLOW_UNKNOWN_PROTOCOLS||!1,lt=!1!==t.ALLOW_SELF_CLOSE_IN_ATTR,ut=t.SAFE_FOR_TEMPLATES||!1,ct=!1!==t.SAFE_FOR_XML,dt=t.WHOLE_DOCUMENT||!1,mt=t.RETURN_DOM||!1,gt=t.RETURN_DOM_FRAGMENT||!1,yt=t.RETURN_TRUSTED_TYPE||!1,pt=t.FORCE_BODY||!1,bt=!1!==t.SANITIZE_DOM,wt=t.SANITIZE_NAMED_PROPS||!1,St=!1!==t.KEEP_CONTENT,_t=t.IN_PLACE||!1,J=function(t){if(!t)return!1;try{return Lh(t,""),!0}catch(t){return!1}}(t.ALLOWED_URI_REGEXP)?t.ALLOWED_URI_REGEXP:af,Dt="string"==typeof t.NAMESPACE?t.NAMESPACE:Lt,jt=kf(t,"MATHML_TEXT_INTEGRATION_POINTS",qt),zt=kf(t,"HTML_INTEGRATION_POINTS",Bt);const e=kf(t,"CUSTOM_ELEMENT_HANDLING",Ut);if(et=ah(null),Eh(e,"tagNameCheck")&&Jt(e.tagNameCheck)&&(et.tagNameCheck=e.tagNameCheck),Eh(e,"attributeNameCheck")&&Jt(e.attributeNameCheck)&&(et.attributeNameCheck=e.attributeNameCheck),Eh(e,"allowCustomizedBuiltInElements")&&"boolean"==typeof e.allowCustomizedBuiltInElements&&(et.allowCustomizedBuiltInElements=e.allowCustomizedBuiltInElements),sh(et),ut&&(st=!1),gt&&(mt=!0),Ct&&((Eh(t,"ALLOWED_TAGS")||Eh(t,"ALLOWED_ATTR"))&&"undefined"!=typeof console&&"function"==typeof console.warn&&console.warn("DOMPurify: USE_PROFILES overrides ALLOWED_TAGS and ALLOWED_ATTR. Do not use these options together."),Y=Nh({},Zh),X=ah(null),!0===Ct.html&&(Nh(Y,Uh),Nh(X,Jh)),!0===Ct.svg&&(Nh(Y,Wh),Nh(X,Yh),Nh(X,Xh)),!0===Ct.svgFilters&&(Nh(Y,Hh),Nh(X,Yh),Nh(X,Xh)),!0===Ct.mathMl&&(Nh(Y,Vh),Nh(X,Kh),Nh(X,Xh))),rt.tagCheck=null,rt.attributeCheck=null,Eh(t,"ADD_TAGS")&&("function"==typeof t.ADD_TAGS?rt.tagCheck=t.ADD_TAGS:gh(t.ADD_TAGS)&&(Y===K&&(Y=Bh(Y)),Nh(Y,t.ADD_TAGS,Vt))),Eh(t,"ADD_ATTR")&&("function"==typeof t.ADD_ATTR?rt.attributeCheck=t.ADD_ATTR:gh(t.ADD_ATTR)&&(X===tt&&(X=Bh(X)),Nh(X,t.ADD_ATTR,Vt))),Eh(t,"ADD_FORBID_CONTENTS")&&gh(t.ADD_FORBID_CONTENTS)&&(Mt===Tt&&(Mt=Bh(Mt)),Nh(Mt,t.ADD_FORBID_CONTENTS,Vt)),St&&(Y["#text"]=!0),dt&&Nh(Y,["html","head","body"]),Y.table&&(Y.tbody=!0,delete nt.tbody),t.TRUSTED_TYPES_POLICY){if("function"!=typeof t.TRUSTED_TYPES_POLICY.createHTML)throw Dh('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof t.TRUSTED_TYPES_POLICY.createScriptURL)throw Dh('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const e=T;T=t.TRUSTED_TYPES_POLICY;try{A=L("")}catch(t){throw T=e,t}}else null===t.TRUSTED_TYPES_POLICY?(T=void 0,A=""):(void 0===T&&(R||(I=function(t,e){if("object"!=typeof t||"function"!=typeof t.createPolicy)return null;let n=null;const i="data-tt-policy-suffix";e&&e.hasAttribute(i)&&(n=e.getAttribute(i));const r="dompurify"+(n?"#"+n:"");try{return t.createPolicy(r,{createHTML:t=>t,createScriptURL:t=>t})}catch(t){return console.warn("TrustedTypes policy "+r+" could not be created."),null}}(c,o),R=!0),T=I),T&&"string"==typeof A&&(A=L("")));Qt=oh(t)},Kt=Nh({},[...Wh,...Hh,...Gh]),Xt=Nh({},[...Vh,...Qh]),te=function(t){vh(n.removed,{element:t});try{g(t).removeChild(t)}catch(e){if(f(t),!g(t))throw Dh("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},ee=function(t,e,n){try{v(t,e)}catch(e){try{t.removeAttribute(n)}catch(t){}}},ne=function(t){se(t);const e=m(t);e&&dh(ph(e),t=>{try{f(t)}catch(t){}}),1===_(t)&&re(t,!1)},ie=function(t,e,i){if(!i)try{i=e.getAttributeNode(t)}catch(t){i=null}if(vh(n.removed,{attribute:i||null,from:e}),i)ee(e,i,t);else try{e.removeAttribute(t)}catch(t){}if("is"===t)if(mt||gt)try{te(e)}catch(t){}else try{e.setAttribute(t,"")}catch(t){}},re=function(t,e){const n=b(t);if(n)for(let i=n.length-1;i>=0;--i){const r=n[i],o=r&&r.name;"string"!=typeof o||e&&X[Vt(o)]||ee(t,r,o)}},oe=function(t,e){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const i=[t];for(;i.length>0;){const t=i.pop();if(!1===e(t))continue;if(n&&1===_(t)){const e=y(t);ye(e)&&i.push(e)}const r=m(t);if(r)for(let t=r.length-1;t>=0;--t)i.push(r[t])}},se=function(t){oe(t,t=>{1===_(t)&&re(t,!0)})},ae=function(t){const e=[];return oe(t,t=>{e.push(t)},!0),e},le=function(t,e){let i=!1;return dh(n.removed,e=>{e.element&&(i=i||e.element===t,se(e.element))}),function(t,e){const n=yh();dh(ae(t),t=>{1===_(t)&&bh(n,t)}),dh(e,t=>{1!==_(t)||wh(n,t)||re(t,!0)})}(t,e),i},ue=function(t,e,n,i){const r=he(t);let o;for(;o=r.nextNode();)wh(i,o)&&!wh(xt,o)&&(e&&we(B.uponSanitizeShadowNode,o,null),Ee(o,n))},ce=function(t,e){return!!ct&&("patchsrc"===t||"for"===t&&"label"!==e&&"output"!==e)},de=function(t){let e=null,n=null;if(pt)t="<remove></remove>"+t;else{const e=_h(t,gf);n=e&&e[0]}"application/xhtml+xml"===Ht&&Dt===Lt&&(t='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+t+"</body></html>");const r=T?L(t):t;if(Dt===Lt)try{e=(new u).parseFromString(r,Ht)}catch(t){}if(!e||!e.documentElement){e=F.createDocument(Dt,"template",null);try{e.documentElement.innerHTML=Ft?A:r}catch(t){}}const o=e.body||e.documentElement;return t&&n&&o.insertBefore(i.createTextNode(n),o.childNodes[0]||null),Dt===Lt?q.call(e,dt?"html":"body")[0]:dt?e.documentElement:o},he=function(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=S?S(t):t.ownerDocument;return P.call(n||t,t,(e?0:l.SHOW_ELEMENT)|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null)},fe=function(t){return t=xh(t,z," "),t=xh(t,U," "),xh(t,W," ")},ve=function(t){var e;pe(t);const n=null===(e=t.querySelectorAll)||void 0===e?void 0:e.call(t,"template");n&&dh(n,t=>{ye(t.content)&&ve(t.content)})},pe=function(t){t.normalize();const e=he(t,!0);let n=e.nextNode();for(;n;)n.data=fe(n.data),n=e.nextNode()},me=function(t){const e=k?k(t):null;return"string"==typeof e&&"form"===Vt(e)&&("string"!=typeof t.nodeName||"string"!=typeof t.textContent||"function"!=typeof t.removeChild||t.attributes!==b(t)||"function"!=typeof t.removeAttribute||"function"!=typeof t.removeAttributeNode||"function"!=typeof t.getAttributeNode||"function"!=typeof t.setAttribute||"string"!=typeof t.namespaceURI||"function"!=typeof t.insertBefore||"function"!=typeof t.hasChildNodes||t.nodeType!==w(t)||t.childNodes!==m(t))},ge=function(t){if(!w||"object"!=typeof t||null===t)return null;try{const e=w(t);return"number"==typeof e?e:null}catch(t){return null}},ye=function(t){return 11===ge(t)},be=function(t){return null!==ge(t)};function we(t,e,i){0!==t.length&&dh(t,t=>{t.call(n,e,i,Qt)})}const ke=function(t,e){if(t instanceof RegExp)return Lh(t,e);if(t instanceof Function){for(var n=arguments.length,i=new Array(n>2?n-2:0),r=2;n>r;r++)i[r-2]=arguments[r];return Boolean(t(e,...i))}return!1},Se=function(t,e,n,i){return 0===t.length?e:e===n||e===i?Bh(e):e},_e=function(t,e){return t!==e&&null===g(t)&&(_t&&se(t),!0)},xe=function(t,e){if(xt&&bh(xt,t),we(B.beforeSanitizeElements,t,null),_e(t,e))return!0;if(me(t))return te(t),!0;const i=Vt(x(t)),r=_(t);if(Y=Se(B.uponSanitizeElement,Y,K,ft),we(B.uponSanitizeElement,t,{tagName:i,allowedTags:Y}),_e(t,e))return!0;if(function(t,e,n){return!!(ct&&1===n&&t.hasChildNodes()&&!be(t.firstElementChild)&&Lh(hf,t.textContent)&&Lh(hf,t.innerHTML))||!!(ct&&yf[e]&&1===n&&M(t)===Lt&&(be(t.firstElementChild)||"string"==typeof t.textContent&&Lh(hf,t.textContent)))||7===n||!(!ct||8!==n||!Lh(ff,t.data))}(t,i,r))return te(t),!0;if(nt[i]||!(rt.tagCheck instanceof Function&&rt.tagCheck(i))&&!Y[i]){const n=function(t,e,n){if(!nt[e]&&Te(e)&&ke(et.tagNameCheck,e))return!1;if(St&&!Mt[e]&&!Mt[kh(e)]){const e=g(t),i=m(t);if(i&&e)for(let r=i.length-1;r>=0;--r){const o=t===n?h(i[r],!0):i[r];e.insertBefore(o,p(t))}}return te(t),!0}(t,i,e);return!(!1!==n||(we(B.afterSanitizeElements,t,null),!_e(t,e)))||n}if(1===r&&!function(t){const e=M(t),n=kh(x(t)),i=g(t);let r=Dt,o="template";return i&&1===_(i)&&(r=M(i),o=kh(x(i))),!!Pt[e]&&(e===$t?function(t,e,n){return e===Lt?"svg"===t:e===Ot?"svg"===t&&("annotation-xml"===n||jt[n]):Boolean(Kt[t])}(n,r,o):e===Ot?function(t,e,n){return e===Lt?"math"===t:e===$t?"math"===t&&zt[n]:Boolean(Xt[t])}(n,r,o):e===Lt?function(t,e,n){return!(e===$t&&!zt[n])&&!(e===Ot&&!jt[n])&&!Xt[t]&&(Wt[t]||!Kt[t])}(n,r,o):"application/xhtml+xml"===Ht)}(t))return te(t),!0;if(("noscript"===i||"noembed"===i||"noframes"===i)&&Lh(vf,t.innerHTML))return te(t),!0;if(ut&&3===r){const e=t.textContent,i=fe(e);e!==i&&(vh(n.removed,{element:t.cloneNode()}),t.textContent=i)}return we(B.afterSanitizeElements,t,null),_e(t,e)},Ce=function(t,e,n){if(it[e])return!1;if(ce(e,t))return!1;if(bt&&("id"===e||"name"===e)&&(n in i||n in Zt))return!1;const r=X[e]||rt.attributeCheck instanceof Function&&rt.attributeCheck(e,t);if(st&&Lh(H,e))return!0;if(ot&&Lh(G,e))return!0;if(!r)return Te(t)&&ke(et.tagNameCheck,t)&&ke(et.attributeNameCheck,e,t)||"is"===e&&et.allowCustomizedBuiltInElements&&ke(et.tagNameCheck,n);if(Rt[e])return!0;const o=xh(n,Q,"");return!(!Lh(J,o)&&("src"!==e&&"xlink:href"!==e&&"href"!==e||"script"===t||0!==Ch(n,"data:")||!It[t])&&(!at||Lh(V,o))&&n)},Me=Nh({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Te=function(t){return!Me[kh(t)]&&Lh(Z,t)},Ie=function(t,e,n,i){if(T&&"object"==typeof c&&"function"==typeof c.getAttributeType&&!n)switch(c.getAttributeType(t,e)){case"TrustedHTML":return L(i);case"TrustedScriptURL":return function(t){O(),E++;try{return T.createScriptURL(t)}finally{E--}}(i)}return i},Ae=function(t,e,n,i){try{return n?t.setAttributeNS(n,e,i):t.setAttribute(e,i),!me(t)||(te(t),!1)}catch(n){return ie(e,t),!1}},Re=function(t,e){return!(!ct||!Lh(mf,e))||"attributename"===kh(t)&&-1!==Ch(e,"href")},Ee=function(t,e){xe(t,e),function(t,e){if(we(B.beforeSanitizeAttributes,t,null),_e(t,e))return;const i=t.attributes;if(!i||me(t))return;X=Se(B.uponSanitizeAttribute,X,tt,vt);const r={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:X,forceKeepAttr:void 0};let o=i.length;const s=Vt(x(t));for(;o--;){const e=i[o],a=e.name,l=e.namespaceURI,u=e.value,c=Vt(a),d=u;let h="value"===a?d:Mh(d),f=!1;r.attrName=c,r.attrValue=h,r.keepAttr=!0,r.forceKeepAttr=void 0,we(B.uponSanitizeAttribute,t,r),h=r.attrValue,!wt||"id"!==c&&"name"!==c||0===Ch(h,kt)||(ie(a,t,e),h=kt+h,f=!0),Re(a,h)?ie(a,t,e):r.forceKeepAttr||(!r.keepAttr||!lt&&Lh(pf,h)?ie(a,t,e):(ut&&(h=fe(h)),Ce(s,c,h)?(h=Ie(s,c,l,h),h!==d&&Ae(t,a,l,h)&&f&&fh(n.removed)):ie(a,t,e)))}we(B.afterSanitizeAttributes,t,null),_e(t,e)}(t,e),ye(t.content)&&Oe(t.content)},Oe=function(t){let e=null;const n=he(t);for(we(B.beforeSanitizeShadowDOM,t,null);e=n.nextNode();)if(we(B.uponSanitizeShadowNode,e,null),Ee(e,t),1===_(e)){const t=y(e);ye(t)&&($e(t),Oe(t))}ut&&pe(t),we(B.afterSanitizeShadowDOM,t,null)},$e=function(t){const e=[{node:t,shadow:null}];for(;e.length>0;){const t=e.pop();if(t.shadow){Oe(t.shadow);continue}const n=t.node,i=1===_(n),r=m(n);if(r)for(let t=r.length-1;t>=0;--t)e.push({node:r[t],shadow:null});if(i){const t=k?k(n):null;if("string"==typeof t&&"template"===Vt(t)){const t=n.content;ye(t)&&e.push({node:t,shadow:null})}}if(i){const t=y(n);ye(t)&&e.push({node:null,shadow:t},{node:t,shadow:null})}}};return n.sanitize=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=null,o=null,s=null,a=null;if(Ft=!t,Ft&&(t="\x3c!--\x3e"),"string"!=typeof t&&!be(t)&&"string"!=typeof(t=function(t){switch(typeof t){case"string":return t;case"number":return Th(t);case"boolean":return Ih(t);case"bigint":return Ah?Ah(t):"0";case"symbol":return Rh?Rh(t):"Symbol()";case"undefined":default:return Oh(t);case"function":case"object":{if(null===t)return Oh(t);const e=t,n=zh(e,"toString");if("function"==typeof n){const t=n(e);return"string"==typeof t?t:Oh(t)}return Oh(t)}}}(t)))throw Dh("dirty is not a string, aborting");if(!n.isSupported)return t;ht?(Y=ft,X=vt):Yt(e),n.removed=[];const l=_t&&"string"!=typeof t&&be(t);let u=[];const c=xt;if(l){ct&&oe(t,t=>{const e=_(t);if(7===e||8===e&&Lh(ff,t.data)){try{f(t)}catch(t){}return!1}if(1===e){const e=t,n=Vt(x(t));try{e.hasAttribute&&e.hasAttribute("patchsrc")&&e.removeAttribute("patchsrc"),e.hasAttribute&&e.hasAttribute("for")&&ce("for",n)&&e.removeAttribute("for")}catch(t){}}return!0});const e=x(t);if("string"==typeof e){const n=Vt(e);if(!Y[n]||nt[n])throw ne(t),Dh("root node is forbidden and cannot be sanitized in-place")}if(me(t))throw ne(t),Dh("root node is clobbered and cannot be sanitized in-place");u=ae(t),xt=yh()}else if(be(t))i=de("\x3c!----\x3e"),o=i.ownerDocument.importNode(t,!0),1===o.nodeType&&"BODY"===o.nodeName||"HTML"===o.nodeName?i=o:i.appendChild(o),$e(i);else{if(!mt&&!ut&&!dt&&-1===t.indexOf("<"))return D(t);if(i=de(t),!i)return mt?null:yt?A:""}i&&pt&&te(i.firstChild);const d=l?t:i;try{l&&$e(t);const e=he(d);for(;s=e.nextNode();)Ee(s,d);l&&function(t,e){const n=xt;let i=null;const r=()=>(i||(i=yh(),dh(e,t=>{bh(i,t)})),i);for(let e=0;;e++){const i=ae(t),o=[t];let s=!1;if(dh(i,t=>{11===_(t)?vh(o,t):s||wh(n,t)||(s=wh(r(),t))}),!s)return;if(e>=8)throw Dh("the tree kept changing during in-place sanitization; refusing to return it");dh(o,(e,n)=>{ue(e,n>0,t,r())})}}(t,u)}catch(e){throw l&&(ne(t),le(t,u)),e}finally{xt=c}if(l){if(le(t,u))throw Dh("a node selected for removal could not be safely returned; refusing to sanitize in place");return ut&&ve(t),t}if(mt){if(ut&&ve(i),gt)for(a=N.call(i.ownerDocument);i.firstChild;)a.appendChild(i.firstChild);else a=i;return(X.shadowroot||X.shadowrootmode)&&(a=j.call(r,a,!0)),a}const h=()=>dt?i.outerHTML:i.innerHTML;let v=h();return ut&&Lh(rf,v)&&(pe(i),v=h()),dt&&Y["!doctype"]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&Lh(cf,i.ownerDocument.doctype.name)&&(v="<!DOCTYPE "+i.ownerDocument.doctype.name+">\n"+v),D(v)},n.setConfig=function(){Yt(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),ht=!0,ft=Y,vt=X},n.clearConfig=function(){Qt=null,ht=!1,ft=null,vt=null,T=I,A=""},n.isValidAttribute=function(t,e,n){Qt||Yt({});const i=Vt(t),r=Vt(e);return("string"!=typeof n||!(Re(e,n)||!lt&&Lh(pf,n)))&&Ce(i,r,n)},n.addHook=function(t,e){"function"==typeof e&&Eh(B,t)&&vh(B[t],e)},n.removeHook=function(t,e){if(Eh(B,t)){if(void 0!==e){const n=hh(B[t],e);return-1===n?void 0:mh(B[t],n,1)[0]}return fh(B[t])}},n.removeHooks=function(t){Eh(B,t)&&(B[t]=[])},n.removeAllHooks=function(){B={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},n}();const _f=["a","abbr","acronym","area","article","aside","b","bdi","bdo","blockquote","br","caption","center","cite","code","col","colgroup","data","dd","del","details","dfn","div","dl","dt","em","figcaption","figure","footer","h1","h2","h3","h4","h5","h6","header","hgroup","hr","i","img","ins","kbd","li","map","mark","nav","ol","p","pre","q","rp","rt","rtc","ruby","s","samp","small","span","strike","strong","sub","summary","sup","table","tbody","td","th","thead","time","tr","tt","u","ul","var","wbr"],xf=["style","lang","title","width","height"],Cf=["abbr","align","axis","bgcolor","char","charoff","colspan","headers","height","nowrap","rowspan","scope","valign","width"],Mf={a:["href","hreflang","target","rel"],bdo:["dir"],blockquote:["cite"],col:["align","char","charoff","span"],colgroup:["align","char","charoff","span"],del:["cite","datetime"],hr:["align","size","width"],img:["align","alt","height","src","width"],ins:["cite","datetime"],ol:["start","type"],q:["cite"],table:["align","bgcolor","border","cellpadding","cellspacing","frame","rules","summary","width"],tbody:["align","char","charoff","valign"],td:Cf,tfoot:["align","char","charoff","valign"],th:Cf,thead:["align","char","charoff","valign"],tr:["align","bgcolor","char","charoff","valign"]};let Tf;function If(t){var e;const n=(null!==(e=Tf)&&void 0!==e?e:Tf=Sf()).sanitize(t,{ALLOWED_TAGS:_f,ALLOWED_ATTR:[],ALLOW_ARIA_ATTR:!1,ALLOW_DATA_ATTR:!1,ALLOWED_NAMESPACES:["http://www.w3.org/1999/xhtml"],ADD_ATTR:(t,e)=>-1!==xf.indexOf(t)||{}.hasOwnProperty.call(Mf,e)&&-1!==(Mf[e]||[]).indexOf(t),RETURN_DOM_FRAGMENT:!0}),i=n.querySelectorAll("a");for(let t=0;i.length>t;t++)i.item(t).relList.add("noopener");const r=document.createElement("div");return r.appendChild(n),r.innerHTML}const Af=he("[Stylesheet Loader]"),Rf="#020617",Ef={fontFamily:"inherit",backgroundColor:"#eeeded",submitButtonColor:"black",submitButtonTextColor:"white",ratingButtonColor:"white",ratingButtonActiveColor:"black",borderColor:"#c9c6c6",whiteLabel:!1,displayThankYouMessage:!0,thankYouMessageHeader:"Thank you for your feedback!",position:Md,widgetType:_d,widgetLabel:"Feedback",widgetColor:"black",zIndex:String(2147483645),disabledButtonOpacity:"0.6",maxWidth:"300px",textSubtleColor:"#939393",boxPadding:"20px 24px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",borderRadius:"10px",shuffleQuestions:!1,outlineColor:"rgba(59, 130, 246, 0.8)",inputBackground:"white",inputTextColor:Rf,scrollbarThumbColor:"var(--ph-survey-border-color)",scrollbarTrackColor:"var(--ph-survey-background-color)"},Of=[Cd,xd,Md];function $f(t){if(t.startsWith("#")){let e=t.replace(/^#/,"");return/^[0-9A-Fa-f]{3}$/.test(e)&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]),/^[0-9A-Fa-f]{6}$/.test(e)?`rgb(${parseInt(e.slice(0,2),16)},${parseInt(e.slice(2,4),16)},${parseInt(e.slice(4,6),16)})`:"rgb(255, 255, 255)"}return"rgb(255, 255, 255)"}function Lf(t=Ef.backgroundColor){let e;"#"===t[0]&&(e=$f(t)),t.startsWith("rgb")&&(e=t);const n={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4","indianred ":"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"}[t.toLowerCase()];if(n&&(e=$f(n)),!e)return Rf;const i=e.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);if(i){const t=parseInt(i[1]),e=parseInt(i[2]),n=parseInt(i[3]);return Math.sqrt(t*t*.299+e*e*.587+n*n*.114)>127.5?Rf:"white"}return Rf}const Df=(t,e,n)=>{const i=ev(t),r=document.querySelector(`.${i}`);if(r&&r.shadowRoot)return{shadow:r.shadowRoot,isNewlyCreated:!1};const o=document.createElement("div");((t,e,n)=>{const i=L(L({},Ef),n),r=t.style,o=!Of.includes(i.position)||e===Ad&&(null==n?void 0:n.widgetType)===_d;var s;r.setProperty("--ph-survey-font-family",function(t){if("inherit"===t)return"inherit";const e='BlinkMacSystemFont, "Inter", "Segoe UI", "Roboto", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"';return t?`${t}, ${e}`:`-apple-system, ${e}`}(i.fontFamily)),r.setProperty("--ph-survey-box-padding",i.boxPadding),r.setProperty("--ph-survey-max-width",i.maxWidth),r.setProperty("--ph-survey-z-index",i.zIndex),r.setProperty("--ph-survey-border-color",i.borderColor),o?(r.setProperty("--ph-survey-border-radius",i.borderRadius),r.setProperty("--ph-survey-border-bottom","1.5px solid var(--ph-survey-border-color)")):(r.setProperty("--ph-survey-border-bottom","none"),r.setProperty("--ph-survey-border-radius",`${i.borderRadius} ${i.borderRadius} 0 0`)),r.setProperty("--ph-survey-background-color",i.backgroundColor),r.setProperty("--ph-survey-box-shadow",i.boxShadow),r.setProperty("--ph-survey-disabled-button-opacity",i.disabledButtonOpacity),r.setProperty("--ph-survey-submit-button-color",i.submitButtonColor),r.setProperty("--ph-survey-submit-button-text-color",(null==n?void 0:n.submitButtonTextColor)||Lf(i.submitButtonColor)),r.setProperty("--ph-survey-rating-bg-color",i.ratingButtonColor),r.setProperty("--ph-survey-rating-active-bg-color",i.ratingButtonActiveColor),r.setProperty("--ph-survey-rating-active-text-color",Lf(i.ratingButtonActiveColor)),r.setProperty("--ph-survey-text-primary-color",(null==n?void 0:n.textColor)||Lf(i.backgroundColor)),r.setProperty("--ph-survey-text-subtle-color",i.textSubtleColor),s=r,"white"===Lf(i.backgroundColor)?s.setProperty("--ph-logo-mono","1"):s.removeProperty("--ph-logo-mono"),r.setProperty("--ph-widget-color",i.widgetColor),r.setProperty("--ph-widget-text-color",Lf(i.widgetColor)),r.setProperty("--ph-widget-z-index",i.zIndex);const a=(null==n?void 0:n.inputBackground)||(null==n?void 0:n.inputBackgroundColor);let l=a||i.inputBackground;a||"white"!==i.backgroundColor||(l="#f8f8f8"),r.setProperty("--ph-survey-input-background",l);const u=(null==n?void 0:n.inputTextColor)||Lf(l);r.setProperty("--ph-survey-input-text-color",u),r.setProperty("--ph-survey-rating-text-color",u),r.setProperty("--ph-survey-scrollbar-thumb-color",i.scrollbarThumbColor),r.setProperty("--ph-survey-scrollbar-track-color",i.scrollbarTrackColor),r.setProperty("--ph-survey-outline-color",i.outlineColor)})(o,t.type,t.appearance),o.className=i;const s=o.attachShadow({mode:"open"}),a=function(t){const e=((t,e,n)=>{let i=t.createElement("style");i.innerText=e;const r=(t=>{var e;return W(t)?t:null==t||null===(e=t.config)||void 0===e?void 0:e.prepare_external_dependency_stylesheet})(n);return r&&(i=r(i)),i||(Af.error("prepare_external_dependency_stylesheet returned null"),null)})(document,':host{--ph-survey-font-family:-apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", "Roboto", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";--ph-survey-box-padding:20px 24px;--ph-survey-max-width:300px;--ph-survey-z-index:calc(2147480000 + 3645);--ph-survey-border-color:#dcdcdc;--ph-survey-border-bottom:1.5px solid var(--ph-survey-border-color);--ph-survey-border-radius:10px;--ph-survey-background-color:#eeeded;--ph-survey-box-shadow:0 4px 12px #00000026;--ph-survey-submit-button-color:black;--ph-survey-submit-button-text-color:white;--ph-survey-rating-bg-color:white;--ph-survey-rating-text-color:#020617;--ph-survey-rating-active-bg-color:black;--ph-survey-rating-active-text-color:white;--ph-survey-text-primary-color:#020617;--ph-survey-text-subtle-color:#939393;--ph-widget-color:#e0a045;--ph-widget-text-color:white;--ph-survey-scrollbar-thumb-color:var(--ph-survey-border-color);--ph-survey-scrollbar-track-color:var(--ph-survey-background-color);--ph-survey-outline-color:#3b82f6cc;--ph-survey-input-background:white;--ph-survey-input-text-color:#020617;--ph-survey-disabled-button-opacity:.6}.ph-survey{min-width:300px;width:var(--ph-survey-max-width);max-width:85%;z-index:var(--ph-survey-z-index);height:fit-content;margin:0;position:fixed;bottom:0}.ph-survey h3,.ph-survey p{margin:0}.ph-survey *{box-sizing:border-box;font-family:var(--ph-survey-font-family);color:var(--ph-survey-text-primary-color)}.ph-survey textarea,.ph-survey input[type=text],.ph-survey .multiple-choice-options label{color:var(--ph-survey-input-text-color);background:var(--ph-survey-input-background);border:1.5px solid var(--ph-survey-border-color);border-radius:4px;padding:10px;transition:border-color .2s ease-out,box-shadow .2s ease-out,transform .15s ease-out}.ph-survey textarea,.ph-survey input[type=text]{transition:border-color .2s ease-out,box-shadow .2s ease-out,transform .15s ease-out}.ph-survey input{margin:0}.ph-survey textarea:focus,.ph-survey textarea:focus-visible,.ph-survey input[type=text]:focus,.ph-survey input[type=text]:focus-visible,.ph-survey .form-submit:focus,.ph-survey .form-submit:focus-visible,.ph-survey input[type=checkbox]:focus,.ph-survey input[type=radio]:focus,.ph-survey input[type=checkbox]:focus-visible,.ph-survey input[type=radio]:focus-visible{outline:1.5px solid var(--ph-survey-outline-color);border-color:var(--ph-survey-rating-active-bg-color);outline-offset:2px}.ph-survey textarea:focus:not(:focus-visible),.ph-survey input[type=text]:focus:not(:focus-visible),.ph-survey button:focus:not(:focus-visible),.ph-survey input[type=checkbox]:focus:not(:focus-visible),.ph-survey input[type=radio]:focus:not(:focus-visible){outline:none}.ph-survey textarea:hover:not(:focus),.ph-survey input[type=text]:hover:not(:focus){border-color:var(--ph-survey-rating-active-bg-color)}@media (max-width:768px){.ph-survey textarea,.ph-survey input[type=text]{font-size:1rem}}.ph-survey .multiple-choice-options label,.ph-survey .rating-options-number,.ph-survey .form-cancel,.ph-survey input[type=checkbox],.ph-survey input[type=radio]{border:1.5px solid var(--ph-survey-border-color)}.ph-survey label,.ph-survey input[type=checkbox],.ph-survey input[type=radio],.ph-survey .ratings-emoji,.ph-survey .ratings-number,.ph-survey .footer-branding,.ph-survey .form-cancel,.ph-survey .form-submit{transition:all .2s ease-out}@media (prefers-reduced-motion:no-preference){.ph-survey button:active,.ph-survey input[type=checkbox]:active,.ph-survey input[type=radio]:active,.ph-survey label:active{transition-duration:.1s}}.ph-survey-widget-tab{background:var(--ph-widget-color);color:var(--ph-widget-text-color);text-align:center;cursor:pointer;z-index:var(--ph-survey-z-index);border:none;border-radius:3px 3px 0 0;padding:10px 12px;transition:padding .2s ease-out;position:fixed}.ph-survey-widget-tab:hover:not(.widget-tab-top){padding-bottom:16px}.ph-survey-widget-tab.widget-tab-top{border-radius:0 0 3px 3px}.ph-survey-widget-tab.widget-tab-top:hover{padding-top:16px}@keyframes ph-survey-fade-in{0%{opacity:0}to{opacity:1}}.survey-box{flex-direction:column;gap:16px;display:flex}.bottom-section{flex-direction:column;gap:8px;display:flex}.thank-you-message-header~.bottom-section,.intro-screen-header~.bottom-section{padding-top:16px}.question-container,.thank-you-message,.intro-screen{flex-direction:column;gap:8px;display:flex}.survey-question{font-size:14px;font-weight:500}.survey-question-description{opacity:.8;padding-top:4px;font-size:13px}.survey-question-description,.thank-you-message-body,.intro-screen-body{word-wrap:break-word;overflow-wrap:break-word}:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) img,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) video,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) iframe,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) embed,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) object,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) svg{max-width:100%;height:auto}.question-textarea-wrapper{flex-direction:column;display:flex}.survey-form{animation:.3s ease-out forwards ph-survey-fade-in}.survey-form,.thank-you-message,.intro-screen{text-align:left;width:100%;z-index:var(--ph-survey-z-index);border:1.5px solid var(--ph-survey-border-color);border-bottom:var(--ph-survey-border-bottom);background:var(--ph-survey-background-color);border-radius:var(--ph-survey-border-radius);box-shadow:var(--ph-survey-box-shadow);padding:var(--ph-survey-box-padding);margin:0;position:relative}.survey-form textarea,.survey-form input[type=text]{min-width:100%}.survey-form textarea:focus,.survey-form textarea:focus-visible{box-shadow:0 4px 12px #00000014}.survey-form textarea:focus:not(:focus-visible){box-shadow:none}.survey-box .question-header--empty~.multiple-choice-options,.survey-box .question-header--empty~textarea{margin-top:0}.multiple-choice-options{border:none;flex-direction:column;gap:8px;margin:0;padding:1px 0;font-size:14px;display:flex}.multiple-choice-options label,.multiple-choice-options .response-choice{color:inherit;align-items:center;gap:8px;display:flex}.multiple-choice-options label{cursor:pointer;font-size:13px}.multiple-choice-options label:hover:not(:has(input:checked)){border-color:var(--ph-survey-text-subtle-color);box-shadow:0 2px 8px #00000014}.multiple-choice-options label:has(input:checked){border-color:var(--ph-survey-rating-active-bg-color);box-shadow:0 1px 4px #0000000d}.multiple-choice-options label.choice-option-open{flex-wrap:wrap}.multiple-choice-options label span{color:inherit}.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:var(--ph-survey-input-background);cursor:pointer;z-index:1;border-radius:3px;flex-shrink:0;width:1rem;height:1rem;transition:all .2s cubic-bezier(.4,0,.2,1),transform .15s ease-out;position:relative}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):focus{transform:scale(1.05)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):hover{border-color:var(--ph-survey-rating-active-bg-color);transform:scale(1.05)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):active{transform:scale(.95)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):checked{background:var(--ph-survey-rating-active-bg-color);border-color:var(--ph-survey-rating-active-bg-color);transform:scale(1)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):checked:hover{transform:scale(1.05)}.multiple-choice-options input[type=checkbox]:checked:after{border:solid var(--ph-survey-rating-active-text-color);border-width:0 2px 2px 0;width:4px;height:8px;animation:.2s ease-out .1s forwards ph-survey-checkmark-reveal;left:4px;transform:rotate(45deg)scale(0)}.multiple-choice-options input[type=radio]:checked:after{background:var(--ph-survey-rating-active-text-color);border-radius:50%;width:6px;height:6px;animation:.15s ease-out 50ms forwards ph-survey-radio-reveal;top:5px;left:5px;transform:scale(0)}.multiple-choice-options input[type=checkbox]:checked:after,.multiple-choice-options input[type=radio]:checked:after{content:"";box-sizing:content-box;position:absolute}.multiple-choice-options input[type=radio]{border-radius:50%}.multiple-choice-options input[type=radio]:checked{border:none}:is(.multiple-choice-options input[type=checkbox]:checked,.multiple-choice-options input[type=radio]:checked)~*{font-weight:700}.multiple-choice-options .choice-option-open input[type=text]::placeholder{color:var(--ph-survey-text-subtle-color);font-weight:400}.rating-options-emoji{justify-content:space-between;display:flex}.rating-options-emoji-2{justify-content:space-around}.ratings-emoji{opacity:.5;background-color:#0000;border:none;padding:0;font-size:16px}.ratings-emoji:hover{cursor:pointer;opacity:1;transform:scale(1.15)}.ratings-emoji.rating-active{opacity:1}.ratings-emoji svg{fill:var(--ph-survey-text-primary-color);transition:fill .2s ease-out}.rating-options-number{border-radius:6px;grid-auto-columns:1fr;grid-auto-flow:column;display:grid;overflow:hidden}.rating-options-number .ratings-number{border-right:1px solid var(--ph-survey-border-color);text-align:center;cursor:pointer;color:var(--ph-survey-rating-text-color);border-top:none;border-bottom:none;border-left:none;font-weight:700}.rating-options-number .ratings-number:last-of-type{border-right:0}.rating-options-number .ratings-number.rating-active{background:var(--ph-survey-rating-active-bg-color);color:var(--ph-survey-rating-active-text-color)}.ratings-number{background-color:var(--ph-survey-rating-bg-color);border:none;padding:8px 0}.ratings-number .rating-active{background-color:var(--ph-survey-rating-active-bg-color)}.ratings-number{cursor:pointer}@media (hover:hover) and (pointer:fine){.ratings-number:hover:not(.rating-active){background-color:color-mix(in srgb, var(--ph-survey-rating-active-bg-color) 14%, var(--ph-survey-rating-bg-color))}}.rating-text{opacity:.7;flex-direction:row;justify-content:space-between;font-size:11px;display:flex}.form-buttons{flex-direction:row;gap:8px;width:100%;display:flex}.form-buttons-with-back>.form-submit{flex:auto;min-width:0}.form-submit{text-align:center;cursor:pointer;user-select:none;background:var(--ph-survey-submit-button-color);color:var(--ph-survey-submit-button-text-color);border:none;border-radius:6px;min-width:100%;padding:12px;font-weight:700;box-shadow:0 2px #0000000b}.form-submit:not([disabled]):hover{transform:scale(1.02);box-shadow:0 4px 8px #0000001a}.form-submit:not([disabled]):active{transform:scale(.98);box-shadow:0 1px 2px #0000000d}.form-submit[disabled]{opacity:var(--ph-survey-disabled-button-opacity);cursor:not-allowed}.form-back{text-align:center;cursor:pointer;user-select:none;color:var(--ph-survey-text-primary-color);border:1.5px solid var(--ph-survey-border-color);background:0 0;border-radius:6px;flex:none;padding:12px 16px;font-weight:600}.form-back:hover{transform:scale(1.02)}.form-back:active{transform:scale(.98)}.validation-hint{opacity:.7;margin-top:4px;font-size:12px}.form-cancel{cursor:pointer;background:#fff;border-radius:100%;padding:12px;line-height:0;position:absolute;top:0;right:0;transform:translate(50%,-50%)}.form-cancel:hover{opacity:.7;transform:translate(50%,-50%)scale(1.1)}.footer-branding{opacity:.6;justify-content:center;align-items:center;gap:4px;font-size:11px;font-weight:500;text-decoration:none;display:flex}.footer-branding:hover{opacity:1}.footer-branding a{text-decoration:none}.thank-you-message{text-align:center}.thank-you-message-header{margin:10px 0 0}.thank-you-message-body{opacity:.8;font-size:14px}.intro-screen{text-align:center;animation:.3s ease-out forwards ph-survey-fade-in}.intro-screen-header{margin:10px 0 0}.intro-screen-body{opacity:.8;font-size:14px}.limit-height{scrollbar-width:thin;scrollbar-color:var(--ph-survey-scrollbar-thumb-color) var(--ph-survey-scrollbar-track-color);max-height:256px;overflow:hidden auto}.limit-height::-webkit-scrollbar{width:8px}.limit-height::-webkit-scrollbar-track{background:var(--ph-survey-scrollbar-track-color);border-radius:4px}.limit-height::-webkit-scrollbar-thumb{background-color:var(--ph-survey-scrollbar-thumb-color);border:2px solid var(--ph-survey-scrollbar-track-color);border-radius:4px}.limit-height::-webkit-scrollbar-thumb:hover{background-color:var(--ph-survey-text-subtle-color)}.sr-only{clip:rect(0, 0, 0, 0);white-space:nowrap;border:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}@media (prefers-reduced-motion:reduce){.ph-survey *{scroll-behavior:auto!important;transition-duration:.01ms!important;animation-duration:.01ms!important;animation-iteration-count:1!important}}@keyframes ph-survey-checkmark-reveal{0%{opacity:0;transform:rotate(45deg)scale(0)}50%{opacity:1;transform:rotate(45deg)scale(1.2)}to{opacity:1;transform:rotate(45deg)scale(1)}}@keyframes ph-survey-radio-reveal{0%{opacity:0;transform:scale(0)}50%{opacity:1;transform:scale(1.3)}to{opacity:1;transform:scale(1)}}',null==t?void 0:t.config.prepareStylesheet);return null==e||e.setAttribute("data-ph-survey-style","true"),e}(e);if(a){const t=s.querySelector("style");t&&s.removeChild(t),s.appendChild(a)}return(n||document.body).appendChild(o),{shadow:s,isNewlyCreated:!0}},Ff=t=>{try{const e=Vd(t);localStorage.getItem(e)||localStorage.setItem(e,"true")}catch(t){Hd.error("Failed to persist survey seen state",t)}},Pf=({responses:t,survey:e,surveySubmissionId:n,posthog:i,isSurveyCompleted:r,properties:o,surveyLanguage:s,questionSnapshots:a})=>{var l,u,c;i?(null===(l=i.client)||void 0===l?void 0:l.canCapture)&&(Ff(e),r&&tv(e),null===(u=i.client)||void 0===u||u.capture(qd,L(L(L({[Bd]:e.name,[jd]:e.id,[zd]:e.current_iteration,[Ud]:e.current_iteration_start_date,sessionRecordingUrl:Jc(i)},Oi(L(L({event:"sent",survey:e,responses:t,submissionId:n,completed:r},!G(s)&&{surveyLanguage:s}),!G(a)&&{questionSnapshots:a}))),o),{},{$set:{[Li(e,"responded")]:!0}})),r&&(window.dispatchEvent(new CustomEvent("PHSurveySent",{detail:{surveyId:e.id}})),null===(c=i.client)||void 0===c||null===(c=c.getExtension("featureFlagsCommon"))||void 0===c||c.reloadFeatureFlags())):Hd.error("[survey sent] event not captured, PostHog instance not found.")},Nf=(t,e,n,i)=>L({[Bd]:e.name,[jd]:e.id,[zd]:e.current_iteration,[Ud]:e.current_iteration_start_date,sessionRecordingUrl:Jc(i)},Oi(L(L(L(L({event:t,survey:e},!G(null==n?void 0:n.responses)&&{responses:n.responses}),!G(null==n?void 0:n.surveySubmissionId)&&{submissionId:n.surveySubmissionId}),!G(null==n?void 0:n.surveyLanguage)&&{surveyLanguage:n.surveyLanguage}),!G(null==n?void 0:n.questionSnapshots)&&{questionSnapshots:n.questionSnapshots}))),qf=(t,e,n,i)=>{var r;if(!e)return void Hd.error("[survey dismissed] event not captured, PostHog instance not found.");if(n)return;const o=Kf(t),s=o?o.surveyLanguage:i,a=L(L(L({},Nf("dismissed",t,o,e)),s&&{[Wd]:s}),{},{$set:{[Li(t,"dismissed")]:!0}});tv(t),Ff(t),null===(r=e.client)||void 0===r||r.capture(Nd,a),window.dispatchEvent(new CustomEvent("PHSurveyClosed",{detail:{surveyId:t.id}}))},jf=(t,e)=>{var n,i;if(!e)return void Hd.error("[survey abandoned] event not captured, PostHog instance not found.");if(!(null===(n=e.client)||void 0===n?void 0:n.canCapture))return;const r=(t=>Gd("abandonedSurvey_",t))(t);try{if("true"===localStorage.getItem(r))return}catch(t){return}const o=Kf(t);if(o){try{localStorage.setItem(r,"true")}catch(t){}null===(i=e.client)||void 0===i||i.capture("survey abandoned",Nf("abandoned",t,o,e),{delivery:"unload"})}},Bf=t=>{const e=t.map(t=>t.id);return e.every(t=>!!t)?e:void 0},zf=(t,e)=>{var n,i,r;return(t=>t.questions.some(t=>{var e;return!!(null===(e=t.branching)||void 0===e?void 0:e.type)}))(t)?t.questions:e?null!==(n=((t,e)=>{if(!e||e.length!==t.questions.length)return null;const n=new Map(t.questions.map(t=>[t.id,t])),i=[];for(const t of e){const e=n.get(t);if(!e)return null;i.push(e)}return i})(t,e.questionOrder))&&void 0!==n?n:t.questions:t.appearance&&t.appearance.shuffleQuestions&&!t.enable_partial_responses?(i=t.questions,r=Wi(t.questions),i.length===r.length&&i.every((t,e)=>t===r[e])?r.reverse():r):t.questions},Uf=t=>function(t){var e;return ji(t)&&!!(null===(e=t.conditions)||void 0===e||null===(e=e.events)||void 0===e?void 0:e.repeatedActivation)||"always"===t.schedule}(t)||Xf(t),Wf=function(t){function e(t){var n,i;return this.getChildContext||(n=new Set,(i={})[e.__c]=this,this.getChildContext=function(){return i},this.componentWillUnmount=function(){n=null},this.shouldComponentUpdate=function(t){this.props.value!=t.value&&n.forEach(function(t){t.__e=!0,Ec(t)})},this.sub=function(t){n.add(t);var e=t.componentWillUnmount;t.componentWillUnmount=function(){n&&n.delete(t),e&&e.call(t)}}),t.children}return e.__c="__cC"+gc++,e.__=t,e.Provider=e.__l=(e.Consumer=function(t,e){return t.children(e)}).contextType=e,e}({isPreviewMode:!1,previewPageIndex:0,onPopupSurveyDismissed(){},isPopup:!0,onPreviewSubmit(){},onPreviewBack(){},surveySubmissionId:"",properties:void 0,surveyLanguage:null}),Hf=()=>pd(Wf),Gf=({component:t,children:e,renderAsHtml:n,style:i})=>function(t,e,n){var i,r,o,s,a=Sc({},t.props);for(o in t.type&&t.type.defaultProps&&(s=t.type.defaultProps),e)"key"==o?i=e[o]:"ref"==o?r=e[o]:a[o]=void 0===e[o]&&null!=s?s[o]:e[o];return arguments.length>2&&(a.children=arguments.length>3?ic.call(arguments,2):n),Cc(t.type,a,i||t.key,r||t.ref,null)}(t,n?{dangerouslySetInnerHTML:{__html:If(e)},style:i}:{children:e,style:i});function Vf(t,e){var n,i,r;if(!(null===(n=t.conditions)||void 0===n?void 0:n.url))return!0;const o=null!==(i=ke(e))&&void 0!==i?i:"u">typeof window?window.location.href:void 0;if(!o)return!1;const s=[t.conditions.url],a=function(t){return null!=t?t:"icontains"}(null===(r=t.conditions)||void 0===r?void 0:r.urlMatchType);return Ui[a](s,[o])}function Qf(t){var e,n;return function(t,e){var n,i,r;if(!t||0===t.length)return!0;const o="u">typeof window?window:void 0,s="u">typeof globalThis?globalThis:o,a=null==s?void 0:s.navigator,l=null==a?void 0:a.userAgent;if(!l)return!1;const u=function(t,e){var n;const i=function(t){return wt.test(t)?ht:bt.test(t)?ft:yt.test(t)?vt:new RegExp(mt,"i").test(t)?mt:new RegExp("(Windows Phone|WPDesktop)","i").test(t)?"Windows Phone":/iPad/.test(t)?ct:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?dt:kt.test(t)?"BlackBerry":/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(pt,"i").test(t)?pt:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(t)||/(kf[a-z]+)( bui|\)).+silk\//i.test(t)?"Kindle Fire":/(Android|ZTE)/i.test(t)?new RegExp(at).test(t)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(t)||/pixel[\daxl ]{1,6}/i.test(t)&&!/pixel c/i.test(t)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(t)||/lmy47v/i.test(t)&&!/QTAQZ3/i.test(t)?"Android":ut:new RegExp("(pda|Mobile)","i").test(t)?"Generic mobile":new RegExp(lt,"i").test(t)&&!new RegExp("Tablet pc","i").test(t)?gt:""}(t);return i===ct||i===ut||"Kobo"===i||"Kindle Fire"===i||i===gt?lt:i===ht||i===vt||i===ft||i===mt?"Console":i===dt?"Wearable":i?at:"Android"===(null==e?void 0:e.userAgentDataPlatform)&&(null!==(n=null==e?void 0:e.maxTouchPoints)&&void 0!==n?n:0)>0?600>Math.min(null!==(r=null==e?void 0:e.screenWidth)&&void 0!==r?r:0,null!==(o=null==e?void 0:e.screenHeight)&&void 0!==o?o:0)/(null!==(s=null==e?void 0:e.devicePixelRatio)&&void 0!==s?s:1)?at:lt:"Desktop";var r,o,s}(l,{userAgentDataPlatform:null==a||null===(n=a.userAgentData)||void 0===n?void 0:n.platform,maxTouchPoints:null==a?void 0:a.maxTouchPoints,screenWidth:null==o||null===(i=o.screen)||void 0===i?void 0:i.width,screenHeight:null==o||null===(r=o.screen)||void 0===r?void 0:r.height,devicePixelRatio:null==o?void 0:o.devicePixelRatio});return Ui[null!=e?e:"icontains"](t,[u])}(null===(e=t.conditions)||void 0===e?void 0:e.deviceTypes,null===(n=t.conditions)||void 0===n?void 0:n.deviceTypesMatchType)}const Zf=t=>Gd("inProgressSurvey_",t),Jf={},Yf=(t,e)=>{const n=Zf(t);try{localStorage.setItem(n,JSON.stringify(e)),delete Jf[n]}catch(t){Hd.error("Error setting in-progress survey state in localStorage",t),Jf[n]=e}},Kf=t=>{const e=Zf(t),n=Jf[e];if(n)return n;try{const t=localStorage.getItem(e);if(t)return JSON.parse(t)}catch(t){Hd.error("Error getting in-progress survey state from localStorage",t)}return null},Xf=t=>{const e=Kf(t);return!J(null==e?void 0:e.surveySubmissionId)},tv=t=>{const e=Zf(t);delete Jf[e];try{localStorage.removeItem(e)}catch(t){Hd.error("Error clearing in-progress survey state from localStorage",t)}};function ev(t,e=!1){const n=`PostHogSurvey-${t.id}`;return e?`.${n}`:n}function nv(t,e=Md,n){if(t===Rd)return{};switch(e){case"top_left":return{top:"0",left:"0",transform:"translate(30px, 30px)"};case"top_right":return{top:"0",right:"0",transform:"translate(-30px, 30px)"};case"top_center":return{top:"0",left:"50%",transform:"translate(-50%, 30px)"};case"middle_left":return{top:"50%",left:"0",transform:"translate(30px, -50%)"};case"middle_right":return{top:"50%",right:"0",transform:"translate(-30px, -50%)"};case"middle_center":return{top:"50%",left:"50%",transform:"translate(-50%, -50%)"};case xd:return{left:"30px"};case Cd:return{left:"50%",transform:"translateX(-50%)"};default:return{right:t===Ad&&n===_d?"60px":"30px"}}}const iv=Qc("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Qc("path",{d:"M626-533q22.5 0 38.25-15.75T680-587q0-22.5-15.75-38.25T626-641q-22.5 0-38.25 15.75T572-587q0 22.5 15.75 38.25T626-533Zm-292 0q22.5 0 38.25-15.75T388-587q0-22.5-15.75-38.25T334-641q-22.5 0-38.25 15.75T280-587q0 22.5 15.75 38.25T334-533Zm146 272q66 0 121.5-35.5T682-393h-52q-23 40-63 61.5T480.5-310q-46.5 0-87-21T331-393h-53q26 61 81 96.5T480-261Zm0 181q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),rv=Qc("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Qc("path",{d:"M626-533q22.5 0 38.25-15.75T680-587q0-22.5-15.75-38.25T626-641q-22.5 0-38.25 15.75T572-587q0 22.5 15.75 38.25T626-533Zm-292 0q22.5 0 38.25-15.75T388-587q0-22.5-15.75-38.25T334-641q-22.5 0-38.25 15.75T280-587q0 22.5 15.75 38.25T334-533Zm20 194h253v-49H354v49ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),ov=Qc("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Qc("path",{d:"M626-533q22.5 0 38.25-15.75T680-587q0-22.5-15.75-38.25T626-641q-22.5 0-38.25 15.75T572-587q0 22.5 15.75 38.25T626-533Zm-292 0q22.5 0 38.25-15.75T388-587q0-22.5-15.75-38.25T334-641q-22.5 0-38.25 15.75T280-587q0 22.5 15.75 38.25T334-533Zm146.174 116Q413-417 358.5-379.5T278-280h53q22-42 62.173-65t87.5-23Q528-368 567.5-344.5T630-280h52q-25-63-79.826-100-54.826-37-122-37ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),sv=Qc("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Qc("path",{d:"M480-417q-67 0-121.5 37.5T278-280h404q-25-63-80-100t-122-37Zm-183-72 50-45 45 45 31-36-45-45 45-45-31-36-45 45-50-45-31 36 45 45-45 45 31 36Zm272 0 44-45 51 45 31-36-45-45 45-45-31-36-51 45-44-45-31 36 44 45-44 45 31 36ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142 0 241-99t99-241q0-142-99-241t-241-99q-142 0-241 99t-99 241q0 142 99 241t241 99Z"})}),av=Qc("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Qc("path",{d:"M479.504-261Q537-261 585.5-287q48.5-26 78.5-72.4 6-11.6-.75-22.6-6.75-11-20.25-11H316.918Q303-393 296.5-382t-.5 22.6q30 46.4 78.5 72.4 48.5 26 105.004 26ZM347-578l27 27q7.636 8 17.818 8Q402-543 410-551q8-8 8-18t-8-18l-42-42q-8.8-9-20.9-9-12.1 0-21.1 9l-42 42q-8 7.636-8 17.818Q276-559 284-551q8 8 18 8t18-8l27-27Zm267 0 27 27q7.714 8 18 8t18-8q8-7.636 8-17.818Q685-579 677-587l-42-42q-8.8-9-20.9-9-12.1 0-21.1 9l-42 42q-8 7.714-8 18t8 18q7.636 8 17.818 8Q579-543 587-551l27-27ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),lv=Qc("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:Qc("path",{d:"M2 20h2c.55 0 1-.45 1-1v-9c0-.55-.45-1-1-1H2v11zm19.83-7.12c.11-.25.17-.52.17-.8V11c0-1.1-.9-2-2-2h-5.5l.92-4.65c.05-.22.02-.46-.08-.66-.23-.45-.52-.86-.88-1.22L14 2 7.59 8.41C7.21 8.79 7 9.3 7 9.83v7.84C7 18.95 8.05 20 9.34 20h8.11c.7 0 1.36-.37 1.72-.97l2.66-6.15z"})}),uv=Qc("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:Qc("path",{d:"M22 4h-2c-.55 0-1 .45-1 1v9c0 .55.45 1 1 1h2V4zM2.17 11.12c-.11.25-.17.52-.17.8V13c0 1.1.9 2 2 2h5.5l-.92 4.65c-.05.22-.02.46.08.66.23.45.52.86.88 1.22L10 22l6.41-6.41c.38-.38.59-.89.59-1.42V6.34C17 5.05 15.95 4 14.66 4H6.55c-.7 0-1.36.37-1.72.97l-2.66 6.15z"})}),cv=({fill:t="currentColor"}={})=>Qc("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:t,xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"close-survey-title-adam",children:[Qc("title",{id:"close-survey-title",className:"adam-testing",children:"Close survey"}),Qc("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0.164752 0.164752C0.384422 -0.0549175 0.740578 -0.0549175 0.960248 0.164752L6 5.20451L11.0398 0.164752C11.2594 -0.0549175 11.6156 -0.0549175 11.8352 0.164752C12.0549 0.384422 12.0549 0.740578 11.8352 0.960248L6.79549 6L11.8352 11.0398C12.0549 11.2594 12.0549 11.6156 11.8352 11.8352C11.6156 12.0549 11.2594 12.0549 11.0398 11.8352L6 6.79549L0.960248 11.8352C0.740578 12.0549 0.384422 12.0549 0.164752 11.8352C-0.0549175 11.6156 -0.0549175 11.2594 0.164752 11.0398L5.20451 6L0.164752 0.960248C-0.0549175 0.740578 -0.0549175 0.384422 0.164752 0.164752Z",fill:t})]}),dv=Qc("svg",{width:"80",height:"14",viewBox:"0 0 160 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Qc("g",{"clip-path":"url(#ph-survey-logo-clip)",style:"opacity: calc(1 - var(--ph-logo-mono, 0))",children:[Qc("path",{fill:"currentColor",d:"M51.66 25.22A1.9 1.9 0 0 0 50 23.33l-.34-.04c-1-.13-1.94-.6-2.65-1.33L33.28 7.75V28H49a2.66 2.66 0 0 0 2.67-2.67zM39.2 23.54h-.09a1.78 1.78 0 1 1 .1 0"}),Qc("path",{fill:"url(#ph-survey-logo-paint0)",d:"M21.96 2.67v4.96l11.3 11.6h.02V7.75L26.63.85a2.8 2.8 0 0 0-2-.85 2.67 2.67 0 0 0-2.67 2.67"}),Qc("path",{fill:"url(#ph-survey-logo-paint1)",d:"M21.96 7.63v11.05L31.03 28h2.25v-8.75z"}),Qc("path",{fill:"url(#ph-survey-logo-paint2)",d:"M21.96 28h9.07l-9.07-9.32z"}),Qc("path",{fill:"url(#ph-survey-logo-paint3)",d:"M10.74 2.66v4.5l11.22 11.52V7.63L15.3.8a2.66 2.66 0 0 0-4.56 1.86"}),Qc("path",{fill:"url(#ph-survey-logo-paint4)",d:"M10.74 28h8.96l-8.96-9.32z"}),Qc("path",{fill:"url(#ph-survey-logo-paint5)",d:"M10.74 7.16v11.52L19.7 28h2.26v-9.32z"}),Qc("path",{fill:"url(#ph-survey-logo-paint6)",d:"M10.74 7.16 4.54.8A2.66 2.66 0 0 0 0 2.66V7.5l10.74 11.18z"}),Qc("path",{fill:"url(#ph-survey-logo-paint7)",d:"M9.19 28h1.55v-9.32L0 7.5v10.73z"}),Qc("path",{fill:"url(#ph-survey-logo-paint8)",d:"M0 25.41A2.6 2.6 0 0 0 2.58 28H9.2L0 18.23z"})]}),Qc("path",{"clip-path":"url(#ph-survey-logo-clip)",fill:"currentColor",style:"opacity: var(--ph-logo-mono, 0)",d:"m50.02 23.34-.34-.04c-1-.13-1.95-.6-2.66-1.33L35.58 10.11a.5.5 0 0 0-.86.35V27.5c0 .28.22.5.5.5H49c1.48 0 2.67-1.2 2.67-2.67v-.1a1.9 1.9 0 0 0-1.66-1.9m-10.81.2a1.78 1.78 0 1 1 0-3.56 1.78 1.78 0 0 1 0 3.57M0 25.41A2.6 2.6 0 0 0 2.59 28h5.22a.5.5 0 0 0 .37-.84L.87 19.13a.5.5 0 0 0-.87.34zm18.81 1.74a.5.5 0 0 1-.36.85h-7.09a.5.5 0 0 1-.37-.17L8.94 25.5.13 15.82A.5.5 0 0 1 0 15.5V8.75a.5.5 0 0 1 .86-.34zM0 2.68C0 .28 2.92-.91 4.59.82l25.6 26.33a.5.5 0 0 1-.36.85h-7.76a.5.5 0 0 1-.37-.17l-2.1-2.33L.28 5.3A1 1 0 0 1 0 4.6zm10.74 0c0-2.4 2.92-3.59 4.59-1.87L32.5 18.48l.5.51v7.3a.5.5 0 0 1-.86.35l-1.12-1.14L11.3 5.23a2 2 0 0 1-.57-1.4zM33 7.46v7.8a.5.5 0 0 1-.85.36l-9.61-9.89a2 2 0 0 1-.57-1.4V2.69c0-2.4 2.92-3.59 4.59-1.86z"}),Qc("path",{fill:"currentColor",d:"M64.9 22.88c-.67 0-1.23-.56-1.23-1.24V5.24c0-.69.56-1.24 1.24-1.24h6.55c3.89 0 6.39 2.32 6.39 5.9 0 3.6-2.5 5.91-6.4 5.91h-3.53v5.83c0 .68-.56 1.24-1.24 1.24zm3.02-11.94c0 .68.55 1.23 1.23 1.23h1.88c1.6 0 2.58-.86 2.58-2.26s-.97-2.27-2.58-2.27h-1.88c-.68 0-1.23.55-1.23 1.23zM84.71 23.1c-4.18 0-7.14-2.97-7.14-7.02s2.96-7.01 7.14-7.01c4.14 0 7.14 2.97 7.14 7.01 0 4.05-3 7.01-7.14 7.01m-3.22-7.02c0 2.16 1.3 3.64 3.22 3.64 1.9 0 3.2-1.48 3.2-3.64s-1.3-3.64-3.2-3.64c-1.93 0-3.22 1.48-3.22 3.64m16.34 7.03a6.2 6.2 0 0 1-5.54-3.01c-.34-.57-.01-1.26.6-1.5l.77-.3c.7-.27 1.45.15 1.92.73a2.8 2.8 0 0 0 2.25 1.08c1.05 0 1.75-.51 1.75-1.27 0-2.13-7.17-.7-7.17-5.85 0-2.13 1.85-3.91 4.83-3.91 2.27 0 4.2.9 5.17 2.31.36.53.05 1.2-.54 1.44l-.85.35c-.68.29-1.45-.14-2-.63a2.5 2.5 0 0 0-1.64-.64c-.89 0-1.5.38-1.5.97 0 2.16 7.27.38 7.27 5.88 0 2.35-2.15 4.34-5.32 4.34m14.64-1.31c.04.57-.3 1.1-.86 1.2q-.6.1-1.27.11c-2.92 0-5.15-1.56-5.15-4.85v-5.66h-.91c-.69 0-1.24-.56-1.24-1.24v-.82c0-.68.55-1.23 1.24-1.23h.91v-2.7c0-.69.55-1.24 1.23-1.24h1.48c.68 0 1.24.55 1.24 1.23v2.7h2.04c.68 0 1.23.56 1.23 1.24v.82c0 .68-.55 1.24-1.23 1.24h-2.04v5.15c0 1.2.64 1.91 1.6 1.91.75 0 1.6.5 1.66 1.25zM125.5 5.23c0-.68.55-1.23 1.23-1.23h1.8c.68 0 1.23.55 1.23 1.23v16.41c0 .68-.55 1.24-1.23 1.24h-1.8c-.68 0-1.23-.56-1.23-1.24v-5.43c0-.68-.56-1.23-1.24-1.23h-5c-.67 0-1.23.55-1.23 1.23v5.43c0 .68-.55 1.24-1.23 1.24h-1.77c-.69 0-1.24-.56-1.24-1.24V5.24c0-.69.55-1.24 1.24-1.24h1.77c.68 0 1.23.55 1.23 1.23v4.87c0 .68.56 1.23 1.24 1.23h5c.67 0 1.23-.55 1.23-1.23zm12.87 17.87c-4.19 0-7.14-2.97-7.14-7.02s2.95-7.01 7.14-7.01c4.13 0 7.14 2.97 7.14 7.01 0 4.05-3 7.01-7.14 7.01m-3.22-7.02c0 2.16 1.29 3.64 3.22 3.64 1.9 0 3.2-1.48 3.2-3.64s-1.3-3.64-3.2-3.64c-1.93 0-3.22 1.48-3.22 3.64m17.17 6.37c-3.84 0-6.2-2.58-6.2-6.68s2.36-6.69 6.12-6.69c1.58 0 2.82.54 3.54 1.37 0-.64.52-1.15 1.16-1.15h1.5c.68 0 1.24.55 1.24 1.23V21.9c0 3.64-2.77 6.09-6.93 6.09-2.64 0-4.9-1.2-5.85-3.09-.31-.62.16-1.29.85-1.4l1.14-.17c.67-.11 1.29.4 1.78.85.5.46 1.26.7 2.08.7 1.85 0 3.06-1.04 3.06-2.55v-1.3c-.7.9-2.01 1.4-3.49 1.4m-2.36-6.68c0 2.02 1.18 3.31 3 3.31 1.86 0 3.04-1.29 3.04-3.31s-1.18-3.32-3.03-3.32c-1.83 0-3.01 1.3-3.01 3.32"}),Qc("defs",{children:[Qc("linearGradient",{id:"ph-survey-logo-paint0",x1:"21.96",x2:"33.28",y1:"9.62",y2:"9.62",gradientUnits:"userSpaceOnUse",children:[Qc("stop",{"stop-color":"#ffd849"}),Qc("stop",{offset:".96","stop-color":"#fbae01"})]}),Qc("linearGradient",{id:"ph-survey-logo-paint1",x1:"21.96",x2:"33.28",y1:"17.81",y2:"17.81",gradientUnits:"userSpaceOnUse",children:[Qc("stop",{"stop-color":"#ffb700"}),Qc("stop",{offset:"1","stop-color":"#f9aa01"})]}),Qc("linearGradient",{id:"ph-survey-logo-paint2",x1:"21.96",x2:"31.03",y1:"23.34",y2:"23.34",gradientUnits:"userSpaceOnUse",children:[Qc("stop",{"stop-color":"#ff9500"}),Qc("stop",{offset:"1","stop-color":"#f8aa00"})]}),Qc("linearGradient",{id:"ph-survey-logo-paint3",x1:"10.74",x2:"21.96",y1:"9.34",y2:"9.34",gradientUnits:"userSpaceOnUse",children:[Qc("stop",{"stop-color":"#ff651e"}),Qc("stop",{offset:"1","stop-color":"#e4400a"})]}),Qc("linearGradient",{id:"ph-survey-logo-paint4",x1:"10.74",x2:"19.7",y1:"23.34",y2:"23.34",gradientUnits:"userSpaceOnUse",children:[Qc("stop",{"stop-color":"#c42c00"}),Qc("stop",{offset:"1","stop-color":"#d63600"})]}),Qc("linearGradient",{id:"ph-survey-logo-paint5",x1:"10.74",x2:"21.96",y1:"17.58",y2:"17.58",gradientUnits:"userSpaceOnUse",children:[Qc("stop",{"stop-color":"#ef3c00"}),Qc("stop",{offset:"1","stop-color":"#d63601"})]}),Qc("linearGradient",{id:"ph-survey-logo-paint6",x1:"0",x2:"10.74",y1:"9.34",y2:"9.34",gradientUnits:"userSpaceOnUse",children:[Qc("stop",{"stop-color":"#3f80ff"}),Qc("stop",{offset:"1","stop-color":"#084fe0"})]}),Qc("linearGradient",{id:"ph-survey-logo-paint7",x1:"0",x2:"10.74",y1:"17.75",y2:"17.75",gradientUnits:"userSpaceOnUse",children:[Qc("stop",{"stop-color":"#0255ff"}),Qc("stop",{offset:"1","stop-color":"#0145d2"})]}),Qc("linearGradient",{id:"ph-survey-logo-paint8",x1:"0",x2:"9.19",y1:"23.11",y2:"23.11",gradientUnits:"userSpaceOnUse",children:[Qc("stop",{"stop-color":"#0041c6"}),Qc("stop",{offset:"1","stop-color":"#0045d0"})]}),Qc("clipPath",{id:"ph-survey-logo-clip",children:Qc("path",{fill:"#fff",d:"M0 0h51.67v28H0z"})})]})]});function hv({urlParams:t}){const e=t?Object.entries(t).map(([t,e])=>`${encodeURIComponent(t)}=${encodeURIComponent(e)}`).join("&"):"";return Qc("a",{href:"https://posthog.com/surveys"+(e?`?${e}`:""),target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",dv]})}function fv({text:t,submitDisabled:e,appearance:n,onSubmit:i,link:r,onPreviewSubmit:o,skipSubmitButton:s,canGoBack:a,onBack:l}){const{isPreviewMode:u}=pd(Wf),c=!!a&&!!l,d=!s&&Qc("button",{className:"form-submit",disabled:e,type:"button",onClick(){var t;r&&(null===(t=window)||void 0===t||t.open(r)),u?null==o||o():i()},children:t});return Qc("div",{className:"bottom-section",children:[c?Qc("div",{className:"form-buttons form-buttons-with-back",children:[Qc("button",{className:"form-back",type:"button","aria-label":"Go to previous question",onClick:l,children:n.backButtonText||"Back"}),d]}):d,!n.whiteLabel&&Qc(hv,{urlParams:{utm_source:"survey-footer"}})]})}function vv({question:t,forceDisableHtml:e,htmlFor:n}){return Qc("div",{class:t.question||t.description?"question-header":"question-header question-header--empty",children:[Qc(t.type===Ed?"label":"h3",{className:"survey-question",htmlFor:n,children:t.question}),t.description&&Gf({component:xc("p",{className:"survey-question-description"}),children:t.description,renderAsHtml:!e&&"text"!==t.descriptionContentType})]})}function pv({onClick:t}){const{isPreviewMode:e}=pd(Wf);return Qc("button",{className:"form-cancel",onClick:t,disabled:e,"aria-label":"Close survey",type:"button",children:cv({fill:"black"})})}function mv({header:t,description:e,contentType:n,forceDisableHtml:i,appearance:r,onClose:o}){const{isPopup:s}=pd(Wf);return hd(()=>{const t=t=>{"Enter"!==t.key&&"Escape"!==t.key||(t.preventDefault(),o())};return me(window,"keydown",t),()=>{window.removeEventListener("keydown",t)}},[o]),Qc("div",{className:"thank-you-message",role:"status",tabIndex:0,"aria-atomic":"true",children:[s&&!0!==r.hideCancelButton&&Qc(pv,{onClick:()=>o()}),Qc("h3",{className:"thank-you-message-header",children:t}),e&&Gf({component:xc("p",{className:"thank-you-message-body"}),children:e,renderAsHtml:!i&&"text"!==n}),s&&Qc(fv,{text:r.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:r,onSubmit:()=>o()})]})}function gv({header:t,description:e,contentType:n,forceDisableHtml:i,appearance:r,onStart:o}){const{isPopup:s,onPreviewSubmit:a,onPopupSurveyDismissed:l}=pd(Wf);return Qc("div",{className:"intro-screen",role:"status",tabIndex:0,"aria-atomic":"true",children:[s&&!0!==r.hideCancelButton&&Qc(pv,{onClick:()=>l()}),t&&Qc("h3",{className:"intro-screen-header",children:t}),e&&Gf({component:xc("p",{className:"intro-screen-body"}),children:e,renderAsHtml:!i&&"text"!==n}),Qc(fv,{text:r.introScreenButtonText||"Get started",submitDisabled:!1,appearance:r,onSubmit:o,onPreviewSubmit:()=>a(null)})]})}const yv=t=>U(t)&&t.every(t=>V(t));function bv({question:t,forceDisableHtml:e,appearance:n,onSubmit:i,onPreviewSubmit:r,displayQuestionIndex:o,initialValue:s,canGoBack:a,onBack:l}){const{isPreviewMode:u}=Hf(),c=fd(null),[d,h]=dd(()=>V(s)?s:""),f=null==n?void 0:n.disableAutofocus;hd(()=>{f||setTimeout(()=>{var t;u||null===(t=c.current)||void 0===t||t.focus()},100)},[u,f]);const v=`surveyQuestion${o}`,p=vd(()=>function(t,e,n){const i=t.trim();if(!n&&""===i)return"This field is required";if(""===i)return!1;if(e&&e.length>0)for(const t of e)switch(t.type){case F:var r;if(void 0!==t.value&&t.value>i.length)return null!==(r=t.errorMessage)&&void 0!==r?r:`Please enter at least ${t.value} characters`;break;case P:var o;if(void 0!==t.value&&i.length>t.value)return null!==(o=t.errorMessage)&&void 0!==o?o:`Please enter no more than ${t.value} characters`}return!1}(d,t.validation,t.optional),[d,t.validation,t.optional]),m=ae(t.validation,F),g=ae(t.validation,P),y=vd(()=>function(t,e){const n=1===t?void 0:t;return n&&e?`Enter ${n}-${e} characters`:n?`Enter at least ${n} ${1===n?"character":"characters"}`:e?`Maximum ${e} ${1===e?"character":"characters"}`:void 0}(m,g),[m,g]),b=()=>{p||i(d.trim())},w=()=>{p||r(d.trim())};return Qc(Mc,{children:[Qc("div",{className:"question-container",children:[Qc(vv,{question:t,forceDisableHtml:e,htmlFor:v}),Qc("textarea",{ref:c,id:v,rows:4,placeholder:null==n?void 0:n.placeholder,minLength:m,maxLength:g,onInput(t){h(t.currentTarget.value),t.stopPropagation()},onKeyDown(t){t.stopPropagation(),"Enter"!==t.key||!t.metaKey&&!t.ctrlKey||p||(t.preventDefault(),u?w():b())},value:d}),y&&Qc("div",{className:"validation-hint",children:y})]}),Qc(fv,{text:t.buttonText||"Submit",submitDisabled:!!p,appearance:n,onSubmit:b,onPreviewSubmit:w,canGoBack:a,onBack:l})]})}function wv({question:t,forceDisableHtml:e,appearance:n,onSubmit:i,onPreviewSubmit:r,canGoBack:o,onBack:s}){return Qc(Mc,{children:[Qc("div",{className:"question-container",children:Qc(vv,{question:t,forceDisableHtml:e})}),Qc(fv,{text:t.buttonText||"Submit",submitDisabled:!1,link:t.link,appearance:n,onSubmit:()=>i("link clicked"),onPreviewSubmit:()=>r("link clicked"),canGoBack:o,onBack:s})]})}function kv({question:t,forceDisableHtml:e,displayQuestionIndex:n,appearance:i,onSubmit:r,onPreviewSubmit:o,initialValue:s,canGoBack:a,onBack:l}){var u;const c=t.scale,d=10===t.scale?0:1,[h,f]=dd(()=>Y(s)?s:U(s)&&s.length>0&&Y(parseInt(s[0]))?parseInt(s[0]):V(s)&&Y(parseInt(s))?parseInt(s):null),v="emoji"===t.display&&2===t.scale,{isPreviewMode:p}=Hf(),m=t=>p?o(t):r(t);return Qc(Mc,{children:[Qc("div",{className:"question-container",children:[Qc(vv,{question:t,forceDisableHtml:e}),Qc("div",{className:"rating-section",children:[Qc("div",{className:"rating-options",children:["emoji"===t.display&&Qc("div",{className:"rating-options-emoji"+(v?" rating-options-emoji-2":""),children:null===(u=Tv[t.scale])||void 0===u?void 0:u.map((e,i)=>Qc("button",{"aria-label":`Rate ${i+1}`,className:`ratings-emoji question-${n}-rating-${i} ${i+1===h?"rating-active":""}`,value:i+1,type:"button",onClick(){const e=i+1;f(e),t.skipSubmitButton&&m(e)},children:e},i))}),"number"===t.display&&Qc("div",{className:"rating-options-number",style:{gridTemplateColumns:`repeat(${c-d+1}, minmax(0, 1fr))`},children:Iv(t.scale).map((e,r)=>Qc(Sv,{displayQuestionIndex:n,active:h===e,appearance:i,num:e,setActiveNumber(e){f(e),t.skipSubmitButton&&m(e)}},r))})]}),!v&&Qc("div",{className:"rating-text",children:[Qc("div",{children:t.lowerBoundLabel}),Qc("div",{children:t.upperBoundLabel})]})]})]}),Qc(fv,{text:t.buttonText||(null==i?void 0:i.submitButtonText)||"Submit",submitDisabled:Z(h)&&!t.optional,appearance:i,onSubmit:()=>r(h),onPreviewSubmit:()=>o(h),skipSubmitButton:t.skipSubmitButton,canGoBack:a,onBack:l})]})}function Sv({num:t,active:e,displayQuestionIndex:n,setActiveNumber:i}){return Qc("button",{"aria-label":`Rate ${t}`,className:`ratings-number question-${n}-rating-${t} ${e?"rating-active":""}`,type:"button",onClick(){i(t)},children:t})}function _v({question:t,forceDisableHtml:e,displayQuestionIndex:n,appearance:i,onSubmit:r,onPreviewSubmit:o,initialValue:s,canGoBack:a,onBack:l}){const u=fd(null),c=vd(()=>(t=>{var e;if(!t.shuffleOptions)return t.choices;const n=[...t.choices],i=t.hasOpenChoice&&null!==(e=n.pop())&&void 0!==e?e:null,r=(o=n,(s=Wi(n)).length>1&&o.every((t,e)=>t===s[e])?s.reverse():s);var o,s;return Z(i)||r.push(i),r})(t),[t]),[d,h]=dd(()=>((t,e)=>V(t)||yv(t)?t:e===$d?null:[])(s,t.type)),[f,v]=dd(()=>((t,e)=>{if(V(t)&&!e.includes(t))return{isSelected:!0,inputValue:t};if(yv(t)){const n=t.find(t=>!e.includes(t));if(n)return{isSelected:!0,inputValue:n}}return{isSelected:!1,inputValue:""}})(s,c)),{isPreviewMode:p}=Hf(),m=t.type===$d,g=t.type===Od,y=t.skipSubmitButton&&m&&!t.hasOpenChoice,b=(t,e)=>{if(e){const t=!f.isSelected;return v(e=>L(L({},e),{},{isSelected:t,inputValue:t?e.inputValue:""})),m&&h(""),void(t&&setTimeout(()=>{var t;return null===(t=u.current)||void 0===t?void 0:t.focus()},75))}if(m)return h(t),v(t=>L(L({},t),{},{isSelected:!1,inputValue:""})),void(y&&(r(t),p&&o(t)));g&&U(d)&&(d.includes(t)?h(d.filter(e=>e!==t)):h([...d,t]))},w=t=>{t.stopPropagation();const e=t.currentTarget.value;v(t=>L(L({},t),{},{inputValue:e})),m&&h(e)},k=t=>{t.stopPropagation(),"Enter"!==t.key||S()||(t.preventDefault(),_()),"Escape"===t.key&&(t.preventDefault(),v(t=>L(L({},t),{},{isSelected:!1,inputValue:""})),m&&h(null))},S=()=>!(t.optional||!Z(d)&&(!U(d)||f.isSelected||0!==d.length)&&(!f.isSelected||""!==f.inputValue.trim())),_=()=>{f.isSelected&&g?U(d)&&(p?o([...d,f.inputValue]):r([...d,f.inputValue])):p?o(d):r(d)};return Qc(Mc,{children:[Qc("div",{className:"question-container",children:[Qc(vv,{question:t,forceDisableHtml:e}),Qc("fieldset",{className:"multiple-choice-options limit-height",children:[Qc("legend",{className:"sr-only",children:g?" Select all that apply":" Select one"}),c.map((e,i)=>{const r=!!t.hasOpenChoice&&i===t.choices.length-1,o=`surveyQuestion${n}Choice${i}`,s=`${o}Open`,a=r?f.isSelected:m?d===e:U(d)&&d.includes(e);return Qc("label",{className:r?"choice-option-open":"",children:[Qc("div",{className:"response-choice",children:[Qc("input",{type:m?"radio":"checkbox",name:o,checked:a,onChange:()=>b(e,r),id:o,"aria-controls":s}),Qc("span",{children:r?`${e}:`:e})]}),r&&Qc("input",{type:"text",ref:u,id:s,name:`question${n}Open`,value:f.inputValue,onKeyDown:k,onInput:w,onClick(t){f.isSelected||b(e,!0),t.stopPropagation()},"aria-label":`${e} - please specify`})]},i)})]})]}),Qc(fv,{text:t.buttonText||"Submit",submitDisabled:S(),appearance:i,onSubmit:_,onPreviewSubmit:_,skipSubmitButton:y,canGoBack:a,onBack:l})]})}const xv=[1,2,3,4,5],Cv=[1,2,3,4,5,6,7],Mv=[0,1,2,3,4,5,6,7,8,9,10],Tv={2:[lv,uv],3:[ov,rv,iv],5:[sv,ov,rv,iv,av]};function Iv(t){switch(t){case 5:default:return xv;case 7:return Cv;case 10:return Mv}}const Av=he("[Surveys]");function Rv(t,e,n){var i;const r=t.questions[e],o=e+1;if(!(null===(i=r.branching)||void 0===i?void 0:i.type))return e===t.questions.length-1?Dd:o;if(r.branching.type===Dd)return Dd;if("specific_question"===r.branching.type){if(Number.isInteger(r.branching.index))return r.branching.index}else if("response_based"===r.branching.type){if(r.type===$d){var s;let t=r.choices.indexOf(`${n}`);if(-1===t&&r.hasOpenChoice&&(t=r.choices.length-1),null===(s=r.branching)||void 0===s||null===(s=s.responseValues)||void 0===s?void 0:s.hasOwnProperty(t)){const e=r.branching.responseValues[t];if(Number.isInteger(e))return e;if(e===Dd)return Dd}}else if(r.type===Ld){var a;if(r.optional&&J(n))return o===t.questions.length?Dd:o;if("number"!=typeof n||!Number.isInteger(n))throw new Error("The response type must be an integer");const e=function(t,e){if(2===e){if(1>t||t>2)throw new Error("The response must be in range 1-2");return 1===t?"positive":"negative"}if(3===e){if(1>t||t>3)throw new Error("The response must be in range 1-3");return 1===t?"negative":2===t?"neutral":"positive"}if(5===e){if(1>t||t>5)throw new Error("The response must be in range 1-5");return t>2?3===t?"neutral":"positive":"negative"}if(7===e){if(1>t||t>7)throw new Error("The response must be in range 1-7");return t>3?4===t?"neutral":"positive":"negative"}if(10===e){if(0>t||t>10)throw new Error("The response must be in range 0-10");return t>6?t>8?"promoters":"passives":"detractors"}throw new Error("The scale must be one of: 2, 3, 5, 7, 10")}(n,r.scale);if(null===(a=r.branching)||void 0===a||null===(a=a.responseValues)||void 0===a?void 0:a.hasOwnProperty(e)){const t=r.branching.responseValues[e];if(Number.isInteger(t))return t;if(t===Dd)return Dd}}return o}return Av.warn("Falling back to next question index due to unexpected branching type"),o}const Ev=he("[SurveyTranslations]");function Ov(t,e){const n=function(t){var e;return function({overrideLanguage:t,storedPersonProperties:e,locale:n},i){const r=Di(t);if(r)return null==i||i.info(`Using override display language: ${r}`),r;const o=function(t){return t&&"object"==typeof t&&"language"in t?Di(t.language):null}(e);if(o)return null==i||i.info(`Using person property language: ${o}`),o;const s=Di(n);return s?(null==i||i.info(`Using detected locale: ${s}`),s):(null==i||i.info("No user language detected"),null)}({overrideLanguage:t.config.overrideLanguage,storedPersonProperties:null===(e=t.client)||void 0===e?void 0:e.kv.get(s),locale:"u">typeof navigator?navigator.language||navigator.userLanguage:void 0},Ev)}(e);if(!n)return Ev.info("No user language detected"),{survey:t,language:null};const i=qi(t,n,Ev);return{survey:i.survey,language:i.matchedKey}}const $v="ph:show_survey_widget",Lv="PHWidgetSurveyClickListener";function Dv(t,e){try{const n=t.getBoundingClientRect(),i=window.innerHeight,r=window.innerWidth;let o=n.left+n.width/2-e/2;o+e>r-20&&(o=r-e-20),20>o&&(o=20);const s=i-n.bottom,a=250>s&&n.top>s;return{position:"fixed",top:a?"auto":`${n.bottom+12}px`,left:`${o}px`,right:"auto",bottom:a?i-n.top+12+"px":"auto",zIndex:Ef.zIndex}}catch(t){return Hd.warn("Failed to calculate trigger position:",t),null}}var Fv=class{constructor(t){var e,n;this.Li=new Map,this.Di=new Map,this.Fi=new Map,this.Pi=new Map,this.Ni=new Set,this.qi=!1,this.ji=null,this.Bi=!1,this.zi=null,this.Ui=null,this.Wi=null,this.Hi=!1,this.handlePageUnload=()=>{var t;const e=null===(t=this.Gi.client)||void 0===t?void 0:t.kv.get(a);if(e)for(const t of e)Xf(t)&&jf(t,this.Gi)},this.handlePopoverSurvey=(t,e,{resumeDelayFromActivation:n=!1}={})=>{var i,r,o,s,a,l,u;if(!(null===(i=this.Gi.client)||void 0===i?void 0:i.canCapture))return;const{survey:c,language:d}=this.Vi(t);this.ji=d,this.Wi=null,this.Qi=e;const h=this.Zi(c,e);this.Ji(h.id);const{properties:f,initialResponses:v}=null!=e?e:{},p=!(!v||0>=Object.keys(v).length)&&this.Yi(h,v,f,d);if(p&&!(null===(r=h.appearance)||void 0===r?void 0:r.displayThankYouMessage))return;this.Ki(h);let m={};if((null===(o=h.appearance)||void 0===o?void 0:o.position)===Td&&(null===(s=h.appearance)||void 0===s?void 0:s.widgetSelector)){var g;const t=document.querySelector(h.appearance.widgetSelector);t&&(m=Dv(t,parseInt((null===(g=h.appearance)||void 0===g?void 0:g.maxWidth)||Ef.maxWidth))||{})}const y=(null===(a=h.appearance)||void 0===a?void 0:a.surveyPopupDelaySeconds)||0,{shadow:b}=Df(h,this.Gi);this.Pi.set(b,b.host);const w={posthog:this.Gi,survey:h,removeSurveyFromFocus:this.Xi,properties:f,style:m,isSurveyCompleted:p,skipShownEvent:null==e?void 0:e.skipShownEvent,surveyLanguage:d};if(this.Wi=w,0>=y)return this.Bi=!0,Gc(Qc(jv,L({},w)),b);const k=()=>{this.Bi=!0;const{survey:n,language:i}=this.Vi(t);this.ji=i;const r=this.Zi(n,e),o=L(L({},w),{},{survey:r,surveyLanguage:i});this.Wi=o,Gc(Qc(jv,L(L({},o),{},{survey:L(L({},r),{},{appearance:L(L({},r.appearance),{},{surveyPopupDelaySeconds:0})})})),b)},S=()=>{var t;if(!(null===(t=this.Gi.client)||void 0===t?void 0:t.canCapture)||!this.er(h))return Hd.info(`Survey ${h.id} no longer eligible when its display delay elapsed; not displaying`),this.Xi(h);k()},_=n?null===(l=this.Gi.surveys)||void 0===l||null===(l=l._surveyEventReceiver)||void 0===l||null===(u=l.getActivationTimestamp)||void 0===u?void 0:u.call(l,h.id):void 0,x=Y(_)?Math.max(0,Date.now()-_):0,C=Math.max(0,1e3*y-x);if(0>=C)return S();const M=window.setTimeout(()=>{this.Li.delete(h.id),S()},C);this.Li.set(h.id,M)},this.nr=t=>{var e;const{survey:n,language:i}=this.Vi(t),{shadow:r,isNewlyCreated:o}=Df(n,this.Gi);this.Pi.set(r,r.host),(null===(e=t.appearance)||void 0===e?void 0:e.widgetType)===_d&&this.Fi.set(t.id,t),o&&Gc(Qc(zv,{posthog:this.Gi,survey:n,surveyLanguage:i},t.id),r)},this.ir=t=>{const e=this.Di.get(t);e&&(e.element.removeEventListener("click",e.listener),e.element.removeAttribute(Lv),this.Di.delete(t),Hd.info(`Removed click listener for survey ${t}`))},this.rr=t=>{this.sr(t)||(this.ar(t),this.ir(t.id))},this.lr=t=>{this.sr(t)||(this.ar(t),this.Fi.delete(t.id))},this.sr=t=>{try{var e;const n=document.querySelector(ev(t,!0));return!!(null==n||null===(e=n.shadowRoot)||void 0===e?void 0:e.querySelector(".ph-survey"))}catch(t){return!1}},this.ur=(t,e)=>{const n=document.querySelector(e),i=this.Di.get(t.id);if(n){if(this.nr(t),i){if(n===i.element)return;Hd.info(`Selector element changed for survey ${t.id}. Re-attaching listener.`),this.ir(t.id)}if(!n.hasAttribute(Lv)){const e=e=>{var n,i;e.stopPropagation();const r=(null===(n=t.appearance)||void 0===n?void 0:n.position)===Td?Dv(e.currentTarget,parseInt((null===(i=t.appearance)||void 0===i?void 0:i.maxWidth)||Ef.maxWidth)):{};window.dispatchEvent(new CustomEvent($v,{detail:{surveyId:t.id,position:r}}))};me(n,"click",e),n.setAttribute(Lv,"true"),this.Di.set(t.id,{element:n,listener:e,survey:t}),Hd.info(`Attached click listener for feedback button survey ${t.id}`)}}else i&&this.rr(t)},this.renderPopover=t=>{var e;if(!(null===(e=this.Gi.client)||void 0===e?void 0:e.canCapture))return;const{survey:n,language:i}=this.Vi(t),{shadow:r}=Df(n,this.Gi);this.Pi.set(r,r.host),Gc(Qc(jv,{posthog:this.Gi,survey:n,removeSurveyFromFocus:this.Xi,surveyLanguage:i}),r)},this.renderSurvey=(t,e,n)=>{var i;if(!(null===(i=this.Gi.client)||void 0===i?void 0:i.canCapture))return;const{survey:r,language:o}=this.Vi(t);let s=!1;this.Gi.config.prefillFromUrl&&(s=this.cr(r,o,n)),Gc(Qc(jv,{posthog:this.Gi,survey:r,removeSurveyFromFocus:this.Xi,isPopup:!1,properties:n,isSurveyCompleted:s,surveyLanguage:o}),e)},this.getActiveMatchingSurveys=(t,e=!1)=>{var n;null===(n=this.Gi.surveys)||void 0===n||n.getSurveys(e=>{t(e.filter(t=>this.er(t)))},e)},this.callSurveysAndEvaluateDisplayLogic=(t=!1)=>{this.getActiveMatchingSurveys(t=>{var e;const n=null===(e=this.Gi.client)||void 0===e?void 0:e.canCapture,i=t.filter(t=>n&&(t.type===Id||t.type===Ad)),r=new Set(i.map(t=>t.id));for(const t of Array.from(this.Li.keys()))r.has(t)||this.cancelSurvey(t);const o=this.dr(i),s=new Set,a=new Set;o.forEach(t=>{if(t.type===Ad){var e,n,i,r;if((null===(e=t.appearance)||void 0===e?void 0:e.widgetType)===_d)return a.add(t.id),void this.nr(t);"selector"===(null===(n=t.appearance)||void 0===n?void 0:n.widgetType)&&(null===(i=t.appearance)||void 0===i?void 0:i.widgetSelector)&&(s.add(t.id),this.ur(t,null===(r=t.appearance)||void 0===r?void 0:r.widgetSelector))}Z(this.vr)&&t.type===Id&&this.handlePopoverSurvey(t,void 0,{resumeDelayFromActivation:!0})}),this.Di.forEach(({survey:t})=>{s.has(t.id)||this.rr(t)}),this.Fi.forEach((t,e)=>{a.has(e)||this.lr(t)})},t)},this.Ki=t=>{Z(this.vr)||Hd.error(`Survey ${this.vr} already in focus. Cannot add survey ${t.id}.`),this.vr=t.id},this.Xi=t=>{this.vr!==t.id&&Hd.error(`Survey ${t.id} is not in focus. Cannot remove survey ${t.id}.`),this.Ji(t.id),this.vr=null,this.ji=null,this.Bi=!1,this.Wi=null,this.Qi=void 0,this.ar(t)},this.Gi=t,this.vr=null,this.zi=()=>this.pr(),me(window,"languagechange",this.zi),this.Ui=null!==(e=null===(n=t.client)||void 0===n||null===(n=n.getExtension("featureFlagsCommon"))||void 0===n?void 0:n.onFeatureFlags(()=>this.pr()))&&void 0!==e?e:null}pr(){var t;if(Z(this.vr))return;const e=null===(t=this.Gi.client)||void 0===t?void 0:t.kv.get(a),n=null==e?void 0:e.find(t=>t.id===this.vr);if(!n)return;const{survey:i,language:r}=this.Vi(n);if(r===this.ji)return;if(this.ji=r,!this.Bi)return;const o=this.Zi(i,this.Qi),{shadow:s}=Df(o,this.Gi);Gc(Qc(jv,L(L({},this.Wi),{},{posthog:this.Gi,survey:o,removeSurveyFromFocus:this.Xi,surveyLanguage:r})),s)}Zi(t,e){return(null==e?void 0:e.position)||(null==e?void 0:e.selector)?L(L({},t),{},{appearance:L(L(L({},t.appearance),e.position&&{position:e.position}),e.selector&&{widgetSelector:e.selector})}):t}Ji(t){const e=this.Li.get(t);e&&(clearTimeout(e),this.Li.delete(t))}cancelSurvey(t){this.Li.has(t)&&(Hd.info(`Cancelled pending survey ${t}`),this.Ji(t),this.vr===t&&(this.vr=null,this.ji=null,this.Bi=!1,this.Wi=null,this.Qi=void 0))}startAutomaticDisplay(){if(this.qi||this.mr||!1===this.Gi.config.automaticDisplay)return;this.mr=()=>{};const t=function(t){let e;t.callSurveysAndEvaluateDisplayLogic(!0);const n=()=>{G(e)&&(e=setInterval(()=>{t.callSurveysAndEvaluateDisplayLogic(!1)},1e3))},i=()=>{G(e)||(clearInterval(e),e=void 0)};n();const r=()=>{document.hidden?i():(t.callSurveysAndEvaluateDisplayLogic(!1),n())};return me(document,"visibilitychange",r),()=>{i(),document.removeEventListener("visibilitychange",r)}}(this);this.qi?t():this.mr=t}clearInMemoryInProgressSurveyState(){(()=>{for(const t of Object.keys(Jf))delete Jf[t]})()}dispose(){var t;this.qi=!0,null===(t=this.mr)||void 0===t||t.call(this),this.mr=void 0,this.zi&&(window.removeEventListener("languagechange",this.zi),this.zi=null),this.Ui&&(this.Ui(),this.Ui=null),this.Li.forEach((t,e)=>this.Ji(e)),this.Di.forEach((t,e)=>this.ir(e)),this.Pi.forEach((t,e)=>{Gc(null,e),null==t||t.remove()}),this.Pi.clear(),this.Fi.clear(),this.vr=null}dr(t){return t.sort((t,e)=>{var n,i;const r=Xf(t),o=Xf(e);if(r&&!o)return-1;if(!r&&o)return 1;const s=t.schedule===Fd,a=e.schedule===Fd;return s&&!a?1:!s&&a?-1:((null===(n=t.appearance)||void 0===n?void 0:n.surveyPopupDelaySeconds)||0)-((null===(i=e.appearance)||void 0===i?void 0:i.surveyPopupDelaySeconds)||0)})}Vi(t){return Ov(t,this.Gi)}cr(t,e,n){if(this.Ni.has(t.id))return!1;const{params:i}=function(){const t={};let e=!1;const n=window.location.search.replace(/^\?/,"");if(!n)return{params:t,autoSubmit:e};const i=n.split("&");for(const n of i){const i=n.indexOf("=");if(0>=i)continue;let r,o;try{r=decodeURIComponent(n.slice(0,i)),o=decodeURIComponent(n.slice(i+1))}catch(t){continue}if("auto_submit"===r&&"true"===o){e=!0;continue}const s=r.match(/^q(\d+)$/);if(s){const e=parseInt(s[1],10);t[e]||(t[e]=[]),t[e].push(o)}}return{params:t,autoSubmit:e}}();if(0===Object.keys(i).length)return!1;Hd.info("[Survey Prefill] Detected URL prefill parameters");const r=this.gr(t,i,e);return!!r&&(this.yr(t,r,n,e),this.Ni.add(t.id),r.isSurveyCompleted)}yr(t,e,n,i){const{responses:r,submissionId:o,isSurveyCompleted:s,skippedResponses:a}=e;(Object.keys(a).length>0&&t.enable_partial_responses||s)&&Pf({responses:s?r:a,survey:t,surveySubmissionId:o,posthog:this.Gi,isSurveyCompleted:s,properties:n,surveyLanguage:i})}Yi(t,e,n,i){const r={};for(const[t,n]of Object.entries(e))r[parseInt(t)]=U(n)?n.map(String):[String(n)];Hd.info("[Survey] Processing initial responses");const o=this.gr(t,r,i);return!!o&&(this.yr(t,o,n,i),o.isSurveyCompleted)}gr(t,e,n){try{const i=function(t,e){const n={};return t.questions.forEach((t,i)=>{if(!e[i]||!t.id)return;const r=e[i],o=Ri(t.id);try{switch(t.type){case $d:{if(!t.choices||0===t.choices.length)return void de.warn(`[Survey Prefill] Question ${i} has no choices`);const e=parseInt(r[0],10);if(isNaN(e)||0>e||e>=t.choices.length)return void de.warn(`[Survey Prefill] Invalid choice index for q${i}: ${r[0]}`);n[o]=t.choices[e];break}case Od:{if(!t.choices||0===t.choices.length)return void de.warn(`[Survey Prefill] Question ${i} has no choices`);const e=r.map(t=>parseInt(t,10)).filter(e=>!isNaN(e)&&e>=0&&t.choices.length>e);if(0===e.length)return void de.warn(`[Survey Prefill] No valid choices for q${i}`);const s=[...new Set(e.map(e=>t.choices[e]))];e.length>s.length&&de.warn(`[Survey Prefill] Removed duplicate choices for q${i}`),n[o]=s;break}case Ld:{const e=parseInt(r[0],10),s=t.scale||10,a=10===s?0:1;if(isNaN(e)||a>e||e>s)return void de.warn(`[Survey Prefill] Invalid rating for q${i}: ${r[0]} (scale: ${a}-${s})`);n[o]=e;break}default:de.info(`[Survey Prefill] Question type ${t.type} does not support prefill`)}}catch(t){de.error(`[Survey Prefill] Error converting q${i}:`,t)}}),n}(t,e);if(0===Object.keys(i).length)return Hd.warn("[Survey Prefill] No valid responses after conversion"),null;const r=_i(),{startQuestionIndex:o,skippedResponses:s,skippedIndices:a}=function(t,e,n){let i=0;const r={},o=[],s=t.questions.length+1;let a=0;for(;t.questions.length>i&&s>a&&(a++,e.includes(i));){const e=t.questions[i];if(!e||!("skipSubmitButton"in e)||!e.skipSubmitButton)break;if(e.id){const t=Ri(e.id);G(n[t])||(r[t]=n[t])}o.push(i);const s=Rv(t,i,e.id?n[Ri(e.id)]:null);if(s===Dd)return{startQuestionIndex:t.questions.length,skippedResponses:r,skippedIndices:o};i=s}return{startQuestionIndex:i,skippedResponses:r,skippedIndices:o}}(t,Object.keys(e).map(t=>parseInt(t,10)).filter(e=>{const n=t.questions[e];return(null==n?void 0:n.id)&&!G(i[Ri(n.id)])}),i),l=o>=t.questions.length;return Yf(t,{surveySubmissionId:r,responses:i,lastQuestionIndex:o,questionOrder:Bf(t.questions),visitedIndices:a,surveyLanguage:n}),Hd.info("[Survey Prefill] Stored prefilled responses in localStorage"),{responses:i,submissionId:r,startQuestionIndex:o,isSurveyCompleted:l,skippedResponses:s}}catch(t){return Hd.error("[Survey Prefill] Error handling prefill:",t),null}}br(t,e){var n;if(!t)return!0;const i=null===(n=this.Gi.client)||void 0===n?void 0:n.getExtension(Zc),r=!!(null==i?void 0:i.isFeatureEnabled(t,{send_event:!t.startsWith("survey-targeting-")}));let o=!0;e&&(o=(null==i?void 0:i.getFeatureFlag(t,{send_event:!1}))===e||"any"===e);const s=r&&o;return s||this.wr(t),s}wr(t){this.Hi||!1!==this.Gi.config.featureFlagEvaluation||(this.Hi=!0,Hd.warn(`Survey feature flag "${t}" evaluated to false because advanced_disable_feature_flags is set. PostHog creates an internal targeting flag for almost every survey, so no survey can display while flags are disabled. To keep surveys working, replace advanced_disable_feature_flags with advanced_only_evaluate_survey_feature_flags, which evaluates survey flags only.`))}kr(t){return!t.conditions||Vf(t,this.Gi)&&Qf(t)&&function(t){var e,n;return!(null===(e=t.conditions)||void 0===e?void 0:e.selector)||!!(null===(n=document)||void 0===n?void 0:n.querySelector(t.conditions.selector))}(t)}Sr(t){var e;return Uf(t)?{satisfied:!0}:t.internal_targeting_flag_key&&function(t){var e;return"recurring"===t.schedule||(null!==(e=t.current_iteration)&&void 0!==e?e:0)>0}(t)&&!(null===(e=this.Gi.client)||void 0===e||null===(e=e.getExtension("featureFlagsCommon"))||void 0===e?void 0:e.hasLoadedFlags)?(this.wr(t.internal_targeting_flag_key),{satisfied:!1,reason:"Feature flags have not loaded yet; deferring internal targeting flag check"}):{satisfied:this.br(t.internal_targeting_flag_key)}}checkSurveyEligibility(t){var e,n;const i={eligible:!0,reason:void 0};if(!function(t){return!(!t.start_date||t.end_date)}(t))return i.eligible=!1,i.reason=`Survey is not running. It was completed on ${t.end_date}`,i;if(!Qd.includes(t.type))return i.eligible=!1,i.reason=`Surveys of type ${t.type} are never eligible to be shown in the app`,i;const r=null===(e=t.conditions)||void 0===e?void 0:e.linkedFlagVariant;if(!this.br(t.linked_flag_key,r))return i.eligible=!1,i.reason=r?`Survey linked feature flag is not enabled for variant ${r}`:"Survey linked feature flag is not enabled",i;if(!this.br(t.targeting_flag_key))return i.eligible=!1,i.reason="Survey targeting feature flag is not enabled",i;const o=this.Sr(t);var s;return o.satisfied?(t=>{let e=null;try{e=localStorage.getItem("lastSeenSurveyDate")}catch(t){Hd.error("localStorage error: "+t)}return function(t,e){if(!t||!e)return!0;const n="string"==typeof e?new Date(e):e,i=Math.abs((new Date).getTime()-n.getTime());return Math.ceil(i/864e5)>t}(t,e)})(null===(n=t.conditions)||void 0===n?void 0:n.seenSurveyWaitPeriodInDays)?((t=>{let e=null;try{e=localStorage.getItem(Vd(t))}catch(t){Hd.error("localStorage error: "+t)}return!!e&&!Uf(t)})(t)&&(i.eligible=!1,i.reason="Survey has already been seen and it can't be activated again"),i):(i.eligible=!1,i.reason="Survey wait period has not passed",i):(i.eligible=!1,i.reason=null!==(s=o.reason)&&void 0!==s?s:"Survey internal targeting flag is not enabled and survey cannot activate repeatedly and survey is not in progress",i)}checkSurveyCaptureEligibility(){var t;return(null===(t=this.Gi.client)||void 0===t?void 0:t.canCapture)?{eligible:!0}:{eligible:!1,reason:"PostHog is not capturing, so a survey response cannot be recorded"}}checkSurveyDisplayEligibility(t){const e=this.checkSurveyCaptureEligibility();return e.eligible?this.checkSurveyEligibility(t):e}checkSurveyRenderability(t){const e=this.checkSurveyDisplayEligibility(t);return e.eligible&&!this._r(t)?{eligible:!1,reason:"Survey event/action trigger has not been fired yet"}:e}_r(t){var e;if(!ji(t)&&!function(t){var e;return!!(null===(e=t.conditions)||void 0===e||null===(e=e.actions)||void 0===e||null===(e=e.values)||void 0===e?void 0:e.length)}(t))return!0;const n=null===(e=this.Gi.surveys)||void 0===e||null===(e=e._surveyEventReceiver)||void 0===e?void 0:e.getSurveys();return!!(null==n?void 0:n.includes(t.id))}Cr(t){var e;return!(null===(e=t.feature_flag_keys)||void 0===e?void 0:e.length)||t.feature_flag_keys.every(({key:t,value:e})=>!t||!e||this.br(e))}er(t){return this.checkSurveyEligibility(t).eligible&&this.kr(t)&&this._r(t)&&this.Cr(t)}ar(t){try{const e=document.querySelector(ev(t,!0));(null==e?void 0:e.shadowRoot)&&(Gc(null,e.shadowRoot),this.Pi.delete(e.shadowRoot)),null==e||e.remove()}catch(e){Hd.warn(`Failed to remove survey ${t.id} from DOM:`,e)}}getTestAPI(){return{addSurveyToFocus:this.Ki,removeSurveyFromFocus:this.Xi,surveyInFocus:this.vr,surveyTimeouts:this.Li,handleWidget:this.nr,handlePopoverSurvey:this.handlePopoverSurvey,manageWidgetSelectorListener:this.ur,sortSurveysByAppearanceDelay:this.dr.bind(this),checkFlags:this.Cr.bind(this),isSurveyFeatureFlagEnabled:this.br.bind(this),onLanguageChange:this.pr.bind(this),currentLanguage:this.ji,surveyIsRendered:this.Bi}}};function Pv({survey:t,removeSurveyFromFocus:e=()=>{},setSurveyVisible:n,isPreviewMode:i=!1,posthog:r}){hd(()=>{var o;if(i||!(null===(o=t.conditions)||void 0===o?void 0:o.url))return;const s=()=>{var i;const o=t.type===Ad,s=Vf(t,r),a=(null===(i=t.appearance)||void 0===i?void 0:i.widgetType)===_d&&o;if(!s)return Hd.info(`Hiding survey ${t.id} because URL does not match`),n(!1),e(t);a&&(Hd.info(`Showing survey ${t.id} because it is a feedback button tab and URL matches`),n(!0))};me(window,"popstate",s),me(window,"hashchange",s);const a=window.history.pushState,l=window.history.replaceState;return window.history.pushState=function(...t){a.apply(this,t),s()},window.history.replaceState=function(...t){l.apply(this,t),s()},()=>{window.removeEventListener("popstate",s),window.removeEventListener("hashchange",s),window.history.pushState=a,window.history.replaceState=l}},[i,t,e,n,r])}const Nv=200;function qv(t="right"){switch(t){case"top":return{top:"0",left:"50%",transform:"translateX(-50%)"};case"left":return{top:"50%",left:"0",transform:"rotate(90deg) translateY(-100%)",transformOrigin:"left top"};case"bottom":return{bottom:"0",left:"50%",transform:"translateX(-50%)"};default:return{top:"50%",right:"0",transform:"rotate(-90deg) translateY(-100%)",transformOrigin:"right top"}}}function jv({survey:t,forceDisableHtml:e,posthog:n,style:i={},previewPageIndex:r,removeSurveyFromFocus:o=()=>{},isPopup:s=!0,onPreviewSubmit:a=()=>{},onPreviewBack:l=()=>{},onPopupSurveyDismissed:u=()=>{},onCloseConfirmationMessage:c=()=>{},properties:d,isSurveyCompleted:h,skipShownEvent:f,surveyLanguage:v}){var p,m,g,y,b,w,k,S,_,x,C,M;const T=fd(null),I=Number.isInteger(r),{isPopupVisible:A,isSurveySent:R,hidePopupWithAnimation:E}=function(t,e,n,i,r,o,s,a,l){const[u,c]=dd(i||0===n||t.type===Rd),[d,h]=dd(!1),f=fd(!1),v=()=>{const e=()=>{o&&r(t),c(!1)};if(f.current)return;const n=null==s?void 0:s.current;n?(f.current=!0,n.style.transition=`opacity ${Nv}ms ease-out`,n.style.opacity="0",setTimeout(()=>{f.current=!1,e()},250)):e()},p=e=>{e.detail.surveyId===t.id&&v()};return hd(()=>{if(!e)return void Hd.error("usePopupVisibility hook called without a PostHog instance.");if(i)return;let r;const o=e=>{var n,i;if(e.detail.surveyId===t.id){if(!(null===(n=t.appearance)||void 0===n?void 0:n.displayThankYouMessage))return v();h(!0),(null===(i=t.appearance)||void 0===i?void 0:i.autoDisappear)&&(r&&clearTimeout(r),r=setTimeout(v,5e3))}},s=()=>{var n;if(Vf(t,e)){c(!0);try{localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())}catch(t){}window.dispatchEvent(new Event("PHSurveyShown")),a||null===(n=e.client)||void 0===n||n.capture(Pd,L(L({[Bd]:t.name,[jd]:t.id,[zd]:t.current_iteration,[Ud]:t.current_iteration_start_date},l&&{[Wd]:l}),{},{sessionRecordingUrl:Jc(e)}))}};me(window,"PHSurveyClosed",p),me(window,"PHSurveySent",o);const u=n>0?setTimeout(s,n):void 0;return G(u)&&s(),()=>{G(u)||clearTimeout(u),G(r)||clearTimeout(r),window.removeEventListener("PHSurveyClosed",p),window.removeEventListener("PHSurveySent",o)}},[]),Pv({survey:t,removeSurveyFromFocus:r,setSurveyVisible:c,isPreviewMode:i,posthog:e}),{isPopupVisible:u,isSurveySent:d,setIsPopupVisible:c,hidePopupWithAnimation:v}}(t,n,(null===(p=t.appearance)||void 0===p?void 0:p.surveyPopupDelaySeconds)?1e3*t.appearance.surveyPopupDelaySeconds:0,I,o,s,T,f,v),O=R||r===t.questions.length||!0===h,[D,F]=dd(!1),P=vd(()=>!!Kf(t),[t]),N=!(!(null===(m=t.appearance)||void 0===m?void 0:m.introScreenHeader)&&!(null===(g=t.appearance)||void 0===g?void 0:g.introScreenDescription)),q=I?-1===r:!!(null===(y=t.appearance)||void 0===y?void 0:y.displayIntroScreen)&&N&&!D&&!P,j=vd(()=>{const e=Kf(t),i=(null==e?void 0:e.surveySubmissionId)||_i()||"";return{isPreviewMode:I,previewPageIndex:r,onPopupSurveyDismissed(){v?qf(t,n,I,v):qf(t,n,I),u()},isPopup:s||!1,surveySubmissionId:i,onPreviewSubmit:a,onPreviewBack:l,posthog:n,properties:d,surveyLanguage:v}},[I,r,s,n,t,u,a,l,d,v]);return A?Qc(Wf.Provider,{value:j,children:Qc("div",{className:"ph-survey",style:L(L({},nv(t.type,null===(b=t.appearance)||void 0===b?void 0:b.position,null===(w=t.appearance)||void 0===w?void 0:w.widgetType)),i),ref:T,children:O?Qc(mv,{header:(null===(k=t.appearance)||void 0===k?void 0:k.thankYouMessageHeader)||"Thank you!",description:(null===(S=t.appearance)||void 0===S?void 0:S.thankYouMessageDescription)||"",forceDisableHtml:!!e,contentType:null===(_=t.appearance)||void 0===_?void 0:_.thankYouMessageDescriptionContentType,appearance:t.appearance||Ef,onClose(){E(),c()}}):q?Qc(gv,{header:(null===(x=t.appearance)||void 0===x?void 0:x.introScreenHeader)||"",description:(null===(C=t.appearance)||void 0===C?void 0:C.introScreenDescription)||"",forceDisableHtml:!!e,contentType:null===(M=t.appearance)||void 0===M?void 0:M.introScreenDescriptionContentType,appearance:t.appearance||Ef,onStart:()=>F(!0)}):Qc(Bv,{survey:t,forceDisableHtml:!!e,posthog:n})})}):null}function Bv({survey:t,forceDisableHtml:e,posthog:n}){var i,r;const o=vd(()=>{const e=Kf(t);if(!e)return null;const n=Y(e.lastQuestionIndex);return!n||n&&e.lastQuestionIndex>=0&&t.questions.length>e.lastQuestionIndex?e:(tv(t),null)},[t]),[s,a]=dd(()=>((null==o?void 0:o.responses)&&Hd.info("Survey is already in progress, filling in initial responses"),(null==o?void 0:o.responses)||{})),[l,u]=dd(!1),{previewPageIndex:c,onPopupSurveyDismissed:d,isPopup:h,onPreviewSubmit:f,onPreviewBack:v,surveySubmissionId:p,isPreviewMode:m,properties:g,surveyLanguage:y}=pd(Wf),[b,w]=dd(()=>{const e=null==o?void 0:o.lastQuestionIndex,n=Y(e)&&e>=0&&t.questions.length>e?e:0;return Y(c)&&c>=0?c:n}),[k,S]=dd(()=>{var e;return(null!==(e=null==o?void 0:o.visitedIndices)&&void 0!==e?e:[]).filter(e=>e>=0&&t.questions.length>e)}),[_,x]=dd(()=>{var e;const n=Kf(t);return null!==(e=null==n?void 0:n.questionSnapshots)&&void 0!==e?e:{}}),C=vd(()=>Bf(zf(t,o)),[t.id,o]),M=vd(()=>{if(!C||new Set(C).size!==C.length)return zf(t,o);const e=new Map(t.questions.map(t=>[t.id,t])),n=C.map(t=>e.get(t)).filter(t=>!!t);return n.length===C.length?n:t.questions},[C,t.questions,t,o]);hd(()=>{!m||G(c)||0>c||w(c)},[c,m]);const T=!!(null===(i=t.appearance)||void 0===i?void 0:i.allowGoBack)&&(m?(null!=c?c:0)>0:k.length>0),I=M.at(b);return I?Qc("form",{className:"survey-form",name:"surveyForm",children:[h&&!0!==(null===(r=t.appearance)||void 0===r?void 0:r.hideCancelButton)&&Qc(pv,{onClick(){d()}}),Qc("div",{className:"survey-box","data-question-index":b,children:[l&&Qc("p",{role:"alert",children:"Your response could not be sent. Please try again later."}),Uv({question:I,forceDisableHtml:e,displayQuestionIndex:b,appearance:t.appearance||Ef,onSubmit:e=>(({res:e,displayQuestionIndex:i,questionId:r})=>{var o;if(!n)return void Hd.error("onNextButtonClick called without a PostHog instance.");if(!(null===(o=n.client)||void 0===o?void 0:o.canCapture))return void u(!0);if(u(!1),!r)return void Hd.error("onNextButtonClick called without a questionId.");const{responses:l,questionSnapshots:c}=function({responses:t,questionSnapshots:e={}},n,i,r){return{responses:L(L({},t),{},{[Ri(n)]:i}),questionSnapshots:(null==r?void 0:r.id)?L(L({},e),{},{[r.id]:r.question}):e}}({responses:s,questionSnapshots:_},r,e,M[i]);a(l),x(c);const d=Rv(t,i,e),h=d===Dd,f=[...k,i];if(h||(S(f),w(d),Yf(t,{surveySubmissionId:p,responses:l,lastQuestionIndex:d,questionOrder:Bf(M),visitedIndices:f,surveyLanguage:y,questionSnapshots:c})),t.enable_partial_responses||h){const e=new Set(f.map(t=>{var e;return null===(e=M[t])||void 0===e?void 0:e.id}).filter(t=>!!t).map(t=>Ri(t))),i=Object.fromEntries(Object.entries(l).filter(([t])=>e.has(t)));Pf({responses:i,survey:t,surveySubmissionId:p,isSurveyCompleted:h,posthog:n,properties:g,surveyLanguage:y,questionSnapshots:c})}})({res:e,displayQuestionIndex:b,questionId:I.id}),onPreviewSubmit:f,initialValue:I.id?s[Ri(I.id)]:void 0,canGoBack:T,onBack(){if(m)return void v();if(0===k.length)return;const e=k[k.length-1],n=k.slice(0,-1);S(n),w(e),Yf(t,{surveySubmissionId:p,responses:s,lastQuestionIndex:e,questionOrder:Bf(M),visitedIndices:n,surveyLanguage:y,questionSnapshots:_})}})]})]}):null}function zv({survey:t,forceDisableHtml:e,posthog:n,readOnly:i,surveyLanguage:r}){var o,s,a,l,u,c,d,h;const[f,v]=dd(!0),[p,m]=dd(!1),[g,y]=dd({}),b=fd(void 0),w=()=>{var t;(p||!n||i||(null===(t=n.client)||void 0===t?void 0:t.canCapture))&&m(!p)};if(hd(()=>{var e,r,o;if(!n)return void Hd.error("FeedbackWidget called without a PostHog instance.");if(i)return;"tab"===(null===(e=t.appearance)||void 0===e?void 0:e.widgetType)&&y((o=null===(r=t.appearance)||void 0===r?void 0:r.position)&&o!==Md&&o!==Td?{}:{top:"50%",bottom:"auto"});const s=e=>{var n;const i=e;(null===(n=i.detail)||void 0===n?void 0:n.surveyId)===t.id&&(Hd.info(`Received show event for feedback button survey ${t.id}`),y(i.detail.position||{}),w())};return me(window,$v,s),()=>{G(b.current)||(clearTimeout(b.current),b.current=void 0),window.removeEventListener($v,s)}},[n,i,t.id,null===(o=t.appearance)||void 0===o?void 0:o.widgetType,null===(s=t.appearance)||void 0===s?void 0:s.position,null===(a=t.appearance)||void 0===a?void 0:a.widgetSelector,null===(l=t.appearance)||void 0===l?void 0:l.borderColor]),Pv({survey:t,setSurveyVisible:v,posthog:n}),!f)return null;const k=()=>{t.schedule!==Fd&&v(!1),G(b.current)||clearTimeout(b.current),b.current=setTimeout(()=>{b.current=void 0,m(!1)},200)};return Qc(Mc,{children:["tab"===(null===(u=t.appearance)||void 0===u?void 0:u.widgetType)&&Qc("button",{className:"ph-survey-widget-tab "+("top"===(null===(c=t.appearance)||void 0===c?void 0:c.tabPosition)?"widget-tab-top":""),onClick:w,disabled:i,style:qv(null===(d=t.appearance)||void 0===d?void 0:d.tabPosition),children:(null===(h=t.appearance)||void 0===h?void 0:h.widgetLabel)||""}),p&&Qc(jv,{posthog:n,survey:t,forceDisableHtml:e,style:g,onPopupSurveyDismissed:k,onCloseConfirmationMessage:k,surveyLanguage:r})]})}const Uv=({question:t,forceDisableHtml:e,displayQuestionIndex:n,appearance:i,onSubmit:r,onPreviewSubmit:o,initialValue:s,canGoBack:a,onBack:l})=>{const u={forceDisableHtml:e,appearance:i,onPreviewSubmit(t){o(t)},onSubmit(t){r(t)},initialValue:s,displayQuestionIndex:n,canGoBack:a,onBack:l};switch(t.type){case Ed:return xc(bv,L(L({},u),{},{question:t,key:t.id}));case"link":return xc(wv,L(L({},u),{},{question:t,key:t.id}));case Ld:return xc(kv,L(L({},u),{},{question:t,key:t.id}));case $d:case Od:return xc(_v,L(L({},u),{},{question:t,key:t.id}));default:return Hd.error(`Unsupported question type: ${t.type}`),null}};function Wv(t){let e=!0;return{dispose(){if(e){e=!1;const n=t();n&&W(n.then)&&n.then(void 0,()=>{})}}}}function Hv(t,e){return e.length>t?e.slice(0,t)+"...":e}function Gv(t){if(t.previousElementSibling)return t.previousElementSibling;let e=t;do{e=e.previousSibling}while(e&&!Se(e));return e}function Vv(t,{e:e,maskAllElementAttributes:n,maskAllText:i,elementAttributeIgnoreList:r,elementsChainAsString:o,disableCaptureUrlHashes:s}){var a,l;if(!Se(t))return{props:{}};const u=[t],c=new Set([t]);let d=t;for(;!_e(d,"body")&&1e3>u.length;){const t=d.assignedSlot||d.parentNode,e=xe(t)?t.host:t&&Se(t)?t:null;if(!e||c.has(e))break;c.add(e),u.push(e),d=e}const h="click"===e.type&&"http://www.w3.org/2000/svg"===t.namespaceURI?u.findIndex(t=>_e(t,"button")||_e(t,"a")):-1;h>0&&(i=i||u.slice(0,h+1).some(t=>!Pe(t)||Ne(t)));const f=[],v={};let p,m=!1,g=!1;if(fe(u,t=>{const e=Pe(t);if(e&&_e(t,"a")&&!n&&!(null==r?void 0:r.includes("href"))){const n=t.getAttribute("href");m=!!(e&&n&&Ge(n))&&(s?St(n):n)}N(Me(t),"ph-no-capture")&&(g=!0),f.push(function(t,e,n,i,r=!1){const o=t.tagName.toLowerCase(),s={tag_name:o};Ae.indexOf(o)>-1&&!n&&(s.$el_text="a"===o.toLowerCase()||"button"===o.toLowerCase()?Hv(1024,Ve(t)):Hv(1024,Te(t)));const a=Me(t);e||(null==i?void 0:i.includes("class"))||0>=a.length||(s.classes=a.filter(function(t){return""!==t})),fe(Fe(t)?[]:t.attributes,function(n){var o;if((!Ne(t)||-1!==["name","id","class","aria-label"].indexOf(n.name))&&!(null==i?void 0:i.includes(n.name))&&!e&&Ge(n.value)&&(!V(o=n.name)||"_ngcontent"!==o.substring(0,10)&&"_nghost"!==o.substring(0,7))){let t=n.value;"class"===n.name&&(t=Ce(t).join(" ")),s["attr__"+n.name]=Hv(1024,"href"===n.name&&r?St(t):t)}});let l=1,u=1,c=t;for(;c=Gv(c);)l++,c.tagName===t.tagName&&u++;return s.nth_child=l,s.nth_of_type=u,s}(t,n,i,r,s)),fe(function(t){if(!Pe(t))return{};const e={};return fe(t.attributes,function(t){if(t.name&&0===t.name.indexOf("data-ph-capture-attribute")){const n=t.name.replace("data-ph-capture-attribute-",""),i=t.value;n&&i&&Ge(i)&&(e[n]=i)}}),e}(t),(t,e)=>{({}).hasOwnProperty.call(v,e)||(v[e]=t)})}),g)return{props:{},explicitNoCapture:g};if(h>0&&(t=u[h],f.splice(0,h)),i||(f[0].$el_text=_e(t,"a")||_e(t,"button")?Ve(t):Te(t)),m){var y,b;f[0].attr__href=m;const t=null===(y=ge(m))||void 0===y?void 0:y.host,e=null===(b=typeof window>"u"?void 0:window)||void 0===b||null===(b=b.location)||void 0===b?void 0:b.host;t&&e&&t!==e&&(p=m)}return{props:ve((k=e.type,{$event_type:k,$ce_version:1}),o?{}:{$elements:f},{$elements_chain:(w=f,U(w)?function(t){return t.map(t=>{var e,n;let i="";if(t.tag_name&&(i+=t.tag_name),t.attr_class){t.attr_class.sort();for(const e of t.attr_class)i+=`.${e.replace(/"/g,"")}`}const r=L(L(L(L({},t.text?{text:t.text}:{}),{},{"nth-child":null!==(e=t.nth_child)&&void 0!==e?e:0,"nth-of-type":null!==(n=t.nth_of_type)&&void 0!==n?n:0},t.href?{href:t.href}:{}),t.attr_id?{attr_id:t.attr_id}:{}),t.attributes),o={};return pe(r).sort(([t],[e])=>function(t,e){return e>t?-1:t>e?1:0}(t,e)).forEach(([t,e])=>o[Ze(t.toString())]=Ze(e.toString())),i+=":",i+=pe(o).map(([t,e])=>`${t}="${e}"`).join(""),i}).join(";")}(function(t){return t.map(t=>{var e,n;const i={text:null===(e=t.$el_text)||void 0===e?void 0:e.slice(0,400),tag_name:t.tag_name,href:null===(n=t.attr__href)||void 0===n?void 0:n.slice(0,2048),attr_class:Je(t),attr_id:t.attr__id,nth_child:t.nth_child,nth_of_type:t.nth_of_type,attributes:{}};return pe(t).filter(([t])=>0===t.indexOf("attr__")).forEach(([t,e])=>i.attributes[t]=e),i})}(w)):"")},(null===(a=f[0])||void 0===a?void 0:a.$el_text)?{$el_text:null===(l=f[0])||void 0===l?void 0:l.$el_text}:{},p&&"click"===e.type?{$external_click_url:p}:{},v),target:t};var w,k}const Qv="logs";A(function*(t){const e=yield oe(be(t.data),Ti.DEBUG,{rethrow:!0});if(!e)return t;const n=yield e.arrayBuffer();return L(L({},t),{},{Mr:{contentType:"text/plain",body:n,estimatedSize:n.byteLength}})});const Zv=()=>{var e;return(null==t||null===(e=t.performance)||void 0===e?void 0:e.now)?t.performance.now():Date.now()},Jv=[],Yv=[50,75,100,150,200,300,400,500,750,1e3,1500,2e3,3e3,5e3,1e4],Kv=[5,10,25,...Yv];var Xv=class{constructor(t){this._instance=t}initialize(){}get(t){const e=this._instance.persistence;if("string"==typeof t)return null==e?void 0:e.get_property(t);const n={};for(const i of t){const t=null==e?void 0:e.get_property(i);G(t)||(n[i]=t)}return n}set(t,e){var n;null===(n=this._instance.persistence)||void 0===n||n.register("string"==typeof t?{[t]:e}:t)}remove(t){var e;null===(e=this._instance.persistence)||void 0===e||e.unregister(t)}},tp=class{constructor(t){this.instance=t,this.R=de,this.kv=new Xv(t),this.onSession=t=>Wv(this.instance.onSessionId(e=>{try{t(e)}catch(t){this.R.error("Browser extension session listener failed",t)}})),this.onEvent=t=>Wv(this.instance._addCaptureHook((e,n)=>{if(n)try{t({event:e,properties:n.properties})}catch(t){this.R.error("Browser extension event listener failed",t)}})),this.onRemoteConfig=t=>{const e=e=>{try{t(e)}catch(t){this.R.error("Browser extension remote config listener failed",t)}},n=this.instance.Tr.on("extensionsRemoteConfig",e);return this.instance.Ir&&e(this.instance.Ir),Wv(n)}}get logger(){return this.R}get distinctId(){return this.instance.get_distinct_id()}get anonymousId(){var t;return null!==(t=this.instance.get_property("$device_id"))&&void 0!==t?t:this.distinctId}get deviceId(){const t=this.instance.get_property("$device_id");return"string"==typeof t?t:void 0}get library(){return{name:Ti.LIB_NAME,version:Ti.LIB_VERSION}}get initialPersonProperties(){var t,e;return null!==(t=null===(e=this.instance.persistence)||void 0===e?void 0:e.get_initial_props())&&void 0!==t?t:{}}get groups(){return this.instance.getGroups()}get session(){try{var t,e,n,i,r;const o=null===(t=this.instance.sessionManager)||void 0===t?void 0:t.checkAndGetSessionAndWindowId(!0);return{sessionId:null!==(e=null==o?void 0:o.sessionId)&&void 0!==e?e:"",windowId:null!==(n=null==o?void 0:o.windowId)&&void 0!==n?n:"",sessionStartTimestamp:null!==(i=null==o?void 0:o.sessionStartTimestamp)&&void 0!==i?i:0,lastActivityTimestamp:null!==(r=null==o?void 0:o.lastActivityTimestamp)&&void 0!==r?r:0}}catch(t){return{sessionId:"",windowId:"",sessionStartTimestamp:0,lastActivityTimestamp:0}}}get isOptedOut(){return this.instance.has_opted_out_capturing()}get canCapture(){return W(this.instance.is_capturing)?this.instance.is_capturing():!this.isOptedOut}get isRateLimited(){var t;return!!(null===(t=this.instance.rateLimiter)||void 0===t?void 0:t.isClientRateLimited)}get projectToken(){return this.instance.config.token}getExtension(t){let e;switch(t){case"featureFlags":case Zc:e=this.instance.featureFlags;break;case Qv:e=this.instance.logs;break;case"surveys":e=this.instance.surveys;break;case"autocapture":e=this.instance.autocapture}return e}capture(t,e,n){if(!n)return this.Ar(this.instance.capture(t,e));const i=L(L({timestamp:n.timestamp,uuid:n.uuid,$set:n.set,$set_once:n.setOnce},"unload"===n.delivery?{transport:"sendBeacon",send_instantly:!0}:{}),"immediate"===n.delivery?{send_instantly:!0}:{});return this.Ar(this.instance.capture(t,e,i))}Ar(t){var e;return!G(t)||!(null===(e=this.instance.rateLimiter)||void 0===e?void 0:e.lastEventRateLimited)}registerDynamicEventProperties(t){return Wv(this.instance.Rr(t))}sendRequest(e){var n=this;return A(function*(e,i={}){var r;const o=null!==(r=i.target)&&void 0!==r?r:"api",s=i.query?((t,e,n=!0)=>{const i=t.indexOf("#"),r=-1===i?"":t.slice(i),o=-1===i?t:t.slice(0,i),s=o.indexOf("?"),a=-1===s?o:o.slice(0,s),l=-1===s?"":o.slice(s+1),u=L({},e),c=l.split("&").filter(t=>""!==t).map(t=>{const e=t.indexOf("="),i=-1===e?t:t.slice(0,e),r=n?u[i]:void 0;return delete u[i],J(r)?t:`${i}=${r}`}),d=we(u);return d&&c.push(d),`${c.length>0?`${a}?${c.join("&")}`:a}${r}`})(e,i.query):e,a=n.instance.requestRouter.endpointFor(o,s),l={method:i.method,url:a,data:i.body,headers:i.headers,timeout:i.timeoutMs,fireCallbackOnDrop:!0,transport:i.transport,compression:i.compression,compressionFallback:"flags"===i.target&&"best-available"===i.compression?D.Base64:void 0,timestampMode:i.sentAt};return"api"===o&&"/i/v1/logs"===e&&(l.batchKey="logs"),"sendBeacon"===i.transport?(n.instance._send_request(l),{statusCode:202}):new Promise(e=>{var i;if(l.callback=e,"flags"===o&&(null===(i=n.instance.config.metrics)||void 0===i?void 0:i.flags)){let i,r;l.onDispatch=()=>{i=Zv()},l.onSend=e=>{r=(e=>{try{return(e=>{var n;const i=null==t?void 0:t.PerformanceObserver,r=null===(n=ge(e))||void 0===n?void 0:n.href;if(!i||!r)return;const o=Zv(),s={name:r,before:1/0,inFlight:!0};let a,l,u,c=1/0,d=!1;const h=()=>{d||(d=!0,clearTimeout(u),p.disconnect(),Jv.splice(Jv.indexOf(s),1))};let f=!1;const v=t=>{for(const e of t){const t=e.startTime;e.name!==r||(f?o>=t:o>t)||t>=s.before||a&&t>=a.startTime||(a=e)}if(a&&l&&c>=a.startTime){const t=l;h(),t(a)}},p=new i(t=>v(t.getEntriesByName(r,"resource")));p.observe({entryTypes:["resource"]});for(const t of Jv)t.name===r&&(t.before=Math.min(t.before,o),f=f||t.inFlight);return Jv.push(s),{take(t,e){d||(c=t,s.inFlight=!1,l=e,u=setTimeout(h,5e3),W(p.takeRecords)&&v(p.takeRecords()))},stop:h}})(e)}catch(t){return}})(e)},l.callback=t=>{if(e(t),G(i))return;const o=i,s=Zv();try{const e=((t,e)=>{var n,i;const r=e.statusCode||void 0,o={"server.address":(null!==(n=null===(i=ge(t))||void 0===i?void 0:i.hostname)&&void 0!==n?n:t).replace(/^\[(.*)\]$/,"$1")};r&&(o["http.response.status_code"]=r);const s=((t,e)=>t?400>t?void 0:String(t):"AbortError"===(null==e?void 0:e.name)?"timeout":"_OTHER")(r,e.error);s&&(o["error.type"]=s);const a=function(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(t){return}}();return a&&(o["client.timezone"]=a),o})(a,t);if(n.Er("posthog.flags.request.duration",s-o,Yv,e),t.statusCode&&r)return void r.take(s,t=>n.Or(t,o,s,e))}catch(t){de.error("Failed to record the /flags request timing",t)}null==r||r.stop()}}n.instance._send_request(l)})}).apply(this,arguments)}Or(t,e,n,i){if(t.responseEnd>=t.startTime)try{const r=Math.min(t.responseEnd,n);this.Er("posthog.flags.request.pre_send_duration",t.startTime-e,Kv,i),this.Er("posthog.flags.request.network_duration",r-t.startTime,Yv,i),this.Er("posthog.flags.request.main_thread_duration",n-r,Kv,i)}catch(t){de.error("Failed to record the /flags request timing split",t)}}Er(t,e,n,i){var r;null===(r=this.instance.metrics)||void 0===r||r.histogram(t,e,{unit:"ms",attributes:L({},i),bounds:n})}},ep=class{constructor(t){this._instance=t}get(){var t,e,n,i;const r=null===(t=this._instance)||void 0===t?void 0:t.config;return{disableSurveys:!!(null==r?void 0:r.disable_surveys),cookielessMode:!!(null==r?void 0:r.cookieless_mode),advancedEnableSurveys:!!(null==r?void 0:r.advanced_enable_surveys),requestTimeoutMs:null!==(e=null==r?void 0:r.surveys_request_timeout_ms)&&void 0!==e?e:1e4,prefillFromUrl:!!(null==r||null===(n=r.surveys)||void 0===n?void 0:n.prefillFromUrl),automaticDisplay:!(null==r?void 0:r.disable_surveys_automatic_display),featureFlagEvaluation:!(null==r?void 0:r.advanced_disable_feature_flags),overrideLanguage:null==r?void 0:r.override_display_language,prepareStylesheet:null==r?void 0:r.prepare_external_dependency_stylesheet,get_current_url:null==r?void 0:r.get_current_url,uiHost:null===(i=this._instance)||void 0===i||null===(i=i.requestRouter)||void 0===i?void 0:i.endpointFor("ui","")}}getExtensions(){const t=null==o?void 0:o.__PosthogExtensions__;if(!t||!this._instance)return;const e=this._instance,{generateSurveys:n}=t,i=(null==(r=e)?void 0:r.config.require_subresource_integrity)?r.__loadExternalDependency:null===(s=o.__PosthogExtensions__)||void 0===s?void 0:s.loadExternalDependency;var r,s;return{generateSurveys:n?t=>n(e,t):void 0,loadExternalDependency:i?t=>i(e,"surveys",t):void 0}}onMatchingConditionsChanged(e){var n,i;const r=null===(n=this._instance)||void 0===n?void 0:n._addCaptureHook(t=>{"$pageview"!==t&&t!==Pd&&t!==Nd&&t!==qd||e()}),o=()=>e();me(t,"PHSurveyShown",o);let s=!1;const a=null===(i=this._instance)||void 0===i?void 0:i.onFeatureFlags(()=>{s&&e()});return s=!0,()=>{s=!1,null==r||r(),null==a||a(),null==t||t.removeEventListener("PHSurveyShown",o)}}};const np=new WeakMap,ip=(t,e)=>{const n=function(t){var e;const n=new ep(t);if(!t)return{get config(){return n.get()}};if(null===(e=t.surveys)||void 0===e?void 0:e.getRenderContext)return t.surveys.getRenderContext();let i=np.get(t);return i||(i={client:new tp(t),get config(){return n.get()},surveys:t.surveys},np.set(t,i)),i}(t);return n?function(t,e){if(typeof document>"u"||typeof window>"u")return;const n=new Fv(t);return!1===t.config.automaticDisplay?(Hd.info("Surveys automatic display is disabled. Skipping call surveys and evaluate display logic."),n):!1===e?(Hd.info("There are no surveys to load or Surveys is disabled in the project settings."),n):(n.startAutomaticDisplay(),n)}(n,e):void 0};o.__PosthogExtensions__=o.__PosthogExtensions__||{},o.__PosthogExtensions__.generateSurveys=ip,o.extendPostHogWithSurveys=ip;const rp=t=>{for(;null==t?void 0:t.__rrweb_original__;)t=t.__rrweb_original__;return t},op=1e4,sp=(t,e,n)=>n.remaining>0?e.length>n.remaining?(t.push(e.slice(0,n.remaining)),n.remaining=0,n.truncated=!0,!1):(t.push(e),n.remaining-=e.length,!0):(n.truncated=!0,!1),ap=(t,e,n)=>{const i=JSON.stringify(t);if(n.remaining>=i.length)return sp(e,i,n);if(n.truncated=!0,2>n.remaining)return!1;let r=0,o=Math.min(t.length,n.remaining-2);for(;o>r;){const e=Math.ceil((r+o)/2);JSON.stringify(t.slice(0,e)).length>n.remaining?o=e-1:r=e}return sp(e,JSON.stringify(t.slice(0,r)),n)},lp=t=>void 0!==t&&"function"!=typeof t&&"symbol"!=typeof t&&"bigint"!=typeof t,up=(t,e,n)=>{if(!n.truncated){if(n.keysRemaining-=1,n.sizeRemaining-=String(e).length+t.length,0>=n.keysRemaining||0>=n.sizeRemaining)return n.truncated=!0,void(n.result.attributes_truncated=!0);n.result[t]=e}},cp=(t,e,n)=>{if(!n.truncated)if(H(t)){if(n.seen.has(t))return void up(e||"circular","[Circular]",n);n.seen.add(t);try{for(const i in t)try{if(!{}.hasOwnProperty.call(t,i))continue;if(cp(t[i],e?`${e}.${i}`:i,n),n.truncated)break}catch(t){continue}}catch(t){}}else up(e,t,n)},dp=(t,e,n,i,r=!1,o)=>{if(!lp(t))return!r||sp(e,"null",n);if(Z(t)||(t=>{try{return Y(t)||K(t)}catch(t){return!1}})(t))return sp(e,JSON.stringify(t),n);if("string"==typeof t)return ap(t,e,n);if(!H(t)&&!U(t))return sp(e,JSON.stringify(t),n);if(i.has(t))return ap("[Circular]",e,n);i.add(t);try{const o=t.toJSON;if(W(o))return dp(o.call(t),e,n,i,r)}catch(t){}try{const i={}.toString.call(t);if("[object String]"===i)return ap(String(t.valueOf()),e,n);if("[object Number]"===i||"[object Boolean]"===i)return sp(e,JSON.stringify(t.valueOf()),n)}catch(t){}if(t instanceof Error){const s={};try{for(const e in t)({}).hasOwnProperty.call(t,e)&&(s[e]=t[e])}catch(t){}try{s.name=t.name}catch(t){}try{s.message=t.message}catch(t){}try{s.stack=t.stack}catch(t){}return dp(s,e,n,i,r,o)}if(U(t)){if(!sp(e,"[",n))return!1;for(let r=0;t.length>r;r++){if(r>0&&!sp(e,",",n))return!1;let o;try{o=t[r]}catch(t){o=void 0}if(!dp(o,e,n,i,!0))return!1}return sp(e,"]",n)}if(!sp(e,"{",n))return!1;let s=!0;try{for(const r in t){if(!{}.hasOwnProperty.call(t,r))continue;if(0>=n.remaining)return n.truncated=!0,!1;let a;try{a=t[r]}catch(t){continue}if(o)try{cp(a,r,o)}catch(t){}if(!lp(a))continue;const l=`${s?"":","}${JSON.stringify(r)}:`;if(l.length>=n.remaining)return n.truncated=!0,!1;const u=e.length,c=n.remaining,d=n.truncated;if(!sp(e,l,n))return!1;const h=e.length,f=dp(a,e,n,i,!1),v=n.truncated;if(e.length!==h){if(s=!1,!f)return!1}else if(e.length=u,n.remaining=c,n.truncated=f?d:v,!f)return!1}}catch(t){}return sp(e,"}",n)},hp=(t,e)=>{const n=[],i={remaining:e,truncated:!1},r=H(t[0])?{result:{},keysRemaining:50,sizeRemaining:op,truncated:!1,seen:new WeakSet([t[0]])}:void 0;for(let e=0;t.length>e&&(0>=e||sp(n," ",i))&&dp(t[e],n,i,new WeakSet,!1,0===e?r:void 0);e++);return{body:n.join("")+(i.truncated?"...":""),truncated:i.truncated,attributes:(null==r?void 0:r.result)||{}}},fp={debug:"debug",log:"info",warn:"warn",error:"error",info:"info"},vp=t=>"canCapture"in t,pp=t=>({console:o.console,hostname:o.location.host,getCapturingLogs(){let e;return e=vp(t)?t.canCapture?t.getExtension(Qv):void 0:(W(t.is_capturing)?t.is_capturing():!t.has_opted_out_capturing())?t.logs:void 0,e?{captureConsoleLog:n=>((t,e,n)=>{if(vp(t))return void e.captureConsoleLog(n);const i=(t=>{const e=/^1\.(\d+)\.(\d+)$/.exec(t);if(!e)return;const n=Number(e[1]),i=Number(e[2]);return 392>n||n>419?void 0:410===n?i>4?i>10?void 0:"de":"le":418===n?i>3?i>10?i>14?i>17?void 0:"vi":"ci":"ui":"he":419===n?i>2?void 0:"vi":410>n?"le":"he"})(t.version),r=i?e[i]:void 0;i?W(r)&&r.call(e,n):W(e.captureConsoleLog)&&e.captureConsoleLog(n)})(t,e,n),captureBufferedConsoleLog(t,n,i){var r;return null===(r=e.captureBufferedConsoleLog)||void 0===r?void 0:r.call(e,t,n,i)}}:void 0}});o.__PosthogExtensions__=o.__PosthogExtensions__||{},o.__PosthogExtensions__.logs={initializeLogs:t=>(t=>{const e=t.console;let n=t;const i=[],r={host:t.hostname};let o=!1;const s=()=>{n=void 0;for(const t of i)try{t()}catch(t){}};try{for(const t of Object.keys(fp)){const s=i=>(...s)=>{let a=!1;try{if(s.length>0&&!o&&n){const e=n.getCapturingLogs();if(e){o=!0,a=!0;const{body:n,truncated:i,attributes:l}=hp(s,op),u=L(L({},r),i?{body_truncated:"true"}:{}),c={level:fp[t],body:n,attributes:L(L({"log.source":`console.${t}`},u),l)};e.captureConsoleLog(c)}}}catch(t){}finally{a&&(o=!1),i.apply(e,s)}},a=e[t];i.push(Mu(e,t,t=>{const e=s(t);return e.__rrweb_original__=rp(a),e}))}}catch(t){throw s(),t}return s})(pp(t)),replayConsoleBuffer:(t,e)=>((t,e)=>{const n=t.getCapturingLogs();if(n)for(const r of e)try{var i;const{body:e,truncated:o,attributes:s}=hp(r.args,op);null===(i=n.captureBufferedConsoleLog)||void 0===i||i.call(n,{level:fp[r.level],body:e,attributes:L(L({"log.source":`console.${r.level}`,host:t.hostname},o?{body_truncated:"true"}:{}),s)},r.context,r.occurredAtMs)}catch(t){}})(pp(t),e)};const mp=he("[ExceptionAutocapture]"),gp=new class{constructor(t,e,n=[]){this.coercers=t,this.stackParser=e,this.modifiers=n}buildFromUnknown(t,e={}){const n=e&&e.mechanism||{handled:!0,type:"generic"},i=this.buildCoercingContext(n,e,0).apply(t),r=this.buildParsingContext(e),o=this.parseStacktrace(i,r);return{$exception_list:this.convertToExceptionList(o,n),$exception_level:"error"}}modifyFrames(t){var e=this;return A(function*(){for(const n of t)n.stacktrace&&n.stacktrace.frames&&U(n.stacktrace.frames)&&(n.stacktrace.frames=yield e.applyModifiers(n.stacktrace.frames));return t})()}coerceFallback(t){var e;return{type:"Error",value:"Unknown error",stack:null===(e=t.syntheticException)||void 0===e?void 0:e.stack,synthetic:!0}}parseStacktrace(t,e){var n;let i,r;if(null!=t.cause&&(i=this.parseStacktrace(t.cause,e)),""!=t.stack&&null!=t.stack)try{r=this.applyChunkIds(this.stackParser(t.stack,t.synthetic?e.skipFirstLines:0),e.chunkIdMap)}catch(t){}return L(L({},t),{},{cause:i,stack:r,errors:null===(n=t.errors)||void 0===n?void 0:n.map(t=>this.parseStacktrace(t,e))})}applyChunkIds(t,e){return t.map(t=>(t.filename&&e&&(t.chunk_id=e[t.filename]),t))}applyCoercers(t,e){for(const n of this.coercers)if(n.match(t))return n.coerce(t,e);return this.coerceFallback(e)}applyModifiers(t){var e=this;return A(function*(){let n=t;for(const t of e.modifiers)n=yield t(n);return n})()}convertToExceptionList(t,e){const n=[],i=(t,r,o)=>{var s;const a=n.length,l=void 0===r?L(L({type:"string"==typeof e.type&&e.type.length>0?e.type:"generic"},"boolean"==typeof e.handled?{handled:e.handled}:void 0===e.handled?{handled:!0}:{}),{},{synthetic:"boolean"==typeof e.synthetic?e.synthetic:t.synthetic,exception_id:a}):{type:"chained",source:o,synthetic:t.synthetic,exception_id:a,parent_id:r},u={type:t.type,value:t.value,mechanism:l};t.stack&&(u.stacktrace={type:"raw",frames:t.stack}),n.push(u),t.cause&&i(t.cause,a,"cause");for(const e of null!==(s=t.errors)&&void 0!==s?s:[])i(e,a,"member")};return i(t),n}buildParsingContext(t){var e;return{chunkIdMap:It(this.stackParser),skipFirstLines:null!==(e=t.skipFirstLines)&&void 0!==e?e:1}}getAggregateErrors(t){try{if(nt(t)){let n=Object.getPrototypeOf(t);for(let i=0;n&&100>i;i++){var e;const i=null===(e=Object.getOwnPropertyDescriptor(n,"constructor"))||void 0===e?void 0:e.value;if("function"==typeof i&&"AggregateError"===i.name){const e=t.errors;return U(e)?e:void 0}n=Object.getPrototypeOf(n)}}}catch(t){}}buildCoercingContext(t,e,n=0){let i=0,r=0,o=!1;const s=new Set,a=[],l={},u=(t,e,n=0)=>{const u=c(e,n),d=u.apply;if(u.apply=e=>{a.push(t);try{return d(e)}finally{a.pop()}},n>4||n>0&&-1!==a.indexOf(t))return this.coerceFallback(u);const h="object"==typeof t&&null!==t||"function"==typeof t;if(0===n&&i>=50||h&&s.has(t))return;h&&s.add(t),0===n&&i++;const f=this.getAggregateErrors(t);let v,p;o||(o=!!f);try{if(v=this.applyCoercers(t,u),!v)throw l}catch(t){if(t===l)return void(0===n&&i--);if(!o)throw t;v=this.coerceFallback(u)}if(!f||i>=50)return v;try{p=f.length}catch(t){return v}if(!Number.isInteger(p)||0>p||p>4294967295)return v;const m=[];for(let t=0;50>i&&1e3>r&&p>t;t++){let n;r++;try{n=u.next(f[t])}catch(t){i++,n=this.coerceFallback(c(e+1))}n&&m.push(n)}return L(L({},v),{},{errors:m})},c=(n,i=0)=>L(L({},e),{},{syntheticException:0==n?e.syntheticException:void 0,mechanism:0==n?t:{},apply(t){const e=u(t,n,i+1);if(!e)throw l;return e},next:t=>u(t,n+1)}),d=c(n);return L(L({},d),{},{apply:t=>{var e;return null!==(e=u(t,n))&&void 0!==e?e:this.coerceFallback(d)}})}}([new class{match(t){return this.isDOMException(t)||this.isDOMError(t)}coerce(t,e){const n=V(t.stack);return{type:this.getType(t),value:this.getValue(t),stack:n?t.stack:void 0,cause:t.cause?e.next(t.cause):void 0,synthetic:!1}}getType(t){return this.isDOMError(t)?"DOMError":"DOMException"}getValue(t){const e=t.name||(this.isDOMError(t)?"DOMError":"DOMException");return t.message?`${e}: ${t.message}`:e}isDOMException(t){return et(t,"DOMException")}isDOMError(t){return et(t,"DOMError")}},new class{match(t){return et(t,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(t)}isCustomEventWrappingRejection(t){if(!it(t))return!1;try{const e=t.detail;return null!=e&&"object"==typeof e&&"reason"in e}catch(t){return!1}}coerce(t,e){var n;const i=this.getUnhandledRejectionReason(t);return tt(i)?{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(i)}`,stack:null===(n=e.syntheticException)||void 0===n?void 0:n.stack,synthetic:!0}:e.apply(i)}getUnhandledRejectionReason(t){try{if("reason"in t)return t.reason;if("detail"in t&&null!=t.detail&&"object"==typeof t.detail&&"reason"in t.detail)return t.detail.reason}catch(t){}return t}},new class{match(t){return!!et(t,"ErrorEvent")&&(null!=t.error||this.$r(t))}coerce(t,e){var n;if(null!=t.error)return e.apply(t.error);const i=e.apply(t.message);return L(L({},i),{},{stack:null!==(n=this.Lr(t))&&void 0!==n?n:i.stack,synthetic:!0})}$r(t){return V(t.message)&&t.message.length>0}Lr(t){var e,n;const i=t,r=null!==(e=i.lineno)&&void 0!==e?e:0,o=null!==(n=i.colno)&&void 0!==n?n:0;if(V(i.filename)&&0!==i.filename.length&&0!==r)return`Error\n at ${i.filename}:${r}:${o}`}},new class{match(t){return nt(t)}coerce(t,e){var n;const i=this.getStack(t),r=void 0===i?null===(n=e.syntheticException)||void 0===n?void 0:n.stack:void 0,o=!!r;return{type:this.getType(t),value:this.getMessage(t,e),stack:null!=i?i:r,cause:t.cause?e.next(t.cause):void 0,synthetic:o}}getType(t){return t.name||t.constructor.name}getMessage(t,e){const n=t.message;return String(n.error&&"string"==typeof n.error.message?n.error.message:n)}getStack(t){try{const e=t.stacktrace;if("string"==typeof e&&e.length>0)return e;const n=t.stack;return"string"==typeof n&&n.length>0?n:void 0}catch(t){return}}},new class{match(t){return it(t)}coerce(t,e){var n;const i=t.constructor.name;return{type:i,value:`${i} captured as exception with keys: ${Kt(t)}`,stack:null===(n=e.syntheticException)||void 0===n?void 0:n.stack,synthetic:!0}}},new class{match(t){return"object"==typeof t&&null!==t}coerce(t,e){var n,i;const r=this.getErrorPropertyFromObject(t);return r?e.apply(r):{type:this.getType(t),value:this.getValue(t),stack:null!==(n=this.getStack(t))&&void 0!==n?n:null===(i=e.syntheticException)||void 0===i?void 0:i.stack,level:this.isSeverityLevel(t.level)?t.level:"error",synthetic:!0}}getType(t){if(it(t))return t.constructor.name;const e="name"in t?t.name:void 0;return V(e)&&!Q(e)?e:"Error"}getValue(t){if("name"in t&&"string"==typeof t.name){let e=`'${t.name}' captured as exception`;return"message"in t&&"string"==typeof t.message&&(e+=` with message: '${t.message}'`),e}if("message"in t&&"string"==typeof t.message)return t.message;const e=this.getObjectClassName(t);return`${e&&"Object"!==e?`'${e}'`:"Object"} captured as exception with keys: ${Kt(t)}`}isSeverityLevel(t){return V(t)&&!Q(t)&&Yt.indexOf(t)>=0}getStack(t){try{return V(t.stacktrace)&&t.stacktrace.length>0?t.stacktrace:V(t.stack)&&t.stack.length>0?t.stack:void 0}catch(t){return}}getErrorPropertyFromObject(t){for(const e in t)if({}.hasOwnProperty.call(t,e)){const n=t[e];if(nt(n))return n}}getObjectClassName(t){try{const e=Object.getPrototypeOf(t);return e?e.constructor.name:void 0}catch(t){return}}},new class{match(t){return"string"==typeof t}coerce(t,e){var n;const[i,r]=this.getInfos(t);return{type:null!=i?i:"Error",value:null!=r?r:t,stack:null===(n=e.syntheticException)||void 0===n?void 0:n.stack,synthetic:!0}}getInfos(t){let e="Error",n=t;const i=t.match(Jt);return i&&(e=i[1],n=i[2]),[e,n]}},new class{match(t){return tt(t)}coerce(t,e){var n;return{type:"Error",value:`Primitive value captured as exception: ${String(t)}`,stack:null===(n=e.syntheticException)||void 0===n?void 0:n.stack,synthetic:!0}}}],function(t,...e){return(n,i=0)=>{const r=[],o=n.split("\n"),s=Math.min(o.length,i+1e3),a=[];for(let n=i;s>n;n++){const i=o[n];if(i.length>1024)continue;const s=zt.test(i)?i.replace(zt,"$1"):i;if(!s.match(/\S*Error: /)){for(const n of e){const e=n(s,t);if(e){r.push(e);const t=Wt(r);if(t){for(let e=a.length-1;e>=0;e--){const n=a[e];if(t.start>=n.start+n.length)break;a.pop()}a.push(t)}break}}if(Qt(r,a)>=50)break}}const l=[...a].sort((t,e)=>e.start-t.start),u=l[l.length-1];if(u){const t=Gt(r,u);r.splice(u.start-t,t);for(const e of l)e.start-=t}for(const t of l)Ht(r,t);return a.some(t=>0===t.start&&r.length===t.length)&&function(t){const e=t.map(t=>`${t.function}|${t.filename}|${t.lineno}|${t.colno}|${t.module}`);let n=0;for(let t=1;e.length>t;t++)Zt(e,t,n)&&(n=t);t.push(...t.splice(0,n))}(r),function(t){if(!t.length)return[];const e=Array.from(t);return e.reverse(),e.slice(0,50).map(t=>{return L(L({},t),{},{filename:t.filename||(n=e,n[n.length-1]||{}).filename,function:t.function||"?"});var n})}(r)}}("web:javascript",Nt,Bt)),yp=(t,e)=>{try{return t()}catch(t){return e}},bp=(t,e)=>yp(()=>t(e()),void 0),wp=t=>yp(()=>W(t)&&W(t.call),!1),kp=(t,e)=>yp(()=>{t[e].__POSTHOG_INSTRUMENTED__=!0},void 0),Sp=(t,e,n)=>{yp(()=>{var n;null===(n=t[e])||void 0===n||delete n.__POSTHOG_INSTRUMENTED__},void 0),yp(()=>{t[e]=n},void 0)},_p=e=>{const n=t;n||mp.info("window not available, cannot wrap onerror");const i=yp(()=>n.onerror,void 0);return n.onerror=function(...t){var n;return bp(e,()=>gp.buildFromUnknown((([t,e,n,i,r])=>{if(null!=r)return r;if(V(t)&&V(e)&&e.length>0&&"undefined"!=typeof ErrorEvent)try{return new ErrorEvent("error",{message:t,filename:e,lineno:n,colno:i})}catch(e){return t}return t})(t),{mechanism:{handled:!1}})),!!wp(i)&&null!==(n=i(...t))&&void 0!==n&&n},kp(n,"onerror"),()=>Sp(n,"onerror",i)},xp=(e,n=!1)=>{const i=t;i||mp.info("window not available, cannot wrap onUnhandledRejection");const r=yp(()=>i.onunhandledrejection,void 0);return i.onunhandledrejection=function(t){var i;return bp(e,()=>gp.buildFromUnknown(t,{mechanism:{handled:!1}})),wp(r)?null!==(i=r(t))&&void 0!==i&&i:n},kp(i,"onunhandledrejection"),()=>Sp(i,"onunhandledrejection",r)},Cp={wrapOnError:_p,wrapUnhandledRejection:xp,wrapConsoleError(t){const e=console;e||mp.info("console not available, cannot wrap console.error");const n=yp(()=>e.error,void 0);return e.error=function(...e){yp(()=>e.length>1&&V(e[0])&&(/^\[PostHog\.js\](?: |$)/.test(e[0])||"rrweb logger error:"===e[0]),!1)||bp(t,()=>{let t;t=1==e.length?e[0]:e.join(" ");const n=e.find(t=>t instanceof Error);return gp.buildFromUnknown(n||t,{mechanism:{handled:!0,type:"onconsole"},syntheticException:new Error("PostHog syntheticException"),skipFirstLines:2})}),wp(n)&&n(...e)},kp(e,"error"),()=>Sp(e,"error",n)}};o.__PosthogExtensions__=o.__PosthogExtensions__||{},o.__PosthogExtensions__.errorWrappingFunctions=Cp,o.posthogErrorWrappingFunctions=Cp;const Mp=(t,e)=>{if(!W(null==t?void 0:t.capture))return;const n=null==e?void 0:e.autocaptureExceptions,i=!Z(n)&&"object"==typeof n&&U(n.errors_to_ignore)?n.errors_to_ignore.reduce((t,e)=>{try{t.push(new RegExp(e))}catch(t){mp.error("Ignoring invalid legacy exception exclusion rule",e,t)}return t},[]):[],r=e=>{try{var n;null===(n=t.capture)||void 0===n||n.call(t,"$exception",e,{_noTruncate:!0,_batchKey:"exceptionEvent",_noHeatmaps:!0})}catch(t){mp.error("Failed to capture exception for a legacy client",t)}};_p(t=>{i.some(e=>t.$exception_list.some(t=>e.test(t.value||"")))||r(t)}),xp(r,!0)};o.extendPostHogWithExceptionAutoCapture=Mp,o.extendPostHogWithExceptionAutocapture=Mp;const Tp="X-POSTHOG-SESSION-ID",Ip="X-POSTHOG-WINDOW-ID",Ap="X-POSTHOG-DISTINCT-ID",Rp=[Tp,Ip,Ap],Ep="traceparent",Op=["attributionReporting","body","browsingTopics","cache","credentials","dispatcher","duplex","integrity","keepalive","method","mode","priority","redirect","referrer","referrerPolicy","signal","window"],$p=(t,e)=>({}.hasOwnProperty.call(t,e)),Lp=t=>"object"==typeof t&&!Z(t)||W(t),Dp=t=>"undefined"!=typeof Request&&(t instanceof Request||"[object Request]"==={}.toString.call(t)),Fp=e=>{try{var n;return Dp(e)?e.url:new URL(e instanceof URL?e.toString():String(e),null==t||null===(n=t.location)||void 0===n?void 0:n.href).toString()}catch(t){return}},Pp=(t,e,n,i,r)=>{let o;try{o=new URL(i).hostname}catch(t){return!1}if(!t)return!1;if(U(t)&&!t.includes(o))return!1;let s=!1;const a=(t=>W(t)?t():t)(e);if(a&&"$posthog_cookieless"!==a){try{r.set(Ap,a)}catch(t){return!1}s=!0}if(n){const{sessionId:t,windowId:e}=n.checkAndGetSessionAndWindowId(!0);r.set(Tp,t),r.set(Ip,e),s=!0}return s},Np=e=>{const n=new Uint8Array(e),i=null==t?void 0:t.crypto;if(i&&W(i.getRandomValues))i.getRandomValues(n);else for(let t=0;e>t;t++)n[t]=Math.floor(256*Math.random());let r="";for(let t=0;e>t;t++)r+=(16>n[t]?"0":"")+n[t].toString(16);return r},qp=t=>{let e=Np(t);for(;/^0+$/.test(e);)e=Np(t);return e},jp=()=>`00-${qp(16)}-${qp(8)}-01`,Bp=t=>{try{return new URL(t).origin}catch(t){return}},zp=(t,e)=>{if(!U(t)||0===t.length)return!1;let n;try{n=new URL(e)}catch(t){return!1}for(let e=0;t.length>e;e++){const i=t[e];if(V(i))if(i.indexOf("://")>-1){if(Bp(i)===n.origin)return!0}else if(i.toLowerCase()===n.hostname)return!0}return!1},Up=(t,e,n)=>!(n.has(Ep)||!zp(t,e)||(n.set(Ep,jp()),0));o.__PosthogExtensions__=o.__PosthogExtensions__||{};const Wp={_patchFetch:(e,n,i,r)=>Mu(t,"fetch",t=>function(o,s){const a=arguments.length>1?[o,s]:[o];let l=a;try{const t=Fp(o);if(t)if(Dp(o)){const t=new Request(o,s);l=[t];const a=new Headers;try{Pp(e,n,i,t.url,a),a.forEach((e,n)=>t.headers.set(n,e))}catch(t){}Up(r,t.url,t.headers)}else{const a=new Headers(Lp(s)?s.headers:void 0),u=Pp(e,n,i,t,a),c=Up(r,t,a);if(u||c){const t=((t,e)=>{if(G(t)||Z(t))return{headers:e};if(!Lp(t))return;const n=t;if("undefined"==typeof Proxy||"undefined"==typeof Reflect){const t=Object.create(n);return Object.defineProperty(t,"headers",{configurable:!0,enumerable:!0,value:e,writable:!0}),t}return new Proxy({headers:e},{get:(t,e)=>$p(t,e)?Reflect.get(t,e):Reflect.get(n,e,n),has:(t,e)=>$p(t,e)||e in n,ownKeys(t){const e=new Set(Reflect.ownKeys(t));return Reflect.ownKeys(n).forEach(t=>e.add(t)),Op.forEach(t=>{t in n&&e.add(t)}),Array.from(e)},getOwnPropertyDescriptor(t,e){const i=Reflect.getOwnPropertyDescriptor(t,e);if(i)return i;if("string"==typeof e&&Op.includes(e)&&e in n)return{configurable:!0,enumerable:!0,get(){return Reflect.get(n,e,n)}};const r=Reflect.getOwnPropertyDescriptor(n,e);return r?L(L({},r),{},{configurable:!0}):void 0},getPrototypeOf:()=>Object.getPrototypeOf(n)})})(s,a);t&&(l=[o,t])}}}catch(t){l=a}return t.apply(this,l)}),_patchXHR(e,n,i,r){const o=U(r)&&"undefined"!=typeof WeakMap?new WeakMap:void 0,s=Mu(t.XMLHttpRequest.prototype,"open",t=>function(r,s,a=!0,l,u){const c=this;let d=new Headers;const h=Fp(s);if(h)try{Pp(e,n,i,h,d)}catch(t){d=new Headers}o&&(o.delete(c),h&&o.set(c,h));const f=t.call(c,r,s,a,l,u);return Rp.forEach(t=>{const e=d.get(t);if(e)try{c.setRequestHeader(t,e)}catch(t){}}),f});if(!o)return s;const a=t.XMLHttpRequest.prototype,l=Mu(a,"setRequestHeader",t=>function(e,n){return(t=>{try{return String(t).toLowerCase()===Ep}catch(t){return!1}})(e)&&o.delete(this),t.call(this,e,n)}),u=Mu(a,"send",e=>function(){const n=o.get(this);if(n){o.delete(this);try{!zp(r,n)||(e=>{try{return!!t&&new URL(e,t.location.href).origin===t.location.origin}catch(t){return!1}})(n)&&(e=>{try{let r=e;for(let e=0;W(r)&&20>e;e++){var n,i;const e=r;if(e.__wrapped){const e=null==t?void 0:t[Symbol.for("opentelemetry.js.api.1")];return!!(null==e?void 0:e.propagation)}r=null===(n=null!==(i=e.__posthog_layer__)&&void 0!==i?i:e.__rrweb_layer__)||void 0===n?void 0:n.next}return!1}catch(t){return!1}})(null==c?void 0:c.next)||this.setRequestHeader(Ep,jp())}catch(t){}}return e.apply(this,arguments)});let c;try{var d;c=null===(d=a.send)||void 0===d?void 0:d.__posthog_layer__}catch(t){}return()=>{u(),l(),s()}}};o.__PosthogExtensions__.tracingHeadersPatchFns=Wp,o.postHogTracingHeadersPatchFns=Wp,"function"!=typeof[].at&&Object.defineProperty(Array.prototype,"at",{value(t){const e=this.length;let n=Math.trunc(t)||0;return 0>n&&(n+=e),0>n||n>=e?void 0:this[n]},writable:!0,enumerable:!1,configurable:!0}),"function"!=typeof[].findLast&&Object.defineProperty(Array.prototype,"findLast",{value(t,e){for(let n=this.length-1;n>=0;n--){const i=this[n];if(t.call(e,i,n,this))return i}},writable:!0,enumerable:!1,configurable:!0});var Hp=class{constructor(){this.t=void 0,this.o=0,this.i=[]}l(t){var e;if(t.hadRecentInput)return;const n=this.i[0],i=this.i.at(-1);this.o&&n&&i&&1e3>t.startTime-i.startTime&&5e3>t.startTime-n.startTime?(this.o+=t.value,this.i.push(t)):(this.o=t.value,this.i=[t]),null===(e=this.t)||void 0===e||e.call(this,t)}};const Gp=()=>{const t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},Vp=t=>{if("loading"===document.readyState)return"loading";const e=Gp();if(e){if(e.domInteractive>t)return"loading";if(0===e.domContentLoadedEventStart||e.domContentLoadedEventStart>t)return"dom-interactive";if(0===e.domComplete||e.domComplete>t)return"dom-content-loaded"}return"complete"},Qp=t=>{const e=t.nodeName;return 1===t.nodeType?e.toLowerCase():e.toUpperCase().replace(/^#/,"")},Zp=t=>{let e="";try{for(;9!==(null==t?void 0:t.nodeType);){var n;const i=t,r=i.id?"#"+i.id:[Qp(i),...Array.from(null!==(n=i.classList)&&void 0!==n?n:[]).sort()].join(".");if(e.length+r.length>99)return e||r;if(e=e?r+">"+e:r,i.id)break;t=i.parentNode}}catch(t){}return e},Jp=new WeakMap;function Yp(t,e){let n=Jp.get(e);return n||(n=new WeakMap,Jp.set(e,n)),n.get(t)||n.set(t,new e),n.get(t)}let Kp=-1;const Xp=()=>Kp,tm=t=>{addEventListener("pageshow",e=>{e.persisted&&(Kp=e.timeStamp,t(e))},!0)},em=(t,e,n,i)=>{let r,o;return s=>{var a;e.value>=0&&(s||i)&&(o=e.value-(null!==(a=r)&&void 0!==a?a:0),(o||void 0===r)&&(r=e.value,e.delta=o,e.rating=((t,e)=>t>e[1]?"poor":t>e[0]?"needs-improvement":"good")(e.value,n),t(e)))}},nm=t=>{requestAnimationFrame(()=>requestAnimationFrame(()=>t()))},im=()=>{var t,e;return null!==(t=null===(e=Gp())||void 0===e?void 0:e.activationStart)&&void 0!==t?t:0};let rm=-1;const om=new Set,sm=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,am=t=>{if("hidden"===document.visibilityState){if("visibilitychange"===t.type)for(const t of om)t();isFinite(rm)||(rm="visibilitychange"===t.type?t.timeStamp:0,removeEventListener("prerenderingchange",am,!0))}},lm=(t=!1)=>{if(t&&(rm=1/0),0>rm){var e;const t=im(),n=document.prerendering||null===(e=globalThis.performance.getEntriesByType("visibility-state").find(e=>"hidden"===e.name&&e.startTime>=t))||void 0===e?void 0:e.startTime;rm=null!=n?n:sm(),addEventListener("visibilitychange",am,!0),addEventListener("prerenderingchange",am,!0),tm(()=>{setTimeout(()=>{rm=sm()})})}return{get firstHiddenTime(){return rm},onHidden(t){om.add(t)}}},um=(t,e=-1,n,i=0,r,o,s)=>{const a=Gp(),l=(null==a?void 0:a.navigationId)||0;let u="navigate";return n?u=n:0>Xp()?a&&(document.prerendering||im()>0?u="prerender":document.wasDiscarded?u="restore":a.type&&(u=a.type.replace(/_/g,"-"))):u="back-forward-cache",{name:t,value:e,rating:"good",delta:0,entries:[],id:`v6-${Date.now()}-${Math.floor(8999999999999*Math.random())+1e12}`,navigationType:u,navigationId:i||l,navigationInteractionId:r,navigationURL:o||(null==a?void 0:a.name),navigationStartTime:s||0}},cm=(t,e,n={})=>{try{const i=t.filter(t=>PerformanceObserver.supportedEntryTypes.includes(t));if(i.length>0){const t=new PerformanceObserver(t=>{queueMicrotask(()=>{const n=t.getEntries();i.length>1&&n.sort((t,e)=>t.startTime+t.duration-(e.startTime+e.duration)),e(n)})});for(const e of i)t.observe(L({type:e,buffered:!0},n));return t}}catch(t){}},dm=t=>{var e,n;return(null===(e=globalThis.PerformanceObserver)||void 0===e||null===(e=e.supportedEntryTypes)||void 0===e?void 0:e.includes("soft-navigation"))&&"function"==typeof(null===(n=globalThis.PerformanceSoftNavigation)||void 0===n||null===(n=n.prototype)||void 0===n?void 0:n.getLargestInteractionContentfulPaint)&&t&&t.reportSoftNavs},hm=(t,e)=>{if(t.set(e.navigationId,e),t.size>2){const e=t.keys().next().value;void 0!==e&&t.delete(e)}},fm=t=>{let e=!1;return()=>{e||(t(),e=!0)}};var vm=class{constructor(){this.u=void 0}};const pm=t=>{document.prerendering?addEventListener("prerenderingchange",t,!0):t()},mm=[1800,3e3],gm=(t,e={})=>{const n=dm(e);pm(()=>{const i=Yp(e,vm),r=lm();let o,s=um("FCP");const a=cm(["paint"],t=>{for(const e of t)"first-contentful-paint"===e.name&&(a.disconnect(),r.firstHiddenTime>e.startTime&&(s.value=Math.max(e.startTime-im(),0),s.entries.push(e),s.navigationId=e.navigationId||s.navigationId,o(!0)))});a&&(o=em(t,s,mm,e.reportAllChanges),tm(n=>{s=um("FCP",-1,"back-forward-cache",s.navigationId,s.navigationInteractionId,s.navigationURL,Xp()),o=em(t,s,mm,e.reportAllChanges),nm(()=>{s.value=performance.now()-n.timeStamp,o(!0)})})),n&&cm(["soft-navigation"],n=>{n.forEach(n=>{i.u&&n.navigationId&&hm(i.u,n);const r=Math.max((n.presentationTime||n.paintTime||0)-n.startTime,0);s=um("FCP",r,"soft-navigation",n.navigationId,n.interactionId,n.name,n.startTime),o=em(t,s,mm,e.reportAllChanges),o(!0)})},e)})},ym=[.1,.25],bm=t=>t.find(t=>{var e;return 1===(null===(e=t.node)||void 0===e?void 0:e.nodeType)})||t[0],wm=(t,e={})=>{const n=Yp(e=Object.assign({},e),Hp),i=new WeakMap;n.t=t=>{var n;if(null==t||null===(n=t.sources)||void 0===n?void 0:n.length){const n=bm(t.sources),s=null==n?void 0:n.node;if(s){var r,o;const t=null!==(r=null===(o=e.generateTarget)||void 0===o?void 0:o.call(e,s))&&void 0!==r?r:Zp(s);i.set(n,t)}}},((t,e={})=>{const n=lm();gm(fm(()=>{let i,r=um("CLS",0);const o=Yp(e,Hp),s=(n,s,a,l,u)=>{r=um("CLS",0,n,s,a,l,u),o.o=0,i=em(t,r,ym,e.reportAllChanges)},a=(t=!1)=>{o.o>r.value&&(r.value=o.o,r.entries=o.i),i(t)},l=t=>{a(!0),s("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime)},u=t=>{for(const e of t)"soft-navigation"!==e.entryType?o.l(e):l(e);a()},c=["layout-shift"];dm(e)&&c.push("soft-navigation");const d=cm(c,u);d&&(i=em(t,r,ym,e.reportAllChanges),n.onHidden(()=>{u(d.takeRecords()),i(!0)}),tm(()=>{s("back-forward-cache",r.navigationId,r.navigationInteractionId,r.navigationURL,Xp()),nm(i)}),setTimeout(i))}))})(e=>{t((t=>{let e={};if(t.entries.length){var n;const r=t.entries.reduce((t,e)=>t.value>e.value?t:e);if(null==r||null===(n=r.sources)||void 0===n?void 0:n.length){const t=bm(r.sources);t&&(e={largestShiftTarget:i.get(t),largestShiftTime:r.startTime,largestShiftValue:r.value,largestShiftSource:t,largestShiftEntry:r,loadState:Vp(r.startTime)})}}return Object.assign(t,{attribution:e})})(e))},e)},km=(t,e={})=>{const n=Yp(e=Object.assign({},e),vm);dm(e)&&(n.u=new Map),gm(e=>{t((t=>{let e={timeToFirstByte:0,firstByteToFCP:t.value,loadState:Vp(Xp())};if("soft-navigation"!==t.navigationType){if(t.entries.length){const n=Gp(),i=t.entries.at(-1);if(n){const r=Math.max(0,n.responseStart-(n.activationStart||0));e={timeToFirstByte:r,firstByteToFCP:t.value-r,loadState:Vp(t.entries[0].startTime),navigationEntry:n,fcpEntry:i}}}}else{var i;const r=null===(i=n.u)||void 0===i?void 0:i.get(t.navigationId);r&&(e={timeToFirstByte:0,firstByteToFCP:t.value,loadState:"complete",navigationEntry:r})}return Object.assign(t,{attribution:e})})(e))},e)};let Sm=0,_m=1/0,xm=0;const Cm=t=>{for(const e of t)e.interactionId&&(_m=Math.min(_m,e.interactionId),xm=Math.max(xm,e.interactionId),Sm=xm?(xm-_m)/7+1:0)};let Mm;const Tm=()=>{var t;return Mm?Sm:null!==(t=performance.interactionCount)&&void 0!==t?t:0};var Im=class{constructor(){this.h=0,this.v=[],this.p=new Map,this.m=void 0,this.M=void 0}T(){return Tm()-this.h}D(){this.h=Tm(),this.v.length=0,this.p.clear()}S(t){const e=this.T(),n=Math.min(this.v.length-1,Math.floor(e/50));return!e||-1!==n||"soft-navigation"!==t&&"back-forward-cache"!==t?this.v[n]:{k:8,id:-1,entries:[]}}l(t){var e;if(null===(e=this.m)||void 0===e||e.call(this,t),!t.interactionId)return;const n=this.v.at(-1);let i=this.p.get(t.interactionId);if(i||10>this.v.length||t.duration>n.k){var r;if(i?t.duration>i.k?(i.entries=[t],i.k=t.duration):t.duration===i.k&&t.startTime===i.entries[0].startTime&&i.entries.push(t):(i={id:t.interactionId,entries:[t],k:t.duration},this.p.set(i.id,i),this.v.push(i)),this.v.sort((t,e)=>e.k-t.k),this.v.length>10){const t=this.v.splice(10);for(const e of t)this.p.delete(e.id)}null===(r=this.M)||void 0===r||r.call(this,i)}}};const Am=t=>{const e="requestIdleCallback"in globalThis?1e3:0,n=globalThis.requestIdleCallback||setTimeout,i=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)t();else{const r=fm(t);let o=-1;const s=()=>{i(o),r()};addEventListener("visibilitychange",s,{once:!0,capture:!0}),o=n(()=>{removeEventListener("visibilitychange",s,{capture:!0}),r()},{timeout:e})}},Rm=[200,500],Em=(t,e={})=>{const n=Yp(e=Object.assign({},e),Im);let i=[],r=[],o=0;const s=new WeakMap,a=new WeakMap;let l=!1;const u=()=>{l||(Am(c),l=!0)},c=()=>{const t=new Set(n.v.map(t=>s.get(t.entries[0]))),e=r.length-10;r=r.filter((n,i)=>i>=e||t.has(n));const a=new Set;for(const t of r){const e=d(t.startTime,t.processingEnd);for(const t of e)a.add(t)}i=i.filter(t=>t.startTime>o||a.has(t)),l=!1};n.m=t=>{const n=t.startTime+t.duration;let i;o=Math.max(o,t.processingEnd);for(let o=r.length-1;o>=0;o--){const s=r[o];if(8>=Math.abs(n-s.renderTime)){i=s,i.startTime=Math.min(t.startTime,i.startTime),i.processingStart=Math.min(t.processingStart,i.processingStart),i.processingEnd=Math.max(t.processingEnd,i.processingEnd),e.includeProcessedEventEntries&&i.entries.push(t);break}}i||(i={startTime:t.startTime,processingStart:t.processingStart,processingEnd:t.processingEnd,renderTime:n,entries:e.includeProcessedEventEntries?[t]:[]},r.push(i)),t.interactionId&&s.set(t,i),u()},n.M=t=>{if(!a.get(t)){var n;const s=null===(n=t.entries.find(t=>t.target))||void 0===n?void 0:n.target;if(s){var i,r;const n=null!==(i=null===(r=e.generateTarget)||void 0===r?void 0:r.call(e,s))&&void 0!==i?i:Zp(s);a.set(t,n)}else{var o;const e=null===(o=t.entries.find(t=>t.targetSelector))||void 0===o?void 0:o.targetSelector;e&&a.set(t,e)}}};const d=(t,e)=>{const n=[];for(const r of i)if(r.startTime+r.duration>=t){if(r.startTime>e)break;n.push(r)}return n};cm(["long-animation-frame"],t=>{i=i.concat(t),u()},e),((t,e={})=>{if(!globalThis.PerformanceEventTiming||!("interactionId"in PerformanceEventTiming.prototype))return;const n=lm();pm(()=>{var i;"interactionCount"in performance||Mm||(Mm=cm(["event"],Cm,{durationThreshold:0}));let r,o=um("INP");const s=Yp(e,Im),a=(n,i,a,l,u)=>{s.D(),o=um("INP",-1,n,i,a,l,u),r=em(t,o,Rm,e.reportAllChanges)},l=()=>{const t=s.S(o.navigationType);t&&t.k!==o.value&&(o.value=t.k,o.entries=t.entries,r())},u=t=>{l(),r(!0),a("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime)},c=(t,e=!1)=>{Am(()=>{for(const e of t)"soft-navigation"!==e.entryType?s.l(e):u(e);l(),e&&r(!0)})},d=["event","first-input"];dm(e)&&d.push("soft-navigation");const h=cm(d,c,L(L({},e),{},{durationThreshold:null!==(i=e.durationThreshold)&&void 0!==i?i:40}));r=em(t,o,Rm,e.reportAllChanges),h&&(n.onHidden(()=>{c(h.takeRecords(),!0)}),tm(()=>{a("back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,Xp())}))})})(e=>{t((t=>{if(0===t.entries.length){const e={processedEventEntries:[],longAnimationFrameEntries:[],inputDelay:0,processingDuration:0,presentationDelay:t.value,loadState:Vp(t.navigationStartTime||0)};return Object.assign(t,{attribution:e})}const e=t.entries[0],i=s.get(e),r=Math.max(i.processingStart,e.startTime),o=Math.max(e.startTime+e.duration,r),l=Math.min(i.processingEnd,o),u=i.entries.sort((t,e)=>t.processingStart-e.processingStart),c=d(e.startTime,l),h=n.p.get(e.interactionId),f={interactionTarget:a.get(h),interactionType:e.name.startsWith("key")?"keyboard":"pointer",interactionTime:e.startTime,nextPaintTime:o,processedEventEntries:u,longAnimationFrameEntries:c,inputDelay:r-e.startTime,processingDuration:l-r,presentationDelay:o-l,loadState:Vp(e.startTime),longestScript:void 0,totalScriptDuration:void 0,totalStyleAndLayoutDuration:void 0,totalPaintDuration:void 0,totalUnattributedDuration:void 0};return(t=>{var e;const n=t.interactionTime,i=t.nextPaintTime;if(!(null===(e=t.longAnimationFrameEntries)||void 0===e?void 0:e.length)||!n||!i)return;const r=t.inputDelay,o=t.processingDuration;let s,a,l=0,u=0,c=0,d=0;for(const e of t.longAnimationFrameEntries){u=u+e.startTime+e.duration-e.styleAndLayoutStart;for(const t of e.scripts){const e=t.startTime+t.duration;if(n>e)continue;const i=e-Math.max(n,t.startTime),c=t.duration?i/t.duration*t.forcedStyleAndLayoutDuration:0;l+=i-c,u+=c,i>d&&(a=n+r>t.startTime?"input-delay":n+r+o>t.startTime?"processing-duration":"presentation-delay",s=t,d=i)}}const h=t.longAnimationFrameEntries.at(-1),f=h?h.startTime+h.duration:0;f>=n+r+o&&(c=i-f),s&&a&&(t.longestScript={entry:s,subpart:a,intersectingDuration:d}),t.totalScriptDuration=l,t.totalStyleAndLayoutDuration=u,t.totalPaintDuration=c,t.totalUnattributedDuration=i-n-l-u-c})(f),Object.assign(t,{attribution:f})})(e))},e)};var Om=class{constructor(){this.m=void 0,this.u=void 0}l(t){var e;null===(e=this.m)||void 0===e||e.call(this,t)}};const $=[2500,4e3];let $m=50;const Lm=[];cm(["resource"],t=>{for(const e of t)Lm.push(e),Lm.length>$m&&Lm.shift()});const Dm=(t,e={})=>{null!=(e=Object.assign({},e)).resourceBufferSize&&($m=e.resourceBufferSize);const n=Yp(e,Om),i=new WeakMap;dm(e)&&(n.u=new Map),n.m=t=>{const n=t.element;if(n){var r,o;const s=null!==(r=null===(o=e.generateTarget)||void 0===o?void 0:o.call(e,n))&&void 0!==r?r:Zp(n);i.set(t,s)}else t.id&&i.set(t,`#${t.id}`)},((t,e={})=>{let n=!1;const i=dm(e);pm(()=>{let r,o=lm(),s=um("LCP");const a=Yp(e,Om),l=(i,a,l,u,c)=>{s=um("LCP",-1,i,a,l,u,c),r=em(t,s,$,e.reportAllChanges),n=!1,"soft-navigation"===i&&(o=lm(!0))},u=t=>{var e;a.u&&t.navigationId&&hm(a.u,t),n||r(!0),l("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime);const i=null===(e=t.getLargestInteractionContentfulPaint)||void 0===e?void 0:e.call(t);i&&c([i])},c=t=>{e.reportAllChanges||i||(t=t.slice(-1));for(const e of t){if(!e)continue;if("soft-navigation"===e.entryType){u(e);continue}let t=0,i=[],l=e.startTime;if("largest-contentful-paint"===e.entryType)t=Math.max(e.startTime-im(),0),a.l(e),i=[e];else if("interaction-contentful-paint"===e.entryType){var n;const r=e;if(!s.navigationId)continue;if("interactionId"in r&&r.interactionId!=s.navigationInteractionId)continue;l=(null===(n=r.largestContentfulPaint)||void 0===n?void 0:n.renderTime)||0,t=Math.max(l-e.startTime,0),r.largestContentfulPaint&&(a.l(r.largestContentfulPaint),i=[r.largestContentfulPaint])}o.firstHiddenTime>l&&(s.value=t,s.entries=i,r())}},d=["largest-contentful-paint"];i&&d.push("interaction-contentful-paint","soft-navigation");const h=cm(d,c);if(h){r=em(t,s,$,e.reportAllChanges);const o=["keydown","click","visibilitychange"],a=t=>{if(t.isTrusted&&!n){const t=s.id;Am(()=>{if(!n){if(!i){h.disconnect();for(const t of o)removeEventListener(t,a,{capture:!0})}t===s.id&&(n=!0,r(!0))}})}};for(const t of o)addEventListener(t,a,{capture:!0});tm(i=>{l("back-forward-cache",s.navigationId,s.navigationInteractionId,s.navigationURL,Xp()),r=em(t,s,$,e.reportAllChanges),nm(()=>{s.value=performance.now()-i.timeStamp,n=!0,r(!0)})})}})})(e=>{t((t=>{let e={timeToFirstByte:0,resourceLoadDelay:0,resourceLoadDuration:0,elementRenderDelay:t.value};if(t.entries.length){var r,o,s;const a=t.entries.at(-1),l=a.url&&(Lm.findLast(t=>t.name===a.url)||performance.getEntriesByType("resource").findLast(t=>t.name===a.url));let u;e.target=i.get(a),e.lcpEntry=a,a.url&&(e.url=a.url),l&&(e.lcpResourceEntry=l);let c=0,d=0;if("soft-navigation"!==t.navigationType?(u=Gp(),c=null!==(r=null==u?void 0:u.activationStart)&&void 0!==r?r:0,d=null!==(o=null==u?void 0:u.responseStart)&&void 0!==o?o:0):(c=t.navigationStartTime||0,u=null===(s=n.u)||void 0===s?void 0:s.get(t.navigationId)),u){const n=Math.max(0,d-c),i=Math.max(n,l?(l.requestStart||l.startTime)-c:0),r=Math.min(t.value,Math.max(i,l?l.responseEnd-c:0));e=L(L({},e),{},{timeToFirstByte:n,resourceLoadDelay:i-n,resourceLoadDuration:r-i,elementRenderDelay:t.value-r,navigationEntry:u})}}return Object.assign(t,{attribution:e})})(e))},e)};let Fm=-1;const Pm=()=>Fm,Nm=t=>{addEventListener("pageshow",e=>{e.persisted&&(Fm=e.timeStamp,t(e))},!0)},qm=(t,e,n,i)=>{let r,o;return s=>{var a;e.value>=0&&(s||i)&&(o=e.value-(null!==(a=r)&&void 0!==a?a:0),(o||void 0===r)&&(r=e.value,e.delta=o,e.rating=((t,e)=>t>e[1]?"poor":t>e[0]?"needs-improvement":"good")(e.value,n),t(e)))}},jm=t=>{requestAnimationFrame(()=>requestAnimationFrame(()=>t()))},Bm=()=>{const t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},zm=()=>{var t,e;return null!==(t=null===(e=Bm())||void 0===e?void 0:e.activationStart)&&void 0!==t?t:0};let Um=-1;const Wm=new Set,Hm=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,Gm=t=>{if("hidden"===document.visibilityState){if("visibilitychange"===t.type)for(const t of Wm)t();isFinite(Um)||(Um="visibilitychange"===t.type?t.timeStamp:0,removeEventListener("prerenderingchange",Gm,!0))}},Vm=(t=!1)=>{if(t&&(Um=1/0),0>Um){var e;const t=zm(),n=document.prerendering||null===(e=globalThis.performance.getEntriesByType("visibility-state").find(e=>"hidden"===e.name&&e.startTime>=t))||void 0===e?void 0:e.startTime;Um=null!=n?n:Hm(),addEventListener("visibilitychange",Gm,!0),addEventListener("prerenderingchange",Gm,!0),Nm(()=>{setTimeout(()=>{Um=Hm()})})}return{get firstHiddenTime(){return Um},onHidden(t){Wm.add(t)}}},Qm=(t,e=-1,n,i=0,r,o,s)=>{const a=Bm(),l=(null==a?void 0:a.navigationId)||0;let u="navigate";return n?u=n:0>Pm()?a&&(document.prerendering||zm()>0?u="prerender":document.wasDiscarded?u="restore":a.type&&(u=a.type.replace(/_/g,"-"))):u="back-forward-cache",{name:t,value:e,rating:"good",delta:0,entries:[],id:`v6-${Date.now()}-${Math.floor(8999999999999*Math.random())+1e12}`,navigationType:u,navigationId:i||l,navigationInteractionId:r,navigationURL:o||(null==a?void 0:a.name),navigationStartTime:s||0}},Zm=new WeakMap;function Jm(t,e){let n=Zm.get(e);return n||(n=new WeakMap,Zm.set(e,n)),n.get(t)||n.set(t,new e),n.get(t)}var Ym=class{constructor(){this.t=void 0,this.i=0,this.o=[]}h(t){var e;if(t.hadRecentInput)return;const n=this.o[0],i=this.o.at(-1);this.i&&n&&i&&1e3>t.startTime-i.startTime&&5e3>t.startTime-n.startTime?(this.i+=t.value,this.o.push(t)):(this.i=t.value,this.o=[t]),null===(e=this.t)||void 0===e||e.call(this,t)}};const Km=(t,e,n={})=>{try{const i=t.filter(t=>PerformanceObserver.supportedEntryTypes.includes(t));if(i.length>0){const t=new PerformanceObserver(t=>{queueMicrotask(()=>{const n=t.getEntries();i.length>1&&n.sort((t,e)=>t.startTime+t.duration-(e.startTime+e.duration)),e(n)})});for(const e of i)t.observe(L({type:e,buffered:!0},n));return t}}catch(t){}},Xm=t=>{var e,n;return(null===(e=globalThis.PerformanceObserver)||void 0===e||null===(e=e.supportedEntryTypes)||void 0===e?void 0:e.includes("soft-navigation"))&&"function"==typeof(null===(n=globalThis.PerformanceSoftNavigation)||void 0===n||null===(n=n.prototype)||void 0===n?void 0:n.getLargestInteractionContentfulPaint)&&t&&t.reportSoftNavs},tg=(t,e)=>{if(t.set(e.navigationId,e),t.size>2){const e=t.keys().next().value;void 0!==e&&t.delete(e)}},eg=t=>{let e=!1;return()=>{e||(t(),e=!0)}};var ng=class{constructor(){this.l=void 0}};const ig=t=>{document.prerendering?addEventListener("prerenderingchange",t,!0):t()},rg=[1800,3e3],og=(t,e={})=>{const n=Xm(e);ig(()=>{const i=Jm(e,ng),r=Vm();let o,s=Qm("FCP");const a=Km(["paint"],t=>{for(const e of t)"first-contentful-paint"===e.name&&(a.disconnect(),r.firstHiddenTime>e.startTime&&(s.value=Math.max(e.startTime-zm(),0),s.entries.push(e),s.navigationId=e.navigationId||s.navigationId,o(!0)))});a&&(o=qm(t,s,rg,e.reportAllChanges),Nm(n=>{s=Qm("FCP",-1,"back-forward-cache",s.navigationId,s.navigationInteractionId,s.navigationURL,Pm()),o=qm(t,s,rg,e.reportAllChanges),jm(()=>{s.value=performance.now()-n.timeStamp,o(!0)})})),n&&Km(["soft-navigation"],n=>{n.forEach(n=>{i.l&&n.navigationId&&tg(i.l,n);const r=Math.max((n.presentationTime||n.paintTime||0)-n.startTime,0);s=Qm("FCP",r,"soft-navigation",n.navigationId,n.interactionId,n.name,n.startTime),o=qm(t,s,rg,e.reportAllChanges),o(!0)})},e)})},sg=[.1,.25],ag=(t,e={})=>{const n=Vm();og(eg(()=>{let i,r=Qm("CLS",0);const o=Jm(e,Ym),s=(n,s,a,l,u)=>{r=Qm("CLS",0,n,s,a,l,u),o.i=0,i=qm(t,r,sg,e.reportAllChanges)},a=(t=!1)=>{o.i>r.value&&(r.value=o.i,r.entries=o.o),i(t)},l=t=>{a(!0),s("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime)},u=t=>{for(const e of t)"soft-navigation"!==e.entryType?o.h(e):l(e);a()},c=["layout-shift"];Xm(e)&&c.push("soft-navigation");const d=Km(c,u);d&&(i=qm(t,r,sg,e.reportAllChanges),n.onHidden(()=>{u(d.takeRecords()),i(!0)}),Nm(()=>{s("back-forward-cache",r.navigationId,r.navigationInteractionId,r.navigationURL,Pm()),jm(i)}),setTimeout(i))}))};let lg=0,ug=1/0,cg=0;const dg=t=>{for(const e of t)e.interactionId&&(ug=Math.min(ug,e.interactionId),cg=Math.max(cg,e.interactionId),lg=cg?(cg-ug)/7+1:0)};let hg;const fg=()=>{var t;return hg?lg:null!==(t=performance.interactionCount)&&void 0!==t?t:0};var vg=class{constructor(){this.u=0,this.v=[],this.m=new Map,this.p=void 0,this.T=void 0}_(){return fg()-this.u}M(){this.u=fg(),this.v.length=0,this.m.clear()}L(t){const e=this._(),n=Math.min(this.v.length-1,Math.floor(e/50));return!e||-1!==n||"soft-navigation"!==t&&"back-forward-cache"!==t?this.v[n]:{P:8,id:-1,entries:[]}}h(t){var e;if(null===(e=this.p)||void 0===e||e.call(this,t),!t.interactionId)return;const n=this.v.at(-1);let i=this.m.get(t.interactionId);if(i||10>this.v.length||t.duration>n.P){var r;if(i?t.duration>i.P?(i.entries=[t],i.P=t.duration):t.duration===i.P&&t.startTime===i.entries[0].startTime&&i.entries.push(t):(i={id:t.interactionId,entries:[t],P:t.duration},this.m.set(i.id,i),this.v.push(i)),this.v.sort((t,e)=>e.P-t.P),this.v.length>10){const t=this.v.splice(10);for(const e of t)this.m.delete(e.id)}null===(r=this.T)||void 0===r||r.call(this,i)}}};const pg=t=>{const e="requestIdleCallback"in globalThis?1e3:0,n=globalThis.requestIdleCallback||setTimeout,i=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)t();else{const r=eg(t);let o=-1;const s=()=>{i(o),r()};addEventListener("visibilitychange",s,{once:!0,capture:!0}),o=n(()=>{removeEventListener("visibilitychange",s,{capture:!0}),r()},{timeout:e})}},mg=[200,500],gg=(t,e={})=>{if(!globalThis.PerformanceEventTiming||!("interactionId"in PerformanceEventTiming.prototype))return;const n=Vm();ig(()=>{var i;"interactionCount"in performance||hg||(hg=Km(["event"],dg,{durationThreshold:0}));let r,o=Qm("INP");const s=Jm(e,vg),a=(n,i,a,l,u)=>{s.M(),o=Qm("INP",-1,n,i,a,l,u),r=qm(t,o,mg,e.reportAllChanges)},l=()=>{const t=s.L(o.navigationType);t&&t.P!==o.value&&(o.value=t.P,o.entries=t.entries,r())},u=t=>{l(),r(!0),a("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime)},c=(t,e=!1)=>{pg(()=>{for(const e of t)"soft-navigation"!==e.entryType?s.h(e):u(e);l(),e&&r(!0)})},d=["event","first-input"];Xm(e)&&d.push("soft-navigation");const h=Km(d,c,L(L({},e),{},{durationThreshold:null!==(i=e.durationThreshold)&&void 0!==i?i:40}));r=qm(t,o,mg,e.reportAllChanges),h&&(n.onHidden(()=>{c(h.takeRecords(),!0)}),Nm(()=>{a("back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,Pm())}))})};var yg=class{constructor(){this.p=void 0,this.l=void 0}h(t){var e;null===(e=this.p)||void 0===e||e.call(this,t)}};const bg=[2500,4e3],wg=(t,e={})=>{let n=!1;const i=Xm(e);ig(()=>{let r,o=Vm(),s=Qm("LCP");const a=Jm(e,yg),l=(i,a,l,u,c)=>{s=Qm("LCP",-1,i,a,l,u,c),r=qm(t,s,bg,e.reportAllChanges),n=!1,"soft-navigation"===i&&(o=Vm(!0))},u=t=>{var e;a.l&&t.navigationId&&tg(a.l,t),n||r(!0),l("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime);const i=null===(e=t.getLargestInteractionContentfulPaint)||void 0===e?void 0:e.call(t);i&&c([i])},c=t=>{e.reportAllChanges||i||(t=t.slice(-1));for(const e of t){if(!e)continue;if("soft-navigation"===e.entryType){u(e);continue}let t=0,i=[],l=e.startTime;if("largest-contentful-paint"===e.entryType)t=Math.max(e.startTime-zm(),0),a.h(e),i=[e];else if("interaction-contentful-paint"===e.entryType){var n;const r=e;if(!s.navigationId)continue;if("interactionId"in r&&r.interactionId!=s.navigationInteractionId)continue;l=(null===(n=r.largestContentfulPaint)||void 0===n?void 0:n.renderTime)||0,t=Math.max(l-e.startTime,0),r.largestContentfulPaint&&(a.h(r.largestContentfulPaint),i=[r.largestContentfulPaint])}o.firstHiddenTime>l&&(s.value=t,s.entries=i,r())}},d=["largest-contentful-paint"];i&&d.push("interaction-contentful-paint","soft-navigation");const h=Km(d,c);if(h){r=qm(t,s,bg,e.reportAllChanges);const o=["keydown","click","visibilitychange"],a=t=>{if(t.isTrusted&&!n){const t=s.id;pg(()=>{if(!n){if(!i){h.disconnect();for(const t of o)removeEventListener(t,a,{capture:!0})}t===s.id&&(n=!0,r(!0))}})}};for(const t of o)addEventListener(t,a,{capture:!0});Nm(i=>{l("back-forward-cache",s.navigationId,s.navigationInteractionId,s.navigationURL,Pm()),r=qm(t,s,bg,e.reportAllChanges),jm(()=>{s.value=performance.now()-i.timeStamp,n=!0,r(!0)})})}})},kg={onLCP:Dm,onCLS:wm,onFCP:km,onINP:Em,withoutAttribution:{onLCP:wg,onCLS:ag,onFCP:og,onINP:gg}};o.__PosthogExtensions__=o.__PosthogExtensions__||{},o.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=o.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},o.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-with-attribution-soft-navs"]=kg,o.__PosthogExtensions__.postHogWebVitalsCallbacks=kg,o.postHogWebVitalsCallbacks=kg;const Sg={onLCP:wg,onCLS:ag,onFCP:og,onINP:gg};o.__PosthogExtensions__=o.__PosthogExtensions__||{},o.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=o.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},o.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-soft-navs"]=Sg,o.__PosthogExtensions__.postHogWebVitalsCallbacks=Sg,o.postHogWebVitalsCallbacks=Sg,o.__PosthogExtensions__.loadWebVitalsCallbacks=()=>Sg;const _g={onLCP:Dm,onCLS:wm,onFCP:km,onINP:Em,withoutAttribution:{onLCP:wg,onCLS:ag,onFCP:og,onINP:gg}};o.__PosthogExtensions__=o.__PosthogExtensions__||{},o.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=o.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},o.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-with-attribution"]=_g,o.__PosthogExtensions__.postHogWebVitalsCallbacks=_g,o.postHogWebVitalsCallbacks=_g;const xg={onLCP:wg,onCLS:ag,onFCP:og,onINP:gg};o.__PosthogExtensions__=o.__PosthogExtensions__||{},o.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=o.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},o.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals"]=xg,o.__PosthogExtensions__.postHogWebVitalsCallbacks=xg,o.postHogWebVitalsCallbacks=xg,o.__PosthogExtensions__.loadWebVitalsCallbacks=()=>xg;const Cg={};function Mg(t,e){const n=Ie(t);return n?L({node:n,originalEvent:t,timestamp:Date.now()},e):null}function Tg(t){return!!_t(()=>Se(t))}function Ig(t,e){return Math.abs(t)<Math.abs(e)?0>e?"up":"down":0>t?"left":"right"}function Ag(t){return"swipe"===t.type?"$dead_swipe":"$dead_click"}const Rg="canvas,video,audio,embed,object";function Eg(t,e){return Y(t)&&t>=e}function Og(t,e=1e3){return t>=0&&e>t?t:void 0}function $g(t,e,n=1e3){return Y(e)?Og(t-e,n):void 0}var Lg=class{Dr(t){var e,n,i,r,o,s,a,l;const u=this.Fr((null==t?void 0:t.__onCapture)||this.Pr.bind(this));return{element_attribute_ignorelist:null!==(e=null==t?void 0:t.element_attribute_ignorelist)&&void 0!==e?e:u.element_attribute_ignorelist,scroll_threshold_ms:null!==(n=null==t?void 0:t.scroll_threshold_ms)&&void 0!==n?n:u.scroll_threshold_ms,selection_change_threshold_ms:null!==(i=null==t?void 0:t.selection_change_threshold_ms)&&void 0!==i?i:u.selection_change_threshold_ms,mutation_threshold_ms:null!==(r=null==t?void 0:t.mutation_threshold_ms)&&void 0!==r?r:u.mutation_threshold_ms,capture_clicks_with_modifier_keys:null!==(o=null==t?void 0:t.capture_clicks_with_modifier_keys)&&void 0!==o?o:u.capture_clicks_with_modifier_keys,capture_dead_swipes:null!==(s=null==t?void 0:t.capture_dead_swipes)&&void 0!==s?s:u.capture_dead_swipes,swipe_threshold_px:null!==(a=null==t?void 0:t.swipe_threshold_px)&&void 0!==a?a:u.swipe_threshold_px,max_dead_swipes_per_page_load:null!==(l=null==t?void 0:t.max_dead_swipes_per_page_load)&&void 0!==l?l:u.max_dead_swipes_per_page_load,css_selector_ignorelist:null==t?void 0:t.css_selector_ignorelist,__onCapture:u.__onCapture}}constructor(t,e){this.instance=t,this.Nr=new WeakSet,this.qr=!1,this.jr=[],this.Br=0,this.Fr=t=>({element_attribute_ignorelist:[],scroll_threshold_ms:100,selection_change_threshold_ms:100,mutation_threshold_ms:2500,capture_clicks_with_modifier_keys:!1,capture_dead_swipes:!0,swipe_threshold_px:30,max_dead_swipes_per_page_load:10,__onCapture:t}),this.zr=()=>{clearTimeout(this.Ur),this.Ur=void 0,this.Wr=void 0},this.Hr=t=>{if(this.Gr(t),this.zr(),0===t.button){const e={path:t.composedPath(),trusted:t.isTrusted,selectionChanged:!1,selectionInitiallyRelated:!1},i=null==n?void 0:n.getSelection();e.selectionInitiallyRelated="Range"===(null==i?void 0:i.type)&&this.Vr(i,e),this.Wr=e}},this.Qr=t=>{Z(t.relatedTarget)&&this.zr()},this.Zr=t=>{const e=this.Wr,n=t;if(!e||0!==n.button||t.isTrusted!==e.trusted)return;const i=t.composedPath();for(const t of e.path)if(Tg(t)&&-1!==i.indexOf(t)){e.clickTarget=t;break}e.clickDetail=n.detail,this.Ur=o.setTimeout(this.zr,0)},this.Jr=t=>{this.Gr(t);const e=t,n=Mg(e,{type:"click"}),i=this.Wr;n&&i&&0===e.button&&e.detail>0&&e.detail===i.clickDetail&&t.isTrusted===i.trusted&&n.node===i.clickTarget&&(n.selectionChangedDuringGesture=i.selectionChanged&&this.Yr.selection_change_threshold_ms>0,this.zr()),Z(n)||this.Kr(n)||this.Xr(n),this.eo()},this.no=()=>{const t=Date.now();this.io=t,t%50==0&&this.jr.forEach(e=>{G(e.scrollDelayMs)&&(e.scrollDelayMs=t-e.timestamp)})},this.ro=t=>{var e,i;const r=null==n?void 0:n.getSelection(),o=this.qr;this.qr="Range"===(null==r?void 0:r.type);const s=null==r?void 0:r.focusNode,a=s&&(Se(s)?s:s.parentElement),l=null==n?void 0:n.activeElement;let u=l;for(;null==u||null===(e=u.shadowRoot)||void 0===e?void 0:e.activeElement;)u=u.shadowRoot.activeElement;const c=$e(Ie(t))||$e(null!=a?a:null)||$e(null!==(i=u)&&void 0!==i?i:null),d="Caret"===(null==r?void 0:r.type)&&u&&!u.shadowRoot&&s&&s!==l&&s.contains(null!=l?l:null);if(!(o||this.qr||c||d))return;const h=Date.now();this.oo=h;const f=this.Wr;if(f&&(o||this.qr||c)){const e=Ie(t);let n;if($e(e))n=e;else if("Caret"===(null==r?void 0:r.type)){var v;$e(null!==(v=u)&&void 0!==v?v:null)||d?n=u:c&&(n=a)}const i=n?this.so(n,f):r&&(s||r.anchorNode)?this.Vr(r,f):o&&!this.qr&&f.selectionInitiallyRelated;f.selectionChanged=f.selectionChanged||i}this.jr.forEach(t=>{const e=h-t.timestamp;0>e||!G(t.selectionChangedDelayMs)&&e>=t.selectionChangedDelayMs||(t.selectionChangedDelayMs=e)})},this.gn=()=>{"hidden"===(null==n?void 0:n.visibilityState)&&this.zr();const t=Date.now();this.ao=t,this.lo("visibilityChangedDelayMs",t)},this.uo=()=>{const t=Date.now();this.co=t,this.lo("focusChangedDelayMs",t)},this.do=t=>{this.Gr(t);const e=t.touches,n=1===(null==e?void 0:e.length)?e[0]:void 0;this.ho=n&&this.fo()?{x:n.clientX,y:n.clientY,timestamp:Date.now()}:void 0},this.vo=()=>{this.ho=void 0},this.po=t=>{var e;const i=this.ho;if(this.ho=void 0,G(i)||this.Br>=this.Yr.max_dead_swipes_per_page_load)return;const r=t,o=null===(e=r.changedTouches)||void 0===e?void 0:e[0];if(!o)return;const s=o.clientX-i.x,a=o.clientY-i.y,l=s*s+a*a,u=this.Yr.swipe_threshold_px;if(u*u>l)return;if([this.io,this.mo,this.oo].some(t=>Y(t)&&t>=i.timestamp))return;var c,d;if(this.yo()&&(null!==(c=null==n||null===(d=n.elementsFromPoint)||void 0===d?void 0:d.call(n,i.x,i.y))&&void 0!==c?c:[]).some(t=>{var e;return null===(e=t.matches)||void 0===e?void 0:e.call(t,Rg)}))return;const h=Mg(r,{type:"swipe",swipeDirection:Ig(s,a),swipeDistancePx:Math.round(Math.sqrt(l))});Z(h)||this.Kr(h)||this.Xr(h),this.eo()},this.Yr=this.Dr(e),this._onCapture=this.Yr.__onCapture}start(t){this.bo(),this.wo(),this.ko(),this.So(),this._o(),this.xo(t),this.Yr.capture_dead_swipes&&this.Co()}xo(e){if(!this.Mo){const n=function(e){return function(e,n){const i=Cg[e];if(i)return i;let r=n[e];if((t=>W(t)&&-1!==t.toString().indexOf("[native code]"))(r)&&!(null==t?void 0:t.Zone))return Cg[e]=r.bind(n);const o=n.document;if(o&&W(o.createElement)){let t,i=!1;try{t=o.createElement("iframe"),t.hidden=!0,o.head.appendChild(t);const u=t.contentWindow;var s,a;u&&u[e]&&(r=u[e],"MutationObserver"===e&&N(l=null!==(s=null===(a=n.navigator)||void 0===a?void 0:a.userAgent)&&void 0!==s?s:"","AppleWebKit")&&!N(l,"Chrome")&&(t.classList.add("rr-block","ph-no-capture"),i=!0))}catch(t){de.warn(`Could not create sandbox iframe for ${e} check, bailing to assignableWindow.${e}: `,t)}finally{!i&&(null==t?void 0:t.parentNode)&&t.parentNode.removeChild(t)}}var l;return r&&W(r)?Cg[e]=r.bind(n):r}("MutationObserver",e)}(o);this.Mo=new n(t=>{this.To(t)}),this.Io(e)}}Io(t){t&&this.Mo&&(this.Nr.has(t)||(this.Mo.observe(t,{attributes:!0,characterData:!0,childList:!0,subtree:!0}),this.Nr.add(t),this.Ao(t)))}Ao(t,e){var n,i;Se(t)&&t.shadowRoot&&this.Io(t.shadowRoot);const r=null!==(n=null===(i=t.querySelectorAll)||void 0===i?void 0:i.call(t,"*"))&&void 0!==n?n:[];for(let t=0;r.length>t;t++)null==e||e.add(r[t]),this.Io(r[t].shadowRoot)}Gr(t){var e,n;const i=null!==(e=null===(n=t.composedPath)||void 0===n?void 0:n.call(t))&&void 0!==e?e:[];for(let t=0;i.length>t;t++){const e=i[t];Tg(e)&&this.Io(e.shadowRoot)}}stop(){var t;null===(t=this.Mo)||void 0===t||t.disconnect(),this.Mo=void 0,this.Nr=new WeakSet,o.removeEventListener("click",this.Jr,{capture:!0}),o.removeEventListener("mousedown",this.Hr,{capture:!0}),o.removeEventListener("mouseup",this.Zr,{capture:!0}),o.removeEventListener("mouseout",this.Qr,{capture:!0}),o.removeEventListener("dragstart",this.zr,{capture:!0}),o.removeEventListener("pointercancel",this.zr,{capture:!0}),o.removeEventListener("blur",this.zr),this.zr(),o.removeEventListener("scroll",this.no,{capture:!0}),null==n||n.removeEventListener("selectionchange",this.ro),o.removeEventListener("touchstart",this.do,{capture:!0}),o.removeEventListener("touchend",this.po,{capture:!0}),o.removeEventListener("touchcancel",this.vo,{capture:!0}),null==n||n.removeEventListener("visibilitychange",this.gn),o.removeEventListener("blur",this.uo),o.removeEventListener("focus",this.uo),this.ho=void 0}To(t){const e=new Set;for(const i of t)try{var n;if(!1===(null===(n=i.target)||void 0===n?void 0:n.isConnected))continue;this.mo=Date.now();const t=i.addedNodes;for(let n=0;t.length>n;n++){const i=t[n];Tg(i)&&!e.has(i)&&this.Ao(i,e)}}catch(t){}}bo(){me(o,"click",this.Jr,{capture:!0}),me(o,"mousedown",this.Hr,{capture:!0}),me(o,"mouseup",this.Zr,{capture:!0}),me(o,"mouseout",this.Qr,{capture:!0}),me(o,"dragstart",this.zr,{capture:!0}),me(o,"pointercancel",this.zr,{capture:!0}),me(o,"blur",this.zr)}Xr(t){this.fo()&&(t.selectionChangedDelayMs=$g(t.timestamp,this.oo,this.Yr.selection_change_threshold_ms),t.visibilityChangedDelayMs=$g(t.timestamp,this.ao),t.focusChangedDelayMs=$g(t.timestamp,this.co),this.jr.push(t))}eo(){this.jr.length&&G(this.Ro)&&(this.Ro=o.setTimeout(()=>{this.Eo()},1e3))}wo(){me(o,"scroll",this.no,{capture:!0})}ko(){var t;this.qr="Range"===(null==n||null===(t=n.getSelection())||void 0===t?void 0:t.type),me(n,"selectionchange",this.ro)}so(t,e){const n=e.path[0];try{for(;t;){if(-1!==e.path.indexOf(t)||Se(n)&&n.contains(t))return!0;t=t.getRootNode().host}}catch(t){}return!1}Vr(t,e){const n=e.path[0],i=t.rangeCount>0?t.getRangeAt(0):void 0,r=!!i&&_t(()=>i.startContainer.getRootNode()===n.getRootNode());if(i&&r&&Se(n)){var o;if(!i.collapsed)return i.intersectsNode(n);const t=Se(i.startContainer)&&null!==(o=i.startContainer.childNodes[i.startOffset])&&void 0!==o?o:i.startContainer;return this.so(t,e)}return this.so(t.focusNode,e)||this.so(t.anchorNode,e)}So(){me(n,"visibilitychange",this.gn)}_o(){me(o,"blur",this.uo),me(o,"focus",this.uo)}lo(t,e){this.jr.forEach(n=>{const i=Og(e-n.timestamp);Y(i)&&(G(n[t])||n[t]>i)&&(n[t]=i)})}Co(){me(o,"touchstart",this.do,{capture:!0,passive:!0}),me(o,"touchend",this.po,{capture:!0,passive:!0}),me(o,"touchcancel",this.vo,{capture:!0,passive:!0})}fo(){return W(this.instance.is_capturing)?this.instance.is_capturing():!this.instance.has_opted_out_capturing()}yo(){const t=G(this.Oo)||Y(this.mo)&&this.mo>this.Oo;return(G(this.$o)||t)&&(this.Oo=Date.now(),this.$o=!!(null==n?void 0:n.querySelector(Rg))),!!this.$o}Kr(t){return!t||("swipe"===t.type?this.Lo(t):this.Do(t))}Lo(t){return!((!((e=t.node)instanceof Element)||"__POSTHOG_TOOLBAR__"!==e.id&&!(null===(n=e.closest)||void 0===n?void 0:n.call(e,".toolbar-global-fade-container")))&&!this.jr.some(e=>e.type===t.type&&e.node===t.node&&1e3>Math.abs(e.timestamp-t.timestamp))&&!_e(t.node,"html")&&Se(t.node)&&function(t,e){var n;if(!(typeof window>"u"?void 0:window)||Le(t))return!1;const i=K(e)?Ee:null!==(n=null==e?void 0:e.css_selector_ignorelist)&&void 0!==n?n:Ee,{targetElementList:r,isComplete:o}=De(t,!1);return!!o&&!function(t,e){if(G(e))return!0;for(const n of t)if(e.some(t=>Re(n,t)))return!0;return!1}(r,i)}(t.node,{css_selector_ignorelist:this.Yr.css_selector_ignorelist}));var e,n}Do(t){return!(this.Yr.capture_clicks_with_modifier_keys||(e=t.originalEvent,!(e.ctrlKey||e.metaKey||e.altKey||e.shiftKey)))||!!this.Lo(t)||function(t){if(!(typeof window>"u"?void 0:window)||Le(t))return!1;const{targetElementList:e,isComplete:n}=De(t,!1);return!n||e.some(t=>_e(t,"a"))}(t.node);var e}Eo(){if(!this.jr.length)return;clearTimeout(this.Ro),this.Ro=void 0;const t=this.jr;this.jr=[];for(const n of t){var e;n.mutationDelayMs=null!==(e=n.mutationDelayMs)&&void 0!==e?e:this.mo&&this.mo>=n.timestamp?this.mo-n.timestamp:void 0,n.absoluteDelayMs=Date.now()-n.timestamp;const t=Eg(n.scrollDelayMs,this.Yr.scroll_threshold_ms),i=Eg(n.selectionChangedDelayMs,this.Yr.selection_change_threshold_ms),r=Eg(n.mutationDelayMs,this.Yr.mutation_threshold_ms),o=Eg(n.absoluteDelayMs,1.1*this.Yr.mutation_threshold_ms),s=Y(n.scrollDelayMs)&&this.Yr.scroll_threshold_ms>n.scrollDelayMs,a=Y(n.mutationDelayMs)&&this.Yr.mutation_threshold_ms>n.mutationDelayMs,l=n.selectionChangedDuringGesture||Y(n.selectionChangedDelayMs)&&this.Yr.selection_change_threshold_ms>n.selectionChangedDelayMs,u=Y(n.visibilityChangedDelayMs),c=Y(n.focusChangedDelayMs);if(!(s||a||l||u||c))if(t||r||o||i){const e=Ag(n);if("$dead_swipe"===e){if(this.Br>=this.Yr.max_dead_swipes_per_page_load)continue;this.Br++}this._onCapture(n,{[`${e}_last_mutation_timestamp`]:this.mo,[`${e}_event_timestamp`]:n.timestamp,[`${e}_scroll_timeout`]:t,[`${e}_mutation_timeout`]:r,[`${e}_absolute_timeout`]:o,[`${e}_selection_changed_timeout`]:i,[`${e}_visibility_changed_timeout`]:!1})}else this.Yr.mutation_threshold_ms>n.absoluteDelayMs&&this.jr.push(n)}this.eo()}Pr(t,e){const n=Ag(t);this.instance.capture(n,L(L(L({},e),Vv(t.node,{e:t.originalEvent,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.Yr.element_attribute_ignorelist,elementsChainAsString:!1,disableCaptureUrlHashes:this.instance.config.disable_capture_url_hashes}).props),{},{[`${n}_scroll_delay_ms`]:t.scrollDelayMs,[`${n}_mutation_delay_ms`]:t.mutationDelayMs,[`${n}_absolute_delay_ms`]:t.absoluteDelayMs,[`${n}_selection_changed_delay_ms`]:t.selectionChangedDelayMs,[`${n}_visibility_changed_delay_ms`]:t.visibilityChangedDelayMs,[`${n}_focus_changed_delay_ms`]:t.focusChangedDelayMs,$dead_swipe_direction:t.swipeDirection,$dead_swipe_distance_px:t.swipeDistancePx}),{timestamp:new Date(t.timestamp)})}};o.__PosthogExtensions__=o.__PosthogExtensions__||{},o.__PosthogExtensions__.initDeadClicksAutocapture=(t,e)=>new Lg(t,e)}();
|
|
1
|
+
!function(){const t="u">typeof window?window:void 0,e="u">typeof globalThis?globalThis:t,n=null==e?void 0:e.document,i=null==e?void 0:e.location;null!=e&&e.XMLHttpRequest&&new e.XMLHttpRequest;const r="undefined"!=typeof globalThis?globalThis:t;r&&"undefined"==typeof self&&(r.self=r),r&&"undefined"==typeof File&&(r.File=function(){});const o=null!=t?t:{},s="$stored_person_properties",a="$surveys",l="$replay_override_sampling",u="$replay_override_linked_flag",c="$replay_override_url_trigger",d="$replay_override_event_trigger",h="$session_is_sampled",f="$session_recording_url_trigger_activated_session",v="$session_recording_event_trigger_activated_session",p="$posthog_sr_group_event_trigger_",m="$posthog_sr_group_url_trigger_",g="$sess_rec_flush_size",y="$sdk_debug_replay_event_trigger_status",b="$sdk_debug_replay_linked_flag_trigger_status",w="$sdk_debug_replay_matched_recording_trigger_groups",k="$sdk_debug_replay_pending_trigger_conditions",S="$sdk_debug_replay_remote_trigger_matching_config",_="$sdk_debug_replay_trigger_groups_count",x="$sdk_debug_replay_url_trigger_status",C="$sdk_debug_rrweb_attached",M="$sdk_debug_rrweb_start_attempted",T="$session_recording_start_reason";function I(t,e,n,i,r,o,s){try{var a=t[o](s),l=a.value}catch(t){return void n(t)}a.done?e(l):Promise.resolve(l).then(i,r)}function A(t){return function(){var e=this,n=arguments;return new Promise(function(i,r){var o=t.apply(e,n);function s(t){I(o,i,r,s,a,"next",t)}function a(t){I(o,i,r,s,a,"throw",t)}s(void 0)})}}function R(t){return R="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},R(t)}function E(t,e,n){return(e=function(t){var e=function(t){if("object"!=R(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=R(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==R(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function O(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,i)}return n}function L(t){for(var e=1;arguments.length>e;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?O(Object(n),!0).forEach(function(e){E(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):O(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}var D=function(t){return t.GZipJS="gzip-js",t.Base64="base64",t}({});const F="min_length",P="max_length";function N(t,e){return-1!==t.indexOf(e)}const q=function(t){return t.trim()},j=Object.prototype,B=j.hasOwnProperty,z=j.toString,U=Array.isArray||function(t){return"[object Array]"===z.call(t)},W=t=>"function"==typeof t,H=t=>t===Object(t)&&!U(t),G=t=>void 0===t,V=t=>"[object String]"==z.call(t),Q=t=>V(t)&&0===t.trim().length,Z=t=>null===t,J=t=>G(t)||Z(t),Y=t=>"[object Number]"==z.call(t)&&t==t,K=t=>"[object Boolean]"===z.call(t),X=t=>t instanceof FormData;function tt(t){return null===t||"object"!=typeof t}function et(t,e){return{}.toString.call(t)===`[object ${e}]`}function nt(t){switch({}.toString.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object DOMError]":case"[object WebAssembly.Exception]":return!0;default:return rt(t,Error)}}function it(t){return"u">typeof Event&&rt(t,Event)}function rt(t,e){try{return t instanceof e}catch(t){return!1}}function ot(t,e,n,i,r){return e>n&&(i.warn("min cannot be greater than max."),e=n),Y(t)?t>n?(i.warn(" cannot be greater than max: "+n+". Using max value instead."),n):e>t?(i.warn(" cannot be less than min: "+e+". Using min value instead."),e):t:(i.warn(" must be a number. using max or fallback. max: "+n+", fallback: "+r),ot(null!=r?r:n,e,n,i))}var st=class{constructor(t){this.C={},this.I=t.I,this.A=ot(t.bucketSize,0,100,t.R),this.O=ot(t.refillRate,0,this.A,t.R),this.$=ot(t.refillInterval,0,864e5,t.R)}F(t,e){const n=Math.floor((e-t.lastAccess)/this.$);n>0&&(t.tokens=Math.min(t.tokens+n*this.O,this.A),t.lastAccess=t.lastAccess+n*this.$)}consumeRateLimit(t){var e;const n=Date.now(),i=String(t);let r=this.C[i];return r?this.F(r,n):(r={tokens:this.A,lastAccess:n},this.C[i]=r),0===r.tokens||(r.tokens--,0===r.tokens&&(null===(e=this.I)||void 0===e||e.call(this,t)),0===r.tokens)}stop(){this.C={}}};const at="Mobile",lt="Tablet",ut="Android Tablet",ct="iPad",dt="Apple Watch",ht="Nintendo",ft="PlayStation",vt="Xbox",pt="Nokia",mt="Ouya",gt="Generic tablet",yt=new RegExp(vt,"i"),bt=new RegExp("PlayStation \\w+","i"),wt=new RegExp("Nintendo \\w+","i"),kt=new RegExp("BlackBerry|PlayBook|BB10","i");function St(t){return t?t.split("#")[0]:t}function _t(t){try{return t()}catch(t){return}}let xt,Ct,Mt,Tt;function It(t){var e;const n=globalThis._posthogChunkIds,i=globalThis._debugIds;if(!n&&!i)return;const r=n?Object.keys(n):[],o=i?Object.keys(i):[];if(Tt&&At(n,r,Ct)&&At(i,o,Mt))return Tt;Ct=n?L({},n):void 0,Mt=i?L({},i):void 0,Tt={},null!==(e=xt)&&void 0!==e||(xt={});const s=(e,n)=>{for(const r of e){const e=n[r];if(!e)continue;const o=null==xt?void 0:xt[r];if(o){Tt[o]=e;continue}const s=t(r);for(let t=s.length-1;t>=0;t--){var i;const n=null===(i=s[t])||void 0===i?void 0:i.filename;if(n){Tt[n]=e,xt[r]=n;break}}}};return i&&s(o,i),n&&s(r,n),Tt}function At(t,e,n){return t&&n?e.length===Object.keys(n).length&&e.every(e=>t[e]===n[e]):t===n}const Rt=/^([a-z][a-z0-9.+-]+):/i,Et=["http","https","file","blob","app","capacitor","ionic","webpack","webpack-internal","ng"];function Ot(t){if(!t||"<anonymous>"===t)return!1;const e=Rt.exec(t);return!e||Et.includes(e[1].toLowerCase())}function $t(t,e,n,i,r){const o={platform:t,filename:e,function:"<anonymous>"===n?"?":n,in_app:Ot(e)};return G(i)||(o.lineno=i),G(r)||(o.colno=r),o}const Lt=(t,e)=>{const n=-1!==t.indexOf("safari-extension"),i=-1!==t.indexOf("safari-web-extension");return n||i?[-1!==t.indexOf("@")?t.split("@")[0]:"?",n?`safari-extension:${e}`:`safari-web-extension:${e}`]:[t,e]},Dt=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,Ft=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Pt=/\((\S*)(?::(\d+))(?::(\d+))\)/,Nt=(t,e)=>{const n=Dt.exec(t);if(n){const[,t,i,r]=n;return $t(e,t,"?",+i,+r)}const i=Ft.exec(t);if(i){if(i[2]&&0===i[2].indexOf("eval")){const t=Pt.exec(i[2]);t&&(i[2]=t[1],i[3]=t[2],i[4]=t[3])}const[t,n]=Lt(i[1]||"?",i[2]);return $t(e,n,t,i[3]?+i[3]:void 0,i[4]?+i[4]:void 0)}},qt=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,jt=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Bt=(t,e)=>{const n=qt.exec(t);if(n){if(n[3]&&n[3].indexOf(" > eval")>-1){const t=jt.exec(n[3]);t&&(n[1]=n[1]||"eval",n[3]=t[1],n[4]=t[2],n[5]="")}let t=n[3],i=n[1]||"?";return[i,t]=Lt(i,t),$t(e,t,i,n[4]?+n[4]:void 0,n[5]?+n[5]:void 0)}},zt=/\(error: (.*)\)/;function Ut(t,e){return t.filename===e.filename&&t.function===e.function&&t.module===e.module&&t.lineno===e.lineno&&t.colno===e.colno}function Wt(t){for(let e=1;10>=e;e++){const n=t.length-2*e;if(0>n)break;let i=!0;for(let r=0;e>r;r++)if(!Ut(t[n+r],t[n+e+r])){i=!1;break}if(i){for(let i=0;e>i;i++)t[n+i]=t[n+e+i];return t.length=n+e,{start:n,length:e}}}}function Ht(t,e){const n=e.start+e.length,i=Vt(t,e);i&&t.splice(n+i===t.length?n:e.start,i)}function Gt(t,e){let n=e.start;for(;n>0&&Ut(t[n-1],t[n-1+e.length]);)n--;return e.start-n}function Vt(t,e){const n=e.start+e.length;let i=n;for(;t.length>i&&Ut(t[i],t[i-e.length]);)i++;return i-n}function Qt(t,e){const n=e[0];let i=t.length-(n?Gt(t,n):0);for(const n of e)i-=Vt(t,n);return i}function Zt(t,e,n){for(let i=0;t.length>i;i++){const r=t[(e+i)%t.length],o=t[(n+i)%t.length];if(r!==o)return o>r}return!1}const Jt=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;const Yt=["fatal","error","warning","log","info","debug"];function Kt(t,e=40){const n=Object.keys(t);if(n.sort(),!n.length)return"[object has no keys]";let i="";for(const t of n){const n=i?`${i}, ${t}`:t;if(n.length>e)break;i=n}return i}const Xt="NativeGzipValidationError";let te;const ee=t=>{throw function(t,e){const n=new Error(e);try{Object.defineProperty(n,"name",{value:t,writable:!0,enumerable:!0,configurable:!0})}catch(t){}return n}(Xt,`Native gzip produced invalid output: ${t}`)};let ne=0,ie=!1;const re=function(){var t=A(function*(t,e){18>t.size&&ee("too-short");const n=new Uint8Array(yield t.slice(0,10).arrayBuffer());var i;(2>(i=n).length||31!==i[0]||139!==i[1]||8!==n[2])&&ee("invalid-header");const r=new DataView(yield t.slice(t.size-8).arrayBuffer()),o=e.length>>>0;r.getUint32(4,!0)!==o&&ee("invalid-size"),(ie||3>ne)&&(r.getUint32(0,!0)!==(t=>{const e=(()=>{if(te)return te;te=[];for(let t=0;256>t;t++){let e=t;for(let t=0;8>t;t++)e=1&e?3988292384^e>>>1:e>>>1;te[t]=e>>>0}return te})();let n=4294967295;for(let i=0;t.length>i;i++)n=e[255&(n^t[i])]^n>>>8;return(4294967295^n)>>>0})(e)&&(ie=!0,ee("invalid-crc")),ne++)});return function(e,n){return t.apply(this,arguments)}}();function oe(t){return se.apply(this,arguments)}function se(){return se=A(function*(t,e=!0,n){try{const e=(new TextEncoder).encode(t),n=new globalThis.CompressionStream("gzip"),r=n.writable.getWriter(),o=r.write(e).then(()=>r.close()).catch((i=A(function*(t){try{yield r.abort(t)}catch(t){}throw t}),function(t){return i.apply(this,arguments)})),s=new Response(n.readable).blob(),[a]=yield Promise.all([s,o]);return yield re(a,e),a}catch(t){if(null==n?void 0:n.rethrow)throw t;return e&&console.error("Failed to gzip compress data",t),null}var i}),se.apply(this,arguments)}function ae(t,e){if(!t)return;const n=t.find(t=>t.type===e);return null==n?void 0:n.value}const le="0.14.1",ue={DEBUG:!1,LIB_VERSION:le,LIB_NAME:"browser-common",JS_SDK_VERSION:le},ce=(t,{debugEnabled:e}={})=>{const n={N(n,...i){let r;try{r=typeof window>"u"?void 0:window}catch(t){return}r&&(ue.DEBUG||r.POSTHOG_DEBUG||e)&&!G(r.console)&&r.console&&("__rrweb_original__"in r.console[n]?r.console[n].__rrweb_original__:r.console[n])(t,...i)},debug(...t){n.N("debug",...t)},info(...t){n.N("log",...t)},warn(...t){n.N("warn",...t)},error(...t){n.N("error",...t)},critical(...e){console.error(t,...e)},uninitializedWarning(t){n.error(`You must initialize PostHog before calling ${t}`)},createLogger:(e,n)=>ce(`${t} ${e}`,n)};return n},de=ce("[PostHog.js]"),he=(t,e)=>de.createLogger(t,e);function fe(t,e){if(!J(t))if(U(t))t.forEach(e);else if(X(t))t.forEach((t,n)=>e(t,n));else for(const n in t)B.call(t,n)&&e(t[n],n)}const ve=function(t,...e){for(const n of e)for(const e in n)void 0!==n[e]&&(t[e]=n[e]);return t};function pe(t){const e=Object.keys(t);let n=e.length;const i=new Array(n);for(;n--;)i[n]=[e[n],t[e[n]]];return i}function me(t,e,n,i){const{capture:r=!1,passive:o=!0}=null!=i?i:{};null==t||t.addEventListener(e,n,{capture:r,passive:o})}const ge=t=>{const e=typeof document>"u"?void 0:document,n=null==e?void 0:e.createElement("a");return G(n)?null:(n.href=t,n)},ye=["localhost","127.0.0.1"],be=(t,e)=>{try{let n;return JSON.stringify(t,(t,e)=>{var i;return nt(e)?(null!==(i=n)&&void 0!==i||(n=new WeakMap),n.has(e)||n.set(e,function(t){const e=L({},t);for(const n of["name","message","stack","cause","errors"])try{n in t&&(e[n]=t[n])}catch(t){}return e}(e)),n.get(e)):"bigint"==typeof e?e.toString():e},e)}catch(e){return function(t){var e;const n=[];return null!==(e=JSON.stringify(t,function(t,e){if("bigint"==typeof e)return e.toString();if("function"!=typeof e&&"symbol"!=typeof e){if(e instanceof Error)return{name:e.name,message:e.message,stack:e.stack};if(e&&"object"==typeof e){for(;n.length>0&&n[n.length-1]!==this;)n.pop();if(n.includes(e))return"[Circular]";n.push(e)}return e}}))&&void 0!==e?e:"null"}(t)}},we=function(t,e="&"){let n,i;const r=[];return fe(t,function(t,e){G(t)||G(e)||"undefined"===e||(n=encodeURIComponent((t=>t instanceof File)(t)?t.name:t.toString()),i=encodeURIComponent(e),r[r.length]=i+"="+n)}),r.join(e)};function ke(t){var e;const n=typeof window>"u"?void 0:window,i=null==n||null===(e=n.location)||void 0===e?void 0:e.href;return G(i)?void 0:function(t,e){var n;const i=null==t||null===(n=t.config)||void 0===n?void 0:n.get_current_url;if(!W(i))return e;try{const t=i(e);return V(t)&&t?t:e}catch(t){return de.error("Error in get_current_url, falling back to window.location.href",t),e}}(t,i)}function Se(t){return!!t&&1===t.nodeType}function _e(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function xe(t){return!!t&&11===t.nodeType&&Se(t.host)}function Ce(t){return t?q(t).split(/\s+/):[]}function Me(t){let e="";switch(typeof t.className){case"string":e=t.className;break;case"object":e=(t.className&&"baseVal"in t.className?t.className.baseVal:null)||t.getAttribute("class")||"";break;default:e=""}return Ce(e)}function Te(t){let e="";return Pe(t)&&!Ne(t)&&t.childNodes&&t.childNodes.length&&fe(t.childNodes,function(t){var n;(function(t){return!!t&&3===t.nodeType})(t)&&t.textContent&&(e+=null!==(n=function(t){return J(t)?null:q(t).split(/(\s+)/).filter(t=>Ge(t)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}(t.textContent))&&void 0!==n?n:"")}),q(e)}function Ie(t){var e;return G(t.target)?t.srcElement||null:(null===(e=t.target)||void 0===e?void 0:e.shadowRoot)?t.composedPath()[0]||null:t.target||null}const Ae=["a","button","form","input","select","textarea","label"];function Re(t,e){const n=t.matches||t.matchesSelector||t.msMatchesSelector||t.mozMatchesSelector||t.webkitMatchesSelector||t.oMatchesSelector;try{return!!n&&n.call(t,e)}catch(t){return!1}}const Ee=[".ph-no-deadclick",".ph-no-capture"];const Oe=["","text","search","email","password","url","tel","number"];function $e(t){return!(!t||!Se(t))&&(!!_e(t,"textarea")||(_e(t,"input")?N(Oe,(t.getAttribute("type")||"").toLowerCase()):function(t){var e;if(t.isContentEditable)return!0;const n=null===(e=t.getAttribute)||void 0===e?void 0:e.call(t,"contenteditable");return"true"===n||""===n}(t)))}const Le=t=>!t||_e(t,"html")||!Se(t),De=(t,e)=>{const n=typeof window>"u"?void 0:window;if(!n||Le(t))return{parentIsUsefulElement:!1,targetElementList:[],isComplete:!1};let i=!1;const r=[t];let o=t;const s=new Set([t]);for(;!_e(o,"body");){const t=o.assignedSlot||o.parentNode,a=xe(t)?t.host:t&&Se(t)?t:null;if(!a)break;if(s.has(a)||s.size>=1e3)return{parentIsUsefulElement:i,targetElementList:r,isComplete:!1};if(s.add(a),xe(t))r.push(a),o=a;else{if(e||Ae.indexOf(a.tagName.toLowerCase())>-1)i=!0;else try{const t=n.getComputedStyle(a);t&&"pointer"===t.getPropertyValue("cursor")&&(i=!0)}catch(t){}r.push(a),o=a}}return{parentIsUsefulElement:i,targetElementList:r,isComplete:!0}};function Fe(t){const e=new Set;let n=0,i=t;for(;i;){if(n++>=1e3||e.has(i))return!0;e.add(i);const t=Me(i);if(N(t,"ph-sensitive")||N(t,"ph-no-capture"))return!0;const r=i.assignedSlot||i.parentNode;i=xe(r)?r.host:r&&Se(r)?r:null}return!1}function Pe(t){if(Fe(t))return!1;if(N(Me(t),"ph-include"))return!0;const e=t.type||"";if(V(e))switch(e.toLowerCase()){case"hidden":case"password":return!1}const n=t.name||t.id||"";return!V(n)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(n.replace(/[^a-zA-Z0-9]/g,""))}function Ne(t){return!!(_e(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||_e(t,"select")||_e(t,"textarea")||"true"===t.getAttribute("contenteditable"))}const qe=new RegExp("^(?:(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11}))$"),je=/(^|[^0-9A-Za-z_])([0-9][0-9 -]*[0-9])(?=$|[^0-9A-Za-z_])/g,Be=[16,15,14,13],ze=new RegExp("^(\\d{3}-?\\d{2}-?\\d{4})$"),Ue=new RegExp("(^|[^0-9])((?!000|666)[0-9]{3}-?(?!00)[0-9]{2}-?(?!0000)[0-9]{4})(?=$|([^0-9]))","g"),We=/[0-9A-Za-z_]/;function He(t){let e=0,n=!1;for(let i=t.length-1;i>=0;i--){let r=t.charCodeAt(i)-48;n&&(r*=2,r>9&&(r-=9)),e+=r,n=!n}return e%10==0}function Ge(t,e=!0){if(J(t))return!1;if(V(t)){if(t=q(t),e?qe.test((t||"").replace(/[- ]/g,"")):function(t){let e;for(je.lastIndex=0;e=je.exec(t);){const t=e[2];if(!t)continue;const n=t.replace(/[- ]/g,"");for(let t=0;n.length>t;t++)for(const e of Be){const i=t+e;if(n.length>=i){const e=n.slice(t,i);if(qe.test(e)&&He(e))return!0}}}return!1}(t))return!1;if(e?ze.test(t):function(t){let e;for(Ue.lastIndex=0;e=Ue.exec(t);){const t=e[1],n=e[3];if(!(t&&n&&We.test(t)&&We.test(n)))return!0}return!1}(t))return!1}return!0}function Ve(t){let e=Te(t);return e=`${e} ${Qe(t)}`.trim(),Ge(e)?e:""}function Qe(t){let e="";return t&&t.childNodes&&t.childNodes.length&&fe(t.childNodes,function(t){var n;if(t&&"span"===(null===(n=t.tagName)||void 0===n?void 0:n.toLowerCase()))try{const n=Te(t);e=`${e} ${n}`.trim(),t.childNodes&&t.childNodes.length&&(e=`${e} ${Qe(t)}`.trim())}catch(t){de.error("[AutoCapture]",t)}}),e}function Ze(t){return t.replace(/"|\\"/g,'\\"')}function Je(t){const e=t.attr__class;if(e)return U(e)?e:Ce(e)}const Ye=1e6;function Ke(t){var e;return Math.min(Ye,null!==(e=t.payloadSizeLimitBytes)&&void 0!==e?e:Ye)}const Xe={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:t=>t,recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:Ye,payloadHostDenyList:[".lr-ingest.io",".ingest.sentry.io",".clarity.ms","google-analytics.com","analytics.google.com","nr-data.net","datadoghq.com","datadoghq.eu","ddog-gov.com","segment.io","rudderstack.com","amplitude.com","mixpanel.com","hotjar.com","hotjar.io","fullstory.com"],streamNetworkBody:!1},tn=["authorization","x-forwarded-for","authorization","cookie","set-cookie","x-api-key","x-real-ip","remote-addr","forwarded","proxy-authorization","x-csrf-token","x-csrftoken","x-xsrf-token"],en=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],nn=["auth","token","secret","session","api-key","apikey","api_key","credential","password","passwd","cookie","csrf","xsrf"],rn=t=>{J(t)||fe(Object.keys(t),e=>{(t=>{const e=t.toLowerCase();return tn.includes(e)||nn.some(t=>e.includes(t))})(e)&&(t[e]="redacted")})},on=["/s/","/e/","/i/"];function sn(t,e,n,i){if(J(t))return t;let r=(null==e?void 0:e["content-length"])||function(t){return new Blob([t]).size}(t);return V(r)&&(r=parseInt(r)),r>n?`[SessionRecording] ${i} body too large to record (${r} bytes)`:t}function an(t,e){if(J(t))return t;let n=t;return Ge(n,!1)||(n="[SessionRecording] "+e+" body redacted"),fe(en,t=>{(null==n?void 0:n.length)&&-1!==(null==n?void 0:n.indexOf(t))&&(n="[SessionRecording] "+e+" body redacted as might contain: "+t)}),n}const ln=new WeakSet,un="disabled",cn="sampled",dn="active",hn="buffering",fn="paused",vn="rrweb_error",pn="trigger_activated",mn="trigger_pending",gn="trigger_disabled";function yn(t,e,n,i,r,o){return 0===e?gn:(null==t?void 0:t.get_property(n?i+n:r))===o?pn:mn}function bn(t,e,n){return e.some(e=>{var i;return"regex"===e.matching&&(null!==(i=null==n?void 0:n.get(e.url))&&void 0!==i?i:new RegExp(e.url)).test(t)})}function wn(t){return t.includes("trigger_activated")?pn:t.includes("trigger_pending")?mn:gn}function kn(t){const e=new Set(t);switch(e.delete(gn),e.size){case 0:return gn;case 1:return Array.from(e)[0];default:return mn}}var Sn=class{constructor(t){this.j=t}triggerStatus(t){return wn(this.j.map(e=>e.triggerStatus(t)))}triggerStatusNoSideEffects(t){return wn(this.j.map(e=>e.triggerStatusNoSideEffects(t)))}stop(){this.j.forEach(t=>t.stop())}},_n=class{constructor(t){this.j=t}triggerStatus(t){return kn(this.j.map(e=>e.triggerStatus(t)))}triggerStatusNoSideEffects(t){return kn(this.j.map(e=>e.triggerStatusNoSideEffects(t)))}stop(){this.j.forEach(t=>t.stop())}},xn=class{triggerStatus(){return this.triggerStatusNoSideEffects()}triggerStatusNoSideEffects(){return pn}stop(){}};const Cn=t=>"sessionRecording"in t;var Mn=class{constructor(t,e){this._instance=t,this.B=[],this.U=[],this.W=new Map,this.H=new Map,this.G="",this.urlBlocked=!1,this.V=e}onConfig(t){var e,n;this.B=(Cn(t)?H(t.sessionRecording)?null===(e=t.sessionRecording)||void 0===e?void 0:e.urlTriggers:[]:null==t?void 0:t.urlTriggers)||[],this.U=(Cn(t)?H(t.sessionRecording)?null===(n=t.sessionRecording)||void 0===n?void 0:n.urlBlocklist:[]:null==t?void 0:t.urlBlocklist)||[],this.Z()}Z(){this.W.clear(),this.H.clear();for(const t of this.B)if("regex"===t.matching&&!this.W.has(t.url))try{this.W.set(t.url,new RegExp(t.url))}catch(e){de.error("Invalid URL trigger regex pattern:",t.url,e)}for(const t of this.U)if("regex"===t.matching&&!this.H.has(t.url))try{this.H.set(t.url,new RegExp(t.url))}catch(e){de.error("Invalid URL blocklist regex pattern:",t.url,e)}}onRemoteConfig(t){this.onConfig(t)}J(t){return yn(this._instance,this.B.length,this.V,m,f,t)}triggerStatus(t){const e=this.triggerStatusNoSideEffects(t);return this._instance.register_for_session({[x]:e}),e}triggerStatusNoSideEffects(t){return this.J(t)}isCurrentUrlBlocked(){const t=ke(this._instance);if(!t)return!1;try{return bn(t,this.U,this.H)}catch(t){return!0}}checkUrlBlocklist(t,e){const n=ke(this._instance);if(!n)return;if(n===this.G)return;this.G=n;const i=this.urlBlocked,r=bn(n,this.U,this.H);i&&r||(r&&!i?t():!r&&i&&e())}checkUrlTriggerConditions(t,e,n,i){const r=ke(this._instance);if(!r)return;if(r===this.G)return;this.G=r;const o=this.urlBlocked,s=bn(r,this.U,this.H);s&&!o?t():!s&&o&&e();const a=this.J(i)===pn,l=bn(r,this.B,this.W);!a&&l&&n("url",r)}stop(){this.G=""}},Tn=class{constructor(t){this._instance=t,this.linkedFlag=null,this.linkedFlagSeen=!1,this.Y=()=>{}}triggerStatus(){const t=this.triggerStatusNoSideEffects();return this._instance.register_for_session({[b]:t}),t}triggerStatusNoSideEffects(){let t=mn;return J(this.linkedFlag)&&(t=gn),this.linkedFlagSeen&&(t=pn),t}onConfig(t,e){var n;if(this.linkedFlag=(Cn(t)?H(t.sessionRecording)?null===(n=t.sessionRecording)||void 0===n?void 0:n.linkedFlag:null:null==t?void 0:t.linkedFlag)||null,!J(this.linkedFlag)&&!this.linkedFlagSeen){const t=V(this.linkedFlag)?this.linkedFlag:this.linkedFlag.flag,n=V(this.linkedFlag)?null:this.linkedFlag.variant;this.Y=this._instance.onFeatureFlags((i,r)=>{let o=!1;if(H(r)&&t in r){const e=r[t];o=K(e)?!0===e:n?e===n:!!e}const s=o&&!this.linkedFlagSeen;this.linkedFlagSeen=o,s&&e(t,n)})}}onRemoteConfig(t,e){this.onConfig(t,e)}stop(){this.Y()}},In=class{constructor(t,e){this._instance=t,this.K=[],this.V=e}onConfig(t){var e;this.K=(Cn(t)?H(t.sessionRecording)?null===(e=t.sessionRecording)||void 0===e?void 0:e.eventTriggers:[]:null==t?void 0:t.eventTriggers)||[]}onRemoteConfig(t){this.onConfig(t)}X(t){return yn(this._instance,this.K.length,this.V,p,v,t)}triggerStatus(t){const e=this.triggerStatusNoSideEffects(t);return this._instance.register_for_session({[y]:e}),e}triggerStatusNoSideEffects(t){return this.X(t)}checkEventTriggerConditions(t,e,n){if(0===this.K.length)return;const i=this.X(n)===pn,r=this.K.includes(t);!i&&r&&e("event",t)}stop(){}},An=class{constructor(t,e,n){if(this._instance=t,this.group=e,this.tt=new Mn(t,e.id),this.et=new In(t,e.id),this.nt=new Tn(t),e.conditions.events&&e.conditions.events.length>0||e.conditions.urls&&e.conditions.urls.length>0||e.conditions.flag){const t=(e.conditions.events||[]).map(t=>t.name),i={urlTriggers:e.conditions.urls||[],eventTriggers:t,linkedFlag:e.conditions.flag||null,urlBlocklist:[]};this.tt.onConfig(i),this.et.onConfig(i),this.nt.onConfig(i,n);const r=[this.et,this.tt,this.nt];this.it="any"===e.conditions.matchType?new Sn(r):new _n(r)}else this.it=new xn}triggerStatus(t){return this.it.triggerStatus(t)}triggerStatusNoSideEffects(t){return this.it.triggerStatusNoSideEffects(t)}getPendingTriggerConditions(t){return"trigger_pending"!==this.triggerStatusNoSideEffects(t)?[]:[{label:"URL condition not matched",status:this.tt.triggerStatusNoSideEffects(t)},{label:"event condition not matched",status:this.et.triggerStatusNoSideEffects(t)},{label:"linked flag condition not matched",status:this.nt.triggerStatusNoSideEffects()}].filter(({status:t})=>t===mn).map(({label:t})=>t)}checkEventTriggerConditions(t,e,n){this.et.checkEventTriggerConditions(t,e,n)}checkUrlTriggerConditions(t,e,n,i){this.tt.checkUrlTriggerConditions(t,e,n,i)}activateTrigger(t,e){var n;const i="url"===t?m+this.group.id:p+this.group.id;null===(n=this._instance.persistence)||void 0===n||n.register({[i]:e})}stop(){this.tt.stop(),this.et.stop(),this.nt.stop()}};function Rn(t){if(t.rrwebError)return vn;if(!t.receivedFlags)return hn;if(!t.isRecordingEnabled)return un;if(t.urlTriggerMatching.urlBlocked)return fn;const e=!0===t.isSampled,n=new Sn([t.eventTriggerMatching,t.urlTriggerMatching,t.linkedFlagMatching]).triggerStatus(t.sessionId);return e?cn:"trigger_activated"===n?dn:"trigger_pending"===n?hn:!1===t.isSampled?un:dn}function En(t){if(t.rrwebError)return vn;if(!t.receivedFlags)return hn;if(!t.isRecordingEnabled)return un;if(t.urlTriggerMatching.urlBlocked)return fn;const e=new _n([t.eventTriggerMatching,t.urlTriggerMatching,t.linkedFlagMatching]).triggerStatus(t.sessionId),n=e!==gn,i=K(t.isSampled);return n&&"trigger_pending"===e?hn:n&&"trigger_disabled"===e||i&&!t.isSampled?un:!0===t.isSampled?cn:dn}function On(){const t=[];return function(e,n){if(H(n)||U(n)){for(;t.length>0&&t[t.length-1]!==this;)t.pop();return t.includes(n)?"[Circular]":(t.push(n),n)}return n}}function $n(t){try{const e=JSON.stringify(t,On());return e?new Blob([e]).size:0}catch(t){return-1}}function Ln(t){if(Z(t))return 4;if(G(t))return 0;switch(typeof t){case"string":return t.length+2;case"number":return String(t).length;case"boolean":return t?4:5;case"object":{if(U(t)){let e=2;for(let n=0;t.length>n;n++){n>0&&(e+=1);const i=t[n];e+=G(i)||Z(i)?4:Ln(i)}return e}const e=t;let n=2,i=!0;for(const t in e){if(!{}.hasOwnProperty.call(e,t))continue;const r=e[t];G(r)||(i||(n+=1),i=!1,n+=t.length+3+Ln(r))}return n}default:return 0}}function Dn(t,e=6606028.8){if(t.size>=e&&t.data.length>1){const e=Math.floor(t.data.length/2),n=t.sizes.slice(0,e),i=t.sizes.slice(e);return[Dn({size:n.reduce((t,e)=>t+e,0),data:t.data.slice(0,e),sizes:n,sessionId:t.sessionId,windowId:t.windowId}),Dn({size:i.reduce((t,e)=>t+e,0),data:t.data.slice(e),sizes:i,sessionId:t.sessionId,windowId:t.windowId})].flatMap(t=>t)}return[t]}var Fn=Uint8Array,Pn=Uint16Array,Nn=Uint32Array,qn=new Fn([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),jn=new Fn([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Bn=new Fn([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),zn=function(t,e){for(var n=new Pn(31),i=0;31>i;++i)n[i]=e+=1<<t[i-1];var r=new Nn(n[30]);for(i=1;30>i;++i)for(var o=n[i];n[i+1]>o;++o)r[o]=o-n[i]<<5|i;return[n,r]},Un=zn(qn,2),Wn=Un[1];Un[0][28]=258,Wn[258]=28;for(var Hn=zn(jn,0)[1],Gn=new Pn(32768),Vn=0;32768>Vn;++Vn){var Qn=(43690&Vn)>>>1|(21845&Vn)<<1;Gn[Vn]=((65280&(Qn=(61680&(Qn=(52428&Qn)>>>2|(13107&Qn)<<2))>>>4|(3855&Qn)<<4))>>>8|(255&Qn)<<8)>>>1}var Zn=function(t,e,n){for(var i=t.length,r=0,o=new Pn(e);i>r;++r)++o[t[r]-1];var s,a=new Pn(e);for(r=0;e>r;++r)a[r]=a[r-1]+o[r-1]<<1;if(n){s=new Pn(1<<e);var l=15-e;for(r=0;i>r;++r)if(t[r])for(var u=r<<4|t[r],c=e-t[r],d=a[t[r]-1]++<<c,h=d|(1<<c)-1;h>=d;++d)s[Gn[d]>>>l]=u}else for(s=new Pn(i),r=0;i>r;++r)s[r]=Gn[a[t[r]-1]++]>>>15-t[r];return s},Jn=new Fn(288);for(Vn=0;144>Vn;++Vn)Jn[Vn]=8;for(Vn=144;256>Vn;++Vn)Jn[Vn]=9;for(Vn=256;280>Vn;++Vn)Jn[Vn]=7;for(Vn=280;288>Vn;++Vn)Jn[Vn]=8;var Yn=new Fn(32);for(Vn=0;32>Vn;++Vn)Yn[Vn]=5;var Kn=Zn(Jn,9,0),Xn=Zn(Yn,5,0),ti=function(t){return(t/8|0)+(7&t&&1)},ei=function(t,e,n){(null==e||0>e)&&(e=0),(null==n||n>t.length)&&(n=t.length);var i=new(t instanceof Pn?Pn:t instanceof Nn?Nn:Fn)(n-e);return i.set(t.subarray(e,n)),i},ni=function(t,e,n){var i=e/8|0;t[i]|=n<<=7&e,t[i+1]|=n>>>8},ii=function(t,e,n){var i=e/8|0;t[i]|=n<<=7&e,t[i+1]|=n>>>8,t[i+2]|=n>>>16},ri=function(t,e){for(var n=[],i=0;t.length>i;++i)t[i]&&n.push({s:i,f:t[i]});var r=n.length,o=n.slice();if(!r)return[new Fn(0),0];if(1==r){var s=new Fn(n[0].s+1);return s[n[0].s]=1,[s,1]}n.sort(function(t,e){return t.f-e.f}),n.push({s:-1,f:25001});var a=n[0],l=n[1],u=0,c=1,d=2;for(n[0]={s:-1,f:a.f+l.f,l:a,r:l};c!=r-1;)a=n[n[d].f>n[u].f?u++:d++],l=n[u!=c&&n[d].f>n[u].f?u++:d++],n[c++]={s:-1,f:a.f+l.f,l:a,r:l};var h=o[0].s;for(i=1;r>i;++i)o[i].s>h&&(h=o[i].s);var f=new Pn(h+1),v=oi(n[c-1],f,0);if(v>e){i=0;var p=0,m=v-e,g=1<<m;for(o.sort(function(t,e){return f[e.s]-f[t.s]||t.f-e.f});r>i;++i){var y=o[i].s;if(e>=f[y])break;p+=g-(1<<v-f[y]),f[y]=e}for(p>>>=m;p>0;){var b=o[i].s;e>f[b]?p-=1<<e-f[b]++-1:++i}for(;i>=0&&p;--i){var w=o[i].s;f[w]==e&&(--f[w],++p)}v=e}return[new Fn(f),v]},oi=function(t,e,n){return-1==t.s?Math.max(oi(t.l,e,n+1),oi(t.r,e,n+1)):e[t.s]=n},si=function(t){for(var e=t.length;e&&!t[--e];);for(var n=new Pn(++e),i=0,r=t[0],o=1,s=function(t){n[i++]=t},a=1;e>=a;++a)if(t[a]==r&&a!=e)++o;else{if(!r&&o>2){for(;o>138;o-=138)s(32754);o>2&&(s(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(s(r),--o;o>6;o-=6)s(8304);o>2&&(s(o-3<<5|8208),o=0)}for(;o--;)s(r);o=1,r=t[a]}return[n.subarray(0,i),e]},ai=function(t,e){for(var n=0,i=0;e.length>i;++i)n+=t[i]*e[i];return n},li=function(t,e,n){var i=n.length,r=ti(e+2);t[r]=255&i,t[r+1]=i>>>8,t[r+2]=255^t[r],t[r+3]=255^t[r+1];for(var o=0;i>o;++o)t[r+o+4]=n[o];return 8*(r+4+i)},ui=function(t,e,n,i,r,o,s,a,l,u,c){ni(e,c++,n),++r[256];for(var d=ri(r,15),h=d[0],f=d[1],v=ri(o,15),p=v[0],m=v[1],g=si(h),y=g[0],b=g[1],w=si(p),k=w[0],S=w[1],_=new Pn(19),x=0;y.length>x;++x)_[31&y[x]]++;for(x=0;k.length>x;++x)_[31&k[x]]++;for(var C=ri(_,7),M=C[0],T=C[1],I=19;I>4&&!M[Bn[I-1]];--I);var A,R,E,O,L=u+5<<3,D=ai(r,Jn)+ai(o,Yn)+s,F=ai(r,h)+ai(o,p)+s+14+3*I+ai(_,M)+(2*_[16]+3*_[17]+7*_[18]);if(D>=L&&F>=L)return li(e,c,t.subarray(l,l+u));if(ni(e,c,1+(D>F)),c+=2,D>F){A=Zn(h,f,0),R=h,E=Zn(p,m,0),O=p;var P=Zn(M,T,0);for(ni(e,c,b-257),ni(e,c+5,S-1),ni(e,c+10,I-4),c+=14,x=0;I>x;++x)ni(e,c+3*x,M[Bn[x]]);c+=3*I;for(var N=[y,k],q=0;2>q;++q){var j=N[q];for(x=0;j.length>x;++x)ni(e,c,P[B=31&j[x]]),c+=M[B],B>15&&(ni(e,c,j[x]>>>5&127),c+=j[x]>>>12)}}else A=Kn,R=Jn,E=Xn,O=Yn;for(x=0;a>x;++x)if(i[x]>255){var B;ii(e,c,A[257+(B=i[x]>>>18&31)]),c+=R[B+257],B>7&&(ni(e,c,i[x]>>>23&31),c+=qn[B]);var z=31&i[x];ii(e,c,E[z]),c+=O[z],z>3&&(ii(e,c,i[x]>>>5&8191),c+=jn[z])}else ii(e,c,A[i[x]]),c+=R[i[x]];return ii(e,c,A[256]),c+R[256]},ci=new Nn([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),di=new Fn(0),hi=function(){for(var t=new Nn(256),e=0;256>e;++e){for(var n=e,i=9;--i;)n=(1&n&&3988292384)^n>>>1;t[e]=n}return t}(),fi=function(t,e,n){for(;n;++e)t[e]=n,n>>>=8};function vi(t,e){void 0===e&&(e={});var n=function(){var t=4294967295;return{p(e){for(var n=t,i=0;e.length>i;++i)n=hi[255&n^e[i]]^n>>>8;t=n},d(){return 4294967295^t}}}(),i=t.length;n.p(t);var r,o,s,a,l,u=(r=t,o=e,s=function(t){return 10+(t.filename&&t.filename.length+1||0)}(e),a=8,function(t,e,n,i,r,o){var s=t.length,a=new Fn(i+s+5*(1+Math.floor(s/7e3))+r),l=a.subarray(i,a.length-r),u=0;if(!e||8>s)for(var c=0;s>=c;c+=65535){var d=c+65535;s>d?u=li(l,u,t.subarray(c,d)):(l[c]=o,u=li(l,u,t.subarray(c,s)))}else{for(var h=ci[e-1],f=h>>>13,v=8191&h,p=(1<<n)-1,m=new Pn(32768),g=new Pn(p+1),y=Math.ceil(n/3),b=2*y,w=function(e){return(t[e]^t[e+1]<<y^t[e+2]<<b)&p},k=new Nn(25e3),S=new Pn(288),_=new Pn(32),x=0,C=0,M=(c=0,0),T=0,I=0;s>c;++c){var A=w(c),R=32767&c,E=g[A];if(m[R]=E,g[A]=R,c>=T){var O=s-c;if((x>7e3||M>24576)&&O>423){u=ui(t,l,0,k,S,_,C,M,I,c-I,u),M=x=C=0,I=c;for(var L=0;286>L;++L)S[L]=0;for(L=0;30>L;++L)_[L]=0}var D=2,F=0,P=v,N=R-E&32767;if(O>2&&A==w(c-N))for(var q=Math.min(f,O)-1,j=Math.min(32767,c),B=Math.min(258,O);j>=N&&--P&&R!=E;){if(t[c+D]==t[c+D-N]){for(var z=0;B>z&&t[c+z]==t[c+z-N];++z);if(z>D){if(D=z,F=N,z>q)break;var U=Math.min(N,z-2),W=0;for(L=0;U>L;++L){var H=c-N+L+32768&32767,G=H-m[H]+32768&32767;G>W&&(W=G,E=H)}}}N+=(R=E)-(E=m[R])+32768&32767}if(F){k[M++]=268435456|Wn[D]<<18|Hn[F];var V=31&Wn[D],Q=31&Hn[F];C+=qn[V]+jn[Q],++S[257+V],++_[Q],T=c+D,++x}else k[M++]=t[c],++S[t[c]]}}u=ui(t,l,o,k,S,_,C,M,I,c-I,u),o||(u=li(l,u,di))}return ei(a,0,i+ti(u)+r)}(r,null==o.level?6:o.level,null==o.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(r.length)))):12+o.mem,s,a,!l)),c=u.length;return function(t,e){var n=e.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=2>e.level?4:9==e.level?2:0,t[9]=3,0!=e.mtime&&fi(t,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),n){t[3]=8;for(var i=0;n.length>=i;++i)t[i+10]=n.charCodeAt(i)}}(u,e),fi(u,c-8,n.d()),fi(u,c-4,i),u}function pi(t,e){var n="";if(!e&&"undefined"!=typeof TextDecoder)return(new TextDecoder).decode(t);for(var i=0;t.length>i;){var r=t[i++];128>r||e?n+=String.fromCharCode(r):224>r?n+=String.fromCharCode((31&r)<<6|63&t[i++]):240>r?n+=String.fromCharCode((15&r)<<12|(63&t[i++])<<6|63&t[i++]):(r=((15&r)<<18|(63&t[i++])<<12|(63&t[i++])<<6|63&t[i++])-65536,n+=String.fromCharCode(55296|r>>10,56320|1023&r))}return n}var mi=class{constructor(t,e={}){var n,i,r,o;this._rrweb=t,this.rt=e,this.ot={},this.st=Date.now(),this.ut=-1/0,this.ct=()=>{const t=Date.now(),e=t-this.st;e>0?(this.dt=Math.min(this.ht,this.dt+e/1e3*this.ft),this.st=t):this.st=t},this.vt=t=>{if(!this.ot[t]){var e,n;this.ot[t]=!0;const i=this.yt(t);null===(e=(n=this.rt).onBlockedNode)||void 0===e||e.call(n,t,i)}},this.bt=t=>{const e=this.yt(t);if("svg"!==(null==e?void 0:e.nodeName)&&e instanceof Element){const t=e.closest("svg");if(t)return[this._rrweb.mirror.getId(t),t]}return[t,e]},this.yt=t=>this._rrweb.mirror.getNode(t),this.wt=t=>{var e,n,i,r,o,s,a,l;return(null!==(e=null===(n=t.removes)||void 0===n?void 0:n.length)&&void 0!==e?e:0)+(null!==(i=null===(r=t.attributes)||void 0===r?void 0:r.length)&&void 0!==i?i:0)+(null!==(o=null===(s=t.texts)||void 0===s?void 0:s.length)&&void 0!==o?o:0)+(null!==(a=null===(l=t.adds)||void 0===l?void 0:l.length)&&void 0!==a?a:0)},this.throttleMutations=t=>{if(3!==t.type||0!==t.data.source)return t;const e=t.data,n=this.wt(e);if(e.attributes){const t=e.attributes.length;e.attributes=e.attributes.filter(t=>{const[e]=this.bt(t.id);return!this.kt.consumeRateLimit(e)&&t});const n=t-e.attributes.length;var i,r;n>0&&(null===(i=(r=this.rt).onDroppedAttributeMutations)||void 0===i||i.call(r,n))}const o=this.wt(e);if(0===o&&n!==o)return;if(this.St)return t;this.ct();const s=Ln(t);var a,l;return s>this.dt?(null===(a=(l=this.rt).onDroppedOversizedMutation)||void 0===a||a.call(l,s),void this._t()):(this.dt-=s,t)},this._t=()=>{if(this.xt)return;const t=Math.max(0,this.Ct-(Date.now()-this.ut));this.xt=setTimeout(()=>{var t,e;this.xt=void 0,this.ut=Date.now(),null===(t=(e=this.rt).requestFullSnapshot)||void 0===t||t.call(e)},t)},this.kt=new st({bucketSize:null!==(n=this.rt.bucketSize)&&void 0!==n?n:100,refillRate:null!==(i=this.rt.refillRate)&&void 0!==i?i:10,refillInterval:1e3,I:this.vt,R:de}),this.ht=null!==(r=this.rt.bytesBucketSize)&&void 0!==r?r:0,this.ft=null!==(o=this.rt.bytesRefillRate)&&void 0!==o?o:25600,this.St=!Number.isFinite(this.ht)||0>=this.ht,this.dt=this.ht;const s=this.rt.resyncIntervalMs;this.Ct=Y(s)&&Number.isFinite(s)&&s>0?s:3e5}reset(){this.ot={},this.xt&&(clearTimeout(this.xt),this.xt=void 0),this.ut=Date.now()}stop(){this.kt.stop(),this.reset(),this.dt=this.ht,this.st=Date.now(),this.ut=-1/0}},gi=class t{constructor(t){if(this.bytes=t,16!==t.length)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,n,i,r){if(!Number.isInteger(e)||!Number.isInteger(n)||!Number.isInteger(i)||!Number.isInteger(r)||0>e||0>n||0>i||0>r||e>0xffffffffffff||n>4095||i>1073741823||r>4294967295)throw new RangeError("invalid field value");const o=new Uint8Array(16);return o[0]=e/Math.pow(2,40),o[1]=e/Math.pow(2,32),o[2]=e/Math.pow(2,24),o[3]=e/Math.pow(2,16),o[4]=e/256,o[5]=e,o[6]=112|n>>>8,o[7]=n,o[8]=128|i>>>24,o[9]=i>>>16,o[10]=i>>>8,o[11]=i,o[12]=r>>>24,o[13]=r>>>16,o[14]=r>>>8,o[15]=r,new t(o)}toString(){let t="";for(let e=0;this.bytes.length>e;e++)t=t+(this.bytes[e]>>>4).toString(16)+(15&this.bytes[e]).toString(16),3!==e&&5!==e&&7!==e&&9!==e||(t+="-");if(36!==t.length)throw new Error("Invalid UUIDv7 was generated");return t}clone(){return new t(this.bytes.slice(0))}equals(t){return 0===this.compareTo(t)}compareTo(t){for(let e=0;16>e;e++){const n=this.bytes[e]-t.bytes[e];if(0!==n)return Math.sign(n)}return 0}},yi=class{generate(){const t=this.generateOrAbort();if(!G(t))return t;{this.Mt=0;const t=this.generateOrAbort();if(G(t))throw new Error("Could not generate UUID after timestamp reset");return t}}generateOrAbort(){const t=(()=>{const t=Date.now();return Y(t)&&isFinite(t)?Math.min(Math.max(Math.floor(t),0),0xffffffffffff):0})();if(t>this.Mt)this.Mt=t,this.Tt();else{if(this.Mt>=t+1e4)return;this.It++,this.It>4398046511103&&(this.Mt++,this.Tt())}return gi.fromFieldsV7(this.Mt,Math.trunc(this.It/Math.pow(2,30)),this.It&Math.pow(2,30)-1,this.At.nextUint32())}Tt(){this.It=1024*this.At.nextUint32()+(1023&this.At.nextUint32())}constructor(){this.Mt=0,this.It=0,this.At=new ki}};const bi=t=>{if("u">typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(let e=0;t.length>e;e++)t[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return t};let wi;var ki=class{nextUint32(){var t;return this.Rt.length>this.Et||((null!==(t=wi)&&void 0!==t?t:wi="u">typeof window&&!G(window.crypto)&&crypto.getRandomValues?t=>{try{return crypto.getRandomValues(t)}catch(e){return bi(t)}}:bi)(this.Rt),this.Et=0),this.Rt[this.Et++]}constructor(){this.Rt=new Uint32Array(8),this.Et=1/0}};let Si;const _i=()=>xi().toString(),xi=()=>(Si||(Si=new yi)).generate();let Ci=null;const Mi={Ot(){if(!Z(Ci))return Ci;if(Ci=!0,G(t))Ci=!1;else try{const t="__support__";Mi.$t(t,"xyz"),'"xyz"'!==Mi.Lt(t)&&(Ci=!1),Mi.Dt(t)}catch(t){Ci=!1}return Ci},Ft(t){de.error("sessionStorage error: ",t)},Lt(e){try{return null==t?void 0:t.sessionStorage.getItem(e)}catch(t){Mi.Ft(t)}return null},Pt(t){try{return JSON.parse(Mi.Lt(t))||null}catch(t){}return null},$t(e,n){try{return null==t||t.sessionStorage.setItem(e,JSON.stringify(n)),!0}catch(t){Mi.Ft(t)}return!1},Dt(e){try{null==t||t.sessionStorage.removeItem(e)}catch(t){Mi.Ft(t)}}};ue.DEBUG=!1,ue.LIB_VERSION="1.455.1",ue.LIB_NAME="web";var Ti=ue,Ii=class{constructor(t){if(!t.persistence)throw new Error("it is not valid to not have persistence and be this far into setting up the application");this.Nt=t.get_property.bind(t),this.qt=t.persistence.set_property.bind(t.persistence)}trackSize(t,e){this.qt(g,{sessionId:t,size:this.currentTrackedSize(t)+e})}currentTrackedSize(t){const e=this.Nt(g);return H(n=e)&&V(n.sessionId)&&Y(n.size)&&e.sessionId===t?e.size:0;var n}};function Ai(t,e){return function(t){let e=0;for(let n=0;t.length>n;n++)e=(e<<5)-e+t.charCodeAt(n),e|=0;return Math.abs(e)}(t)%100<ot(100*e,0,100,de)}function Ri(t){return`$survey_response_${t}`}function Ei(t,e){if(!e)return null;const n=t[Ri(e)];return U(n)?[...n]:n}function Oi({event:t,survey:e,responses:n={},submissionId:i,completed:r,surveyLanguage:o,questionSnapshots:s}){return L(L(L(L({},!G(i)&&{$survey_submission_id:i}),"sent"===t?!G(r)&&{$survey_completed:r}:{$survey_partially_completed:$i(n)}),o&&{$survey_language:o}),function(t={},e,n){const i={};return e.questions.forEach(e=>{if(G(e.originalQuestionIndex))return;const n=0===(r=e.originalQuestionIndex)?"$survey_response":`$survey_response_${r}`;var r;const o=Ei(t,e.id);G(o)||(i[n]=o)}),L(L({$survey_questions:e.questions.map(e=>{var i,r;return{id:e.id,question:null!==(i=null==n?void 0:n[null!==(r=e.id)&&void 0!==r?r:""])&&void 0!==i?i:e.question,response:Ei(t,e.id)}})},t),i)}(n,e,s))}function $i(t={}){return Object.values(t).some(t=>!J(t))}function Li(t,e){let n=`$survey_${e}/${t.id}`;return t.current_iteration&&t.current_iteration>0&&(n=`$survey_${e}/${t.id}/${t.current_iteration}`),n}function Di(t){return"string"==typeof t&&t.trim()?t.trim():null}function Fi(t){return t.toLowerCase()}function Pi(t,e,n){if(!t||!e)return null;const i=Fi(e),r=Object.keys(t).find(t=>Fi(t)===i);if(r)return null==n||n.debug(`Found exact translation match: ${r}`),r;if(i.includes("-")){const r=i.split("-")[0],o=Object.keys(t).find(t=>Fi(t)===r);if(o)return null==n||n.debug(`Found base language translation match: ${o} (from ${e})`),o}return null}const Ni=["thankYouMessageHeader","thankYouMessageDescription","thankYouMessageCloseButtonText","introScreenHeader","introScreenDescription","introScreenButtonText","submitButtonText","backButtonText"];function qi(t,e,n){var i;const r=Pi(t.translations,e,n),o=L({},t);let s=!1;if(r){var a;const e=null===(a=t.translations)||void 0===a?void 0:a[r];if(e)if(null==n||n.info(`Applying survey-level translation for language: ${r}`),G(e.name)||(o.name=e.name,s=!0),o.appearance){const t=L({},o.appearance);for(const n of Ni){const i=e[n];G(i)||(t[n]=i,s=!0)}o.appearance=t}else(function(t){return Ni.some(e=>!G(t[e]))})(e)&&(s=!0)}const l=t.questions.map(t=>function(t,e,n){var i;const r=Pi(t.translations,e,n);if(!r)return{question:t,matchedKey:null,hasChanges:!1};const o=null===(i=t.translations)||void 0===i?void 0:i[r];if(!o)return{question:t,matchedKey:null,hasChanges:!1};const s=L({},t);let a=!1;return G(o.question)||(s.question=o.question,a=!0),G(o.description)||(s.description=o.description,a=!0),G(o.buttonText)||(s.buttonText=o.buttonText,a=!0),"link"in s&&!G(o.link)&&(s.link=o.link,a=!0),"lowerBoundLabel"in s&&!G(o.lowerBoundLabel)&&(s.lowerBoundLabel=o.lowerBoundLabel,a=!0),"upperBoundLabel"in s&&!G(o.upperBoundLabel)&&(s.upperBoundLabel=o.upperBoundLabel,a=!0),"choices"in s&&function(t){return U(t.choices)}(o)&&(s.choices=o.choices,a=!0),{question:a?s:t,matchedKey:a?r:null,hasChanges:a}}(t,e,n)),u=l.map(t=>t.question),c=l.some(t=>t.hasChanges);let d=null;return r||(d=(null===(i=l.find(t=>t.matchedKey))||void 0===i?void 0:i.matchedKey)||null),c&&(o.questions=u,s=!0,null==n||n.info(`Applied question-level translations for language: ${e}`)),{survey:o,matchedKey:s?r||d:null}}function ji(t){var e;return!!(null===(e=t.conditions)||void 0===e||null===(e=e.events)||void 0===e||null===(e=e.values)||void 0===e?void 0:e.length)}const Bi=(t,e)=>{if(!(t=>{try{new RegExp(t)}catch(t){return!1}return!0})(e))return!1;try{return new RegExp(e).test(t)}catch(t){return!1}},zi=t=>t.toLowerCase(),Ui={exact:(t,e)=>e.some(e=>t.some(t=>e===t)),is_not:(t,e)=>e.every(e=>t.every(t=>e!==t)),regex:(t,e)=>e.some(e=>t.some(t=>Bi(e,t))),not_regex:(t,e)=>e.every(e=>t.every(t=>!Bi(e,t))),icontains:(t,e)=>e.map(zi).some(e=>t.map(zi).some(t=>e.includes(t))),not_icontains:(t,e)=>e.map(zi).every(e=>t.map(zi).every(t=>!e.includes(t))),gt:(t,e)=>e.some(e=>{const n=parseFloat(e);return!isNaN(n)&&t.some(t=>n>parseFloat(t))}),lt:(t,e)=>e.some(e=>{const n=parseFloat(e);return!isNaN(n)&&t.some(t=>n<parseFloat(t))})},Wi=t=>{const e=[...t];for(let t=e.length-1;t>0;t--){const n=Math.floor(Math.random()*(t+1));[e[t],e[n]]=[e[n],e[t]]}return e},Hi=new Set(["is_not","not_icontains","not_regex"]);function Gi(t,e,n){return!t||0===t.length||t.every(t=>{const i="person"===t.type?n:e,r=null==i?void 0:i[t.key],o=t.operator||"exact";if(G(r)||Z(r))return Hi.has(o);const s=Ui[o];return!!s&&!G(t.value)&&!Z(t.value)&&s(U(t.value)?t.value.map(String):[String(t.value)],U(r)?r.map(String):[String(r)])})}const Vi=he("[SessionRecording]");function Qi(t,e){return e?t:"x"+t}function Zi(t,e){return t===e||t!=="x"+e&&null}var Ji=class{constructor(t,e,n,i,r,o,s){this._instance=t,this.tt=e,this.et=n,this.nt=i,this.jt=r,this.Bt=o,this.zt=s,this.Ut=null,this.Wt=En}onRemoteConfig(t){this.Ut=Y(t.sampleRate)?t.sampleRate:null,"any"===t.triggerMatchType?(this.Ht=new Sn([this.et,this.tt]),this.Wt=Rn):(this.Ht=new _n([this.et,this.tt]),this.Wt=En),this._instance.register_for_session({[S]:t.triggerMatchType}),this.tt.onConfig(t),this.et.onConfig(t),this.nt.onConfig(t,(t,e)=>{this.jt("linked_flag_matched",{flag:t,variant:e}),this.zt()})}getStatus(t){return this.Wt({receivedFlags:!0,isRecordingEnabled:!0,isSampled:t.isSampled,rrwebError:t.rrwebError,urlTriggerMatching:t.urlTriggerMatching,eventTriggerMatching:t.eventTriggerMatching,linkedFlagMatching:t.linkedFlagMatching,sessionId:t.sessionId})}getMinimumDuration(t){const e=this._instance.get_property("$session_recording_remote_config"),n=null==e?void 0:e.minimumDurationMilliseconds;return Y(n)?n:null}checkUrlTriggers(t,e,n,i){this.tt.checkUrlTriggerConditions(e,n,i,t)}setupEventTriggerListeners(t,e,n){if(0!==this.et.K.length&&J(this.Gt))return this.Gt=t(t=>{try{this.et.checkEventTriggerConditions(t.event,n,e)}catch(t){Vi.error("Could not activate event trigger",t)}}),this.Gt}makeSamplingDecisions(t){var e;const n=this.Ut;var i,r;if(!Y(n))return null===(i=this._instance.persistence)||void 0===i||i.unregister("$session_is_sampled"),void(null===(r=this._instance.persistence)||void 0===r||r.unregister("$replay_sample_rate"));const o=this._instance.get_property(h),s=this._instance.get_property("$replay_sample_rate"),a=Zi(o,t),l=Y(s)&&s!==n,u=G(s)&&o===t,c=l||u||!K(a),d=c?Ai(t,n):a;c&&(d?this.jt("sampled"):Vi.warn(`Sample rate (${n}) has determined that this sessionId (${t}) will not be sent to the server.`)),null===(e=this._instance.persistence)||void 0===e||e.register({$session_is_sampled:Qi(t,d),$replay_sample_rate:Z(s)&&o===t?null:n})}ensureSamplingDecision(t){if(!Y(this.Ut))return;const e=this._instance.get_property(h);K(Zi(e,t))||this.makeSamplingDecisions(t)}onFlushComplete(){}clearConditionalRecordingPersistence(){var t,e,n,i,r;null===(t=this._instance.persistence)||void 0===t||t.unregister("$session_recording_event_trigger_activated_session"),null===(e=this._instance.persistence)||void 0===e||e.unregister("$session_recording_url_trigger_activated_session"),null===(n=this._instance.persistence)||void 0===n||n.unregister("$session_is_sampled"),null===(i=this._instance.persistence)||void 0===i||i.unregister("$replay_sample_rate"),null===(r=this._instance.persistence)||void 0===r||r.unregister("$session_past_minimum_duration")}updateActiveTriggers(t){}hasPendingTriggers(t){var e;return(null===(e=this.Ht)||void 0===e?void 0:e.triggerStatus(t))===mn}getPendingTriggerConditions(t){return[{label:"URL condition not matched",status:this.tt.triggerStatusNoSideEffects(t)},{label:"event condition not matched",status:this.et.triggerStatusNoSideEffects(t)},{label:"linked flag condition not matched",status:this.nt.triggerStatusNoSideEffects()}].filter(({status:t})=>t===mn).map(({label:t})=>t)}stop(){var t;null===(t=this.Gt)||void 0===t||t.call(this),this.Gt=void 0,this.et.stop(),this.tt.stop(),this.nt.stop()}},Yi=class{constructor(t,e,n,i,r){this._instance=t,this.tt=e,this.jt=n,this.Vt=i,this.zt=r,this.Qt=[],this.Zt=new Map,this.Jt=!1}onRemoteConfig(t){t.triggerGroups&&0!==t.triggerGroups.length?(this.Yt(t.triggerGroups),this._instance.register_for_session({[S]:"v2_trigger_groups",[_]:t.triggerGroups.length}),this.tt.onConfig(t)):Vi.warn("[V2Strategy] No trigger groups configured")}getStatus(t){return function(t){if(t.rrwebError)return vn;if(!t.receivedFlags)return hn;if(!t.isRecordingEnabled)return un;if(t.urlTriggerMatching.urlBlocked)return fn;const e=t.triggerGroupMatchers,n=t.triggerGroupSamplingResults;if(0===e.length)return un;let i=!1,r=!1;for(const o of e){const e=o.triggerStatus(t.sessionId);if("trigger_activated"===e){const t=o.group.id,e=n.get(t);G(e)?de.warn("[V2 Triggers] Group activated but no sampling decision found",{groupId:t}):!0===e&&(r=!0)}else"trigger_pending"===e&&(i=!0)}return r?cn:i?hn:un}({receivedFlags:!0,isRecordingEnabled:!0,isSampled:t.isSampled,rrwebError:t.rrwebError,urlTriggerMatching:t.urlTriggerMatching,eventTriggerMatching:t.eventTriggerMatching,linkedFlagMatching:t.linkedFlagMatching,sessionId:t.sessionId,triggerGroupMatchers:this.Qt,triggerGroupSamplingResults:this.Zt,minimumDuration:this.getMinimumDuration(t.sessionId)})}getMinimumDuration(t){let e=null;for(const n of this.Qt)if("trigger_activated"===n.triggerStatus(t)){const t=n.group.minDurationMs;Y(t)&&(Z(e)||e>t)&&(e=t)}return e}checkUrlTriggers(t,e,n,i){this.tt.checkUrlBlocklist(e,n);for(const i of this.Qt)i.checkUrlTriggerConditions(e,n,e=>{this.Kt(i,void 0)&&(i.activateTrigger(e,t),this.updateActiveTriggers(t),this.zt(e))},t)}setupEventTriggerListeners(t,e,n){return this.Gt=t(t=>{var n;if(this.Jt)return Vi.info("[SessionRecorder] Stopping trigger checks - initial buffer flushed"),null===(n=this.Gt)||void 0===n||n.call(this),void(this.Gt=void 0);try{for(const n of this.Qt)n.checkEventTriggerConditions(t.event,i=>{if(!this.Kt(n,t.properties))return;const r=(n.group.conditions.events||[]).filter(e=>e.name===t.event),o=this._instance.get_property(s);r.some(e=>!e.properties||0===e.properties.length||Gi(e.properties,t.properties,o))&&(n.activateTrigger(i,e),this.updateActiveTriggers(e),this.zt(i))},e)}catch(t){Vi.error("Could not activate event trigger for trigger groups",t)}}),this.Gt}makeSamplingDecisions(t){for(const n of this.Qt){var e;const i=n.group,r=i.id,o=i.sampleRate,s="$posthog_sr_group_sampling_"+r,a=this._instance.get_property(s);let l=null,u=!1,c=!1,d=!1;if(H(a)){const e=a.sessionId,n=a.sampleRate,i=a.sampled;u="string"==typeof e&&e!==t,c=Y(n)&&n!==o,l=e===t&&Y(n)&&n===o&&K(i)?i:null}else l=a===t||null,u="string"==typeof a&&a!==t,d=a===t;const h=u||c||d||!K(l),f=h?Ai(t+r,o):l;h&&this.Vt("triggerGroupSamplingDecisionMade",{group_id:r,group_name:i.name,sampleRate:o,isSampled:f}),this.Zt.set(r,f),null===(e=this._instance.persistence)||void 0===e||e.register({[s]:{sessionId:t,sampleRate:o,sampled:f}})}this.updateActiveTriggers(t)}ensureSamplingDecision(t){}onFlushComplete(){this.Jt=!0}clearConditionalRecordingPersistence(){var t,e,n;null===(t=this._instance.persistence)||void 0===t||t.unregister("$session_is_sampled"),null===(e=this._instance.persistence)||void 0===e||e.unregister("$replay_sample_rate"),null===(n=this._instance.persistence)||void 0===n||n.unregister("$session_past_minimum_duration");for(const t of this.Qt){var i,r,o;const e=t.group.id;null===(i=this._instance.persistence)||void 0===i||i.unregister("$posthog_sr_group_event_trigger_"+e),null===(r=this._instance.persistence)||void 0===r||r.unregister("$posthog_sr_group_url_trigger_"+e),null===(o=this._instance.persistence)||void 0===o||o.unregister("$posthog_sr_group_sampling_"+e)}}updateActiveTriggers(t){const e=[];for(const n of this.Qt){const i=n.group,r=i.id,o="trigger_activated"===n.triggerStatus(t),s=!0===this.Zt.get(r);o&&e.push({id:r,name:i.name,matched:!0,sampled:s})}this._instance.register_for_session({[w]:e})}hasPendingTriggers(t){for(const e of this.Qt)if("trigger_pending"===e.triggerStatus(t))return!0;return!1}getPendingTriggerConditions(t){return this.Qt.flatMap(e=>"trigger_pending"!==e.triggerStatusNoSideEffects(t)?[]:e.getPendingTriggerConditions(t).map(t=>`trigger group "${e.group.name}": ${t}`))}stop(){var t;null===(t=this.Gt)||void 0===t||t.call(this),this.Gt=void 0,this.Qt.forEach(t=>t.stop()),this.Qt=[],this.Zt.clear(),this.tt.stop()}Kt(t,e){const n=t.group.conditions.properties;return!n||0===n.length||Gi(n,e,this._instance.get_property(s))}Yt(t){this.Qt.forEach(t=>t.stop()),this.Qt=[],this.Zt.clear();for(const e of t){const t=new An(this._instance,e,(t,n)=>{this.jt("linked_flag_matched",{flag:t,variant:n,group_id:e.id,group_name:e.name}),this.zt()});this.Qt.push(t)}}};const Ki=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","oppref","bfcid","irclid","_kx"],Xi=["ScCid","SsCid"],tr=(()=>[...Ki,...Xi,"sscid"])(),er=1e5,nr=/^[A-Za-z0-9]*[A-Za-z][A-Za-z0-9]*$/,ir=[],rr=()=>!1,or="@type @id actionStatus availability bestRating contentRating encodingFormat eventAttendanceMode eventStatus highPrice inLanguage isAccessibleForFree isFamilyFriendly itemCondition itemListOrder lowPrice maximumAttendeeCapacity nonprofitStatus numberOfItems offerCount position price priceCurrency priceValidUntil publicAccess ratingCount ratingValue reviewCount smokingAllowed worstRating".split(" "),sr="Action BorrowAction ReadAction SearchAction SeekToAction SolveMathAction WatchAction".split(" "),ar="AutoDealer Bakery BarOrPub CafeOrCoffeeShop CollegeOrUniversity Corporation DaySpa Dentist EducationalOrganization Electrician FoodEstablishment GovernmentOrganization HealthClub Hotel LegalService Library LibrarySystem LocalBusiness Locksmith LodgingBusiness MedicalBusiness NGO OnlineStore Organization PerformingGroup Pharmacy Physician Plumber RealEstateAgent Restaurant School SportsOrganization Store".split(" "),lr="Accommodation AdministrativeArea Country Place State".split(" "),ur={AggregateOffer:{offers:["Offer"]},Brand:{name:!0},BreadcrumbList:{itemListElement:["ListItem"]},CreativeWork:{genre:!0,dateCreated:!0,dateModified:!0,datePublished:!0,expires:!0,learningResourceType:!0,educationalLevel:!0,educationalUse:!0,interactivityType:!0,aggregateRating:["AggregateRating"],potentialAction:sr,publisher:ar},Event:{startDate:!0,endDate:!0,previousStartDate:!0,aggregateRating:["AggregateRating"],offers:["AggregateOffer","Offer"]},ItemList:{itemListElement:["ListItem"]},ListItem:{item:ir},Offer:{seller:ar},Organization:{name:!0,legalName:!0,foundingDate:!0,dissolutionDate:!0,aggregateRating:["AggregateRating"],brand:["Brand"]},Place:{aggregateRating:["AggregateRating"]},Product:{name:!0,sku:!0,mpn:!0,gtin:!0,gtin8:!0,gtin12:!0,gtin13:!0,gtin14:!0,productID:!0,productGroupID:!0,asin:!0,model:!0,category:!0,color:!0,material:!0,pattern:!0,size:!0,productionDate:!0,releaseDate:!0,brand:["Brand","Organization"],manufacturer:ar,offers:["Offer","AggregateOffer"],aggregateRating:["AggregateRating"]},Service:{name:!0,serviceType:!0,category:!0,provider:ar,areaServed:lr,offers:["AggregateOffer","Offer"],aggregateRating:["AggregateRating"]},OfferCatalog:{name:!0,itemListElement:ir}},cr=[["3DModel AboutPage Answer Article AudioObject Blog BlogPosting Book Clip CollectionPage Comment ContactPage Course CreativeWorkSeason CreativeWorkSeries DataCatalog DataDownload DataFeed Dataset DiscussionForumPosting Episode FAQPage Game HowTo HowToDirection HowToSection HowToStep HowToTip ImageObject LearningResource MediaObject Message MobileApplication Movie MusicPlaylist MusicRecording NewsArticle Photograph PodcastEpisode PodcastSeries ProfilePage QAPage Question Quiz Recipe Review ScholarlyArticle SearchResultsPage SiteNavigationElement SocialMediaPosting SoftwareApplication TVEpisode TVSeries TechArticle VacationRental VideoGame VideoObject WebApplication WebPage WebPageElement WebSite".split(" "),ur.CreativeWork],["BroadcastEvent BusinessEvent EducationEvent Festival MusicEvent SportsEvent TheaterEvent".split(" "),ur.Event],[ar,ur.Organization],[lr,ur.Place],["Car IndividualProduct ProductGroup ProductModel".split(" "),ur.Product]];function dr(t,e){return B.call(t,e)?t[e]:void 0}function hr(t){const e=typeof t;return Z(t)||"string"===e||"number"===e||"boolean"===e}function fr(t,e){return e&&function(t){return V(t)&&/^(https?:\/\/|\/|\.\.?\/)/i.test(t.trim())}(t)?e(t.trim())||void 0:t}function vr(t,e){return U(t)&&t.every(hr)?t.map(t=>fr(t,e)).filter(t=>!G(t)):hr(t)?fr(t,e):void 0}function pr(t,e){if("string"!=typeof t)return;const n=t.trim(),i=n.indexOf("#"),r=0>i?n:n.slice(i+1);if(!(!r||0>i&&(/^[a-z][a-z\d+.-]*:/i.test(n)||n.includes("/")||n.includes("?"))))try{return e(r)?r:void 0}catch(t){return}}function mr(t){if(B.call(ur,t))return ur[t];for(const[e,n]of cr)if(e.includes(t))return n}function gr(t,e,n){Object.defineProperty(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0})}function yr(t,e,n,i){if(U(t)){const r=t.map(t=>yr(t,e,n,i)).filter(t=>!G(t));return r.length?r:void 0}return br(t,e,n,i)||void 0}function br(t,e,n,i){if(!H(t)||!function(t){return t.remainingNodes?(t.remainingNodes--,!0):(t.exceeded=!0,!1)}(n))return null;const r=dr(t,"@type"),o=function(t){const e=new Set,n="string"==typeof t?[t]:U(t)?t:[],i=[];for(const t of n){if("string"!=typeof t)continue;const n=t.replace(/^https?:\/\/schema\.org\//,"");if(100>=n.length&&nr.test(n)&&!e.has(n)&&(e.add(n),i.push(n),20===i.length))break}return i}(r),s=o.filter(t=>!!mr(t)&&(!i||!i.length||i.includes(t))),a={};for(const i of or){const s="@type"===i?o.length?"string"==typeof r?o[0]:o:void 0:"@id"===i?pr(dr(t,i),e):vr(dr(t,i),n.maskUrl);G(s)||gr(a,i,s)}for(const i of s){const r=mr(i);for(const i of Object.keys(r)){const o=dr(t,i),s=r[i];if(!0===s){const t=vr(o,n.maskUrl);G(t)||gr(a,i,t)}else{const t=yr(o,e,n,s);G(t)||gr(a,i,t)}}}const l=yr(dr(t,"@graph"),e,n);return G(l)||gr(a,"@graph",l),Object.keys(a).length?a:null}function wr(t,e,n){if(!H(t))return null;const i=dr(t,"@context");if("string"!=typeof i||!/^https?:\/\/schema\.org\/?$/.test(i))return null;const r=br(t,e,n);return r?L({"@context":"https://schema.org"},r):null}function kr(t){var e;return"SCRIPT"===t.nodeName&&"application/ld+json"===(null===(e=t.getAttribute("type"))||void 0===e?void 0:e.trim().toLowerCase())}function Sr(t,e,n){if("string"==typeof e?t.classList.contains(e):e&&Array.from(t.classList).some(t=>(e.lastIndex=0,e.test(t))))return!0;try{return!!n&&t.matches(n)}catch(t){return!1}}function _r(t,e,n){for(let i=t;i;){if(Sr(i,e,n))return!0;const t=i.parentNode;i=i.parentElement||(t&&t.nodeType===t.DOCUMENT_FRAGMENT_NODE?t.host:null)}return!1}function xr(t){return kr(t)?[t]:t.nodeType!==t.ELEMENT_NODE?[]:Array.from(t.querySelectorAll("script")).filter(kr)}const Cr=3e5;function Mr(t){return H(t)?t.network_timing:t}const Tr=/^please (take full snapshot|add custom event) after start recording$/,Ir=he("[SessionRecording]"),Ar=[1,2,3,4,5,6,7,12],Rr=t=>({rrwebMethod:t,enqueuedAt:Date.now(),attempt:1});function Er(){var t;return null==o||null===(t=o.__PosthogExtensions__)||void 0===t?void 0:t.rrweb}function Or(){var t;return null===(t=Er())||void 0===t?void 0:t.record}function $r(t){try{return JSON.stringify(t)}catch(e){if(e instanceof RangeError)throw e;return JSON.stringify(t,On())}}function Lr(t){return pi(vi(function(t){var e=t.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(t);for(var n=new Fn(t.length+(t.length>>>1)),i=0,r=function(t){n[i++]=t},o=0;e>o;++o){if(i+5>n.length){var s=new Fn(i+8+(e-o<<1));s.set(n),n=s}var a=t.charCodeAt(o);128>a?r(a):2048>a?(r(192|a>>>6),r(128|63&a)):a>55295&&57344>a?(r(240|(a=65536+(1047552&a)|1023&t.charCodeAt(++o))>>>18),r(128|a>>>12&63),r(128|a>>>6&63),r(128|63&a)):(r(224|a>>>12),r(128|a>>>6&63),r(128|63&a))}return ei(n,0,i)}($r(t))),!0)}function Dr(t){return Fr.apply(this,arguments)}function Fr(){return(Fr=A(function*(t){const e=yield oe($r(t),Ti.DEBUG,{rethrow:!0});return pi(new Uint8Array(yield e.arrayBuffer()),!0)})).apply(this,arguments)}let Pr,Nr;const qr="undefined"!=typeof globalThis&&"CompressionStream"in globalThis&&"TextEncoder"in globalThis&&"Response"in globalThis&&"function"==typeof Response.prototype.blob;let jr=!1;function Br(t){var e;return U(t)&&0===t.length?(Pr=null!==(e=Pr)&&void 0!==e?e:Lr([]),Pr):Lr(t)}function zr(t){return Ur.apply(this,arguments)}function Ur(){return(Ur=A(function*(t){var e;return U(t)&&0===t.length?Pr||(Nr=null!==(e=Nr)&&void 0!==e?e:Dr([]).then(t=>(Pr=t,t)).catch(t=>{throw Pr=void 0,Nr=void 0,t}),Nr):Dr(t)})).apply(this,arguments)}function Wr(t){return qr&&!jr&&function(t){return 2===t.type||3===t.type&&(0===t.data.source||8===t.data.source)}(t)}function Hr(t){return{event:t,size:Ln(t)}}function Gr(t,e){return L(L({},t),{},{data:e,cv:"2024-10"})}function Vr(t,e){return L(L({},t),{},{cv:"2024-10",data:L(L({},t.data),e)})}function Qr(t){try{if(2===t.type)return Hr(Gr(t,Lr(t.data)));if(3===t.type&&0===t.data.source)return Hr(Vr(t,{texts:Br(t.data.texts),attributes:Br(t.data.attributes),removes:Br(t.data.removes),adds:Br(t.data.adds)}));if(3===t.type&&8===t.data.source)return Hr(Vr(t,{adds:t.data.adds?Lr(t.data.adds):void 0,removes:t.data.removes?Lr(t.data.removes):void 0}))}catch(t){Ir.warn("could not compress event - will use uncompressed event",t)}return{event:t,size:$n(t)}}function Zr(){return Zr=A(function*(t){try{if(2===t.type)return Hr(Gr(t,yield Dr(t.data)));if(3===t.type&&0===t.data.source){const[e,n,i,r]=yield Promise.all([zr(t.data.texts),zr(t.data.attributes),zr(t.data.removes),zr(t.data.adds)]);return Hr(Vr(t,{texts:e,attributes:n,removes:i,adds:r}))}if(3===t.type&&8===t.data.source){const[e,n]=yield Promise.all([t.data.adds?Dr(t.data.adds):void 0,t.data.removes?Dr(t.data.removes):void 0]);return Hr(Vr(t,{adds:e,removes:n}))}}catch(e){return(t=>{if(!t||"object"!=typeof t)return!1;const e="name"in t?String(t.name):"";return(t=>!(!t||"object"!=typeof t)&&"NotReadableError"===("name"in t?String(t.name):""))(t)||e===Xt})(e)&&(jr=!0),Ir.warn("could not compress event asynchronously - trying synchronous compression",e),Qr(t)}return{event:t,size:$n(t)}}),Zr.apply(this,arguments)}function Jr(t,e){return 5===t.type&&t.data.tag===e}function Yr(t){return Jr(t,"sessionIdle")}function Kr(t){return Jr(t,"$session_ending")}function Xr(t){return Jr(t,"$session_starting")}var to=class{get sessionId(){return this.Xt}get te(){if(!this._instance.sessionManager)throw new Error("[SessionRecording] must be started with a valid sessionManager.");return this._instance.sessionManager}get ee(){return this._instance.config.session_recording.session_idle_threshold_ms||3e5}get ne(){return Zi(this._instance.get_property(h),this.sessionId)}get Ut(){var t;const e=null===(t=this.ie)||void 0===t?void 0:t.sampleRate;return Y(e)?e:null}get re(){var t,e;return null!==(t=null===(e=this.oe)||void 0===e?void 0:e.getMinimumDuration(this.sessionId))&&void 0!==t?t:null}constructor(t,e){this._instance=t,this.supportsSelectMasking=!0,this.se="/s/",this._forceAllowLocalhostNetworkCapture=!1,this.ae=void 0,this.le=void 0,this.ue=!1,this.ce=Date.now(),this.de=!1,this.he=[],this.fe="unknown",this.ve=0,this.pe=0,this.me=0,this.ge=0,this.ye=0,this.be=!1,this.we=!1,this.ke=!1,this.Se=!1,this._e=!1,this.xe=!1,this.Ce=0,this.Me=void 0,this.Te=void 0,this.Ie=0,this.Ae=void 0,this.Re=void 0,this.Ee=0,this.Oe=!1,this.$e=!1,this.Le=!1,this.De=!1,this.Fe=!1,this.Pe=!1,this.Ne=!1,this.qe=void 0,this.je=void 0,this.Be=!1,this.ze=[],this.Ue=0,this.We=0,this.He=!1,this.Ge=void 0,this.Gt=void 0,this.Ve=void 0,this.Qe=void 0,this.Ze=void 0,this.Je=(t,e,n)=>{var i,r,o,s;if(!n)return;if(t===this.Xt&&e===this.Ye)return;const a=!n.noSessionId&&(n.activityTimeout||n.sessionPastMaximumLength),l=this.Xt,u=this.Ye;var c;if(a&&this.Vt("$session_ending",{currentSessionId:l,currentWindowId:u,nextSessionId:t,nextWindowId:e,changeReason:n,lastActivityTimestamp:this.ce,flushed_size:null===(c=this.Ke)||void 0===c?void 0:c.currentTrackedSize(l)}),null===(i=this._instance.persistence)||void 0===i||i.unregister("$debug_first_full_snapshot_timestamp"),null===(r=Er())||void 0===r||null===(o=r.resetMaxDepthState)||void 0===o||o.call(r),this.Vt("$session_id_change",{sessionId:t,windowId:e,changeReason:n}),this.Xe(),!(!1===this.fe&&this.isStarted||this.Xt===t&&this.Ye===e)){const e=this.Xt!==t&&!1!==this.fe;this.fe="unknown",this.tn(e)}a&&this.Vt("$session_starting",{previousSessionId:l,previousWindowId:u,nextSessionId:t,nextWindowId:e,changeReason:n,lastActivityTimestamp:this.ce}),null===(s=this.oe)||void 0===s||s.makeSamplingDecisions(t)},this.en=!1,this.nn=()=>{var t;return(null===(t=this._instance.persistence)||void 0===t?void 0:t.props.$session_past_minimum_duration)===this.Xt},this.rn=()=>{var t,e;if(0===this.Rt.data.length)return null;const n=null===(t=this.Rt.data[0])||void 0===t?void 0:t.timestamp,i=null===(e=this.Rt.data[this.Rt.data.length-1])||void 0===e?void 0:e.timestamp;return Y(n)&&Y(i)?i-n:null},this.sn=()=>{var t,e;const n=this.re;if(!Y(n))return!1;if(null===(t=null===(e=this._instance.config.session_recording)||void 0===e?void 0:e.strictMinimumDuration)||void 0===t||!t){const t=this.an;return Y(t)&&t>=0&&n>t}if(this.nn())return!1;const i=this.rn();return!!Z(i)||n>i||(null===(r=this._instance.persistence)||void 0===r||r.register({$session_past_minimum_duration:this.Xt}),!1);var r},this.ln=()=>{"buffering"!==this.status?(this.be&&this.we&&this.un&&(this.cn(void 0),this.ke&&(this.ke=!1,this.Bt())),this.dn(),this.hn(!0)):this.fn()},this.vn=()=>{this.ln()},this.pn=()=>{this.Vt("browser offline",{})},this.mn=()=>{this.Vt("browser online",{})},this.gn=()=>{(null==n?void 0:n.visibilityState)&&("visible"===n.visibilityState&&(this.un=!0),this.Vt("window "+n.visibilityState,{}))},this.un=null==e||e;const{sessionId:i,windowId:r,sessionStartTimestamp:o}=this.te.checkAndGetSessionAndWindowId();this.Xt=i,this.Ye=r,this._sessionStartTimestamp=o,this.nt=new Tn(this._instance),this.tt=new Mn(this._instance),this.et=new In(this._instance),this.Rt=this.fn(),this.yn=function(t){return"ph_replay_pending_buffer_"+JSON.stringify([t.persistence_name||t.token,t.token])}(this._instance.config),this.te.sessionTimeoutMs>this.ee||Ir.warn(`session_idle_threshold_ms (${this.ee}) is greater than the session timeout (${this.te.sessionTimeoutMs}). Session will never be detected as idle`),this.Ke=new Ii(this._instance)}setDocumentWasEverVisible(t){t&&(this.un=!0)}get bn(){var t,e,n,i,r,o,s,a,l;const u=null===(t=this.ie)||void 0===t?void 0:t.masking,c={maskAllInputs:null===(e=this._instance.config.session_recording)||void 0===e?void 0:e.maskAllInputs,maskTextSelector:null===(n=this._instance.config.session_recording)||void 0===n?void 0:n.maskTextSelector,blockSelector:null===(i=this._instance.config.session_recording)||void 0===i?void 0:i.blockSelector,maskAllElementAttributes:null===(r=this._instance.config.session_recording)||void 0===r?void 0:r.maskAllElementAttributes},d=null!==(o=null==c?void 0:c.maskAllInputs)&&void 0!==o?o:null==u?void 0:u.maskAllInputs,h=null!==(s=null==c?void 0:c.maskTextSelector)&&void 0!==s?s:null==u?void 0:u.maskTextSelector,f=null!==(a=null==c?void 0:c.blockSelector)&&void 0!==a?a:null==u?void 0:u.blockSelector,v=null!==(l=null==c?void 0:c.maskAllElementAttributes)&&void 0!==l?l:null==u?void 0:u.maskAllElementAttributes;return G(d)&&G(h)&&G(f)&&G(v)?void 0:{maskAllInputs:null==d||d,maskTextSelector:h,blockSelector:f,maskAllElementAttributes:v}}wn(){var t;if(this.Le)return;const e=null===(t=this.ie)||void 0===t?void 0:t.masking;if(J(e))return;const n=this._instance.config.session_recording,i=["maskAllInputs","maskTextSelector","blockSelector","maskAllElementAttributes"].filter(t=>{const i=null==n?void 0:n[t],r=e[t];return!G(i)&&i!==r});0!==i.length&&(this.Le=!0,Ir.warn('Session recording masking is configured both in `posthog.init` and in your project settings, and they differ. The `session_recording` options in `posthog.init` take precedence, so the project ("Privacy and masking") setting is ignored for: '+i.join(", ")+". Remove these masking options from `posthog.init` to use the project setting instead. See https://posthog.com/docs/session-replay/privacy",{client:{maskAllInputs:null==n?void 0:n.maskAllInputs,maskTextSelector:null==n?void 0:n.maskTextSelector,blockSelector:null==n?void 0:n.blockSelector,maskAllElementAttributes:null==n?void 0:n.maskAllElementAttributes},project:e}))}get kn(){var t;return ot(null===(t=this._instance.config.session_recording.canvasCapture)||void 0===t?void 0:t.resolutionScale,.1,1,he("canvas recording resolution scale"),1)}get Sn(){var t,e,n,i,r,o,s;const a=this._instance.config.session_recording.captureCanvas,l=null===(t=this.ie)||void 0===t?void 0:t.canvasRecording,u=null!==(e=null!==(n=null==a?void 0:a.recordCanvas)&&void 0!==n?n:null==l?void 0:l.enabled)&&void 0!==e&&e,c=null!==(i=null!==(r=null==a?void 0:a.canvasFps)&&void 0!==r?r:null==l?void 0:l.fps)&&void 0!==i?i:4;let d=null!==(o=null!==(s=null==a?void 0:a.canvasQuality)&&void 0!==s?s:null==l?void 0:l.quality)&&void 0!==o?o:.4;if("string"==typeof d){const t=parseFloat(d);d=isNaN(t)?.4:t}return{enabled:u,fps:ot(c,0,12,he("canvas recording fps"),4),quality:ot(d,0,1,he("canvas recording quality"),.4)}}get _n(){var t;const e=!!(null===(t=this.ie)||void 0===t?void 0:t.consoleLogRecordingEnabled),n=this._instance.config.enable_recording_console_log;return null!=n?n:e}get xn(){var t,e,n;const i=null===(t=this.ie)||void 0===t?void 0:t.networkPayloadCapture,r={recordHeaders:null===(e=this._instance.config.session_recording)||void 0===e?void 0:e.recordHeaders,recordBody:null===(n=this._instance.config.session_recording)||void 0===n?void 0:n.recordBody},o=!1!==r.recordHeaders&&(r.recordHeaders||(null==i?void 0:i.recordHeaders)),s=!1!==r.recordBody&&(r.recordBody||(null==i?void 0:i.recordBody)),a=Mr(this._instance.config.capture_performance),l=Mr(null==i?void 0:i.capturePerformance),u=!!(K(a)?a:l);return o||s||u?{recordHeaders:o,recordBody:s,recordPerformance:u}:void 0}Cn(){var t,e;const n=[],r=null===(t=o.__PosthogExtensions__)||void 0===t||null===(t=t.rrwebPlugins)||void 0===t?void 0:t.getRecordConsolePlugin;r&&this._n&&n.push(r());const s=null===(e=o.__PosthogExtensions__)||void 0===e||null===(e=e.rrwebPlugins)||void 0===e?void 0:e.getRecordNetworkPlugin;if(this.xn&&W(s))if(!ye.includes(i.hostname)||this._forceAllowLocalhostNetworkCapture){const t=W(this._instance.requestRouter.isIngestionEndpoint)?this._instance.requestRouter.isIngestionEndpoint.bind(this._instance.requestRouter):void 0;n.push(s(L(L({},((t,e,n)=>{const i={payloadSizeLimitBytes:Xe.payloadSizeLimitBytes,performanceEntryTypeToObserve:[...Xe.performanceEntryTypeToObserve],payloadHostDenyList:[...e.payloadHostDenyList||[],...Xe.payloadHostDenyList]},r=!1!==t.session_recording.recordHeaders&&e.recordHeaders,o=!1!==t.session_recording.recordBody&&e.recordBody,s=!1!==t.capture_performance&&e.recordPerformance,a=(t=>{const e=Ke(t);return t=>((null==t?void 0:t.requestBody)&&(t.requestBody=sn(t.requestBody,t.requestHeaders,e,"Request")),(null==t?void 0:t.responseBody)&&(t.responseBody=sn(t.responseBody,t.responseHeaders,e,"Response")),t)})(i),l=e=>{return a(((t,e,n)=>{var i;if(null==n?void 0:n(t.name))return;const r=ge(t.name);let o=0===e.indexOf("http")?null===(i=ge(e))||void 0===i?void 0:i.pathname:e;"/"===o&&(o="");const s=null==r?void 0:r.pathname.replace(o||"","");return r&&s&&on.some(t=>0===s.indexOf(t))?void 0:t})((rn((i=e).requestHeaders),rn(i.responseHeaders),i),t.api_host,n));var i},u=W(t.session_recording.maskNetworkRequestFn);return u&&W(t.session_recording.maskCapturedNetworkRequestFn)?de.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."):u&&(t.session_recording.maskCapturedNetworkRequestFn=e=>{const n=t.session_recording.maskNetworkRequestFn({url:e.name});if(n||!e.isInitial)return L(L({},e),{},{name:null==n?void 0:n.url})}),i.maskRequestFn=W(t.session_recording.maskCapturedNetworkRequestFn)?e=>{var n,i;const r=l(e);if(!r)return;const o=r.isInitial?{name:"",entryType:r.entryType,startTime:r.startTime,duration:r.duration,endTime:r.endTime,timeOrigin:r.timeOrigin,timestamp:r.timestamp,isInitial:!0}:void 0,s=null===(n=(i=t.session_recording).maskCapturedNetworkRequestFn)||void 0===n?void 0:n.call(i,r);return J(s)&&o?(ln.add(o),o):null!=s?s:void 0}:t=>function(t){if(!G(t))return t.requestBody=an(t.requestBody,"Request"),t.responseBody=an(t.responseBody,"Response"),t}(l(t)),L(L(L({},Xe),i),{},{recordHeaders:r,recordBody:o,recordPerformance:s,recordInitialRequests:s,streamNetworkBody:!0===t.session_recording.streamNetworkBody})})(this._instance.config,this.xn,t)),{},{captureFetchSynchronously:!0===this._instance.config.__preview_replay_sync_fetch,returnFetchResponseEarly:!0===this._instance.config.__preview_replay_early_fetch_response})))}else Ir.info("NetworkCapture not started because we are on localhost.");return n}Mn(t){return this._instance.config.disable_capture_url_hashes?St(t):t}Tn(t,e=!1){const n=e?St(t):this.Mn(t),i=this._instance.config.mask_personal_data_properties?[...tr,...this._instance.config.custom_personal_data_properties||[]]:[];return this.In(function(t,e){if(!t||!e||!e.length)return t;const n=t.split(/#(.*)/),i=n[1],r=(n[0]||"").split(/\?(.*)/),o=r[1],s=r[0],a=(o||"").split("&"),l=[];for(let t=0;a.length>t;t++){const n=a[t].split("?");let i=0;for(;n.length>i&&!e.includes(n[i].split("=")[0]);)i++;l.push(n.length>i?n.slice(0,i).concat(n[i].split("=")[0]+"=<masked>").join("?"):a[t])}let u=s;return null!=o&&(u+="?"+l.join("&")),null!=i&&(u+="#"+i),u}(n,i))}In(t){const e=this._instance.config.session_recording;if(e.maskCapturedNetworkRequestFn){var n;const i=e.maskCapturedNetworkRequestFn({name:t});return null!==(n=null==i?void 0:i.name)&&void 0!==n?n:null==i?void 0:i.url}if(e.maskNetworkRequestFn){const n=e.maskNetworkRequestFn({url:t});return null==n?void 0:n.url}return t}An(t){try{return t.rrwebMethod(),!0}catch(r){var e,n,i;this.Ce+=1;const o=String(null!==(e=null==r?void 0:r.message)&&void 0!==e?e:r);return this.Me=Tr.test(o)?o:"other",this.Te=null===(n=Or())||void 0===n||null===(i=n.isRecording)||void 0===i?void 0:i.call(n),10>this.he.length?this.he.push({enqueuedAt:t.enqueuedAt||Date.now(),attempt:t.attempt+1,rrwebMethod:t.rrwebMethod}):Ir.warn("could not emit queued rrweb event.",r,t),!1}}Vt(t,e){return this.An(Rr(()=>Or().addCustomEvent(t,e)))}Rn(){var t;return this.ue&&!0===(null===(t=this._instance.config.session_recording)||void 0===t?void 0:t.captureJsonLd)&&!this.tt.urlBlocked&&!0!==this.fe}En(t){if(!this.Rn())return!1;try{const e=Or();return!!e&&(e.addCustomEvent("$json_ld",t),this.Rn())}catch(t){return!1}}On(t=!1){Promise.resolve().then(()=>{var e;return null===(e=this.$n)||void 0===e?void 0:e.scan(t)})}Ln(){try{if(this._instance.config.capture_pageview||!t)return;const e=new URL(t.location.href),n=this.Tn(e.origin+e.pathname+e.search);this.Dn!==n&&(this.Dn=n,this.Vt("$url_changed",{href:n}))}catch(t){}}Fn(){if(this.he.length){const t=[...this.he];this.he=[],t.forEach(t=>{Date.now()-t.enqueuedAt>2e3||this.An(t)})}}Bt(){const t=this.An(Rr(()=>Or().takeFullSnapshot())),e=this.ae;return!t&&e&&setTimeout(()=>this.Pn(e),0),t}Pn(t){var e,i;const r=Date.now();if(this.ae!==t||this.Ae||G(this.qe)||this.Nn||!["interactive","complete"].includes(null!==(e=null==n?void 0:n.readyState)&&void 0!==e?e:"")||!G(this.Re)&&Cr>r-this.Re)return;this.Re=r,this.Ee+=1,Ir.warn("rrweb stopped recording while replay was started, restarting it");const o=()=>{this.ae=void 0;const e={stopRequested:!1,startRequested:!1};this.Ae=e;try{this.qn(t)}finally{this.Ae=void 0}this.he=[],e.stopRequested&&!e.startRequested||this._instance.config.disable_session_recording||this._instance.has_opted_out_capturing()||this.jn()},s=null===(i=Or())||void 0===i?void 0:i.withStyleRuleSourceHandoff;this.Oe=!0;try{s?s(t,o):o()}finally{this.Oe=!1}this.isStarted&&this.Vt("$replay_recorder_restarted",{reason:"rrweb_not_recording"})}get Bn(){var t,e,n;if((null===(t=this.oe)||void 0===t?void 0:t.hasPendingTriggers(this.sessionId))&&!["sampled","active"].includes(this.status)){var i;const t=null===(i=this._instance.config.session_recording)||void 0===i?void 0:i.trigger_pending_buffer_interval_millis;return Y(t)&&Number.isFinite(t)&&t>=1e3&&36e5>=t?t:6e4}return null!==(e=null===(n=this._instance.config.session_recording)||void 0===n?void 0:n.full_snapshot_interval_millis)&&void 0!==e?e:Cr}zn(){if(this.Un&&clearInterval(this.Un),!0===this.fe)return;const t=this.Bn;t&&(this.Un=setInterval(()=>{this.Bt()},t))}zt(t){"event"===t&&this.Wn(),!this.tt.urlBlocked&&["sampled","active"].includes(this.status)&&this.zn()}Hn(){var t;this.tt.urlBlocked||(this.tt.urlBlocked=!0,null===(t=this.$n)||void 0===t||t.scan(),clearInterval(this.Un),Ir.info("recording paused due to URL blocker"),this.Vt("recording paused",{reason:"url blocker"}))}Gn(){var t;this.tt.urlBlocked&&(null===(t=this.$n)||void 0===t||t.scan(),this.tt.urlBlocked=!1,this.Bt(),this.On(),this.zn(),this.Vt("recording resumed",{reason:"left blocked url"}),Ir.info("recording resumed"))}Vn(t,e){var n;if("event"===t&&this.Wn(),!this.de&&(null===(n=this.oe)||void 0===n?void 0:n.hasPendingTriggers(this.sessionId))){this.de=!0;try{var i,r;const n="url"===t?f:v;null===(i=this._instance.persistence)||void 0===i||i.register({[n]:this.sessionId}),null===(r=this.oe)||void 0===r||r.updateActiveTriggers(this.sessionId),this.zt(),this.hn(),this.jt(t+"_trigger_matched",{["url"===t?"matchedUrl":"matchedEvent"]:e})}finally{this.de=!1}}}get isStarted(){return!!this.ae}get ie(){const t=this._instance.get_property("$session_recording_remote_config");if(!t)return;let e;try{e=H(t)?t:JSON.parse(t)}catch(t){return void Ir.warn("persisted remote config for session recording is invalid and will be ignored",t)}if(!this.isStarted&&!this.en&&!this.Oe){var n;const i=null!==(n=e.cache_timestamp)&&void 0!==n?n:Date.now();if(Date.now()-i>36e5)return void Ir.info("persisted remote config for session recording is stale and will be ignored",{cacheTimestamp:i,persistedConfig:t})}return e}Qn(t,e,n){this._instance.get_property(t)&&(e(),n())}start(e){var i,r;const o=this.ie;if(!o)return void Ir.info("remote config must be stored in persistence before recording can start");if(!this.isStarted){const t=!1!==this.fe&&!this.Se;this.cn(t?"no_interaction_since_recording_started":void 0),this.Se=!1,this.we=t,this.ke=!1}this.He&&(this.Zn(),this.fn());const{sessionId:s,windowId:a,sessionStartTimestamp:h}=this.te.checkAndGetSessionAndWindowId();this.Xt=s,this.Ye=a,this._sessionStartTimestamp=h,this.Jn(),null===(i=this._instance.persistence)||void 0===i||i.unregister("$debug_first_full_snapshot_timestamp"),(null==o?void 0:o.endpoint)&&(this.se=null==o?void 0:o.endpoint),this.oe=2===(null==o?void 0:o.version)&&(null==o?void 0:o.triggerGroups)&&o.triggerGroups.length>0?new Yi(this._instance,this.tt,this.jt.bind(this),this.Vt.bind(this),this.zt.bind(this)):new Ji(this._instance,this.tt,this.et,this.nt,this.jt.bind(this),this.Bt.bind(this),this.zt.bind(this)),this.oe.onRemoteConfig(o),null===(r=this.Gt)||void 0===r||r.call(this),this.Gt=this.oe.setupEventTriggerListeners(this._instance.on.bind(this._instance,"eventCaptured"),this.sessionId,(t,e)=>this.Vn(t,e)),this.Qn(l,()=>{this.overrideSampling()},()=>{var t;return null===(t=this._instance.persistence)||void 0===t?void 0:t.unregister(l)}),this.Qn(u,()=>{this.overrideLinkedFlag()},()=>{var t;return null===(t=this._instance.persistence)||void 0===t?void 0:t.unregister(u)}),this.Qn(d,()=>{this.overrideTrigger("event")},()=>{var t;return null===(t=this._instance.persistence)||void 0===t?void 0:t.unregister(d)}),this.Qn(c,()=>{this.overrideTrigger("url")},()=>{var t;return null===(t=this._instance.persistence)||void 0===t?void 0:t.unregister(c)}),this.oe.makeSamplingDecisions(this.sessionId),this.jn(),!this._e&&this.isStarted&&(me(t,"beforeunload",this.ln),me(t,"pagehide",this.vn),me(t,"offline",this.pn),me(t,"online",this.mn),me(n,"visibilitychange",this.gn),!this.Ve&&W(this.te.onSessionId)&&(this.Ve=this.te.onSessionId(this.Je)),!this.Qe&&W(this.te.on)?this.Qe=this.te.on("forcedIdleReset",()=>{this.Xe(),this.fe="unknown",this.stop(),this.Ze=this.te.onSessionId((t,e,n)=>{var i;null===(i=this.Ze)||void 0===i||i.call(this),this.Ze=void 0,this.Je(t,e,n)})}):W(this.te.on)||Ir.warn("bundled core has no SessionIdManager.on (requires posthog-js >= 1.268.6); recording will start but skip forced-idle-reset handling"),J(this.Ge)&&(this.Ge=this._instance.on("eventCaptured",t=>{try{if("$pageview"===t.event){const e=(null==t?void 0:t.properties.$current_url)?this.Tn(t.properties.$current_url):"";if(!e)return;this.Vt("$pageview",{href:e})}}catch(t){Ir.error("Could not add $pageview to rrweb session",t)}})),"active"===this.status&&this.jt(e||"recording_initialized"))}Yn(e=!1){var i,r,o,s,a,l;null==t||t.removeEventListener("beforeunload",this.ln),null==t||t.removeEventListener("pagehide",this.vn),null==t||t.removeEventListener("offline",this.pn),null==t||t.removeEventListener("online",this.mn),null==n||n.removeEventListener("visibilitychange",this.gn),clearInterval(this.Un),this.Kn(),null===(i=this.Ge)||void 0===i||i.call(this),this.Ge=void 0,null===(r=this.Gt)||void 0===r||r.call(this),this.Gt=void 0,null===(o=this.Ve)||void 0===o||o.call(this),this.Ve=void 0,null===(s=this.Qe)||void 0===s||s.call(this),this.Qe=void 0,null===(a=this.Ze)||void 0===a||a.call(this),this.Ze=void 0,null===(l=this.oe)||void 0===l||l.stop(),this.Xn(e),this.Zn()}Zn(){this.We+=1,this.ze=[],this.Ue=0,this.ti=void 0,this.He=!1}Xn(t=!1){var e,n,i;t||null===(i=this.le)||void 0===i||i.cancel(),null===(e=this.ei)||void 0===e||e.stop(),this.he=[],null===(n=this.$n)||void 0===n||n.stop(),this.$n=void 0,this.ue=!1,this.Ae&&(this.Ae.stopRequested=!0,this.Ae.startRequested=!1),this.ae&&this.qn(this.ae),this.ae=void 0}qn(t){this.Ie-=1;try{t()}catch(t){Ir.warn("could not stop rrweb",t)}}ni(){if(!this.ti||0===this.Ue)return!1;if(this.He)return!0;this.He=!0,this.ii=void 0;const t=this.We;return this.Kn(),this.Xn(),this.ti.catch(()=>{}).then(()=>{t===this.We&&(this.He=!1,this.hn(),this.fn(),this.ri(),this.Yn(),Ir.info("stopped"))}).catch(()=>{this.He=!1,this.ri(),this.Yn(),Ir.info("stopped")}),!0}stop(t=!1){if(this.Xn(t),this.en)this.dn();else if(this.ni())return;this.hn(),this.fn(),this.ri(),this.Yn(t),Ir.info("stopped")}ri(){this.cn(void 0,{preserveLogDedup:this.en}),this.we=!1}flushBeforeIdentityReset(){(this.isStarted||this.He)&&(this.dn(),this.hn())}tn(t){const e=this.le,n=this.en;let i;this.en=!0,this.ce=Date.now();const r={cancelled:!1,cancel(){r.cancelled=!0,null==e||e.cancel(),null==i||i()}};this.le=r;const o=()=>{var t,e;this.stop(!0),r.cancelled||this._instance.config.disable_session_recording||this._instance.has_opted_out_capturing()?r.cancel():(this.oi=void 0,this.ye=0,this.pe=0,this.me=0,this.ge=0,this.Ce=0,this.Me=void 0,this.Te=void 0,null===(t=Er())||void 0===t||null===(e=t.resetSnapshotCostState)||void 0===e||e.call(t),this.start("session_id_changed"),(r.cancelled&&!this.isStarted||this._instance.config.disable_session_recording||this._instance.has_opted_out_capturing())&&(r.cancel(),this.discard({discardProducerEvents:!0})))};try{var s;const t=null===(s=Or())||void 0===s?void 0:s.withStyleRuleSourceHandoff;t&&this.ae?t(this.ae,t=>{i=t,o()}):o()}finally{this.le=e,this.en=n}r.cancelled||(this.cn(t?"no_interaction_since_session_rotated":void 0),this.we=!1)}cn(t,{preserveLogDedup:e=!1}={}){if(this.be=!G(t),this.ii=t,G(t))return void(e||(this.si=void 0));if(this.en)return;const n=`${this.sessionId}:${t}`;n!==this.si&&(this.si=n,Ir.info(`holding buffer: ${t}. nothing is uploaded until the user interacts with the page`))}Wn(){this.isStarted||(this.Se=!0),this.be&&(this.cn(void 0),this.we=!1,this.ke&&(this.ke=!1,this.Bt()),this.ai())}discard({discardProducerEvents:t=!1}={}){t&&(this.li||this._instance.config.session_recording.selectMaskingFn)&&Mi.Dt(this.yn),this.be=!0,t&&(this.fn(),this.Xn()),this.fn(),this.Yn(),this.fn(),this.ri(),Ir.info("discarded")}ui(t,e,n,i,r){if(-1===n)return this.ye+=1,void Ir.warn("could not stringify event - dropping it to keep the rest of the recording");const o={$snapshot_bytes:n,$snapshot_data:e,$session_id:i,$window_id:r};"disabled"!==this.status?(this.ci(t,i),this.di(o)):this.fn()}hi(){try{this.fi()}catch(t){this.$e||(this.$e=!0,Ir.error("could not track full snapshot cost",t))}}fi(){var t,e;const n=null===(t=Er())||void 0===t||null===(e=t.getLastSnapshotCost)||void 0===e?void 0:e.call(t);n&&n!==this.oi&&(this.oi=n,500>n.durationMs||Ir.warn("full snapshot was slow, the page may have been unresponsive while it ran",{durationMs:Math.round(n.durationMs),stylesheetMs:Math.round(n.stylesheetMs),nodeCount:n.nodeCount,cssRuleCount:n.cssRuleCount,nonDeferrableCssRuleCount:n.nonDeferrableCssRuleCount,deferredStylesheetCount:n.deferredStylesheetCount}))}ci(t,e){2!==t.type?3===t.type&&(G(this.qe)||this.qe===e||this.je===e||(this.je=e,Ir.info("incremental snapshot for a session with no full snapshot - requesting one",{sessionId:e}),this.Bt())):this.qe=e}pi(t){t.counted&&t.generation===this.We&&(this.Ue=Math.max(0,this.Ue-1)),t.counted=!1,this.ze=this.ze.filter(e=>e!==t)}mi(t,e,n){t.processed||t.generation!==this.We||(t.processed=!0,this.ui(t.event,e,n,t.targetSessionId,t.targetWindowId))}gi(t){try{let e,n=t.event;if(t.compressionEnabled)try{({event:n,size:e}=Qr(t.event))}catch(t){Ir.warn("could not process queued compression event - will use uncompressed event",t)}G(e)&&(e=$n(t.event));try{this.mi(t,n,e)}catch(t){Ir.warn("could not capture queued compression event",t)}}finally{this.pi(t)}}dn(){[...this.ze].forEach(t=>{try{this.gi(t)}catch(t){Ir.warn("could not drain queued compression event",t)}})}yi(t,e,n,i){var r=this;const o={event:t,compressionEnabled:e,targetSessionId:n,targetWindowId:i,generation:this.We,processed:!1,counted:!0};this.ze.push(o),this.Ue+=1;const s=(a=A(function*(){try{if(o.processed)return;let n,i;try{const r=e?Wr(t)?yield function(t){return Zr.apply(this,arguments)}(t):Qr(t):{event:t,size:$n(t)};n=r.event,i=r.size}catch(e){Ir.warn("could not process queued compression event - will use uncompressed event",e),n=t,i=$n(t)}r.mi(o,n,i)}finally{r.pi(o)}}),function(){return a.apply(this,arguments)});var a;this.ti=this.ti?this.ti.catch(()=>{}).then(s):s()}onRRwebEmit(e,n){var i,r,o,s,a,l,u,c,d,h,f;if(!this._instance.sessionManager)return;if(this.Fn(),!e||!H(e))return;if(4===e.type){const t=this.Tn(e.data.href);if(this.Dn=t,!t)return;e.data.href=t}else this.Ln();if(null===(i=this.oe)||void 0===i||i.checkUrlTriggers(this.sessionId,()=>this.Hn(),()=>this.Gn(),(t,e)=>this.Vn(t,e)),this.tt.urlBlocked&&!function(t){return 5===t.type&&"recording paused"===t.data.tag}(e))return;2===e.type&&(this.hi(),Promise.resolve().then(()=>this.hi()),this.zn(),null===(h=this.ei)||void 0===h||h.reset(),null===(f=this._instance.persistence)||void 0===f||f.register_once({$debug_first_full_snapshot_timestamp:e.timestamp},void 0));const v=2===e.type&&(null===(r=this.oe)||void 0===r?void 0:r.hasPendingTriggers(this.sessionId));v&&this.bi();const p=this.ei?this.ei.throttleMutations(e):e;if(!p)return void(!0===this.fe&&this.ve++);const m=function(t){const e=t;if(e&&H(e)&&6===e.type&&H(e.data)&&"rrweb/console@1"===e.data.plugin){e.data.payload.payload.length>10&&(e.data.payload.payload=e.data.payload.payload.slice(0,10),e.data.payload.payload.push("...[truncated]"));const n=[];for(let t=0;e.data.payload.payload.length>t;t++)n.push(e.data.payload.payload[t]&&e.data.payload.payload[t].length>2e3?e.data.payload.payload[t].slice(0,2e3)+"...[truncated]":e.data.payload.payload[t]);return e.data.payload.payload=n,t}return t}(p),g=function(t){return Kr(t)?t.data.payload:null}(m),y=function(t){return Xr(t)?t.data.payload:null}(m),b=function(t){return Yr(t)?t.data.payload:null}(m);g||y?(null==g?void 0:g.lastActivityTimestamp)&&(m.timestamp=g.lastActivityTimestamp):(null==b?void 0:b.sessionId)||this.wi(m,n);const w=null!==(o=null!==(s=null!==(a=null==g?void 0:g.currentSessionId)&&void 0!==a?a:null==y?void 0:y.nextSessionId)&&void 0!==s?s:null==b?void 0:b.sessionId)&&void 0!==o?o:this.Xt,k=null!==(l=null!==(u=null!==(c=null==g?void 0:g.currentWindowId)&&void 0!==c?c:null==y?void 0:y.nextWindowId)&&void 0!==u?u:null==b?void 0:b.windowId)&&void 0!==l?l:this.Ye;if(!0===this.fe&&!function(t){return Yr(t)||Kr(t)||Xr(t)}(m))return void(function(t){return 2===t.type||4===t.type||3===t.type&&9!==t.data.source}(m)&&this.ve++);2===m.type&&(this.ve=0),b&&(m.timestamp=b.lastActivityTimestamp+b.threshold);const S=this.ue;this.ue=!0,v?this.On(!0):S||this.On();const _=null===(d=this._instance.config.session_recording.compress_events)||void 0===d||d;if(5===m.type&&"$json_ld"===m.data.tag){let e;try{e=t?this.Tn(t.location.href):void 0}catch(t){}m.data.href=e}if(this.Ue>0||_&&Wr(m))return void this.yi(m,_,w,k);const{event:x,size:C}=_?Qr(m):{event:m,size:$n(m)};this.ui(m,x,C,w,k)}get status(){return this.oe?this.oe.getStatus({instance:this._instance,sessionId:this.sessionId,isSampled:this.ne,rrwebError:this._e,urlTriggerMatching:this.tt,eventTriggerMatching:this.et,linkedFlagMatching:this.nt,remoteConfig:this.ie}):un}log(t,e="log"){var n;null===(n=this._instance.sessionRecording)||void 0===n||n.onRRwebEmit({type:6,data:{plugin:"rrweb/console@1",payload:{level:e,trace:[],payload:[JSON.stringify(t)]}},timestamp:Date.now()})}overrideLinkedFlag(){this.nt.linkedFlagSeen=!0,this.Bt(),this.Wn(),this.jt("linked_flag_overridden")}overrideSampling(){var t;null===(t=this._instance.persistence)||void 0===t||t.register({$session_is_sampled:this.sessionId,$replay_sample_rate:null}),this.Bt(),this.Wn(),this.jt("sampling_overridden")}overrideTrigger(t){this.Vn(t),this.Wn()}ki(){try{var e;const n=null==t||null===(e=t.location)||void 0===e?void 0:e.href;if(!n)return;const i=this.Tn(n);if(!i)return;return new URL(i).hostname||void 0}catch(t){return}}Kn(){this.Si&&(clearTimeout(this.Si),this.Si=void 0)}ai(){this.Si||(this.Si=setTimeout(()=>{this.hn()},2e3))}xi(){return this.qe!==this.Rt.sessionId&&0!==this.Rt.data.length&&this.Rt.data.every(t=>5===(null==t?void 0:t.type)&&!Kr(t)&&!Xr(t))}Ci(){var t,e;return null!==(t=null===(e=this.oe)||void 0===e?void 0:e.getPendingTriggerConditions(this.sessionId))&&void 0!==t?t:[]}Mi(t){if("buffering"!==t)return G(this.Ti)||this._instance.register_for_session({[k]:[]}),void(this.Ti=void 0);const e=this.Ci();if(0===e.length)return G(this.Ti)||this._instance.register_for_session({[k]:[]}),void(this.Ti=void 0);const n=e.join(", "),i=`${this.sessionId}:${n}`;i!==this.Ti&&(this.Ti=i,this._instance.register_for_session({[k]:e}),Ir.info(`buffering: ${n}`))}Ii(){var t;return"memory"!==this._instance.config.persistence&&!0!==(null===(t=this._instance.persistence)||void 0===t?void 0:t.Ai)&&Mi.Ot()}Ri(){this.li||this._instance.config.session_recording.selectMaskingFn||0!==this.Rt.data.length&&this.Rt.size!==this.Ei&&943718.4>=this.Rt.size&&this.Ii()&&(this.Ei=this.Rt.size,Mi.$t(this.yn,this.Rt))}Jn(){if(this.Be||!this.Ii())return;this.Be=!0;const t=Mi.Pt(this.yn);Mi.Dt(this.yn),!this._instance.config.session_recording.selectMaskingFn&&H(t)&&U(t.data)&&0!==t.data.length&&U(t.sizes)&&t.sizes.length===t.data.length&&Y(t.size)&&t.sessionId===this.Xt&&t.windowId===this.Ye&&(this.Rt.data.length>0||(this.Rt=t))}hn(t=!1){var e;if(this.Kn(),this.be)return this.Rt;if(this.xi())return this.Rt.size>943718.4?this.fn():(t&&this.Ri(),this.Rt);const n=this.Rt;null===(e=this.oe)||void 0===e||e.ensureSamplingDecision(this.sessionId);const i=this.sn(),r=this.status;if(this.Mi(r),"buffering"===r||"paused"===r||"disabled"===r||i)return!t||"active"!==r&&"sampled"!==r||this.Ri(),this.ai(),this.Rt;if(this.Rt!==n)return this.Rt;if(n.data.length>0){var o;const t=this.ki();Dn(n).forEach(e=>{try{var n;null===(n=this.Ke)||void 0===n||n.trackSize(e.sessionId,e.size),this.Oi(L(L(L(L({$snapshot_bytes:e.size,$snapshot_data:e.data,$session_id:e.sessionId,$window_id:e.windowId,$lib:Ti.LIB_NAME,$lib_version:Ti.LIB_VERSION,$snapshot_host:t},this.pe>0?{$sdk_debug_replay_throttled_mutations_dropped:this.pe}:{}),this.me>0?{$sdk_debug_replay_oversized_mutations_dropped:this.me}:{}),this.ge>0?{$sdk_debug_replay_oversized_mutation_bytes_dropped:this.ge}:{}),this.ye>0?{$sdk_debug_replay_unstringifiable_events_dropped:this.ye}:{}))}catch(t){Ir.warn("could not capture snapshot chunk - skipping it",t)}}),G(this.Ei)||(Mi.Dt(this.yn),this.Ei=void 0),null===(o=this.oe)||void 0===o||o.onFlushComplete()}return this.fn()}di(t){var e;const n=2+((null===(e=this.Rt)||void 0===e?void 0:e.data.length)||0),i=t.$session_id,r=this.Rt.sessionId!==i;if(r||!0!==this.fe&&!this.be&&this.Rt.size+t.$snapshot_bytes+n>943718.4){const e=this.Xt;if(this.Rt=this.hn(),this.Xt!==e)return;r&&this.Rt.data.length>0&&(this.Rt=this.fn()),this.Rt.sessionId=i,this.Rt.windowId=t.$window_id}this.be&&(this.ke||this.Rt.size+t.$snapshot_bytes+n>943718.4)?this.ke=!0:(this.Rt.size+=t.$snapshot_bytes,this.Rt.data.push(t.$snapshot_data),this.Rt.sizes.push(t.$snapshot_bytes),!0===this.fe||this.be||this.ai())}Oi(t){this._instance.capture("$snapshot",t,{_url:this._instance.requestRouter.endpointFor("api",this.se),_noTruncate:!0,_batchKey:"recordings",skip_client_rate_limiting:!0})}get an(){var t,e;const n=null===(t=this.Rt)||void 0===t?void 0:t.data[(null===(e=this.Rt)||void 0===e?void 0:e.data.length)-1];return n?n.timestamp-this._sessionStartTimestamp:null}bi(){if(!this.Rt||0===this.Rt.data.length)return this.fn();let t=-1;for(let e=this.Rt.data.length-1;e>=0;e--)if(4===this.Rt.data[e].type){t=e;break}return 0>t?this.fn():(this.Rt.data=this.Rt.data.slice(t),this.Rt.sizes=this.Rt.sizes.slice(t),this.Rt.size=this.Rt.sizes.reduce((t,e)=>t+e,0),this.Rt)}fn(){return this.Rt={size:0,data:[],sizes:[],sessionId:this.Xt,windowId:this.Ye},this.Rt}jt(t,e){this._instance.register_for_session({[T]:t}),Ir.info(t.replace("_"," "),e),"session_id_changed"!==t&&this.Vt("$recording_started",L({reason:t},e))}$i(t,e){var n;return!e&&3===t.type&&-1!==Ar.indexOf(null===(n=t.data)||void 0===n?void 0:n.source)}wi(t,e){const n=this.$i(t,e);n||!0===this.fe||t.timestamp-this.ce>this.ee&&(this.fe=!0,clearInterval(this.Un),this.Vt("sessionIdle",{eventTimestamp:t.timestamp,lastActivityTimestamp:this.ce,threshold:this.ee,bufferLength:this.Rt.data.length,bufferSize:this.Rt.size,sessionId:this.Xt,windowId:this.Ye}),this.hn());const{windowId:i,sessionId:r}=this.te.checkAndGetSessionAndWindowId(!n,t.timestamp);let o=!1;if(n&&(this.ce=t.timestamp,this.fe)){const e="unknown"===this.fe;this.fe=!1,e||(this.Vt("sessionNoLongerIdle",{reason:"user activity",type:t.type}),o=!0)}const s=this.Xt!==r,a=this.Ye!==i;if(this.Ye=i,this.Xt=r,s||a){const t=s&&!1!==this.fe;t&&(this.fe="unknown"),this.tn(t)}else if(n&&this.Wn(),o){var l;const t=["sampled","active"].includes(this.status)||(null===(l=this.oe)||void 0===l?void 0:l.hasPendingTriggers(this.sessionId));this.ve>0&&t&&this.Bt(),this.On(),this.zn()}}Xe(){var t;null===(t=this.oe)||void 0===t||t.clearConditionalRecordingPersistence()}get sdkDebugProperties(){var t;return L(L({$recording_status:this.status,$sdk_debug_replay_flush_hold_reason:this.ii,$sdk_debug_replay_internal_buffer_length:this.Rt.data.length,$sdk_debug_replay_internal_buffer_size:this.Rt.size,$sdk_debug_session_start:this._sessionStartTimestamp,$sdk_debug_replay_flushed_size:null===(t=this.Ke)||void 0===t?void 0:t.currentTrackedSize(this.sessionId),$sdk_debug_replay_rrweb_error:this._e,[C]:this.Nn,[M]:this.xe},this.Ce>0?{$sdk_debug_replay_rrweb_method_failures:this.Ce,$sdk_debug_replay_rrweb_last_method_error:this.Me,$sdk_debug_replay_rrweb_recording_at_failure:this.Te,$sdk_debug_replay_rrweb_live_recorders:this.Ie}:{}),this.Ee>0?{$sdk_debug_replay_rrweb_restarts:this.Ee}:{})}get Nn(){var t,e,n;return!!this.ae&&(null===(t=null===(e=Or())||void 0===e||null===(n=e.isRecording)||void 0===n?void 0:n.call(e))||void 0===t||t)}jn(){var e;if(this.ae)return;if(this.Ae)return void(this.Ae.startRequested=this.Ae.stopRequested);this.xe=!0;const i={blockClass:"ph-no-capture",blockSelector:void 0,ignoreClass:"ph-ignore-input",maskTextClass:"ph-mask",maskTextSelector:void 0,maskTextFn:void 0,maskAllInputs:!0,maskInputOptions:{password:!0},maskInputFn:void 0,selectMaskingFn:void 0,maskAllElementAttributes:!1,maskAttributeFn:void 0,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0,inlineStylesheetBudgetRules:1e4,recordCrossOriginIframes:!1,sampling:void 0,attributeFilter:void 0},r=this._instance.config.session_recording;for(const[t,e]of Object.entries(r||{}))if(t in i)if("maskInputOptions"===t)i.maskInputOptions=L({password:!0},e);else if("sampling"===t){const t=null!=e?e:{},n={};G(t.mousemove)||(n.mousemove=t.mousemove),G(t.mouseInteraction)||(n.mouseInteraction=t.mouseInteraction),i.sampling=n}else i[t]=e;var o,s,a,l;!0===(null==r?void 0:r.captureJsonLd)&&!0!==i.slimDOMOptions&&"all"!==i.slimDOMOptions&&(i.slimDOMOptions=L(L({},i.slimDOMOptions),{},{script:!0})),this.Sn&&this.Sn.enabled&&(i.recordCanvas=!0,i.sampling=L(L({},i.sampling),{},{canvas:this.Sn.fps}),i.dataURLOptions={type:"image/webp",quality:this.Sn.quality},i.canvasResolutionScale=this.kn,i.canvasMasking={configured:()=>{var t;return W(null===(t=this._instance.config.session_recording)||void 0===t||null===(t=t.canvasCapture)||void 0===t?void 0:t.maskRegionsFn)},regionsFn:t=>{var e;const n=null===(e=this._instance.config.session_recording)||void 0===e||null===(e=e.canvasCapture)||void 0===e?void 0:e.maskRegionsFn;if(W(n))try{var i;return null!==(i=n(t))&&void 0!==i?i:null}catch(t){return this.Fe||(this.Fe=!0,Ir.warn("canvasCapture.maskRegionsFn threw, canvas frames will be skipped",t)),null}}}),this.bn&&(i.maskAllInputs=null===(o=this.bn.maskAllInputs)||void 0===o||o,i.maskTextSelector=null!==(s=this.bn.maskTextSelector)&&void 0!==s?s:void 0,i.blockSelector=null!==(a=this.bn.blockSelector)&&void 0!==a?a:void 0,i.maskAllElementAttributes=null!==(l=this.bn.maskAllElementAttributes)&&void 0!==l&&l),i.maskAllElementAttributes&&i.maskAttributeFn&&(i.maskAttributeFn=void 0,this.De||(this.De=!0,Ir.warn('`maskAllElementAttributes` and `maskAttributeFn` are mutually exclusive, and `maskAttributeFn` is being ignored. Remove one of the two. Note that `maskAllElementAttributes` can also come from your project\'s "Privacy and masking" settings. See https://posthog.com/docs/session-replay/privacy'))),this.wn();const u=Or();if(!u)return void Ir.error("_startRecorder was called but rrwebRecord is not available. This indicates something has gone wrong.");if(i.selectMaskingFn&&!0!==u.supportsSelectMasking)return void Ir.error("Session recording has not started: the recorder does not support selectMaskingFn.");this.ei=null!==(e=this.ei)&&void 0!==e?e:new mi(u,{refillRate:this._instance.config.session_recording.__mutationThrottlerRefillRate,bucketSize:this._instance.config.session_recording.__mutationThrottlerBucketSize,onBlockedNode:(t,e)=>{const n=`Too many mutations on node '${t}'. Rate limiting. This could be due to SVG animations or something similar`;Ir.info(n,{node:e}),this.log("[SessionRecording] "+n,"warn")},onDroppedAttributeMutations:t=>this.pe+=t,bytesRefillRate:this._instance.config.session_recording.__mutationBytesRefillRate,bytesBucketSize:this._instance.config.session_recording.__mutationBytesBucketSize,resyncIntervalMs:this.Bn,onDroppedOversizedMutation:t=>{0===this.me&&this.log("[SessionRecording] Dropped an oversized DOM mutation to keep the recording playable. The recording will resync with a full snapshot.","warn"),this.me+=1,this.ge+=t},requestFullSnapshot:()=>this.Bt()});const c=i.selectMaskingFn;this.li=c,c&&(i.selectMaskingFn=t=>{try{return c(t)}catch(t){throw this.Ne||(this.Ne=!0,Ir.warn("selectMaskingFn threw; affected selects are recorded as masked.",t)),t}});const d=this.Cn(),h=this.le,f={stopRequested:!1,startRequested:!1};let v;this.Ae=f;try{v=u(L(L({emit:(t,e,n)=>{(null==h?void 0:h.cancelled)||f.stopRequested||(h&&this.le===h&&(this._instance.config.disable_session_recording||this._instance.has_opted_out_capturing())?h.cancel():this.onRRwebEmit(t,n))},plugins:d,errorHandler:(t,e)=>"rrweb"===e&&(this.Pe||(this.Pe=!0,Ir.error("rrweb internal error - recording will continue but may be incomplete",t)),!0)},i),{},{recordAfter:"DOMContentLoaded"}))}finally{this.Ae=void 0}if(v&&(this.Ie+=1),f.stopRequested){if(v&&this.qn(v),f.startRequested){const t=this.le;(null==t?void 0:t.cancelled)&&(this.le=void 0),this.jn(),this.le=t}}else{if(this.ae=v,!this.ae)return this._e=!0,void Ir.error("rrweb failed to start - Loss of recording data is possible. Check the browser console for rrweb errors.");this._e=!1,!0===(null==r?void 0:r.captureJsonLd)&&n&&(null==t?void 0:t.MutationObserver)&&!this.$n&&(this.$n=function(t,e,n){const i=new WeakMap,r=n.getCaptureState||(()=>!0);let o=er;const s=function(t,e){const n=e.attributeFilter;return e.maskAllElementAttributes||e.maskAttributeFn||(null==n?void 0:n.length)&&!n.includes("id")?rr:n=>{const i=t.getElementById(n);return!!i&&"SCRIPT"!==i.nodeName&&(!e.isRecordedElement||e.isRecordedElement(i))&&!_r(i,e.blockClass,e.blockSelector)}}(t,n),a=e=>{try{const a=r();if(!o||!1===a||!e.isConnected||e.ownerDocument!==t||function(t,e){return _r(t,e.blockClass,e.blockSelector)||_r(t,e.maskTextClass,e.maskTextSelector)}(e,n))return;const l=function(t,e=rr,n){if(!t||t.length>er)return null;try{const i=JSON.parse(t),r={maskUrl:n,remainingNodes:2048,exceeded:!1},o=U(i)?i.map(t=>wr(t,e,r)):wr(i,e,r);if(r.exceeded||Z(o)||U(o)&&(!o.length||o.some(Z)))return null;const s=JSON.stringify(o);return s.length>2e4?null:[o,s]}catch(t){return null}}(e.text,s,n.maskUrl);if(!l)return void i.delete(e);const[u,c]=l;if(Z(a))return void i.set(e,c);if(i.get(e)!==c){if(c.length>o)return void(o=0);n.emit(u)&&(i.set(e,c),o-=c.length)}}catch(t){return}};try{const n=new e(t=>{try{if(!o||!1===r())return;const e=t=>{for(const e of xr(t))a(e)};for(const n of t)if("childList"===n.type)kr(n.target)&&a(n.target),n.addedNodes.forEach(e);else if("characterData"===n.type){const t=n.target.parentNode;t&&kr(t)&&a(t)}else"attributes"===n.type&&kr(n.target)&&a(n.target)}catch(t){return}});return n.observe(t,{attributes:!0,attributeFilter:["type"],characterData:!0,childList:!0,subtree:!0}),{scan(e=!1){o&&!1!==r()&&xr(t.documentElement).forEach(t=>{e&&i.delete(t),a(t)})},stop(){return n.disconnect()}}}catch(t){return{scan(){},stop(){}}}}(n,t.MutationObserver,{maskUrl:t=>this.Tn(t),attributeFilter:i.attributeFilter,blockClass:i.blockClass,blockSelector:i.blockSelector,isRecordedElement:t=>u.mirror.getId(t)>0,maskAllElementAttributes:i.maskAllElementAttributes,maskAttributeFn:i.maskAttributeFn,maskTextClass:i.maskTextClass,maskTextSelector:i.maskTextSelector,getCaptureState:()=>{var t;return!0!==(null===(t=this._instance.config.session_recording)||void 0===t?void 0:t.captureJsonLd)||this.tt.urlBlocked||this.tt.isCurrentUrlBlocked()?null:this.Rn()},emit:t=>this.En(t)}),this.tt.isCurrentUrlBlocked()&&this.$n.scan()),this.ce=Date.now(),this.fe=K(this.fe)?this.fe:"unknown",this.tryAddCustomEvent("$remote_config_received",this.ie),this.Vt("$session_options",{sessionRecordingOptions:i,activePlugins:d.map(t=>null==t?void 0:t.name)}),this.Vt("$posthog_config",{config:this._instance.config})}}tryAddCustomEvent(t,e){return this.Vt(t,e)}};const eo=["type"];var no=function(t){return t[t.DomContentLoaded=0]="DomContentLoaded",t[t.Load=1]="Load",t[t.FullSnapshot=2]="FullSnapshot",t[t.IncrementalSnapshot=3]="IncrementalSnapshot",t[t.Meta=4]="Meta",t[t.Custom=5]="Custom",t[t.Plugin=6]="Plugin",t}({}),io=function(t){return t[t.Mutation=0]="Mutation",t[t.MouseMove=1]="MouseMove",t[t.MouseInteraction=2]="MouseInteraction",t[t.Scroll=3]="Scroll",t[t.ViewportResize=4]="ViewportResize",t[t.Input=5]="Input",t[t.TouchMove=6]="TouchMove",t[t.MediaInteraction=7]="MediaInteraction",t[t.StyleSheetRule=8]="StyleSheetRule",t[t.CanvasMutation=9]="CanvasMutation",t[t.Font=10]="Font",t[t.Log=11]="Log",t[t.Drag=12]="Drag",t[t.StyleDeclaration=13]="StyleDeclaration",t[t.Selection=14]="Selection",t[t.AdoptedStyleSheet=15]="AdoptedStyleSheet",t[t.CustomElement=16]="CustomElement",t}({}),ro=function(t){return t[t.MouseUp=0]="MouseUp",t[t.MouseDown=1]="MouseDown",t[t.Click=2]="Click",t[t.ContextMenu=3]="ContextMenu",t[t.DblClick=4]="DblClick",t[t.Focus=5]="Focus",t[t.Blur=6]="Blur",t[t.TouchStart=7]="TouchStart",t[t.TouchMove_Departed=8]="TouchMove_Departed",t[t.TouchEnd=9]="TouchEnd",t[t.TouchCancel=10]="TouchCancel",t}({}),oo=function(t){return t[t.Mouse=0]="Mouse",t[t.Pen=1]="Pen",t[t.Touch=2]="Touch",t}({}),so=function(t){return t[t["2D"]=0]="2D",t[t.WebGL=1]="WebGL",t[t.WebGL2=2]="WebGL2",t}({}),ao=function(t){return t[t.Play=0]="Play",t[t.Pause=1]="Pause",t[t.Seeked=2]="Seeked",t[t.VolumeChange=3]="VolumeChange",t[t.RateChange=4]="RateChange",t}({}),lo=function(t){return t[t.Document=0]="Document",t[t.DocumentType=1]="DocumentType",t[t.Element=2]="Element",t[t.Text=3]="Text",t[t.CDATA=4]="CDATA",t[t.Comment=5]="Comment",t}({});function uo(t,e){return-1!==t.indexOf(e)}Date,Date;var co={Node:["childNodes","parentNode","parentElement","textContent","previousSibling","nextSibling","lastChild"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot"],MutationObserver:[]},ho={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:["querySelector","querySelectorAll"],MutationObserver:["constructor"]},fo={};function vo(t){if(fo[t])return fo[t];const e=function(t){var e,n;const i=null===(e=globalThis)||void 0===e||null===(e=e.Zone)||void 0===e||null===(n=e.__symbol__)||void 0===n?void 0:n.call(e,t);return i&&globalThis[i]?globalThis[i]:void 0}(t)||globalThis[t],n=e.prototype,i=t in co?co[t]:void 0,r=Boolean(i&&i.every(t=>{var e;return Boolean(null===(e=Object.getOwnPropertyDescriptor(n,t))||void 0===e||null===(e=e.get)||void 0===e?void 0:e.toString().includes("[native code]"))})),o=t in ho?ho[t]:void 0,s=Boolean(o&&o.every(t=>{var e;return"function"==typeof n[t]&&(null===(e=n[t])||void 0===e?void 0:e.toString().includes("[native code]"))}));if(r&&s)return fo[t]=e.prototype,e.prototype;const a=document.createElement("iframe");a.style.display="none";let l=!1;try{document.body.appendChild(a);const i=a.contentWindow;if(!i)return e.prototype;const r=i[t].prototype;return r?(uo(u=navigator.userAgent,"AppleWebKit")&&!uo(u,"Chrome")&&(a.classList.add("rr-block","ph-no-capture"),a.setAttribute("__rrwebUntaintedPrototype",t),l=!0),fo[t]=r):n}catch(t){return n}finally{!l&&a.parentNode&&document.body.removeChild(a)}var u}var po=Object.create(null);function mo(t,e,n){var i;const r=po[t],o=r[n];if(o)return o.call(e);const s=vo(t),a=null===(i=Object.getOwnPropertyDescriptor(s,n))||void 0===i?void 0:i.get;return a?(r[n]=a,a.call(e)):e[n]}po.Node=Object.create(null),po.ShadowRoot=Object.create(null),po.MutationObserver=Object.create(null),po.Element=Object.create(null);var go,yo={};function bo(t,e,n){const i=`${t}.${String(n)}`;if(yo[i])return yo[i].bind(e);const r=vo(t)[n];return"function"!=typeof r?e[n]:(yo[i]=r,r.bind(e))}function wo(){return vo("MutationObserver").constructor}function ko(t,e,n){try{if(!(e in t))return()=>{};const i=t[e],r={next:i},o=n(function(...t){return r.next.apply(this,t)});return"function"==typeof o&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:i},__rrweb_layer__:{enumerable:!1,value:r}})),t[e]=o,()=>{if(t[e]===o)return void(t[e]=r.next);const n=t=>{var e;return"function"==typeof t?null!==(e=t.__rrweb_layer__)&&void 0!==e?e:t.__posthog_layer__:void 0};let i=t[e],s=n(i);for(;s;){if(s.next===o)return void(s.next=r.next);i=s.next,s=n(i)}}}catch(t){return()=>{}}}var So={childNodes:t=>mo("Node",t,"childNodes"),parentNode:t=>mo("Node",t,"parentNode"),parentElement:t=>mo("Node",t,"parentElement"),textContent:t=>mo("Node",t,"textContent"),previousSibling:t=>mo("Node",t,"previousSibling"),nextSibling:t=>mo("Node",t,"nextSibling"),lastChild:t=>mo("Node",t,"lastChild"),isConnected(t){if(void 0===go){var e;const t=null===(e=Object.getOwnPropertyDescriptor(vo("Node"),"isConnected"))||void 0===e?void 0:e.get;go=(null==t?void 0:t.toString().includes("[native code]"))?t:null}return null==go?void 0:go.call(t)},contains:(t,e)=>bo("Node",t,"contains")(e),getRootNode:t=>bo("Node",t,"getRootNode")(),host:t=>t&&"host"in t?mo("ShadowRoot",t,"host"):null,styleSheets:t=>t.styleSheets,shadowRoot:t=>t&&"shadowRoot"in t?mo("Element",t,"shadowRoot"):null,querySelector:(t,e)=>bo("Element",t,"querySelector")(e),querySelectorAll:(t,e)=>bo("Element",t,"querySelectorAll")(e),mutationObserver:wo,patch:ko},_o=new WeakMap;function xo(t){let e=Object.getPrototypeOf(t);for(;e;){const t=_o.get(e);if(t)return t;e=Object.getPrototypeOf(e)}}var Co=new WeakMap,Mo=new WeakSet,To=new WeakSet,Io=!1;function Ao(t){return/(?:^|[\s;{}])-?[a-zA-Z][\w-]*\s*:\s*;/.test(t)}function Ro(t){return!!t.includes("var(")&&(!!/["'\\]|\/\*|url\(/i.test(t)||t.replace(/\{[^{};]*(?:;\s*)?\}/g,"{}").replace(/(^|[;{])\s*(?:--[\w-]+|color|background-color|width|height|min-width|max-width|min-height|max-height|font-size|font-weight|line-height|opacity|z-index|top|right|bottom|left)\s*:[^;{}]*/gi,"$1").includes("var("))}function Eo(t){try{for(;t;)Co.delete(t),t=t.parentRule}catch(t){Po()}}function Oo(t,e){try{if(Eo(t),Io||To.has(t)||"string"!=typeof e||!Ro(e))return;if("cssRules"in t&&t.cssRules.length>0){var n;let e=t.parentStyleSheet;for(;null==e?void 0:e.ownerRule;)e=e.ownerRule.parentStyleSheet;if("LINK"===(null==e||null===(n=e.ownerNode)||void 0===n?void 0:n.nodeName))return}const i=t.cssText;if(Ao(i)){Co.set(t,{text:e,cssText:i,realm:xo(t)});let n=t.parentRule;for(;n;)Mo.add(n),n=n.parentRule}}catch(t){}}function $o(t,e){try{if(Io||"string"!=typeof e||!Ro(e))return;const n=Array.from(t.cssRules);if(!n.some(t=>Ao(t.cssText)))return;const i=function(t){const e=[];let n=0,i=0,r=0,o=0,s="",a=!1,l=!1;for(let u=0;t.length>u;u++){const c=t[u];if(a)"*"===c&&"/"===t[u+1]&&(a=!1,u++);else if("\\"!==c)if(s)c===s&&(s="");else if("/"!==c||"*"!==t[u+1]){if(!l){const e=t.startsWith("\x3c!--",u)?4:t.startsWith("--\x3e",u)?3:0;if(e){u+=e-1,n=u+1;continue}}-1===" \t\n\r\f".indexOf(c)&&(l=!0),'"'!==c&&"'"!==c?("("===c?r++:")"===c?r--:"["===c?o++:"]"===c&&o--,r||o||("{"===c?i++:"}"===c&&i--,("}"===c&&0===i||";"===c&&0===i)&&(e.push(t.slice(n,u+1).trim()),n=u+1,l=!1))):s=c}else a=!0,u++;else l=!0,u++}return i||r||o||s||a?[]:e}(e);if(i.length!==n.length)return;n.forEach((t,e)=>Oo(t,i[e]))}catch(t){}}function Lo(t){var e;const n=Co.get(t);if(n){if(!1!==(null===(e=n.realm)||void 0===e?void 0:e.active)&&n.cssText===t.cssText)return n.text;Co.delete(t)}}function Do(t){Eo(t);try{let e=t;for(;e;)To.add(e),e=e.parentRule}catch(t){Po()}}function Fo(){Co=new WeakMap,Mo=new WeakSet}function Po(){Fo(),Io=!0}function No(){try{if("undefined"!=typeof performance&&performance.now)return performance.now()}catch(t){}return Date.now()}var qo=0;function jo(){qo+=1}function Bo(){return qo}function zo(t,e){return(e!==qo||t>6e4)&&!0}var Uo=0,Wo=0,Ho=0,Go={durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0},Vo=null,Qo=null,Zo=[],Jo=0,Yo=0,Ko={slowestBatchMs:0},Xo={deferredCount:0,failedCount:0,abandonedCount:0,totalMs:0,slowestSliceMs:0};function ts(t){(Uo+=1)>1||(Go={durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0},Zo=[],Jo=0,Qo=(t=>t&&t>0?t:null)(t),Wo=No(),Ho=qo)}function es(){return 0===Uo?Vo||{durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0}:(Uo-=1)>0?Go:(Go.durationMs=No()-Wo,Go.deferredStylesheetCount=Jo,Xo.deferredCount+=Jo,Qo=null,zo(Go.durationMs,Ho)?Go:Vo=Go)}function ns(t,e,n){let i=t.length;if(n>=32)return i;for(let r=0;t.length>r;r++){const o=t[r];try{const t=o.cssRules;if(t&&t.length)i+=ns(t,e,n+1);else if(e&&o.styleSheet){const t=o.styleSheet;if(!e.has(t)){e.add(t);const r=t.rules||t.cssRules;r&&(i+=ns(r,e,n+1))}}}catch(t){}}return i}function is(t){if(0===Uo)return;const e=ns(t,null,0);Go.cssRuleCount+=e,Yo>0&&(Go.nonDeferrableCssRuleCount+=e)}function rs(t){Yo+=1;try{return t()}finally{Yo-=1}}function os(t){Uo>0&&(Go.stylesheetMs+=t)}function ss(t){if(0===Uo||null===Qo)return!1;const e=Go.cssRuleCount-Go.nonDeferrableCssRuleCount;return e>=Qo||e+function(t){try{const e=t&&(t.rules||t.cssRules);if(!e)return 0;const n=new WeakSet;return n.add(t),ns(e,n,0)}catch(t){return 0}}(t)>Qo}function as(){const t=Zo;return Zo=[],t}function ls(){Xo.failedCount+=1}function us(t){t>0&&(Xo.abandonedCount+=t)}function cs(t){return cs="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},cs(t)}function ds(t,e,n){return(e=function(t){var e=function(t){if("object"!=cs(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=cs(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==cs(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function hs(t){return t.nodeType===t.ELEMENT_NODE}function fs(t){const e=t&&"host"in t&&"mode"in t&&So.host(t)||null;return Boolean(e&&"shadowRoot"in e&&So.shadowRoot(e)===t)}function vs(t){return"[object ShadowRoot]"==={}.toString.call(t)}function ps(t){return t.includes(" background-clip: text;")&&!t.includes(" -webkit-background-clip: text;")&&(t=t.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),t}function ms(t){const{cssText:e}=t;if(3>e.split('"').length)return e;const n=["@import",`url(${JSON.stringify(t.href)})`];return""===t.layerName?n.push("layer"):t.layerName&&n.push(`layer(${t.layerName})`),t.supportsText&&n.push(`supports(${t.supportsText})`),t.media.length&&n.push(t.media.mediaText),n.join(" ")+";"}var gs=0;function ys(t){const e=0===gs,n=e?No():0;gs+=1;try{const e=t.rules||t.cssRules;if(!e)return null;is(e);let n=t.href;return!n&&t.ownerNode&&(n=t.ownerNode.baseURI),ps(Array.from(e,t=>bs(t,n)).join(""))}catch(t){return null}finally{gs-=1,e&&os(No()-n)}}function bs(t,e){if(ks(t)){let e;try{e=ys(t.styleSheet)||ms(t)}catch(n){e=t.cssText}try{var n;if(e&&(null===(n=t.styleSheet)||void 0===n?void 0:n.href))return Ps(e,t.styleSheet.href)}catch(t){}return e}{var i;let n=Lo(t);if(void 0===n&&function(t){return Mo.has(t)}(t)){const e=Cs(t);null!==e&&(n=e+Array.from(t.cssRules,t=>bs(t,null)).join("")+"}")}return null!==(i=n)&&void 0!==i||(n=t.cssText),Ss(t)&&t.selectorText.includes(":")&&(n=ws(n)),e?Ps(n,e):n}}function ws(t){return t.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")}function ks(t){return"styleSheet"in t}function Ss(t){return"selectorText"in t}var _s=/^-?[A-Za-z_][\w-]*$/,xs=/^-?[A-Za-z_][\w-]*(\.-?[A-Za-z_][\w-]*)*$/;function Cs(t){const e=t;if(!e.cssRules||0===e.cssRules.length)return null;if(e.media&&"string"==typeof e.media.mediaText)return`@media ${e.media.mediaText} {`;if(Ss(t)){if("number"==typeof e.type&&1!==e.type)return null;const n=e.style?e.style.cssText:"";return`${t.selectorText} {${n?" "+n:""}`}if("containerName"in e)return"string"!=typeof e.containerQuery||e.containerName&&!_s.test(e.containerName)?null:`@container ${e.containerName?`${e.containerName} `:""}${e.containerQuery} {`;if("string"==typeof e.conditionText){let i="";try{var n;i=(null===(n=t.constructor)||void 0===n?void 0:n.name)||""}catch(t){return null}return""===i||"Object"===i||"CSSSupportsRule"===i?`@supports ${e.conditionText} {`:null}return"string"==typeof e.name?"keyText"in e.cssRules[0]?_s.test(e.name)?`@keyframes ${e.name} {`:null:""===e.name?"@layer {":xs.test(e.name)?`@layer ${e.name} {`:null:null}var Ms=class{constructor(){ds(this,"idNodeMap",new Map),ds(this,"nodeMetaMap",new WeakMap)}getId(t){var e,n;return t&&null!==(e=null===(n=this.getMeta(t))||void 0===n?void 0:n.id)&&void 0!==e?e:-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){const e=this.getId(t);if(this.idNodeMap.delete(e),t.childNodes&&t.childNodes.forEach(t=>this.removeNodeFromMap(t)),hs(t)){const e=So.shadowRoot(t);e&&this.removeNodeFromMap(e),"IFRAME"===t.nodeName&&t.contentDocument&&this.removeNodeFromMap(t.contentDocument)}}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,e){this.idNodeMap.set(e.id,t),this.nodeMetaMap.set(t,e)}replace(t,e){const n=this.getNode(t);if(n){const t=this.nodeMetaMap.get(n);t&&this.nodeMetaMap.set(e,t)}this.idNodeMap.set(t,e)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function Ts({element:t,maskInputOptions:e,tagName:n,type:i,value:r,maskInputFn:o}){let s=r||"";const a=i&&Is(i);return(e[n.toLowerCase()]||a&&e[a])&&(s=o?o(s,t):"*".repeat(s.length)),s}function Is(t){return t.toLowerCase()}var As=new Set(["rr_width","rr_height","rr_left","rr_top","rr_position","rr_transform","rr_display","rr_scrollleft","rr_scrolltop","rr_mediastate","rr_open_mode"]);function Rs({element:t,name:e,value:n,maskAllElementAttributes:i,maskAttributeFn:r,isGenerated:o=!1}){return n?i?o&&As.has(Is(e))?n:"*".repeat(n.length):r?r(e,n,t):n:n}var Es="__rrweb_original__";function Os(t){try{const e=t.type;return t.hasAttribute("data-rr-is-password")?"password":e?Is(e):null}catch(t){return null}}var $s=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,Ls=/^(?:[a-z+]+:)?\/\//i,Ds=/^www\..*/i,Fs=/^(data:)([^,]*),(.*)/i;function Ps(t,e){return(t||"").replace($s,(t,n,i,r,o,s)=>{const a=i||o||s,l=n||r||"";if(!a)return t;if(Ls.test(a)||Ds.test(a))return`url(${l}${a}${l})`;if(Fs.test(a))return`url(${l}${a}${l})`;if("/"===a[0])return`url(${l}${function(t){let e="";return e=t.indexOf("//")>-1?t.split("/").slice(0,3).join("/"):t.split("/")[0],e=e.split("?")[0],e}(e)+a}${l})`;const u=a.split("#")[0],c=a.substring(u.length),d=e.split("#")[0].split("/"),h=u.split("/");d.pop();for(const t of h)"."!==t&&(".."===t?d.pop():d.push(t));return`url(${l}${d.join("/")}${c}${l})`})}var Ns=new Map;function qs(t){return"http://www.w3.org/1999/xhtml"===t.namespaceURI?t.localName:void 0}function js(t,e,n,i=void 0){if(!n||"select"!==qs(t))return e;const r=null==i?void 0:i.input.get(t);if(r)return r;let o;try{o="unmasked"!==n(t)}catch(t){o=!0}const s=L(L({},e),{},{select:o});return null==i||i.input.set(t,s),s}function Bs(t,e,n,i){if(!n)return!1;let r=So.parentNode(t);const o=[];let s=!1;for(;r;){const t=null==i?void 0:i.content.get(r);if(void 0!==t){s=t;break}if(o.push(r),hs(r)&&"selectedcontent"===qs(r)){let t=So.parentElement(r);for(;t;){const r=t.localName;if("option"===r)break;if("select"===r){"select"===qs(t)&&js(t,e,n,i).select&&(s=!0);break}t=So.parentElement(t)}if(s)break}r=fs(r)?So.host(r):So.parentNode(r)}for(const t of o)null==i||i.content.set(t,s);return s}var zs,Us,Ws=1,Hs=new RegExp("[^a-z0-9-_:]");function Gs(){return Ws++}var Vs=!1,Qs=/^[^ \t\n\r\u000c]+/,Zs=/^[, \t\n\r\u000c]+/,Js=new WeakMap;function Ys(t,e){return e&&""!==e.trim()?Ks(t,e):e}function Ks(t,e){let n=Js.get(t);if(n||(n=t.createElement("a"),Js.set(t,n)),e){if(e.startsWith("blob:")||e.startsWith("data:"))return e}else e="";return n.setAttribute("href",e),n.href}function Xs(t,e){return(null==e?void 0:e.maxBase64ImageLength)?function(t,e){return e&&t.length>e?"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxkZWZzPgogICAgPHBhdHRlcm4gaWQ9InN0cmlwZXMiIHBhdHRlcm5Vbml0cz0idXNlclNwYWNlT25Vc2UiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+CiAgICAgIDxyZWN0IHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgZmlsbD0iYmxhY2siLz4KICAgICAgPHBhdGggZD0iTTggMEgxNkwwIDE2VjhMOCAwWiIgZmlsbD0iIzJEMkQyRCIvPgogICAgICA8cGF0aCBkPSJNMTYgOFYxNkg4TDE2IDhaIiBmaWxsPSIjMkQyRDJEIi8+CiAgICA8L3BhdHRlcm4+CiAgPC9kZWZzPgogIDxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjc3RyaXBlcykiLz4KPC9zdmc+Cg==":t}(t,e.maxBase64ImageLength):t}function ta(t,e,n,i,r,o){if(!i)return i;if("src"===n||"href"===n&&("use"!==e||"#"!==i[0])){const n=Ys(t,i);if(n.startsWith("data:")){if("img"===e&&r){let t=n;return((null==o?void 0:o.type)||void 0!==(null==o?void 0:o.quality))&&(t=function(t,e,n,i){if(1e5>e.length)return e;if(!t.complete||0===t.naturalWidth)return e;if(t.naturalWidth>4096||t.naturalHeight>4096)return e;const r=Ns.get(e);if(r&&r.type===n&&r.quality===i)return r.result;try{const r=document.createElement("canvas");r.width=t.naturalWidth,r.height=t.naturalHeight;const o=r.getContext("2d");if(!o)return e;o.drawImage(t,0,0);const s=r.toDataURL(n||"image/webp",null!=i?i:.4),a=e.length>s.length?s:e;if(Ns.size>=10){const t=Ns.keys().next().value;void 0!==t&&Ns.delete(t)}return Ns.set(e,{type:n,quality:i,result:a}),a}catch(t){return e}}(r,n,o.type,o.quality)),Xs(t,o)}if("image"===e)return Xs(n,o)}return n}if("xlink:href"===n&&"#"!==i[0]){const n=Ys(t,i);return"image"===e&&n.startsWith("data:")?Xs(n,o):n}return"background"!==n||"table"!==e&&"td"!==e&&"th"!==e?"srcset"===n?function(t,e){if(""===e.trim())return e;let n=0;function i(t){let i;const r=t.exec(e.substring(n));return r?(i=r[0],n+=i.length,i):""}const r=[];for(;i(Zs),e.length>n;){let o=i(Qs);if(","===o.slice(-1))o=Ys(t,o.substring(0,o.length-1)),r.push(o);else{let i="";o=Ys(t,o);let s=!1;for(;;){const t=e.charAt(n);if(""===t){r.push((o+i).trim());break}if(s)")"===t&&(s=!1);else{if(","===t){n+=1,r.push((o+i).trim());break}"("===t&&(s=!0)}i+=t,n+=1}}}return r.join(", ")}(t,i):"style"===n?Ps(i,Ks(t)):"object"===e&&"data"===n?Ys(t,i):i:Ys(t,i)}function ea(t,e,n){return("video"===t||"audio"===t)&&"autoplay"===Is(e)}function na(t){return"string"==typeof t&&Is(t).split(/\s+/).includes("stylesheet")}function ia(t,e,n){try{if("string"==typeof e){if(t.classList.contains(e))return!0}else if(ra(t,e,!1))return!0;if(n)return t.matches(n)}catch(t){}return!1}function ra(t,e,n){if(!t||!e)return!1;if(t.nodeType!==t.ELEMENT_NODE)return!!n&&ra(So.parentNode(t),e,n);const i=e.global||e.sticky?new RegExp(e):e;for(let e=t.classList.length;e--;)if(i.test(t.classList[e]))return!0;return!!n&&ra(So.parentNode(t),e,n)}function oa(t,e,n,i){let r;if(hs(t)){if(r=t,!So.childNodes(r).length)return!1}else{if(null===So.parentElement(t))return!1;r=So.parentElement(t)}try{if("string"==typeof e){if(i){if(r.closest(`.${e}`))return!0}else if(r.classList.contains(e))return!0}else if(ra(r,e,i))return!0;if(n)if(i){if(r.closest(n))return!0}else if(r.matches(n))return!0}catch(t){}return!1}function sa(t,e,n){const i=t.removeEventListener;"function"==typeof i&&i.call(t,e,n)}var aa=new Map;function la(t={}){aa.forEach((e,n)=>{t.keepChangedLinks&&e.changedLinkBaseline||(e.controller.abort(),aa.delete(n))})}function ua(t){try{return t.sheet}catch(t){return null}}function ca(t,e,n,i,r){const o=new AbortController,s=()=>{var e;(null===(e=aa.get(t))||void 0===e?void 0:e.controller)===o&&aa.delete(t),o.abort()};let a=!1;const l=()=>{if(!a){a=!0;try{e()}finally{s()}}};t.addEventListener("load",l,{signal:o.signal,once:!0}),t.addEventListener("error",s,{signal:o.signal,once:!0});const u=Date.now()+6e4;let c;const d=e=>{const r=i.length>e?i[e]:Math.max(i[i.length-1],1e3);c=setTimeout(()=>{t.isConnected?n()?l():Date.now()<u?d(e+1):s():s()},r)};o.signal.addEventListener("abort",()=>clearTimeout(c),{once:!0}),d(0),aa.set(t,{controller:o,changedLinkBaseline:r})}var da=[100,200,400,800,1600,3200,6400,12800,25600];function ha(t,e){return Array.from(t.styleSheets).find(t=>t.href===e)}function fa(t){return null==t?"":t.toLowerCase()}var va=!1,pa=!1;function ma(t,e,n=void 0){const{doc:i,mirror:r,blockClass:o,blockSelector:s,maskTextClass:a,maskTextSelector:l,skipChild:u=!1,inlineStylesheet:c=!0,maskInputOptions:d={},maskTextFn:h,maskInputFn:f,selectMaskingFn:v,maskAllElementAttributes:p=!1,maskAttributeFn:m,slimDOMOptions:g,dataURLOptions:y={},inlineImages:b=!1,recordCanvas:w=!1,canvasMaskingConfigured:k,onSerialize:S,onIframeLoad:_,iframeLoadTimeout:x=5e3,onIframeListenerRegistered:C,onStylesheetLoad:M,stylesheetLoadTimeout:T=5e3,keepIframeSrcFn:I=()=>!1,newlyAddedElement:A=!1,depth:R=0,maxDepth:E=50}=e;let{needsMask:O}=e,{preserveWhiteSpace:L=!0}=e;if(v&&!n&&(n={input:new WeakMap,content:new WeakMap,owner:new WeakMap}),v&&Bs(t,d,v,n))return null;if(R>=E)return pa=!0,va||(va=!0,console.warn(`[rrweb-snapshot] DOM tree depth exceeded max depth of ${E}. Children beyond this depth will not be recorded. This may indicate deeply nested DOM structures.`)),null;O||(O=oa(t,a,l,void 0===O)),Uo>0&&(Go.nodeCount+=1);const D=function(t,e,n){const{doc:i,mirror:r,blockClass:o,blockSelector:s,needsMask:a,inlineStylesheet:l,maskInputOptions:u={},maskTextFn:c,maskInputFn:d,selectMaskingFn:h,maskAllElementAttributes:f=!1,maskAttributeFn:v,dataURLOptions:p={},inlineImages:m,recordCanvas:g,canvasMaskingConfigured:y,keepIframeSrcFn:b,newlyAddedElement:w=!1}=e,k=function(t,e){if(!e.hasNode(t))return;const n=e.getId(t);return 1===n?void 0:n}(i,r);switch(t.nodeType){case t.DOCUMENT_NODE:return"CSS1Compat"!==t.compatMode?{type:lo.Document,childNodes:[],compatMode:t.compatMode}:{type:lo.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:lo.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:k};case t.ELEMENT_NODE:return function(t,e,n){const{doc:i,blockClass:r,blockSelector:o,inlineStylesheet:s,maskInputOptions:a={},maskInputFn:l,selectMaskingFn:u,maskAllElementAttributes:c=!1,maskAttributeFn:d,dataURLOptions:h={},inlineImages:f,recordCanvas:v,canvasMaskingConfigured:p,keepIframeSrcFn:m,newlyAddedElement:g=!1,rootId:y}=e,b=ia(t,r,o),w=u&&qs(t),k="select"===w||"option"===w||"selectedcontent"===w?w:function(t){if(t instanceof HTMLFormElement)return"form";const e=Is(t.tagName);return Hs.test(e)?"div":e}(t);let S=a;if(u&&!b&&("select"===k||"option"===k)){const e="option"===k?function(t,e){let n=So.parentElement(t);const i=[];for(;n&&"select"!==qs(n);){const t=null==e?void 0:e.owner.get(n);if(void 0!==t){n=t;break}i.push(n),n=So.parentElement(n)}for(const t of i)null==e||e.owner.set(t,n);return n}(t,n):t;e&&(S=js(e,a,u,n))}const _=new Set;let x={};const C=t.attributes.length;for(let e=0;C>e;e++){const n=t.attributes[e];ea(k,n.name)||(x[n.name]=ta(i,k,Is(n.name),n.value,t,h))}if("link"===k&&"string"==typeof x.href){var M;const e=null===(M=ua(t))||void 0===M?void 0:M.href;e&&(x.href=e)}if("link"===k&&s&&!b&&na(x.rel)){let e=t.sheet;if(!e){const n=function(t){return t.href}(t);n&&(e=ha(i,n),!e&&n.includes(".css"))&&(e=ha(i,window.location.origin+"/"+n.replace(window.location.href,"")))}let n=null;e&&(ss(e)?Uo>0&&(Zo.push(t),Jo+=1):n=ys(e)),n&&(delete x.rel,delete x.href,x._cssText=n)}var T;if("style"===k&&t.sheet&&!(t.innerText||So.textContent(t)||"").trim().length){const e=rs(()=>ys(t.sheet));e&&(x._cssText=e)}if("input"===k||"textarea"===k||"select"===k){var I;const e="select"===k?t.selectedOptions:void 0,n=e?(null===(I=Array.from(e).find(e=>{let n=e;for(;n&&n!==t;){if(ia(n,r,o))return!1;n=So.parentElement(n)}return!0}))||void 0===I?void 0:I.value)||"":t.value,i=t.checked;"radio"!==x.type&&"checkbox"!==x.type&&"submit"!==x.type&&"button"!==x.type&&(e||n)?x.value=n?Ts({element:t,type:Os(t),tagName:k,value:n,maskInputOptions:S,maskInputFn:l}):"":i&&(x.checked=i)}if("select"===k&&(u||S.select&&!l)&&(x.rr_maskedSelect=!!S.select||null,_.add("rr_maskedSelect")),"option"===k&&(t.selected&&!S.select?x.selected=!0:delete x.selected),"dialog"===k&&t.open){try{x.rr_open_mode=t.matches("dialog:modal")?"modal":"non-modal"}catch(t){x.rr_open_mode="modal",x.ph_rr_could_not_detect_modal=!0}_.add("rr_open_mode")}if("canvas"===k&&v&&!(null==p?void 0:p()))try{if("2d"===t.__context)(function(t){const e=t.getContext("2d");if(!e)return!0;for(let n=0;t.width>n;n+=50)for(let i=0;t.height>i;i+=50){const r=e.getImageData,o=Es in r?r[Es]:r;let s;try{s=o.call(e,n,i,Math.min(50,t.width-n),Math.min(50,t.height-i))}catch(t){return!1}if(new Uint32Array(s.data.buffer).some(t=>0!==t))return!1}return!0})(t)||(x.rr_dataURL=t.toDataURL(h.type,h.quality));else if(!("__context"in t)){const e=t.toDataURL(h.type,h.quality),n=i.createElement("canvas");n.width=t.width,n.height=t.height,e!==n.toDataURL(h.type,h.quality)&&(x.rr_dataURL=e)}}catch(t){"SecurityError"===(null==(T=t)?void 0:T.name)?Vs||(Vs=!0,console.warn("Cannot read canvas pixels, so this canvas is left out of the recording. A cross-origin image or video drawn into it taints it.",T)):console.warn("Cannot read canvas pixels, so this canvas is left out of the recording.",T)}let A,R=!1;if("img"===k&&f){zs||(zs=i.createElement("canvas"),Us=zs.getContext("2d"));const e=t,n=e.currentSrc||e.getAttribute("src")||"<unknown-src>",r=e.crossOrigin,o=(e,n)=>R?Rs({element:t,name:e,value:n,maskAllElementAttributes:c,maskAttributeFn:d}):n,s=()=>{sa(e,"load",s);try{zs.width=e.naturalWidth,zs.height=e.naturalHeight,Us.drawImage(e,0,0);const t=zs.toDataURL(h.type,h.quality);x.rr_dataURL=o("rr_dataURL",t)}catch(t){if("anonymous"!==e.crossOrigin)return e.crossOrigin="anonymous",void(e.complete&&0!==e.naturalWidth?s():e.addEventListener("load",s));console.warn(`Cannot inline img src=${n}! Error: ${t}`)}"anonymous"===e.crossOrigin&&(r?x.crossOrigin=o("crossOrigin",r):e.removeAttribute("crossorigin"))};e.complete&&0!==e.naturalWidth?s():e.addEventListener("load",s)}if("audio"===k||"video"===k){const e=x;e.rr_mediaState=t.paused?"paused":"played",_.add("rr_mediaState"),e.rr_mediaCurrentTime=t.currentTime,e.rr_mediaPlaybackRate=t.playbackRate,e.rr_mediaMuted=t.muted,e.rr_mediaLoop=t.loop,e.rr_mediaVolume=t.volume}if(g||function(t){return"function"!=typeof t.checkVisibility||t.checkVisibility({contentVisibilityAuto:!0})}(t)&&(t.scrollLeft&&(x.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(x.rr_scrollTop=t.scrollTop)),b){var E,O,L;const{width:e,height:n,left:r,top:o}=t.getBoundingClientRect(),s=null===(E=i.defaultView)||void 0===E?void 0:E.getComputedStyle(t);x={class:x.class,rr_width:`${e}px`,rr_height:`${n}px`,rr_left:`${Math.floor(r+((null===(O=i.defaultView)||void 0===O?void 0:O.scrollX)||0))}px`,rr_top:`${Math.floor(o+((null===(L=i.defaultView)||void 0===L?void 0:L.scrollY)||0))}px`},_.add("rr_width"),_.add("rr_height"),_.add("rr_left"),_.add("rr_top"),s&&(x.rr_position=s.position||"static",_.add("rr_position"),s.transform&&"none"!==s.transform&&(x.rr_transform=s.transform,_.add("rr_transform")),s.display&&s.display.startsWith("inline")&&(x.rr_display=s.display,_.add("rr_display")))}if("iframe"!==k||m(x.src)||(t.contentDocument||(x.rr_src=x.src),delete x.src),c||d)for(const[e,n]of Object.entries(x))"string"!=typeof n&&null!==n||(x[e]=Rs({element:t,name:e,value:n,maskAllElementAttributes:c,maskAttributeFn:d,isGenerated:_.has(e)}));R=!0;try{customElements.get(k)&&(A=!0)}catch(t){}return{type:lo.Element,tagName:k,attributes:x,childNodes:[],isSVG:(D=t,Boolean("svg"===D.tagName||D.ownerSVGElement)||void 0),needBlock:b,rootId:y,isCustom:A};var D}(t,{doc:i,blockClass:o,blockSelector:s,inlineStylesheet:l,maskInputOptions:u,maskInputFn:d,selectMaskingFn:h,maskAllElementAttributes:f,maskAttributeFn:v,dataURLOptions:p,inlineImages:m,recordCanvas:g,canvasMaskingConfigured:y,keepIframeSrcFn:b,newlyAddedElement:w,rootId:k},n);case t.TEXT_NODE:case t.CDATA_SECTION_NODE:return function(t,e){const{needsMask:n,maskTextFn:i,rootId:r}=e,o=So.parentNode(t),s=o&&o.tagName;let a=So.textContent(t);const l="STYLE"===s||void 0,u="string"==typeof s&&"SCRIPT"===s.toUpperCase();if(l&&a){try{var c;if(t.nextSibling||t.previousSibling);else if(ss(o.sheet));else if(null===(c=o.sheet)||void 0===c?void 0:c.cssRules){const t=ys(o.sheet);t&&!Ao(t)&&(a=t)}}catch(e){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${e}`,t)}a=Ps(a,Ks(e.doc))}return u&&(a="SCRIPT_PLACEHOLDER"),!l&&!u&&a&&n&&(a=i?i(a,So.parentElement(t)):a.replace(/[\S]/g,"*")),{type:lo.Text,textContent:a||"",isStyle:l,rootId:r}}(t,{doc:i,needsMask:a,maskTextFn:c,rootId:k});case t.COMMENT_NODE:return{type:lo.Comment,textContent:So.textContent(t)||"",rootId:k};default:return!1}}(t,{doc:i,mirror:r,blockClass:o,blockSelector:s,needsMask:O,inlineStylesheet:c,maskInputOptions:d,maskTextFn:h,maskInputFn:f,selectMaskingFn:v,maskAllElementAttributes:p,maskAttributeFn:m,dataURLOptions:y,inlineImages:b,recordCanvas:w,canvasMaskingConfigured:k,keepIframeSrcFn:I,newlyAddedElement:A},n);if(!D)return console.warn(t,"not serialized"),null;let F;F=r.hasNode(t)?r.getId(t):function(t,e){if(e.comment&&t.type===lo.Comment)return!0;if(t.type===lo.Element){if(e.script&&("script"===t.tagName||"link"===t.tagName&&("preload"===t.attributes.rel&&"script"===t.attributes.as||"modulepreload"===t.attributes.rel)||"link"===t.tagName&&"prefetch"===t.attributes.rel&&"string"==typeof t.attributes.href&&"js"===function(t){var e;let n;try{n=new URL(t,window.location.href)}catch(t){return null}const i=n.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!==(e=null==i?void 0:i[1])&&void 0!==e?e:null}(t.attributes.href)))return!0;if(e.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(fa(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===fa(t.attributes.name)||["icon","apple-touch-icon","shortcut icon"].includes(fa(t.attributes.rel)))))return!0;if("meta"===t.tagName){if(e.headMetaDescKeywords&&fa(t.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(fa(t.attributes.property).match(/^(og|twitter|fb):/)||fa(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===fa(t.attributes.name)))return!0;if(e.headMetaRobots&&["robots","googlebot","bingbot"].includes(fa(t.attributes.name)))return!0;if(e.headMetaHttpEquiv&&void 0!==t.attributes["http-equiv"])return!0;if(e.headMetaAuthorship&&(["author","generator","framework","publisher","progid"].includes(fa(t.attributes.name))||fa(t.attributes.property).match(/^article:/)||fa(t.attributes.property).match(/^product:/)))return!0;if(e.headMetaVerification&&["google-site-verification","yandex-verification","csrf-token","p:domain_verify","verify-v1","verification","shopify-checkout-api-token"].includes(fa(t.attributes.name)))return!0}}return!1}(D,g)||!L&&D.type===lo.Text&&!D.isStyle&&!D.textContent.replace(/^\s+|\s+$/gm,"").length?-2:Gs();const P=Object.assign(D,{id:F});if(r.add(t,P),-2===F)return null;S&&S(t);let N=!u;if(P.type===lo.Element){N=N&&!P.needBlock,delete P.needBlock;const e=So.shadowRoot(t);e&&vs(e)&&(P.isShadowHost=!0)}if((P.type===lo.Document||P.type===lo.Element)&&N){g.headWhitespace&&P.type===lo.Element&&"head"===P.tagName&&(L=!1);const e={doc:i,mirror:r,blockClass:o,blockSelector:s,needsMask:O,maskTextClass:a,maskTextSelector:l,skipChild:u,inlineStylesheet:c,maskInputOptions:d,maskTextFn:h,maskInputFn:f,selectMaskingFn:v,maskAllElementAttributes:p,maskAttributeFn:m,slimDOMOptions:g,dataURLOptions:y,inlineImages:b,recordCanvas:w,canvasMaskingConfigured:k,preserveWhiteSpace:L,onSerialize:S,onIframeLoad:_,iframeLoadTimeout:x,onIframeListenerRegistered:C,onStylesheetLoad:M,stylesheetLoadTimeout:T,keepIframeSrcFn:I,depth:R+1,maxDepth:E};if(P.type===lo.Element&&"textarea"===P.tagName&&void 0!==P.attributes.value);else for(const i of Array.from(So.childNodes(t))){const t=ma(i,e,n);t&&P.childNodes.push(t)}let A=null;if(hs(t)&&(A=So.shadowRoot(t)))for(const t of Array.from(So.childNodes(A))){const i=ma(t,e,n);i&&(vs(A)&&(i.isShadow=!0),P.childNodes.push(i))}}const q=So.parentNode(t);if(q&&fs(q)&&vs(q)&&(P.isShadow=!0),P.type===lo.Element&&"iframe"===P.tagName&&!ia(t,o,s)){const e=function(t,e,n){const i=()=>{},r=t.contentWindow;if(!r)return i;let o;try{o=r.document.readyState}catch(t){return i}const s=()=>e();if("complete"!==o){let i=!1,r=null;const o=()=>{i||(i=!0,null!==r&&(clearTimeout(r),r=null),sa(t,"load",a),t.addEventListener("load",s),e())},a=()=>o();return r=setTimeout(o,n),t.addEventListener("load",a),()=>{null!==r&&(clearTimeout(r),r=null),i?sa(t,"load",s):(i=!0,sa(t,"load",a))}}const a="about:blank";let l;try{l=r.location.href}catch(t){return i}if(l!==a||t.src===a||""===t.src){const n=setTimeout(e,0);return t.addEventListener("load",s),()=>{clearTimeout(n),sa(t,"load",s)}}return t.addEventListener("load",s),()=>{sa(t,"load",s)}}(t,()=>{const e=t.contentDocument;if(e&&_){const n=ma(e,{doc:e,mirror:r,blockClass:o,blockSelector:s,needsMask:O,maskTextClass:a,maskTextSelector:l,skipChild:!1,inlineStylesheet:c,maskInputOptions:d,maskTextFn:h,maskInputFn:f,selectMaskingFn:v,maskAllElementAttributes:p,maskAttributeFn:m,slimDOMOptions:g,dataURLOptions:y,inlineImages:b,recordCanvas:w,canvasMaskingConfigured:k,preserveWhiteSpace:L,onSerialize:S,onIframeLoad:_,iframeLoadTimeout:x,onIframeListenerRegistered:C,onStylesheetLoad:M,stylesheetLoadTimeout:T,keepIframeSrcFn:I,depth:R+1,maxDepth:E});n&&_(t,n)}},x);null==C||C(t,e)}var j,B,z;return P.type===lo.Element&&"link"===P.tagName&&na(P.attributes.rel)&&(B=()=>{if(M){const e=r.getMeta(t),n=ma(t,{doc:i,mirror:r,blockClass:o,blockSelector:s,needsMask:O,maskTextClass:a,maskTextSelector:l,skipChild:!1,inlineStylesheet:c,maskInputOptions:d,maskTextFn:h,maskInputFn:f,selectMaskingFn:v,maskAllElementAttributes:p,maskAttributeFn:m,slimDOMOptions:g,dataURLOptions:y,inlineImages:b,recordCanvas:w,canvasMaskingConfigured:k,preserveWhiteSpace:L,onSerialize:S,onIframeLoad:_,iframeLoadTimeout:x,onStylesheetLoad:M,stylesheetLoadTimeout:T,keepIframeSrcFn:I,depth:R,maxDepth:E});n&&M(t,n,e)}},z=T,aa.has(j=t)||ua(j)||ca(j,B,()=>Boolean(ua(j)),[z])),P}function ga(t){return!0===t||"all"===t?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===t,headMetaDescKeywords:"all"===t,headTitleMutations:"all"===t}:!1===t?{}:t}var ya=class t{constructor(...t){ds(this,"parentElement",null),ds(this,"parentNode",null),ds(this,"ownerDocument",void 0),ds(this,"firstChild",null),ds(this,"lastChild",null),ds(this,"previousSibling",null),ds(this,"nextSibling",null),ds(this,"ELEMENT_NODE",1),ds(this,"TEXT_NODE",3),ds(this,"nodeType",void 0),ds(this,"nodeName",void 0),ds(this,"RRNodeType",void 0)}get childNodes(){const t=[];let e=this.firstChild;for(;e;)t.push(e),e=e.nextSibling;return t}contains(e){if(!(e instanceof t))return!1;if(e.ownerDocument!==this.ownerDocument)return!1;if(e===this)return!0;for(;e.parentNode;){if(e.parentNode===this)return!0;e=e.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,e){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 ba(t,e,n=document){const i={capture:!0,passive:!0};return n.addEventListener(t,e,i),()=>wa(n,t,e,i)}function wa(t,e,n,i){ka(()=>{const r=t.removeEventListener;"function"==typeof r&&(void 0!==i?r.call(t,e,n,i):r.call(t,e,n))})}function ka(t){try{t()}catch(t){if(!(t instanceof DOMException&&"SecurityError"===t.name))throw t}}function Sa(t){t.forEach(t=>{if("function"==typeof t)try{t()}catch(t){}})}var _a="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.",xa={map:{},getId(){return console.warn(_a),-1},getNode(){return console.warn(_a),null},removeNodeFromMap(){console.warn(_a)},has(){return console.warn(_a),!1},reset(){console.warn(_a)}};function Ca(t,e,n={}){let i=null,r=0;return function(...o){const s=Date.now();r||!1!==n.leading||(r=s);const a=e-(s-r),l=this;0>=a||a>e?(i&&(clearTimeout(i),i=null),r=s,t.apply(l,o)):i||!1===n.trailing||(i=setTimeout(()=>{r=!1===n.leading?0:Date.now(),i=null,t.apply(l,o)},a))}}function Ma(t){let e="function"==typeof t.setTimeout?t.setTimeout:void 0;try{var n,i;const r=null===(n=t.Zone)||void 0===n||null===(i=n.__symbol__)||void 0===i?void 0:i.call(n,"setTimeout"),o=r?t[r]:void 0;"function"==typeof o&&(e=o)}catch(t){}if(!e)return()=>{};const r=e;return e=>{try{r.call(t,e,0)}catch(t){}}}function Ta(t,e,n,i,r=window){const o=r.Object.getOwnPropertyDescriptor(t,e),s=()=>Ta(t,e,o||{},!0);if(i)return r.Object.defineProperty(t,e,n),s;const a=Ma(r);return r.Object.defineProperty(t,e,{set(t){if(a(()=>{try{n.set.call(this,t)}catch(t){}}),o&&o.set){if(o.get)try{o.get.call(this)}catch(t){return}o.set.call(this,t)}}}),s}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(xa=new Proxy(xa,{get(t,e,n){return"map"===e&&console.warn(_a),Reflect.get(t,e,n)}}));var Ia=Date.now;function Aa(t){var e,n,i,r;const o=t.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:void 0!==t.pageXOffset?t.pageXOffset:o.documentElement.scrollLeft||(null==o?void 0:o.body)&&(null===(e=So.parentElement(o.body))||void 0===e?void 0:e.scrollLeft)||(null==o||null===(n=o.body)||void 0===n?void 0:n.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:void 0!==t.pageYOffset?t.pageYOffset:(null==o?void 0:o.documentElement.scrollTop)||(null==o?void 0:o.body)&&(null===(i=So.parentElement(o.body))||void 0===i?void 0:i.scrollTop)||(null==o||null===(r=o.body)||void 0===r?void 0:r.scrollTop)||0}}function Ra(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Ea(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Oa(t){return t?t.nodeType===t.ELEMENT_NODE?t:So.parentElement(t):null}function $a(t,e,n,i){if(!t)return!1;const r=Oa(t);if(!r)return!1;try{if("string"==typeof e){if(r.classList.contains(e))return!0;if(i&&null!==r.closest("."+e))return!0}else if(ra(r,e,i))return!0}catch(t){}if(n){if(r.matches(n))return!0;if(i&&null!==r.closest(n))return!0}return!1}function La(t,e,n){const i=e&&"string"!=typeof e&&(e.global||e.sticky)?new RegExp(e):null;for(;t;){if(i&&(i.lastIndex=0),$a(t,i||e,n,!0))return!0;const r="getRootNode"in t?So.getRootNode(t):null;t=(null==r?void 0:r.nodeType)===Node.DOCUMENT_FRAGMENT_NODE?So.host(r):null}return!1}function Da(t,e,n){return!("TITLE"!==t.tagName||!n.headTitleMutations)||-2===e.getId(t)}function Fa(t,e){if(fs(t))return!1;const n=e.getId(t);if(!e.has(n))return!0;const i=So.parentNode(t);return(!i||i.nodeType!==t.DOCUMENT_NODE)&&(!i||Fa(i,e))}function Pa(t){return Boolean(t.changedTouches)}function Na(t,e){return Boolean("IFRAME"===t.nodeName&&e.getMeta(t))}function qa(t,e){return Boolean("LINK"===t.nodeName&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&"stylesheet"===t.getAttribute("rel")&&e.getMeta(t))}function ja(t){return!!t&&(t instanceof ya&&"shadowRoot"in t?Boolean(t.shadowRoot):Boolean(So.shadowRoot(t)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(Ia=()=>(new Date).getTime());var Ba=class{constructor(){ds(this,"id",1),ds(this,"styleIDMap",new WeakMap),ds(this,"idStyleMap",new Map)}getId(t){var e;return null!==(e=this.styleIDMap.get(t))&&void 0!==e?e:-1}has(t){return this.styleIDMap.has(t)}add(t,e){if(this.has(t))return this.getId(t);let n;return n=void 0===e?this.id++:e,this.styleIDMap.set(t,n),this.idStyleMap.set(n,t),n}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}};function za(t){var e;let n=null;return"getRootNode"in t&&(null===(e=So.getRootNode(t))||void 0===e?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&So.host(So.getRootNode(t))&&(n=So.host(So.getRootNode(t))),n}function Ua(t){const e=t.ownerDocument;if(!e)return!1;if(So.contains(e,t))return!0;const n=So.isConnected(t);return"boolean"==typeof n?n:function(t){const e=t.ownerDocument;if(!e)return!1;const n=function(t){let e,n=t;for(;e=za(n);)n=e;return n}(t);return So.contains(e,n)}(t)}var Wa,Ha=new WeakMap,Ga=(t,e)=>`${t}@${e}`,Va=class{constructor(){ds(this,"frozen",!1),ds(this,"locked",!1),ds(this,"takePendingRecords",void 0),ds(this,"texts",new Map),ds(this,"attributes",new Map),ds(this,"generatedAttributes",new WeakMap),ds(this,"selectedAttributeChanges",new Set),ds(this,"removes",[]),ds(this,"mapRemoves",new Set),ds(this,"movedMap",{}),ds(this,"addedSet",new Set),ds(this,"movedSet",new Set),ds(this,"droppedSet",new Set),ds(this,"removesSubTreeCache",new Set),ds(this,"mutationCb",void 0),ds(this,"blockClass",void 0),ds(this,"blockSelector",void 0),ds(this,"maskTextClass",void 0),ds(this,"maskTextSelector",void 0),ds(this,"inlineStylesheet",void 0),ds(this,"maskInputOptions",void 0),ds(this,"maskTextFn",void 0),ds(this,"maskInputFn",void 0),ds(this,"selectMaskingFn",void 0),ds(this,"maskAllElementAttributes",void 0),ds(this,"maskAttributeFn",void 0),ds(this,"keepIframeSrcFn",void 0),ds(this,"recordCanvas",void 0),ds(this,"canvasMaskingConfigured",void 0),ds(this,"inlineImages",void 0),ds(this,"slimDOMOptions",void 0),ds(this,"dataURLOptions",void 0),ds(this,"doc",void 0),ds(this,"mirror",void 0),ds(this,"iframeManager",void 0),ds(this,"stylesheetManager",void 0),ds(this,"shadowDomManager",void 0),ds(this,"canvasManager",void 0),ds(this,"processedNodeManager",void 0),ds(this,"unattachedDoc",void 0),ds(this,"canvasManagerReleased",!1),ds(this,"processMutations",t=>{t.forEach(this.processMutation),this.emit()}),ds(this,"emit",()=>{if(this.frozen||this.locked)return;const t=No(),e=Bo();try{this.processBufferedMutations()}finally{n=No()-t,i=e,Uo>0||zo(n,null!=i?i:qo)||n>Ko.slowestBatchMs&&(Ko.slowestBatchMs=n)}var n,i}),ds(this,"processBufferedMutations",()=>{const t=[],e=new Set,n=this.selectMaskingFn?{input:new WeakMap,content:new WeakMap,owner:new WeakMap}:void 0,i=t=>{let e=t,n=-2;for(;-2===n;)e=e&&So.nextSibling(e),n=e&&this.mirror.getId(e);return n};let r;const o=o=>{var s;const a=So.parentNode(o);if(!a||!Ua(o)||"TEXTAREA"===a.tagName)return!0;if(this.isBlockedAtEmission(a,n))return!0;if(this.selectMaskingFn&&Bs(o,this.maskInputOptions,this.selectMaskingFn,n))return!0;const l=fs(a)?this.mirror.getId(za(o)):this.mirror.getId(a),u=i(o);if(-1===l||-1===u)return!1;null!==(s=r)&&void 0!==s||(r=this.buildSerializationOptions());const c=ma(o,r,n);return c&&(t.push({parentId:l,nextId:u,node:c}),e.add(c.id)),!0};for(const t of this.mapRemoves)this.mapRemoves.delete(t),this.mirror.removeNodeFromMap(t);for(const t of this.movedSet)Za(this.removesSubTreeCache,t)&&!this.movedSet.has(So.parentNode(t))||this.addedSet.add(t);for(const t of Array.from(this.addedSet)){const e=Ja(this.droppedSet,t),n=Za(this.removesSubTreeCache,t),i=this.movedSet.has(t)||Ja(this.movedSet,t);!e&&!n||i||(this.droppedSet.add(t),this.addedSet.delete(t))}const s=new Set;let a=null;const l=this.addedSet.values();let u=l.next();for(;this.addedSet.size;){let t=null;if(null!==a)for(t=So.previousSibling(a);t&&-2===this.mirror.getId(t);)t=So.previousSibling(t);if(t&&this.addedSet.has(t))a=t;else{for(this.addedSet.has(u.value)||(u=l.next()),a=u.value;;){const t=So.parentNode(a),e=t&&t.nodeType===Node.DOCUMENT_FRAGMENT_NODE?So.host(t):t;if(!e||!this.addedSet.has(e))break;a=e}const t=So.parentNode(a);if(t&&this.addedSet.has(So.lastChild(t)))a=So.lastChild(t);else if(t)for(;;){let t=So.nextSibling(a);for(;t&&-2===this.mirror.getId(t);)t=So.nextSibling(t);if(!t||!this.addedSet.has(t))break;a=t}}this.addedSet.delete(a);const e=So.parentNode(a),n=e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE?So.host(e):e;n&&s.has(n)?s.add(a):o(a)||s.add(a)}s.size>0&&console.warn(`[rrweb] dropped ${s.size} node(s) with unresolved parent at emit`);const c={texts:Array.from(this.texts,([t,e])=>({node:t,value:e})).filter(t=>!this.isBlockedAtEmission(t.node,n)).map(t=>{const e=t.node,n=So.parentNode(e);return n&&"TEXTAREA"===n.tagName&&this.genTextAreaValueMutation(n),{id:this.mirror.getId(e),value:t.value}}).filter(t=>!e.has(t.id)).filter(t=>this.mirror.has(t.id)),attributes:Array.from(this.attributes.values()).filter(t=>!this.isBlockedAtEmission(t.node,n)).map(t=>{const{attributes:e}=t;if(!this.maskAllElementAttributes&&!this.maskAttributeFn&&"string"==typeof e.style){const n=JSON.stringify(t.styleDiff),i=JSON.stringify(t._unchangedStyles);e.style.length>n.length&&(n+i).split("var(").length===e.style.split("var(").length&&(e.style=t.styleDiff)}if(this.maskAllElementAttributes||this.maskAttributeFn)for(const[i,r]of Object.entries(e))if("string"==typeof r||null===r){var n;e[i]=Rs({element:t.node,name:i,value:r,maskAllElementAttributes:this.maskAllElementAttributes,maskAttributeFn:this.maskAttributeFn,isGenerated:null===(n=this.generatedAttributes.get(t.node))||void 0===n?void 0:n.has(i)})}return{id:this.mirror.getId(t.node),attributes:e}}).filter(t=>!e.has(t.id)).filter(t=>this.mirror.has(t.id)),removes:this.removes,adds:t},d=[];if(this.inlineStylesheet)for(const{id:t,attributes:e}of c.attributes){if(!("rel"in e)&&!("href"in e))continue;const n=this.mirror.getNode(t);n&&"link"===Is(n.nodeName)&&na(n.getAttribute("rel"))&&n.getAttribute("href")&&!n.disabled&&d.push(n)}this.texts.clear(),this.attributes.clear(),this.generatedAttributes=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.removesSubTreeCache=new Set,this.movedMap={};const h=this.selectedAttributeChanges;this.selectedAttributeChanges=new Set,(c.texts.length||c.attributes.length||c.removes.length||c.adds.length)&&this.mutationCb(c);for(const t of h){var f;null===(f=Ha.get(t.ownerDocument))||void 0===f||f.forEach(e=>e(t))}for(const t of d)this.stylesheetManager.inlineLinkStylesheetAfterChange(t,{currentId:()=>this.mirror.getId(t),reserializeWithoutCss:()=>({previous:this.mirror.getMeta(t),current:ma(t,L(L({},this.buildSerializationOptions()),{},{inlineStylesheet:!1}))}),lastSerialization:()=>this.mirror.getMeta(t),readdAsMove:()=>this.recordReinsertion(t)})}),ds(this,"bufferBelongsToIframe",t=>this.doc===t.contentDocument),ds(this,"genTextAreaValueMutation",t=>{let e=this.attributes.get(t);e||(e={node:t,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.set(t,e));const n=Array.from(So.childNodes(t),t=>So.textContent(t)||"").join("");e.attributes.value=Ts({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:Os(t),value:n,maskInputFn:this.maskInputFn})}),ds(this,"processMutation",t=>{if(!Da(t.target,this.mirror,this.slimDOMOptions)){if(this.selectMaskingFn){var e;const n=null===(e=Oa(t.target))||void 0===e?void 0:e.closest("select");n&&this.selectedAttributeChanges.add(n)}switch(t.type){case"characterData":{const e=So.textContent(t.target);$a(t.target,this.blockClass,this.blockSelector,!1)||e===t.oldValue||this.texts.set(t.target,oa(t.target,this.maskTextClass,this.maskTextSelector,!0)&&e?this.maskTextFn?this.maskTextFn(e,Oa(t.target)):e.replace(/[\S]/g,"*"):e);break}case"attributes":{var n;const e=t.target,r=!this.selectMaskingFn||"http://www.w3.org/1999/xhtml"!==e.namespaceURI||"select"!==e.localName&&"option"!==e.localName?Is(e.tagName):e.localName,o=t.attributeName,s=null!==(n=t.attributeNamespace)&&void 0!==n?n:null;let a=function(t,e,n){if(!n)return e;const i=t.getAttributeNodeNS(n,e);if(i)return i.name;if("http://www.w3.org/1999/xlink"===n)return`xlink:${e}`;if("http://www.w3.org/XML/1998/namespace"===n)return`xml:${e}`;if("http://www.w3.org/2000/xmlns/"===n)return"xmlns"===e?e:`xmlns:${e}`;const r=t.lookupPrefix(n);return r?`${r}:${e}`:e}(e,o,s),l=s?e.getAttributeNS(s,o):t.target.getAttribute(o);if("option"===r&&"selected"===a&&(this.selectMaskingFn||this.maskInputOptions.select)){let n=So.parentElement(e);if("OPTGROUP"===(null==n?void 0:n.tagName)&&(n=So.parentElement(n)),this.selectMaskingFn||!this.maskInputFn||"SELECT"!==(null==n?void 0:n.tagName)||!n.multiple)return void(l!==t.oldValue&&"SELECT"===(null==n?void 0:n.tagName)&&this.selectedAttributeChanges.add(n))}if("value"===a){const t=e,n=Os(t);l=Ts({element:t,maskInputOptions:js(t,this.maskInputOptions,this.selectMaskingFn),tagName:this.selectMaskingFn&&"select"===r?"select":e.tagName,type:n,value:l,maskInputFn:this.maskInputFn})}if($a(t.target,this.blockClass,this.blockSelector,!1)||l===t.oldValue)return;let u=this.attributes.get(t.target);const c="iframe"===r&&"src"===a;if(c&&!this.keepIframeSrcFn(l)&&e.contentDocument)return;if("type"===a&&"input"===r&&"password"===(t.oldValue||"").toLowerCase()&&e.setAttribute("data-rr-is-password","true"),!ea(r,a)){var i;u||(u={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.set(t.target,u));const n=ta(this.doc,r,Is(a),l,e,this.dataURLOptions);if(c&&!this.keepIframeSrcFn(l)&&(a="rr_src"),u.attributes[a]=n,null===(i=this.generatedAttributes.get(t.target))||void 0===i||i.delete(a),"style"===a){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(t){this.unattachedDoc=this.doc}const n=this.unattachedDoc.createElement("span"),i=e.style;t.oldValue&&(n.style.cssText=t.oldValue);for(const t of Array.from(i)){const e=i.getPropertyValue(t),r=i.getPropertyPriority(t);e!==n.style.getPropertyValue(t)||r!==n.style.getPropertyPriority(t)?u.styleDiff[t]=""===r?e:[e,r]:u._unchangedStyles[t]=[e,r]}for(const t of Array.from(n.style))""===i.getPropertyValue(t)&&(u.styleDiff[t]=!1)}else if("open"===a&&"dialog"===r){u.attributes.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal";let n=this.generatedAttributes.get(t.target);n||(n=new Set,this.generatedAttributes.set(t.target,n)),n.add("rr_open_mode")}}break}case"childList":if(t.removedNodes.forEach(t=>{Ua(t)||this.shadowDomManager.removeShadowRootsIn(t)}),$a(t.target,this.blockClass,this.blockSelector,!0))return;if("TEXTAREA"===t.target.tagName)return void this.genTextAreaValueMutation(t.target);t.addedNodes.forEach(e=>this.genAdds(e,t.target)),t.removedNodes.forEach(e=>{const n=this.mirror.getId(e),i=fs(t.target)?this.mirror.getId(So.host(t.target)):this.mirror.getId(t.target);$a(t.target,this.blockClass,this.blockSelector,!1)||Da(e,this.mirror,this.slimDOMOptions)||!function(t,e){return-1!==e.getId(t)}(e,this.mirror)||(this.addedSet.has(e)?(Qa(this.addedSet,e),this.droppedSet.add(e)):this.addedSet.has(t.target)&&-1===n||Fa(t.target,this.mirror)||(this.movedSet.has(e)&&this.movedMap[Ga(n,i)]?Qa(this.movedSet,e):(this.removes.push({parentId:i,id:n,isShadow:!(!fs(t.target)||!vs(t.target))||void 0}),function(t,e){const n=[t];for(;n.length;){const t=n.pop();e.has(t)||(e.add(t),So.childNodes(t).forEach(t=>n.push(t)))}}(e,this.removesSubTreeCache))),this.mapRemoves.add(e))})}}}),ds(this,"genAdds",(t,e)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)){if(this.addedSet.has(t))return this.addedSet.delete(t),void this.addedSet.add(t);if(!this.movedSet.has(t)){if(this.mirror.hasNode(t)){if(Da(t,this.mirror,this.slimDOMOptions))return;this.movedSet.add(t);let n=null;e&&this.mirror.hasNode(e)&&(n=this.mirror.getId(e)),n&&-1!==n&&(this.movedMap[Ga(this.mirror.getId(t),n)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);if(!$a(t,this.blockClass,this.blockSelector,!1)){if(t.nodeType===t.TEXT_NODE)return;const e=So.childNodes(t);for(let t=0,n=e.length;n>t;t++){const n=e[t];n&&this.genAdds(n)}if(ja(t)){const e=So.childNodes(So.shadowRoot(t));for(let n=0,i=e.length;i>n;n++){const i=e[n];i&&(this.processedNodeManager.add(i,this),this.genAdds(i,t))}}}}}})}init(t){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","selectMaskingFn","maskAllElementAttributes","maskAttributeFn","keepIframeSrcFn","recordCanvas","canvasMaskingConfigured","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(e=>{this[e]=t[e]}),this.canvasManager.acquire()}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()}readPendingRecordsFrom(t){this.takePendingRecords=()=>t.takeRecords()}reset(){this.releaseCanvasManager()}releaseCanvasManager(){this.canvasManagerReleased||(this.canvasManagerReleased=!0,this.canvasManager.reset())}bufferDoc(){return this.doc}destroy(){this.selectedAttributeChanges.clear();for(const t of this.mapRemoves)this.mapRemoves.delete(t),this.mirror.removeNodeFromMap(t)}isBlockedAtEmission(t,e){return La(t,this.blockClass,this.blockSelector)||!!this.selectMaskingFn&&!!t&&Bs(t,this.maskInputOptions,this.selectMaskingFn,e)}recordReinsertion(t){var e;const n=So.parentNode(t);if(!n)return;null===(e=this.takePendingRecords)||void 0===e||e.call(this).forEach(this.processMutation);const i=(t,e)=>({type:"childList",target:n,removedNodes:t,addedNodes:e,oldValue:null,attributeName:null});this.processMutation(i([t],[])),this.processMutation(i([],[t])),this.emit()}buildSerializationOptions(){return{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,selectMaskingFn:this.selectMaskingFn,maskAllElementAttributes:this.maskAllElementAttributes,maskAttributeFn:this.maskAttributeFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,canvasMaskingConfigured:this.canvasMaskingConfigured,inlineImages:this.inlineImages,onSerialize:t=>{Na(t,this.mirror)&&this.iframeManager.addIframe(t),qa(t,this.mirror)&&this.stylesheetManager.trackLinkElement(t),ja(t)&&!$a(t,this.blockClass,this.blockSelector,!0)&&this.shadowDomManager.addShadowRoot(So.shadowRoot(t),this.doc)},onIframeLoad:(t,e)=>{this.iframeManager.attachIframe(t,e),this.shadowDomManager.observeAttachShadow(t)},onIframeListenerRegistered:(t,e)=>{this.iframeManager.registerLoadListenerDisposer(t,e)},onStylesheetLoad:(t,e,n)=>{this.stylesheetManager.attachLinkElement(t,e,n)}}}};function Qa(t,e){const n=[e];for(;n.length;){const e=n.pop();if(t.delete(e),e.nodeType===e.TEXT_NODE)continue;const i=So.childNodes(e);for(let t=0,e=i.length;e>t;t++){const e=i[t];e&&n.push(e)}}}function Za(t,e,n){return 0!==t.size&&function(t,e){const n=So.parentNode(e);return!!n&&t.has(n)}(t,e)}function Ja(t,e){if(0===t.size)return!1;let n=So.parentNode(e);for(;n;){if(t.has(n))return!0;n=So.parentNode(n)}return!1}function Ya(t){Wa=t}function Ka(){Wa=void 0}var Xa=(t,e="rrweb")=>Wa?(...n)=>{try{return t(...n)}catch(t){if(Wa&&!0===Wa(t,e))return;throw t}}:t,tl=[];function el(t){try{if("composedPath"in t){const e=t.composedPath();if(e.length)return e[0]}else if("path"in t&&t.path.length)return t.path[0]}catch(t){}return t&&t.target}function nl(t,e){const n=new Va;let i;n.init(t);try{i=new(wo())(Xa(n.processMutations.bind(n)));const r={attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0};return t.attributeFilter&&t.attributeFilter.length>0&&(r.attributeFilter=t.attributeFilter),i.observe(e,r),n.readPendingRecordsFrom(i),tl.push(n),{observer:i,buffer:n}}catch(t){try{null==i||i.disconnect(),n.destroy(),n.reset()}catch(t){}throw t}}function il({scrollCb:t,doc:e,mirror:n,blockClass:i,blockSelector:r,sampling:o}){const s=new Map,a=o=>{const a=el(o);if(!a||$a(a,i,r,!0))return;const l=n.getId(a);let u,c;if(a===e&&e.defaultView){const t=Aa(e.defaultView);u=t.left,c=t.top}else u=a.scrollLeft,c=a.scrollTop;const d=`${u},${c}`;s.get(l)!==d&&(s.set(l,d),t({id:l,x:u,y:c}))},l=Xa(a),u=new WeakMap,c=[ba("scroll",Xa(t=>{const e=t.target;if(!e)return;let n=u.get(e);n||(n=Ca(l,o.scroll||100),u.set(e,n)),n(t)}),e)];return"onscrollend"in e&&c.push(ba("scrollend",Xa(a),e)),()=>c.forEach(t=>t())}function rl(t,e){for(let n=tl.length-1;n>=0;n--){const i=tl[n];if(!i)continue;let r=i.bufferBelongsToIframe(t);!r&&e&&e.has(i.bufferDoc())&&(r=!0),r&&(i.reset(),tl.splice(n,1))}}var ol=["INPUT","TEXTAREA","SELECT"],sl=new WeakMap,al=new WeakMap;function ll(t){return function t(e,n){if(pl("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||pl("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||pl("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||pl("CSSConditionRule")&&e.parentRule instanceof CSSConditionRule){const i=Array.from(e.parentRule.cssRules).indexOf(e);return n.unshift(i),t(e.parentRule,n)}if(e.parentStyleSheet){const t=Array.from(e.parentStyleSheet.cssRules).indexOf(e);n.unshift(t)}return n}(t,[])}function ul(t,e,n){let i,r;return t?(t.ownerNode?i=e.getId(t.ownerNode):r=n.getId(t),{styleId:r,id:i}):{}}var cl=Symbol.for("rrweb.adoptedStyleSheets.rejected"),dl=new WeakMap;function hl({mirror:t,stylesheetManager:e},n){var i,r;let o=null;o=t.getId("#document"===n.nodeName?n:So.host(n));const s="#document"===n.nodeName?null===(i=n.defaultView)||void 0===i?void 0:i.Document:null===(r=n.ownerDocument)||void 0===r||null===(r=r.defaultView)||void 0===r?void 0:r.ShadowRoot,a=Object.getOwnPropertyDescriptor(n,"adoptedStyleSheets"),l=null!=a?a:(null==s?void 0:s.prototype)?Object.getOwnPropertyDescriptor(s.prototype,"adoptedStyleSheets"):void 0;if(null===o||-1===o||!s||!1===(null==a?void 0:a.configurable)||!(null==l?void 0:l.get)||!(null==l?void 0:l.set))return()=>{};const u={stylesheetManager:e,previousDescriptor:a,get:void 0},c={configurable:!0,enumerable:l.enumerable,get(){var t;return null===(t=l.get)||void 0===t?void 0:t.call(this)},set(t){let e;try{var n;e=null===(n=l.set)||void 0===n?void 0:n.call(this,t)}catch(t){if(t&&"object"==typeof t&&"NotAllowedError"===t.name)return cl;throw t}if(e===cl)return e;if(u.stylesheetManager&&null!==o&&-1!==o)try{u.stylesheetManager.adoptStyleSheets(t,o)}catch(t){}return e}};try{Object.defineProperty(n,"adoptedStyleSheets",c)}catch(t){return()=>{}}return u.get=c.get,dl.set(c.set,u),Xa(()=>{u.stylesheetManager=void 0;const t=Object.getOwnPropertyDescriptor(n,"adoptedStyleSheets");if(!(null==t?void 0:t.configurable)||t.get!==c.get||t.set!==c.set)return;let e=a;for(;null==e?void 0:e.set;){const t=dl.get(e.set);if(!t||t.stylesheetManager||t.get!==e.get)break;e=t.previousDescriptor}e?Object.defineProperty(n,"adoptedStyleSheets",e):delete n.adoptedStyleSheets})}var fl=new Set;function vl(t,e={}){const n=t.doc.defaultView;if(!n)return()=>{};let i,r;!function(t,e){const{mutationCb:n,mousemoveCb:i,mouseInteractionCb:r,scrollCb:o,viewportResizeCb:s,inputCb:a,mediaInteractionCb:l,styleSheetRuleCb:u,styleDeclarationCb:c,canvasMutationCb:d,fontCb:h,selectionCb:f,customElementCb:v}=t;t.mutationCb=(...t)=>{e.mutation&&e.mutation(...t),n(...t)},t.mousemoveCb=(...t)=>{e.mousemove&&e.mousemove(...t),i(...t)},t.mouseInteractionCb=(...t)=>{e.mouseInteraction&&e.mouseInteraction(...t),r(...t)},t.scrollCb=(...t)=>{e.scroll&&e.scroll(...t),o(...t)},t.viewportResizeCb=(...t)=>{e.viewportResize&&e.viewportResize(...t),s(...t)},t.inputCb=(...t)=>{e.input&&e.input(...t),a(...t)},t.mediaInteractionCb=(...t)=>{e.mediaInteaction&&e.mediaInteaction(...t),l(...t)},t.styleSheetRuleCb=(...t)=>{e.styleSheetRule&&e.styleSheetRule(...t),u(...t)},t.styleDeclarationCb=(...t)=>{e.styleDeclaration&&e.styleDeclaration(...t),c(...t)},t.canvasMutationCb=(...t)=>{e.canvasMutation&&e.canvasMutation(...t),d(...t)},t.fontCb=(...t)=>{e.font&&e.font(...t),h(...t)},t.selectionCb=(...t)=>{e.selection&&e.selection(...t),f(...t)},t.customElementCb=(...t)=>{e.customElement&&e.customElement(...t),v(...t)}}(t,e);const o=[],s=Xa(()=>{try{if(r)try{r.destroy(),r.reset()}finally{const t=tl.indexOf(r);-1!==t&&tl.splice(t,1)}t.shadowDomManager.resetForDoc(t.doc),null==i||i.disconnect()}finally{Sa(o)}}),a=(t,e)=>{const n=Xa(()=>{try{return e()}catch(e){throw fl.add(t),e}})();"function"==typeof n&&o.push(n)};try{if(t.recordDOM&&a("mutation",()=>{const e=nl(t,t.doc);i=e.observer,r=e.buffer}),a("move",()=>function({mousemoveCb:t,sampling:e,doc:n,mirror:i}){if(!1===e.mousemove)return()=>{};const r="number"==typeof e.mousemove?e.mousemove:50,o="number"==typeof e.mousemoveCallback?e.mousemoveCallback:500;let s,a=[];const l=Ca(Xa(e=>{const n=Date.now()-s;t(a.map(t=>(t.timeOffset-=n,t)),e),a=[],s=null}),o),u=Xa(Ca(Xa(t=>{const e=el(t),{clientX:n,clientY:r}=Pa(t)?t.changedTouches[0]:t;s||(s=Ia()),a.push({x:n,y:r,id:i.getId(e),timeOffset:Ia()-s}),l("drag"===t.type?io.Drag:"touchmove"===t.type?io.TouchMove:io.MouseMove)}),r,{trailing:!1})),c=[ba("mousemove",u,n),ba("touchmove",u,n),ba("drag",u,n)];return Xa(()=>{c.forEach(t=>t())})}(t)),a("mouseInteraction",()=>function({mouseInteractionCb:t,doc:e,mirror:n,blockClass:i,blockSelector:r,sampling:o}){if(!1===o.mouseInteraction)return()=>{};const s=!0===o.mouseInteraction||void 0===o.mouseInteraction?{}:o.mouseInteraction,a=[];let l=null;return Object.keys(ro).filter(t=>Number.isNaN(Number(t))&&!t.endsWith("_Departed")&&!1!==s[t]).forEach(o=>{let s=Is(o);const u=(e=>o=>{const s=el(o);if($a(s,i,r,!0))return;let a=null,u=e;if("pointerType"in o){switch(o.pointerType){case"mouse":a=oo.Mouse;break;case"touch":a=oo.Touch;break;case"pen":a=oo.Pen}a===oo.Touch&&(ro[e]===ro.MouseDown?u="TouchStart":ro[e]===ro.MouseUp&&(u="TouchEnd"))}else Pa(o)&&(a=oo.Touch);null!==a?(l=a,(u.startsWith("Touch")&&a===oo.Touch||u.startsWith("Mouse")&&a===oo.Mouse)&&(a=null)):ro[e]===ro.Click&&(a=l,l=null);const c=Pa(o)?o.changedTouches[0]:o;if(!c)return;const d=n.getId(s),{clientX:h,clientY:f}=c;Xa(t)(L({type:ro[u],id:d,x:h,y:f},null!==a&&{pointerType:a}))})(o);if(window.PointerEvent)switch(ro[o]){case ro.MouseDown:case ro.MouseUp:s=s.replace("mouse","pointer");break;case ro.TouchStart:case ro.TouchEnd:return}a.push(ba(s,u,e))}),Xa(()=>{a.forEach(t=>t())})}(t)),a("scroll",()=>il(t)),a("viewportResize",()=>function({viewportResizeCb:t},{win:e}){let n=-1,i=-1;return ba("resize",Xa(Ca(Xa(()=>{const e=Ra(),r=Ea();n===e&&i===r||(t({width:Number(r),height:Number(e)}),n=e,i=r)}),200)),e)}(t,{win:n})),a("input",()=>function({inputCb:t,doc:e,mirror:n,blockClass:i,blockSelector:r,ignoreClass:o,ignoreSelector:s,maskInputOptions:a,maskInputFn:l,selectMaskingFn:u,sampling:c,userTriggeredOnInput:d}){let h=!0;const f=new Map;let v=!1;function p(t){return"SELECT"===t.tagName||!!u&&"select"===t.localName&&"http://www.w3.org/1999/xhtml"===t.namespaceURI}function m(t){const n=e.defaultView;if(t&&n&&!(t instanceof n.HTMLElement))return null;if(u&&"option"===(null==t?void 0:t.localName)&&"http://www.w3.org/1999/xhtml"===t.namespaceURI){let e=So.parentElement(t);for(;e&&("select"!==e.localName||"http://www.w3.org/1999/xhtml"!==e.namespaceURI);)e=So.parentElement(e);return e}return t&&"OPTION"===t.tagName&&(t=So.parentElement(t))&&"OPTGROUP"===t.tagName&&(t=So.parentElement(t)),t}function g(t){b(m(el(t)),t.isTrusted)}function y(t){return Array.from(t.selectedOptions).filter(t=>!$a(t,i,r,!0))}function b(t,c,f=!1,v=!1){var m;const g=t&&(p(t)?"SELECT":t.tagName);var b;if(u&&"SELECT"===g&&((null===(b=tl[0])||void 0===b?void 0:b.isFrozen())&&tl.forEach(t=>t.unfreeze()),!h))return;if(!t||!g||0>ol.indexOf(g)||$a(t,i,r,!0))return;if(t.classList.contains(o)||s&&t.matches(s))return;const k=Os(t)||"",_=js(t,a,u);if(u&&(!h||$a(t,i,r,!0)))return;const x=_[g.toLowerCase()]||_[k];let C="SELECT"===g?y(t):void 0;if(C&&(0>=n.getId(t)||C.some(t=>0>=n.getId(t)))){var M;if(null===(M=tl[0])||void 0===M?void 0:M.isFrozen()){if(tl.forEach(t=>t.unfreeze()),!h)return;C=y(t)}if(!f)return void w(t,c,v);if(0>=n.getId(t)||!x&&C.some(t=>0>=n.getId(t)))return}let T,I=C?(null===(m=C[0])||void 0===m?void 0:m.value)||"":t.value,A=!1;"radio"===k||"checkbox"===k?A=t.checked:x?I=Ts({element:t,maskInputOptions:_,tagName:g,type:k,value:I,maskInputFn:l}):C&&(T=C.map(t=>n.getId(t)));const R={text:I,isChecked:A};T&&(R.selectedOptionIds=T),u&&C&&function(t,e,n){if("SELECT"!==t.nodeName)return;const i=e.getMeta(t),r=!!n||null;(null==i?void 0:i.type)!==lo.Element||!0!==i.attributes.rr_maskedSelect&&null!==i.attributes.rr_maskedSelect||i.attributes.rr_maskedSelect===r||e.add(t,L(L({},i),{},{attributes:L(L({},i.attributes),{},{rr_maskedSelect:r})}))}(t,n,!!x),d&&(R.userTriggered=c),S(t,R,v);const E=t.name;"radio"===k&&E&&A&&e.querySelectorAll(`input[type="radio"][name="${E}"]`).forEach(e=>{if(e!==t){const t=e.value;S(e,d?{text:t,isChecked:!A,userTriggered:!1}:{text:t,isChecked:!A})}})}function w(t,e,n=!1){var i;const r=f.get(t);f.set(t,{userTriggered:e||(null==r?void 0:r.userTriggered)||!1,fromMutation:n&&(null===(i=null==r?void 0:r.fromMutation)||void 0===i||i)}),v||(v=!0,C(k))}function k(){v=!1;const t=Array.from(f);f.clear(),Sa(t.map(([t,{userTriggered:e,fromMutation:n}])=>()=>{h&&Xa(b)(t,e,!0,n)}))}function S(e,i,r=!1){var o,s,a;const l=p(e)?al:sl,u=l.get(e);if(!u||u.text!==i.text||u.isChecked!==i.isChecked||(null===(o=u.selectedOptionIds)||void 0===o?void 0:o.length)!==(null===(s=i.selectedOptionIds)||void 0===s?void 0:s.length)||(null===(a=i.selectedOptionIds)||void 0===a?void 0:a.some((t,e)=>{var n;return t!==(null===(n=u.selectedOptionIds)||void 0===n?void 0:n[e])}))){l.set(e,i);const o=n.getId(e);Xa(t)(L(L({},i),{},{id:o}),r)}}const _=("last"===c.input?["change"]:["input","change"]).map(t=>ba(t,Xa(g),e)),x=e.defaultView;if(!x)return()=>{_.forEach(t=>t())};const C=Ma(x),M=x.Object.getOwnPropertyDescriptor(x.HTMLInputElement.prototype,"value");return M&&M.set&&_.push(...[[x.HTMLInputElement.prototype,"value"],[x.HTMLInputElement.prototype,"checked"],[x.HTMLSelectElement.prototype,"value"],[x.HTMLTextAreaElement.prototype,"value"],[x.HTMLSelectElement.prototype,"selectedIndex"],[x.HTMLOptionElement.prototype,"selected"]].map(t=>Ta(t[0],t[1],{set(){if(!h)return;const t=Xa(m)(this);t&&(p(t)?w(t,!1):Xa(b)(t,!1))}},!1,x))),_.unshift(function(t,e){const n=Ha.get(t)||new Set;return Ha.set(t,n),n.add(e),()=>{n.delete(e),n.size||Ha.get(t)!==n||Ha.delete(t)}}(e,Xa(t=>{n.getId(t)>0&&Ua(t)&&!La(t,i,r)&&b(t,!1,!1,!!u)}))),Xa(()=>{Sa([k]),h=!1,f.clear(),Sa(_)})}(t)),a("mediaInteraction",()=>function({mediaInteractionCb:t,blockClass:e,blockSelector:n,mirror:i,sampling:r,doc:o}){const s=Xa(o=>Ca(Xa(r=>{const s=el(r);if(!function(t){const e=null==t?void 0:t.tagName;if("string"!=typeof e)return!1;const n=Is(e);return"video"===n||"audio"===n}(s)||$a(s,e,n,!0))return;const{currentTime:a,volume:l,muted:u,playbackRate:c,loop:d}=s;t({type:o,id:i.getId(s),currentTime:a,volume:l,muted:u,playbackRate:c,loop:d})}),r.media||500)),a=[ba("play",s(ao.Play),o),ba("pause",s(ao.Pause),o),ba("seeked",s(ao.Seeked),o),ba("volumechange",s(ao.VolumeChange),o),ba("ratechange",s(ao.RateChange),o)];return Xa(()=>{a.forEach(t=>t())})}(t)),t.recordDOM){const e=function(t){const e=new Map,n=new Set;let i=!0;const r=t=>{if(i)try{t()}catch(t){}},o=t=>{var n;const i=e.get(t);if(i){for(;null===(n=i[0])||void 0===n?void 0:n.ready;){const t=i.shift();(null==t?void 0:t.emit)&&r(t.emit)}0===i.length&&e.delete(t)}};return{queueMutation(t,n){if(!t)return void r(n);const i=e.get(t);i?(i.push({emit:n,ready:!0}),o(t)):r(n)},queuePendingMutation(s,a,l){if(!i)return()=>{};let u=e.get(s);u||(u=[],e.set(s,u));const c={emit:a,ready:!1};u.push(c);let d,h=!1,f=!1;const v=()=>{h||f||(h=!0,void 0!==d&&n.delete(d),c.ready=!0,c.emit=void 0,o(s))};try{d=t.setTimeout(v,5e3),h||f?t.clearTimeout(d):n.add(d)}catch(t){v()}return e=>{!f&&i&&(f=!0,void 0!==d&&(t.clearTimeout(d),n.delete(d)),h?e&&r(l):(c.ready=!0,e||(c.emit=void 0),o(s)))}},reset(){i=!1,n.forEach(e=>t.clearTimeout(e)),n.clear(),e.clear()}}}(n);o.push(e.reset),a("styleSheet",()=>function({styleSheetRuleCb:t,mirror:e,stylesheetManager:n},{win:i,mutationQueue:r}){if(!i.CSSStyleSheet||!i.CSSStyleSheet.prototype)return()=>{};const o=i.CSSStyleSheet.prototype.insertRule;i.CSSStyleSheet.prototype.insertRule=new Proxy(o,{apply:Xa((i,o,s)=>{const[a]=s,l=i.apply(o,s);Oo(o.cssRules[l],a),n.onCssomSheetMutation(o);const{id:u,styleId:c}=ul(o,e,n.styleMirror);return(u&&-1!==u||c&&-1!==c)&&r.queueMutation(o,()=>t({id:u,styleId:c,adds:[{rule:a,index:l}]})),l},"host")}),i.CSSStyleSheet.prototype.addRule=function(t,e,n=this.cssRules.length){return i.CSSStyleSheet.prototype.insertRule.apply(this,[`${t} { ${e} }`,n])};const s=i.CSSStyleSheet.prototype.deleteRule;let a,l;i.CSSStyleSheet.prototype.deleteRule=new Proxy(s,{apply:Xa((i,o,s)=>{const[a]=s,l=i.apply(o,s);n.onCssomSheetMutation(o);const{id:u,styleId:c}=ul(o,e,n.styleMirror);return(u&&-1!==u||c&&-1!==c)&&r.queueMutation(o,()=>t({id:u,styleId:c,removes:[{index:a}]})),l},"host")}),i.CSSStyleSheet.prototype.removeRule=function(t){return i.CSSStyleSheet.prototype.deleteRule.apply(this,[t])},i.CSSStyleSheet.prototype.replace&&(a=i.CSSStyleSheet.prototype.replace,i.CSSStyleSheet.prototype.replace=new Proxy(a,{apply:Xa((i,o,s)=>{const[a]=s,l=i.apply(o,s);try{const i=null==l?void 0:l.then;if(o.ownerNode||!l||"function"!=typeof i)return l;const s=n.onCssomSheetMutation(o),{id:u,styleId:c}=ul(o,e,n.styleMirror),d=u&&-1!==u||c&&-1!==c?r.queuePendingMutation(o,()=>t({id:u,styleId:c,replace:a}),()=>{const e=ys(o);null!==e&&t({id:u,styleId:c,replace:e})}):void 0;try{i.call(l,()=>{n.isCurrentCssomMutation(o,s)&&$o(o,a),null==d||d(!0)},()=>null==d?void 0:d(!1))}catch(t){null==d||d(!1)}}catch(t){}return l},"host")})),i.CSSStyleSheet.prototype.replaceSync&&(l=i.CSSStyleSheet.prototype.replaceSync,i.CSSStyleSheet.prototype.replaceSync=new Proxy(l,{apply:Xa((i,o,s)=>{const[a]=s,l=i.apply(o,s);$o(o,a),n.onCssomSheetMutation(o);const{id:u,styleId:c}=ul(o,e,n.styleMirror);return(u&&-1!==u||c&&-1!==c)&&r.queueMutation(o,()=>t({id:u,styleId:c,replaceSync:a})),l},"host")}));const u={};ml("CSSGroupingRule")?u.CSSGroupingRule=i.CSSGroupingRule:(ml("CSSMediaRule")&&(u.CSSMediaRule=i.CSSMediaRule),ml("CSSConditionRule")&&(u.CSSConditionRule=i.CSSConditionRule),ml("CSSSupportsRule")&&(u.CSSSupportsRule=i.CSSSupportsRule));const c={};return Object.entries(u).forEach(([i,o])=>{c[i]={insertRule:o.prototype.insertRule,deleteRule:o.prototype.deleteRule},o.prototype.insertRule=new Proxy(c[i].insertRule,{apply:Xa((i,o,s)=>{const[a]=s,l=i.apply(o,s);Oo(o.cssRules[l],a),n.onCssomSheetMutation(o.parentStyleSheet);const{id:u,styleId:c}=ul(o.parentStyleSheet,e,n.styleMirror);if(o.parentStyleSheet&&(u&&-1!==u||c&&-1!==c)){const e=[...ll(o),l];r.queueMutation(o.parentStyleSheet,()=>t({id:u,styleId:c,adds:[{rule:a,index:e}]}))}return l},"host")}),o.prototype.deleteRule=new Proxy(c[i].deleteRule,{apply:Xa((i,o,s)=>{const[a]=s,l=i.apply(o,s);Eo(o),n.onCssomSheetMutation(o.parentStyleSheet);const{id:u,styleId:c}=ul(o.parentStyleSheet,e,n.styleMirror);if(o.parentStyleSheet&&(u&&-1!==u||c&&-1!==c)){const e=[...ll(o),a];r.queueMutation(o.parentStyleSheet,()=>t({id:u,styleId:c,removes:[{index:e}]}))}return l},"host")})}),Xa(()=>{i.CSSStyleSheet.prototype.insertRule=o,i.CSSStyleSheet.prototype.deleteRule=s,a&&(i.CSSStyleSheet.prototype.replace=a),l&&(i.CSSStyleSheet.prototype.replaceSync=l),Object.entries(u).forEach(([t,e])=>{e.prototype.insertRule=c[t].insertRule,e.prototype.deleteRule=c[t].deleteRule})})}(t,{win:n,mutationQueue:e})),a("adoptedStyleSheet",()=>hl(t,t.doc)),a("styleDeclaration",()=>function({styleDeclarationCb:t,mirror:e,ignoreCSSAttributes:n,stylesheetManager:i},{win:r,mutationQueue:o}){const s=r.CSSStyleDeclaration.prototype.setProperty;r.CSSStyleDeclaration.prototype.setProperty=new Proxy(s,{apply:Xa((r,s,a)=>{var l;const[u,c,d]=a,h=r.apply(s,a);if(Eo(s.parentRule),n.has(u))return h;const f=null===(l=s.parentRule)||void 0===l?void 0:l.parentStyleSheet;i.onCssomSheetMutation(f);const{id:v,styleId:p}=ul(f,e,i.styleMirror);if(v&&-1!==v||p&&-1!==p){const e=ll(s.parentRule);o.queueMutation(f,()=>t({id:v,styleId:p,set:{property:u,value:c,priority:d},index:e}))}return h},"host")});const a=r.CSSStyleDeclaration.prototype.removeProperty;return r.CSSStyleDeclaration.prototype.removeProperty=new Proxy(a,{apply:Xa((r,s,a)=>{var l;const[u]=a,c=r.apply(s,a);if(Eo(s.parentRule),n.has(u))return c;const d=null===(l=s.parentRule)||void 0===l?void 0:l.parentStyleSheet;i.onCssomSheetMutation(d);const{id:h,styleId:f}=ul(d,e,i.styleMirror);if(h&&-1!==h||f&&-1!==f){const e=ll(s.parentRule);o.queueMutation(d,()=>t({id:h,styleId:f,remove:{property:u},index:e}))}return c},"host")}),Xa(()=>{r.CSSStyleDeclaration.prototype.setProperty=s,r.CSSStyleDeclaration.prototype.removeProperty=a})}(t,{win:n,mutationQueue:e})),t.collectFonts&&a("font",()=>function({fontCb:t,doc:e}){const n=e.defaultView;if(!n)return()=>{};const i=[],r=new WeakMap,o=n.FontFace;n.FontFace=function(t,e,n){const i=new o(t,e,n);return r.set(i,{family:t,buffer:"string"!=typeof e,descriptors:n,fontSource:"string"==typeof e?e:JSON.stringify(Array.from(new Uint8Array(e)))}),i};const s=ko(e.fonts,"add",function(e){return function(n){return setTimeout(Xa(()=>{const e=r.get(n);e&&(t(e),r.delete(n))}),0),e.apply(this,[n])}});return i.push(()=>{n.FontFace=o}),i.push(s),Xa(()=>{i.forEach(t=>t())})}(t))}a("selection",()=>function(t){const{doc:e,mirror:n,blockClass:i,blockSelector:r,selectionCb:o}=t;let s=!0;const a=Xa(()=>{const t=e.getSelection();if(!t||s&&(null==t?void 0:t.isCollapsed))return;s=t.isCollapsed||!1;const a=[],l=t.rangeCount||0;for(let e=0;l>e;e++){const{startContainer:o,startOffset:s,endContainer:l,endOffset:u}=t.getRangeAt(e);$a(o,i,r,!0)||$a(l,i,r,!0)||a.push({start:n.getId(o),startOffset:s,end:n.getId(l),endOffset:u})}o({ranges:a})});return a(),ba("selectionchange",a)}(t)),a("customElement",()=>function({doc:t,customElementCb:e}){const n=t.defaultView;return n&&n.customElements?ko(n.customElements,"define",function(t){return function(n,i,r){try{e({define:{name:n}})}catch(t){console.warn(`Custom element callback failed for ${n}`)}return t.apply(this,[n,i,r])}}):()=>{}}(t));for(const e of t.plugins)a(`plugin:${e.name}`,()=>e.observer(e.callback,n,e.options))}catch(t){try{s()}catch(t){}throw t}return s}function pl(t){return void 0!==window[t]}function ml(t){return Boolean(void 0!==window[t]&&window[t].prototype&&"insertRule"in window[t].prototype&&"deleteRule"in window[t].prototype)}function gl(t){const e=window;if("function"==typeof e.requestIdleCallback){const n=e.requestIdleCallback(t,{timeout:2e3});return{cancel(){var t;return null===(t=e.cancelIdleCallback)||void 0===t?void 0:t.call(e,n)}}}const n=setTimeout(t,250);return{cancel:()=>clearTimeout(n)}}var yl,bl,wl=class{constructor(t){ds(this,"generateIdFn",void 0),ds(this,"iframeRemoteIdToLocalIdMap",new WeakMap),ds(this,"iframeLocalIdToRemoteIdMap",new WeakMap),this.generateIdFn=t}getId(t,e,n,i){if(0>e)return e;const r=n||this.getRemoteIdToLocalIdMap(t),o=i||this.getLocalIdToRemoteIdMap(t);let s=r.get(e);return void 0===s&&(s=this.generateIdFn(),r.set(e,s),o.set(s,e)),s}getIds(t,e){const n=this.getRemoteIdToLocalIdMap(t),i=this.getLocalIdToRemoteIdMap(t);return e.map(e=>this.getId(t,e,n,i))}getRemoteId(t,e,n){var i;return"number"!=typeof e||0>e?e:null!==(i=(n||this.getLocalIdToRemoteIdMap(t)).get(e))&&void 0!==i?i:-1}getRemoteIds(t,e){const n=this.getLocalIdToRemoteIdMap(t);return e.map(e=>this.getRemoteId(t,e,n))}reset(t){if(!t)return this.iframeRemoteIdToLocalIdMap=new WeakMap,void(this.iframeLocalIdToRemoteIdMap=new WeakMap);this.iframeRemoteIdToLocalIdMap.delete(t),this.iframeLocalIdToRemoteIdMap.delete(t)}getRemoteIdToLocalIdMap(t){let e=this.iframeRemoteIdToLocalIdMap.get(t);return e||(e=new Map,this.iframeRemoteIdToLocalIdMap.set(t,e)),e}getLocalIdToRemoteIdMap(t){let e=this.iframeLocalIdToRemoteIdMap.get(t);return e||(e=new Map,this.iframeLocalIdToRemoteIdMap.set(t,e)),e}},kl=class{constructor(t){ds(this,"iframes",new WeakMap),ds(this,"crossOriginIframeMap",new WeakMap),ds(this,"crossOriginIframeMirror",new wl(Gs)),ds(this,"crossOriginIframeStyleMirror",void 0),ds(this,"crossOriginIframeRootIdMap",new WeakMap),ds(this,"mirror",void 0),ds(this,"mutationCb",void 0),ds(this,"wrappedEmit",void 0),ds(this,"loadListener",void 0),ds(this,"pageHideListener",void 0),ds(this,"stylesheetManager",void 0),ds(this,"recordCrossOriginIframes",void 0),ds(this,"blockClass",void 0),ds(this,"blockSelector",void 0),ds(this,"messageHandler",void 0),ds(this,"nestedIframeListeners",new Map),ds(this,"attachedWindows",new WeakMap),ds(this,"attachedDocuments",new WeakMap),ds(this,"attachedIframes",new Map),ds(this,"loadListenerDisposers",new WeakMap),ds(this,"iframeElementsById",new Map),ds(this,"pageHideHandlers",new WeakMap),this.blockClass=t.blockClass,this.blockSelector=t.blockSelector,this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new wl(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.messageHandler=this.handleMessage.bind(this),this.recordCrossOriginIframes&&window.addEventListener("message",this.messageHandler)}addIframe(t){ia(t,this.blockClass,this.blockSelector)||(this.iframes.set(t,!0),t.contentWindow&&this.crossOriginIframeMap.set(t.contentWindow,t))}registerLoadListenerDisposer(t,e){let n=this.loadListenerDisposers.get(t);n||(n=new Set,this.loadListenerDisposers.set(t,n)),n.add(e);const i=this.mirror.getId(t);-1!==i&&this.iframeElementsById.set(i,t)}getIframeElementById(t){var e,n,i;return null!==(e=null!==(n=null===(i=this.attachedIframes.get(t))||void 0===i?void 0:i.element)&&void 0!==n?n:this.iframeElementsById.get(t))&&void 0!==e?e:null}forgetIframeId(t){this.attachedIframes.delete(t),this.iframeElementsById.delete(t)}disposeLoadListeners(t){const e=this.loadListenerDisposers.get(t);e&&(e.forEach(t=>ka(t)),this.loadListenerDisposers.delete(t))}removePageHideListener(t){const e=this.pageHideHandlers.get(t);e&&(e.forEach(({win:t,handler:e})=>{wa(t,"pagehide",e)}),this.pageHideHandlers.delete(t))}addLoadListener(t){this.loadListener=t}addPageHideListener(t){this.pageHideListener=t}removeLoadListener(){this.loadListener=void 0}trackIframeContent(t,e){const n=this.mirror.getId(t);return this.attachedIframes.set(n,{element:t,content:e}),n}attachIframe(t,e){var n;const i=this.trackIframeContent(t,e);if(t.contentDocument){let e=this.attachedDocuments.get(t);e||(e=new Set,this.attachedDocuments.set(t,e)),e.add(t.contentDocument)}this.mutationCb({adds:[{parentId:i,nextId:null,node:e}],removes:[],texts:[],attributes:[],isAttachIframe:!0});const r=t.contentWindow;if(this.recordCrossOriginIframes&&r&&!this.nestedIframeListeners.has(r)){const e=this.handleMessage.bind(this);ka(()=>{r.addEventListener("message",e),this.nestedIframeListeners.set(r,e);let n=this.attachedWindows.get(t);n||(n=new Set,this.attachedWindows.set(t,n)),n.add(r)})}ka(()=>{const e=t.contentWindow;if(!e)return;let n=this.pageHideHandlers.get(t);if(n)for(const t of n)if(t.win===e)return;const i=()=>{var e;null===(e=this.pageHideListener)||void 0===e||e.call(this,t),t.contentDocument&&this.mirror.removeNodeFromMap(t.contentDocument)};e.addEventListener("pagehide",i),n||(n=new Set,this.pageHideHandlers.set(t,n)),n.add({win:e,handler:i})}),null===(n=this.loadListener)||void 0===n||n.call(this,t),t.contentDocument&&t.contentDocument.adoptedStyleSheets&&t.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(t.contentDocument.adoptedStyleSheets,this.mirror.getId(t.contentDocument))}handleMessage(t){const e=t;if("rrweb"!==e.data.type||e.origin!==e.data.origin)return;if(!t.source)return;const n=this.crossOriginIframeMap.get(t.source);if(!n)return;const i=this.transformCrossOriginEvent(n,e.data.event);i&&this.wrappedEmit(i,e.data.isCheckout,!0===e.data.nonInteractive)}transformCrossOriginEvent(t,e){switch(e.type){case no.FullSnapshot:{this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(e.data.node,t);const n=e.data.node.id;return this.crossOriginIframeRootIdMap.set(t,n),this.patchRootIdOnNode(e.data.node,n),this.trackIframeContent(t,e.data.node),{timestamp:e.timestamp,type:no.IncrementalSnapshot,data:{source:io.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:e.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case no.Meta:case no.Load:case no.DomContentLoaded:return!1;case no.Plugin:return e;case no.Custom:return this.replaceIds(e.data.payload,t,["id","parentId","previousId","nextId"]),e;case no.IncrementalSnapshot:switch(e.data.source){case io.Mutation:return e.data.adds.forEach(e=>{this.replaceIds(e,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(e.node,t);const n=this.crossOriginIframeRootIdMap.get(t);n&&this.patchRootIdOnNode(e.node,n)}),e.data.removes.forEach(e=>{this.replaceIds(e,t,["parentId","id"])}),e.data.attributes.forEach(e=>{this.replaceIds(e,t,["id"])}),e.data.texts.forEach(e=>{this.replaceIds(e,t,["id"])}),e;case io.Drag:case io.TouchMove:case io.MouseMove:return e.data.positions.forEach(e=>{this.replaceIds(e,t,["id"])}),e;case io.ViewportResize:return!1;case io.MediaInteraction:case io.MouseInteraction:case io.Scroll:case io.CanvasMutation:return this.replaceIds(e.data,t,["id"]),e;case io.Input:return this.replaceIds(e.data,t,["id","selectedOptionIds"]),e;case io.StyleSheetRule:case io.StyleDeclaration:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleId"]),e;case io.Font:return e;case io.Selection:return e.data.ranges.forEach(e=>{this.replaceIds(e,t,["start","end"])}),e;case io.AdoptedStyleSheet:var n;return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleIds"]),null===(n=e.data.styles)||void 0===n||n.forEach(e=>{this.replaceStyleIds(e,t,["styleId"])}),e}}return!1}replace(t,e,n,i){for(const r of i)(Array.isArray(e[r])||"number"==typeof e[r])&&(e[r]=Array.isArray(e[r])?t.getIds(n,e[r]):t.getId(n,e[r]));return e}replaceIds(t,e,n){return this.replace(this.crossOriginIframeMirror,t,e,n)}replaceStyleIds(t,e,n){return this.replace(this.crossOriginIframeStyleMirror,t,e,n)}replaceIdOnNode(t,e){this.replaceIds(t,e,["id","rootId"]),"childNodes"in t&&t.childNodes.forEach(t=>{this.replaceIdOnNode(t,e)})}patchRootIdOnNode(t,e){t.type===lo.Document||t.rootId||(t.rootId=e),"childNodes"in t&&t.childNodes.forEach(t=>{this.patchRootIdOnNode(t,e)})}removeIframeById(t){const e=this.attachedIframes.get(t),n=(null==e?void 0:e.element)||this.iframeElementsById.get(t)||this.mirror.getNode(t);if(this.iframeElementsById.delete(t),n){const t=n.contentWindow,e=this.attachedWindows.get(n);e&&(e.forEach(t=>{const e=this.nestedIframeListeners.get(t);e&&(wa(t,"message",e),this.nestedIframeListeners.delete(t)),this.crossOriginIframeMap.delete(t)}),this.attachedWindows.delete(n)),t&&this.nestedIframeListeners.has(t)&&(wa(t,"message",this.nestedIframeListeners.get(t)),this.nestedIframeListeners.delete(t)),t&&this.crossOriginIframeMap.delete(t),this.iframes.delete(n),this.disposeLoadListeners(n),this.removePageHideListener(n);const i=this.attachedDocuments.get(n);i&&(i.forEach(t=>{ka(()=>this.mirror.removeNodeFromMap(t))}),ka(()=>rl(n,i)),this.attachedDocuments.delete(n))}e&&this.attachedIframes.delete(t)}cleanupDetachedIframes(){if(0===this.attachedIframes.size)return;const t=[];this.attachedIframes.forEach((e,n)=>{this.mirror.has(n)||t.push(n)}),t.forEach(t=>this.removeIframeById(t))}reattachIframes(){this.attachedIframes.forEach(({content:t},e)=>{this.mirror.has(e)?this.mutationCb({adds:[{parentId:e,nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}):this.attachedIframes.delete(e)})}destroy(){this.recordCrossOriginIframes&&wa(window,"message",this.messageHandler),this.nestedIframeListeners.forEach((t,e)=>{wa(e,"message",t)}),this.nestedIframeListeners.clear();const t=new Set;this.iframeElementsById.forEach(e=>t.add(e)),this.attachedIframes.forEach(({element:e})=>t.add(e)),t.forEach(t=>{this.disposeLoadListeners(t),this.removePageHideListener(t)}),this.crossOriginIframeMirror.reset(),this.crossOriginIframeStyleMirror.reset(),this.attachedIframes.clear(),this.crossOriginIframeMap=new WeakMap,this.iframes=new WeakMap,this.crossOriginIframeRootIdMap=new WeakMap,this.loadListenerDisposers=new WeakMap,this.pageHideHandlers=new WeakMap,this.attachedDocuments=new WeakMap,this.attachedWindows=new WeakMap,this.iframeElementsById=new Map}},Sl=new Map,_l=new WeakMap;function xl(t){t.dispose(),Sl.get(t.win)===t&&Sl.delete(t.win)}function Cl(){(null==bl?void 0:bl.valid)&&(bl.valid=!1,(null==yl?void 0:yl.stopped)?Po():Fo())}var Ml=class{constructor(t,e){ds(this,"win",void 0),ds(this,"owned",new Map),ds(this,"pending",new Set),ds(this,"stopped",!1),ds(this,"ready",!1),this.win=t;try{const i=bl;if(e&&(null==i?void 0:i.valid)&&i.stopCompleted&&!i.next&&["interactive","complete"].includes(t.document.readyState)){i.next=this;for(const e of i.retained)try{var n;e.win.CSSRule.prototype!==e.prototype||e.win!==t&&!(null===(n=e.win.frameElement)||void 0===n?void 0:n.isConnected)||(this.acquire(e.win),e.win!==t&&this.pending.add(e.win))}catch(t){}}else{if(Cl(),i){for(const t of i.retained)0===t.owners&&xl(t);i.retained.clear()}Fo(),To=new WeakSet,Io=!1}yl=this,e&&this.acquire(t)}catch(t){throw this.stop(),t}}acquire(t){if(!t.CSSRule)return Po(),()=>{};const e=this.owned.get(t);if(e)return e;let n=Sl.get(t);if(!n){const e=function(t){const e={active:!0};return _o.set(t,e),()=>{e.active=!1,_o.get(t)===e&&_o.delete(t)}}(t.CSSRule.prototype);let i;try{i=function(t){const e=[],n=(t,n)=>{const i="appendRule"===n||"deleteRule"===n||"insertRule"===n,r=Object.getOwnPropertyDescriptor(t,n);if(!r)return void(("style"===n||i)&&Po());const o="style"===n||"styleMap"===n||"media"===n;if(!r.configurable||o&&!r.get||i&&"function"!=typeof r.value)return void Po();const s=L({},r);if(i&&(s.value=new Proxy(r.value,{apply(t,e,n){const i=t.apply(e,n);return Do(e),i}})),r.get&&o){const t=r.get;s.get=function(){const e=t.call(this);return Do(this),e}}if(r.set){const t=r.set;s.set=function(e){const n=t.call(this,e);return Do(this),n}}try{Object.defineProperty(t,n,s),e.push(()=>{const e=Object.getOwnPropertyDescriptor(t,n);(null==e?void 0:e.get)===s.get&&(null==e?void 0:e.set)===s.set&&(null==e?void 0:e.value)===s.value&&Object.defineProperty(t,n,r)})}catch(t){Po()}};try{var i,r,o;const s=t;for(const e of[t.CSSStyleRule,t.CSSKeyframeRule,t.CSSPageRule,t.CSSFontFaceRule,s.CSSNestedDeclarations,s.CSSMarginRule,s.CSSPositionTryRule])e&&(n(e.prototype,"style"),n(e.prototype,"styleMap"));for(const e of[t.CSSMediaRule,t.CSSImportRule])e&&n(e.prototype,"media");t.CSSStyleRule&&n(t.CSSStyleRule.prototype,"selectorText"),t.CSSKeyframeRule&&n(t.CSSKeyframeRule.prototype,"keyText"),t.CSSKeyframesRule&&(n(t.CSSKeyframesRule.prototype,"name"),n(t.CSSKeyframesRule.prototype,"appendRule"),n(t.CSSKeyframesRule.prototype,"deleteRule"));const a=t.CSSGroupingRule?[t.CSSGroupingRule]:[t.CSSMediaRule,t.CSSConditionRule,t.CSSSupportsRule];for(const t of a)t&&(n(t.prototype,"insertRule"),n(t.prototype,"deleteRule"));const l=null===(i=t.CSSStyleRule)||void 0===i?void 0:i.prototype;for(const t of["insertRule","deleteRule"])l&&{}.hasOwnProperty.call(l,t)&&n(l,t);const u=null===(r=t.CSSRule)||void 0===r?void 0:r.prototype;return u&&(null===(o=Object.getOwnPropertyDescriptor(u,"cssText"))||void 0===o?void 0:o.set)&&n(u,"cssText"),()=>Sa(e)}catch(t){throw Sa(e),Po(),t}}(t)}catch(t){throw e(),t}n={win:t,prototype:t.CSSRule.prototype,owners:0,dispose:()=>Sa([e,i])},Sl.set(t,n)}const i=n;i.owners++;const r=()=>{this.owned.get(t)===r&&(this.owned.delete(t),this.pending.delete(t),i.owners--,0===i.owners&&((null==bl?void 0:bl.valid)&&bl.previous===this&&bl.stopStarted?bl.retained.add(i):xl(i)))};return this.owned.set(t,r),r}observe(t){return this.prune(),this.pending.delete(t),t===this.win?()=>{}:this.acquire(t)}prune(){for(const n of this.pending){var t;try{var e;const t=Sl.get(n);if((null===(e=n.frameElement)||void 0===e?void 0:e.isConnected)&&n.CSSRule.prototype===(null==t?void 0:t.prototype))continue}catch(t){}null===(t=this.owned.get(n))||void 0===t||t()}}beforeStop(){(null==bl?void 0:bl.previous)===this&&bl.valid&&!bl.stopStarted?bl.stopStarted=!0:Cl()}stop(){if(!this.stopped){for(const t of[...this.owned.values()])t();this.stopped=!0,(null==bl?void 0:bl.valid)&&bl.previous===this?bl.stopCompleted=!0:yl===this&&(Po(),yl=void 0)}}},Tl=class{constructor(t){ds(this,"shadowDoms",new Map),ds(this,"mutationCb",void 0),ds(this,"scrollCb",void 0),ds(this,"bypassOptions",void 0),ds(this,"mirror",void 0),ds(this,"restoreHandlers",[]),this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(t,e){var n,i;if(!vs(t))return;if(this.shadowDoms.has(t))return;const r=null!==(n=null===(i=So.host(t))||void 0===i?void 0:i.ownerDocument)&&void 0!==n?n:e,o={doc:r,handlers:[]};this.shadowDoms.set(t,o);const{observer:s,buffer:a}=nl(L(L({},this.bypassOptions),{},{doc:r,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t);o.handlers.push(()=>{s.disconnect(),a.destroy(),a.releaseCanvasManager();const t=tl.indexOf(a);-1!==t&&tl.splice(t,1)}),o.handlers.push(il(L(L({},this.bypassOptions),{},{scrollCb:this.scrollCb,doc:t,mirror:this.mirror}))),setTimeout(()=>{this.shadowDoms.get(t)===o&&(t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(So.host(t))),o.handlers.push(hl({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t)))},0)}removeShadowRootsIn(t){if(0===this.shadowDoms.size)return;const e=So.shadowRoot(t);e&&(this.shadowDoms.has(e)&&this.removeShadowRoot(e),this.removeShadowRootsIn(e)),So.childNodes(t).forEach(t=>this.removeShadowRootsIn(t))}removeShadowRoot(t){const e=this.shadowDoms.get(t);this.shadowDoms.delete(t),null==e||e.handlers.forEach(Il)}observeAttachShadow(t){ka(()=>{const e=t.contentWindow,n=t.contentDocument;e&&n&&this.patchAttachShadow(e.Element,n)})}patchAttachShadow(t,e){const n=this;this.restoreHandlers.push({doc:e,handler:ko(t.prototype,"attachShadow",function(t){return function(i){const r=t.call(this,i),o=So.shadowRoot(this);return o&&Ua(this)&&n.addShadowRoot(o,e),r}})})}reset(){this.restoreHandlers.forEach(({handler:t})=>Il(t)),this.restoreHandlers=[];const t=this.shadowDoms;this.shadowDoms=new Map,t.forEach(({handlers:t})=>t.forEach(Il))}resetForDoc(t){const e=[];for(const n of this.restoreHandlers)n.doc===t?Il(n.handler):e.push(n);this.restoreHandlers=e,this.shadowDoms.forEach((e,n)=>{e.doc===t&&this.removeShadowRoot(n)})}};function Il(t){try{t()}catch(t){}}var Al="skip-frame";function Rl(t){if("object"!=typeof t||null===t)return!1;const{x:e,y:n,width:i,height:r}=t;return Number.isFinite(e)&&Number.isFinite(n)&&Number.isFinite(i)&&Number.isFinite(r)&&i>=0&&r>=0}for(var El="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ol="undefined"==typeof Uint8Array?[]:new Uint8Array(256),$l=0;64>$l;$l++)Ol[El.charCodeAt($l)]=$l;var Ll=function(t){var e,n=new Uint8Array(t),i=n.length,r="";for(e=0;i>e;e+=3)r+=El[n[e]>>2],r+=El[(3&n[e])<<4|n[e+1]>>4],r+=El[(15&n[e+1])<<2|n[e+2]>>6],r+=El[63&n[e+2]];return i%3==2?r=r.substring(0,r.length-1)+"=":i%3==1&&(r=r.substring(0,r.length-2)+"=="),r},Dl=!1,Fl=new Map,Pl=(t,e,n)=>{if(!t||!jl(t,e)&&"object"!=typeof t)return;const i=function(t,e){let n=Fl.get(t);return n||(n=new Map,Fl.set(t,n)),n.has(e)||n.set(e,[]),n.get(e)}(n,t.constructor.name);let r=i.indexOf(t);return-1===r&&(r=i.length,i.push(t)),r};function Nl(t,e,n,i){if(t instanceof Array)return t.map(t=>Nl(t,e,n,i));if(null===t)return t;if(t instanceof Float32Array||t instanceof Float64Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Uint8Array||t instanceof Uint16Array||t instanceof Int16Array||t instanceof Int8Array||t instanceof Uint8ClampedArray)return{rr_type:t.constructor.name,args:[Object.values(t)]};if(t instanceof ArrayBuffer)return{rr_type:t.constructor.name,base64:Ll(t)};if(t instanceof DataView)return{rr_type:t.constructor.name,args:[Nl(t.buffer,e,n,i),t.byteOffset,t.byteLength]};if(t instanceof HTMLImageElement){const e=t.constructor.name,{src:n}=t;return{rr_type:e,src:n}}if(t instanceof HTMLCanvasElement){const e="HTMLImageElement";let n;try{n=t.toDataURL(i.type,i.quality)}catch(t){throw function(t){"SecurityError"===(null==t?void 0:t.name)?Dl||(Dl=!0,console.warn("[replay] canvas capture: skipping a canvas draw because its pixels cannot be read. A cross-origin image or video drawn into it taints it.",t)):console.warn("[replay] canvas capture: skipping a canvas draw because its pixels cannot be read.",t)}(t),t}return{rr_type:e,src:n}}return t instanceof ImageData?{rr_type:t.constructor.name,args:[Nl(t.data,e,n,i),t.width,t.height]}:jl(t,e)||"object"==typeof t?{rr_type:t.constructor.name,index:Pl(t,e,n)}:t}var ql=(t,e,n,i)=>t.map(t=>Nl(t,e,n,i)),jl=(t,e)=>{const n=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(t=>"function"==typeof e[t]);return Boolean(n.find(n=>t instanceof e[n]))},Bl=["webgl","webgl2"];function zl(t){return"nodeType"in t}function Ul(t,e,n,i){const r=[];try{if(i){const i=function(t,e,n){const i=t.GPUCanvasContext;if((null==i?void 0:i.prototype)&&"function"==typeof i.prototype.configure)return ko(i.prototype,"configure",function(i){return function(r){const o=function(t){const{canvas:e}=t;return e&&"object"==typeof e?e:null}(this);if(!o||zl(o)&&$a(o,e,n,!0))return i.call(this,r);zl(o)&&!("__context"in o)&&(o.__context="webgpu");const s=function(t){const e=t.GPUTextureUsage;return e?e.COPY_SRC|e.RENDER_ATTACHMENT:null}(t);return i.call(this,null!==s&&r?L(L({},r),{},{usage:"number"==typeof r.usage?r.usage|s:s}):r)}})}(t,e,n);i&&r.push(i)}const o=ko(t.HTMLCanvasElement.prototype,"getContext",function(t){return function(r,...o){const s=function(t){return"experimental-webgl"===t?"webgl":t}(r);if(!$a(this,e,n,!0)&&("__context"in this||(this.__context=s),i&&Bl.includes(s)))if(o[0]&&"object"==typeof o[0]){const t=o[0];t.preserveDrawingBuffer||(t.preserveDrawingBuffer=!0)}else o.splice(0,1,{preserveDrawingBuffer:!0});return t.apply(this,[r,...o])}});r.push(o)}catch(t){console.warn("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{r.forEach(t=>t())}}function Wl(t,e,n,i,r,o,s){const a=[],l=Object.getOwnPropertyNames(t);for(const u of l)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(u))try{if("function"!=typeof t[u])continue;const l=ko(t,u,function(t){return function(...a){const l=t.apply(this,a);if(Pl(l,o,this),this.canvas&&"tagName"in this.canvas&&!$a(this.canvas,i,r,!0)){let t;try{t=ql(a,o,this,s)}catch(t){}t&&n(this.canvas,{type:e,property:u,args:t})}return l}});a.push(l)}catch(o){const s=Ta(t,u,{set(t){this.canvas&&"tagName"in this.canvas&&!$a(this.canvas,i,r,!0)&&n(this.canvas,{type:e,property:u,args:[t],setter:!0})}});a.push(s)}return a}var Hl='(function() {\n\t//#region ../../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/base64-arraybuffer/1.0.2/f63fa6b5c318cf1c9f6bdd1d4292ad2f15f76f2ec78475025a2d44070e896fe9/node_modules/base64-arraybuffer/dist/base64-arraybuffer.es5.js\n\tvar chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";\n\tvar lookup = typeof Uint8Array === "undefined" ? [] : /* @__PURE__ */ new Uint8Array(256);\n\tfor (var i = 0; i < chars.length; i++) lookup[chars.charCodeAt(i)] = i;\n\tvar encode = function(arraybuffer) {\n\t\tvar bytes = new Uint8Array(arraybuffer), i, len = bytes.length, base64 = "";\n\t\tfor (i = 0; i < len; i += 3) {\n\t\t\tbase64 += chars[bytes[i] >> 2];\n\t\t\tbase64 += chars[(bytes[i] & 3) << 4 | bytes[i + 1] >> 4];\n\t\t\tbase64 += chars[(bytes[i + 1] & 15) << 2 | bytes[i + 2] >> 6];\n\t\t\tbase64 += chars[bytes[i + 2] & 63];\n\t\t}\n\t\tif (len % 3 === 2) base64 = base64.substring(0, base64.length - 1) + "=";\n\t\telse if (len % 3 === 1) base64 = base64.substring(0, base64.length - 2) + "==";\n\t\treturn base64;\n\t};\n\t//#endregion\n\t//#region ../rrweb/src/record/workers/image-bitmap-data-url-worker.ts\n\tconst lastFingerprintMap = /* @__PURE__ */ new Map();\n\tconst transparentFingerprintMap = /* @__PURE__ */ new Map();\n\tconst lastSentAtMap = /* @__PURE__ */ new Map();\n\tconst PROVIDER_KEYFRAME_INTERVAL_MS = 3e4;\n\tfunction hashPixels(data) {\n\t\tconst view = new Uint32Array(data.buffer, data.byteOffset, data.byteLength >>> 2);\n\t\tlet primaryHash = 2166136261;\n\t\tlet secondaryHash = 2654435769;\n\t\tfor (let i = 0; i < view.length; i++) {\n\t\t\tprimaryHash ^= view[i];\n\t\t\tprimaryHash = Math.imul(primaryHash, 16777619);\n\t\t\tsecondaryHash ^= view[i];\n\t\t\tsecondaryHash = Math.imul(secondaryHash, 2246822507);\n\t\t}\n\t\treturn `${(primaryHash >>> 0).toString(16)}:${(secondaryHash >>> 0).toString(16)}`;\n\t}\n\tfunction frameFingerprint(width, height, data) {\n\t\treturn `${width}x${height}:${hashPixels(data)}`;\n\t}\n\tfunction transparentFingerprint(width, height) {\n\t\tconst pixelCount = width * height;\n\t\tlet hash = transparentFingerprintMap.get(pixelCount);\n\t\tif (hash === void 0) {\n\t\t\thash = hashPixels(new Uint8ClampedArray(pixelCount * 4));\n\t\t\ttransparentFingerprintMap.set(pixelCount, hash);\n\t\t}\n\t\treturn `${width}x${height}:${hash}`;\n\t}\n\tlet webpProbeStarted = false;\n\tlet noWebpEncoder = false;\n\tfunction probeWebpEncoder() {\n\t\twebpProbeStarted = true;\n\t\tnew OffscreenCanvas(1, 1).convertToBlob({ type: "image/webp" }).then((blob) => {\n\t\t\tnoWebpEncoder = blob.type !== "image/webp";\n\t\t}).catch(() => void 0);\n\t}\n\tfunction isOpaque(pixels) {\n\t\tfor (let i = 3; i < pixels.length; i += 4) if (pixels[i] !== 255) return false;\n\t\treturn true;\n\t}\n\tfunction encodeOptions(options, pixels) {\n\t\tif (options.type !== "image/webp") return options;\n\t\tif (!webpProbeStarted) probeWebpEncoder();\n\t\treturn noWebpEncoder && isOpaque(pixels) ? {\n\t\t\t...options,\n\t\t\ttype: "image/jpeg"\n\t\t} : options;\n\t}\n\tconst worker = self;\n\tlet reusableCanvas = null;\n\tlet reusableCtx = null;\n\tworker.onmessage = async function(e) {\n\t\tif ("resetFrameDedup" in e.data) {\n\t\t\tlastFingerprintMap.clear();\n\t\t\treturn;\n\t\t}\n\t\tif ("OffscreenCanvas" in globalThis) {\n\t\t\tconst { id, bitmap, width, height, displayWidth, displayHeight, dataURLOptions, maskRegions } = e.data;\n\t\t\ttry {\n\t\t\t\tif (!reusableCanvas || reusableCanvas.width !== width || reusableCanvas.height !== height) {\n\t\t\t\t\treusableCanvas = new OffscreenCanvas(width, height);\n\t\t\t\t\treusableCtx = reusableCanvas.getContext("2d", { willReadFrequently: true });\n\t\t\t\t}\n\t\t\t\tconst ctx = reusableCtx;\n\t\t\t\tctx.clearRect(0, 0, width, height);\n\t\t\t\tctx.drawImage(bitmap, 0, 0);\n\t\t\t\tbitmap.close();\n\t\t\t\tif (maskRegions) {\n\t\t\t\t\tctx.fillStyle = "black";\n\t\t\t\t\tfor (const region of maskRegions) ctx.fillRect(region.x, region.y, region.width, region.height);\n\t\t\t\t}\n\t\t\t\tconst pixels = ctx.getImageData(0, 0, width, height).data;\n\t\t\t\tconst fingerprint = frameFingerprint(width, height, pixels);\n\t\t\t\tif (fingerprint === (lastFingerprintMap.get(id) ?? transparentFingerprint(width, height))) {\n\t\t\t\t\tconst lastSentAt = lastSentAtMap.get(id);\n\t\t\t\t\tif (!(maskRegions !== void 0 && lastSentAt !== void 0 && Date.now() - lastSentAt >= PROVIDER_KEYFRAME_INTERVAL_MS)) return worker.postMessage({ id });\n\t\t\t\t}\n\t\t\t\tconst blob = await reusableCanvas.convertToBlob(encodeOptions(dataURLOptions, pixels));\n\t\t\t\tconst arrayBuffer = await blob.arrayBuffer();\n\t\t\t\tworker.postMessage({\n\t\t\t\t\tid,\n\t\t\t\t\ttype: blob.type,\n\t\t\t\t\tbase64: encode(arrayBuffer),\n\t\t\t\t\tdisplayWidth,\n\t\t\t\t\tdisplayHeight\n\t\t\t\t});\n\t\t\t\tlastFingerprintMap.set(id, fingerprint);\n\t\t\t\tlastSentAtMap.set(id, Date.now());\n\t\t\t} catch {\n\t\t\t\tworker.postMessage({ id });\n\t\t\t}\n\t\t} else {\n\t\t\te.data.bitmap.close();\n\t\t\treturn worker.postMessage({ id: e.data.id });\n\t\t}\n\t};\n\t//#endregion\n})();\n',Gl="undefined"!=typeof self&&self.Blob&&new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);",Hl],{type:"text/javascript;charset=utf-8"});function Vl(t){let e;try{if(e=Gl&&(self.URL||self.webkitURL).createObjectURL(Gl),!e)throw"";const n=new Worker(e,{name:null==t?void 0:t.name});return n.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(e)}),n}catch(e){return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(Hl),{name:null==t?void 0:t.name})}}var Ql="A page CSP that omits blob: from worker-src or script-src blocks it";function Zl(t,...e){console.warn(`[replay] canvas capture: ${t}`,...e)}var Jl=class{onFullSnapshot(){var t;null===(t=this.resetFrameDedup)||void 0===t||t.call(this)}acquire(){this.refCount+=1}reset(){this.refCount>0&&(this.refCount-=1),this.refCount>0||this.teardown()}teardown(){this.torndown||(this.torndown=!0,this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers(),null!==this.rafIdTimestamp&&(cancelAnimationFrame(this.rafIdTimestamp),this.rafIdTimestamp=null),null!==this.rafIdFlush&&(cancelAnimationFrame(this.rafIdFlush),this.rafIdFlush=null))}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}constructor(t){ds(this,"pendingCanvasMutations",new Map),ds(this,"rafStamps",{latestId:0,invokeId:null}),ds(this,"mirror",void 0),ds(this,"mutationCb",void 0),ds(this,"resetObservers",void 0),ds(this,"frozen",!1),ds(this,"locked",!1),ds(this,"rafIdTimestamp",null),ds(this,"rafIdFlush",null),ds(this,"refCount",0),ds(this,"torndown",!1),ds(this,"resetFrameDedup",null),ds(this,"processMutation",(t,e)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(t)||this.pendingCanvasMutations.set(t,[]),this.pendingCanvasMutations.get(t).push(e)});const{sampling:e="all",win:n,blockClass:i,blockSelector:r,recordCanvas:o,dataURLOptions:s,resolutionScale:a,canvasMasking:l}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,o&&"all"===e&&this.initCanvasMutationObserver(n,i,r,s),o&&"number"==typeof e&&this.initCanvasFPSObserver(e,n,i,r,{dataURLOptions:s,resolutionScale:a,canvasMasking:l})}initCanvasFPSObserver(t,e,n,i,r){var o=this;if(!("OffscreenCanvas"in e))return void Zl("disabled because this browser does not support OffscreenCanvas");const s="number"==typeof r.resolutionScale&&Number.isFinite(r.resolutionScale)?Math.min(1,Math.max(.1,r.resolutionScale)):1,a=Ul(e,n,i,!0),l=new Map;let u;try{u=new Vl}catch(t){return Zl(`disabled because the encode worker did not start. ${Ql}`,t),void a()}let c=!1;u.onerror=t=>{var e;c=!0,Zl(`stopped because the encode worker failed. ${Ql}`,t),cancelAnimationFrame(v),null===(e=u.terminate)||void 0===e||e.call(u),this.resetFrameDedup=null},this.resetFrameDedup=()=>{u.postMessage({resetFrameDedup:!0})},u.onmessage=t=>{const{id:e}=t.data;if(l.set(e,!1),!("base64"in t.data))return;const{base64:n,type:i,displayWidth:r,displayHeight:o}=t.data;this.mutationCb({id:e,type:so["2D"],commands:[{property:"clearRect",args:[0,0,r,o]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:n}],type:i}]},0,0,r,o]}],displayWidth:r,displayHeight:o})};let d=!1,h=!1;const f=1e3/t;let v,p=0;const m=t=>{var a;c||(p&&f>t-p||(p=t,(()=>{const t=[],r=e=>{try{e.querySelectorAll("canvas").forEach(e=>{$a(e,n,i,!0)||t.push(e)}),e.querySelectorAll("*").forEach(t=>{t.shadowRoot&&r(t.shadowRoot)})}catch(t){}};return r(e.document),t})().forEach((a=A(function*(t){const e=o.mirror.getId(t);if(-1!==e&&!l.get(e)&&0!==t.width&&0!==t.height){l.set(e,!0);try{if(["webgl","webgl2"].includes(t.__context)){var n,i;const r=t.getContext(t.__context);if(null==r||null===(n=r.isContextLost)||void 0===n?void 0:n.call(r))return void l.set(e,!1);!1===(null==r||null===(i=r.getContextAttributes())||void 0===i?void 0:i.preserveDrawingBuffer)&&r.clear(r.COLOR_BUFFER_BIT)}const o=t.clientWidth||t.width,a=t.clientHeight||t.height,c=Math.max(1,Math.round(o*s)),h=Math.max(1,Math.round(a*s)),f=function(t,e,n,i,r,o){if(!t||"function"!=typeof t.regionsFn)return;let s;try{s=t.regionsFn(e)}catch(t){return Al}if(void 0===s)return;if(!Array.isArray(s)||!s.every(Rl))return Al;const a=n/r,l=i/o;return s.filter(t=>t.width>0&&t.height>0).map(t=>{const e=Math.floor(t.x*a),n=Math.floor(t.y*l);return{x:e,y:n,width:Math.ceil((t.x+t.width)*a)-e,height:Math.ceil((t.y+t.height)*l)-n}})}(r.canvasMasking,t,c,h,o,a);if("skip-frame"===f)return d||(d=!0,Zl("dropped a frame because the mask provider did not return valid regions. A provider that always fails records no canvas frames at all")),void l.set(e,!1);const v=yield createImageBitmap(t,1>s?{resizeWidth:c,resizeHeight:h,resizeQuality:"medium"}:{resizeWidth:c,resizeHeight:h});u.postMessage({id:e,bitmap:v,width:c,height:h,displayWidth:o,displayHeight:a,dataURLOptions:r.dataURLOptions,maskRegions:f},[v])}catch(t){h||(h=!0,Zl("dropped a frame because the snapshot failed. A canvas that fails every frame records no canvas frames at all",t)),l.set(e,!1)}}}),function(t){return a.apply(this,arguments)}))),v=requestAnimationFrame(m))};v=requestAnimationFrame(m),this.resetObservers=()=>{var t;a(),cancelAnimationFrame(v),null===(t=u.terminate)||void 0===t||t.call(u),this.resetFrameDedup=null}}initCanvasMutationObserver(t,e,n,i){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const r=Ul(t,e,n,!1),o=function(t,e,n,i,r){const o=[],s=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype);for(const a of s)try{if("function"!=typeof e.CanvasRenderingContext2D.prototype[a])continue;const s=ko(e.CanvasRenderingContext2D.prototype,a,function(o){return function(...s){return $a(this.canvas,n,i,!0)||setTimeout(()=>{let n;try{n=ql(s,e,this,r)}catch(t){return}t(this.canvas,{type:so["2D"],property:a,args:n})},0),o.apply(this,s)}});o.push(s)}catch(r){const s=Ta(e.CanvasRenderingContext2D.prototype,a,{set(e){$a(this.canvas,n,i,!0)||t(this.canvas,{type:so["2D"],property:a,args:[e],setter:!0})}});o.push(s)}return()=>{o.forEach(t=>t())}}(this.processMutation.bind(this),t,e,n,i),s=function(t,e,n,i,r){const o=[];return void 0!==e.WebGLRenderingContext&&o.push(...Wl(e.WebGLRenderingContext.prototype,so.WebGL,t,n,i,e,r)),void 0!==e.WebGL2RenderingContext&&o.push(...Wl(e.WebGL2RenderingContext.prototype,so.WebGL2,t,n,i,e,r)),()=>{o.forEach(t=>t())}}(this.processMutation.bind(this),t,e,n,i);this.resetObservers=()=>{r(),o(),s()}}startPendingCanvasMutationFlusher(){this.rafIdFlush=requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const t=e=>{this.rafStamps.latestId=e,this.rafIdTimestamp=requestAnimationFrame(t)};this.rafIdTimestamp=requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((t,e)=>{const n=this.mirror.getId(e);this.flushPendingCanvasMutationFor(e,n)}),this.rafIdFlush=requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(t,e){if(this.frozen||this.locked)return;const n=this.pendingCanvasMutations.get(t);if(!n||-1===e)return;const i=n.map(t=>function(t,e){if(null==t)return{};var n,i,r=function(t,e){if(null==t)return{};var n={};for(var i in t)if({}.hasOwnProperty.call(t,i)){if(e.includes(i))continue;n[i]=t[i]}return n}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;o.length>i;i++)e.includes(n=o[i])||{}.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}(t,eo)),{type:r}=n[0];this.mutationCb({id:e,type:r,commands:i}),this.pendingCanvasMutations.delete(t)}};function Yl(t){var e,n,i;const r={};for(const i of Object.keys(null!==(e=null===(n=t.previous)||void 0===n?void 0:n.attributes)&&void 0!==e?e:{}))r[i]=null;return Object.assign(r,null===(i=t.current)||void 0===i?void 0:i.attributes),delete r.rel,delete r.href,r}var Kl,Xl,tu,eu=class{constructor(t){var e,n,i;ds(this,"trackedLinkElements",new WeakSet),ds(this,"pendingDeferredSheets",new Set),ds(this,"cssomRevisions",new WeakMap),ds(this,"stopped",!1),ds(this,"changedLinkJobs",new Map),ds(this,"linksInlinedSinceSnapshot",new WeakSet),ds(this,"mutationCb",void 0),ds(this,"adoptedStyleSheetCb",void 0),ds(this,"maskAllElementAttributes",void 0),ds(this,"maskAttributeFn",void 0),ds(this,"blockClass",void 0),ds(this,"blockSelector",void 0),ds(this,"styleMirror",new Ba),this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb,this.maskAllElementAttributes=null!==(e=t.maskAllElementAttributes)&&void 0!==e&&e,this.maskAttributeFn=t.maskAttributeFn,this.blockClass=null!==(n=t.blockClass)&&void 0!==n?n:"rr-block",this.blockSelector=null!==(i=t.blockSelector)&&void 0!==i?i:null}isLinkBlocked(t){return La(t,this.blockClass,this.blockSelector)}attachLinkElement(t,e,n=null){this.stopped||!("_cssText"in e.attributes)||this.isLinkBlocked(t)||(this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:e.id,attributes:Yl({previous:n,current:e})}]}),this.linksInlinedSinceSnapshot.add(t)),this.trackLinkElement(t)}beginDeferredLinkInlining(t,e,n={}){var i;const r=null!==(i=n.emitCssText)&&void 0!==i?i:n=>this.emitCssTextMutation(t,e,n);if(-1===e||!t.isConnected)return null;let o=null,s=null;try{s=t.sheet,s&&(o=function(t){const e=[];let n=!1,i=null;const r=new Map;function o(t){const r=e.pop();if("group"===r.kind){if(null===t){for(;e.length>0&&"group"===e[e.length-1].kind;)e.pop();return void o(null)}const n=e[e.length-1];return n.parts.push(t),void(n.index+=1)}if(!r.importRule)return n=!0,void(i=t);s(e[e.length-1],r.importRule,t)}function s(t,e,n){try{let r;try{r=n||ms(e)}catch(t){r=e.cssText}try{var i;r&&(null===(i=e.styleSheet)||void 0===i?void 0:i.href)&&(r=Ps(r,e.styleSheet.href))}catch(t){}r&&t.parts.push(r),t.index+=1}catch(t){o(null)}}function a(t){var n;const i=t.rules[t.index];if("sheet"===t.kind&&ks(i)){const n=r.get(i);return null===n?(t.parts.push(i.cssText),void(t.index+=1)):n?void e.push({kind:"sheet",sheet:n.sheet,rules:n.rules,sheetHref:n.sheetHref,index:0,parts:[],importRule:i}):void s(t,i,null)}if(function(t,n){try{if(void 0!==Lo(t))return!1;const i=Cs(t);if(null===i)return!1;const r=n.sheetHref;return e.push({kind:"group",rules:Array.from(t.cssRules),sheetHref:r,index:0,parts:[],prelude:r?Ps(i,r):i,fixColons:"sheet"===n.kind&&Ss(t)&&t.selectorText.includes(":")}),!0}catch(t){return!1}}(i,t))return;let o=null!==(n=Lo(i))&&void 0!==n?n:i.cssText;"sheet"===t.kind&&Ss(i)&&i.selectorText.includes(":")&&(o=ws(o)),t.parts.push(t.sheetHref?Ps(o,t.sheetHref):o),t.index+=1}return function(t){try{const n=t.rules||t.cssRules;if(!n)return!1;is(n);let i=t.href;!i&&t.ownerNode&&(i=t.ownerNode.baseURI);const o=Array.from(n);return e.push({kind:"sheet",sheet:t,rules:o,sheetHref:i,index:0,parts:[],importRule:null}),function(t,e){const n=[{sheet:e,rules:t,index:0}];for(;n.length>0;){const t=n[n.length-1];if(t.index>=t.rules.length){n.pop();continue}const e=t.rules[t.index];if(t.index+=1,!ks(e)||r.has(e))continue;let i=null;try{i=e.styleSheet}catch(t){r.set(e,null);continue}if(i&&!n.some(t=>t.sheet===i))try{const t=i.rules||i.cssRules;if(!t)continue;is(t);let o=i.href;!o&&i.ownerNode&&(o=i.ownerNode.baseURI);const s=Array.from(t);r.set(e,{sheet:i,rules:s,sheetHref:o}),n.push({sheet:i,rules:s,index:0})}catch(t){}}}(o,t),!0}catch(t){return!1}}(t)||(n=!0),{advance(t){if(n)return!0;const r=No();let s=t>0?t:1;try{for(;!n&&s>0;){const t=e[e.length-1];if(t.index>=t.rules.length){let e=null;try{if("group"===t.kind){const n=t.prelude+t.parts.join("")+"}";e=t.fixColons?ws(n):n}else e=ps(t.parts.join(""))}catch(t){}o(e);continue}s-=1;try{a(t)}catch(t){o(null)}}}catch(t){n=!0,i=null}finally{os(No()-r)}return n},text(){return n?i:null},remainingRules(){if(n)return 0;let t=0;for(const n of e)t+=n.rules.length-n.index;return t}}}(s))}catch(t){}var a;if(!o||!s)return ls(),null===(a=n.onUninlinable)||void 0===a||a.call(n),null;const l=o;let u=!1;const c={sheet:s,invalidate(){u=!0}};this.pendingDeferredSheets.add(c);let d=!1;return{advance:e=>{if(d)return!0;const i=No(),o=Bo();let a=!0;try{if(u)return d=!0,n.onInvalidatedBySheetMutation?n.onInvalidatedBySheetMutation():ls(),!0;if(!l.advance(e))return a=!1,!1;d=!0;const i=l.text();if(!t.isConnected)return!0;let o=null;try{o=t.sheet}catch(t){}return o!==s?(ls(),!0):i?(this.isLinkBlocked(t)||r(i),!0):(ls(),null===(h=n.onUninlinable)||void 0===h||h.call(n),!0);var h}finally{a&&this.pendingDeferredSheets.delete(c),zo(f=No()-i,null!=(v=o)?v:qo)||(Xo.totalMs+=f,f>Xo.slowestSliceMs&&(Xo.slowestSliceMs=f))}var f,v},remainingRules:()=>l.remainingRules(),discard:()=>{this.pendingDeferredSheets.delete(c)}}}onCssomSheetMutation(t){var e;if(!t)return;const n=(null!==(e=this.cssomRevisions.get(t))&&void 0!==e?e:0)+1;this.cssomRevisions.set(t,n);for(const e of this.pendingDeferredSheets)e.sheet===t&&(this.pendingDeferredSheets.delete(e),e.invalidate());return n}isCurrentCssomMutation(t,e){return!this.stopped&&this.cssomRevisions.get(t)===e}inlineLinkStylesheetAfterChange(t,e){this.stopped||-1===e.currentId()||function(t,e){const n=ua(t),i=aa.get(t);if(i)return void(i.changedLinkBaseline&&(i.changedLinkBaseline.sheetAtLatestChange=n));const r={sheetAtLatestChange:n},o=()=>{const e=ua(t);return Boolean(e&&(e!==r.sheetAtLatestChange||e.href===t.href))};o()?e():ca(t,e,o,da,r)}(t,()=>this.inlineChangedLinkStylesheet(t,e,3))}inlineChangedLinkStylesheet(t,e,n){var i;const r=e.currentId();if(this.stopped||!t.isConnected||-1===r||this.isLinkBlocked(t))return;null===(i=this.changedLinkJobs.get(t))||void 0===i||i.drop();let o=!1;const s=this.beginDeferredLinkInlining(t,r,{emitCssText:n=>this.emitCssTextMutation(t,r,n,Yl(e.reserializeWithoutCss())),onInvalidatedBySheetMutation(){o=!0},onUninlinable:()=>this.readdAsPlainLink(t,e)});if(!s)return;let a=null;const l=()=>{s.discard(),null==a||a.cancel(),a=null,this.changedLinkJobs.get(t)===u&&this.changedLinkJobs.delete(t)},u={remainingRules:()=>s.remainingRules(),runSlice:()=>{try{return this.stopped||this.changedLinkJobs.get(t)!==u||-1===e.currentId()||this.isLinkBlocked(t)?(l(),!0):!!s.advance(200)&&(l(),!o||(n>0?this.inlineChangedLinkStylesheet(t,e,n-1):ls(),!0))}catch(t){return l(),!0}},drop:l};this.changedLinkJobs.set(t,u);const c=t=>{a=null;let e,n=0;do{e=u.runSlice(),n+=1}while(!e&&(t?!t.didTimeout&&t.timeRemaining()>5:10>n));e||(a=gl(c))};a=gl(c)}flushChangedLinkInlining(t){let e=0;for(const n of this.changedLinkJobs.values()){let i=!1;for(;!i;){if(Math.floor(n.remainingRules()/200)+1>t-e){n.drop(),us(1);break}i=n.runSlice(),e+=1}}return e}inlineDeferredLinkElement(t,e){var n;null===(n=this.beginDeferredLinkInlining(t,e))||void 0===n||n.advance(1/0)}emitCssTextMutation(t,e,n,i={}){this.stopped||(this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:e,attributes:L(L({},i),{},{_cssText:Rs({element:t,name:"_cssText",value:n,maskAllElementAttributes:this.maskAllElementAttributes,maskAttributeFn:this.maskAttributeFn})})}]}),this.linksInlinedSinceSnapshot.add(t))}readdAsPlainLink(t,e){try{var n,i;if(this.stopped||!t.isConnected||this.isLinkBlocked(t))return;if(!this.linksInlinedSinceSnapshot.has(t)&&!("_cssText"in(null!==(n=null===(i=e.lastSerialization())||void 0===i?void 0:i.attributes)&&void 0!==n?n:{})))return;this.linksInlinedSinceSnapshot.delete(t),e.readdAsMove()}catch(t){}}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,e){if(0===t.length)return;const n={id:e,styleIds:[]},i=[];for(const e of t){let t;if(this.styleMirror.has(e))t=this.styleMirror.getId(e);else{const n=this.styleMirror.add(e);t=n;const r=No();try{rs(()=>{try{const t=e.rules||e.cssRules;t&&is(t)}catch(t){}i.push({styleId:n,rules:Array.from(e.rules||CSSRule,(t,n)=>({rule:bs(t,e.href),index:n}))})})}finally{os(No()-r)}}n.styleIds.push(t)}i.length>0&&(n.styles=i),this.adoptedStyleSheetCb(n)}stop(){this.stopped=!0,this.dropChangedLinkJobs(),la()}dropChangedLinkJobs(){Array.from(this.changedLinkJobs.values()).forEach(t=>t.drop())}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet,this.pendingDeferredSheets.clear(),this.dropChangedLinkJobs(),this.linksInlinedSinceSnapshot=new WeakSet,la({keepChangedLinks:!0})}trackStylesheetInLinkElement(t){}},nu=class{constructor(){ds(this,"nodeMap",new WeakMap),ds(this,"active",!1)}inOtherBuffer(t,e){const n=this.nodeMap.get(t);return n&&Array.from(n).some(t=>t!==e)}add(t,e){this.active||(this.active=!0,requestAnimationFrame(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(e))}destroy(){}},iu=!1;try{if(2!==Array.from([1],t=>2*t)[0]){var ru;const t=document.createElement("iframe");document.body.appendChild(t),Array.from=(null===(ru=t.contentWindow)||void 0===ru?void 0:ru.Array.from)||Array.from,document.body.removeChild(t)}}catch(t){console.debug("Unable to override Array.from",t)}var ou=new Ms,su=new Set([io.Mutation,io.MediaInteraction,io.StyleSheetRule,io.CanvasMutation,io.Font,io.Log,io.StyleDeclaration,io.AdoptedStyleSheet]);function au(t={}){let e,n=!1,i=!1;const{emit:r,checkoutEveryNms:o,checkoutEveryNth:s,blockClass:a="rr-block",blockSelector:l=null,ignoreClass:u="rr-ignore",ignoreSelector:c=null,maskTextClass:d="rr-mask",maskTextSelector:h=null,inlineStylesheet:f=!0,inlineStylesheetBudgetRules:v,maskAllInputs:p,maskInputOptions:m,slimDOMOptions:g,maskInputFn:y,selectMaskingFn:b,maskTextFn:w,maskAllElementAttributes:k=!1,maskAttributeFn:S,hooks:_,packFn:x,sampling:C={},dataURLOptions:M={},canvasResolutionScale:T,canvasMasking:I,mousemoveWait:A,recordDOM:R=!0,recordCanvas:E=!1,recordCrossOriginIframes:O=!1,recordAfter:D=("DOMContentLoaded"===t.recordAfter?t.recordAfter:"load"),userTriggeredOnInput:F=!1,collectFonts:P=!1,inlineImages:N=!1,plugins:q,keepIframeSrcFn:j=()=>!1,ignoreCSSAttributes:B=new Set([]),attributeFilter:z,errorHandler:U}=t;Ya(U);const W=L({type:"image/webp",quality:.4,maxBase64ImageLength:1048576},M),H=!O||window.parent===window;let G=!1;if(!H)try{window.parent.document&&(G=!1)}catch(t){G=!0}if(H&&!r)throw new Error("emit function is required");if(!H&&!G)return()=>{};void 0!==A&&void 0===C.mousemove&&(C.mousemove=A),ou.reset(),la();const V=!0===p?{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,hidden:!0}:void 0!==m?m:{password:!0},Q=ga(void 0!==g&&g);let Z;!function(t=window){"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=[].forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=[].forEach)}();let J=0;const Y=new Map;let K,X;const tt=t=>{for(const e of q||[])e.eventProcessor&&(t=e.eventProcessor(t));return x&&!G&&(t=x(t)),t};Kl=(t,e,n)=>{var i;const a=t;if(a.timestamp=Ia(),!(null===(i=tl[0])||void 0===i?void 0:i.isFrozen())||a.type===no.FullSnapshot||a.type===no.IncrementalSnapshot&&su.has(a.data.source)||tl.forEach(t=>t.unfreeze()),H)n?null==r||r(tt(a),e,!0):null==r||r(tt(a),e);else if(G){const t={type:"rrweb",event:tt(a),origin:window.location.origin,isCheckout:e};n&&(t.nonInteractive=!0),window.parent.postMessage(t,"*")}if(a.type===no.FullSnapshot)Z=a,J=0;else if(a.type===no.IncrementalSnapshot){if(a.data.source===io.Mutation&&a.data.isAttachIframe)return;J++,(s&&J>=s||o&&a.timestamp-Z.timestamp>o)&&Xl(!0)}};const et=t=>{if(t.removes&&t.removes.length>0){const e=t.adds.length>0?new Set(t.adds.map(t=>t.node.id)):null,n=new Set;if(t.adds.length>0)for(const e of t.adds){const t=ou.getNode(e.node.id);t&&"IFRAME"===t.nodeName&&n.add(t)}t.removes.forEach(({id:t})=>{if(e&&e.has(t))return;const i=at.getIframeElementById(t);i&&n.has(i)?at.forgetIframeId(t):(null==K||K(t),at.removeIframeById(t))}),null==X||X(),at.cleanupDetachedIframes()}Kl({type:no.IncrementalSnapshot,data:L({source:io.Mutation},t)})},nt=t=>Kl({type:no.IncrementalSnapshot,data:L({source:io.Scroll},t)}),it=t=>Kl({type:no.IncrementalSnapshot,data:L({source:io.CanvasMutation},t)}),rt=new eu({mutationCb:et,adoptedStyleSheetCb:t=>Kl({type:no.IncrementalSnapshot,data:L({source:io.AdoptedStyleSheet},t)}),maskAllElementAttributes:k,maskAttributeFn:S,blockClass:a,blockSelector:l});let ot=!1;const st=()=>{if(!ot){ot=!0;try{var t;const n=null!==(t=null==e?void 0:e.flush())&&void 0!==t?t:0;rt.flushChangedLinkInlining(50-n)}finally{ot=!1}}},at=new kl({mirror:ou,mutationCb:et,stylesheetManager:rt,recordCrossOriginIframes:O,wrappedEmit:Kl,blockClass:a,blockSelector:l});for(const t of q||[])t.getMirror&&t.getMirror({nodeMirror:ou,crossOriginIframeMirror:at.crossOriginIframeMirror,crossOriginIframeStyleMirror:at.crossOriginIframeStyleMirror});const lt=new nu,ut=null==I?void 0:I.configured;tu=new Jl({recordCanvas:E,mutationCb:it,win:window,blockClass:a,blockSelector:l,mirror:ou,sampling:C.canvas,dataURLOptions:W,resolutionScale:T,canvasMasking:I});const ct=new Tl({mutationCb:et,scrollCb:nt,bypassOptions:{blockClass:a,blockSelector:l,maskTextClass:d,maskTextSelector:h,inlineStylesheet:f,maskInputOptions:V,dataURLOptions:W,maskTextFn:w,maskInputFn:y,selectMaskingFn:b,maskAllElementAttributes:k,maskAttributeFn:S,recordCanvas:E,canvasMaskingConfigured:ut,inlineImages:N,sampling:C,slimDOMOptions:Q,iframeManager:at,stylesheetManager:rt,canvasManager:tu,keepIframeSrcFn:j,processedNodeManager:lt,attributeFilter:z},mirror:ou});Xl=(t=!1)=>{if(R){ts(v);try{if(Kl({type:no.Meta,data:{href:window.location.href,width:Ea(),height:Ra()}},t),n)return;null==e||e.cancel(),e=void 0,rt.reset(),ct.init(),tl.forEach(t=>t.lock());let i=null,r=[];try{i=function(t,e){const{mirror:n=new Ms,blockClass:i="rr-block",blockSelector:r=null,maskTextClass:o="rr-mask",maskTextSelector:s=null,inlineStylesheet:a=!0,inlineImages:l=!1,recordCanvas:u=!1,canvasMaskingConfigured:c,maskAllInputs:d=!1,maskTextFn:h,maskInputFn:f,selectMaskingFn:v,maskAllElementAttributes:p=!1,maskAttributeFn:m,slimDOM:g=!1,dataURLOptions:y,preserveWhiteSpace:b,onSerialize:w,onIframeLoad:k,iframeLoadTimeout:S,onIframeListenerRegistered:_,onStylesheetLoad:x,stylesheetLoadTimeout:C,keepIframeSrcFn:M=()=>!1,maxDepth:T,inlineStylesheetBudgetRules:I}=e||{},A=!0===d?{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,hidden:!0}:!1===d?{password:!0}:d,R=ga(g);ts(I);try{return ma(t,{doc:t,mirror:n,blockClass:i,blockSelector:r,maskTextClass:o,maskTextSelector:s,skipChild:!1,inlineStylesheet:a,maskInputOptions:A,maskTextFn:h,maskInputFn:f,selectMaskingFn:v,maskAllElementAttributes:p,maskAttributeFn:m,slimDOMOptions:R,dataURLOptions:y,inlineImages:l,recordCanvas:u,canvasMaskingConfigured:c,preserveWhiteSpace:b,onSerialize:w,onIframeLoad:k,iframeLoadTimeout:S,onIframeListenerRegistered:_,onStylesheetLoad:x,stylesheetLoadTimeout:C,keepIframeSrcFn:M,newlyAddedElement:!1,maxDepth:T})}finally{es()}}(document,{mirror:ou,blockClass:a,blockSelector:l,maskTextClass:d,maskTextSelector:h,inlineStylesheet:f,maskAllInputs:V,inlineStylesheetBudgetRules:v,maskTextFn:w,maskInputFn:y,selectMaskingFn:b,maskAllElementAttributes:k,maskAttributeFn:S,slimDOM:Q,dataURLOptions:W,recordCanvas:E,canvasMaskingConfigured:ut,inlineImages:N,onSerialize(t){Na(t,ou)&&at.addIframe(t),qa(t,ou)&&rt.trackLinkElement(t),ja(t)&&ct.addShadowRoot(So.shadowRoot(t),document)},onIframeLoad(t,e){at.attachIframe(t,e),ct.observeAttachShadow(t)},onIframeListenerRegistered(t,e){at.registerLoadListenerDisposer(t,e)},onStylesheetLoad(t,e,n){rt.attachLinkElement(t,e,n)},keepIframeSrcFn:j})}finally{r=as()}if(n)return;if(!i)return console.warn("Failed to snapshot the document");if(al=new WeakMap,Kl({type:no.FullSnapshot,data:{node:i,initialOffset:Aa(window)}},t),n)return;if(tl.forEach(t=>t.unlock()),tu.onFullSnapshot(),r.length){const t=function(t,e,n){let i=!1,r=null,o=0,s=null;const a=()=>null!==s||t.length>o,l=()=>{const n=t[o];t[o]=null,o+=1,n&&ka(()=>{s=e.beginDeferredLinkInlining(n,ou.getId(n))})},u=()=>{if(!s)return;const t=s;let e=!0;ka(()=>{e=t.advance(200)}),e&&(s=null)},c=()=>{s||l(),u()},d=t=>{if(r=null,i)return;let e=0;do{try{c()}catch(t){null==s||s.discard(),s=null,us(1)}e+=1}while(!i&&a()&&(t?!t.didTimeout&&t.timeRemaining()>5:10>e));i||(a()?r=gl(d):n())};return r=gl(d),{cancel(){i=!0,null==s||s.discard(),s=null,null==r||r.cancel(),r=null},flush(){if(i)return 0;i=!0,null==r||r.cancel(),r=null;let e=0,c=0;for(;a()&&50>e;){s||l();const t=s;if(t)if(Math.floor(t.remainingRules()/200)+1>50-e)t.discard(),s=null,c+=1;else{try{u()}catch(t){null==s||s.discard(),s=null,c+=1}e+=1}}if(a()||c>0){let e=c+(null!==s?1:0);for(let n=o;t.length>n;n++)null!==t[n]&&(e+=1);us(e),null==s||s.discard(),s=null}return n(),e}}}(r,rt,()=>{e===t&&(e=void 0)});e=t}O&&at.reattachIframes(),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&rt.adoptStyleSheets(document.adoptedStyleSheets,ou.getId(document))}finally{es()}}};const dt=[];let ht;try{ht=new Ml(window,R),dt.push(ba("pagehide",()=>{try{st()}catch(t){}e=void 0},window));for(const t of["visibilitychange","freeze","resume"])dt.push(ba(t,jo,document));K=t=>{const e=Y.get(t);e&&(e.forEach(t=>{ka(t);const e=dt.indexOf(t);-1!==e&&dt.splice(e,1)}),Y.delete(t))},X=()=>{null==ht||ht.prune();for(const[t]of Y){const e=ou.getNode(t);if(e)try{e.contentDocument&&e.contentDocument.defaultView||null==K||K(t)}catch(e){null==K||K(t)}else null==K||K(t)}};const t=t=>{var e;return Xa(vl)({mutationCb:et,mousemoveCb:(t,e)=>Kl({type:no.IncrementalSnapshot,data:{source:e,positions:t}}),mouseInteractionCb:t=>Kl({type:no.IncrementalSnapshot,data:L({source:io.MouseInteraction},t)}),scrollCb:nt,viewportResizeCb:t=>Kl({type:no.IncrementalSnapshot,data:L({source:io.ViewportResize},t)}),inputCb:(t,e)=>Kl({type:no.IncrementalSnapshot,data:L({source:io.Input},t)},void 0,e),mediaInteractionCb:t=>Kl({type:no.IncrementalSnapshot,data:L({source:io.MediaInteraction},t)}),styleSheetRuleCb:t=>Kl({type:no.IncrementalSnapshot,data:L({source:io.StyleSheetRule},t)}),styleDeclarationCb:t=>Kl({type:no.IncrementalSnapshot,data:L({source:io.StyleDeclaration},t)}),canvasMutationCb:it,fontCb:t=>Kl({type:no.IncrementalSnapshot,data:L({source:io.Font},t)}),selectionCb(t){Kl({type:no.IncrementalSnapshot,data:L({source:io.Selection},t)})},customElementCb(t){Kl({type:no.IncrementalSnapshot,data:L({source:io.CustomElement},t)})},blockClass:a,ignoreClass:u,ignoreSelector:c,maskTextClass:d,maskTextSelector:h,maskInputOptions:V,inlineStylesheet:f,sampling:C,recordDOM:R,recordCanvas:E,canvasMaskingConfigured:ut,inlineImages:N,userTriggeredOnInput:F,collectFonts:P,doc:t,maskInputFn:y,selectMaskingFn:b,maskTextFn:w,maskAllElementAttributes:k,maskAttributeFn:S,keepIframeSrcFn:j,blockSelector:l,slimDOMOptions:Q,dataURLOptions:W,mirror:ou,iframeManager:at,stylesheetManager:rt,shadowDomManager:ct,processedNodeManager:lt,canvasManager:tu,ignoreCSSAttributes:B,attributeFilter:z,plugins:(null==q||null===(e=q.filter(t=>t.observer))||void 0===e?void 0:e.map(t=>({name:t.name,observer:t.observer,options:t.options,callback:e=>Kl({type:no.Plugin,data:{plugin:t.name,payload:e}})})))||[]},_)},r=e=>{const n=e.defaultView?null==ht?void 0:ht.observe(e.defaultView):void 0;try{const i=t(e);return()=>Sa([()=>null==i?void 0:i(),()=>null==n?void 0:n()])}catch(t){throw null==n||n(),t}},o=new WeakMap,s=new WeakMap;at.addLoadListener(t=>{null==ht||ht.prune();try{const e=t.contentDocument,n=ou.getId(t);if(!e)return;const i=s.get(t);if(i){s.delete(t),ka(i);const e=dt.indexOf(i);-1!==e&&dt.splice(e,1)}const a=o.get(e);if(-1!==n&&a){if(a())return;null==K||K(n)}const l=r(e);if("function"==typeof l){let i=!1;const r=ba("rrweb-check-iframe-observers",()=>{i=!0},e);-1!==n&&o.set(e,()=>{i=!1;const t=e.createEvent("Event");return t.initEvent("rrweb-check-iframe-observers",!1,!1),e.dispatchEvent(t),i});const a=()=>{o.delete(e),r(),l()};if(dt.push(a),-1!==n){let t=Y.get(n);t||(t=new Set,Y.set(n,t)),t.add(a)}else s.set(t,a)}}catch(t){console.warn(t)}}),at.addPageHideListener(t=>{const e=ou.getId(t);null==K||K(e),rl(t)});let v=-1;const p=t=>Kl({type:no.Custom,data:{tag:"rrweb/fullscreen",payload:t}}),m=()=>{var t,e,n,i;const r=document,o=null!==(t=null!==(e=null!==(n=null!==(i=r.fullscreenElement)&&void 0!==i?i:r.webkitFullscreenElement)&&void 0!==n?n:r.mozFullScreenElement)&&void 0!==e?e:r.msFullscreenElement)&&void 0!==t?t:null,s=o?ou.getId(o):-1;s!==v&&(-1!==v&&p({id:v,enter:!1}),v=s,-1!==s&&p({id:s,enter:!0}))},g=()=>{if(n||i)return;if(i=!0,Xl(),n)return;const t=r(document);n?"function"==typeof t&&Sa([t]):("function"==typeof t&&dt.push(t),dt.push(ba("fullscreenchange",m)),dt.push(ba("webkitfullscreenchange",m)),dt.push(ba("mozfullscreenchange",m)),dt.push(ba("MSFullscreenChange",m)),iu=!0,ht&&(ht.ready=!0))};["interactive","complete"].includes(document.readyState)?g():(dt.push(ba("DOMContentLoaded",()=>{Kl({type:no.DomContentLoaded,data:{}}),"DOMContentLoaded"===D&&setTimeout(g,0)})),dt.push(ba("load",()=>{Kl({type:no.Load,data:{}}),"load"===D&&g()},window)));const x=()=>{if(null==ht||ht.beforeStop(),!n){n=!0;try{st()}catch(t){}e=void 0,rt.stop(),Sa(dt),lt.destroy(),at.removeLoadListener(),at.destroy(),Y.clear(),ct.reset(),ou.reset(),iu=!1,Ka(),null==ht||ht.stop()}};return ht&&function(t,e){_l.set(t,e)}(x,ht),x}catch(t){n=!0,Sa(dt),null==ht||ht.stop(),console.warn(t)}}au.withStyleRuleSourceHandoff=function(t,e){const n=_l.get(t);if(!n||n.stopped||yl!==n||bl)return Cl(),void e(()=>{});const i={previous:n,next:void 0,valid:!0,stopStarted:!1,stopCompleted:!1,retained:new Set};bl=i;try{e(()=>{bl===i&&Cl()})}finally{var r;(null===(r=i.next)||void 0===r?void 0:r.ready)||Cl();for(const t of i.retained)0===t.owners&&xl(t);i.retained.clear(),bl===i&&(bl=void 0)}},au.addCustomEvent=(t,e)=>{if(!iu)throw new Error("please add custom event after start recording");Kl({type:no.Custom,data:{tag:t,payload:e}})},au.freezePage=()=>{tl.forEach(t=>t.freeze())},au.takeFullSnapshot=t=>{if(!iu)throw new Error("please take full snapshot after start recording");Xl(t)},au.isRecording=()=>iu,au.supportsSelectMasking=!0,au.mirror=ou,Date,Date;var lu=Object.create(null);function uu(t){return uu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},uu(t)}function cu(t,e,n){return(e=function(t){var e=function(t){if("object"!=uu(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=uu(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==uu(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}lu.Node=Object.create(null),lu.ShadowRoot=Object.create(null),lu.MutationObserver=Object.create(null),lu.Element=Object.create(null);var du=class{constructor(t){cu(this,"fileName",void 0),cu(this,"functionName",void 0),cu(this,"lineNumber",void 0),cu(this,"columnNumber",void 0),this.fileName=t.fileName||"",this.functionName=t.functionName||"",this.lineNumber=t.lineNumber,this.columnNumber=t.columnNumber}toString(){const t=this.lineNumber||"",e=this.columnNumber||"";return this.functionName?`${this.functionName} (${this.fileName}:${t}:${e})`:`${this.fileName}:${t}:${e}`}},hu=/(^|@)\S+:\d+/,fu=/^\s*at .*(\S+:\d+|\(native\))/m,vu=/^(eval@)?(\[native code])?$/,pu={parse(t){return t?void 0!==t.stacktrace||void 0!==t["opera#sourceloc"]?this.parseOpera(t):t.stack&&t.stack.match(fu)?this.parseV8OrIE(t):t.stack?this.parseFFOrSafari(t):[]:[]},extractLocation(t){if(-1===t.indexOf(":"))return[t];const e=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(t.replace(/[()]/g,""));if(!e)throw new Error(`Cannot parse given url: ${t}`);return[e[1],e[2]||void 0,e[3]||void 0]},parseV8OrIE(t){return t.stack.split("\n").filter(function(t){return!!t.match(fu)},this).map(function(t){t.indexOf("(eval ")>-1&&(t=t.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));let e=t.replace(/^\s+/,"").replace(/\(eval code/g,"(");const n=e.match(/ (\((.+):(\d+):(\d+)\)$)/);e=n?e.replace(n[0],""):e;const i=e.split(/\s+/).slice(1),r=this.extractLocation(n?n[1]:i.pop());return new du({functionName:i.join(" ")||void 0,fileName:["eval","<anonymous>"].indexOf(r[0])>-1?void 0:r[0],lineNumber:r[1],columnNumber:r[2]})},this)},parseFFOrSafari(t){return t.stack.split("\n").filter(function(t){return!t.match(vu)},this).map(function(t){if(t.indexOf(" > eval")>-1&&(t=t.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===t.indexOf("@")&&-1===t.indexOf(":"))return new du({functionName:t});{const e=/((.*".+"[^@]*)?[^@]*)(?:@)/,n=t.match(e),i=n&&n[1]?n[1]:void 0,r=this.extractLocation(t.replace(e,""));return new du({functionName:i,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})}},this)},parseOpera(t){return!t.stacktrace||t.message.indexOf("\n")>-1&&t.message.split("\n").length>t.stacktrace.split("\n").length?this.parseOpera9(t):t.stack?this.parseOpera11(t):this.parseOpera10(t)},parseOpera9(t){const e=/Line (\d+).*script (?:in )?(\S+)/i,n=t.message.split("\n"),i=[];for(let t=2,r=n.length;r>t;t+=2){const r=e.exec(n[t]);r&&i.push(new du({fileName:r[2],lineNumber:parseFloat(r[1])}))}return i},parseOpera10(t){const e=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,n=t.stacktrace.split("\n"),i=[];for(let t=0,r=n.length;r>t;t+=2){const r=e.exec(n[t]);r&&i.push(new du({functionName:r[3]||void 0,fileName:r[2],lineNumber:parseFloat(r[1])}))}return i},parseOpera11(t){return t.stack.split("\n").filter(function(t){return!!t.match(hu)&&!t.match(/^Error created at/)},this).map(function(t){const e=t.split("@"),n=this.extractLocation(e.pop());return new du({functionName:(e.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})},this)}};function mu(t){if(!t||!t.outerHTML)return"";let e="";for(;t.parentElement;){let n=t.localName;if(!n)break;n=n.toLowerCase();const i=t.parentElement,r=[];if(i.children&&i.children.length>0)for(let t=0;i.children.length>t;t++){const e=i.children[t];e.localName&&e.localName.toLowerCase&&e.localName.toLowerCase()===n&&r.push(e)}r.length>1&&(n+=`:eq(${r.indexOf(t)})`),e=n+(e?">"+e:""),t=i}return e}function gu(t){return Array.isArray(t)}function yu(t){return"object"==typeof t&&null!==t&&!gu(t)}function bu(t,e){if(0===e)return!0;const n=Object.keys(t);for(const i of n)if(yu(t[i])&&bu(t[i],e-1))return!0;return!1}function wu(t,e){const n={numOfKeysLimit:50,depthOfLimit:4};Object.assign(n,e);const i=[],r=[];return JSON.stringify(t,function(t,e){if(i.length>0){const n=i.indexOf(this);~n?i.splice(n+1):i.push(this),~n?r.splice(n,1/0,t):r.push(t),~i.indexOf(e)&&(e=i[0]===e?"[Circular ~]":"[Circular ~."+r.slice(0,i.indexOf(e)).join(".")+"]")}else i.push(e);if(null===e)return e;if(void 0===e)return"undefined";if(yu(o=e)&&Object.keys(o).length>n.numOfKeysLimit||"function"==typeof o||yu(o)&&bu(o,n.depthOfLimit))return function(t){let e=t.toString();return n.stringLengthLimit&&e.length>n.stringLengthLimit&&(e=`${e.slice(0,n.stringLengthLimit)}...`),e}(e);var o;if("bigint"==typeof e)return e.toString()+"n";if(e instanceof Event){const t={};for(const n in e){const i=e[n];t[n]=gu(i)?mu(i.length?i[0]:null):i}return t}return e instanceof Node?e instanceof HTMLElement?e?e.outerHTML:"":e.nodeName:e instanceof Error?e.stack?e.stack+"\nEnd of stack for Error object":e.name+": "+e.message:e})}var ku={level:["assert","clear","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"],lengthThreshold:1e3,logger:"console"};function Su(t,e,n){const i=n?Object.assign({},ku,n):ku,r=i.logger;if(!r)return()=>{};let o;o="string"==typeof r?e[r]:r;let s=0,a=!1,l=!0;const u=[];if(i.level.includes("error")){const n=e=>{const n=e.message;t({level:"error",trace:pu.parse(e.error).map(t=>t.toString()),payload:[wu(n,i.stringifyOptions)]})};e.addEventListener("error",n),u.push(()=>{e.removeEventListener("error",n)});const r=e=>{let n,r;e.reason instanceof Error?(n=e.reason,r=[wu(`Uncaught (in promise) ${n.name}: ${n.message}`,i.stringifyOptions)]):(n=new Error,r=[wu("Uncaught (in promise)",i.stringifyOptions),wu(e.reason,i.stringifyOptions)]),t({level:"error",trace:pu.parse(n).map(t=>t.toString()),payload:r})};e.addEventListener("unhandledrejection",r),u.push(()=>{e.removeEventListener("unhandledrejection",r)})}for(const t of i.level)u.push(c(o,t));return()=>{l=!1,u.forEach(t=>t())};function c(e,n){return e[n]?function(r,o){try{if(!(o in r))return()=>{};const u=r[o],c={next:u},d=(r=>(...o)=>{if(r.apply(e,o),l&&!("assert"===n&&o[0]||a)){a=!0;try{const e=pu.parse(new Error).map(t=>t.toString()).splice(1),r=("assert"===n?o.slice(1):o).map(t=>wu(t,i.stringifyOptions));s++,i.lengthThreshold>s?t({level:n,trace:e,payload:r}):s===i.lengthThreshold&&t({level:"warn",trace:[],payload:[wu("The number of log records reached the threshold.")]})}catch(t){r.apply(e,["rrweb logger error:",t,...o])}finally{a=!1}}})(function(...t){return c.next.apply(this,t)});return"function"==typeof d&&(d.prototype=d.prototype||{},Object.defineProperties(d,{__rrweb_original__:{enumerable:!1,value:u},__rrweb_layer__:{enumerable:!1,value:c}})),r[o]=d,()=>{if(r[o]===d)return void(r[o]=c.next);const t=t=>{var e;return"function"==typeof t?null!==(e=t.__rrweb_layer__)&&void 0!==e?e:t.__posthog_layer__:void 0};let e=r[o],n=t(e);for(;n;){if(n.next===d)return void(n.next=c.next);e=n.next,n=t(e)}}}catch(t){return()=>{}}}(e,n):()=>{}}}var _u=t=>({name:"rrweb/console@1",observer:Su,options:t});const xu=()=>{},Cu=t=>{var e;if(W(t))return null!==(e=t.__posthog_layer__)&&void 0!==e?e:t.__rrweb_layer__};function Mu(t,e,n){try{if(!(e in t))return xu;const i={next:t[e]},r=n(function(...t){return i.next.apply(this,t)});return W(r)&&(r.prototype=r.prototype||{},Object.defineProperties(r,{__posthog_wrapped__:{enumerable:!1,value:!0},__posthog_layer__:{enumerable:!1,value:i}})),t[e]=r,()=>{if(t[e]===r)return void(t[e]=i.next);let n=t[e],o=Cu(n);for(;o;){if(o.next===r)return void(o.next=i.next);n=o.next,o=Cu(n)}}}catch(t){return xu}}function Tu(t,e){var n;const i=function(t){try{return"string"==typeof t?new URL(t).hostname:"url"in t?new URL(t.url).hostname:t.hostname}catch(t){return null}}(t),r={hostname:i,isHostDenied:!1};if(!(null===(n=e.payloadHostDenyList)||void 0===n?void 0:n.length)||!(null==i?void 0:i.trim().length))return r;for(const t of e.payloadHostDenyList)if(i.endsWith(t))return{hostname:i,isHostDenied:!0};return r}const Iu=he("[Recorder]"),Au=t=>"navigation"===t.entryType,Ru=t=>"resource"===t.entryType,Eu=()=>{};function Ou(t,e){var n;return Au(e)&&"complete"===(null===(n=t.document)||void 0===n?void 0:n.readyState)&&e.loadEventEnd>0}function $u(t,e){return e.recordInitialRequests?t.performance.getEntries().filter(n=>Ou(t,n)||Ru(n)&&e.initiatorTypes.includes(n.initiatorType)):e.performanceEntryTypeToObserve.includes("navigation")?function(t){var e;return"complete"!==(null===(e=t.document)||void 0===e?void 0:e.readyState)?[]:t.performance.getEntriesByType("navigation").filter(e=>Ou(t,e))}(t):[]}function Lu(t,e){return!!e&&(K(e)||e[t])}function Du(t){if("undefined"==typeof Request)return!1;if(t instanceof Request)return!0;try{return"[object Request]"==={}.toString.call(t)}catch(t){return!1}}const Fu=["image/","video/","audio/","font/","application/octet-stream","application/pdf","application/zip","application/wasm"];function Pu({type:t,recordBody:e,headers:n,url:i}){function r(t){const e=Object.keys(n).find(t=>"content-type"===t.toLowerCase()),i=e&&n[e];return t.some(t=>null==i?void 0:i.toLowerCase().includes(t))}if(!e)return!1;if(function t(e){try{return"string"==typeof e?e.startsWith("blob:"):e instanceof URL?"blob:"===e.protocol:!!Du(e)&&t(e.url)}catch(t){return!1}}(i))return!1;if(r(Fu))return!1;if(K(e))return!0;if(U(e))return r(e);const o=e[t];return K(o)?o:r(o)}function Nu(t,e,n,i,r){return qu.apply(this,arguments)}function qu(){return qu=A(function*(t,e,n,i,r,o=0){if(o>10)return Iu.warn("Failed to get performance entry for request",{url:n,initiatorType:e}),null;const s=function(t,e){for(let n=t.length-1;n>=0;n-=1)if(e(t[n]))return t[n]}(t.performance.getEntriesByName(n),t=>Ru(t)&&t.initiatorType===e&&(G(i)||t.startTime>=i)&&(G(r)||r>=t.startTime));return s||(yield new Promise(t=>setTimeout(t,50*o)),Nu(t,e,n,i,r,o+1))}),qu.apply(this,arguments)}function ju({body:t,options:e,url:n}){if(J(t))return null;const{hostname:i,isHostDenied:r}=Tu(n,e);if(r)return i+" is in deny list";if(V(t))return t;if((t=>"u">typeof Document&&t instanceof Document)(t))return t.textContent;if(X(t))return we(t);if(H(t))try{return JSON.stringify(t)}catch(t){return"[SessionReplay] Failed to stringify response object"}return"[SessionReplay] Cannot read body of type "+toString.call(t)}const Bu=t=>!Z(t)&&("navigation"===t.entryType||"resource"===t.entryType);function zu(t,{entry:e,method:n,status:i,networkRequest:r,isInitial:o,start:s,end:a,url:l,initiatorType:u}){s=e?e.startTime:s,a=e?e.responseEnd:a;const c=Math.floor(Date.now()-t.performance.now()),d=Math.floor(c+(s||0)),h=[L(L({},e?JSON.parse(JSON.stringify(e.toJSON())):{name:l}),{},{startTime:G(s)?void 0:Math.round(s),endTime:G(a)?void 0:Math.round(a),timeOrigin:c,timestamp:d,method:n,initiatorType:u||(e?e.initiatorType:void 0),status:i,requestHeaders:r.requestHeaders,requestBody:r.requestBody,responseHeaders:r.responseHeaders,responseBody:r.responseBody,isInitial:o})];if(Bu(e))for(const t of e.serverTiming||[])h.push({timeOrigin:c,timestamp:d,startTime:Math.round(e.startTime),name:t.name,duration:t.duration,entryType:"serverTiming"});return h}const Uu=["video/","audio/"];function Wu(t){return H(t)&&W(t.getReader)&&W(t.tee)}const Hu="[SessionReplay] Timeout while trying to read body",Gu="[SessionReplay] Failed to read body";function Vu(t){return`${Gu}: ${t}`}function Qu(t){return`[SessionReplay] Body too large to record (> ${t} bytes)`}function Zu(t,e){if(!e.streamNetworkBody)return function(t){return new Promise(e=>{const n=setTimeout(()=>e(Hu),500);try{t.clone().text().then(t=>e(t),t=>e(Vu(t))).finally(()=>clearTimeout(n))}catch(t){clearTimeout(n),e(Gu)}})}(t);const n=Ke(e);return function(t,e){try{var n,i;const r=null===(n=t.headers)||void 0===n||null===(i=n.get)||void 0===i?void 0:i.call(n,"content-length");if(!r)return!1;const o=parseInt(r,10);return Number.isFinite(o)&&o>e}catch(t){return!1}}(t,n)?Promise.resolve(Qu(n)):function(t,e){return new Promise(n=>{let i,r=!1;function o(){try{null==i||i.cancel().catch(()=>{})}catch(t){}}function s(t){r||(r=!0,clearTimeout(a),o(),n(t))}const a=setTimeout(()=>s(Hu),500);let l;try{l=t.clone()}catch(t){return void s(Gu)}const u=l.body;if(!Wu(u)||"undefined"==typeof TextDecoder){try{l.text().then(t=>s(t),t=>s(Vu(t)))}catch(t){s(Gu)}return}try{i=u.getReader()}catch(t){return void s(Gu)}const c=[];let d=0;!function t(){i.read().then(({done:n,value:i})=>{if(r)o();else if(n)s((new TextDecoder).decode(function(t,e){const n=new Uint8Array(e);let i=0;for(const e of t)n.set(e,i),i+=e.byteLength;return n}(c,d)));else{if(i){if(d+i.byteLength>e)return void s(Qu(e));d+=i.byteLength,c.push(i)}t()}},t=>s(Vu(t)))}()})}(t,n)}function Ju(t){return Yu.apply(this,arguments)}function Yu(){return Yu=A(function*({r:t,options:e,url:n}){const{hostname:i,isHostDenied:r}=Tu(n,e);return r?Promise.resolve(i+" is in deny list"):Zu(t,e)}),Yu.apply(this,arguments)}function Ku(t){return Xu.apply(this,arguments)}function Xu(){return Xu=A(function*({r:t,options:e,url:n}){const i=function({r:t,options:e,url:n}){var i;if("chunked"===t.headers.get("Transfer-Encoding"))return"Chunked Transfer-Encoding is not supported";const r=null===(i=t.headers.get("Content-Type"))||void 0===i?void 0:i.toLowerCase(),o=Uu.some(t=>null==r?void 0:r.startsWith(t));if(r&&o)return`Content-Type ${r} is not supported`;const{hostname:s,isHostDenied:a}=Tu(n,e);return a?s+" is in deny list":null}({r:t,options:e,url:n});return Z(i)?Zu(t,e):Promise.resolve(i)}),Xu.apply(this,arguments)}let tc=null;function ec(t,e,n){if(!("performance"in e))return()=>{};if(tc)return Iu.warn("Network observer already initialised, doing nothing"),()=>{};const i=n?Object.assign({},Xe,n):Xe;let r=!0,o=!1;const s=e=>{if(!r)return;const n=[];let s=!1;e.requests.forEach(t=>{const e="serverTiming"===t.entryType;if(e&&s)return;let r;try{r=i.maskRequestFn(t)}catch(t){return o||(o=!0,Iu.warn("Network capture masking callback failed; dropping the record. Further masking failures will not be logged for this observer.")),void(e||(s=!0))}e||(s=!r||(t=>!!t&&ln.has(t))(r)),r&&n.push(r)}),n.length>0&&t(L(L({},e),{},{requests:n}))},a=function(t,e,n){try{t({requests:$u(e,n).flatMap(t=>zu(e,{entry:t,method:void 0,status:void 0,networkRequest:{},isInitial:!0})),isInitial:!0})}catch(t){Iu.error("Failed to capture initial performance entries for network capture",t)}const i=e.PerformanceObserver,r=null==i?void 0:i.supportedEntryTypes;if(!i||!U(r))return;const o=r.filter(t=>n.performanceEntryTypeToObserve.includes(t));if(!o.length)return;const s=new i(i=>{t({requests:i.getEntries().filter(t=>Au(t)||Ru(t)&&n.initiatorTypes.includes(t.initiatorType)&&(t=>!n.recordBody&&!n.recordHeaders||"xmlhttprequest"!==t.initiatorType&&"fetch"!==t.initiatorType)(t)).flatMap(t=>zu(e,{entry:t,method:void 0,status:void 0,networkRequest:{}}))})});return s.observe({entryTypes:o}),()=>{s.disconnect()}}(s,e,i),l=i.recordHeaders||i.recordBody;if(!a&&!l)return r=!1,Eu;let u=()=>{},c=()=>{};return l&&(u=function(t,e,n){if(!n.initiatorTypes.includes("xmlhttprequest"))return()=>{};const i=Lu("request",n.recordHeaders),r=Lu("response",n.recordHeaders),o=Mu(e.XMLHttpRequest.prototype,"open",o=>function(s,a,l=!0,u,c){const d=this;try{const o=new Request(a),l={};let u,c;const h={},f=d.setRequestHeader.bind(d);d.setRequestHeader=(t,e)=>(h[t]=e,f(t,e)),i&&(l.requestHeaders=h);const v=d.send.bind(d);d.send=t=>(Pu({type:"request",headers:h,url:a,recordBody:n.recordBody})&&(l.requestBody=ju({body:t,options:n,url:a})),u=e.performance.now(),v(t));const p=()=>{d.removeEventListener("readystatechange",m),d.removeEventListener("error",p),d.removeEventListener("abort",p),d.removeEventListener("timeout",p)},m=()=>{if(d.readyState!==d.DONE)return;p(),c=e.performance.now();const i={};d.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach(t=>{const e=t.split(": "),n=e.shift(),r=e.join(": ");n&&(i[n]=r)}),r&&(l.responseHeaders=i),Pu({type:"response",headers:i,url:a,recordBody:n.recordBody})&&(l.responseBody=ju({body:d.response,options:n,url:a})),Nu(e,"xmlhttprequest",o.url,u,c).then(n=>{t({requests:zu(e,{entry:n,method:s,status:null==d?void 0:d.status,networkRequest:l,start:u,end:c,url:a.toString(),initiatorType:"xmlhttprequest"})})}).catch(()=>{})};d.addEventListener("readystatechange",m),d.addEventListener("error",p),d.addEventListener("abort",p),d.addEventListener("timeout",p)}catch(t){Iu.error("Failed to instrument XHR for network capture",t)}o.call(d,s,a.toString(),l,u,c)});return()=>{o()}}(s,e,i),c=!0===i.captureFetchSynchronously?function(t,e,n){if(!n.initiatorTypes.includes("fetch"))return()=>{};const i=Lu("request",n.recordHeaders),r=Lu("response",n.recordHeaders),o=Mu(e,"fetch",o=>function(s,a){let l;try{l=new Request(s,a)}catch(t){Iu.error("Failed to instrument fetch for network capture",t);try{return Promise.resolve(o(s,a))}catch(t){return new Promise((e,n)=>n(t))}}const u={};let c,d;const h=A(function*(){try{const t={};l.headers.forEach((e,n)=>{t[n]=e}),i&&(u.requestHeaders=t),!Wu(null==a?void 0:a.body)&&Pu({type:"request",headers:t,url:s,recordBody:n.recordBody})&&(u.requestBody=yield Ju({r:l,options:n,url:s}))}catch(t){Iu.error("Failed to record fetch request for network capture",t)}})(),f=(v=A(function*(t){try{const e={};t.headers.forEach((t,n)=>{e[n]=t}),r&&(u.responseHeaders=e),Pu({type:"response",headers:e,url:s,recordBody:n.recordBody})&&(u.responseBody=yield Ku({r:t,options:n,url:s}))}catch(t){Iu.error("Failed to record fetch response for network capture",t)}}),function(t){return v.apply(this,arguments)});var v;try{c=e.performance.now()}catch(t){}let p;try{p=Du(s)?o(l):o(s,a)}catch(t){p=new Promise((e,n)=>n(t))}const m=Promise.resolve(p).then(t=>{try{d=e.performance.now()}catch(t){}return{status:"fulfilled",response:t}},t=>({status:"rejected",error:t})),g=n=>{(n=>Nu(e,"fetch",l.url,c,d).then(i=>{t({requests:zu(e,{entry:i,method:l.method,status:null==n?void 0:n.status,networkRequest:u,start:c,end:d,url:l.url,initiatorType:"fetch"})})}))(n).catch(()=>{})};return A(function*(){let t,e=!1;try{yield h;const i=yield m;if("rejected"===i.status)throw i.error;if(t=i.response,!0===n.returnFetchResponseEarly){const n=t;e=!0;const i=()=>g(n);return f(n).then(i,i),n}return yield f(t),t}finally{e||g(t)}})()});return()=>{o()}}(s,e,i):function(t,e,n){if(!n.initiatorTypes.includes("fetch"))return()=>{};const i=Lu("request",n.recordHeaders),r=Lu("response",n.recordHeaders),o=Mu(e,"fetch",o=>function(){var s=A(function*(s,a){let l,u;try{l=new Request(s,a)}catch(t){return Iu.error("Failed to instrument fetch for network capture",t),o(s,a)}const c={};let d,h;try{try{const t={};l.headers.forEach((e,n)=>{t[n]=e}),i&&(c.requestHeaders=t),!Wu(null==a?void 0:a.body)&&Pu({type:"request",headers:t,url:s,recordBody:n.recordBody})&&(c.requestBody=yield Ju({r:l,options:n,url:s}))}catch(t){Iu.error("Failed to record fetch request for network capture",t)}d=e.performance.now(),u=Du(s)?yield o(l):yield o(s,a),h=e.performance.now();try{const t={};u.headers.forEach((e,n)=>{t[n]=e}),r&&(c.responseHeaders=t),Pu({type:"response",headers:t,url:s,recordBody:n.recordBody})&&(c.responseBody=yield Ku({r:u,options:n,url:s}))}catch(t){Iu.error("Failed to record fetch response for network capture",t)}return u}finally{Nu(e,"fetch",l.url,d,h).then(n=>{t({requests:zu(e,{entry:n,method:l.method,status:null==u?void 0:u.status,networkRequest:c,start:d,end:h,url:l.url,initiatorType:"fetch"})})}).catch(()=>{})}});return function(t,e){return s.apply(this,arguments)}}());return()=>{o()}}(s,e,i)),tc=()=>{r=!1,null==a||a(),u(),c(),tc=null},tc}const nc=t=>({name:"rrweb/network@1",observer:ec,options:t});var ic,rc,oc,sc,ac,lc,uc,cc,dc,hc,fc,vc,pc,mc,gc;o.__PosthogExtensions__=o.__PosthogExtensions__||{},o.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:_u,getRecordNetworkPlugin:nc},o.__PosthogExtensions__.rrweb={record:au,version:"v2",wasMaxDepthReached:()=>pa,resetMaxDepthState(){pa=!1,va=!1},getLastSnapshotCost:()=>Vo,getMutationCost:()=>L({},Ko),getObserverInitFailures:()=>fl.size?Array.from(fl):void 0,resetSnapshotCostState(){Uo=0,Wo=0,Ho=0,qo=0,Go={durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0},Vo=null,Qo=null,Zo=[],Jo=0,Yo=0,Ko={slowestBatchMs:0},Xo={deferredCount:0,failedCount:0,abandonedCount:0,totalMs:0,slowestSliceMs:0}}},o.rrweb={record:au,version:"v2"},o.rrwebConsoleRecord={getRecordConsolePlugin:_u},o.getRecordNetworkPlugin=nc,o.__PosthogExtensions__=o.__PosthogExtensions__||{},o.__PosthogExtensions__.initSessionRecording=(t,e)=>new to(t,e),o.__PosthogExtensions__.initSessionRecording.supportsSelectMasking=!0;var yc={},bc=[],wc=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,kc=Array.isArray;function Sc(t,e){for(var n in e)t[n]=e[n];return t}function _c(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function xc(t,e,n){var i,r,o,s={};for(o in e)"key"==o?i=e[o]:"ref"==o?r=e[o]:s[o]=e[o];if(arguments.length>2&&(s.children=arguments.length>3?ic.call(arguments,2):n),"function"==typeof t&&null!=t.defaultProps)for(o in t.defaultProps)void 0===s[o]&&(s[o]=t.defaultProps[o]);return Cc(t,s,i,r,null)}function Cc(t,e,n,i,r){var o={type:t,props:e,key:n,ref:i,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==r?++oc:r,__i:-1,__u:0};return null==r&&null!=rc.vnode&&rc.vnode(o),o}function Mc(t){return t.children}function Tc(t,e){this.props=t,this.context=e}function Ic(t,e){if(null==e)return t.__?Ic(t.__,t.__i+1):null;for(var n;t.__k.length>e;e++)if(null!=(n=t.__k[e])&&null!=n.__e)return n.__e;return"function"==typeof t.type?Ic(t):null}function Ac(t){if(t.__P&&t.__d){var e=t.__v,n=e.__e,i=[],r=[],o=Sc({},e);o.__v=e.__v+1,rc.vnode&&rc.vnode(o),qc(t.__P,o,e,t.__n,t.__P.namespaceURI,32&e.__u?[n]:null,i,null==n?Ic(e):n,!!(32&e.__u),r),o.__v=e.__v,o.__.__k[o.__i]=o,Bc(i,o,r),e.__e=e.__=null,o.__e!=n&&Rc(o)}}function Rc(t){if(null!=(t=t.__)&&null!=t.__c)return t.__e=t.__c.base=null,t.__k.some(function(e){if(null!=e&&null!=e.__e)return t.__e=t.__c.base=e.__e}),Rc(t)}function Ec(t){(!t.__d&&(t.__d=!0)&&sc.push(t)&&!Oc.__r++||ac!=rc.debounceRendering)&&((ac=rc.debounceRendering)||lc)(Oc)}function Oc(){try{for(var t,e=1;sc.length;)sc.length>e&&sc.sort(uc),t=sc.shift(),e=sc.length,Ac(t)}finally{sc.length=Oc.__r=0}}function $c(t,e,n,i,r,o,s,a,l,u,c){var d,h,f,v,p,m,g,y=i&&i.__k||bc,b=e.length;for(l=function(t,e,n,i,r){var o,s,a,l,u,c=n.length,d=c,h=0;for(t.__k=new Array(r),o=0;r>o;o++)null!=(s=e[o])&&"boolean"!=typeof s&&"function"!=typeof s?("string"==typeof s||"number"==typeof s||"bigint"==typeof s||s.constructor==String?s=t.__k[o]=Cc(null,s,null,null,null):kc(s)?s=t.__k[o]=Cc(Mc,{children:s},null,null,null):void 0===s.constructor&&s.__b>0?s=t.__k[o]=Cc(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):t.__k[o]=s,l=o+h,s.__=t,s.__b=t.__b+1,a=null,-1!=(u=s.__i=Dc(s,n,l,d))&&(d--,(a=n[u])&&(a.__u|=2)),null==a||null==a.__v?(-1==u&&(r>c?h--:c>r&&h++),"function"!=typeof s.type&&(s.__u|=4)):u!=l&&(u==l-1?h--:u==l+1?h++:(u>l?h--:h++,s.__u|=4))):t.__k[o]=null;if(d)for(o=0;c>o;o++)null!=(a=n[o])&&!(2&a.__u)&&(a.__e==i&&(i=Ic(a)),Wc(a,a));return i}(n,e,y,l,b),d=0;b>d;d++)null!=(f=n.__k[d])&&(h=-1!=f.__i&&y[f.__i]||yc,f.__i=d,m=qc(t,f,h,r,o,s,a,l,u,c),v=f.__e,f.ref&&h.ref!=f.ref&&(h.ref&&Uc(h.ref,null,f),c.push(f.ref,f.__c||v,f)),null==p&&null!=v&&(p=v),(g=!!(4&f.__u))||h.__k===f.__k?(l=Lc(f,l,t,g),g&&h.__e&&(h.__e=null)):"function"==typeof f.type&&void 0!==m?l=m:v&&(l=v.nextSibling),f.__u&=-7);return n.__e=p,l}function Lc(t,e,n,i){var r,o;if("function"==typeof t.type){for(r=t.__k,o=0;r&&r.length>o;o++)r[o]&&(r[o].__=t,e=Lc(r[o],e,n,i));return e}t.__e!=e&&(i&&(e&&t.type&&!e.parentNode&&(e=Ic(t)),n.insertBefore(t.__e,e||null)),e=t.__e);do{e=e&&e.nextSibling}while(null!=e&&8==e.nodeType);return e}function Dc(t,e,n,i){var r,o,s,a=t.key,l=t.type,u=e[n],c=null!=u&&!(2&u.__u);if(null===u&&null==a||c&&a==u.key&&l==u.type)return n;if(i>(c?1:0))for(r=n-1,o=n+1;r>=0||e.length>o;)if(null!=(u=e[s=0>r?o++:r--])&&!(2&u.__u)&&a==u.key&&l==u.type)return s;return-1}function Fc(t,e,n){"-"==e[0]?t.setProperty(e,null==n?"":n):t[e]=null==n?"":"number"!=typeof n||wc.test(e)?n:n+"px"}function Pc(t,e,n,i,r){var o,s;t:if("style"==e)if("string"==typeof n)t.style.cssText=n;else{if("string"==typeof i&&(t.style.cssText=i=""),i)for(e in i)n&&e in n||Fc(t.style,e,"");if(n)for(e in n)i&&n[e]==i[e]||Fc(t.style,e,n[e])}else if("o"==e[0]&&"n"==e[1])o=e!=(e=e.replace(fc,"$1")),s=e.toLowerCase(),e=s in t||"onFocusOut"==e||"onFocusIn"==e?s.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+o]=n,n?i?n[hc]=i[hc]:(n[hc]=vc,t.addEventListener(e,o?mc:pc,o)):t.removeEventListener(e,o?mc:pc,o);else{if("http://www.w3.org/2000/svg"==r)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=e&&"height"!=e&&"href"!=e&&"list"!=e&&"form"!=e&&"tabIndex"!=e&&"download"!=e&&"rowSpan"!=e&&"colSpan"!=e&&"role"!=e&&"popover"!=e&&e in t)try{t[e]=null==n?"":n;break t}catch(t){}"function"==typeof n||(null==n||!1===n&&"-"!=e[4]?t.removeAttribute(e):t.setAttribute(e,"popover"==e&&1==n?"":n))}}function Nc(t){return function(e){if(this.l){var n=this.l[e.type+t];if(null==e[dc])e[dc]=vc++;else if(n[hc]>e[dc])return;return n(rc.event?rc.event(e):e)}}}function qc(t,e,n,i,r,o,s,a,l,u){var c,d,h,f,v,p,m,g,y,b,$,w,k,S,_,x,C=e.type;if(void 0!==e.constructor)return null;128&n.__u&&(l=!!(32&n.__u),o=[a=e.__e=n.__e]),(c=rc.__b)&&c(e);t:if("function"==typeof C){d=s.length;try{if(y=e.props,b=C.prototype&&C.prototype.render,$=(c=C.contextType)&&i[c.__c],w=c?$?$.props.value:c.__:i,n.__c?g=(h=e.__c=n.__c).__=h.__E:(b?e.__c=h=new C(y,w):(e.__c=h=new Tc(y,w),h.constructor=C,h.render=Hc),$&&$.sub(h),h.state||(h.state={}),h.__n=i,f=h.__d=!0,h.__h=[],h._sb=[]),b&&null==h.__s&&(h.__s=h.state),b&&null!=C.getDerivedStateFromProps&&(h.__s==h.state&&(h.__s=Sc({},h.__s)),Sc(h.__s,C.getDerivedStateFromProps(y,h.__s))),v=h.props,p=h.state,h.__v=e,f)b&&null==C.getDerivedStateFromProps&&null!=h.componentWillMount&&h.componentWillMount(),b&&null!=h.componentDidMount&&h.__h.push(h.componentDidMount);else{if(b&&null==C.getDerivedStateFromProps&&y!==v&&null!=h.componentWillReceiveProps&&h.componentWillReceiveProps(y,w),e.__v==n.__v||!h.__e&&null!=h.shouldComponentUpdate&&!1===h.shouldComponentUpdate(y,h.__s,w)){e.__v!=n.__v&&(h.props=y,h.state=h.__s,h.__d=!1),e.__e=n.__e,e.__k=n.__k,e.__k.some(function(t){t&&(t.__=e)}),bc.push.apply(h.__h,h._sb),h._sb=[],h.__h.length&&s.push(h);break t}null!=h.componentWillUpdate&&h.componentWillUpdate(y,h.__s,w),b&&null!=h.componentDidUpdate&&h.__h.push(function(){h.componentDidUpdate(v,p,m)})}if(h.context=w,h.props=y,h.__P=t,h.__e=!1,k=rc.__r,S=0,b)h.state=h.__s,h.__d=!1,k&&k(e),c=h.render(h.props,h.state,h.context),bc.push.apply(h.__h,h._sb),h._sb=[];else do{h.__d=!1,k&&k(e),c=h.render(h.props,h.state,h.context),h.state=h.__s}while(h.__d&&25>++S);h.state=h.__s,null!=h.getChildContext&&(i=Sc(Sc({},i),h.getChildContext())),b&&!f&&null!=h.getSnapshotBeforeUpdate&&(m=h.getSnapshotBeforeUpdate(v,p)),_=null!=c&&c.type===Mc&&null==c.key?zc(c.props.children):c,a=$c(t,kc(_)?_:[_],e,n,i,r,o,s,a,l,u),h.base=e.__e,e.__u&=-161,h.__h.length&&s.push(h),g&&(h.__E=h.__=null)}catch(t){if(s.length=d,e.__v=null,l||null!=o)if(t.then){for(e.__u|=l?160:128;a&&8==a.nodeType&&a.nextSibling;)a=a.nextSibling;null!=o&&(o[o.indexOf(a)]=null),e.__e=a}else{if(null!=o)for(x=o.length;x--;)_c(o[x]);jc(e)}else e.__e=n.__e,!e.__k&&n.__k&&(e.__k=n.__k),t.then||jc(e);rc.__e(t,e,n)}}else null==o&&e.__v==n.__v?(e.__k=n.__k,e.__e=n.__e):a=e.__e=function(t,e,n,i,r,o,s,a,l){var u,c,d,h,f,v,p,m=n.props||yc,g=e.props,y=e.type;if("svg"==y?r="http://www.w3.org/2000/svg":"math"==y?r="http://www.w3.org/1998/Math/MathML":r||(r="http://www.w3.org/1999/xhtml"),null!=o)for(u=0;o.length>u;u++)if((f=o[u])&&"setAttribute"in f==!!y&&(y?f.localName==y:3==f.nodeType)){t=f,o[u]=null;break}if(null==t){if(null==y)return document.createTextNode(g);t=document.createElementNS(r,y,g.is&&g),a&&(rc.__m&&rc.__m(e,o),a=!1),o=null}if(null==y)m===g||a&&t.data==g||(t.data=g);else{if(o="textarea"==y&&null!=g.defaultValue?null:o&&ic.call(t.childNodes),!a&&null!=o)for(m={},u=0;t.attributes.length>u;u++)m[(f=t.attributes[u]).name]=f.value;for(u in m)f=m[u],"dangerouslySetInnerHTML"==u?d=f:"children"==u||u in g||"value"==u&&"defaultValue"in g||"checked"==u&&"defaultChecked"in g||Pc(t,u,null,f,r);for(u in g)f=g[u],"children"==u?h=f:"dangerouslySetInnerHTML"==u?c=f:"value"==u?v=f:"checked"==u?p=f:a&&"function"!=typeof f||m[u]===f||Pc(t,u,f,m[u],r);if(c)a||d&&(c.__html==d.__html||c.__html==t.innerHTML)||(t.innerHTML=c.__html),e.__k=[];else if(d&&(t.innerHTML=""),$c("template"==e.type?t.content:t,kc(h)?h:[h],e,n,i,"foreignObject"==y?"http://www.w3.org/1999/xhtml":r,o,s,o?o[0]:n.__k&&Ic(n,0),a,l),null!=o)for(u=o.length;u--;)_c(o[u]);a&&"textarea"!=y||(u="value","progress"==y&&null==v?t.removeAttribute("value"):null!=v&&(v!==t[u]||"progress"==y&&!v||"option"==y&&v!=m[u])&&Pc(t,u,v,m[u],r),u="checked",null!=p&&p!=t[u]&&Pc(t,u,p,m[u],r))}return t}(n.__e,e,n,i,r,o,s,l,u);return(c=rc.diffed)&&c(e),128&e.__u?void 0:a}function jc(t){t&&(t.__c&&(t.__c.__e=!0),t.__k&&t.__k.some(jc))}function Bc(t,e,n){for(var i=0;n.length>i;i++)Uc(n[i],n[++i],n[++i]);rc.__c&&rc.__c(e,t),t.some(function(e){try{t=e.__h,e.__h=[],t.some(function(t){t.call(e)})}catch(t){rc.__e(t,e.__v)}})}function zc(t){return"object"!=typeof t||null==t||t.__b>0?t:kc(t)?t.map(zc):void 0!==t.constructor?null:Sc({},t)}function Uc(t,e,n){try{if("function"==typeof t){var i="function"==typeof t.__u;i&&t.__u(),i&&null==e||(t.__u=t(e))}else t.current=e}catch(t){rc.__e(t,n)}}function Wc(t,e,n){var i,r;if(rc.unmount&&rc.unmount(t),(i=t.ref)&&(i.current&&i.current!=t.__e||Uc(i,null,e)),null!=(i=t.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(t){rc.__e(t,e)}i.base=i.__P=i.__n=null}if(i=t.__k)for(r=0;i.length>r;r++)i[r]&&Wc(i[r],e,n||"function"!=typeof t.type);n||_c(t.__e),t.__c=t.__=t.__e=void 0}function Hc(t,e,n){return this.constructor(t,n)}function Gc(t,e,n){var i,r,o,s;e==document&&(e=document.documentElement),rc.__&&rc.__(t,e),r=(i="function"==typeof n)?null:n&&n.__k||e.__k,o=[],s=[],qc(e,t=(!i&&n||e).__k=xc(Mc,null,[t]),r||yc,yc,e.namespaceURI,!i&&n?[n]:r?null:e.firstChild?ic.call(e.childNodes):null,o,!i&&n?n:r?r.__e:e.firstChild,i,s),Bc(o,t,s),t.props.children=null}ic=bc.slice,rc={__e(t,e,n,i){for(var r,o,s;e=e.__;)if((r=e.__c)&&!r.__)try{if((o=r.constructor)&&null!=o.getDerivedStateFromError&&(r.setState(o.getDerivedStateFromError(t)),s=r.__d),null!=r.componentDidCatch&&(r.componentDidCatch(t,i||{}),s=r.__d),s)return r.__E=r}catch(e){t=e}throw t}},oc=0,Tc.prototype.setState=function(t,e){var n=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=Sc({},this.state);"function"==typeof t&&(t=t(Sc({},n),this.props)),t&&Sc(n,t),null!=t&&this.__v&&(e&&this._sb.push(e),Ec(this))},Tc.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),Ec(this))},Tc.prototype.render=Mc,sc=[],lc="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,uc=function(t,e){return t.__v.__b-e.__v.__b},Oc.__r=0,cc=Math.random().toString(8),dc="__d"+cc,hc="__a"+cc,fc=/(PointerCapture)$|Capture$/i,vc=0,pc=Nc(!1),mc=Nc(!0),gc=0;var Vc=0;function Qc(t,e,n,i,r,o){e||(e={});var s,a,l=e;if("ref"in l)for(a in l={},e)"ref"==a?s=e[a]:l[a]=e[a];var u={type:t,props:l,key:n,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Vc,__i:-1,__u:0,__source:r,__self:o};if("function"==typeof t&&(s=t.defaultProps))for(a in s)void 0===l[a]&&(l[a]=s[a]);return rc.vnode&&rc.vnode(u),u}const Zc="featureFlagsCommon";function Jc({client:t,config:e}){var n;if(!t||!e.uiHost)return;const i=null===(n=t.session)||void 0===n?void 0:n.sessionId;return i?`${e.uiHost}/project/${t.projectToken}/replay/${i}`:void 0}var Yc,Kc,Xc,td,ed=0,nd=[],id=rc,rd=id.__b,od=id.__r,sd=id.diffed,ad=id.__c,ld=id.unmount,ud=id.__;function cd(t,e){id.__h&&id.__h(Kc,t,ed||e),ed=0;var n=Kc.__H||(Kc.__H={__:[],__h:[]});return t>=n.__.length&&n.__.push({}),n.__[t]}function dd(t){return ed=1,function(t,e){var n=cd(Yc++,2);if(n.t=t,!n.__c&&(n.__=[Sd(void 0,e),function(t){var e=n.__N?n.__N[0]:n.__[0],i=n.t(e,t);e!==i&&(n.__N=[i,n.__[1]],n.__c.setState({}))}],n.__c=Kc,!Kc.__f)){var i=function(t,e,i){if(!n.__c.__H)return!0;var o=!1,s=n.__c.props!==t;if(n.__c.__H.__.some(function(t){if(t.__N){o=!0;var e=t.__[0];t.__=t.__N,t.__N=void 0,e!==t.__[0]&&(s=!0)}}),r){var a=r.call(this,t,e,i);return o?a||s:a}return!o||s};Kc.__f=!0;var r=Kc.shouldComponentUpdate,o=Kc.componentWillUpdate;Kc.componentWillUpdate=function(t,e,n){if(this.__e){var s=r;r=void 0,i(t,e,n),r=s}o&&o.call(this,t,e,n)},Kc.shouldComponentUpdate=i}return n.__N||n.__}(Sd,t)}function hd(t,e){var n=cd(Yc++,3);!id.__s&&kd(n.__H,e)&&(n.__=t,n.u=e,Kc.__H.__h.push(n))}function fd(t){return ed=5,vd(function(){return{current:t}},[])}function vd(t,e){var n=cd(Yc++,7);return kd(n.__H,e)&&(n.__=t(),n.__H=e,n.__h=t),n.__}function pd(t){var e=Kc.context[t.__c],n=cd(Yc++,9);return n.c=t,e?(null==n.__&&(n.__=!0,e.sub(Kc)),e.props.value):t.__}function md(){for(var t;t=nd.shift();){var e=t.__H;if(t.__P&&e)try{e.__h.some(bd),e.__h.some(wd),e.__h=[]}catch(n){e.__h=[],id.__e(n,t.__v)}}}id.__b=function(t){Kc=null,rd&&rd(t)},id.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),ud&&ud(t,e)},id.__r=function(t){od&&od(t),Yc=0;var e=(Kc=t.__c).__H;e&&(Xc===Kc?(e.__h=[],Kc.__h=[],e.__.some(function(t){t.__N&&(t.__=t.__N),t.u=t.__N=void 0})):(e.__h.length&&md(),Yc=0)),Xc=Kc},id.diffed=function(t){sd&&sd(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(1!==nd.push(e)&&td===id.requestAnimationFrame||((td=id.requestAnimationFrame)||yd)(md)),e.__H.__.some(function(t){t.u&&(t.__H=t.u,t.u=void 0)})),Xc=Kc=null},id.__c=function(t,e){e.some(function(t){try{t.__h.some(bd),t.__h=t.__h.filter(function(t){return!t.__||wd(t)})}catch(n){e.some(function(t){t.__h&&(t.__h=[])}),e=[],id.__e(n,t.__v)}}),ad&&ad(t,e)},id.unmount=function(t){ld&&ld(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.some(function(t){try{bd(t)}catch(t){e=t}}),n.__H=void 0,e&&id.__e(e,n.__v))};var gd="function"==typeof requestAnimationFrame;function yd(t){var e,n=function(){clearTimeout(i),gd&&cancelAnimationFrame(e),setTimeout(t)},i=setTimeout(n,35);gd&&(e=requestAnimationFrame(n))}function bd(t){var e=Kc,n=t.__c;"function"==typeof n&&(t.__c=void 0,n()),Kc=e}function wd(t){var e=Kc;t.__c=t.__(),Kc=e}function kd(t,e){return!t||t.length!==e.length||e.some(function(e,n){return e!==t[n]})}function Sd(t,e){return"function"==typeof e?e(t):e}const _d="tab",xd="left",Cd="center",Md="right",Td="next_to_trigger",Id="popover",Ad="widget",Rd="external_survey",Ed="open",Od="multiple_choice",$d="single_choice",Ld="rating",Dd="end",Fd="always",Pd="survey shown",Nd="survey dismissed",qd="survey sent",jd="$survey_id",Bd="$survey_name",zd="$survey_iteration",Ud="$survey_iteration_start_date",Wd="$survey_language",Hd=he("[Surveys]"),Gd=(t,e)=>`${t}${function(t){return t.current_iteration&&t.current_iteration>0?`${t.id}_${t.current_iteration}`:t.id}(e)}`,Vd=t=>Gd("seenSurvey_",t),Qd=[Id,Ad,"api"];function Zd(t,e){this.v=t,this.k=e}function Jd(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=Array(e);e>n;n++)i[n]=t[n];return i}function Yd(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var i,r,o,s,a=[],l=!0,u=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(i=o.call(n)).done)&&(a.push(i.value),a.length!==e);l=!0);}catch(t){u=!0,r=t}finally{try{if(!l&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw r}}return a}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Jd(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Jd(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Kd(t){var e,n;function i(e,n){try{var o=t[e](n),s=o.value,a=s instanceof Zd;Promise.resolve(a?s.v:s).then(function(n){if(a){var l="return"===e&&s.k?e:"next";if(!s.k||n.done)return i(l,n);n=t[l](n).value}r(!!o.done,n)},function(t){i("throw",t)})}catch(t){r(2,t)}}function r(t,r){2===t?e.reject(r):e.resolve({value:r,done:t}),(e=e.next)?i(e.key,e.arg):n=null}this._invoke=function(t,r){return new Promise(function(o,s){var a={key:t,arg:r,resolve:o,reject:s,next:null};n?n=n.next=a:(e=n=a,i(t,r))})},"function"!=typeof t.return&&(this.return=void 0)}Kd.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},Kd.prototype.next=function(t){return this._invoke("next",t)},Kd.prototype.throw=function(t){return this._invoke("throw",t)},Kd.prototype.return=function(t){return this._invoke("return",t)};const Xd=Object.entries,th=Object.keys,eh=Object.setPrototypeOf,nh=Object.isFrozen,ih=Object.getPrototypeOf,rh=Object.getOwnPropertyDescriptor;let oh=Object.freeze,sh=Object.seal,ah=Object.create,lh="undefined"!=typeof Reflect&&Reflect,uh=lh.apply,ch=lh.construct;oh||(oh=function(t){return t}),sh||(sh=function(t){return t}),uh||(uh=function(t,e){for(var n=arguments.length,i=new Array(n>2?n-2:0),r=2;n>r;r++)i[r-2]=arguments[r];return t.apply(e,i)}),ch||(ch=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;e>i;i++)n[i-1]=arguments[i];return new t(...n)});const dh=Fh([].forEach),hh=Fh([].lastIndexOf),fh=Fh([].pop),vh=Fh([].push),ph=Fh([].slice),mh=Fh([].splice),gh=Array.isArray,yh=Ph(Set),bh=Fh(Set.prototype.add),wh=Fh(Set.prototype.has),kh=Fh("".toLowerCase),Sh=Fh("".toString),_h=Fh("".match),xh=Fh("".replace),Ch=Fh("".indexOf),Mh=Fh("".trim),Th=Fh((0).toString),Ih=Fh(Boolean.prototype.toString),Ah="undefined"==typeof BigInt?null:Fh(BigInt.prototype.toString),Rh="undefined"==typeof Symbol?null:Fh(Symbol.prototype.toString),Eh=Fh({}.hasOwnProperty),Oh=Fh({}.toString),$h=/t/.test,Lh=function(t,e){return t instanceof RegExp&&(t.lastIndex=0),uh($h,t,[e])},Dh=Ph(TypeError);function Fh(t){return function(e){for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;n>r;r++)i[r-1]=arguments[r];return uh(t,e,i)}}function Ph(t){return function(){for(var e=arguments.length,n=new Array(e),i=0;e>i;i++)n[i]=arguments[i];return ch(t,n)}}function Nh(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:kh;if(eh&&eh(t,null),!gh(e))return t;let i=e.length;for(;i--;){let r=e[i];if("string"==typeof r){const t=n(r);t!==r&&(nh(e)||(e[i]=t),r=t)}t[r]=!0}return t}function qh(t){for(let e=0;t.length>e;e++)Eh(t,e)||(t[e]=null);return t}function jh(t){const e=ah(null);for(const i of Xd(t)){var n=Yd(i,2);const r=n[0],o=n[1];Eh(t,r)&&(e[r]=gh(o)?qh(o):o&&"object"==typeof o&&o.constructor===Object?jh(o):o)}return e}function Bh(t){const e=ah(null),n=th(t);let i=n.length;for(;i--;)e[n[i]]=t[n[i]];return e}function zh(t,e){for(;null!==t;){const n=rh(t,e);if(n){if(n.get)return Fh(n.get);if("function"==typeof n.value)return Fh(n.value)}t=ih(t)}return function(){return null}}const Uh=oh(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Wh=oh(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Hh=oh(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Gh=oh(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Vh=oh(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Qh=oh(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Zh=oh(["#text"]),Jh=oh(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),Yh=oh(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","pointer-events","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","vector-effect","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Kh=oh(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Xh=oh(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),tf=sh(/{{[\w\W]*|^[\w\W]*}}/g),ef=sh(/<%[\w\W]*|^[\w\W]*%>/g),nf=sh(/\${[\w\W]*/g),rf=sh(/{{|}}|\${|<%|%>|<%|%>/),of=sh(/^data-[\-\w.\u00B7-\uFFFF]+$/),sf=sh(/^aria-[\-\w]+$/),af=sh(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),lf=sh(/^(?:\w+script|data):/i),uf=sh(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),cf=sh(/^html$/i),df=sh(/^[a-z][.\w]*(-[.\w]+)+$/i),hf=sh(/<[/\w!]/g),ff=sh(/<[/\w]/g),vf=sh(/<\/no(script|embed|frames)/i),pf=sh(/\/>/i),mf=sh(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i),gf=sh(/^[\r\n\t ]+/),yf=oh(Nh({},["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"])),bf=function(){return"undefined"==typeof window?null:window},wf=function(t,e,n,i){return Eh(t,e)&&gh(t[e])?Nh(i.base?Bh(i.base):{},t[e],i.transform):n},kf=function(t,e,n){const i=Eh(t,e)?t[e]:void 0;return i&&"object"==typeof i?jh(i):n};var Sf=function t(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:bf();const n=e=>t(e);if(n.version="3.4.18",n.removed=[],!e||!e.document||9!==e.document.nodeType||!e.Element)return n.isSupported=!1,n;let i=e.document;const r=i,o=r.currentScript,s=e.HTMLTemplateElement,a=e.Node,l=e.NodeFilter,u=e.DOMParser,c=e.trustedTypes,d=e.Element.prototype,h=zh(d,"cloneNode"),f=zh(d,"remove"),v=zh(d,"removeAttributeNode"),p=zh(d,"nextSibling"),m=zh(d,"childNodes"),g=zh(d,"parentNode"),y=zh(d,"shadowRoot"),b=zh(d,"attributes"),w=a&&a.prototype?zh(a.prototype,"nodeType"):null,k=a&&a.prototype?zh(a.prototype,"nodeName"):null,S=a&&a.prototype?zh(a.prototype,"ownerDocument"):null,_=function(t){return w?w(t):t.nodeType},x=function(t){return k?k(t):t.nodeName},C=function(t){for(;null!==t;){const e=rh(t,"namespaceURI");if(e)return e.get?Fh(e.get):null;t=ih(t)}return null}(d),M=function(t){return C?C(t):t.namespaceURI};if("function"==typeof s){const t=i.createElement("template");t.content&&t.content.ownerDocument&&(i=t.content.ownerDocument)}let T,I,A="",R=!1,E=0;const O=function(){if(E>0)throw Dh('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},L=function(t){O(),E++;try{return T.createHTML(t)}finally{E--}},D=function(t){return T&&yt?L(t):t},F=i.implementation,P=i.createNodeIterator,N=i.createDocumentFragment,q=i.getElementsByTagName,j=r.importNode;let B={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};n.isSupported="function"==typeof Xd&&"function"==typeof g&&F&&void 0!==F.createHTMLDocument;const z=tf,U=ef,W=nf,H=of,G=sf,V=lf,Q=uf,Z=df;let J=af,Y=null;const K=Nh({},[...Uh,...Wh,...Hh,...Vh,...Zh]);let X=null;const tt=Nh({},[...Jh,...Yh,...Kh,...Xh]);let et=null,nt=null,it=null;const rt=Object.seal(ah(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let ot=!0,st=!0,at=!1,lt=!0,ut=!1,ct=!0,dt=!1,ht=!1,ft=null,vt=null,pt=!1,mt=!1,gt=!1,yt=!1,bt=!0,wt=!1;const kt="user-content-";let St=!0,_t=!1,xt=null,Ct=!1,Mt=null;const Tt=Nh({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let It=null;const At=Nh({},["audio","video","img","source","image","track"]);let Rt=null;const Et=Nh({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Ot="http://www.w3.org/1998/Math/MathML",$t="http://www.w3.org/2000/svg",Lt="http://www.w3.org/1999/xhtml";let Dt=Lt,Ft=!1,Pt=null;const Nt=Nh({},[Ot,$t,Lt],Sh),qt=oh(Nh({},["mi","mo","mn","ms","mtext"]));let jt=null;const Bt=oh(Nh({},["annotation-xml"]));let zt=null;const Ut=oh(ah(null)),Wt=Nh({},["title","style","font","a","script"]);let Ht=null;const Gt=["application/xhtml+xml","text/html"];let Vt=null,Qt=null;const Zt=i.createElement("form"),Jt=function(t){return t instanceof RegExp||t instanceof Function},Yt=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t&&"object"==typeof t||(t={}),t=jh(t),Ht=-1===Gt.indexOf(t.PARSER_MEDIA_TYPE)?"text/html":t.PARSER_MEDIA_TYPE,Vt="application/xhtml+xml"===Ht?Sh:kh,Y=wf(t,"ALLOWED_TAGS",K,{transform:Vt}),X=wf(t,"ALLOWED_ATTR",tt,{transform:Vt}),Pt=wf(t,"ALLOWED_NAMESPACES",Nt,{transform:Sh}),Rt=wf(t,"ADD_URI_SAFE_ATTR",Et,{transform:Vt,base:Et}),It=wf(t,"ADD_DATA_URI_TAGS",At,{transform:Vt,base:At}),Mt=wf(t,"FORBID_CONTENTS",Tt,{transform:Vt}),nt=wf(t,"FORBID_TAGS",ah(null),{transform:Vt}),it=wf(t,"FORBID_ATTR",ah(null),{transform:Vt}),Ct=!!Eh(t,"USE_PROFILES")&&(t.USE_PROFILES&&"object"==typeof t.USE_PROFILES?jh(t.USE_PROFILES):t.USE_PROFILES),ot=!1!==t.ALLOW_ARIA_ATTR,st=!1!==t.ALLOW_DATA_ATTR,at=t.ALLOW_UNKNOWN_PROTOCOLS||!1,lt=!1!==t.ALLOW_SELF_CLOSE_IN_ATTR,ut=t.SAFE_FOR_TEMPLATES||!1,ct=!1!==t.SAFE_FOR_XML,dt=t.WHOLE_DOCUMENT||!1,mt=t.RETURN_DOM||!1,gt=t.RETURN_DOM_FRAGMENT||!1,yt=t.RETURN_TRUSTED_TYPE||!1,pt=t.FORCE_BODY||!1,bt=!1!==t.SANITIZE_DOM,wt=t.SANITIZE_NAMED_PROPS||!1,St=!1!==t.KEEP_CONTENT,_t=t.IN_PLACE||!1,J=function(t){if(!t)return!1;try{return Lh(t,""),!0}catch(t){return!1}}(t.ALLOWED_URI_REGEXP)?t.ALLOWED_URI_REGEXP:af,Dt="string"==typeof t.NAMESPACE?t.NAMESPACE:Lt,jt=kf(t,"MATHML_TEXT_INTEGRATION_POINTS",qt),zt=kf(t,"HTML_INTEGRATION_POINTS",Bt);const e=kf(t,"CUSTOM_ELEMENT_HANDLING",Ut);if(et=ah(null),Eh(e,"tagNameCheck")&&Jt(e.tagNameCheck)&&(et.tagNameCheck=e.tagNameCheck),Eh(e,"attributeNameCheck")&&Jt(e.attributeNameCheck)&&(et.attributeNameCheck=e.attributeNameCheck),Eh(e,"allowCustomizedBuiltInElements")&&"boolean"==typeof e.allowCustomizedBuiltInElements&&(et.allowCustomizedBuiltInElements=e.allowCustomizedBuiltInElements),sh(et),ut&&(st=!1),gt&&(mt=!0),Ct&&((Eh(t,"ALLOWED_TAGS")||Eh(t,"ALLOWED_ATTR"))&&"undefined"!=typeof console&&"function"==typeof console.warn&&console.warn("DOMPurify: USE_PROFILES overrides ALLOWED_TAGS and ALLOWED_ATTR. Do not use these options together."),Y=Nh({},Zh),X=ah(null),!0===Ct.html&&(Nh(Y,Uh),Nh(X,Jh)),!0===Ct.svg&&(Nh(Y,Wh),Nh(X,Yh),Nh(X,Xh)),!0===Ct.svgFilters&&(Nh(Y,Hh),Nh(X,Yh),Nh(X,Xh)),!0===Ct.mathMl&&(Nh(Y,Vh),Nh(X,Kh),Nh(X,Xh))),rt.tagCheck=null,rt.attributeCheck=null,Eh(t,"ADD_TAGS")&&("function"==typeof t.ADD_TAGS?rt.tagCheck=t.ADD_TAGS:gh(t.ADD_TAGS)&&(Y===K&&(Y=Bh(Y)),Nh(Y,t.ADD_TAGS,Vt))),Eh(t,"ADD_ATTR")&&("function"==typeof t.ADD_ATTR?rt.attributeCheck=t.ADD_ATTR:gh(t.ADD_ATTR)&&(X===tt&&(X=Bh(X)),Nh(X,t.ADD_ATTR,Vt))),Eh(t,"ADD_FORBID_CONTENTS")&&gh(t.ADD_FORBID_CONTENTS)&&(Mt===Tt&&(Mt=Bh(Mt)),Nh(Mt,t.ADD_FORBID_CONTENTS,Vt)),St&&(Y["#text"]=!0),dt&&Nh(Y,["html","head","body"]),Y.table&&(Y.tbody=!0,delete nt.tbody),t.TRUSTED_TYPES_POLICY){if("function"!=typeof t.TRUSTED_TYPES_POLICY.createHTML)throw Dh('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof t.TRUSTED_TYPES_POLICY.createScriptURL)throw Dh('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const e=T;T=t.TRUSTED_TYPES_POLICY;try{A=L("")}catch(t){throw T=e,t}}else null===t.TRUSTED_TYPES_POLICY?(T=void 0,A=""):(void 0===T&&(R||(I=function(t,e){if("object"!=typeof t||"function"!=typeof t.createPolicy)return null;let n=null;const i="data-tt-policy-suffix";e&&e.hasAttribute(i)&&(n=e.getAttribute(i));const r="dompurify"+(n?"#"+n:"");try{return t.createPolicy(r,{createHTML:t=>t,createScriptURL:t=>t})}catch(t){return console.warn("TrustedTypes policy "+r+" could not be created."),null}}(c,o),R=!0),T=I),T&&"string"==typeof A&&(A=L("")));Qt=oh(t)},Kt=Nh({},[...Wh,...Hh,...Gh]),Xt=Nh({},[...Vh,...Qh]),te=function(t){vh(n.removed,{element:t});try{g(t).removeChild(t)}catch(e){if(f(t),!g(t))throw Dh("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},ee=function(t,e,n){try{v(t,e)}catch(e){try{t.removeAttribute(n)}catch(t){}}},ne=function(t){se(t);const e=m(t);e&&dh(ph(e),t=>{try{f(t)}catch(t){}}),1===_(t)&&re(t,!1)},ie=function(t,e,i){if(!i)try{i=e.getAttributeNode(t)}catch(t){i=null}if(vh(n.removed,{attribute:i||null,from:e}),i)ee(e,i,t);else try{e.removeAttribute(t)}catch(t){}if("is"===t)if(mt||gt)try{te(e)}catch(t){}else try{e.setAttribute(t,"")}catch(t){}},re=function(t,e){const n=b(t);if(n)for(let i=n.length-1;i>=0;--i){const r=n[i],o=r&&r.name;"string"!=typeof o||e&&X[Vt(o)]||ee(t,r,o)}},oe=function(t,e){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const i=[t];for(;i.length>0;){const t=i.pop();if(!1===e(t))continue;if(n&&1===_(t)){const e=y(t);ye(e)&&i.push(e)}const r=m(t);if(r)for(let t=r.length-1;t>=0;--t)i.push(r[t])}},se=function(t){oe(t,t=>{1===_(t)&&re(t,!0)})},ae=function(t){const e=[];return oe(t,t=>{e.push(t)},!0),e},le=function(t,e){let i=!1;return dh(n.removed,e=>{e.element&&(i=i||e.element===t,se(e.element))}),function(t,e){const n=yh();dh(ae(t),t=>{1===_(t)&&bh(n,t)}),dh(e,t=>{1!==_(t)||wh(n,t)||re(t,!0)})}(t,e),i},ue=function(t,e,n,i){const r=he(t);let o;for(;o=r.nextNode();)wh(i,o)&&!wh(xt,o)&&(e&&we(B.uponSanitizeShadowNode,o,null),Ee(o,n))},ce=function(t,e){return!!ct&&("patchsrc"===t||"for"===t&&"label"!==e&&"output"!==e)},de=function(t){let e=null,n=null;if(pt)t="<remove></remove>"+t;else{const e=_h(t,gf);n=e&&e[0]}"application/xhtml+xml"===Ht&&Dt===Lt&&(t='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+t+"</body></html>");const r=T?L(t):t;if(Dt===Lt)try{e=(new u).parseFromString(r,Ht)}catch(t){}if(!e||!e.documentElement){e=F.createDocument(Dt,"template",null);try{e.documentElement.innerHTML=Ft?A:r}catch(t){}}const o=e.body||e.documentElement;return t&&n&&o.insertBefore(i.createTextNode(n),o.childNodes[0]||null),Dt===Lt?q.call(e,dt?"html":"body")[0]:dt?e.documentElement:o},he=function(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=S?S(t):t.ownerDocument;return P.call(n||t,t,(e?0:l.SHOW_ELEMENT)|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null)},fe=function(t){return t=xh(t,z," "),t=xh(t,U," "),xh(t,W," ")},ve=function(t){var e;pe(t);const n=null===(e=t.querySelectorAll)||void 0===e?void 0:e.call(t,"template");n&&dh(n,t=>{ye(t.content)&&ve(t.content)})},pe=function(t){t.normalize();const e=he(t,!0);let n=e.nextNode();for(;n;)n.data=fe(n.data),n=e.nextNode()},me=function(t){const e=k?k(t):null;return"string"==typeof e&&"form"===Vt(e)&&("string"!=typeof t.nodeName||"string"!=typeof t.textContent||"function"!=typeof t.removeChild||t.attributes!==b(t)||"function"!=typeof t.removeAttribute||"function"!=typeof t.removeAttributeNode||"function"!=typeof t.getAttributeNode||"function"!=typeof t.setAttribute||"string"!=typeof t.namespaceURI||"function"!=typeof t.insertBefore||"function"!=typeof t.hasChildNodes||t.nodeType!==w(t)||t.childNodes!==m(t))},ge=function(t){if(!w||"object"!=typeof t||null===t)return null;try{const e=w(t);return"number"==typeof e?e:null}catch(t){return null}},ye=function(t){return 11===ge(t)},be=function(t){return null!==ge(t)};function we(t,e,i){0!==t.length&&dh(t,t=>{t.call(n,e,i,Qt)})}const ke=function(t,e){if(t instanceof RegExp)return Lh(t,e);if(t instanceof Function){for(var n=arguments.length,i=new Array(n>2?n-2:0),r=2;n>r;r++)i[r-2]=arguments[r];return Boolean(t(e,...i))}return!1},Se=function(t,e,n,i){return 0===t.length?e:e===n||e===i?Bh(e):e},_e=function(t,e){return t!==e&&null===g(t)&&(_t&&se(t),!0)},xe=function(t,e){if(xt&&bh(xt,t),we(B.beforeSanitizeElements,t,null),_e(t,e))return!0;if(me(t))return te(t),!0;const i=Vt(x(t)),r=_(t);if(Y=Se(B.uponSanitizeElement,Y,K,ft),we(B.uponSanitizeElement,t,{tagName:i,allowedTags:Y}),_e(t,e))return!0;if(function(t,e,n){return!!(ct&&1===n&&t.hasChildNodes()&&!be(t.firstElementChild)&&Lh(hf,t.textContent)&&Lh(hf,t.innerHTML))||!!(ct&&yf[e]&&1===n&&M(t)===Lt&&(be(t.firstElementChild)||"string"==typeof t.textContent&&Lh(hf,t.textContent)))||7===n||!(!ct||8!==n||!Lh(ff,t.data))}(t,i,r))return te(t),!0;if(nt[i]||!(rt.tagCheck instanceof Function&&rt.tagCheck(i))&&!Y[i]){const n=function(t,e,n){if(!nt[e]&&Te(e)&&ke(et.tagNameCheck,e))return!1;if(St&&!Mt[e]&&!Mt[kh(e)]){const e=g(t),i=m(t);if(i&&e)for(let r=i.length-1;r>=0;--r){const o=t===n?h(i[r],!0):i[r];e.insertBefore(o,p(t))}}return te(t),!0}(t,i,e);return!(!1!==n||(we(B.afterSanitizeElements,t,null),!_e(t,e)))||n}if(1===r&&!function(t){const e=M(t),n=kh(x(t)),i=g(t);let r=Dt,o="template";return i&&1===_(i)&&(r=M(i),o=kh(x(i))),!!Pt[e]&&(e===$t?function(t,e,n){return e===Lt?"svg"===t:e===Ot?"svg"===t&&("annotation-xml"===n||jt[n]):Boolean(Kt[t])}(n,r,o):e===Ot?function(t,e,n){return e===Lt?"math"===t:e===$t?"math"===t&&zt[n]:Boolean(Xt[t])}(n,r,o):e===Lt?function(t,e,n){return!(e===$t&&!zt[n])&&!(e===Ot&&!jt[n])&&!Xt[t]&&(Wt[t]||!Kt[t])}(n,r,o):"application/xhtml+xml"===Ht)}(t))return te(t),!0;if(("noscript"===i||"noembed"===i||"noframes"===i)&&Lh(vf,t.innerHTML))return te(t),!0;if(ut&&3===r){const e=t.textContent,i=fe(e);e!==i&&(vh(n.removed,{element:t.cloneNode()}),t.textContent=i)}return we(B.afterSanitizeElements,t,null),_e(t,e)},Ce=function(t,e,n){if(it[e])return!1;if(ce(e,t))return!1;if(bt&&("id"===e||"name"===e)&&(n in i||n in Zt))return!1;const r=X[e]||rt.attributeCheck instanceof Function&&rt.attributeCheck(e,t);if(st&&Lh(H,e))return!0;if(ot&&Lh(G,e))return!0;if(!r)return Te(t)&&ke(et.tagNameCheck,t)&&ke(et.attributeNameCheck,e,t)||"is"===e&&et.allowCustomizedBuiltInElements&&ke(et.tagNameCheck,n);if(Rt[e])return!0;const o=xh(n,Q,"");return!(!Lh(J,o)&&("src"!==e&&"xlink:href"!==e&&"href"!==e||"script"===t||0!==Ch(n,"data:")||!It[t])&&(!at||Lh(V,o))&&n)},Me=Nh({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Te=function(t){return!Me[kh(t)]&&Lh(Z,t)},Ie=function(t,e,n,i){if(T&&"object"==typeof c&&"function"==typeof c.getAttributeType&&!n)switch(c.getAttributeType(t,e)){case"TrustedHTML":return L(i);case"TrustedScriptURL":return function(t){O(),E++;try{return T.createScriptURL(t)}finally{E--}}(i)}return i},Ae=function(t,e,n,i){try{return n?t.setAttributeNS(n,e,i):t.setAttribute(e,i),!me(t)||(te(t),!1)}catch(n){return ie(e,t),!1}},Re=function(t,e){return!(!ct||!Lh(mf,e))||"attributename"===kh(t)&&-1!==Ch(e,"href")},Ee=function(t,e){xe(t,e),function(t,e){if(we(B.beforeSanitizeAttributes,t,null),_e(t,e))return;const i=t.attributes;if(!i||me(t))return;X=Se(B.uponSanitizeAttribute,X,tt,vt);const r={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:X,forceKeepAttr:void 0};let o=i.length;const s=Vt(x(t));for(;o--;){const e=i[o],a=e.name,l=e.namespaceURI,u=e.value,c=Vt(a),d=u;let h="value"===a?d:Mh(d),f=!1;r.attrName=c,r.attrValue=h,r.keepAttr=!0,r.forceKeepAttr=void 0,we(B.uponSanitizeAttribute,t,r),h=r.attrValue,!wt||"id"!==c&&"name"!==c||0===Ch(h,kt)||(ie(a,t,e),h=kt+h,f=!0),Re(a,h)?ie(a,t,e):r.forceKeepAttr||(!r.keepAttr||!lt&&Lh(pf,h)?ie(a,t,e):(ut&&(h=fe(h)),Ce(s,c,h)?(h=Ie(s,c,l,h),h!==d&&Ae(t,a,l,h)&&f&&fh(n.removed)):ie(a,t,e)))}we(B.afterSanitizeAttributes,t,null),_e(t,e)}(t,e),ye(t.content)&&Oe(t.content)},Oe=function(t){let e=null;const n=he(t);for(we(B.beforeSanitizeShadowDOM,t,null);e=n.nextNode();)if(we(B.uponSanitizeShadowNode,e,null),Ee(e,t),1===_(e)){const t=y(e);ye(t)&&($e(t),Oe(t))}ut&&pe(t),we(B.afterSanitizeShadowDOM,t,null)},$e=function(t){const e=[{node:t,shadow:null}];for(;e.length>0;){const t=e.pop();if(t.shadow){Oe(t.shadow);continue}const n=t.node,i=1===_(n),r=m(n);if(r)for(let t=r.length-1;t>=0;--t)e.push({node:r[t],shadow:null});if(i){const t=k?k(n):null;if("string"==typeof t&&"template"===Vt(t)){const t=n.content;ye(t)&&e.push({node:t,shadow:null})}}if(i){const t=y(n);ye(t)&&e.push({node:null,shadow:t},{node:t,shadow:null})}}};return n.sanitize=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=null,o=null,s=null,a=null;if(Ft=!t,Ft&&(t="\x3c!--\x3e"),"string"!=typeof t&&!be(t)&&"string"!=typeof(t=function(t){switch(typeof t){case"string":return t;case"number":return Th(t);case"boolean":return Ih(t);case"bigint":return Ah?Ah(t):"0";case"symbol":return Rh?Rh(t):"Symbol()";case"undefined":default:return Oh(t);case"function":case"object":{if(null===t)return Oh(t);const e=t,n=zh(e,"toString");if("function"==typeof n){const t=n(e);return"string"==typeof t?t:Oh(t)}return Oh(t)}}}(t)))throw Dh("dirty is not a string, aborting");if(!n.isSupported)return t;ht?(Y=ft,X=vt):Yt(e),n.removed=[];const l=_t&&"string"!=typeof t&&be(t);let u=[];const c=xt;if(l){ct&&oe(t,t=>{const e=_(t);if(7===e||8===e&&Lh(ff,t.data)){try{f(t)}catch(t){}return!1}if(1===e){const e=t,n=Vt(x(t));try{e.hasAttribute&&e.hasAttribute("patchsrc")&&e.removeAttribute("patchsrc"),e.hasAttribute&&e.hasAttribute("for")&&ce("for",n)&&e.removeAttribute("for")}catch(t){}}return!0});const e=x(t);if("string"==typeof e){const n=Vt(e);if(!Y[n]||nt[n])throw ne(t),Dh("root node is forbidden and cannot be sanitized in-place")}if(me(t))throw ne(t),Dh("root node is clobbered and cannot be sanitized in-place");u=ae(t),xt=yh()}else if(be(t))i=de("\x3c!----\x3e"),o=i.ownerDocument.importNode(t,!0),1===o.nodeType&&"BODY"===o.nodeName||"HTML"===o.nodeName?i=o:i.appendChild(o),$e(i);else{if(!mt&&!ut&&!dt&&-1===t.indexOf("<"))return D(t);if(i=de(t),!i)return mt?null:yt?A:""}i&&pt&&te(i.firstChild);const d=l?t:i;try{l&&$e(t);const e=he(d);for(;s=e.nextNode();)Ee(s,d);l&&function(t,e){const n=xt;let i=null;const r=()=>(i||(i=yh(),dh(e,t=>{bh(i,t)})),i);for(let e=0;;e++){const i=ae(t),o=[t];let s=!1;if(dh(i,t=>{11===_(t)?vh(o,t):s||wh(n,t)||(s=wh(r(),t))}),!s)return;if(e>=8)throw Dh("the tree kept changing during in-place sanitization; refusing to return it");dh(o,(e,n)=>{ue(e,n>0,t,r())})}}(t,u)}catch(e){throw l&&(ne(t),le(t,u)),e}finally{xt=c}if(l){if(le(t,u))throw Dh("a node selected for removal could not be safely returned; refusing to sanitize in place");return ut&&ve(t),t}if(mt){if(ut&&ve(i),gt)for(a=N.call(i.ownerDocument);i.firstChild;)a.appendChild(i.firstChild);else a=i;return(X.shadowroot||X.shadowrootmode)&&(a=j.call(r,a,!0)),a}const h=()=>dt?i.outerHTML:i.innerHTML;let v=h();return ut&&Lh(rf,v)&&(pe(i),v=h()),dt&&Y["!doctype"]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&Lh(cf,i.ownerDocument.doctype.name)&&(v="<!DOCTYPE "+i.ownerDocument.doctype.name+">\n"+v),D(v)},n.setConfig=function(){Yt(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),ht=!0,ft=Y,vt=X},n.clearConfig=function(){Qt=null,ht=!1,ft=null,vt=null,T=I,A=""},n.isValidAttribute=function(t,e,n){Qt||Yt({});const i=Vt(t),r=Vt(e);return("string"!=typeof n||!(Re(e,n)||!lt&&Lh(pf,n)))&&Ce(i,r,n)},n.addHook=function(t,e){"function"==typeof e&&Eh(B,t)&&vh(B[t],e)},n.removeHook=function(t,e){if(Eh(B,t)){if(void 0!==e){const n=hh(B[t],e);return-1===n?void 0:mh(B[t],n,1)[0]}return fh(B[t])}},n.removeHooks=function(t){Eh(B,t)&&(B[t]=[])},n.removeAllHooks=function(){B={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},n}();const _f=["a","abbr","acronym","area","article","aside","b","bdi","bdo","blockquote","br","caption","center","cite","code","col","colgroup","data","dd","del","details","dfn","div","dl","dt","em","figcaption","figure","footer","h1","h2","h3","h4","h5","h6","header","hgroup","hr","i","img","ins","kbd","li","map","mark","nav","ol","p","pre","q","rp","rt","rtc","ruby","s","samp","small","span","strike","strong","sub","summary","sup","table","tbody","td","th","thead","time","tr","tt","u","ul","var","wbr"],xf=["style","lang","title","width","height"],Cf=["abbr","align","axis","bgcolor","char","charoff","colspan","headers","height","nowrap","rowspan","scope","valign","width"],Mf={a:["href","hreflang","target","rel"],bdo:["dir"],blockquote:["cite"],col:["align","char","charoff","span"],colgroup:["align","char","charoff","span"],del:["cite","datetime"],hr:["align","size","width"],img:["align","alt","height","src","width"],ins:["cite","datetime"],ol:["start","type"],q:["cite"],table:["align","bgcolor","border","cellpadding","cellspacing","frame","rules","summary","width"],tbody:["align","char","charoff","valign"],td:Cf,tfoot:["align","char","charoff","valign"],th:Cf,thead:["align","char","charoff","valign"],tr:["align","bgcolor","char","charoff","valign"]};let Tf;function If(t){var e;const n=(null!==(e=Tf)&&void 0!==e?e:Tf=Sf()).sanitize(t,{ALLOWED_TAGS:_f,ALLOWED_ATTR:[],ALLOW_ARIA_ATTR:!1,ALLOW_DATA_ATTR:!1,ALLOWED_NAMESPACES:["http://www.w3.org/1999/xhtml"],ADD_ATTR:(t,e)=>-1!==xf.indexOf(t)||{}.hasOwnProperty.call(Mf,e)&&-1!==(Mf[e]||[]).indexOf(t),RETURN_DOM_FRAGMENT:!0}),i=n.querySelectorAll("a");for(let t=0;i.length>t;t++)i.item(t).relList.add("noopener");const r=document.createElement("div");return r.appendChild(n),r.innerHTML}const Af=he("[Stylesheet Loader]"),Rf="#020617",Ef={fontFamily:"inherit",backgroundColor:"#eeeded",submitButtonColor:"black",submitButtonTextColor:"white",ratingButtonColor:"white",ratingButtonActiveColor:"black",borderColor:"#c9c6c6",whiteLabel:!1,displayThankYouMessage:!0,thankYouMessageHeader:"Thank you for your feedback!",position:Md,widgetType:_d,widgetLabel:"Feedback",widgetColor:"black",zIndex:String(2147483645),disabledButtonOpacity:"0.6",maxWidth:"300px",textSubtleColor:"#939393",boxPadding:"20px 24px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",borderRadius:"10px",shuffleQuestions:!1,outlineColor:"rgba(59, 130, 246, 0.8)",inputBackground:"white",inputTextColor:Rf,scrollbarThumbColor:"var(--ph-survey-border-color)",scrollbarTrackColor:"var(--ph-survey-background-color)"},Of=[Cd,xd,Md];function $f(t){if(t.startsWith("#")){let e=t.replace(/^#/,"");return/^[0-9A-Fa-f]{3}$/.test(e)&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]),/^[0-9A-Fa-f]{6}$/.test(e)?`rgb(${parseInt(e.slice(0,2),16)},${parseInt(e.slice(2,4),16)},${parseInt(e.slice(4,6),16)})`:"rgb(255, 255, 255)"}return"rgb(255, 255, 255)"}function Lf(t=Ef.backgroundColor){let e;"#"===t[0]&&(e=$f(t)),t.startsWith("rgb")&&(e=t);const n={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4","indianred ":"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"}[t.toLowerCase()];if(n&&(e=$f(n)),!e)return Rf;const i=e.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);if(i){const t=parseInt(i[1]),e=parseInt(i[2]),n=parseInt(i[3]);return Math.sqrt(t*t*.299+e*e*.587+n*n*.114)>127.5?Rf:"white"}return Rf}const Df=(t,e,n)=>{const i=ev(t),r=document.querySelector(`.${i}`);if(r&&r.shadowRoot)return{shadow:r.shadowRoot,isNewlyCreated:!1};const o=document.createElement("div");((t,e,n)=>{const i=L(L({},Ef),n),r=t.style,o=!Of.includes(i.position)||e===Ad&&(null==n?void 0:n.widgetType)===_d;var s;r.setProperty("--ph-survey-font-family",function(t){if("inherit"===t)return"inherit";const e='BlinkMacSystemFont, "Inter", "Segoe UI", "Roboto", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"';return t?`${t}, ${e}`:`-apple-system, ${e}`}(i.fontFamily)),r.setProperty("--ph-survey-box-padding",i.boxPadding),r.setProperty("--ph-survey-max-width",i.maxWidth),r.setProperty("--ph-survey-z-index",i.zIndex),r.setProperty("--ph-survey-border-color",i.borderColor),o?(r.setProperty("--ph-survey-border-radius",i.borderRadius),r.setProperty("--ph-survey-border-bottom","1.5px solid var(--ph-survey-border-color)")):(r.setProperty("--ph-survey-border-bottom","none"),r.setProperty("--ph-survey-border-radius",`${i.borderRadius} ${i.borderRadius} 0 0`)),r.setProperty("--ph-survey-background-color",i.backgroundColor),r.setProperty("--ph-survey-box-shadow",i.boxShadow),r.setProperty("--ph-survey-disabled-button-opacity",i.disabledButtonOpacity),r.setProperty("--ph-survey-submit-button-color",i.submitButtonColor),r.setProperty("--ph-survey-submit-button-text-color",(null==n?void 0:n.submitButtonTextColor)||Lf(i.submitButtonColor)),r.setProperty("--ph-survey-rating-bg-color",i.ratingButtonColor),r.setProperty("--ph-survey-rating-active-bg-color",i.ratingButtonActiveColor),r.setProperty("--ph-survey-rating-active-text-color",Lf(i.ratingButtonActiveColor)),r.setProperty("--ph-survey-text-primary-color",(null==n?void 0:n.textColor)||Lf(i.backgroundColor)),r.setProperty("--ph-survey-text-subtle-color",i.textSubtleColor),s=r,"white"===Lf(i.backgroundColor)?s.setProperty("--ph-logo-mono","1"):s.removeProperty("--ph-logo-mono"),r.setProperty("--ph-widget-color",i.widgetColor),r.setProperty("--ph-widget-text-color",Lf(i.widgetColor)),r.setProperty("--ph-widget-z-index",i.zIndex);const a=(null==n?void 0:n.inputBackground)||(null==n?void 0:n.inputBackgroundColor);let l=a||i.inputBackground;a||"white"!==i.backgroundColor||(l="#f8f8f8"),r.setProperty("--ph-survey-input-background",l);const u=(null==n?void 0:n.inputTextColor)||Lf(l);r.setProperty("--ph-survey-input-text-color",u),r.setProperty("--ph-survey-rating-text-color",u),r.setProperty("--ph-survey-scrollbar-thumb-color",i.scrollbarThumbColor),r.setProperty("--ph-survey-scrollbar-track-color",i.scrollbarTrackColor),r.setProperty("--ph-survey-outline-color",i.outlineColor)})(o,t.type,t.appearance),o.className=i;const s=o.attachShadow({mode:"open"}),a=function(t){const e=((t,e,n)=>{let i=t.createElement("style");i.innerText=e;const r=(t=>{var e;return W(t)?t:null==t||null===(e=t.config)||void 0===e?void 0:e.prepare_external_dependency_stylesheet})(n);return r&&(i=r(i)),i||(Af.error("prepare_external_dependency_stylesheet returned null"),null)})(document,':host{--ph-survey-font-family:-apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", "Roboto", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";--ph-survey-box-padding:20px 24px;--ph-survey-max-width:300px;--ph-survey-z-index:calc(2147480000 + 3645);--ph-survey-border-color:#dcdcdc;--ph-survey-border-bottom:1.5px solid var(--ph-survey-border-color);--ph-survey-border-radius:10px;--ph-survey-background-color:#eeeded;--ph-survey-box-shadow:0 4px 12px #00000026;--ph-survey-submit-button-color:black;--ph-survey-submit-button-text-color:white;--ph-survey-rating-bg-color:white;--ph-survey-rating-text-color:#020617;--ph-survey-rating-active-bg-color:black;--ph-survey-rating-active-text-color:white;--ph-survey-text-primary-color:#020617;--ph-survey-text-subtle-color:#939393;--ph-widget-color:#e0a045;--ph-widget-text-color:white;--ph-survey-scrollbar-thumb-color:var(--ph-survey-border-color);--ph-survey-scrollbar-track-color:var(--ph-survey-background-color);--ph-survey-outline-color:#3b82f6cc;--ph-survey-input-background:white;--ph-survey-input-text-color:#020617;--ph-survey-disabled-button-opacity:.6}.ph-survey{min-width:300px;width:var(--ph-survey-max-width);max-width:85%;z-index:var(--ph-survey-z-index);height:fit-content;margin:0;position:fixed;bottom:0}.ph-survey h3,.ph-survey p{margin:0}.ph-survey *{box-sizing:border-box;font-family:var(--ph-survey-font-family);color:var(--ph-survey-text-primary-color)}.ph-survey textarea,.ph-survey input[type=text],.ph-survey .multiple-choice-options label{color:var(--ph-survey-input-text-color);background:var(--ph-survey-input-background);border:1.5px solid var(--ph-survey-border-color);border-radius:4px;padding:10px;transition:border-color .2s ease-out,box-shadow .2s ease-out,transform .15s ease-out}.ph-survey textarea,.ph-survey input[type=text]{transition:border-color .2s ease-out,box-shadow .2s ease-out,transform .15s ease-out}.ph-survey input{margin:0}.ph-survey textarea:focus,.ph-survey textarea:focus-visible,.ph-survey input[type=text]:focus,.ph-survey input[type=text]:focus-visible,.ph-survey .form-submit:focus,.ph-survey .form-submit:focus-visible,.ph-survey input[type=checkbox]:focus,.ph-survey input[type=radio]:focus,.ph-survey input[type=checkbox]:focus-visible,.ph-survey input[type=radio]:focus-visible{outline:1.5px solid var(--ph-survey-outline-color);border-color:var(--ph-survey-rating-active-bg-color);outline-offset:2px}.ph-survey textarea:focus:not(:focus-visible),.ph-survey input[type=text]:focus:not(:focus-visible),.ph-survey button:focus:not(:focus-visible),.ph-survey input[type=checkbox]:focus:not(:focus-visible),.ph-survey input[type=radio]:focus:not(:focus-visible){outline:none}.ph-survey textarea:hover:not(:focus),.ph-survey input[type=text]:hover:not(:focus){border-color:var(--ph-survey-rating-active-bg-color)}@media (max-width:768px){.ph-survey textarea,.ph-survey input[type=text]{font-size:1rem}}.ph-survey .multiple-choice-options label,.ph-survey .rating-options-number,.ph-survey .form-cancel,.ph-survey input[type=checkbox],.ph-survey input[type=radio]{border:1.5px solid var(--ph-survey-border-color)}.ph-survey label,.ph-survey input[type=checkbox],.ph-survey input[type=radio],.ph-survey .ratings-emoji,.ph-survey .ratings-number,.ph-survey .footer-branding,.ph-survey .form-cancel,.ph-survey .form-submit{transition:all .2s ease-out}@media (prefers-reduced-motion:no-preference){.ph-survey button:active,.ph-survey input[type=checkbox]:active,.ph-survey input[type=radio]:active,.ph-survey label:active{transition-duration:.1s}}.ph-survey-widget-tab{background:var(--ph-widget-color);color:var(--ph-widget-text-color);text-align:center;cursor:pointer;z-index:var(--ph-survey-z-index);border:none;border-radius:3px 3px 0 0;padding:10px 12px;transition:padding .2s ease-out;position:fixed}.ph-survey-widget-tab:hover:not(.widget-tab-top){padding-bottom:16px}.ph-survey-widget-tab.widget-tab-top{border-radius:0 0 3px 3px}.ph-survey-widget-tab.widget-tab-top:hover{padding-top:16px}@keyframes ph-survey-fade-in{0%{opacity:0}to{opacity:1}}.survey-box{flex-direction:column;gap:16px;display:flex}.bottom-section{flex-direction:column;gap:8px;display:flex}.thank-you-message-header~.bottom-section,.intro-screen-header~.bottom-section{padding-top:16px}.question-container,.thank-you-message,.intro-screen{flex-direction:column;gap:8px;display:flex}.survey-question{font-size:14px;font-weight:500}.survey-question-description{opacity:.8;padding-top:4px;font-size:13px}.survey-question-description,.thank-you-message-body,.intro-screen-body{word-wrap:break-word;overflow-wrap:break-word}:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) img,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) video,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) iframe,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) embed,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) object,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) svg{max-width:100%;height:auto}.question-textarea-wrapper{flex-direction:column;display:flex}.survey-form{animation:.3s ease-out forwards ph-survey-fade-in}.survey-form,.thank-you-message,.intro-screen{text-align:left;width:100%;z-index:var(--ph-survey-z-index);border:1.5px solid var(--ph-survey-border-color);border-bottom:var(--ph-survey-border-bottom);background:var(--ph-survey-background-color);border-radius:var(--ph-survey-border-radius);box-shadow:var(--ph-survey-box-shadow);padding:var(--ph-survey-box-padding);margin:0;position:relative}.survey-form textarea,.survey-form input[type=text]{min-width:100%}.survey-form textarea:focus,.survey-form textarea:focus-visible{box-shadow:0 4px 12px #00000014}.survey-form textarea:focus:not(:focus-visible){box-shadow:none}.survey-box .question-header--empty~.multiple-choice-options,.survey-box .question-header--empty~textarea{margin-top:0}.multiple-choice-options{border:none;flex-direction:column;gap:8px;margin:0;padding:1px 0;font-size:14px;display:flex}.multiple-choice-options label,.multiple-choice-options .response-choice{color:inherit;align-items:center;gap:8px;display:flex}.multiple-choice-options label{cursor:pointer;font-size:13px}.multiple-choice-options label:hover:not(:has(input:checked)){border-color:var(--ph-survey-text-subtle-color);box-shadow:0 2px 8px #00000014}.multiple-choice-options label:has(input:checked){border-color:var(--ph-survey-rating-active-bg-color);box-shadow:0 1px 4px #0000000d}.multiple-choice-options label.choice-option-open{flex-wrap:wrap}.multiple-choice-options label span{color:inherit}.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:var(--ph-survey-input-background);cursor:pointer;z-index:1;border-radius:3px;flex-shrink:0;width:1rem;height:1rem;transition:all .2s cubic-bezier(.4,0,.2,1),transform .15s ease-out;position:relative}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):focus{transform:scale(1.05)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):hover{border-color:var(--ph-survey-rating-active-bg-color);transform:scale(1.05)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):active{transform:scale(.95)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):checked{background:var(--ph-survey-rating-active-bg-color);border-color:var(--ph-survey-rating-active-bg-color);transform:scale(1)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):checked:hover{transform:scale(1.05)}.multiple-choice-options input[type=checkbox]:checked:after{border:solid var(--ph-survey-rating-active-text-color);border-width:0 2px 2px 0;width:4px;height:8px;animation:.2s ease-out .1s forwards ph-survey-checkmark-reveal;left:4px;transform:rotate(45deg)scale(0)}.multiple-choice-options input[type=radio]:checked:after{background:var(--ph-survey-rating-active-text-color);border-radius:50%;width:6px;height:6px;animation:.15s ease-out 50ms forwards ph-survey-radio-reveal;top:5px;left:5px;transform:scale(0)}.multiple-choice-options input[type=checkbox]:checked:after,.multiple-choice-options input[type=radio]:checked:after{content:"";box-sizing:content-box;position:absolute}.multiple-choice-options input[type=radio]{border-radius:50%}.multiple-choice-options input[type=radio]:checked{border:none}:is(.multiple-choice-options input[type=checkbox]:checked,.multiple-choice-options input[type=radio]:checked)~*{font-weight:700}.multiple-choice-options .choice-option-open input[type=text]::placeholder{color:var(--ph-survey-text-subtle-color);font-weight:400}.rating-options-emoji{justify-content:space-between;display:flex}.rating-options-emoji-2{justify-content:space-around}.ratings-emoji{opacity:.5;background-color:#0000;border:none;padding:0;font-size:16px}.ratings-emoji:hover{cursor:pointer;opacity:1;transform:scale(1.15)}.ratings-emoji.rating-active{opacity:1}.ratings-emoji svg{fill:var(--ph-survey-text-primary-color);transition:fill .2s ease-out}.rating-options-number{border-radius:6px;grid-auto-columns:1fr;grid-auto-flow:column;display:grid;overflow:hidden}.rating-options-number .ratings-number{border-right:1px solid var(--ph-survey-border-color);text-align:center;cursor:pointer;color:var(--ph-survey-rating-text-color);border-top:none;border-bottom:none;border-left:none;font-weight:700}.rating-options-number .ratings-number:last-of-type{border-right:0}.rating-options-number .ratings-number.rating-active{background:var(--ph-survey-rating-active-bg-color);color:var(--ph-survey-rating-active-text-color)}.ratings-number{background-color:var(--ph-survey-rating-bg-color);border:none;padding:8px 0}.ratings-number .rating-active{background-color:var(--ph-survey-rating-active-bg-color)}.ratings-number{cursor:pointer}@media (hover:hover) and (pointer:fine){.ratings-number:hover:not(.rating-active){background-color:color-mix(in srgb, var(--ph-survey-rating-active-bg-color) 14%, var(--ph-survey-rating-bg-color))}}.rating-text{opacity:.7;flex-direction:row;justify-content:space-between;font-size:11px;display:flex}.form-buttons{flex-direction:row;gap:8px;width:100%;display:flex}.form-buttons-with-back>.form-submit{flex:auto;min-width:0}.form-submit{text-align:center;cursor:pointer;user-select:none;background:var(--ph-survey-submit-button-color);color:var(--ph-survey-submit-button-text-color);border:none;border-radius:6px;min-width:100%;padding:12px;font-weight:700;box-shadow:0 2px #0000000b}.form-submit:not([disabled]):hover{transform:scale(1.02);box-shadow:0 4px 8px #0000001a}.form-submit:not([disabled]):active{transform:scale(.98);box-shadow:0 1px 2px #0000000d}.form-submit[disabled]{opacity:var(--ph-survey-disabled-button-opacity);cursor:not-allowed}.form-back{text-align:center;cursor:pointer;user-select:none;color:var(--ph-survey-text-primary-color);border:1.5px solid var(--ph-survey-border-color);background:0 0;border-radius:6px;flex:none;padding:12px 16px;font-weight:600}.form-back:hover{transform:scale(1.02)}.form-back:active{transform:scale(.98)}.validation-hint{opacity:.7;margin-top:4px;font-size:12px}.form-cancel{cursor:pointer;background:#fff;border-radius:100%;padding:12px;line-height:0;position:absolute;top:0;right:0;transform:translate(50%,-50%)}.form-cancel:hover{opacity:.7;transform:translate(50%,-50%)scale(1.1)}.footer-branding{opacity:.6;justify-content:center;align-items:center;gap:4px;font-size:11px;font-weight:500;text-decoration:none;display:flex}.footer-branding:hover{opacity:1}.footer-branding a{text-decoration:none}.thank-you-message{text-align:center}.thank-you-message-header{margin:10px 0 0}.thank-you-message-body{opacity:.8;font-size:14px}.intro-screen{text-align:center;animation:.3s ease-out forwards ph-survey-fade-in}.intro-screen-header{margin:10px 0 0}.intro-screen-body{opacity:.8;font-size:14px}.limit-height{scrollbar-width:thin;scrollbar-color:var(--ph-survey-scrollbar-thumb-color) var(--ph-survey-scrollbar-track-color);max-height:256px;overflow:hidden auto}.limit-height::-webkit-scrollbar{width:8px}.limit-height::-webkit-scrollbar-track{background:var(--ph-survey-scrollbar-track-color);border-radius:4px}.limit-height::-webkit-scrollbar-thumb{background-color:var(--ph-survey-scrollbar-thumb-color);border:2px solid var(--ph-survey-scrollbar-track-color);border-radius:4px}.limit-height::-webkit-scrollbar-thumb:hover{background-color:var(--ph-survey-text-subtle-color)}.sr-only{clip:rect(0, 0, 0, 0);white-space:nowrap;border:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}@media (prefers-reduced-motion:reduce){.ph-survey *{scroll-behavior:auto!important;transition-duration:.01ms!important;animation-duration:.01ms!important;animation-iteration-count:1!important}}@keyframes ph-survey-checkmark-reveal{0%{opacity:0;transform:rotate(45deg)scale(0)}50%{opacity:1;transform:rotate(45deg)scale(1.2)}to{opacity:1;transform:rotate(45deg)scale(1)}}@keyframes ph-survey-radio-reveal{0%{opacity:0;transform:scale(0)}50%{opacity:1;transform:scale(1.3)}to{opacity:1;transform:scale(1)}}',null==t?void 0:t.config.prepareStylesheet);return null==e||e.setAttribute("data-ph-survey-style","true"),e}(e);if(a){const t=s.querySelector("style");t&&s.removeChild(t),s.appendChild(a)}return(n||document.body).appendChild(o),{shadow:s,isNewlyCreated:!0}},Ff=t=>{try{const e=Vd(t);localStorage.getItem(e)||localStorage.setItem(e,"true")}catch(t){Hd.error("Failed to persist survey seen state",t)}},Pf=({responses:t,survey:e,surveySubmissionId:n,posthog:i,isSurveyCompleted:r,properties:o,surveyLanguage:s,questionSnapshots:a})=>{var l,u,c;i?(null===(l=i.client)||void 0===l?void 0:l.canCapture)&&(Ff(e),r&&tv(e),null===(u=i.client)||void 0===u||u.capture(qd,L(L(L({[Bd]:e.name,[jd]:e.id,[zd]:e.current_iteration,[Ud]:e.current_iteration_start_date,sessionRecordingUrl:Jc(i)},Oi(L(L({event:"sent",survey:e,responses:t,submissionId:n,completed:r},!G(s)&&{surveyLanguage:s}),!G(a)&&{questionSnapshots:a}))),o),{},{$set:{[Li(e,"responded")]:!0}})),r&&(window.dispatchEvent(new CustomEvent("PHSurveySent",{detail:{surveyId:e.id}})),null===(c=i.client)||void 0===c||null===(c=c.getExtension("featureFlagsCommon"))||void 0===c||c.reloadFeatureFlags())):Hd.error("[survey sent] event not captured, PostHog instance not found.")},Nf=(t,e,n,i)=>L({[Bd]:e.name,[jd]:e.id,[zd]:e.current_iteration,[Ud]:e.current_iteration_start_date,sessionRecordingUrl:Jc(i)},Oi(L(L(L(L({event:t,survey:e},!G(null==n?void 0:n.responses)&&{responses:n.responses}),!G(null==n?void 0:n.surveySubmissionId)&&{submissionId:n.surveySubmissionId}),!G(null==n?void 0:n.surveyLanguage)&&{surveyLanguage:n.surveyLanguage}),!G(null==n?void 0:n.questionSnapshots)&&{questionSnapshots:n.questionSnapshots}))),qf=(t,e,n,i)=>{var r;if(!e)return void Hd.error("[survey dismissed] event not captured, PostHog instance not found.");if(n)return;const o=Kf(t),s=o?o.surveyLanguage:i,a=L(L(L({},Nf("dismissed",t,o,e)),s&&{[Wd]:s}),{},{$set:{[Li(t,"dismissed")]:!0}});tv(t),Ff(t),null===(r=e.client)||void 0===r||r.capture(Nd,a),window.dispatchEvent(new CustomEvent("PHSurveyClosed",{detail:{surveyId:t.id}}))},jf=(t,e)=>{var n,i;if(!e)return void Hd.error("[survey abandoned] event not captured, PostHog instance not found.");if(!(null===(n=e.client)||void 0===n?void 0:n.canCapture))return;const r=(t=>Gd("abandonedSurvey_",t))(t);try{if("true"===localStorage.getItem(r))return}catch(t){return}const o=Kf(t);if(o){try{localStorage.setItem(r,"true")}catch(t){}null===(i=e.client)||void 0===i||i.capture("survey abandoned",Nf("abandoned",t,o,e),{delivery:"unload"})}},Bf=t=>{const e=t.map(t=>t.id);return e.every(t=>!!t)?e:void 0},zf=(t,e)=>{var n,i,r;return(t=>t.questions.some(t=>{var e;return!!(null===(e=t.branching)||void 0===e?void 0:e.type)}))(t)?t.questions:e?null!==(n=((t,e)=>{if(!e||e.length!==t.questions.length)return null;const n=new Map(t.questions.map(t=>[t.id,t])),i=[];for(const t of e){const e=n.get(t);if(!e)return null;i.push(e)}return i})(t,e.questionOrder))&&void 0!==n?n:t.questions:t.appearance&&t.appearance.shuffleQuestions&&!t.enable_partial_responses?(i=t.questions,r=Wi(t.questions),i.length===r.length&&i.every((t,e)=>t===r[e])?r.reverse():r):t.questions},Uf=t=>function(t){var e;return ji(t)&&!!(null===(e=t.conditions)||void 0===e||null===(e=e.events)||void 0===e?void 0:e.repeatedActivation)||"always"===t.schedule}(t)||Xf(t),Wf=function(t){function e(t){var n,i;return this.getChildContext||(n=new Set,(i={})[e.__c]=this,this.getChildContext=function(){return i},this.componentWillUnmount=function(){n=null},this.shouldComponentUpdate=function(t){this.props.value!=t.value&&n.forEach(function(t){t.__e=!0,Ec(t)})},this.sub=function(t){n.add(t);var e=t.componentWillUnmount;t.componentWillUnmount=function(){n&&n.delete(t),e&&e.call(t)}}),t.children}return e.__c="__cC"+gc++,e.__=t,e.Provider=e.__l=(e.Consumer=function(t,e){return t.children(e)}).contextType=e,e}({isPreviewMode:!1,previewPageIndex:0,onPopupSurveyDismissed(){},isPopup:!0,onPreviewSubmit(){},onPreviewBack(){},surveySubmissionId:"",properties:void 0,surveyLanguage:null}),Hf=()=>pd(Wf),Gf=({component:t,children:e,renderAsHtml:n,style:i})=>function(t,e,n){var i,r,o,s,a=Sc({},t.props);for(o in t.type&&t.type.defaultProps&&(s=t.type.defaultProps),e)"key"==o?i=e[o]:"ref"==o?r=e[o]:a[o]=void 0===e[o]&&null!=s?s[o]:e[o];return arguments.length>2&&(a.children=arguments.length>3?ic.call(arguments,2):n),Cc(t.type,a,i||t.key,r||t.ref,null)}(t,n?{dangerouslySetInnerHTML:{__html:If(e)},style:i}:{children:e,style:i});function Vf(t,e){var n,i,r;if(!(null===(n=t.conditions)||void 0===n?void 0:n.url))return!0;const o=null!==(i=ke(e))&&void 0!==i?i:"u">typeof window?window.location.href:void 0;if(!o)return!1;const s=[t.conditions.url],a=function(t){return null!=t?t:"icontains"}(null===(r=t.conditions)||void 0===r?void 0:r.urlMatchType);return Ui[a](s,[o])}function Qf(t){var e,n;return function(t,e){var n,i,r;if(!t||0===t.length)return!0;const o="u">typeof window?window:void 0,s="u">typeof globalThis?globalThis:o,a=null==s?void 0:s.navigator,l=null==a?void 0:a.userAgent;if(!l)return!1;const u=function(t,e){var n;const i=function(t){return wt.test(t)?ht:bt.test(t)?ft:yt.test(t)?vt:new RegExp(mt,"i").test(t)?mt:new RegExp("(Windows Phone|WPDesktop)","i").test(t)?"Windows Phone":/iPad/.test(t)?ct:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?dt:kt.test(t)?"BlackBerry":/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(pt,"i").test(t)?pt:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(t)||/(kf[a-z]+)( bui|\)).+silk\//i.test(t)?"Kindle Fire":/(Android|ZTE)/i.test(t)?new RegExp(at).test(t)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(t)||/pixel[\daxl ]{1,6}/i.test(t)&&!/pixel c/i.test(t)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(t)||/lmy47v/i.test(t)&&!/QTAQZ3/i.test(t)?"Android":ut:new RegExp("(pda|Mobile)","i").test(t)?"Generic mobile":new RegExp(lt,"i").test(t)&&!new RegExp("Tablet pc","i").test(t)?gt:""}(t);return i===ct||i===ut||"Kobo"===i||"Kindle Fire"===i||i===gt?lt:i===ht||i===vt||i===ft||i===mt?"Console":i===dt?"Wearable":i?at:"Android"===(null==e?void 0:e.userAgentDataPlatform)&&(null!==(n=null==e?void 0:e.maxTouchPoints)&&void 0!==n?n:0)>0?600>Math.min(null!==(r=null==e?void 0:e.screenWidth)&&void 0!==r?r:0,null!==(o=null==e?void 0:e.screenHeight)&&void 0!==o?o:0)/(null!==(s=null==e?void 0:e.devicePixelRatio)&&void 0!==s?s:1)?at:lt:"Desktop";var r,o,s}(l,{userAgentDataPlatform:null==a||null===(n=a.userAgentData)||void 0===n?void 0:n.platform,maxTouchPoints:null==a?void 0:a.maxTouchPoints,screenWidth:null==o||null===(i=o.screen)||void 0===i?void 0:i.width,screenHeight:null==o||null===(r=o.screen)||void 0===r?void 0:r.height,devicePixelRatio:null==o?void 0:o.devicePixelRatio});return Ui[null!=e?e:"icontains"](t,[u])}(null===(e=t.conditions)||void 0===e?void 0:e.deviceTypes,null===(n=t.conditions)||void 0===n?void 0:n.deviceTypesMatchType)}const Zf=t=>Gd("inProgressSurvey_",t),Jf={},Yf=(t,e)=>{const n=Zf(t);try{localStorage.setItem(n,JSON.stringify(e)),delete Jf[n]}catch(t){Hd.error("Error setting in-progress survey state in localStorage",t),Jf[n]=e}},Kf=t=>{const e=Zf(t),n=Jf[e];if(n)return n;try{const t=localStorage.getItem(e);if(t)return JSON.parse(t)}catch(t){Hd.error("Error getting in-progress survey state from localStorage",t)}return null},Xf=t=>{const e=Kf(t);return!J(null==e?void 0:e.surveySubmissionId)},tv=t=>{const e=Zf(t);delete Jf[e];try{localStorage.removeItem(e)}catch(t){Hd.error("Error clearing in-progress survey state from localStorage",t)}};function ev(t,e=!1){const n=`PostHogSurvey-${t.id}`;return e?`.${n}`:n}function nv(t,e=Md,n){if(t===Rd)return{};switch(e){case"top_left":return{top:"0",left:"0",transform:"translate(30px, 30px)"};case"top_right":return{top:"0",right:"0",transform:"translate(-30px, 30px)"};case"top_center":return{top:"0",left:"50%",transform:"translate(-50%, 30px)"};case"middle_left":return{top:"50%",left:"0",transform:"translate(30px, -50%)"};case"middle_right":return{top:"50%",right:"0",transform:"translate(-30px, -50%)"};case"middle_center":return{top:"50%",left:"50%",transform:"translate(-50%, -50%)"};case xd:return{left:"30px"};case Cd:return{left:"50%",transform:"translateX(-50%)"};default:return{right:t===Ad&&n===_d?"60px":"30px"}}}const iv=Qc("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Qc("path",{d:"M626-533q22.5 0 38.25-15.75T680-587q0-22.5-15.75-38.25T626-641q-22.5 0-38.25 15.75T572-587q0 22.5 15.75 38.25T626-533Zm-292 0q22.5 0 38.25-15.75T388-587q0-22.5-15.75-38.25T334-641q-22.5 0-38.25 15.75T280-587q0 22.5 15.75 38.25T334-533Zm146 272q66 0 121.5-35.5T682-393h-52q-23 40-63 61.5T480.5-310q-46.5 0-87-21T331-393h-53q26 61 81 96.5T480-261Zm0 181q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),rv=Qc("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Qc("path",{d:"M626-533q22.5 0 38.25-15.75T680-587q0-22.5-15.75-38.25T626-641q-22.5 0-38.25 15.75T572-587q0 22.5 15.75 38.25T626-533Zm-292 0q22.5 0 38.25-15.75T388-587q0-22.5-15.75-38.25T334-641q-22.5 0-38.25 15.75T280-587q0 22.5 15.75 38.25T334-533Zm20 194h253v-49H354v49ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),ov=Qc("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Qc("path",{d:"M626-533q22.5 0 38.25-15.75T680-587q0-22.5-15.75-38.25T626-641q-22.5 0-38.25 15.75T572-587q0 22.5 15.75 38.25T626-533Zm-292 0q22.5 0 38.25-15.75T388-587q0-22.5-15.75-38.25T334-641q-22.5 0-38.25 15.75T280-587q0 22.5 15.75 38.25T334-533Zm146.174 116Q413-417 358.5-379.5T278-280h53q22-42 62.173-65t87.5-23Q528-368 567.5-344.5T630-280h52q-25-63-79.826-100-54.826-37-122-37ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),sv=Qc("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Qc("path",{d:"M480-417q-67 0-121.5 37.5T278-280h404q-25-63-80-100t-122-37Zm-183-72 50-45 45 45 31-36-45-45 45-45-31-36-45 45-50-45-31 36 45 45-45 45 31 36Zm272 0 44-45 51 45 31-36-45-45 45-45-31-36-51 45-44-45-31 36 44 45-44 45 31 36ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142 0 241-99t99-241q0-142-99-241t-241-99q-142 0-241 99t-99 241q0 142 99 241t241 99Z"})}),av=Qc("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Qc("path",{d:"M479.504-261Q537-261 585.5-287q48.5-26 78.5-72.4 6-11.6-.75-22.6-6.75-11-20.25-11H316.918Q303-393 296.5-382t-.5 22.6q30 46.4 78.5 72.4 48.5 26 105.004 26ZM347-578l27 27q7.636 8 17.818 8Q402-543 410-551q8-8 8-18t-8-18l-42-42q-8.8-9-20.9-9-12.1 0-21.1 9l-42 42q-8 7.636-8 17.818Q276-559 284-551q8 8 18 8t18-8l27-27Zm267 0 27 27q7.714 8 18 8t18-8q8-7.636 8-17.818Q685-579 677-587l-42-42q-8.8-9-20.9-9-12.1 0-21.1 9l-42 42q-8 7.714-8 18t8 18q7.636 8 17.818 8Q579-543 587-551l27-27ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),lv=Qc("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:Qc("path",{d:"M2 20h2c.55 0 1-.45 1-1v-9c0-.55-.45-1-1-1H2v11zm19.83-7.12c.11-.25.17-.52.17-.8V11c0-1.1-.9-2-2-2h-5.5l.92-4.65c.05-.22.02-.46-.08-.66-.23-.45-.52-.86-.88-1.22L14 2 7.59 8.41C7.21 8.79 7 9.3 7 9.83v7.84C7 18.95 8.05 20 9.34 20h8.11c.7 0 1.36-.37 1.72-.97l2.66-6.15z"})}),uv=Qc("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:Qc("path",{d:"M22 4h-2c-.55 0-1 .45-1 1v9c0 .55.45 1 1 1h2V4zM2.17 11.12c-.11.25-.17.52-.17.8V13c0 1.1.9 2 2 2h5.5l-.92 4.65c-.05.22-.02.46.08.66.23.45.52.86.88 1.22L10 22l6.41-6.41c.38-.38.59-.89.59-1.42V6.34C17 5.05 15.95 4 14.66 4H6.55c-.7 0-1.36.37-1.72.97l-2.66 6.15z"})}),cv=({fill:t="currentColor"}={})=>Qc("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:t,xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"close-survey-title-adam",children:[Qc("title",{id:"close-survey-title",className:"adam-testing",children:"Close survey"}),Qc("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0.164752 0.164752C0.384422 -0.0549175 0.740578 -0.0549175 0.960248 0.164752L6 5.20451L11.0398 0.164752C11.2594 -0.0549175 11.6156 -0.0549175 11.8352 0.164752C12.0549 0.384422 12.0549 0.740578 11.8352 0.960248L6.79549 6L11.8352 11.0398C12.0549 11.2594 12.0549 11.6156 11.8352 11.8352C11.6156 12.0549 11.2594 12.0549 11.0398 11.8352L6 6.79549L0.960248 11.8352C0.740578 12.0549 0.384422 12.0549 0.164752 11.8352C-0.0549175 11.6156 -0.0549175 11.2594 0.164752 11.0398L5.20451 6L0.164752 0.960248C-0.0549175 0.740578 -0.0549175 0.384422 0.164752 0.164752Z",fill:t})]}),dv=Qc("svg",{width:"80",height:"14",viewBox:"0 0 160 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Qc("g",{"clip-path":"url(#ph-survey-logo-clip)",style:"opacity: calc(1 - var(--ph-logo-mono, 0))",children:[Qc("path",{fill:"currentColor",d:"M51.66 25.22A1.9 1.9 0 0 0 50 23.33l-.34-.04c-1-.13-1.94-.6-2.65-1.33L33.28 7.75V28H49a2.66 2.66 0 0 0 2.67-2.67zM39.2 23.54h-.09a1.78 1.78 0 1 1 .1 0"}),Qc("path",{fill:"url(#ph-survey-logo-paint0)",d:"M21.96 2.67v4.96l11.3 11.6h.02V7.75L26.63.85a2.8 2.8 0 0 0-2-.85 2.67 2.67 0 0 0-2.67 2.67"}),Qc("path",{fill:"url(#ph-survey-logo-paint1)",d:"M21.96 7.63v11.05L31.03 28h2.25v-8.75z"}),Qc("path",{fill:"url(#ph-survey-logo-paint2)",d:"M21.96 28h9.07l-9.07-9.32z"}),Qc("path",{fill:"url(#ph-survey-logo-paint3)",d:"M10.74 2.66v4.5l11.22 11.52V7.63L15.3.8a2.66 2.66 0 0 0-4.56 1.86"}),Qc("path",{fill:"url(#ph-survey-logo-paint4)",d:"M10.74 28h8.96l-8.96-9.32z"}),Qc("path",{fill:"url(#ph-survey-logo-paint5)",d:"M10.74 7.16v11.52L19.7 28h2.26v-9.32z"}),Qc("path",{fill:"url(#ph-survey-logo-paint6)",d:"M10.74 7.16 4.54.8A2.66 2.66 0 0 0 0 2.66V7.5l10.74 11.18z"}),Qc("path",{fill:"url(#ph-survey-logo-paint7)",d:"M9.19 28h1.55v-9.32L0 7.5v10.73z"}),Qc("path",{fill:"url(#ph-survey-logo-paint8)",d:"M0 25.41A2.6 2.6 0 0 0 2.58 28H9.2L0 18.23z"})]}),Qc("path",{"clip-path":"url(#ph-survey-logo-clip)",fill:"currentColor",style:"opacity: var(--ph-logo-mono, 0)",d:"m50.02 23.34-.34-.04c-1-.13-1.95-.6-2.66-1.33L35.58 10.11a.5.5 0 0 0-.86.35V27.5c0 .28.22.5.5.5H49c1.48 0 2.67-1.2 2.67-2.67v-.1a1.9 1.9 0 0 0-1.66-1.9m-10.81.2a1.78 1.78 0 1 1 0-3.56 1.78 1.78 0 0 1 0 3.57M0 25.41A2.6 2.6 0 0 0 2.59 28h5.22a.5.5 0 0 0 .37-.84L.87 19.13a.5.5 0 0 0-.87.34zm18.81 1.74a.5.5 0 0 1-.36.85h-7.09a.5.5 0 0 1-.37-.17L8.94 25.5.13 15.82A.5.5 0 0 1 0 15.5V8.75a.5.5 0 0 1 .86-.34zM0 2.68C0 .28 2.92-.91 4.59.82l25.6 26.33a.5.5 0 0 1-.36.85h-7.76a.5.5 0 0 1-.37-.17l-2.1-2.33L.28 5.3A1 1 0 0 1 0 4.6zm10.74 0c0-2.4 2.92-3.59 4.59-1.87L32.5 18.48l.5.51v7.3a.5.5 0 0 1-.86.35l-1.12-1.14L11.3 5.23a2 2 0 0 1-.57-1.4zM33 7.46v7.8a.5.5 0 0 1-.85.36l-9.61-9.89a2 2 0 0 1-.57-1.4V2.69c0-2.4 2.92-3.59 4.59-1.86z"}),Qc("path",{fill:"currentColor",d:"M64.9 22.88c-.67 0-1.23-.56-1.23-1.24V5.24c0-.69.56-1.24 1.24-1.24h6.55c3.89 0 6.39 2.32 6.39 5.9 0 3.6-2.5 5.91-6.4 5.91h-3.53v5.83c0 .68-.56 1.24-1.24 1.24zm3.02-11.94c0 .68.55 1.23 1.23 1.23h1.88c1.6 0 2.58-.86 2.58-2.26s-.97-2.27-2.58-2.27h-1.88c-.68 0-1.23.55-1.23 1.23zM84.71 23.1c-4.18 0-7.14-2.97-7.14-7.02s2.96-7.01 7.14-7.01c4.14 0 7.14 2.97 7.14 7.01 0 4.05-3 7.01-7.14 7.01m-3.22-7.02c0 2.16 1.3 3.64 3.22 3.64 1.9 0 3.2-1.48 3.2-3.64s-1.3-3.64-3.2-3.64c-1.93 0-3.22 1.48-3.22 3.64m16.34 7.03a6.2 6.2 0 0 1-5.54-3.01c-.34-.57-.01-1.26.6-1.5l.77-.3c.7-.27 1.45.15 1.92.73a2.8 2.8 0 0 0 2.25 1.08c1.05 0 1.75-.51 1.75-1.27 0-2.13-7.17-.7-7.17-5.85 0-2.13 1.85-3.91 4.83-3.91 2.27 0 4.2.9 5.17 2.31.36.53.05 1.2-.54 1.44l-.85.35c-.68.29-1.45-.14-2-.63a2.5 2.5 0 0 0-1.64-.64c-.89 0-1.5.38-1.5.97 0 2.16 7.27.38 7.27 5.88 0 2.35-2.15 4.34-5.32 4.34m14.64-1.31c.04.57-.3 1.1-.86 1.2q-.6.1-1.27.11c-2.92 0-5.15-1.56-5.15-4.85v-5.66h-.91c-.69 0-1.24-.56-1.24-1.24v-.82c0-.68.55-1.23 1.24-1.23h.91v-2.7c0-.69.55-1.24 1.23-1.24h1.48c.68 0 1.24.55 1.24 1.23v2.7h2.04c.68 0 1.23.56 1.23 1.24v.82c0 .68-.55 1.24-1.23 1.24h-2.04v5.15c0 1.2.64 1.91 1.6 1.91.75 0 1.6.5 1.66 1.25zM125.5 5.23c0-.68.55-1.23 1.23-1.23h1.8c.68 0 1.23.55 1.23 1.23v16.41c0 .68-.55 1.24-1.23 1.24h-1.8c-.68 0-1.23-.56-1.23-1.24v-5.43c0-.68-.56-1.23-1.24-1.23h-5c-.67 0-1.23.55-1.23 1.23v5.43c0 .68-.55 1.24-1.23 1.24h-1.77c-.69 0-1.24-.56-1.24-1.24V5.24c0-.69.55-1.24 1.24-1.24h1.77c.68 0 1.23.55 1.23 1.23v4.87c0 .68.56 1.23 1.24 1.23h5c.67 0 1.23-.55 1.23-1.23zm12.87 17.87c-4.19 0-7.14-2.97-7.14-7.02s2.95-7.01 7.14-7.01c4.13 0 7.14 2.97 7.14 7.01 0 4.05-3 7.01-7.14 7.01m-3.22-7.02c0 2.16 1.29 3.64 3.22 3.64 1.9 0 3.2-1.48 3.2-3.64s-1.3-3.64-3.2-3.64c-1.93 0-3.22 1.48-3.22 3.64m17.17 6.37c-3.84 0-6.2-2.58-6.2-6.68s2.36-6.69 6.12-6.69c1.58 0 2.82.54 3.54 1.37 0-.64.52-1.15 1.16-1.15h1.5c.68 0 1.24.55 1.24 1.23V21.9c0 3.64-2.77 6.09-6.93 6.09-2.64 0-4.9-1.2-5.85-3.09-.31-.62.16-1.29.85-1.4l1.14-.17c.67-.11 1.29.4 1.78.85.5.46 1.26.7 2.08.7 1.85 0 3.06-1.04 3.06-2.55v-1.3c-.7.9-2.01 1.4-3.49 1.4m-2.36-6.68c0 2.02 1.18 3.31 3 3.31 1.86 0 3.04-1.29 3.04-3.31s-1.18-3.32-3.03-3.32c-1.83 0-3.01 1.3-3.01 3.32"}),Qc("defs",{children:[Qc("linearGradient",{id:"ph-survey-logo-paint0",x1:"21.96",x2:"33.28",y1:"9.62",y2:"9.62",gradientUnits:"userSpaceOnUse",children:[Qc("stop",{"stop-color":"#ffd849"}),Qc("stop",{offset:".96","stop-color":"#fbae01"})]}),Qc("linearGradient",{id:"ph-survey-logo-paint1",x1:"21.96",x2:"33.28",y1:"17.81",y2:"17.81",gradientUnits:"userSpaceOnUse",children:[Qc("stop",{"stop-color":"#ffb700"}),Qc("stop",{offset:"1","stop-color":"#f9aa01"})]}),Qc("linearGradient",{id:"ph-survey-logo-paint2",x1:"21.96",x2:"31.03",y1:"23.34",y2:"23.34",gradientUnits:"userSpaceOnUse",children:[Qc("stop",{"stop-color":"#ff9500"}),Qc("stop",{offset:"1","stop-color":"#f8aa00"})]}),Qc("linearGradient",{id:"ph-survey-logo-paint3",x1:"10.74",x2:"21.96",y1:"9.34",y2:"9.34",gradientUnits:"userSpaceOnUse",children:[Qc("stop",{"stop-color":"#ff651e"}),Qc("stop",{offset:"1","stop-color":"#e4400a"})]}),Qc("linearGradient",{id:"ph-survey-logo-paint4",x1:"10.74",x2:"19.7",y1:"23.34",y2:"23.34",gradientUnits:"userSpaceOnUse",children:[Qc("stop",{"stop-color":"#c42c00"}),Qc("stop",{offset:"1","stop-color":"#d63600"})]}),Qc("linearGradient",{id:"ph-survey-logo-paint5",x1:"10.74",x2:"21.96",y1:"17.58",y2:"17.58",gradientUnits:"userSpaceOnUse",children:[Qc("stop",{"stop-color":"#ef3c00"}),Qc("stop",{offset:"1","stop-color":"#d63601"})]}),Qc("linearGradient",{id:"ph-survey-logo-paint6",x1:"0",x2:"10.74",y1:"9.34",y2:"9.34",gradientUnits:"userSpaceOnUse",children:[Qc("stop",{"stop-color":"#3f80ff"}),Qc("stop",{offset:"1","stop-color":"#084fe0"})]}),Qc("linearGradient",{id:"ph-survey-logo-paint7",x1:"0",x2:"10.74",y1:"17.75",y2:"17.75",gradientUnits:"userSpaceOnUse",children:[Qc("stop",{"stop-color":"#0255ff"}),Qc("stop",{offset:"1","stop-color":"#0145d2"})]}),Qc("linearGradient",{id:"ph-survey-logo-paint8",x1:"0",x2:"9.19",y1:"23.11",y2:"23.11",gradientUnits:"userSpaceOnUse",children:[Qc("stop",{"stop-color":"#0041c6"}),Qc("stop",{offset:"1","stop-color":"#0045d0"})]}),Qc("clipPath",{id:"ph-survey-logo-clip",children:Qc("path",{fill:"#fff",d:"M0 0h51.67v28H0z"})})]})]});function hv({urlParams:t}){const e=t?Object.entries(t).map(([t,e])=>`${encodeURIComponent(t)}=${encodeURIComponent(e)}`).join("&"):"";return Qc("a",{href:"https://posthog.com/surveys"+(e?`?${e}`:""),target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",dv]})}function fv({text:t,submitDisabled:e,appearance:n,onSubmit:i,link:r,onPreviewSubmit:o,skipSubmitButton:s,canGoBack:a,onBack:l}){const{isPreviewMode:u}=pd(Wf),c=!!a&&!!l,d=!s&&Qc("button",{className:"form-submit",disabled:e,type:"button",onClick(){var t;r&&(null===(t=window)||void 0===t||t.open(r)),u?null==o||o():i()},children:t});return Qc("div",{className:"bottom-section",children:[c?Qc("div",{className:"form-buttons form-buttons-with-back",children:[Qc("button",{className:"form-back",type:"button","aria-label":"Go to previous question",onClick:l,children:n.backButtonText||"Back"}),d]}):d,!n.whiteLabel&&Qc(hv,{urlParams:{utm_source:"survey-footer"}})]})}function vv({question:t,forceDisableHtml:e,htmlFor:n}){return Qc("div",{class:t.question||t.description?"question-header":"question-header question-header--empty",children:[Qc(t.type===Ed?"label":"h3",{className:"survey-question",htmlFor:n,children:t.question}),t.description&&Gf({component:xc("p",{className:"survey-question-description"}),children:t.description,renderAsHtml:!e&&"text"!==t.descriptionContentType})]})}function pv({onClick:t}){const{isPreviewMode:e}=pd(Wf);return Qc("button",{className:"form-cancel",onClick:t,disabled:e,"aria-label":"Close survey",type:"button",children:cv({fill:"black"})})}function mv({header:t,description:e,contentType:n,forceDisableHtml:i,appearance:r,onClose:o}){const{isPopup:s}=pd(Wf);return hd(()=>{const t=t=>{"Enter"!==t.key&&"Escape"!==t.key||(t.preventDefault(),o())};return me(window,"keydown",t),()=>{window.removeEventListener("keydown",t)}},[o]),Qc("div",{className:"thank-you-message",role:"status",tabIndex:0,"aria-atomic":"true",children:[s&&!0!==r.hideCancelButton&&Qc(pv,{onClick:()=>o()}),Qc("h3",{className:"thank-you-message-header",children:t}),e&&Gf({component:xc("p",{className:"thank-you-message-body"}),children:e,renderAsHtml:!i&&"text"!==n}),s&&Qc(fv,{text:r.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:r,onSubmit:()=>o()})]})}function gv({header:t,description:e,contentType:n,forceDisableHtml:i,appearance:r,onStart:o}){const{isPopup:s,onPreviewSubmit:a,onPopupSurveyDismissed:l}=pd(Wf);return Qc("div",{className:"intro-screen",role:"status",tabIndex:0,"aria-atomic":"true",children:[s&&!0!==r.hideCancelButton&&Qc(pv,{onClick:()=>l()}),t&&Qc("h3",{className:"intro-screen-header",children:t}),e&&Gf({component:xc("p",{className:"intro-screen-body"}),children:e,renderAsHtml:!i&&"text"!==n}),Qc(fv,{text:r.introScreenButtonText||"Get started",submitDisabled:!1,appearance:r,onSubmit:o,onPreviewSubmit:()=>a(null)})]})}const yv=t=>U(t)&&t.every(t=>V(t));function bv({question:t,forceDisableHtml:e,appearance:n,onSubmit:i,onPreviewSubmit:r,displayQuestionIndex:o,initialValue:s,canGoBack:a,onBack:l}){const{isPreviewMode:u}=Hf(),c=fd(null),[d,h]=dd(()=>V(s)?s:""),f=null==n?void 0:n.disableAutofocus;hd(()=>{f||setTimeout(()=>{var t;u||null===(t=c.current)||void 0===t||t.focus()},100)},[u,f]);const v=`surveyQuestion${o}`,p=vd(()=>function(t,e,n){const i=t.trim();if(!n&&""===i)return"This field is required";if(""===i)return!1;if(e&&e.length>0)for(const t of e)switch(t.type){case F:var r;if(void 0!==t.value&&t.value>i.length)return null!==(r=t.errorMessage)&&void 0!==r?r:`Please enter at least ${t.value} characters`;break;case P:var o;if(void 0!==t.value&&i.length>t.value)return null!==(o=t.errorMessage)&&void 0!==o?o:`Please enter no more than ${t.value} characters`}return!1}(d,t.validation,t.optional),[d,t.validation,t.optional]),m=ae(t.validation,F),g=ae(t.validation,P),y=vd(()=>function(t,e){const n=1===t?void 0:t;return n&&e?`Enter ${n}-${e} characters`:n?`Enter at least ${n} ${1===n?"character":"characters"}`:e?`Maximum ${e} ${1===e?"character":"characters"}`:void 0}(m,g),[m,g]),b=()=>{p||i(d.trim())},w=()=>{p||r(d.trim())};return Qc(Mc,{children:[Qc("div",{className:"question-container",children:[Qc(vv,{question:t,forceDisableHtml:e,htmlFor:v}),Qc("textarea",{ref:c,id:v,rows:4,placeholder:null==n?void 0:n.placeholder,minLength:m,maxLength:g,onInput(t){h(t.currentTarget.value),t.stopPropagation()},onKeyDown(t){t.stopPropagation(),"Enter"!==t.key||!t.metaKey&&!t.ctrlKey||p||(t.preventDefault(),u?w():b())},value:d}),y&&Qc("div",{className:"validation-hint",children:y})]}),Qc(fv,{text:t.buttonText||"Submit",submitDisabled:!!p,appearance:n,onSubmit:b,onPreviewSubmit:w,canGoBack:a,onBack:l})]})}function wv({question:t,forceDisableHtml:e,appearance:n,onSubmit:i,onPreviewSubmit:r,canGoBack:o,onBack:s}){return Qc(Mc,{children:[Qc("div",{className:"question-container",children:Qc(vv,{question:t,forceDisableHtml:e})}),Qc(fv,{text:t.buttonText||"Submit",submitDisabled:!1,link:t.link,appearance:n,onSubmit:()=>i("link clicked"),onPreviewSubmit:()=>r("link clicked"),canGoBack:o,onBack:s})]})}function kv({question:t,forceDisableHtml:e,displayQuestionIndex:n,appearance:i,onSubmit:r,onPreviewSubmit:o,initialValue:s,canGoBack:a,onBack:l}){var u;const c=t.scale,d=10===t.scale?0:1,[h,f]=dd(()=>Y(s)?s:U(s)&&s.length>0&&Y(parseInt(s[0]))?parseInt(s[0]):V(s)&&Y(parseInt(s))?parseInt(s):null),v="emoji"===t.display&&2===t.scale,{isPreviewMode:p}=Hf(),m=t=>p?o(t):r(t);return Qc(Mc,{children:[Qc("div",{className:"question-container",children:[Qc(vv,{question:t,forceDisableHtml:e}),Qc("div",{className:"rating-section",children:[Qc("div",{className:"rating-options",children:["emoji"===t.display&&Qc("div",{className:"rating-options-emoji"+(v?" rating-options-emoji-2":""),children:null===(u=Tv[t.scale])||void 0===u?void 0:u.map((e,i)=>Qc("button",{"aria-label":`Rate ${i+1}`,className:`ratings-emoji question-${n}-rating-${i} ${i+1===h?"rating-active":""}`,value:i+1,type:"button",onClick(){const e=i+1;f(e),t.skipSubmitButton&&m(e)},children:e},i))}),"number"===t.display&&Qc("div",{className:"rating-options-number",style:{gridTemplateColumns:`repeat(${c-d+1}, minmax(0, 1fr))`},children:Iv(t.scale).map((e,r)=>Qc(Sv,{displayQuestionIndex:n,active:h===e,appearance:i,num:e,setActiveNumber(e){f(e),t.skipSubmitButton&&m(e)}},r))})]}),!v&&Qc("div",{className:"rating-text",children:[Qc("div",{children:t.lowerBoundLabel}),Qc("div",{children:t.upperBoundLabel})]})]})]}),Qc(fv,{text:t.buttonText||(null==i?void 0:i.submitButtonText)||"Submit",submitDisabled:Z(h)&&!t.optional,appearance:i,onSubmit:()=>r(h),onPreviewSubmit:()=>o(h),skipSubmitButton:t.skipSubmitButton,canGoBack:a,onBack:l})]})}function Sv({num:t,active:e,displayQuestionIndex:n,setActiveNumber:i}){return Qc("button",{"aria-label":`Rate ${t}`,className:`ratings-number question-${n}-rating-${t} ${e?"rating-active":""}`,type:"button",onClick(){i(t)},children:t})}function _v({question:t,forceDisableHtml:e,displayQuestionIndex:n,appearance:i,onSubmit:r,onPreviewSubmit:o,initialValue:s,canGoBack:a,onBack:l}){const u=fd(null),c=vd(()=>(t=>{var e;if(!t.shuffleOptions)return t.choices;const n=[...t.choices],i=t.hasOpenChoice&&null!==(e=n.pop())&&void 0!==e?e:null,r=(o=n,(s=Wi(n)).length>1&&o.every((t,e)=>t===s[e])?s.reverse():s);var o,s;return Z(i)||r.push(i),r})(t),[t]),[d,h]=dd(()=>((t,e)=>V(t)||yv(t)?t:e===$d?null:[])(s,t.type)),[f,v]=dd(()=>((t,e)=>{if(V(t)&&!e.includes(t))return{isSelected:!0,inputValue:t};if(yv(t)){const n=t.find(t=>!e.includes(t));if(n)return{isSelected:!0,inputValue:n}}return{isSelected:!1,inputValue:""}})(s,c)),{isPreviewMode:p}=Hf(),m=t.type===$d,g=t.type===Od,y=t.skipSubmitButton&&m&&!t.hasOpenChoice,b=(t,e)=>{if(e){const t=!f.isSelected;return v(e=>L(L({},e),{},{isSelected:t,inputValue:t?e.inputValue:""})),m&&h(""),void(t&&setTimeout(()=>{var t;return null===(t=u.current)||void 0===t?void 0:t.focus()},75))}if(m)return h(t),v(t=>L(L({},t),{},{isSelected:!1,inputValue:""})),void(y&&(r(t),p&&o(t)));g&&U(d)&&(d.includes(t)?h(d.filter(e=>e!==t)):h([...d,t]))},w=t=>{t.stopPropagation();const e=t.currentTarget.value;v(t=>L(L({},t),{},{inputValue:e})),m&&h(e)},k=t=>{t.stopPropagation(),"Enter"!==t.key||S()||(t.preventDefault(),_()),"Escape"===t.key&&(t.preventDefault(),v(t=>L(L({},t),{},{isSelected:!1,inputValue:""})),m&&h(null))},S=()=>!(t.optional||!Z(d)&&(!U(d)||f.isSelected||0!==d.length)&&(!f.isSelected||""!==f.inputValue.trim())),_=()=>{f.isSelected&&g?U(d)&&(p?o([...d,f.inputValue]):r([...d,f.inputValue])):p?o(d):r(d)};return Qc(Mc,{children:[Qc("div",{className:"question-container",children:[Qc(vv,{question:t,forceDisableHtml:e}),Qc("fieldset",{className:"multiple-choice-options limit-height",children:[Qc("legend",{className:"sr-only",children:g?" Select all that apply":" Select one"}),c.map((e,i)=>{const r=!!t.hasOpenChoice&&i===t.choices.length-1,o=`surveyQuestion${n}Choice${i}`,s=`${o}Open`,a=r?f.isSelected:m?d===e:U(d)&&d.includes(e);return Qc("label",{className:r?"choice-option-open":"",children:[Qc("div",{className:"response-choice",children:[Qc("input",{type:m?"radio":"checkbox",name:o,checked:a,onChange:()=>b(e,r),id:o,"aria-controls":s}),Qc("span",{children:r?`${e}:`:e})]}),r&&Qc("input",{type:"text",ref:u,id:s,name:`question${n}Open`,value:f.inputValue,onKeyDown:k,onInput:w,onClick(t){f.isSelected||b(e,!0),t.stopPropagation()},"aria-label":`${e} - please specify`})]},i)})]})]}),Qc(fv,{text:t.buttonText||"Submit",submitDisabled:S(),appearance:i,onSubmit:_,onPreviewSubmit:_,skipSubmitButton:y,canGoBack:a,onBack:l})]})}const xv=[1,2,3,4,5],Cv=[1,2,3,4,5,6,7],Mv=[0,1,2,3,4,5,6,7,8,9,10],Tv={2:[lv,uv],3:[ov,rv,iv],5:[sv,ov,rv,iv,av]};function Iv(t){switch(t){case 5:default:return xv;case 7:return Cv;case 10:return Mv}}const Av=he("[Surveys]");function Rv(t,e,n){var i;const r=t.questions[e],o=e+1;if(!(null===(i=r.branching)||void 0===i?void 0:i.type))return e===t.questions.length-1?Dd:o;if(r.branching.type===Dd)return Dd;if("specific_question"===r.branching.type){if(Number.isInteger(r.branching.index))return r.branching.index}else if("response_based"===r.branching.type){if(r.type===$d){var s;let t=r.choices.indexOf(`${n}`);if(-1===t&&r.hasOpenChoice&&(t=r.choices.length-1),null===(s=r.branching)||void 0===s||null===(s=s.responseValues)||void 0===s?void 0:s.hasOwnProperty(t)){const e=r.branching.responseValues[t];if(Number.isInteger(e))return e;if(e===Dd)return Dd}}else if(r.type===Ld){var a;if(r.optional&&J(n))return o===t.questions.length?Dd:o;if("number"!=typeof n||!Number.isInteger(n))throw new Error("The response type must be an integer");const e=function(t,e){if(2===e){if(1>t||t>2)throw new Error("The response must be in range 1-2");return 1===t?"positive":"negative"}if(3===e){if(1>t||t>3)throw new Error("The response must be in range 1-3");return 1===t?"negative":2===t?"neutral":"positive"}if(5===e){if(1>t||t>5)throw new Error("The response must be in range 1-5");return t>2?3===t?"neutral":"positive":"negative"}if(7===e){if(1>t||t>7)throw new Error("The response must be in range 1-7");return t>3?4===t?"neutral":"positive":"negative"}if(10===e){if(0>t||t>10)throw new Error("The response must be in range 0-10");return t>6?t>8?"promoters":"passives":"detractors"}throw new Error("The scale must be one of: 2, 3, 5, 7, 10")}(n,r.scale);if(null===(a=r.branching)||void 0===a||null===(a=a.responseValues)||void 0===a?void 0:a.hasOwnProperty(e)){const t=r.branching.responseValues[e];if(Number.isInteger(t))return t;if(t===Dd)return Dd}}return o}return Av.warn("Falling back to next question index due to unexpected branching type"),o}const Ev=he("[SurveyTranslations]");function Ov(t,e){const n=function(t){var e;return function({overrideLanguage:t,storedPersonProperties:e,locale:n},i){const r=Di(t);if(r)return null==i||i.info(`Using override display language: ${r}`),r;const o=function(t){return t&&"object"==typeof t&&"language"in t?Di(t.language):null}(e);if(o)return null==i||i.info(`Using person property language: ${o}`),o;const s=Di(n);return s?(null==i||i.info(`Using detected locale: ${s}`),s):(null==i||i.info("No user language detected"),null)}({overrideLanguage:t.config.overrideLanguage,storedPersonProperties:null===(e=t.client)||void 0===e?void 0:e.kv.get(s),locale:"u">typeof navigator?navigator.language||navigator.userLanguage:void 0},Ev)}(e);if(!n)return Ev.info("No user language detected"),{survey:t,language:null};const i=qi(t,n,Ev);return{survey:i.survey,language:i.matchedKey}}const $v="ph:show_survey_widget",Lv="PHWidgetSurveyClickListener";function Dv(t,e){try{const n=t.getBoundingClientRect(),i=window.innerHeight,r=window.innerWidth;let o=n.left+n.width/2-e/2;o+e>r-20&&(o=r-e-20),20>o&&(o=20);const s=i-n.bottom,a=250>s&&n.top>s;return{position:"fixed",top:a?"auto":`${n.bottom+12}px`,left:`${o}px`,right:"auto",bottom:a?i-n.top+12+"px":"auto",zIndex:Ef.zIndex}}catch(t){return Hd.warn("Failed to calculate trigger position:",t),null}}var Fv=class{constructor(t){var e,n;this.Li=new Map,this.Di=new Map,this.Fi=new Map,this.Pi=new Map,this.Ni=new Set,this.qi=!1,this.ji=null,this.Bi=!1,this.zi=null,this.Ui=null,this.Wi=null,this.Hi=!1,this.handlePageUnload=()=>{var t;const e=null===(t=this.Gi.client)||void 0===t?void 0:t.kv.get(a);if(e)for(const t of e)Xf(t)&&jf(t,this.Gi)},this.handlePopoverSurvey=(t,e,{resumeDelayFromActivation:n=!1}={})=>{var i,r,o,s,a,l,u;if(!(null===(i=this.Gi.client)||void 0===i?void 0:i.canCapture))return;const{survey:c,language:d}=this.Vi(t);this.ji=d,this.Wi=null,this.Qi=e;const h=this.Zi(c,e);this.Ji(h.id);const{properties:f,initialResponses:v}=null!=e?e:{},p=!(!v||0>=Object.keys(v).length)&&this.Yi(h,v,f,d);if(p&&!(null===(r=h.appearance)||void 0===r?void 0:r.displayThankYouMessage))return;this.Ki(h);let m={};if((null===(o=h.appearance)||void 0===o?void 0:o.position)===Td&&(null===(s=h.appearance)||void 0===s?void 0:s.widgetSelector)){var g;const t=document.querySelector(h.appearance.widgetSelector);t&&(m=Dv(t,parseInt((null===(g=h.appearance)||void 0===g?void 0:g.maxWidth)||Ef.maxWidth))||{})}const y=(null===(a=h.appearance)||void 0===a?void 0:a.surveyPopupDelaySeconds)||0,{shadow:b}=Df(h,this.Gi);this.Pi.set(b,b.host);const w={posthog:this.Gi,survey:h,removeSurveyFromFocus:this.Xi,properties:f,style:m,isSurveyCompleted:p,skipShownEvent:null==e?void 0:e.skipShownEvent,surveyLanguage:d};if(this.Wi=w,0>=y)return this.Bi=!0,Gc(Qc(jv,L({},w)),b);const k=()=>{this.Bi=!0;const{survey:n,language:i}=this.Vi(t);this.ji=i;const r=this.Zi(n,e),o=L(L({},w),{},{survey:r,surveyLanguage:i});this.Wi=o,Gc(Qc(jv,L(L({},o),{},{survey:L(L({},r),{},{appearance:L(L({},r.appearance),{},{surveyPopupDelaySeconds:0})})})),b)},S=()=>{var t;if(!(null===(t=this.Gi.client)||void 0===t?void 0:t.canCapture)||!this.er(h))return Hd.info(`Survey ${h.id} no longer eligible when its display delay elapsed; not displaying`),this.Xi(h);k()},_=n?null===(l=this.Gi.surveys)||void 0===l||null===(l=l._surveyEventReceiver)||void 0===l||null===(u=l.getActivationTimestamp)||void 0===u?void 0:u.call(l,h.id):void 0,x=Y(_)?Math.max(0,Date.now()-_):0,C=Math.max(0,1e3*y-x);if(0>=C)return S();const M=window.setTimeout(()=>{this.Li.delete(h.id),S()},C);this.Li.set(h.id,M)},this.nr=t=>{var e;const{survey:n,language:i}=this.Vi(t),{shadow:r,isNewlyCreated:o}=Df(n,this.Gi);this.Pi.set(r,r.host),(null===(e=t.appearance)||void 0===e?void 0:e.widgetType)===_d&&this.Fi.set(t.id,t),o&&Gc(Qc(zv,{posthog:this.Gi,survey:n,surveyLanguage:i},t.id),r)},this.ir=t=>{const e=this.Di.get(t);e&&(e.element.removeEventListener("click",e.listener),e.element.removeAttribute(Lv),this.Di.delete(t),Hd.info(`Removed click listener for survey ${t}`))},this.rr=t=>{this.sr(t)||(this.ar(t),this.ir(t.id))},this.lr=t=>{this.sr(t)||(this.ar(t),this.Fi.delete(t.id))},this.sr=t=>{try{var e;const n=document.querySelector(ev(t,!0));return!!(null==n||null===(e=n.shadowRoot)||void 0===e?void 0:e.querySelector(".ph-survey"))}catch(t){return!1}},this.ur=(t,e)=>{const n=document.querySelector(e),i=this.Di.get(t.id);if(n){if(this.nr(t),i){if(n===i.element)return;Hd.info(`Selector element changed for survey ${t.id}. Re-attaching listener.`),this.ir(t.id)}if(!n.hasAttribute(Lv)){const e=e=>{var n,i;e.stopPropagation();const r=(null===(n=t.appearance)||void 0===n?void 0:n.position)===Td?Dv(e.currentTarget,parseInt((null===(i=t.appearance)||void 0===i?void 0:i.maxWidth)||Ef.maxWidth)):{};window.dispatchEvent(new CustomEvent($v,{detail:{surveyId:t.id,position:r}}))};me(n,"click",e),n.setAttribute(Lv,"true"),this.Di.set(t.id,{element:n,listener:e,survey:t}),Hd.info(`Attached click listener for feedback button survey ${t.id}`)}}else i&&this.rr(t)},this.renderPopover=t=>{var e;if(!(null===(e=this.Gi.client)||void 0===e?void 0:e.canCapture))return;const{survey:n,language:i}=this.Vi(t),{shadow:r}=Df(n,this.Gi);this.Pi.set(r,r.host),Gc(Qc(jv,{posthog:this.Gi,survey:n,removeSurveyFromFocus:this.Xi,surveyLanguage:i}),r)},this.renderSurvey=(t,e,n)=>{var i;if(!(null===(i=this.Gi.client)||void 0===i?void 0:i.canCapture))return;const{survey:r,language:o}=this.Vi(t);let s=!1;this.Gi.config.prefillFromUrl&&(s=this.cr(r,o,n)),Gc(Qc(jv,{posthog:this.Gi,survey:r,removeSurveyFromFocus:this.Xi,isPopup:!1,properties:n,isSurveyCompleted:s,surveyLanguage:o}),e)},this.getActiveMatchingSurveys=(t,e=!1)=>{var n;null===(n=this.Gi.surveys)||void 0===n||n.getSurveys(e=>{t(e.filter(t=>this.er(t)))},e)},this.callSurveysAndEvaluateDisplayLogic=(t=!1)=>{this.getActiveMatchingSurveys(t=>{var e;const n=null===(e=this.Gi.client)||void 0===e?void 0:e.canCapture,i=t.filter(t=>n&&(t.type===Id||t.type===Ad)),r=new Set(i.map(t=>t.id));for(const t of Array.from(this.Li.keys()))r.has(t)||this.cancelSurvey(t);const o=this.dr(i),s=new Set,a=new Set;o.forEach(t=>{if(t.type===Ad){var e,n,i,r;if((null===(e=t.appearance)||void 0===e?void 0:e.widgetType)===_d)return a.add(t.id),void this.nr(t);"selector"===(null===(n=t.appearance)||void 0===n?void 0:n.widgetType)&&(null===(i=t.appearance)||void 0===i?void 0:i.widgetSelector)&&(s.add(t.id),this.ur(t,null===(r=t.appearance)||void 0===r?void 0:r.widgetSelector))}Z(this.vr)&&t.type===Id&&this.handlePopoverSurvey(t,void 0,{resumeDelayFromActivation:!0})}),this.Di.forEach(({survey:t})=>{s.has(t.id)||this.rr(t)}),this.Fi.forEach((t,e)=>{a.has(e)||this.lr(t)})},t)},this.Ki=t=>{Z(this.vr)||Hd.error(`Survey ${this.vr} already in focus. Cannot add survey ${t.id}.`),this.vr=t.id},this.Xi=t=>{this.vr!==t.id&&Hd.error(`Survey ${t.id} is not in focus. Cannot remove survey ${t.id}.`),this.Ji(t.id),this.vr=null,this.ji=null,this.Bi=!1,this.Wi=null,this.Qi=void 0,this.ar(t)},this.Gi=t,this.vr=null,this.zi=()=>this.pr(),me(window,"languagechange",this.zi),this.Ui=null!==(e=null===(n=t.client)||void 0===n||null===(n=n.getExtension("featureFlagsCommon"))||void 0===n?void 0:n.onFeatureFlags(()=>this.pr()))&&void 0!==e?e:null}pr(){var t;if(Z(this.vr))return;const e=null===(t=this.Gi.client)||void 0===t?void 0:t.kv.get(a),n=null==e?void 0:e.find(t=>t.id===this.vr);if(!n)return;const{survey:i,language:r}=this.Vi(n);if(r===this.ji)return;if(this.ji=r,!this.Bi)return;const o=this.Zi(i,this.Qi),{shadow:s}=Df(o,this.Gi);Gc(Qc(jv,L(L({},this.Wi),{},{posthog:this.Gi,survey:o,removeSurveyFromFocus:this.Xi,surveyLanguage:r})),s)}Zi(t,e){return(null==e?void 0:e.position)||(null==e?void 0:e.selector)?L(L({},t),{},{appearance:L(L(L({},t.appearance),e.position&&{position:e.position}),e.selector&&{widgetSelector:e.selector})}):t}Ji(t){const e=this.Li.get(t);e&&(clearTimeout(e),this.Li.delete(t))}cancelSurvey(t){this.Li.has(t)&&(Hd.info(`Cancelled pending survey ${t}`),this.Ji(t),this.vr===t&&(this.vr=null,this.ji=null,this.Bi=!1,this.Wi=null,this.Qi=void 0))}startAutomaticDisplay(){if(this.qi||this.mr||!1===this.Gi.config.automaticDisplay)return;this.mr=()=>{};const t=function(t){let e;t.callSurveysAndEvaluateDisplayLogic(!0);const n=()=>{G(e)&&(e=setInterval(()=>{t.callSurveysAndEvaluateDisplayLogic(!1)},1e3))},i=()=>{G(e)||(clearInterval(e),e=void 0)};n();const r=()=>{document.hidden?i():(t.callSurveysAndEvaluateDisplayLogic(!1),n())};return me(document,"visibilitychange",r),()=>{i(),document.removeEventListener("visibilitychange",r)}}(this);this.qi?t():this.mr=t}clearInMemoryInProgressSurveyState(){(()=>{for(const t of Object.keys(Jf))delete Jf[t]})()}dispose(){var t;this.qi=!0,null===(t=this.mr)||void 0===t||t.call(this),this.mr=void 0,this.zi&&(window.removeEventListener("languagechange",this.zi),this.zi=null),this.Ui&&(this.Ui(),this.Ui=null),this.Li.forEach((t,e)=>this.Ji(e)),this.Di.forEach((t,e)=>this.ir(e)),this.Pi.forEach((t,e)=>{Gc(null,e),null==t||t.remove()}),this.Pi.clear(),this.Fi.clear(),this.vr=null}dr(t){return t.sort((t,e)=>{var n,i;const r=Xf(t),o=Xf(e);if(r&&!o)return-1;if(!r&&o)return 1;const s=t.schedule===Fd,a=e.schedule===Fd;return s&&!a?1:!s&&a?-1:((null===(n=t.appearance)||void 0===n?void 0:n.surveyPopupDelaySeconds)||0)-((null===(i=e.appearance)||void 0===i?void 0:i.surveyPopupDelaySeconds)||0)})}Vi(t){return Ov(t,this.Gi)}cr(t,e,n){if(this.Ni.has(t.id))return!1;const{params:i}=function(){const t={};let e=!1;const n=window.location.search.replace(/^\?/,"");if(!n)return{params:t,autoSubmit:e};const i=n.split("&");for(const n of i){const i=n.indexOf("=");if(0>=i)continue;let r,o;try{r=decodeURIComponent(n.slice(0,i)),o=decodeURIComponent(n.slice(i+1))}catch(t){continue}if("auto_submit"===r&&"true"===o){e=!0;continue}const s=r.match(/^q(\d+)$/);if(s){const e=parseInt(s[1],10);t[e]||(t[e]=[]),t[e].push(o)}}return{params:t,autoSubmit:e}}();if(0===Object.keys(i).length)return!1;Hd.info("[Survey Prefill] Detected URL prefill parameters");const r=this.gr(t,i,e);return!!r&&(this.yr(t,r,n,e),this.Ni.add(t.id),r.isSurveyCompleted)}yr(t,e,n,i){const{responses:r,submissionId:o,isSurveyCompleted:s,skippedResponses:a}=e;(Object.keys(a).length>0&&t.enable_partial_responses||s)&&Pf({responses:s?r:a,survey:t,surveySubmissionId:o,posthog:this.Gi,isSurveyCompleted:s,properties:n,surveyLanguage:i})}Yi(t,e,n,i){const r={};for(const[t,n]of Object.entries(e))r[parseInt(t)]=U(n)?n.map(String):[String(n)];Hd.info("[Survey] Processing initial responses");const o=this.gr(t,r,i);return!!o&&(this.yr(t,o,n,i),o.isSurveyCompleted)}gr(t,e,n){try{const i=function(t,e){const n={};return t.questions.forEach((t,i)=>{if(!e[i]||!t.id)return;const r=e[i],o=Ri(t.id);try{switch(t.type){case $d:{if(!t.choices||0===t.choices.length)return void de.warn(`[Survey Prefill] Question ${i} has no choices`);const e=parseInt(r[0],10);if(isNaN(e)||0>e||e>=t.choices.length)return void de.warn(`[Survey Prefill] Invalid choice index for q${i}: ${r[0]}`);n[o]=t.choices[e];break}case Od:{if(!t.choices||0===t.choices.length)return void de.warn(`[Survey Prefill] Question ${i} has no choices`);const e=r.map(t=>parseInt(t,10)).filter(e=>!isNaN(e)&&e>=0&&t.choices.length>e);if(0===e.length)return void de.warn(`[Survey Prefill] No valid choices for q${i}`);const s=[...new Set(e.map(e=>t.choices[e]))];e.length>s.length&&de.warn(`[Survey Prefill] Removed duplicate choices for q${i}`),n[o]=s;break}case Ld:{const e=parseInt(r[0],10),s=t.scale||10,a=10===s?0:1;if(isNaN(e)||a>e||e>s)return void de.warn(`[Survey Prefill] Invalid rating for q${i}: ${r[0]} (scale: ${a}-${s})`);n[o]=e;break}default:de.info(`[Survey Prefill] Question type ${t.type} does not support prefill`)}}catch(t){de.error(`[Survey Prefill] Error converting q${i}:`,t)}}),n}(t,e);if(0===Object.keys(i).length)return Hd.warn("[Survey Prefill] No valid responses after conversion"),null;const r=_i(),{startQuestionIndex:o,skippedResponses:s,skippedIndices:a}=function(t,e,n){let i=0;const r={},o=[],s=t.questions.length+1;let a=0;for(;t.questions.length>i&&s>a&&(a++,e.includes(i));){const e=t.questions[i];if(!e||!("skipSubmitButton"in e)||!e.skipSubmitButton)break;if(e.id){const t=Ri(e.id);G(n[t])||(r[t]=n[t])}o.push(i);const s=Rv(t,i,e.id?n[Ri(e.id)]:null);if(s===Dd)return{startQuestionIndex:t.questions.length,skippedResponses:r,skippedIndices:o};i=s}return{startQuestionIndex:i,skippedResponses:r,skippedIndices:o}}(t,Object.keys(e).map(t=>parseInt(t,10)).filter(e=>{const n=t.questions[e];return(null==n?void 0:n.id)&&!G(i[Ri(n.id)])}),i),l=o>=t.questions.length;return Yf(t,{surveySubmissionId:r,responses:i,lastQuestionIndex:o,questionOrder:Bf(t.questions),visitedIndices:a,surveyLanguage:n}),Hd.info("[Survey Prefill] Stored prefilled responses in localStorage"),{responses:i,submissionId:r,startQuestionIndex:o,isSurveyCompleted:l,skippedResponses:s}}catch(t){return Hd.error("[Survey Prefill] Error handling prefill:",t),null}}br(t,e){var n;if(!t)return!0;const i=null===(n=this.Gi.client)||void 0===n?void 0:n.getExtension(Zc),r=!!(null==i?void 0:i.isFeatureEnabled(t,{send_event:!t.startsWith("survey-targeting-")}));let o=!0;e&&(o=(null==i?void 0:i.getFeatureFlag(t,{send_event:!1}))===e||"any"===e);const s=r&&o;return s||this.wr(t),s}wr(t){this.Hi||!1!==this.Gi.config.featureFlagEvaluation||(this.Hi=!0,Hd.warn(`Survey feature flag "${t}" evaluated to false because advanced_disable_feature_flags is set. PostHog creates an internal targeting flag for almost every survey, so no survey can display while flags are disabled. To keep surveys working, replace advanced_disable_feature_flags with advanced_only_evaluate_survey_feature_flags, which evaluates survey flags only.`))}kr(t){return!t.conditions||Vf(t,this.Gi)&&Qf(t)&&function(t){var e,n;return!(null===(e=t.conditions)||void 0===e?void 0:e.selector)||!!(null===(n=document)||void 0===n?void 0:n.querySelector(t.conditions.selector))}(t)}Sr(t){var e;return Uf(t)?{satisfied:!0}:t.internal_targeting_flag_key&&function(t){var e;return"recurring"===t.schedule||(null!==(e=t.current_iteration)&&void 0!==e?e:0)>0}(t)&&!(null===(e=this.Gi.client)||void 0===e||null===(e=e.getExtension("featureFlagsCommon"))||void 0===e?void 0:e.hasLoadedFlags)?(this.wr(t.internal_targeting_flag_key),{satisfied:!1,reason:"Feature flags have not loaded yet; deferring internal targeting flag check"}):{satisfied:this.br(t.internal_targeting_flag_key)}}checkSurveyEligibility(t){var e,n;const i={eligible:!0,reason:void 0};if(!function(t){return!(!t.start_date||t.end_date)}(t))return i.eligible=!1,i.reason=`Survey is not running. It was completed on ${t.end_date}`,i;if(!Qd.includes(t.type))return i.eligible=!1,i.reason=`Surveys of type ${t.type} are never eligible to be shown in the app`,i;const r=null===(e=t.conditions)||void 0===e?void 0:e.linkedFlagVariant;if(!this.br(t.linked_flag_key,r))return i.eligible=!1,i.reason=r?`Survey linked feature flag is not enabled for variant ${r}`:"Survey linked feature flag is not enabled",i;if(!this.br(t.targeting_flag_key))return i.eligible=!1,i.reason="Survey targeting feature flag is not enabled",i;const o=this.Sr(t);var s;return o.satisfied?(t=>{let e=null;try{e=localStorage.getItem("lastSeenSurveyDate")}catch(t){Hd.error("localStorage error: "+t)}return function(t,e){if(!t||!e)return!0;const n="string"==typeof e?new Date(e):e,i=Math.abs((new Date).getTime()-n.getTime());return Math.ceil(i/864e5)>t}(t,e)})(null===(n=t.conditions)||void 0===n?void 0:n.seenSurveyWaitPeriodInDays)?((t=>{let e=null;try{e=localStorage.getItem(Vd(t))}catch(t){Hd.error("localStorage error: "+t)}return!!e&&!Uf(t)})(t)&&(i.eligible=!1,i.reason="Survey has already been seen and it can't be activated again"),i):(i.eligible=!1,i.reason="Survey wait period has not passed",i):(i.eligible=!1,i.reason=null!==(s=o.reason)&&void 0!==s?s:"Survey internal targeting flag is not enabled and survey cannot activate repeatedly and survey is not in progress",i)}checkSurveyCaptureEligibility(){var t;return(null===(t=this.Gi.client)||void 0===t?void 0:t.canCapture)?{eligible:!0}:{eligible:!1,reason:"PostHog is not capturing, so a survey response cannot be recorded"}}checkSurveyDisplayEligibility(t){const e=this.checkSurveyCaptureEligibility();return e.eligible?this.checkSurveyEligibility(t):e}checkSurveyRenderability(t){const e=this.checkSurveyDisplayEligibility(t);return e.eligible&&!this._r(t)?{eligible:!1,reason:"Survey event/action trigger has not been fired yet"}:e}_r(t){var e;if(!ji(t)&&!function(t){var e;return!!(null===(e=t.conditions)||void 0===e||null===(e=e.actions)||void 0===e||null===(e=e.values)||void 0===e?void 0:e.length)}(t))return!0;const n=null===(e=this.Gi.surveys)||void 0===e||null===(e=e._surveyEventReceiver)||void 0===e?void 0:e.getSurveys();return!!(null==n?void 0:n.includes(t.id))}Cr(t){var e;return!(null===(e=t.feature_flag_keys)||void 0===e?void 0:e.length)||t.feature_flag_keys.every(({key:t,value:e})=>!t||!e||this.br(e))}er(t){return this.checkSurveyEligibility(t).eligible&&this.kr(t)&&this._r(t)&&this.Cr(t)}ar(t){try{const e=document.querySelector(ev(t,!0));(null==e?void 0:e.shadowRoot)&&(Gc(null,e.shadowRoot),this.Pi.delete(e.shadowRoot)),null==e||e.remove()}catch(e){Hd.warn(`Failed to remove survey ${t.id} from DOM:`,e)}}getTestAPI(){return{addSurveyToFocus:this.Ki,removeSurveyFromFocus:this.Xi,surveyInFocus:this.vr,surveyTimeouts:this.Li,handleWidget:this.nr,handlePopoverSurvey:this.handlePopoverSurvey,manageWidgetSelectorListener:this.ur,sortSurveysByAppearanceDelay:this.dr.bind(this),checkFlags:this.Cr.bind(this),isSurveyFeatureFlagEnabled:this.br.bind(this),onLanguageChange:this.pr.bind(this),currentLanguage:this.ji,surveyIsRendered:this.Bi}}};function Pv({survey:t,removeSurveyFromFocus:e=()=>{},setSurveyVisible:n,isPreviewMode:i=!1,posthog:r}){hd(()=>{var o;if(i||!(null===(o=t.conditions)||void 0===o?void 0:o.url))return;const s=()=>{var i;const o=t.type===Ad,s=Vf(t,r),a=(null===(i=t.appearance)||void 0===i?void 0:i.widgetType)===_d&&o;if(!s)return Hd.info(`Hiding survey ${t.id} because URL does not match`),n(!1),e(t);a&&(Hd.info(`Showing survey ${t.id} because it is a feedback button tab and URL matches`),n(!0))};me(window,"popstate",s),me(window,"hashchange",s);const a=window.history.pushState,l=window.history.replaceState;return window.history.pushState=function(...t){a.apply(this,t),s()},window.history.replaceState=function(...t){l.apply(this,t),s()},()=>{window.removeEventListener("popstate",s),window.removeEventListener("hashchange",s),window.history.pushState=a,window.history.replaceState=l}},[i,t,e,n,r])}const Nv=200;function qv(t="right"){switch(t){case"top":return{top:"0",left:"50%",transform:"translateX(-50%)"};case"left":return{top:"50%",left:"0",transform:"rotate(90deg) translateY(-100%)",transformOrigin:"left top"};case"bottom":return{bottom:"0",left:"50%",transform:"translateX(-50%)"};default:return{top:"50%",right:"0",transform:"rotate(-90deg) translateY(-100%)",transformOrigin:"right top"}}}function jv({survey:t,forceDisableHtml:e,posthog:n,style:i={},previewPageIndex:r,removeSurveyFromFocus:o=()=>{},isPopup:s=!0,onPreviewSubmit:a=()=>{},onPreviewBack:l=()=>{},onPopupSurveyDismissed:u=()=>{},onCloseConfirmationMessage:c=()=>{},properties:d,isSurveyCompleted:h,skipShownEvent:f,surveyLanguage:v}){var p,m,g,y,b,w,k,S,_,x,C,M;const T=fd(null),I=Number.isInteger(r),{isPopupVisible:A,isSurveySent:R,hidePopupWithAnimation:E}=function(t,e,n,i,r,o,s,a,l){const[u,c]=dd(i||0===n||t.type===Rd),[d,h]=dd(!1),f=fd(!1),v=()=>{const e=()=>{o&&r(t),c(!1)};if(f.current)return;const n=null==s?void 0:s.current;n?(f.current=!0,n.style.transition=`opacity ${Nv}ms ease-out`,n.style.opacity="0",setTimeout(()=>{f.current=!1,e()},250)):e()},p=e=>{e.detail.surveyId===t.id&&v()};return hd(()=>{if(!e)return void Hd.error("usePopupVisibility hook called without a PostHog instance.");if(i)return;let r;const o=e=>{var n,i;if(e.detail.surveyId===t.id){if(!(null===(n=t.appearance)||void 0===n?void 0:n.displayThankYouMessage))return v();h(!0),(null===(i=t.appearance)||void 0===i?void 0:i.autoDisappear)&&(r&&clearTimeout(r),r=setTimeout(v,5e3))}},s=()=>{var n;if(Vf(t,e)){c(!0);try{localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())}catch(t){}window.dispatchEvent(new Event("PHSurveyShown")),a||null===(n=e.client)||void 0===n||n.capture(Pd,L(L({[Bd]:t.name,[jd]:t.id,[zd]:t.current_iteration,[Ud]:t.current_iteration_start_date},l&&{[Wd]:l}),{},{sessionRecordingUrl:Jc(e)}))}};me(window,"PHSurveyClosed",p),me(window,"PHSurveySent",o);const u=n>0?setTimeout(s,n):void 0;return G(u)&&s(),()=>{G(u)||clearTimeout(u),G(r)||clearTimeout(r),window.removeEventListener("PHSurveyClosed",p),window.removeEventListener("PHSurveySent",o)}},[]),Pv({survey:t,removeSurveyFromFocus:r,setSurveyVisible:c,isPreviewMode:i,posthog:e}),{isPopupVisible:u,isSurveySent:d,setIsPopupVisible:c,hidePopupWithAnimation:v}}(t,n,(null===(p=t.appearance)||void 0===p?void 0:p.surveyPopupDelaySeconds)?1e3*t.appearance.surveyPopupDelaySeconds:0,I,o,s,T,f,v),O=R||r===t.questions.length||!0===h,[D,F]=dd(!1),P=vd(()=>!!Kf(t),[t]),N=!(!(null===(m=t.appearance)||void 0===m?void 0:m.introScreenHeader)&&!(null===(g=t.appearance)||void 0===g?void 0:g.introScreenDescription)),q=I?-1===r:!!(null===(y=t.appearance)||void 0===y?void 0:y.displayIntroScreen)&&N&&!D&&!P,j=vd(()=>{const e=Kf(t),i=(null==e?void 0:e.surveySubmissionId)||_i()||"";return{isPreviewMode:I,previewPageIndex:r,onPopupSurveyDismissed(){v?qf(t,n,I,v):qf(t,n,I),u()},isPopup:s||!1,surveySubmissionId:i,onPreviewSubmit:a,onPreviewBack:l,posthog:n,properties:d,surveyLanguage:v}},[I,r,s,n,t,u,a,l,d,v]);return A?Qc(Wf.Provider,{value:j,children:Qc("div",{className:"ph-survey",style:L(L({},nv(t.type,null===(b=t.appearance)||void 0===b?void 0:b.position,null===(w=t.appearance)||void 0===w?void 0:w.widgetType)),i),ref:T,children:O?Qc(mv,{header:(null===(k=t.appearance)||void 0===k?void 0:k.thankYouMessageHeader)||"Thank you!",description:(null===(S=t.appearance)||void 0===S?void 0:S.thankYouMessageDescription)||"",forceDisableHtml:!!e,contentType:null===(_=t.appearance)||void 0===_?void 0:_.thankYouMessageDescriptionContentType,appearance:t.appearance||Ef,onClose(){E(),c()}}):q?Qc(gv,{header:(null===(x=t.appearance)||void 0===x?void 0:x.introScreenHeader)||"",description:(null===(C=t.appearance)||void 0===C?void 0:C.introScreenDescription)||"",forceDisableHtml:!!e,contentType:null===(M=t.appearance)||void 0===M?void 0:M.introScreenDescriptionContentType,appearance:t.appearance||Ef,onStart:()=>F(!0)}):Qc(Bv,{survey:t,forceDisableHtml:!!e,posthog:n})})}):null}function Bv({survey:t,forceDisableHtml:e,posthog:n}){var i,r;const o=vd(()=>{const e=Kf(t);if(!e)return null;const n=Y(e.lastQuestionIndex);return!n||n&&e.lastQuestionIndex>=0&&t.questions.length>e.lastQuestionIndex?e:(tv(t),null)},[t]),[s,a]=dd(()=>((null==o?void 0:o.responses)&&Hd.info("Survey is already in progress, filling in initial responses"),(null==o?void 0:o.responses)||{})),[l,u]=dd(!1),{previewPageIndex:c,onPopupSurveyDismissed:d,isPopup:h,onPreviewSubmit:f,onPreviewBack:v,surveySubmissionId:p,isPreviewMode:m,properties:g,surveyLanguage:y}=pd(Wf),[b,w]=dd(()=>{const e=null==o?void 0:o.lastQuestionIndex,n=Y(e)&&e>=0&&t.questions.length>e?e:0;return Y(c)&&c>=0?c:n}),[k,S]=dd(()=>{var e;return(null!==(e=null==o?void 0:o.visitedIndices)&&void 0!==e?e:[]).filter(e=>e>=0&&t.questions.length>e)}),[_,x]=dd(()=>{var e;const n=Kf(t);return null!==(e=null==n?void 0:n.questionSnapshots)&&void 0!==e?e:{}}),C=vd(()=>Bf(zf(t,o)),[t.id,o]),M=vd(()=>{if(!C||new Set(C).size!==C.length)return zf(t,o);const e=new Map(t.questions.map(t=>[t.id,t])),n=C.map(t=>e.get(t)).filter(t=>!!t);return n.length===C.length?n:t.questions},[C,t.questions,t,o]);hd(()=>{!m||G(c)||0>c||w(c)},[c,m]);const T=!!(null===(i=t.appearance)||void 0===i?void 0:i.allowGoBack)&&(m?(null!=c?c:0)>0:k.length>0),I=M.at(b);return I?Qc("form",{className:"survey-form",name:"surveyForm",children:[h&&!0!==(null===(r=t.appearance)||void 0===r?void 0:r.hideCancelButton)&&Qc(pv,{onClick(){d()}}),Qc("div",{className:"survey-box","data-question-index":b,children:[l&&Qc("p",{role:"alert",children:"Your response could not be sent. Please try again later."}),Uv({question:I,forceDisableHtml:e,displayQuestionIndex:b,appearance:t.appearance||Ef,onSubmit:e=>(({res:e,displayQuestionIndex:i,questionId:r})=>{var o;if(!n)return void Hd.error("onNextButtonClick called without a PostHog instance.");if(!(null===(o=n.client)||void 0===o?void 0:o.canCapture))return void u(!0);if(u(!1),!r)return void Hd.error("onNextButtonClick called without a questionId.");const{responses:l,questionSnapshots:c}=function({responses:t,questionSnapshots:e={}},n,i,r){return{responses:L(L({},t),{},{[Ri(n)]:i}),questionSnapshots:(null==r?void 0:r.id)?L(L({},e),{},{[r.id]:r.question}):e}}({responses:s,questionSnapshots:_},r,e,M[i]);a(l),x(c);const d=Rv(t,i,e),h=d===Dd,f=[...k,i];if(h||(S(f),w(d),Yf(t,{surveySubmissionId:p,responses:l,lastQuestionIndex:d,questionOrder:Bf(M),visitedIndices:f,surveyLanguage:y,questionSnapshots:c})),t.enable_partial_responses||h){const e=new Set(f.map(t=>{var e;return null===(e=M[t])||void 0===e?void 0:e.id}).filter(t=>!!t).map(t=>Ri(t))),i=Object.fromEntries(Object.entries(l).filter(([t])=>e.has(t)));Pf({responses:i,survey:t,surveySubmissionId:p,isSurveyCompleted:h,posthog:n,properties:g,surveyLanguage:y,questionSnapshots:c})}})({res:e,displayQuestionIndex:b,questionId:I.id}),onPreviewSubmit:f,initialValue:I.id?s[Ri(I.id)]:void 0,canGoBack:T,onBack(){if(m)return void v();if(0===k.length)return;const e=k[k.length-1],n=k.slice(0,-1);S(n),w(e),Yf(t,{surveySubmissionId:p,responses:s,lastQuestionIndex:e,questionOrder:Bf(M),visitedIndices:n,surveyLanguage:y,questionSnapshots:_})}})]})]}):null}function zv({survey:t,forceDisableHtml:e,posthog:n,readOnly:i,surveyLanguage:r}){var o,s,a,l,u,c,d,h;const[f,v]=dd(!0),[p,m]=dd(!1),[g,y]=dd({}),b=fd(void 0),w=()=>{var t;(p||!n||i||(null===(t=n.client)||void 0===t?void 0:t.canCapture))&&m(!p)};if(hd(()=>{var e,r,o;if(!n)return void Hd.error("FeedbackWidget called without a PostHog instance.");if(i)return;"tab"===(null===(e=t.appearance)||void 0===e?void 0:e.widgetType)&&y((o=null===(r=t.appearance)||void 0===r?void 0:r.position)&&o!==Md&&o!==Td?{}:{top:"50%",bottom:"auto"});const s=e=>{var n;const i=e;(null===(n=i.detail)||void 0===n?void 0:n.surveyId)===t.id&&(Hd.info(`Received show event for feedback button survey ${t.id}`),y(i.detail.position||{}),w())};return me(window,$v,s),()=>{G(b.current)||(clearTimeout(b.current),b.current=void 0),window.removeEventListener($v,s)}},[n,i,t.id,null===(o=t.appearance)||void 0===o?void 0:o.widgetType,null===(s=t.appearance)||void 0===s?void 0:s.position,null===(a=t.appearance)||void 0===a?void 0:a.widgetSelector,null===(l=t.appearance)||void 0===l?void 0:l.borderColor]),Pv({survey:t,setSurveyVisible:v,posthog:n}),!f)return null;const k=()=>{t.schedule!==Fd&&v(!1),G(b.current)||clearTimeout(b.current),b.current=setTimeout(()=>{b.current=void 0,m(!1)},200)};return Qc(Mc,{children:["tab"===(null===(u=t.appearance)||void 0===u?void 0:u.widgetType)&&Qc("button",{className:"ph-survey-widget-tab "+("top"===(null===(c=t.appearance)||void 0===c?void 0:c.tabPosition)?"widget-tab-top":""),onClick:w,disabled:i,style:qv(null===(d=t.appearance)||void 0===d?void 0:d.tabPosition),children:(null===(h=t.appearance)||void 0===h?void 0:h.widgetLabel)||""}),p&&Qc(jv,{posthog:n,survey:t,forceDisableHtml:e,style:g,onPopupSurveyDismissed:k,onCloseConfirmationMessage:k,surveyLanguage:r})]})}const Uv=({question:t,forceDisableHtml:e,displayQuestionIndex:n,appearance:i,onSubmit:r,onPreviewSubmit:o,initialValue:s,canGoBack:a,onBack:l})=>{const u={forceDisableHtml:e,appearance:i,onPreviewSubmit(t){o(t)},onSubmit(t){r(t)},initialValue:s,displayQuestionIndex:n,canGoBack:a,onBack:l};switch(t.type){case Ed:return xc(bv,L(L({},u),{},{question:t,key:t.id}));case"link":return xc(wv,L(L({},u),{},{question:t,key:t.id}));case Ld:return xc(kv,L(L({},u),{},{question:t,key:t.id}));case $d:case Od:return xc(_v,L(L({},u),{},{question:t,key:t.id}));default:return Hd.error(`Unsupported question type: ${t.type}`),null}};function Wv(t){let e=!0;return{dispose(){if(e){e=!1;const n=t();n&&W(n.then)&&n.then(void 0,()=>{})}}}}function Hv(t,e){return e.length>t?e.slice(0,t)+"...":e}function Gv(t){if(t.previousElementSibling)return t.previousElementSibling;let e=t;do{e=e.previousSibling}while(e&&!Se(e));return e}function Vv(t,{e:e,maskAllElementAttributes:n,maskAllText:i,elementAttributeIgnoreList:r,elementsChainAsString:o,disableCaptureUrlHashes:s}){var a,l;if(!Se(t))return{props:{}};const u=[t],c=new Set([t]);let d=t;for(;!_e(d,"body")&&1e3>u.length;){const t=d.assignedSlot||d.parentNode,e=xe(t)?t.host:t&&Se(t)?t:null;if(!e||c.has(e))break;c.add(e),u.push(e),d=e}const h="click"===e.type&&"http://www.w3.org/2000/svg"===t.namespaceURI?u.findIndex(t=>_e(t,"button")||_e(t,"a")):-1;h>0&&(i=i||u.slice(0,h+1).some(t=>!Pe(t)||Ne(t)));const f=[],v={};let p,m=!1,g=!1;if(fe(u,t=>{const e=Pe(t);if(e&&_e(t,"a")&&!n&&!(null==r?void 0:r.includes("href"))){const n=t.getAttribute("href");m=!!(e&&n&&Ge(n))&&(s?St(n):n)}N(Me(t),"ph-no-capture")&&(g=!0),f.push(function(t,e,n,i,r=!1){const o=t.tagName.toLowerCase(),s={tag_name:o};Ae.indexOf(o)>-1&&!n&&(s.$el_text="a"===o.toLowerCase()||"button"===o.toLowerCase()?Hv(1024,Ve(t)):Hv(1024,Te(t)));const a=Me(t);e||(null==i?void 0:i.includes("class"))||0>=a.length||(s.classes=a.filter(function(t){return""!==t})),fe(Fe(t)?[]:t.attributes,function(n){var o;if((!Ne(t)||-1!==["name","id","class","aria-label"].indexOf(n.name))&&!(null==i?void 0:i.includes(n.name))&&!e&&Ge(n.value)&&(!V(o=n.name)||"_ngcontent"!==o.substring(0,10)&&"_nghost"!==o.substring(0,7))){let t=n.value;"class"===n.name&&(t=Ce(t).join(" ")),s["attr__"+n.name]=Hv(1024,"href"===n.name&&r?St(t):t)}});let l=1,u=1,c=t;for(;c=Gv(c);)l++,c.tagName===t.tagName&&u++;return s.nth_child=l,s.nth_of_type=u,s}(t,n,i,r,s)),fe(function(t){if(!Pe(t))return{};const e={};return fe(t.attributes,function(t){if(t.name&&0===t.name.indexOf("data-ph-capture-attribute")){const n=t.name.replace("data-ph-capture-attribute-",""),i=t.value;n&&i&&Ge(i)&&(e[n]=i)}}),e}(t),(t,e)=>{({}).hasOwnProperty.call(v,e)||(v[e]=t)})}),g)return{props:{},explicitNoCapture:g};if(h>0&&(t=u[h],f.splice(0,h)),i||(f[0].$el_text=_e(t,"a")||_e(t,"button")?Ve(t):Te(t)),m){var y,b;f[0].attr__href=m;const t=null===(y=ge(m))||void 0===y?void 0:y.host,e=null===(b=typeof window>"u"?void 0:window)||void 0===b||null===(b=b.location)||void 0===b?void 0:b.host;t&&e&&t!==e&&(p=m)}return{props:ve((k=e.type,{$event_type:k,$ce_version:1}),o?{}:{$elements:f},{$elements_chain:(w=f,U(w)?function(t){return t.map(t=>{var e,n;let i="";if(t.tag_name&&(i+=t.tag_name),t.attr_class){t.attr_class.sort();for(const e of t.attr_class)i+=`.${e.replace(/"/g,"")}`}const r=L(L(L(L({},t.text?{text:t.text}:{}),{},{"nth-child":null!==(e=t.nth_child)&&void 0!==e?e:0,"nth-of-type":null!==(n=t.nth_of_type)&&void 0!==n?n:0},t.href?{href:t.href}:{}),t.attr_id?{attr_id:t.attr_id}:{}),t.attributes),o={};return pe(r).sort(([t],[e])=>function(t,e){return e>t?-1:t>e?1:0}(t,e)).forEach(([t,e])=>o[Ze(t.toString())]=Ze(e.toString())),i+=":",i+=pe(o).map(([t,e])=>`${t}="${e}"`).join(""),i}).join(";")}(function(t){return t.map(t=>{var e,n;const i={text:null===(e=t.$el_text)||void 0===e?void 0:e.slice(0,400),tag_name:t.tag_name,href:null===(n=t.attr__href)||void 0===n?void 0:n.slice(0,2048),attr_class:Je(t),attr_id:t.attr__id,nth_child:t.nth_child,nth_of_type:t.nth_of_type,attributes:{}};return pe(t).filter(([t])=>0===t.indexOf("attr__")).forEach(([t,e])=>i.attributes[t]=e),i})}(w)):"")},(null===(a=f[0])||void 0===a?void 0:a.$el_text)?{$el_text:null===(l=f[0])||void 0===l?void 0:l.$el_text}:{},p&&"click"===e.type?{$external_click_url:p}:{},v),target:t};var w,k}const Qv="logs";A(function*(t){const e=yield oe(be(t.data),Ti.DEBUG,{rethrow:!0});if(!e)return t;const n=yield e.arrayBuffer();return L(L({},t),{},{Mr:{contentType:"text/plain",body:n,estimatedSize:n.byteLength}})});const Zv=()=>{var e;return(null==t||null===(e=t.performance)||void 0===e?void 0:e.now)?t.performance.now():Date.now()},Jv=[],Yv=[50,75,100,150,200,300,400,500,750,1e3,1500,2e3,3e3,5e3,1e4],Kv=[5,10,25,...Yv];var Xv=class{constructor(t){this._instance=t}initialize(){}get(t){const e=this._instance.persistence;if("string"==typeof t)return null==e?void 0:e.get_property(t);const n={};for(const i of t){const t=null==e?void 0:e.get_property(i);G(t)||(n[i]=t)}return n}set(t,e){var n;null===(n=this._instance.persistence)||void 0===n||n.register("string"==typeof t?{[t]:e}:t)}remove(t){var e;null===(e=this._instance.persistence)||void 0===e||e.unregister(t)}},tp=class{constructor(t){this.instance=t,this.R=de,this.kv=new Xv(t),this.onSession=t=>Wv(this.instance.onSessionId(e=>{try{t(e)}catch(t){this.R.error("Browser extension session listener failed",t)}})),this.onEvent=t=>Wv(this.instance._addCaptureHook((e,n)=>{if(n)try{t({event:e,properties:n.properties})}catch(t){this.R.error("Browser extension event listener failed",t)}})),this.onRemoteConfig=t=>{const e=e=>{try{t(e)}catch(t){this.R.error("Browser extension remote config listener failed",t)}},n=this.instance.Tr.on("extensionsRemoteConfig",e);return this.instance.Ir&&e(this.instance.Ir),Wv(n)}}get logger(){return this.R}get distinctId(){return this.instance.get_distinct_id()}get anonymousId(){var t;return null!==(t=this.instance.get_property("$device_id"))&&void 0!==t?t:this.distinctId}get deviceId(){const t=this.instance.get_property("$device_id");return"string"==typeof t?t:void 0}get library(){return{name:Ti.LIB_NAME,version:Ti.LIB_VERSION}}get initialPersonProperties(){var t,e;return null!==(t=null===(e=this.instance.persistence)||void 0===e?void 0:e.get_initial_props())&&void 0!==t?t:{}}get groups(){return this.instance.getGroups()}get session(){try{var t,e,n,i,r;const o=null===(t=this.instance.sessionManager)||void 0===t?void 0:t.checkAndGetSessionAndWindowId(!0);return{sessionId:null!==(e=null==o?void 0:o.sessionId)&&void 0!==e?e:"",windowId:null!==(n=null==o?void 0:o.windowId)&&void 0!==n?n:"",sessionStartTimestamp:null!==(i=null==o?void 0:o.sessionStartTimestamp)&&void 0!==i?i:0,lastActivityTimestamp:null!==(r=null==o?void 0:o.lastActivityTimestamp)&&void 0!==r?r:0}}catch(t){return{sessionId:"",windowId:"",sessionStartTimestamp:0,lastActivityTimestamp:0}}}get isOptedOut(){return this.instance.has_opted_out_capturing()}get canCapture(){return W(this.instance.is_capturing)?this.instance.is_capturing():!this.isOptedOut}get isRateLimited(){var t;return!!(null===(t=this.instance.rateLimiter)||void 0===t?void 0:t.isClientRateLimited)}get projectToken(){return this.instance.config.token}getExtension(t){let e;switch(t){case"featureFlags":case Zc:e=this.instance.featureFlags;break;case Qv:e=this.instance.logs;break;case"surveys":e=this.instance.surveys;break;case"autocapture":e=this.instance.autocapture}return e}capture(t,e,n){if(!n)return this.Ar(this.instance.capture(t,e));const i=L(L({timestamp:n.timestamp,uuid:n.uuid,$set:n.set,$set_once:n.setOnce},"unload"===n.delivery?{transport:"sendBeacon",send_instantly:!0}:{}),"immediate"===n.delivery?{send_instantly:!0}:{});return this.Ar(this.instance.capture(t,e,i))}Ar(t){var e;return!G(t)||!(null===(e=this.instance.rateLimiter)||void 0===e?void 0:e.lastEventRateLimited)}registerDynamicEventProperties(t){return Wv(this.instance.Rr(t))}sendRequest(e){var n=this;return A(function*(e,i={}){var r;const o=null!==(r=i.target)&&void 0!==r?r:"api",s=i.query?((t,e,n=!0)=>{const i=t.indexOf("#"),r=-1===i?"":t.slice(i),o=-1===i?t:t.slice(0,i),s=o.indexOf("?"),a=-1===s?o:o.slice(0,s),l=-1===s?"":o.slice(s+1),u=L({},e),c=l.split("&").filter(t=>""!==t).map(t=>{const e=t.indexOf("="),i=-1===e?t:t.slice(0,e),r=n?u[i]:void 0;return delete u[i],J(r)?t:`${i}=${r}`}),d=we(u);return d&&c.push(d),`${c.length>0?`${a}?${c.join("&")}`:a}${r}`})(e,i.query):e,a=n.instance.requestRouter.endpointFor(o,s),l={method:i.method,url:a,data:i.body,headers:i.headers,timeout:i.timeoutMs,fireCallbackOnDrop:!0,transport:i.transport,compression:i.compression,compressionFallback:"flags"===i.target&&"best-available"===i.compression?D.Base64:void 0,timestampMode:i.sentAt};return"api"===o&&"/i/v1/logs"===e&&(l.batchKey="logs"),"sendBeacon"===i.transport?(n.instance._send_request(l),{statusCode:202}):new Promise(e=>{var i;if(l.callback=e,"flags"===o&&(null===(i=n.instance.config.metrics)||void 0===i?void 0:i.flags)){let i,r;l.onDispatch=()=>{i=Zv()},l.onSend=e=>{r=(e=>{try{return(e=>{var n;const i=null==t?void 0:t.PerformanceObserver,r=null===(n=ge(e))||void 0===n?void 0:n.href;if(!i||!r)return;const o=Zv(),s={name:r,before:1/0,inFlight:!0};let a,l,u,c=1/0,d=!1;const h=()=>{d||(d=!0,clearTimeout(u),p.disconnect(),Jv.splice(Jv.indexOf(s),1))};let f=!1;const v=t=>{for(const e of t){const t=e.startTime;e.name!==r||(f?o>=t:o>t)||t>=s.before||a&&t>=a.startTime||(a=e)}if(a&&l&&c>=a.startTime){const t=l;h(),t(a)}},p=new i(t=>v(t.getEntriesByName(r,"resource")));p.observe({entryTypes:["resource"]});for(const t of Jv)t.name===r&&(t.before=Math.min(t.before,o),f=f||t.inFlight);return Jv.push(s),{take(t,e){d||(c=t,s.inFlight=!1,l=e,u=setTimeout(h,5e3),W(p.takeRecords)&&v(p.takeRecords()))},stop:h}})(e)}catch(t){return}})(e)},l.callback=t=>{if(e(t),G(i))return;const o=i,s=Zv();try{const e=((t,e)=>{var n,i;const r=e.statusCode||void 0,o={"server.address":(null!==(n=null===(i=ge(t))||void 0===i?void 0:i.hostname)&&void 0!==n?n:t).replace(/^\[(.*)\]$/,"$1")};r&&(o["http.response.status_code"]=r);const s=((t,e)=>t?400>t?void 0:String(t):"AbortError"===(null==e?void 0:e.name)?"timeout":"_OTHER")(r,e.error);s&&(o["error.type"]=s);const a=function(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(t){return}}();return a&&(o["client.timezone"]=a),o})(a,t);if(n.Er("posthog.flags.request.duration",s-o,Yv,e),t.statusCode&&r)return void r.take(s,t=>n.Or(t,o,s,e))}catch(t){de.error("Failed to record the /flags request timing",t)}null==r||r.stop()}}n.instance._send_request(l)})}).apply(this,arguments)}Or(t,e,n,i){if(t.responseEnd>=t.startTime)try{const r=Math.min(t.responseEnd,n);this.Er("posthog.flags.request.pre_send_duration",t.startTime-e,Kv,i),this.Er("posthog.flags.request.network_duration",r-t.startTime,Yv,i),this.Er("posthog.flags.request.main_thread_duration",n-r,Kv,i)}catch(t){de.error("Failed to record the /flags request timing split",t)}}Er(t,e,n,i){var r;null===(r=this.instance.metrics)||void 0===r||r.histogram(t,e,{unit:"ms",attributes:L({},i),bounds:n})}},ep=class{constructor(t){this._instance=t}get(){var t,e,n,i;const r=null===(t=this._instance)||void 0===t?void 0:t.config;return{disableSurveys:!!(null==r?void 0:r.disable_surveys),cookielessMode:!!(null==r?void 0:r.cookieless_mode),advancedEnableSurveys:!!(null==r?void 0:r.advanced_enable_surveys),requestTimeoutMs:null!==(e=null==r?void 0:r.surveys_request_timeout_ms)&&void 0!==e?e:1e4,prefillFromUrl:!!(null==r||null===(n=r.surveys)||void 0===n?void 0:n.prefillFromUrl),automaticDisplay:!(null==r?void 0:r.disable_surveys_automatic_display),featureFlagEvaluation:!(null==r?void 0:r.advanced_disable_feature_flags),overrideLanguage:null==r?void 0:r.override_display_language,prepareStylesheet:null==r?void 0:r.prepare_external_dependency_stylesheet,get_current_url:null==r?void 0:r.get_current_url,uiHost:null===(i=this._instance)||void 0===i||null===(i=i.requestRouter)||void 0===i?void 0:i.endpointFor("ui","")}}getExtensions(){const t=null==o?void 0:o.__PosthogExtensions__;if(!t||!this._instance)return;const e=this._instance,{generateSurveys:n}=t,i=(null==(r=e)?void 0:r.config.require_subresource_integrity)?r.__loadExternalDependency:null===(s=o.__PosthogExtensions__)||void 0===s?void 0:s.loadExternalDependency;var r,s;return{generateSurveys:n?t=>n(e,t):void 0,loadExternalDependency:i?t=>i(e,"surveys",t):void 0}}onMatchingConditionsChanged(e){var n,i;const r=null===(n=this._instance)||void 0===n?void 0:n._addCaptureHook(t=>{"$pageview"!==t&&t!==Pd&&t!==Nd&&t!==qd||e()}),o=()=>e();me(t,"PHSurveyShown",o);let s=!1;const a=null===(i=this._instance)||void 0===i?void 0:i.onFeatureFlags(()=>{s&&e()});return s=!0,()=>{s=!1,null==r||r(),null==a||a(),null==t||t.removeEventListener("PHSurveyShown",o)}}};const np=new WeakMap,ip=(t,e)=>{const n=function(t){var e;const n=new ep(t);if(!t)return{get config(){return n.get()}};if(null===(e=t.surveys)||void 0===e?void 0:e.getRenderContext)return t.surveys.getRenderContext();let i=np.get(t);return i||(i={client:new tp(t),get config(){return n.get()},surveys:t.surveys},np.set(t,i)),i}(t);return n?function(t,e){if(typeof document>"u"||typeof window>"u")return;const n=new Fv(t);return!1===t.config.automaticDisplay?(Hd.info("Surveys automatic display is disabled. Skipping call surveys and evaluate display logic."),n):!1===e?(Hd.info("There are no surveys to load or Surveys is disabled in the project settings."),n):(n.startAutomaticDisplay(),n)}(n,e):void 0};o.__PosthogExtensions__=o.__PosthogExtensions__||{},o.__PosthogExtensions__.generateSurveys=ip,o.extendPostHogWithSurveys=ip;const rp=t=>{for(;null==t?void 0:t.__rrweb_original__;)t=t.__rrweb_original__;return t},op=1e4,sp=(t,e,n)=>n.remaining>0?e.length>n.remaining?(t.push(e.slice(0,n.remaining)),n.remaining=0,n.truncated=!0,!1):(t.push(e),n.remaining-=e.length,!0):(n.truncated=!0,!1),ap=(t,e,n)=>{const i=JSON.stringify(t);if(n.remaining>=i.length)return sp(e,i,n);if(n.truncated=!0,2>n.remaining)return!1;let r=0,o=Math.min(t.length,n.remaining-2);for(;o>r;){const e=Math.ceil((r+o)/2);JSON.stringify(t.slice(0,e)).length>n.remaining?o=e-1:r=e}return sp(e,JSON.stringify(t.slice(0,r)),n)},lp=t=>void 0!==t&&"function"!=typeof t&&"symbol"!=typeof t&&"bigint"!=typeof t,up=(t,e,n)=>{if(!n.truncated){if(n.keysRemaining-=1,n.sizeRemaining-=String(e).length+t.length,0>=n.keysRemaining||0>=n.sizeRemaining)return n.truncated=!0,void(n.result.attributes_truncated=!0);n.result[t]=e}},cp=(t,e,n)=>{if(!n.truncated)if(H(t)){if(n.seen.has(t))return void up(e||"circular","[Circular]",n);n.seen.add(t);try{for(const i in t)try{if(!{}.hasOwnProperty.call(t,i))continue;if(cp(t[i],e?`${e}.${i}`:i,n),n.truncated)break}catch(t){continue}}catch(t){}}else up(e,t,n)},dp=(t,e,n,i,r=!1,o)=>{if(!lp(t))return!r||sp(e,"null",n);if(Z(t)||(t=>{try{return Y(t)||K(t)}catch(t){return!1}})(t))return sp(e,JSON.stringify(t),n);if("string"==typeof t)return ap(t,e,n);if(!H(t)&&!U(t))return sp(e,JSON.stringify(t),n);if(i.has(t))return ap("[Circular]",e,n);i.add(t);try{const o=t.toJSON;if(W(o))return dp(o.call(t),e,n,i,r)}catch(t){}try{const i={}.toString.call(t);if("[object String]"===i)return ap(String(t.valueOf()),e,n);if("[object Number]"===i||"[object Boolean]"===i)return sp(e,JSON.stringify(t.valueOf()),n)}catch(t){}if(t instanceof Error){const s={};try{for(const e in t)({}).hasOwnProperty.call(t,e)&&(s[e]=t[e])}catch(t){}try{s.name=t.name}catch(t){}try{s.message=t.message}catch(t){}try{s.stack=t.stack}catch(t){}return dp(s,e,n,i,r,o)}if(U(t)){if(!sp(e,"[",n))return!1;for(let r=0;t.length>r;r++){if(r>0&&!sp(e,",",n))return!1;let o;try{o=t[r]}catch(t){o=void 0}if(!dp(o,e,n,i,!0))return!1}return sp(e,"]",n)}if(!sp(e,"{",n))return!1;let s=!0;try{for(const r in t){if(!{}.hasOwnProperty.call(t,r))continue;if(0>=n.remaining)return n.truncated=!0,!1;let a;try{a=t[r]}catch(t){continue}if(o)try{cp(a,r,o)}catch(t){}if(!lp(a))continue;const l=`${s?"":","}${JSON.stringify(r)}:`;if(l.length>=n.remaining)return n.truncated=!0,!1;const u=e.length,c=n.remaining,d=n.truncated;if(!sp(e,l,n))return!1;const h=e.length,f=dp(a,e,n,i,!1),v=n.truncated;if(e.length!==h){if(s=!1,!f)return!1}else if(e.length=u,n.remaining=c,n.truncated=f?d:v,!f)return!1}}catch(t){}return sp(e,"}",n)},hp=(t,e)=>{const n=[],i={remaining:e,truncated:!1},r=H(t[0])?{result:{},keysRemaining:50,sizeRemaining:op,truncated:!1,seen:new WeakSet([t[0]])}:void 0;for(let e=0;t.length>e&&(0>=e||sp(n," ",i))&&dp(t[e],n,i,new WeakSet,!1,0===e?r:void 0);e++);return{body:n.join("")+(i.truncated?"...":""),truncated:i.truncated,attributes:(null==r?void 0:r.result)||{}}},fp={debug:"debug",log:"info",warn:"warn",error:"error",info:"info"},vp=t=>"canCapture"in t,pp=t=>({console:o.console,hostname:o.location.host,getCapturingLogs(){let e;return e=vp(t)?t.canCapture?t.getExtension(Qv):void 0:(W(t.is_capturing)?t.is_capturing():!t.has_opted_out_capturing())?t.logs:void 0,e?{captureConsoleLog:n=>((t,e,n)=>{if(vp(t))return void e.captureConsoleLog(n);const i=(t=>{const e=/^1\.(\d+)\.(\d+)$/.exec(t);if(!e)return;const n=Number(e[1]),i=Number(e[2]);return 392>n||n>419?void 0:410===n?i>4?i>10?void 0:"de":"le":418===n?i>3?i>10?i>14?i>17?void 0:"vi":"ci":"ui":"he":419===n?i>2?void 0:"vi":410>n?"le":"he"})(t.version),r=i?e[i]:void 0;i?W(r)&&r.call(e,n):W(e.captureConsoleLog)&&e.captureConsoleLog(n)})(t,e,n),captureBufferedConsoleLog(t,n,i){var r;return null===(r=e.captureBufferedConsoleLog)||void 0===r?void 0:r.call(e,t,n,i)}}:void 0}});o.__PosthogExtensions__=o.__PosthogExtensions__||{},o.__PosthogExtensions__.logs={initializeLogs:t=>(t=>{const e=t.console;let n=t;const i=[],r={host:t.hostname};let o=!1;const s=()=>{n=void 0;for(const t of i)try{t()}catch(t){}};try{for(const t of Object.keys(fp)){const s=i=>(...s)=>{let a=!1;try{if(s.length>0&&!o&&n){const e=n.getCapturingLogs();if(e){o=!0,a=!0;const{body:n,truncated:i,attributes:l}=hp(s,op),u=L(L({},r),i?{body_truncated:"true"}:{}),c={level:fp[t],body:n,attributes:L(L({"log.source":`console.${t}`},u),l)};e.captureConsoleLog(c)}}}catch(t){}finally{a&&(o=!1),i.apply(e,s)}},a=e[t];i.push(Mu(e,t,t=>{const e=s(t);return e.__rrweb_original__=rp(a),e}))}}catch(t){throw s(),t}return s})(pp(t)),replayConsoleBuffer:(t,e)=>((t,e)=>{const n=t.getCapturingLogs();if(n)for(const r of e)try{var i;const{body:e,truncated:o,attributes:s}=hp(r.args,op);null===(i=n.captureBufferedConsoleLog)||void 0===i||i.call(n,{level:fp[r.level],body:e,attributes:L(L({"log.source":`console.${r.level}`,host:t.hostname},o?{body_truncated:"true"}:{}),s)},r.context,r.occurredAtMs)}catch(t){}})(pp(t),e)};const mp=he("[ExceptionAutocapture]"),gp=new class{constructor(t,e,n=[]){this.coercers=t,this.stackParser=e,this.modifiers=n}buildFromUnknown(t,e={}){const n=e&&e.mechanism||{handled:!0,type:"generic"},i=this.buildCoercingContext(n,e,0).apply(t),r=this.buildParsingContext(e),o=this.parseStacktrace(i,r);return{$exception_list:this.convertToExceptionList(o,n),$exception_level:"error"}}modifyFrames(t){var e=this;return A(function*(){for(const n of t)n.stacktrace&&n.stacktrace.frames&&U(n.stacktrace.frames)&&(n.stacktrace.frames=yield e.applyModifiers(n.stacktrace.frames));return t})()}coerceFallback(t){var e;return{type:"Error",value:"Unknown error",stack:null===(e=t.syntheticException)||void 0===e?void 0:e.stack,synthetic:!0}}parseStacktrace(t,e){var n;let i,r;if(null!=t.cause&&(i=this.parseStacktrace(t.cause,e)),""!=t.stack&&null!=t.stack)try{r=this.applyChunkIds(this.stackParser(t.stack,t.synthetic?e.skipFirstLines:0),e.chunkIdMap)}catch(t){}return L(L({},t),{},{cause:i,stack:r,errors:null===(n=t.errors)||void 0===n?void 0:n.map(t=>this.parseStacktrace(t,e))})}applyChunkIds(t,e){return t.map(t=>(t.filename&&e&&(t.chunk_id=e[t.filename]),t))}applyCoercers(t,e){for(const n of this.coercers)if(n.match(t))return n.coerce(t,e);return this.coerceFallback(e)}applyModifiers(t){var e=this;return A(function*(){let n=t;for(const t of e.modifiers)n=yield t(n);return n})()}convertToExceptionList(t,e){const n=[],i=(t,r,o)=>{var s;const a=n.length,l=void 0===r?L(L({type:"string"==typeof e.type&&e.type.length>0?e.type:"generic"},"boolean"==typeof e.handled?{handled:e.handled}:void 0===e.handled?{handled:!0}:{}),{},{synthetic:"boolean"==typeof e.synthetic?e.synthetic:t.synthetic,exception_id:a}):{type:"chained",source:o,synthetic:t.synthetic,exception_id:a,parent_id:r},u={type:t.type,value:t.value,mechanism:l};t.stack&&(u.stacktrace={type:"raw",frames:t.stack}),n.push(u),t.cause&&i(t.cause,a,"cause");for(const e of null!==(s=t.errors)&&void 0!==s?s:[])i(e,a,"member")};return i(t),n}buildParsingContext(t){var e;return{chunkIdMap:It(this.stackParser),skipFirstLines:null!==(e=t.skipFirstLines)&&void 0!==e?e:1}}getAggregateErrors(t){try{if(nt(t)){let n=Object.getPrototypeOf(t);for(let i=0;n&&100>i;i++){var e;const i=null===(e=Object.getOwnPropertyDescriptor(n,"constructor"))||void 0===e?void 0:e.value;if("function"==typeof i&&"AggregateError"===i.name){const e=t.errors;return U(e)?e:void 0}n=Object.getPrototypeOf(n)}}}catch(t){}}buildCoercingContext(t,e,n=0){let i=0,r=0,o=!1;const s=new Set,a=[],l={},u=(t,e,n=0)=>{const u=c(e,n),d=u.apply;if(u.apply=e=>{a.push(t);try{return d(e)}finally{a.pop()}},n>4||n>0&&-1!==a.indexOf(t))return this.coerceFallback(u);const h="object"==typeof t&&null!==t||"function"==typeof t;if(0===n&&i>=50||h&&s.has(t))return;h&&s.add(t),0===n&&i++;const f=this.getAggregateErrors(t);let v,p;o||(o=!!f);try{if(v=this.applyCoercers(t,u),!v)throw l}catch(t){if(t===l)return void(0===n&&i--);if(!o)throw t;v=this.coerceFallback(u)}if(!f||i>=50)return v;try{p=f.length}catch(t){return v}if(!Number.isInteger(p)||0>p||p>4294967295)return v;const m=[];for(let t=0;50>i&&1e3>r&&p>t;t++){let n;r++;try{n=u.next(f[t])}catch(t){i++,n=this.coerceFallback(c(e+1))}n&&m.push(n)}return L(L({},v),{},{errors:m})},c=(n,i=0)=>L(L({},e),{},{syntheticException:0==n?e.syntheticException:void 0,mechanism:0==n?t:{},apply(t){const e=u(t,n,i+1);if(!e)throw l;return e},next:t=>u(t,n+1)}),d=c(n);return L(L({},d),{},{apply:t=>{var e;return null!==(e=u(t,n))&&void 0!==e?e:this.coerceFallback(d)}})}}([new class{match(t){return this.isDOMException(t)||this.isDOMError(t)}coerce(t,e){const n=V(t.stack);return{type:this.getType(t),value:this.getValue(t),stack:n?t.stack:void 0,cause:t.cause?e.next(t.cause):void 0,synthetic:!1}}getType(t){return this.isDOMError(t)?"DOMError":"DOMException"}getValue(t){const e=t.name||(this.isDOMError(t)?"DOMError":"DOMException");return t.message?`${e}: ${t.message}`:e}isDOMException(t){return et(t,"DOMException")}isDOMError(t){return et(t,"DOMError")}},new class{match(t){return et(t,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(t)}isCustomEventWrappingRejection(t){if(!it(t))return!1;try{const e=t.detail;return null!=e&&"object"==typeof e&&"reason"in e}catch(t){return!1}}coerce(t,e){var n;const i=this.getUnhandledRejectionReason(t);return tt(i)?{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(i)}`,stack:null===(n=e.syntheticException)||void 0===n?void 0:n.stack,synthetic:!0}:e.apply(i)}getUnhandledRejectionReason(t){try{if("reason"in t)return t.reason;if("detail"in t&&null!=t.detail&&"object"==typeof t.detail&&"reason"in t.detail)return t.detail.reason}catch(t){}return t}},new class{match(t){return!!et(t,"ErrorEvent")&&(null!=t.error||this.$r(t))}coerce(t,e){var n;if(null!=t.error)return e.apply(t.error);const i=e.apply(t.message);return L(L({},i),{},{stack:null!==(n=this.Lr(t))&&void 0!==n?n:i.stack,synthetic:!0})}$r(t){return V(t.message)&&t.message.length>0}Lr(t){var e,n;const i=t,r=null!==(e=i.lineno)&&void 0!==e?e:0,o=null!==(n=i.colno)&&void 0!==n?n:0;if(V(i.filename)&&0!==i.filename.length&&0!==r)return`Error\n at ${i.filename}:${r}:${o}`}},new class{match(t){return nt(t)}coerce(t,e){var n;const i=this.getStack(t),r=void 0===i?null===(n=e.syntheticException)||void 0===n?void 0:n.stack:void 0,o=!!r;return{type:this.getType(t),value:this.getMessage(t,e),stack:null!=i?i:r,cause:t.cause?e.next(t.cause):void 0,synthetic:o}}getType(t){return t.name||t.constructor.name}getMessage(t,e){const n=t.message;return String(n.error&&"string"==typeof n.error.message?n.error.message:n)}getStack(t){try{const e=t.stacktrace;if("string"==typeof e&&e.length>0)return e;const n=t.stack;return"string"==typeof n&&n.length>0?n:void 0}catch(t){return}}},new class{match(t){return it(t)}coerce(t,e){var n;const i=t.constructor.name;return{type:i,value:`${i} captured as exception with keys: ${Kt(t)}`,stack:null===(n=e.syntheticException)||void 0===n?void 0:n.stack,synthetic:!0}}},new class{match(t){return"object"==typeof t&&null!==t}coerce(t,e){var n,i;const r=this.getErrorPropertyFromObject(t);return r?e.apply(r):{type:this.getType(t),value:this.getValue(t),stack:null!==(n=this.getStack(t))&&void 0!==n?n:null===(i=e.syntheticException)||void 0===i?void 0:i.stack,level:this.isSeverityLevel(t.level)?t.level:"error",synthetic:!0}}getType(t){if(it(t))return t.constructor.name;const e="name"in t?t.name:void 0;return V(e)&&!Q(e)?e:"Error"}getValue(t){if("name"in t&&"string"==typeof t.name){let e=`'${t.name}' captured as exception`;return"message"in t&&"string"==typeof t.message&&(e+=` with message: '${t.message}'`),e}if("message"in t&&"string"==typeof t.message)return t.message;const e=this.getObjectClassName(t);return`${e&&"Object"!==e?`'${e}'`:"Object"} captured as exception with keys: ${Kt(t)}`}isSeverityLevel(t){return V(t)&&!Q(t)&&Yt.indexOf(t)>=0}getStack(t){try{return V(t.stacktrace)&&t.stacktrace.length>0?t.stacktrace:V(t.stack)&&t.stack.length>0?t.stack:void 0}catch(t){return}}getErrorPropertyFromObject(t){for(const e in t)if({}.hasOwnProperty.call(t,e)){const n=t[e];if(nt(n))return n}}getObjectClassName(t){try{const e=Object.getPrototypeOf(t);return e?e.constructor.name:void 0}catch(t){return}}},new class{match(t){return"string"==typeof t}coerce(t,e){var n;const[i,r]=this.getInfos(t);return{type:null!=i?i:"Error",value:null!=r?r:t,stack:null===(n=e.syntheticException)||void 0===n?void 0:n.stack,synthetic:!0}}getInfos(t){let e="Error",n=t;const i=t.match(Jt);return i&&(e=i[1],n=i[2]),[e,n]}},new class{match(t){return tt(t)}coerce(t,e){var n;return{type:"Error",value:`Primitive value captured as exception: ${String(t)}`,stack:null===(n=e.syntheticException)||void 0===n?void 0:n.stack,synthetic:!0}}}],function(t,...e){return(n,i=0)=>{const r=[],o=n.split("\n"),s=Math.min(o.length,i+1e3),a=[];for(let n=i;s>n;n++){const i=o[n];if(i.length>1024)continue;const s=zt.test(i)?i.replace(zt,"$1"):i;if(!s.match(/\S*Error: /)){for(const n of e){const e=n(s,t);if(e){r.push(e);const t=Wt(r);if(t){for(let e=a.length-1;e>=0;e--){const n=a[e];if(t.start>=n.start+n.length)break;a.pop()}a.push(t)}break}}if(Qt(r,a)>=50)break}}const l=[...a].sort((t,e)=>e.start-t.start),u=l[l.length-1];if(u){const t=Gt(r,u);r.splice(u.start-t,t);for(const e of l)e.start-=t}for(const t of l)Ht(r,t);return a.some(t=>0===t.start&&r.length===t.length)&&function(t){const e=t.map(t=>`${t.function}|${t.filename}|${t.lineno}|${t.colno}|${t.module}`);let n=0;for(let t=1;e.length>t;t++)Zt(e,t,n)&&(n=t);t.push(...t.splice(0,n))}(r),function(t){if(!t.length)return[];const e=Array.from(t);return e.reverse(),e.slice(0,50).map(t=>{return L(L({},t),{},{filename:t.filename||(n=e,n[n.length-1]||{}).filename,function:t.function||"?"});var n})}(r)}}("web:javascript",Nt,Bt)),yp=(t,e)=>{try{return t()}catch(t){return e}},bp=t=>{var e;return W(t)?null!==(e=t.__posthog_layer__)&&void 0!==e?e:t.__rrweb_layer__:void 0},wp=(t,e)=>yp(()=>t(e()),void 0),kp=t=>yp(()=>W(t)&&W(t.call),!1),Sp=(t,e)=>yp(()=>{t.__POSTHOG_INSTRUMENTED__=!0,Object.defineProperty(t,"__posthog_layer__",{enumerable:!1,value:e})},void 0),_p=(t,e,n,i)=>{yp(()=>{delete n.__POSTHOG_INSTRUMENTED__},void 0),yp(()=>{const r=t[e];if(r===n)return void(t[e]=i.next);const o=[];let s=bp(r);for(;s&&-1===o.indexOf(s);){if(s.next===n)return void((s.checksNext||kp(i.next))&&(s.next=i.next));o.push(s),s=bp(s.next)}},void 0)},xp=e=>{const n=t;n||mp.info("window not available, cannot wrap onerror");const i={next:yp(()=>n.onerror,void 0),checksNext:!0};let r=e;const o=function(...t){var e;r&&wp(r,()=>gp.buildFromUnknown((([t,e,n,i,r])=>{if(null!=r)return r;if(V(t)&&V(e)&&e.length>0&&"undefined"!=typeof ErrorEvent)try{return new ErrorEvent("error",{message:t,filename:e,lineno:n,colno:i})}catch(e){return t}return t})(t),{mechanism:{handled:!1}}));const{next:n}=i;return!!kp(n)&&null!==(e=n(...t))&&void 0!==e&&e};return n.onerror=o,Sp(o,i),()=>{r=void 0,_p(n,"onerror",o,i)}},Cp=(e,n=!1)=>{const i=t;i||mp.info("window not available, cannot wrap onUnhandledRejection");const r={next:yp(()=>i.onunhandledrejection,void 0),checksNext:!0};let o=e;const s=function(t){var e;o&&wp(o,()=>gp.buildFromUnknown(t,{mechanism:{handled:!1}}));const{next:i}=r;return kp(i)?null!==(e=i(t))&&void 0!==e&&e:n};return i.onunhandledrejection=s,Sp(s,r),()=>{o=void 0,_p(i,"onunhandledrejection",s,r)}},Mp={wrapOnError:xp,wrapUnhandledRejection:Cp,wrapConsoleError(t){const e=console;e||mp.info("console not available, cannot wrap console.error");const n={next:yp(()=>e.error,void 0),checksNext:!0};let i=t;const r=function(...t){i&&!yp(()=>t.length>1&&V(t[0])&&(/^\[PostHog\.js\](?: |$)/.test(t[0])||"rrweb logger error:"===t[0]),!1)&&wp(i,()=>{let e;e=1==t.length?t[0]:t.join(" ");const n=t.find(t=>t instanceof Error);return gp.buildFromUnknown(n||e,{mechanism:{handled:!0,type:"onconsole"},syntheticException:new Error("PostHog syntheticException"),skipFirstLines:2})});const{next:e}=n;kp(e)&&e(...t)};return e.error=r,Sp(r,n),()=>{i=void 0,_p(e,"error",r,n)}}};o.__PosthogExtensions__=o.__PosthogExtensions__||{},o.__PosthogExtensions__.errorWrappingFunctions=Mp,o.posthogErrorWrappingFunctions=Mp;const Tp=(t,e)=>{if(!W(null==t?void 0:t.capture))return;const n=null==e?void 0:e.autocaptureExceptions,i=!Z(n)&&"object"==typeof n&&U(n.errors_to_ignore)?n.errors_to_ignore.reduce((t,e)=>{try{t.push(new RegExp(e))}catch(t){mp.error("Ignoring invalid legacy exception exclusion rule",e,t)}return t},[]):[],r=e=>{try{var n;null===(n=t.capture)||void 0===n||n.call(t,"$exception",e,{_noTruncate:!0,_batchKey:"exceptionEvent",_noHeatmaps:!0})}catch(t){mp.error("Failed to capture exception for a legacy client",t)}};xp(t=>{i.some(e=>t.$exception_list.some(t=>e.test(t.value||"")))||r(t)}),Cp(r,!0)};o.extendPostHogWithExceptionAutoCapture=Tp,o.extendPostHogWithExceptionAutocapture=Tp;const Ip="X-POSTHOG-SESSION-ID",Ap="X-POSTHOG-WINDOW-ID",Rp="X-POSTHOG-DISTINCT-ID",Ep=[Ip,Ap,Rp],Op="traceparent",$p=["attributionReporting","body","browsingTopics","cache","credentials","dispatcher","duplex","integrity","keepalive","method","mode","priority","redirect","referrer","referrerPolicy","signal","window"],Lp=(t,e)=>({}.hasOwnProperty.call(t,e)),Dp=t=>"object"==typeof t&&!Z(t)||W(t),Fp=t=>"undefined"!=typeof Request&&(t instanceof Request||"[object Request]"==={}.toString.call(t)),Pp=e=>{try{var n;return Fp(e)?e.url:new URL(e instanceof URL?e.toString():String(e),null==t||null===(n=t.location)||void 0===n?void 0:n.href).toString()}catch(t){return}},Np=(t,e,n,i,r)=>{let o;try{o=new URL(i).hostname}catch(t){return!1}if(!t)return!1;if(U(t)&&!t.includes(o))return!1;let s=!1;const a=(t=>W(t)?t():t)(e);if(a&&"$posthog_cookieless"!==a){try{r.set(Rp,a)}catch(t){return!1}s=!0}if(n){const{sessionId:t,windowId:e}=n.checkAndGetSessionAndWindowId(!0);r.set(Ip,t),r.set(Ap,e),s=!0}return s},qp=e=>{const n=new Uint8Array(e),i=null==t?void 0:t.crypto;if(i&&W(i.getRandomValues))i.getRandomValues(n);else for(let t=0;e>t;t++)n[t]=Math.floor(256*Math.random());let r="";for(let t=0;e>t;t++)r+=(16>n[t]?"0":"")+n[t].toString(16);return r},jp=t=>{let e=qp(t);for(;/^0+$/.test(e);)e=qp(t);return e},Bp=()=>`00-${jp(16)}-${jp(8)}-01`,zp=t=>{try{return new URL(t).origin}catch(t){return}},Up=(t,e)=>{if(!U(t)||0===t.length)return!1;let n;try{n=new URL(e)}catch(t){return!1}for(let e=0;t.length>e;e++){const i=t[e];if(V(i))if(i.indexOf("://")>-1){if(zp(i)===n.origin)return!0}else if(i.toLowerCase()===n.hostname)return!0}return!1},Wp=(t,e,n)=>!(n.has(Op)||!Up(t,e)||(n.set(Op,Bp()),0));o.__PosthogExtensions__=o.__PosthogExtensions__||{};const Hp={_patchFetch:(e,n,i,r)=>Mu(t,"fetch",t=>function(o,s){const a=arguments.length>1?[o,s]:[o];let l=a;try{const t=Pp(o);if(t)if(Fp(o)){const t=new Request(o,s);l=[t];const a=new Headers;try{Np(e,n,i,t.url,a),a.forEach((e,n)=>t.headers.set(n,e))}catch(t){}Wp(r,t.url,t.headers)}else{const a=new Headers(Dp(s)?s.headers:void 0),u=Np(e,n,i,t,a),c=Wp(r,t,a);if(u||c){const t=((t,e)=>{if(G(t)||Z(t))return{headers:e};if(!Dp(t))return;const n=t;if("undefined"==typeof Proxy||"undefined"==typeof Reflect){const t=Object.create(n);return Object.defineProperty(t,"headers",{configurable:!0,enumerable:!0,value:e,writable:!0}),t}return new Proxy({headers:e},{get:(t,e)=>Lp(t,e)?Reflect.get(t,e):Reflect.get(n,e,n),has:(t,e)=>Lp(t,e)||e in n,ownKeys(t){const e=new Set(Reflect.ownKeys(t));return Reflect.ownKeys(n).forEach(t=>e.add(t)),$p.forEach(t=>{t in n&&e.add(t)}),Array.from(e)},getOwnPropertyDescriptor(t,e){const i=Reflect.getOwnPropertyDescriptor(t,e);if(i)return i;if("string"==typeof e&&$p.includes(e)&&e in n)return{configurable:!0,enumerable:!0,get(){return Reflect.get(n,e,n)}};const r=Reflect.getOwnPropertyDescriptor(n,e);return r?L(L({},r),{},{configurable:!0}):void 0},getPrototypeOf:()=>Object.getPrototypeOf(n)})})(s,a);t&&(l=[o,t])}}}catch(t){l=a}return t.apply(this,l)}),_patchXHR(e,n,i,r){const o=U(r)&&"undefined"!=typeof WeakMap?new WeakMap:void 0,s=Mu(t.XMLHttpRequest.prototype,"open",t=>function(r,s,a=!0,l,u){const c=this;let d=new Headers;const h=Pp(s);if(h)try{Np(e,n,i,h,d)}catch(t){d=new Headers}o&&(o.delete(c),h&&o.set(c,h));const f=t.call(c,r,s,a,l,u);return Ep.forEach(t=>{const e=d.get(t);if(e)try{c.setRequestHeader(t,e)}catch(t){}}),f});if(!o)return s;const a=t.XMLHttpRequest.prototype,l=Mu(a,"setRequestHeader",t=>function(e,n){return(t=>{try{return String(t).toLowerCase()===Op}catch(t){return!1}})(e)&&o.delete(this),t.call(this,e,n)}),u=Mu(a,"send",e=>function(){const n=o.get(this);if(n){o.delete(this);try{!Up(r,n)||(e=>{try{return!!t&&new URL(e,t.location.href).origin===t.location.origin}catch(t){return!1}})(n)&&(e=>{try{let r=e;for(let e=0;W(r)&&20>e;e++){var n,i;const e=r;if(e.__wrapped){const e=null==t?void 0:t[Symbol.for("opentelemetry.js.api.1")];return!!(null==e?void 0:e.propagation)}r=null===(n=null!==(i=e.__posthog_layer__)&&void 0!==i?i:e.__rrweb_layer__)||void 0===n?void 0:n.next}return!1}catch(t){return!1}})(null==c?void 0:c.next)||this.setRequestHeader(Op,Bp())}catch(t){}}return e.apply(this,arguments)});let c;try{var d;c=null===(d=a.send)||void 0===d?void 0:d.__posthog_layer__}catch(t){}return()=>{u(),l(),s()}}};o.__PosthogExtensions__.tracingHeadersPatchFns=Hp,o.postHogTracingHeadersPatchFns=Hp,"function"!=typeof[].at&&Object.defineProperty(Array.prototype,"at",{value(t){const e=this.length;let n=Math.trunc(t)||0;return 0>n&&(n+=e),0>n||n>=e?void 0:this[n]},writable:!0,enumerable:!1,configurable:!0}),"function"!=typeof[].findLast&&Object.defineProperty(Array.prototype,"findLast",{value(t,e){for(let n=this.length-1;n>=0;n--){const i=this[n];if(t.call(e,i,n,this))return i}},writable:!0,enumerable:!1,configurable:!0});var Gp=class{constructor(){this.t=void 0,this.o=0,this.i=[]}l(t){var e;if(t.hadRecentInput)return;const n=this.i[0],i=this.i.at(-1);this.o&&n&&i&&1e3>t.startTime-i.startTime&&5e3>t.startTime-n.startTime?(this.o+=t.value,this.i.push(t)):(this.o=t.value,this.i=[t]),null===(e=this.t)||void 0===e||e.call(this,t)}};const Vp=()=>{const t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},Qp=t=>{if("loading"===document.readyState)return"loading";const e=Vp();if(e){if(e.domInteractive>t)return"loading";if(0===e.domContentLoadedEventStart||e.domContentLoadedEventStart>t)return"dom-interactive";if(0===e.domComplete||e.domComplete>t)return"dom-content-loaded"}return"complete"},Zp=t=>{const e=t.nodeName;return 1===t.nodeType?e.toLowerCase():e.toUpperCase().replace(/^#/,"")},Jp=t=>{let e="";try{for(;9!==(null==t?void 0:t.nodeType);){var n;const i=t,r=i.id?"#"+i.id:[Zp(i),...Array.from(null!==(n=i.classList)&&void 0!==n?n:[]).sort()].join(".");if(e.length+r.length>99)return e||r;if(e=e?r+">"+e:r,i.id)break;t=i.parentNode}}catch(t){}return e},Yp=new WeakMap;function Kp(t,e){let n=Yp.get(e);return n||(n=new WeakMap,Yp.set(e,n)),n.get(t)||n.set(t,new e),n.get(t)}let Xp=-1;const tm=()=>Xp,em=t=>{addEventListener("pageshow",e=>{e.persisted&&(Xp=e.timeStamp,t(e))},!0)},nm=(t,e,n,i)=>{let r,o;return s=>{var a;e.value>=0&&(s||i)&&(o=e.value-(null!==(a=r)&&void 0!==a?a:0),(o||void 0===r)&&(r=e.value,e.delta=o,e.rating=((t,e)=>t>e[1]?"poor":t>e[0]?"needs-improvement":"good")(e.value,n),t(e)))}},im=t=>{requestAnimationFrame(()=>requestAnimationFrame(()=>t()))},rm=()=>{var t,e;return null!==(t=null===(e=Vp())||void 0===e?void 0:e.activationStart)&&void 0!==t?t:0};let om=-1;const sm=new Set,am=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,lm=t=>{if("hidden"===document.visibilityState){if("visibilitychange"===t.type)for(const t of sm)t();isFinite(om)||(om="visibilitychange"===t.type?t.timeStamp:0,removeEventListener("prerenderingchange",lm,!0))}},um=(t=!1)=>{if(t&&(om=1/0),0>om){var e;const t=rm(),n=document.prerendering||null===(e=globalThis.performance.getEntriesByType("visibility-state").find(e=>"hidden"===e.name&&e.startTime>=t))||void 0===e?void 0:e.startTime;om=null!=n?n:am(),addEventListener("visibilitychange",lm,!0),addEventListener("prerenderingchange",lm,!0),em(()=>{setTimeout(()=>{om=am()})})}return{get firstHiddenTime(){return om},onHidden(t){sm.add(t)}}},cm=(t,e=-1,n,i=0,r,o,s)=>{const a=Vp(),l=(null==a?void 0:a.navigationId)||0;let u="navigate";return n?u=n:0>tm()?a&&(document.prerendering||rm()>0?u="prerender":document.wasDiscarded?u="restore":a.type&&(u=a.type.replace(/_/g,"-"))):u="back-forward-cache",{name:t,value:e,rating:"good",delta:0,entries:[],id:`v6-${Date.now()}-${Math.floor(8999999999999*Math.random())+1e12}`,navigationType:u,navigationId:i||l,navigationInteractionId:r,navigationURL:o||(null==a?void 0:a.name),navigationStartTime:s||0}},dm=(t,e,n={})=>{try{const i=t.filter(t=>PerformanceObserver.supportedEntryTypes.includes(t));if(i.length>0){const t=new PerformanceObserver(t=>{queueMicrotask(()=>{const n=t.getEntries();i.length>1&&n.sort((t,e)=>t.startTime+t.duration-(e.startTime+e.duration)),e(n)})});for(const e of i)t.observe(L({type:e,buffered:!0},n));return t}}catch(t){}},hm=t=>{var e,n;return(null===(e=globalThis.PerformanceObserver)||void 0===e||null===(e=e.supportedEntryTypes)||void 0===e?void 0:e.includes("soft-navigation"))&&"function"==typeof(null===(n=globalThis.PerformanceSoftNavigation)||void 0===n||null===(n=n.prototype)||void 0===n?void 0:n.getLargestInteractionContentfulPaint)&&t&&t.reportSoftNavs},fm=(t,e)=>{if(t.set(e.navigationId,e),t.size>2){const e=t.keys().next().value;void 0!==e&&t.delete(e)}},vm=t=>{let e=!1;return()=>{e||(t(),e=!0)}};var pm=class{constructor(){this.u=void 0}};const mm=t=>{document.prerendering?addEventListener("prerenderingchange",t,!0):t()},gm=[1800,3e3],ym=(t,e={})=>{const n=hm(e);mm(()=>{const i=Kp(e,pm),r=um();let o,s=cm("FCP");const a=dm(["paint"],t=>{for(const e of t)"first-contentful-paint"===e.name&&(a.disconnect(),r.firstHiddenTime>e.startTime&&(s.value=Math.max(e.startTime-rm(),0),s.entries.push(e),s.navigationId=e.navigationId||s.navigationId,o(!0)))});a&&(o=nm(t,s,gm,e.reportAllChanges),em(n=>{s=cm("FCP",-1,"back-forward-cache",s.navigationId,s.navigationInteractionId,s.navigationURL,tm()),o=nm(t,s,gm,e.reportAllChanges),im(()=>{s.value=performance.now()-n.timeStamp,o(!0)})})),n&&dm(["soft-navigation"],n=>{n.forEach(n=>{i.u&&n.navigationId&&fm(i.u,n);const r=Math.max((n.presentationTime||n.paintTime||0)-n.startTime,0);s=cm("FCP",r,"soft-navigation",n.navigationId,n.interactionId,n.name,n.startTime),o=nm(t,s,gm,e.reportAllChanges),o(!0)})},e)})},bm=[.1,.25],wm=t=>t.find(t=>{var e;return 1===(null===(e=t.node)||void 0===e?void 0:e.nodeType)})||t[0],km=(t,e={})=>{const n=Kp(e=Object.assign({},e),Gp),i=new WeakMap;n.t=t=>{var n;if(null==t||null===(n=t.sources)||void 0===n?void 0:n.length){const n=wm(t.sources),s=null==n?void 0:n.node;if(s){var r,o;const t=null!==(r=null===(o=e.generateTarget)||void 0===o?void 0:o.call(e,s))&&void 0!==r?r:Jp(s);i.set(n,t)}}},((t,e={})=>{const n=um();ym(vm(()=>{let i,r=cm("CLS",0);const o=Kp(e,Gp),s=(n,s,a,l,u)=>{r=cm("CLS",0,n,s,a,l,u),o.o=0,i=nm(t,r,bm,e.reportAllChanges)},a=(t=!1)=>{o.o>r.value&&(r.value=o.o,r.entries=o.i),i(t)},l=t=>{a(!0),s("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime)},u=t=>{for(const e of t)"soft-navigation"!==e.entryType?o.l(e):l(e);a()},c=["layout-shift"];hm(e)&&c.push("soft-navigation");const d=dm(c,u);d&&(i=nm(t,r,bm,e.reportAllChanges),n.onHidden(()=>{u(d.takeRecords()),i(!0)}),em(()=>{s("back-forward-cache",r.navigationId,r.navigationInteractionId,r.navigationURL,tm()),im(i)}),setTimeout(i))}))})(e=>{t((t=>{let e={};if(t.entries.length){var n;const r=t.entries.reduce((t,e)=>t.value>e.value?t:e);if(null==r||null===(n=r.sources)||void 0===n?void 0:n.length){const t=wm(r.sources);t&&(e={largestShiftTarget:i.get(t),largestShiftTime:r.startTime,largestShiftValue:r.value,largestShiftSource:t,largestShiftEntry:r,loadState:Qp(r.startTime)})}}return Object.assign(t,{attribution:e})})(e))},e)},Sm=(t,e={})=>{const n=Kp(e=Object.assign({},e),pm);hm(e)&&(n.u=new Map),ym(e=>{t((t=>{let e={timeToFirstByte:0,firstByteToFCP:t.value,loadState:Qp(tm())};if("soft-navigation"!==t.navigationType){if(t.entries.length){const n=Vp(),i=t.entries.at(-1);if(n){const r=Math.max(0,n.responseStart-(n.activationStart||0));e={timeToFirstByte:r,firstByteToFCP:t.value-r,loadState:Qp(t.entries[0].startTime),navigationEntry:n,fcpEntry:i}}}}else{var i;const r=null===(i=n.u)||void 0===i?void 0:i.get(t.navigationId);r&&(e={timeToFirstByte:0,firstByteToFCP:t.value,loadState:"complete",navigationEntry:r})}return Object.assign(t,{attribution:e})})(e))},e)};let _m=0,xm=1/0,Cm=0;const Mm=t=>{for(const e of t)e.interactionId&&(xm=Math.min(xm,e.interactionId),Cm=Math.max(Cm,e.interactionId),_m=Cm?(Cm-xm)/7+1:0)};let Tm;const Im=()=>{var t;return Tm?_m:null!==(t=performance.interactionCount)&&void 0!==t?t:0};var Am=class{constructor(){this.h=0,this.v=[],this.p=new Map,this.m=void 0,this.M=void 0}T(){return Im()-this.h}D(){this.h=Im(),this.v.length=0,this.p.clear()}S(t){const e=this.T(),n=Math.min(this.v.length-1,Math.floor(e/50));return!e||-1!==n||"soft-navigation"!==t&&"back-forward-cache"!==t?this.v[n]:{k:8,id:-1,entries:[]}}l(t){var e;if(null===(e=this.m)||void 0===e||e.call(this,t),!t.interactionId)return;const n=this.v.at(-1);let i=this.p.get(t.interactionId);if(i||10>this.v.length||t.duration>n.k){var r;if(i?t.duration>i.k?(i.entries=[t],i.k=t.duration):t.duration===i.k&&t.startTime===i.entries[0].startTime&&i.entries.push(t):(i={id:t.interactionId,entries:[t],k:t.duration},this.p.set(i.id,i),this.v.push(i)),this.v.sort((t,e)=>e.k-t.k),this.v.length>10){const t=this.v.splice(10);for(const e of t)this.p.delete(e.id)}null===(r=this.M)||void 0===r||r.call(this,i)}}};const Rm=t=>{const e="requestIdleCallback"in globalThis?1e3:0,n=globalThis.requestIdleCallback||setTimeout,i=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)t();else{const r=vm(t);let o=-1;const s=()=>{i(o),r()};addEventListener("visibilitychange",s,{once:!0,capture:!0}),o=n(()=>{removeEventListener("visibilitychange",s,{capture:!0}),r()},{timeout:e})}},Em=[200,500],Om=(t,e={})=>{const n=Kp(e=Object.assign({},e),Am);let i=[],r=[],o=0;const s=new WeakMap,a=new WeakMap;let l=!1;const u=()=>{l||(Rm(c),l=!0)},c=()=>{const t=new Set(n.v.map(t=>s.get(t.entries[0]))),e=r.length-10;r=r.filter((n,i)=>i>=e||t.has(n));const a=new Set;for(const t of r){const e=d(t.startTime,t.processingEnd);for(const t of e)a.add(t)}i=i.filter(t=>t.startTime>o||a.has(t)),l=!1};n.m=t=>{const n=t.startTime+t.duration;let i;o=Math.max(o,t.processingEnd);for(let o=r.length-1;o>=0;o--){const s=r[o];if(8>=Math.abs(n-s.renderTime)){i=s,i.startTime=Math.min(t.startTime,i.startTime),i.processingStart=Math.min(t.processingStart,i.processingStart),i.processingEnd=Math.max(t.processingEnd,i.processingEnd),e.includeProcessedEventEntries&&i.entries.push(t);break}}i||(i={startTime:t.startTime,processingStart:t.processingStart,processingEnd:t.processingEnd,renderTime:n,entries:e.includeProcessedEventEntries?[t]:[]},r.push(i)),t.interactionId&&s.set(t,i),u()},n.M=t=>{if(!a.get(t)){var n;const s=null===(n=t.entries.find(t=>t.target))||void 0===n?void 0:n.target;if(s){var i,r;const n=null!==(i=null===(r=e.generateTarget)||void 0===r?void 0:r.call(e,s))&&void 0!==i?i:Jp(s);a.set(t,n)}else{var o;const e=null===(o=t.entries.find(t=>t.targetSelector))||void 0===o?void 0:o.targetSelector;e&&a.set(t,e)}}};const d=(t,e)=>{const n=[];for(const r of i)if(r.startTime+r.duration>=t){if(r.startTime>e)break;n.push(r)}return n};dm(["long-animation-frame"],t=>{i=i.concat(t),u()},e),((t,e={})=>{if(!globalThis.PerformanceEventTiming||!("interactionId"in PerformanceEventTiming.prototype))return;const n=um();mm(()=>{var i;"interactionCount"in performance||Tm||(Tm=dm(["event"],Mm,{durationThreshold:0}));let r,o=cm("INP");const s=Kp(e,Am),a=(n,i,a,l,u)=>{s.D(),o=cm("INP",-1,n,i,a,l,u),r=nm(t,o,Em,e.reportAllChanges)},l=()=>{const t=s.S(o.navigationType);t&&t.k!==o.value&&(o.value=t.k,o.entries=t.entries,r())},u=t=>{l(),r(!0),a("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime)},c=(t,e=!1)=>{Rm(()=>{for(const e of t)"soft-navigation"!==e.entryType?s.l(e):u(e);l(),e&&r(!0)})},d=["event","first-input"];hm(e)&&d.push("soft-navigation");const h=dm(d,c,L(L({},e),{},{durationThreshold:null!==(i=e.durationThreshold)&&void 0!==i?i:40}));r=nm(t,o,Em,e.reportAllChanges),h&&(n.onHidden(()=>{c(h.takeRecords(),!0)}),em(()=>{a("back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,tm())}))})})(e=>{t((t=>{if(0===t.entries.length){const e={processedEventEntries:[],longAnimationFrameEntries:[],inputDelay:0,processingDuration:0,presentationDelay:t.value,loadState:Qp(t.navigationStartTime||0)};return Object.assign(t,{attribution:e})}const e=t.entries[0],i=s.get(e),r=Math.max(i.processingStart,e.startTime),o=Math.max(e.startTime+e.duration,r),l=Math.min(i.processingEnd,o),u=i.entries.sort((t,e)=>t.processingStart-e.processingStart),c=d(e.startTime,l),h=n.p.get(e.interactionId),f={interactionTarget:a.get(h),interactionType:e.name.startsWith("key")?"keyboard":"pointer",interactionTime:e.startTime,nextPaintTime:o,processedEventEntries:u,longAnimationFrameEntries:c,inputDelay:r-e.startTime,processingDuration:l-r,presentationDelay:o-l,loadState:Qp(e.startTime),longestScript:void 0,totalScriptDuration:void 0,totalStyleAndLayoutDuration:void 0,totalPaintDuration:void 0,totalUnattributedDuration:void 0};return(t=>{var e;const n=t.interactionTime,i=t.nextPaintTime;if(!(null===(e=t.longAnimationFrameEntries)||void 0===e?void 0:e.length)||!n||!i)return;const r=t.inputDelay,o=t.processingDuration;let s,a,l=0,u=0,c=0,d=0;for(const e of t.longAnimationFrameEntries){u=u+e.startTime+e.duration-e.styleAndLayoutStart;for(const t of e.scripts){const e=t.startTime+t.duration;if(n>e)continue;const i=e-Math.max(n,t.startTime),c=t.duration?i/t.duration*t.forcedStyleAndLayoutDuration:0;l+=i-c,u+=c,i>d&&(a=n+r>t.startTime?"input-delay":n+r+o>t.startTime?"processing-duration":"presentation-delay",s=t,d=i)}}const h=t.longAnimationFrameEntries.at(-1),f=h?h.startTime+h.duration:0;f>=n+r+o&&(c=i-f),s&&a&&(t.longestScript={entry:s,subpart:a,intersectingDuration:d}),t.totalScriptDuration=l,t.totalStyleAndLayoutDuration=u,t.totalPaintDuration=c,t.totalUnattributedDuration=i-n-l-u-c})(f),Object.assign(t,{attribution:f})})(e))},e)};var $m=class{constructor(){this.m=void 0,this.u=void 0}l(t){var e;null===(e=this.m)||void 0===e||e.call(this,t)}};const $=[2500,4e3];let Lm=50;const Dm=[];dm(["resource"],t=>{for(const e of t)Dm.push(e),Dm.length>Lm&&Dm.shift()});const Fm=(t,e={})=>{null!=(e=Object.assign({},e)).resourceBufferSize&&(Lm=e.resourceBufferSize);const n=Kp(e,$m),i=new WeakMap;hm(e)&&(n.u=new Map),n.m=t=>{const n=t.element;if(n){var r,o;const s=null!==(r=null===(o=e.generateTarget)||void 0===o?void 0:o.call(e,n))&&void 0!==r?r:Jp(n);i.set(t,s)}else t.id&&i.set(t,`#${t.id}`)},((t,e={})=>{let n=!1;const i=hm(e);mm(()=>{let r,o=um(),s=cm("LCP");const a=Kp(e,$m),l=(i,a,l,u,c)=>{s=cm("LCP",-1,i,a,l,u,c),r=nm(t,s,$,e.reportAllChanges),n=!1,"soft-navigation"===i&&(o=um(!0))},u=t=>{var e;a.u&&t.navigationId&&fm(a.u,t),n||r(!0),l("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime);const i=null===(e=t.getLargestInteractionContentfulPaint)||void 0===e?void 0:e.call(t);i&&c([i])},c=t=>{e.reportAllChanges||i||(t=t.slice(-1));for(const e of t){if(!e)continue;if("soft-navigation"===e.entryType){u(e);continue}let t=0,i=[],l=e.startTime;if("largest-contentful-paint"===e.entryType)t=Math.max(e.startTime-rm(),0),a.l(e),i=[e];else if("interaction-contentful-paint"===e.entryType){var n;const r=e;if(!s.navigationId)continue;if("interactionId"in r&&r.interactionId!=s.navigationInteractionId)continue;l=(null===(n=r.largestContentfulPaint)||void 0===n?void 0:n.renderTime)||0,t=Math.max(l-e.startTime,0),r.largestContentfulPaint&&(a.l(r.largestContentfulPaint),i=[r.largestContentfulPaint])}o.firstHiddenTime>l&&(s.value=t,s.entries=i,r())}},d=["largest-contentful-paint"];i&&d.push("interaction-contentful-paint","soft-navigation");const h=dm(d,c);if(h){r=nm(t,s,$,e.reportAllChanges);const o=["keydown","click","visibilitychange"],a=t=>{if(t.isTrusted&&!n){const t=s.id;Rm(()=>{if(!n){if(!i){h.disconnect();for(const t of o)removeEventListener(t,a,{capture:!0})}t===s.id&&(n=!0,r(!0))}})}};for(const t of o)addEventListener(t,a,{capture:!0});em(i=>{l("back-forward-cache",s.navigationId,s.navigationInteractionId,s.navigationURL,tm()),r=nm(t,s,$,e.reportAllChanges),im(()=>{s.value=performance.now()-i.timeStamp,n=!0,r(!0)})})}})})(e=>{t((t=>{let e={timeToFirstByte:0,resourceLoadDelay:0,resourceLoadDuration:0,elementRenderDelay:t.value};if(t.entries.length){var r,o,s;const a=t.entries.at(-1),l=a.url&&(Dm.findLast(t=>t.name===a.url)||performance.getEntriesByType("resource").findLast(t=>t.name===a.url));let u;e.target=i.get(a),e.lcpEntry=a,a.url&&(e.url=a.url),l&&(e.lcpResourceEntry=l);let c=0,d=0;if("soft-navigation"!==t.navigationType?(u=Vp(),c=null!==(r=null==u?void 0:u.activationStart)&&void 0!==r?r:0,d=null!==(o=null==u?void 0:u.responseStart)&&void 0!==o?o:0):(c=t.navigationStartTime||0,u=null===(s=n.u)||void 0===s?void 0:s.get(t.navigationId)),u){const n=Math.max(0,d-c),i=Math.max(n,l?(l.requestStart||l.startTime)-c:0),r=Math.min(t.value,Math.max(i,l?l.responseEnd-c:0));e=L(L({},e),{},{timeToFirstByte:n,resourceLoadDelay:i-n,resourceLoadDuration:r-i,elementRenderDelay:t.value-r,navigationEntry:u})}}return Object.assign(t,{attribution:e})})(e))},e)};let Pm=-1;const Nm=()=>Pm,qm=t=>{addEventListener("pageshow",e=>{e.persisted&&(Pm=e.timeStamp,t(e))},!0)},jm=(t,e,n,i)=>{let r,o;return s=>{var a;e.value>=0&&(s||i)&&(o=e.value-(null!==(a=r)&&void 0!==a?a:0),(o||void 0===r)&&(r=e.value,e.delta=o,e.rating=((t,e)=>t>e[1]?"poor":t>e[0]?"needs-improvement":"good")(e.value,n),t(e)))}},Bm=t=>{requestAnimationFrame(()=>requestAnimationFrame(()=>t()))},zm=()=>{const t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},Um=()=>{var t,e;return null!==(t=null===(e=zm())||void 0===e?void 0:e.activationStart)&&void 0!==t?t:0};let Wm=-1;const Hm=new Set,Gm=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,Vm=t=>{if("hidden"===document.visibilityState){if("visibilitychange"===t.type)for(const t of Hm)t();isFinite(Wm)||(Wm="visibilitychange"===t.type?t.timeStamp:0,removeEventListener("prerenderingchange",Vm,!0))}},Qm=(t=!1)=>{if(t&&(Wm=1/0),0>Wm){var e;const t=Um(),n=document.prerendering||null===(e=globalThis.performance.getEntriesByType("visibility-state").find(e=>"hidden"===e.name&&e.startTime>=t))||void 0===e?void 0:e.startTime;Wm=null!=n?n:Gm(),addEventListener("visibilitychange",Vm,!0),addEventListener("prerenderingchange",Vm,!0),qm(()=>{setTimeout(()=>{Wm=Gm()})})}return{get firstHiddenTime(){return Wm},onHidden(t){Hm.add(t)}}},Zm=(t,e=-1,n,i=0,r,o,s)=>{const a=zm(),l=(null==a?void 0:a.navigationId)||0;let u="navigate";return n?u=n:0>Nm()?a&&(document.prerendering||Um()>0?u="prerender":document.wasDiscarded?u="restore":a.type&&(u=a.type.replace(/_/g,"-"))):u="back-forward-cache",{name:t,value:e,rating:"good",delta:0,entries:[],id:`v6-${Date.now()}-${Math.floor(8999999999999*Math.random())+1e12}`,navigationType:u,navigationId:i||l,navigationInteractionId:r,navigationURL:o||(null==a?void 0:a.name),navigationStartTime:s||0}},Jm=new WeakMap;function Ym(t,e){let n=Jm.get(e);return n||(n=new WeakMap,Jm.set(e,n)),n.get(t)||n.set(t,new e),n.get(t)}var Km=class{constructor(){this.t=void 0,this.i=0,this.o=[]}h(t){var e;if(t.hadRecentInput)return;const n=this.o[0],i=this.o.at(-1);this.i&&n&&i&&1e3>t.startTime-i.startTime&&5e3>t.startTime-n.startTime?(this.i+=t.value,this.o.push(t)):(this.i=t.value,this.o=[t]),null===(e=this.t)||void 0===e||e.call(this,t)}};const Xm=(t,e,n={})=>{try{const i=t.filter(t=>PerformanceObserver.supportedEntryTypes.includes(t));if(i.length>0){const t=new PerformanceObserver(t=>{queueMicrotask(()=>{const n=t.getEntries();i.length>1&&n.sort((t,e)=>t.startTime+t.duration-(e.startTime+e.duration)),e(n)})});for(const e of i)t.observe(L({type:e,buffered:!0},n));return t}}catch(t){}},tg=t=>{var e,n;return(null===(e=globalThis.PerformanceObserver)||void 0===e||null===(e=e.supportedEntryTypes)||void 0===e?void 0:e.includes("soft-navigation"))&&"function"==typeof(null===(n=globalThis.PerformanceSoftNavigation)||void 0===n||null===(n=n.prototype)||void 0===n?void 0:n.getLargestInteractionContentfulPaint)&&t&&t.reportSoftNavs},eg=(t,e)=>{if(t.set(e.navigationId,e),t.size>2){const e=t.keys().next().value;void 0!==e&&t.delete(e)}},ng=t=>{let e=!1;return()=>{e||(t(),e=!0)}};var ig=class{constructor(){this.l=void 0}};const rg=t=>{document.prerendering?addEventListener("prerenderingchange",t,!0):t()},og=[1800,3e3],sg=(t,e={})=>{const n=tg(e);rg(()=>{const i=Ym(e,ig),r=Qm();let o,s=Zm("FCP");const a=Xm(["paint"],t=>{for(const e of t)"first-contentful-paint"===e.name&&(a.disconnect(),r.firstHiddenTime>e.startTime&&(s.value=Math.max(e.startTime-Um(),0),s.entries.push(e),s.navigationId=e.navigationId||s.navigationId,o(!0)))});a&&(o=jm(t,s,og,e.reportAllChanges),qm(n=>{s=Zm("FCP",-1,"back-forward-cache",s.navigationId,s.navigationInteractionId,s.navigationURL,Nm()),o=jm(t,s,og,e.reportAllChanges),Bm(()=>{s.value=performance.now()-n.timeStamp,o(!0)})})),n&&Xm(["soft-navigation"],n=>{n.forEach(n=>{i.l&&n.navigationId&&eg(i.l,n);const r=Math.max((n.presentationTime||n.paintTime||0)-n.startTime,0);s=Zm("FCP",r,"soft-navigation",n.navigationId,n.interactionId,n.name,n.startTime),o=jm(t,s,og,e.reportAllChanges),o(!0)})},e)})},ag=[.1,.25],lg=(t,e={})=>{const n=Qm();sg(ng(()=>{let i,r=Zm("CLS",0);const o=Ym(e,Km),s=(n,s,a,l,u)=>{r=Zm("CLS",0,n,s,a,l,u),o.i=0,i=jm(t,r,ag,e.reportAllChanges)},a=(t=!1)=>{o.i>r.value&&(r.value=o.i,r.entries=o.o),i(t)},l=t=>{a(!0),s("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime)},u=t=>{for(const e of t)"soft-navigation"!==e.entryType?o.h(e):l(e);a()},c=["layout-shift"];tg(e)&&c.push("soft-navigation");const d=Xm(c,u);d&&(i=jm(t,r,ag,e.reportAllChanges),n.onHidden(()=>{u(d.takeRecords()),i(!0)}),qm(()=>{s("back-forward-cache",r.navigationId,r.navigationInteractionId,r.navigationURL,Nm()),Bm(i)}),setTimeout(i))}))};let ug=0,cg=1/0,dg=0;const hg=t=>{for(const e of t)e.interactionId&&(cg=Math.min(cg,e.interactionId),dg=Math.max(dg,e.interactionId),ug=dg?(dg-cg)/7+1:0)};let fg;const vg=()=>{var t;return fg?ug:null!==(t=performance.interactionCount)&&void 0!==t?t:0};var pg=class{constructor(){this.u=0,this.v=[],this.m=new Map,this.p=void 0,this.T=void 0}_(){return vg()-this.u}M(){this.u=vg(),this.v.length=0,this.m.clear()}L(t){const e=this._(),n=Math.min(this.v.length-1,Math.floor(e/50));return!e||-1!==n||"soft-navigation"!==t&&"back-forward-cache"!==t?this.v[n]:{P:8,id:-1,entries:[]}}h(t){var e;if(null===(e=this.p)||void 0===e||e.call(this,t),!t.interactionId)return;const n=this.v.at(-1);let i=this.m.get(t.interactionId);if(i||10>this.v.length||t.duration>n.P){var r;if(i?t.duration>i.P?(i.entries=[t],i.P=t.duration):t.duration===i.P&&t.startTime===i.entries[0].startTime&&i.entries.push(t):(i={id:t.interactionId,entries:[t],P:t.duration},this.m.set(i.id,i),this.v.push(i)),this.v.sort((t,e)=>e.P-t.P),this.v.length>10){const t=this.v.splice(10);for(const e of t)this.m.delete(e.id)}null===(r=this.T)||void 0===r||r.call(this,i)}}};const mg=t=>{const e="requestIdleCallback"in globalThis?1e3:0,n=globalThis.requestIdleCallback||setTimeout,i=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)t();else{const r=ng(t);let o=-1;const s=()=>{i(o),r()};addEventListener("visibilitychange",s,{once:!0,capture:!0}),o=n(()=>{removeEventListener("visibilitychange",s,{capture:!0}),r()},{timeout:e})}},gg=[200,500],yg=(t,e={})=>{if(!globalThis.PerformanceEventTiming||!("interactionId"in PerformanceEventTiming.prototype))return;const n=Qm();rg(()=>{var i;"interactionCount"in performance||fg||(fg=Xm(["event"],hg,{durationThreshold:0}));let r,o=Zm("INP");const s=Ym(e,pg),a=(n,i,a,l,u)=>{s.M(),o=Zm("INP",-1,n,i,a,l,u),r=jm(t,o,gg,e.reportAllChanges)},l=()=>{const t=s.L(o.navigationType);t&&t.P!==o.value&&(o.value=t.P,o.entries=t.entries,r())},u=t=>{l(),r(!0),a("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime)},c=(t,e=!1)=>{mg(()=>{for(const e of t)"soft-navigation"!==e.entryType?s.h(e):u(e);l(),e&&r(!0)})},d=["event","first-input"];tg(e)&&d.push("soft-navigation");const h=Xm(d,c,L(L({},e),{},{durationThreshold:null!==(i=e.durationThreshold)&&void 0!==i?i:40}));r=jm(t,o,gg,e.reportAllChanges),h&&(n.onHidden(()=>{c(h.takeRecords(),!0)}),qm(()=>{a("back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,Nm())}))})};var bg=class{constructor(){this.p=void 0,this.l=void 0}h(t){var e;null===(e=this.p)||void 0===e||e.call(this,t)}};const wg=[2500,4e3],kg=(t,e={})=>{let n=!1;const i=tg(e);rg(()=>{let r,o=Qm(),s=Zm("LCP");const a=Ym(e,bg),l=(i,a,l,u,c)=>{s=Zm("LCP",-1,i,a,l,u,c),r=jm(t,s,wg,e.reportAllChanges),n=!1,"soft-navigation"===i&&(o=Qm(!0))},u=t=>{var e;a.l&&t.navigationId&&eg(a.l,t),n||r(!0),l("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime);const i=null===(e=t.getLargestInteractionContentfulPaint)||void 0===e?void 0:e.call(t);i&&c([i])},c=t=>{e.reportAllChanges||i||(t=t.slice(-1));for(const e of t){if(!e)continue;if("soft-navigation"===e.entryType){u(e);continue}let t=0,i=[],l=e.startTime;if("largest-contentful-paint"===e.entryType)t=Math.max(e.startTime-Um(),0),a.h(e),i=[e];else if("interaction-contentful-paint"===e.entryType){var n;const r=e;if(!s.navigationId)continue;if("interactionId"in r&&r.interactionId!=s.navigationInteractionId)continue;l=(null===(n=r.largestContentfulPaint)||void 0===n?void 0:n.renderTime)||0,t=Math.max(l-e.startTime,0),r.largestContentfulPaint&&(a.h(r.largestContentfulPaint),i=[r.largestContentfulPaint])}o.firstHiddenTime>l&&(s.value=t,s.entries=i,r())}},d=["largest-contentful-paint"];i&&d.push("interaction-contentful-paint","soft-navigation");const h=Xm(d,c);if(h){r=jm(t,s,wg,e.reportAllChanges);const o=["keydown","click","visibilitychange"],a=t=>{if(t.isTrusted&&!n){const t=s.id;mg(()=>{if(!n){if(!i){h.disconnect();for(const t of o)removeEventListener(t,a,{capture:!0})}t===s.id&&(n=!0,r(!0))}})}};for(const t of o)addEventListener(t,a,{capture:!0});qm(i=>{l("back-forward-cache",s.navigationId,s.navigationInteractionId,s.navigationURL,Nm()),r=jm(t,s,wg,e.reportAllChanges),Bm(()=>{s.value=performance.now()-i.timeStamp,n=!0,r(!0)})})}})},Sg={onLCP:Fm,onCLS:km,onFCP:Sm,onINP:Om,withoutAttribution:{onLCP:kg,onCLS:lg,onFCP:sg,onINP:yg}};o.__PosthogExtensions__=o.__PosthogExtensions__||{},o.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=o.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},o.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-with-attribution-soft-navs"]=Sg,o.__PosthogExtensions__.postHogWebVitalsCallbacks=Sg,o.postHogWebVitalsCallbacks=Sg;const _g={onLCP:kg,onCLS:lg,onFCP:sg,onINP:yg};o.__PosthogExtensions__=o.__PosthogExtensions__||{},o.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=o.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},o.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-soft-navs"]=_g,o.__PosthogExtensions__.postHogWebVitalsCallbacks=_g,o.postHogWebVitalsCallbacks=_g,o.__PosthogExtensions__.loadWebVitalsCallbacks=()=>_g;const xg={onLCP:Fm,onCLS:km,onFCP:Sm,onINP:Om,withoutAttribution:{onLCP:kg,onCLS:lg,onFCP:sg,onINP:yg}};o.__PosthogExtensions__=o.__PosthogExtensions__||{},o.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=o.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},o.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-with-attribution"]=xg,o.__PosthogExtensions__.postHogWebVitalsCallbacks=xg,o.postHogWebVitalsCallbacks=xg;const Cg={onLCP:kg,onCLS:lg,onFCP:sg,onINP:yg};o.__PosthogExtensions__=o.__PosthogExtensions__||{},o.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=o.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},o.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals"]=Cg,o.__PosthogExtensions__.postHogWebVitalsCallbacks=Cg,o.postHogWebVitalsCallbacks=Cg,o.__PosthogExtensions__.loadWebVitalsCallbacks=()=>Cg;const Mg={};function Tg(t,e){const n=Ie(t);return n?L({node:n,originalEvent:t,timestamp:Date.now()},e):null}function Ig(t){return!!_t(()=>Se(t))}function Ag(t,e){return Math.abs(t)<Math.abs(e)?0>e?"up":"down":0>t?"left":"right"}function Rg(t){return"swipe"===t.type?"$dead_swipe":"$dead_click"}const Eg="canvas,video,audio,embed,object";function Og(t,e){return Y(t)&&t>=e}function $g(t,e=1e3){return t>=0&&e>t?t:void 0}function Lg(t,e,n=1e3){return Y(e)?$g(t-e,n):void 0}var Dg=class{Dr(t){var e,n,i,r,o,s,a,l;const u=this.Fr((null==t?void 0:t.__onCapture)||this.Pr.bind(this));return{element_attribute_ignorelist:null!==(e=null==t?void 0:t.element_attribute_ignorelist)&&void 0!==e?e:u.element_attribute_ignorelist,scroll_threshold_ms:null!==(n=null==t?void 0:t.scroll_threshold_ms)&&void 0!==n?n:u.scroll_threshold_ms,selection_change_threshold_ms:null!==(i=null==t?void 0:t.selection_change_threshold_ms)&&void 0!==i?i:u.selection_change_threshold_ms,mutation_threshold_ms:null!==(r=null==t?void 0:t.mutation_threshold_ms)&&void 0!==r?r:u.mutation_threshold_ms,capture_clicks_with_modifier_keys:null!==(o=null==t?void 0:t.capture_clicks_with_modifier_keys)&&void 0!==o?o:u.capture_clicks_with_modifier_keys,capture_dead_swipes:null!==(s=null==t?void 0:t.capture_dead_swipes)&&void 0!==s?s:u.capture_dead_swipes,swipe_threshold_px:null!==(a=null==t?void 0:t.swipe_threshold_px)&&void 0!==a?a:u.swipe_threshold_px,max_dead_swipes_per_page_load:null!==(l=null==t?void 0:t.max_dead_swipes_per_page_load)&&void 0!==l?l:u.max_dead_swipes_per_page_load,css_selector_ignorelist:null==t?void 0:t.css_selector_ignorelist,__onCapture:u.__onCapture}}constructor(t,e){this.instance=t,this.Nr=new WeakSet,this.qr=!1,this.jr=[],this.Br=0,this.Fr=t=>({element_attribute_ignorelist:[],scroll_threshold_ms:100,selection_change_threshold_ms:100,mutation_threshold_ms:2500,capture_clicks_with_modifier_keys:!1,capture_dead_swipes:!0,swipe_threshold_px:30,max_dead_swipes_per_page_load:10,__onCapture:t}),this.zr=()=>{clearTimeout(this.Ur),this.Ur=void 0,this.Wr=void 0},this.Hr=t=>{if(this.Gr(t),this.zr(),0===t.button){const e={path:t.composedPath(),trusted:t.isTrusted,selectionChanged:!1,selectionInitiallyRelated:!1},i=null==n?void 0:n.getSelection();e.selectionInitiallyRelated="Range"===(null==i?void 0:i.type)&&this.Vr(i,e),this.Wr=e}},this.Qr=t=>{Z(t.relatedTarget)&&this.zr()},this.Zr=t=>{const e=this.Wr,n=t;if(!e||0!==n.button||t.isTrusted!==e.trusted)return;const i=t.composedPath();for(const t of e.path)if(Ig(t)&&-1!==i.indexOf(t)){e.clickTarget=t;break}e.clickDetail=n.detail,this.Ur=o.setTimeout(this.zr,0)},this.Jr=t=>{this.Gr(t);const e=t,n=Tg(e,{type:"click"}),i=this.Wr;n&&i&&0===e.button&&e.detail>0&&e.detail===i.clickDetail&&t.isTrusted===i.trusted&&n.node===i.clickTarget&&(n.selectionChangedDuringGesture=i.selectionChanged&&this.Yr.selection_change_threshold_ms>0,this.zr()),Z(n)||this.Kr(n)||this.Xr(n),this.eo()},this.no=()=>{const t=Date.now();this.io=t,t%50==0&&this.jr.forEach(e=>{G(e.scrollDelayMs)&&(e.scrollDelayMs=t-e.timestamp)})},this.ro=t=>{var e,i;const r=null==n?void 0:n.getSelection(),o=this.qr;this.qr="Range"===(null==r?void 0:r.type);const s=null==r?void 0:r.focusNode,a=s&&(Se(s)?s:s.parentElement),l=null==n?void 0:n.activeElement;let u=l;for(;null==u||null===(e=u.shadowRoot)||void 0===e?void 0:e.activeElement;)u=u.shadowRoot.activeElement;const c=$e(Ie(t))||$e(null!=a?a:null)||$e(null!==(i=u)&&void 0!==i?i:null),d="Caret"===(null==r?void 0:r.type)&&u&&!u.shadowRoot&&s&&s!==l&&s.contains(null!=l?l:null);if(!(o||this.qr||c||d))return;const h=Date.now();this.oo=h;const f=this.Wr;if(f&&(o||this.qr||c)){const e=Ie(t);let n;if($e(e))n=e;else if("Caret"===(null==r?void 0:r.type)){var v;$e(null!==(v=u)&&void 0!==v?v:null)||d?n=u:c&&(n=a)}const i=n?this.so(n,f):r&&(s||r.anchorNode)?this.Vr(r,f):o&&!this.qr&&f.selectionInitiallyRelated;f.selectionChanged=f.selectionChanged||i}this.jr.forEach(t=>{const e=h-t.timestamp;0>e||!G(t.selectionChangedDelayMs)&&e>=t.selectionChangedDelayMs||(t.selectionChangedDelayMs=e)})},this.gn=()=>{"hidden"===(null==n?void 0:n.visibilityState)&&this.zr();const t=Date.now();this.ao=t,this.lo("visibilityChangedDelayMs",t)},this.uo=()=>{const t=Date.now();this.co=t,this.lo("focusChangedDelayMs",t)},this.do=t=>{this.Gr(t);const e=t.touches,n=1===(null==e?void 0:e.length)?e[0]:void 0;this.ho=n&&this.fo()?{x:n.clientX,y:n.clientY,timestamp:Date.now()}:void 0},this.vo=()=>{this.ho=void 0},this.po=t=>{var e;const i=this.ho;if(this.ho=void 0,G(i)||this.Br>=this.Yr.max_dead_swipes_per_page_load)return;const r=t,o=null===(e=r.changedTouches)||void 0===e?void 0:e[0];if(!o)return;const s=o.clientX-i.x,a=o.clientY-i.y,l=s*s+a*a,u=this.Yr.swipe_threshold_px;if(u*u>l)return;if([this.io,this.mo,this.oo].some(t=>Y(t)&&t>=i.timestamp))return;var c,d;if(this.yo()&&(null!==(c=null==n||null===(d=n.elementsFromPoint)||void 0===d?void 0:d.call(n,i.x,i.y))&&void 0!==c?c:[]).some(t=>{var e;return null===(e=t.matches)||void 0===e?void 0:e.call(t,Eg)}))return;const h=Tg(r,{type:"swipe",swipeDirection:Ag(s,a),swipeDistancePx:Math.round(Math.sqrt(l))});Z(h)||this.Kr(h)||this.Xr(h),this.eo()},this.Yr=this.Dr(e),this._onCapture=this.Yr.__onCapture}start(t){this.bo(),this.wo(),this.ko(),this.So(),this._o(),this.xo(t),this.Yr.capture_dead_swipes&&this.Co()}xo(e){if(!this.Mo){const n=function(e){return function(e,n){const i=Mg[e];if(i)return i;let r=n[e];if((t=>W(t)&&-1!==t.toString().indexOf("[native code]"))(r)&&!(null==t?void 0:t.Zone))return Mg[e]=r.bind(n);const o=n.document;if(o&&W(o.createElement)){let t,i=!1;try{t=o.createElement("iframe"),t.hidden=!0,o.head.appendChild(t);const u=t.contentWindow;var s,a;u&&u[e]&&(r=u[e],"MutationObserver"===e&&N(l=null!==(s=null===(a=n.navigator)||void 0===a?void 0:a.userAgent)&&void 0!==s?s:"","AppleWebKit")&&!N(l,"Chrome")&&(t.classList.add("rr-block","ph-no-capture"),i=!0))}catch(t){de.warn(`Could not create sandbox iframe for ${e} check, bailing to assignableWindow.${e}: `,t)}finally{!i&&(null==t?void 0:t.parentNode)&&t.parentNode.removeChild(t)}}var l;return r&&W(r)?Mg[e]=r.bind(n):r}("MutationObserver",e)}(o);this.Mo=new n(t=>{this.To(t)}),this.Io(e)}}Io(t){t&&this.Mo&&(this.Nr.has(t)||(this.Mo.observe(t,{attributes:!0,characterData:!0,childList:!0,subtree:!0}),this.Nr.add(t),this.Ao(t)))}Ao(t,e){var n,i;Se(t)&&t.shadowRoot&&this.Io(t.shadowRoot);const r=null!==(n=null===(i=t.querySelectorAll)||void 0===i?void 0:i.call(t,"*"))&&void 0!==n?n:[];for(let t=0;r.length>t;t++)null==e||e.add(r[t]),this.Io(r[t].shadowRoot)}Gr(t){var e,n;const i=null!==(e=null===(n=t.composedPath)||void 0===n?void 0:n.call(t))&&void 0!==e?e:[];for(let t=0;i.length>t;t++){const e=i[t];Ig(e)&&this.Io(e.shadowRoot)}}stop(){var t;null===(t=this.Mo)||void 0===t||t.disconnect(),this.Mo=void 0,this.Nr=new WeakSet,o.removeEventListener("click",this.Jr,{capture:!0}),o.removeEventListener("mousedown",this.Hr,{capture:!0}),o.removeEventListener("mouseup",this.Zr,{capture:!0}),o.removeEventListener("mouseout",this.Qr,{capture:!0}),o.removeEventListener("dragstart",this.zr,{capture:!0}),o.removeEventListener("pointercancel",this.zr,{capture:!0}),o.removeEventListener("blur",this.zr),this.zr(),o.removeEventListener("scroll",this.no,{capture:!0}),null==n||n.removeEventListener("selectionchange",this.ro),o.removeEventListener("touchstart",this.do,{capture:!0}),o.removeEventListener("touchend",this.po,{capture:!0}),o.removeEventListener("touchcancel",this.vo,{capture:!0}),null==n||n.removeEventListener("visibilitychange",this.gn),o.removeEventListener("blur",this.uo),o.removeEventListener("focus",this.uo),this.ho=void 0}To(t){const e=new Set;for(const i of t)try{var n;if(!1===(null===(n=i.target)||void 0===n?void 0:n.isConnected))continue;this.mo=Date.now();const t=i.addedNodes;for(let n=0;t.length>n;n++){const i=t[n];Ig(i)&&!e.has(i)&&this.Ao(i,e)}}catch(t){}}bo(){me(o,"click",this.Jr,{capture:!0}),me(o,"mousedown",this.Hr,{capture:!0}),me(o,"mouseup",this.Zr,{capture:!0}),me(o,"mouseout",this.Qr,{capture:!0}),me(o,"dragstart",this.zr,{capture:!0}),me(o,"pointercancel",this.zr,{capture:!0}),me(o,"blur",this.zr)}Xr(t){this.fo()&&(t.selectionChangedDelayMs=Lg(t.timestamp,this.oo,this.Yr.selection_change_threshold_ms),t.visibilityChangedDelayMs=Lg(t.timestamp,this.ao),t.focusChangedDelayMs=Lg(t.timestamp,this.co),this.jr.push(t))}eo(){this.jr.length&&G(this.Ro)&&(this.Ro=o.setTimeout(()=>{this.Eo()},1e3))}wo(){me(o,"scroll",this.no,{capture:!0})}ko(){var t;this.qr="Range"===(null==n||null===(t=n.getSelection())||void 0===t?void 0:t.type),me(n,"selectionchange",this.ro)}so(t,e){const n=e.path[0];try{for(;t;){if(-1!==e.path.indexOf(t)||Se(n)&&n.contains(t))return!0;t=t.getRootNode().host}}catch(t){}return!1}Vr(t,e){const n=e.path[0],i=t.rangeCount>0?t.getRangeAt(0):void 0,r=!!i&&_t(()=>i.startContainer.getRootNode()===n.getRootNode());if(i&&r&&Se(n)){var o;if(!i.collapsed)return i.intersectsNode(n);const t=Se(i.startContainer)&&null!==(o=i.startContainer.childNodes[i.startOffset])&&void 0!==o?o:i.startContainer;return this.so(t,e)}return this.so(t.focusNode,e)||this.so(t.anchorNode,e)}So(){me(n,"visibilitychange",this.gn)}_o(){me(o,"blur",this.uo),me(o,"focus",this.uo)}lo(t,e){this.jr.forEach(n=>{const i=$g(e-n.timestamp);Y(i)&&(G(n[t])||n[t]>i)&&(n[t]=i)})}Co(){me(o,"touchstart",this.do,{capture:!0,passive:!0}),me(o,"touchend",this.po,{capture:!0,passive:!0}),me(o,"touchcancel",this.vo,{capture:!0,passive:!0})}fo(){return W(this.instance.is_capturing)?this.instance.is_capturing():!this.instance.has_opted_out_capturing()}yo(){const t=G(this.Oo)||Y(this.mo)&&this.mo>this.Oo;return(G(this.$o)||t)&&(this.Oo=Date.now(),this.$o=!!(null==n?void 0:n.querySelector(Eg))),!!this.$o}Kr(t){return!t||("swipe"===t.type?this.Lo(t):this.Do(t))}Lo(t){return!((!((e=t.node)instanceof Element)||"__POSTHOG_TOOLBAR__"!==e.id&&!(null===(n=e.closest)||void 0===n?void 0:n.call(e,".toolbar-global-fade-container")))&&!this.jr.some(e=>e.type===t.type&&e.node===t.node&&1e3>Math.abs(e.timestamp-t.timestamp))&&!_e(t.node,"html")&&Se(t.node)&&function(t,e){var n;if(!(typeof window>"u"?void 0:window)||Le(t))return!1;const i=K(e)?Ee:null!==(n=null==e?void 0:e.css_selector_ignorelist)&&void 0!==n?n:Ee,{targetElementList:r,isComplete:o}=De(t,!1);return!!o&&!function(t,e){if(G(e))return!0;for(const n of t)if(e.some(t=>Re(n,t)))return!0;return!1}(r,i)}(t.node,{css_selector_ignorelist:this.Yr.css_selector_ignorelist}));var e,n}Do(t){return!(this.Yr.capture_clicks_with_modifier_keys||(e=t.originalEvent,!(e.ctrlKey||e.metaKey||e.altKey||e.shiftKey)))||!!this.Lo(t)||function(t){if(!(typeof window>"u"?void 0:window)||Le(t))return!1;const{targetElementList:e,isComplete:n}=De(t,!1);return!n||e.some(t=>_e(t,"a"))}(t.node);var e}Eo(){if(!this.jr.length)return;clearTimeout(this.Ro),this.Ro=void 0;const t=this.jr;this.jr=[];for(const n of t){var e;n.mutationDelayMs=null!==(e=n.mutationDelayMs)&&void 0!==e?e:this.mo&&this.mo>=n.timestamp?this.mo-n.timestamp:void 0,n.absoluteDelayMs=Date.now()-n.timestamp;const t=Og(n.scrollDelayMs,this.Yr.scroll_threshold_ms),i=Og(n.selectionChangedDelayMs,this.Yr.selection_change_threshold_ms),r=Og(n.mutationDelayMs,this.Yr.mutation_threshold_ms),o=Og(n.absoluteDelayMs,1.1*this.Yr.mutation_threshold_ms),s=Y(n.scrollDelayMs)&&this.Yr.scroll_threshold_ms>n.scrollDelayMs,a=Y(n.mutationDelayMs)&&this.Yr.mutation_threshold_ms>n.mutationDelayMs,l=n.selectionChangedDuringGesture||Y(n.selectionChangedDelayMs)&&this.Yr.selection_change_threshold_ms>n.selectionChangedDelayMs,u=Y(n.visibilityChangedDelayMs),c=Y(n.focusChangedDelayMs);if(!(s||a||l||u||c))if(t||r||o||i){const e=Rg(n);if("$dead_swipe"===e){if(this.Br>=this.Yr.max_dead_swipes_per_page_load)continue;this.Br++}this._onCapture(n,{[`${e}_last_mutation_timestamp`]:this.mo,[`${e}_event_timestamp`]:n.timestamp,[`${e}_scroll_timeout`]:t,[`${e}_mutation_timeout`]:r,[`${e}_absolute_timeout`]:o,[`${e}_selection_changed_timeout`]:i,[`${e}_visibility_changed_timeout`]:!1})}else this.Yr.mutation_threshold_ms>n.absoluteDelayMs&&this.jr.push(n)}this.eo()}Pr(t,e){const n=Rg(t);this.instance.capture(n,L(L(L({},e),Vv(t.node,{e:t.originalEvent,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.Yr.element_attribute_ignorelist,elementsChainAsString:!1,disableCaptureUrlHashes:this.instance.config.disable_capture_url_hashes}).props),{},{[`${n}_scroll_delay_ms`]:t.scrollDelayMs,[`${n}_mutation_delay_ms`]:t.mutationDelayMs,[`${n}_absolute_delay_ms`]:t.absoluteDelayMs,[`${n}_selection_changed_delay_ms`]:t.selectionChangedDelayMs,[`${n}_visibility_changed_delay_ms`]:t.visibilityChangedDelayMs,[`${n}_focus_changed_delay_ms`]:t.focusChangedDelayMs,$dead_swipe_direction:t.swipeDirection,$dead_swipe_distance_px:t.swipeDistancePx}),{timestamp:new Date(t.timestamp)})}};o.__PosthogExtensions__=o.__PosthogExtensions__||{},o.__PosthogExtensions__.initDeadClicksAutocapture=(t,e)=>new Dg(t,e)}();
|
|
2
2
|
//# sourceMappingURL=all-external-dependencies.js.map
|