posthog-js 1.438.8 → 1.438.9
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/array.full.es5.js +1 -1
- package/dist/array.full.js +1 -1
- package/dist/array.full.no-external.js +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.full.js.map +1 -1
- package/dist/customizations.js +1 -1
- package/dist/customizations.js.map +1 -1
- package/dist/default-extensions.js +1 -1
- package/dist/extension-bundles.js +1 -1
- 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.no-external.cjs +1 -1
- package/dist/module.full.no-external.js +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/lib/package.json +1 -1
- package/lib/src/customizations/before-send.js +0 -9
- package/lib/src/customizations/before-send.js.map +1 -1
- package/package.json +6 -6
|
@@ -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.navigator,i=null==e?void 0:e.document,r=null==e?void 0:e.location;null!=e&&e.XMLHttpRequest&&new e.XMLHttpRequest;const o=null==n?void 0:n.userAgent,s="undefined"!=typeof globalThis?globalThis:t;s&&"undefined"==typeof self&&(s.self=s),s&&"undefined"==typeof File&&(s.File=function(){});const a=null!=t?t:{},l="$stored_person_properties",u="$replay_override_sampling",c="$replay_override_linked_flag",d="$replay_override_url_trigger",h="$replay_override_event_trigger",f="$session_is_sampled",v="$session_recording_url_trigger_activated_session",p="$session_recording_event_trigger_activated_session",m="$posthog_sr_group_event_trigger_",g="$posthog_sr_group_url_trigger_",y="$sess_rec_flush_size",b="$surveys",w="$sdk_debug_replay_event_trigger_status",k="$sdk_debug_replay_linked_flag_trigger_status",_="$sdk_debug_replay_matched_recording_trigger_groups",S="$sdk_debug_replay_pending_trigger_conditions",x="$sdk_debug_replay_remote_trigger_matching_config",C="$sdk_debug_replay_trigger_groups_count",I="$sdk_debug_replay_url_trigger_status",M="$sdk_debug_rrweb_attached",T="$sdk_debug_rrweb_start_attempted",R="$session_recording_start_reason";function E(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){E(o,i,r,s,a,"next",t)}function a(t){E(o,i,r,s,a,"throw",t)}s(void 0)})}}function O(t){return O="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},O(t)}function P(t,e,n){return(e=function(t){var e=function(t){if("object"!=O(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=O(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==O(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function L(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 D(t){for(var e=1;arguments.length>e;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?L(Object(n),!0).forEach(function(e){P(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):L(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}const F="min_length",N="max_length";function q(t,e){return-1!==t.indexOf(e)}const j=function(t){return t.trim()},B=Object.prototype,z=B.hasOwnProperty,H=B.toString,U=Array.isArray||function(t){return"[object Array]"===H.call(t)},W=t=>"function"==typeof t,V=t=>t===Object(t)&&!U(t),G=t=>void 0===t,Q=t=>"[object String]"==H.call(t),Z=t=>Q(t)&&0===t.trim().length,J=t=>null===t,K=t=>G(t)||J(t),X=t=>"[object Number]"==H.call(t)&&t==t,Y=t=>"[object Boolean]"===H.call(t),tt=t=>t instanceof FormData;function et(t){return null===t||"object"!=typeof t}function nt(t,e){return{}.toString.call(t)===`[object ${e}]`}function it(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 ot(t,Error)}}function rt(t){return"u">typeof Event&&ot(t,Event)}function ot(t,e){try{return t instanceof e}catch(t){return!1}}function st(t,e,n,i,r){return e>n&&(i.warn("min cannot be greater than max."),e=n),X(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),st(null!=r?r:n,e,n,i))}var at=class{constructor(t){this.C={},this.I=t.I,this.R=st(t.bucketSize,0,100,t.A),this.$=st(t.refillRate,0,this.R,t.A),this.O=st(t.refillInterval,0,864e5,t.A)}F(t,e){const n=Math.floor((e-t.lastAccess)/this.O);n>0&&(t.tokens=Math.min(t.tokens+n*this.$,this.R),t.lastAccess=t.lastAccess+n*this.O)}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.R,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 lt="Mobile",ut="Tablet",ct="Android Tablet",dt="iPad",ht="Apple Watch",ft="Nintendo",vt="PlayStation",pt="Xbox",mt="Nokia",gt="Ouya",yt="Generic "+lt.toLowerCase(),bt="Generic "+ut.toLowerCase(),wt=new RegExp(pt,"i"),kt=new RegExp("PlayStation \\w+","i"),_t=new RegExp("Nintendo \\w+","i"),St=new RegExp("BlackBerry|PlayBook|BB10","i");new RegExp(ft,"i"),new RegExp(vt,"i"),new RegExp("Windows","i");function xt(t){return t?t.split("#")[0]:t}function Ct(t){try{return t()}catch(t){return}}let It,Mt,Tt,Rt;function Et(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(Rt&&At(n,r,Mt)&&At(i,o,Tt))return Rt;Mt=n?D({},n):void 0,Tt=i?D({},i):void 0,Rt={},null!==(e=It)&&void 0!==e||(It={});const s=(e,n)=>{for(const r of e){const e=n[r];if(!e)continue;const o=null==It?void 0:It[r];if(o){Rt[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){Rt[n]=e,It[r]=n;break}}}};return i&&s(o,i),n&&s(r,n),Rt}function At(t,e,n){return t&&n?e.length===Object.keys(n).length&&e.every(e=>t[e]===n[e]):t===n}const $t=/^([a-z][a-z0-9.+-]+):/i,Ot=["http","https","file","blob","app","capacitor","ionic","webpack","webpack-internal","ng"];function Pt(t){if(!t||"<anonymous>"===t)return!1;const e=$t.exec(t);return!e||Ot.includes(e[1].toLowerCase())}function Lt(t,e,n,i,r){const o={platform:t,filename:e,function:"<anonymous>"===n?"?":n,in_app:Pt(e)};return G(i)||(o.lineno=i),G(r)||(o.colno=r),o}const Dt=(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]},Ft=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,Nt=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,qt=/\((\S*)(?::(\d+))(?::(\d+))\)/,jt=(t,e)=>{const n=Ft.exec(t);if(n){const[,t,i,r]=n;return Lt(e,t,"?",+i,+r)}const i=Nt.exec(t);if(i){if(i[2]&&0===i[2].indexOf("eval")){const t=qt.exec(i[2]);t&&(i[2]=t[1],i[3]=t[2],i[4]=t[3])}const[t,n]=Dt(i[1]||"?",i[2]);return Lt(e,n,t,i[3]?+i[3]:void 0,i[4]?+i[4]:void 0)}},Bt=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,zt=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Ht=(t,e)=>{const n=Bt.exec(t);if(n){if(n[3]&&n[3].indexOf(" > eval")>-1){const t=zt.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]=Dt(i,t),Lt(e,t,i,n[4]?+n[4]:void 0,n[5]?+n[5]:void 0)}},Ut=/\(error: (.*)\)/;function Wt(t,e){return t.filename===e.filename&&t.function===e.function&&t.module===e.module&&t.lineno===e.lineno&&t.colno===e.colno}function Vt(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(!Wt(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 Gt(t,e){const n=e.start+e.length,i=Zt(t,e);i&&t.splice(n+i===t.length?n:e.start,i)}function Qt(t,e){let n=e.start;for(;n>0&&Wt(t[n-1],t[n-1+e.length]);)n--;return e.start-n}function Zt(t,e){const n=e.start+e.length;let i=n;for(;t.length>i&&Wt(t[i],t[i-e.length]);)i++;return i-n}function Jt(t,e){const n=e[0];let i=t.length-(n?Qt(t,n):0);for(const n of e)i-=Zt(t,n);return i}function Kt(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 Xt=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;const Yt=["fatal","error","warning","log","info","debug"];function te(t,e=40){const n=Object.keys(t);if(n.sort(),!n.length)return"[object has no keys]";for(let t=n.length;t>0;t--){const i=n.slice(0,t).join(", ");if(e>=i.length)return t===n.length?i:i.length>e?`${i.slice(0,e)}...`:i}return""}const ee="NativeGzipValidationError";let ne;const ie=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}(ee,`Native gzip produced invalid output: ${t}`)},re=(oe=A(function*(t,e){18>t.size&&ie("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])&&ie("invalid-header");const r=new DataView(yield t.slice(t.size-8).arrayBuffer());r.getUint32(0,!0)!==(t=>{const e=(()=>{if(ne)return ne;ne=[];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;ne[t]=e>>>0}return ne})();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("invalid-crc");const o=e.length>>>0;r.getUint32(4,!0)!==o&&ie("invalid-size")}),function(t,e){return oe.apply(this,arguments)});var oe;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.9.4",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=de.createLogger;function fe(t,e){if(!K(t))if(U(t))t.forEach(e);else if(tt(t))t.forEach((t,n)=>e(t,n));else for(const n in t)z.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=["localhost","127.0.0.1"],ye=t=>{const e=null==i?void 0:i.createElement("a");return G(e)?null:(e.href=t,e)};function be(e){var n;const i=null==t||null===(n=t.location)||void 0===n?void 0:n.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 Q(t)&&t?t:e}catch(t){return de.error("Error in get_current_url, falling back to window.location.href",t),e}}(e,i)}function we(t){return!!t&&1===t.nodeType}function ke(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function _e(t){return!!t&&11===t.nodeType&&we(t.host)}function Se(t){return t?j(t).split(/\s+/):[]}function xe(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 Se(e)}function Ce(t){let e="";return Le(t)&&!De(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 K(t)?null:j(t).split(/(\s+)/).filter(t=>Ue(t)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}(t.textContent))&&void 0!==n?n:"")}),j(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 Me=["a","button","form","input","select","textarea","label"];function Te(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}}function Re(t){const e=t.parentNode;return!(!e||!we(e))&&e}const Ee=[".ph-no-deadclick",".ph-no-capture"];const Ae=["","text","search","email","password","url","tel","number"];function $e(t){return!(!t||!we(t))&&(!!ke(t,"textarea")||(ke(t,"input")?q(Ae,(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 Oe=t=>!t||ke(t,"html")||!we(t),Pe=(e,n)=>{if(!t||Oe(e))return{parentIsUsefulElement:!1,targetElementList:[]};let i=!1;const r=[e];let o=e;for(;o.parentNode&&!ke(o,"body");){if(_e(o.parentNode)){r.push(o.parentNode.host),o=o.parentNode.host;continue}const e=Re(o);if(!e)break;if(n||Me.indexOf(e.tagName.toLowerCase())>-1)i=!0;else try{const n=t.getComputedStyle(e);n&&"pointer"===n.getPropertyValue("cursor")&&(i=!0)}catch(t){}r.push(e),o=e}return{parentIsUsefulElement:i,targetElementList:r}};function Le(t){const e=new Set;let n=0;for(let i=t;i.parentNode&&!ke(i,"body");i=i.parentNode){if(n++>=1e3||e.has(i))return!1;e.add(i);const t=xe(i);if(q(t,"ph-sensitive")||q(t,"ph-no-capture"))return!1}if(q(xe(t),"ph-include"))return!0;const i=t.type||"";if(Q(i))switch(i.toLowerCase()){case"hidden":case"password":return!1}const r=t.name||t.id||"";return!Q(r)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(r.replace(/[^a-zA-Z0-9]/g,""))}function De(t){return!!(ke(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||ke(t,"select")||ke(t,"textarea")||"true"===t.getAttribute("contenteditable"))}const Fe=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}))$"),Ne=/(^|[^0-9A-Za-z_])([0-9][0-9 -]*[0-9])(?=$|[^0-9A-Za-z_])/g,qe=[16,15,14,13],je=new RegExp("^(\\d{3}-?\\d{2}-?\\d{4})$"),Be=new RegExp("(^|[^0-9])((?!000|666)[0-9]{3}-?(?!00)[0-9]{2}-?(?!0000)[0-9]{4})(?=$|([^0-9]))","g"),ze=/[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 Ue(t,e=!0){if(K(t))return!1;if(Q(t)){if(t=j(t),e?Fe.test((t||"").replace(/[- ]/g,"")):function(t){let e;for(Ne.lastIndex=0;e=Ne.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 qe){const i=t+e;if(n.length>=i){const e=n.slice(t,i);if(Fe.test(e)&&He(e))return!0}}}return!1}(t))return!1;if(e?je.test(t):function(t){let e;for(Be.lastIndex=0;e=Be.exec(t);){const t=e[1],n=e[3];if(!(t&&n&&ze.test(t)&&ze.test(n)))return!0}return!1}(t))return!1}return!0}function We(t){let e=Ce(t);return e=`${e} ${Ve(t)}`.trim(),Ue(e)?e:""}function Ve(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=Ce(t);e=`${e} ${n}`.trim(),t.childNodes&&t.childNodes.length&&(e=`${e} ${Ve(t)}`.trim())}catch(t){de.error("[AutoCapture]",t)}}),e}function Ge(t){return t.replace(/"|\\"/g,'\\"')}function Qe(t){const e=t.attr__class;if(e)return U(e)?e:Se(e)}const Ze=1e6;function Je(t){var e;return Math.min(Ze,null!==(e=t.payloadSizeLimitBytes)&&void 0!==e?e:Ze)}const Ke={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:Ze,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},Xe=["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"],Ye=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],tn=["auth","token","secret","session","api-key","apikey","api_key","credential","password","passwd","cookie","csrf","xsrf"],en=t=>{K(t)||fe(Object.keys(t),e=>{(t=>{const e=t.toLowerCase();return Xe.includes(e)||tn.some(t=>e.includes(t))})(e)&&(t[e]="redacted")})},nn=["/s/","/e/","/i/"];function rn(t,e,n,i){if(K(t))return t;let r=(null==e?void 0:e["content-length"])||function(t){return new Blob([t]).size}(t);return Q(r)&&(r=parseInt(r)),r>n?`[SessionRecording] ${i} body too large to record (${r} bytes)`:t}function on(t,e){if(K(t))return t;let n=t;return Ue(n,!1)||(n="[SessionRecording] "+e+" body redacted"),fe(Ye,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 sn=new WeakSet,an="disabled",ln="sampled",un="active",cn="buffering",dn="paused",hn="rrweb_error",fn="trigger_activated",vn="trigger_pending",pn="trigger_disabled";function mn(t,e,n,i,r,o){return 0===e?pn:(null==t?void 0:t.get_property(n?i+n:r))===o?fn:vn}function gn(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 yn(t){return t.includes("trigger_activated")?fn:t.includes("trigger_pending")?vn:pn}function bn(t){const e=new Set(t);switch(e.delete(pn),e.size){case 0:return pn;case 1:return Array.from(e)[0];default:return vn}}var wn=class{constructor(t){this.q=t}triggerStatus(t){return yn(this.q.map(e=>e.triggerStatus(t)))}triggerStatusNoSideEffects(t){return yn(this.q.map(e=>e.triggerStatusNoSideEffects(t)))}stop(){this.q.forEach(t=>t.stop())}},kn=class{constructor(t){this.q=t}triggerStatus(t){return bn(this.q.map(e=>e.triggerStatus(t)))}triggerStatusNoSideEffects(t){return bn(this.q.map(e=>e.triggerStatusNoSideEffects(t)))}stop(){this.q.forEach(t=>t.stop())}},_n=class{triggerStatus(){return this.triggerStatusNoSideEffects()}triggerStatusNoSideEffects(){return fn}stop(){}};const Sn=t=>"sessionRecording"in t;var xn=class{constructor(t,e){this._instance=t,this.j=[],this.B=[],this.H=new Map,this.U=new Map,this.W="",this.urlBlocked=!1,this.V=e}onConfig(t){var e,n;this.j=(Sn(t)?V(t.sessionRecording)?null===(e=t.sessionRecording)||void 0===e?void 0:e.urlTriggers:[]:null==t?void 0:t.urlTriggers)||[],this.B=(Sn(t)?V(t.sessionRecording)?null===(n=t.sessionRecording)||void 0===n?void 0:n.urlBlocklist:[]:null==t?void 0:t.urlBlocklist)||[],this.G()}G(){this.H.clear(),this.U.clear();for(const t of this.j)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 trigger regex pattern:",t.url,e)}for(const t of this.B)if("regex"===t.matching&&!this.U.has(t.url))try{this.U.set(t.url,new RegExp(t.url))}catch(e){de.error("Invalid URL blocklist regex pattern:",t.url,e)}}onRemoteConfig(t){this.onConfig(t)}Z(t){return mn(this._instance,this.j.length,this.V,g,v,t)}triggerStatus(t){const e=this.triggerStatusNoSideEffects(t);return this._instance.register_for_session({[I]:e}),e}triggerStatusNoSideEffects(t){return this.Z(t)}isCurrentUrlBlocked(){const t=be(this._instance);if(!t)return!1;try{return gn(t,this.B,this.U)}catch(t){return!0}}checkUrlBlocklist(t,e){const n=be(this._instance);if(!n)return;if(n===this.W)return;this.W=n;const i=this.urlBlocked,r=gn(n,this.B,this.U);i&&r||(r&&!i?t():!r&&i&&e())}checkUrlTriggerConditions(t,e,n,i){const r=be(this._instance);if(!r)return;if(r===this.W)return;this.W=r;const o=this.urlBlocked,s=gn(r,this.B,this.U);s&&!o?t():!s&&o&&e();const a=this.Z(i)===fn,l=gn(r,this.j,this.H);!a&&l&&n("url",r)}stop(){this.W=""}},Cn=class{constructor(t){this._instance=t,this.linkedFlag=null,this.linkedFlagSeen=!1,this.J=()=>{}}triggerStatus(){const t=this.triggerStatusNoSideEffects();return this._instance.register_for_session({[k]:t}),t}triggerStatusNoSideEffects(){let t=vn;return K(this.linkedFlag)&&(t=pn),this.linkedFlagSeen&&(t=fn),t}onConfig(t,e){var n;if(this.linkedFlag=(Sn(t)?V(t.sessionRecording)?null===(n=t.sessionRecording)||void 0===n?void 0:n.linkedFlag:null:null==t?void 0:t.linkedFlag)||null,!K(this.linkedFlag)&&!this.linkedFlagSeen){const t=Q(this.linkedFlag)?this.linkedFlag:this.linkedFlag.flag,n=Q(this.linkedFlag)?null:this.linkedFlag.variant;this.J=this._instance.onFeatureFlags((i,r)=>{let o=!1;if(V(r)&&t in r){const e=r[t];o=Y(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.J()}},In=class{constructor(t,e){this._instance=t,this.K=[],this.V=e}onConfig(t){var e;this.K=(Sn(t)?V(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 mn(this._instance,this.K.length,this.V,m,p,t)}triggerStatus(t){const e=this.triggerStatusNoSideEffects(t);return this._instance.register_for_session({[w]:e}),e}triggerStatusNoSideEffects(t){return this.X(t)}checkEventTriggerConditions(t,e,n){if(0===this.K.length)return;const i=this.X(n)===fn,r=this.K.includes(t);!i&&r&&e("event",t)}stop(){}},Mn=class{constructor(t,e,n){if(this._instance=t,this.group=e,this.Y=new xn(t,e.id),this.tt=new In(t,e.id),this.et=new Cn(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.Y.onConfig(i),this.tt.onConfig(i),this.et.onConfig(i,n);const r=[this.tt,this.Y,this.et];this.nt="any"===e.conditions.matchType?new wn(r):new kn(r)}else this.nt=new _n}triggerStatus(t){return this.nt.triggerStatus(t)}triggerStatusNoSideEffects(t){return this.nt.triggerStatusNoSideEffects(t)}getPendingTriggerConditions(t){return"trigger_pending"!==this.triggerStatusNoSideEffects(t)?[]:[{label:"URL condition not matched",status:this.Y.triggerStatusNoSideEffects(t)},{label:"event condition not matched",status:this.tt.triggerStatusNoSideEffects(t)},{label:"linked flag condition not matched",status:this.et.triggerStatusNoSideEffects()}].filter(({status:t})=>t===vn).map(({label:t})=>t)}checkEventTriggerConditions(t,e,n){this.tt.checkEventTriggerConditions(t,e,n)}checkUrlTriggerConditions(t,e,n,i){this.Y.checkUrlTriggerConditions(t,e,n,i)}activateTrigger(t,e){var n;const i="url"===t?g+this.group.id:m+this.group.id;null===(n=this._instance.persistence)||void 0===n||n.register({[i]:e})}stop(){this.Y.stop(),this.tt.stop(),this.et.stop()}};function Tn(t){if(t.rrwebError)return hn;if(!t.receivedFlags)return cn;if(!t.isRecordingEnabled)return an;if(t.urlTriggerMatching.urlBlocked)return dn;const e=!0===t.isSampled,n=new wn([t.eventTriggerMatching,t.urlTriggerMatching,t.linkedFlagMatching]).triggerStatus(t.sessionId);return e?ln:"trigger_activated"===n?un:"trigger_pending"===n?cn:!1===t.isSampled?an:un}function Rn(t){if(t.rrwebError)return hn;if(!t.receivedFlags)return cn;if(!t.isRecordingEnabled)return an;if(t.urlTriggerMatching.urlBlocked)return dn;const e=new kn([t.eventTriggerMatching,t.urlTriggerMatching,t.linkedFlagMatching]).triggerStatus(t.sessionId),n=e!==pn,i=Y(t.isSampled);return n&&"trigger_pending"===e?cn:n&&"trigger_disabled"===e||i&&!t.isSampled?an:!0===t.isSampled?ln:un}function En(){const t=[];return function(e,n){if(V(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 An(t){try{const e=JSON.stringify(t,En());return e?new Blob([e]).size:0}catch(t){return-1}}function $n(t){if(J(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)||J(i)?4:$n(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+$n(r))}return n}default:return 0}}function On(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[On({size:n.reduce((t,e)=>t+e,0),data:t.data.slice(0,e),sizes:n,sessionId:t.sessionId,windowId:t.windowId}),On({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 Pn=Uint8Array,Ln=Uint16Array,Dn=Uint32Array,Fn=new Pn([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]),Nn=new Pn([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]),qn=new Pn([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),jn=function(t,e){for(var n=new Ln(31),i=0;31>i;++i)n[i]=e+=1<<t[i-1];var r=new Dn(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]},Bn=jn(Fn,2),zn=Bn[1];Bn[0][28]=258,zn[258]=28;for(var Hn=jn(Nn,0)[1],Un=new Ln(32768),Wn=0;32768>Wn;++Wn){var Vn=(43690&Wn)>>>1|(21845&Wn)<<1;Un[Wn]=((65280&(Vn=(61680&(Vn=(52428&Vn)>>>2|(13107&Vn)<<2))>>>4|(3855&Vn)<<4))>>>8|(255&Vn)<<8)>>>1}var Gn=function(t,e,n){for(var i=t.length,r=0,o=new Ln(e);i>r;++r)++o[t[r]-1];var s,a=new Ln(e);for(r=0;e>r;++r)a[r]=a[r-1]+o[r-1]<<1;if(n){s=new Ln(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[Un[d]>>>l]=u}else for(s=new Ln(i),r=0;i>r;++r)s[r]=Un[a[t[r]-1]++]>>>15-t[r];return s},Qn=new Pn(288);for(Wn=0;144>Wn;++Wn)Qn[Wn]=8;for(Wn=144;256>Wn;++Wn)Qn[Wn]=9;for(Wn=256;280>Wn;++Wn)Qn[Wn]=7;for(Wn=280;288>Wn;++Wn)Qn[Wn]=8;var Zn=new Pn(32);for(Wn=0;32>Wn;++Wn)Zn[Wn]=5;var Jn=Gn(Qn,9,0),Kn=Gn(Zn,5,0),Xn=function(t){return(t/8|0)+(7&t&&1)},Yn=function(t,e,n){(null==e||0>e)&&(e=0),(null==n||n>t.length)&&(n=t.length);var i=new(t instanceof Ln?Ln:t instanceof Dn?Dn:Pn)(n-e);return i.set(t.subarray(e,n)),i},ti=function(t,e,n){var i=e/8|0;t[i]|=n<<=7&e,t[i+1]|=n>>>8},ei=function(t,e,n){var i=e/8|0;t[i]|=n<<=7&e,t[i+1]|=n>>>8,t[i+2]|=n>>>16},ni=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 Pn(0),0];if(1==r){var s=new Pn(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 Ln(h+1),v=ii(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 Pn(f),v]},ii=function(t,e,n){return-1==t.s?Math.max(ii(t.l,e,n+1),ii(t.r,e,n+1)):e[t.s]=n},ri=function(t){for(var e=t.length;e&&!t[--e];);for(var n=new Ln(++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]},oi=function(t,e){for(var n=0,i=0;e.length>i;++i)n+=t[i]*e[i];return n},si=function(t,e,n){var i=n.length,r=Xn(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)},ai=function(t,e,n,i,r,o,s,a,l,u,c){ti(e,c++,n),++r[256];for(var d=ni(r,15),h=d[0],f=d[1],v=ni(o,15),p=v[0],m=v[1],g=ri(h),y=g[0],b=g[1],w=ri(p),k=w[0],_=w[1],S=new Ln(19),x=0;y.length>x;++x)S[31&y[x]]++;for(x=0;k.length>x;++x)S[31&k[x]]++;for(var C=ni(S,7),I=C[0],M=C[1],T=19;T>4&&!I[qn[T-1]];--T);var R,E,A,O,P=u+5<<3,L=oi(r,Qn)+oi(o,Zn)+s,D=oi(r,h)+oi(o,p)+s+14+3*T+oi(S,I)+(2*S[16]+3*S[17]+7*S[18]);if(L>=P&&D>=P)return si(e,c,t.subarray(l,l+u));if(ti(e,c,1+(L>D)),c+=2,L>D){R=Gn(h,f,0),E=h,A=Gn(p,m,0),O=p;var F=Gn(I,M,0);for(ti(e,c,b-257),ti(e,c+5,_-1),ti(e,c+10,T-4),c+=14,x=0;T>x;++x)ti(e,c+3*x,I[qn[x]]);c+=3*T;for(var N=[y,k],q=0;2>q;++q){var j=N[q];for(x=0;j.length>x;++x)ti(e,c,F[B=31&j[x]]),c+=I[B],B>15&&(ti(e,c,j[x]>>>5&127),c+=j[x]>>>12)}}else R=Jn,E=Qn,A=Kn,O=Zn;for(x=0;a>x;++x)if(i[x]>255){var B;ei(e,c,R[257+(B=i[x]>>>18&31)]),c+=E[B+257],B>7&&(ti(e,c,i[x]>>>23&31),c+=Fn[B]);var z=31&i[x];ei(e,c,A[z]),c+=O[z],z>3&&(ei(e,c,i[x]>>>5&8191),c+=Nn[z])}else ei(e,c,R[i[x]]),c+=E[i[x]];return ei(e,c,R[256]),c+E[256]},li=new Dn([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),ui=new Pn(0),ci=function(){for(var t=new Dn(256),e=0;256>e;++e){for(var n=e,i=9;--i;)n=(1&n&&3988292384)^n>>>1;t[e]=n}return t}(),di=function(t,e,n){for(;n;++e)t[e]=n,n>>>=8};function hi(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=ci[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 Pn(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=si(l,u,t.subarray(c,d)):(l[c]=o,u=si(l,u,t.subarray(c,s)))}else{for(var h=li[e-1],f=h>>>13,v=8191&h,p=(1<<n)-1,m=new Ln(32768),g=new Ln(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 Dn(25e3),_=new Ln(288),S=new Ln(32),x=0,C=0,I=(c=0,0),M=0,T=0;s>c;++c){var R=w(c),E=32767&c,A=g[R];if(m[E]=A,g[R]=E,c>=M){var O=s-c;if((x>7e3||I>24576)&&O>423){u=ai(t,l,0,k,_,S,C,I,T,c-T,u),I=x=C=0,T=c;for(var P=0;286>P;++P)_[P]=0;for(P=0;30>P;++P)S[P]=0}var L=2,D=0,F=v,N=E-A&32767;if(O>2&&R==w(c-N))for(var q=Math.min(f,O)-1,j=Math.min(32767,c),B=Math.min(258,O);j>=N&&--F&&E!=A;){if(t[c+L]==t[c+L-N]){for(var z=0;B>z&&t[c+z]==t[c+z-N];++z);if(z>L){if(L=z,D=N,z>q)break;var H=Math.min(N,z-2),U=0;for(P=0;H>P;++P){var W=c-N+P+32768&32767,V=W-m[W]+32768&32767;V>U&&(U=V,A=W)}}}N+=(E=A)-(A=m[E])+32768&32767}if(D){k[I++]=268435456|zn[L]<<18|Hn[D];var G=31&zn[L],Q=31&Hn[D];C+=Fn[G]+Nn[Q],++_[257+G],++S[Q],M=c+L,++x}else k[I++]=t[c],++_[t[c]]}}u=ai(t,l,o,k,_,S,C,I,T,c-T,u),o||(u=si(l,u,ui))}return Yn(a,0,i+Xn(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&&di(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),di(u,c-8,n.d()),di(u,c-4,i),u}function fi(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 vi=class{constructor(t,e={}){var n,i,r,o;this._rrweb=t,this.it=e,this.rt={},this.ot=Date.now(),this.st=-1/0,this.ut=()=>{const t=Date.now(),e=t-this.ot;e>0?(this.ct=Math.min(this.dt,this.ct+e/1e3*this.ht),this.ot=t):this.ot=t},this.ft=t=>{if(!this.rt[t]){var e,n;this.rt[t]=!0;const i=this.vt(t);null===(e=(n=this.it).onBlockedNode)||void 0===e||e.call(n,t,i)}},this.yt=t=>{const e=this.vt(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.vt=t=>this._rrweb.mirror.getNode(t),this.bt=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.bt(e);if(e.attributes){const t=e.attributes.length;e.attributes=e.attributes.filter(t=>{const[e]=this.yt(t.id);return!this.wt.consumeRateLimit(e)&&t});const n=t-e.attributes.length;var i,r;n>0&&(null===(i=(r=this.it).onDroppedAttributeMutations)||void 0===i||i.call(r,n))}const o=this.bt(e);if(0===o&&n!==o)return;if(this.kt)return t;this.ut();const s=$n(t);var a,l;return s>this.ct?(null===(a=(l=this.it).onDroppedOversizedMutation)||void 0===a||a.call(l,s),void this._t()):(this.ct-=s,t)},this._t=()=>{if(this.St)return;const t=Math.max(0,this.xt-(Date.now()-this.st));this.St=setTimeout(()=>{var t,e;this.St=void 0,this.st=Date.now(),null===(t=(e=this.it).requestFullSnapshot)||void 0===t||t.call(e)},t)},this.wt=new at({bucketSize:null!==(n=this.it.bucketSize)&&void 0!==n?n:100,refillRate:null!==(i=this.it.refillRate)&&void 0!==i?i:10,refillInterval:1e3,I:this.ft,A:de}),this.dt=null!==(r=this.it.bytesBucketSize)&&void 0!==r?r:0,this.ht=null!==(o=this.it.bytesRefillRate)&&void 0!==o?o:25600,this.kt=!Number.isFinite(this.dt)||0>=this.dt,this.ct=this.dt;const s=this.it.resyncIntervalMs;this.xt=X(s)&&Number.isFinite(s)&&s>0?s:3e5}reset(){this.rt={},this.St&&(clearTimeout(this.St),this.St=void 0),this.st=Date.now()}stop(){this.wt.stop(),this.reset(),this.ct=this.dt,this.ot=Date.now(),this.st=-1/0}};Math.trunc||(Math.trunc=function(t){return 0>t?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return X(t)&&isFinite(t)&&Math.floor(t)===t});var pi=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}},mi=class{generate(){const t=this.generateOrAbort();if(!G(t))return t;{this.Ct=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 X(t)&&isFinite(t)?Math.min(Math.max(Math.floor(t),0),0xffffffffffff):0})();if(t>this.Ct)this.Ct=t,this.It();else{if(this.Ct>=t+1e4)return;this.Mt++,this.Mt>4398046511103&&(this.Ct++,this.It())}return pi.fromFieldsV7(this.Ct,Math.trunc(this.Mt/Math.pow(2,30)),this.Mt&Math.pow(2,30)-1,this.Tt.nextUint32())}It(){this.Mt=1024*this.Tt.nextUint32()+(1023&this.Tt.nextUint32())}constructor(){this.Ct=0,this.Mt=0,this.Tt=new yi}};let gi=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};t&&!G(t.crypto)&&crypto.getRandomValues&&(gi=t=>crypto.getRandomValues(t));var yi=class{nextUint32(){return this.Rt.length>this.Et||(gi(this.Rt),this.Et=0),this.Rt[this.Et++]}constructor(){this.Rt=new Uint32Array(8),this.Et=1/0}};let bi;const wi=()=>ki().toString(),ki=()=>(bi||(bi=new mi)).generate();let _i=null;const Si={At(){if(!J(_i))return _i;let e=!0;if(G(t))e=!1;else try{const t="__mplssupport__";Si.$t(t,"xyz"),'"xyz"'!==Si.Ot(t)&&(e=!1),Si.Pt(t)}catch(t){e=!1}return e||de.error("localStorage unsupported; falling back to cookie store"),_i=e,e},Lt(t){de.error("localStorage error: "+t)},Ot(e){try{return null==t?void 0:t.localStorage.getItem(e)}catch(t){Si.Lt(t)}return null},Dt(t){try{return JSON.parse(Si.Ot(t))||{}}catch(t){}return null},$t(e,n){try{return null==t||t.localStorage.setItem(e,JSON.stringify(n)),!0}catch(t){Si.Lt(t)}return!1},Pt(e){try{null==t||t.localStorage.removeItem(e)}catch(t){Si.Lt(t)}}};let xi=null;const Ci={At(){if(!J(xi))return xi;if(xi=!0,G(t))xi=!1;else try{const t="__support__";Ci.$t(t,"xyz"),'"xyz"'!==Ci.Ot(t)&&(xi=!1),Ci.Pt(t)}catch(t){xi=!1}return xi},Lt(t){de.error("sessionStorage error: ",t)},Ot(e){try{return null==t?void 0:t.sessionStorage.getItem(e)}catch(t){Ci.Lt(t)}return null},Dt(t){try{return JSON.parse(Ci.Ot(t))||null}catch(t){}return null},$t(e,n){try{return null==t||t.sessionStorage.setItem(e,JSON.stringify(n)),!0}catch(t){Ci.Lt(t)}return!1},Pt(e){try{null==t||t.sessionStorage.removeItem(e)}catch(t){Ci.Lt(t)}}};ue.DEBUG=!1,ue.LIB_VERSION="1.438.8",ue.LIB_NAME="web";var Ii=ue,Mi=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.Ft=t.get_property.bind(t),this.Nt=t.persistence.set_property.bind(t.persistence)}trackSize(t,e){this.Nt(y,{sessionId:t,size:this.currentTrackedSize(t)+e})}currentTrackedSize(t){const e=this.Ft(y);return V(n=e)&&Q(n.sessionId)&&X(n.size)&&e.sessionId===t?e.size:0;var n}};function Ti(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<st(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 Ai({event:t,survey:e,responses:n={},submissionId:i,completed:r,surveyLanguage:o,questionSnapshots:s}){return D(D(D(D({},!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)}),D(D({$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=>!K(t))}function Oi(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 Pi(t){return"string"==typeof t&&t.trim()?t.trim():null}function Li(t){return t.toLowerCase()}function Di(t,e,n){if(!t||!e)return null;const i=Li(e),r=Object.keys(t).find(t=>Li(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=>Li(t)===r);if(o)return null==n||n.debug(`Found base language translation match: ${o} (from ${e})`),o}return null}const Fi=["thankYouMessageHeader","thankYouMessageDescription","thankYouMessageCloseButtonText","introScreenHeader","introScreenDescription","introScreenButtonText","submitButtonText","backButtonText"];function Ni(t,e,n){var i;const r=Di(t.translations,e,n),o=D({},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=D({},o.appearance);for(const n of Fi){const i=e[n];G(i)||(t[n]=i,s=!0)}o.appearance=t}else(function(t){return Fi.some(e=>!G(t[e]))})(e)&&(s=!0)}const l=t.questions.map(t=>function(t,e,n){var i;const r=Di(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=D({},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 qi(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 ji=(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}},Bi=t=>t.toLowerCase(),zi={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=>ji(e,t))),not_regex:(t,e)=>e.every(e=>t.every(t=>!ji(e,t))),icontains:(t,e)=>e.map(Bi).some(e=>t.map(Bi).some(t=>e.includes(t))),not_icontains:(t,e)=>e.map(Bi).every(e=>t.map(Bi).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))})},Hi=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},Ui=new Set(["is_not","not_icontains","not_regex"]);function Wi(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)||J(r))return Ui.has(o);const s=zi[o];return!!s&&!G(t.value)&&!J(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 Gi(t,e){return e?t:"!"+t}function Qi(t,e){return t===e||t!=="!"+e&&null}var Zi=class{constructor(t,e,n,i,r,o,s){this._instance=t,this.Y=e,this.tt=n,this.et=i,this.qt=r,this.jt=o,this.Bt=s,this.zt=null,this.Ht=Rn}onRemoteConfig(t){this.zt=X(t.sampleRate)?t.sampleRate:null,"any"===t.triggerMatchType?(this.Ut=new wn([this.tt,this.Y]),this.Ht=Tn):(this.Ut=new kn([this.tt,this.Y]),this.Ht=Rn),this._instance.register_for_session({[x]:t.triggerMatchType}),this.Y.onConfig(t),this.tt.onConfig(t),this.et.onConfig(t,(t,e)=>{this.qt("linked_flag_matched",{flag:t,variant:e}),this.Bt()})}getStatus(t){return this.Ht({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 X(n)?n:null}checkUrlTriggers(t,e,n,i){this.Y.checkUrlTriggerConditions(e,n,i,t)}setupEventTriggerListeners(t,e,n){if(0!==this.tt.K.length&&K(this.Wt))return this.Wt=t(t=>{try{this.tt.checkEventTriggerConditions(t.event,n,e)}catch(t){Vi.error("Could not activate event trigger",t)}}),this.Wt}makeSamplingDecisions(t){var e;const n=this.zt;var i,r;if(!X(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(f),s=this._instance.get_property("$replay_sample_rate"),a=Qi(o,t),l=X(s)&&s!==n,u=G(s)&&o===t,c=l||u||!Y(a),d=c?Ti(t,n):a;c&&(d?this.qt("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:Gi(t,d),$replay_sample_rate:J(s)&&o===t?null:n})}ensureSamplingDecision(t){if(!X(this.zt))return;const e=this._instance.get_property(f);Y(Qi(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.Ut)||void 0===e?void 0:e.triggerStatus(t))===vn}getPendingTriggerConditions(t){return[{label:"URL condition not matched",status:this.Y.triggerStatusNoSideEffects(t)},{label:"event condition not matched",status:this.tt.triggerStatusNoSideEffects(t)},{label:"linked flag condition not matched",status:this.et.triggerStatusNoSideEffects()}].filter(({status:t})=>t===vn).map(({label:t})=>t)}stop(){var t;null===(t=this.Wt)||void 0===t||t.call(this),this.Wt=void 0,this.tt.stop(),this.Y.stop(),this.et.stop()}},Ji=class{constructor(t,e,n,i,r){this._instance=t,this.Y=e,this.qt=n,this.Vt=i,this.Bt=r,this.Gt=[],this.Qt=new Map,this.Zt=!1}onRemoteConfig(t){t.triggerGroups&&0!==t.triggerGroups.length?(this.Jt(t.triggerGroups),this._instance.register_for_session({[x]:"v2_trigger_groups",[C]:t.triggerGroups.length}),this.Y.onConfig(t)):Vi.warn("[V2Strategy] No trigger groups configured")}getStatus(t){return function(t){if(t.rrwebError)return hn;if(!t.receivedFlags)return cn;if(!t.isRecordingEnabled)return an;if(t.urlTriggerMatching.urlBlocked)return dn;const e=t.triggerGroupMatchers,n=t.triggerGroupSamplingResults;if(0===e.length)return an;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?ln:i?cn:an}({receivedFlags:!0,isRecordingEnabled:!0,isSampled:t.isSampled,rrwebError:t.rrwebError,urlTriggerMatching:t.urlTriggerMatching,eventTriggerMatching:t.eventTriggerMatching,linkedFlagMatching:t.linkedFlagMatching,sessionId:t.sessionId,triggerGroupMatchers:this.Gt,triggerGroupSamplingResults:this.Qt,minimumDuration:this.getMinimumDuration(t.sessionId)})}getMinimumDuration(t){let e=null;for(const n of this.Gt)if("trigger_activated"===n.triggerStatus(t)){const t=n.group.minDurationMs;X(t)&&(J(e)||e>t)&&(e=t)}return e}checkUrlTriggers(t,e,n,i){this.Y.checkUrlBlocklist(e,n);for(const i of this.Gt)i.checkUrlTriggerConditions(e,n,e=>{this.Kt(i,void 0)&&(i.activateTrigger(e,t),this.updateActiveTriggers(t),this.Bt(e))},t)}setupEventTriggerListeners(t,e,n){return this.Wt=t(t=>{var n;if(this.Zt)return Vi.info("[SessionRecorder] Stopping trigger checks - initial buffer flushed"),null===(n=this.Wt)||void 0===n||n.call(this),void(this.Wt=void 0);try{for(const n of this.Gt)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(l);r.some(e=>!e.properties||0===e.properties.length||Wi(e.properties,t.properties,o))&&(n.activateTrigger(i,e),this.updateActiveTriggers(e),this.Bt(i))},e)}catch(t){Vi.error("Could not activate event trigger for trigger groups",t)}}),this.Wt}makeSamplingDecisions(t){for(const n of this.Gt){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(V(a)){const e=a.sessionId,n=a.sampleRate,i=a.sampled;u="string"==typeof e&&e!==t,c=X(n)&&n!==o,l=e===t&&X(n)&&n===o&&Y(i)?i:null}else l=a===t||null,u="string"==typeof a&&a!==t,d=a===t;const h=u||c||d||!Y(l),f=h?Ti(t+r,o):l;h&&this.Vt("triggerGroupSamplingDecisionMade",{group_id:r,group_name:i.name,sampleRate:o,isSampled:f}),this.Qt.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.Zt=!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.Gt){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.Gt){const i=n.group,r=i.id,o="trigger_activated"===n.triggerStatus(t),s=!0===this.Qt.get(r);o&&e.push({id:r,name:i.name,matched:!0,sampled:s})}this._instance.register_for_session({[_]:e})}hasPendingTriggers(t){for(const e of this.Gt)if("trigger_pending"===e.triggerStatus(t))return!0;return!1}getPendingTriggerConditions(t){return this.Gt.flatMap(e=>"trigger_pending"!==e.triggerStatusNoSideEffects(t)?[]:e.getPendingTriggerConditions(t).map(t=>`trigger group "${e.group.name}": ${t}`))}stop(){var t;null===(t=this.Wt)||void 0===t||t.call(this),this.Wt=void 0,this.Gt.forEach(t=>t.stop()),this.Gt=[],this.Qt.clear(),this.Y.stop()}Kt(t,e){const n=t.group.conditions.properties;return!n||0===n.length||Wi(n,e,this._instance.get_property(l))}Jt(t){this.Gt.forEach(t=>t.stop()),this.Gt=[],this.Qt.clear();for(const e of t){const t=new Mn(this._instance,e,(t,n)=>{this.qt("linked_flag_matched",{flag:t,variant:n,group_id:e.id,group_name:e.name}),this.Bt()});this.Gt.push(t)}}};const Ki=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","oppref","irclid","_kx"],Xi=1e5,Yi=/^[A-Za-z0-9]*[A-Za-z][A-Za-z0-9]*$/,tr=[],er=()=>!1,nr="@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(" "),ir="Action BorrowAction ReadAction SearchAction SeekToAction SolveMathAction WatchAction".split(" "),rr="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(" "),or="Accommodation AdministrativeArea Country Place State".split(" "),sr={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:ir,publisher:rr},Event:{startDate:!0,endDate:!0,previousStartDate:!0,aggregateRating:["AggregateRating"],offers:["AggregateOffer","Offer"]},ItemList:{itemListElement:["ListItem"]},ListItem:{item:tr},Offer:{seller:rr},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:rr,offers:["Offer","AggregateOffer"],aggregateRating:["AggregateRating"]},Service:{name:!0,serviceType:!0,category:!0,provider:rr,areaServed:or,offers:["AggregateOffer","Offer"],aggregateRating:["AggregateRating"]},OfferCatalog:{name:!0,itemListElement:tr}},ar=[["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(" "),sr.CreativeWork],["BroadcastEvent BusinessEvent EducationEvent Festival MusicEvent SportsEvent TheaterEvent".split(" "),sr.Event],[rr,sr.Organization],[or,sr.Place],["Car IndividualProduct ProductGroup ProductModel".split(" "),sr.Product]];function lr(t,e){return z.call(t,e)?t[e]:void 0}function ur(t){const e=typeof t;return J(t)||"string"===e||"number"===e||"boolean"===e}function cr(t,e){return e&&function(t){return Q(t)&&/^(https?:\/\/|\/|\.\.?\/)/i.test(t.trim())}(t)?e(t.trim())||void 0:t}function dr(t,e){return U(t)&&t.every(ur)?t.map(t=>cr(t,e)).filter(t=>!G(t)):ur(t)?cr(t,e):void 0}function hr(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 fr(t){if(z.call(sr,t))return sr[t];for(const[e,n]of ar)if(e.includes(t))return n}function vr(t,e,n){Object.defineProperty(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0})}function pr(t,e,n,i){if(U(t)){const r=t.map(t=>pr(t,e,n,i)).filter(t=>!G(t));return r.length?r:void 0}return mr(t,e,n,i)||void 0}function mr(t,e,n,i){if(!V(t)||!function(t){return t.remainingNodes?(t.remainingNodes--,!0):(t.exceeded=!0,!1)}(n))return null;const r=lr(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&&Yi.test(n)&&!e.has(n)&&(e.add(n),i.push(n),20===i.length))break}return i}(r),s=o.filter(t=>!!fr(t)&&(!i||!i.length||i.includes(t))),a={};for(const i of nr){const s="@type"===i?o.length?"string"==typeof r?o[0]:o:void 0:"@id"===i?hr(lr(t,i),e):dr(lr(t,i),n.maskUrl);G(s)||vr(a,i,s)}for(const i of s){const r=fr(i);for(const i of Object.keys(r)){const o=lr(t,i),s=r[i];if(!0===s){const t=dr(o,n.maskUrl);G(t)||vr(a,i,t)}else{const t=pr(o,e,n,s);G(t)||vr(a,i,t)}}}const l=pr(lr(t,"@graph"),e,n);return G(l)||vr(a,"@graph",l),Object.keys(a).length?a:null}function gr(t,e,n){if(!V(t))return null;const i=lr(t,"@context");if("string"!=typeof i||!/^https?:\/\/schema\.org\/?$/.test(i))return null;const r=mr(t,e,n);return r?D({"@context":"https://schema.org"},r):null}function yr(t){var e;return"SCRIPT"===t.nodeName&&"application/ld+json"===(null===(e=t.getAttribute("type"))||void 0===e?void 0:e.trim().toLowerCase())}function br(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 wr(t,e,n){for(let i=t;i;){if(br(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 kr(t){return yr(t)?[t]:t.nodeType!==t.ELEMENT_NODE?[]:Array.from(t.querySelectorAll("script")).filter(yr)}function _r(t){return V(t)?t.network_timing:t}const Sr=he("[SessionRecording]"),xr=[1,2,3,4,5,6,7,12],Cr=t=>({rrwebMethod:t,enqueuedAt:Date.now(),attempt:1});function Ir(){var t;return null==a||null===(t=a.__PosthogExtensions__)||void 0===t?void 0:t.rrweb}function Mr(){var t;return null===(t=Ir())||void 0===t?void 0:t.record}function Tr(t){try{return JSON.stringify(t)}catch(e){if(e instanceof RangeError)throw e;return JSON.stringify(t,En())}}function Rr(t){return fi(hi(function(t){var e=t.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(t);for(var n=new Pn(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 Pn(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 Yn(n,0,i)}(Tr(t))),!0)}function Er(t){return Ar.apply(this,arguments)}function Ar(){return Ar=A(function*(t){const e=yield function(t){return se.apply(this,arguments)}(Tr(t),Ii.DEBUG,{rethrow:!0});return fi(new Uint8Array(yield e.arrayBuffer()),!0)}),Ar.apply(this,arguments)}let $r,Or;const Pr="undefined"!=typeof globalThis&&"CompressionStream"in globalThis&&"TextEncoder"in globalThis&&"Response"in globalThis&&"function"==typeof Response.prototype.blob;let Lr=!1;function Dr(t){var e;return U(t)&&0===t.length?($r=null!==(e=$r)&&void 0!==e?e:Rr([]),$r):Rr(t)}function Fr(t){return Nr.apply(this,arguments)}function Nr(){return(Nr=A(function*(t){var e;return U(t)&&0===t.length?$r||(Or=null!==(e=Or)&&void 0!==e?e:Er([]).then(t=>($r=t,t)).catch(t=>{throw $r=void 0,Or=void 0,t}),Or):Er(t)})).apply(this,arguments)}function qr(t){return Pr&&!Lr&&function(t){return 2===t.type||3===t.type&&(0===t.data.source||8===t.data.source)}(t)}function jr(t){return{event:t,size:$n(t)}}function Br(t,e){return D(D({},t),{},{data:e,cv:"2024-10"})}function zr(t,e){return D(D({},t),{},{cv:"2024-10",data:D(D({},t.data),e)})}function Hr(t){try{if(2===t.type)return jr(Br(t,Rr(t.data)));if(3===t.type&&0===t.data.source)return jr(zr(t,{texts:Dr(t.data.texts),attributes:Dr(t.data.attributes),removes:Dr(t.data.removes),adds:Dr(t.data.adds)}));if(3===t.type&&8===t.data.source)return jr(zr(t,{adds:t.data.adds?Rr(t.data.adds):void 0,removes:t.data.removes?Rr(t.data.removes):void 0}))}catch(t){Sr.warn("could not compress event - will use uncompressed event",t)}return{event:t,size:An(t)}}function Ur(){return Ur=A(function*(t){try{if(2===t.type)return jr(Br(t,yield Er(t.data)));if(3===t.type&&0===t.data.source){const[e,n,i,r]=yield Promise.all([Fr(t.data.texts),Fr(t.data.attributes),Fr(t.data.removes),Fr(t.data.adds)]);return jr(zr(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?Er(t.data.adds):void 0,t.data.removes?Er(t.data.removes):void 0]);return jr(zr(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===ee})(e)&&(Lr=!0),Sr.warn("could not compress event asynchronously - trying synchronous compression",e),Hr(t)}return{event:t,size:An(t)}}),Ur.apply(this,arguments)}function Wr(t,e){return 5===t.type&&t.data.tag===e}function Vr(t){return Wr(t,"sessionIdle")}function Gr(t){return Wr(t,"$session_ending")}function Qr(t){return Wr(t,"$session_starting")}var Zr=class{get sessionId(){return this.Xt}get Yt(){if(!this._instance.sessionManager)throw new Error("[SessionRecording] must be started with a valid sessionManager.");return this._instance.sessionManager}get te(){return this._instance.config.session_recording.session_idle_threshold_ms||3e5}get ee(){return Qi(this._instance.get_property(f),this.sessionId)}get zt(){var t;const e=null===(t=this.ne)||void 0===t?void 0:t.sampleRate;return X(e)?e:null}get ie(){var t,e;return null!==(t=null===(e=this.re)||void 0===e?void 0:e.getMinimumDuration(this.sessionId))&&void 0!==t?t:null}constructor(t,e){this._instance=t,this.oe="/s/",this._forceAllowLocalhostNetworkCapture=!1,this.se=void 0,this.ae=!1,this.le=Date.now(),this.ue=!1,this.ce=[],this.de="unknown",this.he=0,this.fe=0,this.ve=0,this.pe=0,this.me=0,this.ge=!1,this.ye=!1,this.be=!1,this.we=!1,this.ke=!1,this._e=!1,this.Se=!1,this.xe=!1,this.Ce=!1,this.Ie=!1,this.Me=!1,this.Te=void 0,this.Re=void 0,this.Ee=!1,this.Ae=[],this.$e=0,this.Oe=0,this.Pe=!1,this.Le=void 0,this.Wt=void 0,this.De=void 0,this.Fe=void 0,this.Ne=void 0,this.qe=(t,e,n)=>{var i,r,o,s;if(!n)return;if(t===this.Xt&&e===this.je)return;const a=!n.noSessionId&&(n.activityTimeout||n.sessionPastMaximumLength),l=this.Xt,u=this.je;var c;if(a&&this.Vt("$session_ending",{currentSessionId:l,currentWindowId:u,nextSessionId:t,nextWindowId:e,changeReason:n,lastActivityTimestamp:this.le,flushed_size:null===(c=this.Be)||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=Ir())||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.ze(),!(!1===this.de&&this.isStarted||this.Xt===t&&this.je===e)){const e=this.Xt!==t&&!1!==this.de;this.de="unknown",this.He(e)}a&&this.Vt("$session_starting",{previousSessionId:l,previousWindowId:u,nextSessionId:t,nextWindowId:e,changeReason:n,lastActivityTimestamp:this.le}),null===(s=this.re)||void 0===s||s.makeSamplingDecisions(t)},this.Ue=!1,this.We=()=>{var t;return(null===(t=this._instance.persistence)||void 0===t?void 0:t.props.$session_past_minimum_duration)===this.Xt},this.Ve=()=>{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 X(n)&&X(i)?i-n:null},this.Ge=()=>{var t,e;const n=this.ie;if(!X(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.Qe;return X(t)&&t>=0&&n>t}if(this.We())return!1;const i=this.Ve();return!!J(i)||n>i||(null===(r=this._instance.persistence)||void 0===r||r.register({$session_past_minimum_duration:this.Xt}),!1);var r},this.Ze=()=>{"buffering"!==this.status?(this.ge&&this.ye&&this.Je&&(this.Ke(void 0),this.be&&(this.be=!1,this.jt())),this.Xe(),this.Ye(!0)):this.tn()},this.en=()=>{this.Ze()},this.nn=()=>{this.Vt("browser offline",{})},this.rn=()=>{this.Vt("browser online",{})},this.sn=()=>{(null==i?void 0:i.visibilityState)&&("visible"===i.visibilityState&&(this.Je=!0),this.Vt("window "+i.visibilityState,{}))},this.Je=null==e||e;const{sessionId:n,windowId:r,sessionStartTimestamp:o}=this.Yt.checkAndGetSessionAndWindowId();this.Xt=n,this.je=r,this._sessionStartTimestamp=o,this.et=new Cn(this._instance),this.Y=new xn(this._instance),this.tt=new In(this._instance),this.Rt=this.tn(),this.an="ph_replay_pending_buffer_"+JSON.stringify([this._instance.config.persistence_name||this._instance.config.token,this._instance.config.token]),this.Yt.sessionTimeoutMs>this.te||Sr.warn(`session_idle_threshold_ms (${this.te}) is greater than the session timeout (${this.Yt.sessionTimeoutMs}). Session will never be detected as idle`),this.Be=new Mi(this._instance)}setDocumentWasEverVisible(t){t&&(this.Je=!0)}get ln(){var t,e,n,i,r,o,s,a,l;const u=null===(t=this.ne)||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}}un(){var t;if(this.xe)return;const e=null===(t=this.ne)||void 0===t?void 0:t.masking;if(K(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.xe=!0,Sr.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 cn(){var t;return st(null===(t=this._instance.config.session_recording.canvasCapture)||void 0===t?void 0:t.resolutionScale,.1,1,he("canvas recording resolution scale"),1)}get dn(){var t,e,n,i,r,o,s;const a=this._instance.config.session_recording.captureCanvas,l=null===(t=this.ne)||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:st(c,0,12,he("canvas recording fps"),4),quality:st(d,0,1,he("canvas recording quality"),.4)}}get hn(){var t;const e=!!(null===(t=this.ne)||void 0===t?void 0:t.consoleLogRecordingEnabled),n=this._instance.config.enable_recording_console_log;return null!=n?n:e}get fn(){var t,e,n;const i=null===(t=this.ne)||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=(null==r?void 0:r.recordHeaders)||(null==i?void 0:i.recordHeaders),s=(null==r?void 0:r.recordBody)||(null==i?void 0:i.recordBody),a=_r(this._instance.config.capture_performance),l=_r(null==i?void 0:i.capturePerformance),u=!!(Y(a)?a:l);return o||s||u?{recordHeaders:o,recordBody:s,recordPerformance:u}:void 0}vn(){var t,e;const n=[],i=null===(t=a.__PosthogExtensions__)||void 0===t||null===(t=t.rrwebPlugins)||void 0===t?void 0:t.getRecordConsolePlugin;i&&this.hn&&n.push(i());const o=null===(e=a.__PosthogExtensions__)||void 0===e||null===(e=e.rrwebPlugins)||void 0===e?void 0:e.getRecordNetworkPlugin;if(this.fn&&W(o))if(!ge.includes(r.hostname)||this._forceAllowLocalhostNetworkCapture){const t=W(this._instance.requestRouter.isIngestionEndpoint)?this._instance.requestRouter.isIngestionEndpoint.bind(this._instance.requestRouter):void 0;n.push(o(D(D({},((t,e,n)=>{const i={payloadSizeLimitBytes:Ke.payloadSizeLimitBytes,performanceEntryTypeToObserve:[...Ke.performanceEntryTypeToObserve],payloadHostDenyList:[...e.payloadHostDenyList||[],...Ke.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=Je(t);return t=>((null==t?void 0:t.requestBody)&&(t.requestBody=rn(t.requestBody,t.requestHeaders,e,"Request")),(null==t?void 0:t.responseBody)&&(t.responseBody=rn(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=ye(t.name);let o=0===e.indexOf("http")?null===(i=ye(e))||void 0===i?void 0:i.pathname:e;"/"===o&&(o="");const s=null==r?void 0:r.pathname.replace(o||"","");return r&&s&&nn.some(t=>0===s.indexOf(t))?void 0:t})((en((i=e).requestHeaders),en(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});return!n&&e.isInitial?n:D(D({},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 K(s)&&o?(sn.add(o),o):null!=s?s:void 0}:t=>function(t){if(!G(t))return t.requestBody=on(t.requestBody,"Request"),t.responseBody=on(t.responseBody,"Response"),t}(l(t)),D(D(D({},Ke),i),{},{recordHeaders:r,recordBody:o,recordPerformance:s,recordInitialRequests:s,streamNetworkBody:!0===t.session_recording.streamNetworkBody})})(this._instance.config,this.fn,t)),{},{captureFetchSynchronously:!0===this._instance.config.__preview_replay_sync_fetch})))}else Sr.info("NetworkCapture not started because we are on localhost.");return n}pn(t){return this._instance.config.disable_capture_url_hashes?xt(t):t}mn(t,e=!1){const n=e?xt(t):this.pn(t),i=this._instance.config.mask_personal_data_properties?[...Ki,...this._instance.config.custom_personal_data_properties||[]]:[];return this.gn(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("=");U(n)&&(e.includes(n[0])?l.push(n[0]+"=<masked>"):l.push(a[t]))}let u=s;return null!=o&&(u+="?"+l.join("&")),null!=i&&(u+="#"+i),u}(n,i))}gn(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}yn(t){try{return t.rrwebMethod(),!0}catch(e){return 10>this.ce.length?this.ce.push({enqueuedAt:t.enqueuedAt||Date.now(),attempt:t.attempt+1,rrwebMethod:t.rrwebMethod}):Sr.warn("could not emit queued rrweb event.",e,t),!1}}Vt(t,e){return this.yn(Cr(()=>Mr().addCustomEvent(t,e)))}bn(){var t;return this.ae&&!0===(null===(t=this._instance.config.session_recording)||void 0===t?void 0:t.captureJsonLd)&&!this.Y.urlBlocked&&!0!==this.de}wn(t){if(!this.bn())return!1;try{const e=Mr();return!!e&&(e.addCustomEvent("$json_ld",t),this.bn())}catch(t){return!1}}kn(t=!1){Promise.resolve().then(()=>{var e;return null===(e=this._n)||void 0===e?void 0:e.scan(t)})}Sn(){try{if(this._instance.config.capture_pageview||!t)return;const e=new URL(t.location.href),n=this.mn(e.origin+e.pathname+e.search);this.xn!==n&&(this.xn=n,this.Vt("$url_changed",{href:n}))}catch(t){}}Cn(){if(this.ce.length){const t=[...this.ce];this.ce=[],t.forEach(t=>{Date.now()-t.enqueuedAt>2e3||this.yn(t)})}}jt(){return this.yn(Cr(()=>Mr().takeFullSnapshot()))}get In(){var t,e,n;if((null===(t=this.re)||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 X(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:3e5}Mn(){if(this.Tn&&clearInterval(this.Tn),!0===this.de)return;const t=this.In;t&&(this.Tn=setInterval(()=>{this.jt()},t))}Bt(t){"event"===t&&this.Rn(),!this.Y.urlBlocked&&["sampled","active"].includes(this.status)&&this.Mn()}En(){var t;this.Y.urlBlocked||(this.Y.urlBlocked=!0,null===(t=this._n)||void 0===t||t.scan(),clearInterval(this.Tn),Sr.info("recording paused due to URL blocker"),this.Vt("recording paused",{reason:"url blocker"}))}An(){var t;this.Y.urlBlocked&&(null===(t=this._n)||void 0===t||t.scan(),this.Y.urlBlocked=!1,this.jt(),this.kn(),this.Mn(),this.Vt("recording resumed",{reason:"left blocked url"}),Sr.info("recording resumed"))}$n(t,e){var n;if("event"===t&&this.Rn(),!this.ue&&(null===(n=this.re)||void 0===n?void 0:n.hasPendingTriggers(this.sessionId))){this.ue=!0;try{var i,r;const n="url"===t?v:p;null===(i=this._instance.persistence)||void 0===i||i.register({[n]:this.sessionId}),null===(r=this.re)||void 0===r||r.updateActiveTriggers(this.sessionId),this.Bt(),this.Ye(),this.qt(t+"_trigger_matched",{["url"===t?"matchedUrl":"matchedEvent"]:e})}finally{this.ue=!1}}}get isStarted(){return!!this.se}get ne(){const t=this._instance.get_property("$session_recording_remote_config");if(!t)return;let e;try{e=V(t)?t:JSON.parse(t)}catch(t){return void Sr.warn("persisted remote config for session recording is invalid and will be ignored",t)}if(!this.isStarted&&!this.Ue){var n;const i=null!==(n=e.cache_timestamp)&&void 0!==n?n:Date.now();if(Date.now()-i>36e5)return void Sr.info("persisted remote config for session recording is stale and will be ignored",{cacheTimestamp:i,persistedConfig:t})}return e}On(t,e,n){this._instance.get_property(t)&&(e(),n())}start(e){var n,r;const o=this.ne;if(!o)return void Sr.info("remote config must be stored in persistence before recording can start");if(!this.isStarted){const t=!1!==this.de&&!this.we;this.Ke(t?"no_interaction_since_recording_started":void 0),this.we=!1,this.ye=t,this.be=!1}this.Pe&&(this.Pn(),this.tn());const{sessionId:s,windowId:a,sessionStartTimestamp:l}=this.Yt.checkAndGetSessionAndWindowId();this.Xt=s,this.je=a,this._sessionStartTimestamp=l,this.Ln(),null===(n=this._instance.persistence)||void 0===n||n.unregister("$debug_first_full_snapshot_timestamp"),(null==o?void 0:o.endpoint)&&(this.oe=null==o?void 0:o.endpoint),this.re=2===(null==o?void 0:o.version)&&(null==o?void 0:o.triggerGroups)&&o.triggerGroups.length>0?new Ji(this._instance,this.Y,this.qt.bind(this),this.Vt.bind(this),this.Bt.bind(this)):new Zi(this._instance,this.Y,this.tt,this.et,this.qt.bind(this),this.jt.bind(this),this.Bt.bind(this)),this.re.onRemoteConfig(o),null===(r=this.Wt)||void 0===r||r.call(this),this.Wt=this.re.setupEventTriggerListeners(this._instance.on.bind(this._instance,"eventCaptured"),this.sessionId,(t,e)=>this.$n(t,e)),this.On(u,()=>{this.overrideSampling()},()=>{var t;return null===(t=this._instance.persistence)||void 0===t?void 0:t.unregister(u)}),this.On(c,()=>{this.overrideLinkedFlag()},()=>{var t;return null===(t=this._instance.persistence)||void 0===t?void 0:t.unregister(c)}),this.On(h,()=>{this.overrideTrigger("event")},()=>{var t;return null===(t=this._instance.persistence)||void 0===t?void 0:t.unregister(h)}),this.On(d,()=>{this.overrideTrigger("url")},()=>{var t;return null===(t=this._instance.persistence)||void 0===t?void 0:t.unregister(d)}),this.re.makeSamplingDecisions(this.sessionId),this.Dn(),this.ke||(me(t,"beforeunload",this.Ze),me(t,"pagehide",this.en),me(t,"offline",this.nn),me(t,"online",this.rn),me(i,"visibilitychange",this.sn),!this.De&&W(this.Yt.onSessionId)&&(this.De=this.Yt.onSessionId(this.qe)),!this.Fe&&W(this.Yt.on)?this.Fe=this.Yt.on("forcedIdleReset",()=>{this.ze(),this.de="unknown",this.stop(),this.Ne=this.Yt.onSessionId((t,e,n)=>{var i;null===(i=this.Ne)||void 0===i||i.call(this),this.Ne=void 0,this.qe(t,e,n)})}):W(this.Yt.on)||Sr.warn("bundled core has no SessionIdManager.on (requires posthog-js >= 1.268.6); recording will start but skip forced-idle-reset handling"),K(this.Le)&&(this.Le=this._instance.on("eventCaptured",t=>{try{if("$pageview"===t.event){const e=(null==t?void 0:t.properties.$current_url)?this.mn(t.properties.$current_url):"";if(!e)return;this.Vt("$pageview",{href:e})}}catch(t){Sr.error("Could not add $pageview to rrweb session",t)}})),"active"===this.status&&this.qt(e||"recording_initialized"))}Fn(){var e,n,r,o,s,a;null==t||t.removeEventListener("beforeunload",this.Ze),null==t||t.removeEventListener("pagehide",this.en),null==t||t.removeEventListener("offline",this.nn),null==t||t.removeEventListener("online",this.rn),null==i||i.removeEventListener("visibilitychange",this.sn),clearInterval(this.Tn),this.Nn(),null===(e=this.Le)||void 0===e||e.call(this),this.Le=void 0,null===(n=this.Wt)||void 0===n||n.call(this),this.Wt=void 0,null===(r=this.De)||void 0===r||r.call(this),this.De=void 0,null===(o=this.Fe)||void 0===o||o.call(this),this.Fe=void 0,null===(s=this.Ne)||void 0===s||s.call(this),this.Ne=void 0,null===(a=this.re)||void 0===a||a.stop(),this.qn(),this.Pn()}Pn(){this.Oe+=1,this.Ae=[],this.$e=0,this.jn=void 0,this.Pe=!1}qn(){var t,e;null===(t=this.Bn)||void 0===t||t.stop(),this.ce=[],null===(e=this._n)||void 0===e||e.stop(),this._n=void 0,this.ae=!1;try{var n;null===(n=this.se)||void 0===n||n.call(this)}catch(t){Sr.warn("could not stop rrweb",t)}this.se=void 0}zn(){if(!this.jn||0===this.$e)return!1;if(this.Pe)return!0;this.Pe=!0,this.Hn=void 0;const t=this.Oe;return this.Nn(),this.qn(),this.jn.catch(()=>{}).then(()=>{t===this.Oe&&(this.Pe=!1,this.Ye(),this.tn(),this.Un(),this.Fn(),Sr.info("stopped"))}).catch(()=>{this.Pe=!1,this.Un(),this.Fn(),Sr.info("stopped")}),!0}stop(){if(this.qn(),this.Ue)this.Xe();else if(this.zn())return;this.Ye(),this.tn(),this.Un(),this.Fn(),Sr.info("stopped")}Un(){this.Ke(void 0,{preserveLogDedup:this.Ue}),this.ye=!1}flushBeforeIdentityReset(){(this.isStarted||this.Pe)&&(this.Xe(),this.Ye())}He(t){this.Ue=!0,this.le=Date.now();try{var e,n;this.stop(),this.Wn=void 0,this.me=0,this.fe=0,this.ve=0,this.pe=0,null===(e=Ir())||void 0===e||null===(n=e.resetSnapshotCostState)||void 0===n||n.call(e),this.start("session_id_changed")}finally{this.Ue=!1}this.Ke(t?"no_interaction_since_session_rotated":void 0),this.ye=!1}Ke(t,{preserveLogDedup:e=!1}={}){if(this.ge=!G(t),this.Hn=t,G(t))return void(e||(this.Vn=void 0));if(this.Ue)return;const n=`${this.sessionId}:${t}`;n!==this.Vn&&(this.Vn=n,Sr.info(`holding buffer: ${t}. nothing is uploaded until the user interacts with the page`))}Rn(){this.isStarted||(this.we=!0),this.ge&&(this.Ke(void 0),this.ye=!1,this.be&&(this.be=!1,this.jt()),this.Gn())}discard({discardProducerEvents:t=!1}={}){this.ge=!0,t&&(this.tn(),this.qn()),this.tn(),this.Fn(),this.tn(),this.Un(),Sr.info("discarded")}Qn(t,e,n,i,r){if(-1===n)return this.me+=1,void Sr.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.Zn(t,i),this.Jn(o)):this.tn()}Kn(){try{this.Xn()}catch(t){this.Se||(this.Se=!0,Sr.error("could not track full snapshot cost",t))}}Xn(){var t,e;const n=null===(t=Ir())||void 0===t||null===(e=t.getLastSnapshotCost)||void 0===e?void 0:e.call(t);n&&n!==this.Wn&&(this.Wn=n,500>n.durationMs||Sr.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}))}Zn(t,e){2!==t.type?3===t.type&&(G(this.Te)||this.Te===e||this.Re===e||(this.Re=e,Sr.info("incremental snapshot for a session with no full snapshot - requesting one",{sessionId:e}),this.jt())):this.Te=e}Yn(t){t.counted&&t.generation===this.Oe&&(this.$e=Math.max(0,this.$e-1)),t.counted=!1,this.Ae=this.Ae.filter(e=>e!==t)}ti(t,e,n){t.processed||t.generation!==this.Oe||(t.processed=!0,this.Qn(t.event,e,n,t.targetSessionId,t.targetWindowId))}ei(t){try{let e,n=t.event;if(t.compressionEnabled)try{({event:n,size:e}=Hr(t.event))}catch(t){Sr.warn("could not process queued compression event - will use uncompressed event",t)}G(e)&&(e=An(t.event));try{this.ti(t,n,e)}catch(t){Sr.warn("could not capture queued compression event",t)}}finally{this.Yn(t)}}Xe(){[...this.Ae].forEach(t=>{try{this.ei(t)}catch(t){Sr.warn("could not drain queued compression event",t)}})}ni(t,e,n,i){var r=this;const o={event:t,compressionEnabled:e,targetSessionId:n,targetWindowId:i,generation:this.Oe,processed:!1,counted:!0};this.Ae.push(o),this.$e+=1;const s=(a=A(function*(){try{if(o.processed)return;let n,i;try{const r=e?qr(t)?yield function(t){return Ur.apply(this,arguments)}(t):Hr(t):{event:t,size:An(t)};n=r.event,i=r.size}catch(e){Sr.warn("could not process queued compression event - will use uncompressed event",e),n=t,i=An(t)}r.ti(o,n,i)}finally{r.Yn(o)}}),function(){return a.apply(this,arguments)});var a;this.jn=this.jn?this.jn.catch(()=>{}).then(s):s()}onRRwebEmit(e){var n,i,r,o,s,a,l,u,c,d,h;if(!this._instance.sessionManager)return;if(this.Cn(),!e||!V(e))return;if(4===e.type){const t=this.mn(e.data.href);if(this.xn=t,!t)return;e.data.href=t}else this.Sn();if(null===(n=this.re)||void 0===n||n.checkUrlTriggers(this.sessionId,()=>this.En(),()=>this.An(),(t,e)=>this.$n(t,e)),this.Y.urlBlocked&&!function(t){return 5===t.type&&"recording paused"===t.data.tag}(e))return;2===e.type&&(this.Kn(),Promise.resolve().then(()=>this.Kn()),this.Mn(),null===(d=this.Bn)||void 0===d||d.reset(),null===(h=this._instance.persistence)||void 0===h||h.register_once({$debug_first_full_snapshot_timestamp:e.timestamp},void 0));const f=2===e.type&&(null===(i=this.re)||void 0===i?void 0:i.hasPendingTriggers(this.sessionId));f&&this.ii();const v=this.Bn?this.Bn.throttleMutations(e):e;if(!v)return void(!0===this.de&&this.he++);const p=function(t){const e=t;if(e&&V(e)&&6===e.type&&V(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}(v),m=function(t){return Gr(t)?t.data.payload:null}(p),g=function(t){return Qr(t)?t.data.payload:null}(p),y=function(t){return Vr(t)?t.data.payload:null}(p);m||g?(null==m?void 0:m.lastActivityTimestamp)&&(p.timestamp=m.lastActivityTimestamp):(null==y?void 0:y.sessionId)||this.ri(p);const b=null!==(r=null!==(o=null!==(s=null==m?void 0:m.currentSessionId)&&void 0!==s?s:null==g?void 0:g.nextSessionId)&&void 0!==o?o:null==y?void 0:y.sessionId)&&void 0!==r?r:this.Xt,w=null!==(a=null!==(l=null!==(u=null==m?void 0:m.currentWindowId)&&void 0!==u?u:null==g?void 0:g.nextWindowId)&&void 0!==l?l:null==y?void 0:y.windowId)&&void 0!==a?a:this.je;if(!0===this.de&&!function(t){return Vr(t)||Gr(t)||Qr(t)}(p))return void(function(t){return 2===t.type||4===t.type||3===t.type&&9!==t.data.source}(p)&&this.he++);2===p.type&&(this.he=0),y&&(p.timestamp=y.lastActivityTimestamp+y.threshold);const k=this.ae;this.ae=!0,f?this.kn(!0):k||this.kn();const _=null===(c=this._instance.config.session_recording.compress_events)||void 0===c||c;if(5===p.type&&"$json_ld"===p.data.tag){let e;try{e=t?this.mn(t.location.href):void 0}catch(t){}p.data.href=e}if(this.$e>0||_&&qr(p))return void this.ni(p,_,b,w);const{event:S,size:x}=_?Hr(p):{event:p,size:An(p)};this.Qn(p,S,x,b,w)}get status(){return this.re?this.re.getStatus({instance:this._instance,sessionId:this.sessionId,isSampled:this.ee,rrwebError:this.ke,urlTriggerMatching:this.Y,eventTriggerMatching:this.tt,linkedFlagMatching:this.et,remoteConfig:this.ne}):an}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.et.linkedFlagSeen=!0,this.jt(),this.Rn(),this.qt("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.jt(),this.Rn(),this.qt("sampling_overridden")}overrideTrigger(t){this.$n(t),this.Rn()}oi(){try{var e;const n=null==t||null===(e=t.location)||void 0===e?void 0:e.href;if(!n)return;const i=this.mn(n);if(!i)return;return new URL(i).hostname||void 0}catch(t){return}}Nn(){this.si&&(clearTimeout(this.si),this.si=void 0)}Gn(){this.si||(this.si=setTimeout(()=>{this.Ye()},2e3))}ai(){return this.Te!==this.Rt.sessionId&&0!==this.Rt.data.length&&this.Rt.data.every(t=>5===(null==t?void 0:t.type)&&!Gr(t)&&!Qr(t))}li(){var t,e;return null!==(t=null===(e=this.re)||void 0===e?void 0:e.getPendingTriggerConditions(this.sessionId))&&void 0!==t?t:[]}ui(t){if("buffering"!==t)return G(this.ci)||this._instance.register_for_session({[S]:[]}),void(this.ci=void 0);const e=this.li();if(0===e.length)return G(this.ci)||this._instance.register_for_session({[S]:[]}),void(this.ci=void 0);const n=e.join(", "),i=`${this.sessionId}:${n}`;i!==this.ci&&(this.ci=i,this._instance.register_for_session({[S]:e}),Sr.info(`buffering: ${n}`))}di(){var t;return"memory"!==this._instance.config.persistence&&!0!==(null===(t=this._instance.persistence)||void 0===t?void 0:t.hi)&&Ci.At()}fi(){0!==this.Rt.data.length&&this.Rt.size!==this.pi&&943718.4>=this.Rt.size&&this.di()&&(this.pi=this.Rt.size,Ci.$t(this.an,this.Rt))}Ln(){if(this.Ee||!this.di())return;this.Ee=!0;const t=Ci.Dt(this.an);Ci.Pt(this.an),V(t)&&U(t.data)&&0!==t.data.length&&U(t.sizes)&&t.sizes.length===t.data.length&&X(t.size)&&t.sessionId===this.Xt&&t.windowId===this.je&&(this.Rt.data.length>0||(this.Rt=t))}Ye(t=!1){var e;if(this.Nn(),this.ge)return this.Rt;if(this.ai())return this.Rt.size>943718.4?this.tn():(t&&this.fi(),this.Rt);const n=this.Rt;null===(e=this.re)||void 0===e||e.ensureSamplingDecision(this.sessionId);const i=this.Ge(),r=this.status;if(this.ui(r),"buffering"===r||"paused"===r||"disabled"===r||i)return!t||"active"!==r&&"sampled"!==r||this.fi(),this.Gn(),this.Rt;if(this.Rt!==n)return this.Rt;if(n.data.length>0){var o;const t=this.oi();On(n).forEach(e=>{try{var n;null===(n=this.Be)||void 0===n||n.trackSize(e.sessionId,e.size),this.mi(D(D(D(D({$snapshot_bytes:e.size,$snapshot_data:e.data,$session_id:e.sessionId,$window_id:e.windowId,$lib:Ii.LIB_NAME,$lib_version:Ii.LIB_VERSION,$snapshot_host:t},this.fe>0?{$sdk_debug_replay_throttled_mutations_dropped:this.fe}:{}),this.ve>0?{$sdk_debug_replay_oversized_mutations_dropped:this.ve}:{}),this.pe>0?{$sdk_debug_replay_oversized_mutation_bytes_dropped:this.pe}:{}),this.me>0?{$sdk_debug_replay_unstringifiable_events_dropped:this.me}:{}))}catch(t){Sr.warn("could not capture snapshot chunk - skipping it",t)}}),G(this.pi)||(Ci.Pt(this.an),this.pi=void 0),null===(o=this.re)||void 0===o||o.onFlushComplete()}return this.tn()}Jn(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.de&&!this.ge&&this.Rt.size+t.$snapshot_bytes+n>943718.4){const e=this.Xt;if(this.Rt=this.Ye(),this.Xt!==e)return;r&&this.Rt.data.length>0&&(this.Rt=this.tn()),this.Rt.sessionId=i,this.Rt.windowId=t.$window_id}this.ge&&(this.be||this.Rt.size+t.$snapshot_bytes+n>943718.4)?this.be=!0:(this.Rt.size+=t.$snapshot_bytes,this.Rt.data.push(t.$snapshot_data),this.Rt.sizes.push(t.$snapshot_bytes),!0===this.de||this.ge||this.Gn())}mi(t){this._instance.capture("$snapshot",t,{_url:this._instance.requestRouter.endpointFor("api",this.oe),_noTruncate:!0,_batchKey:"recordings",skip_client_rate_limiting:!0})}get Qe(){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}ii(){if(!this.Rt||0===this.Rt.data.length)return this.tn();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.tn():(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)}tn(){return this.Rt={size:0,data:[],sizes:[],sessionId:this.Xt,windowId:this.je},this.Rt}qt(t,e){this._instance.register_for_session({[R]:t}),Sr.info(t.replace("_"," "),e),"session_id_changed"!==t&&this.Vt("$recording_started",D({reason:t},e))}gi(t){var e;return 3===t.type&&-1!==xr.indexOf(null===(e=t.data)||void 0===e?void 0:e.source)}ri(t){const e=this.gi(t);e||!0===this.de||t.timestamp-this.le>this.te&&(this.de=!0,clearInterval(this.Tn),this.Vt("sessionIdle",{eventTimestamp:t.timestamp,lastActivityTimestamp:this.le,threshold:this.te,bufferLength:this.Rt.data.length,bufferSize:this.Rt.size,sessionId:this.Xt,windowId:this.je}),this.Ye());const{windowId:n,sessionId:i}=this.Yt.checkAndGetSessionAndWindowId(!e,t.timestamp);let r=!1;if(e&&(this.le=t.timestamp,this.de)){const e="unknown"===this.de;this.de=!1,e||(this.Vt("sessionNoLongerIdle",{reason:"user activity",type:t.type}),r=!0)}const o=this.Xt!==i,s=this.je!==n;if(this.je=n,this.Xt=i,o||s){const t=o&&!1!==this.de;t&&(this.de="unknown"),this.He(t)}else if(e&&this.Rn(),r){var a;const t=["sampled","active"].includes(this.status)||(null===(a=this.re)||void 0===a?void 0:a.hasPendingTriggers(this.sessionId));this.he>0&&t&&this.jt(),this.kn(),this.Mn()}}ze(){var t;null===(t=this.re)||void 0===t||t.clearConditionalRecordingPersistence()}get sdkDebugProperties(){var t;return{$recording_status:this.status,$sdk_debug_replay_flush_hold_reason:this.Hn,$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.Be)||void 0===t?void 0:t.currentTrackedSize(this.sessionId),$sdk_debug_replay_rrweb_error:this.ke,[M]:this.yi,[T]:this._e}}get yi(){var t,e,n;return!!this.se&&(null===(t=null===(e=Mr())||void 0===e||null===(n=e.isRecording)||void 0===n?void 0:n.call(e))||void 0===t||t)}Dn(){var e;if(this.se)return;this._e=!0;const n={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,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 n)if("maskInputOptions"===t)n.maskInputOptions=D({password:!0},e);else if("sampling"===t){const t=null!=e?e:{},i={};G(t.mousemove)||(i.mousemove=t.mousemove),G(t.mouseInteraction)||(i.mouseInteraction=t.mouseInteraction),n.sampling=i}else n[t]=e;var o,s,a,l;!0===(null==r?void 0:r.captureJsonLd)&&!0!==n.slimDOMOptions&&"all"!==n.slimDOMOptions&&(n.slimDOMOptions=D(D({},n.slimDOMOptions),{},{script:!0})),this.dn&&this.dn.enabled&&(n.recordCanvas=!0,n.sampling=D(D({},n.sampling),{},{canvas:this.dn.fps}),n.dataURLOptions={type:"image/webp",quality:this.dn.quality},n.canvasResolutionScale=this.cn,n.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.Ie||(this.Ie=!0,Sr.warn("canvasCapture.maskRegionsFn threw, canvas frames will be skipped",t)),null}}}),this.ln&&(n.maskAllInputs=null===(o=this.ln.maskAllInputs)||void 0===o||o,n.maskTextSelector=null!==(s=this.ln.maskTextSelector)&&void 0!==s?s:void 0,n.blockSelector=null!==(a=this.ln.blockSelector)&&void 0!==a?a:void 0,n.maskAllElementAttributes=null!==(l=this.ln.maskAllElementAttributes)&&void 0!==l&&l),n.maskAllElementAttributes&&n.maskAttributeFn&&(n.maskAttributeFn=void 0,this.Ce||(this.Ce=!0,Sr.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.un();const u=Mr();if(!u)return void Sr.error("_startRecorder was called but rrwebRecord is not available. This indicates something has gone wrong.");this.Bn=null!==(e=this.Bn)&&void 0!==e?e:new vi(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`;Sr.info(n,{node:e}),this.log("[SessionRecording] "+n,"warn")},onDroppedAttributeMutations:t=>this.fe+=t,bytesRefillRate:this._instance.config.session_recording.__mutationBytesRefillRate,bytesBucketSize:this._instance.config.session_recording.__mutationBytesBucketSize,resyncIntervalMs:this.In,onDroppedOversizedMutation:t=>{0===this.ve&&this.log("[SessionRecording] Dropped an oversized DOM mutation to keep the recording playable. The recording will resync with a full snapshot.","warn"),this.ve+=1,this.pe+=t},requestFullSnapshot:()=>this.jt()});const c=this.vn();if(this.se=u(D(D({emit:t=>{this.onRRwebEmit(t)},plugins:c,errorHandler:(t,e)=>"rrweb"===e&&(this.Me||(this.Me=!0,Sr.error("rrweb internal error - recording will continue but may be incomplete",t)),!0)},n),{},{recordAfter:"DOMContentLoaded"})),!this.se)return this.ke=!0,void Sr.error("rrweb failed to start - Loss of recording data is possible. Check the browser console for rrweb errors.");this.ke=!1,!0===(null==r?void 0:r.captureJsonLd)&&i&&(null==t?void 0:t.MutationObserver)&&!this._n&&(this._n=function(t,e,n){const i=new WeakMap,r=n.getCaptureState||(()=>!0);let o=Xi;const s=function(t,e){const n=e.attributeFilter;return e.maskAllElementAttributes||e.maskAttributeFn||(null==n?void 0:n.length)&&!n.includes("id")?er:n=>{const i=t.getElementById(n);return!!i&&"SCRIPT"!==i.nodeName&&(!e.isRecordedElement||e.isRecordedElement(i))&&!wr(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 wr(t,e.blockClass,e.blockSelector)||wr(t,e.maskTextClass,e.maskTextSelector)}(e,n))return;const l=function(t,e=er,n){if(!t||t.length>Xi)return null;try{const i=JSON.parse(t),r={maskUrl:n,remainingNodes:2048,exceeded:!1},o=U(i)?i.map(t=>gr(t,e,r)):gr(i,e,r);if(r.exceeded||J(o)||U(o)&&(!o.length||o.some(J)))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(J(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 kr(t))a(e)};for(const n of t)if("childList"===n.type)yr(n.target)&&a(n.target),n.addedNodes.forEach(e);else if("characterData"===n.type){const t=n.target.parentNode;t&&yr(t)&&a(t)}else"attributes"===n.type&&yr(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()&&kr(t.documentElement).forEach(t=>{e&&i.delete(t),a(t)})},stop(){return n.disconnect()}}}catch(t){return{scan(){},stop(){}}}}(i,t.MutationObserver,{maskUrl:t=>this.mn(t),attributeFilter:n.attributeFilter,blockClass:n.blockClass,blockSelector:n.blockSelector,isRecordedElement:t=>u.mirror.getId(t)>0,maskAllElementAttributes:n.maskAllElementAttributes,maskAttributeFn:n.maskAttributeFn,maskTextClass:n.maskTextClass,maskTextSelector:n.maskTextSelector,getCaptureState:()=>{var t;return!0!==(null===(t=this._instance.config.session_recording)||void 0===t?void 0:t.captureJsonLd)||this.Y.urlBlocked||this.Y.isCurrentUrlBlocked()?null:this.bn()},emit:t=>this.wn(t)}),this.Y.isCurrentUrlBlocked()&&this._n.scan()),this.le=Date.now(),this.de=Y(this.de)?this.de:"unknown",this.tryAddCustomEvent("$remote_config_received",this.ne),this.Vt("$session_options",{sessionRecordingOptions:n,activePlugins:c.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 Jr=["type"];var Kr=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}({}),Xr=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}({}),Yr=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}({}),to=function(t){return t[t.Mouse=0]="Mouse",t[t.Pen=1]="Pen",t[t.Touch=2]="Touch",t}({}),eo=function(t){return t[t["2D"]=0]="2D",t[t.WebGL=1]="WebGL",t[t.WebGL2=2]="WebGL2",t}({}),no=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}({}),io=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 ro(t,e){return-1!==t.indexOf(e)}"Mobile".toLowerCase(),"Tablet".toLowerCase(),new RegExp("Xbox","i"),new RegExp("Nintendo","i"),new RegExp("PlayStation","i"),new RegExp("Windows","i"),Date,Date,new RegExp(/[a-z][a-z0-9+.-]{0,63}:[^\s<>"]+/gi.source,"i");var oo=/[a-z][a-z0-9+.-]{0,63}:\/\//i;new RegExp(`^${oo.source}`,"i"),new RegExp(oo.source,"gi"),"0".repeat(32),"0".repeat(16);var so={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot"],MutationObserver:[]},ao={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:["querySelector","querySelectorAll"],MutationObserver:["constructor"]},lo={};function uo(t){if(lo[t])return lo[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 so?so[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 ao?ao[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 lo[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?(function(t){return ro(t,"AppleWebKit")&&!ro(t,"Chrome")}(navigator.userAgent)&&(a.classList.add("rr-block","ph-no-capture"),a.setAttribute("__rrwebUntaintedPrototype",t),l=!0),lo[t]=r):n}catch(t){return n}finally{!l&&a.parentNode&&document.body.removeChild(a)}}var co=Object.create(null);function ho(t,e,n){var i;const r=co[t],o=r[n];if(o)return o.call(e);const s=uo(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]}co.Node=Object.create(null),co.ShadowRoot=Object.create(null),co.MutationObserver=Object.create(null),co.Element=Object.create(null);var fo,vo={};function po(t,e,n){const i=`${t}.${String(n)}`;if(vo[i])return vo[i].bind(e);const r=uo(t)[n];return"function"!=typeof r?e[n]:(vo[i]=r,r.bind(e))}function mo(){return uo("MutationObserver").constructor}function go(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 yo={childNodes:t=>ho("Node",t,"childNodes"),parentNode:t=>ho("Node",t,"parentNode"),parentElement:t=>ho("Node",t,"parentElement"),textContent:t=>ho("Node",t,"textContent"),isConnected(t){if(void 0===fo){var e;const t=null===(e=Object.getOwnPropertyDescriptor(uo("Node"),"isConnected"))||void 0===e?void 0:e.get;fo=(null==t?void 0:t.toString().includes("[native code]"))?t:null}return null==fo?void 0:fo.call(t)},contains:(t,e)=>po("Node",t,"contains")(e),getRootNode:t=>po("Node",t,"getRootNode")(),host:t=>t&&"host"in t?ho("ShadowRoot",t,"host"):null,styleSheets:t=>t.styleSheets,shadowRoot:t=>t&&"shadowRoot"in t?ho("Element",t,"shadowRoot"):null,querySelector:(t,e)=>po("Element",t,"querySelector")(e),querySelectorAll:(t,e)=>po("Element",t,"querySelectorAll")(e),mutationObserver:mo,patch:go};function bo(){try{if("undefined"!=typeof performance&&performance.now)return performance.now()}catch(t){}return Date.now()}var wo=0;function ko(){wo+=1}function _o(){return wo}function So(t,e){return(e!==wo||t>6e4)&&!0}var xo=0,Co=0,Io=0,Mo={durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0},To=null,Ro=null,Eo=[],Ao=0,$o=0,Oo={slowestBatchMs:0},Po={deferredCount:0,failedCount:0,abandonedCount:0,totalMs:0,slowestSliceMs:0};function Lo(t){(xo+=1)>1||(Mo={durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0},Eo=[],Ao=0,Ro=(t=>t&&t>0?t:null)(t),Co=bo(),Io=wo)}function Do(){return 0===xo?To||{durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0}:(xo-=1)>0?Mo:(Mo.durationMs=bo()-Co,Mo.deferredStylesheetCount=Ao,Po.deferredCount+=Ao,Ro=null,So(Mo.durationMs,Io)?Mo:To=Mo)}function Fo(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+=Fo(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+=Fo(r,e,n+1))}}}catch(t){}}return i}function No(t){if(0===xo)return;const e=Fo(t,null,0);Mo.cssRuleCount+=e,$o>0&&(Mo.nonDeferrableCssRuleCount+=e)}function qo(t){$o+=1;try{return t()}finally{$o-=1}}function jo(t){xo>0&&(Mo.stylesheetMs+=t)}function Bo(t){if(0===xo||null===Ro)return!1;const e=Mo.cssRuleCount-Mo.nonDeferrableCssRuleCount;return e>=Ro||e+function(t){try{const e=t&&(t.rules||t.cssRules);if(!e)return 0;const n=new WeakSet;return n.add(t),Fo(e,n,0)}catch(t){return 0}}(t)>Ro}function zo(){const t=Eo;return Eo=[],t}function Ho(){Po.failedCount+=1}function Uo(t){t>0&&(Po.abandonedCount+=t)}function Wo(t){return Wo="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},Wo(t)}function Vo(t,e,n){return(e=function(t){var e=function(t){if("object"!=Wo(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Wo(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Wo(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Go(t){return t.nodeType===t.ELEMENT_NODE}function Qo(t){const e=t&&"host"in t&&"mode"in t&&yo.host(t)||null;return Boolean(e&&"shadowRoot"in e&&yo.shadowRoot(e)===t)}function Zo(t){return"[object ShadowRoot]"==={}.toString.call(t)}function Jo(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 Ko(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 Xo=0;function Yo(t){const e=0===Xo,n=e?bo():0;Xo+=1;try{const e=t.rules||t.cssRules;if(!e)return null;No(e);let n=t.href;return!n&&t.ownerNode&&(n=t.ownerNode.baseURI),Jo(Array.from(e,t=>ts(t,n)).join(""))}catch(t){return null}finally{Xo-=1,e&&jo(bo()-n)}}function ts(t,e){if(ns(t)){let e;try{e=Yo(t.styleSheet)||Ko(t)}catch(n){e=t.cssText}try{var n;if(e&&(null===(n=t.styleSheet)||void 0===n?void 0:n.href))return ys(e,t.styleSheet.href)}catch(t){}return e}{let n=t.cssText;return is(t)&&t.selectorText.includes(":")&&(n=es(n)),e?ys(n,e):n}}function es(t){return t.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")}function ns(t){return"styleSheet"in t}function is(t){return"selectorText"in t}var rs=/^-?[A-Za-z_][\w-]*$/,os=/^-?[A-Za-z_][\w-]*(\.-?[A-Za-z_][\w-]*)*$/;function ss(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||Ko(e)}catch(t){r=e.cssText}try{var i;r&&(null===(i=e.styleSheet)||void 0===i?void 0:i.href)&&(r=ys(r,e.styleSheet.href))}catch(t){}r&&t.parts.push(r),t.index+=1}catch(t){o(null)}}function a(t){const n=t.rules[t.index];if("sheet"===t.kind&&ns(n)){const i=r.get(n);return null===i?(t.parts.push(n.cssText),void(t.index+=1)):i?void e.push({kind:"sheet",sheet:i.sheet,rules:i.rules,sheetHref:i.sheetHref,index:0,parts:[],importRule:n}):void s(t,n,null)}if(function(t,n){try{const i=function(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(is(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&&!rs.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]?rs.test(e.name)?`@keyframes ${e.name} {`:null:""===e.name?"@layer {":os.test(e.name)?`@layer ${e.name} {`:null:null}(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?ys(i,r):i,fixColons:"sheet"===n.kind&&is(t)&&t.selectorText.includes(":")}),!0}catch(t){return!1}}(n,t))return;let i=n.cssText;"sheet"===t.kind&&is(n)&&n.selectorText.includes(":")&&(i=es(i)),t.parts.push(t.sheetHref?ys(i,t.sheetHref):i),t.index+=1}return function(t){try{const n=t.rules||t.cssRules;if(!n)return!1;No(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,!ns(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;No(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=bo();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?es(n):n}else e=Jo(t.parts.join(""))}catch(t){}o(e);continue}s-=1;try{a(t)}catch(t){o(null)}}}catch(t){n=!0,i=null}finally{jo(bo()-r)}return n},text:()=>n?i:null,remainingRules(){if(n)return 0;let t=0;for(const n of e)t+=n.rules.length-n.index;return t}}}var as=class{constructor(){Vo(this,"idNodeMap",new Map),Vo(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)),Go(t)){const e=yo.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 ls({element:t,maskInputOptions:e,tagName:n,type:i,value:r,maskInputFn:o}){let s=r||"";const a=i&&us(i);return(e[n.toLowerCase()]||a&&e[a])&&(s=o?o(s,t):"*".repeat(s.length)),s}function us(t){return t.toLowerCase()}var cs=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 ds({element:t,name:e,value:n,maskAllElementAttributes:i,maskAttributeFn:r,isGenerated:o=!1}){return n?i?o&&cs.has(us(e))?n:"*".repeat(n.length):r?r(e,n,t):n:n}var hs="__rrweb_original__";function fs(t){try{const e=t.type;return t.hasAttribute("data-rr-is-password")?"password":e?us(e):null}catch(t){return null}}var vs=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,ps=/^(?:[a-z+]+:)?\/\//i,ms=/^www\..*/i,gs=/^(data:)([^,]*),(.*)/i;function ys(t,e){return(t||"").replace(vs,(t,n,i,r,o,s)=>{const a=i||o||s,l=n||r||"";if(!a)return t;if(ps.test(a)||ms.test(a))return`url(${l}${a}${l})`;if(gs.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=e.split("/"),c=a.split("/");u.pop();for(const t of c)"."!==t&&(".."===t?u.pop():u.push(t));return`url(${l}${u.join("/")}${l})`})}var bs,ws,ks=new Map,_s=1,Ss=new RegExp("[^a-z0-9-_:]");function xs(){return _s++}var Cs=!1,Is=/^[^ \t\n\r\u000c]+/,Ms=/^[, \t\n\r\u000c]+/,Ts=new WeakMap;function Rs(t,e){return e&&""!==e.trim()?Es(t,e):e}function Es(t,e){let n=Ts.get(t);if(n||(n=t.createElement("a"),Ts.set(t,n)),e){if(e.startsWith("blob:")||e.startsWith("data:"))return e}else e="";return n.setAttribute("href",e),n.href}function As(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 $s(t,e,n,i,r,o){if(!i)return i;if("src"===n||"href"===n&&("use"!==e||"#"!==i[0])){if("link"===e&&r){var s;const t=null===(s=r.sheet)||void 0===s?void 0:s.href;if(t)return t}const n=Rs(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=ks.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(ks.size>=10){const t=ks.keys().next().value;void 0!==t&&ks.delete(t)}return ks.set(e,{type:n,quality:i,result:a}),a}catch(t){return e}}(r,n,o.type,o.quality)),As(t,o)}if("image"===e)return As(n,o)}return n}if("xlink:href"===n&&"#"!==i[0]){const n=Rs(t,i);return"image"===e&&n.startsWith("data:")?As(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(Ms),e.length>n;){let o=i(Is);if(","===o.slice(-1))o=Rs(t,o.substring(0,o.length-1)),r.push(o);else{let i="";o=Rs(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?ys(i,Es(t)):"object"===e&&"data"===n?Rs(t,i):i:Rs(t,i)}function Os(t,e,n){return("video"===t||"audio"===t)&&"autoplay"===us(e)}function Ps(t){return"string"==typeof t&&us(t).split(/\s+/).includes("stylesheet")}function Ls(t,e,n){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return!!n&&Ls(yo.parentNode(t),e,n);for(let n=t.classList.length;n--;)if(e.test(t.classList[n]))return!0;return!!n&&Ls(yo.parentNode(t),e,n)}function Ds(t,e,n,i){let r;if(Go(t)){if(r=t,!yo.childNodes(r).length)return!1}else{if(null===yo.parentElement(t))return!1;r=yo.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(Ls(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 Fs(t,e,n){const i=t.removeEventListener;"function"==typeof i&&i.call(t,e,n)}var Ns=new Map;function qs(t,e){return Array.from(t.styleSheets).find(t=>t.href===e)}function js(t){return null==t?"":t.toLowerCase()}var Bs=!1,zs=!1;function Hs(t,e){const{doc:n,mirror:i,blockClass:r,blockSelector:o,maskTextClass:s,maskTextSelector:a,skipChild:l=!1,inlineStylesheet:u=!0,maskInputOptions:c={},maskTextFn:d,maskInputFn:h,maskAllElementAttributes:f=!1,maskAttributeFn:v,slimDOMOptions:p,dataURLOptions:m={},inlineImages:g=!1,recordCanvas:y=!1,canvasMaskingConfigured:b,onSerialize:w,onIframeLoad:k,iframeLoadTimeout:_=5e3,onIframeListenerRegistered:S,onStylesheetLoad:x,stylesheetLoadTimeout:C=5e3,keepIframeSrcFn:I=()=>!1,newlyAddedElement:M=!1,depth:T=0,maxDepth:R=50}=e;let{needsMask:E}=e,{preserveWhiteSpace:A=!0}=e;if(T>=R)return zs=!0,Bs||(Bs=!0,console.warn(`[rrweb-snapshot] DOM tree depth exceeded max depth of ${R}. Children beyond this depth will not be recorded. This may indicate deeply nested DOM structures.`)),null;E||(E=Ds(t,s,a,void 0===E)),xo>0&&(Mo.nodeCount+=1);const O=function(t,e){const{doc:n,mirror:i,blockClass:r,blockSelector:o,needsMask:s,inlineStylesheet:a,maskInputOptions:l={},maskTextFn:u,maskInputFn:c,maskAllElementAttributes:d=!1,maskAttributeFn:h,dataURLOptions:f={},inlineImages:v,recordCanvas:p,canvasMaskingConfigured:m,keepIframeSrcFn:g,newlyAddedElement:y=!1}=e,b=function(t,e){if(!e.hasNode(t))return;const n=e.getId(t);return 1===n?void 0:n}(n,i);switch(t.nodeType){case t.DOCUMENT_NODE:return"CSS1Compat"!==t.compatMode?{type:io.Document,childNodes:[],compatMode:t.compatMode}:{type:io.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:io.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:b};case t.ELEMENT_NODE:return function(t,e){const{doc:n,blockClass:i,blockSelector:r,inlineStylesheet:o,maskInputOptions:s={},maskInputFn:a,maskAllElementAttributes:l=!1,maskAttributeFn:u,dataURLOptions:c={},inlineImages:d,recordCanvas:h,canvasMaskingConfigured:f,keepIframeSrcFn:v,newlyAddedElement:p=!1,rootId:m}=e,g=function(t,e,n){try{if("string"==typeof e){if(t.classList.contains(e))return!0}else for(let n=t.classList.length;n--;)if(e.test(t.classList[n]))return!0;if(n)return t.matches(n)}catch(t){}return!1}(t,i,r),y=function(t){if(t instanceof HTMLFormElement)return"form";const e=us(t.tagName);return Ss.test(e)?"div":e}(t),b=new Set;let w={};const k=t.attributes.length;for(let e=0;k>e;e++){const i=t.attributes[e];Os(y,i.name)||(w[i.name]=$s(n,y,us(i.name),i.value,t,c))}if("link"===y&&o&&!g&&Ps(w.rel)){let e=t.sheet;if(!e){const i=function(t){return t.href}(t);i&&(e=qs(n,i),!e&&i.includes(".css"))&&(e=qs(n,window.location.origin+"/"+i.replace(window.location.href,"")))}let i=null;e&&(Bo(e)?xo>0&&(Eo.push(t),Ao+=1):i=Yo(e)),i&&(delete w.rel,delete w.href,w._cssText=i)}var _;if("style"===y&&t.sheet&&!(t.innerText||yo.textContent(t)||"").trim().length){const e=qo(()=>Yo(t.sheet));e&&(w._cssText=e)}if("input"===y||"textarea"===y||"select"===y){const e=t.value,n=t.checked;"radio"!==w.type&&"checkbox"!==w.type&&"submit"!==w.type&&"button"!==w.type&&e?w.value=ls({element:t,type:fs(t),tagName:y,value:e,maskInputOptions:s,maskInputFn:a}):n&&(w.checked=n)}if("option"===y&&(t.selected&&!s.select?w.selected=!0:delete w.selected),"dialog"===y&&t.open){try{w.rr_open_mode=t.matches("dialog:modal")?"modal":"non-modal"}catch(t){w.rr_open_mode="modal",w.ph_rr_could_not_detect_modal=!0}b.add("rr_open_mode")}if("canvas"===y&&h&&!(null==f?void 0:f()))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=hs in r?r[hs]: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)||(w.rr_dataURL=t.toDataURL(c.type,c.quality));else if(!("__context"in t)){const e=t.toDataURL(c.type,c.quality),i=n.createElement("canvas");i.width=t.width,i.height=t.height,e!==i.toDataURL(c.type,c.quality)&&(w.rr_dataURL=e)}}catch(t){"SecurityError"===(null==(_=t)?void 0:_.name)?Cs||(Cs=!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.",_)):console.warn("Cannot read canvas pixels, so this canvas is left out of the recording.",_)}let S,x=!1;if("img"===y&&d){bs||(bs=n.createElement("canvas"),ws=bs.getContext("2d"));const e=t,i=e.currentSrc||e.getAttribute("src")||"<unknown-src>",r=e.crossOrigin,o=(e,n)=>x?ds({element:t,name:e,value:n,maskAllElementAttributes:l,maskAttributeFn:u}):n,s=()=>{Fs(e,"load",s);try{bs.width=e.naturalWidth,bs.height=e.naturalHeight,ws.drawImage(e,0,0);const t=bs.toDataURL(c.type,c.quality);w.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=${i}! Error: ${t}`)}"anonymous"===e.crossOrigin&&(r?w.crossOrigin=o("crossOrigin",r):e.removeAttribute("crossorigin"))};e.complete&&0!==e.naturalWidth?s():e.addEventListener("load",s)}if("audio"===y||"video"===y){const e=w;e.rr_mediaState=t.paused?"paused":"played",b.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(p||(t.scrollLeft&&(w.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(w.rr_scrollTop=t.scrollTop)),g){var C,I,M;const{width:e,height:i,left:r,top:o}=t.getBoundingClientRect(),s=null===(C=n.defaultView)||void 0===C?void 0:C.getComputedStyle(t);w={class:w.class,rr_width:`${e}px`,rr_height:`${i}px`,rr_left:`${Math.floor(r+((null===(I=n.defaultView)||void 0===I?void 0:I.scrollX)||0))}px`,rr_top:`${Math.floor(o+((null===(M=n.defaultView)||void 0===M?void 0:M.scrollY)||0))}px`},b.add("rr_width"),b.add("rr_height"),b.add("rr_left"),b.add("rr_top"),s&&(w.rr_position=s.position||"static",b.add("rr_position"),s.transform&&"none"!==s.transform&&(w.rr_transform=s.transform,b.add("rr_transform")),s.display&&s.display.startsWith("inline")&&(w.rr_display=s.display,b.add("rr_display")))}if("iframe"!==y||v(w.src)||(t.contentDocument||(w.rr_src=w.src),delete w.src),l||u)for(const[e,n]of Object.entries(w))"string"!=typeof n&&null!==n||(w[e]=ds({element:t,name:e,value:n,maskAllElementAttributes:l,maskAttributeFn:u,isGenerated:b.has(e)}));x=!0;try{customElements.get(y)&&(S=!0)}catch(t){}return{type:io.Element,tagName:y,attributes:w,childNodes:[],isSVG:(T=t,Boolean("svg"===T.tagName||T.ownerSVGElement)||void 0),needBlock:g,rootId:m,isCustom:S};var T}(t,{doc:n,blockClass:r,blockSelector:o,inlineStylesheet:a,maskInputOptions:l,maskInputFn:c,maskAllElementAttributes:d,maskAttributeFn:h,dataURLOptions:f,inlineImages:v,recordCanvas:p,canvasMaskingConfigured:m,keepIframeSrcFn:g,newlyAddedElement:y,rootId:b});case t.TEXT_NODE:return function(t,e){const{needsMask:n,maskTextFn:i,rootId:r}=e,o=yo.parentNode(t),s=o&&o.tagName;let a=yo.textContent(t);const l="STYLE"===s||void 0,u="SCRIPT"===s||void 0;if(l&&a){try{var c;if(t.nextSibling||t.previousSibling);else if(Bo(o.sheet));else if(null===(c=o.sheet)||void 0===c?void 0:c.cssRules){const t=Yo(o.sheet);t&&!/(?:^|[\s;{}])-?[a-zA-Z][\w-]*\s*:\s*;/.test(t)&&(a=t)}}catch(e){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${e}`,t)}a=ys(a,Es(e.doc))}return u&&(a="SCRIPT_PLACEHOLDER"),!l&&!u&&a&&n&&(a=i?i(a,yo.parentElement(t)):a.replace(/[\S]/g,"*")),{type:io.Text,textContent:a||"",isStyle:l,rootId:r}}(t,{doc:n,needsMask:s,maskTextFn:u,rootId:b});case t.CDATA_SECTION_NODE:return{type:io.CDATA,textContent:"",rootId:b};case t.COMMENT_NODE:return{type:io.Comment,textContent:yo.textContent(t)||"",rootId:b};default:return!1}}(t,{doc:n,mirror:i,blockClass:r,blockSelector:o,needsMask:E,inlineStylesheet:u,maskInputOptions:c,maskTextFn:d,maskInputFn:h,maskAllElementAttributes:f,maskAttributeFn:v,dataURLOptions:m,inlineImages:g,recordCanvas:y,canvasMaskingConfigured:b,keepIframeSrcFn:I,newlyAddedElement:M});if(!O)return console.warn(t,"not serialized"),null;let P;P=i.hasNode(t)?i.getId(t):function(t,e){if(e.comment&&t.type===io.Comment)return!0;if(t.type===io.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&&(js(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===js(t.attributes.name)||["icon","apple-touch-icon","shortcut icon"].includes(js(t.attributes.rel)))))return!0;if("meta"===t.tagName){if(e.headMetaDescKeywords&&js(t.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(js(t.attributes.property).match(/^(og|twitter|fb):/)||js(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===js(t.attributes.name)))return!0;if(e.headMetaRobots&&["robots","googlebot","bingbot"].includes(js(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(js(t.attributes.name))||js(t.attributes.property).match(/^article:/)||js(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(js(t.attributes.name)))return!0}}return!1}(O,p)||!A&&O.type===io.Text&&!O.isStyle&&!O.textContent.replace(/^\s+|\s+$/gm,"").length?-2:xs();const L=Object.assign(O,{id:P});if(i.add(t,L),-2===P)return null;w&&w(t);let D=!l;if(L.type===io.Element){D=D&&!L.needBlock,delete L.needBlock;const e=yo.shadowRoot(t);e&&Zo(e)&&(L.isShadowHost=!0)}if((L.type===io.Document||L.type===io.Element)&&D){p.headWhitespace&&L.type===io.Element&&"head"===L.tagName&&(A=!1);const e={doc:n,mirror:i,blockClass:r,blockSelector:o,needsMask:E,maskTextClass:s,maskTextSelector:a,skipChild:l,inlineStylesheet:u,maskInputOptions:c,maskTextFn:d,maskInputFn:h,maskAllElementAttributes:f,maskAttributeFn:v,slimDOMOptions:p,dataURLOptions:m,inlineImages:g,recordCanvas:y,canvasMaskingConfigured:b,preserveWhiteSpace:A,onSerialize:w,onIframeLoad:k,iframeLoadTimeout:_,onIframeListenerRegistered:S,onStylesheetLoad:x,stylesheetLoadTimeout:C,keepIframeSrcFn:I,depth:T+1,maxDepth:R};if(L.type===io.Element&&"textarea"===L.tagName&&void 0!==L.attributes.value);else for(const n of Array.from(yo.childNodes(t))){const t=Hs(n,e);t&&L.childNodes.push(t)}let M=null;if(Go(t)&&(M=yo.shadowRoot(t)))for(const t of Array.from(yo.childNodes(M))){const n=Hs(t,e);n&&(Zo(M)&&(n.isShadow=!0),L.childNodes.push(n))}}const F=yo.parentNode(t);if(F&&Qo(F)&&Zo(F)&&(L.isShadow=!0),L.type===io.Element&&"iframe"===L.tagName){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),Fs(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?Fs(t,"load",s):(i=!0,Fs(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),Fs(t,"load",s)}}return t.addEventListener("load",s),()=>{Fs(t,"load",s)}}(t,()=>{const e=t.contentDocument;if(e&&k){const n=Hs(e,{doc:e,mirror:i,blockClass:r,blockSelector:o,needsMask:E,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:u,maskInputOptions:c,maskTextFn:d,maskInputFn:h,maskAllElementAttributes:f,maskAttributeFn:v,slimDOMOptions:p,dataURLOptions:m,inlineImages:g,recordCanvas:y,canvasMaskingConfigured:b,preserveWhiteSpace:A,onSerialize:w,onIframeLoad:k,iframeLoadTimeout:_,onIframeListenerRegistered:S,onStylesheetLoad:x,stylesheetLoadTimeout:C,keepIframeSrcFn:I,depth:T+1,maxDepth:R});n&&k(t,n)}},_);null==S||S(t,e)}return L.type===io.Element&&"link"===L.tagName&&Ps(L.attributes.rel)&&function(e,l,S){if(Ns.has(e))return;let M;try{M=e.sheet}catch(t){return}if(M)return;const O=new AbortController;let P=!1;const L=()=>{if(!P){P=!0;try{(()=>{if(x){const e=Hs(t,{doc:n,mirror:i,blockClass:r,blockSelector:o,needsMask:E,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:u,maskInputOptions:c,maskTextFn:d,maskInputFn:h,maskAllElementAttributes:f,maskAttributeFn:v,slimDOMOptions:p,dataURLOptions:m,inlineImages:g,recordCanvas:y,canvasMaskingConfigured:b,preserveWhiteSpace:A,onSerialize:w,onIframeLoad:k,iframeLoadTimeout:_,onStylesheetLoad:x,stylesheetLoadTimeout:C,keepIframeSrcFn:I,depth:T,maxDepth:R});e&&x(t,e)}})()}finally{Ns.delete(e),O.abort()}}},D=setTimeout(L,S);O.signal.addEventListener("abort",()=>clearTimeout(D),{once:!0}),e.addEventListener("load",L,{signal:O.signal,once:!0}),Ns.set(e,O)}(t,0,C),L}function Us(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 Ws=class t{constructor(...t){Vo(this,"parentElement",null),Vo(this,"parentNode",null),Vo(this,"ownerDocument",void 0),Vo(this,"firstChild",null),Vo(this,"lastChild",null),Vo(this,"previousSibling",null),Vo(this,"nextSibling",null),Vo(this,"ELEMENT_NODE",1),Vo(this,"TEXT_NODE",3),Vo(this,"nodeType",void 0),Vo(this,"nodeName",void 0),Vo(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 Vs(t,e,n=document){const i={capture:!0,passive:!0};return n.addEventListener(t,e,i),()=>Gs(n,t,e,i)}function Gs(t,e,n,i){Qs(()=>{const r=t.removeEventListener;"function"==typeof r&&(void 0!==i?r.call(t,e,n,i):r.call(t,e,n))})}function Qs(t){try{t()}catch(t){if(!(t instanceof DOMException&&"SecurityError"===t.name))throw t}}function Zs(t){t.forEach(t=>{if("function"==typeof t)try{t()}catch(t){}})}var Js="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.",Ks={map:{},getId(){return console.warn(Js),-1},getNode(){return console.warn(Js),null},removeNodeFromMap(){console.warn(Js)},has(){return console.warn(Js),!1},reset(){console.warn(Js)}};function Xs(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 Ys(t,e,n,i,r=window){const o=r.Object.getOwnPropertyDescriptor(t,e),s=()=>Ys(t,e,o||{},!0);if(i)return r.Object.defineProperty(t,e,n),s;const a=function(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){}}}(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&&(Ks=new Proxy(Ks,{get(t,e,n){return"map"===e&&console.warn(Js),Reflect.get(t,e,n)}}));var ta=Date.now;function ea(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=yo.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=yo.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 na(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function ia(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function ra(t){return t?t.nodeType===t.ELEMENT_NODE?t:yo.parentElement(t):null}function oa(t,e,n,i){if(!t)return!1;const r=ra(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(Ls(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 sa(t,e,n){return!("TITLE"!==t.tagName||!n.headTitleMutations)||-2===e.getId(t)}function aa(t,e){if(Qo(t))return!1;const n=e.getId(t);if(!e.has(n))return!0;const i=yo.parentNode(t);return(!i||i.nodeType!==t.DOCUMENT_NODE)&&(!i||aa(i,e))}function la(t){return Boolean(t.changedTouches)}function ua(t,e){return Boolean("IFRAME"===t.nodeName&&e.getMeta(t))}function ca(t,e){return Boolean("LINK"===t.nodeName&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&"stylesheet"===t.getAttribute("rel")&&e.getMeta(t))}function da(t){return!!t&&(t instanceof Ws&&"shadowRoot"in t?Boolean(t.shadowRoot):Boolean(yo.shadowRoot(t)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(ta=()=>(new Date).getTime());var ha=class{constructor(){Vo(this,"id",1),Vo(this,"styleIDMap",new WeakMap),Vo(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 fa(t){var e;let n=null;return"getRootNode"in t&&(null===(e=yo.getRootNode(t))||void 0===e?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&yo.host(yo.getRootNode(t))&&(n=yo.host(yo.getRootNode(t))),n}function va(t){const e=t.ownerDocument;if(!e)return!1;if(yo.contains(e,t))return!0;const n=yo.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=fa(n);)n=e;return n}(t);return yo.contains(e,n)}(t)}function pa(t){return"__ln"in t}var ma,ga=class{constructor(){Vo(this,"length",0),Vo(this,"head",null),Vo(this,"tail",null)}get(t){if(t>=this.length)throw new Error("Position outside of list range");let e=this.head;for(let n=0;t>n;n++)e=(null==e?void 0:e.next)||null;return e}addNode(t){const e={value:t,previous:null,next:null};if(t.__ln=e,t.previousSibling&&pa(t.previousSibling)){const n=t.previousSibling.__ln.next;e.next=n,e.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=e,n&&(n.previous=e)}else if(t.nextSibling&&pa(t.nextSibling)&&t.nextSibling.__ln.previous){const n=t.nextSibling.__ln.previous;e.previous=n,e.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=e,n&&(n.next=e)}else this.head&&(this.head.previous=e),e.next=this.head,this.head=e;null===e.next&&(this.tail=e),this.length++}removeNode(t){const e=t.__ln;this.head&&(e.previous?(e.previous.next=e.next,e.next?e.next.previous=e.previous:this.tail=e.previous):(this.head=e.next,this.head?this.head.previous=null:this.tail=null),t.__ln&&delete t.__ln,this.length--)}},ya=(t,e)=>`${t}@${e}`,ba=class{constructor(){Vo(this,"frozen",!1),Vo(this,"locked",!1),Vo(this,"texts",[]),Vo(this,"attributes",[]),Vo(this,"attributeMap",new WeakMap),Vo(this,"generatedAttributes",new WeakMap),Vo(this,"removes",[]),Vo(this,"mapRemoves",new Set),Vo(this,"movedMap",{}),Vo(this,"addedSet",new Set),Vo(this,"movedSet",new Set),Vo(this,"droppedSet",new Set),Vo(this,"removesSubTreeCache",new Set),Vo(this,"mutationCb",void 0),Vo(this,"blockClass",void 0),Vo(this,"blockSelector",void 0),Vo(this,"maskTextClass",void 0),Vo(this,"maskTextSelector",void 0),Vo(this,"inlineStylesheet",void 0),Vo(this,"maskInputOptions",void 0),Vo(this,"maskTextFn",void 0),Vo(this,"maskInputFn",void 0),Vo(this,"maskAllElementAttributes",void 0),Vo(this,"maskAttributeFn",void 0),Vo(this,"keepIframeSrcFn",void 0),Vo(this,"recordCanvas",void 0),Vo(this,"canvasMaskingConfigured",void 0),Vo(this,"inlineImages",void 0),Vo(this,"slimDOMOptions",void 0),Vo(this,"dataURLOptions",void 0),Vo(this,"doc",void 0),Vo(this,"mirror",void 0),Vo(this,"iframeManager",void 0),Vo(this,"stylesheetManager",void 0),Vo(this,"shadowDomManager",void 0),Vo(this,"canvasManager",void 0),Vo(this,"processedNodeManager",void 0),Vo(this,"unattachedDoc",void 0),Vo(this,"canvasManagerReleased",!1),Vo(this,"processMutations",t=>{t.forEach(this.processMutation),this.emit()}),Vo(this,"emit",()=>{if(this.frozen||this.locked)return;const t=bo(),e=_o();try{this.processBufferedMutations()}finally{n=bo()-t,i=e,xo>0||So(n,null!=i?i:wo)||n>Oo.slowestBatchMs&&(Oo.slowestBatchMs=n)}var n,i}),Vo(this,"processBufferedMutations",()=>{const t=[],e=new Set,n=new ga,i=t=>{let e=t,n=-2;for(;-2===n;)e=e&&e.nextSibling,n=e&&this.mirror.getId(e);return n};let r;const o=o=>{var s;const a=yo.parentNode(o);if(!a||!va(o)||"TEXTAREA"===a.tagName)return;if(this.isBlockedAtEmission(a))return;const l=Qo(a)?this.mirror.getId(fa(o)):this.mirror.getId(a),u=i(o);if(-1===l||-1===u)return n.addNode(o);null!==(s=r)&&void 0!==s||(r={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,maskAllElementAttributes:this.maskAllElementAttributes,maskAttributeFn:this.maskAttributeFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,canvasMaskingConfigured:this.canvasMaskingConfigured,inlineImages:this.inlineImages,onSerialize:t=>{ua(t,this.mirror)&&this.iframeManager.addIframe(t),ca(t,this.mirror)&&this.stylesheetManager.trackLinkElement(t),da(t)&&!oa(t,this.blockClass,this.blockSelector,!0)&&this.shadowDomManager.addShadowRoot(yo.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)=>{this.stylesheetManager.attachLinkElement(t,e)}});const c=Hs(o,r);c&&(t.push({parentId:l,nextId:u,node:c}),e.add(c.id))};for(const t of this.mapRemoves)this.mapRemoves.delete(t),this.mirror.removeNodeFromMap(t);for(const t of this.movedSet)ka(this.removesSubTreeCache,t)&&!this.movedSet.has(yo.parentNode(t))||o(t);for(const t of this.addedSet)_a(this.droppedSet,t)||ka(this.removesSubTreeCache,t)?_a(this.movedSet,t)?o(t):this.droppedSet.add(t):o(t);let s=null;for(;n.length;){let t=null;if(s){const e=this.mirror.getId(yo.parentNode(s.value)),n=i(s.value);-1!==e&&-1!==n&&(t=s)}if(!t){let e=n.tail;for(;e;){const n=e;if(e=e.previous,n){const e=this.mirror.getId(yo.parentNode(n.value));if(-1===i(n.value))continue;if(-1!==e){t=n;break}{const e=yo.parentNode(n.value);if(e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const i=yo.host(e);if(-1!==this.mirror.getId(i)){t=n;break}}}}}}if(!t){for(;n.head;)n.removeNode(n.head.value);break}s=t.previous,n.removeNode(t.value),o(t.value)}const a={texts:this.texts.filter(t=>!this.isBlockedAtEmission(t.node)).map(t=>{const e=t.node,n=yo.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:this.attributes.filter(t=>!this.isBlockedAtEmission(t.node)).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]=ds({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};this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.generatedAttributes=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.removesSubTreeCache=new Set,this.movedMap={},(a.texts.length||a.attributes.length||a.removes.length||a.adds.length)&&this.mutationCb(a)}),Vo(this,"bufferBelongsToIframe",t=>this.doc===t.contentDocument),Vo(this,"genTextAreaValueMutation",t=>{let e=this.attributeMap.get(t);e||(e={node:t,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(e),this.attributeMap.set(t,e));const n=Array.from(yo.childNodes(t),t=>yo.textContent(t)||"").join("");e.attributes.value=ls({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:fs(t),value:n,maskInputFn:this.maskInputFn})}),Vo(this,"processMutation",t=>{if(!sa(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":{const e=yo.textContent(t.target);oa(t.target,this.blockClass,this.blockSelector,!1)||e===t.oldValue||this.texts.push({value:Ds(t.target,this.maskTextClass,this.maskTextSelector,!0)&&e?this.maskTextFn?this.maskTextFn(e,ra(t.target)):e.replace(/[\S]/g,"*"):e,node:t.target});break}case"attributes":{var e;const i=t.target,r=us(i.tagName),o=t.attributeName,s=null!==(e=t.attributeNamespace)&&void 0!==e?e: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}(i,o,s),l=s?i.getAttributeNS(s,o):t.target.getAttribute(o);if("value"===a){const t=i,e=fs(t);l=ls({element:t,maskInputOptions:this.maskInputOptions,tagName:i.tagName,type:e,value:l,maskInputFn:this.maskInputFn})}if(oa(t.target,this.blockClass,this.blockSelector,!1)||l===t.oldValue)return;let u=this.attributeMap.get(t.target);const c="iframe"===r&&"src"===a;if(c&&!this.keepIframeSrcFn(l)&&i.contentDocument)return;if("type"===a&&"input"===r&&"password"===(t.oldValue||"").toLowerCase()&&i.setAttribute("data-rr-is-password","true"),!Os(r,a)){var n;u||(u={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(u),this.attributeMap.set(t.target,u));const e=$s(this.doc,r,us(a),l,i,this.dataURLOptions);if(c&&!this.keepIframeSrcFn(l)&&(a="rr_src"),u.attributes[a]=e,null===(n=this.generatedAttributes.get(t.target))||void 0===n||n.delete(a),"style"===a){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(t){this.unattachedDoc=this.doc}const e=this.unattachedDoc.createElement("span"),n=i.style;t.oldValue&&(e.style.cssText=t.oldValue);for(const t of Array.from(n)){const i=n.getPropertyValue(t),r=n.getPropertyPriority(t);i!==e.style.getPropertyValue(t)||r!==e.style.getPropertyPriority(t)?u.styleDiff[t]=""===r?i:[i,r]:u._unchangedStyles[t]=[i,r]}for(const t of Array.from(e.style))""===n.getPropertyValue(t)&&(u.styleDiff[t]=!1)}else if("open"===a&&"dialog"===r){u.attributes.rr_open_mode=i.matches("dialog:modal")?"modal":"non-modal";let e=this.generatedAttributes.get(t.target);e||(e=new Set,this.generatedAttributes.set(t.target,e)),e.add("rr_open_mode")}}break}case"childList":if(oa(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=Qo(t.target)?this.mirror.getId(yo.host(t.target)):this.mirror.getId(t.target);oa(t.target,this.blockClass,this.blockSelector,!1)||sa(e,this.mirror,this.slimDOMOptions)||!function(t,e){return-1!==e.getId(t)}(e,this.mirror)||(this.addedSet.has(e)?(wa(this.addedSet,e),this.droppedSet.add(e)):this.addedSet.has(t.target)&&-1===n||aa(t.target,this.mirror)||(this.movedSet.has(e)&&this.movedMap[ya(n,i)]?wa(this.movedSet,e):(this.removes.push({parentId:i,id:n,isShadow:!(!Qo(t.target)||!Zo(t.target))||void 0}),function(t,e){const n=[t];for(;n.length;){const t=n.pop();e.has(t)||(e.add(t),yo.childNodes(t).forEach(t=>n.push(t)))}}(e,this.removesSubTreeCache))),this.mapRemoves.add(e))})}}),Vo(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(sa(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[ya(this.mirror.getId(t),n)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);if(!oa(t,this.blockClass,this.blockSelector,!1)){if(t.nodeType===t.TEXT_NODE)return;const e=yo.childNodes(t);for(let t=0,n=e.length;n>t;t++){const n=e[t];n&&this.genAdds(n)}if(da(t)){const e=yo.childNodes(yo.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","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()}reset(){this.releaseCanvasManager()}releaseCanvasManager(){this.canvasManagerReleased||(this.canvasManagerReleased=!0,this.canvasManager.reset())}bufferDoc(){return this.doc}destroy(){for(const t of this.mapRemoves)this.mapRemoves.delete(t),this.mirror.removeNodeFromMap(t)}isBlockedAtEmission(t){const e=this.blockClass,n=e&&"string"!=typeof e&&(e.global||e.sticky)?new RegExp(e):null;for(;t;){if(n&&(n.lastIndex=0),oa(t,n||e,this.blockSelector,!0))return!0;const i="getRootNode"in t?yo.getRootNode(t):null;t=(null==i?void 0:i.nodeType)===Node.DOCUMENT_FRAGMENT_NODE?yo.host(i):null}return!1}};function wa(t,e){const n=[e];for(;n.length;){const e=n.pop();if(t.delete(e),e.nodeType===e.TEXT_NODE)continue;const i=yo.childNodes(e);for(let t=0,e=i.length;e>t;t++){const e=i[t];e&&n.push(e)}}}function ka(t,e,n){return 0!==t.size&&function(t,e){const n=yo.parentNode(e);return!!n&&t.has(n)}(t,e)}function _a(t,e){if(0===t.size)return!1;let n=yo.parentNode(e);for(;n;){if(t.has(n))return!0;n=yo.parentNode(n)}return!1}function Sa(t){ma=t}function xa(){ma=void 0}var Ca=(t,e="rrweb")=>ma?(...n)=>{try{return t(...n)}catch(t){if(ma&&!0===ma(t,e))return;throw t}}:t,Ia=[];function Ma(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 Ta(t,e){const n=new ba;let i;n.init(t);try{i=new(mo())(Ca(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),Ia.push(n),{observer:i,buffer:n}}catch(t){try{null==i||i.disconnect(),n.destroy(),n.reset()}catch(t){}throw t}}function Ra({scrollCb:t,doc:e,mirror:n,blockClass:i,blockSelector:r,sampling:o}){const s=new Map,a=o=>{const a=Ma(o);if(!a||oa(a,i,r,!0))return;const l=n.getId(a);let u,c;if(a===e&&e.defaultView){const t=ea(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=[Vs("scroll",Ca(Xs(Ca(t=>a(t)),o.scroll||100)),e)];return"onscrollend"in e&&l.push(Vs("scrollend",Ca(a),e)),()=>l.forEach(t=>t())}function Ea(t,e){for(let n=Ia.length-1;n>=0;n--){const i=Ia[n];if(!i)continue;let r=i.bufferBelongsToIframe(t);!r&&e&&e.has(i.bufferDoc())&&(r=!0),r&&(i.reset(),Ia.splice(n,1))}}var Aa=["INPUT","TEXTAREA","SELECT"],$a=new WeakMap;function Oa(t){return function t(e,n){if(Na("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||Na("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||Na("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||Na("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 Pa(t,e,n){let i,r;return t?(t.ownerNode?i=e.getId(t.ownerNode):r=n.getId(t),{styleId:r,id:i}):{}}function La({mirror:t,stylesheetManager:e},n){var i,r;let o=null;o=t.getId("#document"===n.nodeName?n:yo.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=(null==s?void 0:s.prototype)?Object.getOwnPropertyDescriptor(null==s?void 0:s.prototype,"adoptedStyleSheets"):void 0;return null!==o&&-1!==o&&s&&a?(Object.defineProperty(n,"adoptedStyleSheets",{configurable:a.configurable,enumerable:a.enumerable,get(){var t;return null===(t=a.get)||void 0===t?void 0:t.call(this)},set(t){let n;try{var i;n=null===(i=a.set)||void 0===i?void 0:i.call(this,t)}catch(t){if(t&&"object"==typeof t&&"NotAllowedError"===t.name)return;throw t}if(null!==o&&-1!==o)try{e.adoptStyleSheets(t,o)}catch(t){}return n}}),Ca(()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:a.configurable,enumerable:a.enumerable,get:a.get,set:a.set})})):()=>{}}var Da=new Set;function Fa(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=Ca(()=>{try{if(r)try{r.destroy(),r.reset()}finally{const t=Ia.indexOf(r);-1!==t&&Ia.splice(t,1)}t.shadowDomManager.resetForDoc(t.doc),null==i||i.disconnect()}finally{Zs(o)}}),a=(t,e)=>{const n=Ca(()=>{try{return e()}catch(e){throw Da.add(t),e}})();"function"==typeof n&&o.push(n)};try{if(t.recordDOM&&a("mutation",()=>{const e=Ta(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=Xs(Ca(e=>{const n=Date.now()-s;t(a.map(t=>(t.timeOffset-=n,t)),e),a=[],s=null}),o),u=Ca(Xs(Ca(t=>{const e=Ma(t),{clientX:n,clientY:r}=la(t)?t.changedTouches[0]:t;s||(s=ta()),a.push({x:n,y:r,id:i.getId(e),timeOffset:ta()-s}),l("undefined"!=typeof DragEvent&&t instanceof DragEvent?Xr.Drag:t instanceof MouseEvent?Xr.MouseMove:Xr.TouchMove)}),r,{trailing:!1})),c=[Vs("mousemove",u,n),Vs("touchmove",u,n),Vs("drag",u,n)];return Ca(()=>{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(Yr).filter(t=>Number.isNaN(Number(t))&&!t.endsWith("_Departed")&&!1!==s[t]).forEach(o=>{let s=us(o);const u=(e=>o=>{const s=Ma(o);if(oa(s,i,r,!0))return;let a=null,u=e;if("pointerType"in o){switch(o.pointerType){case"mouse":a=to.Mouse;break;case"touch":a=to.Touch;break;case"pen":a=to.Pen}a===to.Touch&&(Yr[e]===Yr.MouseDown?u="TouchStart":Yr[e]===Yr.MouseUp&&(u="TouchEnd"))}else la(o)&&(a=to.Touch);null!==a?(l=a,(u.startsWith("Touch")&&a===to.Touch||u.startsWith("Mouse")&&a===to.Mouse)&&(a=null)):Yr[e]===Yr.Click&&(a=l,l=null);const c=la(o)?o.changedTouches[0]:o;if(!c)return;const d=n.getId(s),{clientX:h,clientY:f}=c;Ca(t)(D({type:Yr[u],id:d,x:h,y:f},null!==a&&{pointerType:a}))})(o);if(window.PointerEvent)switch(Yr[o]){case Yr.MouseDown:case Yr.MouseUp:s=s.replace("mouse","pointer");break;case Yr.TouchStart:case Yr.TouchEnd:return}a.push(Vs(s,u,e))}),Ca(()=>{a.forEach(t=>t())})}(t)),a("scroll",()=>Ra(t)),a("viewportResize",()=>function({viewportResizeCb:t},{win:e}){let n=-1,i=-1;return Vs("resize",Ca(Xs(Ca(()=>{const e=na(),r=ia();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,sampling:u,userTriggeredOnInput:c}){function d(t){let n=Ma(t);const u=t.isTrusted,d=e.defaultView;if(n&&d&&!(n instanceof d.HTMLElement))return;const f=n&&n.tagName;if(n&&"OPTION"===f&&(n=yo.parentElement(n)),!n||!f||0>Aa.indexOf(f)||oa(n,i,r,!0))return;if(n.classList.contains(o)||s&&n.matches(s))return;let v=n.value,p=!1;const m=fs(n)||"";"radio"===m||"checkbox"===m?p=n.checked:(a[f.toLowerCase()]||a[m])&&(v=ls({element:n,maskInputOptions:a,tagName:f,type:m,value:v,maskInputFn:l})),h(n,c?{text:v,isChecked:p,userTriggered:u}:{text:v,isChecked:p});const g=n.name;"radio"===m&&g&&p&&e.querySelectorAll(`input[type="radio"][name="${g}"]`).forEach(t=>{if(t!==n){const e=t.value;h(t,c?{text:e,isChecked:!p,userTriggered:!1}:{text:e,isChecked:!p})}})}function h(e,i){const r=$a.get(e);if(!r||r.text!==i.text||r.isChecked!==i.isChecked){$a.set(e,i);const r=n.getId(e);Ca(t)(D(D({},i),{},{id:r}))}}const f=("last"===u.input?["change"]:["input","change"]).map(t=>Vs(t,Ca(d),e)),v=e.defaultView;if(!v)return()=>{f.forEach(t=>t())};const p=v.Object.getOwnPropertyDescriptor(v.HTMLInputElement.prototype,"value");return p&&p.set&&f.push(...[[v.HTMLInputElement.prototype,"value"],[v.HTMLInputElement.prototype,"checked"],[v.HTMLSelectElement.prototype,"value"],[v.HTMLTextAreaElement.prototype,"value"],[v.HTMLSelectElement.prototype,"selectedIndex"],[v.HTMLOptionElement.prototype,"selected"]].map(t=>Ys(t[0],t[1],{set(){Ca(d)({target:this,isTrusted:!1})}},!1,v))),Ca(()=>{Zs(f)})}(t)),a("mediaInteraction",()=>function({mediaInteractionCb:t,blockClass:e,blockSelector:n,mirror:i,sampling:r,doc:o}){const s=Ca(o=>Xs(Ca(r=>{const s=Ma(r);if(!s||oa(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=[Vs("play",s(no.Play),o),Vs("pause",s(no.Pause),o),Vs("seeked",s(no.Seeked),o),Vs("volumechange",s(no.VolumeChange),o),Vs("ratechange",s(no.RateChange),o)];return Ca(()=>{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:Ca((i,o,s)=>{const[a]=s,l=i.apply(o,s);n.onCssomSheetMutation(o);const{id:u,styleId:c}=Pa(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:Ca((i,o,s)=>{const[a]=s,l=i.apply(o,s);n.onCssomSheetMutation(o);const{id:u,styleId:c}=Pa(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:Ca((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;n.onCssomSheetMutation(o);const{id:s,styleId:u}=Pa(o,e,n.styleMirror);if(!(s&&-1!==s||u&&-1!==u))return l;const c=r.queuePendingMutation(o,()=>t({id:s,styleId:u,replace:a}),()=>{const e=Yo(o);null!==e&&t({id:s,styleId:u,replace:e})});try{i.call(l,()=>c(!0),()=>c(!1))}catch(t){c(!1)}}catch(t){}return l},"host")})),i.CSSStyleSheet.prototype.replaceSync&&(l=i.CSSStyleSheet.prototype.replaceSync,i.CSSStyleSheet.prototype.replaceSync=new Proxy(l,{apply:Ca((i,o,s)=>{const[a]=s,l=i.apply(o,s);n.onCssomSheetMutation(o);const{id:u,styleId:c}=Pa(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={};qa("CSSGroupingRule")?u.CSSGroupingRule=i.CSSGroupingRule:(qa("CSSMediaRule")&&(u.CSSMediaRule=i.CSSMediaRule),qa("CSSConditionRule")&&(u.CSSConditionRule=i.CSSConditionRule),qa("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:Ca((i,o,s)=>{const[a]=s,l=i.apply(o,s);n.onCssomSheetMutation(o.parentStyleSheet);const{id:u,styleId:c}=Pa(o.parentStyleSheet,e,n.styleMirror);if(o.parentStyleSheet&&(u&&-1!==u||c&&-1!==c)){const e=[...Oa(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:Ca((i,o,s)=>{const[a]=s,l=i.apply(o,s);n.onCssomSheetMutation(o.parentStyleSheet);const{id:u,styleId:c}=Pa(o.parentStyleSheet,e,n.styleMirror);if(o.parentStyleSheet&&(u&&-1!==u||c&&-1!==c)){const e=[...Oa(o),a];r.queueMutation(o.parentStyleSheet,()=>t({id:u,styleId:c,removes:[{index:e}]}))}return l},"host")})}),Ca(()=>{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",()=>La(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:Ca((r,s,a)=>{var l;const[u,c,d]=a,h=r.apply(s,a);if(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}=Pa(f,e,i.styleMirror);if(v&&-1!==v||p&&-1!==p){const e=Oa(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:Ca((r,s,a)=>{var l;const[u]=a,c=r.apply(s,a);if(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}=Pa(d,e,i.styleMirror);if(h&&-1!==h||f&&-1!==f){const e=Oa(s.parentRule);o.queueMutation(d,()=>t({id:h,styleId:f,remove:{property:u},index:e}))}return c},"host")}),Ca(()=>{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=go(e.fonts,"add",function(e){return function(n){return setTimeout(Ca(()=>{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),Ca(()=>{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=Ca(()=>{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);oa(o,i,r,!0)||oa(l,i,r,!0)||a.push({start:n.getId(o),startOffset:s,end:n.getId(l),endOffset:u})}o({ranges:a})});return a(),Vs("selectionchange",a)}(t)),a("customElement",()=>function({doc:t,customElementCb:e}){const n=t.defaultView;return n&&n.customElements?go(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 Na(t){return void 0!==window[t]}function qa(t){return Boolean(void 0!==window[t]&&window[t].prototype&&"insertRule"in window[t].prototype&&"deleteRule"in window[t].prototype)}var ja=class{constructor(t){Vo(this,"generateIdFn",void 0),Vo(this,"iframeRemoteIdToLocalIdMap",new WeakMap),Vo(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}},Ba=class{constructor(t){Vo(this,"iframes",new WeakMap),Vo(this,"crossOriginIframeMap",new WeakMap),Vo(this,"crossOriginIframeMirror",new ja(xs)),Vo(this,"crossOriginIframeStyleMirror",void 0),Vo(this,"crossOriginIframeRootIdMap",new WeakMap),Vo(this,"mirror",void 0),Vo(this,"mutationCb",void 0),Vo(this,"wrappedEmit",void 0),Vo(this,"loadListener",void 0),Vo(this,"pageHideListener",void 0),Vo(this,"stylesheetManager",void 0),Vo(this,"recordCrossOriginIframes",void 0),Vo(this,"messageHandler",void 0),Vo(this,"nestedIframeListeners",new Map),Vo(this,"attachedWindows",new WeakMap),Vo(this,"attachedDocuments",new WeakMap),Vo(this,"attachedIframes",new Map),Vo(this,"loadListenerDisposers",new WeakMap),Vo(this,"iframeElementsById",new Map),Vo(this,"pageHideHandlers",new WeakMap),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new ja(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){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=>Qs(t)),this.loadListenerDisposers.delete(t))}removePageHideListener(t){const e=this.pageHideHandlers.get(t);e&&(e.forEach(({win:t,handler:e})=>{Gs(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);Qs(()=>{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)})}Qs(()=>{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)}transformCrossOriginEvent(t,e){switch(e.type){case Kr.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:Kr.IncrementalSnapshot,data:{source:Xr.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:e.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case Kr.Meta:case Kr.Load:case Kr.DomContentLoaded:return!1;case Kr.Plugin:return e;case Kr.Custom:return this.replaceIds(e.data.payload,t,["id","parentId","previousId","nextId"]),e;case Kr.IncrementalSnapshot:switch(e.data.source){case Xr.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 Xr.Drag:case Xr.TouchMove:case Xr.MouseMove:return e.data.positions.forEach(e=>{this.replaceIds(e,t,["id"])}),e;case Xr.ViewportResize:return!1;case Xr.MediaInteraction:case Xr.MouseInteraction:case Xr.Scroll:case Xr.CanvasMutation:case Xr.Input:return this.replaceIds(e.data,t,["id"]),e;case Xr.StyleSheetRule:case Xr.StyleDeclaration:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleId"]),e;case Xr.Font:return e;case Xr.Selection:return e.data.ranges.forEach(e=>{this.replaceIds(e,t,["start","end"])}),e;case Xr.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===io.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&&(Gs(t,"message",e),this.nestedIframeListeners.delete(t)),this.crossOriginIframeMap.delete(t)}),this.attachedWindows.delete(n)),t&&this.nestedIframeListeners.has(t)&&(Gs(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=>{Qs(()=>this.mirror.removeNodeFromMap(t))}),Qs(()=>Ea(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&&Gs(window,"message",this.messageHandler),this.nestedIframeListeners.forEach((t,e)=>{Gs(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}},za=class{constructor(t){Vo(this,"shadowDoms",new WeakSet),Vo(this,"mutationCb",void 0),Vo(this,"scrollCb",void 0),Vo(this,"bypassOptions",void 0),Vo(this,"mirror",void 0),Vo(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(!Zo(t))return;if(this.shadowDoms.has(t))return;this.shadowDoms.add(t);const r=null!==(n=null===(i=yo.host(t))||void 0===i?void 0:i.ownerDocument)&&void 0!==n?n:e,{observer:o,buffer:s}=Ta(D(D({},this.bypassOptions),{},{doc:r,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t);this.restoreHandlers.push({doc:r,handler(){o.disconnect(),s.destroy(),s.releaseCanvasManager();const t=Ia.indexOf(s);-1!==t&&Ia.splice(t,1)}}),this.restoreHandlers.push({doc:r,handler:Ra(D(D({},this.bypassOptions),{},{scrollCb:this.scrollCb,doc:t,mirror:this.mirror}))}),setTimeout(()=>{t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(yo.host(t))),this.restoreHandlers.push({doc:r,handler:La({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t)})},0)}observeAttachShadow(t){Qs(()=>{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:go(t.prototype,"attachShadow",function(t){return function(i){const r=t.call(this,i),o=yo.shadowRoot(this);return o&&va(this)&&n.addShadowRoot(o,e),r}})})}reset(){this.restoreHandlers.forEach(({handler:t})=>{try{t()}catch(t){}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}resetForDoc(t){const e=[];for(const n of this.restoreHandlers)if(n.doc===t)try{n.handler()}catch(t){}else e.push(n);this.restoreHandlers=e}},Ha="skip-frame";function Ua(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 Wa="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Va="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Ga=0;64>Ga;Ga++)Va[Wa.charCodeAt(Ga)]=Ga;var Qa=function(t){var e,n=new Uint8Array(t),i=n.length,r="";for(e=0;i>e;e+=3)r+=Wa[n[e]>>2],r+=Wa[(3&n[e])<<4|n[e+1]>>4],r+=Wa[(15&n[e+1])<<2|n[e+2]>>6],r+=Wa[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},Za=!1,Ja=new Map,Ka=(t,e,n)=>{if(!t||!tl(t,e)&&"object"!=typeof t)return;const i=function(t,e){let n=Ja.get(t);return n||(n=new Map,Ja.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 Xa(t,e,n,i){if(t instanceof Array)return t.map(t=>Xa(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:Qa(t)};if(t instanceof DataView)return{rr_type:t.constructor.name,args:[Xa(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)?Za||(Za=!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:[Xa(t.data,e,n,i),t.width,t.height]}:tl(t,e)||"object"==typeof t?{rr_type:t.constructor.name,index:Ka(t,e,n)}:t}var Ya=(t,e,n,i)=>t.map(t=>Xa(t,e,n,i)),tl=(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]))},el=["webgl","webgl2"];function nl(t){return"nodeType"in t}function il(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 go(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||nl(o)&&oa(o,e,n,!0))return i.call(this,r);nl(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?D(D({},r),{},{usage:"number"==typeof r.usage?r.usage|s:s}):r)}})}(t,e,n);i&&r.push(i)}const o=go(t.HTMLCanvasElement.prototype,"getContext",function(t){return function(r,...o){const s=function(t){return"experimental-webgl"===t?"webgl":t}(r);if(!oa(this,e,n,!0)&&("__context"in this||(this.__context=s),i&&el.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 rl(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=go(t,u,function(t){return function(...a){const l=t.apply(this,a);if(Ka(l,o,this),this.canvas&&"tagName"in this.canvas&&!oa(this.canvas,i,r,!0)){let t;try{t=Ya(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=Ys(t,u,{set(t){this.canvas&&"tagName"in this.canvas&&!oa(this.canvas,i,r,!0)&&n(this.canvas,{type:e,property:u,args:[t],setter:!0})}});a.push(s)}return a}var ol='(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\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 fingerprint = frameFingerprint(width, height, ctx.getImageData(0, 0, width, height).data);\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(dataURLOptions);\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',sl="undefined"!=typeof self&&self.Blob&&new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);",ol],{type:"text/javascript;charset=utf-8"});function al(t){let e;try{if(e=sl&&(self.URL||self.webkitURL).createObjectURL(sl),!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(ol),{name:null==t?void 0:t.name})}}var ll="A page CSP that omits blob: from worker-src or script-src blocks it";function ul(t,...e){console.warn(`[replay] canvas capture: ${t}`,...e)}var cl,dl,hl,fl=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){Vo(this,"pendingCanvasMutations",new Map),Vo(this,"rafStamps",{latestId:0,invokeId:null}),Vo(this,"mirror",void 0),Vo(this,"mutationCb",void 0),Vo(this,"resetObservers",void 0),Vo(this,"frozen",!1),Vo(this,"locked",!1),Vo(this,"rafIdTimestamp",null),Vo(this,"rafIdFlush",null),Vo(this,"refCount",0),Vo(this,"torndown",!1),Vo(this,"resetFrameDedup",null),Vo(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 ul("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=il(e,n,i,!0),l=new Map;let u;try{u=new al}catch(t){return ul(`disabled because the encode worker did not start. ${ll}`,t),void a()}let c=!1;u.onerror=t=>{var e;c=!0,ul(`stopped because the encode worker failed. ${ll}`,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:eo["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=>{oa(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 Ha}if(void 0===s)return;if(!Array.isArray(s)||!s.every(Ua))return Ha;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,ul("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,ul("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=il(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=go(e.CanvasRenderingContext2D.prototype,a,function(o){return function(...s){return oa(this.canvas,n,i,!0)||setTimeout(()=>{let n;try{n=Ya(s,e,this,r)}catch(t){return}t(this.canvas,{type:eo["2D"],property:a,args:n})},0),o.apply(this,s)}});o.push(s)}catch(r){const s=Ys(e.CanvasRenderingContext2D.prototype,a,{set(e){oa(this.canvas,n,i,!0)||t(this.canvas,{type:eo["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(...rl(e.WebGLRenderingContext.prototype,eo.WebGL,t,n,i,e,r)),void 0!==e.WebGL2RenderingContext&&o.push(...rl(e.WebGL2RenderingContext.prototype,eo.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,Jr)),{type:r}=n[0];this.mutationCb({id:e,type:r,commands:i}),this.pendingCanvasMutations.delete(t)}},vl=class{constructor(t){var e;Vo(this,"trackedLinkElements",new WeakSet),Vo(this,"pendingDeferredSheets",new Set),Vo(this,"mutationCb",void 0),Vo(this,"adoptedStyleSheetCb",void 0),Vo(this,"maskAllElementAttributes",void 0),Vo(this,"maskAttributeFn",void 0),Vo(this,"styleMirror",new ha),this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb,this.maskAllElementAttributes=null!==(e=t.maskAllElementAttributes)&&void 0!==e&&e,this.maskAttributeFn=t.maskAttributeFn}attachLinkElement(t,e){"_cssText"in e.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:e.id,attributes:e.attributes}]}),this.trackLinkElement(t)}beginDeferredLinkInlining(t,e){if(-1===e||!t.isConnected)return null;let n=null,i=null;try{i=t.sheet,i&&(n=ss(i))}catch(t){}if(!n||!i)return Ho(),null;const r=n;let o=!1;const s={sheet:i,invalidate(){o=!0}};this.pendingDeferredSheets.add(s);let a=!1;return{advance:n=>{if(a)return!0;const l=bo(),u=_o();let c=!0;try{if(o)return a=!0,Ho(),!0;if(!r.advance(n))return c=!1,!1;a=!0;const s=r.text();if(!t.isConnected)return!0;let l=null;try{l=t.sheet}catch(t){}return l!==i?(Ho(),!0):s?(this.emitCssTextMutation(t,e,s),!0):(Ho(),!0)}finally{c&&this.pendingDeferredSheets.delete(s),So(d=bo()-l,null!=(h=u)?h:wo)||(Po.totalMs+=d,d>Po.slowestSliceMs&&(Po.slowestSliceMs=d))}var d,h},remainingRules:()=>r.remainingRules(),discard:()=>{this.pendingDeferredSheets.delete(s)}}}onCssomSheetMutation(t){if(t&&0!==this.pendingDeferredSheets.size)for(const e of this.pendingDeferredSheets)e.sheet===t&&(this.pendingDeferredSheets.delete(e),e.invalidate())}inlineDeferredLinkElement(t,e){var n;null===(n=this.beginDeferredLinkInlining(t,e))||void 0===n||n.advance(1/0)}emitCssTextMutation(t,e,n){this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:e,attributes:{_cssText:ds({element:t,name:"_cssText",value:n,maskAllElementAttributes:this.maskAllElementAttributes,maskAttributeFn:this.maskAttributeFn})}}]})}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=bo();try{qo(()=>{try{const t=e.rules||e.cssRules;t&&No(t)}catch(t){}i.push({styleId:n,rules:Array.from(e.rules||CSSRule,(t,n)=>({rule:ts(t,e.href),index:n}))})})}finally{jo(bo()-r)}}n.styleIds.push(t)}i.length>0&&(n.styles=i),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet,this.pendingDeferredSheets.clear(),Ns.forEach(t=>t.abort()),Ns.clear()}trackStylesheetInLinkElement(t){}},pl=class{constructor(){Vo(this,"nodeMap",new WeakMap),Vo(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(){}},ml=!1;try{if(2!==Array.from([1],t=>2*t)[0]){var gl;const t=document.createElement("iframe");document.body.appendChild(t),Array.from=(null===(gl=t.contentWindow)||void 0===gl?void 0:gl.Array.from)||Array.from,document.body.removeChild(t)}}catch(t){console.debug("Unable to override Array.from",t)}var yl=new as,bl=new Set([Xr.Mutation,Xr.MediaInteraction,Xr.StyleSheetRule,Xr.CanvasMutation,Xr.Font,Xr.Log,Xr.StyleDeclaration,Xr.AdoptedStyleSheet]);function wl(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)}}function kl(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,maskTextFn:b,maskAllElementAttributes:w=!1,maskAttributeFn:k,hooks:_,packFn:S,sampling:x={},dataURLOptions:C={},canvasResolutionScale:I,canvasMasking:M,mousemoveWait:T,recordDOM:R=!0,recordCanvas:E=!1,recordCrossOriginIframes:A=!1,recordAfter:O=("DOMContentLoaded"===t.recordAfter?t.recordAfter:"load"),userTriggeredOnInput:P=!1,collectFonts:L=!1,inlineImages:F=!1,plugins:N,keepIframeSrcFn:q=()=>!1,ignoreCSSAttributes:j=new Set([]),attributeFilter:B,errorHandler:z}=t;Sa(z);const H=D({type:"image/webp",quality:.4,maxBase64ImageLength:1048576},C),U=!A||window.parent===window;let W=!1;if(!U)try{window.parent.document&&(W=!1)}catch(t){W=!0}if(U&&!r)throw new Error("emit function is required");if(!U&&!W)return()=>{};void 0!==T&&void 0===x.mousemove&&(x.mousemove=T),yl.reset();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}:void 0!==m?m:{password:!0},G=Us(void 0!==g&&g);let Q;!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 Z=0;const J=new Map;let K,X;const Y=t=>{for(const e of N||[])e.eventProcessor&&(t=e.eventProcessor(t));return S&&!W&&(t=S(t)),t};cl=(t,e)=>{var n;const i=t;if(i.timestamp=ta(),!(null===(n=Ia[0])||void 0===n?void 0:n.isFrozen())||i.type===Kr.FullSnapshot||i.type===Kr.IncrementalSnapshot&&bl.has(i.data.source)||Ia.forEach(t=>t.unfreeze()),U)null==r||r(Y(i),e);else if(W){const t={type:"rrweb",event:Y(i),origin:window.location.origin,isCheckout:e};window.parent.postMessage(t,"*")}if(i.type===Kr.FullSnapshot)Q=i,Z=0;else if(i.type===Kr.IncrementalSnapshot){if(i.data.source===Xr.Mutation&&i.data.isAttachIframe)return;Z++,(s&&Z>=s||o&&i.timestamp-Q.timestamp>o)&&dl(!0)}};const tt=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=yl.getNode(e.node.id);t&&"IFRAME"===t.nodeName&&n.add(t)}t.removes.forEach(({id:t})=>{if(e&&e.has(t))return;const i=rt.getIframeElementById(t);i&&n.has(i)?rt.forgetIframeId(t):(null==K||K(t),rt.removeIframeById(t))}),null==X||X(),rt.cleanupDetachedIframes()}cl({type:Kr.IncrementalSnapshot,data:D({source:Xr.Mutation},t)})},et=t=>cl({type:Kr.IncrementalSnapshot,data:D({source:Xr.Scroll},t)}),nt=t=>cl({type:Kr.IncrementalSnapshot,data:D({source:Xr.CanvasMutation},t)}),it=new vl({mutationCb:tt,adoptedStyleSheetCb:t=>cl({type:Kr.IncrementalSnapshot,data:D({source:Xr.AdoptedStyleSheet},t)}),maskAllElementAttributes:w,maskAttributeFn:k}),rt=new Ba({mirror:yl,mutationCb:tt,stylesheetManager:it,recordCrossOriginIframes:A,wrappedEmit:cl});for(const t of N||[])t.getMirror&&t.getMirror({nodeMirror:yl,crossOriginIframeMirror:rt.crossOriginIframeMirror,crossOriginIframeStyleMirror:rt.crossOriginIframeStyleMirror});const ot=new pl,st=null==M?void 0:M.configured;hl=new fl({recordCanvas:E,mutationCb:nt,win:window,blockClass:a,blockSelector:l,mirror:yl,sampling:x.canvas,dataURLOptions:H,resolutionScale:I,canvasMasking:M});const at=new za({mutationCb:tt,scrollCb:et,bypassOptions:{blockClass:a,blockSelector:l,maskTextClass:d,maskTextSelector:h,inlineStylesheet:f,maskInputOptions:V,dataURLOptions:H,maskTextFn:b,maskInputFn:y,maskAllElementAttributes:w,maskAttributeFn:k,recordCanvas:E,canvasMaskingConfigured:st,inlineImages:F,sampling:x,slimDOMOptions:G,iframeManager:rt,stylesheetManager:it,canvasManager:hl,keepIframeSrcFn:q,processedNodeManager:ot,attributeFilter:B},mirror:yl});dl=(t=!1)=>{if(R){Lo(v);try{if(cl({type:Kr.Meta,data:{href:window.location.href,width:ia(),height:na()}},t),n)return;null==e||e.cancel(),e=void 0,it.reset(),at.init(),Ia.forEach(t=>t.lock());let i=null,r=[];try{i=function(t,e){const{mirror:n=new as,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,maskAllElementAttributes:v=!1,maskAttributeFn:p,slimDOM:m=!1,dataURLOptions:g,preserveWhiteSpace:y,onSerialize:b,onIframeLoad:w,iframeLoadTimeout:k,onIframeListenerRegistered:_,onStylesheetLoad:S,stylesheetLoadTimeout:x,keepIframeSrcFn:C=()=>!1,maxDepth:I,inlineStylesheetBudgetRules:M}=e||{},T=!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}:!1===d?{password:!0}:d,R=Us(m);Lo(M);try{return Hs(t,{doc:t,mirror:n,blockClass:i,blockSelector:r,maskTextClass:o,maskTextSelector:s,skipChild:!1,inlineStylesheet:a,maskInputOptions:T,maskTextFn:h,maskInputFn:f,maskAllElementAttributes:v,maskAttributeFn:p,slimDOMOptions:R,dataURLOptions:g,inlineImages:l,recordCanvas:u,canvasMaskingConfigured:c,preserveWhiteSpace:y,onSerialize:b,onIframeLoad:w,iframeLoadTimeout:k,onIframeListenerRegistered:_,onStylesheetLoad:S,stylesheetLoadTimeout:x,keepIframeSrcFn:C,newlyAddedElement:!1,maxDepth:I})}finally{Do()}}(document,{mirror:yl,blockClass:a,blockSelector:l,maskTextClass:d,maskTextSelector:h,inlineStylesheet:f,maskAllInputs:V,inlineStylesheetBudgetRules:v,maskTextFn:b,maskInputFn:y,maskAllElementAttributes:w,maskAttributeFn:k,slimDOM:G,dataURLOptions:H,recordCanvas:E,canvasMaskingConfigured:st,inlineImages:F,onSerialize(t){ua(t,yl)&&rt.addIframe(t),ca(t,yl)&&it.trackLinkElement(t),da(t)&&at.addShadowRoot(yo.shadowRoot(t),document)},onIframeLoad(t,e){rt.attachIframe(t,e),at.observeAttachShadow(t)},onIframeListenerRegistered(t,e){rt.registerLoadListenerDisposer(t,e)},onStylesheetLoad(t,e){it.attachLinkElement(t,e)},keepIframeSrcFn:q})}finally{r=zo()}if(n)return;if(!i)return console.warn("Failed to snapshot the document");if(cl({type:Kr.FullSnapshot,data:{node:i,initialOffset:ea(window)}},t),n)return;if(Ia.forEach(t=>t.unlock()),hl.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&&Qs(()=>{s=e.beginDeferredLinkInlining(n,yl.getId(n))})},u=()=>{if(!s)return;const t=s;let e=!0;Qs(()=>{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,Uo(1)}e+=1}while(!i&&a()&&(t?!t.didTimeout&&t.timeRemaining()>5:10>e));i||(a()?r=wl(d):n())};return r=wl(d),{cancel(){i=!0,null==s||s.discard(),s=null,null==r||r.cancel(),r=null},flush(){if(i)return;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);Uo(e),null==s||s.discard(),s=null}n()}}}(r,it,()=>{e===t&&(e=void 0)});e=t}A&&rt.reattachIframes(),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&it.adoptStyleSheets(document.adoptedStyleSheets,yl.getId(document))}finally{Do()}}};try{const t=[];t.push(Vs("pagehide",()=>{try{null==e||e.flush()}catch(t){}e=void 0},window));for(const e of["visibilitychange","freeze","resume"])t.push(Vs(e,ko,document));K=e=>{const n=J.get(e);n&&(n.forEach(e=>{Qs(e);const n=t.indexOf(e);-1!==n&&t.splice(n,1)}),J.delete(e))},X=()=>{for(const[t]of J){const e=yl.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 r=t=>{var e;return Ca(Fa)({mutationCb:tt,mousemoveCb:(t,e)=>cl({type:Kr.IncrementalSnapshot,data:{source:e,positions:t}}),mouseInteractionCb:t=>cl({type:Kr.IncrementalSnapshot,data:D({source:Xr.MouseInteraction},t)}),scrollCb:et,viewportResizeCb:t=>cl({type:Kr.IncrementalSnapshot,data:D({source:Xr.ViewportResize},t)}),inputCb:t=>cl({type:Kr.IncrementalSnapshot,data:D({source:Xr.Input},t)}),mediaInteractionCb:t=>cl({type:Kr.IncrementalSnapshot,data:D({source:Xr.MediaInteraction},t)}),styleSheetRuleCb:t=>cl({type:Kr.IncrementalSnapshot,data:D({source:Xr.StyleSheetRule},t)}),styleDeclarationCb:t=>cl({type:Kr.IncrementalSnapshot,data:D({source:Xr.StyleDeclaration},t)}),canvasMutationCb:nt,fontCb:t=>cl({type:Kr.IncrementalSnapshot,data:D({source:Xr.Font},t)}),selectionCb(t){cl({type:Kr.IncrementalSnapshot,data:D({source:Xr.Selection},t)})},customElementCb(t){cl({type:Kr.IncrementalSnapshot,data:D({source:Xr.CustomElement},t)})},blockClass:a,ignoreClass:u,ignoreSelector:c,maskTextClass:d,maskTextSelector:h,maskInputOptions:V,inlineStylesheet:f,sampling:x,recordDOM:R,recordCanvas:E,canvasMaskingConfigured:st,inlineImages:F,userTriggeredOnInput:P,collectFonts:L,doc:t,maskInputFn:y,maskTextFn:b,maskAllElementAttributes:w,maskAttributeFn:k,keepIframeSrcFn:q,blockSelector:l,slimDOMOptions:G,dataURLOptions:H,mirror:yl,iframeManager:rt,stylesheetManager:it,shadowDomManager:at,processedNodeManager:ot,canvasManager:hl,ignoreCSSAttributes:j,attributeFilter:B,plugins:(null==N||null===(e=N.filter(t=>t.observer))||void 0===e?void 0:e.map(t=>({name:t.name,observer:t.observer,options:t.options,callback:e=>cl({type:Kr.Plugin,data:{plugin:t.name,payload:e}})})))||[]},_)};rt.addLoadListener(e=>{try{const n=yl.getId(e),i=r(e.contentDocument);if("function"==typeof i&&(t.push(i),-1!==n)){let t=J.get(n);t||(t=new Set,J.set(n,t)),t.add(i)}}catch(t){console.warn(t)}}),rt.addPageHideListener(t=>{const e=yl.getId(t);null==K||K(e),Ea(t)});let o=-1;const s=t=>cl({type:Kr.Custom,data:{tag:"rrweb/fullscreen",payload:t}}),v=()=>{var t,e,n,i;const r=document,a=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,l=a?yl.getId(a):-1;l!==o&&(-1!==o&&s({id:o,enter:!1}),o=l,-1!==l&&s({id:l,enter:!0}))},p=()=>{if(n||i)return;if(i=!0,dl(),n)return;const e=r(document);n?"function"==typeof e&&Zs([e]):("function"==typeof e&&t.push(e),t.push(Vs("fullscreenchange",v)),t.push(Vs("webkitfullscreenchange",v)),t.push(Vs("mozfullscreenchange",v)),t.push(Vs("MSFullscreenChange",v)),ml=!0)};return["interactive","complete"].includes(document.readyState)?p():(t.push(Vs("DOMContentLoaded",()=>{cl({type:Kr.DomContentLoaded,data:{}}),"DOMContentLoaded"===O&&setTimeout(p,0)})),t.push(Vs("load",()=>{cl({type:Kr.Load,data:{}}),"load"===O&&p()},window))),()=>{n=!0;try{null==e||e.flush()}catch(t){}e=void 0,Zs(t),ot.destroy(),rt.removeLoadListener(),rt.destroy(),J.clear(),at.reset(),yl.reset(),ml=!1,xa()}}catch(t){console.warn(t)}}kl.addCustomEvent=(t,e)=>{if(!ml)throw new Error("please add custom event after start recording");cl({type:Kr.Custom,data:{tag:t,payload:e}})},kl.freezePage=()=>{Ia.forEach(t=>t.freeze())},kl.takeFullSnapshot=t=>{if(!ml)throw new Error("please take full snapshot after start recording");dl(t)},kl.isRecording=()=>ml,kl.mirror=yl,"Mobile".toLowerCase(),"Tablet".toLowerCase(),new RegExp("Xbox","i"),new RegExp("Nintendo","i"),new RegExp("PlayStation","i"),new RegExp("Windows","i"),Date,Date,new RegExp(/[a-z][a-z0-9+.-]{0,63}:[^\s<>"]+/gi.source,"i");var _l=/[a-z][a-z0-9+.-]{0,63}:\/\//i;new RegExp(`^${_l.source}`,"i"),new RegExp(_l.source,"gi"),"0".repeat(32),"0".repeat(16);var Sl=Object.create(null);function xl(t){return xl="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},xl(t)}function Cl(t,e,n){return(e=function(t){var e=function(t){if("object"!=xl(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=xl(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==xl(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}Sl.Node=Object.create(null),Sl.ShadowRoot=Object.create(null),Sl.MutationObserver=Object.create(null),Sl.Element=Object.create(null);var Il=class{constructor(t){Cl(this,"fileName",void 0),Cl(this,"functionName",void 0),Cl(this,"lineNumber",void 0),Cl(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}`}},Ml=/(^|@)\S+:\d+/,Tl=/^\s*at .*(\S+:\d+|\(native\))/m,Rl=/^(eval@)?(\[native code])?$/,El={parse(t){return t?void 0!==t.stacktrace||void 0!==t["opera#sourceloc"]?this.parseOpera(t):t.stack&&t.stack.match(Tl)?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(Tl)},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 Il({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(Rl)},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 Il({functionName:t});{const e=/((.*".+"[^@]*)?[^@]*)(?:@)/,n=t.match(e),i=n&&n[1]?n[1]:void 0,r=this.extractLocation(t.replace(e,""));return new Il({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 Il({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 Il({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(Ml)&&!t.match(/^Error created at/)},this).map(function(t){const e=t.split("@"),n=this.extractLocation(e.pop());return new Il({functionName:(e.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})},this)}};function Al(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 $l(t){return Array.isArray(t)}function Ol(t){return"object"==typeof t&&null!==t&&!$l(t)}function Pl(t,e){if(0===e)return!0;const n=Object.keys(t);for(const i of n)if(Ol(t[i])&&Pl(t[i],e-1))return!0;return!1}function Ll(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(Ol(o=e)&&Object.keys(o).length>n.numOfKeysLimit||"function"==typeof o||Ol(o)&&Pl(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]=$l(i)?Al(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 Dl={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 Fl(t,e,n){const i=n?Object.assign({},Dl,n):Dl,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:El.parse(e.error).map(t=>t.toString()),payload:[Ll(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=[Ll(`Uncaught (in promise) ${n.name}: ${n.message}`,i.stringifyOptions)]):(n=new Error,r=[Ll("Uncaught (in promise)",i.stringifyOptions),Ll(e.reason,i.stringifyOptions)]),t({level:"error",trace:El.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=El.parse(new Error).map(t=>t.toString()).splice(1),r=("assert"===n?o.slice(1):o).map(t=>Ll(t,i.stringifyOptions));s++,i.lengthThreshold>s?t({level:n,trace:e,payload:r}):s===i.lengthThreshold&&t({level:"warn",trace:[],payload:[Ll("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 Nl=t=>({name:"rrweb/console@1",observer:Fl,options:t});const ql=()=>{},jl=t=>{var e;if(W(t))return null!==(e=t.__posthog_layer__)&&void 0!==e?e:t.__rrweb_layer__};function Bl(t,e,n){try{if(!(e in t))return ql;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=jl(n);for(;o;){if(o.next===r)return void(o.next=i.next);n=o.next,o=jl(n)}}}catch(t){return ql}}function zl(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 Hl=he("[Recorder]"),Ul=t=>"navigation"===t.entryType,Wl=t=>"resource"===t.entryType,Vl=()=>{};function Gl(t,e){var n;return Ul(e)&&"complete"===(null===(n=t.document)||void 0===n?void 0:n.readyState)&&e.loadEventEnd>0}function Ql(t,e){return e.recordInitialRequests?t.performance.getEntries().filter(n=>Gl(t,n)||Wl(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=>Gl(t,e))}(t):[]}function Zl(t,e){return!!e&&(Y(e)||e[t])}function Jl(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 Kl=["image/","video/","audio/","font/","application/octet-stream","application/pdf","application/zip","application/wasm"];function Xl({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:!!Jl(e)&&t(e.url)}catch(t){return!1}}(i))return!1;if(r(Kl))return!1;if(Y(e))return!0;if(U(e))return r(e);const o=e[t];return Y(o)?o:r(o)}function Yl(t,e,n,i,r){return tu.apply(this,arguments)}function tu(){return tu=A(function*(t,e,n,i,r,o=0){if(o>10)return Hl.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=>Wl(t)&&t.initiatorType===e&&(G(i)||t.startTime>=i)&&(G(r)||r>=t.startTime));return s||(yield new Promise(t=>setTimeout(t,50*o)),Yl(t,e,n,i,r,o+1))}),tu.apply(this,arguments)}function eu({body:t,options:e,url:n}){if(K(t))return null;const{hostname:i,isHostDenied:r}=zl(n,e);if(r)return i+" is in deny list";if(Q(t))return t;if((t=>"u">typeof Document&&t instanceof Document)(t))return t.textContent;if(tt(t))return 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)}(t);if(V(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 nu=t=>!J(t)&&("navigation"===t.entryType||"resource"===t.entryType);function iu(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=[D(D({},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(nu(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 ru=["video/","audio/"];function ou(t){return V(t)&&W(t.getReader)&&W(t.tee)}const su="[SessionReplay] Timeout while trying to read body",au="[SessionReplay] Failed to read body";function lu(t){return`${au}: ${t}`}function uu(t){return`[SessionReplay] Body too large to record (> ${t} bytes)`}function cu(t,e){if(!e.streamNetworkBody)return function(t){return new Promise(e=>{const n=setTimeout(()=>e(su),500);try{t.clone().text().then(t=>e(t),t=>e(lu(t))).finally(()=>clearTimeout(n))}catch(t){clearTimeout(n),e(au)}})}(t);const n=Je(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(uu(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(su),500);let l;try{l=t.clone()}catch(t){return void s(au)}const u=l.body;if(!ou(u)||"undefined"==typeof TextDecoder){try{l.text().then(t=>s(t),t=>s(lu(t)))}catch(t){s(au)}return}try{i=u.getReader()}catch(t){return void s(au)}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(uu(e));d+=i.byteLength,c.push(i)}t()}},t=>s(lu(t)))}()})}(t,n)}function du(t){return hu.apply(this,arguments)}function hu(){return hu=A(function*({r:t,options:e,url:n}){const{hostname:i,isHostDenied:r}=zl(n,e);return r?Promise.resolve(i+" is in deny list"):cu(t,e)}),hu.apply(this,arguments)}function fu(t){return vu.apply(this,arguments)}function vu(){return vu=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=ru.some(t=>null==r?void 0:r.startsWith(t));if(r&&o)return`Content-Type ${r} is not supported`;const{hostname:s,isHostDenied:a}=zl(n,e);return a?s+" is in deny list":null}({r:t,options:e,url:n});return J(i)?cu(t,e):Promise.resolve(i)}),vu.apply(this,arguments)}let pu=null;function mu(t,e,n){if(!("performance"in e))return()=>{};if(pu)return Hl.warn("Network observer already initialised, doing nothing"),()=>{};const i=n?Object.assign({},Ke,n):Ke;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,Hl.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&&sn.has(t))(r)),r&&n.push(r)}),n.length>0&&t(D(D({},e),{},{requests:n}))},a=function(t,e,n){try{t({requests:Ql(e,n).flatMap(t=>iu(e,{entry:t,method:void 0,status:void 0,networkRequest:{},isInitial:!0})),isInitial:!0})}catch(t){Hl.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=>Ul(t)||Wl(t)&&n.initiatorTypes.includes(t.initiatorType)&&(t=>!n.recordBody&&!n.recordHeaders||"xmlhttprequest"!==t.initiatorType&&"fetch"!==t.initiatorType)(t)).flatMap(t=>iu(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,Vl;let u=()=>{},c=()=>{};return l&&(u=function(t,e,n){if(!n.initiatorTypes.includes("xmlhttprequest"))return()=>{};const i=Zl("request",n.recordHeaders),r=Zl("response",n.recordHeaders),o=Bl(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=>(Xl({type:"request",headers:h,url:a,recordBody:n.recordBody})&&(l.requestBody=eu({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),Xl({type:"response",headers:i,url:a,recordBody:n.recordBody})&&(l.responseBody=eu({body:d.response,options:n,url:a})),Yl(e,"xmlhttprequest",o.url,u,c).then(n=>{t({requests:iu(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){Hl.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=Zl("request",n.recordHeaders),r=Zl("response",n.recordHeaders),o=Bl(e,"fetch",o=>function(s,a){let l;try{l=new Request(s,a)}catch(t){Hl.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),!ou(null==a?void 0:a.body)&&Xl({type:"request",headers:t,url:s,recordBody:n.recordBody})&&(u.requestBody=yield du({r:l,options:n,url:s}))}catch(t){Hl.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),Xl({type:"response",headers:e,url:s,recordBody:n.recordBody})&&(u.responseBody=yield fu({r:t,options:n,url:s}))}catch(t){Hl.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=Jl(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}));return A(function*(){let n;try{yield h;const t=yield m;if("rejected"===t.status)throw t.error;return n=t.response,yield f(n),n}finally{(i=n,Yl(e,"fetch",l.url,c,d).then(n=>{t({requests:iu(e,{entry:n,method:l.method,status:null==i?void 0:i.status,networkRequest:u,start:c,end:d,url:l.url,initiatorType:"fetch"})})})).catch(()=>{})}var i})()});return()=>{o()}}(s,e,i):function(t,e,n){if(!n.initiatorTypes.includes("fetch"))return()=>{};const i=Zl("request",n.recordHeaders),r=Zl("response",n.recordHeaders),o=Bl(e,"fetch",o=>function(){var s=A(function*(s,a){let l,u;try{l=new Request(s,a)}catch(t){return Hl.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),!ou(null==a?void 0:a.body)&&Xl({type:"request",headers:t,url:s,recordBody:n.recordBody})&&(c.requestBody=yield du({r:l,options:n,url:s}))}catch(t){Hl.error("Failed to record fetch request for network capture",t)}d=e.performance.now(),u=Jl(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),Xl({type:"response",headers:t,url:s,recordBody:n.recordBody})&&(c.responseBody=yield fu({r:u,options:n,url:s}))}catch(t){Hl.error("Failed to record fetch response for network capture",t)}return u}finally{Yl(e,"fetch",l.url,d,h).then(n=>{t({requests:iu(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)),pu=()=>{r=!1,null==a||a(),u(),c(),pu=null},pu}const gu=t=>({name:"rrweb/network@1",observer:mu,options:t});var yu,bu,wu,ku,_u,Su,xu,Cu,Iu,Mu,Tu,Ru,Eu,Au,$u;a.__PosthogExtensions__=a.__PosthogExtensions__||{},a.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:Nl,getRecordNetworkPlugin:gu},a.__PosthogExtensions__.rrweb={record:kl,version:"v2",wasMaxDepthReached:()=>zs,resetMaxDepthState(){zs=!1,Bs=!1},getLastSnapshotCost:()=>To,getMutationCost:()=>D({},Oo),getObserverInitFailures:()=>Da.size?Array.from(Da):void 0,resetSnapshotCostState(){xo=0,Co=0,Io=0,wo=0,Mo={durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0},To=null,Ro=null,Eo=[],Ao=0,$o=0,Oo={slowestBatchMs:0},Po={deferredCount:0,failedCount:0,abandonedCount:0,totalMs:0,slowestSliceMs:0}}},a.rrweb={record:kl,version:"v2"},a.rrwebConsoleRecord={getRecordConsolePlugin:Nl},a.getRecordNetworkPlugin=gu,a.__PosthogExtensions__=a.__PosthogExtensions__||{},a.__PosthogExtensions__.initSessionRecording=(t,e)=>new Zr(t,e);var Ou,Pu,Lu,Du,Fu={},Nu=[],qu=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,ju=Array.isArray;function Bu(t,e){for(var n in e)t[n]=e[n];return t}function zu(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function Hu(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?yu.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 Uu(t,s,i,r,null)}function Uu(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?++wu:r,__i:-1,__u:0};return null==r&&null!=bu.vnode&&bu.vnode(o),o}function Wu(t){return t.children}function Vu(t,e){this.props=t,this.context=e}function Gu(t,e){if(null==e)return t.__?Gu(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?Gu(t):null}function Qu(t){if(t.__P&&t.__d){var e=t.__v,n=e.__e,i=[],r=[],o=Bu({},e);o.__v=e.__v+1,bu.vnode&&bu.vnode(o),rc(t.__P,o,e,t.__n,t.__P.namespaceURI,32&e.__u?[n]:null,i,null==n?Gu(e):n,!!(32&e.__u),r),o.__v=e.__v,o.__.__k[o.__i]=o,sc(i,o,r),e.__e=e.__=null,o.__e!=n&&Zu(o)}}function Zu(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}),Zu(t)}function Ju(t){(!t.__d&&(t.__d=!0)&&ku.push(t)&&!Ku.__r++||_u!=bu.debounceRendering)&&((_u=bu.debounceRendering)||Su)(Ku)}function Ku(){try{for(var t,e=1;ku.length;)ku.length>e&&ku.sort(xu),t=ku.shift(),e=ku.length,Qu(t)}finally{ku.length=Ku.__r=0}}function Xu(t,e,n,i,r,o,s,a,l,u,c){var d,h,f,v,p,m,g,y=i&&i.__k||Nu,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]=Uu(null,s,null,null,null):ju(s)?s=t.__k[o]=Uu(Wu,{children:s},null,null,null):void 0===s.constructor&&s.__b>0?s=t.__k[o]=Uu(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=tc(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=Gu(a)),uc(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]||Fu,f.__i=d,m=rc(t,f,h,r,o,s,a,l,u,c),v=f.__e,f.ref&&h.ref!=f.ref&&(h.ref&&lc(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=Yu(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 Yu(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=Yu(r[o],e,n,i));return e}t.__e!=e&&(i&&(e&&t.type&&!e.parentNode&&(e=Gu(t)),n.insertBefore(t.__e,e||null)),e=t.__e);do{e=e&&e.nextSibling}while(null!=e&&8==e.nodeType);return e}function tc(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 ec(t,e,n){"-"==e[0]?t.setProperty(e,null==n?"":n):t[e]=null==n?"":"number"!=typeof n||qu.test(e)?n:n+"px"}function nc(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||ec(t.style,e,"");if(n)for(e in n)i&&n[e]==i[e]||ec(t.style,e,n[e])}else if("o"==e[0]&&"n"==e[1])o=e!=(e=e.replace(Tu,"$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[Mu]=i[Mu]:(n[Mu]=Ru,t.addEventListener(e,o?Au:Eu,o)):t.removeEventListener(e,o?Au:Eu,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 ic(t){return function(e){if(this.l){var n=this.l[e.type+t];if(null==e[Iu])e[Iu]=Ru++;else if(n[Mu]>e[Iu])return;return n(bu.event?bu.event(e):e)}}}function rc(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=bu.__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 Vu(y,w),h.constructor=C,h.render=cc),$&&$.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=Bu({},h.__s)),Bu(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)}),Nu.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=bu.__r,_=0,b)h.state=h.__s,h.__d=!1,k&&k(e),c=h.render(h.props,h.state,h.context),Nu.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>++_);h.state=h.__s,null!=h.getChildContext&&(i=Bu(Bu({},i),h.getChildContext())),b&&!f&&null!=h.getSnapshotBeforeUpdate&&(m=h.getSnapshotBeforeUpdate(v,p)),S=null!=c&&c.type===Wu&&null==c.key?ac(c.props.children):c,a=Xu(t,ju(S)?S:[S],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--;)zu(o[x]);oc(e)}else e.__e=n.__e,!e.__k&&n.__k&&(e.__k=n.__k),t.then||oc(e);bu.__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||Fu,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&&(bu.__m&&bu.__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&&yu.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||nc(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||nc(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=""),Xu("template"==e.type?t.content:t,ju(h)?h:[h],e,n,i,"foreignObject"==y?"http://www.w3.org/1999/xhtml":r,o,s,o?o[0]:n.__k&&Gu(n,0),a,l),null!=o)for(u=o.length;u--;)zu(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])&&nc(t,u,v,m[u],r),u="checked",null!=p&&p!=t[u]&&nc(t,u,p,m[u],r))}return t}(n.__e,e,n,i,r,o,s,l,u);return(c=bu.diffed)&&c(e),128&e.__u?void 0:a}function oc(t){t&&(t.__c&&(t.__c.__e=!0),t.__k&&t.__k.some(oc))}function sc(t,e,n){for(var i=0;n.length>i;i++)lc(n[i],n[++i],n[++i]);bu.__c&&bu.__c(e,t),t.some(function(e){try{t=e.__h,e.__h=[],t.some(function(t){t.call(e)})}catch(t){bu.__e(t,e.__v)}})}function ac(t){return"object"!=typeof t||null==t||t.__b>0?t:ju(t)?t.map(ac):void 0!==t.constructor?null:Bu({},t)}function lc(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){bu.__e(t,n)}}function uc(t,e,n){var i,r;if(bu.unmount&&bu.unmount(t),(i=t.ref)&&(i.current&&i.current!=t.__e||lc(i,null,e)),null!=(i=t.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(t){bu.__e(t,e)}i.base=i.__P=i.__n=null}if(i=t.__k)for(r=0;i.length>r;r++)i[r]&&uc(i[r],e,n||"function"!=typeof t.type);n||zu(t.__e),t.__c=t.__=t.__e=void 0}function cc(t,e,n){return this.constructor(t,n)}function dc(t,e,n){var i,r,o,s;e==document&&(e=document.documentElement),bu.__&&bu.__(t,e),r=(i="function"==typeof n)?null:n&&n.__k||e.__k,o=[],s=[],rc(e,t=(!i&&n||e).__k=Hu(Wu,null,[t]),r||Fu,Fu,e.namespaceURI,!i&&n?[n]:r?null:e.firstChild?yu.call(e.childNodes):null,o,!i&&n?n:r?r.__e:e.firstChild,i,s),sc(o,t,s),t.props.children=null}yu=Nu.slice,bu={__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}},wu=0,Vu.prototype.setState=function(t,e){var n=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=Bu({},this.state);"function"==typeof t&&(t=t(Bu({},n),this.props)),t&&Bu(n,t),null!=t&&this.__v&&(e&&this._sb.push(e),Ju(this))},Vu.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),Ju(this))},Vu.prototype.render=Wu,ku=[],Su="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,xu=function(t,e){return t.__v.__b-e.__v.__b},Ku.__r=0,Cu=Math.random().toString(8),Iu="__d"+Cu,Mu="__a"+Cu,Tu=/(PointerCapture)$|Capture$/i,Ru=0,Eu=ic(!1),Au=ic(!0),$u=0;var hc=0,fc=[],vc=bu,pc=vc.__b,mc=vc.__r,gc=vc.diffed,yc=vc.__c,bc=vc.unmount,wc=vc.__;function kc(t,e){vc.__h&&vc.__h(Pu,t,hc||e),hc=0;var n=Pu.__H||(Pu.__H={__:[],__h:[]});return t>=n.__.length&&n.__.push({}),n.__[t]}function _c(t){return hc=1,function(t,e){var n=kc(Ou++,2);if(n.t=t,!n.__c&&(n.__=[Oc(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=Pu,!Pu.__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};Pu.__f=!0;var r=Pu.shouldComponentUpdate,o=Pu.componentWillUpdate;Pu.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)},Pu.shouldComponentUpdate=i}return n.__N||n.__}(Oc,t)}function Sc(t,e){var n=kc(Ou++,3);!vc.__s&&$c(n.__H,e)&&(n.__=t,n.u=e,Pu.__H.__h.push(n))}function xc(t){return hc=5,Cc(function(){return{current:t}},[])}function Cc(t,e){var n=kc(Ou++,7);return $c(n.__H,e)&&(n.__=t(),n.__H=e,n.__h=t),n.__}function Ic(t){var e=Pu.context[t.__c],n=kc(Ou++,9);return n.c=t,e?(null==n.__&&(n.__=!0,e.sub(Pu)),e.props.value):t.__}function Mc(){for(var t;t=fc.shift();){var e=t.__H;if(t.__P&&e)try{e.__h.some(Ec),e.__h.some(Ac),e.__h=[]}catch(n){e.__h=[],vc.__e(n,t.__v)}}}vc.__b=function(t){Pu=null,pc&&pc(t)},vc.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),wc&&wc(t,e)},vc.__r=function(t){mc&&mc(t),Ou=0;var e=(Pu=t.__c).__H;e&&(Lu===Pu?(e.__h=[],Pu.__h=[],e.__.some(function(t){t.__N&&(t.__=t.__N),t.u=t.__N=void 0})):(e.__h.length&&Mc(),Ou=0)),Lu=Pu},vc.diffed=function(t){gc&&gc(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(1!==fc.push(e)&&Du===vc.requestAnimationFrame||((Du=vc.requestAnimationFrame)||Rc)(Mc)),e.__H.__.some(function(t){t.u&&(t.__H=t.u,t.u=void 0)})),Lu=Pu=null},vc.__c=function(t,e){e.some(function(t){try{t.__h.some(Ec),t.__h=t.__h.filter(function(t){return!t.__||Ac(t)})}catch(n){e.some(function(t){t.__h&&(t.__h=[])}),e=[],vc.__e(n,t.__v)}}),yc&&yc(t,e)},vc.unmount=function(t){bc&&bc(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.some(function(t){try{Ec(t)}catch(t){e=t}}),n.__H=void 0,e&&vc.__e(e,n.__v))};var Tc="function"==typeof requestAnimationFrame;function Rc(t){var e,n=function(){clearTimeout(i),Tc&&cancelAnimationFrame(e),setTimeout(t)},i=setTimeout(n,35);Tc&&(e=requestAnimationFrame(n))}function Ec(t){var e=Pu,n=t.__c;"function"==typeof n&&(t.__c=void 0,n()),Pu=e}function Ac(t){var e=Pu;t.__c=t.__(),Pu=e}function $c(t,e){return!t||t.length!==e.length||e.some(function(e,n){return e!==t[n]})}function Oc(t,e){return"function"==typeof e?e(t):e}const Pc="tab",Lc="left",Dc="center",Fc="right",Nc="next_to_trigger",qc="popover",jc="widget",Bc="external_survey",zc="open",Hc="multiple_choice",Uc="single_choice",Wc="rating",Vc="end",Gc="always",Qc="$survey_id",Zc="$survey_name",Jc="$survey_iteration",Kc="$survey_iteration_start_date",Xc="$survey_language",Yc=he("[Surveys]");function td(t){return W(t.is_capturing)?t.is_capturing():!t.has_opted_out_capturing()}const ed=(t,e)=>`${t}${function(t){return t.current_iteration&&t.current_iteration>0?`${t.id}_${t.current_iteration}`:t.id}(e)}`,nd=t=>ed("seenSurvey_",t),id=t=>{try{const e=nd(t);if(localStorage.getItem(e))return;localStorage.setItem(e,"true")}catch(t){Yc.error("Failed to persist survey seen state",t)}},rd=[qc,jc,"api"],od=he("[Stylesheet Loader]"),sd=t,ad=i,ld="#020617",ud={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:Fc,widgetType:Pc,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,surveyPopupDelaySeconds:void 0,outlineColor:"rgba(59, 130, 246, 0.8)",inputBackground:"white",inputTextColor:ld,scrollbarThumbColor:"var(--ph-survey-border-color)",scrollbarTrackColor:"var(--ph-survey-background-color)"},cd=[Dc,Lc,Fc];function dd(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 hd(t=ud.backgroundColor){let e;"#"===t[0]&&(e=dd(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=dd(n)),!e)return ld;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?ld:"white"}return ld}const fd=(t,e,n)=>{const i=$d(t),r=ad.querySelector(`.${i}`);if(r&&r.shadowRoot)return{shadow:r.shadowRoot,isNewlyCreated:!1};const o=ad.createElement("div");((t,e,n)=>{const i=D(D({},ud),n),r=t.style,o=!cd.includes(i.position)||e===jc&&(null==n?void 0:n.widgetType)===Pc;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)||hd(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",hd(i.ratingButtonActiveColor)),r.setProperty("--ph-survey-text-primary-color",(null==n?void 0:n.textColor)||hd(i.backgroundColor)),r.setProperty("--ph-survey-text-subtle-color",i.textSubtleColor),r.setProperty("--ph-widget-color",i.widgetColor),r.setProperty("--ph-widget-text-color",hd(i.widgetColor)),r.setProperty("--ph-widget-z-index",i.zIndex);const s=(null==n?void 0:n.inputBackground)||(null==n?void 0:n.inputBackgroundColor);let a=s||i.inputBackground;s||"white"!==i.backgroundColor||(a="#f8f8f8"),r.setProperty("--ph-survey-input-background",a);const l=(null==n?void 0:n.inputTextColor)||hd(a);r.setProperty("--ph-survey-input-text-color",l),r.setProperty("--ph-survey-rating-text-color",l),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||(od.error("prepare_external_dependency_stylesheet returned null"),null)})(ad,':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)}}',t);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||ad.body).appendChild(o),{shadow:s,isNewlyCreated:!0}},vd=({responses:t,survey:e,surveySubmissionId:n,posthog:i,isSurveyCompleted:r,properties:o,surveyLanguage:s,questionSnapshots:a})=>{var l;i?td(i)&&(id(e),r&&Ad(e),i.capture("survey sent",D(D(D({[Zc]:e.name,[Qc]:e.id,[Jc]:e.current_iteration,[Kc]:e.current_iteration_start_date,sessionRecordingUrl:null===(l=i.get_session_replay_url)||void 0===l?void 0:l.call(i)},Ai({event:"sent",survey:e,responses:t,submissionId:n,completed:r,surveyLanguage:s,questionSnapshots:a})),o),{},{$set:{[Oi(e,"responded")]:!0}})),r&&(sd.dispatchEvent(new CustomEvent("PHSurveySent",{detail:{surveyId:e.id}})),i.reloadFeatureFlags())):Yc.error("[survey sent] event not captured, PostHog instance not found.")},pd=(t,e,n,i)=>{var r;return D({[Zc]:e.name,[Qc]:e.id,[Jc]:e.current_iteration,[Kc]:e.current_iteration_start_date,sessionRecordingUrl:null===(r=i.get_session_replay_url)||void 0===r?void 0:r.call(i)},Ai({event:t,survey:e,responses:null==n?void 0:n.responses,submissionId:null==n?void 0:n.surveySubmissionId,surveyLanguage:null==n?void 0:n.surveyLanguage,questionSnapshots:null==n?void 0:n.questionSnapshots}))},md=(t,e,n,i)=>{if(!e)return void Yc.error("[survey dismissed] event not captured, PostHog instance not found.");if(n)return;const r=Rd(t),o=r?r.surveyLanguage:i,s=D(D(D({},pd("dismissed",t,r,e)),o&&{[Xc]:o}),{},{$set:{[Oi(t,"dismissed")]:!0}});Ad(t),id(t),e.capture("survey dismissed",s),sd.dispatchEvent(new CustomEvent("PHSurveyClosed",{detail:{surveyId:t.id}}))},gd=(t,e)=>{if(!e)return void Yc.error("[survey abandoned] event not captured, PostHog instance not found.");const n=(t=>ed("abandonedSurvey_",t))(t);try{if("true"===localStorage.getItem(n))return}catch(t){return}const i=Rd(t);if(i){try{localStorage.setItem(n,"true")}catch(t){}e.capture("survey abandoned",pd("abandoned",t,i,e),{transport:"sendBeacon"})}},yd=t=>{const e=t.map(t=>t.id);return e.every(t=>!!t)?e:void 0},bd=(t,e)=>{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=Hi(t.questions),i.length===r.length&&i.every((t,e)=>t===r[e])?r.reverse():r):t.questions;var n,i,r},wd=t=>function(t){var e;return qi(t)&&!!(null===(e=t.conditions)||void 0===e||null===(e=e.events)||void 0===e?void 0:e.repeatedActivation)||"always"===t.schedule}(t)||Ed(t),kd=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,Ju(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"+$u++,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}),_d=()=>Ic(kd),Sd=({component:t,children:e,renderAsHtml:n,style:i})=>function(t,e,n){var i,r,o,s,a=Bu({},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?yu.call(arguments,2):n),Uu(t.type,a,i||t.key,r||t.ref,null)}(t,n?{dangerouslySetInnerHTML:{__html:e},style:i}:{children:e,style:i});function xd(t,e){var n,i;if(!(null===(n=t.conditions)||void 0===n?void 0:n.url))return!0;const r=be(e);if(!r)return!1;const o=[t.conditions.url],s=function(t){return null!=t?t:"icontains"}(null===(i=t.conditions)||void 0===i?void 0:i.urlMatchType);return zi[s](o,[r])}function Cd(e){var i,r;return function(e,i){var r,s,a;if(!e||0===e.length)return!0;if(!o)return!1;const l=function(t,e){var n;const i=function(t){return _t.test(t)?ft:kt.test(t)?vt:wt.test(t)?pt:new RegExp(gt,"i").test(t)?gt:new RegExp("(Windows Phone|WPDesktop)","i").test(t)?"Windows Phone":/iPad/.test(t)?dt:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?ht:St.test(t)?"BlackBerry":/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(mt,"i").test(t)?mt:/(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(lt).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":ct:new RegExp("(pda|Mobile)","i").test(t)?yt:new RegExp(ut,"i").test(t)&&!new RegExp("Tablet pc","i").test(t)?bt:""}(t);return i===dt||i===ct||"Kobo"===i||"Kindle Fire"===i||i===bt?ut:i===ft||i===pt||i===vt||i===gt?"Console":i===ht?"Wearable":i?lt:"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)?lt:ut:"Desktop";var r,o,s}(o,{userAgentDataPlatform:null==n||null===(r=n.userAgentData)||void 0===r?void 0:r.platform,maxTouchPoints:null==n?void 0:n.maxTouchPoints,screenWidth:null==t||null===(s=t.screen)||void 0===s?void 0:s.width,screenHeight:null==t||null===(a=t.screen)||void 0===a?void 0:a.height,devicePixelRatio:null==t?void 0:t.devicePixelRatio});return zi[null!=i?i:"icontains"](e,[l])}(null===(i=e.conditions)||void 0===i?void 0:i.deviceTypes,null===(r=e.conditions)||void 0===r?void 0:r.deviceTypesMatchType)}const Id=t=>ed("inProgressSurvey_",t),Md={},Td=(t,e)=>{const n=Id(t);try{localStorage.setItem(n,JSON.stringify(e)),delete Md[n]}catch(t){Yc.error("Error setting in-progress survey state in localStorage",t),Md[n]=e}},Rd=t=>{const e=Id(t),n=Md[e];if(n)return n;try{const t=localStorage.getItem(e);if(t)return JSON.parse(t)}catch(t){Yc.error("Error getting in-progress survey state from localStorage",t)}return null},Ed=t=>{const e=Rd(t);return!K(null==e?void 0:e.surveySubmissionId)},Ad=t=>{const e=Id(t);delete Md[e];try{localStorage.removeItem(e)}catch(t){Yc.error("Error clearing in-progress survey state from localStorage",t)}};function $d(t,e=!1){const n=`PostHogSurvey-${t.id}`;return e?`.${n}`:n}function Od(t,e=Fc,n){if(t===Bc)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 Lc:return{left:"30px"};case Dc:return{left:"50%",transform:"translateX(-50%)"};default:return{right:t===jc&&n===Pc?"60px":"30px"}}}var Pd=0;function Ld(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:--Pd,__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 bu.vnode&&bu.vnode(u),u}const Dd=Ld("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Ld("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"})}),Fd=Ld("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Ld("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"})}),Nd=Ld("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Ld("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"})}),qd=Ld("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Ld("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"})}),jd=Ld("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Ld("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"})}),Bd=Ld("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:Ld("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"})}),zd=Ld("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:Ld("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"})}),Hd=({fill:t="currentColor"}={})=>Ld("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:[Ld("title",{id:"close-survey-title",className:"adam-testing",children:"Close survey"}),Ld("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})]}),Ud=Ld("svg",{width:"80",height:"14",viewBox:"0 0 160 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Ld("g",{"clip-path":"url(#ph-survey-logo-clip)",children:[Ld("path",{fill:"currentColor",d:"m50 23.34-.35-.05A4.5 4.5 0 0 1 47 21.97L35.56 10.1c-.3-.33-.86-.1-.86.35V27.5c0 .27.22.5.5.5h13.78c1.48 0 2.67-1.2 2.67-2.67v-.1a1.9 1.9 0 0 0-1.67-1.89zm-10.81.2a1.8 1.8 0 1 1 0-3.58 1.8 1.8 0 0 1 0 3.58"}),Ld("path",{fill:"#0054ff",d:"M.87 19.13a.5.5 0 0 0-.87.34v5.94a2.6 2.6 0 0 0 2.59 2.58H7.8a.5.5 0 0 0 .37-.84zM.86 8.4c-.3-.32-.86-.1-.86.36v6.73q0 .2.13.34l8.81 9.68 1.8 2.06v-8.82zM4.59.82A2.67 2.67 0 0 0 0 2.68v1.93q0 .4.27.69l10.47 10.95v-9.1z"}),Ld("path",{fill:"#ff5506",d:"M11.36 28h7.08a.5.5 0 0 0 .36-.85l-8.05-8.4v8.8l.23.28q.16.17.38.17m-.61-11.76 8.84 9.25 2.1 2.33q.1.11.27.14V18.7L10.75 7.15zm0-13.7v1.41a2 2 0 0 0 .55 1.28L21.96 16.2V7.65L15.32.8a2.67 2.67 0 0 0-4.57 1.71z"}),Ld("path",{fill:"#ffb70f",d:"M22.06 28h7.76a.5.5 0 0 0 .36-.86l-8.22-8.45v9.27l.09.02zM31 25.49l1.13 1.14c.32.31.85.09.85-.35v-7.3l-.49-.51L21.96 7.64v8.55zM22.52 5.73l9.62 9.89c.3.32.86.1.86-.35V7.46L26.56.82a2.67 2.67 0 0 0-4.59 1.84v1.7c0 .51.2 1 .57 1.37z"})]}),Ld("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"}),Ld("defs",{children:Ld("clipPath",{id:"ph-survey-logo-clip",children:Ld("path",{fill:"#fff",d:"M0 0h51.67v28H0z"})})})]});function Wd({urlParams:t}){const e=t?Object.entries(t).map(([t,e])=>`${encodeURIComponent(t)}=${encodeURIComponent(e)}`).join("&"):"";return Ld("a",{href:"https://posthog.com/surveys"+(e?`?${e}`:""),target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",Ud]})}function Vd({text:e,submitDisabled:n,appearance:i,onSubmit:r,link:o,onPreviewSubmit:s,skipSubmitButton:a,canGoBack:l,onBack:u}){const{isPreviewMode:c}=Ic(kd),d=!!l&&!!u,h=!a&&Ld("button",{className:"form-submit",disabled:n,"aria-label":"Submit survey",type:"button",onClick(){o&&(null==t||t.open(o)),c?null==s||s():r()},children:e});return Ld("div",{className:"bottom-section",children:[d?Ld("div",{className:"form-buttons form-buttons-with-back",children:[Ld("button",{className:"form-back",type:"button","aria-label":"Go to previous question",onClick:u,children:i.backButtonText||"Back"}),h]}):h,!i.whiteLabel&&Ld(Wd,{urlParams:{utm_source:"survey-footer"}})]})}function Gd({question:t,forceDisableHtml:e,htmlFor:n}){return Ld("div",{class:t.question||t.description?"question-header":"question-header question-header--empty",children:[Ld(t.type===zc?"label":"h3",{className:"survey-question",htmlFor:n,children:t.question}),t.description&&Sd({component:Hu("p",{className:"survey-question-description"}),children:t.description,renderAsHtml:!e&&"text"!==t.descriptionContentType})]})}function Qd({onClick:t}){const{isPreviewMode:e}=Ic(kd);return Ld("button",{className:"form-cancel",onClick:t,disabled:e,"aria-label":"Close survey",type:"button",children:Hd({fill:"black"})})}const Zd=t;function Jd({header:t,description:e,contentType:n,forceDisableHtml:i,appearance:r,onClose:o}){const{isPopup:s}=Ic(kd);return Sc(()=>{const t=t=>{"Enter"!==t.key&&"Escape"!==t.key||(t.preventDefault(),o())};return me(Zd,"keydown",t),()=>{Zd.removeEventListener("keydown",t)}},[o]),Ld("div",{className:"thank-you-message",role:"status",tabIndex:0,"aria-atomic":"true",children:[s&&!0!==r.hideCancelButton&&Ld(Qd,{onClick:()=>o()}),Ld("h3",{className:"thank-you-message-header",children:t}),e&&Sd({component:Hu("p",{className:"thank-you-message-body"}),children:e,renderAsHtml:!i&&"text"!==n}),s&&Ld(Vd,{text:r.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:r,onSubmit:()=>o()})]})}function Kd({header:t,description:e,contentType:n,forceDisableHtml:i,appearance:r,onStart:o}){const{isPopup:s,onPreviewSubmit:a,onPopupSurveyDismissed:l}=Ic(kd);return Ld("div",{className:"intro-screen",role:"status",tabIndex:0,"aria-atomic":"true",children:[s&&!0!==r.hideCancelButton&&Ld(Qd,{onClick:()=>l()}),t&&Ld("h3",{className:"intro-screen-header",children:t}),e&&Sd({component:Hu("p",{className:"intro-screen-body"}),children:e,renderAsHtml:!i&&"text"!==n}),Ld(Vd,{text:r.introScreenButtonText||"Get started",submitDisabled:!1,appearance:r,onSubmit:o,onPreviewSubmit:()=>a(null)})]})}const Xd=t=>U(t)&&t.every(t=>Q(t));function Yd({question:t,forceDisableHtml:e,appearance:n,onSubmit:i,onPreviewSubmit:r,displayQuestionIndex:o,initialValue:s,canGoBack:a,onBack:l}){const{isPreviewMode:u}=_d(),c=xc(null),[d,h]=_c(()=>Q(s)?s:""),f=null==n?void 0:n.disableAutofocus;Sc(()=>{f||setTimeout(()=>{var t;u||null===(t=c.current)||void 0===t||t.focus()},100)},[u,f]);const v=`surveyQuestion${o}`,p=Cc(()=>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 N: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,N),y=Cc(()=>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 Ld(Wu,{children:[Ld("div",{className:"question-container",children:[Ld(Gd,{question:t,forceDisableHtml:e,htmlFor:v}),Ld("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&&Ld("div",{className:"validation-hint",children:y})]}),Ld(Vd,{text:t.buttonText||"Submit",submitDisabled:!!p,appearance:n,onSubmit:b,onPreviewSubmit:w,canGoBack:a,onBack:l})]})}function th({question:t,forceDisableHtml:e,appearance:n,onSubmit:i,onPreviewSubmit:r,canGoBack:o,onBack:s}){return Ld(Wu,{children:[Ld("div",{className:"question-container",children:Ld(Gd,{question:t,forceDisableHtml:e})}),Ld(Vd,{text:t.buttonText||"Submit",submitDisabled:!1,link:t.link,appearance:n,onSubmit:()=>i("link clicked"),onPreviewSubmit:()=>r("link clicked"),canGoBack:o,onBack:s})]})}function eh({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]=_c(()=>X(s)?s:U(s)&&s.length>0&&X(parseInt(s[0]))?parseInt(s[0]):Q(s)&&X(parseInt(s))?parseInt(s):null),v="emoji"===t.display&&2===t.scale,{isPreviewMode:p}=_d(),m=t=>p?o(t):r(t);return Ld(Wu,{children:[Ld("div",{className:"question-container",children:[Ld(Gd,{question:t,forceDisableHtml:e}),Ld("div",{className:"rating-section",children:[Ld("div",{className:"rating-options",children:["emoji"===t.display&&Ld("div",{className:"rating-options-emoji"+(v?" rating-options-emoji-2":""),children:null===(u=ah[t.scale])||void 0===u?void 0:u.map((e,i)=>Ld("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&&Ld("div",{className:"rating-options-number",style:{gridTemplateColumns:`repeat(${c-d+1}, minmax(0, 1fr))`},children:lh(t.scale).map((e,r)=>Ld(nh,{displayQuestionIndex:n,active:h===e,appearance:i,num:e,setActiveNumber(e){f(e),t.skipSubmitButton&&m(e)}},r))})]}),!v&&Ld("div",{className:"rating-text",children:[Ld("div",{children:t.lowerBoundLabel}),Ld("div",{children:t.upperBoundLabel})]})]})]}),Ld(Vd,{text:t.buttonText||(null==i?void 0:i.submitButtonText)||"Submit",submitDisabled:J(h)&&!t.optional,appearance:i,onSubmit:()=>r(h),onPreviewSubmit:()=>o(h),skipSubmitButton:t.skipSubmitButton,canGoBack:a,onBack:l})]})}function nh({num:t,active:e,displayQuestionIndex:n,setActiveNumber:i}){return Ld("button",{"aria-label":`Rate ${t}`,className:`ratings-number question-${n}-rating-${t} ${e?"rating-active":""}`,type:"button",onClick(){i(t)},children:t})}function ih({question:t,forceDisableHtml:e,displayQuestionIndex:n,appearance:i,onSubmit:r,onPreviewSubmit:o,initialValue:s,canGoBack:a,onBack:l}){const u=xc(null),c=Cc(()=>(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=Hi(n)).length>1&&o.every((t,e)=>t===s[e])?s.reverse():s);var o,s;return J(i)||r.push(i),r})(t),[t]),[d,h]=_c(()=>((t,e)=>Q(t)||Xd(t)?t:e===Uc?null:[])(s,t.type)),[f,v]=_c(()=>((t,e)=>{if(Q(t)&&!e.includes(t))return{isSelected:!0,inputValue:t};if(Xd(t)){const n=t.find(t=>!e.includes(t));if(n)return{isSelected:!0,inputValue:n}}return{isSelected:!1,inputValue:""}})(s,c)),{isPreviewMode:p}=_d(),m=t.type===Uc,g=t.type===Hc,y=t.skipSubmitButton&&m&&!t.hasOpenChoice,b=(t,e)=>{if(e){const t=!f.isSelected;return v(e=>D(D({},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=>D(D({},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=>D(D({},t),{},{inputValue:e})),m&&h(e)},k=t=>{t.stopPropagation(),"Enter"!==t.key||_()||(t.preventDefault(),S()),"Escape"===t.key&&(t.preventDefault(),v(t=>D(D({},t),{},{isSelected:!1,inputValue:""})),m&&h(null))},_=()=>!(t.optional||!J(d)&&(!U(d)||f.isSelected||0!==d.length)&&(!f.isSelected||""!==f.inputValue.trim())),S=()=>{f.isSelected&&g?U(d)&&(p?o([...d,f.inputValue]):r([...d,f.inputValue])):p?o(d):r(d)};return Ld(Wu,{children:[Ld("div",{className:"question-container",children:[Ld(Gd,{question:t,forceDisableHtml:e}),Ld("fieldset",{className:"multiple-choice-options limit-height",children:[Ld("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 Ld("label",{className:r?"choice-option-open":"",children:[Ld("div",{className:"response-choice",children:[Ld("input",{type:m?"radio":"checkbox",name:o,checked:a,onChange:()=>b(e,r),id:o,"aria-controls":s}),Ld("span",{children:r?`${e}:`:e})]}),r&&Ld("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)})]})]}),Ld(Vd,{text:t.buttonText||"Submit",submitDisabled:_(),appearance:i,onSubmit:S,onPreviewSubmit:S,skipSubmitButton:y,canGoBack:a,onBack:l})]})}const rh=[1,2,3,4,5],oh=[1,2,3,4,5,6,7],sh=[0,1,2,3,4,5,6,7,8,9,10],ah={2:[Bd,zd],3:[Nd,Fd,Dd],5:[qd,Nd,Fd,Dd,jd]};function lh(t){switch(t){case 5:default:return rh;case 7:return oh;case 10:return sh}}const uh=he("[Surveys]");function ch(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?Vc:o;if(r.branching.type===Vc)return Vc;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===Uc){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];return Number.isInteger(e)?e:e===Vc?Vc:o}}else if(r.type===Wc){var a;if("number"!=typeof n||!Number.isInteger(n))throw new Error("The response type must be an integer");const t=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(t)){const e=r.branching.responseValues[t];return Number.isInteger(e)?e:e===Vc?Vc:o}}return o}return uh.warn("Falling back to next question index due to unexpected branching type"),o}const dh=he("[SurveyTranslations]");function hh(t,e){const n=function(t){return function({overrideLanguage:t,storedPersonProperties:e,locale:n},i){const r=Pi(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?Pi(t.language):null}(e);if(o)return null==i||i.info(`Using person property language: ${o}`),o;const s=Pi(n);return s?(null==i||i.info(`Using detected locale: ${s}`),s):(null==i||i.info("No user language detected"),null)}({overrideLanguage:t.config.override_display_language,storedPersonProperties:W(t.get_property)?t.get_property(l):void 0,locale:navigator.language||navigator.userLanguage},dh)}(e);if(!n)return dh.info("No user language detected"),{survey:t,language:null};const i=Ni(t,n,dh);return{survey:i.survey,language:i.matchedKey}}const fh=t,vh=i,ph="ph:show_survey_widget",mh="PHWidgetSurveyClickListener";function gh(t,e){try{const n=t.getBoundingClientRect(),i=fh.innerHeight,r=fh.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:ud.zIndex}}catch(t){return Yc.warn("Failed to calculate trigger position:",t),null}}var yh=class{constructor(t){this.bi=new Map,this.wi=new Map,this.ki=new Map,this.Si=new Map,this.xi=new Set,this.Ci=null,this.Ii=!1,this.Mi=null,this.Ti=null,this.Ri=null,this.Ei=!1,this.handlePageUnload=()=>{const t=this._posthog.get_property(b);if(t)for(const e of t)Ed(e)&&gd(e,this._posthog)},this.handlePopoverSurvey=(t,e,{resumeDelayFromActivation:n=!1}={})=>{var i,r,o,s,a,l;if(!td(this._posthog))return;const{survey:u,language:c}=this.Ai(t);this.Ci=c,this.Ri=null,this.$i=e;const d=this.Oi(u,e);this.Pi(d.id);const{properties:h,initialResponses:f}=null!=e?e:{},v=!(!f||0>=Object.keys(f).length)&&this.Li(d,f,h,c);if(v&&!(null===(i=d.appearance)||void 0===i?void 0:i.displayThankYouMessage))return;this.Di(d);let p={};if((null===(r=d.appearance)||void 0===r?void 0:r.position)===Nc&&(null===(o=d.appearance)||void 0===o?void 0:o.widgetSelector)){const t=vh.querySelector(d.appearance.widgetSelector);var m;t&&(p=gh(t,parseInt((null===(m=d.appearance)||void 0===m?void 0:m.maxWidth)||ud.maxWidth))||{})}const g=(null===(s=d.appearance)||void 0===s?void 0:s.surveyPopupDelaySeconds)||0,{shadow:y}=fd(d,this._posthog);this.Si.set(y,y.host);const b={posthog:this._posthog,survey:d,removeSurveyFromFocus:this.Fi,properties:h,style:p,isSurveyCompleted:v,skipShownEvent:null==e?void 0:e.skipShownEvent,surveyLanguage:c};if(this.Ri=b,0>=g)return this.Ii=!0,dc(Ld(Sh,D({},b)),y);const w=()=>{this.Ii=!0;const{survey:n,language:i}=this.Ai(t);this.Ci=i;const r=this.Oi(n,e),o=D(D({},b),{},{survey:r,surveyLanguage:i});this.Ri=o,dc(Ld(Sh,D(D({},o),{},{survey:D(D({},r),{},{appearance:D(D({},r.appearance),{},{surveyPopupDelaySeconds:0})})})),y)},k=()=>{if(!td(this._posthog)||!this.Ni(d))return Yc.info(`Survey ${d.id} no longer eligible when its display delay elapsed; not displaying`),this.Fi(d);w()},_=n?null===(a=this._posthog.surveys)||void 0===a||null===(a=a._surveyEventReceiver)||void 0===a||null===(l=a.getActivationTimestamp)||void 0===l?void 0:l.call(a,d.id):void 0,S=X(_)?Math.max(0,Date.now()-_):0,x=Math.max(0,1e3*g-S);if(0>=x)return k();const C=fh.setTimeout(()=>{this.bi.delete(d.id),k()},x);this.bi.set(d.id,C)},this.qi=t=>{var e;const{survey:n,language:i}=this.Ai(t),{shadow:r,isNewlyCreated:o}=fd(n,this._posthog);this.Si.set(r,r.host),(null===(e=t.appearance)||void 0===e?void 0:e.widgetType)===Pc&&this.ki.set(t.id,t),o&&dc(Ld(Ch,{posthog:this._posthog,survey:n,surveyLanguage:i},t.id),r)},this.ji=t=>{const e=this.wi.get(t);e&&(e.element.removeEventListener("click",e.listener),e.element.removeAttribute(mh),this.wi.delete(t),Yc.info(`Removed click listener for survey ${t}`))},this.Bi=t=>{this.zi(t)||(this.Hi(t),this.ji(t.id))},this.Ui=t=>{this.zi(t)||(this.Hi(t),this.ki.delete(t.id))},this.zi=t=>{try{var e;const n=vh.querySelector($d(t,!0));return!!(null==n||null===(e=n.shadowRoot)||void 0===e?void 0:e.querySelector(".ph-survey"))}catch(t){return!1}},this.Wi=(t,e)=>{const n=vh.querySelector(e),i=this.wi.get(t.id);if(n){if(this.qi(t),i){if(n===i.element)return;Yc.info(`Selector element changed for survey ${t.id}. Re-attaching listener.`),this.ji(t.id)}if(!n.hasAttribute(mh)){const e=e=>{var n,i;e.stopPropagation();const r=(null===(n=t.appearance)||void 0===n?void 0:n.position)===Nc?gh(e.currentTarget,parseInt((null===(i=t.appearance)||void 0===i?void 0:i.maxWidth)||ud.maxWidth)):{};fh.dispatchEvent(new CustomEvent(ph,{detail:{surveyId:t.id,position:r}}))};me(n,"click",e),n.setAttribute(mh,"true"),this.wi.set(t.id,{element:n,listener:e,survey:t}),Yc.info(`Attached click listener for feedback button survey ${t.id}`)}}else i&&this.Bi(t)},this.renderPopover=t=>{if(!td(this._posthog))return;const{survey:e,language:n}=this.Ai(t),{shadow:i}=fd(e,this._posthog);this.Si.set(i,i.host),dc(Ld(Sh,{posthog:this._posthog,survey:e,removeSurveyFromFocus:this.Fi,surveyLanguage:n}),i)},this.renderSurvey=(t,e,n)=>{var i;if(!td(this._posthog))return;const{survey:r,language:o}=this.Ai(t);let s=!1;(null===(i=this._posthog.config)||void 0===i||null===(i=i.surveys)||void 0===i?void 0:i.prefillFromUrl)&&(s=this.Vi(r,o,n)),dc(Ld(Sh,{posthog:this._posthog,survey:r,removeSurveyFromFocus:this.Fi,isPopup:!1,properties:n,isSurveyCompleted:s,surveyLanguage:o}),e)},this.getActiveMatchingSurveys=(t,e=!1)=>{var n;null===(n=this._posthog)||void 0===n||null===(n=n.surveys)||void 0===n||n.getSurveys(e=>{t(e.filter(t=>this.Ni(t)))},e)},this.callSurveysAndEvaluateDisplayLogic=(t=!1)=>{this.getActiveMatchingSurveys(t=>{const e=td(this._posthog),n=t.filter(t=>e&&(t.type===qc||t.type===jc)),i=new Set(n.map(t=>t.id));for(const t of Array.from(this.bi.keys()))i.has(t)||this.cancelSurvey(t);const r=this.Gi(n),o=new Set,s=new Set;r.forEach(t=>{if(t.type===jc){var e,n,i,r;if((null===(e=t.appearance)||void 0===e?void 0:e.widgetType)===Pc)return s.add(t.id),void this.qi(t);"selector"===(null===(n=t.appearance)||void 0===n?void 0:n.widgetType)&&(null===(i=t.appearance)||void 0===i?void 0:i.widgetSelector)&&(o.add(t.id),this.Wi(t,null===(r=t.appearance)||void 0===r?void 0:r.widgetSelector))}J(this.Qi)&&t.type===qc&&this.handlePopoverSurvey(t,void 0,{resumeDelayFromActivation:!0})}),this.wi.forEach(({survey:t})=>{o.has(t.id)||this.Bi(t)}),this.ki.forEach((t,e)=>{s.has(e)||this.Ui(t)})},t)},this.Di=t=>{J(this.Qi)||Yc.error(`Survey ${this.Qi} already in focus. Cannot add survey ${t.id}.`),this.Qi=t.id},this.Fi=t=>{this.Qi!==t.id&&Yc.error(`Survey ${t.id} is not in focus. Cannot remove survey ${t.id}.`),this.Pi(t.id),this.Qi=null,this.Ci=null,this.Ii=!1,this.Ri=null,this.$i=void 0,this.Hi(t)},this._posthog=t,this.Qi=null,this.Mi=()=>this.Zi(),me(fh,"languagechange",this.Mi),this.Ti=t.onFeatureFlags(()=>this.Zi())}Zi(){if(J(this.Qi))return;const t=this._posthog.get_property(b),e=null==t?void 0:t.find(t=>t.id===this.Qi);if(!e)return;const{survey:n,language:i}=this.Ai(e);if(i===this.Ci)return;if(this.Ci=i,!this.Ii)return;const r=this.Oi(n,this.$i),{shadow:o}=fd(r,this._posthog);dc(Ld(Sh,D(D({},this.Ri),{},{posthog:this._posthog,survey:r,removeSurveyFromFocus:this.Fi,surveyLanguage:i})),o)}get Ji(){var t,e,n;return null!==(t=null===(e=(n=this._posthog).getExtension)||void 0===e?void 0:e.call(n,"featureFlags"))&&void 0!==t?t:this._posthog.featureFlags}Oi(t,e){return(null==e?void 0:e.position)||(null==e?void 0:e.selector)?D(D({},t),{},{appearance:D(D(D({},t.appearance),e.position&&{position:e.position}),e.selector&&{widgetSelector:e.selector})}):t}Pi(t){const e=this.bi.get(t);e&&(clearTimeout(e),this.bi.delete(t))}cancelSurvey(t){this.bi.has(t)&&(Yc.info(`Cancelled pending survey ${t}`),this.Pi(t),this.Qi===t&&(this.Qi=null,this.Ci=null,this.Ii=!1,this.Ri=null,this.$i=void 0))}clearInMemoryInProgressSurveyState(){(()=>{for(const t of Object.keys(Md))delete Md[t]})()}setAutomaticDisplayDispose(t){this.Ki=t}dispose(){var t;null===(t=this.Ki)||void 0===t||t.call(this),this.Ki=void 0,this.Mi&&(fh.removeEventListener("languagechange",this.Mi),this.Mi=null),this.Ti&&(this.Ti(),this.Ti=null),this.bi.forEach((t,e)=>this.Pi(e)),this.wi.forEach((t,e)=>this.ji(e)),this.Si.forEach((t,e)=>{dc(null,e),null==t||t.remove()}),this.Si.clear(),this.ki.clear(),this.Qi=null}Gi(t){return t.sort((t,e)=>{var n,i;const r=Ed(t),o=Ed(e);if(r&&!o)return-1;if(!r&&o)return 1;const s=t.schedule===Gc,a=e.schedule===Gc;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)})}Ai(t){return hh(t,this._posthog)}Vi(t,e,n){if(this.xi.has(t.id))return!1;const{params:i}=function(t){const e={};let n=!1;const i=t.replace(/^\?/,"");if(!i)return{params:e,autoSubmit:n};const r=i.split("&");for(const t of r){const i=t.indexOf("=");if(0>=i)continue;let r,o;try{r=decodeURIComponent(t.slice(0,i)),o=decodeURIComponent(t.slice(i+1))}catch(t){continue}if("auto_submit"===r&&"true"===o){n=!0;continue}const s=r.match(/^q(\d+)$/);if(s){const t=parseInt(s[1],10);e[t]||(e[t]=[]),e[t].push(o)}}return{params:e,autoSubmit:n}}(fh.location.search);if(0===Object.keys(i).length)return!1;Yc.info("[Survey Prefill] Detected URL prefill parameters");const r=this.Xi(t,i,e);return!!r&&(this.Yi(t,r,n,e),this.xi.add(t.id),r.isSurveyCompleted)}Yi(t,e,n,i){const{responses:r,submissionId:o,isSurveyCompleted:s,skippedResponses:a}=e;(Object.keys(a).length>0&&t.enable_partial_responses||s)&&vd({responses:s?r:a,survey:t,surveySubmissionId:o,posthog:this._posthog,isSurveyCompleted:s,properties:n,surveyLanguage:i})}Li(t,e,n,i){const r={};for(const[t,n]of Object.entries(e))r[parseInt(t)]=U(n)?n.map(String):[String(n)];Yc.info("[Survey] Processing initial responses");const o=this.Xi(t,r,i);return!!o&&(this.Yi(t,o,n,i),o.isSurveyCompleted)}Xi(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 Uc:{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 Hc:{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 Wc:{const e=parseInt(r[0],10),s=t.scale||10;if(isNaN(e)||0>e||e>s)return void de.warn(`[Survey Prefill] Invalid rating for q${i}: ${r[0]} (scale: 0-${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 Yc.warn("[Survey Prefill] No valid responses after conversion"),null;const r=wi(),{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=ch(t,i,e.id?n[Ri(e.id)]:null);if(s===Vc)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)),i),l=o>=t.questions.length;return Td(t,{surveySubmissionId:r,responses:i,lastQuestionIndex:o,questionOrder:yd(t.questions),visitedIndices:a,surveyLanguage:n}),Yc.info("[Survey Prefill] Stored prefilled responses in localStorage"),{responses:i,submissionId:r,startQuestionIndex:o,isSurveyCompleted:l,skippedResponses:s}}catch(t){return Yc.error("[Survey Prefill] Error handling prefill:",t),null}}tr(t,e=void 0){if(!t)return!0;const n=this.Ji,i=!!(null==n?void 0:n.isFeatureEnabled(t,{send_event:!t.startsWith("survey-targeting-")}));let r=!0;e&&(r=(null==n?void 0:n.getFeatureFlag(t,{send_event:!1}))===e||"any"===e);const o=i&&r;return o||this.er(t),o}er(t){var e;!this.Ei&&(null===(e=this._posthog.config)||void 0===e?void 0:e.advanced_disable_feature_flags)&&(this.Ei=!0,Yc.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.`))}nr(t){return!t.conditions||xd(t,this._posthog)&&Cd(t)&&function(t){var e;return!(null===(e=t.conditions)||void 0===e?void 0:e.selector)||!!(null==ad?void 0:ad.querySelector(t.conditions.selector))}(t)}ir(t){var e;return wd(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.Ji)||void 0===e?void 0:e.hasLoadedFlags)?(this.er(t.internal_targeting_flag_key),{satisfied:!1,reason:"Feature flags have not loaded yet; deferring internal targeting flag check"}):{satisfied:this.tr(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(!rd.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.tr(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.tr(t.targeting_flag_key))return i.eligible=!1,i.reason="Survey targeting feature flag is not enabled",i;const o=this.ir(t);var s;return o.satisfied?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}(null===(n=t.conditions)||void 0===n?void 0:n.seenSurveyWaitPeriodInDays,Si.Ot("lastSeenSurveyDate"))?(t=>!!Si.Ot(nd(t))&&!wd(t))(t)?(i.eligible=!1,i.reason="Survey has already been seen and it can't be activated again",i):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(){return td(this._posthog)?{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.rr(t)?{eligible:!1,reason:"Survey event/action trigger has not been fired yet"}:e}rr(t){var e;if(!qi(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._posthog.surveys)||void 0===e||null===(e=e._surveyEventReceiver)||void 0===e?void 0:e.getSurveys();return!!(null==n?void 0:n.includes(t.id))}sr(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.tr(e))}Ni(t){return this.checkSurveyEligibility(t).eligible&&this.nr(t)&&this.rr(t)&&this.sr(t)}Hi(t){try{const e=vh.querySelector($d(t,!0));(null==e?void 0:e.shadowRoot)&&(dc(null,e.shadowRoot),this.Si.delete(e.shadowRoot)),null==e||e.remove()}catch(e){Yc.warn(`Failed to remove survey ${t.id} from DOM:`,e)}}getTestAPI(){return{addSurveyToFocus:this.Di,removeSurveyFromFocus:this.Fi,surveyInFocus:this.Qi,surveyTimeouts:this.bi,handleWidget:this.qi,handlePopoverSurvey:this.handlePopoverSurvey,manageWidgetSelectorListener:this.Wi,sortSurveysByAppearanceDelay:this.Gi,checkFlags:this.sr.bind(this),isSurveyFeatureFlagEnabled:this.tr.bind(this),onLanguageChange:this.Zi.bind(this),currentLanguage:this.Ci,surveyIsRendered:this.Ii}}};function bh(t,e){if(!vh||!fh)return;const n=new yh(t);if(t.config.disable_surveys_automatic_display)return Yc.info("Surveys automatic display is disabled. Skipping call surveys and evaluate display logic."),n;if(!1===e)return Yc.info("There are no surveys to load or Surveys is disabled in the project settings."),n;let i;n.callSurveysAndEvaluateDisplayLogic(!0);const r=()=>{G(i)&&(i=setInterval(()=>{n.callSurveysAndEvaluateDisplayLogic(!1)},1e3))},o=()=>{G(i)||(clearInterval(i),i=void 0)};r();const s=()=>{vh.hidden?o():(n.callSurveysAndEvaluateDisplayLogic(!1),r())};return me(vh,"visibilitychange",s),n.setAutomaticDisplayDispose(()=>{o(),vh.removeEventListener("visibilitychange",s)}),n}function wh({survey:t,removeSurveyFromFocus:e=()=>{},setSurveyVisible:n,isPreviewMode:i=!1,posthog:r}){Sc(()=>{var o;if(i||!(null===(o=t.conditions)||void 0===o?void 0:o.url))return;const s=()=>{var i;const o=t.type===jc,s=xd(t,r),a=(null===(i=t.appearance)||void 0===i?void 0:i.widgetType)===Pc&&o;if(!s)return Yc.info(`Hiding survey ${t.id} because URL does not match`),n(!1),e(t);a&&(Yc.info(`Showing survey ${t.id} because it is a feedback button tab and URL matches`),n(!0))};me(fh,"popstate",s),me(fh,"hashchange",s);const a=fh.history.pushState,l=fh.history.replaceState;return fh.history.pushState=function(...t){a.apply(this,t),s()},fh.history.replaceState=function(...t){l.apply(this,t),s()},()=>{fh.removeEventListener("popstate",s),fh.removeEventListener("hashchange",s),fh.history.pushState=a,fh.history.replaceState=l}},[i,t,e,n,r])}const kh=200;function _h(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 Sh({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,I;const M=xc(null),T=Number.isInteger(r),{isPopupVisible:R,isSurveySent:E,hidePopupWithAnimation:A}=function(t,e,n,i,r,o,s,a,l){const[u,c]=_c(i||0===n||t.type===Bc),[d,h]=_c(!1),f=xc(!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 ${kh}ms ease-out`,n.style.opacity="0",setTimeout(()=>{f.current=!1,e()},250)):e()},p=e=>{e.detail.surveyId===t.id&&v()};return Sc(()=>{if(!e)return void Yc.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=()=>{if(xd(t,e)){c(!0);try{localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())}catch(t){}var n;fh.dispatchEvent(new Event("PHSurveyShown")),a||e.capture("survey shown",D(D({[Zc]:t.name,[Qc]:t.id,[Jc]:t.current_iteration,[Kc]:t.current_iteration_start_date},l&&{[Xc]:l}),{},{sessionRecordingUrl:null===(n=e.get_session_replay_url)||void 0===n?void 0:n.call(e)}))}};me(fh,"PHSurveyClosed",p),me(fh,"PHSurveySent",o);const u=n>0?setTimeout(s,n):void 0;return G(u)&&s(),()=>{G(u)||clearTimeout(u),G(r)||clearTimeout(r),fh.removeEventListener("PHSurveyClosed",p),fh.removeEventListener("PHSurveySent",o)}},[]),wh({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,T,o,s,M,f,v),O=E||r===t.questions.length||!0===h,[P,L]=_c(!1),F=Cc(()=>!!Rd(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=T?-1===r:!!(null===(y=t.appearance)||void 0===y?void 0:y.displayIntroScreen)&&N&&!P&&!F,j=Cc(()=>{const e=Rd(t),i=(null==e?void 0:e.surveySubmissionId)||wi();return{isPreviewMode:T,previewPageIndex:r,onPopupSurveyDismissed(){v?md(t,n,T,v):md(t,n,T),u()},isPopup:s||!1,surveySubmissionId:i,onPreviewSubmit:a,onPreviewBack:l,posthog:n,properties:d,surveyLanguage:v}},[T,r,s,n,t,u,a,l,d,v]);return R?Ld(kd.Provider,{value:j,children:Ld("div",{className:"ph-survey",style:D(D({},Od(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:M,children:O?Ld(Jd,{header:(null===(k=t.appearance)||void 0===k?void 0:k.thankYouMessageHeader)||"Thank you!",description:(null===(_=t.appearance)||void 0===_?void 0:_.thankYouMessageDescription)||"",forceDisableHtml:!!e,contentType:null===(S=t.appearance)||void 0===S?void 0:S.thankYouMessageDescriptionContentType,appearance:t.appearance||ud,onClose(){A(),c()}}):q?Ld(Kd,{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===(I=t.appearance)||void 0===I?void 0:I.introScreenDescriptionContentType,appearance:t.appearance||ud,onStart:()=>L(!0)}):Ld(xh,{survey:t,forceDisableHtml:!!e,posthog:n})})}):null}function xh({survey:t,forceDisableHtml:e,posthog:n}){var i,r;const o=Cc(()=>{const e=Rd(t);if(!e)return null;const n=X(e.lastQuestionIndex);return!n||n&&e.lastQuestionIndex>=0&&t.questions.length>e.lastQuestionIndex?e:(Ad(t),null)},[t]),[s,a]=_c(()=>((null==o?void 0:o.responses)&&Yc.info("Survey is already in progress, filling in initial responses"),(null==o?void 0:o.responses)||{})),[l,u]=_c(!1),{previewPageIndex:c,onPopupSurveyDismissed:d,isPopup:h,onPreviewSubmit:f,onPreviewBack:v,surveySubmissionId:p,isPreviewMode:m,properties:g,surveyLanguage:y}=Ic(kd),[b,w]=_c(()=>{const e=null==o?void 0:o.lastQuestionIndex,n=X(e)&&e>=0&&t.questions.length>e?e:0;return X(c)&&c>=0?c:n}),[k,_]=_c(()=>{var e;return(null!==(e=null==o?void 0:o.visitedIndices)&&void 0!==e?e:[]).filter(e=>e>=0&&t.questions.length>e)}),[S,x]=_c(()=>{var e;const n=Rd(t);return null!==(e=null==n?void 0:n.questionSnapshots)&&void 0!==e?e:{}}),C=Cc(()=>yd(bd(t,o)),[t.id,o]),I=Cc(()=>{if(!C||new Set(C).size!==C.length)return bd(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]);Sc(()=>{!m||G(c)||0>c||w(c)},[c,m]);const M=!!(null===(i=t.appearance)||void 0===i?void 0:i.allowGoBack)&&(m?(null!=c?c:0)>0:k.length>0),T=I.at(b);return T?Ld("form",{className:"survey-form",name:"surveyForm",children:[h&&!0!==(null===(r=t.appearance)||void 0===r?void 0:r.hideCancelButton)&&Ld(Qd,{onClick(){d()}}),Ld("div",{className:"survey-box","data-question-index":b,children:[l&&Ld("p",{role:"alert",children:"Your response could not be sent. Please try again later."}),Ih({question:T,forceDisableHtml:e,displayQuestionIndex:b,appearance:t.appearance||ud,onSubmit:e=>(({res:e,displayQuestionIndex:i,questionId:r})=>{if(!n)return void Yc.error("onNextButtonClick called without a PostHog instance.");if(!td(n))return void u(!0);if(u(!1),!r)return void Yc.error("onNextButtonClick called without a questionId.");const{responses:o,questionSnapshots:l}=function({responses:t,questionSnapshots:e={}},n,i,r){return{responses:D(D({},t),{},{[Ri(n)]:i}),questionSnapshots:(null==r?void 0:r.id)?D(D({},e),{},{[r.id]:r.question}):e}}({responses:s,questionSnapshots:S},r,e,I[i]);a(o),x(l);const c=ch(t,i,e),d=c===Vc,h=[...k,i];if(d||(_(h),w(c),Td(t,{surveySubmissionId:p,responses:o,lastQuestionIndex:c,questionOrder:yd(I),visitedIndices:h,surveyLanguage:y,questionSnapshots:l})),t.enable_partial_responses||d){const e=new Set(h.map(t=>{var e;return null===(e=I[t])||void 0===e?void 0:e.id}).filter(t=>!!t).map(t=>Ri(t))),i=Object.fromEntries(Object.entries(o).filter(([t])=>e.has(t)));vd({responses:i,survey:t,surveySubmissionId:p,isSurveyCompleted:d,posthog:n,properties:g,surveyLanguage:y,questionSnapshots:l})}})({res:e,displayQuestionIndex:b,questionId:T.id}),onPreviewSubmit:f,initialValue:T.id?s[Ri(T.id)]:void 0,canGoBack:M,onBack(){if(m)return void v();if(0===k.length)return;const e=k[k.length-1],n=k.slice(0,-1);_(n),w(e),Td(t,{surveySubmissionId:p,responses:s,lastQuestionIndex:e,questionOrder:yd(I),visitedIndices:n,surveyLanguage:y,questionSnapshots:S})}})]})]}):null}function Ch({survey:t,forceDisableHtml:e,posthog:n,readOnly:i,surveyLanguage:r}){var o,s,a,l,u,c,d;const[h,f]=_c(!0),[v,p]=_c(!1),[m,g]=_c({}),y=xc(void 0),b=()=>{(v||!n||i||td(n))&&p(!v)};if(Sc(()=>{var e;if(!n)return void Yc.error("FeedbackWidget called without a PostHog instance.");if(i)return;"tab"===(null===(e=t.appearance)||void 0===e?void 0:e.widgetType)&&g({top:"50%",bottom:"auto"});const r=e=>{var n;const i=e;(null===(n=i.detail)||void 0===n?void 0:n.surveyId)===t.id&&(Yc.info(`Received show event for feedback button survey ${t.id}`),g(i.detail.position||{}),b())};return me(fh,ph,r),()=>{G(y.current)||(clearTimeout(y.current),y.current=void 0),fh.removeEventListener(ph,r)}},[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.widgetSelector,null===(a=t.appearance)||void 0===a?void 0:a.borderColor]),wh({survey:t,setSurveyVisible:f,posthog:n}),!h)return null;const w=()=>{t.schedule!==Gc&&f(!1),G(y.current)||clearTimeout(y.current),y.current=setTimeout(()=>{y.current=void 0,p(!1)},200)};return Ld(Wu,{children:["tab"===(null===(l=t.appearance)||void 0===l?void 0:l.widgetType)&&Ld("button",{className:"ph-survey-widget-tab "+("top"===(null===(u=t.appearance)||void 0===u?void 0:u.tabPosition)?"widget-tab-top":""),onClick:b,disabled:i,style:_h(null===(c=t.appearance)||void 0===c?void 0:c.tabPosition),children:(null===(d=t.appearance)||void 0===d?void 0:d.widgetLabel)||""}),v&&Ld(Sh,{posthog:n,survey:t,forceDisableHtml:e,style:m,onPopupSurveyDismissed:w,onCloseConfirmationMessage:w,surveyLanguage:r})]})}const Ih=({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 zc:return Hu(Yd,D(D({},u),{},{question:t,key:t.id}));case"link":return Hu(th,D(D({},u),{},{question:t,key:t.id}));case Wc:return Hu(eh,D(D({},u),{},{question:t,key:t.id}));case Uc:case Hc:return Hu(ih,D(D({},u),{},{question:t,key:t.id}));default:return Yc.error(`Unsupported question type: ${t.type}`),null}};a.__PosthogExtensions__=a.__PosthogExtensions__||{},a.__PosthogExtensions__.generateSurveys=bh,a.extendPostHogWithSurveys=bh;const Mh=t=>{for(;null==t?void 0:t.__rrweb_original__;)t=t.__rrweb_original__;return t},Th=1e4,Rh=(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),Eh=(t,e,n)=>{const i=JSON.stringify(t);if(n.remaining>=i.length)return Rh(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 Rh(e,JSON.stringify(t.slice(0,r)),n)},Ah=t=>void 0!==t&&"function"!=typeof t&&"symbol"!=typeof t&&"bigint"!=typeof t,$h=(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}},Oh=(t,e,n)=>{if(!n.truncated)if(V(t)){if(n.seen.has(t))return void $h(e||"circular","[Circular]",n);n.seen.add(t);try{for(const i in t)try{if(!{}.hasOwnProperty.call(t,i))continue;if(Oh(t[i],e?`${e}.${i}`:i,n),n.truncated)break}catch(t){continue}}catch(t){}}else $h(e,t,n)},Ph=(t,e,n,i,r=!1,o)=>{if(!Ah(t))return!r||Rh(e,"null",n);if(J(t)||(t=>{try{return X(t)||Y(t)}catch(t){return!1}})(t))return Rh(e,JSON.stringify(t),n);if("string"==typeof t)return Eh(t,e,n);if(!V(t)&&!U(t))return Rh(e,JSON.stringify(t),n);if(i.has(t))return Eh("[Circular]",e,n);i.add(t);try{const o=t.toJSON;if(W(o))return Ph(o.call(t),e,n,i,r)}catch(t){}try{const i={}.toString.call(t);if("[object String]"===i)return Eh(String(t.valueOf()),e,n);if("[object Number]"===i||"[object Boolean]"===i)return Rh(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 Ph(s,e,n,i,r,o)}if(U(t)){if(!Rh(e,"[",n))return!1;for(let r=0;t.length>r;r++){if(r>0&&!Rh(e,",",n))return!1;let o;try{o=t[r]}catch(t){o=void 0}if(!Ph(o,e,n,i,!0))return!1}return Rh(e,"]",n)}if(!Rh(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{Oh(a,r,o)}catch(t){}if(!Ah(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(!Rh(e,l,n))return!1;const h=e.length,f=Ph(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 Rh(e,"}",n)},Lh=(t,e)=>{const n=[],i={remaining:e,truncated:!1},r=V(t[0])?{result:{},keysRemaining:50,sizeRemaining:Th,truncated:!1,seen:new WeakSet([t[0]])}:void 0;for(let e=0;t.length>e&&(0>=e||Rh(n," ",i))&&Ph(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)||{}}},Dh={debug:"debug",log:"info",warn:"warn",error:"error",info:"info"},Fh=t=>"canCapture"in t,Nh=t=>({console:a.console,hostname:a.location.host,getCapturingLogs(){let e;return e=Fh(t)?t.canCapture?t.getExtension("logs"):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(Fh(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}});a.__PosthogExtensions__=a.__PosthogExtensions__||{},a.__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(Dh)){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}=Lh(s,Th),u=D(D({},r),i?{body_truncated:"true"}:{}),c={level:Dh[t],body:n,attributes:D(D({"log.source":`console.${t}`},u),l)};e.captureConsoleLog(c)}}}catch(t){}finally{a&&(o=!1),i.apply(e,s)}},a=e[t];i.push(Bl(e,t,t=>{const e=s(t);return e.__rrweb_original__=Mh(a),e}))}}catch(t){throw s(),t}return s})(Nh(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}=Lh(r.args,Th);null===(i=n.captureBufferedConsoleLog)||void 0===i||i.call(n,{level:Dh[r.level],body:e,attributes:D(D({"log.source":`console.${r.level}`,host:t.hostname},o?{body_truncated:"true"}:{}),s)},r.context,r.occurredAtMs)}catch(t){}})(Nh(t),e)},he("[Error tracking]");const qh=he("[ExceptionAutocapture]"),jh=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 D(D({},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?D(D({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:Et(this.stackParser),skipFirstLines:null!==(e=t.skipFirstLines)&&void 0!==e?e:1}}getAggregateErrors(t){try{if(it(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 D(D({},v),{},{errors:m})},c=(n,i=0)=>D(D({},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 D(D({},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=Q(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 nt(t,"DOMException")}isDOMError(t){return nt(t,"DOMError")}},new class{match(t){return nt(t,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(t)}isCustomEventWrappingRejection(t){if(!rt(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 et(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!!nt(t,"ErrorEvent")&&(null!=t.error||this.ar(t))}coerce(t,e){var n;if(null!=t.error)return e.apply(t.error);const i=e.apply(t.message);return D(D({},i),{},{stack:null!==(n=this.lr(t))&&void 0!==n?n:i.stack,synthetic:!0})}ar(t){return Q(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(Q(i.filename)&&0!==i.filename.length&&0!==r)return`Error\n at ${i.filename}:${r}:${o}`}},new class{match(t){return it(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 rt(t)}coerce(t,e){var n;const i=t.constructor.name;return{type:i,value:`${i} captured as exception with keys: ${te(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(rt(t))return t.constructor.name;const e="name"in t?t.name:void 0;return Q(e)&&!Z(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: ${te(t)}`}isSeverityLevel(t){return Q(t)&&!Z(t)&&Yt.indexOf(t)>=0}getStack(t){try{return Q(t.stacktrace)&&t.stacktrace.length>0?t.stacktrace:Q(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(it(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(Xt);return i&&(e=i[1],n=i[2]),[e,n]}},new class{match(t){return et(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=Ut.test(i)?i.replace(Ut,"$1"):i;if(!s.match(/\S*Error: /)){for(const n of e){const e=n(s,t);if(e){r.push(e);const t=Vt(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(Jt(r,a)>=50)break}}const l=[...a].sort((t,e)=>e.start-t.start),u=l[l.length-1];if(u){const t=Qt(r,u);r.splice(u.start-t,t);for(const e of l)e.start-=t}for(const t of l)Gt(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++)Kt(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 D(D({},t),{},{filename:t.filename||(n=e,n[n.length-1]||{}).filename,function:t.function||"?"});var n})}(r)}}("web:javascript",jt,Ht)),Bh=(t,e)=>{try{return t()}catch(t){return e}},zh=(t,e)=>Bh(()=>t(e()),void 0),Hh=t=>Bh(()=>W(t)&&W(t.call),!1),Uh=(t,e)=>Bh(()=>{t[e].__POSTHOG_INSTRUMENTED__=!0},void 0),Wh=(t,e,n)=>{Bh(()=>{var n;null===(n=t[e])||void 0===n||delete n.__POSTHOG_INSTRUMENTED__},void 0),Bh(()=>{t[e]=n},void 0)},Vh=e=>{const n=t;n||qh.info("window not available, cannot wrap onerror");const i=Bh(()=>n.onerror,void 0);return n.onerror=function(...t){var n;return zh(e,()=>jh.buildFromUnknown((([t,e,n,i,r])=>{if(null!=r)return r;if(Q(t)&&Q(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}})),!!Hh(i)&&null!==(n=i(...t))&&void 0!==n&&n},Uh(n,"onerror"),()=>Wh(n,"onerror",i)},Gh=(e,n=!1)=>{const i=t;i||qh.info("window not available, cannot wrap onUnhandledRejection");const r=Bh(()=>i.onunhandledrejection,void 0);return i.onunhandledrejection=function(t){var i;return zh(e,()=>jh.buildFromUnknown(t,{mechanism:{handled:!1}})),Hh(r)?null!==(i=r(t))&&void 0!==i&&i:n},Uh(i,"onunhandledrejection"),()=>Wh(i,"onunhandledrejection",r)},Qh={wrapOnError:Vh,wrapUnhandledRejection:Gh,wrapConsoleError(t){const e=console;e||qh.info("console not available, cannot wrap console.error");const n=Bh(()=>e.error,void 0);return e.error=function(...e){Bh(()=>e.length>1&&Q(e[0])&&(/^\[PostHog\.js\](?: |$)/.test(e[0])||"rrweb logger error:"===e[0]),!1)||zh(t,()=>{let t;t=1==e.length?e[0]:e.join(" ");const n=e.find(t=>t instanceof Error);return jh.buildFromUnknown(n||t,{mechanism:{handled:!0,type:"onconsole"},syntheticException:new Error("PostHog syntheticException"),skipFirstLines:2})}),Hh(n)&&n(...e)},Uh(e,"error"),()=>Wh(e,"error",n)}};a.__PosthogExtensions__=a.__PosthogExtensions__||{},a.__PosthogExtensions__.errorWrappingFunctions=Qh,a.posthogErrorWrappingFunctions=Qh;const Zh=(t,e)=>{if(!W(null==t?void 0:t.capture))return;const n=null==e?void 0:e.autocaptureExceptions,i=!J(n)&&"object"==typeof n&&U(n.errors_to_ignore)?n.errors_to_ignore.reduce((t,e)=>{try{t.push(new RegExp(e))}catch(t){qh.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){qh.error("Failed to capture exception for a legacy client",t)}};Vh(t=>{i.some(e=>t.$exception_list.some(t=>e.test(t.value||"")))||r(t)}),Gh(r,!0)};a.extendPostHogWithExceptionAutoCapture=Zh,a.extendPostHogWithExceptionAutocapture=Zh;const Jh="X-POSTHOG-SESSION-ID",Kh="X-POSTHOG-WINDOW-ID",Xh="X-POSTHOG-DISTINCT-ID",Yh=[Jh,Kh,Xh],tf=["attributionReporting","body","browsingTopics","cache","credentials","dispatcher","duplex","integrity","keepalive","method","mode","priority","redirect","referrer","referrerPolicy","signal","window"],ef=(t,e)=>({}.hasOwnProperty.call(t,e)),nf=t=>"object"==typeof t&&!J(t)||W(t),rf=t=>"undefined"!=typeof Request&&(t instanceof Request||"[object Request]"==={}.toString.call(t)),of=e=>{try{var n;return rf(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}},sf=(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;if(n){const{sessionId:t,windowId:e}=n.checkAndGetSessionAndWindowId(!0);r.set(Jh,t),r.set(Kh,e),s=!0}const a=(t=>W(t)?t():t)(e);return a&&"$posthog_cookieless"!==a&&(r.set(Xh,a),s=!0),s};a.__PosthogExtensions__=a.__PosthogExtensions__||{};const af={_patchFetch:(e,n,i)=>Bl(t,"fetch",t=>function(r,o){const s=arguments.length>1?[r,o]:[r];let a=s;try{const t=of(r);if(t)if(rf(r)){const t=new Request(r,o);sf(e,n,i,t.url,t.headers),a=[t]}else{const s=new Headers(nf(o)?o.headers:void 0);if(sf(e,n,i,t,s)){const t=((t,e)=>{if(G(t)||J(t))return{headers:e};if(!nf(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)=>ef(t,e)?Reflect.get(t,e):Reflect.get(n,e,n),has:(t,e)=>ef(t,e)||e in n,ownKeys(t){const e=new Set(Reflect.ownKeys(t));return Reflect.ownKeys(n).forEach(t=>e.add(t)),tf.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&&tf.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?D(D({},r),{},{configurable:!0}):void 0},getPrototypeOf:()=>Object.getPrototypeOf(n)})})(o,s);t&&(a=[r,t])}}}catch(t){a=s}return t.apply(this,a)}),_patchXHR:(e,n,i)=>Bl(t.XMLHttpRequest.prototype,"open",t=>function(r,o,s=!0,a,l){const u=this,c=new Headers,d=of(o);d&&sf(e,n,i,d,c);const h=t.call(u,r,o,s,a,l);return Yh.forEach(t=>{const e=c.get(t);if(e)try{u.setRequestHeader(t,e)}catch(t){}}),h})};a.__PosthogExtensions__.tracingHeadersPatchFns=af,a.postHogTracingHeadersPatchFns=af,"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 lf=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 uf=()=>{const t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},cf=t=>{if("loading"===document.readyState)return"loading";const e=uf();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"},df=t=>{const e=t.nodeName;return 1===t.nodeType?e.toLowerCase():e.toUpperCase().replace(/^#/,"")},hf=t=>{let e="";try{for(;9!==(null==t?void 0:t.nodeType);){var n;const i=t,r=i.id?"#"+i.id:[df(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},ff=new WeakMap;function vf(t,e){let n=ff.get(e);return n||(n=new WeakMap,ff.set(e,n)),n.get(t)||n.set(t,new e),n.get(t)}let pf=-1;const mf=()=>pf,gf=t=>{addEventListener("pageshow",e=>{e.persisted&&(pf=e.timeStamp,t(e))},!0)},yf=(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)))}},bf=t=>{requestAnimationFrame(()=>requestAnimationFrame(()=>t()))},wf=()=>{var t,e;return null!==(t=null===(e=uf())||void 0===e?void 0:e.activationStart)&&void 0!==t?t:0};let kf=-1;const _f=new Set,Sf=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,xf=t=>{if("hidden"===document.visibilityState){if("visibilitychange"===t.type)for(const t of _f)t();isFinite(kf)||(kf="visibilitychange"===t.type?t.timeStamp:0,removeEventListener("prerenderingchange",xf,!0))}},Cf=(t=!1)=>{if(t&&(kf=1/0),0>kf){var e;const t=wf(),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;kf=null!=n?n:Sf(),addEventListener("visibilitychange",xf,!0),addEventListener("prerenderingchange",xf,!0),gf(()=>{setTimeout(()=>{kf=Sf()})})}return{get firstHiddenTime(){return kf},onHidden(t){_f.add(t)}}},If=(t,e=-1,n,i=0,r,o,s)=>{const a=uf(),l=(null==a?void 0:a.navigationId)||0;let u="navigate";return n?u=n:0>mf()?a&&(document.prerendering||wf()>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}},Mf=(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(D({type:e,buffered:!0},n));return t}}catch(t){}},Tf=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},Rf=(t,e)=>{if(t.set(e.navigationId,e),t.size>2){const e=t.keys().next().value;void 0!==e&&t.delete(e)}},Ef=t=>{let e=!1;return()=>{e||(t(),e=!0)}};var Af=class{constructor(){this.u=void 0}};const $f=t=>{document.prerendering?addEventListener("prerenderingchange",t,!0):t()},Of=[1800,3e3],Pf=(t,e={})=>{const n=Tf(e);$f(()=>{const i=vf(e,Af),r=Cf();let o,s=If("FCP");const a=Mf(["paint"],t=>{for(const e of t)"first-contentful-paint"===e.name&&(a.disconnect(),r.firstHiddenTime>e.startTime&&(s.value=Math.max(e.startTime-wf(),0),s.entries.push(e),s.navigationId=e.navigationId||s.navigationId,o(!0)))});a&&(o=yf(t,s,Of,e.reportAllChanges),gf(n=>{s=If("FCP",-1,"back-forward-cache",s.navigationId,s.navigationInteractionId,s.navigationURL,mf()),o=yf(t,s,Of,e.reportAllChanges),bf(()=>{s.value=performance.now()-n.timeStamp,o(!0)})})),n&&Mf(["soft-navigation"],n=>{n.forEach(n=>{i.u&&n.navigationId&&Rf(i.u,n);const r=Math.max((n.presentationTime||n.paintTime||0)-n.startTime,0);s=If("FCP",r,"soft-navigation",n.navigationId,n.interactionId,n.name,n.startTime),o=yf(t,s,Of,e.reportAllChanges),o(!0)})},e)})},Lf=[.1,.25],Df=t=>t.find(t=>{var e;return 1===(null===(e=t.node)||void 0===e?void 0:e.nodeType)})||t[0],Ff=(t,e={})=>{const n=vf(e=Object.assign({},e),lf),i=new WeakMap;n.t=t=>{var n;if(null==t||null===(n=t.sources)||void 0===n?void 0:n.length){const n=Df(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:hf(s);i.set(n,t)}}},((t,e={})=>{const n=Cf();Pf(Ef(()=>{let i,r=If("CLS",0);const o=vf(e,lf),s=(n,s,a,l,u)=>{r=If("CLS",0,n,s,a,l,u),o.o=0,i=yf(t,r,Lf,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"];Tf(e)&&c.push("soft-navigation");const d=Mf(c,u);d&&(i=yf(t,r,Lf,e.reportAllChanges),n.onHidden(()=>{u(d.takeRecords()),i(!0)}),gf(()=>{s("back-forward-cache",r.navigationId,r.navigationInteractionId,r.navigationURL,mf()),bf(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=Df(r.sources);t&&(e={largestShiftTarget:i.get(t),largestShiftTime:r.startTime,largestShiftValue:r.value,largestShiftSource:t,largestShiftEntry:r,loadState:cf(r.startTime)})}}return Object.assign(t,{attribution:e})})(e))},e)},Nf=(t,e={})=>{const n=vf(e=Object.assign({},e),Af);Tf(e)&&(n.u=new Map),Pf(e=>{t((t=>{let e={timeToFirstByte:0,firstByteToFCP:t.value,loadState:cf(mf())};if("soft-navigation"!==t.navigationType){if(t.entries.length){const n=uf(),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:cf(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 qf=0,jf=1/0,Bf=0;const zf=t=>{for(const e of t)e.interactionId&&(jf=Math.min(jf,e.interactionId),Bf=Math.max(Bf,e.interactionId),qf=Bf?(Bf-jf)/7+1:0)};let Hf;const Uf=()=>{var t;return Hf?qf:null!==(t=performance.interactionCount)&&void 0!==t?t:0};var Wf=class{constructor(){this.h=0,this.v=[],this.p=new Map,this.m=void 0,this.M=void 0}T(){return Uf()-this.h}D(){this.h=Uf(),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 Vf=t=>{const e="requestIdleCallback"in globalThis?1e3:0,n=globalThis.requestIdleCallback||setTimeout,i=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)t();else{const r=Ef(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})}},Gf=[200,500],Qf=(t,e={})=>{const n=vf(e=Object.assign({},e),Wf);let i=[],r=[],o=0;const s=new WeakMap,a=new WeakMap;let l=!1;const u=()=>{l||(Vf(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:hf(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};Mf(["long-animation-frame"],t=>{i=i.concat(t),u()},e),((t,e={})=>{if(!globalThis.PerformanceEventTiming||!("interactionId"in PerformanceEventTiming.prototype))return;const n=Cf();$f(()=>{var i;"interactionCount"in performance||Hf||(Hf=Mf(["event"],zf,{durationThreshold:0}));let r,o=If("INP");const s=vf(e,Wf),a=(n,i,a,l,u)=>{s.D(),o=If("INP",-1,n,i,a,l,u),r=yf(t,o,Gf,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)=>{Vf(()=>{for(const e of t)"soft-navigation"!==e.entryType?s.l(e):u(e);l(),e&&r(!0)})},d=["event","first-input"];Tf(e)&&d.push("soft-navigation");const h=Mf(d,c,D(D({},e),{},{durationThreshold:null!==(i=e.durationThreshold)&&void 0!==i?i:40}));r=yf(t,o,Gf,e.reportAllChanges),h&&(n.onHidden(()=>{c(h.takeRecords(),!0)}),gf(()=>{a("back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,mf())}))})})(e=>{t((t=>{if(0===t.entries.length){const e={processedEventEntries:[],longAnimationFrameEntries:[],inputDelay:0,processingDuration:0,presentationDelay:t.value,loadState:cf(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:cf(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 Zf=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 Jf=50;const Kf=[];Mf(["resource"],t=>{for(const e of t)Kf.push(e),Kf.length>Jf&&Kf.shift()});const Xf=(t,e={})=>{null!=(e=Object.assign({},e)).resourceBufferSize&&(Jf=e.resourceBufferSize);const n=vf(e,Zf),i=new WeakMap;Tf(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:hf(n);i.set(t,s)}else t.id&&i.set(t,`#${t.id}`)},((t,e={})=>{let n=!1;const i=Tf(e);$f(()=>{let r,o=Cf(),s=If("LCP");const a=vf(e,Zf),l=(i,a,l,u,c)=>{s=If("LCP",-1,i,a,l,u,c),r=yf(t,s,$,e.reportAllChanges),n=!1,"soft-navigation"===i&&(o=Cf(!0))},u=t=>{var e;a.u&&t.navigationId&&Rf(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-wf(),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=Mf(d,c);if(h){r=yf(t,s,$,e.reportAllChanges);const o=["keydown","click","visibilitychange"],a=t=>{if(t.isTrusted&&!n){const t=s.id;Vf(()=>{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});gf(i=>{l("back-forward-cache",s.navigationId,s.navigationInteractionId,s.navigationURL,mf()),r=yf(t,s,$,e.reportAllChanges),bf(()=>{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&&(Kf.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=uf(),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=D(D({},e),{},{timeToFirstByte:n,resourceLoadDelay:i-n,resourceLoadDuration:r-i,elementRenderDelay:t.value-r,navigationEntry:u})}}return Object.assign(t,{attribution:e})})(e))},e)};let Yf=-1;const tv=()=>Yf,ev=t=>{addEventListener("pageshow",e=>{e.persisted&&(Yf=e.timeStamp,t(e))},!0)},nv=(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)))}},iv=t=>{requestAnimationFrame(()=>requestAnimationFrame(()=>t()))},rv=()=>{const t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},ov=()=>{var t,e;return null!==(t=null===(e=rv())||void 0===e?void 0:e.activationStart)&&void 0!==t?t:0};let sv=-1;const av=new Set,lv=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,uv=t=>{if("hidden"===document.visibilityState){if("visibilitychange"===t.type)for(const t of av)t();isFinite(sv)||(sv="visibilitychange"===t.type?t.timeStamp:0,removeEventListener("prerenderingchange",uv,!0))}},cv=(t=!1)=>{if(t&&(sv=1/0),0>sv){var e;const t=ov(),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;sv=null!=n?n:lv(),addEventListener("visibilitychange",uv,!0),addEventListener("prerenderingchange",uv,!0),ev(()=>{setTimeout(()=>{sv=lv()})})}return{get firstHiddenTime(){return sv},onHidden(t){av.add(t)}}},dv=(t,e=-1,n,i=0,r,o,s)=>{const a=rv(),l=(null==a?void 0:a.navigationId)||0;let u="navigate";return n?u=n:0>tv()?a&&(document.prerendering||ov()>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}},hv=new WeakMap;function fv(t,e){let n=hv.get(e);return n||(n=new WeakMap,hv.set(e,n)),n.get(t)||n.set(t,new e),n.get(t)}var vv=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 pv=(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(D({type:e,buffered:!0},n));return t}}catch(t){}},mv=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},gv=(t,e)=>{if(t.set(e.navigationId,e),t.size>2){const e=t.keys().next().value;void 0!==e&&t.delete(e)}},yv=t=>{let e=!1;return()=>{e||(t(),e=!0)}};var bv=class{constructor(){this.l=void 0}};const wv=t=>{document.prerendering?addEventListener("prerenderingchange",t,!0):t()},kv=[1800,3e3],_v=(t,e={})=>{const n=mv(e);wv(()=>{const i=fv(e,bv),r=cv();let o,s=dv("FCP");const a=pv(["paint"],t=>{for(const e of t)"first-contentful-paint"===e.name&&(a.disconnect(),r.firstHiddenTime>e.startTime&&(s.value=Math.max(e.startTime-ov(),0),s.entries.push(e),s.navigationId=e.navigationId||s.navigationId,o(!0)))});a&&(o=nv(t,s,kv,e.reportAllChanges),ev(n=>{s=dv("FCP",-1,"back-forward-cache",s.navigationId,s.navigationInteractionId,s.navigationURL,tv()),o=nv(t,s,kv,e.reportAllChanges),iv(()=>{s.value=performance.now()-n.timeStamp,o(!0)})})),n&&pv(["soft-navigation"],n=>{n.forEach(n=>{i.l&&n.navigationId&&gv(i.l,n);const r=Math.max((n.presentationTime||n.paintTime||0)-n.startTime,0);s=dv("FCP",r,"soft-navigation",n.navigationId,n.interactionId,n.name,n.startTime),o=nv(t,s,kv,e.reportAllChanges),o(!0)})},e)})},Sv=[.1,.25],xv=(t,e={})=>{const n=cv();_v(yv(()=>{let i,r=dv("CLS",0);const o=fv(e,vv),s=(n,s,a,l,u)=>{r=dv("CLS",0,n,s,a,l,u),o.i=0,i=nv(t,r,Sv,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"];mv(e)&&c.push("soft-navigation");const d=pv(c,u);d&&(i=nv(t,r,Sv,e.reportAllChanges),n.onHidden(()=>{u(d.takeRecords()),i(!0)}),ev(()=>{s("back-forward-cache",r.navigationId,r.navigationInteractionId,r.navigationURL,tv()),iv(i)}),setTimeout(i))}))};let Cv=0,Iv=1/0,Mv=0;const Tv=t=>{for(const e of t)e.interactionId&&(Iv=Math.min(Iv,e.interactionId),Mv=Math.max(Mv,e.interactionId),Cv=Mv?(Mv-Iv)/7+1:0)};let Rv;const Ev=()=>{var t;return Rv?Cv:null!==(t=performance.interactionCount)&&void 0!==t?t:0};var Av=class{constructor(){this.u=0,this.v=[],this.m=new Map,this.p=void 0,this.T=void 0}_(){return Ev()-this.u}M(){this.u=Ev(),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 $v=t=>{const e="requestIdleCallback"in globalThis?1e3:0,n=globalThis.requestIdleCallback||setTimeout,i=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)t();else{const r=yv(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})}},Ov=[200,500],Pv=(t,e={})=>{if(!globalThis.PerformanceEventTiming||!("interactionId"in PerformanceEventTiming.prototype))return;const n=cv();wv(()=>{var i;"interactionCount"in performance||Rv||(Rv=pv(["event"],Tv,{durationThreshold:0}));let r,o=dv("INP");const s=fv(e,Av),a=(n,i,a,l,u)=>{s.M(),o=dv("INP",-1,n,i,a,l,u),r=nv(t,o,Ov,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)=>{$v(()=>{for(const e of t)"soft-navigation"!==e.entryType?s.h(e):u(e);l(),e&&r(!0)})},d=["event","first-input"];mv(e)&&d.push("soft-navigation");const h=pv(d,c,D(D({},e),{},{durationThreshold:null!==(i=e.durationThreshold)&&void 0!==i?i:40}));r=nv(t,o,Ov,e.reportAllChanges),h&&(n.onHidden(()=>{c(h.takeRecords(),!0)}),ev(()=>{a("back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,tv())}))})};var Lv=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 Dv=[2500,4e3],Fv=(t,e={})=>{let n=!1;const i=mv(e);wv(()=>{let r,o=cv(),s=dv("LCP");const a=fv(e,Lv),l=(i,a,l,u,c)=>{s=dv("LCP",-1,i,a,l,u,c),r=nv(t,s,Dv,e.reportAllChanges),n=!1,"soft-navigation"===i&&(o=cv(!0))},u=t=>{var e;a.l&&t.navigationId&&gv(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-ov(),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=pv(d,c);if(h){r=nv(t,s,Dv,e.reportAllChanges);const o=["keydown","click","visibilitychange"],a=t=>{if(t.isTrusted&&!n){const t=s.id;$v(()=>{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});ev(i=>{l("back-forward-cache",s.navigationId,s.navigationInteractionId,s.navigationURL,tv()),r=nv(t,s,Dv,e.reportAllChanges),iv(()=>{s.value=performance.now()-i.timeStamp,n=!0,r(!0)})})}})},Nv={onLCP:Xf,onCLS:Ff,onFCP:Nf,onINP:Qf,withoutAttribution:{onLCP:Fv,onCLS:xv,onFCP:_v,onINP:Pv}};a.__PosthogExtensions__=a.__PosthogExtensions__||{},a.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=a.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},a.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-with-attribution-soft-navs"]=Nv,a.__PosthogExtensions__.postHogWebVitalsCallbacks=Nv,a.postHogWebVitalsCallbacks=Nv;const qv={onLCP:Fv,onCLS:xv,onFCP:_v,onINP:Pv};a.__PosthogExtensions__=a.__PosthogExtensions__||{},a.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=a.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},a.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-soft-navs"]=qv,a.__PosthogExtensions__.postHogWebVitalsCallbacks=qv,a.postHogWebVitalsCallbacks=qv,a.__PosthogExtensions__.loadWebVitalsCallbacks=()=>qv;const jv={onLCP:Xf,onCLS:Ff,onFCP:Nf,onINP:Qf,withoutAttribution:{onLCP:Fv,onCLS:xv,onFCP:_v,onINP:Pv}};a.__PosthogExtensions__=a.__PosthogExtensions__||{},a.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=a.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},a.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-with-attribution"]=jv,a.__PosthogExtensions__.postHogWebVitalsCallbacks=jv,a.postHogWebVitalsCallbacks=jv;const Bv={onLCP:Fv,onCLS:xv,onFCP:_v,onINP:Pv};function zv(t,e){return e.length>t?e.slice(0,t)+"...":e}function Hv(t){if(t.previousElementSibling)return t.previousElementSibling;let e=t;do{e=e.previousSibling}while(e&&!we(e));return e}function Uv(e,{e:n,maskAllElementAttributes:i,maskAllText:r,elementAttributeIgnoreList:o,elementsChainAsString:s,disableCaptureUrlHashes:a}){var l,u;if(!we(e))return{props:{}};const c=[e],d=new Set([e]);let h=e;for(;h.parentNode&&!ke(h,"body")&&1e3>c.length;){if(_e(h.parentNode)){const t=h.parentNode.host;if(d.has(t))break;d.add(t),c.push(t),h=t;continue}if(!we(h.parentNode))break;if(d.has(h.parentNode))break;d.add(h.parentNode),c.push(h.parentNode),h=h.parentNode}const f="click"===n.type&&"http://www.w3.org/2000/svg"===e.namespaceURI?c.findIndex(t=>ke(t,"button")||ke(t,"a")):-1;f>0&&(r=r||c.slice(0,f+1).some(t=>!Le(t)||De(t)));const v=[],p={};let m,g=!1,y=!1;if(fe(c,t=>{const e=Le(t);if(ke(t,"a")&&!i&&!(null==o?void 0:o.includes("href"))){const n=t.getAttribute("href");g=!!(e&&n&&Ue(n))&&(a?xt(n):n)}q(xe(t),"ph-no-capture")&&(y=!0),v.push(function(t,e,n,i,r=!1){const o=t.tagName.toLowerCase(),s={tag_name:o};Me.indexOf(o)>-1&&!n&&(s.$el_text="a"===o.toLowerCase()||"button"===o.toLowerCase()?zv(1024,We(t)):zv(1024,Ce(t)));const a=xe(t);e||(null==i?void 0:i.includes("class"))||0>=a.length||(s.classes=a.filter(function(t){return""!==t})),fe(t.attributes,function(n){var o;if((!De(t)||-1!==["name","id","class","aria-label"].indexOf(n.name))&&!(null==i?void 0:i.includes(n.name))&&!e&&Ue(n.value)&&(!Q(o=n.name)||"_ngcontent"!==o.substring(0,10)&&"_nghost"!==o.substring(0,7))){let t=n.value;"class"===n.name&&(t=Se(t).join(" ")),s["attr__"+n.name]=zv(1024,"href"===n.name&&r?xt(t):t)}});let l=1,u=1,c=t;for(;c=Hv(c);)l++,c.tagName===t.tagName&&u++;return s.nth_child=l,s.nth_of_type=u,s}(t,i,r,o,a)),fe(function(t){if(!Le(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&&Ue(i)&&(e[n]=i)}}),e}(t),(t,e)=>{({}).hasOwnProperty.call(p,e)||(p[e]=t)})}),y)return{props:{},explicitNoCapture:y};if(f>0&&(e=c[f],v.splice(0,f)),r||(v[0].$el_text=ke(e,"a")||ke(e,"button")?We(e):Ce(e)),g){var b,w;v[0].attr__href=g;const e=null===(b=ye(g))||void 0===b?void 0:b.host,n=null==t||null===(w=t.location)||void 0===w?void 0:w.host;e&&n&&e!==n&&(m=g)}return{props:ve((_=n.type,{$event_type:_,$ce_version:1}),s?{}:{$elements:v},{$elements_chain:(k=v,U(k)?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=D(D(D(D({},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[Ge(t.toString())]=Ge(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:Qe(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})}(k)):"")},(null===(l=v[0])||void 0===l?void 0:l.$el_text)?{$el_text:null===(u=v[0])||void 0===u?void 0:u.$el_text}:{},m&&"click"===n.type?{$external_click_url:m}:{},p),target:e};var k,_}a.__PosthogExtensions__=a.__PosthogExtensions__||{},a.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=a.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},a.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals"]=Bv,a.__PosthogExtensions__.postHogWebVitalsCallbacks=Bv,a.postHogWebVitalsCallbacks=Bv,a.__PosthogExtensions__.loadWebVitalsCallbacks=()=>Bv,he("[AutoCapture]");const Wv={};function Vv(t,e){const n=Ie(t);return n?D({node:n,originalEvent:t,timestamp:Date.now()},e):null}function Gv(t){return!!Ct(()=>we(t))}function Qv(t,e){return Math.abs(t)<Math.abs(e)?0>e?"up":"down":0>t?"left":"right"}function Zv(t){return"swipe"===t.type?"$dead_swipe":"$dead_click"}const Jv="canvas,video,audio,embed,object";function Kv(t,e){return X(t)&&t>=e}function Xv(t,e=1e3){return t>=0&&e>t?t:void 0}function Yv(t,e,n=1e3){return X(e)?Xv(t-e,n):void 0}var tp=class{ur(t){var e,n,i,r,o,s,a,l;const u=this.cr((null==t?void 0:t.__onCapture)||this.dr.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.hr=new WeakSet,this.vr=!1,this.pr=[],this.mr=0,this.cr=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.gr=()=>{clearTimeout(this.yr),this.yr=void 0,this.br=void 0},this.wr=t=>{if(this.kr(t),this.gr(),0===t.button){const e={path:t.composedPath(),trusted:t.isTrusted,selectionChanged:!1,selectionInitiallyRelated:!1},n=null==i?void 0:i.getSelection();e.selectionInitiallyRelated="Range"===(null==n?void 0:n.type)&&this._r(n,e),this.br=e}},this.Sr=t=>{J(t.relatedTarget)&&this.gr()},this.Cr=t=>{const e=this.br,n=t;if(!e||0!==n.button||t.isTrusted!==e.trusted)return;const i=t.composedPath();for(const t of e.path)if(Gv(t)&&-1!==i.indexOf(t)){e.clickTarget=t;break}e.clickDetail=n.detail,this.yr=a.setTimeout(this.gr,0)},this.Ir=t=>{this.kr(t);const e=t,n=Vv(e,{type:"click"}),i=this.br;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.Mr.selection_change_threshold_ms>0,this.gr()),J(n)||this.Tr(n)||this.Rr(n),this.Er()},this.Ar=()=>{const t=Date.now();this.$r=t,t%50==0&&this.pr.forEach(e=>{G(e.scrollDelayMs)&&(e.scrollDelayMs=t-e.timestamp)})},this.Or=t=>{var e,n;const r=null==i?void 0:i.getSelection(),o=this.vr;this.vr="Range"===(null==r?void 0:r.type);const s=null==r?void 0:r.focusNode,a=s&&(we(s)?s:s.parentElement),l=null==i?void 0:i.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!==(n=u)&&void 0!==n?n:null),d="Caret"===(null==r?void 0:r.type)&&u&&!u.shadowRoot&&s&&s!==l&&s.contains(null!=l?l:null);if(!(o||this.vr||c||d))return;const h=Date.now();this.Pr=h;const f=this.br;if(f&&(o||this.vr||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.Lr(n,f):r&&(s||r.anchorNode)?this._r(r,f):o&&!this.vr&&f.selectionInitiallyRelated;f.selectionChanged=f.selectionChanged||i}this.pr.forEach(t=>{const e=h-t.timestamp;0>e||!G(t.selectionChangedDelayMs)&&e>=t.selectionChangedDelayMs||(t.selectionChangedDelayMs=e)})},this.sn=()=>{"hidden"===(null==i?void 0:i.visibilityState)&&this.gr();const t=Date.now();this.Dr=t,this.Fr("visibilityChangedDelayMs",t)},this.Nr=()=>{const t=Date.now();this.qr=t,this.Fr("focusChangedDelayMs",t)},this.jr=t=>{this.kr(t);const e=t.touches,n=1===(null==e?void 0:e.length)?e[0]:void 0;this.Br=n?{x:n.clientX,y:n.clientY,timestamp:Date.now()}:void 0},this.zr=()=>{this.Br=void 0},this.Hr=t=>{var e;const n=this.Br;if(this.Br=void 0,G(n)||this.mr>=this.Mr.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-n.x,a=o.clientY-n.y,l=s*s+a*a,u=this.Mr.swipe_threshold_px;if(u*u>l)return;if([this.$r,this.Ur,this.Pr].some(t=>X(t)&&t>=n.timestamp))return;var c,d;if(this.Wr()&&(null!==(c=null==i||null===(d=i.elementsFromPoint)||void 0===d?void 0:d.call(i,n.x,n.y))&&void 0!==c?c:[]).some(t=>{var e;return null===(e=t.matches)||void 0===e?void 0:e.call(t,Jv)}))return;const h=Vv(r,{type:"swipe",swipeDirection:Qv(s,a),swipeDistancePx:Math.round(Math.sqrt(l))});J(h)||this.Tr(h)||this.Rr(h),this.Er()},this.Mr=this.ur(e),this._onCapture=this.Mr.__onCapture}start(t){this.Vr(),this.Gr(),this.Qr(),this.Zr(),this.Jr(),this.Kr(t),this.Mr.capture_dead_swipes&&this.Xr()}Kr(e){if(!this.Yr){const n=function(e){return function(e,n){const i=Wv[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 Wv[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 l=t.contentWindow;var s,a;l&&l[e]&&(r=l[e],"MutationObserver"===e&&function(t){return q(t,"AppleWebKit")&&!q(t,"Chrome")}(null!==(s=null===(a=n.navigator)||void 0===a?void 0:a.userAgent)&&void 0!==s?s:"")&&(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)}}return r&&W(r)?Wv[e]=r.bind(n):r}("MutationObserver",e)}(a);this.Yr=new n(t=>{this.eo(t)}),this.no(e)}}no(t){t&&this.Yr&&(this.hr.has(t)||(this.Yr.observe(t,{attributes:!0,characterData:!0,childList:!0,subtree:!0}),this.hr.add(t),this.io(t)))}io(t,e){var n,i;we(t)&&t.shadowRoot&&this.no(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.no(r[t].shadowRoot)}kr(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];Gv(e)&&this.no(e.shadowRoot)}}stop(){var t;null===(t=this.Yr)||void 0===t||t.disconnect(),this.Yr=void 0,this.hr=new WeakSet,a.removeEventListener("click",this.Ir,{capture:!0}),a.removeEventListener("mousedown",this.wr,{capture:!0}),a.removeEventListener("mouseup",this.Cr,{capture:!0}),a.removeEventListener("mouseout",this.Sr,{capture:!0}),a.removeEventListener("dragstart",this.gr,{capture:!0}),a.removeEventListener("pointercancel",this.gr,{capture:!0}),a.removeEventListener("blur",this.gr),this.gr(),a.removeEventListener("scroll",this.Ar,{capture:!0}),null==i||i.removeEventListener("selectionchange",this.Or),a.removeEventListener("touchstart",this.jr,{capture:!0}),a.removeEventListener("touchend",this.Hr,{capture:!0}),a.removeEventListener("touchcancel",this.zr,{capture:!0}),null==i||i.removeEventListener("visibilitychange",this.sn),a.removeEventListener("blur",this.Nr),a.removeEventListener("focus",this.Nr),this.Br=void 0}eo(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.Ur=Date.now();const t=i.addedNodes;for(let n=0;t.length>n;n++){const i=t[n];Gv(i)&&!e.has(i)&&this.io(i,e)}}catch(t){}}Vr(){me(a,"click",this.Ir,{capture:!0}),me(a,"mousedown",this.wr,{capture:!0}),me(a,"mouseup",this.Cr,{capture:!0}),me(a,"mouseout",this.Sr,{capture:!0}),me(a,"dragstart",this.gr,{capture:!0}),me(a,"pointercancel",this.gr,{capture:!0}),me(a,"blur",this.gr)}Rr(t){t.selectionChangedDelayMs=Yv(t.timestamp,this.Pr,this.Mr.selection_change_threshold_ms),t.visibilityChangedDelayMs=Yv(t.timestamp,this.Dr),t.focusChangedDelayMs=Yv(t.timestamp,this.qr),this.pr.push(t)}Er(){this.pr.length&&G(this.ro)&&(this.ro=a.setTimeout(()=>{this.oo()},1e3))}Gr(){me(a,"scroll",this.Ar,{capture:!0})}Qr(){var t;this.vr="Range"===(null==i||null===(t=i.getSelection())||void 0===t?void 0:t.type),me(i,"selectionchange",this.Or)}Lr(t,e){const n=e.path[0];try{for(;t;){if(-1!==e.path.indexOf(t)||we(n)&&n.contains(t))return!0;t=t.getRootNode().host}}catch(t){}return!1}_r(t,e){const n=e.path[0],i=t.rangeCount>0?t.getRangeAt(0):void 0,r=!!i&&Ct(()=>i.startContainer.getRootNode()===n.getRootNode());if(i&&r&&we(n)){var o;if(!i.collapsed)return i.intersectsNode(n);const t=we(i.startContainer)&&null!==(o=i.startContainer.childNodes[i.startOffset])&&void 0!==o?o:i.startContainer;return this.Lr(t,e)}return this.Lr(t.focusNode,e)||this.Lr(t.anchorNode,e)}Zr(){me(i,"visibilitychange",this.sn)}Jr(){me(a,"blur",this.Nr),me(a,"focus",this.Nr)}Fr(t,e){this.pr.forEach(n=>{const i=Xv(e-n.timestamp);X(i)&&(G(n[t])||n[t]>i)&&(n[t]=i)})}Xr(){me(a,"touchstart",this.jr,{capture:!0,passive:!0}),me(a,"touchend",this.Hr,{capture:!0,passive:!0}),me(a,"touchcancel",this.zr,{capture:!0,passive:!0})}Wr(){const t=G(this.so)||X(this.Ur)&&this.Ur>this.so;return(G(this.ao)||t)&&(this.so=Date.now(),this.ao=!!(null==i?void 0:i.querySelector(Jv))),!!this.ao}Tr(t){return!t||("swipe"===t.type?this.lo(t):this.uo(t))}lo(e){return!((!((n=e.node)instanceof Element)||"__POSTHOG_TOOLBAR__"!==n.id&&!(null===(i=n.closest)||void 0===i?void 0:i.call(n,".toolbar-global-fade-container")))&&!this.pr.some(t=>t.type===e.type&&t.node===e.node&&1e3>Math.abs(t.timestamp-e.timestamp))&&!ke(e.node,"html")&&we(e.node)&&function(e,n){var i;if(!t||Oe(e))return!1;const r=Y(n)?Ee:null!==(i=null==n?void 0:n.css_selector_ignorelist)&&void 0!==i?i:Ee,{targetElementList:o}=Pe(e,!1);return!function(t,e){if(G(e))return!0;for(const n of t)if(e.some(t=>Te(n,t)))return!0;return!1}(o,r)}(e.node,{css_selector_ignorelist:this.Mr.css_selector_ignorelist}));var n,i}uo(e){return!(this.Mr.capture_clicks_with_modifier_keys||(n=e.originalEvent,!(n.ctrlKey||n.metaKey||n.altKey||n.shiftKey)))||!!this.lo(e)||function(e){if(!t||Oe(e))return!1;const{targetElementList:n}=Pe(e,!1);return n.some(t=>ke(t,"a"))}(e.node);var n}oo(){if(!this.pr.length)return;clearTimeout(this.ro),this.ro=void 0;const t=this.pr;this.pr=[];for(const n of t){var e;n.mutationDelayMs=null!==(e=n.mutationDelayMs)&&void 0!==e?e:this.Ur&&this.Ur>=n.timestamp?this.Ur-n.timestamp:void 0,n.absoluteDelayMs=Date.now()-n.timestamp;const t=Kv(n.scrollDelayMs,this.Mr.scroll_threshold_ms),i=Kv(n.selectionChangedDelayMs,this.Mr.selection_change_threshold_ms),r=Kv(n.mutationDelayMs,this.Mr.mutation_threshold_ms),o=Kv(n.absoluteDelayMs,1.1*this.Mr.mutation_threshold_ms),s=X(n.scrollDelayMs)&&this.Mr.scroll_threshold_ms>n.scrollDelayMs,a=X(n.mutationDelayMs)&&this.Mr.mutation_threshold_ms>n.mutationDelayMs,l=n.selectionChangedDuringGesture||X(n.selectionChangedDelayMs)&&this.Mr.selection_change_threshold_ms>n.selectionChangedDelayMs,u=X(n.visibilityChangedDelayMs),c=X(n.focusChangedDelayMs);if(!(s||a||l||u||c))if(t||r||o||i){const e=Zv(n);if("$dead_swipe"===e){if(this.mr>=this.Mr.max_dead_swipes_per_page_load)continue;this.mr++}this._onCapture(n,{[`${e}_last_mutation_timestamp`]:this.Ur,[`${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.Mr.mutation_threshold_ms>n.absoluteDelayMs&&this.pr.push(n)}this.Er()}dr(t,e){const n=Zv(t);this.instance.capture(n,D(D(D({},e),Uv(t.node,{e:t.originalEvent,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.Mr.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)})}};a.__PosthogExtensions__=a.__PosthogExtensions__||{},a.__PosthogExtensions__.initDeadClicksAutocapture=(t,e)=>new tp(t,e)}();
|
|
1
|
+
!function(){const t="u">typeof window?window:void 0,e="u">typeof globalThis?globalThis:t,n=null==e?void 0:e.navigator,i=null==e?void 0:e.document,r=null==e?void 0:e.location;null!=e&&e.XMLHttpRequest&&new e.XMLHttpRequest;const o=null==n?void 0:n.userAgent,s="undefined"!=typeof globalThis?globalThis:t;s&&"undefined"==typeof self&&(s.self=s),s&&"undefined"==typeof File&&(s.File=function(){});const a=null!=t?t:{},l="$stored_person_properties",u="$replay_override_sampling",c="$replay_override_linked_flag",d="$replay_override_url_trigger",h="$replay_override_event_trigger",f="$session_is_sampled",v="$session_recording_url_trigger_activated_session",p="$session_recording_event_trigger_activated_session",m="$posthog_sr_group_event_trigger_",g="$posthog_sr_group_url_trigger_",y="$sess_rec_flush_size",b="$surveys",w="$sdk_debug_replay_event_trigger_status",k="$sdk_debug_replay_linked_flag_trigger_status",_="$sdk_debug_replay_matched_recording_trigger_groups",S="$sdk_debug_replay_pending_trigger_conditions",x="$sdk_debug_replay_remote_trigger_matching_config",C="$sdk_debug_replay_trigger_groups_count",I="$sdk_debug_replay_url_trigger_status",M="$sdk_debug_rrweb_attached",T="$sdk_debug_rrweb_start_attempted",R="$session_recording_start_reason";function E(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){E(o,i,r,s,a,"next",t)}function a(t){E(o,i,r,s,a,"throw",t)}s(void 0)})}}function O(t){return O="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},O(t)}function P(t,e,n){return(e=function(t){var e=function(t){if("object"!=O(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=O(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==O(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function L(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 D(t){for(var e=1;arguments.length>e;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?L(Object(n),!0).forEach(function(e){P(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):L(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}const F="min_length",N="max_length";function q(t,e){return-1!==t.indexOf(e)}const j=function(t){return t.trim()},B=Object.prototype,z=B.hasOwnProperty,H=B.toString,U=Array.isArray||function(t){return"[object Array]"===H.call(t)},W=t=>"function"==typeof t,V=t=>t===Object(t)&&!U(t),G=t=>void 0===t,Q=t=>"[object String]"==H.call(t),Z=t=>Q(t)&&0===t.trim().length,J=t=>null===t,K=t=>G(t)||J(t),X=t=>"[object Number]"==H.call(t)&&t==t,Y=t=>"[object Boolean]"===H.call(t),tt=t=>t instanceof FormData;function et(t){return null===t||"object"!=typeof t}function nt(t,e){return{}.toString.call(t)===`[object ${e}]`}function it(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 ot(t,Error)}}function rt(t){return"u">typeof Event&&ot(t,Event)}function ot(t,e){try{return t instanceof e}catch(t){return!1}}function st(t,e,n,i,r){return e>n&&(i.warn("min cannot be greater than max."),e=n),X(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),st(null!=r?r:n,e,n,i))}var at=class{constructor(t){this.C={},this.I=t.I,this.R=st(t.bucketSize,0,100,t.A),this.$=st(t.refillRate,0,this.R,t.A),this.O=st(t.refillInterval,0,864e5,t.A)}F(t,e){const n=Math.floor((e-t.lastAccess)/this.O);n>0&&(t.tokens=Math.min(t.tokens+n*this.$,this.R),t.lastAccess=t.lastAccess+n*this.O)}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.R,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 lt="Mobile",ut="Tablet",ct="Android Tablet",dt="iPad",ht="Apple Watch",ft="Nintendo",vt="PlayStation",pt="Xbox",mt="Nokia",gt="Ouya",yt="Generic "+lt.toLowerCase(),bt="Generic "+ut.toLowerCase(),wt=new RegExp(pt,"i"),kt=new RegExp("PlayStation \\w+","i"),_t=new RegExp("Nintendo \\w+","i"),St=new RegExp("BlackBerry|PlayBook|BB10","i");new RegExp(ft,"i"),new RegExp(vt,"i"),new RegExp("Windows","i");function xt(t){return t?t.split("#")[0]:t}function Ct(t){try{return t()}catch(t){return}}let It,Mt,Tt,Rt;function Et(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(Rt&&At(n,r,Mt)&&At(i,o,Tt))return Rt;Mt=n?D({},n):void 0,Tt=i?D({},i):void 0,Rt={},null!==(e=It)&&void 0!==e||(It={});const s=(e,n)=>{for(const r of e){const e=n[r];if(!e)continue;const o=null==It?void 0:It[r];if(o){Rt[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){Rt[n]=e,It[r]=n;break}}}};return i&&s(o,i),n&&s(r,n),Rt}function At(t,e,n){return t&&n?e.length===Object.keys(n).length&&e.every(e=>t[e]===n[e]):t===n}const $t=/^([a-z][a-z0-9.+-]+):/i,Ot=["http","https","file","blob","app","capacitor","ionic","webpack","webpack-internal","ng"];function Pt(t){if(!t||"<anonymous>"===t)return!1;const e=$t.exec(t);return!e||Ot.includes(e[1].toLowerCase())}function Lt(t,e,n,i,r){const o={platform:t,filename:e,function:"<anonymous>"===n?"?":n,in_app:Pt(e)};return G(i)||(o.lineno=i),G(r)||(o.colno=r),o}const Dt=(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]},Ft=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,Nt=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,qt=/\((\S*)(?::(\d+))(?::(\d+))\)/,jt=(t,e)=>{const n=Ft.exec(t);if(n){const[,t,i,r]=n;return Lt(e,t,"?",+i,+r)}const i=Nt.exec(t);if(i){if(i[2]&&0===i[2].indexOf("eval")){const t=qt.exec(i[2]);t&&(i[2]=t[1],i[3]=t[2],i[4]=t[3])}const[t,n]=Dt(i[1]||"?",i[2]);return Lt(e,n,t,i[3]?+i[3]:void 0,i[4]?+i[4]:void 0)}},Bt=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,zt=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Ht=(t,e)=>{const n=Bt.exec(t);if(n){if(n[3]&&n[3].indexOf(" > eval")>-1){const t=zt.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]=Dt(i,t),Lt(e,t,i,n[4]?+n[4]:void 0,n[5]?+n[5]:void 0)}},Ut=/\(error: (.*)\)/;function Wt(t,e){return t.filename===e.filename&&t.function===e.function&&t.module===e.module&&t.lineno===e.lineno&&t.colno===e.colno}function Vt(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(!Wt(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 Gt(t,e){const n=e.start+e.length,i=Zt(t,e);i&&t.splice(n+i===t.length?n:e.start,i)}function Qt(t,e){let n=e.start;for(;n>0&&Wt(t[n-1],t[n-1+e.length]);)n--;return e.start-n}function Zt(t,e){const n=e.start+e.length;let i=n;for(;t.length>i&&Wt(t[i],t[i-e.length]);)i++;return i-n}function Jt(t,e){const n=e[0];let i=t.length-(n?Qt(t,n):0);for(const n of e)i-=Zt(t,n);return i}function Kt(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 Xt=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;const Yt=["fatal","error","warning","log","info","debug"];function te(t,e=40){const n=Object.keys(t);if(n.sort(),!n.length)return"[object has no keys]";for(let t=n.length;t>0;t--){const i=n.slice(0,t).join(", ");if(e>=i.length)return t===n.length?i:i.length>e?`${i.slice(0,e)}...`:i}return""}const ee="NativeGzipValidationError";let ne;const ie=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}(ee,`Native gzip produced invalid output: ${t}`)},re=(oe=A(function*(t,e){18>t.size&&ie("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])&&ie("invalid-header");const r=new DataView(yield t.slice(t.size-8).arrayBuffer());r.getUint32(0,!0)!==(t=>{const e=(()=>{if(ne)return ne;ne=[];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;ne[t]=e>>>0}return ne})();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("invalid-crc");const o=e.length>>>0;r.getUint32(4,!0)!==o&&ie("invalid-size")}),function(t,e){return oe.apply(this,arguments)});var oe;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.9.4",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=de.createLogger;function fe(t,e){if(!K(t))if(U(t))t.forEach(e);else if(tt(t))t.forEach((t,n)=>e(t,n));else for(const n in t)z.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=["localhost","127.0.0.1"],ye=t=>{const e=null==i?void 0:i.createElement("a");return G(e)?null:(e.href=t,e)};function be(e){var n;const i=null==t||null===(n=t.location)||void 0===n?void 0:n.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 Q(t)&&t?t:e}catch(t){return de.error("Error in get_current_url, falling back to window.location.href",t),e}}(e,i)}function we(t){return!!t&&1===t.nodeType}function ke(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function _e(t){return!!t&&11===t.nodeType&&we(t.host)}function Se(t){return t?j(t).split(/\s+/):[]}function xe(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 Se(e)}function Ce(t){let e="";return Le(t)&&!De(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 K(t)?null:j(t).split(/(\s+)/).filter(t=>Ue(t)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}(t.textContent))&&void 0!==n?n:"")}),j(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 Me=["a","button","form","input","select","textarea","label"];function Te(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}}function Re(t){const e=t.parentNode;return!(!e||!we(e))&&e}const Ee=[".ph-no-deadclick",".ph-no-capture"];const Ae=["","text","search","email","password","url","tel","number"];function $e(t){return!(!t||!we(t))&&(!!ke(t,"textarea")||(ke(t,"input")?q(Ae,(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 Oe=t=>!t||ke(t,"html")||!we(t),Pe=(e,n)=>{if(!t||Oe(e))return{parentIsUsefulElement:!1,targetElementList:[]};let i=!1;const r=[e];let o=e;for(;o.parentNode&&!ke(o,"body");){if(_e(o.parentNode)){r.push(o.parentNode.host),o=o.parentNode.host;continue}const e=Re(o);if(!e)break;if(n||Me.indexOf(e.tagName.toLowerCase())>-1)i=!0;else try{const n=t.getComputedStyle(e);n&&"pointer"===n.getPropertyValue("cursor")&&(i=!0)}catch(t){}r.push(e),o=e}return{parentIsUsefulElement:i,targetElementList:r}};function Le(t){const e=new Set;let n=0;for(let i=t;i.parentNode&&!ke(i,"body");i=i.parentNode){if(n++>=1e3||e.has(i))return!1;e.add(i);const t=xe(i);if(q(t,"ph-sensitive")||q(t,"ph-no-capture"))return!1}if(q(xe(t),"ph-include"))return!0;const i=t.type||"";if(Q(i))switch(i.toLowerCase()){case"hidden":case"password":return!1}const r=t.name||t.id||"";return!Q(r)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(r.replace(/[^a-zA-Z0-9]/g,""))}function De(t){return!!(ke(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||ke(t,"select")||ke(t,"textarea")||"true"===t.getAttribute("contenteditable"))}const Fe=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}))$"),Ne=/(^|[^0-9A-Za-z_])([0-9][0-9 -]*[0-9])(?=$|[^0-9A-Za-z_])/g,qe=[16,15,14,13],je=new RegExp("^(\\d{3}-?\\d{2}-?\\d{4})$"),Be=new RegExp("(^|[^0-9])((?!000|666)[0-9]{3}-?(?!00)[0-9]{2}-?(?!0000)[0-9]{4})(?=$|([^0-9]))","g"),ze=/[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 Ue(t,e=!0){if(K(t))return!1;if(Q(t)){if(t=j(t),e?Fe.test((t||"").replace(/[- ]/g,"")):function(t){let e;for(Ne.lastIndex=0;e=Ne.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 qe){const i=t+e;if(n.length>=i){const e=n.slice(t,i);if(Fe.test(e)&&He(e))return!0}}}return!1}(t))return!1;if(e?je.test(t):function(t){let e;for(Be.lastIndex=0;e=Be.exec(t);){const t=e[1],n=e[3];if(!(t&&n&&ze.test(t)&&ze.test(n)))return!0}return!1}(t))return!1}return!0}function We(t){let e=Ce(t);return e=`${e} ${Ve(t)}`.trim(),Ue(e)?e:""}function Ve(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=Ce(t);e=`${e} ${n}`.trim(),t.childNodes&&t.childNodes.length&&(e=`${e} ${Ve(t)}`.trim())}catch(t){de.error("[AutoCapture]",t)}}),e}function Ge(t){return t.replace(/"|\\"/g,'\\"')}function Qe(t){const e=t.attr__class;if(e)return U(e)?e:Se(e)}const Ze=1e6;function Je(t){var e;return Math.min(Ze,null!==(e=t.payloadSizeLimitBytes)&&void 0!==e?e:Ze)}const Ke={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:Ze,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},Xe=["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"],Ye=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],tn=["auth","token","secret","session","api-key","apikey","api_key","credential","password","passwd","cookie","csrf","xsrf"],en=t=>{K(t)||fe(Object.keys(t),e=>{(t=>{const e=t.toLowerCase();return Xe.includes(e)||tn.some(t=>e.includes(t))})(e)&&(t[e]="redacted")})},nn=["/s/","/e/","/i/"];function rn(t,e,n,i){if(K(t))return t;let r=(null==e?void 0:e["content-length"])||function(t){return new Blob([t]).size}(t);return Q(r)&&(r=parseInt(r)),r>n?`[SessionRecording] ${i} body too large to record (${r} bytes)`:t}function on(t,e){if(K(t))return t;let n=t;return Ue(n,!1)||(n="[SessionRecording] "+e+" body redacted"),fe(Ye,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 sn=new WeakSet,an="disabled",ln="sampled",un="active",cn="buffering",dn="paused",hn="rrweb_error",fn="trigger_activated",vn="trigger_pending",pn="trigger_disabled";function mn(t,e,n,i,r,o){return 0===e?pn:(null==t?void 0:t.get_property(n?i+n:r))===o?fn:vn}function gn(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 yn(t){return t.includes("trigger_activated")?fn:t.includes("trigger_pending")?vn:pn}function bn(t){const e=new Set(t);switch(e.delete(pn),e.size){case 0:return pn;case 1:return Array.from(e)[0];default:return vn}}var wn=class{constructor(t){this.q=t}triggerStatus(t){return yn(this.q.map(e=>e.triggerStatus(t)))}triggerStatusNoSideEffects(t){return yn(this.q.map(e=>e.triggerStatusNoSideEffects(t)))}stop(){this.q.forEach(t=>t.stop())}},kn=class{constructor(t){this.q=t}triggerStatus(t){return bn(this.q.map(e=>e.triggerStatus(t)))}triggerStatusNoSideEffects(t){return bn(this.q.map(e=>e.triggerStatusNoSideEffects(t)))}stop(){this.q.forEach(t=>t.stop())}},_n=class{triggerStatus(){return this.triggerStatusNoSideEffects()}triggerStatusNoSideEffects(){return fn}stop(){}};const Sn=t=>"sessionRecording"in t;var xn=class{constructor(t,e){this._instance=t,this.j=[],this.B=[],this.H=new Map,this.U=new Map,this.W="",this.urlBlocked=!1,this.V=e}onConfig(t){var e,n;this.j=(Sn(t)?V(t.sessionRecording)?null===(e=t.sessionRecording)||void 0===e?void 0:e.urlTriggers:[]:null==t?void 0:t.urlTriggers)||[],this.B=(Sn(t)?V(t.sessionRecording)?null===(n=t.sessionRecording)||void 0===n?void 0:n.urlBlocklist:[]:null==t?void 0:t.urlBlocklist)||[],this.G()}G(){this.H.clear(),this.U.clear();for(const t of this.j)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 trigger regex pattern:",t.url,e)}for(const t of this.B)if("regex"===t.matching&&!this.U.has(t.url))try{this.U.set(t.url,new RegExp(t.url))}catch(e){de.error("Invalid URL blocklist regex pattern:",t.url,e)}}onRemoteConfig(t){this.onConfig(t)}Z(t){return mn(this._instance,this.j.length,this.V,g,v,t)}triggerStatus(t){const e=this.triggerStatusNoSideEffects(t);return this._instance.register_for_session({[I]:e}),e}triggerStatusNoSideEffects(t){return this.Z(t)}isCurrentUrlBlocked(){const t=be(this._instance);if(!t)return!1;try{return gn(t,this.B,this.U)}catch(t){return!0}}checkUrlBlocklist(t,e){const n=be(this._instance);if(!n)return;if(n===this.W)return;this.W=n;const i=this.urlBlocked,r=gn(n,this.B,this.U);i&&r||(r&&!i?t():!r&&i&&e())}checkUrlTriggerConditions(t,e,n,i){const r=be(this._instance);if(!r)return;if(r===this.W)return;this.W=r;const o=this.urlBlocked,s=gn(r,this.B,this.U);s&&!o?t():!s&&o&&e();const a=this.Z(i)===fn,l=gn(r,this.j,this.H);!a&&l&&n("url",r)}stop(){this.W=""}},Cn=class{constructor(t){this._instance=t,this.linkedFlag=null,this.linkedFlagSeen=!1,this.J=()=>{}}triggerStatus(){const t=this.triggerStatusNoSideEffects();return this._instance.register_for_session({[k]:t}),t}triggerStatusNoSideEffects(){let t=vn;return K(this.linkedFlag)&&(t=pn),this.linkedFlagSeen&&(t=fn),t}onConfig(t,e){var n;if(this.linkedFlag=(Sn(t)?V(t.sessionRecording)?null===(n=t.sessionRecording)||void 0===n?void 0:n.linkedFlag:null:null==t?void 0:t.linkedFlag)||null,!K(this.linkedFlag)&&!this.linkedFlagSeen){const t=Q(this.linkedFlag)?this.linkedFlag:this.linkedFlag.flag,n=Q(this.linkedFlag)?null:this.linkedFlag.variant;this.J=this._instance.onFeatureFlags((i,r)=>{let o=!1;if(V(r)&&t in r){const e=r[t];o=Y(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.J()}},In=class{constructor(t,e){this._instance=t,this.K=[],this.V=e}onConfig(t){var e;this.K=(Sn(t)?V(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 mn(this._instance,this.K.length,this.V,m,p,t)}triggerStatus(t){const e=this.triggerStatusNoSideEffects(t);return this._instance.register_for_session({[w]:e}),e}triggerStatusNoSideEffects(t){return this.X(t)}checkEventTriggerConditions(t,e,n){if(0===this.K.length)return;const i=this.X(n)===fn,r=this.K.includes(t);!i&&r&&e("event",t)}stop(){}},Mn=class{constructor(t,e,n){if(this._instance=t,this.group=e,this.Y=new xn(t,e.id),this.tt=new In(t,e.id),this.et=new Cn(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.Y.onConfig(i),this.tt.onConfig(i),this.et.onConfig(i,n);const r=[this.tt,this.Y,this.et];this.nt="any"===e.conditions.matchType?new wn(r):new kn(r)}else this.nt=new _n}triggerStatus(t){return this.nt.triggerStatus(t)}triggerStatusNoSideEffects(t){return this.nt.triggerStatusNoSideEffects(t)}getPendingTriggerConditions(t){return"trigger_pending"!==this.triggerStatusNoSideEffects(t)?[]:[{label:"URL condition not matched",status:this.Y.triggerStatusNoSideEffects(t)},{label:"event condition not matched",status:this.tt.triggerStatusNoSideEffects(t)},{label:"linked flag condition not matched",status:this.et.triggerStatusNoSideEffects()}].filter(({status:t})=>t===vn).map(({label:t})=>t)}checkEventTriggerConditions(t,e,n){this.tt.checkEventTriggerConditions(t,e,n)}checkUrlTriggerConditions(t,e,n,i){this.Y.checkUrlTriggerConditions(t,e,n,i)}activateTrigger(t,e){var n;const i="url"===t?g+this.group.id:m+this.group.id;null===(n=this._instance.persistence)||void 0===n||n.register({[i]:e})}stop(){this.Y.stop(),this.tt.stop(),this.et.stop()}};function Tn(t){if(t.rrwebError)return hn;if(!t.receivedFlags)return cn;if(!t.isRecordingEnabled)return an;if(t.urlTriggerMatching.urlBlocked)return dn;const e=!0===t.isSampled,n=new wn([t.eventTriggerMatching,t.urlTriggerMatching,t.linkedFlagMatching]).triggerStatus(t.sessionId);return e?ln:"trigger_activated"===n?un:"trigger_pending"===n?cn:!1===t.isSampled?an:un}function Rn(t){if(t.rrwebError)return hn;if(!t.receivedFlags)return cn;if(!t.isRecordingEnabled)return an;if(t.urlTriggerMatching.urlBlocked)return dn;const e=new kn([t.eventTriggerMatching,t.urlTriggerMatching,t.linkedFlagMatching]).triggerStatus(t.sessionId),n=e!==pn,i=Y(t.isSampled);return n&&"trigger_pending"===e?cn:n&&"trigger_disabled"===e||i&&!t.isSampled?an:!0===t.isSampled?ln:un}function En(){const t=[];return function(e,n){if(V(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 An(t){try{const e=JSON.stringify(t,En());return e?new Blob([e]).size:0}catch(t){return-1}}function $n(t){if(J(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)||J(i)?4:$n(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+$n(r))}return n}default:return 0}}function On(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[On({size:n.reduce((t,e)=>t+e,0),data:t.data.slice(0,e),sizes:n,sessionId:t.sessionId,windowId:t.windowId}),On({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 Pn=Uint8Array,Ln=Uint16Array,Dn=Uint32Array,Fn=new Pn([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]),Nn=new Pn([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]),qn=new Pn([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),jn=function(t,e){for(var n=new Ln(31),i=0;31>i;++i)n[i]=e+=1<<t[i-1];var r=new Dn(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]},Bn=jn(Fn,2),zn=Bn[1];Bn[0][28]=258,zn[258]=28;for(var Hn=jn(Nn,0)[1],Un=new Ln(32768),Wn=0;32768>Wn;++Wn){var Vn=(43690&Wn)>>>1|(21845&Wn)<<1;Un[Wn]=((65280&(Vn=(61680&(Vn=(52428&Vn)>>>2|(13107&Vn)<<2))>>>4|(3855&Vn)<<4))>>>8|(255&Vn)<<8)>>>1}var Gn=function(t,e,n){for(var i=t.length,r=0,o=new Ln(e);i>r;++r)++o[t[r]-1];var s,a=new Ln(e);for(r=0;e>r;++r)a[r]=a[r-1]+o[r-1]<<1;if(n){s=new Ln(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[Un[d]>>>l]=u}else for(s=new Ln(i),r=0;i>r;++r)s[r]=Un[a[t[r]-1]++]>>>15-t[r];return s},Qn=new Pn(288);for(Wn=0;144>Wn;++Wn)Qn[Wn]=8;for(Wn=144;256>Wn;++Wn)Qn[Wn]=9;for(Wn=256;280>Wn;++Wn)Qn[Wn]=7;for(Wn=280;288>Wn;++Wn)Qn[Wn]=8;var Zn=new Pn(32);for(Wn=0;32>Wn;++Wn)Zn[Wn]=5;var Jn=Gn(Qn,9,0),Kn=Gn(Zn,5,0),Xn=function(t){return(t/8|0)+(7&t&&1)},Yn=function(t,e,n){(null==e||0>e)&&(e=0),(null==n||n>t.length)&&(n=t.length);var i=new(t instanceof Ln?Ln:t instanceof Dn?Dn:Pn)(n-e);return i.set(t.subarray(e,n)),i},ti=function(t,e,n){var i=e/8|0;t[i]|=n<<=7&e,t[i+1]|=n>>>8},ei=function(t,e,n){var i=e/8|0;t[i]|=n<<=7&e,t[i+1]|=n>>>8,t[i+2]|=n>>>16},ni=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 Pn(0),0];if(1==r){var s=new Pn(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 Ln(h+1),v=ii(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 Pn(f),v]},ii=function(t,e,n){return-1==t.s?Math.max(ii(t.l,e,n+1),ii(t.r,e,n+1)):e[t.s]=n},ri=function(t){for(var e=t.length;e&&!t[--e];);for(var n=new Ln(++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]},oi=function(t,e){for(var n=0,i=0;e.length>i;++i)n+=t[i]*e[i];return n},si=function(t,e,n){var i=n.length,r=Xn(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)},ai=function(t,e,n,i,r,o,s,a,l,u,c){ti(e,c++,n),++r[256];for(var d=ni(r,15),h=d[0],f=d[1],v=ni(o,15),p=v[0],m=v[1],g=ri(h),y=g[0],b=g[1],w=ri(p),k=w[0],_=w[1],S=new Ln(19),x=0;y.length>x;++x)S[31&y[x]]++;for(x=0;k.length>x;++x)S[31&k[x]]++;for(var C=ni(S,7),I=C[0],M=C[1],T=19;T>4&&!I[qn[T-1]];--T);var R,E,A,O,P=u+5<<3,L=oi(r,Qn)+oi(o,Zn)+s,D=oi(r,h)+oi(o,p)+s+14+3*T+oi(S,I)+(2*S[16]+3*S[17]+7*S[18]);if(L>=P&&D>=P)return si(e,c,t.subarray(l,l+u));if(ti(e,c,1+(L>D)),c+=2,L>D){R=Gn(h,f,0),E=h,A=Gn(p,m,0),O=p;var F=Gn(I,M,0);for(ti(e,c,b-257),ti(e,c+5,_-1),ti(e,c+10,T-4),c+=14,x=0;T>x;++x)ti(e,c+3*x,I[qn[x]]);c+=3*T;for(var N=[y,k],q=0;2>q;++q){var j=N[q];for(x=0;j.length>x;++x)ti(e,c,F[B=31&j[x]]),c+=I[B],B>15&&(ti(e,c,j[x]>>>5&127),c+=j[x]>>>12)}}else R=Jn,E=Qn,A=Kn,O=Zn;for(x=0;a>x;++x)if(i[x]>255){var B;ei(e,c,R[257+(B=i[x]>>>18&31)]),c+=E[B+257],B>7&&(ti(e,c,i[x]>>>23&31),c+=Fn[B]);var z=31&i[x];ei(e,c,A[z]),c+=O[z],z>3&&(ei(e,c,i[x]>>>5&8191),c+=Nn[z])}else ei(e,c,R[i[x]]),c+=E[i[x]];return ei(e,c,R[256]),c+E[256]},li=new Dn([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),ui=new Pn(0),ci=function(){for(var t=new Dn(256),e=0;256>e;++e){for(var n=e,i=9;--i;)n=(1&n&&3988292384)^n>>>1;t[e]=n}return t}(),di=function(t,e,n){for(;n;++e)t[e]=n,n>>>=8};function hi(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=ci[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 Pn(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=si(l,u,t.subarray(c,d)):(l[c]=o,u=si(l,u,t.subarray(c,s)))}else{for(var h=li[e-1],f=h>>>13,v=8191&h,p=(1<<n)-1,m=new Ln(32768),g=new Ln(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 Dn(25e3),_=new Ln(288),S=new Ln(32),x=0,C=0,I=(c=0,0),M=0,T=0;s>c;++c){var R=w(c),E=32767&c,A=g[R];if(m[E]=A,g[R]=E,c>=M){var O=s-c;if((x>7e3||I>24576)&&O>423){u=ai(t,l,0,k,_,S,C,I,T,c-T,u),I=x=C=0,T=c;for(var P=0;286>P;++P)_[P]=0;for(P=0;30>P;++P)S[P]=0}var L=2,D=0,F=v,N=E-A&32767;if(O>2&&R==w(c-N))for(var q=Math.min(f,O)-1,j=Math.min(32767,c),B=Math.min(258,O);j>=N&&--F&&E!=A;){if(t[c+L]==t[c+L-N]){for(var z=0;B>z&&t[c+z]==t[c+z-N];++z);if(z>L){if(L=z,D=N,z>q)break;var H=Math.min(N,z-2),U=0;for(P=0;H>P;++P){var W=c-N+P+32768&32767,V=W-m[W]+32768&32767;V>U&&(U=V,A=W)}}}N+=(E=A)-(A=m[E])+32768&32767}if(D){k[I++]=268435456|zn[L]<<18|Hn[D];var G=31&zn[L],Q=31&Hn[D];C+=Fn[G]+Nn[Q],++_[257+G],++S[Q],M=c+L,++x}else k[I++]=t[c],++_[t[c]]}}u=ai(t,l,o,k,_,S,C,I,T,c-T,u),o||(u=si(l,u,ui))}return Yn(a,0,i+Xn(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&&di(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),di(u,c-8,n.d()),di(u,c-4,i),u}function fi(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 vi=class{constructor(t,e={}){var n,i,r,o;this._rrweb=t,this.it=e,this.rt={},this.ot=Date.now(),this.st=-1/0,this.ut=()=>{const t=Date.now(),e=t-this.ot;e>0?(this.ct=Math.min(this.dt,this.ct+e/1e3*this.ht),this.ot=t):this.ot=t},this.ft=t=>{if(!this.rt[t]){var e,n;this.rt[t]=!0;const i=this.vt(t);null===(e=(n=this.it).onBlockedNode)||void 0===e||e.call(n,t,i)}},this.yt=t=>{const e=this.vt(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.vt=t=>this._rrweb.mirror.getNode(t),this.bt=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.bt(e);if(e.attributes){const t=e.attributes.length;e.attributes=e.attributes.filter(t=>{const[e]=this.yt(t.id);return!this.wt.consumeRateLimit(e)&&t});const n=t-e.attributes.length;var i,r;n>0&&(null===(i=(r=this.it).onDroppedAttributeMutations)||void 0===i||i.call(r,n))}const o=this.bt(e);if(0===o&&n!==o)return;if(this.kt)return t;this.ut();const s=$n(t);var a,l;return s>this.ct?(null===(a=(l=this.it).onDroppedOversizedMutation)||void 0===a||a.call(l,s),void this._t()):(this.ct-=s,t)},this._t=()=>{if(this.St)return;const t=Math.max(0,this.xt-(Date.now()-this.st));this.St=setTimeout(()=>{var t,e;this.St=void 0,this.st=Date.now(),null===(t=(e=this.it).requestFullSnapshot)||void 0===t||t.call(e)},t)},this.wt=new at({bucketSize:null!==(n=this.it.bucketSize)&&void 0!==n?n:100,refillRate:null!==(i=this.it.refillRate)&&void 0!==i?i:10,refillInterval:1e3,I:this.ft,A:de}),this.dt=null!==(r=this.it.bytesBucketSize)&&void 0!==r?r:0,this.ht=null!==(o=this.it.bytesRefillRate)&&void 0!==o?o:25600,this.kt=!Number.isFinite(this.dt)||0>=this.dt,this.ct=this.dt;const s=this.it.resyncIntervalMs;this.xt=X(s)&&Number.isFinite(s)&&s>0?s:3e5}reset(){this.rt={},this.St&&(clearTimeout(this.St),this.St=void 0),this.st=Date.now()}stop(){this.wt.stop(),this.reset(),this.ct=this.dt,this.ot=Date.now(),this.st=-1/0}};Math.trunc||(Math.trunc=function(t){return 0>t?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return X(t)&&isFinite(t)&&Math.floor(t)===t});var pi=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}},mi=class{generate(){const t=this.generateOrAbort();if(!G(t))return t;{this.Ct=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 X(t)&&isFinite(t)?Math.min(Math.max(Math.floor(t),0),0xffffffffffff):0})();if(t>this.Ct)this.Ct=t,this.It();else{if(this.Ct>=t+1e4)return;this.Mt++,this.Mt>4398046511103&&(this.Ct++,this.It())}return pi.fromFieldsV7(this.Ct,Math.trunc(this.Mt/Math.pow(2,30)),this.Mt&Math.pow(2,30)-1,this.Tt.nextUint32())}It(){this.Mt=1024*this.Tt.nextUint32()+(1023&this.Tt.nextUint32())}constructor(){this.Ct=0,this.Mt=0,this.Tt=new yi}};let gi=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};t&&!G(t.crypto)&&crypto.getRandomValues&&(gi=t=>crypto.getRandomValues(t));var yi=class{nextUint32(){return this.Rt.length>this.Et||(gi(this.Rt),this.Et=0),this.Rt[this.Et++]}constructor(){this.Rt=new Uint32Array(8),this.Et=1/0}};let bi;const wi=()=>ki().toString(),ki=()=>(bi||(bi=new mi)).generate();let _i=null;const Si={At(){if(!J(_i))return _i;let e=!0;if(G(t))e=!1;else try{const t="__mplssupport__";Si.$t(t,"xyz"),'"xyz"'!==Si.Ot(t)&&(e=!1),Si.Pt(t)}catch(t){e=!1}return e||de.error("localStorage unsupported; falling back to cookie store"),_i=e,e},Lt(t){de.error("localStorage error: "+t)},Ot(e){try{return null==t?void 0:t.localStorage.getItem(e)}catch(t){Si.Lt(t)}return null},Dt(t){try{return JSON.parse(Si.Ot(t))||{}}catch(t){}return null},$t(e,n){try{return null==t||t.localStorage.setItem(e,JSON.stringify(n)),!0}catch(t){Si.Lt(t)}return!1},Pt(e){try{null==t||t.localStorage.removeItem(e)}catch(t){Si.Lt(t)}}};let xi=null;const Ci={At(){if(!J(xi))return xi;if(xi=!0,G(t))xi=!1;else try{const t="__support__";Ci.$t(t,"xyz"),'"xyz"'!==Ci.Ot(t)&&(xi=!1),Ci.Pt(t)}catch(t){xi=!1}return xi},Lt(t){de.error("sessionStorage error: ",t)},Ot(e){try{return null==t?void 0:t.sessionStorage.getItem(e)}catch(t){Ci.Lt(t)}return null},Dt(t){try{return JSON.parse(Ci.Ot(t))||null}catch(t){}return null},$t(e,n){try{return null==t||t.sessionStorage.setItem(e,JSON.stringify(n)),!0}catch(t){Ci.Lt(t)}return!1},Pt(e){try{null==t||t.sessionStorage.removeItem(e)}catch(t){Ci.Lt(t)}}};ue.DEBUG=!1,ue.LIB_VERSION="1.438.9",ue.LIB_NAME="web";var Ii=ue,Mi=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.Ft=t.get_property.bind(t),this.Nt=t.persistence.set_property.bind(t.persistence)}trackSize(t,e){this.Nt(y,{sessionId:t,size:this.currentTrackedSize(t)+e})}currentTrackedSize(t){const e=this.Ft(y);return V(n=e)&&Q(n.sessionId)&&X(n.size)&&e.sessionId===t?e.size:0;var n}};function Ti(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<st(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 Ai({event:t,survey:e,responses:n={},submissionId:i,completed:r,surveyLanguage:o,questionSnapshots:s}){return D(D(D(D({},!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)}),D(D({$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=>!K(t))}function Oi(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 Pi(t){return"string"==typeof t&&t.trim()?t.trim():null}function Li(t){return t.toLowerCase()}function Di(t,e,n){if(!t||!e)return null;const i=Li(e),r=Object.keys(t).find(t=>Li(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=>Li(t)===r);if(o)return null==n||n.debug(`Found base language translation match: ${o} (from ${e})`),o}return null}const Fi=["thankYouMessageHeader","thankYouMessageDescription","thankYouMessageCloseButtonText","introScreenHeader","introScreenDescription","introScreenButtonText","submitButtonText","backButtonText"];function Ni(t,e,n){var i;const r=Di(t.translations,e,n),o=D({},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=D({},o.appearance);for(const n of Fi){const i=e[n];G(i)||(t[n]=i,s=!0)}o.appearance=t}else(function(t){return Fi.some(e=>!G(t[e]))})(e)&&(s=!0)}const l=t.questions.map(t=>function(t,e,n){var i;const r=Di(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=D({},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 qi(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 ji=(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}},Bi=t=>t.toLowerCase(),zi={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=>ji(e,t))),not_regex:(t,e)=>e.every(e=>t.every(t=>!ji(e,t))),icontains:(t,e)=>e.map(Bi).some(e=>t.map(Bi).some(t=>e.includes(t))),not_icontains:(t,e)=>e.map(Bi).every(e=>t.map(Bi).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))})},Hi=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},Ui=new Set(["is_not","not_icontains","not_regex"]);function Wi(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)||J(r))return Ui.has(o);const s=zi[o];return!!s&&!G(t.value)&&!J(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 Gi(t,e){return e?t:"!"+t}function Qi(t,e){return t===e||t!=="!"+e&&null}var Zi=class{constructor(t,e,n,i,r,o,s){this._instance=t,this.Y=e,this.tt=n,this.et=i,this.qt=r,this.jt=o,this.Bt=s,this.zt=null,this.Ht=Rn}onRemoteConfig(t){this.zt=X(t.sampleRate)?t.sampleRate:null,"any"===t.triggerMatchType?(this.Ut=new wn([this.tt,this.Y]),this.Ht=Tn):(this.Ut=new kn([this.tt,this.Y]),this.Ht=Rn),this._instance.register_for_session({[x]:t.triggerMatchType}),this.Y.onConfig(t),this.tt.onConfig(t),this.et.onConfig(t,(t,e)=>{this.qt("linked_flag_matched",{flag:t,variant:e}),this.Bt()})}getStatus(t){return this.Ht({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 X(n)?n:null}checkUrlTriggers(t,e,n,i){this.Y.checkUrlTriggerConditions(e,n,i,t)}setupEventTriggerListeners(t,e,n){if(0!==this.tt.K.length&&K(this.Wt))return this.Wt=t(t=>{try{this.tt.checkEventTriggerConditions(t.event,n,e)}catch(t){Vi.error("Could not activate event trigger",t)}}),this.Wt}makeSamplingDecisions(t){var e;const n=this.zt;var i,r;if(!X(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(f),s=this._instance.get_property("$replay_sample_rate"),a=Qi(o,t),l=X(s)&&s!==n,u=G(s)&&o===t,c=l||u||!Y(a),d=c?Ti(t,n):a;c&&(d?this.qt("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:Gi(t,d),$replay_sample_rate:J(s)&&o===t?null:n})}ensureSamplingDecision(t){if(!X(this.zt))return;const e=this._instance.get_property(f);Y(Qi(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.Ut)||void 0===e?void 0:e.triggerStatus(t))===vn}getPendingTriggerConditions(t){return[{label:"URL condition not matched",status:this.Y.triggerStatusNoSideEffects(t)},{label:"event condition not matched",status:this.tt.triggerStatusNoSideEffects(t)},{label:"linked flag condition not matched",status:this.et.triggerStatusNoSideEffects()}].filter(({status:t})=>t===vn).map(({label:t})=>t)}stop(){var t;null===(t=this.Wt)||void 0===t||t.call(this),this.Wt=void 0,this.tt.stop(),this.Y.stop(),this.et.stop()}},Ji=class{constructor(t,e,n,i,r){this._instance=t,this.Y=e,this.qt=n,this.Vt=i,this.Bt=r,this.Gt=[],this.Qt=new Map,this.Zt=!1}onRemoteConfig(t){t.triggerGroups&&0!==t.triggerGroups.length?(this.Jt(t.triggerGroups),this._instance.register_for_session({[x]:"v2_trigger_groups",[C]:t.triggerGroups.length}),this.Y.onConfig(t)):Vi.warn("[V2Strategy] No trigger groups configured")}getStatus(t){return function(t){if(t.rrwebError)return hn;if(!t.receivedFlags)return cn;if(!t.isRecordingEnabled)return an;if(t.urlTriggerMatching.urlBlocked)return dn;const e=t.triggerGroupMatchers,n=t.triggerGroupSamplingResults;if(0===e.length)return an;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?ln:i?cn:an}({receivedFlags:!0,isRecordingEnabled:!0,isSampled:t.isSampled,rrwebError:t.rrwebError,urlTriggerMatching:t.urlTriggerMatching,eventTriggerMatching:t.eventTriggerMatching,linkedFlagMatching:t.linkedFlagMatching,sessionId:t.sessionId,triggerGroupMatchers:this.Gt,triggerGroupSamplingResults:this.Qt,minimumDuration:this.getMinimumDuration(t.sessionId)})}getMinimumDuration(t){let e=null;for(const n of this.Gt)if("trigger_activated"===n.triggerStatus(t)){const t=n.group.minDurationMs;X(t)&&(J(e)||e>t)&&(e=t)}return e}checkUrlTriggers(t,e,n,i){this.Y.checkUrlBlocklist(e,n);for(const i of this.Gt)i.checkUrlTriggerConditions(e,n,e=>{this.Kt(i,void 0)&&(i.activateTrigger(e,t),this.updateActiveTriggers(t),this.Bt(e))},t)}setupEventTriggerListeners(t,e,n){return this.Wt=t(t=>{var n;if(this.Zt)return Vi.info("[SessionRecorder] Stopping trigger checks - initial buffer flushed"),null===(n=this.Wt)||void 0===n||n.call(this),void(this.Wt=void 0);try{for(const n of this.Gt)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(l);r.some(e=>!e.properties||0===e.properties.length||Wi(e.properties,t.properties,o))&&(n.activateTrigger(i,e),this.updateActiveTriggers(e),this.Bt(i))},e)}catch(t){Vi.error("Could not activate event trigger for trigger groups",t)}}),this.Wt}makeSamplingDecisions(t){for(const n of this.Gt){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(V(a)){const e=a.sessionId,n=a.sampleRate,i=a.sampled;u="string"==typeof e&&e!==t,c=X(n)&&n!==o,l=e===t&&X(n)&&n===o&&Y(i)?i:null}else l=a===t||null,u="string"==typeof a&&a!==t,d=a===t;const h=u||c||d||!Y(l),f=h?Ti(t+r,o):l;h&&this.Vt("triggerGroupSamplingDecisionMade",{group_id:r,group_name:i.name,sampleRate:o,isSampled:f}),this.Qt.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.Zt=!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.Gt){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.Gt){const i=n.group,r=i.id,o="trigger_activated"===n.triggerStatus(t),s=!0===this.Qt.get(r);o&&e.push({id:r,name:i.name,matched:!0,sampled:s})}this._instance.register_for_session({[_]:e})}hasPendingTriggers(t){for(const e of this.Gt)if("trigger_pending"===e.triggerStatus(t))return!0;return!1}getPendingTriggerConditions(t){return this.Gt.flatMap(e=>"trigger_pending"!==e.triggerStatusNoSideEffects(t)?[]:e.getPendingTriggerConditions(t).map(t=>`trigger group "${e.group.name}": ${t}`))}stop(){var t;null===(t=this.Wt)||void 0===t||t.call(this),this.Wt=void 0,this.Gt.forEach(t=>t.stop()),this.Gt=[],this.Qt.clear(),this.Y.stop()}Kt(t,e){const n=t.group.conditions.properties;return!n||0===n.length||Wi(n,e,this._instance.get_property(l))}Jt(t){this.Gt.forEach(t=>t.stop()),this.Gt=[],this.Qt.clear();for(const e of t){const t=new Mn(this._instance,e,(t,n)=>{this.qt("linked_flag_matched",{flag:t,variant:n,group_id:e.id,group_name:e.name}),this.Bt()});this.Gt.push(t)}}};const Ki=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","oppref","irclid","_kx"],Xi=1e5,Yi=/^[A-Za-z0-9]*[A-Za-z][A-Za-z0-9]*$/,tr=[],er=()=>!1,nr="@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(" "),ir="Action BorrowAction ReadAction SearchAction SeekToAction SolveMathAction WatchAction".split(" "),rr="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(" "),or="Accommodation AdministrativeArea Country Place State".split(" "),sr={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:ir,publisher:rr},Event:{startDate:!0,endDate:!0,previousStartDate:!0,aggregateRating:["AggregateRating"],offers:["AggregateOffer","Offer"]},ItemList:{itemListElement:["ListItem"]},ListItem:{item:tr},Offer:{seller:rr},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:rr,offers:["Offer","AggregateOffer"],aggregateRating:["AggregateRating"]},Service:{name:!0,serviceType:!0,category:!0,provider:rr,areaServed:or,offers:["AggregateOffer","Offer"],aggregateRating:["AggregateRating"]},OfferCatalog:{name:!0,itemListElement:tr}},ar=[["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(" "),sr.CreativeWork],["BroadcastEvent BusinessEvent EducationEvent Festival MusicEvent SportsEvent TheaterEvent".split(" "),sr.Event],[rr,sr.Organization],[or,sr.Place],["Car IndividualProduct ProductGroup ProductModel".split(" "),sr.Product]];function lr(t,e){return z.call(t,e)?t[e]:void 0}function ur(t){const e=typeof t;return J(t)||"string"===e||"number"===e||"boolean"===e}function cr(t,e){return e&&function(t){return Q(t)&&/^(https?:\/\/|\/|\.\.?\/)/i.test(t.trim())}(t)?e(t.trim())||void 0:t}function dr(t,e){return U(t)&&t.every(ur)?t.map(t=>cr(t,e)).filter(t=>!G(t)):ur(t)?cr(t,e):void 0}function hr(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 fr(t){if(z.call(sr,t))return sr[t];for(const[e,n]of ar)if(e.includes(t))return n}function vr(t,e,n){Object.defineProperty(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0})}function pr(t,e,n,i){if(U(t)){const r=t.map(t=>pr(t,e,n,i)).filter(t=>!G(t));return r.length?r:void 0}return mr(t,e,n,i)||void 0}function mr(t,e,n,i){if(!V(t)||!function(t){return t.remainingNodes?(t.remainingNodes--,!0):(t.exceeded=!0,!1)}(n))return null;const r=lr(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&&Yi.test(n)&&!e.has(n)&&(e.add(n),i.push(n),20===i.length))break}return i}(r),s=o.filter(t=>!!fr(t)&&(!i||!i.length||i.includes(t))),a={};for(const i of nr){const s="@type"===i?o.length?"string"==typeof r?o[0]:o:void 0:"@id"===i?hr(lr(t,i),e):dr(lr(t,i),n.maskUrl);G(s)||vr(a,i,s)}for(const i of s){const r=fr(i);for(const i of Object.keys(r)){const o=lr(t,i),s=r[i];if(!0===s){const t=dr(o,n.maskUrl);G(t)||vr(a,i,t)}else{const t=pr(o,e,n,s);G(t)||vr(a,i,t)}}}const l=pr(lr(t,"@graph"),e,n);return G(l)||vr(a,"@graph",l),Object.keys(a).length?a:null}function gr(t,e,n){if(!V(t))return null;const i=lr(t,"@context");if("string"!=typeof i||!/^https?:\/\/schema\.org\/?$/.test(i))return null;const r=mr(t,e,n);return r?D({"@context":"https://schema.org"},r):null}function yr(t){var e;return"SCRIPT"===t.nodeName&&"application/ld+json"===(null===(e=t.getAttribute("type"))||void 0===e?void 0:e.trim().toLowerCase())}function br(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 wr(t,e,n){for(let i=t;i;){if(br(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 kr(t){return yr(t)?[t]:t.nodeType!==t.ELEMENT_NODE?[]:Array.from(t.querySelectorAll("script")).filter(yr)}function _r(t){return V(t)?t.network_timing:t}const Sr=he("[SessionRecording]"),xr=[1,2,3,4,5,6,7,12],Cr=t=>({rrwebMethod:t,enqueuedAt:Date.now(),attempt:1});function Ir(){var t;return null==a||null===(t=a.__PosthogExtensions__)||void 0===t?void 0:t.rrweb}function Mr(){var t;return null===(t=Ir())||void 0===t?void 0:t.record}function Tr(t){try{return JSON.stringify(t)}catch(e){if(e instanceof RangeError)throw e;return JSON.stringify(t,En())}}function Rr(t){return fi(hi(function(t){var e=t.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(t);for(var n=new Pn(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 Pn(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 Yn(n,0,i)}(Tr(t))),!0)}function Er(t){return Ar.apply(this,arguments)}function Ar(){return Ar=A(function*(t){const e=yield function(t){return se.apply(this,arguments)}(Tr(t),Ii.DEBUG,{rethrow:!0});return fi(new Uint8Array(yield e.arrayBuffer()),!0)}),Ar.apply(this,arguments)}let $r,Or;const Pr="undefined"!=typeof globalThis&&"CompressionStream"in globalThis&&"TextEncoder"in globalThis&&"Response"in globalThis&&"function"==typeof Response.prototype.blob;let Lr=!1;function Dr(t){var e;return U(t)&&0===t.length?($r=null!==(e=$r)&&void 0!==e?e:Rr([]),$r):Rr(t)}function Fr(t){return Nr.apply(this,arguments)}function Nr(){return(Nr=A(function*(t){var e;return U(t)&&0===t.length?$r||(Or=null!==(e=Or)&&void 0!==e?e:Er([]).then(t=>($r=t,t)).catch(t=>{throw $r=void 0,Or=void 0,t}),Or):Er(t)})).apply(this,arguments)}function qr(t){return Pr&&!Lr&&function(t){return 2===t.type||3===t.type&&(0===t.data.source||8===t.data.source)}(t)}function jr(t){return{event:t,size:$n(t)}}function Br(t,e){return D(D({},t),{},{data:e,cv:"2024-10"})}function zr(t,e){return D(D({},t),{},{cv:"2024-10",data:D(D({},t.data),e)})}function Hr(t){try{if(2===t.type)return jr(Br(t,Rr(t.data)));if(3===t.type&&0===t.data.source)return jr(zr(t,{texts:Dr(t.data.texts),attributes:Dr(t.data.attributes),removes:Dr(t.data.removes),adds:Dr(t.data.adds)}));if(3===t.type&&8===t.data.source)return jr(zr(t,{adds:t.data.adds?Rr(t.data.adds):void 0,removes:t.data.removes?Rr(t.data.removes):void 0}))}catch(t){Sr.warn("could not compress event - will use uncompressed event",t)}return{event:t,size:An(t)}}function Ur(){return Ur=A(function*(t){try{if(2===t.type)return jr(Br(t,yield Er(t.data)));if(3===t.type&&0===t.data.source){const[e,n,i,r]=yield Promise.all([Fr(t.data.texts),Fr(t.data.attributes),Fr(t.data.removes),Fr(t.data.adds)]);return jr(zr(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?Er(t.data.adds):void 0,t.data.removes?Er(t.data.removes):void 0]);return jr(zr(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===ee})(e)&&(Lr=!0),Sr.warn("could not compress event asynchronously - trying synchronous compression",e),Hr(t)}return{event:t,size:An(t)}}),Ur.apply(this,arguments)}function Wr(t,e){return 5===t.type&&t.data.tag===e}function Vr(t){return Wr(t,"sessionIdle")}function Gr(t){return Wr(t,"$session_ending")}function Qr(t){return Wr(t,"$session_starting")}var Zr=class{get sessionId(){return this.Xt}get Yt(){if(!this._instance.sessionManager)throw new Error("[SessionRecording] must be started with a valid sessionManager.");return this._instance.sessionManager}get te(){return this._instance.config.session_recording.session_idle_threshold_ms||3e5}get ee(){return Qi(this._instance.get_property(f),this.sessionId)}get zt(){var t;const e=null===(t=this.ne)||void 0===t?void 0:t.sampleRate;return X(e)?e:null}get ie(){var t,e;return null!==(t=null===(e=this.re)||void 0===e?void 0:e.getMinimumDuration(this.sessionId))&&void 0!==t?t:null}constructor(t,e){this._instance=t,this.oe="/s/",this._forceAllowLocalhostNetworkCapture=!1,this.se=void 0,this.ae=!1,this.le=Date.now(),this.ue=!1,this.ce=[],this.de="unknown",this.he=0,this.fe=0,this.ve=0,this.pe=0,this.me=0,this.ge=!1,this.ye=!1,this.be=!1,this.we=!1,this.ke=!1,this._e=!1,this.Se=!1,this.xe=!1,this.Ce=!1,this.Ie=!1,this.Me=!1,this.Te=void 0,this.Re=void 0,this.Ee=!1,this.Ae=[],this.$e=0,this.Oe=0,this.Pe=!1,this.Le=void 0,this.Wt=void 0,this.De=void 0,this.Fe=void 0,this.Ne=void 0,this.qe=(t,e,n)=>{var i,r,o,s;if(!n)return;if(t===this.Xt&&e===this.je)return;const a=!n.noSessionId&&(n.activityTimeout||n.sessionPastMaximumLength),l=this.Xt,u=this.je;var c;if(a&&this.Vt("$session_ending",{currentSessionId:l,currentWindowId:u,nextSessionId:t,nextWindowId:e,changeReason:n,lastActivityTimestamp:this.le,flushed_size:null===(c=this.Be)||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=Ir())||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.ze(),!(!1===this.de&&this.isStarted||this.Xt===t&&this.je===e)){const e=this.Xt!==t&&!1!==this.de;this.de="unknown",this.He(e)}a&&this.Vt("$session_starting",{previousSessionId:l,previousWindowId:u,nextSessionId:t,nextWindowId:e,changeReason:n,lastActivityTimestamp:this.le}),null===(s=this.re)||void 0===s||s.makeSamplingDecisions(t)},this.Ue=!1,this.We=()=>{var t;return(null===(t=this._instance.persistence)||void 0===t?void 0:t.props.$session_past_minimum_duration)===this.Xt},this.Ve=()=>{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 X(n)&&X(i)?i-n:null},this.Ge=()=>{var t,e;const n=this.ie;if(!X(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.Qe;return X(t)&&t>=0&&n>t}if(this.We())return!1;const i=this.Ve();return!!J(i)||n>i||(null===(r=this._instance.persistence)||void 0===r||r.register({$session_past_minimum_duration:this.Xt}),!1);var r},this.Ze=()=>{"buffering"!==this.status?(this.ge&&this.ye&&this.Je&&(this.Ke(void 0),this.be&&(this.be=!1,this.jt())),this.Xe(),this.Ye(!0)):this.tn()},this.en=()=>{this.Ze()},this.nn=()=>{this.Vt("browser offline",{})},this.rn=()=>{this.Vt("browser online",{})},this.sn=()=>{(null==i?void 0:i.visibilityState)&&("visible"===i.visibilityState&&(this.Je=!0),this.Vt("window "+i.visibilityState,{}))},this.Je=null==e||e;const{sessionId:n,windowId:r,sessionStartTimestamp:o}=this.Yt.checkAndGetSessionAndWindowId();this.Xt=n,this.je=r,this._sessionStartTimestamp=o,this.et=new Cn(this._instance),this.Y=new xn(this._instance),this.tt=new In(this._instance),this.Rt=this.tn(),this.an="ph_replay_pending_buffer_"+JSON.stringify([this._instance.config.persistence_name||this._instance.config.token,this._instance.config.token]),this.Yt.sessionTimeoutMs>this.te||Sr.warn(`session_idle_threshold_ms (${this.te}) is greater than the session timeout (${this.Yt.sessionTimeoutMs}). Session will never be detected as idle`),this.Be=new Mi(this._instance)}setDocumentWasEverVisible(t){t&&(this.Je=!0)}get ln(){var t,e,n,i,r,o,s,a,l;const u=null===(t=this.ne)||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}}un(){var t;if(this.xe)return;const e=null===(t=this.ne)||void 0===t?void 0:t.masking;if(K(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.xe=!0,Sr.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 cn(){var t;return st(null===(t=this._instance.config.session_recording.canvasCapture)||void 0===t?void 0:t.resolutionScale,.1,1,he("canvas recording resolution scale"),1)}get dn(){var t,e,n,i,r,o,s;const a=this._instance.config.session_recording.captureCanvas,l=null===(t=this.ne)||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:st(c,0,12,he("canvas recording fps"),4),quality:st(d,0,1,he("canvas recording quality"),.4)}}get hn(){var t;const e=!!(null===(t=this.ne)||void 0===t?void 0:t.consoleLogRecordingEnabled),n=this._instance.config.enable_recording_console_log;return null!=n?n:e}get fn(){var t,e,n;const i=null===(t=this.ne)||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=(null==r?void 0:r.recordHeaders)||(null==i?void 0:i.recordHeaders),s=(null==r?void 0:r.recordBody)||(null==i?void 0:i.recordBody),a=_r(this._instance.config.capture_performance),l=_r(null==i?void 0:i.capturePerformance),u=!!(Y(a)?a:l);return o||s||u?{recordHeaders:o,recordBody:s,recordPerformance:u}:void 0}vn(){var t,e;const n=[],i=null===(t=a.__PosthogExtensions__)||void 0===t||null===(t=t.rrwebPlugins)||void 0===t?void 0:t.getRecordConsolePlugin;i&&this.hn&&n.push(i());const o=null===(e=a.__PosthogExtensions__)||void 0===e||null===(e=e.rrwebPlugins)||void 0===e?void 0:e.getRecordNetworkPlugin;if(this.fn&&W(o))if(!ge.includes(r.hostname)||this._forceAllowLocalhostNetworkCapture){const t=W(this._instance.requestRouter.isIngestionEndpoint)?this._instance.requestRouter.isIngestionEndpoint.bind(this._instance.requestRouter):void 0;n.push(o(D(D({},((t,e,n)=>{const i={payloadSizeLimitBytes:Ke.payloadSizeLimitBytes,performanceEntryTypeToObserve:[...Ke.performanceEntryTypeToObserve],payloadHostDenyList:[...e.payloadHostDenyList||[],...Ke.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=Je(t);return t=>((null==t?void 0:t.requestBody)&&(t.requestBody=rn(t.requestBody,t.requestHeaders,e,"Request")),(null==t?void 0:t.responseBody)&&(t.responseBody=rn(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=ye(t.name);let o=0===e.indexOf("http")?null===(i=ye(e))||void 0===i?void 0:i.pathname:e;"/"===o&&(o="");const s=null==r?void 0:r.pathname.replace(o||"","");return r&&s&&nn.some(t=>0===s.indexOf(t))?void 0:t})((en((i=e).requestHeaders),en(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});return!n&&e.isInitial?n:D(D({},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 K(s)&&o?(sn.add(o),o):null!=s?s:void 0}:t=>function(t){if(!G(t))return t.requestBody=on(t.requestBody,"Request"),t.responseBody=on(t.responseBody,"Response"),t}(l(t)),D(D(D({},Ke),i),{},{recordHeaders:r,recordBody:o,recordPerformance:s,recordInitialRequests:s,streamNetworkBody:!0===t.session_recording.streamNetworkBody})})(this._instance.config,this.fn,t)),{},{captureFetchSynchronously:!0===this._instance.config.__preview_replay_sync_fetch})))}else Sr.info("NetworkCapture not started because we are on localhost.");return n}pn(t){return this._instance.config.disable_capture_url_hashes?xt(t):t}mn(t,e=!1){const n=e?xt(t):this.pn(t),i=this._instance.config.mask_personal_data_properties?[...Ki,...this._instance.config.custom_personal_data_properties||[]]:[];return this.gn(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("=");U(n)&&(e.includes(n[0])?l.push(n[0]+"=<masked>"):l.push(a[t]))}let u=s;return null!=o&&(u+="?"+l.join("&")),null!=i&&(u+="#"+i),u}(n,i))}gn(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}yn(t){try{return t.rrwebMethod(),!0}catch(e){return 10>this.ce.length?this.ce.push({enqueuedAt:t.enqueuedAt||Date.now(),attempt:t.attempt+1,rrwebMethod:t.rrwebMethod}):Sr.warn("could not emit queued rrweb event.",e,t),!1}}Vt(t,e){return this.yn(Cr(()=>Mr().addCustomEvent(t,e)))}bn(){var t;return this.ae&&!0===(null===(t=this._instance.config.session_recording)||void 0===t?void 0:t.captureJsonLd)&&!this.Y.urlBlocked&&!0!==this.de}wn(t){if(!this.bn())return!1;try{const e=Mr();return!!e&&(e.addCustomEvent("$json_ld",t),this.bn())}catch(t){return!1}}kn(t=!1){Promise.resolve().then(()=>{var e;return null===(e=this._n)||void 0===e?void 0:e.scan(t)})}Sn(){try{if(this._instance.config.capture_pageview||!t)return;const e=new URL(t.location.href),n=this.mn(e.origin+e.pathname+e.search);this.xn!==n&&(this.xn=n,this.Vt("$url_changed",{href:n}))}catch(t){}}Cn(){if(this.ce.length){const t=[...this.ce];this.ce=[],t.forEach(t=>{Date.now()-t.enqueuedAt>2e3||this.yn(t)})}}jt(){return this.yn(Cr(()=>Mr().takeFullSnapshot()))}get In(){var t,e,n;if((null===(t=this.re)||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 X(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:3e5}Mn(){if(this.Tn&&clearInterval(this.Tn),!0===this.de)return;const t=this.In;t&&(this.Tn=setInterval(()=>{this.jt()},t))}Bt(t){"event"===t&&this.Rn(),!this.Y.urlBlocked&&["sampled","active"].includes(this.status)&&this.Mn()}En(){var t;this.Y.urlBlocked||(this.Y.urlBlocked=!0,null===(t=this._n)||void 0===t||t.scan(),clearInterval(this.Tn),Sr.info("recording paused due to URL blocker"),this.Vt("recording paused",{reason:"url blocker"}))}An(){var t;this.Y.urlBlocked&&(null===(t=this._n)||void 0===t||t.scan(),this.Y.urlBlocked=!1,this.jt(),this.kn(),this.Mn(),this.Vt("recording resumed",{reason:"left blocked url"}),Sr.info("recording resumed"))}$n(t,e){var n;if("event"===t&&this.Rn(),!this.ue&&(null===(n=this.re)||void 0===n?void 0:n.hasPendingTriggers(this.sessionId))){this.ue=!0;try{var i,r;const n="url"===t?v:p;null===(i=this._instance.persistence)||void 0===i||i.register({[n]:this.sessionId}),null===(r=this.re)||void 0===r||r.updateActiveTriggers(this.sessionId),this.Bt(),this.Ye(),this.qt(t+"_trigger_matched",{["url"===t?"matchedUrl":"matchedEvent"]:e})}finally{this.ue=!1}}}get isStarted(){return!!this.se}get ne(){const t=this._instance.get_property("$session_recording_remote_config");if(!t)return;let e;try{e=V(t)?t:JSON.parse(t)}catch(t){return void Sr.warn("persisted remote config for session recording is invalid and will be ignored",t)}if(!this.isStarted&&!this.Ue){var n;const i=null!==(n=e.cache_timestamp)&&void 0!==n?n:Date.now();if(Date.now()-i>36e5)return void Sr.info("persisted remote config for session recording is stale and will be ignored",{cacheTimestamp:i,persistedConfig:t})}return e}On(t,e,n){this._instance.get_property(t)&&(e(),n())}start(e){var n,r;const o=this.ne;if(!o)return void Sr.info("remote config must be stored in persistence before recording can start");if(!this.isStarted){const t=!1!==this.de&&!this.we;this.Ke(t?"no_interaction_since_recording_started":void 0),this.we=!1,this.ye=t,this.be=!1}this.Pe&&(this.Pn(),this.tn());const{sessionId:s,windowId:a,sessionStartTimestamp:l}=this.Yt.checkAndGetSessionAndWindowId();this.Xt=s,this.je=a,this._sessionStartTimestamp=l,this.Ln(),null===(n=this._instance.persistence)||void 0===n||n.unregister("$debug_first_full_snapshot_timestamp"),(null==o?void 0:o.endpoint)&&(this.oe=null==o?void 0:o.endpoint),this.re=2===(null==o?void 0:o.version)&&(null==o?void 0:o.triggerGroups)&&o.triggerGroups.length>0?new Ji(this._instance,this.Y,this.qt.bind(this),this.Vt.bind(this),this.Bt.bind(this)):new Zi(this._instance,this.Y,this.tt,this.et,this.qt.bind(this),this.jt.bind(this),this.Bt.bind(this)),this.re.onRemoteConfig(o),null===(r=this.Wt)||void 0===r||r.call(this),this.Wt=this.re.setupEventTriggerListeners(this._instance.on.bind(this._instance,"eventCaptured"),this.sessionId,(t,e)=>this.$n(t,e)),this.On(u,()=>{this.overrideSampling()},()=>{var t;return null===(t=this._instance.persistence)||void 0===t?void 0:t.unregister(u)}),this.On(c,()=>{this.overrideLinkedFlag()},()=>{var t;return null===(t=this._instance.persistence)||void 0===t?void 0:t.unregister(c)}),this.On(h,()=>{this.overrideTrigger("event")},()=>{var t;return null===(t=this._instance.persistence)||void 0===t?void 0:t.unregister(h)}),this.On(d,()=>{this.overrideTrigger("url")},()=>{var t;return null===(t=this._instance.persistence)||void 0===t?void 0:t.unregister(d)}),this.re.makeSamplingDecisions(this.sessionId),this.Dn(),this.ke||(me(t,"beforeunload",this.Ze),me(t,"pagehide",this.en),me(t,"offline",this.nn),me(t,"online",this.rn),me(i,"visibilitychange",this.sn),!this.De&&W(this.Yt.onSessionId)&&(this.De=this.Yt.onSessionId(this.qe)),!this.Fe&&W(this.Yt.on)?this.Fe=this.Yt.on("forcedIdleReset",()=>{this.ze(),this.de="unknown",this.stop(),this.Ne=this.Yt.onSessionId((t,e,n)=>{var i;null===(i=this.Ne)||void 0===i||i.call(this),this.Ne=void 0,this.qe(t,e,n)})}):W(this.Yt.on)||Sr.warn("bundled core has no SessionIdManager.on (requires posthog-js >= 1.268.6); recording will start but skip forced-idle-reset handling"),K(this.Le)&&(this.Le=this._instance.on("eventCaptured",t=>{try{if("$pageview"===t.event){const e=(null==t?void 0:t.properties.$current_url)?this.mn(t.properties.$current_url):"";if(!e)return;this.Vt("$pageview",{href:e})}}catch(t){Sr.error("Could not add $pageview to rrweb session",t)}})),"active"===this.status&&this.qt(e||"recording_initialized"))}Fn(){var e,n,r,o,s,a;null==t||t.removeEventListener("beforeunload",this.Ze),null==t||t.removeEventListener("pagehide",this.en),null==t||t.removeEventListener("offline",this.nn),null==t||t.removeEventListener("online",this.rn),null==i||i.removeEventListener("visibilitychange",this.sn),clearInterval(this.Tn),this.Nn(),null===(e=this.Le)||void 0===e||e.call(this),this.Le=void 0,null===(n=this.Wt)||void 0===n||n.call(this),this.Wt=void 0,null===(r=this.De)||void 0===r||r.call(this),this.De=void 0,null===(o=this.Fe)||void 0===o||o.call(this),this.Fe=void 0,null===(s=this.Ne)||void 0===s||s.call(this),this.Ne=void 0,null===(a=this.re)||void 0===a||a.stop(),this.qn(),this.Pn()}Pn(){this.Oe+=1,this.Ae=[],this.$e=0,this.jn=void 0,this.Pe=!1}qn(){var t,e;null===(t=this.Bn)||void 0===t||t.stop(),this.ce=[],null===(e=this._n)||void 0===e||e.stop(),this._n=void 0,this.ae=!1;try{var n;null===(n=this.se)||void 0===n||n.call(this)}catch(t){Sr.warn("could not stop rrweb",t)}this.se=void 0}zn(){if(!this.jn||0===this.$e)return!1;if(this.Pe)return!0;this.Pe=!0,this.Hn=void 0;const t=this.Oe;return this.Nn(),this.qn(),this.jn.catch(()=>{}).then(()=>{t===this.Oe&&(this.Pe=!1,this.Ye(),this.tn(),this.Un(),this.Fn(),Sr.info("stopped"))}).catch(()=>{this.Pe=!1,this.Un(),this.Fn(),Sr.info("stopped")}),!0}stop(){if(this.qn(),this.Ue)this.Xe();else if(this.zn())return;this.Ye(),this.tn(),this.Un(),this.Fn(),Sr.info("stopped")}Un(){this.Ke(void 0,{preserveLogDedup:this.Ue}),this.ye=!1}flushBeforeIdentityReset(){(this.isStarted||this.Pe)&&(this.Xe(),this.Ye())}He(t){this.Ue=!0,this.le=Date.now();try{var e,n;this.stop(),this.Wn=void 0,this.me=0,this.fe=0,this.ve=0,this.pe=0,null===(e=Ir())||void 0===e||null===(n=e.resetSnapshotCostState)||void 0===n||n.call(e),this.start("session_id_changed")}finally{this.Ue=!1}this.Ke(t?"no_interaction_since_session_rotated":void 0),this.ye=!1}Ke(t,{preserveLogDedup:e=!1}={}){if(this.ge=!G(t),this.Hn=t,G(t))return void(e||(this.Vn=void 0));if(this.Ue)return;const n=`${this.sessionId}:${t}`;n!==this.Vn&&(this.Vn=n,Sr.info(`holding buffer: ${t}. nothing is uploaded until the user interacts with the page`))}Rn(){this.isStarted||(this.we=!0),this.ge&&(this.Ke(void 0),this.ye=!1,this.be&&(this.be=!1,this.jt()),this.Gn())}discard({discardProducerEvents:t=!1}={}){this.ge=!0,t&&(this.tn(),this.qn()),this.tn(),this.Fn(),this.tn(),this.Un(),Sr.info("discarded")}Qn(t,e,n,i,r){if(-1===n)return this.me+=1,void Sr.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.Zn(t,i),this.Jn(o)):this.tn()}Kn(){try{this.Xn()}catch(t){this.Se||(this.Se=!0,Sr.error("could not track full snapshot cost",t))}}Xn(){var t,e;const n=null===(t=Ir())||void 0===t||null===(e=t.getLastSnapshotCost)||void 0===e?void 0:e.call(t);n&&n!==this.Wn&&(this.Wn=n,500>n.durationMs||Sr.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}))}Zn(t,e){2!==t.type?3===t.type&&(G(this.Te)||this.Te===e||this.Re===e||(this.Re=e,Sr.info("incremental snapshot for a session with no full snapshot - requesting one",{sessionId:e}),this.jt())):this.Te=e}Yn(t){t.counted&&t.generation===this.Oe&&(this.$e=Math.max(0,this.$e-1)),t.counted=!1,this.Ae=this.Ae.filter(e=>e!==t)}ti(t,e,n){t.processed||t.generation!==this.Oe||(t.processed=!0,this.Qn(t.event,e,n,t.targetSessionId,t.targetWindowId))}ei(t){try{let e,n=t.event;if(t.compressionEnabled)try{({event:n,size:e}=Hr(t.event))}catch(t){Sr.warn("could not process queued compression event - will use uncompressed event",t)}G(e)&&(e=An(t.event));try{this.ti(t,n,e)}catch(t){Sr.warn("could not capture queued compression event",t)}}finally{this.Yn(t)}}Xe(){[...this.Ae].forEach(t=>{try{this.ei(t)}catch(t){Sr.warn("could not drain queued compression event",t)}})}ni(t,e,n,i){var r=this;const o={event:t,compressionEnabled:e,targetSessionId:n,targetWindowId:i,generation:this.Oe,processed:!1,counted:!0};this.Ae.push(o),this.$e+=1;const s=(a=A(function*(){try{if(o.processed)return;let n,i;try{const r=e?qr(t)?yield function(t){return Ur.apply(this,arguments)}(t):Hr(t):{event:t,size:An(t)};n=r.event,i=r.size}catch(e){Sr.warn("could not process queued compression event - will use uncompressed event",e),n=t,i=An(t)}r.ti(o,n,i)}finally{r.Yn(o)}}),function(){return a.apply(this,arguments)});var a;this.jn=this.jn?this.jn.catch(()=>{}).then(s):s()}onRRwebEmit(e){var n,i,r,o,s,a,l,u,c,d,h;if(!this._instance.sessionManager)return;if(this.Cn(),!e||!V(e))return;if(4===e.type){const t=this.mn(e.data.href);if(this.xn=t,!t)return;e.data.href=t}else this.Sn();if(null===(n=this.re)||void 0===n||n.checkUrlTriggers(this.sessionId,()=>this.En(),()=>this.An(),(t,e)=>this.$n(t,e)),this.Y.urlBlocked&&!function(t){return 5===t.type&&"recording paused"===t.data.tag}(e))return;2===e.type&&(this.Kn(),Promise.resolve().then(()=>this.Kn()),this.Mn(),null===(d=this.Bn)||void 0===d||d.reset(),null===(h=this._instance.persistence)||void 0===h||h.register_once({$debug_first_full_snapshot_timestamp:e.timestamp},void 0));const f=2===e.type&&(null===(i=this.re)||void 0===i?void 0:i.hasPendingTriggers(this.sessionId));f&&this.ii();const v=this.Bn?this.Bn.throttleMutations(e):e;if(!v)return void(!0===this.de&&this.he++);const p=function(t){const e=t;if(e&&V(e)&&6===e.type&&V(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}(v),m=function(t){return Gr(t)?t.data.payload:null}(p),g=function(t){return Qr(t)?t.data.payload:null}(p),y=function(t){return Vr(t)?t.data.payload:null}(p);m||g?(null==m?void 0:m.lastActivityTimestamp)&&(p.timestamp=m.lastActivityTimestamp):(null==y?void 0:y.sessionId)||this.ri(p);const b=null!==(r=null!==(o=null!==(s=null==m?void 0:m.currentSessionId)&&void 0!==s?s:null==g?void 0:g.nextSessionId)&&void 0!==o?o:null==y?void 0:y.sessionId)&&void 0!==r?r:this.Xt,w=null!==(a=null!==(l=null!==(u=null==m?void 0:m.currentWindowId)&&void 0!==u?u:null==g?void 0:g.nextWindowId)&&void 0!==l?l:null==y?void 0:y.windowId)&&void 0!==a?a:this.je;if(!0===this.de&&!function(t){return Vr(t)||Gr(t)||Qr(t)}(p))return void(function(t){return 2===t.type||4===t.type||3===t.type&&9!==t.data.source}(p)&&this.he++);2===p.type&&(this.he=0),y&&(p.timestamp=y.lastActivityTimestamp+y.threshold);const k=this.ae;this.ae=!0,f?this.kn(!0):k||this.kn();const _=null===(c=this._instance.config.session_recording.compress_events)||void 0===c||c;if(5===p.type&&"$json_ld"===p.data.tag){let e;try{e=t?this.mn(t.location.href):void 0}catch(t){}p.data.href=e}if(this.$e>0||_&&qr(p))return void this.ni(p,_,b,w);const{event:S,size:x}=_?Hr(p):{event:p,size:An(p)};this.Qn(p,S,x,b,w)}get status(){return this.re?this.re.getStatus({instance:this._instance,sessionId:this.sessionId,isSampled:this.ee,rrwebError:this.ke,urlTriggerMatching:this.Y,eventTriggerMatching:this.tt,linkedFlagMatching:this.et,remoteConfig:this.ne}):an}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.et.linkedFlagSeen=!0,this.jt(),this.Rn(),this.qt("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.jt(),this.Rn(),this.qt("sampling_overridden")}overrideTrigger(t){this.$n(t),this.Rn()}oi(){try{var e;const n=null==t||null===(e=t.location)||void 0===e?void 0:e.href;if(!n)return;const i=this.mn(n);if(!i)return;return new URL(i).hostname||void 0}catch(t){return}}Nn(){this.si&&(clearTimeout(this.si),this.si=void 0)}Gn(){this.si||(this.si=setTimeout(()=>{this.Ye()},2e3))}ai(){return this.Te!==this.Rt.sessionId&&0!==this.Rt.data.length&&this.Rt.data.every(t=>5===(null==t?void 0:t.type)&&!Gr(t)&&!Qr(t))}li(){var t,e;return null!==(t=null===(e=this.re)||void 0===e?void 0:e.getPendingTriggerConditions(this.sessionId))&&void 0!==t?t:[]}ui(t){if("buffering"!==t)return G(this.ci)||this._instance.register_for_session({[S]:[]}),void(this.ci=void 0);const e=this.li();if(0===e.length)return G(this.ci)||this._instance.register_for_session({[S]:[]}),void(this.ci=void 0);const n=e.join(", "),i=`${this.sessionId}:${n}`;i!==this.ci&&(this.ci=i,this._instance.register_for_session({[S]:e}),Sr.info(`buffering: ${n}`))}di(){var t;return"memory"!==this._instance.config.persistence&&!0!==(null===(t=this._instance.persistence)||void 0===t?void 0:t.hi)&&Ci.At()}fi(){0!==this.Rt.data.length&&this.Rt.size!==this.pi&&943718.4>=this.Rt.size&&this.di()&&(this.pi=this.Rt.size,Ci.$t(this.an,this.Rt))}Ln(){if(this.Ee||!this.di())return;this.Ee=!0;const t=Ci.Dt(this.an);Ci.Pt(this.an),V(t)&&U(t.data)&&0!==t.data.length&&U(t.sizes)&&t.sizes.length===t.data.length&&X(t.size)&&t.sessionId===this.Xt&&t.windowId===this.je&&(this.Rt.data.length>0||(this.Rt=t))}Ye(t=!1){var e;if(this.Nn(),this.ge)return this.Rt;if(this.ai())return this.Rt.size>943718.4?this.tn():(t&&this.fi(),this.Rt);const n=this.Rt;null===(e=this.re)||void 0===e||e.ensureSamplingDecision(this.sessionId);const i=this.Ge(),r=this.status;if(this.ui(r),"buffering"===r||"paused"===r||"disabled"===r||i)return!t||"active"!==r&&"sampled"!==r||this.fi(),this.Gn(),this.Rt;if(this.Rt!==n)return this.Rt;if(n.data.length>0){var o;const t=this.oi();On(n).forEach(e=>{try{var n;null===(n=this.Be)||void 0===n||n.trackSize(e.sessionId,e.size),this.mi(D(D(D(D({$snapshot_bytes:e.size,$snapshot_data:e.data,$session_id:e.sessionId,$window_id:e.windowId,$lib:Ii.LIB_NAME,$lib_version:Ii.LIB_VERSION,$snapshot_host:t},this.fe>0?{$sdk_debug_replay_throttled_mutations_dropped:this.fe}:{}),this.ve>0?{$sdk_debug_replay_oversized_mutations_dropped:this.ve}:{}),this.pe>0?{$sdk_debug_replay_oversized_mutation_bytes_dropped:this.pe}:{}),this.me>0?{$sdk_debug_replay_unstringifiable_events_dropped:this.me}:{}))}catch(t){Sr.warn("could not capture snapshot chunk - skipping it",t)}}),G(this.pi)||(Ci.Pt(this.an),this.pi=void 0),null===(o=this.re)||void 0===o||o.onFlushComplete()}return this.tn()}Jn(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.de&&!this.ge&&this.Rt.size+t.$snapshot_bytes+n>943718.4){const e=this.Xt;if(this.Rt=this.Ye(),this.Xt!==e)return;r&&this.Rt.data.length>0&&(this.Rt=this.tn()),this.Rt.sessionId=i,this.Rt.windowId=t.$window_id}this.ge&&(this.be||this.Rt.size+t.$snapshot_bytes+n>943718.4)?this.be=!0:(this.Rt.size+=t.$snapshot_bytes,this.Rt.data.push(t.$snapshot_data),this.Rt.sizes.push(t.$snapshot_bytes),!0===this.de||this.ge||this.Gn())}mi(t){this._instance.capture("$snapshot",t,{_url:this._instance.requestRouter.endpointFor("api",this.oe),_noTruncate:!0,_batchKey:"recordings",skip_client_rate_limiting:!0})}get Qe(){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}ii(){if(!this.Rt||0===this.Rt.data.length)return this.tn();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.tn():(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)}tn(){return this.Rt={size:0,data:[],sizes:[],sessionId:this.Xt,windowId:this.je},this.Rt}qt(t,e){this._instance.register_for_session({[R]:t}),Sr.info(t.replace("_"," "),e),"session_id_changed"!==t&&this.Vt("$recording_started",D({reason:t},e))}gi(t){var e;return 3===t.type&&-1!==xr.indexOf(null===(e=t.data)||void 0===e?void 0:e.source)}ri(t){const e=this.gi(t);e||!0===this.de||t.timestamp-this.le>this.te&&(this.de=!0,clearInterval(this.Tn),this.Vt("sessionIdle",{eventTimestamp:t.timestamp,lastActivityTimestamp:this.le,threshold:this.te,bufferLength:this.Rt.data.length,bufferSize:this.Rt.size,sessionId:this.Xt,windowId:this.je}),this.Ye());const{windowId:n,sessionId:i}=this.Yt.checkAndGetSessionAndWindowId(!e,t.timestamp);let r=!1;if(e&&(this.le=t.timestamp,this.de)){const e="unknown"===this.de;this.de=!1,e||(this.Vt("sessionNoLongerIdle",{reason:"user activity",type:t.type}),r=!0)}const o=this.Xt!==i,s=this.je!==n;if(this.je=n,this.Xt=i,o||s){const t=o&&!1!==this.de;t&&(this.de="unknown"),this.He(t)}else if(e&&this.Rn(),r){var a;const t=["sampled","active"].includes(this.status)||(null===(a=this.re)||void 0===a?void 0:a.hasPendingTriggers(this.sessionId));this.he>0&&t&&this.jt(),this.kn(),this.Mn()}}ze(){var t;null===(t=this.re)||void 0===t||t.clearConditionalRecordingPersistence()}get sdkDebugProperties(){var t;return{$recording_status:this.status,$sdk_debug_replay_flush_hold_reason:this.Hn,$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.Be)||void 0===t?void 0:t.currentTrackedSize(this.sessionId),$sdk_debug_replay_rrweb_error:this.ke,[M]:this.yi,[T]:this._e}}get yi(){var t,e,n;return!!this.se&&(null===(t=null===(e=Mr())||void 0===e||null===(n=e.isRecording)||void 0===n?void 0:n.call(e))||void 0===t||t)}Dn(){var e;if(this.se)return;this._e=!0;const n={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,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 n)if("maskInputOptions"===t)n.maskInputOptions=D({password:!0},e);else if("sampling"===t){const t=null!=e?e:{},i={};G(t.mousemove)||(i.mousemove=t.mousemove),G(t.mouseInteraction)||(i.mouseInteraction=t.mouseInteraction),n.sampling=i}else n[t]=e;var o,s,a,l;!0===(null==r?void 0:r.captureJsonLd)&&!0!==n.slimDOMOptions&&"all"!==n.slimDOMOptions&&(n.slimDOMOptions=D(D({},n.slimDOMOptions),{},{script:!0})),this.dn&&this.dn.enabled&&(n.recordCanvas=!0,n.sampling=D(D({},n.sampling),{},{canvas:this.dn.fps}),n.dataURLOptions={type:"image/webp",quality:this.dn.quality},n.canvasResolutionScale=this.cn,n.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.Ie||(this.Ie=!0,Sr.warn("canvasCapture.maskRegionsFn threw, canvas frames will be skipped",t)),null}}}),this.ln&&(n.maskAllInputs=null===(o=this.ln.maskAllInputs)||void 0===o||o,n.maskTextSelector=null!==(s=this.ln.maskTextSelector)&&void 0!==s?s:void 0,n.blockSelector=null!==(a=this.ln.blockSelector)&&void 0!==a?a:void 0,n.maskAllElementAttributes=null!==(l=this.ln.maskAllElementAttributes)&&void 0!==l&&l),n.maskAllElementAttributes&&n.maskAttributeFn&&(n.maskAttributeFn=void 0,this.Ce||(this.Ce=!0,Sr.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.un();const u=Mr();if(!u)return void Sr.error("_startRecorder was called but rrwebRecord is not available. This indicates something has gone wrong.");this.Bn=null!==(e=this.Bn)&&void 0!==e?e:new vi(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`;Sr.info(n,{node:e}),this.log("[SessionRecording] "+n,"warn")},onDroppedAttributeMutations:t=>this.fe+=t,bytesRefillRate:this._instance.config.session_recording.__mutationBytesRefillRate,bytesBucketSize:this._instance.config.session_recording.__mutationBytesBucketSize,resyncIntervalMs:this.In,onDroppedOversizedMutation:t=>{0===this.ve&&this.log("[SessionRecording] Dropped an oversized DOM mutation to keep the recording playable. The recording will resync with a full snapshot.","warn"),this.ve+=1,this.pe+=t},requestFullSnapshot:()=>this.jt()});const c=this.vn();if(this.se=u(D(D({emit:t=>{this.onRRwebEmit(t)},plugins:c,errorHandler:(t,e)=>"rrweb"===e&&(this.Me||(this.Me=!0,Sr.error("rrweb internal error - recording will continue but may be incomplete",t)),!0)},n),{},{recordAfter:"DOMContentLoaded"})),!this.se)return this.ke=!0,void Sr.error("rrweb failed to start - Loss of recording data is possible. Check the browser console for rrweb errors.");this.ke=!1,!0===(null==r?void 0:r.captureJsonLd)&&i&&(null==t?void 0:t.MutationObserver)&&!this._n&&(this._n=function(t,e,n){const i=new WeakMap,r=n.getCaptureState||(()=>!0);let o=Xi;const s=function(t,e){const n=e.attributeFilter;return e.maskAllElementAttributes||e.maskAttributeFn||(null==n?void 0:n.length)&&!n.includes("id")?er:n=>{const i=t.getElementById(n);return!!i&&"SCRIPT"!==i.nodeName&&(!e.isRecordedElement||e.isRecordedElement(i))&&!wr(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 wr(t,e.blockClass,e.blockSelector)||wr(t,e.maskTextClass,e.maskTextSelector)}(e,n))return;const l=function(t,e=er,n){if(!t||t.length>Xi)return null;try{const i=JSON.parse(t),r={maskUrl:n,remainingNodes:2048,exceeded:!1},o=U(i)?i.map(t=>gr(t,e,r)):gr(i,e,r);if(r.exceeded||J(o)||U(o)&&(!o.length||o.some(J)))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(J(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 kr(t))a(e)};for(const n of t)if("childList"===n.type)yr(n.target)&&a(n.target),n.addedNodes.forEach(e);else if("characterData"===n.type){const t=n.target.parentNode;t&&yr(t)&&a(t)}else"attributes"===n.type&&yr(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()&&kr(t.documentElement).forEach(t=>{e&&i.delete(t),a(t)})},stop(){return n.disconnect()}}}catch(t){return{scan(){},stop(){}}}}(i,t.MutationObserver,{maskUrl:t=>this.mn(t),attributeFilter:n.attributeFilter,blockClass:n.blockClass,blockSelector:n.blockSelector,isRecordedElement:t=>u.mirror.getId(t)>0,maskAllElementAttributes:n.maskAllElementAttributes,maskAttributeFn:n.maskAttributeFn,maskTextClass:n.maskTextClass,maskTextSelector:n.maskTextSelector,getCaptureState:()=>{var t;return!0!==(null===(t=this._instance.config.session_recording)||void 0===t?void 0:t.captureJsonLd)||this.Y.urlBlocked||this.Y.isCurrentUrlBlocked()?null:this.bn()},emit:t=>this.wn(t)}),this.Y.isCurrentUrlBlocked()&&this._n.scan()),this.le=Date.now(),this.de=Y(this.de)?this.de:"unknown",this.tryAddCustomEvent("$remote_config_received",this.ne),this.Vt("$session_options",{sessionRecordingOptions:n,activePlugins:c.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 Jr=["type"];var Kr=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}({}),Xr=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}({}),Yr=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}({}),to=function(t){return t[t.Mouse=0]="Mouse",t[t.Pen=1]="Pen",t[t.Touch=2]="Touch",t}({}),eo=function(t){return t[t["2D"]=0]="2D",t[t.WebGL=1]="WebGL",t[t.WebGL2=2]="WebGL2",t}({}),no=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}({}),io=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 ro(t,e){return-1!==t.indexOf(e)}"Mobile".toLowerCase(),"Tablet".toLowerCase(),new RegExp("Xbox","i"),new RegExp("Nintendo","i"),new RegExp("PlayStation","i"),new RegExp("Windows","i"),Date,Date,new RegExp(/[a-z][a-z0-9+.-]{0,63}:[^\s<>"]+/gi.source,"i");var oo=/[a-z][a-z0-9+.-]{0,63}:\/\//i;new RegExp(`^${oo.source}`,"i"),new RegExp(oo.source,"gi"),"0".repeat(32),"0".repeat(16);var so={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot"],MutationObserver:[]},ao={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:["querySelector","querySelectorAll"],MutationObserver:["constructor"]},lo={};function uo(t){if(lo[t])return lo[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 so?so[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 ao?ao[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 lo[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?(function(t){return ro(t,"AppleWebKit")&&!ro(t,"Chrome")}(navigator.userAgent)&&(a.classList.add("rr-block","ph-no-capture"),a.setAttribute("__rrwebUntaintedPrototype",t),l=!0),lo[t]=r):n}catch(t){return n}finally{!l&&a.parentNode&&document.body.removeChild(a)}}var co=Object.create(null);function ho(t,e,n){var i;const r=co[t],o=r[n];if(o)return o.call(e);const s=uo(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]}co.Node=Object.create(null),co.ShadowRoot=Object.create(null),co.MutationObserver=Object.create(null),co.Element=Object.create(null);var fo,vo={};function po(t,e,n){const i=`${t}.${String(n)}`;if(vo[i])return vo[i].bind(e);const r=uo(t)[n];return"function"!=typeof r?e[n]:(vo[i]=r,r.bind(e))}function mo(){return uo("MutationObserver").constructor}function go(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 yo={childNodes:t=>ho("Node",t,"childNodes"),parentNode:t=>ho("Node",t,"parentNode"),parentElement:t=>ho("Node",t,"parentElement"),textContent:t=>ho("Node",t,"textContent"),isConnected(t){if(void 0===fo){var e;const t=null===(e=Object.getOwnPropertyDescriptor(uo("Node"),"isConnected"))||void 0===e?void 0:e.get;fo=(null==t?void 0:t.toString().includes("[native code]"))?t:null}return null==fo?void 0:fo.call(t)},contains:(t,e)=>po("Node",t,"contains")(e),getRootNode:t=>po("Node",t,"getRootNode")(),host:t=>t&&"host"in t?ho("ShadowRoot",t,"host"):null,styleSheets:t=>t.styleSheets,shadowRoot:t=>t&&"shadowRoot"in t?ho("Element",t,"shadowRoot"):null,querySelector:(t,e)=>po("Element",t,"querySelector")(e),querySelectorAll:(t,e)=>po("Element",t,"querySelectorAll")(e),mutationObserver:mo,patch:go};function bo(){try{if("undefined"!=typeof performance&&performance.now)return performance.now()}catch(t){}return Date.now()}var wo=0;function ko(){wo+=1}function _o(){return wo}function So(t,e){return(e!==wo||t>6e4)&&!0}var xo=0,Co=0,Io=0,Mo={durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0},To=null,Ro=null,Eo=[],Ao=0,$o=0,Oo={slowestBatchMs:0},Po={deferredCount:0,failedCount:0,abandonedCount:0,totalMs:0,slowestSliceMs:0};function Lo(t){(xo+=1)>1||(Mo={durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0},Eo=[],Ao=0,Ro=(t=>t&&t>0?t:null)(t),Co=bo(),Io=wo)}function Do(){return 0===xo?To||{durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0}:(xo-=1)>0?Mo:(Mo.durationMs=bo()-Co,Mo.deferredStylesheetCount=Ao,Po.deferredCount+=Ao,Ro=null,So(Mo.durationMs,Io)?Mo:To=Mo)}function Fo(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+=Fo(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+=Fo(r,e,n+1))}}}catch(t){}}return i}function No(t){if(0===xo)return;const e=Fo(t,null,0);Mo.cssRuleCount+=e,$o>0&&(Mo.nonDeferrableCssRuleCount+=e)}function qo(t){$o+=1;try{return t()}finally{$o-=1}}function jo(t){xo>0&&(Mo.stylesheetMs+=t)}function Bo(t){if(0===xo||null===Ro)return!1;const e=Mo.cssRuleCount-Mo.nonDeferrableCssRuleCount;return e>=Ro||e+function(t){try{const e=t&&(t.rules||t.cssRules);if(!e)return 0;const n=new WeakSet;return n.add(t),Fo(e,n,0)}catch(t){return 0}}(t)>Ro}function zo(){const t=Eo;return Eo=[],t}function Ho(){Po.failedCount+=1}function Uo(t){t>0&&(Po.abandonedCount+=t)}function Wo(t){return Wo="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},Wo(t)}function Vo(t,e,n){return(e=function(t){var e=function(t){if("object"!=Wo(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Wo(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Wo(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Go(t){return t.nodeType===t.ELEMENT_NODE}function Qo(t){const e=t&&"host"in t&&"mode"in t&&yo.host(t)||null;return Boolean(e&&"shadowRoot"in e&&yo.shadowRoot(e)===t)}function Zo(t){return"[object ShadowRoot]"==={}.toString.call(t)}function Jo(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 Ko(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 Xo=0;function Yo(t){const e=0===Xo,n=e?bo():0;Xo+=1;try{const e=t.rules||t.cssRules;if(!e)return null;No(e);let n=t.href;return!n&&t.ownerNode&&(n=t.ownerNode.baseURI),Jo(Array.from(e,t=>ts(t,n)).join(""))}catch(t){return null}finally{Xo-=1,e&&jo(bo()-n)}}function ts(t,e){if(ns(t)){let e;try{e=Yo(t.styleSheet)||Ko(t)}catch(n){e=t.cssText}try{var n;if(e&&(null===(n=t.styleSheet)||void 0===n?void 0:n.href))return ys(e,t.styleSheet.href)}catch(t){}return e}{let n=t.cssText;return is(t)&&t.selectorText.includes(":")&&(n=es(n)),e?ys(n,e):n}}function es(t){return t.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")}function ns(t){return"styleSheet"in t}function is(t){return"selectorText"in t}var rs=/^-?[A-Za-z_][\w-]*$/,os=/^-?[A-Za-z_][\w-]*(\.-?[A-Za-z_][\w-]*)*$/;function ss(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||Ko(e)}catch(t){r=e.cssText}try{var i;r&&(null===(i=e.styleSheet)||void 0===i?void 0:i.href)&&(r=ys(r,e.styleSheet.href))}catch(t){}r&&t.parts.push(r),t.index+=1}catch(t){o(null)}}function a(t){const n=t.rules[t.index];if("sheet"===t.kind&&ns(n)){const i=r.get(n);return null===i?(t.parts.push(n.cssText),void(t.index+=1)):i?void e.push({kind:"sheet",sheet:i.sheet,rules:i.rules,sheetHref:i.sheetHref,index:0,parts:[],importRule:n}):void s(t,n,null)}if(function(t,n){try{const i=function(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(is(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&&!rs.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]?rs.test(e.name)?`@keyframes ${e.name} {`:null:""===e.name?"@layer {":os.test(e.name)?`@layer ${e.name} {`:null:null}(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?ys(i,r):i,fixColons:"sheet"===n.kind&&is(t)&&t.selectorText.includes(":")}),!0}catch(t){return!1}}(n,t))return;let i=n.cssText;"sheet"===t.kind&&is(n)&&n.selectorText.includes(":")&&(i=es(i)),t.parts.push(t.sheetHref?ys(i,t.sheetHref):i),t.index+=1}return function(t){try{const n=t.rules||t.cssRules;if(!n)return!1;No(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,!ns(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;No(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=bo();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?es(n):n}else e=Jo(t.parts.join(""))}catch(t){}o(e);continue}s-=1;try{a(t)}catch(t){o(null)}}}catch(t){n=!0,i=null}finally{jo(bo()-r)}return n},text:()=>n?i:null,remainingRules(){if(n)return 0;let t=0;for(const n of e)t+=n.rules.length-n.index;return t}}}var as=class{constructor(){Vo(this,"idNodeMap",new Map),Vo(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)),Go(t)){const e=yo.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 ls({element:t,maskInputOptions:e,tagName:n,type:i,value:r,maskInputFn:o}){let s=r||"";const a=i&&us(i);return(e[n.toLowerCase()]||a&&e[a])&&(s=o?o(s,t):"*".repeat(s.length)),s}function us(t){return t.toLowerCase()}var cs=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 ds({element:t,name:e,value:n,maskAllElementAttributes:i,maskAttributeFn:r,isGenerated:o=!1}){return n?i?o&&cs.has(us(e))?n:"*".repeat(n.length):r?r(e,n,t):n:n}var hs="__rrweb_original__";function fs(t){try{const e=t.type;return t.hasAttribute("data-rr-is-password")?"password":e?us(e):null}catch(t){return null}}var vs=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,ps=/^(?:[a-z+]+:)?\/\//i,ms=/^www\..*/i,gs=/^(data:)([^,]*),(.*)/i;function ys(t,e){return(t||"").replace(vs,(t,n,i,r,o,s)=>{const a=i||o||s,l=n||r||"";if(!a)return t;if(ps.test(a)||ms.test(a))return`url(${l}${a}${l})`;if(gs.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=e.split("/"),c=a.split("/");u.pop();for(const t of c)"."!==t&&(".."===t?u.pop():u.push(t));return`url(${l}${u.join("/")}${l})`})}var bs,ws,ks=new Map,_s=1,Ss=new RegExp("[^a-z0-9-_:]");function xs(){return _s++}var Cs=!1,Is=/^[^ \t\n\r\u000c]+/,Ms=/^[, \t\n\r\u000c]+/,Ts=new WeakMap;function Rs(t,e){return e&&""!==e.trim()?Es(t,e):e}function Es(t,e){let n=Ts.get(t);if(n||(n=t.createElement("a"),Ts.set(t,n)),e){if(e.startsWith("blob:")||e.startsWith("data:"))return e}else e="";return n.setAttribute("href",e),n.href}function As(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 $s(t,e,n,i,r,o){if(!i)return i;if("src"===n||"href"===n&&("use"!==e||"#"!==i[0])){if("link"===e&&r){var s;const t=null===(s=r.sheet)||void 0===s?void 0:s.href;if(t)return t}const n=Rs(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=ks.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(ks.size>=10){const t=ks.keys().next().value;void 0!==t&&ks.delete(t)}return ks.set(e,{type:n,quality:i,result:a}),a}catch(t){return e}}(r,n,o.type,o.quality)),As(t,o)}if("image"===e)return As(n,o)}return n}if("xlink:href"===n&&"#"!==i[0]){const n=Rs(t,i);return"image"===e&&n.startsWith("data:")?As(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(Ms),e.length>n;){let o=i(Is);if(","===o.slice(-1))o=Rs(t,o.substring(0,o.length-1)),r.push(o);else{let i="";o=Rs(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?ys(i,Es(t)):"object"===e&&"data"===n?Rs(t,i):i:Rs(t,i)}function Os(t,e,n){return("video"===t||"audio"===t)&&"autoplay"===us(e)}function Ps(t){return"string"==typeof t&&us(t).split(/\s+/).includes("stylesheet")}function Ls(t,e,n){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return!!n&&Ls(yo.parentNode(t),e,n);for(let n=t.classList.length;n--;)if(e.test(t.classList[n]))return!0;return!!n&&Ls(yo.parentNode(t),e,n)}function Ds(t,e,n,i){let r;if(Go(t)){if(r=t,!yo.childNodes(r).length)return!1}else{if(null===yo.parentElement(t))return!1;r=yo.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(Ls(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 Fs(t,e,n){const i=t.removeEventListener;"function"==typeof i&&i.call(t,e,n)}var Ns=new Map;function qs(t,e){return Array.from(t.styleSheets).find(t=>t.href===e)}function js(t){return null==t?"":t.toLowerCase()}var Bs=!1,zs=!1;function Hs(t,e){const{doc:n,mirror:i,blockClass:r,blockSelector:o,maskTextClass:s,maskTextSelector:a,skipChild:l=!1,inlineStylesheet:u=!0,maskInputOptions:c={},maskTextFn:d,maskInputFn:h,maskAllElementAttributes:f=!1,maskAttributeFn:v,slimDOMOptions:p,dataURLOptions:m={},inlineImages:g=!1,recordCanvas:y=!1,canvasMaskingConfigured:b,onSerialize:w,onIframeLoad:k,iframeLoadTimeout:_=5e3,onIframeListenerRegistered:S,onStylesheetLoad:x,stylesheetLoadTimeout:C=5e3,keepIframeSrcFn:I=()=>!1,newlyAddedElement:M=!1,depth:T=0,maxDepth:R=50}=e;let{needsMask:E}=e,{preserveWhiteSpace:A=!0}=e;if(T>=R)return zs=!0,Bs||(Bs=!0,console.warn(`[rrweb-snapshot] DOM tree depth exceeded max depth of ${R}. Children beyond this depth will not be recorded. This may indicate deeply nested DOM structures.`)),null;E||(E=Ds(t,s,a,void 0===E)),xo>0&&(Mo.nodeCount+=1);const O=function(t,e){const{doc:n,mirror:i,blockClass:r,blockSelector:o,needsMask:s,inlineStylesheet:a,maskInputOptions:l={},maskTextFn:u,maskInputFn:c,maskAllElementAttributes:d=!1,maskAttributeFn:h,dataURLOptions:f={},inlineImages:v,recordCanvas:p,canvasMaskingConfigured:m,keepIframeSrcFn:g,newlyAddedElement:y=!1}=e,b=function(t,e){if(!e.hasNode(t))return;const n=e.getId(t);return 1===n?void 0:n}(n,i);switch(t.nodeType){case t.DOCUMENT_NODE:return"CSS1Compat"!==t.compatMode?{type:io.Document,childNodes:[],compatMode:t.compatMode}:{type:io.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:io.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:b};case t.ELEMENT_NODE:return function(t,e){const{doc:n,blockClass:i,blockSelector:r,inlineStylesheet:o,maskInputOptions:s={},maskInputFn:a,maskAllElementAttributes:l=!1,maskAttributeFn:u,dataURLOptions:c={},inlineImages:d,recordCanvas:h,canvasMaskingConfigured:f,keepIframeSrcFn:v,newlyAddedElement:p=!1,rootId:m}=e,g=function(t,e,n){try{if("string"==typeof e){if(t.classList.contains(e))return!0}else for(let n=t.classList.length;n--;)if(e.test(t.classList[n]))return!0;if(n)return t.matches(n)}catch(t){}return!1}(t,i,r),y=function(t){if(t instanceof HTMLFormElement)return"form";const e=us(t.tagName);return Ss.test(e)?"div":e}(t),b=new Set;let w={};const k=t.attributes.length;for(let e=0;k>e;e++){const i=t.attributes[e];Os(y,i.name)||(w[i.name]=$s(n,y,us(i.name),i.value,t,c))}if("link"===y&&o&&!g&&Ps(w.rel)){let e=t.sheet;if(!e){const i=function(t){return t.href}(t);i&&(e=qs(n,i),!e&&i.includes(".css"))&&(e=qs(n,window.location.origin+"/"+i.replace(window.location.href,"")))}let i=null;e&&(Bo(e)?xo>0&&(Eo.push(t),Ao+=1):i=Yo(e)),i&&(delete w.rel,delete w.href,w._cssText=i)}var _;if("style"===y&&t.sheet&&!(t.innerText||yo.textContent(t)||"").trim().length){const e=qo(()=>Yo(t.sheet));e&&(w._cssText=e)}if("input"===y||"textarea"===y||"select"===y){const e=t.value,n=t.checked;"radio"!==w.type&&"checkbox"!==w.type&&"submit"!==w.type&&"button"!==w.type&&e?w.value=ls({element:t,type:fs(t),tagName:y,value:e,maskInputOptions:s,maskInputFn:a}):n&&(w.checked=n)}if("option"===y&&(t.selected&&!s.select?w.selected=!0:delete w.selected),"dialog"===y&&t.open){try{w.rr_open_mode=t.matches("dialog:modal")?"modal":"non-modal"}catch(t){w.rr_open_mode="modal",w.ph_rr_could_not_detect_modal=!0}b.add("rr_open_mode")}if("canvas"===y&&h&&!(null==f?void 0:f()))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=hs in r?r[hs]: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)||(w.rr_dataURL=t.toDataURL(c.type,c.quality));else if(!("__context"in t)){const e=t.toDataURL(c.type,c.quality),i=n.createElement("canvas");i.width=t.width,i.height=t.height,e!==i.toDataURL(c.type,c.quality)&&(w.rr_dataURL=e)}}catch(t){"SecurityError"===(null==(_=t)?void 0:_.name)?Cs||(Cs=!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.",_)):console.warn("Cannot read canvas pixels, so this canvas is left out of the recording.",_)}let S,x=!1;if("img"===y&&d){bs||(bs=n.createElement("canvas"),ws=bs.getContext("2d"));const e=t,i=e.currentSrc||e.getAttribute("src")||"<unknown-src>",r=e.crossOrigin,o=(e,n)=>x?ds({element:t,name:e,value:n,maskAllElementAttributes:l,maskAttributeFn:u}):n,s=()=>{Fs(e,"load",s);try{bs.width=e.naturalWidth,bs.height=e.naturalHeight,ws.drawImage(e,0,0);const t=bs.toDataURL(c.type,c.quality);w.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=${i}! Error: ${t}`)}"anonymous"===e.crossOrigin&&(r?w.crossOrigin=o("crossOrigin",r):e.removeAttribute("crossorigin"))};e.complete&&0!==e.naturalWidth?s():e.addEventListener("load",s)}if("audio"===y||"video"===y){const e=w;e.rr_mediaState=t.paused?"paused":"played",b.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(p||(t.scrollLeft&&(w.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(w.rr_scrollTop=t.scrollTop)),g){var C,I,M;const{width:e,height:i,left:r,top:o}=t.getBoundingClientRect(),s=null===(C=n.defaultView)||void 0===C?void 0:C.getComputedStyle(t);w={class:w.class,rr_width:`${e}px`,rr_height:`${i}px`,rr_left:`${Math.floor(r+((null===(I=n.defaultView)||void 0===I?void 0:I.scrollX)||0))}px`,rr_top:`${Math.floor(o+((null===(M=n.defaultView)||void 0===M?void 0:M.scrollY)||0))}px`},b.add("rr_width"),b.add("rr_height"),b.add("rr_left"),b.add("rr_top"),s&&(w.rr_position=s.position||"static",b.add("rr_position"),s.transform&&"none"!==s.transform&&(w.rr_transform=s.transform,b.add("rr_transform")),s.display&&s.display.startsWith("inline")&&(w.rr_display=s.display,b.add("rr_display")))}if("iframe"!==y||v(w.src)||(t.contentDocument||(w.rr_src=w.src),delete w.src),l||u)for(const[e,n]of Object.entries(w))"string"!=typeof n&&null!==n||(w[e]=ds({element:t,name:e,value:n,maskAllElementAttributes:l,maskAttributeFn:u,isGenerated:b.has(e)}));x=!0;try{customElements.get(y)&&(S=!0)}catch(t){}return{type:io.Element,tagName:y,attributes:w,childNodes:[],isSVG:(T=t,Boolean("svg"===T.tagName||T.ownerSVGElement)||void 0),needBlock:g,rootId:m,isCustom:S};var T}(t,{doc:n,blockClass:r,blockSelector:o,inlineStylesheet:a,maskInputOptions:l,maskInputFn:c,maskAllElementAttributes:d,maskAttributeFn:h,dataURLOptions:f,inlineImages:v,recordCanvas:p,canvasMaskingConfigured:m,keepIframeSrcFn:g,newlyAddedElement:y,rootId:b});case t.TEXT_NODE:return function(t,e){const{needsMask:n,maskTextFn:i,rootId:r}=e,o=yo.parentNode(t),s=o&&o.tagName;let a=yo.textContent(t);const l="STYLE"===s||void 0,u="SCRIPT"===s||void 0;if(l&&a){try{var c;if(t.nextSibling||t.previousSibling);else if(Bo(o.sheet));else if(null===(c=o.sheet)||void 0===c?void 0:c.cssRules){const t=Yo(o.sheet);t&&!/(?:^|[\s;{}])-?[a-zA-Z][\w-]*\s*:\s*;/.test(t)&&(a=t)}}catch(e){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${e}`,t)}a=ys(a,Es(e.doc))}return u&&(a="SCRIPT_PLACEHOLDER"),!l&&!u&&a&&n&&(a=i?i(a,yo.parentElement(t)):a.replace(/[\S]/g,"*")),{type:io.Text,textContent:a||"",isStyle:l,rootId:r}}(t,{doc:n,needsMask:s,maskTextFn:u,rootId:b});case t.CDATA_SECTION_NODE:return{type:io.CDATA,textContent:"",rootId:b};case t.COMMENT_NODE:return{type:io.Comment,textContent:yo.textContent(t)||"",rootId:b};default:return!1}}(t,{doc:n,mirror:i,blockClass:r,blockSelector:o,needsMask:E,inlineStylesheet:u,maskInputOptions:c,maskTextFn:d,maskInputFn:h,maskAllElementAttributes:f,maskAttributeFn:v,dataURLOptions:m,inlineImages:g,recordCanvas:y,canvasMaskingConfigured:b,keepIframeSrcFn:I,newlyAddedElement:M});if(!O)return console.warn(t,"not serialized"),null;let P;P=i.hasNode(t)?i.getId(t):function(t,e){if(e.comment&&t.type===io.Comment)return!0;if(t.type===io.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&&(js(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===js(t.attributes.name)||["icon","apple-touch-icon","shortcut icon"].includes(js(t.attributes.rel)))))return!0;if("meta"===t.tagName){if(e.headMetaDescKeywords&&js(t.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(js(t.attributes.property).match(/^(og|twitter|fb):/)||js(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===js(t.attributes.name)))return!0;if(e.headMetaRobots&&["robots","googlebot","bingbot"].includes(js(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(js(t.attributes.name))||js(t.attributes.property).match(/^article:/)||js(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(js(t.attributes.name)))return!0}}return!1}(O,p)||!A&&O.type===io.Text&&!O.isStyle&&!O.textContent.replace(/^\s+|\s+$/gm,"").length?-2:xs();const L=Object.assign(O,{id:P});if(i.add(t,L),-2===P)return null;w&&w(t);let D=!l;if(L.type===io.Element){D=D&&!L.needBlock,delete L.needBlock;const e=yo.shadowRoot(t);e&&Zo(e)&&(L.isShadowHost=!0)}if((L.type===io.Document||L.type===io.Element)&&D){p.headWhitespace&&L.type===io.Element&&"head"===L.tagName&&(A=!1);const e={doc:n,mirror:i,blockClass:r,blockSelector:o,needsMask:E,maskTextClass:s,maskTextSelector:a,skipChild:l,inlineStylesheet:u,maskInputOptions:c,maskTextFn:d,maskInputFn:h,maskAllElementAttributes:f,maskAttributeFn:v,slimDOMOptions:p,dataURLOptions:m,inlineImages:g,recordCanvas:y,canvasMaskingConfigured:b,preserveWhiteSpace:A,onSerialize:w,onIframeLoad:k,iframeLoadTimeout:_,onIframeListenerRegistered:S,onStylesheetLoad:x,stylesheetLoadTimeout:C,keepIframeSrcFn:I,depth:T+1,maxDepth:R};if(L.type===io.Element&&"textarea"===L.tagName&&void 0!==L.attributes.value);else for(const n of Array.from(yo.childNodes(t))){const t=Hs(n,e);t&&L.childNodes.push(t)}let M=null;if(Go(t)&&(M=yo.shadowRoot(t)))for(const t of Array.from(yo.childNodes(M))){const n=Hs(t,e);n&&(Zo(M)&&(n.isShadow=!0),L.childNodes.push(n))}}const F=yo.parentNode(t);if(F&&Qo(F)&&Zo(F)&&(L.isShadow=!0),L.type===io.Element&&"iframe"===L.tagName){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),Fs(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?Fs(t,"load",s):(i=!0,Fs(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),Fs(t,"load",s)}}return t.addEventListener("load",s),()=>{Fs(t,"load",s)}}(t,()=>{const e=t.contentDocument;if(e&&k){const n=Hs(e,{doc:e,mirror:i,blockClass:r,blockSelector:o,needsMask:E,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:u,maskInputOptions:c,maskTextFn:d,maskInputFn:h,maskAllElementAttributes:f,maskAttributeFn:v,slimDOMOptions:p,dataURLOptions:m,inlineImages:g,recordCanvas:y,canvasMaskingConfigured:b,preserveWhiteSpace:A,onSerialize:w,onIframeLoad:k,iframeLoadTimeout:_,onIframeListenerRegistered:S,onStylesheetLoad:x,stylesheetLoadTimeout:C,keepIframeSrcFn:I,depth:T+1,maxDepth:R});n&&k(t,n)}},_);null==S||S(t,e)}return L.type===io.Element&&"link"===L.tagName&&Ps(L.attributes.rel)&&function(e,l,S){if(Ns.has(e))return;let M;try{M=e.sheet}catch(t){return}if(M)return;const O=new AbortController;let P=!1;const L=()=>{if(!P){P=!0;try{(()=>{if(x){const e=Hs(t,{doc:n,mirror:i,blockClass:r,blockSelector:o,needsMask:E,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:u,maskInputOptions:c,maskTextFn:d,maskInputFn:h,maskAllElementAttributes:f,maskAttributeFn:v,slimDOMOptions:p,dataURLOptions:m,inlineImages:g,recordCanvas:y,canvasMaskingConfigured:b,preserveWhiteSpace:A,onSerialize:w,onIframeLoad:k,iframeLoadTimeout:_,onStylesheetLoad:x,stylesheetLoadTimeout:C,keepIframeSrcFn:I,depth:T,maxDepth:R});e&&x(t,e)}})()}finally{Ns.delete(e),O.abort()}}},D=setTimeout(L,S);O.signal.addEventListener("abort",()=>clearTimeout(D),{once:!0}),e.addEventListener("load",L,{signal:O.signal,once:!0}),Ns.set(e,O)}(t,0,C),L}function Us(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 Ws=class t{constructor(...t){Vo(this,"parentElement",null),Vo(this,"parentNode",null),Vo(this,"ownerDocument",void 0),Vo(this,"firstChild",null),Vo(this,"lastChild",null),Vo(this,"previousSibling",null),Vo(this,"nextSibling",null),Vo(this,"ELEMENT_NODE",1),Vo(this,"TEXT_NODE",3),Vo(this,"nodeType",void 0),Vo(this,"nodeName",void 0),Vo(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 Vs(t,e,n=document){const i={capture:!0,passive:!0};return n.addEventListener(t,e,i),()=>Gs(n,t,e,i)}function Gs(t,e,n,i){Qs(()=>{const r=t.removeEventListener;"function"==typeof r&&(void 0!==i?r.call(t,e,n,i):r.call(t,e,n))})}function Qs(t){try{t()}catch(t){if(!(t instanceof DOMException&&"SecurityError"===t.name))throw t}}function Zs(t){t.forEach(t=>{if("function"==typeof t)try{t()}catch(t){}})}var Js="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.",Ks={map:{},getId(){return console.warn(Js),-1},getNode(){return console.warn(Js),null},removeNodeFromMap(){console.warn(Js)},has(){return console.warn(Js),!1},reset(){console.warn(Js)}};function Xs(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 Ys(t,e,n,i,r=window){const o=r.Object.getOwnPropertyDescriptor(t,e),s=()=>Ys(t,e,o||{},!0);if(i)return r.Object.defineProperty(t,e,n),s;const a=function(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){}}}(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&&(Ks=new Proxy(Ks,{get(t,e,n){return"map"===e&&console.warn(Js),Reflect.get(t,e,n)}}));var ta=Date.now;function ea(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=yo.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=yo.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 na(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function ia(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function ra(t){return t?t.nodeType===t.ELEMENT_NODE?t:yo.parentElement(t):null}function oa(t,e,n,i){if(!t)return!1;const r=ra(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(Ls(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 sa(t,e,n){return!("TITLE"!==t.tagName||!n.headTitleMutations)||-2===e.getId(t)}function aa(t,e){if(Qo(t))return!1;const n=e.getId(t);if(!e.has(n))return!0;const i=yo.parentNode(t);return(!i||i.nodeType!==t.DOCUMENT_NODE)&&(!i||aa(i,e))}function la(t){return Boolean(t.changedTouches)}function ua(t,e){return Boolean("IFRAME"===t.nodeName&&e.getMeta(t))}function ca(t,e){return Boolean("LINK"===t.nodeName&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&"stylesheet"===t.getAttribute("rel")&&e.getMeta(t))}function da(t){return!!t&&(t instanceof Ws&&"shadowRoot"in t?Boolean(t.shadowRoot):Boolean(yo.shadowRoot(t)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(ta=()=>(new Date).getTime());var ha=class{constructor(){Vo(this,"id",1),Vo(this,"styleIDMap",new WeakMap),Vo(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 fa(t){var e;let n=null;return"getRootNode"in t&&(null===(e=yo.getRootNode(t))||void 0===e?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&yo.host(yo.getRootNode(t))&&(n=yo.host(yo.getRootNode(t))),n}function va(t){const e=t.ownerDocument;if(!e)return!1;if(yo.contains(e,t))return!0;const n=yo.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=fa(n);)n=e;return n}(t);return yo.contains(e,n)}(t)}function pa(t){return"__ln"in t}var ma,ga=class{constructor(){Vo(this,"length",0),Vo(this,"head",null),Vo(this,"tail",null)}get(t){if(t>=this.length)throw new Error("Position outside of list range");let e=this.head;for(let n=0;t>n;n++)e=(null==e?void 0:e.next)||null;return e}addNode(t){const e={value:t,previous:null,next:null};if(t.__ln=e,t.previousSibling&&pa(t.previousSibling)){const n=t.previousSibling.__ln.next;e.next=n,e.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=e,n&&(n.previous=e)}else if(t.nextSibling&&pa(t.nextSibling)&&t.nextSibling.__ln.previous){const n=t.nextSibling.__ln.previous;e.previous=n,e.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=e,n&&(n.next=e)}else this.head&&(this.head.previous=e),e.next=this.head,this.head=e;null===e.next&&(this.tail=e),this.length++}removeNode(t){const e=t.__ln;this.head&&(e.previous?(e.previous.next=e.next,e.next?e.next.previous=e.previous:this.tail=e.previous):(this.head=e.next,this.head?this.head.previous=null:this.tail=null),t.__ln&&delete t.__ln,this.length--)}},ya=(t,e)=>`${t}@${e}`,ba=class{constructor(){Vo(this,"frozen",!1),Vo(this,"locked",!1),Vo(this,"texts",[]),Vo(this,"attributes",[]),Vo(this,"attributeMap",new WeakMap),Vo(this,"generatedAttributes",new WeakMap),Vo(this,"removes",[]),Vo(this,"mapRemoves",new Set),Vo(this,"movedMap",{}),Vo(this,"addedSet",new Set),Vo(this,"movedSet",new Set),Vo(this,"droppedSet",new Set),Vo(this,"removesSubTreeCache",new Set),Vo(this,"mutationCb",void 0),Vo(this,"blockClass",void 0),Vo(this,"blockSelector",void 0),Vo(this,"maskTextClass",void 0),Vo(this,"maskTextSelector",void 0),Vo(this,"inlineStylesheet",void 0),Vo(this,"maskInputOptions",void 0),Vo(this,"maskTextFn",void 0),Vo(this,"maskInputFn",void 0),Vo(this,"maskAllElementAttributes",void 0),Vo(this,"maskAttributeFn",void 0),Vo(this,"keepIframeSrcFn",void 0),Vo(this,"recordCanvas",void 0),Vo(this,"canvasMaskingConfigured",void 0),Vo(this,"inlineImages",void 0),Vo(this,"slimDOMOptions",void 0),Vo(this,"dataURLOptions",void 0),Vo(this,"doc",void 0),Vo(this,"mirror",void 0),Vo(this,"iframeManager",void 0),Vo(this,"stylesheetManager",void 0),Vo(this,"shadowDomManager",void 0),Vo(this,"canvasManager",void 0),Vo(this,"processedNodeManager",void 0),Vo(this,"unattachedDoc",void 0),Vo(this,"canvasManagerReleased",!1),Vo(this,"processMutations",t=>{t.forEach(this.processMutation),this.emit()}),Vo(this,"emit",()=>{if(this.frozen||this.locked)return;const t=bo(),e=_o();try{this.processBufferedMutations()}finally{n=bo()-t,i=e,xo>0||So(n,null!=i?i:wo)||n>Oo.slowestBatchMs&&(Oo.slowestBatchMs=n)}var n,i}),Vo(this,"processBufferedMutations",()=>{const t=[],e=new Set,n=new ga,i=t=>{let e=t,n=-2;for(;-2===n;)e=e&&e.nextSibling,n=e&&this.mirror.getId(e);return n};let r;const o=o=>{var s;const a=yo.parentNode(o);if(!a||!va(o)||"TEXTAREA"===a.tagName)return;if(this.isBlockedAtEmission(a))return;const l=Qo(a)?this.mirror.getId(fa(o)):this.mirror.getId(a),u=i(o);if(-1===l||-1===u)return n.addNode(o);null!==(s=r)&&void 0!==s||(r={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,maskAllElementAttributes:this.maskAllElementAttributes,maskAttributeFn:this.maskAttributeFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,canvasMaskingConfigured:this.canvasMaskingConfigured,inlineImages:this.inlineImages,onSerialize:t=>{ua(t,this.mirror)&&this.iframeManager.addIframe(t),ca(t,this.mirror)&&this.stylesheetManager.trackLinkElement(t),da(t)&&!oa(t,this.blockClass,this.blockSelector,!0)&&this.shadowDomManager.addShadowRoot(yo.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)=>{this.stylesheetManager.attachLinkElement(t,e)}});const c=Hs(o,r);c&&(t.push({parentId:l,nextId:u,node:c}),e.add(c.id))};for(const t of this.mapRemoves)this.mapRemoves.delete(t),this.mirror.removeNodeFromMap(t);for(const t of this.movedSet)ka(this.removesSubTreeCache,t)&&!this.movedSet.has(yo.parentNode(t))||o(t);for(const t of this.addedSet)_a(this.droppedSet,t)||ka(this.removesSubTreeCache,t)?_a(this.movedSet,t)?o(t):this.droppedSet.add(t):o(t);let s=null;for(;n.length;){let t=null;if(s){const e=this.mirror.getId(yo.parentNode(s.value)),n=i(s.value);-1!==e&&-1!==n&&(t=s)}if(!t){let e=n.tail;for(;e;){const n=e;if(e=e.previous,n){const e=this.mirror.getId(yo.parentNode(n.value));if(-1===i(n.value))continue;if(-1!==e){t=n;break}{const e=yo.parentNode(n.value);if(e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const i=yo.host(e);if(-1!==this.mirror.getId(i)){t=n;break}}}}}}if(!t){for(;n.head;)n.removeNode(n.head.value);break}s=t.previous,n.removeNode(t.value),o(t.value)}const a={texts:this.texts.filter(t=>!this.isBlockedAtEmission(t.node)).map(t=>{const e=t.node,n=yo.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:this.attributes.filter(t=>!this.isBlockedAtEmission(t.node)).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]=ds({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};this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.generatedAttributes=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.removesSubTreeCache=new Set,this.movedMap={},(a.texts.length||a.attributes.length||a.removes.length||a.adds.length)&&this.mutationCb(a)}),Vo(this,"bufferBelongsToIframe",t=>this.doc===t.contentDocument),Vo(this,"genTextAreaValueMutation",t=>{let e=this.attributeMap.get(t);e||(e={node:t,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(e),this.attributeMap.set(t,e));const n=Array.from(yo.childNodes(t),t=>yo.textContent(t)||"").join("");e.attributes.value=ls({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:fs(t),value:n,maskInputFn:this.maskInputFn})}),Vo(this,"processMutation",t=>{if(!sa(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":{const e=yo.textContent(t.target);oa(t.target,this.blockClass,this.blockSelector,!1)||e===t.oldValue||this.texts.push({value:Ds(t.target,this.maskTextClass,this.maskTextSelector,!0)&&e?this.maskTextFn?this.maskTextFn(e,ra(t.target)):e.replace(/[\S]/g,"*"):e,node:t.target});break}case"attributes":{var e;const i=t.target,r=us(i.tagName),o=t.attributeName,s=null!==(e=t.attributeNamespace)&&void 0!==e?e: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}(i,o,s),l=s?i.getAttributeNS(s,o):t.target.getAttribute(o);if("value"===a){const t=i,e=fs(t);l=ls({element:t,maskInputOptions:this.maskInputOptions,tagName:i.tagName,type:e,value:l,maskInputFn:this.maskInputFn})}if(oa(t.target,this.blockClass,this.blockSelector,!1)||l===t.oldValue)return;let u=this.attributeMap.get(t.target);const c="iframe"===r&&"src"===a;if(c&&!this.keepIframeSrcFn(l)&&i.contentDocument)return;if("type"===a&&"input"===r&&"password"===(t.oldValue||"").toLowerCase()&&i.setAttribute("data-rr-is-password","true"),!Os(r,a)){var n;u||(u={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(u),this.attributeMap.set(t.target,u));const e=$s(this.doc,r,us(a),l,i,this.dataURLOptions);if(c&&!this.keepIframeSrcFn(l)&&(a="rr_src"),u.attributes[a]=e,null===(n=this.generatedAttributes.get(t.target))||void 0===n||n.delete(a),"style"===a){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(t){this.unattachedDoc=this.doc}const e=this.unattachedDoc.createElement("span"),n=i.style;t.oldValue&&(e.style.cssText=t.oldValue);for(const t of Array.from(n)){const i=n.getPropertyValue(t),r=n.getPropertyPriority(t);i!==e.style.getPropertyValue(t)||r!==e.style.getPropertyPriority(t)?u.styleDiff[t]=""===r?i:[i,r]:u._unchangedStyles[t]=[i,r]}for(const t of Array.from(e.style))""===n.getPropertyValue(t)&&(u.styleDiff[t]=!1)}else if("open"===a&&"dialog"===r){u.attributes.rr_open_mode=i.matches("dialog:modal")?"modal":"non-modal";let e=this.generatedAttributes.get(t.target);e||(e=new Set,this.generatedAttributes.set(t.target,e)),e.add("rr_open_mode")}}break}case"childList":if(oa(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=Qo(t.target)?this.mirror.getId(yo.host(t.target)):this.mirror.getId(t.target);oa(t.target,this.blockClass,this.blockSelector,!1)||sa(e,this.mirror,this.slimDOMOptions)||!function(t,e){return-1!==e.getId(t)}(e,this.mirror)||(this.addedSet.has(e)?(wa(this.addedSet,e),this.droppedSet.add(e)):this.addedSet.has(t.target)&&-1===n||aa(t.target,this.mirror)||(this.movedSet.has(e)&&this.movedMap[ya(n,i)]?wa(this.movedSet,e):(this.removes.push({parentId:i,id:n,isShadow:!(!Qo(t.target)||!Zo(t.target))||void 0}),function(t,e){const n=[t];for(;n.length;){const t=n.pop();e.has(t)||(e.add(t),yo.childNodes(t).forEach(t=>n.push(t)))}}(e,this.removesSubTreeCache))),this.mapRemoves.add(e))})}}),Vo(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(sa(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[ya(this.mirror.getId(t),n)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);if(!oa(t,this.blockClass,this.blockSelector,!1)){if(t.nodeType===t.TEXT_NODE)return;const e=yo.childNodes(t);for(let t=0,n=e.length;n>t;t++){const n=e[t];n&&this.genAdds(n)}if(da(t)){const e=yo.childNodes(yo.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","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()}reset(){this.releaseCanvasManager()}releaseCanvasManager(){this.canvasManagerReleased||(this.canvasManagerReleased=!0,this.canvasManager.reset())}bufferDoc(){return this.doc}destroy(){for(const t of this.mapRemoves)this.mapRemoves.delete(t),this.mirror.removeNodeFromMap(t)}isBlockedAtEmission(t){const e=this.blockClass,n=e&&"string"!=typeof e&&(e.global||e.sticky)?new RegExp(e):null;for(;t;){if(n&&(n.lastIndex=0),oa(t,n||e,this.blockSelector,!0))return!0;const i="getRootNode"in t?yo.getRootNode(t):null;t=(null==i?void 0:i.nodeType)===Node.DOCUMENT_FRAGMENT_NODE?yo.host(i):null}return!1}};function wa(t,e){const n=[e];for(;n.length;){const e=n.pop();if(t.delete(e),e.nodeType===e.TEXT_NODE)continue;const i=yo.childNodes(e);for(let t=0,e=i.length;e>t;t++){const e=i[t];e&&n.push(e)}}}function ka(t,e,n){return 0!==t.size&&function(t,e){const n=yo.parentNode(e);return!!n&&t.has(n)}(t,e)}function _a(t,e){if(0===t.size)return!1;let n=yo.parentNode(e);for(;n;){if(t.has(n))return!0;n=yo.parentNode(n)}return!1}function Sa(t){ma=t}function xa(){ma=void 0}var Ca=(t,e="rrweb")=>ma?(...n)=>{try{return t(...n)}catch(t){if(ma&&!0===ma(t,e))return;throw t}}:t,Ia=[];function Ma(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 Ta(t,e){const n=new ba;let i;n.init(t);try{i=new(mo())(Ca(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),Ia.push(n),{observer:i,buffer:n}}catch(t){try{null==i||i.disconnect(),n.destroy(),n.reset()}catch(t){}throw t}}function Ra({scrollCb:t,doc:e,mirror:n,blockClass:i,blockSelector:r,sampling:o}){const s=new Map,a=o=>{const a=Ma(o);if(!a||oa(a,i,r,!0))return;const l=n.getId(a);let u,c;if(a===e&&e.defaultView){const t=ea(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=[Vs("scroll",Ca(Xs(Ca(t=>a(t)),o.scroll||100)),e)];return"onscrollend"in e&&l.push(Vs("scrollend",Ca(a),e)),()=>l.forEach(t=>t())}function Ea(t,e){for(let n=Ia.length-1;n>=0;n--){const i=Ia[n];if(!i)continue;let r=i.bufferBelongsToIframe(t);!r&&e&&e.has(i.bufferDoc())&&(r=!0),r&&(i.reset(),Ia.splice(n,1))}}var Aa=["INPUT","TEXTAREA","SELECT"],$a=new WeakMap;function Oa(t){return function t(e,n){if(Na("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||Na("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||Na("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||Na("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 Pa(t,e,n){let i,r;return t?(t.ownerNode?i=e.getId(t.ownerNode):r=n.getId(t),{styleId:r,id:i}):{}}function La({mirror:t,stylesheetManager:e},n){var i,r;let o=null;o=t.getId("#document"===n.nodeName?n:yo.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=(null==s?void 0:s.prototype)?Object.getOwnPropertyDescriptor(null==s?void 0:s.prototype,"adoptedStyleSheets"):void 0;return null!==o&&-1!==o&&s&&a?(Object.defineProperty(n,"adoptedStyleSheets",{configurable:a.configurable,enumerable:a.enumerable,get(){var t;return null===(t=a.get)||void 0===t?void 0:t.call(this)},set(t){let n;try{var i;n=null===(i=a.set)||void 0===i?void 0:i.call(this,t)}catch(t){if(t&&"object"==typeof t&&"NotAllowedError"===t.name)return;throw t}if(null!==o&&-1!==o)try{e.adoptStyleSheets(t,o)}catch(t){}return n}}),Ca(()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:a.configurable,enumerable:a.enumerable,get:a.get,set:a.set})})):()=>{}}var Da=new Set;function Fa(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=Ca(()=>{try{if(r)try{r.destroy(),r.reset()}finally{const t=Ia.indexOf(r);-1!==t&&Ia.splice(t,1)}t.shadowDomManager.resetForDoc(t.doc),null==i||i.disconnect()}finally{Zs(o)}}),a=(t,e)=>{const n=Ca(()=>{try{return e()}catch(e){throw Da.add(t),e}})();"function"==typeof n&&o.push(n)};try{if(t.recordDOM&&a("mutation",()=>{const e=Ta(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=Xs(Ca(e=>{const n=Date.now()-s;t(a.map(t=>(t.timeOffset-=n,t)),e),a=[],s=null}),o),u=Ca(Xs(Ca(t=>{const e=Ma(t),{clientX:n,clientY:r}=la(t)?t.changedTouches[0]:t;s||(s=ta()),a.push({x:n,y:r,id:i.getId(e),timeOffset:ta()-s}),l("undefined"!=typeof DragEvent&&t instanceof DragEvent?Xr.Drag:t instanceof MouseEvent?Xr.MouseMove:Xr.TouchMove)}),r,{trailing:!1})),c=[Vs("mousemove",u,n),Vs("touchmove",u,n),Vs("drag",u,n)];return Ca(()=>{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(Yr).filter(t=>Number.isNaN(Number(t))&&!t.endsWith("_Departed")&&!1!==s[t]).forEach(o=>{let s=us(o);const u=(e=>o=>{const s=Ma(o);if(oa(s,i,r,!0))return;let a=null,u=e;if("pointerType"in o){switch(o.pointerType){case"mouse":a=to.Mouse;break;case"touch":a=to.Touch;break;case"pen":a=to.Pen}a===to.Touch&&(Yr[e]===Yr.MouseDown?u="TouchStart":Yr[e]===Yr.MouseUp&&(u="TouchEnd"))}else la(o)&&(a=to.Touch);null!==a?(l=a,(u.startsWith("Touch")&&a===to.Touch||u.startsWith("Mouse")&&a===to.Mouse)&&(a=null)):Yr[e]===Yr.Click&&(a=l,l=null);const c=la(o)?o.changedTouches[0]:o;if(!c)return;const d=n.getId(s),{clientX:h,clientY:f}=c;Ca(t)(D({type:Yr[u],id:d,x:h,y:f},null!==a&&{pointerType:a}))})(o);if(window.PointerEvent)switch(Yr[o]){case Yr.MouseDown:case Yr.MouseUp:s=s.replace("mouse","pointer");break;case Yr.TouchStart:case Yr.TouchEnd:return}a.push(Vs(s,u,e))}),Ca(()=>{a.forEach(t=>t())})}(t)),a("scroll",()=>Ra(t)),a("viewportResize",()=>function({viewportResizeCb:t},{win:e}){let n=-1,i=-1;return Vs("resize",Ca(Xs(Ca(()=>{const e=na(),r=ia();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,sampling:u,userTriggeredOnInput:c}){function d(t){let n=Ma(t);const u=t.isTrusted,d=e.defaultView;if(n&&d&&!(n instanceof d.HTMLElement))return;const f=n&&n.tagName;if(n&&"OPTION"===f&&(n=yo.parentElement(n)),!n||!f||0>Aa.indexOf(f)||oa(n,i,r,!0))return;if(n.classList.contains(o)||s&&n.matches(s))return;let v=n.value,p=!1;const m=fs(n)||"";"radio"===m||"checkbox"===m?p=n.checked:(a[f.toLowerCase()]||a[m])&&(v=ls({element:n,maskInputOptions:a,tagName:f,type:m,value:v,maskInputFn:l})),h(n,c?{text:v,isChecked:p,userTriggered:u}:{text:v,isChecked:p});const g=n.name;"radio"===m&&g&&p&&e.querySelectorAll(`input[type="radio"][name="${g}"]`).forEach(t=>{if(t!==n){const e=t.value;h(t,c?{text:e,isChecked:!p,userTriggered:!1}:{text:e,isChecked:!p})}})}function h(e,i){const r=$a.get(e);if(!r||r.text!==i.text||r.isChecked!==i.isChecked){$a.set(e,i);const r=n.getId(e);Ca(t)(D(D({},i),{},{id:r}))}}const f=("last"===u.input?["change"]:["input","change"]).map(t=>Vs(t,Ca(d),e)),v=e.defaultView;if(!v)return()=>{f.forEach(t=>t())};const p=v.Object.getOwnPropertyDescriptor(v.HTMLInputElement.prototype,"value");return p&&p.set&&f.push(...[[v.HTMLInputElement.prototype,"value"],[v.HTMLInputElement.prototype,"checked"],[v.HTMLSelectElement.prototype,"value"],[v.HTMLTextAreaElement.prototype,"value"],[v.HTMLSelectElement.prototype,"selectedIndex"],[v.HTMLOptionElement.prototype,"selected"]].map(t=>Ys(t[0],t[1],{set(){Ca(d)({target:this,isTrusted:!1})}},!1,v))),Ca(()=>{Zs(f)})}(t)),a("mediaInteraction",()=>function({mediaInteractionCb:t,blockClass:e,blockSelector:n,mirror:i,sampling:r,doc:o}){const s=Ca(o=>Xs(Ca(r=>{const s=Ma(r);if(!s||oa(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=[Vs("play",s(no.Play),o),Vs("pause",s(no.Pause),o),Vs("seeked",s(no.Seeked),o),Vs("volumechange",s(no.VolumeChange),o),Vs("ratechange",s(no.RateChange),o)];return Ca(()=>{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:Ca((i,o,s)=>{const[a]=s,l=i.apply(o,s);n.onCssomSheetMutation(o);const{id:u,styleId:c}=Pa(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:Ca((i,o,s)=>{const[a]=s,l=i.apply(o,s);n.onCssomSheetMutation(o);const{id:u,styleId:c}=Pa(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:Ca((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;n.onCssomSheetMutation(o);const{id:s,styleId:u}=Pa(o,e,n.styleMirror);if(!(s&&-1!==s||u&&-1!==u))return l;const c=r.queuePendingMutation(o,()=>t({id:s,styleId:u,replace:a}),()=>{const e=Yo(o);null!==e&&t({id:s,styleId:u,replace:e})});try{i.call(l,()=>c(!0),()=>c(!1))}catch(t){c(!1)}}catch(t){}return l},"host")})),i.CSSStyleSheet.prototype.replaceSync&&(l=i.CSSStyleSheet.prototype.replaceSync,i.CSSStyleSheet.prototype.replaceSync=new Proxy(l,{apply:Ca((i,o,s)=>{const[a]=s,l=i.apply(o,s);n.onCssomSheetMutation(o);const{id:u,styleId:c}=Pa(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={};qa("CSSGroupingRule")?u.CSSGroupingRule=i.CSSGroupingRule:(qa("CSSMediaRule")&&(u.CSSMediaRule=i.CSSMediaRule),qa("CSSConditionRule")&&(u.CSSConditionRule=i.CSSConditionRule),qa("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:Ca((i,o,s)=>{const[a]=s,l=i.apply(o,s);n.onCssomSheetMutation(o.parentStyleSheet);const{id:u,styleId:c}=Pa(o.parentStyleSheet,e,n.styleMirror);if(o.parentStyleSheet&&(u&&-1!==u||c&&-1!==c)){const e=[...Oa(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:Ca((i,o,s)=>{const[a]=s,l=i.apply(o,s);n.onCssomSheetMutation(o.parentStyleSheet);const{id:u,styleId:c}=Pa(o.parentStyleSheet,e,n.styleMirror);if(o.parentStyleSheet&&(u&&-1!==u||c&&-1!==c)){const e=[...Oa(o),a];r.queueMutation(o.parentStyleSheet,()=>t({id:u,styleId:c,removes:[{index:e}]}))}return l},"host")})}),Ca(()=>{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",()=>La(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:Ca((r,s,a)=>{var l;const[u,c,d]=a,h=r.apply(s,a);if(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}=Pa(f,e,i.styleMirror);if(v&&-1!==v||p&&-1!==p){const e=Oa(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:Ca((r,s,a)=>{var l;const[u]=a,c=r.apply(s,a);if(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}=Pa(d,e,i.styleMirror);if(h&&-1!==h||f&&-1!==f){const e=Oa(s.parentRule);o.queueMutation(d,()=>t({id:h,styleId:f,remove:{property:u},index:e}))}return c},"host")}),Ca(()=>{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=go(e.fonts,"add",function(e){return function(n){return setTimeout(Ca(()=>{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),Ca(()=>{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=Ca(()=>{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);oa(o,i,r,!0)||oa(l,i,r,!0)||a.push({start:n.getId(o),startOffset:s,end:n.getId(l),endOffset:u})}o({ranges:a})});return a(),Vs("selectionchange",a)}(t)),a("customElement",()=>function({doc:t,customElementCb:e}){const n=t.defaultView;return n&&n.customElements?go(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 Na(t){return void 0!==window[t]}function qa(t){return Boolean(void 0!==window[t]&&window[t].prototype&&"insertRule"in window[t].prototype&&"deleteRule"in window[t].prototype)}var ja=class{constructor(t){Vo(this,"generateIdFn",void 0),Vo(this,"iframeRemoteIdToLocalIdMap",new WeakMap),Vo(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}},Ba=class{constructor(t){Vo(this,"iframes",new WeakMap),Vo(this,"crossOriginIframeMap",new WeakMap),Vo(this,"crossOriginIframeMirror",new ja(xs)),Vo(this,"crossOriginIframeStyleMirror",void 0),Vo(this,"crossOriginIframeRootIdMap",new WeakMap),Vo(this,"mirror",void 0),Vo(this,"mutationCb",void 0),Vo(this,"wrappedEmit",void 0),Vo(this,"loadListener",void 0),Vo(this,"pageHideListener",void 0),Vo(this,"stylesheetManager",void 0),Vo(this,"recordCrossOriginIframes",void 0),Vo(this,"messageHandler",void 0),Vo(this,"nestedIframeListeners",new Map),Vo(this,"attachedWindows",new WeakMap),Vo(this,"attachedDocuments",new WeakMap),Vo(this,"attachedIframes",new Map),Vo(this,"loadListenerDisposers",new WeakMap),Vo(this,"iframeElementsById",new Map),Vo(this,"pageHideHandlers",new WeakMap),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new ja(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){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=>Qs(t)),this.loadListenerDisposers.delete(t))}removePageHideListener(t){const e=this.pageHideHandlers.get(t);e&&(e.forEach(({win:t,handler:e})=>{Gs(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);Qs(()=>{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)})}Qs(()=>{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)}transformCrossOriginEvent(t,e){switch(e.type){case Kr.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:Kr.IncrementalSnapshot,data:{source:Xr.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:e.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case Kr.Meta:case Kr.Load:case Kr.DomContentLoaded:return!1;case Kr.Plugin:return e;case Kr.Custom:return this.replaceIds(e.data.payload,t,["id","parentId","previousId","nextId"]),e;case Kr.IncrementalSnapshot:switch(e.data.source){case Xr.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 Xr.Drag:case Xr.TouchMove:case Xr.MouseMove:return e.data.positions.forEach(e=>{this.replaceIds(e,t,["id"])}),e;case Xr.ViewportResize:return!1;case Xr.MediaInteraction:case Xr.MouseInteraction:case Xr.Scroll:case Xr.CanvasMutation:case Xr.Input:return this.replaceIds(e.data,t,["id"]),e;case Xr.StyleSheetRule:case Xr.StyleDeclaration:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleId"]),e;case Xr.Font:return e;case Xr.Selection:return e.data.ranges.forEach(e=>{this.replaceIds(e,t,["start","end"])}),e;case Xr.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===io.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&&(Gs(t,"message",e),this.nestedIframeListeners.delete(t)),this.crossOriginIframeMap.delete(t)}),this.attachedWindows.delete(n)),t&&this.nestedIframeListeners.has(t)&&(Gs(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=>{Qs(()=>this.mirror.removeNodeFromMap(t))}),Qs(()=>Ea(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&&Gs(window,"message",this.messageHandler),this.nestedIframeListeners.forEach((t,e)=>{Gs(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}},za=class{constructor(t){Vo(this,"shadowDoms",new WeakSet),Vo(this,"mutationCb",void 0),Vo(this,"scrollCb",void 0),Vo(this,"bypassOptions",void 0),Vo(this,"mirror",void 0),Vo(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(!Zo(t))return;if(this.shadowDoms.has(t))return;this.shadowDoms.add(t);const r=null!==(n=null===(i=yo.host(t))||void 0===i?void 0:i.ownerDocument)&&void 0!==n?n:e,{observer:o,buffer:s}=Ta(D(D({},this.bypassOptions),{},{doc:r,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t);this.restoreHandlers.push({doc:r,handler(){o.disconnect(),s.destroy(),s.releaseCanvasManager();const t=Ia.indexOf(s);-1!==t&&Ia.splice(t,1)}}),this.restoreHandlers.push({doc:r,handler:Ra(D(D({},this.bypassOptions),{},{scrollCb:this.scrollCb,doc:t,mirror:this.mirror}))}),setTimeout(()=>{t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(yo.host(t))),this.restoreHandlers.push({doc:r,handler:La({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t)})},0)}observeAttachShadow(t){Qs(()=>{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:go(t.prototype,"attachShadow",function(t){return function(i){const r=t.call(this,i),o=yo.shadowRoot(this);return o&&va(this)&&n.addShadowRoot(o,e),r}})})}reset(){this.restoreHandlers.forEach(({handler:t})=>{try{t()}catch(t){}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}resetForDoc(t){const e=[];for(const n of this.restoreHandlers)if(n.doc===t)try{n.handler()}catch(t){}else e.push(n);this.restoreHandlers=e}},Ha="skip-frame";function Ua(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 Wa="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Va="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Ga=0;64>Ga;Ga++)Va[Wa.charCodeAt(Ga)]=Ga;var Qa=function(t){var e,n=new Uint8Array(t),i=n.length,r="";for(e=0;i>e;e+=3)r+=Wa[n[e]>>2],r+=Wa[(3&n[e])<<4|n[e+1]>>4],r+=Wa[(15&n[e+1])<<2|n[e+2]>>6],r+=Wa[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},Za=!1,Ja=new Map,Ka=(t,e,n)=>{if(!t||!tl(t,e)&&"object"!=typeof t)return;const i=function(t,e){let n=Ja.get(t);return n||(n=new Map,Ja.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 Xa(t,e,n,i){if(t instanceof Array)return t.map(t=>Xa(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:Qa(t)};if(t instanceof DataView)return{rr_type:t.constructor.name,args:[Xa(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)?Za||(Za=!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:[Xa(t.data,e,n,i),t.width,t.height]}:tl(t,e)||"object"==typeof t?{rr_type:t.constructor.name,index:Ka(t,e,n)}:t}var Ya=(t,e,n,i)=>t.map(t=>Xa(t,e,n,i)),tl=(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]))},el=["webgl","webgl2"];function nl(t){return"nodeType"in t}function il(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 go(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||nl(o)&&oa(o,e,n,!0))return i.call(this,r);nl(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?D(D({},r),{},{usage:"number"==typeof r.usage?r.usage|s:s}):r)}})}(t,e,n);i&&r.push(i)}const o=go(t.HTMLCanvasElement.prototype,"getContext",function(t){return function(r,...o){const s=function(t){return"experimental-webgl"===t?"webgl":t}(r);if(!oa(this,e,n,!0)&&("__context"in this||(this.__context=s),i&&el.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 rl(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=go(t,u,function(t){return function(...a){const l=t.apply(this,a);if(Ka(l,o,this),this.canvas&&"tagName"in this.canvas&&!oa(this.canvas,i,r,!0)){let t;try{t=Ya(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=Ys(t,u,{set(t){this.canvas&&"tagName"in this.canvas&&!oa(this.canvas,i,r,!0)&&n(this.canvas,{type:e,property:u,args:[t],setter:!0})}});a.push(s)}return a}var ol='(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\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 fingerprint = frameFingerprint(width, height, ctx.getImageData(0, 0, width, height).data);\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(dataURLOptions);\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',sl="undefined"!=typeof self&&self.Blob&&new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);",ol],{type:"text/javascript;charset=utf-8"});function al(t){let e;try{if(e=sl&&(self.URL||self.webkitURL).createObjectURL(sl),!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(ol),{name:null==t?void 0:t.name})}}var ll="A page CSP that omits blob: from worker-src or script-src blocks it";function ul(t,...e){console.warn(`[replay] canvas capture: ${t}`,...e)}var cl,dl,hl,fl=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){Vo(this,"pendingCanvasMutations",new Map),Vo(this,"rafStamps",{latestId:0,invokeId:null}),Vo(this,"mirror",void 0),Vo(this,"mutationCb",void 0),Vo(this,"resetObservers",void 0),Vo(this,"frozen",!1),Vo(this,"locked",!1),Vo(this,"rafIdTimestamp",null),Vo(this,"rafIdFlush",null),Vo(this,"refCount",0),Vo(this,"torndown",!1),Vo(this,"resetFrameDedup",null),Vo(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 ul("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=il(e,n,i,!0),l=new Map;let u;try{u=new al}catch(t){return ul(`disabled because the encode worker did not start. ${ll}`,t),void a()}let c=!1;u.onerror=t=>{var e;c=!0,ul(`stopped because the encode worker failed. ${ll}`,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:eo["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=>{oa(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 Ha}if(void 0===s)return;if(!Array.isArray(s)||!s.every(Ua))return Ha;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,ul("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,ul("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=il(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=go(e.CanvasRenderingContext2D.prototype,a,function(o){return function(...s){return oa(this.canvas,n,i,!0)||setTimeout(()=>{let n;try{n=Ya(s,e,this,r)}catch(t){return}t(this.canvas,{type:eo["2D"],property:a,args:n})},0),o.apply(this,s)}});o.push(s)}catch(r){const s=Ys(e.CanvasRenderingContext2D.prototype,a,{set(e){oa(this.canvas,n,i,!0)||t(this.canvas,{type:eo["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(...rl(e.WebGLRenderingContext.prototype,eo.WebGL,t,n,i,e,r)),void 0!==e.WebGL2RenderingContext&&o.push(...rl(e.WebGL2RenderingContext.prototype,eo.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,Jr)),{type:r}=n[0];this.mutationCb({id:e,type:r,commands:i}),this.pendingCanvasMutations.delete(t)}},vl=class{constructor(t){var e;Vo(this,"trackedLinkElements",new WeakSet),Vo(this,"pendingDeferredSheets",new Set),Vo(this,"mutationCb",void 0),Vo(this,"adoptedStyleSheetCb",void 0),Vo(this,"maskAllElementAttributes",void 0),Vo(this,"maskAttributeFn",void 0),Vo(this,"styleMirror",new ha),this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb,this.maskAllElementAttributes=null!==(e=t.maskAllElementAttributes)&&void 0!==e&&e,this.maskAttributeFn=t.maskAttributeFn}attachLinkElement(t,e){"_cssText"in e.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:e.id,attributes:e.attributes}]}),this.trackLinkElement(t)}beginDeferredLinkInlining(t,e){if(-1===e||!t.isConnected)return null;let n=null,i=null;try{i=t.sheet,i&&(n=ss(i))}catch(t){}if(!n||!i)return Ho(),null;const r=n;let o=!1;const s={sheet:i,invalidate(){o=!0}};this.pendingDeferredSheets.add(s);let a=!1;return{advance:n=>{if(a)return!0;const l=bo(),u=_o();let c=!0;try{if(o)return a=!0,Ho(),!0;if(!r.advance(n))return c=!1,!1;a=!0;const s=r.text();if(!t.isConnected)return!0;let l=null;try{l=t.sheet}catch(t){}return l!==i?(Ho(),!0):s?(this.emitCssTextMutation(t,e,s),!0):(Ho(),!0)}finally{c&&this.pendingDeferredSheets.delete(s),So(d=bo()-l,null!=(h=u)?h:wo)||(Po.totalMs+=d,d>Po.slowestSliceMs&&(Po.slowestSliceMs=d))}var d,h},remainingRules:()=>r.remainingRules(),discard:()=>{this.pendingDeferredSheets.delete(s)}}}onCssomSheetMutation(t){if(t&&0!==this.pendingDeferredSheets.size)for(const e of this.pendingDeferredSheets)e.sheet===t&&(this.pendingDeferredSheets.delete(e),e.invalidate())}inlineDeferredLinkElement(t,e){var n;null===(n=this.beginDeferredLinkInlining(t,e))||void 0===n||n.advance(1/0)}emitCssTextMutation(t,e,n){this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:e,attributes:{_cssText:ds({element:t,name:"_cssText",value:n,maskAllElementAttributes:this.maskAllElementAttributes,maskAttributeFn:this.maskAttributeFn})}}]})}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=bo();try{qo(()=>{try{const t=e.rules||e.cssRules;t&&No(t)}catch(t){}i.push({styleId:n,rules:Array.from(e.rules||CSSRule,(t,n)=>({rule:ts(t,e.href),index:n}))})})}finally{jo(bo()-r)}}n.styleIds.push(t)}i.length>0&&(n.styles=i),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet,this.pendingDeferredSheets.clear(),Ns.forEach(t=>t.abort()),Ns.clear()}trackStylesheetInLinkElement(t){}},pl=class{constructor(){Vo(this,"nodeMap",new WeakMap),Vo(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(){}},ml=!1;try{if(2!==Array.from([1],t=>2*t)[0]){var gl;const t=document.createElement("iframe");document.body.appendChild(t),Array.from=(null===(gl=t.contentWindow)||void 0===gl?void 0:gl.Array.from)||Array.from,document.body.removeChild(t)}}catch(t){console.debug("Unable to override Array.from",t)}var yl=new as,bl=new Set([Xr.Mutation,Xr.MediaInteraction,Xr.StyleSheetRule,Xr.CanvasMutation,Xr.Font,Xr.Log,Xr.StyleDeclaration,Xr.AdoptedStyleSheet]);function wl(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)}}function kl(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,maskTextFn:b,maskAllElementAttributes:w=!1,maskAttributeFn:k,hooks:_,packFn:S,sampling:x={},dataURLOptions:C={},canvasResolutionScale:I,canvasMasking:M,mousemoveWait:T,recordDOM:R=!0,recordCanvas:E=!1,recordCrossOriginIframes:A=!1,recordAfter:O=("DOMContentLoaded"===t.recordAfter?t.recordAfter:"load"),userTriggeredOnInput:P=!1,collectFonts:L=!1,inlineImages:F=!1,plugins:N,keepIframeSrcFn:q=()=>!1,ignoreCSSAttributes:j=new Set([]),attributeFilter:B,errorHandler:z}=t;Sa(z);const H=D({type:"image/webp",quality:.4,maxBase64ImageLength:1048576},C),U=!A||window.parent===window;let W=!1;if(!U)try{window.parent.document&&(W=!1)}catch(t){W=!0}if(U&&!r)throw new Error("emit function is required");if(!U&&!W)return()=>{};void 0!==T&&void 0===x.mousemove&&(x.mousemove=T),yl.reset();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}:void 0!==m?m:{password:!0},G=Us(void 0!==g&&g);let Q;!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 Z=0;const J=new Map;let K,X;const Y=t=>{for(const e of N||[])e.eventProcessor&&(t=e.eventProcessor(t));return S&&!W&&(t=S(t)),t};cl=(t,e)=>{var n;const i=t;if(i.timestamp=ta(),!(null===(n=Ia[0])||void 0===n?void 0:n.isFrozen())||i.type===Kr.FullSnapshot||i.type===Kr.IncrementalSnapshot&&bl.has(i.data.source)||Ia.forEach(t=>t.unfreeze()),U)null==r||r(Y(i),e);else if(W){const t={type:"rrweb",event:Y(i),origin:window.location.origin,isCheckout:e};window.parent.postMessage(t,"*")}if(i.type===Kr.FullSnapshot)Q=i,Z=0;else if(i.type===Kr.IncrementalSnapshot){if(i.data.source===Xr.Mutation&&i.data.isAttachIframe)return;Z++,(s&&Z>=s||o&&i.timestamp-Q.timestamp>o)&&dl(!0)}};const tt=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=yl.getNode(e.node.id);t&&"IFRAME"===t.nodeName&&n.add(t)}t.removes.forEach(({id:t})=>{if(e&&e.has(t))return;const i=rt.getIframeElementById(t);i&&n.has(i)?rt.forgetIframeId(t):(null==K||K(t),rt.removeIframeById(t))}),null==X||X(),rt.cleanupDetachedIframes()}cl({type:Kr.IncrementalSnapshot,data:D({source:Xr.Mutation},t)})},et=t=>cl({type:Kr.IncrementalSnapshot,data:D({source:Xr.Scroll},t)}),nt=t=>cl({type:Kr.IncrementalSnapshot,data:D({source:Xr.CanvasMutation},t)}),it=new vl({mutationCb:tt,adoptedStyleSheetCb:t=>cl({type:Kr.IncrementalSnapshot,data:D({source:Xr.AdoptedStyleSheet},t)}),maskAllElementAttributes:w,maskAttributeFn:k}),rt=new Ba({mirror:yl,mutationCb:tt,stylesheetManager:it,recordCrossOriginIframes:A,wrappedEmit:cl});for(const t of N||[])t.getMirror&&t.getMirror({nodeMirror:yl,crossOriginIframeMirror:rt.crossOriginIframeMirror,crossOriginIframeStyleMirror:rt.crossOriginIframeStyleMirror});const ot=new pl,st=null==M?void 0:M.configured;hl=new fl({recordCanvas:E,mutationCb:nt,win:window,blockClass:a,blockSelector:l,mirror:yl,sampling:x.canvas,dataURLOptions:H,resolutionScale:I,canvasMasking:M});const at=new za({mutationCb:tt,scrollCb:et,bypassOptions:{blockClass:a,blockSelector:l,maskTextClass:d,maskTextSelector:h,inlineStylesheet:f,maskInputOptions:V,dataURLOptions:H,maskTextFn:b,maskInputFn:y,maskAllElementAttributes:w,maskAttributeFn:k,recordCanvas:E,canvasMaskingConfigured:st,inlineImages:F,sampling:x,slimDOMOptions:G,iframeManager:rt,stylesheetManager:it,canvasManager:hl,keepIframeSrcFn:q,processedNodeManager:ot,attributeFilter:B},mirror:yl});dl=(t=!1)=>{if(R){Lo(v);try{if(cl({type:Kr.Meta,data:{href:window.location.href,width:ia(),height:na()}},t),n)return;null==e||e.cancel(),e=void 0,it.reset(),at.init(),Ia.forEach(t=>t.lock());let i=null,r=[];try{i=function(t,e){const{mirror:n=new as,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,maskAllElementAttributes:v=!1,maskAttributeFn:p,slimDOM:m=!1,dataURLOptions:g,preserveWhiteSpace:y,onSerialize:b,onIframeLoad:w,iframeLoadTimeout:k,onIframeListenerRegistered:_,onStylesheetLoad:S,stylesheetLoadTimeout:x,keepIframeSrcFn:C=()=>!1,maxDepth:I,inlineStylesheetBudgetRules:M}=e||{},T=!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}:!1===d?{password:!0}:d,R=Us(m);Lo(M);try{return Hs(t,{doc:t,mirror:n,blockClass:i,blockSelector:r,maskTextClass:o,maskTextSelector:s,skipChild:!1,inlineStylesheet:a,maskInputOptions:T,maskTextFn:h,maskInputFn:f,maskAllElementAttributes:v,maskAttributeFn:p,slimDOMOptions:R,dataURLOptions:g,inlineImages:l,recordCanvas:u,canvasMaskingConfigured:c,preserveWhiteSpace:y,onSerialize:b,onIframeLoad:w,iframeLoadTimeout:k,onIframeListenerRegistered:_,onStylesheetLoad:S,stylesheetLoadTimeout:x,keepIframeSrcFn:C,newlyAddedElement:!1,maxDepth:I})}finally{Do()}}(document,{mirror:yl,blockClass:a,blockSelector:l,maskTextClass:d,maskTextSelector:h,inlineStylesheet:f,maskAllInputs:V,inlineStylesheetBudgetRules:v,maskTextFn:b,maskInputFn:y,maskAllElementAttributes:w,maskAttributeFn:k,slimDOM:G,dataURLOptions:H,recordCanvas:E,canvasMaskingConfigured:st,inlineImages:F,onSerialize(t){ua(t,yl)&&rt.addIframe(t),ca(t,yl)&&it.trackLinkElement(t),da(t)&&at.addShadowRoot(yo.shadowRoot(t),document)},onIframeLoad(t,e){rt.attachIframe(t,e),at.observeAttachShadow(t)},onIframeListenerRegistered(t,e){rt.registerLoadListenerDisposer(t,e)},onStylesheetLoad(t,e){it.attachLinkElement(t,e)},keepIframeSrcFn:q})}finally{r=zo()}if(n)return;if(!i)return console.warn("Failed to snapshot the document");if(cl({type:Kr.FullSnapshot,data:{node:i,initialOffset:ea(window)}},t),n)return;if(Ia.forEach(t=>t.unlock()),hl.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&&Qs(()=>{s=e.beginDeferredLinkInlining(n,yl.getId(n))})},u=()=>{if(!s)return;const t=s;let e=!0;Qs(()=>{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,Uo(1)}e+=1}while(!i&&a()&&(t?!t.didTimeout&&t.timeRemaining()>5:10>e));i||(a()?r=wl(d):n())};return r=wl(d),{cancel(){i=!0,null==s||s.discard(),s=null,null==r||r.cancel(),r=null},flush(){if(i)return;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);Uo(e),null==s||s.discard(),s=null}n()}}}(r,it,()=>{e===t&&(e=void 0)});e=t}A&&rt.reattachIframes(),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&it.adoptStyleSheets(document.adoptedStyleSheets,yl.getId(document))}finally{Do()}}};try{const t=[];t.push(Vs("pagehide",()=>{try{null==e||e.flush()}catch(t){}e=void 0},window));for(const e of["visibilitychange","freeze","resume"])t.push(Vs(e,ko,document));K=e=>{const n=J.get(e);n&&(n.forEach(e=>{Qs(e);const n=t.indexOf(e);-1!==n&&t.splice(n,1)}),J.delete(e))},X=()=>{for(const[t]of J){const e=yl.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 r=t=>{var e;return Ca(Fa)({mutationCb:tt,mousemoveCb:(t,e)=>cl({type:Kr.IncrementalSnapshot,data:{source:e,positions:t}}),mouseInteractionCb:t=>cl({type:Kr.IncrementalSnapshot,data:D({source:Xr.MouseInteraction},t)}),scrollCb:et,viewportResizeCb:t=>cl({type:Kr.IncrementalSnapshot,data:D({source:Xr.ViewportResize},t)}),inputCb:t=>cl({type:Kr.IncrementalSnapshot,data:D({source:Xr.Input},t)}),mediaInteractionCb:t=>cl({type:Kr.IncrementalSnapshot,data:D({source:Xr.MediaInteraction},t)}),styleSheetRuleCb:t=>cl({type:Kr.IncrementalSnapshot,data:D({source:Xr.StyleSheetRule},t)}),styleDeclarationCb:t=>cl({type:Kr.IncrementalSnapshot,data:D({source:Xr.StyleDeclaration},t)}),canvasMutationCb:nt,fontCb:t=>cl({type:Kr.IncrementalSnapshot,data:D({source:Xr.Font},t)}),selectionCb(t){cl({type:Kr.IncrementalSnapshot,data:D({source:Xr.Selection},t)})},customElementCb(t){cl({type:Kr.IncrementalSnapshot,data:D({source:Xr.CustomElement},t)})},blockClass:a,ignoreClass:u,ignoreSelector:c,maskTextClass:d,maskTextSelector:h,maskInputOptions:V,inlineStylesheet:f,sampling:x,recordDOM:R,recordCanvas:E,canvasMaskingConfigured:st,inlineImages:F,userTriggeredOnInput:P,collectFonts:L,doc:t,maskInputFn:y,maskTextFn:b,maskAllElementAttributes:w,maskAttributeFn:k,keepIframeSrcFn:q,blockSelector:l,slimDOMOptions:G,dataURLOptions:H,mirror:yl,iframeManager:rt,stylesheetManager:it,shadowDomManager:at,processedNodeManager:ot,canvasManager:hl,ignoreCSSAttributes:j,attributeFilter:B,plugins:(null==N||null===(e=N.filter(t=>t.observer))||void 0===e?void 0:e.map(t=>({name:t.name,observer:t.observer,options:t.options,callback:e=>cl({type:Kr.Plugin,data:{plugin:t.name,payload:e}})})))||[]},_)};rt.addLoadListener(e=>{try{const n=yl.getId(e),i=r(e.contentDocument);if("function"==typeof i&&(t.push(i),-1!==n)){let t=J.get(n);t||(t=new Set,J.set(n,t)),t.add(i)}}catch(t){console.warn(t)}}),rt.addPageHideListener(t=>{const e=yl.getId(t);null==K||K(e),Ea(t)});let o=-1;const s=t=>cl({type:Kr.Custom,data:{tag:"rrweb/fullscreen",payload:t}}),v=()=>{var t,e,n,i;const r=document,a=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,l=a?yl.getId(a):-1;l!==o&&(-1!==o&&s({id:o,enter:!1}),o=l,-1!==l&&s({id:l,enter:!0}))},p=()=>{if(n||i)return;if(i=!0,dl(),n)return;const e=r(document);n?"function"==typeof e&&Zs([e]):("function"==typeof e&&t.push(e),t.push(Vs("fullscreenchange",v)),t.push(Vs("webkitfullscreenchange",v)),t.push(Vs("mozfullscreenchange",v)),t.push(Vs("MSFullscreenChange",v)),ml=!0)};return["interactive","complete"].includes(document.readyState)?p():(t.push(Vs("DOMContentLoaded",()=>{cl({type:Kr.DomContentLoaded,data:{}}),"DOMContentLoaded"===O&&setTimeout(p,0)})),t.push(Vs("load",()=>{cl({type:Kr.Load,data:{}}),"load"===O&&p()},window))),()=>{n=!0;try{null==e||e.flush()}catch(t){}e=void 0,Zs(t),ot.destroy(),rt.removeLoadListener(),rt.destroy(),J.clear(),at.reset(),yl.reset(),ml=!1,xa()}}catch(t){console.warn(t)}}kl.addCustomEvent=(t,e)=>{if(!ml)throw new Error("please add custom event after start recording");cl({type:Kr.Custom,data:{tag:t,payload:e}})},kl.freezePage=()=>{Ia.forEach(t=>t.freeze())},kl.takeFullSnapshot=t=>{if(!ml)throw new Error("please take full snapshot after start recording");dl(t)},kl.isRecording=()=>ml,kl.mirror=yl,"Mobile".toLowerCase(),"Tablet".toLowerCase(),new RegExp("Xbox","i"),new RegExp("Nintendo","i"),new RegExp("PlayStation","i"),new RegExp("Windows","i"),Date,Date,new RegExp(/[a-z][a-z0-9+.-]{0,63}:[^\s<>"]+/gi.source,"i");var _l=/[a-z][a-z0-9+.-]{0,63}:\/\//i;new RegExp(`^${_l.source}`,"i"),new RegExp(_l.source,"gi"),"0".repeat(32),"0".repeat(16);var Sl=Object.create(null);function xl(t){return xl="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},xl(t)}function Cl(t,e,n){return(e=function(t){var e=function(t){if("object"!=xl(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=xl(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==xl(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}Sl.Node=Object.create(null),Sl.ShadowRoot=Object.create(null),Sl.MutationObserver=Object.create(null),Sl.Element=Object.create(null);var Il=class{constructor(t){Cl(this,"fileName",void 0),Cl(this,"functionName",void 0),Cl(this,"lineNumber",void 0),Cl(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}`}},Ml=/(^|@)\S+:\d+/,Tl=/^\s*at .*(\S+:\d+|\(native\))/m,Rl=/^(eval@)?(\[native code])?$/,El={parse(t){return t?void 0!==t.stacktrace||void 0!==t["opera#sourceloc"]?this.parseOpera(t):t.stack&&t.stack.match(Tl)?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(Tl)},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 Il({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(Rl)},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 Il({functionName:t});{const e=/((.*".+"[^@]*)?[^@]*)(?:@)/,n=t.match(e),i=n&&n[1]?n[1]:void 0,r=this.extractLocation(t.replace(e,""));return new Il({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 Il({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 Il({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(Ml)&&!t.match(/^Error created at/)},this).map(function(t){const e=t.split("@"),n=this.extractLocation(e.pop());return new Il({functionName:(e.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})},this)}};function Al(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 $l(t){return Array.isArray(t)}function Ol(t){return"object"==typeof t&&null!==t&&!$l(t)}function Pl(t,e){if(0===e)return!0;const n=Object.keys(t);for(const i of n)if(Ol(t[i])&&Pl(t[i],e-1))return!0;return!1}function Ll(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(Ol(o=e)&&Object.keys(o).length>n.numOfKeysLimit||"function"==typeof o||Ol(o)&&Pl(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]=$l(i)?Al(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 Dl={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 Fl(t,e,n){const i=n?Object.assign({},Dl,n):Dl,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:El.parse(e.error).map(t=>t.toString()),payload:[Ll(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=[Ll(`Uncaught (in promise) ${n.name}: ${n.message}`,i.stringifyOptions)]):(n=new Error,r=[Ll("Uncaught (in promise)",i.stringifyOptions),Ll(e.reason,i.stringifyOptions)]),t({level:"error",trace:El.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=El.parse(new Error).map(t=>t.toString()).splice(1),r=("assert"===n?o.slice(1):o).map(t=>Ll(t,i.stringifyOptions));s++,i.lengthThreshold>s?t({level:n,trace:e,payload:r}):s===i.lengthThreshold&&t({level:"warn",trace:[],payload:[Ll("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 Nl=t=>({name:"rrweb/console@1",observer:Fl,options:t});const ql=()=>{},jl=t=>{var e;if(W(t))return null!==(e=t.__posthog_layer__)&&void 0!==e?e:t.__rrweb_layer__};function Bl(t,e,n){try{if(!(e in t))return ql;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=jl(n);for(;o;){if(o.next===r)return void(o.next=i.next);n=o.next,o=jl(n)}}}catch(t){return ql}}function zl(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 Hl=he("[Recorder]"),Ul=t=>"navigation"===t.entryType,Wl=t=>"resource"===t.entryType,Vl=()=>{};function Gl(t,e){var n;return Ul(e)&&"complete"===(null===(n=t.document)||void 0===n?void 0:n.readyState)&&e.loadEventEnd>0}function Ql(t,e){return e.recordInitialRequests?t.performance.getEntries().filter(n=>Gl(t,n)||Wl(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=>Gl(t,e))}(t):[]}function Zl(t,e){return!!e&&(Y(e)||e[t])}function Jl(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 Kl=["image/","video/","audio/","font/","application/octet-stream","application/pdf","application/zip","application/wasm"];function Xl({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:!!Jl(e)&&t(e.url)}catch(t){return!1}}(i))return!1;if(r(Kl))return!1;if(Y(e))return!0;if(U(e))return r(e);const o=e[t];return Y(o)?o:r(o)}function Yl(t,e,n,i,r){return tu.apply(this,arguments)}function tu(){return tu=A(function*(t,e,n,i,r,o=0){if(o>10)return Hl.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=>Wl(t)&&t.initiatorType===e&&(G(i)||t.startTime>=i)&&(G(r)||r>=t.startTime));return s||(yield new Promise(t=>setTimeout(t,50*o)),Yl(t,e,n,i,r,o+1))}),tu.apply(this,arguments)}function eu({body:t,options:e,url:n}){if(K(t))return null;const{hostname:i,isHostDenied:r}=zl(n,e);if(r)return i+" is in deny list";if(Q(t))return t;if((t=>"u">typeof Document&&t instanceof Document)(t))return t.textContent;if(tt(t))return 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)}(t);if(V(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 nu=t=>!J(t)&&("navigation"===t.entryType||"resource"===t.entryType);function iu(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=[D(D({},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(nu(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 ru=["video/","audio/"];function ou(t){return V(t)&&W(t.getReader)&&W(t.tee)}const su="[SessionReplay] Timeout while trying to read body",au="[SessionReplay] Failed to read body";function lu(t){return`${au}: ${t}`}function uu(t){return`[SessionReplay] Body too large to record (> ${t} bytes)`}function cu(t,e){if(!e.streamNetworkBody)return function(t){return new Promise(e=>{const n=setTimeout(()=>e(su),500);try{t.clone().text().then(t=>e(t),t=>e(lu(t))).finally(()=>clearTimeout(n))}catch(t){clearTimeout(n),e(au)}})}(t);const n=Je(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(uu(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(su),500);let l;try{l=t.clone()}catch(t){return void s(au)}const u=l.body;if(!ou(u)||"undefined"==typeof TextDecoder){try{l.text().then(t=>s(t),t=>s(lu(t)))}catch(t){s(au)}return}try{i=u.getReader()}catch(t){return void s(au)}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(uu(e));d+=i.byteLength,c.push(i)}t()}},t=>s(lu(t)))}()})}(t,n)}function du(t){return hu.apply(this,arguments)}function hu(){return hu=A(function*({r:t,options:e,url:n}){const{hostname:i,isHostDenied:r}=zl(n,e);return r?Promise.resolve(i+" is in deny list"):cu(t,e)}),hu.apply(this,arguments)}function fu(t){return vu.apply(this,arguments)}function vu(){return vu=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=ru.some(t=>null==r?void 0:r.startsWith(t));if(r&&o)return`Content-Type ${r} is not supported`;const{hostname:s,isHostDenied:a}=zl(n,e);return a?s+" is in deny list":null}({r:t,options:e,url:n});return J(i)?cu(t,e):Promise.resolve(i)}),vu.apply(this,arguments)}let pu=null;function mu(t,e,n){if(!("performance"in e))return()=>{};if(pu)return Hl.warn("Network observer already initialised, doing nothing"),()=>{};const i=n?Object.assign({},Ke,n):Ke;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,Hl.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&&sn.has(t))(r)),r&&n.push(r)}),n.length>0&&t(D(D({},e),{},{requests:n}))},a=function(t,e,n){try{t({requests:Ql(e,n).flatMap(t=>iu(e,{entry:t,method:void 0,status:void 0,networkRequest:{},isInitial:!0})),isInitial:!0})}catch(t){Hl.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=>Ul(t)||Wl(t)&&n.initiatorTypes.includes(t.initiatorType)&&(t=>!n.recordBody&&!n.recordHeaders||"xmlhttprequest"!==t.initiatorType&&"fetch"!==t.initiatorType)(t)).flatMap(t=>iu(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,Vl;let u=()=>{},c=()=>{};return l&&(u=function(t,e,n){if(!n.initiatorTypes.includes("xmlhttprequest"))return()=>{};const i=Zl("request",n.recordHeaders),r=Zl("response",n.recordHeaders),o=Bl(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=>(Xl({type:"request",headers:h,url:a,recordBody:n.recordBody})&&(l.requestBody=eu({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),Xl({type:"response",headers:i,url:a,recordBody:n.recordBody})&&(l.responseBody=eu({body:d.response,options:n,url:a})),Yl(e,"xmlhttprequest",o.url,u,c).then(n=>{t({requests:iu(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){Hl.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=Zl("request",n.recordHeaders),r=Zl("response",n.recordHeaders),o=Bl(e,"fetch",o=>function(s,a){let l;try{l=new Request(s,a)}catch(t){Hl.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),!ou(null==a?void 0:a.body)&&Xl({type:"request",headers:t,url:s,recordBody:n.recordBody})&&(u.requestBody=yield du({r:l,options:n,url:s}))}catch(t){Hl.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),Xl({type:"response",headers:e,url:s,recordBody:n.recordBody})&&(u.responseBody=yield fu({r:t,options:n,url:s}))}catch(t){Hl.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=Jl(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}));return A(function*(){let n;try{yield h;const t=yield m;if("rejected"===t.status)throw t.error;return n=t.response,yield f(n),n}finally{(i=n,Yl(e,"fetch",l.url,c,d).then(n=>{t({requests:iu(e,{entry:n,method:l.method,status:null==i?void 0:i.status,networkRequest:u,start:c,end:d,url:l.url,initiatorType:"fetch"})})})).catch(()=>{})}var i})()});return()=>{o()}}(s,e,i):function(t,e,n){if(!n.initiatorTypes.includes("fetch"))return()=>{};const i=Zl("request",n.recordHeaders),r=Zl("response",n.recordHeaders),o=Bl(e,"fetch",o=>function(){var s=A(function*(s,a){let l,u;try{l=new Request(s,a)}catch(t){return Hl.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),!ou(null==a?void 0:a.body)&&Xl({type:"request",headers:t,url:s,recordBody:n.recordBody})&&(c.requestBody=yield du({r:l,options:n,url:s}))}catch(t){Hl.error("Failed to record fetch request for network capture",t)}d=e.performance.now(),u=Jl(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),Xl({type:"response",headers:t,url:s,recordBody:n.recordBody})&&(c.responseBody=yield fu({r:u,options:n,url:s}))}catch(t){Hl.error("Failed to record fetch response for network capture",t)}return u}finally{Yl(e,"fetch",l.url,d,h).then(n=>{t({requests:iu(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)),pu=()=>{r=!1,null==a||a(),u(),c(),pu=null},pu}const gu=t=>({name:"rrweb/network@1",observer:mu,options:t});var yu,bu,wu,ku,_u,Su,xu,Cu,Iu,Mu,Tu,Ru,Eu,Au,$u;a.__PosthogExtensions__=a.__PosthogExtensions__||{},a.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:Nl,getRecordNetworkPlugin:gu},a.__PosthogExtensions__.rrweb={record:kl,version:"v2",wasMaxDepthReached:()=>zs,resetMaxDepthState(){zs=!1,Bs=!1},getLastSnapshotCost:()=>To,getMutationCost:()=>D({},Oo),getObserverInitFailures:()=>Da.size?Array.from(Da):void 0,resetSnapshotCostState(){xo=0,Co=0,Io=0,wo=0,Mo={durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0},To=null,Ro=null,Eo=[],Ao=0,$o=0,Oo={slowestBatchMs:0},Po={deferredCount:0,failedCount:0,abandonedCount:0,totalMs:0,slowestSliceMs:0}}},a.rrweb={record:kl,version:"v2"},a.rrwebConsoleRecord={getRecordConsolePlugin:Nl},a.getRecordNetworkPlugin=gu,a.__PosthogExtensions__=a.__PosthogExtensions__||{},a.__PosthogExtensions__.initSessionRecording=(t,e)=>new Zr(t,e);var Ou,Pu,Lu,Du,Fu={},Nu=[],qu=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,ju=Array.isArray;function Bu(t,e){for(var n in e)t[n]=e[n];return t}function zu(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function Hu(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?yu.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 Uu(t,s,i,r,null)}function Uu(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?++wu:r,__i:-1,__u:0};return null==r&&null!=bu.vnode&&bu.vnode(o),o}function Wu(t){return t.children}function Vu(t,e){this.props=t,this.context=e}function Gu(t,e){if(null==e)return t.__?Gu(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?Gu(t):null}function Qu(t){if(t.__P&&t.__d){var e=t.__v,n=e.__e,i=[],r=[],o=Bu({},e);o.__v=e.__v+1,bu.vnode&&bu.vnode(o),rc(t.__P,o,e,t.__n,t.__P.namespaceURI,32&e.__u?[n]:null,i,null==n?Gu(e):n,!!(32&e.__u),r),o.__v=e.__v,o.__.__k[o.__i]=o,sc(i,o,r),e.__e=e.__=null,o.__e!=n&&Zu(o)}}function Zu(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}),Zu(t)}function Ju(t){(!t.__d&&(t.__d=!0)&&ku.push(t)&&!Ku.__r++||_u!=bu.debounceRendering)&&((_u=bu.debounceRendering)||Su)(Ku)}function Ku(){try{for(var t,e=1;ku.length;)ku.length>e&&ku.sort(xu),t=ku.shift(),e=ku.length,Qu(t)}finally{ku.length=Ku.__r=0}}function Xu(t,e,n,i,r,o,s,a,l,u,c){var d,h,f,v,p,m,g,y=i&&i.__k||Nu,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]=Uu(null,s,null,null,null):ju(s)?s=t.__k[o]=Uu(Wu,{children:s},null,null,null):void 0===s.constructor&&s.__b>0?s=t.__k[o]=Uu(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=tc(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=Gu(a)),uc(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]||Fu,f.__i=d,m=rc(t,f,h,r,o,s,a,l,u,c),v=f.__e,f.ref&&h.ref!=f.ref&&(h.ref&&lc(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=Yu(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 Yu(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=Yu(r[o],e,n,i));return e}t.__e!=e&&(i&&(e&&t.type&&!e.parentNode&&(e=Gu(t)),n.insertBefore(t.__e,e||null)),e=t.__e);do{e=e&&e.nextSibling}while(null!=e&&8==e.nodeType);return e}function tc(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 ec(t,e,n){"-"==e[0]?t.setProperty(e,null==n?"":n):t[e]=null==n?"":"number"!=typeof n||qu.test(e)?n:n+"px"}function nc(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||ec(t.style,e,"");if(n)for(e in n)i&&n[e]==i[e]||ec(t.style,e,n[e])}else if("o"==e[0]&&"n"==e[1])o=e!=(e=e.replace(Tu,"$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[Mu]=i[Mu]:(n[Mu]=Ru,t.addEventListener(e,o?Au:Eu,o)):t.removeEventListener(e,o?Au:Eu,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 ic(t){return function(e){if(this.l){var n=this.l[e.type+t];if(null==e[Iu])e[Iu]=Ru++;else if(n[Mu]>e[Iu])return;return n(bu.event?bu.event(e):e)}}}function rc(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=bu.__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 Vu(y,w),h.constructor=C,h.render=cc),$&&$.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=Bu({},h.__s)),Bu(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)}),Nu.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=bu.__r,_=0,b)h.state=h.__s,h.__d=!1,k&&k(e),c=h.render(h.props,h.state,h.context),Nu.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>++_);h.state=h.__s,null!=h.getChildContext&&(i=Bu(Bu({},i),h.getChildContext())),b&&!f&&null!=h.getSnapshotBeforeUpdate&&(m=h.getSnapshotBeforeUpdate(v,p)),S=null!=c&&c.type===Wu&&null==c.key?ac(c.props.children):c,a=Xu(t,ju(S)?S:[S],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--;)zu(o[x]);oc(e)}else e.__e=n.__e,!e.__k&&n.__k&&(e.__k=n.__k),t.then||oc(e);bu.__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||Fu,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&&(bu.__m&&bu.__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&&yu.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||nc(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||nc(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=""),Xu("template"==e.type?t.content:t,ju(h)?h:[h],e,n,i,"foreignObject"==y?"http://www.w3.org/1999/xhtml":r,o,s,o?o[0]:n.__k&&Gu(n,0),a,l),null!=o)for(u=o.length;u--;)zu(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])&&nc(t,u,v,m[u],r),u="checked",null!=p&&p!=t[u]&&nc(t,u,p,m[u],r))}return t}(n.__e,e,n,i,r,o,s,l,u);return(c=bu.diffed)&&c(e),128&e.__u?void 0:a}function oc(t){t&&(t.__c&&(t.__c.__e=!0),t.__k&&t.__k.some(oc))}function sc(t,e,n){for(var i=0;n.length>i;i++)lc(n[i],n[++i],n[++i]);bu.__c&&bu.__c(e,t),t.some(function(e){try{t=e.__h,e.__h=[],t.some(function(t){t.call(e)})}catch(t){bu.__e(t,e.__v)}})}function ac(t){return"object"!=typeof t||null==t||t.__b>0?t:ju(t)?t.map(ac):void 0!==t.constructor?null:Bu({},t)}function lc(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){bu.__e(t,n)}}function uc(t,e,n){var i,r;if(bu.unmount&&bu.unmount(t),(i=t.ref)&&(i.current&&i.current!=t.__e||lc(i,null,e)),null!=(i=t.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(t){bu.__e(t,e)}i.base=i.__P=i.__n=null}if(i=t.__k)for(r=0;i.length>r;r++)i[r]&&uc(i[r],e,n||"function"!=typeof t.type);n||zu(t.__e),t.__c=t.__=t.__e=void 0}function cc(t,e,n){return this.constructor(t,n)}function dc(t,e,n){var i,r,o,s;e==document&&(e=document.documentElement),bu.__&&bu.__(t,e),r=(i="function"==typeof n)?null:n&&n.__k||e.__k,o=[],s=[],rc(e,t=(!i&&n||e).__k=Hu(Wu,null,[t]),r||Fu,Fu,e.namespaceURI,!i&&n?[n]:r?null:e.firstChild?yu.call(e.childNodes):null,o,!i&&n?n:r?r.__e:e.firstChild,i,s),sc(o,t,s),t.props.children=null}yu=Nu.slice,bu={__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}},wu=0,Vu.prototype.setState=function(t,e){var n=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=Bu({},this.state);"function"==typeof t&&(t=t(Bu({},n),this.props)),t&&Bu(n,t),null!=t&&this.__v&&(e&&this._sb.push(e),Ju(this))},Vu.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),Ju(this))},Vu.prototype.render=Wu,ku=[],Su="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,xu=function(t,e){return t.__v.__b-e.__v.__b},Ku.__r=0,Cu=Math.random().toString(8),Iu="__d"+Cu,Mu="__a"+Cu,Tu=/(PointerCapture)$|Capture$/i,Ru=0,Eu=ic(!1),Au=ic(!0),$u=0;var hc=0,fc=[],vc=bu,pc=vc.__b,mc=vc.__r,gc=vc.diffed,yc=vc.__c,bc=vc.unmount,wc=vc.__;function kc(t,e){vc.__h&&vc.__h(Pu,t,hc||e),hc=0;var n=Pu.__H||(Pu.__H={__:[],__h:[]});return t>=n.__.length&&n.__.push({}),n.__[t]}function _c(t){return hc=1,function(t,e){var n=kc(Ou++,2);if(n.t=t,!n.__c&&(n.__=[Oc(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=Pu,!Pu.__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};Pu.__f=!0;var r=Pu.shouldComponentUpdate,o=Pu.componentWillUpdate;Pu.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)},Pu.shouldComponentUpdate=i}return n.__N||n.__}(Oc,t)}function Sc(t,e){var n=kc(Ou++,3);!vc.__s&&$c(n.__H,e)&&(n.__=t,n.u=e,Pu.__H.__h.push(n))}function xc(t){return hc=5,Cc(function(){return{current:t}},[])}function Cc(t,e){var n=kc(Ou++,7);return $c(n.__H,e)&&(n.__=t(),n.__H=e,n.__h=t),n.__}function Ic(t){var e=Pu.context[t.__c],n=kc(Ou++,9);return n.c=t,e?(null==n.__&&(n.__=!0,e.sub(Pu)),e.props.value):t.__}function Mc(){for(var t;t=fc.shift();){var e=t.__H;if(t.__P&&e)try{e.__h.some(Ec),e.__h.some(Ac),e.__h=[]}catch(n){e.__h=[],vc.__e(n,t.__v)}}}vc.__b=function(t){Pu=null,pc&&pc(t)},vc.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),wc&&wc(t,e)},vc.__r=function(t){mc&&mc(t),Ou=0;var e=(Pu=t.__c).__H;e&&(Lu===Pu?(e.__h=[],Pu.__h=[],e.__.some(function(t){t.__N&&(t.__=t.__N),t.u=t.__N=void 0})):(e.__h.length&&Mc(),Ou=0)),Lu=Pu},vc.diffed=function(t){gc&&gc(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(1!==fc.push(e)&&Du===vc.requestAnimationFrame||((Du=vc.requestAnimationFrame)||Rc)(Mc)),e.__H.__.some(function(t){t.u&&(t.__H=t.u,t.u=void 0)})),Lu=Pu=null},vc.__c=function(t,e){e.some(function(t){try{t.__h.some(Ec),t.__h=t.__h.filter(function(t){return!t.__||Ac(t)})}catch(n){e.some(function(t){t.__h&&(t.__h=[])}),e=[],vc.__e(n,t.__v)}}),yc&&yc(t,e)},vc.unmount=function(t){bc&&bc(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.some(function(t){try{Ec(t)}catch(t){e=t}}),n.__H=void 0,e&&vc.__e(e,n.__v))};var Tc="function"==typeof requestAnimationFrame;function Rc(t){var e,n=function(){clearTimeout(i),Tc&&cancelAnimationFrame(e),setTimeout(t)},i=setTimeout(n,35);Tc&&(e=requestAnimationFrame(n))}function Ec(t){var e=Pu,n=t.__c;"function"==typeof n&&(t.__c=void 0,n()),Pu=e}function Ac(t){var e=Pu;t.__c=t.__(),Pu=e}function $c(t,e){return!t||t.length!==e.length||e.some(function(e,n){return e!==t[n]})}function Oc(t,e){return"function"==typeof e?e(t):e}const Pc="tab",Lc="left",Dc="center",Fc="right",Nc="next_to_trigger",qc="popover",jc="widget",Bc="external_survey",zc="open",Hc="multiple_choice",Uc="single_choice",Wc="rating",Vc="end",Gc="always",Qc="$survey_id",Zc="$survey_name",Jc="$survey_iteration",Kc="$survey_iteration_start_date",Xc="$survey_language",Yc=he("[Surveys]");function td(t){return W(t.is_capturing)?t.is_capturing():!t.has_opted_out_capturing()}const ed=(t,e)=>`${t}${function(t){return t.current_iteration&&t.current_iteration>0?`${t.id}_${t.current_iteration}`:t.id}(e)}`,nd=t=>ed("seenSurvey_",t),id=t=>{try{const e=nd(t);if(localStorage.getItem(e))return;localStorage.setItem(e,"true")}catch(t){Yc.error("Failed to persist survey seen state",t)}},rd=[qc,jc,"api"],od=he("[Stylesheet Loader]"),sd=t,ad=i,ld="#020617",ud={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:Fc,widgetType:Pc,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,surveyPopupDelaySeconds:void 0,outlineColor:"rgba(59, 130, 246, 0.8)",inputBackground:"white",inputTextColor:ld,scrollbarThumbColor:"var(--ph-survey-border-color)",scrollbarTrackColor:"var(--ph-survey-background-color)"},cd=[Dc,Lc,Fc];function dd(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 hd(t=ud.backgroundColor){let e;"#"===t[0]&&(e=dd(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=dd(n)),!e)return ld;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?ld:"white"}return ld}const fd=(t,e,n)=>{const i=$d(t),r=ad.querySelector(`.${i}`);if(r&&r.shadowRoot)return{shadow:r.shadowRoot,isNewlyCreated:!1};const o=ad.createElement("div");((t,e,n)=>{const i=D(D({},ud),n),r=t.style,o=!cd.includes(i.position)||e===jc&&(null==n?void 0:n.widgetType)===Pc;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)||hd(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",hd(i.ratingButtonActiveColor)),r.setProperty("--ph-survey-text-primary-color",(null==n?void 0:n.textColor)||hd(i.backgroundColor)),r.setProperty("--ph-survey-text-subtle-color",i.textSubtleColor),r.setProperty("--ph-widget-color",i.widgetColor),r.setProperty("--ph-widget-text-color",hd(i.widgetColor)),r.setProperty("--ph-widget-z-index",i.zIndex);const s=(null==n?void 0:n.inputBackground)||(null==n?void 0:n.inputBackgroundColor);let a=s||i.inputBackground;s||"white"!==i.backgroundColor||(a="#f8f8f8"),r.setProperty("--ph-survey-input-background",a);const l=(null==n?void 0:n.inputTextColor)||hd(a);r.setProperty("--ph-survey-input-text-color",l),r.setProperty("--ph-survey-rating-text-color",l),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||(od.error("prepare_external_dependency_stylesheet returned null"),null)})(ad,':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)}}',t);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||ad.body).appendChild(o),{shadow:s,isNewlyCreated:!0}},vd=({responses:t,survey:e,surveySubmissionId:n,posthog:i,isSurveyCompleted:r,properties:o,surveyLanguage:s,questionSnapshots:a})=>{var l;i?td(i)&&(id(e),r&&Ad(e),i.capture("survey sent",D(D(D({[Zc]:e.name,[Qc]:e.id,[Jc]:e.current_iteration,[Kc]:e.current_iteration_start_date,sessionRecordingUrl:null===(l=i.get_session_replay_url)||void 0===l?void 0:l.call(i)},Ai({event:"sent",survey:e,responses:t,submissionId:n,completed:r,surveyLanguage:s,questionSnapshots:a})),o),{},{$set:{[Oi(e,"responded")]:!0}})),r&&(sd.dispatchEvent(new CustomEvent("PHSurveySent",{detail:{surveyId:e.id}})),i.reloadFeatureFlags())):Yc.error("[survey sent] event not captured, PostHog instance not found.")},pd=(t,e,n,i)=>{var r;return D({[Zc]:e.name,[Qc]:e.id,[Jc]:e.current_iteration,[Kc]:e.current_iteration_start_date,sessionRecordingUrl:null===(r=i.get_session_replay_url)||void 0===r?void 0:r.call(i)},Ai({event:t,survey:e,responses:null==n?void 0:n.responses,submissionId:null==n?void 0:n.surveySubmissionId,surveyLanguage:null==n?void 0:n.surveyLanguage,questionSnapshots:null==n?void 0:n.questionSnapshots}))},md=(t,e,n,i)=>{if(!e)return void Yc.error("[survey dismissed] event not captured, PostHog instance not found.");if(n)return;const r=Rd(t),o=r?r.surveyLanguage:i,s=D(D(D({},pd("dismissed",t,r,e)),o&&{[Xc]:o}),{},{$set:{[Oi(t,"dismissed")]:!0}});Ad(t),id(t),e.capture("survey dismissed",s),sd.dispatchEvent(new CustomEvent("PHSurveyClosed",{detail:{surveyId:t.id}}))},gd=(t,e)=>{if(!e)return void Yc.error("[survey abandoned] event not captured, PostHog instance not found.");const n=(t=>ed("abandonedSurvey_",t))(t);try{if("true"===localStorage.getItem(n))return}catch(t){return}const i=Rd(t);if(i){try{localStorage.setItem(n,"true")}catch(t){}e.capture("survey abandoned",pd("abandoned",t,i,e),{transport:"sendBeacon"})}},yd=t=>{const e=t.map(t=>t.id);return e.every(t=>!!t)?e:void 0},bd=(t,e)=>{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=Hi(t.questions),i.length===r.length&&i.every((t,e)=>t===r[e])?r.reverse():r):t.questions;var n,i,r},wd=t=>function(t){var e;return qi(t)&&!!(null===(e=t.conditions)||void 0===e||null===(e=e.events)||void 0===e?void 0:e.repeatedActivation)||"always"===t.schedule}(t)||Ed(t),kd=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,Ju(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"+$u++,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}),_d=()=>Ic(kd),Sd=({component:t,children:e,renderAsHtml:n,style:i})=>function(t,e,n){var i,r,o,s,a=Bu({},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?yu.call(arguments,2):n),Uu(t.type,a,i||t.key,r||t.ref,null)}(t,n?{dangerouslySetInnerHTML:{__html:e},style:i}:{children:e,style:i});function xd(t,e){var n,i;if(!(null===(n=t.conditions)||void 0===n?void 0:n.url))return!0;const r=be(e);if(!r)return!1;const o=[t.conditions.url],s=function(t){return null!=t?t:"icontains"}(null===(i=t.conditions)||void 0===i?void 0:i.urlMatchType);return zi[s](o,[r])}function Cd(e){var i,r;return function(e,i){var r,s,a;if(!e||0===e.length)return!0;if(!o)return!1;const l=function(t,e){var n;const i=function(t){return _t.test(t)?ft:kt.test(t)?vt:wt.test(t)?pt:new RegExp(gt,"i").test(t)?gt:new RegExp("(Windows Phone|WPDesktop)","i").test(t)?"Windows Phone":/iPad/.test(t)?dt:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?ht:St.test(t)?"BlackBerry":/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(mt,"i").test(t)?mt:/(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(lt).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":ct:new RegExp("(pda|Mobile)","i").test(t)?yt:new RegExp(ut,"i").test(t)&&!new RegExp("Tablet pc","i").test(t)?bt:""}(t);return i===dt||i===ct||"Kobo"===i||"Kindle Fire"===i||i===bt?ut:i===ft||i===pt||i===vt||i===gt?"Console":i===ht?"Wearable":i?lt:"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)?lt:ut:"Desktop";var r,o,s}(o,{userAgentDataPlatform:null==n||null===(r=n.userAgentData)||void 0===r?void 0:r.platform,maxTouchPoints:null==n?void 0:n.maxTouchPoints,screenWidth:null==t||null===(s=t.screen)||void 0===s?void 0:s.width,screenHeight:null==t||null===(a=t.screen)||void 0===a?void 0:a.height,devicePixelRatio:null==t?void 0:t.devicePixelRatio});return zi[null!=i?i:"icontains"](e,[l])}(null===(i=e.conditions)||void 0===i?void 0:i.deviceTypes,null===(r=e.conditions)||void 0===r?void 0:r.deviceTypesMatchType)}const Id=t=>ed("inProgressSurvey_",t),Md={},Td=(t,e)=>{const n=Id(t);try{localStorage.setItem(n,JSON.stringify(e)),delete Md[n]}catch(t){Yc.error("Error setting in-progress survey state in localStorage",t),Md[n]=e}},Rd=t=>{const e=Id(t),n=Md[e];if(n)return n;try{const t=localStorage.getItem(e);if(t)return JSON.parse(t)}catch(t){Yc.error("Error getting in-progress survey state from localStorage",t)}return null},Ed=t=>{const e=Rd(t);return!K(null==e?void 0:e.surveySubmissionId)},Ad=t=>{const e=Id(t);delete Md[e];try{localStorage.removeItem(e)}catch(t){Yc.error("Error clearing in-progress survey state from localStorage",t)}};function $d(t,e=!1){const n=`PostHogSurvey-${t.id}`;return e?`.${n}`:n}function Od(t,e=Fc,n){if(t===Bc)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 Lc:return{left:"30px"};case Dc:return{left:"50%",transform:"translateX(-50%)"};default:return{right:t===jc&&n===Pc?"60px":"30px"}}}var Pd=0;function Ld(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:--Pd,__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 bu.vnode&&bu.vnode(u),u}const Dd=Ld("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Ld("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"})}),Fd=Ld("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Ld("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"})}),Nd=Ld("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Ld("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"})}),qd=Ld("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Ld("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"})}),jd=Ld("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Ld("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"})}),Bd=Ld("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:Ld("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"})}),zd=Ld("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:Ld("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"})}),Hd=({fill:t="currentColor"}={})=>Ld("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:[Ld("title",{id:"close-survey-title",className:"adam-testing",children:"Close survey"}),Ld("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})]}),Ud=Ld("svg",{width:"80",height:"14",viewBox:"0 0 160 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Ld("g",{"clip-path":"url(#ph-survey-logo-clip)",children:[Ld("path",{fill:"currentColor",d:"m50 23.34-.35-.05A4.5 4.5 0 0 1 47 21.97L35.56 10.1c-.3-.33-.86-.1-.86.35V27.5c0 .27.22.5.5.5h13.78c1.48 0 2.67-1.2 2.67-2.67v-.1a1.9 1.9 0 0 0-1.67-1.89zm-10.81.2a1.8 1.8 0 1 1 0-3.58 1.8 1.8 0 0 1 0 3.58"}),Ld("path",{fill:"#0054ff",d:"M.87 19.13a.5.5 0 0 0-.87.34v5.94a2.6 2.6 0 0 0 2.59 2.58H7.8a.5.5 0 0 0 .37-.84zM.86 8.4c-.3-.32-.86-.1-.86.36v6.73q0 .2.13.34l8.81 9.68 1.8 2.06v-8.82zM4.59.82A2.67 2.67 0 0 0 0 2.68v1.93q0 .4.27.69l10.47 10.95v-9.1z"}),Ld("path",{fill:"#ff5506",d:"M11.36 28h7.08a.5.5 0 0 0 .36-.85l-8.05-8.4v8.8l.23.28q.16.17.38.17m-.61-11.76 8.84 9.25 2.1 2.33q.1.11.27.14V18.7L10.75 7.15zm0-13.7v1.41a2 2 0 0 0 .55 1.28L21.96 16.2V7.65L15.32.8a2.67 2.67 0 0 0-4.57 1.71z"}),Ld("path",{fill:"#ffb70f",d:"M22.06 28h7.76a.5.5 0 0 0 .36-.86l-8.22-8.45v9.27l.09.02zM31 25.49l1.13 1.14c.32.31.85.09.85-.35v-7.3l-.49-.51L21.96 7.64v8.55zM22.52 5.73l9.62 9.89c.3.32.86.1.86-.35V7.46L26.56.82a2.67 2.67 0 0 0-4.59 1.84v1.7c0 .51.2 1 .57 1.37z"})]}),Ld("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"}),Ld("defs",{children:Ld("clipPath",{id:"ph-survey-logo-clip",children:Ld("path",{fill:"#fff",d:"M0 0h51.67v28H0z"})})})]});function Wd({urlParams:t}){const e=t?Object.entries(t).map(([t,e])=>`${encodeURIComponent(t)}=${encodeURIComponent(e)}`).join("&"):"";return Ld("a",{href:"https://posthog.com/surveys"+(e?`?${e}`:""),target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",Ud]})}function Vd({text:e,submitDisabled:n,appearance:i,onSubmit:r,link:o,onPreviewSubmit:s,skipSubmitButton:a,canGoBack:l,onBack:u}){const{isPreviewMode:c}=Ic(kd),d=!!l&&!!u,h=!a&&Ld("button",{className:"form-submit",disabled:n,"aria-label":"Submit survey",type:"button",onClick(){o&&(null==t||t.open(o)),c?null==s||s():r()},children:e});return Ld("div",{className:"bottom-section",children:[d?Ld("div",{className:"form-buttons form-buttons-with-back",children:[Ld("button",{className:"form-back",type:"button","aria-label":"Go to previous question",onClick:u,children:i.backButtonText||"Back"}),h]}):h,!i.whiteLabel&&Ld(Wd,{urlParams:{utm_source:"survey-footer"}})]})}function Gd({question:t,forceDisableHtml:e,htmlFor:n}){return Ld("div",{class:t.question||t.description?"question-header":"question-header question-header--empty",children:[Ld(t.type===zc?"label":"h3",{className:"survey-question",htmlFor:n,children:t.question}),t.description&&Sd({component:Hu("p",{className:"survey-question-description"}),children:t.description,renderAsHtml:!e&&"text"!==t.descriptionContentType})]})}function Qd({onClick:t}){const{isPreviewMode:e}=Ic(kd);return Ld("button",{className:"form-cancel",onClick:t,disabled:e,"aria-label":"Close survey",type:"button",children:Hd({fill:"black"})})}const Zd=t;function Jd({header:t,description:e,contentType:n,forceDisableHtml:i,appearance:r,onClose:o}){const{isPopup:s}=Ic(kd);return Sc(()=>{const t=t=>{"Enter"!==t.key&&"Escape"!==t.key||(t.preventDefault(),o())};return me(Zd,"keydown",t),()=>{Zd.removeEventListener("keydown",t)}},[o]),Ld("div",{className:"thank-you-message",role:"status",tabIndex:0,"aria-atomic":"true",children:[s&&!0!==r.hideCancelButton&&Ld(Qd,{onClick:()=>o()}),Ld("h3",{className:"thank-you-message-header",children:t}),e&&Sd({component:Hu("p",{className:"thank-you-message-body"}),children:e,renderAsHtml:!i&&"text"!==n}),s&&Ld(Vd,{text:r.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:r,onSubmit:()=>o()})]})}function Kd({header:t,description:e,contentType:n,forceDisableHtml:i,appearance:r,onStart:o}){const{isPopup:s,onPreviewSubmit:a,onPopupSurveyDismissed:l}=Ic(kd);return Ld("div",{className:"intro-screen",role:"status",tabIndex:0,"aria-atomic":"true",children:[s&&!0!==r.hideCancelButton&&Ld(Qd,{onClick:()=>l()}),t&&Ld("h3",{className:"intro-screen-header",children:t}),e&&Sd({component:Hu("p",{className:"intro-screen-body"}),children:e,renderAsHtml:!i&&"text"!==n}),Ld(Vd,{text:r.introScreenButtonText||"Get started",submitDisabled:!1,appearance:r,onSubmit:o,onPreviewSubmit:()=>a(null)})]})}const Xd=t=>U(t)&&t.every(t=>Q(t));function Yd({question:t,forceDisableHtml:e,appearance:n,onSubmit:i,onPreviewSubmit:r,displayQuestionIndex:o,initialValue:s,canGoBack:a,onBack:l}){const{isPreviewMode:u}=_d(),c=xc(null),[d,h]=_c(()=>Q(s)?s:""),f=null==n?void 0:n.disableAutofocus;Sc(()=>{f||setTimeout(()=>{var t;u||null===(t=c.current)||void 0===t||t.focus()},100)},[u,f]);const v=`surveyQuestion${o}`,p=Cc(()=>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 N: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,N),y=Cc(()=>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 Ld(Wu,{children:[Ld("div",{className:"question-container",children:[Ld(Gd,{question:t,forceDisableHtml:e,htmlFor:v}),Ld("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&&Ld("div",{className:"validation-hint",children:y})]}),Ld(Vd,{text:t.buttonText||"Submit",submitDisabled:!!p,appearance:n,onSubmit:b,onPreviewSubmit:w,canGoBack:a,onBack:l})]})}function th({question:t,forceDisableHtml:e,appearance:n,onSubmit:i,onPreviewSubmit:r,canGoBack:o,onBack:s}){return Ld(Wu,{children:[Ld("div",{className:"question-container",children:Ld(Gd,{question:t,forceDisableHtml:e})}),Ld(Vd,{text:t.buttonText||"Submit",submitDisabled:!1,link:t.link,appearance:n,onSubmit:()=>i("link clicked"),onPreviewSubmit:()=>r("link clicked"),canGoBack:o,onBack:s})]})}function eh({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]=_c(()=>X(s)?s:U(s)&&s.length>0&&X(parseInt(s[0]))?parseInt(s[0]):Q(s)&&X(parseInt(s))?parseInt(s):null),v="emoji"===t.display&&2===t.scale,{isPreviewMode:p}=_d(),m=t=>p?o(t):r(t);return Ld(Wu,{children:[Ld("div",{className:"question-container",children:[Ld(Gd,{question:t,forceDisableHtml:e}),Ld("div",{className:"rating-section",children:[Ld("div",{className:"rating-options",children:["emoji"===t.display&&Ld("div",{className:"rating-options-emoji"+(v?" rating-options-emoji-2":""),children:null===(u=ah[t.scale])||void 0===u?void 0:u.map((e,i)=>Ld("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&&Ld("div",{className:"rating-options-number",style:{gridTemplateColumns:`repeat(${c-d+1}, minmax(0, 1fr))`},children:lh(t.scale).map((e,r)=>Ld(nh,{displayQuestionIndex:n,active:h===e,appearance:i,num:e,setActiveNumber(e){f(e),t.skipSubmitButton&&m(e)}},r))})]}),!v&&Ld("div",{className:"rating-text",children:[Ld("div",{children:t.lowerBoundLabel}),Ld("div",{children:t.upperBoundLabel})]})]})]}),Ld(Vd,{text:t.buttonText||(null==i?void 0:i.submitButtonText)||"Submit",submitDisabled:J(h)&&!t.optional,appearance:i,onSubmit:()=>r(h),onPreviewSubmit:()=>o(h),skipSubmitButton:t.skipSubmitButton,canGoBack:a,onBack:l})]})}function nh({num:t,active:e,displayQuestionIndex:n,setActiveNumber:i}){return Ld("button",{"aria-label":`Rate ${t}`,className:`ratings-number question-${n}-rating-${t} ${e?"rating-active":""}`,type:"button",onClick(){i(t)},children:t})}function ih({question:t,forceDisableHtml:e,displayQuestionIndex:n,appearance:i,onSubmit:r,onPreviewSubmit:o,initialValue:s,canGoBack:a,onBack:l}){const u=xc(null),c=Cc(()=>(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=Hi(n)).length>1&&o.every((t,e)=>t===s[e])?s.reverse():s);var o,s;return J(i)||r.push(i),r})(t),[t]),[d,h]=_c(()=>((t,e)=>Q(t)||Xd(t)?t:e===Uc?null:[])(s,t.type)),[f,v]=_c(()=>((t,e)=>{if(Q(t)&&!e.includes(t))return{isSelected:!0,inputValue:t};if(Xd(t)){const n=t.find(t=>!e.includes(t));if(n)return{isSelected:!0,inputValue:n}}return{isSelected:!1,inputValue:""}})(s,c)),{isPreviewMode:p}=_d(),m=t.type===Uc,g=t.type===Hc,y=t.skipSubmitButton&&m&&!t.hasOpenChoice,b=(t,e)=>{if(e){const t=!f.isSelected;return v(e=>D(D({},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=>D(D({},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=>D(D({},t),{},{inputValue:e})),m&&h(e)},k=t=>{t.stopPropagation(),"Enter"!==t.key||_()||(t.preventDefault(),S()),"Escape"===t.key&&(t.preventDefault(),v(t=>D(D({},t),{},{isSelected:!1,inputValue:""})),m&&h(null))},_=()=>!(t.optional||!J(d)&&(!U(d)||f.isSelected||0!==d.length)&&(!f.isSelected||""!==f.inputValue.trim())),S=()=>{f.isSelected&&g?U(d)&&(p?o([...d,f.inputValue]):r([...d,f.inputValue])):p?o(d):r(d)};return Ld(Wu,{children:[Ld("div",{className:"question-container",children:[Ld(Gd,{question:t,forceDisableHtml:e}),Ld("fieldset",{className:"multiple-choice-options limit-height",children:[Ld("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 Ld("label",{className:r?"choice-option-open":"",children:[Ld("div",{className:"response-choice",children:[Ld("input",{type:m?"radio":"checkbox",name:o,checked:a,onChange:()=>b(e,r),id:o,"aria-controls":s}),Ld("span",{children:r?`${e}:`:e})]}),r&&Ld("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)})]})]}),Ld(Vd,{text:t.buttonText||"Submit",submitDisabled:_(),appearance:i,onSubmit:S,onPreviewSubmit:S,skipSubmitButton:y,canGoBack:a,onBack:l})]})}const rh=[1,2,3,4,5],oh=[1,2,3,4,5,6,7],sh=[0,1,2,3,4,5,6,7,8,9,10],ah={2:[Bd,zd],3:[Nd,Fd,Dd],5:[qd,Nd,Fd,Dd,jd]};function lh(t){switch(t){case 5:default:return rh;case 7:return oh;case 10:return sh}}const uh=he("[Surveys]");function ch(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?Vc:o;if(r.branching.type===Vc)return Vc;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===Uc){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];return Number.isInteger(e)?e:e===Vc?Vc:o}}else if(r.type===Wc){var a;if("number"!=typeof n||!Number.isInteger(n))throw new Error("The response type must be an integer");const t=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(t)){const e=r.branching.responseValues[t];return Number.isInteger(e)?e:e===Vc?Vc:o}}return o}return uh.warn("Falling back to next question index due to unexpected branching type"),o}const dh=he("[SurveyTranslations]");function hh(t,e){const n=function(t){return function({overrideLanguage:t,storedPersonProperties:e,locale:n},i){const r=Pi(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?Pi(t.language):null}(e);if(o)return null==i||i.info(`Using person property language: ${o}`),o;const s=Pi(n);return s?(null==i||i.info(`Using detected locale: ${s}`),s):(null==i||i.info("No user language detected"),null)}({overrideLanguage:t.config.override_display_language,storedPersonProperties:W(t.get_property)?t.get_property(l):void 0,locale:navigator.language||navigator.userLanguage},dh)}(e);if(!n)return dh.info("No user language detected"),{survey:t,language:null};const i=Ni(t,n,dh);return{survey:i.survey,language:i.matchedKey}}const fh=t,vh=i,ph="ph:show_survey_widget",mh="PHWidgetSurveyClickListener";function gh(t,e){try{const n=t.getBoundingClientRect(),i=fh.innerHeight,r=fh.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:ud.zIndex}}catch(t){return Yc.warn("Failed to calculate trigger position:",t),null}}var yh=class{constructor(t){this.bi=new Map,this.wi=new Map,this.ki=new Map,this.Si=new Map,this.xi=new Set,this.Ci=null,this.Ii=!1,this.Mi=null,this.Ti=null,this.Ri=null,this.Ei=!1,this.handlePageUnload=()=>{const t=this._posthog.get_property(b);if(t)for(const e of t)Ed(e)&&gd(e,this._posthog)},this.handlePopoverSurvey=(t,e,{resumeDelayFromActivation:n=!1}={})=>{var i,r,o,s,a,l;if(!td(this._posthog))return;const{survey:u,language:c}=this.Ai(t);this.Ci=c,this.Ri=null,this.$i=e;const d=this.Oi(u,e);this.Pi(d.id);const{properties:h,initialResponses:f}=null!=e?e:{},v=!(!f||0>=Object.keys(f).length)&&this.Li(d,f,h,c);if(v&&!(null===(i=d.appearance)||void 0===i?void 0:i.displayThankYouMessage))return;this.Di(d);let p={};if((null===(r=d.appearance)||void 0===r?void 0:r.position)===Nc&&(null===(o=d.appearance)||void 0===o?void 0:o.widgetSelector)){const t=vh.querySelector(d.appearance.widgetSelector);var m;t&&(p=gh(t,parseInt((null===(m=d.appearance)||void 0===m?void 0:m.maxWidth)||ud.maxWidth))||{})}const g=(null===(s=d.appearance)||void 0===s?void 0:s.surveyPopupDelaySeconds)||0,{shadow:y}=fd(d,this._posthog);this.Si.set(y,y.host);const b={posthog:this._posthog,survey:d,removeSurveyFromFocus:this.Fi,properties:h,style:p,isSurveyCompleted:v,skipShownEvent:null==e?void 0:e.skipShownEvent,surveyLanguage:c};if(this.Ri=b,0>=g)return this.Ii=!0,dc(Ld(Sh,D({},b)),y);const w=()=>{this.Ii=!0;const{survey:n,language:i}=this.Ai(t);this.Ci=i;const r=this.Oi(n,e),o=D(D({},b),{},{survey:r,surveyLanguage:i});this.Ri=o,dc(Ld(Sh,D(D({},o),{},{survey:D(D({},r),{},{appearance:D(D({},r.appearance),{},{surveyPopupDelaySeconds:0})})})),y)},k=()=>{if(!td(this._posthog)||!this.Ni(d))return Yc.info(`Survey ${d.id} no longer eligible when its display delay elapsed; not displaying`),this.Fi(d);w()},_=n?null===(a=this._posthog.surveys)||void 0===a||null===(a=a._surveyEventReceiver)||void 0===a||null===(l=a.getActivationTimestamp)||void 0===l?void 0:l.call(a,d.id):void 0,S=X(_)?Math.max(0,Date.now()-_):0,x=Math.max(0,1e3*g-S);if(0>=x)return k();const C=fh.setTimeout(()=>{this.bi.delete(d.id),k()},x);this.bi.set(d.id,C)},this.qi=t=>{var e;const{survey:n,language:i}=this.Ai(t),{shadow:r,isNewlyCreated:o}=fd(n,this._posthog);this.Si.set(r,r.host),(null===(e=t.appearance)||void 0===e?void 0:e.widgetType)===Pc&&this.ki.set(t.id,t),o&&dc(Ld(Ch,{posthog:this._posthog,survey:n,surveyLanguage:i},t.id),r)},this.ji=t=>{const e=this.wi.get(t);e&&(e.element.removeEventListener("click",e.listener),e.element.removeAttribute(mh),this.wi.delete(t),Yc.info(`Removed click listener for survey ${t}`))},this.Bi=t=>{this.zi(t)||(this.Hi(t),this.ji(t.id))},this.Ui=t=>{this.zi(t)||(this.Hi(t),this.ki.delete(t.id))},this.zi=t=>{try{var e;const n=vh.querySelector($d(t,!0));return!!(null==n||null===(e=n.shadowRoot)||void 0===e?void 0:e.querySelector(".ph-survey"))}catch(t){return!1}},this.Wi=(t,e)=>{const n=vh.querySelector(e),i=this.wi.get(t.id);if(n){if(this.qi(t),i){if(n===i.element)return;Yc.info(`Selector element changed for survey ${t.id}. Re-attaching listener.`),this.ji(t.id)}if(!n.hasAttribute(mh)){const e=e=>{var n,i;e.stopPropagation();const r=(null===(n=t.appearance)||void 0===n?void 0:n.position)===Nc?gh(e.currentTarget,parseInt((null===(i=t.appearance)||void 0===i?void 0:i.maxWidth)||ud.maxWidth)):{};fh.dispatchEvent(new CustomEvent(ph,{detail:{surveyId:t.id,position:r}}))};me(n,"click",e),n.setAttribute(mh,"true"),this.wi.set(t.id,{element:n,listener:e,survey:t}),Yc.info(`Attached click listener for feedback button survey ${t.id}`)}}else i&&this.Bi(t)},this.renderPopover=t=>{if(!td(this._posthog))return;const{survey:e,language:n}=this.Ai(t),{shadow:i}=fd(e,this._posthog);this.Si.set(i,i.host),dc(Ld(Sh,{posthog:this._posthog,survey:e,removeSurveyFromFocus:this.Fi,surveyLanguage:n}),i)},this.renderSurvey=(t,e,n)=>{var i;if(!td(this._posthog))return;const{survey:r,language:o}=this.Ai(t);let s=!1;(null===(i=this._posthog.config)||void 0===i||null===(i=i.surveys)||void 0===i?void 0:i.prefillFromUrl)&&(s=this.Vi(r,o,n)),dc(Ld(Sh,{posthog:this._posthog,survey:r,removeSurveyFromFocus:this.Fi,isPopup:!1,properties:n,isSurveyCompleted:s,surveyLanguage:o}),e)},this.getActiveMatchingSurveys=(t,e=!1)=>{var n;null===(n=this._posthog)||void 0===n||null===(n=n.surveys)||void 0===n||n.getSurveys(e=>{t(e.filter(t=>this.Ni(t)))},e)},this.callSurveysAndEvaluateDisplayLogic=(t=!1)=>{this.getActiveMatchingSurveys(t=>{const e=td(this._posthog),n=t.filter(t=>e&&(t.type===qc||t.type===jc)),i=new Set(n.map(t=>t.id));for(const t of Array.from(this.bi.keys()))i.has(t)||this.cancelSurvey(t);const r=this.Gi(n),o=new Set,s=new Set;r.forEach(t=>{if(t.type===jc){var e,n,i,r;if((null===(e=t.appearance)||void 0===e?void 0:e.widgetType)===Pc)return s.add(t.id),void this.qi(t);"selector"===(null===(n=t.appearance)||void 0===n?void 0:n.widgetType)&&(null===(i=t.appearance)||void 0===i?void 0:i.widgetSelector)&&(o.add(t.id),this.Wi(t,null===(r=t.appearance)||void 0===r?void 0:r.widgetSelector))}J(this.Qi)&&t.type===qc&&this.handlePopoverSurvey(t,void 0,{resumeDelayFromActivation:!0})}),this.wi.forEach(({survey:t})=>{o.has(t.id)||this.Bi(t)}),this.ki.forEach((t,e)=>{s.has(e)||this.Ui(t)})},t)},this.Di=t=>{J(this.Qi)||Yc.error(`Survey ${this.Qi} already in focus. Cannot add survey ${t.id}.`),this.Qi=t.id},this.Fi=t=>{this.Qi!==t.id&&Yc.error(`Survey ${t.id} is not in focus. Cannot remove survey ${t.id}.`),this.Pi(t.id),this.Qi=null,this.Ci=null,this.Ii=!1,this.Ri=null,this.$i=void 0,this.Hi(t)},this._posthog=t,this.Qi=null,this.Mi=()=>this.Zi(),me(fh,"languagechange",this.Mi),this.Ti=t.onFeatureFlags(()=>this.Zi())}Zi(){if(J(this.Qi))return;const t=this._posthog.get_property(b),e=null==t?void 0:t.find(t=>t.id===this.Qi);if(!e)return;const{survey:n,language:i}=this.Ai(e);if(i===this.Ci)return;if(this.Ci=i,!this.Ii)return;const r=this.Oi(n,this.$i),{shadow:o}=fd(r,this._posthog);dc(Ld(Sh,D(D({},this.Ri),{},{posthog:this._posthog,survey:r,removeSurveyFromFocus:this.Fi,surveyLanguage:i})),o)}get Ji(){var t,e,n;return null!==(t=null===(e=(n=this._posthog).getExtension)||void 0===e?void 0:e.call(n,"featureFlags"))&&void 0!==t?t:this._posthog.featureFlags}Oi(t,e){return(null==e?void 0:e.position)||(null==e?void 0:e.selector)?D(D({},t),{},{appearance:D(D(D({},t.appearance),e.position&&{position:e.position}),e.selector&&{widgetSelector:e.selector})}):t}Pi(t){const e=this.bi.get(t);e&&(clearTimeout(e),this.bi.delete(t))}cancelSurvey(t){this.bi.has(t)&&(Yc.info(`Cancelled pending survey ${t}`),this.Pi(t),this.Qi===t&&(this.Qi=null,this.Ci=null,this.Ii=!1,this.Ri=null,this.$i=void 0))}clearInMemoryInProgressSurveyState(){(()=>{for(const t of Object.keys(Md))delete Md[t]})()}setAutomaticDisplayDispose(t){this.Ki=t}dispose(){var t;null===(t=this.Ki)||void 0===t||t.call(this),this.Ki=void 0,this.Mi&&(fh.removeEventListener("languagechange",this.Mi),this.Mi=null),this.Ti&&(this.Ti(),this.Ti=null),this.bi.forEach((t,e)=>this.Pi(e)),this.wi.forEach((t,e)=>this.ji(e)),this.Si.forEach((t,e)=>{dc(null,e),null==t||t.remove()}),this.Si.clear(),this.ki.clear(),this.Qi=null}Gi(t){return t.sort((t,e)=>{var n,i;const r=Ed(t),o=Ed(e);if(r&&!o)return-1;if(!r&&o)return 1;const s=t.schedule===Gc,a=e.schedule===Gc;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)})}Ai(t){return hh(t,this._posthog)}Vi(t,e,n){if(this.xi.has(t.id))return!1;const{params:i}=function(t){const e={};let n=!1;const i=t.replace(/^\?/,"");if(!i)return{params:e,autoSubmit:n};const r=i.split("&");for(const t of r){const i=t.indexOf("=");if(0>=i)continue;let r,o;try{r=decodeURIComponent(t.slice(0,i)),o=decodeURIComponent(t.slice(i+1))}catch(t){continue}if("auto_submit"===r&&"true"===o){n=!0;continue}const s=r.match(/^q(\d+)$/);if(s){const t=parseInt(s[1],10);e[t]||(e[t]=[]),e[t].push(o)}}return{params:e,autoSubmit:n}}(fh.location.search);if(0===Object.keys(i).length)return!1;Yc.info("[Survey Prefill] Detected URL prefill parameters");const r=this.Xi(t,i,e);return!!r&&(this.Yi(t,r,n,e),this.xi.add(t.id),r.isSurveyCompleted)}Yi(t,e,n,i){const{responses:r,submissionId:o,isSurveyCompleted:s,skippedResponses:a}=e;(Object.keys(a).length>0&&t.enable_partial_responses||s)&&vd({responses:s?r:a,survey:t,surveySubmissionId:o,posthog:this._posthog,isSurveyCompleted:s,properties:n,surveyLanguage:i})}Li(t,e,n,i){const r={};for(const[t,n]of Object.entries(e))r[parseInt(t)]=U(n)?n.map(String):[String(n)];Yc.info("[Survey] Processing initial responses");const o=this.Xi(t,r,i);return!!o&&(this.Yi(t,o,n,i),o.isSurveyCompleted)}Xi(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 Uc:{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 Hc:{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 Wc:{const e=parseInt(r[0],10),s=t.scale||10;if(isNaN(e)||0>e||e>s)return void de.warn(`[Survey Prefill] Invalid rating for q${i}: ${r[0]} (scale: 0-${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 Yc.warn("[Survey Prefill] No valid responses after conversion"),null;const r=wi(),{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=ch(t,i,e.id?n[Ri(e.id)]:null);if(s===Vc)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)),i),l=o>=t.questions.length;return Td(t,{surveySubmissionId:r,responses:i,lastQuestionIndex:o,questionOrder:yd(t.questions),visitedIndices:a,surveyLanguage:n}),Yc.info("[Survey Prefill] Stored prefilled responses in localStorage"),{responses:i,submissionId:r,startQuestionIndex:o,isSurveyCompleted:l,skippedResponses:s}}catch(t){return Yc.error("[Survey Prefill] Error handling prefill:",t),null}}tr(t,e=void 0){if(!t)return!0;const n=this.Ji,i=!!(null==n?void 0:n.isFeatureEnabled(t,{send_event:!t.startsWith("survey-targeting-")}));let r=!0;e&&(r=(null==n?void 0:n.getFeatureFlag(t,{send_event:!1}))===e||"any"===e);const o=i&&r;return o||this.er(t),o}er(t){var e;!this.Ei&&(null===(e=this._posthog.config)||void 0===e?void 0:e.advanced_disable_feature_flags)&&(this.Ei=!0,Yc.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.`))}nr(t){return!t.conditions||xd(t,this._posthog)&&Cd(t)&&function(t){var e;return!(null===(e=t.conditions)||void 0===e?void 0:e.selector)||!!(null==ad?void 0:ad.querySelector(t.conditions.selector))}(t)}ir(t){var e;return wd(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.Ji)||void 0===e?void 0:e.hasLoadedFlags)?(this.er(t.internal_targeting_flag_key),{satisfied:!1,reason:"Feature flags have not loaded yet; deferring internal targeting flag check"}):{satisfied:this.tr(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(!rd.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.tr(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.tr(t.targeting_flag_key))return i.eligible=!1,i.reason="Survey targeting feature flag is not enabled",i;const o=this.ir(t);var s;return o.satisfied?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}(null===(n=t.conditions)||void 0===n?void 0:n.seenSurveyWaitPeriodInDays,Si.Ot("lastSeenSurveyDate"))?(t=>!!Si.Ot(nd(t))&&!wd(t))(t)?(i.eligible=!1,i.reason="Survey has already been seen and it can't be activated again",i):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(){return td(this._posthog)?{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.rr(t)?{eligible:!1,reason:"Survey event/action trigger has not been fired yet"}:e}rr(t){var e;if(!qi(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._posthog.surveys)||void 0===e||null===(e=e._surveyEventReceiver)||void 0===e?void 0:e.getSurveys();return!!(null==n?void 0:n.includes(t.id))}sr(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.tr(e))}Ni(t){return this.checkSurveyEligibility(t).eligible&&this.nr(t)&&this.rr(t)&&this.sr(t)}Hi(t){try{const e=vh.querySelector($d(t,!0));(null==e?void 0:e.shadowRoot)&&(dc(null,e.shadowRoot),this.Si.delete(e.shadowRoot)),null==e||e.remove()}catch(e){Yc.warn(`Failed to remove survey ${t.id} from DOM:`,e)}}getTestAPI(){return{addSurveyToFocus:this.Di,removeSurveyFromFocus:this.Fi,surveyInFocus:this.Qi,surveyTimeouts:this.bi,handleWidget:this.qi,handlePopoverSurvey:this.handlePopoverSurvey,manageWidgetSelectorListener:this.Wi,sortSurveysByAppearanceDelay:this.Gi,checkFlags:this.sr.bind(this),isSurveyFeatureFlagEnabled:this.tr.bind(this),onLanguageChange:this.Zi.bind(this),currentLanguage:this.Ci,surveyIsRendered:this.Ii}}};function bh(t,e){if(!vh||!fh)return;const n=new yh(t);if(t.config.disable_surveys_automatic_display)return Yc.info("Surveys automatic display is disabled. Skipping call surveys and evaluate display logic."),n;if(!1===e)return Yc.info("There are no surveys to load or Surveys is disabled in the project settings."),n;let i;n.callSurveysAndEvaluateDisplayLogic(!0);const r=()=>{G(i)&&(i=setInterval(()=>{n.callSurveysAndEvaluateDisplayLogic(!1)},1e3))},o=()=>{G(i)||(clearInterval(i),i=void 0)};r();const s=()=>{vh.hidden?o():(n.callSurveysAndEvaluateDisplayLogic(!1),r())};return me(vh,"visibilitychange",s),n.setAutomaticDisplayDispose(()=>{o(),vh.removeEventListener("visibilitychange",s)}),n}function wh({survey:t,removeSurveyFromFocus:e=()=>{},setSurveyVisible:n,isPreviewMode:i=!1,posthog:r}){Sc(()=>{var o;if(i||!(null===(o=t.conditions)||void 0===o?void 0:o.url))return;const s=()=>{var i;const o=t.type===jc,s=xd(t,r),a=(null===(i=t.appearance)||void 0===i?void 0:i.widgetType)===Pc&&o;if(!s)return Yc.info(`Hiding survey ${t.id} because URL does not match`),n(!1),e(t);a&&(Yc.info(`Showing survey ${t.id} because it is a feedback button tab and URL matches`),n(!0))};me(fh,"popstate",s),me(fh,"hashchange",s);const a=fh.history.pushState,l=fh.history.replaceState;return fh.history.pushState=function(...t){a.apply(this,t),s()},fh.history.replaceState=function(...t){l.apply(this,t),s()},()=>{fh.removeEventListener("popstate",s),fh.removeEventListener("hashchange",s),fh.history.pushState=a,fh.history.replaceState=l}},[i,t,e,n,r])}const kh=200;function _h(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 Sh({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,I;const M=xc(null),T=Number.isInteger(r),{isPopupVisible:R,isSurveySent:E,hidePopupWithAnimation:A}=function(t,e,n,i,r,o,s,a,l){const[u,c]=_c(i||0===n||t.type===Bc),[d,h]=_c(!1),f=xc(!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 ${kh}ms ease-out`,n.style.opacity="0",setTimeout(()=>{f.current=!1,e()},250)):e()},p=e=>{e.detail.surveyId===t.id&&v()};return Sc(()=>{if(!e)return void Yc.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=()=>{if(xd(t,e)){c(!0);try{localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())}catch(t){}var n;fh.dispatchEvent(new Event("PHSurveyShown")),a||e.capture("survey shown",D(D({[Zc]:t.name,[Qc]:t.id,[Jc]:t.current_iteration,[Kc]:t.current_iteration_start_date},l&&{[Xc]:l}),{},{sessionRecordingUrl:null===(n=e.get_session_replay_url)||void 0===n?void 0:n.call(e)}))}};me(fh,"PHSurveyClosed",p),me(fh,"PHSurveySent",o);const u=n>0?setTimeout(s,n):void 0;return G(u)&&s(),()=>{G(u)||clearTimeout(u),G(r)||clearTimeout(r),fh.removeEventListener("PHSurveyClosed",p),fh.removeEventListener("PHSurveySent",o)}},[]),wh({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,T,o,s,M,f,v),O=E||r===t.questions.length||!0===h,[P,L]=_c(!1),F=Cc(()=>!!Rd(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=T?-1===r:!!(null===(y=t.appearance)||void 0===y?void 0:y.displayIntroScreen)&&N&&!P&&!F,j=Cc(()=>{const e=Rd(t),i=(null==e?void 0:e.surveySubmissionId)||wi();return{isPreviewMode:T,previewPageIndex:r,onPopupSurveyDismissed(){v?md(t,n,T,v):md(t,n,T),u()},isPopup:s||!1,surveySubmissionId:i,onPreviewSubmit:a,onPreviewBack:l,posthog:n,properties:d,surveyLanguage:v}},[T,r,s,n,t,u,a,l,d,v]);return R?Ld(kd.Provider,{value:j,children:Ld("div",{className:"ph-survey",style:D(D({},Od(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:M,children:O?Ld(Jd,{header:(null===(k=t.appearance)||void 0===k?void 0:k.thankYouMessageHeader)||"Thank you!",description:(null===(_=t.appearance)||void 0===_?void 0:_.thankYouMessageDescription)||"",forceDisableHtml:!!e,contentType:null===(S=t.appearance)||void 0===S?void 0:S.thankYouMessageDescriptionContentType,appearance:t.appearance||ud,onClose(){A(),c()}}):q?Ld(Kd,{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===(I=t.appearance)||void 0===I?void 0:I.introScreenDescriptionContentType,appearance:t.appearance||ud,onStart:()=>L(!0)}):Ld(xh,{survey:t,forceDisableHtml:!!e,posthog:n})})}):null}function xh({survey:t,forceDisableHtml:e,posthog:n}){var i,r;const o=Cc(()=>{const e=Rd(t);if(!e)return null;const n=X(e.lastQuestionIndex);return!n||n&&e.lastQuestionIndex>=0&&t.questions.length>e.lastQuestionIndex?e:(Ad(t),null)},[t]),[s,a]=_c(()=>((null==o?void 0:o.responses)&&Yc.info("Survey is already in progress, filling in initial responses"),(null==o?void 0:o.responses)||{})),[l,u]=_c(!1),{previewPageIndex:c,onPopupSurveyDismissed:d,isPopup:h,onPreviewSubmit:f,onPreviewBack:v,surveySubmissionId:p,isPreviewMode:m,properties:g,surveyLanguage:y}=Ic(kd),[b,w]=_c(()=>{const e=null==o?void 0:o.lastQuestionIndex,n=X(e)&&e>=0&&t.questions.length>e?e:0;return X(c)&&c>=0?c:n}),[k,_]=_c(()=>{var e;return(null!==(e=null==o?void 0:o.visitedIndices)&&void 0!==e?e:[]).filter(e=>e>=0&&t.questions.length>e)}),[S,x]=_c(()=>{var e;const n=Rd(t);return null!==(e=null==n?void 0:n.questionSnapshots)&&void 0!==e?e:{}}),C=Cc(()=>yd(bd(t,o)),[t.id,o]),I=Cc(()=>{if(!C||new Set(C).size!==C.length)return bd(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]);Sc(()=>{!m||G(c)||0>c||w(c)},[c,m]);const M=!!(null===(i=t.appearance)||void 0===i?void 0:i.allowGoBack)&&(m?(null!=c?c:0)>0:k.length>0),T=I.at(b);return T?Ld("form",{className:"survey-form",name:"surveyForm",children:[h&&!0!==(null===(r=t.appearance)||void 0===r?void 0:r.hideCancelButton)&&Ld(Qd,{onClick(){d()}}),Ld("div",{className:"survey-box","data-question-index":b,children:[l&&Ld("p",{role:"alert",children:"Your response could not be sent. Please try again later."}),Ih({question:T,forceDisableHtml:e,displayQuestionIndex:b,appearance:t.appearance||ud,onSubmit:e=>(({res:e,displayQuestionIndex:i,questionId:r})=>{if(!n)return void Yc.error("onNextButtonClick called without a PostHog instance.");if(!td(n))return void u(!0);if(u(!1),!r)return void Yc.error("onNextButtonClick called without a questionId.");const{responses:o,questionSnapshots:l}=function({responses:t,questionSnapshots:e={}},n,i,r){return{responses:D(D({},t),{},{[Ri(n)]:i}),questionSnapshots:(null==r?void 0:r.id)?D(D({},e),{},{[r.id]:r.question}):e}}({responses:s,questionSnapshots:S},r,e,I[i]);a(o),x(l);const c=ch(t,i,e),d=c===Vc,h=[...k,i];if(d||(_(h),w(c),Td(t,{surveySubmissionId:p,responses:o,lastQuestionIndex:c,questionOrder:yd(I),visitedIndices:h,surveyLanguage:y,questionSnapshots:l})),t.enable_partial_responses||d){const e=new Set(h.map(t=>{var e;return null===(e=I[t])||void 0===e?void 0:e.id}).filter(t=>!!t).map(t=>Ri(t))),i=Object.fromEntries(Object.entries(o).filter(([t])=>e.has(t)));vd({responses:i,survey:t,surveySubmissionId:p,isSurveyCompleted:d,posthog:n,properties:g,surveyLanguage:y,questionSnapshots:l})}})({res:e,displayQuestionIndex:b,questionId:T.id}),onPreviewSubmit:f,initialValue:T.id?s[Ri(T.id)]:void 0,canGoBack:M,onBack(){if(m)return void v();if(0===k.length)return;const e=k[k.length-1],n=k.slice(0,-1);_(n),w(e),Td(t,{surveySubmissionId:p,responses:s,lastQuestionIndex:e,questionOrder:yd(I),visitedIndices:n,surveyLanguage:y,questionSnapshots:S})}})]})]}):null}function Ch({survey:t,forceDisableHtml:e,posthog:n,readOnly:i,surveyLanguage:r}){var o,s,a,l,u,c,d;const[h,f]=_c(!0),[v,p]=_c(!1),[m,g]=_c({}),y=xc(void 0),b=()=>{(v||!n||i||td(n))&&p(!v)};if(Sc(()=>{var e;if(!n)return void Yc.error("FeedbackWidget called without a PostHog instance.");if(i)return;"tab"===(null===(e=t.appearance)||void 0===e?void 0:e.widgetType)&&g({top:"50%",bottom:"auto"});const r=e=>{var n;const i=e;(null===(n=i.detail)||void 0===n?void 0:n.surveyId)===t.id&&(Yc.info(`Received show event for feedback button survey ${t.id}`),g(i.detail.position||{}),b())};return me(fh,ph,r),()=>{G(y.current)||(clearTimeout(y.current),y.current=void 0),fh.removeEventListener(ph,r)}},[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.widgetSelector,null===(a=t.appearance)||void 0===a?void 0:a.borderColor]),wh({survey:t,setSurveyVisible:f,posthog:n}),!h)return null;const w=()=>{t.schedule!==Gc&&f(!1),G(y.current)||clearTimeout(y.current),y.current=setTimeout(()=>{y.current=void 0,p(!1)},200)};return Ld(Wu,{children:["tab"===(null===(l=t.appearance)||void 0===l?void 0:l.widgetType)&&Ld("button",{className:"ph-survey-widget-tab "+("top"===(null===(u=t.appearance)||void 0===u?void 0:u.tabPosition)?"widget-tab-top":""),onClick:b,disabled:i,style:_h(null===(c=t.appearance)||void 0===c?void 0:c.tabPosition),children:(null===(d=t.appearance)||void 0===d?void 0:d.widgetLabel)||""}),v&&Ld(Sh,{posthog:n,survey:t,forceDisableHtml:e,style:m,onPopupSurveyDismissed:w,onCloseConfirmationMessage:w,surveyLanguage:r})]})}const Ih=({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 zc:return Hu(Yd,D(D({},u),{},{question:t,key:t.id}));case"link":return Hu(th,D(D({},u),{},{question:t,key:t.id}));case Wc:return Hu(eh,D(D({},u),{},{question:t,key:t.id}));case Uc:case Hc:return Hu(ih,D(D({},u),{},{question:t,key:t.id}));default:return Yc.error(`Unsupported question type: ${t.type}`),null}};a.__PosthogExtensions__=a.__PosthogExtensions__||{},a.__PosthogExtensions__.generateSurveys=bh,a.extendPostHogWithSurveys=bh;const Mh=t=>{for(;null==t?void 0:t.__rrweb_original__;)t=t.__rrweb_original__;return t},Th=1e4,Rh=(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),Eh=(t,e,n)=>{const i=JSON.stringify(t);if(n.remaining>=i.length)return Rh(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 Rh(e,JSON.stringify(t.slice(0,r)),n)},Ah=t=>void 0!==t&&"function"!=typeof t&&"symbol"!=typeof t&&"bigint"!=typeof t,$h=(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}},Oh=(t,e,n)=>{if(!n.truncated)if(V(t)){if(n.seen.has(t))return void $h(e||"circular","[Circular]",n);n.seen.add(t);try{for(const i in t)try{if(!{}.hasOwnProperty.call(t,i))continue;if(Oh(t[i],e?`${e}.${i}`:i,n),n.truncated)break}catch(t){continue}}catch(t){}}else $h(e,t,n)},Ph=(t,e,n,i,r=!1,o)=>{if(!Ah(t))return!r||Rh(e,"null",n);if(J(t)||(t=>{try{return X(t)||Y(t)}catch(t){return!1}})(t))return Rh(e,JSON.stringify(t),n);if("string"==typeof t)return Eh(t,e,n);if(!V(t)&&!U(t))return Rh(e,JSON.stringify(t),n);if(i.has(t))return Eh("[Circular]",e,n);i.add(t);try{const o=t.toJSON;if(W(o))return Ph(o.call(t),e,n,i,r)}catch(t){}try{const i={}.toString.call(t);if("[object String]"===i)return Eh(String(t.valueOf()),e,n);if("[object Number]"===i||"[object Boolean]"===i)return Rh(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 Ph(s,e,n,i,r,o)}if(U(t)){if(!Rh(e,"[",n))return!1;for(let r=0;t.length>r;r++){if(r>0&&!Rh(e,",",n))return!1;let o;try{o=t[r]}catch(t){o=void 0}if(!Ph(o,e,n,i,!0))return!1}return Rh(e,"]",n)}if(!Rh(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{Oh(a,r,o)}catch(t){}if(!Ah(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(!Rh(e,l,n))return!1;const h=e.length,f=Ph(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 Rh(e,"}",n)},Lh=(t,e)=>{const n=[],i={remaining:e,truncated:!1},r=V(t[0])?{result:{},keysRemaining:50,sizeRemaining:Th,truncated:!1,seen:new WeakSet([t[0]])}:void 0;for(let e=0;t.length>e&&(0>=e||Rh(n," ",i))&&Ph(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)||{}}},Dh={debug:"debug",log:"info",warn:"warn",error:"error",info:"info"},Fh=t=>"canCapture"in t,Nh=t=>({console:a.console,hostname:a.location.host,getCapturingLogs(){let e;return e=Fh(t)?t.canCapture?t.getExtension("logs"):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(Fh(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}});a.__PosthogExtensions__=a.__PosthogExtensions__||{},a.__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(Dh)){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}=Lh(s,Th),u=D(D({},r),i?{body_truncated:"true"}:{}),c={level:Dh[t],body:n,attributes:D(D({"log.source":`console.${t}`},u),l)};e.captureConsoleLog(c)}}}catch(t){}finally{a&&(o=!1),i.apply(e,s)}},a=e[t];i.push(Bl(e,t,t=>{const e=s(t);return e.__rrweb_original__=Mh(a),e}))}}catch(t){throw s(),t}return s})(Nh(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}=Lh(r.args,Th);null===(i=n.captureBufferedConsoleLog)||void 0===i||i.call(n,{level:Dh[r.level],body:e,attributes:D(D({"log.source":`console.${r.level}`,host:t.hostname},o?{body_truncated:"true"}:{}),s)},r.context,r.occurredAtMs)}catch(t){}})(Nh(t),e)},he("[Error tracking]");const qh=he("[ExceptionAutocapture]"),jh=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 D(D({},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?D(D({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:Et(this.stackParser),skipFirstLines:null!==(e=t.skipFirstLines)&&void 0!==e?e:1}}getAggregateErrors(t){try{if(it(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 D(D({},v),{},{errors:m})},c=(n,i=0)=>D(D({},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 D(D({},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=Q(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 nt(t,"DOMException")}isDOMError(t){return nt(t,"DOMError")}},new class{match(t){return nt(t,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(t)}isCustomEventWrappingRejection(t){if(!rt(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 et(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!!nt(t,"ErrorEvent")&&(null!=t.error||this.ar(t))}coerce(t,e){var n;if(null!=t.error)return e.apply(t.error);const i=e.apply(t.message);return D(D({},i),{},{stack:null!==(n=this.lr(t))&&void 0!==n?n:i.stack,synthetic:!0})}ar(t){return Q(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(Q(i.filename)&&0!==i.filename.length&&0!==r)return`Error\n at ${i.filename}:${r}:${o}`}},new class{match(t){return it(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 rt(t)}coerce(t,e){var n;const i=t.constructor.name;return{type:i,value:`${i} captured as exception with keys: ${te(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(rt(t))return t.constructor.name;const e="name"in t?t.name:void 0;return Q(e)&&!Z(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: ${te(t)}`}isSeverityLevel(t){return Q(t)&&!Z(t)&&Yt.indexOf(t)>=0}getStack(t){try{return Q(t.stacktrace)&&t.stacktrace.length>0?t.stacktrace:Q(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(it(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(Xt);return i&&(e=i[1],n=i[2]),[e,n]}},new class{match(t){return et(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=Ut.test(i)?i.replace(Ut,"$1"):i;if(!s.match(/\S*Error: /)){for(const n of e){const e=n(s,t);if(e){r.push(e);const t=Vt(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(Jt(r,a)>=50)break}}const l=[...a].sort((t,e)=>e.start-t.start),u=l[l.length-1];if(u){const t=Qt(r,u);r.splice(u.start-t,t);for(const e of l)e.start-=t}for(const t of l)Gt(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++)Kt(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 D(D({},t),{},{filename:t.filename||(n=e,n[n.length-1]||{}).filename,function:t.function||"?"});var n})}(r)}}("web:javascript",jt,Ht)),Bh=(t,e)=>{try{return t()}catch(t){return e}},zh=(t,e)=>Bh(()=>t(e()),void 0),Hh=t=>Bh(()=>W(t)&&W(t.call),!1),Uh=(t,e)=>Bh(()=>{t[e].__POSTHOG_INSTRUMENTED__=!0},void 0),Wh=(t,e,n)=>{Bh(()=>{var n;null===(n=t[e])||void 0===n||delete n.__POSTHOG_INSTRUMENTED__},void 0),Bh(()=>{t[e]=n},void 0)},Vh=e=>{const n=t;n||qh.info("window not available, cannot wrap onerror");const i=Bh(()=>n.onerror,void 0);return n.onerror=function(...t){var n;return zh(e,()=>jh.buildFromUnknown((([t,e,n,i,r])=>{if(null!=r)return r;if(Q(t)&&Q(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}})),!!Hh(i)&&null!==(n=i(...t))&&void 0!==n&&n},Uh(n,"onerror"),()=>Wh(n,"onerror",i)},Gh=(e,n=!1)=>{const i=t;i||qh.info("window not available, cannot wrap onUnhandledRejection");const r=Bh(()=>i.onunhandledrejection,void 0);return i.onunhandledrejection=function(t){var i;return zh(e,()=>jh.buildFromUnknown(t,{mechanism:{handled:!1}})),Hh(r)?null!==(i=r(t))&&void 0!==i&&i:n},Uh(i,"onunhandledrejection"),()=>Wh(i,"onunhandledrejection",r)},Qh={wrapOnError:Vh,wrapUnhandledRejection:Gh,wrapConsoleError(t){const e=console;e||qh.info("console not available, cannot wrap console.error");const n=Bh(()=>e.error,void 0);return e.error=function(...e){Bh(()=>e.length>1&&Q(e[0])&&(/^\[PostHog\.js\](?: |$)/.test(e[0])||"rrweb logger error:"===e[0]),!1)||zh(t,()=>{let t;t=1==e.length?e[0]:e.join(" ");const n=e.find(t=>t instanceof Error);return jh.buildFromUnknown(n||t,{mechanism:{handled:!0,type:"onconsole"},syntheticException:new Error("PostHog syntheticException"),skipFirstLines:2})}),Hh(n)&&n(...e)},Uh(e,"error"),()=>Wh(e,"error",n)}};a.__PosthogExtensions__=a.__PosthogExtensions__||{},a.__PosthogExtensions__.errorWrappingFunctions=Qh,a.posthogErrorWrappingFunctions=Qh;const Zh=(t,e)=>{if(!W(null==t?void 0:t.capture))return;const n=null==e?void 0:e.autocaptureExceptions,i=!J(n)&&"object"==typeof n&&U(n.errors_to_ignore)?n.errors_to_ignore.reduce((t,e)=>{try{t.push(new RegExp(e))}catch(t){qh.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){qh.error("Failed to capture exception for a legacy client",t)}};Vh(t=>{i.some(e=>t.$exception_list.some(t=>e.test(t.value||"")))||r(t)}),Gh(r,!0)};a.extendPostHogWithExceptionAutoCapture=Zh,a.extendPostHogWithExceptionAutocapture=Zh;const Jh="X-POSTHOG-SESSION-ID",Kh="X-POSTHOG-WINDOW-ID",Xh="X-POSTHOG-DISTINCT-ID",Yh=[Jh,Kh,Xh],tf=["attributionReporting","body","browsingTopics","cache","credentials","dispatcher","duplex","integrity","keepalive","method","mode","priority","redirect","referrer","referrerPolicy","signal","window"],ef=(t,e)=>({}.hasOwnProperty.call(t,e)),nf=t=>"object"==typeof t&&!J(t)||W(t),rf=t=>"undefined"!=typeof Request&&(t instanceof Request||"[object Request]"==={}.toString.call(t)),of=e=>{try{var n;return rf(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}},sf=(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;if(n){const{sessionId:t,windowId:e}=n.checkAndGetSessionAndWindowId(!0);r.set(Jh,t),r.set(Kh,e),s=!0}const a=(t=>W(t)?t():t)(e);return a&&"$posthog_cookieless"!==a&&(r.set(Xh,a),s=!0),s};a.__PosthogExtensions__=a.__PosthogExtensions__||{};const af={_patchFetch:(e,n,i)=>Bl(t,"fetch",t=>function(r,o){const s=arguments.length>1?[r,o]:[r];let a=s;try{const t=of(r);if(t)if(rf(r)){const t=new Request(r,o);sf(e,n,i,t.url,t.headers),a=[t]}else{const s=new Headers(nf(o)?o.headers:void 0);if(sf(e,n,i,t,s)){const t=((t,e)=>{if(G(t)||J(t))return{headers:e};if(!nf(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)=>ef(t,e)?Reflect.get(t,e):Reflect.get(n,e,n),has:(t,e)=>ef(t,e)||e in n,ownKeys(t){const e=new Set(Reflect.ownKeys(t));return Reflect.ownKeys(n).forEach(t=>e.add(t)),tf.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&&tf.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?D(D({},r),{},{configurable:!0}):void 0},getPrototypeOf:()=>Object.getPrototypeOf(n)})})(o,s);t&&(a=[r,t])}}}catch(t){a=s}return t.apply(this,a)}),_patchXHR:(e,n,i)=>Bl(t.XMLHttpRequest.prototype,"open",t=>function(r,o,s=!0,a,l){const u=this,c=new Headers,d=of(o);d&&sf(e,n,i,d,c);const h=t.call(u,r,o,s,a,l);return Yh.forEach(t=>{const e=c.get(t);if(e)try{u.setRequestHeader(t,e)}catch(t){}}),h})};a.__PosthogExtensions__.tracingHeadersPatchFns=af,a.postHogTracingHeadersPatchFns=af,"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 lf=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 uf=()=>{const t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},cf=t=>{if("loading"===document.readyState)return"loading";const e=uf();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"},df=t=>{const e=t.nodeName;return 1===t.nodeType?e.toLowerCase():e.toUpperCase().replace(/^#/,"")},hf=t=>{let e="";try{for(;9!==(null==t?void 0:t.nodeType);){var n;const i=t,r=i.id?"#"+i.id:[df(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},ff=new WeakMap;function vf(t,e){let n=ff.get(e);return n||(n=new WeakMap,ff.set(e,n)),n.get(t)||n.set(t,new e),n.get(t)}let pf=-1;const mf=()=>pf,gf=t=>{addEventListener("pageshow",e=>{e.persisted&&(pf=e.timeStamp,t(e))},!0)},yf=(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)))}},bf=t=>{requestAnimationFrame(()=>requestAnimationFrame(()=>t()))},wf=()=>{var t,e;return null!==(t=null===(e=uf())||void 0===e?void 0:e.activationStart)&&void 0!==t?t:0};let kf=-1;const _f=new Set,Sf=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,xf=t=>{if("hidden"===document.visibilityState){if("visibilitychange"===t.type)for(const t of _f)t();isFinite(kf)||(kf="visibilitychange"===t.type?t.timeStamp:0,removeEventListener("prerenderingchange",xf,!0))}},Cf=(t=!1)=>{if(t&&(kf=1/0),0>kf){var e;const t=wf(),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;kf=null!=n?n:Sf(),addEventListener("visibilitychange",xf,!0),addEventListener("prerenderingchange",xf,!0),gf(()=>{setTimeout(()=>{kf=Sf()})})}return{get firstHiddenTime(){return kf},onHidden(t){_f.add(t)}}},If=(t,e=-1,n,i=0,r,o,s)=>{const a=uf(),l=(null==a?void 0:a.navigationId)||0;let u="navigate";return n?u=n:0>mf()?a&&(document.prerendering||wf()>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}},Mf=(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(D({type:e,buffered:!0},n));return t}}catch(t){}},Tf=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},Rf=(t,e)=>{if(t.set(e.navigationId,e),t.size>2){const e=t.keys().next().value;void 0!==e&&t.delete(e)}},Ef=t=>{let e=!1;return()=>{e||(t(),e=!0)}};var Af=class{constructor(){this.u=void 0}};const $f=t=>{document.prerendering?addEventListener("prerenderingchange",t,!0):t()},Of=[1800,3e3],Pf=(t,e={})=>{const n=Tf(e);$f(()=>{const i=vf(e,Af),r=Cf();let o,s=If("FCP");const a=Mf(["paint"],t=>{for(const e of t)"first-contentful-paint"===e.name&&(a.disconnect(),r.firstHiddenTime>e.startTime&&(s.value=Math.max(e.startTime-wf(),0),s.entries.push(e),s.navigationId=e.navigationId||s.navigationId,o(!0)))});a&&(o=yf(t,s,Of,e.reportAllChanges),gf(n=>{s=If("FCP",-1,"back-forward-cache",s.navigationId,s.navigationInteractionId,s.navigationURL,mf()),o=yf(t,s,Of,e.reportAllChanges),bf(()=>{s.value=performance.now()-n.timeStamp,o(!0)})})),n&&Mf(["soft-navigation"],n=>{n.forEach(n=>{i.u&&n.navigationId&&Rf(i.u,n);const r=Math.max((n.presentationTime||n.paintTime||0)-n.startTime,0);s=If("FCP",r,"soft-navigation",n.navigationId,n.interactionId,n.name,n.startTime),o=yf(t,s,Of,e.reportAllChanges),o(!0)})},e)})},Lf=[.1,.25],Df=t=>t.find(t=>{var e;return 1===(null===(e=t.node)||void 0===e?void 0:e.nodeType)})||t[0],Ff=(t,e={})=>{const n=vf(e=Object.assign({},e),lf),i=new WeakMap;n.t=t=>{var n;if(null==t||null===(n=t.sources)||void 0===n?void 0:n.length){const n=Df(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:hf(s);i.set(n,t)}}},((t,e={})=>{const n=Cf();Pf(Ef(()=>{let i,r=If("CLS",0);const o=vf(e,lf),s=(n,s,a,l,u)=>{r=If("CLS",0,n,s,a,l,u),o.o=0,i=yf(t,r,Lf,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"];Tf(e)&&c.push("soft-navigation");const d=Mf(c,u);d&&(i=yf(t,r,Lf,e.reportAllChanges),n.onHidden(()=>{u(d.takeRecords()),i(!0)}),gf(()=>{s("back-forward-cache",r.navigationId,r.navigationInteractionId,r.navigationURL,mf()),bf(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=Df(r.sources);t&&(e={largestShiftTarget:i.get(t),largestShiftTime:r.startTime,largestShiftValue:r.value,largestShiftSource:t,largestShiftEntry:r,loadState:cf(r.startTime)})}}return Object.assign(t,{attribution:e})})(e))},e)},Nf=(t,e={})=>{const n=vf(e=Object.assign({},e),Af);Tf(e)&&(n.u=new Map),Pf(e=>{t((t=>{let e={timeToFirstByte:0,firstByteToFCP:t.value,loadState:cf(mf())};if("soft-navigation"!==t.navigationType){if(t.entries.length){const n=uf(),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:cf(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 qf=0,jf=1/0,Bf=0;const zf=t=>{for(const e of t)e.interactionId&&(jf=Math.min(jf,e.interactionId),Bf=Math.max(Bf,e.interactionId),qf=Bf?(Bf-jf)/7+1:0)};let Hf;const Uf=()=>{var t;return Hf?qf:null!==(t=performance.interactionCount)&&void 0!==t?t:0};var Wf=class{constructor(){this.h=0,this.v=[],this.p=new Map,this.m=void 0,this.M=void 0}T(){return Uf()-this.h}D(){this.h=Uf(),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 Vf=t=>{const e="requestIdleCallback"in globalThis?1e3:0,n=globalThis.requestIdleCallback||setTimeout,i=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)t();else{const r=Ef(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})}},Gf=[200,500],Qf=(t,e={})=>{const n=vf(e=Object.assign({},e),Wf);let i=[],r=[],o=0;const s=new WeakMap,a=new WeakMap;let l=!1;const u=()=>{l||(Vf(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:hf(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};Mf(["long-animation-frame"],t=>{i=i.concat(t),u()},e),((t,e={})=>{if(!globalThis.PerformanceEventTiming||!("interactionId"in PerformanceEventTiming.prototype))return;const n=Cf();$f(()=>{var i;"interactionCount"in performance||Hf||(Hf=Mf(["event"],zf,{durationThreshold:0}));let r,o=If("INP");const s=vf(e,Wf),a=(n,i,a,l,u)=>{s.D(),o=If("INP",-1,n,i,a,l,u),r=yf(t,o,Gf,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)=>{Vf(()=>{for(const e of t)"soft-navigation"!==e.entryType?s.l(e):u(e);l(),e&&r(!0)})},d=["event","first-input"];Tf(e)&&d.push("soft-navigation");const h=Mf(d,c,D(D({},e),{},{durationThreshold:null!==(i=e.durationThreshold)&&void 0!==i?i:40}));r=yf(t,o,Gf,e.reportAllChanges),h&&(n.onHidden(()=>{c(h.takeRecords(),!0)}),gf(()=>{a("back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,mf())}))})})(e=>{t((t=>{if(0===t.entries.length){const e={processedEventEntries:[],longAnimationFrameEntries:[],inputDelay:0,processingDuration:0,presentationDelay:t.value,loadState:cf(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:cf(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 Zf=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 Jf=50;const Kf=[];Mf(["resource"],t=>{for(const e of t)Kf.push(e),Kf.length>Jf&&Kf.shift()});const Xf=(t,e={})=>{null!=(e=Object.assign({},e)).resourceBufferSize&&(Jf=e.resourceBufferSize);const n=vf(e,Zf),i=new WeakMap;Tf(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:hf(n);i.set(t,s)}else t.id&&i.set(t,`#${t.id}`)},((t,e={})=>{let n=!1;const i=Tf(e);$f(()=>{let r,o=Cf(),s=If("LCP");const a=vf(e,Zf),l=(i,a,l,u,c)=>{s=If("LCP",-1,i,a,l,u,c),r=yf(t,s,$,e.reportAllChanges),n=!1,"soft-navigation"===i&&(o=Cf(!0))},u=t=>{var e;a.u&&t.navigationId&&Rf(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-wf(),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=Mf(d,c);if(h){r=yf(t,s,$,e.reportAllChanges);const o=["keydown","click","visibilitychange"],a=t=>{if(t.isTrusted&&!n){const t=s.id;Vf(()=>{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});gf(i=>{l("back-forward-cache",s.navigationId,s.navigationInteractionId,s.navigationURL,mf()),r=yf(t,s,$,e.reportAllChanges),bf(()=>{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&&(Kf.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=uf(),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=D(D({},e),{},{timeToFirstByte:n,resourceLoadDelay:i-n,resourceLoadDuration:r-i,elementRenderDelay:t.value-r,navigationEntry:u})}}return Object.assign(t,{attribution:e})})(e))},e)};let Yf=-1;const tv=()=>Yf,ev=t=>{addEventListener("pageshow",e=>{e.persisted&&(Yf=e.timeStamp,t(e))},!0)},nv=(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)))}},iv=t=>{requestAnimationFrame(()=>requestAnimationFrame(()=>t()))},rv=()=>{const t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},ov=()=>{var t,e;return null!==(t=null===(e=rv())||void 0===e?void 0:e.activationStart)&&void 0!==t?t:0};let sv=-1;const av=new Set,lv=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,uv=t=>{if("hidden"===document.visibilityState){if("visibilitychange"===t.type)for(const t of av)t();isFinite(sv)||(sv="visibilitychange"===t.type?t.timeStamp:0,removeEventListener("prerenderingchange",uv,!0))}},cv=(t=!1)=>{if(t&&(sv=1/0),0>sv){var e;const t=ov(),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;sv=null!=n?n:lv(),addEventListener("visibilitychange",uv,!0),addEventListener("prerenderingchange",uv,!0),ev(()=>{setTimeout(()=>{sv=lv()})})}return{get firstHiddenTime(){return sv},onHidden(t){av.add(t)}}},dv=(t,e=-1,n,i=0,r,o,s)=>{const a=rv(),l=(null==a?void 0:a.navigationId)||0;let u="navigate";return n?u=n:0>tv()?a&&(document.prerendering||ov()>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}},hv=new WeakMap;function fv(t,e){let n=hv.get(e);return n||(n=new WeakMap,hv.set(e,n)),n.get(t)||n.set(t,new e),n.get(t)}var vv=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 pv=(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(D({type:e,buffered:!0},n));return t}}catch(t){}},mv=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},gv=(t,e)=>{if(t.set(e.navigationId,e),t.size>2){const e=t.keys().next().value;void 0!==e&&t.delete(e)}},yv=t=>{let e=!1;return()=>{e||(t(),e=!0)}};var bv=class{constructor(){this.l=void 0}};const wv=t=>{document.prerendering?addEventListener("prerenderingchange",t,!0):t()},kv=[1800,3e3],_v=(t,e={})=>{const n=mv(e);wv(()=>{const i=fv(e,bv),r=cv();let o,s=dv("FCP");const a=pv(["paint"],t=>{for(const e of t)"first-contentful-paint"===e.name&&(a.disconnect(),r.firstHiddenTime>e.startTime&&(s.value=Math.max(e.startTime-ov(),0),s.entries.push(e),s.navigationId=e.navigationId||s.navigationId,o(!0)))});a&&(o=nv(t,s,kv,e.reportAllChanges),ev(n=>{s=dv("FCP",-1,"back-forward-cache",s.navigationId,s.navigationInteractionId,s.navigationURL,tv()),o=nv(t,s,kv,e.reportAllChanges),iv(()=>{s.value=performance.now()-n.timeStamp,o(!0)})})),n&&pv(["soft-navigation"],n=>{n.forEach(n=>{i.l&&n.navigationId&&gv(i.l,n);const r=Math.max((n.presentationTime||n.paintTime||0)-n.startTime,0);s=dv("FCP",r,"soft-navigation",n.navigationId,n.interactionId,n.name,n.startTime),o=nv(t,s,kv,e.reportAllChanges),o(!0)})},e)})},Sv=[.1,.25],xv=(t,e={})=>{const n=cv();_v(yv(()=>{let i,r=dv("CLS",0);const o=fv(e,vv),s=(n,s,a,l,u)=>{r=dv("CLS",0,n,s,a,l,u),o.i=0,i=nv(t,r,Sv,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"];mv(e)&&c.push("soft-navigation");const d=pv(c,u);d&&(i=nv(t,r,Sv,e.reportAllChanges),n.onHidden(()=>{u(d.takeRecords()),i(!0)}),ev(()=>{s("back-forward-cache",r.navigationId,r.navigationInteractionId,r.navigationURL,tv()),iv(i)}),setTimeout(i))}))};let Cv=0,Iv=1/0,Mv=0;const Tv=t=>{for(const e of t)e.interactionId&&(Iv=Math.min(Iv,e.interactionId),Mv=Math.max(Mv,e.interactionId),Cv=Mv?(Mv-Iv)/7+1:0)};let Rv;const Ev=()=>{var t;return Rv?Cv:null!==(t=performance.interactionCount)&&void 0!==t?t:0};var Av=class{constructor(){this.u=0,this.v=[],this.m=new Map,this.p=void 0,this.T=void 0}_(){return Ev()-this.u}M(){this.u=Ev(),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 $v=t=>{const e="requestIdleCallback"in globalThis?1e3:0,n=globalThis.requestIdleCallback||setTimeout,i=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)t();else{const r=yv(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})}},Ov=[200,500],Pv=(t,e={})=>{if(!globalThis.PerformanceEventTiming||!("interactionId"in PerformanceEventTiming.prototype))return;const n=cv();wv(()=>{var i;"interactionCount"in performance||Rv||(Rv=pv(["event"],Tv,{durationThreshold:0}));let r,o=dv("INP");const s=fv(e,Av),a=(n,i,a,l,u)=>{s.M(),o=dv("INP",-1,n,i,a,l,u),r=nv(t,o,Ov,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)=>{$v(()=>{for(const e of t)"soft-navigation"!==e.entryType?s.h(e):u(e);l(),e&&r(!0)})},d=["event","first-input"];mv(e)&&d.push("soft-navigation");const h=pv(d,c,D(D({},e),{},{durationThreshold:null!==(i=e.durationThreshold)&&void 0!==i?i:40}));r=nv(t,o,Ov,e.reportAllChanges),h&&(n.onHidden(()=>{c(h.takeRecords(),!0)}),ev(()=>{a("back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,tv())}))})};var Lv=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 Dv=[2500,4e3],Fv=(t,e={})=>{let n=!1;const i=mv(e);wv(()=>{let r,o=cv(),s=dv("LCP");const a=fv(e,Lv),l=(i,a,l,u,c)=>{s=dv("LCP",-1,i,a,l,u,c),r=nv(t,s,Dv,e.reportAllChanges),n=!1,"soft-navigation"===i&&(o=cv(!0))},u=t=>{var e;a.l&&t.navigationId&&gv(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-ov(),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=pv(d,c);if(h){r=nv(t,s,Dv,e.reportAllChanges);const o=["keydown","click","visibilitychange"],a=t=>{if(t.isTrusted&&!n){const t=s.id;$v(()=>{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});ev(i=>{l("back-forward-cache",s.navigationId,s.navigationInteractionId,s.navigationURL,tv()),r=nv(t,s,Dv,e.reportAllChanges),iv(()=>{s.value=performance.now()-i.timeStamp,n=!0,r(!0)})})}})},Nv={onLCP:Xf,onCLS:Ff,onFCP:Nf,onINP:Qf,withoutAttribution:{onLCP:Fv,onCLS:xv,onFCP:_v,onINP:Pv}};a.__PosthogExtensions__=a.__PosthogExtensions__||{},a.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=a.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},a.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-with-attribution-soft-navs"]=Nv,a.__PosthogExtensions__.postHogWebVitalsCallbacks=Nv,a.postHogWebVitalsCallbacks=Nv;const qv={onLCP:Fv,onCLS:xv,onFCP:_v,onINP:Pv};a.__PosthogExtensions__=a.__PosthogExtensions__||{},a.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=a.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},a.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-soft-navs"]=qv,a.__PosthogExtensions__.postHogWebVitalsCallbacks=qv,a.postHogWebVitalsCallbacks=qv,a.__PosthogExtensions__.loadWebVitalsCallbacks=()=>qv;const jv={onLCP:Xf,onCLS:Ff,onFCP:Nf,onINP:Qf,withoutAttribution:{onLCP:Fv,onCLS:xv,onFCP:_v,onINP:Pv}};a.__PosthogExtensions__=a.__PosthogExtensions__||{},a.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=a.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},a.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-with-attribution"]=jv,a.__PosthogExtensions__.postHogWebVitalsCallbacks=jv,a.postHogWebVitalsCallbacks=jv;const Bv={onLCP:Fv,onCLS:xv,onFCP:_v,onINP:Pv};function zv(t,e){return e.length>t?e.slice(0,t)+"...":e}function Hv(t){if(t.previousElementSibling)return t.previousElementSibling;let e=t;do{e=e.previousSibling}while(e&&!we(e));return e}function Uv(e,{e:n,maskAllElementAttributes:i,maskAllText:r,elementAttributeIgnoreList:o,elementsChainAsString:s,disableCaptureUrlHashes:a}){var l,u;if(!we(e))return{props:{}};const c=[e],d=new Set([e]);let h=e;for(;h.parentNode&&!ke(h,"body")&&1e3>c.length;){if(_e(h.parentNode)){const t=h.parentNode.host;if(d.has(t))break;d.add(t),c.push(t),h=t;continue}if(!we(h.parentNode))break;if(d.has(h.parentNode))break;d.add(h.parentNode),c.push(h.parentNode),h=h.parentNode}const f="click"===n.type&&"http://www.w3.org/2000/svg"===e.namespaceURI?c.findIndex(t=>ke(t,"button")||ke(t,"a")):-1;f>0&&(r=r||c.slice(0,f+1).some(t=>!Le(t)||De(t)));const v=[],p={};let m,g=!1,y=!1;if(fe(c,t=>{const e=Le(t);if(ke(t,"a")&&!i&&!(null==o?void 0:o.includes("href"))){const n=t.getAttribute("href");g=!!(e&&n&&Ue(n))&&(a?xt(n):n)}q(xe(t),"ph-no-capture")&&(y=!0),v.push(function(t,e,n,i,r=!1){const o=t.tagName.toLowerCase(),s={tag_name:o};Me.indexOf(o)>-1&&!n&&(s.$el_text="a"===o.toLowerCase()||"button"===o.toLowerCase()?zv(1024,We(t)):zv(1024,Ce(t)));const a=xe(t);e||(null==i?void 0:i.includes("class"))||0>=a.length||(s.classes=a.filter(function(t){return""!==t})),fe(t.attributes,function(n){var o;if((!De(t)||-1!==["name","id","class","aria-label"].indexOf(n.name))&&!(null==i?void 0:i.includes(n.name))&&!e&&Ue(n.value)&&(!Q(o=n.name)||"_ngcontent"!==o.substring(0,10)&&"_nghost"!==o.substring(0,7))){let t=n.value;"class"===n.name&&(t=Se(t).join(" ")),s["attr__"+n.name]=zv(1024,"href"===n.name&&r?xt(t):t)}});let l=1,u=1,c=t;for(;c=Hv(c);)l++,c.tagName===t.tagName&&u++;return s.nth_child=l,s.nth_of_type=u,s}(t,i,r,o,a)),fe(function(t){if(!Le(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&&Ue(i)&&(e[n]=i)}}),e}(t),(t,e)=>{({}).hasOwnProperty.call(p,e)||(p[e]=t)})}),y)return{props:{},explicitNoCapture:y};if(f>0&&(e=c[f],v.splice(0,f)),r||(v[0].$el_text=ke(e,"a")||ke(e,"button")?We(e):Ce(e)),g){var b,w;v[0].attr__href=g;const e=null===(b=ye(g))||void 0===b?void 0:b.host,n=null==t||null===(w=t.location)||void 0===w?void 0:w.host;e&&n&&e!==n&&(m=g)}return{props:ve((_=n.type,{$event_type:_,$ce_version:1}),s?{}:{$elements:v},{$elements_chain:(k=v,U(k)?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=D(D(D(D({},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[Ge(t.toString())]=Ge(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:Qe(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})}(k)):"")},(null===(l=v[0])||void 0===l?void 0:l.$el_text)?{$el_text:null===(u=v[0])||void 0===u?void 0:u.$el_text}:{},m&&"click"===n.type?{$external_click_url:m}:{},p),target:e};var k,_}a.__PosthogExtensions__=a.__PosthogExtensions__||{},a.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=a.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},a.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals"]=Bv,a.__PosthogExtensions__.postHogWebVitalsCallbacks=Bv,a.postHogWebVitalsCallbacks=Bv,a.__PosthogExtensions__.loadWebVitalsCallbacks=()=>Bv,he("[AutoCapture]");const Wv={};function Vv(t,e){const n=Ie(t);return n?D({node:n,originalEvent:t,timestamp:Date.now()},e):null}function Gv(t){return!!Ct(()=>we(t))}function Qv(t,e){return Math.abs(t)<Math.abs(e)?0>e?"up":"down":0>t?"left":"right"}function Zv(t){return"swipe"===t.type?"$dead_swipe":"$dead_click"}const Jv="canvas,video,audio,embed,object";function Kv(t,e){return X(t)&&t>=e}function Xv(t,e=1e3){return t>=0&&e>t?t:void 0}function Yv(t,e,n=1e3){return X(e)?Xv(t-e,n):void 0}var tp=class{ur(t){var e,n,i,r,o,s,a,l;const u=this.cr((null==t?void 0:t.__onCapture)||this.dr.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.hr=new WeakSet,this.vr=!1,this.pr=[],this.mr=0,this.cr=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.gr=()=>{clearTimeout(this.yr),this.yr=void 0,this.br=void 0},this.wr=t=>{if(this.kr(t),this.gr(),0===t.button){const e={path:t.composedPath(),trusted:t.isTrusted,selectionChanged:!1,selectionInitiallyRelated:!1},n=null==i?void 0:i.getSelection();e.selectionInitiallyRelated="Range"===(null==n?void 0:n.type)&&this._r(n,e),this.br=e}},this.Sr=t=>{J(t.relatedTarget)&&this.gr()},this.Cr=t=>{const e=this.br,n=t;if(!e||0!==n.button||t.isTrusted!==e.trusted)return;const i=t.composedPath();for(const t of e.path)if(Gv(t)&&-1!==i.indexOf(t)){e.clickTarget=t;break}e.clickDetail=n.detail,this.yr=a.setTimeout(this.gr,0)},this.Ir=t=>{this.kr(t);const e=t,n=Vv(e,{type:"click"}),i=this.br;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.Mr.selection_change_threshold_ms>0,this.gr()),J(n)||this.Tr(n)||this.Rr(n),this.Er()},this.Ar=()=>{const t=Date.now();this.$r=t,t%50==0&&this.pr.forEach(e=>{G(e.scrollDelayMs)&&(e.scrollDelayMs=t-e.timestamp)})},this.Or=t=>{var e,n;const r=null==i?void 0:i.getSelection(),o=this.vr;this.vr="Range"===(null==r?void 0:r.type);const s=null==r?void 0:r.focusNode,a=s&&(we(s)?s:s.parentElement),l=null==i?void 0:i.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!==(n=u)&&void 0!==n?n:null),d="Caret"===(null==r?void 0:r.type)&&u&&!u.shadowRoot&&s&&s!==l&&s.contains(null!=l?l:null);if(!(o||this.vr||c||d))return;const h=Date.now();this.Pr=h;const f=this.br;if(f&&(o||this.vr||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.Lr(n,f):r&&(s||r.anchorNode)?this._r(r,f):o&&!this.vr&&f.selectionInitiallyRelated;f.selectionChanged=f.selectionChanged||i}this.pr.forEach(t=>{const e=h-t.timestamp;0>e||!G(t.selectionChangedDelayMs)&&e>=t.selectionChangedDelayMs||(t.selectionChangedDelayMs=e)})},this.sn=()=>{"hidden"===(null==i?void 0:i.visibilityState)&&this.gr();const t=Date.now();this.Dr=t,this.Fr("visibilityChangedDelayMs",t)},this.Nr=()=>{const t=Date.now();this.qr=t,this.Fr("focusChangedDelayMs",t)},this.jr=t=>{this.kr(t);const e=t.touches,n=1===(null==e?void 0:e.length)?e[0]:void 0;this.Br=n?{x:n.clientX,y:n.clientY,timestamp:Date.now()}:void 0},this.zr=()=>{this.Br=void 0},this.Hr=t=>{var e;const n=this.Br;if(this.Br=void 0,G(n)||this.mr>=this.Mr.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-n.x,a=o.clientY-n.y,l=s*s+a*a,u=this.Mr.swipe_threshold_px;if(u*u>l)return;if([this.$r,this.Ur,this.Pr].some(t=>X(t)&&t>=n.timestamp))return;var c,d;if(this.Wr()&&(null!==(c=null==i||null===(d=i.elementsFromPoint)||void 0===d?void 0:d.call(i,n.x,n.y))&&void 0!==c?c:[]).some(t=>{var e;return null===(e=t.matches)||void 0===e?void 0:e.call(t,Jv)}))return;const h=Vv(r,{type:"swipe",swipeDirection:Qv(s,a),swipeDistancePx:Math.round(Math.sqrt(l))});J(h)||this.Tr(h)||this.Rr(h),this.Er()},this.Mr=this.ur(e),this._onCapture=this.Mr.__onCapture}start(t){this.Vr(),this.Gr(),this.Qr(),this.Zr(),this.Jr(),this.Kr(t),this.Mr.capture_dead_swipes&&this.Xr()}Kr(e){if(!this.Yr){const n=function(e){return function(e,n){const i=Wv[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 Wv[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 l=t.contentWindow;var s,a;l&&l[e]&&(r=l[e],"MutationObserver"===e&&function(t){return q(t,"AppleWebKit")&&!q(t,"Chrome")}(null!==(s=null===(a=n.navigator)||void 0===a?void 0:a.userAgent)&&void 0!==s?s:"")&&(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)}}return r&&W(r)?Wv[e]=r.bind(n):r}("MutationObserver",e)}(a);this.Yr=new n(t=>{this.eo(t)}),this.no(e)}}no(t){t&&this.Yr&&(this.hr.has(t)||(this.Yr.observe(t,{attributes:!0,characterData:!0,childList:!0,subtree:!0}),this.hr.add(t),this.io(t)))}io(t,e){var n,i;we(t)&&t.shadowRoot&&this.no(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.no(r[t].shadowRoot)}kr(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];Gv(e)&&this.no(e.shadowRoot)}}stop(){var t;null===(t=this.Yr)||void 0===t||t.disconnect(),this.Yr=void 0,this.hr=new WeakSet,a.removeEventListener("click",this.Ir,{capture:!0}),a.removeEventListener("mousedown",this.wr,{capture:!0}),a.removeEventListener("mouseup",this.Cr,{capture:!0}),a.removeEventListener("mouseout",this.Sr,{capture:!0}),a.removeEventListener("dragstart",this.gr,{capture:!0}),a.removeEventListener("pointercancel",this.gr,{capture:!0}),a.removeEventListener("blur",this.gr),this.gr(),a.removeEventListener("scroll",this.Ar,{capture:!0}),null==i||i.removeEventListener("selectionchange",this.Or),a.removeEventListener("touchstart",this.jr,{capture:!0}),a.removeEventListener("touchend",this.Hr,{capture:!0}),a.removeEventListener("touchcancel",this.zr,{capture:!0}),null==i||i.removeEventListener("visibilitychange",this.sn),a.removeEventListener("blur",this.Nr),a.removeEventListener("focus",this.Nr),this.Br=void 0}eo(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.Ur=Date.now();const t=i.addedNodes;for(let n=0;t.length>n;n++){const i=t[n];Gv(i)&&!e.has(i)&&this.io(i,e)}}catch(t){}}Vr(){me(a,"click",this.Ir,{capture:!0}),me(a,"mousedown",this.wr,{capture:!0}),me(a,"mouseup",this.Cr,{capture:!0}),me(a,"mouseout",this.Sr,{capture:!0}),me(a,"dragstart",this.gr,{capture:!0}),me(a,"pointercancel",this.gr,{capture:!0}),me(a,"blur",this.gr)}Rr(t){t.selectionChangedDelayMs=Yv(t.timestamp,this.Pr,this.Mr.selection_change_threshold_ms),t.visibilityChangedDelayMs=Yv(t.timestamp,this.Dr),t.focusChangedDelayMs=Yv(t.timestamp,this.qr),this.pr.push(t)}Er(){this.pr.length&&G(this.ro)&&(this.ro=a.setTimeout(()=>{this.oo()},1e3))}Gr(){me(a,"scroll",this.Ar,{capture:!0})}Qr(){var t;this.vr="Range"===(null==i||null===(t=i.getSelection())||void 0===t?void 0:t.type),me(i,"selectionchange",this.Or)}Lr(t,e){const n=e.path[0];try{for(;t;){if(-1!==e.path.indexOf(t)||we(n)&&n.contains(t))return!0;t=t.getRootNode().host}}catch(t){}return!1}_r(t,e){const n=e.path[0],i=t.rangeCount>0?t.getRangeAt(0):void 0,r=!!i&&Ct(()=>i.startContainer.getRootNode()===n.getRootNode());if(i&&r&&we(n)){var o;if(!i.collapsed)return i.intersectsNode(n);const t=we(i.startContainer)&&null!==(o=i.startContainer.childNodes[i.startOffset])&&void 0!==o?o:i.startContainer;return this.Lr(t,e)}return this.Lr(t.focusNode,e)||this.Lr(t.anchorNode,e)}Zr(){me(i,"visibilitychange",this.sn)}Jr(){me(a,"blur",this.Nr),me(a,"focus",this.Nr)}Fr(t,e){this.pr.forEach(n=>{const i=Xv(e-n.timestamp);X(i)&&(G(n[t])||n[t]>i)&&(n[t]=i)})}Xr(){me(a,"touchstart",this.jr,{capture:!0,passive:!0}),me(a,"touchend",this.Hr,{capture:!0,passive:!0}),me(a,"touchcancel",this.zr,{capture:!0,passive:!0})}Wr(){const t=G(this.so)||X(this.Ur)&&this.Ur>this.so;return(G(this.ao)||t)&&(this.so=Date.now(),this.ao=!!(null==i?void 0:i.querySelector(Jv))),!!this.ao}Tr(t){return!t||("swipe"===t.type?this.lo(t):this.uo(t))}lo(e){return!((!((n=e.node)instanceof Element)||"__POSTHOG_TOOLBAR__"!==n.id&&!(null===(i=n.closest)||void 0===i?void 0:i.call(n,".toolbar-global-fade-container")))&&!this.pr.some(t=>t.type===e.type&&t.node===e.node&&1e3>Math.abs(t.timestamp-e.timestamp))&&!ke(e.node,"html")&&we(e.node)&&function(e,n){var i;if(!t||Oe(e))return!1;const r=Y(n)?Ee:null!==(i=null==n?void 0:n.css_selector_ignorelist)&&void 0!==i?i:Ee,{targetElementList:o}=Pe(e,!1);return!function(t,e){if(G(e))return!0;for(const n of t)if(e.some(t=>Te(n,t)))return!0;return!1}(o,r)}(e.node,{css_selector_ignorelist:this.Mr.css_selector_ignorelist}));var n,i}uo(e){return!(this.Mr.capture_clicks_with_modifier_keys||(n=e.originalEvent,!(n.ctrlKey||n.metaKey||n.altKey||n.shiftKey)))||!!this.lo(e)||function(e){if(!t||Oe(e))return!1;const{targetElementList:n}=Pe(e,!1);return n.some(t=>ke(t,"a"))}(e.node);var n}oo(){if(!this.pr.length)return;clearTimeout(this.ro),this.ro=void 0;const t=this.pr;this.pr=[];for(const n of t){var e;n.mutationDelayMs=null!==(e=n.mutationDelayMs)&&void 0!==e?e:this.Ur&&this.Ur>=n.timestamp?this.Ur-n.timestamp:void 0,n.absoluteDelayMs=Date.now()-n.timestamp;const t=Kv(n.scrollDelayMs,this.Mr.scroll_threshold_ms),i=Kv(n.selectionChangedDelayMs,this.Mr.selection_change_threshold_ms),r=Kv(n.mutationDelayMs,this.Mr.mutation_threshold_ms),o=Kv(n.absoluteDelayMs,1.1*this.Mr.mutation_threshold_ms),s=X(n.scrollDelayMs)&&this.Mr.scroll_threshold_ms>n.scrollDelayMs,a=X(n.mutationDelayMs)&&this.Mr.mutation_threshold_ms>n.mutationDelayMs,l=n.selectionChangedDuringGesture||X(n.selectionChangedDelayMs)&&this.Mr.selection_change_threshold_ms>n.selectionChangedDelayMs,u=X(n.visibilityChangedDelayMs),c=X(n.focusChangedDelayMs);if(!(s||a||l||u||c))if(t||r||o||i){const e=Zv(n);if("$dead_swipe"===e){if(this.mr>=this.Mr.max_dead_swipes_per_page_load)continue;this.mr++}this._onCapture(n,{[`${e}_last_mutation_timestamp`]:this.Ur,[`${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.Mr.mutation_threshold_ms>n.absoluteDelayMs&&this.pr.push(n)}this.Er()}dr(t,e){const n=Zv(t);this.instance.capture(n,D(D(D({},e),Uv(t.node,{e:t.originalEvent,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.Mr.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)})}};a.__PosthogExtensions__=a.__PosthogExtensions__||{},a.__PosthogExtensions__.initDeadClicksAutocapture=(t,e)=>new tp(t,e)}();
|
|
2
2
|
//# sourceMappingURL=all-external-dependencies.js.map
|