posthog-js 1.422.3 → 1.422.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/dist/all-external-dependencies.js +1 -1
  2. package/dist/all-external-dependencies.js.map +1 -1
  3. package/dist/array.full.es5.js +1 -1
  4. package/dist/array.full.es5.js.map +1 -1
  5. package/dist/array.full.js +1 -1
  6. package/dist/array.full.js.map +1 -1
  7. package/dist/array.full.no-external.js +1 -1
  8. package/dist/array.full.no-external.js.map +1 -1
  9. package/dist/array.js +1 -1
  10. package/dist/array.no-external.js +1 -1
  11. package/dist/conversations.js +1 -1
  12. package/dist/customizations.d.ts +11 -0
  13. package/dist/customizations.full.js +1 -1
  14. package/dist/customizations.js +1 -1
  15. package/dist/dead-clicks-autocapture.js +1 -1
  16. package/dist/default-extensions.js +1 -1
  17. package/dist/exception-autocapture.js +1 -1
  18. package/dist/extension-bundles.js +1 -1
  19. package/dist/lazy-recorder.js +1 -1
  20. package/dist/main.d.ts +11 -0
  21. package/dist/main.js +1 -1
  22. package/dist/module.d.ts +11 -0
  23. package/dist/module.full.d.ts +11 -0
  24. package/dist/module.full.js +1 -1
  25. package/dist/module.full.js.map +1 -1
  26. package/dist/module.full.no-external.d.ts +11 -0
  27. package/dist/module.full.no-external.js +1 -1
  28. package/dist/module.full.no-external.js.map +1 -1
  29. package/dist/module.js +1 -1
  30. package/dist/module.no-external.d.ts +11 -0
  31. package/dist/module.no-external.js +1 -1
  32. package/dist/module.slim.js +1 -1
  33. package/dist/module.slim.no-external.d.ts +11 -0
  34. package/dist/module.slim.no-external.js +1 -1
  35. package/dist/posthog-recorder.js +1 -1
  36. package/dist/product-tours-preview.js.map +1 -1
  37. package/dist/product-tours.js +1 -1
  38. package/dist/product-tours.js.map +1 -1
  39. package/dist/src/extensions/surveys/surveys-extension-utils.d.ts +4 -1
  40. package/dist/src/extensions/surveys.d.ts +11 -0
  41. package/dist/surveys-preview.js +1 -1
  42. package/dist/surveys-preview.js.map +1 -1
  43. package/dist/surveys.d.ts +11 -0
  44. package/dist/surveys.js +1 -1
  45. package/dist/surveys.js.map +1 -1
  46. package/lib/package.json +1 -1
  47. package/lib/src/extensions/surveys/surveys-extension-utils.d.ts +4 -1
  48. package/lib/src/extensions/surveys/surveys-extension-utils.js +10 -4
  49. package/lib/src/extensions/surveys/surveys-extension-utils.js.map +1 -1
  50. package/lib/src/extensions/surveys.d.ts +11 -0
  51. package/lib/src/extensions/surveys.js +120 -6
  52. package/lib/src/extensions/surveys.js.map +1 -1
  53. package/package.json +5 -5
@@ -1,2 +1,2 @@
1
- !function(){"use strict";var e="undefined"!=typeof window?window:void 0,t="undefined"!=typeof globalThis?globalThis:e,r=null==t?void 0:t.navigator,i=null==t?void 0:t.document,n=null==t?void 0:t.location;null!=t&&t.XMLHttpRequest&&new t.XMLHttpRequest;var a=null==r?void 0:r.userAgent,o="undefined"!=typeof globalThis?globalThis:e;o&&"undefined"==typeof self&&(o.self=o),o&&"undefined"==typeof File&&(o.File=function(){});var s=null!=e?e:{};function u(e,t,r,i,n,a,o){try{var s=e[a](o),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(i,n)}function l(e){return function(){var t=this,r=arguments;return new Promise((function(i,n){var a=e.apply(t,r);function o(e){u(a,i,n,o,s,"next",e)}function s(e){u(a,i,n,o,s,"throw",e)}o(void 0)}))}}function h(){return h=Object.assign?Object.assign.bind():function(e){for(var t=1;arguments.length>t;t++){var r=arguments[t];for(var i in r)({}).hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},h.apply(null,arguments)}var c={DomContentLoaded:0,Load:1,FullSnapshot:2,IncrementalSnapshot:3,Meta:4,Custom:5,Plugin:6},d={Mutation:0,MouseMove:1,MouseInteraction:2,Scroll:3,ViewportResize:4,Input:5,TouchMove:6,MediaInteraction:7,StyleSheetRule:8,CanvasMutation:9,Font:10,Log:11,Drag:12,StyleDeclaration:13,Selection:14,AdoptedStyleSheet:15,CustomElement:16},v="min_length",f="max_length";function p(e,t){return-1!==e.indexOf(t)}var g=function(e){return e.trim()},m=Object.prototype,y=m.hasOwnProperty,b=m.toString,w=Array.isArray||function(e){return"[object Array]"===b.call(e)},k=e=>"function"==typeof e,_=e=>e===Object(e)&&!w(e),S=e=>void 0===e,x=e=>"[object String]"==b.call(e),C=e=>x(e)&&0===e.trim().length,M=e=>null===e,T=e=>S(e)||M(e),I=e=>"[object Number]"==b.call(e)&&e==e,E=e=>"[object Boolean]"===b.call(e),R=e=>e instanceof FormData;function A(e){return null===e||"object"!=typeof e}function L(e,t){return{}.toString.call(e)==="[object "+t+"]"}function O(e){switch({}.toString.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object DOMError]":case"[object WebAssembly.Exception]":return!0;default:return D(e,Error)}}function P(e){return"undefined"!=typeof Event&&D(e,Event)}function D(e,t){try{return e instanceof t}catch(e){return!1}}function F(e,t,r,i,n){return t>r&&(i.warn("min cannot be greater than max."),t=r),I(e)?e>r?(i.warn(" cannot be greater than max: "+r+". Using max value instead."),r):t>e?(i.warn(" cannot be less than min: "+t+". Using min value instead."),t):e:(i.warn(" must be a number. using max or fallback. max: "+r+", fallback: "+n),F(n||r,t,r,i))}class N{constructor(e){this.k={},this.S=e.S,this.C=F(e.bucketSize,0,100,e.I),this.R=F(e.refillRate,0,this.C,e.I),this.A=F(e.refillInterval,0,864e5,e.I)}O(e,t){var r=Math.floor((t-e.lastAccess)/this.A);r>0&&(e.tokens=Math.min(e.tokens+r*this.R,this.C),e.lastAccess=e.lastAccess+r*this.A)}consumeRateLimit(e){var t,r=Date.now(),i=String(e),n=this.k[i];return n?this.O(n,r):this.k[i]=n={tokens:this.C,lastAccess:r},0===n.tokens||(n.tokens--,0===n.tokens&&(null==(t=this.S)||t.call(this,e)),0===n.tokens)}stop(){this.k={}}}var q="Mobile",j="Android",B="Tablet",H=j+" "+B,U="iPad",W="Apple Watch",z="BlackBerry",V="Nintendo",Z="PlayStation",G="Xbox",Q="Windows Phone",J="Nokia",Y="Ouya",K="Generic",X=K+" "+q.toLowerCase(),ee=K+" "+B.toLowerCase(),te=new RegExp(G,"i"),re=new RegExp(Z+" \\w+","i"),ie=new RegExp(V+" \\w+","i"),ne=new RegExp(z+"|PlayBook|BB10","i");function ae(e){return e?e.split("#")[0]:e}var oe,se,ue,le,he="NativeGzipValidationError",ce=e=>{throw function(e,t){var r=new Error(t);try{Object.defineProperty(r,"name",{value:e,writable:!0,enumerable:!0,configurable:!0})}catch(e){}return r}(he,"Native gzip produced invalid output: "+e)},de=function(){var e=l((function*(e,t){18>e.size&&ce("too-short");var r,i=new Uint8Array(yield e.slice(0,10).arrayBuffer());(2>(r=i).length||31!==r[0]||139!==r[1]||8!==i[2])&&ce("invalid-header");var n=new DataView(yield e.slice(e.size-8).arrayBuffer());n.getUint32(0,!0)!==(e=>{for(var t=(()=>{if(oe)return oe;oe=[];for(var e=0;256>e;e++){for(var t=e,r=0;8>r;r++)t=1&t?3988292384^t>>>1:t>>>1;oe[e]=t>>>0}return oe})(),r=4294967295,i=0;e.length>i;i++)r=t[255&(r^e[i])]^r>>>8;return(4294967295^r)>>>0})(t)&&ce("invalid-crc");var a=t.length>>>0;n.getUint32(4,!0)!==a&&ce("invalid-size")}));return function(t,r){return e.apply(this,arguments)}}();function ve(){return ve=l((function*(e,t,r){void 0===t&&(t=!0);try{var i=(new TextEncoder).encode(e),n=new globalThis.CompressionStream("gzip"),a=n.writable.getWriter(),o=a.write(i).then((()=>a.close())).catch(function(){var e=l((function*(e){try{yield a.abort(e)}catch(e){}throw e}));return function(t){return e.apply(this,arguments)}}()),s=new Response(n.readable).blob(),u=(yield Promise.all([s,o]))[0];return yield de(u,i),u}catch(e){if(null!=r&&r.rethrow)throw e;return t&&console.error("Failed to gzip compress data",e),null}})),ve.apply(this,arguments)}function fe(e,t){if(e){var r=e.find((e=>e.type===t));return null==r?void 0:r.value}}function pe(e){var t=globalThis._posthogChunkIds;if(t){var r=Object.keys(t);return le&&r.length===ue||(ue=r.length,le=r.reduce(((r,i)=>{se||(se={});var n=se[i];if(n)r[n[0]]=n[1];else for(var a=e(i),o=a.length-1;o>=0;o--){var s=a[o],u=null==s?void 0:s.filename,l=t[i];if(u&&l){r[u]=l,se[i]=[u,l];break}}return r}),{})),le}}var ge="?";function me(e,t,r,i,n){var a={platform:e,filename:t,function:"<anonymous>"===r?ge:r,in_app:!(null!=t&&t.startsWith("webkit-masked-url://"))&&"<anonymous>"!==t};return S(i)||(a.lineno=i),S(n)||(a.colno=n),a}var ye=(e,t)=>{var r=-1!==e.indexOf("safari-extension"),i=-1!==e.indexOf("safari-web-extension");return r||i?[-1!==e.indexOf("@")?e.split("@")[0]:ge,r?"safari-extension:"+t:"safari-web-extension:"+t]:[e,t]},be=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,we=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,ke=/\((\S*)(?::(\d+))(?::(\d+))\)/,_e=(e,t)=>{var r=be.exec(e);if(r)return me(t,r[1],ge,+r[2],+r[3]);var i=we.exec(e);if(i){if(i[2]&&0===i[2].indexOf("eval")){var n=ke.exec(i[2]);n&&(i[2]=n[1],i[3]=n[2],i[4]=n[3])}var a=ye(i[1]||ge,i[2]);return me(t,a[1],a[0],i[3]?+i[3]:void 0,i[4]?+i[4]:void 0)}},Se=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,xe=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Ce=(e,t)=>{var r=Se.exec(e);if(r){if(r[3]&&r[3].indexOf(" > eval")>-1){var i=xe.exec(r[3]);i&&(r[1]=r[1]||"eval",r[3]=i[1],r[4]=i[2],r[5]="")}var n=r[3],a=r[1]||ge,o=ye(a,n);return me(t,n=o[1],a=o[0],r[4]?+r[4]:void 0,r[5]?+r[5]:void 0)}},Me=/\(error: (.*)\)/;var Te=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;var Ie=["fatal","error","warning","log","info","debug"];function Ee(e,t){void 0===t&&(t=40);var r=Object.keys(e);if(r.sort(),!r.length)return"[object has no keys]";for(var i=r.length;i>0;i--){var n=r.slice(0,i).join(", ");if(t>=n.length)return i===r.length?n:n.length>t?n.slice(0,t)+"...":n}return""}var Re={DEBUG:!1,LIB_VERSION:"0.6.2",LIB_NAME:"browser-common"},Ae=function(t,r){var i=(void 0===r?{}:r).debugEnabled,n={P(r){if(e&&(Re.DEBUG||e.POSTHOG_DEBUG||i)&&!S(e.console)&&e.console){for(var n=("__rrweb_original__"in e.console[r]?e.console[r].__rrweb_original__:e.console[r]),a=arguments.length,o=new Array(a>1?a-1:0),s=1;a>s;s++)o[s-1]=arguments[s];n(t,...o)}},debug(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];n.P("debug",...t)},info(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];n.P("log",...t)},warn(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];n.P("warn",...t)},error(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];n.P("error",...t)},critical(){for(var e=arguments.length,r=new Array(e),i=0;e>i;i++)r[i]=arguments[i];console.error(t,...r)},uninitializedWarning(e){n.error("You must initialize PostHog before calling "+e)},createLogger:(e,r)=>Ae(t+" "+e,r)};return n},Le=Ae("[PostHog.js]"),Oe=Le.createLogger;function Pe(e,t){if(!T(e))if(w(e))e.forEach(t);else if(R(e))e.forEach(((e,r)=>t(e,r)));else for(var r in e)y.call(e,r)&&t(e[r],r)}var De=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;t>i;i++)r[i-1]=arguments[i];for(var n of r)for(var a in n)void 0!==n[a]&&(e[a]=n[a]);return e};function Fe(e){for(var t=Object.keys(e),r=t.length,i=new Array(r);r--;)i[r]=[t[r],e[t[r]]];return i}function Ne(e,t,r,i){var n=null!=i?i:{},a=n.capture,o=n.passive;null==e||e.addEventListener(t,r,{capture:void 0!==a&&a,passive:void 0===o||o})}var qe=["localhost","127.0.0.1"],je=e=>{var t=null==i?void 0:i.createElement("a");return S(t)?null:(t.href=e,t)},Be=function(e,t){var r,i;void 0===t&&(t="&");var n=[];return Pe(e,(function(e,t){S(e)||S(t)||"undefined"===t||(r=encodeURIComponent((e=>e instanceof File)(e)?e.name:e.toString()),i=encodeURIComponent(t),n[n.length]=i+"="+r)})),n.join(t)};function He(t){var r,i=null==e||null==(r=e.location)?void 0:r.href;return S(i)?void 0:function(e,t){var r,i=null==e||null==(r=e.config)?void 0:r.get_current_url;if(!k(i))return t;try{var n=i(t);return x(n)&&n?n:t}catch(e){return Le.error("Error in get_current_url, falling back to window.location.href",e),t}}(t,i)}var $e=1,Ue=3,We=11;function ze(e){return!!e&&e.nodeType===$e}function Ve(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function Ze(e){return!!e&&e.nodeType===We&&ze(e.host)}var Ge=1e3;function Qe(e){return e?g(e).split(/\s+/):[]}function Je(e){var t="";switch(typeof e.className){case"string":t=e.className;break;case"object":t=(e.className&&"baseVal"in e.className?e.className.baseVal:null)||e.getAttribute("class")||"";break;default:t=""}return Qe(t)}function Ye(e){var t="";return it(e)&&!nt(e)&&e.childNodes&&e.childNodes.length&&Pe(e.childNodes,(function(e){var r;(function(e){return!!e&&e.nodeType===Ue})(e)&&e.textContent&&(t+=null!==(r=function(e){return T(e)?null:g(e).split(/(\s+)/).filter((e=>dt(e))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}(e.textContent))&&void 0!==r?r:"")})),g(t)}var Ke=["a","button","form","input","select","textarea","label"];function Xe(e){var t=e.parentNode;return!(!t||!ze(t))&&t}var et=[".ph-no-deadclick",".ph-no-capture"];var tt=e=>!e||Ve(e,"html")||!ze(e),rt=(t,r)=>{if(!e||tt(t))return{parentIsUsefulElement:!1,targetElementList:[]};for(var i=!1,n=[t],a=t;a.parentNode&&!Ve(a,"body");)if(Ze(a.parentNode))n.push(a.parentNode.host),a=a.parentNode.host;else{var o=Xe(a);if(!o)break;if(Ke.indexOf(o.tagName.toLowerCase())>-1)i=!0;else try{var s=e.getComputedStyle(o);s&&"pointer"===s.getPropertyValue("cursor")&&(i=!0)}catch(e){}n.push(o),a=o}return{parentIsUsefulElement:i,targetElementList:n}};function it(e){for(var t=new Set,r=0,i=e;i.parentNode&&!Ve(i,"body");i=i.parentNode){if(r++>=Ge||t.has(i))return!1;t.add(i);var n=Je(i);if(p(n,"ph-sensitive")||p(n,"ph-no-capture"))return!1}if(p(Je(e),"ph-include"))return!0;var a=e.type||"";if(x(a))switch(a.toLowerCase()){case"hidden":case"password":return!1}var o=e.name||e.id||"";return!x(o)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(o.replace(/[^a-zA-Z0-9]/g,""))}function nt(e){return!!(Ve(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||Ve(e,"select")||Ve(e,"textarea")||"true"===e.getAttribute("contenteditable"))}var at=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}))$"),ot=/(^|[^0-9A-Za-z_])([0-9][0-9 -]*[0-9])(?=$|[^0-9A-Za-z_])/g,st=[16,15,14,13],ut=new RegExp("^(\\d{3}-?\\d{2}-?\\d{4})$"),lt=new RegExp("(^|[^0-9])((?!000|666)[0-9]{3}-?(?!00)[0-9]{2}-?(?!0000)[0-9]{4})(?=$|([^0-9]))","g"),ht=/[0-9A-Za-z_]/;function ct(e){for(var t=0,r=!1,i=e.length-1;i>=0;i--){var n=e.charCodeAt(i)-48;r&&(n*=2)>9&&(n-=9),t+=n,r=!r}return t%10==0}function dt(e,t){if(void 0===t&&(t=!0),T(e))return!1;if(x(e)){e=g(e);var r=t?at.test((e||"").replace(/[- ]/g,"")):function(e){var t;for(ot.lastIndex=0;t=ot.exec(e);){var r=t[2];if(r)for(var i=r.replace(/[- ]/g,""),n=0;i.length>n;n++)for(var a of st){var o=n+a;if(i.length>=o){var s=i.slice(n,o);if(at.test(s)&&ct(s))return!0}}}return!1}(e);if(r)return!1;var i=t?ut.test(e):function(e){var t;for(lt.lastIndex=0;t=lt.exec(e);){var r=t[1],i=t[3];if(!(r&&i&&ht.test(r)&&ht.test(i)))return!0}return!1}(e);if(i)return!1}return!0}function vt(e){var t=Ye(e);return dt(t=(t+" "+ft(e)).trim())?t:""}function ft(e){var t="";return e&&e.childNodes&&e.childNodes.length&&Pe(e.childNodes,(function(e){var r;if(e&&"span"===(null==(r=e.tagName)?void 0:r.toLowerCase()))try{var i=Ye(e);t=(t+" "+i).trim(),e.childNodes&&e.childNodes.length&&(t=(t+" "+ft(e)).trim())}catch(e){Le.error("[AutoCapture]",e)}})),t}function pt(e){return e.replace(/"|\\"/g,'\\"')}function gt(e){var t=e.attr__class;if(t)return w(t)?t:Qe(t)}var mt="[SessionRecording]",yt="redacted",bt=1e6;function wt(e){var t;return Math.min(bt,null!==(t=e.payloadSizeLimitBytes)&&void 0!==t?t:bt)}var kt={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:e=>e,recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:bt,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},_t=["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"],St=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],xt=["auth","token","secret","session","api-key","apikey","api_key","credential","password","passwd","cookie","csrf","xsrf"],Ct=e=>{T(e)||Pe(Object.keys(e),(t=>{(e=>{var t=e.toLowerCase();return _t.includes(t)||xt.some((e=>t.includes(e)))})(t)&&(e[t]=yt)}))},Mt=["/s/","/e/","/i/"];function Tt(e,t,r,i){if(T(e))return e;var n=(null==t?void 0:t["content-length"])||function(e){return new Blob([e]).size}(e);return x(n)&&(n=parseInt(n)),n>r?mt+" "+i+" body too large to record ("+n+" bytes)":e}function It(e,t){if(T(e))return e;var r=e;return dt(r,!1)||(r=mt+" "+t+" body "+yt),Pe(St,(e=>{var i,n;null!=(i=r)&&i.length&&-1!==(null==(n=r)?void 0:n.indexOf(e))&&(r=mt+" "+t+" body "+yt+" as might contain: "+e)})),r}var Et=new WeakSet,Rt="$session_recording_remote_config",At="$replay_sample_rate",Lt="$replay_override_sampling",Ot="$replay_override_linked_flag",Pt="$replay_override_url_trigger",Dt="$replay_override_event_trigger",Ft="$session_is_sampled",Nt="$session_past_minimum_duration",qt="$session_recording_url_trigger_activated_session",jt="$session_recording_event_trigger_activated_session",Bt="$posthog_sr_group_event_trigger_",Ht="$posthog_sr_group_url_trigger_",$t="$posthog_sr_group_sampling_",Ut="$debug_first_full_snapshot_timestamp",Wt="$sess_rec_flush_size",zt="$stored_person_properties",Vt="$sdk_debug_replay_pending_trigger_conditions",Zt="$sdk_debug_replay_remote_trigger_matching_config",Gt="disabled",Qt="sampled",Jt="active",Yt="buffering",Kt="paused",Xt="rrweb_error",er="trigger",tr=er+"_activated",rr=er+"_pending",ir=er+"_"+Gt;function nr(e,t,r,i,n,a){return 0===t?ir:(null==e?void 0:e.get_property(r?i+r:n))===a?tr:rr}function ar(e,t,r){return t.some((t=>{var i;return"regex"===t.matching&&(null!==(i=null==r?void 0:r.get(t.url))&&void 0!==i?i:new RegExp(t.url)).test(e)}))}function or(e){return e.includes(tr)?tr:e.includes(rr)?rr:ir}function sr(e){var t=new Set(e);switch(t.delete(ir),t.size){case 0:return ir;case 1:return Array.from(t)[0];default:return rr}}class ur{constructor(e){this.F=e}triggerStatus(e){return or(this.F.map((t=>t.triggerStatus(e))))}triggerStatusNoSideEffects(e){return or(this.F.map((t=>t.triggerStatusNoSideEffects(e))))}stop(){this.F.forEach((e=>e.stop()))}}class lr{constructor(e){this.F=e}triggerStatus(e){return sr(this.F.map((t=>t.triggerStatus(e))))}triggerStatusNoSideEffects(e){return sr(this.F.map((t=>t.triggerStatusNoSideEffects(e))))}stop(){this.F.forEach((e=>e.stop()))}}class hr{triggerStatus(){return this.triggerStatusNoSideEffects()}triggerStatusNoSideEffects(){return tr}stop(){}}var cr=e=>"sessionRecording"in e;class dr{constructor(e,t){this.N=[],this.q=[],this.j=new Map,this.B=new Map,this.H="",this.urlBlocked=!1,this._instance=e,this.$=t}onConfig(e){var t,r;this.N=(cr(e)?_(e.sessionRecording)?null==(t=e.sessionRecording)?void 0:t.urlTriggers:[]:null==e?void 0:e.urlTriggers)||[],this.q=(cr(e)?_(e.sessionRecording)?null==(r=e.sessionRecording)?void 0:r.urlBlocklist:[]:null==e?void 0:e.urlBlocklist)||[],this.U()}U(){for(var e of(this.j.clear(),this.B.clear(),this.N))if("regex"===e.matching&&!this.j.has(e.url))try{this.j.set(e.url,new RegExp(e.url))}catch(t){Le.error("Invalid URL trigger regex pattern:",e.url,t)}for(var t of this.q)if("regex"===t.matching&&!this.B.has(t.url))try{this.B.set(t.url,new RegExp(t.url))}catch(e){Le.error("Invalid URL blocklist regex pattern:",t.url,e)}}onRemoteConfig(e){this.onConfig(e)}W(e){return nr(this._instance,this.N.length,this.$,Ht,qt,e)}triggerStatus(e){var t=this.triggerStatusNoSideEffects(e);return this._instance.register_for_session({$sdk_debug_replay_url_trigger_status:t}),t}triggerStatusNoSideEffects(e){return this.W(e)}isCurrentUrlBlocked(){var e=He(this._instance);if(!e)return!1;try{return ar(e,this.q,this.B)}catch(e){return!0}}checkUrlBlocklist(e,t){var r=He(this._instance);if(r&&r!==this.H){this.H=r;var i=this.urlBlocked,n=ar(r,this.q,this.B);i&&n||(n&&!i?e():!n&&i&&t())}}checkUrlTriggerConditions(e,t,r,i){var n=He(this._instance);if(n&&n!==this.H){this.H=n;var a=this.urlBlocked,o=ar(n,this.q,this.B);o&&!a?e():!o&&a&&t();var s=this.W(i)===tr,u=ar(n,this.N,this.j);!s&&u&&r("url",n)}}stop(){this.H=""}}class vr{constructor(e){this.linkedFlag=null,this.linkedFlagSeen=!1,this.V=()=>{},this._instance=e}triggerStatus(){var e=this.triggerStatusNoSideEffects();return this._instance.register_for_session({$sdk_debug_replay_linked_flag_trigger_status:e}),e}triggerStatusNoSideEffects(){var e=rr;return T(this.linkedFlag)&&(e=ir),this.linkedFlagSeen&&(e=tr),e}onConfig(e,t){var r;if(this.linkedFlag=(cr(e)?_(e.sessionRecording)?null==(r=e.sessionRecording)?void 0:r.linkedFlag:null:null==e?void 0:e.linkedFlag)||null,!T(this.linkedFlag)&&!this.linkedFlagSeen){var i=x(this.linkedFlag)?this.linkedFlag:this.linkedFlag.flag,n=x(this.linkedFlag)?null:this.linkedFlag.variant;this.V=this._instance.onFeatureFlags(((e,r)=>{var a=!1;if(_(r)&&i in r){var o=r[i];a=E(o)?!0===o:n?o===n:!!o}var s=a&&!this.linkedFlagSeen;this.linkedFlagSeen=a,s&&t(i,n)}))}}onRemoteConfig(e,t){this.onConfig(e,t)}stop(){this.V()}}class fr{constructor(e,t){this.Z=[],this._instance=e,this.$=t}onConfig(e){var t;this.Z=(cr(e)?_(e.sessionRecording)?null==(t=e.sessionRecording)?void 0:t.eventTriggers:[]:null==e?void 0:e.eventTriggers)||[]}onRemoteConfig(e){this.onConfig(e)}G(e){return nr(this._instance,this.Z.length,this.$,Bt,jt,e)}triggerStatus(e){var t=this.triggerStatusNoSideEffects(e);return this._instance.register_for_session({$sdk_debug_replay_event_trigger_status:t}),t}triggerStatusNoSideEffects(e){return this.G(e)}checkEventTriggerConditions(e,t,r){if(0!==this.Z.length){var i=this.G(r)===tr,n=this.Z.includes(e);!i&&n&&t("event",e)}}stop(){}}class pr{constructor(e,t,r){if(this._instance=e,this.group=t,this.J=new dr(e,t.id),this.Y=new fr(e,t.id),this.K=new vr(e),t.conditions.events&&t.conditions.events.length>0||t.conditions.urls&&t.conditions.urls.length>0||t.conditions.flag){var i=(t.conditions.events||[]).map((e=>e.name)),n={urlTriggers:t.conditions.urls||[],eventTriggers:i,linkedFlag:t.conditions.flag||null,urlBlocklist:[]};this.J.onConfig(n),this.Y.onConfig(n),this.K.onConfig(n,r);var a=[this.Y,this.J,this.K];this.X="any"===t.conditions.matchType?new ur(a):new lr(a)}else this.X=new hr}triggerStatus(e){return this.X.triggerStatus(e)}triggerStatusNoSideEffects(e){return this.X.triggerStatusNoSideEffects(e)}getPendingTriggerConditions(e){return this.triggerStatusNoSideEffects(e)!==rr?[]:[{label:"URL condition not matched",status:this.J.triggerStatusNoSideEffects(e)},{label:"event condition not matched",status:this.Y.triggerStatusNoSideEffects(e)},{label:"linked flag condition not matched",status:this.K.triggerStatusNoSideEffects()}].filter((e=>e.status===rr)).map((e=>e.label))}checkEventTriggerConditions(e,t,r){this.Y.checkEventTriggerConditions(e,t,r)}checkUrlTriggerConditions(e,t,r,i){this.J.checkUrlTriggerConditions(e,t,r,i)}activateTrigger(e,t){var r;null==(r=this._instance.persistence)||r.register({["url"===e?Ht+this.group.id:Bt+this.group.id]:t})}stop(){this.J.stop(),this.Y.stop(),this.K.stop()}}function gr(e){if(e.rrwebError)return Xt;if(!e.receivedFlags)return Yt;if(!e.isRecordingEnabled)return Gt;if(e.urlTriggerMatching.urlBlocked)return Kt;var t=!0===e.isSampled,r=new ur([e.eventTriggerMatching,e.urlTriggerMatching,e.linkedFlagMatching]).triggerStatus(e.sessionId);return t?Qt:r===tr?Jt:r===rr?Yt:!1===e.isSampled?Gt:Jt}function mr(e){if(e.rrwebError)return Xt;if(!e.receivedFlags)return Yt;if(!e.isRecordingEnabled)return Gt;if(e.urlTriggerMatching.urlBlocked)return Kt;var t=new lr([e.eventTriggerMatching,e.urlTriggerMatching,e.linkedFlagMatching]).triggerStatus(e.sessionId),r=t!==ir,i=E(e.isSampled);return r&&t===rr?Yt:r&&t===ir||i&&!e.isSampled?Gt:!0===e.isSampled?Qt:Jt}function yr(){var e=[];return function(t,r){if(_(r)||w(r)){for(;e.length>0&&e[e.length-1]!==this;)e.pop();return e.includes(r)?"[Circular]":(e.push(r),r)}return r}}function br(e){var t=JSON.stringify(e,yr());return t?new Blob([t]).size:0}function wr(e){if(M(e))return 4;if(S(e))return 0;switch(typeof e){case"string":return e.length+2;case"number":return String(e).length;case"boolean":return e?4:5;case"object":if(w(e)){for(var t=2,r=0;e.length>r;r++){r>0&&(t+=1);var i=e[r];t+=S(i)||M(i)?4:wr(i)}return t}var n=e,a=2,o=!0;for(var s in n)if({}.hasOwnProperty.call(n,s)){var u=n[s];S(u)||(o||(a+=1),o=!1,a+=s.length+3+wr(u))}return a;default:return 0}}function kr(e,t){if(void 0===t&&(t=6606028.8),e.size>=t&&e.data.length>1){var r=Math.floor(e.data.length/2),i=e.sizes.slice(0,r),n=e.sizes.slice(r);return[kr({size:i.reduce(((e,t)=>e+t),0),data:e.data.slice(0,r),sizes:i,sessionId:e.sessionId,windowId:e.windowId}),kr({size:n.reduce(((e,t)=>e+t),0),data:e.data.slice(r),sizes:n,sessionId:e.sessionId,windowId:e.windowId})].flatMap((e=>e))}return[e]}var _r=Uint8Array,Sr=Uint16Array,xr=Uint32Array,Cr=new _r([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]),Mr=new _r([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]),Tr=new _r([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Ir=function(e,t){for(var r=new Sr(31),i=0;31>i;++i)r[i]=t+=1<<e[i-1];var n=new xr(r[30]);for(i=1;30>i;++i)for(var a=r[i];r[i+1]>a;++a)n[a]=a-r[i]<<5|i;return[r,n]},Er=Ir(Cr,2),Rr=Er[1];Er[0][28]=258,Rr[258]=28;for(var Ar=Ir(Mr,0)[1],Lr=new Sr(32768),Or=0;32768>Or;++Or){var Pr=(43690&Or)>>>1|(21845&Or)<<1;Lr[Or]=((65280&(Pr=(61680&(Pr=(52428&Pr)>>>2|(13107&Pr)<<2))>>>4|(3855&Pr)<<4))>>>8|(255&Pr)<<8)>>>1}var Dr=function(e,t,r){for(var i=e.length,n=0,a=new Sr(t);i>n;++n)++a[e[n]-1];var o,s=new Sr(t);for(n=0;t>n;++n)s[n]=s[n-1]+a[n-1]<<1;if(r){o=new Sr(1<<t);var u=15-t;for(n=0;i>n;++n)if(e[n])for(var l=n<<4|e[n],h=t-e[n],c=s[e[n]-1]++<<h,d=c|(1<<h)-1;d>=c;++c)o[Lr[c]>>>u]=l}else for(o=new Sr(i),n=0;i>n;++n)o[n]=Lr[s[e[n]-1]++]>>>15-e[n];return o},Fr=new _r(288);for(Or=0;144>Or;++Or)Fr[Or]=8;for(Or=144;256>Or;++Or)Fr[Or]=9;for(Or=256;280>Or;++Or)Fr[Or]=7;for(Or=280;288>Or;++Or)Fr[Or]=8;var Nr=new _r(32);for(Or=0;32>Or;++Or)Nr[Or]=5;var qr=Dr(Fr,9,0),jr=Dr(Nr,5,0),Br=function(e){return(e/8>>0)+(7&e&&1)},Hr=function(e,t,r){(null==r||r>e.length)&&(r=e.length);var i=new(e instanceof Sr?Sr:e instanceof xr?xr:_r)(r-t);return i.set(e.subarray(t,r)),i},$r=function(e,t,r){var i=t/8>>0;e[i]|=r<<=7&t,e[i+1]|=r>>>8},Ur=function(e,t,r){var i=t/8>>0;e[i]|=r<<=7&t,e[i+1]|=r>>>8,e[i+2]|=r>>>16},Wr=function(e,t){for(var r=[],i=0;e.length>i;++i)e[i]&&r.push({s:i,f:e[i]});var n=r.length,a=r.slice();if(!n)return[new _r(0),0];if(1==n){var o=new _r(r[0].s+1);return o[r[0].s]=1,[o,1]}r.sort((function(e,t){return e.f-t.f})),r.push({s:-1,f:25001});var s=r[0],u=r[1],l=0,h=1,c=2;for(r[0]={s:-1,f:s.f+u.f,l:s,r:u};h!=n-1;)s=r[r[c].f>r[l].f?l++:c++],u=r[l!=h&&r[c].f>r[l].f?l++:c++],r[h++]={s:-1,f:s.f+u.f,l:s,r:u};var d=a[0].s;for(i=1;n>i;++i)a[i].s>d&&(d=a[i].s);var v=new Sr(d+1),f=zr(r[h-1],v,0);if(f>t){i=0;var p=0,g=f-t,m=1<<g;for(a.sort((function(e,t){return v[t.s]-v[e.s]||e.f-t.f}));n>i;++i){var y=a[i].s;if(t>=v[y])break;p+=m-(1<<f-v[y]),v[y]=t}for(p>>>=g;p>0;){var b=a[i].s;t>v[b]?p-=1<<t-v[b]++-1:++i}for(;i>=0&&p;--i){var w=a[i].s;v[w]==t&&(--v[w],++p)}f=t}return[new _r(v),f]},zr=function(e,t,r){return-1==e.s?Math.max(zr(e.l,t,r+1),zr(e.r,t,r+1)):t[e.s]=r},Vr=function(e){for(var t=e.length;t&&!e[--t];);for(var r=new Sr(++t),i=0,n=e[0],a=1,o=function(e){r[i++]=e},s=1;t>=s;++s)if(e[s]==n&&s!=t)++a;else{if(!n&&a>2){for(;a>138;a-=138)o(32754);a>2&&(o(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(o(n),--a;a>6;a-=6)o(8304);a>2&&(o(a-3<<5|8208),a=0)}for(;a--;)o(n);a=1,n=e[s]}return[r.subarray(0,i),t]},Zr=function(e,t){for(var r=0,i=0;t.length>i;++i)r+=e[i]*t[i];return r},Gr=function(e,t,r){var i=r.length,n=Br(t+2);e[n]=255&i,e[n+1]=i>>>8,e[n+2]=255^e[n],e[n+3]=255^e[n+1];for(var a=0;i>a;++a)e[n+a+4]=r[a];return 8*(n+4+i)},Qr=function(e,t,r,i,n,a,o,s,u,l,h){$r(t,h++,r),++n[256];for(var c=Wr(n,15),d=c[0],v=c[1],f=Wr(a,15),p=f[0],g=f[1],m=Vr(d),y=m[0],b=m[1],w=Vr(p),k=w[0],_=w[1],S=new Sr(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=Wr(S,7),M=C[0],T=C[1],I=19;I>4&&!M[Tr[I-1]];--I);var E,R,A,L,O=l+5<<3,P=Zr(n,Fr)+Zr(a,Nr)+o,D=Zr(n,d)+Zr(a,p)+o+14+3*I+Zr(S,M)+(2*S[16]+3*S[17]+7*S[18]);if(P>=O&&D>=O)return Gr(t,h,e.subarray(u,u+l));if($r(t,h,1+(P>D)),h+=2,P>D){E=Dr(d,v,0),R=d,A=Dr(p,g,0),L=p;var F=Dr(M,T,0);for($r(t,h,b-257),$r(t,h+5,_-1),$r(t,h+10,I-4),h+=14,x=0;I>x;++x)$r(t,h+3*x,M[Tr[x]]);h+=3*I;for(var N=[y,k],q=0;2>q;++q){var j=N[q];for(x=0;j.length>x;++x)$r(t,h,F[B=31&j[x]]),h+=M[B],B>15&&($r(t,h,j[x]>>>5&127),h+=j[x]>>>12)}}else E=qr,R=Fr,A=jr,L=Nr;for(x=0;s>x;++x)if(i[x]>255){var B;Ur(t,h,E[257+(B=i[x]>>>18&31)]),h+=R[B+257],B>7&&($r(t,h,i[x]>>>23&31),h+=Cr[B]);var H=31&i[x];Ur(t,h,A[H]),h+=L[H],H>3&&(Ur(t,h,i[x]>>>5&8191),h+=Mr[H])}else Ur(t,h,E[i[x]]),h+=R[i[x]];return Ur(t,h,E[256]),h+R[256]},Jr=new xr([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Yr=function(){for(var e=new xr(256),t=0;256>t;++t){for(var r=t,i=9;--i;)r=(1&r&&3988292384)^r>>>1;e[t]=r}return e}(),Kr=function(){var e=4294967295;return{p(t){for(var r=e,i=0;t.length>i;++i)r=Yr[255&r^t[i]]^r>>>8;e=r},d:()=>4294967295^e}},Xr=function(e,t,r,i,n){return function(e,t,r,i,n,a){var o=e.length,s=new _r(i+o+5*(1+Math.floor(o/7e3))+n),u=s.subarray(i,s.length-n),l=0;if(!t||8>o)for(var h=0;o>=h;h+=65535){var c=h+65535;o>c?l=Gr(u,l,e.subarray(h,c)):(u[h]=true,l=Gr(u,l,e.subarray(h,o)))}else{for(var d=Jr[t-1],v=d>>>13,f=8191&d,p=(1<<r)-1,g=new Sr(32768),m=new Sr(p+1),y=Math.ceil(r/3),b=2*y,w=function(t){return(e[t]^e[t+1]<<y^e[t+2]<<b)&p},k=new xr(25e3),_=new Sr(288),S=new Sr(32),x=0,C=0,M=(h=0,0),T=0,I=0;o>h;++h){var E=w(h),R=32767&h,A=m[E];if(g[R]=A,m[E]=R,h>=T){var L=o-h;if((x>7e3||M>24576)&&L>423){l=Qr(e,u,0,k,_,S,C,M,I,h-I,l),M=x=C=0,I=h;for(var O=0;286>O;++O)_[O]=0;for(O=0;30>O;++O)S[O]=0}var P=2,D=0,F=f,N=R-A&32767;if(L>2&&E==w(h-N))for(var q=Math.min(v,L)-1,j=Math.min(32767,h),B=Math.min(258,L);j>=N&&--F&&R!=A;){if(e[h+P]==e[h+P-N]){for(var H=0;B>H&&e[h+H]==e[h+H-N];++H);if(H>P){if(P=H,D=N,H>q)break;var U=Math.min(N,H-2),W=0;for(O=0;U>O;++O){var z=h-N+O+32768&32767,V=z-g[z]+32768&32767;V>W&&(W=V,A=z)}}}N+=(R=A)-(A=g[R])+32768&32767}if(D){k[M++]=268435456|Rr[P]<<18|Ar[D];var Z=31&Rr[P],G=31&Ar[D];C+=Cr[Z]+Mr[G],++_[257+Z],++S[G],T=h+P,++x}else k[M++]=e[h],++_[e[h]]}}l=Qr(e,u,true,k,_,S,C,M,I,h-I,l)}return Hr(s,0,i+Br(l)+n)}(e,null==t.level?6:t.level,null==t.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+t.mem,r,i)},ei=function(e,t,r){for(;r;++t)e[t]=r,r>>>=8},ti=function(e,t){var r=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=2>t.level?4:9==t.level?2:0,e[9]=3,0!=t.mtime&&ei(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),r){e[3]=8;for(var i=0;r.length>=i;++i)e[i+10]=r.charCodeAt(i)}},ri=function(e){return 10+(e.filename&&e.filename.length+1||0)};function ii(e,t){for(var r="",i=0;e.length>i;){var n=e[i++];r+=String.fromCharCode(n)}return r}class ni{constructor(e,t){var r,i,n,a;void 0===t&&(t={}),this.ee={},this.te=Date.now(),this.re=-1/0,this.ie=()=>{var e=Date.now(),t=e-this.te;t>0?(this.ne=Math.min(this.ae,this.ne+t/1e3*this.oe),this.te=e):this.te=e},this.se=e=>{if(!this.ee[e]){var t,r;this.ee[e]=!0;var i=this.ue(e);null==(t=(r=this.le).onBlockedNode)||t.call(r,e,i)}},this.he=e=>{var t=this.ue(e);if("svg"!==(null==t?void 0:t.nodeName)&&t instanceof Element){var r=t.closest("svg");if(r)return[this._rrweb.mirror.getId(r),r]}return[e,t]},this.ue=e=>this._rrweb.mirror.getNode(e),this.ce=e=>{var t,r,i,n,a,o,s,u;return(null!==(t=null==(r=e.removes)?void 0:r.length)&&void 0!==t?t:0)+(null!==(i=null==(n=e.attributes)?void 0:n.length)&&void 0!==i?i:0)+(null!==(a=null==(o=e.texts)?void 0:o.length)&&void 0!==a?a:0)+(null!==(s=null==(u=e.adds)?void 0:u.length)&&void 0!==s?s:0)},this.throttleMutations=e=>{if(3!==e.type||0!==e.data.source)return e;var t=e.data,r=this.ce(t);if(t.attributes){var i=t.attributes.length;t.attributes=t.attributes.filter((e=>{var t=this.he(e.id);return!this.de.consumeRateLimit(t[0])&&e}));var n,a,o=i-t.attributes.length;o>0&&(null==(n=(a=this.le).onDroppedAttributeMutations)||n.call(a,o))}var s=this.ce(t);if(0!==s||r===s){if(this.ve)return e;this.ie();var u,l,h=wr(e);return h>this.ne?(null==(u=(l=this.le).onDroppedOversizedMutation)||u.call(l,h),void this.fe()):(this.ne-=h,e)}},this.fe=()=>{if(!this.pe){var e=Math.max(0,this.ge-(Date.now()-this.re));this.pe=setTimeout((()=>{var e,t;this.pe=void 0,this.re=Date.now(),null==(e=(t=this.le).requestFullSnapshot)||e.call(t)}),e)}},this._rrweb=e,this.le=t,this.de=new N({bucketSize:null!==(r=this.le.bucketSize)&&void 0!==r?r:100,refillRate:null!==(i=this.le.refillRate)&&void 0!==i?i:10,refillInterval:1e3,S:this.se,I:Le}),this.ae=null!==(n=this.le.bytesBucketSize)&&void 0!==n?n:0,this.oe=null!==(a=this.le.bytesRefillRate)&&void 0!==a?a:25600,this.ve=!Number.isFinite(this.ae)||0>=this.ae,this.ne=this.ae;var o=this.le.resyncIntervalMs;this.ge=I(o)&&Number.isFinite(o)&&o>0?o:3e5}reset(){this.ee={},this.pe&&(clearTimeout(this.pe),this.pe=void 0),this.re=Date.now()}stop(){this.de.stop(),this.reset(),this.ne=this.ae,this.te=Date.now(),this.re=-1/0}}Re.DEBUG=!1,Re.LIB_VERSION="1.422.3",Re.LIB_NAME="web";class ai{constructor(e){if(!e.persistence)throw new Error("it is not valid to not have persistence and be this far into setting up the application");this.me=e.get_property.bind(e),this.ye=e.persistence.set_property.bind(e.persistence)}trackSize(e,t){this.ye(Wt,{sessionId:e,size:this.currentTrackedSize(e)+t})}currentTrackedSize(e){var t,r=this.me(Wt);return _(t=r)&&x(t.sessionId)&&I(t.size)&&r.sessionId===e?r.size:0}}function oi(e,t){return function(e){for(var t=0,r=0;e.length>r;r++)t=(t<<5)-t+e.charCodeAt(r),t|=0;return Math.abs(t)}(e)%100<F(100*t,0,100,Le)}function si(e){return"$survey_response_"+e}function ui(e,t){if(!t)return null;var r=e[si(t)];return w(r)?[...r]:r}function li(e,t){void 0===e&&(e={});var r={};return t.questions.forEach((t=>{if(!S(t.originalQuestionIndex)){var i,n=0===(i=t.originalQuestionIndex)?"$survey_response":"$survey_response_"+i,a=ui(e,t.id);S(a)||(r[n]=a)}})),h({$survey_questions:t.questions.map((t=>({id:t.id,question:t.question,response:ui(e,t.id)})))},e,r)}function hi(e,t){var r="$survey_"+t+"/"+e.id;return e.current_iteration&&e.current_iteration>0&&(r="$survey_"+t+"/"+e.id+"/"+e.current_iteration),r}function ci(e){return"string"==typeof e&&e.trim()?e.trim():null}function di(e){return e.toLowerCase()}function vi(e,t,r){if(!e||!t)return null;var i=di(t),n=Object.keys(e).find((e=>di(e)===i));if(n)return null==r||r.debug("Found exact translation match: "+n),n;if(i.includes("-")){var a=i.split("-")[0],o=Object.keys(e).find((e=>di(e)===a));if(o)return null==r||r.debug("Found base language translation match: "+o+" (from "+t+")"),o}return null}var fi=["thankYouMessageHeader","thankYouMessageDescription","thankYouMessageCloseButtonText","introScreenHeader","introScreenDescription","introScreenButtonText","submitButtonText","backButtonText"];function pi(e,t,r){var i,n=vi(e.translations,t,r),a=h({},e),o=!1;if(n){var s,u=null==(s=e.translations)?void 0:s[n];if(u)if(null==r||r.info("Applying survey-level translation for language: "+n),S(u.name)||(a.name=u.name,o=!0),a.appearance){var l=h({},a.appearance);for(var c of fi){var d=u[c];S(d)||(l[c]=d,o=!0)}a.appearance=l}else(function(e){return fi.some((t=>!S(e[t])))})(u)&&(o=!0)}var v=e.questions.map((e=>function(e,t,r){var i,n=vi(e.translations,t,r);if(!n)return{question:e,matchedKey:null,hasChanges:!1};var a=null==(i=e.translations)?void 0:i[n];if(!a)return{question:e,matchedKey:null,hasChanges:!1};var o=h({},e),s=!1;return S(a.question)||(o.question=a.question,s=!0),S(a.description)||(o.description=a.description,s=!0),S(a.buttonText)||(o.buttonText=a.buttonText,s=!0),"link"in o&&!S(a.link)&&(o.link=a.link,s=!0),"lowerBoundLabel"in o&&!S(a.lowerBoundLabel)&&(o.lowerBoundLabel=a.lowerBoundLabel,s=!0),"upperBoundLabel"in o&&!S(a.upperBoundLabel)&&(o.upperBoundLabel=a.upperBoundLabel,s=!0),"choices"in o&&function(e){return w(e.choices)}(a)&&(o.choices=a.choices,s=!0),{question:s?o:e,matchedKey:s?n:null,hasChanges:s}}(e,t,r))),f=v.map((e=>e.question)),p=v.some((e=>e.hasChanges)),g=null;return n||(g=(null==(i=v.find((e=>e.matchedKey)))?void 0:i.matchedKey)||null),p&&(a.questions=f,o=!0,null==r||r.info("Applied question-level translations for language: "+t)),{survey:a,matchedKey:o?n||g:null}}function gi(e){var t;return!(null==(t=e.conditions)||null==(t=t.events)||null==(t=t.values)||!t.length)}var mi=(e,t)=>{if(!(e=>{try{new RegExp(e)}catch(e){return!1}return!0})(t))return!1;try{return new RegExp(t).test(e)}catch(e){return!1}},yi=e=>e.toLowerCase(),bi={exact:(e,t)=>t.some((t=>e.some((e=>t===e)))),is_not:(e,t)=>t.every((t=>e.every((e=>t!==e)))),regex:(e,t)=>t.some((t=>e.some((e=>mi(t,e))))),not_regex:(e,t)=>t.every((t=>e.every((e=>!mi(t,e))))),icontains:(e,t)=>t.map(yi).some((t=>e.map(yi).some((e=>t.includes(e))))),not_icontains:(e,t)=>t.map(yi).every((t=>e.map(yi).every((e=>!t.includes(e))))),gt:(e,t)=>t.some((t=>{var r=parseFloat(t);return!isNaN(r)&&e.some((e=>r>parseFloat(e)))})),lt:(e,t)=>t.some((t=>{var r=parseFloat(t);return!isNaN(r)&&e.some((e=>r<parseFloat(e)))}))},wi=new Set(["is_not","not_icontains","not_regex"]);function ki(e,t,r){return!e||0===e.length||e.every((e=>{var i="person"===e.type?r:t,n=null==i?void 0:i[e.key],a=e.operator||"exact";if(S(n)||M(n))return wi.has(a);var o=bi[a];return!!o&&!S(e.value)&&!M(e.value)&&o(w(e.value)?e.value.map(String):[String(e.value)],w(n)?n.map(String):[String(n)])}))}var _i=Oe("[SessionRecording]");function Si(e,t){return t?e:"!"+e}function xi(e,t){return e===t||e!=="!"+t&&null}class Ci{constructor(e,t,r,i,n,a,o){this.be=null,this.we=mr,this._instance=e,this.J=t,this.Y=r,this.K=i,this.ke=n,this._e=a,this.Se=o}onRemoteConfig(e){this.be=I(e.sampleRate)?e.sampleRate:null,"any"===e.triggerMatchType?(this.xe=new ur([this.Y,this.J]),this.we=gr):(this.xe=new lr([this.Y,this.J]),this.we=mr),this._instance.register_for_session({[Zt]:e.triggerMatchType}),this.J.onConfig(e),this.Y.onConfig(e),this.K.onConfig(e,((e,t)=>{this.ke("linked_flag_matched",{flag:e,variant:t}),this.Se()}))}getStatus(e){return this.we({receivedFlags:!0,isRecordingEnabled:!0,isSampled:e.isSampled,rrwebError:e.rrwebError,urlTriggerMatching:e.urlTriggerMatching,eventTriggerMatching:e.eventTriggerMatching,linkedFlagMatching:e.linkedFlagMatching,sessionId:e.sessionId})}getMinimumDuration(e){var t=this._instance.get_property("$session_recording_remote_config"),r=null==t?void 0:t.minimumDurationMilliseconds;return I(r)?r:null}checkUrlTriggers(e,t,r,i){this.J.checkUrlTriggerConditions(t,r,i,e)}setupEventTriggerListeners(e,t,r){if(0!==this.Y.Z.length&&T(this.Ce))return this.Ce=e((e=>{try{this.Y.checkEventTriggerConditions(e.event,r,t)}catch(e){_i.error("Could not activate event trigger",e)}})),this.Ce}makeSamplingDecisions(e){var t,r,i,n=this.be;if(!I(n))return null==(r=this._instance.persistence)||r.unregister(Ft),void(null==(i=this._instance.persistence)||i.unregister(At));var a=this._instance.get_property(Ft),o=this._instance.get_property(At),s=xi(a,e),u=I(o)&&o!==n,l=S(o)&&a===e,h=u||l||!E(s),c=h?oi(e,n):s;h&&(c?this.ke("sampled"):_i.warn("Sample rate ("+n+") has determined that this sessionId ("+e+") will not be sent to the server.")),null==(t=this._instance.persistence)||t.register({[Ft]:Si(e,c),[At]:M(o)&&a===e?null:n})}ensureSamplingDecision(e){if(I(this.be)){var t=this._instance.get_property(Ft);E(xi(t,e))||this.makeSamplingDecisions(e)}}onFlushComplete(){}clearConditionalRecordingPersistence(){var e,t,r,i,n;null==(e=this._instance.persistence)||e.unregister(jt),null==(t=this._instance.persistence)||t.unregister(qt),null==(r=this._instance.persistence)||r.unregister(Ft),null==(i=this._instance.persistence)||i.unregister(At),null==(n=this._instance.persistence)||n.unregister(Nt)}updateActiveTriggers(e){}hasPendingTriggers(e){var t;return(null==(t=this.xe)?void 0:t.triggerStatus(e))===rr}getPendingTriggerConditions(e){return[{label:"URL condition not matched",status:this.J.triggerStatusNoSideEffects(e)},{label:"event condition not matched",status:this.Y.triggerStatusNoSideEffects(e)},{label:"linked flag condition not matched",status:this.K.triggerStatusNoSideEffects()}].filter((e=>e.status===rr)).map((e=>e.label))}stop(){var e;null==(e=this.Ce)||e.call(this),this.Ce=void 0,this.Y.stop(),this.J.stop(),this.K.stop()}}class Mi{constructor(e,t,r,i,n){this.Me=[],this.Te=new Map,this.Ie=!1,this._instance=e,this.J=t,this.ke=r,this.Ee=i,this.Se=n}onRemoteConfig(e){e.triggerGroups&&0!==e.triggerGroups.length?(this.Re(e.triggerGroups),this._instance.register_for_session({[Zt]:"v2_trigger_groups",$sdk_debug_replay_trigger_groups_count:e.triggerGroups.length}),this.J.onConfig(e)):_i.warn("[V2Strategy] No trigger groups configured")}getStatus(e){return function(e){if(e.rrwebError)return Xt;if(e.urlTriggerMatching.urlBlocked)return Kt;var t=e.triggerGroupMatchers,r=e.triggerGroupSamplingResults;if(0===t.length)return Gt;var i=!1,n=!1;for(var a of t){var o=a.triggerStatus(e.sessionId);if(o===tr){var s=a.group.id,u=r.get(s);S(u)?Le.warn("[V2 Triggers] Group activated but no sampling decision found",{groupId:s}):!0===u&&(n=!0)}else o===rr&&(i=!0)}return n?Qt:i?Yt:Gt}({isSampled:e.isSampled,rrwebError:e.rrwebError,urlTriggerMatching:e.urlTriggerMatching,eventTriggerMatching:e.eventTriggerMatching,linkedFlagMatching:e.linkedFlagMatching,sessionId:e.sessionId,triggerGroupMatchers:this.Me,triggerGroupSamplingResults:this.Te,minimumDuration:this.getMinimumDuration(e.sessionId)})}getMinimumDuration(e){var t=null;for(var r of this.Me)if("trigger_activated"===r.triggerStatus(e)){var i=r.group.minDurationMs;I(i)&&(M(t)||t>i)&&(t=i)}return t}checkUrlTriggers(e,t,r,i){var n=this;this.J.checkUrlBlocklist(t,r);var a=function(i){i.checkUrlTriggerConditions(t,r,(t=>{n.Ae(i,void 0)&&(i.activateTrigger(t,e),n.updateActiveTriggers(e),n.Se(t))}),e)};for(var o of this.Me)a(o)}setupEventTriggerListeners(e,t,r){var i=this;return this.Ce=e((e=>{var r;if(this.Ie)return _i.info("[SessionRecorder] Stopping trigger checks - initial buffer flushed"),null==(r=this.Ce)||r.call(this),void(this.Ce=void 0);try{var n=function(r){r.checkEventTriggerConditions(e.event,(n=>{if(i.Ae(r,e.properties)){var a=(r.group.conditions.events||[]).filter((t=>t.name===e.event)),o=i._instance.get_property(zt),s=a.some((t=>!t.properties||0===t.properties.length||ki(t.properties,e.properties,o)));s&&(r.activateTrigger(n,t),i.updateActiveTriggers(t),i.Se(n))}}),t)};for(var a of this.Me)n(a)}catch(e){_i.error("Could not activate event trigger for trigger groups",e)}})),this.Ce}makeSamplingDecisions(e){for(var t of this.Me){var r,i=t.group,n=i.id,a=i.sampleRate,o=$t+n,s=this._instance.get_property(o),u=null,l=!1,h=!1,c=!1;if(_(s)){var d=s.sessionId,v=s.sampleRate,f=s.sampled;l="string"==typeof d&&d!==e,h=I(v)&&v!==a,u=d===e&&I(v)&&v===a&&E(f)?f:null}else u=s===e||null,l="string"==typeof s&&s!==e,c=s===e;var p=l||h||c||!E(u),g=p?oi(e+n,a):u;p&&this.Ee("triggerGroupSamplingDecisionMade",{group_id:n,group_name:i.name,sampleRate:a,isSampled:g}),this.Te.set(n,g),null==(r=this._instance.persistence)||r.register({[o]:{sessionId:e,sampleRate:a,sampled:g}})}this.updateActiveTriggers(e)}ensureSamplingDecision(e){}onFlushComplete(){this.Ie=!0}clearConditionalRecordingPersistence(){var e,t,r;for(var i of(null==(e=this._instance.persistence)||e.unregister(Ft),null==(t=this._instance.persistence)||t.unregister(At),null==(r=this._instance.persistence)||r.unregister(Nt),this.Me)){var n,a,o,s=i.group.id;null==(n=this._instance.persistence)||n.unregister(Bt+s),null==(a=this._instance.persistence)||a.unregister(Ht+s),null==(o=this._instance.persistence)||o.unregister($t+s)}}updateActiveTriggers(e){var t=[];for(var r of this.Me){var i=r.group,n=i.id,a="trigger_activated"===r.triggerStatus(e),o=!0===this.Te.get(n);a&&t.push({id:n,name:i.name,matched:!0,sampled:o})}this._instance.register_for_session({$sdk_debug_replay_matched_recording_trigger_groups:t})}hasPendingTriggers(e){for(var t of this.Me)if(t.triggerStatus(e)===rr)return!0;return!1}getPendingTriggerConditions(e){return this.Me.flatMap((t=>t.triggerStatusNoSideEffects(e)!==rr?[]:t.getPendingTriggerConditions(e).map((e=>'trigger group "'+t.group.name+'": '+e))))}stop(){var e;null==(e=this.Ce)||e.call(this),this.Ce=void 0,this.Me.forEach((e=>e.stop())),this.Me=[],this.Te.clear(),this.J.stop()}Ae(e,t){var r=e.group.conditions.properties;return!r||0===r.length||ki(r,t,this._instance.get_property(zt))}Re(e){var t=this;this.Me.forEach((e=>e.stop())),this.Me=[],this.Te.clear();var r=function(e){var r=new pr(t._instance,e,((r,i)=>{t.ke("linked_flag_matched",{flag:r,variant:i,group_id:e.id,group_name:e.name}),t.Se()}));t.Me.push(r)};for(var i of e)r(i)}}var Ti=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],Ii=1e5,Ei="https://schema.org",Ri=[],Ai="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(" "),Li="Action BorrowAction ReadAction SearchAction SeekToAction SolveMathAction WatchAction".split(" "),Oi="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(" "),Pi="Accommodation AdministrativeArea Country Place State".split(" "),Di={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:Li,publisher:Oi},Event:{startDate:!0,endDate:!0,previousStartDate:!0,aggregateRating:["AggregateRating"],offers:["AggregateOffer","Offer"]},ItemList:{itemListElement:["ListItem"]},ListItem:{item:Ri},Offer:{seller:Oi},Organization:{name:!0,legalName:!0,foundingDate:!0,dissolutionDate:!0,aggregateRating:["AggregateRating"],brand:["Brand"]},Person:{},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:Oi,offers:["Offer","AggregateOffer"],aggregateRating:["AggregateRating"]},Service:{name:!0,serviceType:!0,category:!0,provider:Oi,areaServed:Pi,offers:["AggregateOffer","Offer"],aggregateRating:["AggregateRating"]},OfferCatalog:{name:!0,itemListElement:Ri}},Fi={},Ni=[[Li,Fi],["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(" "),Di.CreativeWork],["BroadcastEvent BusinessEvent EducationEvent Festival MusicEvent SportsEvent TheaterEvent".split(" "),Di.Event],[Oi,Di.Organization],[Pi,Di.Place],["Car IndividualProduct ProductGroup ProductModel".split(" "),Di.Product],["AggregateRating EmployerAggregateRating Rating".split(" "),Fi]],qi="AlignmentObject BedDetails Certification ContactPoint CreditCard DefinedRegion EducationalOccupationalCredential EntryPoint GeoCoordinates GeoShape InteractionCounter JobPosting LocationFeatureSpecification MathSolver MemberProgram MemberProgramTier MerchantReturnPolicy MerchantReturnPolicySeasonalOverride MonetaryAmount NutritionInformation OccupationalExperienceRequirements OfferShippingDetails OpeningHoursSpecification PeopleAudience PostalAddress PriceSpecification PropertyValue QuantitativeValue ServicePeriod ShippingConditions ShippingDeliveryTime ShippingRateSettings ShippingService SpeakableSpecification Thing UnitPriceSpecification".split(" ");function ji(e,t){return y.call(e,t)?e[t]:void 0}function Bi(e){var t=typeof e;return M(e)||"string"===t||"number"===t||"boolean"===t}function Hi(e){return Bi(e)||w(e)&&e.every(Bi)?e:void 0}function $i(e){if(y.call(Di,e))return Di[e];for(var t of Ni){var r=t[1];if(t[0].includes(e))return r}return qi.includes(e)?Fi:void 0}function Ui(e,t){if(!_(e))return null;var r=ji(e,"@type"),i=function(e){return("string"==typeof e?[e]:w(e)?e:[]).filter((e=>"string"==typeof e)).map((e=>e.replace(/^https?:\/\/schema\.org\//,""))).filter((e=>!!$i(e)))}(r).filter((e=>!t||!t.length||t.includes(e)));if(!i.length)return null;var n={"@type":"string"==typeof r?i[0]:i},a=Hi(ji(e,"@id"));for(var o of(S(a)||(n["@id"]=a),Ai)){var s=Hi(ji(e,o));S(s)||(n[o]=s)}for(var u of i){var l=$i(u),h=function(){var t=ji(e,c),r=l[c];if(!0===r){var i=Hi(t);S(i)||(n[c]=i)}else if(w(t)){var a=t.map((e=>Ui(e,r))).filter(_);a.length&&(n[c]=a)}else{var o=Ui(t,r);o&&(n[c]=o)}};for(var c of Object.keys(l))h()}return n}function Wi(e){if(!_(e))return null;var t=ji(e,"@context");if("string"!=typeof t||!/^https?:\/\/schema\.org\/?$/.test(t))return null;var r=Ui(e);if(r)return h({"@context":Ei},r);var i=ji(e,"@graph");if(!w(i))return null;var n=i.map((e=>Ui(e))).filter(_);return n.length?{"@context":Ei,"@graph":n}:null}function zi(e){var t;return"SCRIPT"===e.nodeName&&"application/ld+json"===(null==(t=e.getAttribute("type"))?void 0:t.trim().toLowerCase())}function Vi(e,t,r){if("string"==typeof t?e.classList.contains(t):t&&Array.from(e.classList).some((e=>(t.lastIndex=0,t.test(e)))))return!0;try{return!!r&&e.matches(r)}catch(e){return!1}}function Zi(e){return zi(e)?[e]:e.nodeType!==e.ELEMENT_NODE?[]:Array.from(e.querySelectorAll("script")).filter(zi)}function Gi(e){return S(e)?void 0:Math.round(e)}function Qi(e){return _(e)?e.network_timing:e}var Ji,Yi,Ki=943718.4,Xi="[SessionRecording]",en=Oe(Xi),tn=[d.MouseMove,d.MouseInteraction,d.Scroll,d.ViewportResize,d.Input,d.TouchMove,d.MediaInteraction,d.Drag],rn=e=>({rrwebMethod:e,enqueuedAt:Date.now(),attempt:1});function nn(){var e;return null==s||null==(e=s.__PosthogExtensions__)?void 0:e.rrweb}function an(){var e;return null==(e=nn())?void 0:e.record}function on(e){try{return JSON.stringify(e)}catch(t){return JSON.stringify(e,yr())}}function sn(e){return ii(function(e,t){void 0===t&&(t={});var r=Kr(),i=e.length;r.p(e);var n=Xr(e,t,ri(t),8),a=n.length;return ti(n,t),ei(n,a-8,r.d()),ei(n,a-4,i),n}(function(e,t){var r=e.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var i=new _r(e.length+(e.length>>>1)),n=0,a=function(e){i[n++]=e},o=0;r>o;++o){if(n+5>i.length){var s=new _r(n+8+(r-o<<1));s.set(i),i=s}var u=e.charCodeAt(o);128>u?a(u):2048>u?(a(192|u>>>6),a(128|63&u)):u>55295&&57344>u?(a(240|(u=65536+(1047552&u)|1023&e.charCodeAt(++o))>>>18),a(128|u>>>12&63),a(128|u>>>6&63),a(128|63&u)):(a(224|u>>>12),a(128|u>>>6&63),a(128|63&u))}return Hr(i,0,n)}(on(e))))}function un(e){return ln.apply(this,arguments)}function ln(){return ln=l((function*(e){var t=on(e),r=yield function(e,t,r){return ve.apply(this,arguments)}(t,Re.DEBUG,{rethrow:!0});return ii(new Uint8Array(yield r.arrayBuffer()))})),ln.apply(this,arguments)}var hn="undefined"!=typeof globalThis&&"CompressionStream"in globalThis&&"TextEncoder"in globalThis&&"Response"in globalThis&&"function"==typeof Response.prototype.blob,cn=!1;function dn(e){return w(e)&&0===e.length?Ji=null!=Ji?Ji:sn([]):sn(e)}function vn(e){return fn.apply(this,arguments)}function fn(){return(fn=l((function*(e){return w(e)&&0===e.length?Ji||(Yi=null!=Yi?Yi:un([]).then((e=>(Ji=e,e))).catch((e=>{throw Ji=void 0,Yi=void 0,e}))):un(e)}))).apply(this,arguments)}function pn(e){return hn&&!cn&&function(e){return e.type===c.FullSnapshot||e.type===c.IncrementalSnapshot&&(e.data.source===d.Mutation||e.data.source===d.StyleSheetRule)}(e)}function gn(e){return{event:e,size:wr(e)}}function mn(e,t){return h({},e,{data:t,cv:"2024-10"})}function yn(e,t){return h({},e,{cv:"2024-10",data:h({},e.data,t)})}function bn(e){try{if(e.type===c.FullSnapshot)return gn(mn(e,sn(e.data)));if(e.type===c.IncrementalSnapshot&&e.data.source===d.Mutation)return gn(yn(e,{texts:dn(e.data.texts),attributes:dn(e.data.attributes),removes:dn(e.data.removes),adds:dn(e.data.adds)}));if(e.type===c.IncrementalSnapshot&&e.data.source===d.StyleSheetRule)return gn(yn(e,{adds:e.data.adds?sn(e.data.adds):void 0,removes:e.data.removes?sn(e.data.removes):void 0}))}catch(e){en.error("could not compress event - will use uncompressed event",e)}return{event:e,size:br(e)}}function wn(){return wn=l((function*(e){try{if(e.type===c.FullSnapshot)return gn(mn(e,yield un(e.data)));if(e.type===c.IncrementalSnapshot&&e.data.source===d.Mutation){var t=yield Promise.all([vn(e.data.texts),vn(e.data.attributes),vn(e.data.removes),vn(e.data.adds)]);return gn(yn(e,{texts:t[0],attributes:t[1],removes:t[2],adds:t[3]}))}if(e.type===c.IncrementalSnapshot&&e.data.source===d.StyleSheetRule){var r=yield Promise.all([e.data.adds?un(e.data.adds):void 0,e.data.removes?un(e.data.removes):void 0]);return gn(yn(e,{adds:r[0],removes:r[1]}))}}catch(t){return(e=>{if(!e||"object"!=typeof e)return!1;var t="name"in e?String(e.name):"";return(e=>!(!e||"object"!=typeof e)&&"NotReadableError"===("name"in e?String(e.name):""))(e)||t===he})(t)&&(cn=!0),en.error("could not compress event asynchronously - trying synchronous compression",t),bn(e)}return{event:e,size:br(e)}})),wn.apply(this,arguments)}function kn(e,t){return e.type===c.Custom&&e.data.tag===t}function _n(e){return kn(e,"sessionIdle")}function Sn(e){return kn(e,"$session_ending")}function xn(e){return kn(e,"$session_starting")}class Cn{get sessionId(){return this.Le}get Oe(){if(!this._instance.sessionManager)throw new Error(Xi+" must be started with a valid sessionManager.");return this._instance.sessionManager}get Pe(){return this._instance.config.session_recording.session_idle_threshold_ms||3e5}get De(){return xi(this._instance.get_property(Ft),this.sessionId)}get be(){var e,t=null==(e=this.Fe)?void 0:e.sampleRate;return I(t)?t:null}get Ne(){var e,t;return null!==(e=null==(t=this.qe)?void 0:t.getMinimumDuration(this.sessionId))&&void 0!==e?e:null}constructor(e,t){this.je="/s/",this._forceAllowLocalhostNetworkCapture=!1,this.Be=void 0,this.He=!1,this.$e=Date.now(),this.Ue=!1,this.We=[],this.ze="unknown",this.Ve=0,this.Ze=0,this.Ge=0,this.Qe=0,this.Je=!1,this.Ye=!1,this.Ke=!1,this.Xe=!1,this.et=!1,this.tt=!1,this.rt=!1,this.it=!1,this.nt=!1,this.ot=!1,this.st=!1,this.ut=!1,this.ht=[],this.ct=void 0,this.dt=void 0,this.vt=[],this.ft=0,this.yt=0,this.bt=!1,this.wt=void 0,this.Ce=void 0,this.kt=void 0,this._t=void 0,this.St=void 0,this.xt=(e,t,r)=>{var i,n,a;if(r&&(e!==this.Le||t!==this.Ct)){var o,s=!r.noSessionId&&(r.activityTimeout||r.sessionPastMaximumLength),u=this.Le,l=this.Ct;if(s&&this.Ee("$session_ending",{currentSessionId:u,currentWindowId:l,nextSessionId:e,nextWindowId:t,changeReason:r,lastActivityTimestamp:this.$e,flushed_size:null==(o=this.Mt)?void 0:o.currentTrackedSize(u)}),null==(i=this._instance.persistence)||i.unregister(Ut),this.rt=!1,null==(n=nn())||null==n.resetMaxDepthState||n.resetMaxDepthState(),this.Ee("$session_id_change",{sessionId:e,windowId:t,changeReason:r}),this.Tt(),!(!1===this.ze&&this.isStarted||this.Le===e&&this.Ct===t)){var h=this.Le!==e&&!1!==this.ze;this.ze="unknown",this.It(h)}s&&this.Ee("$session_starting",{previousSessionId:u,previousWindowId:l,nextSessionId:e,nextWindowId:t,changeReason:r,lastActivityTimestamp:this.$e}),null==(a=this.qe)||a.makeSamplingDecisions(e)}},this.Et=()=>{var e;return(null==(e=this._instance.persistence)?void 0:e.props[Nt])===this.Le},this.Rt=()=>{var e,t;if(0===this.At.data.length)return null;var r=null==(e=this.At.data[0])?void 0:e.timestamp,i=null==(t=this.At.data[this.At.data.length-1])?void 0:t.timestamp;return I(r)&&I(i)?i-r:null},this.Lt=()=>{var e,t,r=this.Ne;if(!I(r))return!1;if(null===(e=null==(t=this._instance.config.session_recording)?void 0:t.strictMinimumDuration)||void 0===e||!e){var i=this.Ot;return I(i)&&i>=0&&r>i}if(this.Et())return!1;var n,a=this.Rt();return!!M(a)||r>a||(null==(n=this._instance.persistence)||n.register({[Nt]:this.Le}),!1)},this.Pt=()=>{this.status!==Yt?(this.Je&&this.Ye&&this.Dt&&!this.Ke&&(this.Je=!1),this.Ft(),this.Nt()):this.qt()},this.jt=()=>{this.Pt()},this.Bt=()=>{this.Ee("browser offline",{})},this.Ht=()=>{this.Ee("browser online",{})},this.$t=()=>{null!=i&&i.visibilityState&&("visible"===i.visibilityState&&(this.Dt=!0),this.Ee("window "+i.visibilityState,{}))},this._instance=e,this.Dt=null==t||t;var r=this.Oe.checkAndGetSessionAndWindowId(),n=r.windowId;this.Le=r.sessionId,this.Ct=n,this.K=new vr(this._instance),this.J=new dr(this._instance),this.Y=new fr(this._instance),this.At=this.qt(),this.Oe.sessionTimeoutMs>this.Pe||en.warn("session_idle_threshold_ms ("+this.Pe+") is greater than the session timeout ("+this.Oe.sessionTimeoutMs+"). Session will never be detected as idle"),this.Mt=new ai(this._instance)}setDocumentWasEverVisible(e){e&&(this.Dt=!0)}get Ut(){var e,t,r,i,n,a,o,s,u,l=null==(e=this.Fe)?void 0:e.masking,h={maskAllInputs:null==(t=this._instance.config.session_recording)?void 0:t.maskAllInputs,maskTextSelector:null==(r=this._instance.config.session_recording)?void 0:r.maskTextSelector,blockSelector:null==(i=this._instance.config.session_recording)?void 0:i.blockSelector,maskAllElementAttributes:null==(n=this._instance.config.session_recording)?void 0:n.maskAllElementAttributes},c=null!==(a=null==h?void 0:h.maskAllInputs)&&void 0!==a?a:null==l?void 0:l.maskAllInputs,d=null!==(o=null==h?void 0:h.maskTextSelector)&&void 0!==o?o:null==l?void 0:l.maskTextSelector,v=null!==(s=null==h?void 0:h.blockSelector)&&void 0!==s?s:null==l?void 0:l.blockSelector,f=null!==(u=null==h?void 0:h.maskAllElementAttributes)&&void 0!==u?u:null==l?void 0:l.maskAllElementAttributes;return S(c)&&S(d)&&S(v)&&S(f)?void 0:{maskAllInputs:null==c||c,maskTextSelector:d,blockSelector:v,maskAllElementAttributes:f}}Wt(){var e;if(!this.nt){var t=null==(e=this.Fe)?void 0:e.masking;if(!T(t)){var r=this._instance.config.session_recording,i=["maskAllInputs","maskTextSelector","blockSelector","maskAllElementAttributes"].filter((e=>{var i=null==r?void 0:r[e],n=t[e];return!S(i)&&i!==n}));0!==i.length&&(this.nt=!0,en.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==r?void 0:r.maskAllInputs,maskTextSelector:null==r?void 0:r.maskTextSelector,blockSelector:null==r?void 0:r.blockSelector,maskAllElementAttributes:null==r?void 0:r.maskAllElementAttributes},project:t}))}}}get zt(){var e;return F(null==(e=this._instance.config.session_recording.canvasCapture)?void 0:e.resolutionScale,.1,1,Oe("canvas recording resolution scale"),1)}get Vt(){var e,t,r,i,n,a,o,s=this._instance.config.session_recording.captureCanvas,u=null==(e=this.Fe)?void 0:e.canvasRecording,l=null!==(t=null!==(r=null==s?void 0:s.recordCanvas)&&void 0!==r?r:null==u?void 0:u.enabled)&&void 0!==t&&t,h=null!==(i=null!==(n=null==s?void 0:s.canvasFps)&&void 0!==n?n:null==u?void 0:u.fps)&&void 0!==i?i:4,c=null!==(a=null!==(o=null==s?void 0:s.canvasQuality)&&void 0!==o?o:null==u?void 0:u.quality)&&void 0!==a?a:.4;if("string"==typeof c){var d=parseFloat(c);c=isNaN(d)?.4:d}return{enabled:l,fps:F(h,0,12,Oe("canvas recording fps"),4),quality:F(c,0,1,Oe("canvas recording quality"),.4)}}get Zt(){var e,t=!(null==(e=this.Fe)||!e.consoleLogRecordingEnabled),r=this._instance.config.enable_recording_console_log;return null!=r?r:t}get Gt(){var e,t,r,i=null==(e=this.Fe)?void 0:e.networkPayloadCapture,n={recordHeaders:null==(t=this._instance.config.session_recording)?void 0:t.recordHeaders,recordBody:null==(r=this._instance.config.session_recording)?void 0:r.recordBody},a=(null==n?void 0:n.recordHeaders)||(null==i?void 0:i.recordHeaders),o=(null==n?void 0:n.recordBody)||(null==i?void 0:i.recordBody),s=Qi(this._instance.config.capture_performance),u=Qi(null==i?void 0:i.capturePerformance),l=!!(E(s)?s:u);return a||o||l?{recordHeaders:a,recordBody:o,recordPerformance:l}:void 0}Qt(){var e,t,r=[],i=null==(e=s.__PosthogExtensions__)||null==(e=e.rrwebPlugins)?void 0:e.getRecordConsolePlugin;i&&this.Zt&&r.push(i());var a=null==(t=s.__PosthogExtensions__)||null==(t=t.rrwebPlugins)?void 0:t.getRecordNetworkPlugin;if(this.Gt&&k(a))if(!qe.includes(n.hostname)||this._forceAllowLocalhostNetworkCapture){var o=k(this._instance.requestRouter.isIngestionEndpoint)?this._instance.requestRouter.isIngestionEndpoint.bind(this._instance.requestRouter):void 0;r.push(a(((e,t,r)=>{var i,n={payloadSizeLimitBytes:kt.payloadSizeLimitBytes,performanceEntryTypeToObserve:[...kt.performanceEntryTypeToObserve],payloadHostDenyList:[...t.payloadHostDenyList||[],...kt.payloadHostDenyList]},a=!1!==e.session_recording.recordHeaders&&t.recordHeaders,o=!1!==e.session_recording.recordBody&&t.recordBody,s=!1!==e.capture_performance&&t.recordPerformance,u=(i=wt(n),e=>(null!=e&&e.requestBody&&(e.requestBody=Tt(e.requestBody,e.requestHeaders,i,"Request")),null!=e&&e.responseBody&&(e.responseBody=Tt(e.responseBody,e.responseHeaders,i,"Response")),e)),l=t=>{return u(((e,t,r)=>{var i;if(null==r||!r(e.name)){var n=je(e.name),a=0===t.indexOf("http")?null==(i=je(t))?void 0:i.pathname:t;"/"===a&&(a="");var o=null==n?void 0:n.pathname.replace(a||"","");if(!(n&&o&&Mt.some((e=>0===o.indexOf(e)))))return e}})((Ct((i=t).requestHeaders),Ct(i.responseHeaders),i),e.api_host,r));var i},c=k(e.session_recording.maskNetworkRequestFn);return c&&k(e.session_recording.maskCapturedNetworkRequestFn)&&Le.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."),c&&(e.session_recording.maskCapturedNetworkRequestFn=t=>{var r=e.session_recording.maskNetworkRequestFn({url:t.name});return!r&&t.isInitial?r:h({},t,{name:null==r?void 0:r.url})}),n.maskRequestFn=k(e.session_recording.maskCapturedNetworkRequestFn)?t=>{var r=l(t);if(r){var i=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,n=null==e.session_recording.maskCapturedNetworkRequestFn?void 0:e.session_recording.maskCapturedNetworkRequestFn(r);return T(n)&&i?(Et.add(i),i):null!=n?n:void 0}}:e=>function(e){if(!S(e))return e.requestBody=It(e.requestBody,"Request"),e.responseBody=It(e.responseBody,"Response"),e}(l(e)),h({},kt,n,{recordHeaders:a,recordBody:o,recordPerformance:s,recordInitialRequests:s,streamNetworkBody:!0===e.session_recording.streamNetworkBody})})(this._instance.config,this.Gt,o)))}else en.info("NetworkCapture not started because we are on localhost.");return r}Jt(e){return this._instance.config.disable_capture_url_hashes?ae(e):e}Yt(e,t){void 0===t&&(t=!1);var r=t?ae(e):this.Jt(e),i=this._instance.config.mask_personal_data_properties?[...Ti,...this._instance.config.custom_personal_data_properties||[]]:[];return this.Kt(function(e,t,r){if(!e||!t||!t.length)return e;for(var i=e.split("#"),n=i[1],a=(i[0]||"").split("?"),o=a[1],s=a[0],u=(o||"").split("&"),l=[],h=0;u.length>h;h++){var c=u[h].split("=");w(c)&&(t.includes(c[0])?l.push(c[0]+"=<masked>"):l.push(u[h]))}var d=s;return null!=o&&(d+="?"+l.join("&")),null!=n&&(d+="#"+n),d}(r,i))}Kt(e){var t=this._instance.config.session_recording;if(t.maskCapturedNetworkRequestFn){var r,i=t.maskCapturedNetworkRequestFn({name:e});return null!==(r=null==i?void 0:i.name)&&void 0!==r?r:null==i?void 0:i.url}if(t.maskNetworkRequestFn){var n=t.maskNetworkRequestFn({url:e});return null==n?void 0:n.url}return e}Xt(e){try{return e.rrwebMethod(),!0}catch(t){return 10>this.We.length?this.We.push({enqueuedAt:e.enqueuedAt||Date.now(),attempt:e.attempt+1,rrwebMethod:e.rrwebMethod}):en.warn("could not emit queued rrweb event.",t,e),!1}}Ee(e,t){return this.Xt(rn((()=>an().addCustomEvent(e,t))))}er(){var e;return this.He&&!0===(null==(e=this._instance.config.session_recording)?void 0:e.captureJsonLd)&&!this.J.urlBlocked&&!0!==this.ze}tr(e){if(!this.er())return!1;try{var t=an();return!!t&&(t.addCustomEvent("$json_ld",e),this.er())}catch(e){return!1}}rr(e){void 0===e&&(e=!1),Promise.resolve().then((()=>{var t;return null==(t=this.ir)?void 0:t.scan(e)}))}nr(){try{if(this._instance.config.capture_pageview||!e)return;var t=new URL(e.location.href),r=this.Yt(t.origin+t.pathname+t.search);this.ar!==r&&(this.ar=r,this.Ee("$url_changed",{href:r}))}catch(e){}}sr(){if(this.We.length){var e=[...this.We];this.We=[],e.forEach((e=>{Date.now()-e.enqueuedAt>2e3||this.Xt(e)}))}}_e(){return this.Xt(rn((()=>an().takeFullSnapshot())))}get ur(){var e,t,r;if(null!=(e=this.qe)&&e.hasPendingTriggers(this.sessionId)&&!["sampled","active"].includes(this.status)){var i,n=null==(i=this._instance.config.session_recording)?void 0:i.trigger_pending_buffer_interval_millis;return I(n)&&Number.isFinite(n)&&n>=1e3&&36e5>=n?n:6e4}return null!==(t=null==(r=this._instance.config.session_recording)?void 0:r.full_snapshot_interval_millis)&&void 0!==t?t:3e5}lr(){if(this.hr&&clearInterval(this.hr),!0!==this.ze){var e=this.ur;e&&(this.hr=setInterval((()=>{this._e()}),e))}}Se(e){"event"===e&&this.cr(),!this.J.urlBlocked&&["sampled","active"].includes(this.status)&&this.lr()}dr(){var e;this.J.urlBlocked||(this.J.urlBlocked=!0,null==(e=this.ir)||e.scan(),clearInterval(this.hr),en.info("recording paused due to URL blocker"),this.Ee("recording paused",{reason:"url blocker"}))}vr(){var e;this.J.urlBlocked&&(null==(e=this.ir)||e.scan(),this.J.urlBlocked=!1,this._e(),this.rr(),this.lr(),this.Ee("recording resumed",{reason:"left blocked url"}),en.info("recording resumed"))}pr(e,t){var r;if("event"===e&&this.cr(),!this.Ue&&null!=(r=this.qe)&&r.hasPendingTriggers(this.sessionId)){this.Ue=!0;try{var i,n;null==(i=this._instance.persistence)||i.register({["url"===e?qt:jt]:this.sessionId}),null==(n=this.qe)||n.updateActiveTriggers(this.sessionId),this.Se(),this.Nt(),this.ke(e+"_trigger_matched",{["url"===e?"matchedUrl":"matchedEvent"]:t})}finally{this.Ue=!1}}}get isStarted(){return!!this.Be}get Fe(){var e=this._instance.get_property(Rt);if(e){var t;try{t=_(e)?e:JSON.parse(e)}catch(e){return void en.warn("persisted remote config for session recording is invalid and will be ignored",e)}if(!this.isStarted){var r,i,n=null!==(r=t.cache_timestamp)&&void 0!==r?r:Date.now();if(Date.now()-n>36e5)return en.info("persisted remote config for session recording is stale and will be ignored",{cacheTimestamp:n,persistedConfig:e}),void(null==(i=this._instance.persistence)||i.unregister(Rt))}return t}}gr(e,t,r){this._instance.get_property(e)&&(t(),r())}start(t){var r,n,a=this.Fe;if(a){this.isStarted||(this.Je=!1!==this.ze&&!this.Xe,this.Xe=!1,this.Ye=this.Je,this.Ke=!1),this.bt&&(this.mr(),this.qt());var o=this.Oe.checkAndGetSessionAndWindowId(),s=o.windowId;this.Le=o.sessionId,this.Ct=s,null==(r=this._instance.persistence)||r.unregister(Ut),null!=a&&a.endpoint&&(this.je=null==a?void 0:a.endpoint),this.qe=2===(null==a?void 0:a.version)&&(null==a?void 0:a.triggerGroups)&&a.triggerGroups.length>0?new Mi(this._instance,this.J,this.ke.bind(this),this.Ee.bind(this),this.Se.bind(this)):new Ci(this._instance,this.J,this.Y,this.K,this.ke.bind(this),this._e.bind(this),this.Se.bind(this)),this.qe.onRemoteConfig(a),null==(n=this.Ce)||n.call(this),this.Ce=this.qe.setupEventTriggerListeners(this._instance.on.bind(this._instance,"eventCaptured"),this.sessionId,((e,t)=>this.pr(e,t))),this.gr(Lt,(()=>{this.overrideSampling()}),(()=>{var e;return null==(e=this._instance.persistence)?void 0:e.unregister(Lt)})),this.gr(Ot,(()=>{this.overrideLinkedFlag()}),(()=>{var e;return null==(e=this._instance.persistence)?void 0:e.unregister(Ot)})),this.gr(Dt,(()=>{this.overrideTrigger("event")}),(()=>{var e;return null==(e=this._instance.persistence)?void 0:e.unregister(Dt)})),this.gr(Pt,(()=>{this.overrideTrigger("url")}),(()=>{var e;return null==(e=this._instance.persistence)?void 0:e.unregister(Pt)})),this.qe.makeSamplingDecisions(this.sessionId),this.yr(),this.et||(Ne(e,"beforeunload",this.Pt),Ne(e,"pagehide",this.jt),Ne(e,"offline",this.Bt),Ne(e,"online",this.Ht),Ne(i,"visibilitychange",this.$t),!this.kt&&k(this.Oe.onSessionId)&&(this.kt=this.Oe.onSessionId(this.xt)),!this._t&&k(this.Oe.on)?this._t=this.Oe.on("forcedIdleReset",(()=>{this.Tt(),this.ze="unknown",this.stop(),this.St=this.Oe.onSessionId(((e,t,r)=>{var i;null==(i=this.St)||i.call(this),this.St=void 0,this.xt(e,t,r)}))})):k(this.Oe.on)||en.warn("bundled core has no SessionIdManager.on (requires posthog-js >= 1.268.6); recording will start but skip forced-idle-reset handling"),T(this.wt)&&(this.wt=this._instance.on("eventCaptured",(e=>{try{if("$pageview"===e.event){var t=null!=e&&e.properties.$current_url?this.Yt(e.properties.$current_url):"";if(!t)return;this.Ee("$pageview",{href:t})}}catch(e){en.error("Could not add $pageview to rrweb session",e)}}))),this.status===Jt&&this.ke(t||"recording_initialized"))}else en.info("remote config must be stored in persistence before recording can start")}br(){var t,r,n,a,o,s;null==e||e.removeEventListener("beforeunload",this.Pt),null==e||e.removeEventListener("pagehide",this.jt),null==e||e.removeEventListener("offline",this.Bt),null==e||e.removeEventListener("online",this.Ht),null==i||i.removeEventListener("visibilitychange",this.$t),clearInterval(this.hr),this.wr(),null==(t=this.wt)||t.call(this),this.wt=void 0,null==(r=this.Ce)||r.call(this),this.Ce=void 0,null==(n=this.kt)||n.call(this),this.kt=void 0,null==(a=this._t)||a.call(this),this._t=void 0,null==(o=this.St)||o.call(this),this.St=void 0,null==(s=this.qe)||s.stop(),this.kr(),this.mr()}mr(){this.yt+=1,this.vt=[],this.ft=0,this._r=void 0,this.bt=!1}kr(){var e,t,r;null==(e=this.Sr)||e.stop(),this.We=[],null==(t=this.ir)||t.stop(),this.ir=void 0,this.He=!1,null==(r=this.Be)||r.call(this),this.Be=void 0}Cr(){if(!this._r||0===this.ft)return!1;if(this.bt)return!0;this.bt=!0;var e=this.yt;return this.wr(),this.kr(),this._r.catch((()=>{})).then((()=>{e===this.yt&&(this.bt=!1,this.Nt(),this.qt(),this.br(),en.info("stopped"))})).catch((()=>{this.bt=!1,this.br(),en.info("stopped")})),!0}stop(){this.kr(),this.Cr()||(this.Nt(),this.qt(),this.br(),en.info("stopped"))}It(e){var t;this.stop(),this.Mr=void 0,this.Tr=void 0,this.Ze=0,this.Ge=0,this.Qe=0,null==(t=nn())||null==t.resetSnapshotCostState||t.resetSnapshotCostState(),this.start("session_id_changed"),this.Je=e,this.Ye=!1}cr(){this.isStarted||(this.Xe=!0),this.Je&&(this.Je=!1,this.Ye=!1,this.Ke&&(this.Ke=!1,this._e()),this.Ir())}discard(){this.qt(),this.br(),en.info("discarded")}Er(e,t,r,i,n){var a={$snapshot_bytes:r,$snapshot_data:t,$session_id:i,$window_id:n};this.status!==Gt?(this.Rr(e,i),this.Ar(a)):this.qt()}Lr(){try{this.Or()}catch(e){this.it||(this.it=!0,en.error("could not track full snapshot cost",e))}}Or(){var e,t=null==(e=nn())||null==e.getLastSnapshotCost?void 0:e.getLastSnapshotCost();t&&t!==this.Tr&&(this.Tr=t,this.Mr&&this.Mr.durationMs>=t.durationMs||(this.Mr=t),500>t.durationMs||en.warn("full snapshot was slow, the page may have been unresponsive while it ran",{durationMs:Math.round(t.durationMs),stylesheetMs:Math.round(t.stylesheetMs),nodeCount:t.nodeCount,cssRuleCount:t.cssRuleCount,nonDeferrableCssRuleCount:t.nonDeferrableCssRuleCount,deferredStylesheetCount:t.deferredStylesheetCount}))}Rr(e,t){e.type!==c.FullSnapshot?e.type===c.IncrementalSnapshot&&(S(this.ct)||this.ct===t||this.dt===t||(this.dt=t,en.info("incremental snapshot for a session with no full snapshot - requesting one",{sessionId:t}),this._e())):this.ct=t}Pr(e){e.counted&&e.generation===this.yt&&(this.ft=Math.max(0,this.ft-1)),e.counted=!1,this.vt=this.vt.filter((t=>t!==e))}Dr(e,t,r){e.processed||e.generation!==this.yt||(e.processed=!0,this.Er(e.event,t,r,e.targetSessionId,e.targetWindowId))}Fr(e){try{var t=e.compressionEnabled?bn(e.event):{event:e.event,size:br(e.event)};this.Dr(e,t.event,t.size)}finally{this.Pr(e)}}Ft(){[...this.vt].forEach((e=>{this.Fr(e)}))}Nr(e,t,r,i){var n=this,a={event:e,compressionEnabled:t,targetSessionId:r,targetWindowId:i,generation:this.yt,processed:!1,counted:!0};this.vt.push(a),this.ft+=1;var o=function(){var r=l((function*(){try{if(a.processed)return;var r,i;try{var o=t?pn(e)?yield function(e){return wn.apply(this,arguments)}(e):bn(e):{event:e,size:br(e)};r=o.event,i=o.size}catch(t){en.error("could not process queued compression event - will use uncompressed event",t),r=e,i=br(e)}n.Dr(a,r,i)}finally{n.Pr(a)}}));return function(){return r.apply(this,arguments)}}();this._r=this._r?this._r.catch((()=>{})).then(o):o()}onRRwebEmit(e){var t,r,i,n,a,o,s,u,l;if(this._instance.sessionManager&&(this.sr(),e&&_(e))){if(e.type===c.Meta){var h=this.Yt(e.data.href);if(this.ar=h,!h)return;e.data.href=h}else this.nr();if(null==(t=this.qe)||t.checkUrlTriggers(this.sessionId,(()=>this.dr()),(()=>this.vr()),((e,t)=>this.pr(e,t))),!this.J.urlBlocked||function(e){return e.type===c.Custom&&"recording paused"===e.data.tag}(e)){var v,f,p;e.type===c.FullSnapshot&&(null!=(v=nn())&&null!=v.wasMaxDepthReached&&v.wasMaxDepthReached()&&(this.rt=!0),this.Lr(),Promise.resolve().then((()=>this.Lr())),this.lr(),null==(f=this.Sr)||f.reset(),null==(p=this._instance.persistence)||p.register_once({[Ut]:e.timestamp},void 0));var g=e.type===c.FullSnapshot&&(null==(r=this.qe)?void 0:r.hasPendingTriggers(this.sessionId));g&&this.qr();var m=this.Sr?this.Sr.throttleMutations(e):e;if(m){var y=function(e){var t=e;if(t&&_(t)&&6===t.type&&_(t.data)&&"rrweb/console@1"===t.data.plugin){t.data.payload.payload.length>10&&(t.data.payload.payload=t.data.payload.payload.slice(0,10),t.data.payload.payload.push("...[truncated]"));for(var r=[],i=0;t.data.payload.payload.length>i;i++)r.push(t.data.payload.payload[i]&&t.data.payload.payload[i].length>2e3?t.data.payload.payload[i].slice(0,2e3)+"...[truncated]":t.data.payload.payload[i]);return t.data.payload.payload=r,e}return e}(m),b=function(e){return Sn(e)?e.data.payload:null}(y),w=function(e){return xn(e)?e.data.payload:null}(y),k=function(e){return _n(e)?e.data.payload:null}(y);b||w?null!=b&&b.lastActivityTimestamp&&(y.timestamp=b.lastActivityTimestamp):null!=k&&k.sessionId||this.jr(y),e.type===c.FullSnapshot&&(this.ht.push([this.Le,e.timestamp]),this.ht.length>6&&(this.ht=this.ht.slice(-6)));var S=null!==(i=null!==(n=null!==(a=null==b?void 0:b.currentSessionId)&&void 0!==a?a:null==w?void 0:w.nextSessionId)&&void 0!==n?n:null==k?void 0:k.sessionId)&&void 0!==i?i:this.Le,x=null!==(o=null!==(s=null!==(u=null==b?void 0:b.currentWindowId)&&void 0!==u?u:null==w?void 0:w.nextWindowId)&&void 0!==s?s:null==k?void 0:k.windowId)&&void 0!==o?o:this.Ct;if(!0!==this.ze||function(e){return _n(e)||Sn(e)||xn(e)}(y)){y.type===c.FullSnapshot&&(this.Ve=0),k&&(y.timestamp=k.lastActivityTimestamp+k.threshold);var C=this.He;this.He=!0,g?this.rr(!0):C||this.rr();var M=null===(l=this._instance.config.session_recording.compress_events)||void 0===l||l;if(this.ft>0||M&&pn(y))this.Nr(y,M,S,x);else{var T=M?bn(y):{event:y,size:br(y)};this.Er(y,T.event,T.size,S,x)}}else(function(e){return e.type===c.FullSnapshot||e.type===c.Meta||e.type===c.IncrementalSnapshot&&e.data.source!==d.CanvasMutation})(y)&&this.Ve++}else!0===this.ze&&this.Ve++}}}get status(){return this.qe?this.qe.getStatus({instance:this._instance,sessionId:this.sessionId,isSampled:this.De,rrwebError:this.et,urlTriggerMatching:this.J,eventTriggerMatching:this.Y,linkedFlagMatching:this.K,remoteConfig:this.Fe}):Gt}log(e,t){var r;void 0===t&&(t="log"),null==(r=this._instance.sessionRecording)||r.onRRwebEmit({type:6,data:{plugin:"rrweb/console@1",payload:{level:t,trace:[],payload:[JSON.stringify(e)]}},timestamp:Date.now()})}overrideLinkedFlag(){this.K.linkedFlagSeen=!0,this._e(),this.cr(),this.ke("linked_flag_overridden")}overrideSampling(){var e;null==(e=this._instance.persistence)||e.register({[Ft]:this.sessionId,[At]:null}),this._e(),this.cr(),this.ke("sampling_overridden")}overrideTrigger(e){this.pr(e),this.cr()}Br(){try{var t,r=null==e||null==(t=e.location)?void 0:t.href;if(!r)return;var i=this.Yt(r);if(!i)return;return new URL(i).hostname||void 0}catch(e){return}}wr(){this.Hr&&(clearTimeout(this.Hr),this.Hr=void 0)}Ir(){this.Hr||(this.Hr=setTimeout((()=>{this.Nt()}),2e3))}$r(){return this.ct!==this.At.sessionId&&0!==this.At.data.length&&this.At.data.every((e=>(null==e?void 0:e.type)===c.Custom&&!Sn(e)&&!xn(e)))}Ur(){var e,t;return null!==(e=null==(t=this.qe)?void 0:t.getPendingTriggerConditions(this.sessionId))&&void 0!==e?e:[]}Wr(e){if(e!==Yt)return S(this.zr)||this._instance.register_for_session({[Vt]:[]}),void(this.zr=void 0);var t=this.Ur();if(0===t.length)return S(this.zr)||this._instance.register_for_session({[Vt]:[]}),void(this.zr=void 0);var r=t.join(", "),i=this.sessionId+":"+r;i!==this.zr&&(this.zr=i,this._instance.register_for_session({[Vt]:t}),en.info("buffering: "+r))}Nt(){var e;if(this.wr(),this.Je)return this.At;if(this.$r())return this.At.size>Ki?this.qt():this.At;var t=this.At;null==(e=this.qe)||e.ensureSamplingDecision(this.sessionId);var r=this.Lt(),i=this.status;if(this.Wr(i),i===Yt||i===Kt||i===Gt||r)return this.Ir(),this.At;if(this.At!==t)return this.At;if(t.data.length>0){var n,a=this.Br();kr(t).forEach((e=>{var t;null==(t=this.Mt)||t.trackSize(e.sessionId,e.size),this.Vr({$snapshot_bytes:e.size,$snapshot_data:e.data,$session_id:e.sessionId,$window_id:e.windowId,$lib:Re.LIB_NAME,$lib_version:Re.LIB_VERSION,$snapshot_host:a})})),null==(n=this.qe)||n.onFlushComplete()}return this.qt()}Ar(e){var t,r=2+((null==(t=this.At)?void 0:t.data.length)||0),i=e.$session_id,n=this.At.sessionId!==i;if(n||!0!==this.ze&&!this.Je&&this.At.size+e.$snapshot_bytes+r>Ki){var a=this.Le;if(this.At=this.Nt(),this.Le!==a)return;n&&this.At.data.length>0&&(this.At=this.qt()),this.At.sessionId=i,this.At.windowId=e.$window_id}this.Je&&(this.Ke||this.At.size+e.$snapshot_bytes+r>Ki)?this.Ke||(this.Ke=!0,this.At=this.qt()):(this.At.size+=e.$snapshot_bytes,this.At.data.push(e.$snapshot_data),this.At.sizes.push(e.$snapshot_bytes),!0===this.ze||this.Je||this.Ir())}Vr(e){this._instance.capture("$snapshot",e,{_url:this._instance.requestRouter.endpointFor("api",this.je),_noTruncate:!0,_batchKey:"recordings",skip_client_rate_limiting:!0})}get Ot(){var e,t,r=null==(e=this.At)?void 0:e.data[(null==(t=this.At)?void 0:t.data.length)-1],i=this.Oe.checkAndGetSessionAndWindowId(!0);return r?r.timestamp-i.sessionStartTimestamp:null}qr(){if(!this.At||0===this.At.data.length)return this.qt();for(var e=-1,t=this.At.data.length-1;t>=0;t--)if(this.At.data[t].type===c.Meta){e=t;break}return 0>e?this.qt():(this.At.data=this.At.data.slice(e),this.At.sizes=this.At.sizes.slice(e),this.At.size=this.At.sizes.reduce(((e,t)=>e+t),0),this.At)}qt(){return this.At={size:0,data:[],sizes:[],sessionId:this.Le,windowId:this.Ct},this.At}ke(e,t){this._instance.register_for_session({$session_recording_start_reason:e}),en.info(e.replace("_"," "),t),"session_id_changed"!==e&&this.Ee("$recording_started",h({reason:e},t))}Zr(e){var t;return 3===e.type&&-1!==tn.indexOf(null==(t=e.data)?void 0:t.source)}jr(e){var t=this.Zr(e);t||!0===this.ze||e.timestamp-this.$e>this.Pe&&(this.ze=!0,clearInterval(this.hr),this.Ee("sessionIdle",{eventTimestamp:e.timestamp,lastActivityTimestamp:this.$e,threshold:this.Pe,bufferLength:this.At.data.length,bufferSize:this.At.size,sessionId:this.Le,windowId:this.Ct}),this.Nt());var r=!1;if(t&&(this.$e=e.timestamp,this.ze)){var i="unknown"===this.ze;this.ze=!1,i||(this.Ee("sessionNoLongerIdle",{reason:"user activity",type:e.type}),r=!0)}var n=this.Oe.checkAndGetSessionAndWindowId(!t,e.timestamp),a=n.windowId,o=n.sessionId,s=this.Le!==o,u=this.Ct!==a;if(this.Ct=a,this.Le=o,s||u){var l=s&&!1!==this.ze;l&&(this.ze="unknown"),this.It(l)}else if(t&&this.cr(),r){var h,c=["sampled","active"].includes(this.status)||(null==(h=this.qe)?void 0:h.hasPendingTriggers(this.sessionId));this.Ve>0&&c&&this._e(),this.rr(),this.lr()}}Tt(){var e;null==(e=this.qe)||e.clearConditionalRecordingPersistence()}get sdkDebugProperties(){var e,t,r,i,n,a,o,s,u,l=this.Oe.checkAndGetSessionAndWindowId(!0).sessionStartTimestamp,h=null==(e=nn())||null==e.getDeferredStylesheetStats?void 0:e.getDeferredStylesheetStats();return{$recording_status:this.status,$sdk_debug_replay_internal_buffer_length:this.At.data.length,$sdk_debug_replay_internal_buffer_size:this.At.size,$sdk_debug_current_session_duration:this.Ot,$sdk_debug_session_start:l,$sdk_debug_replay_flushed_size:null==(t=this.Mt)?void 0:t.currentTrackedSize(this.sessionId),$sdk_debug_replay_full_snapshots:this.ht,$snapshot_max_depth_exceeded:this.rt,$sdk_debug_replay_slowest_full_snapshot_ms:Gi(null==(r=this.Mr)?void 0:r.durationMs),$sdk_debug_replay_slowest_full_snapshot_stylesheet_ms:Gi(null==(i=this.Mr)?void 0:i.stylesheetMs),$sdk_debug_replay_slowest_full_snapshot_nodes:null==(n=this.Mr)?void 0:n.nodeCount,$sdk_debug_replay_slowest_full_snapshot_css_rules:null==(a=this.Mr)?void 0:a.cssRuleCount,$sdk_debug_replay_slowest_full_snapshot_css_rules_non_deferrable:null==(o=this.Mr)?void 0:o.nonDeferrableCssRuleCount,$sdk_debug_replay_deferred_stylesheets:null==h?void 0:h.deferredCount,$sdk_debug_replay_deferred_stylesheets_failed:null==h?void 0:h.failedCount,$sdk_debug_replay_deferred_stylesheets_abandoned:null==h?void 0:h.abandonedCount,$sdk_debug_replay_deferred_stylesheet_ms:Gi(null==h?void 0:h.totalMs),$sdk_debug_replay_deferred_stylesheet_slowest_slice_ms:Gi(null==h?void 0:h.slowestSliceMs),$sdk_debug_replay_slowest_mutation_batch_ms:Gi(null==(s=nn())||null==s.getMutationCost||null==(s=s.getMutationCost())?void 0:s.slowestBatchMs),$sdk_debug_replay_discarded_duration_samples:null==(u=nn())||null==u.getDiscardedDurationSamples?void 0:u.getDiscardedDurationSamples(),$sdk_debug_replay_throttled_mutations_dropped:this.Ze,$sdk_debug_replay_oversized_mutations_dropped:this.Ge,$sdk_debug_replay_oversized_mutation_bytes_dropped:this.Qe,$sdk_debug_replay_rrweb_error:this.et,$sdk_debug_rrweb_attached:!!this.Be,$sdk_debug_rrweb_start_attempted:this.tt}}yr(){var t;if(!this.Be){this.tt=!0;var r,n,a,o,s={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},u=this._instance.config.session_recording;for(var l of Object.entries(u||{})){var c=l[0],d=l[1];if(c in s)if("maskInputOptions"===c)s.maskInputOptions=h({password:!0},d);else if("sampling"===c){var v=null!=d?d:{},f={};S(v.mousemove)||(f.mousemove=v.mousemove),S(v.mouseInteraction)||(f.mouseInteraction=v.mouseInteraction),s.sampling=f}else s[c]=d}!0===(null==u?void 0:u.captureJsonLd)&&!0!==s.slimDOMOptions&&"all"!==s.slimDOMOptions&&(s.slimDOMOptions=h({},s.slimDOMOptions,{script:!0})),this.Vt&&this.Vt.enabled&&(s.recordCanvas=!0,s.sampling=h({},s.sampling,{canvas:this.Vt.fps}),s.dataURLOptions={type:"image/webp",quality:this.Vt.quality},s.canvasResolutionScale=this.zt,s.canvasMasking={configured:()=>{var e;return k(null==(e=this._instance.config.session_recording)||null==(e=e.canvasCapture)?void 0:e.maskRegionsFn)},regionsFn:e=>{var t,r=null==(t=this._instance.config.session_recording)||null==(t=t.canvasCapture)?void 0:t.maskRegionsFn;if(k(r))try{var i;return null!==(i=r(e))&&void 0!==i?i:null}catch(e){return this.st||(this.st=!0,en.warn("canvasCapture.maskRegionsFn threw, canvas frames will be skipped",e)),null}}}),this.Ut&&(s.maskAllInputs=null===(r=this.Ut.maskAllInputs)||void 0===r||r,s.maskTextSelector=null!==(n=this.Ut.maskTextSelector)&&void 0!==n?n:void 0,s.blockSelector=null!==(a=this.Ut.blockSelector)&&void 0!==a?a:void 0,s.maskAllElementAttributes=null!==(o=this.Ut.maskAllElementAttributes)&&void 0!==o&&o),s.maskAllElementAttributes&&s.maskAttributeFn&&(s.maskAttributeFn=void 0,this.ot||(this.ot=!0,en.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.Wt();var p=an();if(p){this.Sr=null!==(t=this.Sr)&&void 0!==t?t:new ni(p,{refillRate:this._instance.config.session_recording.__mutationThrottlerRefillRate,bucketSize:this._instance.config.session_recording.__mutationThrottlerBucketSize,onBlockedNode:(e,t)=>{var r="Too many mutations on node '"+e+"'. Rate limiting. This could be due to SVG animations or something similar";en.info(r,{node:t}),this.log(Xi+" "+r,"warn")},onDroppedAttributeMutations:e=>this.Ze+=e,bytesRefillRate:this._instance.config.session_recording.__mutationBytesRefillRate,bytesBucketSize:this._instance.config.session_recording.__mutationBytesBucketSize,resyncIntervalMs:this.ur,onDroppedOversizedMutation:e=>{0===this.Ge&&this.log(Xi+" Dropped an oversized DOM mutation to keep the recording playable. The recording will resync with a full snapshot.","warn"),this.Ge+=1,this.Qe+=e},requestFullSnapshot:()=>this._e()});var g=this.Qt();if(this.Be=p(h({emit:e=>{this.onRRwebEmit(e)},plugins:g,errorHandler:(e,t)=>"rrweb"===t&&(this.ut||(this.ut=!0,en.error("rrweb internal error - recording will continue but may be incomplete",e)),!0)},s)),!this.Be)return this.et=!0,void en.error("rrweb failed to start - Loss of recording data is possible. Check the browser console for rrweb errors.");this.et=!1,!0===(null==u?void 0:u.captureJsonLd)&&i&&null!=e&&e.MutationObserver&&!this.ir&&(this.ir=function(e,t,r){var i=new WeakMap,n=r.getCaptureState||(()=>!0),a=Ii,o=t=>{try{var o=n();if(!a||!1===o||!t.isConnected||t.ownerDocument!==e||function(e,t){for(var r=e;r;){if(Vi(r,t.blockClass,t.blockSelector)||Vi(r,t.maskTextClass,t.maskTextSelector))return!0;var i=r.parentNode;r=r.parentElement||(i&&i.nodeType===i.DOCUMENT_FRAGMENT_NODE?i.host:null)}return!1}(t,r))return;var s=function(e){if(!e||e.length>Ii)return null;try{var t=JSON.parse(e),r=w(t)?t.map(Wi):Wi(t);if(M(r)||w(r)&&(!r.length||r.some(M)))return null;var i=JSON.stringify(r);return i.length>2e4?null:[r,i]}catch(e){return null}}(t.text);if(!s)return void i.delete(t);var u=s[0],l=s[1];if(M(o))return void i.set(t,l);if(i.get(t)!==l){if(l.length>a)return void(a=0);r.emit(u)&&(i.set(t,l),a-=l.length)}}catch(e){return}};try{var s=new t((e=>{try{if(!a||!1===n())return;var t=e=>{for(var t of Zi(e))o(t)};for(var r of e)if("childList"===r.type)zi(r.target)&&o(r.target),r.addedNodes.forEach(t);else if("characterData"===r.type){var i=r.target.parentNode;i&&zi(i)&&o(i)}else"attributes"===r.type&&zi(r.target)&&o(r.target)}catch(e){return}}));return s.observe(e,{attributes:!0,attributeFilter:["type"],characterData:!0,childList:!0,subtree:!0}),{scan(t){void 0===t&&(t=!1),a&&!1!==n()&&Zi(e.documentElement).forEach((e=>{t&&i.delete(e),o(e)}))},stop(){return s.disconnect()}}}catch(e){return{scan(){},stop(){}}}}(i,e.MutationObserver,{blockClass:s.blockClass,blockSelector:s.blockSelector,maskTextClass:s.maskTextClass,maskTextSelector:s.maskTextSelector,getCaptureState:()=>{var e;return!0!==(null==(e=this._instance.config.session_recording)?void 0:e.captureJsonLd)||this.J.urlBlocked||this.J.isCurrentUrlBlocked()?null:this.er()},emit:e=>this.tr(e)}),this.J.isCurrentUrlBlocked()&&this.ir.scan()),this.$e=Date.now(),this.ze=E(this.ze)?this.ze:"unknown",this.tryAddCustomEvent("$remote_config_received",this.Fe),this.Ee("$session_options",{sessionRecordingOptions:s,activePlugins:g.map((e=>null==e?void 0:e.name))}),this.Ee("$posthog_config",{config:this._instance.config})}else en.error("_startRecorder was called but rrwebRecord is not available. This indicates something has gone wrong.")}}tryAddCustomEvent(e,t){return this.Ee(e,t)}}var Mn,Tn=["type"],In=Object.defineProperty,En=(e,t,r)=>((e,t,r)=>t in e?In(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),Rn=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(Rn||{}),An=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(An||{}),Ln=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(Ln||{}),On=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(On||{}),Pn=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(Pn||{}),Dn=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e[e.RateChange=4]="RateChange",e))(Dn||{}),Fn=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(Fn||{});function Nn(e,t){return-1!==e.indexOf(t)}var qn={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot"],MutationObserver:[]},jn={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:["querySelector","querySelectorAll"],MutationObserver:["constructor"]},Bn={};function Hn(e){if(Bn[e])return Bn[e];var t=function(e){var t,r,i=null==(r=null==(t=null==globalThis?void 0:globalThis.Zone)?void 0:t.__symbol__)?void 0:r.call(t,e);return i&&globalThis[i]?globalThis[i]:void 0}(e)||globalThis[e],r=t.prototype,i=e in qn?qn[e]:void 0,n=Boolean(i&&i.every((e=>{var t,i;return Boolean(null==(i=null==(t=Object.getOwnPropertyDescriptor(r,e))?void 0:t.get)?void 0:i.toString().includes("[native code]"))}))),a=e in jn?jn[e]:void 0,o=Boolean(a&&a.every((e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))})));if(n&&o)return Bn[e]=t.prototype,t.prototype;var s=document.createElement("iframe");s.style.display="none";var u=!1;try{document.body.appendChild(s);var l=s.contentWindow;if(!l)return t.prototype;var h=l[e].prototype;return h?(function(e){return Nn(e,"AppleWebKit")&&!Nn(e,"Chrome")}(navigator.userAgent)&&(s.classList.add("rr-block","ph-no-capture"),s.setAttribute("__rrwebUntaintedPrototype",e),u=!0),Bn[e]=h):r}catch(e){return r}finally{!u&&s.parentNode&&document.body.removeChild(s)}}var $n={};function Un(e,t,r){var i,n=e+"."+String(r);if($n[n])return $n[n].call(t);var a=Hn(e),o=null==(i=Object.getOwnPropertyDescriptor(a,r))?void 0:i.get;return o?($n[n]=o,o.call(t)):t[r]}var Wn={};function zn(e,t,r){var i=e+"."+String(r);if(Wn[i])return Wn[i].bind(t);var n=Hn(e)[r];return"function"!=typeof n?t[r]:(Wn[i]=n,n.bind(t))}function Vn(){return Hn("MutationObserver").constructor}function Zn(e,t,r){try{if(!(t in e))return()=>{};var i=e[t],n={next:i},a=r((function(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];return n.next.apply(this,t)}));return"function"==typeof a&&(a.prototype=a.prototype||{},Object.defineProperties(a,{__rrweb_original__:{enumerable:!1,value:i},__rrweb_layer__:{enumerable:!1,value:n}})),e[t]=a,()=>{if(e[t]!==a)for(var r=e=>{var t;return"function"==typeof e?null!==(t=e.__rrweb_layer__)&&void 0!==t?t:e.__posthog_layer__:void 0},i=e[t],o=r(i);o;){if(o.next===a)return void(o.next=n.next);o=r(i=o.next)}else e[t]=n.next}}catch(e){return()=>{}}}var Gn={childNodes:e=>Un("Node",e,"childNodes"),parentNode:e=>Un("Node",e,"parentNode"),parentElement:e=>Un("Node",e,"parentElement"),textContent:e=>Un("Node",e,"textContent"),contains:(e,t)=>zn("Node",e,"contains")(t),getRootNode:e=>zn("Node",e,"getRootNode")(),host:e=>e&&"host"in e?Un("ShadowRoot",e,"host"):null,styleSheets:e=>e.styleSheets,shadowRoot:e=>e&&"shadowRoot"in e?Un("Element",e,"shadowRoot"):null,querySelector:(e,t)=>zn("Element",e,"querySelector")(t),querySelectorAll:(e,t)=>zn("Element",e,"querySelectorAll")(t),mutationObserver:Vn,patch:Zn},Qn=()=>({durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0});function Jn(){try{if("undefined"!=typeof performance&&performance.now)return performance.now()}catch(e){}return Date.now()}var Yn=0,Kn=6e4;function Xn(){Yn+=1}function ea(){return Yn}function ta(e,t){return t!==Yn||e>Kn}var ra=0,ia=0,na=0,aa=Qn(),oa=null,sa=null,ua=[],la=0,ha=0,ca={slowestBatchMs:0},da={deferredCount:0,failedCount:0,abandonedCount:0,totalMs:0,slowestSliceMs:0},va=e=>e&&e>0?e:null;function fa(e){(ra+=1)>1||(aa=Qn(),ua=[],la=0,sa=va(e),ia=Jn(),na=Yn)}function pa(){return 0===ra?oa||Qn():(ra-=1)>0?aa:(aa.durationMs=Jn()-ia,aa.deferredStylesheetCount=la,da.deferredCount+=la,sa=null,ta(aa.durationMs,na)?aa:oa=aa)}var ga=32;function ma(e,t,r){var i=e.length;if(r>=ga)return i;for(var n=0;e.length>n;n++){var a=e[n];try{var o=a.cssRules;if(o&&o.length)i+=ma(o,t,r+1);else if(t&&a.styleSheet){var s=a.styleSheet;if(!t.has(s)){t.add(s);var u=s.rules||s.cssRules;u&&(i+=ma(u,t,r+1))}}}catch(e){}}return i}function ya(e){if(0!==ra){var t=ma(e,null,0);aa.cssRuleCount+=t,ha>0&&(aa.nonDeferrableCssRuleCount+=t)}}function ba(e){ha+=1;try{return e()}finally{ha-=1}}function wa(e){ra>0&&(aa.stylesheetMs+=e)}function ka(e){if(0===ra||null===sa)return!1;var t=aa.cssRuleCount-aa.nonDeferrableCssRuleCount;return t>=sa||t+function(e){try{var t=e&&(e.rules||e.cssRules);if(!t)return 0;var r=new WeakSet;return r.add(e),ma(t,r,0)}catch(e){return 0}}(e)>sa}function _a(){da.failedCount+=1}function Sa(e){e>0&&(da.abandonedCount+=e)}function xa(e){return e.nodeType===e.ELEMENT_NODE}function Ca(e){var t=e&&"host"in e&&"mode"in e&&Gn.host(e)||null;return Boolean(t&&"shadowRoot"in t&&Gn.shadowRoot(t)===e)}function Ma(e){return"[object ShadowRoot]"==={}.toString.call(e)}function Ta(e){return e.includes(" background-clip: text;")&&!e.includes(" -webkit-background-clip: text;")&&(e=e.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),e}function Ia(e){var t=e.cssText;if(3>t.split('"').length)return t;var r=["@import","url("+JSON.stringify(e.href)+")"];return""===e.layerName?r.push("layer"):e.layerName&&r.push("layer("+e.layerName+")"),e.supportsText&&r.push("supports("+e.supportsText+")"),e.media.length&&r.push(e.media.mediaText),r.join(" ")+";"}var Ea=0;function Ra(e){var t=0===Ea,r=t?Jn():0;Ea+=1;try{var i=e.rules||e.cssRules;if(!i)return null;ya(i);var n=e.href;return!n&&e.ownerNode&&(n=e.ownerNode.baseURI),Ta(Array.from(i,(e=>Aa(e,n))).join(""))}catch(e){return null}finally{Ea-=1,t&&wa(Jn()-r)}}function Aa(e,t){var r;if(Oa(e)){var i;try{i=Ra(e.styleSheet)||Ia(e)}catch(t){i=e.cssText}try{if(i&&(null==(r=e.styleSheet)?void 0:r.href))return Qa(i,e.styleSheet.href)}catch(e){}return i}var n=e.cssText;return Pa(e)&&e.selectorText.includes(":")&&(n=La(n)),t?Qa(n,t):n}function La(e){return e.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")}function Oa(e){return"styleSheet"in e}function Pa(e){return"selectorText"in e}var Da=/^-?[A-Za-z_][\w-]*$/,Fa=/^-?[A-Za-z_][\w-]*(\.-?[A-Za-z_][\w-]*)*$/;function Na(e){var t=[],r=!1,i=null,n=new Map;function a(e){var n=t.pop();if("group"===n.kind){if(null===e){for(;t.length>0&&"group"===t[t.length-1].kind;)t.pop();return void a(null)}var s=t[t.length-1];return s.parts.push(e),void(s.index+=1)}if(!n.importRule)return r=!0,void(i=e);o(t[t.length-1],n.importRule,e)}function o(e,t,r){var i;try{var n;try{n=r||Ia(t)}catch(e){n=t.cssText}try{n&&(null==(i=t.styleSheet)?void 0:i.href)&&(n=Qa(n,t.styleSheet.href))}catch(e){}n&&e.parts.push(n),e.index+=1}catch(e){a(null)}}function s(e){var r=e.rules[e.index];if("sheet"===e.kind&&Oa(r)){var i=n.get(r);return null===i?(e.parts.push(r.cssText),void(e.index+=1)):i?void t.push({kind:"sheet",sheet:i.sheet,rules:i.rules,sheetHref:i.sheetHref,index:0,parts:[],importRule:r}):void o(e,r,null)}if(!function(e,r){try{var i=function(e){var t,r=e;if(!r.cssRules||0===r.cssRules.length)return null;if(r.media&&"string"==typeof r.media.mediaText)return"@media "+r.media.mediaText+" {";if(Pa(e)){if("number"==typeof r.type&&1!==r.type)return null;var i=r.style?r.style.cssText:"";return e.selectorText+" {"+(i?" "+i:"")}if("containerName"in r)return"string"!=typeof r.containerQuery||r.containerName&&!Da.test(r.containerName)?null:"@container "+(r.containerName?r.containerName+" ":"")+r.containerQuery+" {";if("string"==typeof r.conditionText){var n="";try{n=(null==(t=e.constructor)?void 0:t.name)||""}catch(e){return null}return""===n||"Object"===n||"CSSSupportsRule"===n?"@supports "+r.conditionText+" {":null}return"string"==typeof r.name?"keyText"in r.cssRules[0]?Da.test(r.name)?"@keyframes "+r.name+" {":null:""===r.name?"@layer {":Fa.test(r.name)?"@layer "+r.name+" {":null:null}(e);if(null===i)return!1;var n=r.sheetHref;return t.push({kind:"group",rules:Array.from(e.cssRules),sheetHref:n,index:0,parts:[],prelude:n?Qa(i,n):i,fixColons:"sheet"===r.kind&&Pa(e)&&e.selectorText.includes(":")}),!0}catch(e){return!1}}(r,e)){var a=r.cssText;"sheet"===e.kind&&Pa(r)&&r.selectorText.includes(":")&&(a=La(a)),e.parts.push(e.sheetHref?Qa(a,e.sheetHref):a),e.index+=1}}return function(e){try{var r=e.rules||e.cssRules;if(!r)return!1;ya(r);var i=e.href;!i&&e.ownerNode&&(i=e.ownerNode.baseURI);var a=Array.from(r);return t.push({kind:"sheet",sheet:e,rules:a,sheetHref:i,index:0,parts:[],importRule:null}),function(e,t){for(var r=[{sheet:t,rules:e,index:0}],i=function(){var e=r[r.length-1];if(e.index>=e.rules.length)return r.pop(),0;var t=e.rules[e.index];if(e.index+=1,!Oa(t)||n.has(t))return 0;var i=null;try{i=t.styleSheet}catch(e){return n.set(t,null),0}if(!i||r.some((e=>e.sheet===i)))return 0;try{var a=i.rules||i.cssRules;if(!a)return 0;ya(a);var o=i.href;!o&&i.ownerNode&&(o=i.ownerNode.baseURI);var s=Array.from(a);n.set(t,{sheet:i,rules:s,sheetHref:o}),r.push({sheet:i,rules:s,index:0})}catch(e){}};r.length>0;)i()}(a,e),!0}catch(e){return!1}}(e)||(r=!0),{advance(e){if(r)return!0;var n=Jn(),o=e>0?e:1;try{for(;!r&&o>0;){var u=t[t.length-1];if(u.rules.length>u.index){o-=1;try{s(u)}catch(e){a(null)}}else{var l=null;try{if("group"===u.kind){var h=u.prelude+u.parts.join("")+"}";l=u.fixColons?La(h):h}else l=Ta(u.parts.join(""))}catch(e){}a(l)}}}catch(e){r=!0,i=null}finally{wa(Jn()-n)}return r},text:()=>r?i:null,remainingRules(){if(r)return 0;var e=0;for(var i of t)e+=i.rules.length-i.index;return e}}}class qa{constructor(){En(this,"idNodeMap",new Map),En(this,"nodeMetaMap",new WeakMap)}getId(e){var t;if(!e)return-1;var r=null==(t=this.getMeta(e))?void 0:t.id;return null!=r?r:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){var t=this.getId(e);if(this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach((e=>this.removeNodeFromMap(e))),xa(e)){var r=Gn.shadowRoot(e);r&&this.removeNodeFromMap(r),"IFRAME"===e.nodeName&&e.contentDocument&&this.removeNodeFromMap(e.contentDocument)}}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){this.idNodeMap.set(t.id,e),this.nodeMetaMap.set(e,t)}replace(e,t){var r=this.getNode(e);if(r){var i=this.nodeMetaMap.get(r);i&&this.nodeMetaMap.set(t,i)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function ja(e){var t=e.element,r=e.maskInputOptions,i=e.tagName,n=e.type,a=e.maskInputFn,o=e.value||"",s=n&&Ba(n);return(r[i.toLowerCase()]||s&&r[s])&&(o=a?a(o,t):"*".repeat(o.length)),o}function Ba(e){return e.toLowerCase()}var Ha=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 $a(e){var t=e.element,r=e.name,i=e.value,n=e.maskAttributeFn,a=e.isGenerated;return i?e.maskAllElementAttributes?void 0!==a&&a&&Ha.has(Ba(r))?i:"*".repeat(i.length):n?n(r,i,t):i:i}var Ua="__rrweb_original__";function Wa(e){try{var t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?Ba(t):null}catch(e){return null}}var za=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,Va=/^(?:[a-z+]+:)?\/\//i,Za=/^www\..*/i,Ga=/^(data:)([^,]*),(.*)/i;function Qa(e,t){return(e||"").replace(za,((e,r,i,n,a,o)=>{var s,u=i||a||o,l=r||n||"";if(!u)return e;if(Va.test(u)||Za.test(u))return"url("+l+u+l+")";if(Ga.test(u))return"url("+l+u+l+")";if("/"===u[0])return"url("+l+(((s=t).indexOf("//")>-1?s.split("/").slice(0,3).join("/"):s.split("/")[0]).split("?")[0]+u)+l+")";var h=t.split("/"),c=u.split("/");for(var d of(h.pop(),c))"."!==d&&(".."===d?h.pop():h.push(d));return"url("+l+h.join("/")+l+")"}))}var Ja,Ya,Ka="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxkZWZzPgogICAgPHBhdHRlcm4gaWQ9InN0cmlwZXMiIHBhdHRlcm5Vbml0cz0idXNlclNwYWNlT25Vc2UiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+CiAgICAgIDxyZWN0IHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgZmlsbD0iYmxhY2siLz4KICAgICAgPHBhdGggZD0iTTggMEgxNkwwIDE2VjhMOCAwWiIgZmlsbD0iIzJEMkQyRCIvPgogICAgICA8cGF0aCBkPSJNMTYgOFYxNkg4TDE2IDhaIiBmaWxsPSIjMkQyRDJEIi8+CiAgICA8L3BhdHRlcm4+CiAgPC9kZWZzPgogIDxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjc3RyaXBlcykiLz4KPC9zdmc+Cg==",Xa=4096,eo=1e5,to=10,ro=new Map,io=1,no=new RegExp("[^a-z0-9-_:]"),ao=-2;function oo(){return io++}var so=/^[^ \t\n\r\u000c]+/,uo=/^[, \t\n\r\u000c]+/,lo=new WeakMap;function ho(e,t){return t&&""!==t.trim()?co(e,t):t}function co(e,t){var r=lo.get(e);if(r||(r=e.createElement("a"),lo.set(e,r)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return r.setAttribute("href",t),r.href}function vo(e,t){return(null==t?void 0:t.maxBase64ImageLength)?function(e,t){return t&&e.length>t?Ka:e}(e,t.maxBase64ImageLength):e}function fo(e,t,r,i,n,a){var o;if(!i)return i;if("src"===r||"href"===r&&("use"!==t||"#"!==i[0])){if("link"===t&&n){var s=null==(o=n.sheet)?void 0:o.href;if(s)return s}var u=ho(e,i);if(u.startsWith("data:")){if("img"===t&&n){var l=u;return((null==a?void 0:a.type)||void 0!==(null==a?void 0:a.quality))&&(l=function(e,t,r,i){if(eo>t.length)return t;if(!e.complete||0===e.naturalWidth)return t;if(e.naturalWidth>Xa||e.naturalHeight>Xa)return t;var n=ro.get(t);if(n&&n.type===r&&n.quality===i)return n.result;try{var a=document.createElement("canvas");a.width=e.naturalWidth,a.height=e.naturalHeight;var o=a.getContext("2d");if(!o)return t;o.drawImage(e,0,0);var s=a.toDataURL(r||"image/webp",null!=i?i:.4),u=t.length>s.length?s:t;if(ro.size>=to){var l=ro.keys().next().value;void 0!==l&&ro.delete(l)}return ro.set(t,{type:r,quality:i,result:u}),u}catch(e){return t}}(n,u,a.type,a.quality)),vo(l,a)}if("image"===t)return vo(u,a)}return u}if("xlink:href"===r&&"#"!==i[0]){var h=ho(e,i);return"image"===t&&h.startsWith("data:")?vo(h,a):h}return"background"!==r||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===r?function(e,t){if(""===t.trim())return t;var r=0;function i(e){var i,n=e.exec(t.substring(r));return n?(r+=(i=n[0]).length,i):""}for(var n=[];i(uo),t.length>r;){var a=i(so);if(","===a.slice(-1))a=ho(e,a.substring(0,a.length-1)),n.push(a);else{var o="";a=ho(e,a);for(var s=!1;;){var u=t.charAt(r);if(""===u){n.push((a+o).trim());break}if(s)")"===u&&(s=!1);else{if(","===u){r+=1,n.push((a+o).trim());break}"("===u&&(s=!0)}o+=u,r+=1}}}return n.join(", ")}(e,i):"style"===r?Qa(i,co(e)):"object"===t&&"data"===r?ho(e,i):i:ho(e,i)}function po(e,t,r){return("video"===e||"audio"===e)&&"autoplay"===t}function go(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&go(Gn.parentNode(e),t,r);for(var i=e.classList.length;i--;)if(t.test(e.classList[i]))return!0;return!!r&&go(Gn.parentNode(e),t,r)}function mo(e,t,r,i){var n;if(xa(e)){if(!Gn.childNodes(n=e).length)return!1}else{if(null===Gn.parentElement(e))return!1;n=Gn.parentElement(e)}try{if("string"==typeof t){if(i){if(n.closest("."+t))return!0}else if(n.classList.contains(t))return!0}else if(go(n,t,i))return!0;if(r)if(i){if(n.closest(r))return!0}else if(n.matches(r))return!0}catch(e){}return!1}function yo(e,t,r){var i=e.removeEventListener;"function"==typeof i&&i.call(e,t,r)}var bo=new Map;function wo(e,t){return Array.from(e.styleSheets).find((e=>e.href===t))}function ko(e){return null==e?"":e.toLowerCase()}var _o=50,So=!1,xo=!1;function Co(e,t){var r=t.doc,i=t.mirror,n=t.blockClass,a=t.blockSelector,o=t.maskTextClass,s=t.maskTextSelector,u=t.skipChild,l=void 0!==u&&u,h=t.inlineStylesheet,c=void 0===h||h,d=t.maskInputOptions,v=void 0===d?{}:d,f=t.maskTextFn,p=t.maskInputFn,g=t.maskAllElementAttributes,m=void 0!==g&&g,y=t.maskAttributeFn,b=t.slimDOMOptions,w=t.dataURLOptions,k=void 0===w?{}:w,_=t.inlineImages,S=void 0!==_&&_,x=t.recordCanvas,C=void 0!==x&&x,M=t.canvasMaskingConfigured,T=t.onSerialize,I=t.onIframeLoad,E=t.iframeLoadTimeout,R=void 0===E?5e3:E,A=t.onIframeListenerRegistered,L=t.onStylesheetLoad,O=t.stylesheetLoadTimeout,P=void 0===O?5e3:O,D=t.keepIframeSrcFn,F=void 0===D?()=>!1:D,N=t.newlyAddedElement,q=void 0!==N&&N,j=t.depth,B=void 0===j?0:j,H=t.maxDepth,U=void 0===H?_o:H,W=t.needsMask,z=t.preserveWhiteSpace,V=void 0===z||z;if(B>=U)return xo=!0,So||(So=!0,console.warn("[rrweb-snapshot] DOM tree depth exceeded max depth of "+U+". Children beyond this depth will not be recorded. This may indicate deeply nested DOM structures.")),null;W||(W=mo(e,o,s,void 0===W)),ra>0&&(aa.nodeCount+=1);var Z,G=function(e,t){var r=t.doc,i=t.blockClass,n=t.blockSelector,a=t.needsMask,o=t.inlineStylesheet,s=t.maskInputOptions,u=void 0===s?{}:s,l=t.maskTextFn,h=t.maskInputFn,c=t.maskAllElementAttributes,d=void 0!==c&&c,v=t.maskAttributeFn,f=t.dataURLOptions,p=void 0===f?{}:f,g=t.inlineImages,m=t.recordCanvas,y=t.canvasMaskingConfigured,b=t.keepIframeSrcFn,w=t.newlyAddedElement,k=void 0!==w&&w,_=function(e,t){if(t.hasNode(e)){var r=t.getId(e);return 1===r?void 0:r}}(r,t.mirror);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:Fn.Document,childNodes:[],compatMode:e.compatMode}:{type:Fn.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:Fn.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:_};case e.ELEMENT_NODE:return function(e,t){for(var r,i,n,a=t.doc,o=t.inlineStylesheet,s=t.maskInputOptions,u=void 0===s?{}:s,l=t.maskInputFn,h=t.maskAllElementAttributes,c=void 0!==h&&h,d=t.maskAttributeFn,v=t.dataURLOptions,f=void 0===v?{}:v,p=t.inlineImages,g=t.recordCanvas,m=t.canvasMaskingConfigured,y=t.keepIframeSrcFn,b=t.newlyAddedElement,w=void 0!==b&&b,k=t.rootId,_=function(e,t,r){try{if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var i=e.classList.length;i--;)if(t.test(e.classList[i]))return!0;if(r)return e.matches(r)}catch(e){}return!1}(e,t.blockClass,t.blockSelector),S=function(e){if(e instanceof HTMLFormElement)return"form";var t=Ba(e.tagName);return no.test(t)?"div":t}(e),x=new Set,C={},M=e.attributes.length,T=0;M>T;T++){var I=e.attributes[T];po(S,I.name)||(C[I.name]=fo(a,S,Ba(I.name),I.value,e,f))}if("link"===S&&o&&!_){var E=e.sheet;if(!E){var R=function(e){return e.href}(e);R&&!(E=wo(a,R))&&R.includes(".css")&&(E=wo(a,window.location.origin+"/"+R.replace(window.location.href,"")))}var A=null;E&&(ka(E)?ra>0&&(ua.push(e),la+=1):A=Ra(E)),A&&(delete C.rel,delete C.href,C._cssText=A)}if("style"===S&&e.sheet&&!(e.innerText||Gn.textContent(e)||"").trim().length){var L=ba((()=>Ra(e.sheet)));L&&(C._cssText=L)}if("input"===S||"textarea"===S||"select"===S){var O=e.value,P=e.checked;"radio"!==C.type&&"checkbox"!==C.type&&"submit"!==C.type&&"button"!==C.type&&O?C.value=ja({element:e,type:Wa(e),tagName:S,value:O,maskInputOptions:u,maskInputFn:l}):P&&(C.checked=P)}if("option"===S&&(e.selected&&!u.select?C.selected=!0:delete C.selected),"dialog"===S&&e.open){try{C.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal"}catch(e){C.rr_open_mode="modal",C.ph_rr_could_not_detect_modal=!0}x.add("rr_open_mode")}if("canvas"===S&&g&&!(null==m?void 0:m()))if("2d"===e.__context)(function(e){var t=e.getContext("2d");if(!t)return!0;for(var r=0;e.width>r;r+=50)for(var i=0;e.height>i;i+=50){var n=t.getImageData;if(new Uint32Array((Ua in n?n[Ua]:n).call(t,r,i,Math.min(50,e.width-r),Math.min(50,e.height-i)).data.buffer).some((e=>0!==e)))return!1}return!0})(e)||(C.rr_dataURL=e.toDataURL(f.type,f.quality));else if(!("__context"in e)){var D=e.toDataURL(f.type,f.quality),F=a.createElement("canvas");F.width=e.width,F.height=e.height,D!==F.toDataURL(f.type,f.quality)&&(C.rr_dataURL=D)}var N,q,j=!1;if("img"===S&&p){Ja||(Ja=a.createElement("canvas"),Ya=Ja.getContext("2d"));var B=e,H=B.currentSrc||B.getAttribute("src")||"<unknown-src>",U=B.crossOrigin,W=(t,r)=>j?$a({element:e,name:t,value:r,maskAllElementAttributes:c,maskAttributeFn:d}):r,z=()=>{yo(B,"load",z);try{Ja.width=B.naturalWidth,Ja.height=B.naturalHeight,Ya.drawImage(B,0,0);var e=Ja.toDataURL(f.type,f.quality);C.rr_dataURL=W("rr_dataURL",e)}catch(e){if("anonymous"!==B.crossOrigin)return B.crossOrigin="anonymous",void(B.complete&&0!==B.naturalWidth?z():B.addEventListener("load",z));console.warn("Cannot inline img src="+H+"! Error: "+e)}"anonymous"===B.crossOrigin&&(U?C.crossOrigin=W("crossOrigin",U):B.removeAttribute("crossorigin"))};B.complete&&0!==B.naturalWidth?z():B.addEventListener("load",z)}if("audio"===S||"video"===S){var V=C;V.rr_mediaState=e.paused?"paused":"played",x.add("rr_mediaState"),V.rr_mediaCurrentTime=e.currentTime,V.rr_mediaPlaybackRate=e.playbackRate,V.rr_mediaMuted=e.muted,V.rr_mediaLoop=e.loop,V.rr_mediaVolume=e.volume}if(w||(e.scrollLeft&&(C.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(C.rr_scrollTop=e.scrollTop)),_){var Z=e.getBoundingClientRect(),G=Z.width,Q=Z.height,J=Z.left,Y=Z.top,K=null==(r=a.defaultView)?void 0:r.getComputedStyle(e);C={class:C.class,rr_width:G+"px",rr_height:Q+"px",rr_left:Math.floor(J+((null==(i=a.defaultView)?void 0:i.scrollX)||0))+"px",rr_top:Math.floor(Y+((null==(n=a.defaultView)?void 0:n.scrollY)||0))+"px"},x.add("rr_width"),x.add("rr_height"),x.add("rr_left"),x.add("rr_top"),K&&(C.rr_position=K.position||"static",x.add("rr_position"),K.transform&&"none"!==K.transform&&(C.rr_transform=K.transform,x.add("rr_transform")),K.display&&K.display.startsWith("inline")&&(C.rr_display=K.display,x.add("rr_display")))}if("iframe"!==S||y(C.src)||(e.contentDocument||(C.rr_src=C.src),delete C.src),c||d)for(var X of Object.entries(C)){var ee=X[0],te=X[1];"string"!=typeof te&&null!==te||(C[ee]=$a({element:e,name:ee,value:te,maskAllElementAttributes:c,maskAttributeFn:d,isGenerated:x.has(ee)}))}j=!0;try{customElements.get(S)&&(N=!0)}catch(e){}return{type:Fn.Element,tagName:S,attributes:C,childNodes:[],isSVG:(q=e,Boolean("svg"===q.tagName||q.ownerSVGElement)||void 0),needBlock:_,rootId:k,isCustom:N}}(e,{doc:r,blockClass:i,blockSelector:n,inlineStylesheet:o,maskInputOptions:u,maskInputFn:h,maskAllElementAttributes:d,maskAttributeFn:v,dataURLOptions:p,inlineImages:g,recordCanvas:m,canvasMaskingConfigured:y,keepIframeSrcFn:b,newlyAddedElement:k,rootId:_});case e.TEXT_NODE:return function(e,t){var r,i=t.needsMask,n=t.maskTextFn,a=t.rootId,o=Gn.parentNode(e),s=o&&o.tagName,u=Gn.textContent(e),l="STYLE"===s||void 0,h="SCRIPT"===s||void 0;if(l&&u){try{if(e.nextSibling||e.previousSibling);else if(ka(o.sheet));else if(null==(r=o.sheet)?void 0:r.cssRules){var c=Ra(o.sheet);c&&!/(?:^|[\s;{}])-?[a-zA-Z][\w-]*\s*:\s*;/.test(c)&&(u=c)}}catch(t){console.warn("Cannot get CSS styles from text's parentNode. Error: "+t,e)}u=Qa(u,co(t.doc))}return h&&(u="SCRIPT_PLACEHOLDER"),!l&&!h&&u&&i&&(u=n?n(u,Gn.parentElement(e)):u.replace(/[\S]/g,"*")),{type:Fn.Text,textContent:u||"",isStyle:l,rootId:a}}(e,{doc:r,needsMask:a,maskTextFn:l,rootId:_});case e.CDATA_SECTION_NODE:return{type:Fn.CDATA,textContent:"",rootId:_};case e.COMMENT_NODE:return{type:Fn.Comment,textContent:Gn.textContent(e)||"",rootId:_};default:return!1}}(e,{doc:r,mirror:i,blockClass:n,blockSelector:a,needsMask:W,inlineStylesheet:c,maskInputOptions:v,maskTextFn:f,maskInputFn:p,maskAllElementAttributes:m,maskAttributeFn:y,dataURLOptions:k,inlineImages:S,recordCanvas:C,canvasMaskingConfigured:M,keepIframeSrcFn:F,newlyAddedElement:q});if(!G)return console.warn(e,"not serialized"),null;Z=i.hasNode(e)?i.getId(e):function(e,t){if(t.comment&&e.type===Fn.Comment)return!0;if(e.type===Fn.Element){if(t.script&&("script"===e.tagName||"link"===e.tagName&&("preload"===e.attributes.rel&&"script"===e.attributes.as||"modulepreload"===e.attributes.rel)||"link"===e.tagName&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&"js"===function(e,t){var r,i;try{i=new URL(e,window.location.href)}catch(e){return null}var n=i.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!==(r=null==n?void 0:n[1])&&void 0!==r?r:null}(e.attributes.href)))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(ko(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===ko(e.attributes.name)||["icon","apple-touch-icon","shortcut icon"].includes(ko(e.attributes.rel)))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&ko(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(ko(e.attributes.property).match(/^(og|twitter|fb):/)||ko(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===ko(e.attributes.name)))return!0;if(t.headMetaRobots&&["robots","googlebot","bingbot"].includes(ko(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&(["author","generator","framework","publisher","progid"].includes(ko(e.attributes.name))||ko(e.attributes.property).match(/^article:/)||ko(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&["google-site-verification","yandex-verification","csrf-token","p:domain_verify","verify-v1","verification","shopify-checkout-api-token"].includes(ko(e.attributes.name)))return!0}}return!1}(G,b)||!V&&G.type===Fn.Text&&!G.isStyle&&!G.textContent.replace(/^\s+|\s+$/gm,"").length?ao:oo();var Q=Object.assign(G,{id:Z});if(i.add(e,Q),Z===ao)return null;T&&T(e);var J=!l;if(Q.type===Fn.Element){J=J&&!Q.needBlock,delete Q.needBlock;var Y=Gn.shadowRoot(e);Y&&Ma(Y)&&(Q.isShadowHost=!0)}if((Q.type===Fn.Document||Q.type===Fn.Element)&&J){b.headWhitespace&&Q.type===Fn.Element&&"head"===Q.tagName&&(V=!1);var K={doc:r,mirror:i,blockClass:n,blockSelector:a,needsMask:W,maskTextClass:o,maskTextSelector:s,skipChild:l,inlineStylesheet:c,maskInputOptions:v,maskTextFn:f,maskInputFn:p,maskAllElementAttributes:m,maskAttributeFn:y,slimDOMOptions:b,dataURLOptions:k,inlineImages:S,recordCanvas:C,canvasMaskingConfigured:M,preserveWhiteSpace:V,onSerialize:T,onIframeLoad:I,iframeLoadTimeout:R,onIframeListenerRegistered:A,onStylesheetLoad:L,stylesheetLoadTimeout:P,keepIframeSrcFn:F,depth:B+1,maxDepth:U};if(Q.type===Fn.Element&&"textarea"===Q.tagName&&void 0!==Q.attributes.value);else for(var X of Array.from(Gn.childNodes(e))){var ee=Co(X,K);ee&&Q.childNodes.push(ee)}var te=null;if(xa(e)&&(te=Gn.shadowRoot(e)))for(var re of Array.from(Gn.childNodes(te))){var ie=Co(re,K);ie&&(Ma(te)&&(ie.isShadow=!0),Q.childNodes.push(ie))}}var ne=Gn.parentNode(e);if(ne&&Ca(ne)&&Ma(ne)&&(Q.isShadow=!0),Q.type===Fn.Element&&"iframe"===Q.tagName){var ae=function(e,t,r){var i,n=()=>{},a=e.contentWindow;if(!a)return n;try{i=a.document.readyState}catch(e){return n}var o=()=>t();if("complete"!==i){var s=!1,u=null,l=()=>{s||(s=!0,null!==u&&(clearTimeout(u),u=null),yo(e,"load",h),e.addEventListener("load",o),t())},h=()=>l();return u=setTimeout(l,r),e.addEventListener("load",h),()=>{null!==u&&(clearTimeout(u),u=null),s?yo(e,"load",o):(s=!0,yo(e,"load",h))}}var c,d="about:blank";try{c=a.location.href}catch(e){return n}if(c!==d||e.src===d||""===e.src){var v=setTimeout(t,0);return e.addEventListener("load",o),()=>{clearTimeout(v),yo(e,"load",o)}}return e.addEventListener("load",o),()=>{yo(e,"load",o)}}(e,(()=>{var t=e.contentDocument;if(t&&I){var r=Co(t,{doc:t,mirror:i,blockClass:n,blockSelector:a,needsMask:W,maskTextClass:o,maskTextSelector:s,skipChild:!1,inlineStylesheet:c,maskInputOptions:v,maskTextFn:f,maskInputFn:p,maskAllElementAttributes:m,maskAttributeFn:y,slimDOMOptions:b,dataURLOptions:k,inlineImages:S,recordCanvas:C,canvasMaskingConfigured:M,preserveWhiteSpace:V,onSerialize:T,onIframeLoad:I,iframeLoadTimeout:R,onIframeListenerRegistered:A,onStylesheetLoad:L,stylesheetLoadTimeout:P,keepIframeSrcFn:F,depth:B+1,maxDepth:U});r&&I(e,r)}}),R);null==A||A(e,ae)}return Q.type===Fn.Element&&"link"===Q.tagName&&"stylesheet"===Q.attributes.rel&&function(t,u,l){if(!bo.has(t)){var h;try{h=t.sheet}catch(e){return}if(!h){var d=new AbortController,g=!1,w=()=>{if(!g){g=!0;try{(()=>{if(L){var t=Co(e,{doc:r,mirror:i,blockClass:n,blockSelector:a,needsMask:W,maskTextClass:o,maskTextSelector:s,skipChild:!1,inlineStylesheet:c,maskInputOptions:v,maskTextFn:f,maskInputFn:p,maskAllElementAttributes:m,maskAttributeFn:y,slimDOMOptions:b,dataURLOptions:k,inlineImages:S,recordCanvas:C,canvasMaskingConfigured:M,preserveWhiteSpace:V,onSerialize:T,onIframeLoad:I,iframeLoadTimeout:R,onStylesheetLoad:L,stylesheetLoadTimeout:P,keepIframeSrcFn:F,depth:B,maxDepth:U});t&&L(e,t)}})()}finally{bo.delete(t),d.abort()}}},_=setTimeout(w,l);d.signal.addEventListener("abort",(()=>clearTimeout(_)),{once:!0}),t.addEventListener("load",w,{signal:d.signal,once:!0}),bo.set(t,d)}}}(e,0,P),Q}function Mo(e){return!0===e||"all"===e?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===e,headMetaDescKeywords:"all"===e,headTitleMutations:"all"===e}:!1===e?{}:e}class To{constructor(){En(this,"parentElement",null),En(this,"parentNode",null),En(this,"ownerDocument"),En(this,"firstChild",null),En(this,"lastChild",null),En(this,"previousSibling",null),En(this,"nextSibling",null),En(this,"ELEMENT_NODE",1),En(this,"TEXT_NODE",3),En(this,"nodeType"),En(this,"nodeName"),En(this,"RRNodeType")}get childNodes(){for(var e=[],t=this.firstChild;t;)e.push(t),t=t.nextSibling;return e}contains(e){if(!(e instanceof To))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(e){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(e,t){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(e){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}function Io(e,t,r){void 0===r&&(r=document);var i={capture:!0,passive:!0};return r.addEventListener(e,t,i),()=>Eo(r,e,t,i)}function Eo(e,t,r,i){Ro((()=>{var n=e.removeEventListener;"function"==typeof n&&(void 0!==i?n.call(e,t,r,i):n.call(e,t,r))}))}function Ro(e){try{e()}catch(e){if(!(e instanceof DOMException&&"SecurityError"===e.name))throw e}}var Ao="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.",Lo={map:{},getId(){return console.error(Ao),-1},getNode(){return console.error(Ao),null},removeNodeFromMap(){console.error(Ao)},has(){return console.error(Ao),!1},reset(){console.error(Ao)}};function Oo(e,t,r){void 0===r&&(r={});var i=null,n=0;return function(){for(var a=arguments.length,o=new Array(a),s=0;a>s;s++)o[s]=arguments[s];var u=Date.now();n||!1!==r.leading||(n=u);var l=t-(u-n),h=this;0>=l||l>t?(i&&(clearTimeout(i),i=null),n=u,e.apply(h,o)):i||!1===r.trailing||(i=setTimeout((()=>{n=!1===r.leading?0:Date.now(),i=null,e.apply(h,o)}),l))}}function Po(e,t,r,i,n){void 0===n&&(n=window);var a=n.Object.getOwnPropertyDescriptor(e,t);return n.Object.defineProperty(e,t,i?r:{set(e){if(setTimeout((()=>{try{r.set.call(this,e)}catch(e){}}),0),a&&a.set){if(a.get)try{a.get.call(this)}catch(e){return}a.set.call(this,e)}}}),()=>Po(e,t,a||{},!0)}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(Lo=new Proxy(Lo,{get(e,t,r){return"map"===t&&console.error(Ao),Reflect.get(e,t,r)}}));var Do=Date.now;function Fo(e){var t,r,i,n,a=e.document;return{left:a.scrollingElement?a.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:a.documentElement.scrollLeft||(null==a?void 0:a.body)&&(null==(t=Gn.parentElement(a.body))?void 0:t.scrollLeft)||(null==(r=null==a?void 0:a.body)?void 0:r.scrollLeft)||0,top:a.scrollingElement?a.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==a?void 0:a.documentElement.scrollTop)||(null==a?void 0:a.body)&&(null==(i=Gn.parentElement(a.body))?void 0:i.scrollTop)||(null==(n=null==a?void 0:a.body)?void 0:n.scrollTop)||0}}function No(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function qo(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function jo(e){return e?e.nodeType===e.ELEMENT_NODE?e:Gn.parentElement(e):null}function Bo(e,t,r,i){if(!e)return!1;var n=jo(e);if(!n)return!1;try{if("string"==typeof t){if(n.classList.contains(t))return!0;if(i&&null!==n.closest("."+t))return!0}else if(go(n,t,i))return!0}catch(e){}if(r){if(n.matches(r))return!0;if(i&&null!==n.closest(r))return!0}return!1}function Ho(e,t,r){return!("TITLE"!==e.tagName||!r.headTitleMutations)||t.getId(e)===ao}function $o(e,t){if(Ca(e))return!1;var r=t.getId(e);if(!t.has(r))return!0;var i=Gn.parentNode(e);return(!i||i.nodeType!==e.DOCUMENT_NODE)&&(!i||$o(i,t))}function Uo(e){return Boolean(e.changedTouches)}function Wo(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function zo(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function Vo(e){return!!e&&(e instanceof To&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(Gn.shadowRoot(e)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(Do=()=>(new Date).getTime());class Zo{constructor(){En(this,"id",1),En(this,"styleIDMap",new WeakMap),En(this,"idStyleMap",new Map)}getId(e){var t;return null!==(t=this.styleIDMap.get(e))&&void 0!==t?t:-1}has(e){return this.styleIDMap.has(e)}add(e,t){return this.has(e)?this.getId(e):(r=void 0===t?this.id++:t,this.styleIDMap.set(e,r),this.idStyleMap.set(r,e),r);var r}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}function Go(e){var t,r=null;return"getRootNode"in e&&(null==(t=Gn.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&Gn.host(Gn.getRootNode(e))&&(r=Gn.host(Gn.getRootNode(e))),r}function Qo(e){var t=e.ownerDocument;return!!t&&(Gn.contains(t,e)||function(e){var t=e.ownerDocument;if(!t)return!1;var r=function(e){for(var t,r=e;t=Go(r);)r=t;return r}(e);return Gn.contains(t,r)}(e))}function Jo(e){return"__ln"in e}class Yo{constructor(){En(this,"length",0),En(this,"head",null),En(this,"tail",null)}get(e){if(e>=this.length)throw new Error("Position outside of list range");for(var t=this.head,r=0;e>r;r++)t=(null==t?void 0:t.next)||null;return t}addNode(e){var t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&Jo(e.previousSibling)){var r=e.previousSibling.__ln.next;t.next=r,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,r&&(r.previous=t)}else if(e.nextSibling&&Jo(e.nextSibling)&&e.nextSibling.__ln.previous){var i=e.nextSibling.__ln.previous;t.previous=i,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,i&&(i.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;null===t.next&&(this.tail=t),this.length++}removeNode(e){var t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next?t.next.previous=t.previous:this.tail=t.previous):(this.head=t.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)}}var Ko,Xo=(e,t)=>e+"@"+t;class es{constructor(){En(this,"frozen",!1),En(this,"locked",!1),En(this,"texts",[]),En(this,"attributes",[]),En(this,"attributeMap",new WeakMap),En(this,"generatedAttributes",new WeakMap),En(this,"removes",[]),En(this,"mapRemoves",[]),En(this,"movedMap",{}),En(this,"addedSet",new Set),En(this,"movedSet",new Set),En(this,"droppedSet",new Set),En(this,"removesSubTreeCache",new Set),En(this,"mutationCb"),En(this,"blockClass"),En(this,"blockSelector"),En(this,"maskTextClass"),En(this,"maskTextSelector"),En(this,"inlineStylesheet"),En(this,"maskInputOptions"),En(this,"maskTextFn"),En(this,"maskInputFn"),En(this,"maskAllElementAttributes"),En(this,"maskAttributeFn"),En(this,"keepIframeSrcFn"),En(this,"recordCanvas"),En(this,"canvasMaskingConfigured"),En(this,"inlineImages"),En(this,"slimDOMOptions"),En(this,"dataURLOptions"),En(this,"doc"),En(this,"mirror"),En(this,"iframeManager"),En(this,"stylesheetManager"),En(this,"shadowDomManager"),En(this,"canvasManager"),En(this,"processedNodeManager"),En(this,"unattachedDoc"),En(this,"canvasManagerReleased",!1),En(this,"processMutations",(e=>{e.forEach(this.processMutation),this.emit()})),En(this,"emit",(()=>{if(!this.frozen&&!this.locked){var e,t,r=Jn(),i=ea();try{this.processBufferedMutations()}finally{e=Jn()-r,t=i,ra>0||ta(e,null!=t?t:Yn)||e>ca.slowestBatchMs&&(ca.slowestBatchMs=e)}}})),En(this,"processBufferedMutations",(()=>{for(var e=[],t=new Set,r=new Yo,i=e=>{for(var t=e,r=ao;r===ao;)r=(t=t&&t.nextSibling)&&this.mirror.getId(t);return r},n=n=>{var a=Gn.parentNode(n);if(a&&Qo(n)&&"TEXTAREA"!==a.tagName){var o=Ca(a)?this.mirror.getId(Go(n)):this.mirror.getId(a),s=i(n);if(-1===o||-1===s)return r.addNode(n);var u=Co(n,{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:e=>{Wo(e,this.mirror)&&this.iframeManager.addIframe(e),zo(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),Vo(e)&&!Bo(e,this.blockClass,this.blockSelector,!0)&&this.shadowDomManager.addShadowRoot(Gn.shadowRoot(e),this.doc)},onIframeLoad:(e,t)=>{this.iframeManager.attachIframe(e,t),this.shadowDomManager.observeAttachShadow(e)},onIframeListenerRegistered:(e,t)=>{this.iframeManager.registerLoadListenerDisposer(e,t)},onStylesheetLoad:(e,t)=>{this.stylesheetManager.attachLinkElement(e,t)}});u&&(e.push({parentId:o,nextId:s,node:u}),t.add(u.id))}};this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(var a of this.movedSet)rs(this.removesSubTreeCache,a)&&!this.movedSet.has(Gn.parentNode(a))||n(a);for(var o of this.addedSet)is(this.droppedSet,o)||rs(this.removesSubTreeCache,o)?is(this.movedSet,o)?n(o):this.droppedSet.add(o):n(o);for(var s=null;r.length;){var u=null;if(s){var l=this.mirror.getId(Gn.parentNode(s.value)),h=i(s.value);-1!==l&&-1!==h&&(u=s)}if(!u)for(var c=r.tail;c;){var d=c;if(c=c.previous,d){var v=this.mirror.getId(Gn.parentNode(d.value));if(-1===i(d.value))continue;if(-1!==v){u=d;break}var f=Gn.parentNode(d.value);if(f&&f.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var p=Gn.host(f);if(-1!==this.mirror.getId(p)){u=d;break}}}}if(!u){for(;r.head;)r.removeNode(r.head.value);break}s=u.previous,r.removeNode(u.value),n(u.value)}var g={texts:this.texts.map((e=>{var t=e.node,r=Gn.parentNode(t);return r&&"TEXTAREA"===r.tagName&&this.genTextAreaValueMutation(r),{id:this.mirror.getId(t),value:e.value}})).filter((e=>!t.has(e.id))).filter((e=>this.mirror.has(e.id))),attributes:this.attributes.map((e=>{var t,r=e.attributes;if(!this.maskAllElementAttributes&&!this.maskAttributeFn&&"string"==typeof r.style){var i=JSON.stringify(e.styleDiff),n=JSON.stringify(e._unchangedStyles);r.style.length>i.length&&(i+n).split("var(").length===r.style.split("var(").length&&(r.style=e.styleDiff)}if(this.maskAllElementAttributes||this.maskAttributeFn)for(var a of Object.entries(r)){var o=a[0],s=a[1];"string"!=typeof s&&null!==s||(r[o]=$a({element:e.node,name:o,value:s,maskAllElementAttributes:this.maskAllElementAttributes,maskAttributeFn:this.maskAttributeFn,isGenerated:null==(t=this.generatedAttributes.get(e.node))?void 0:t.has(o)}))}return{id:this.mirror.getId(e.node),attributes:r}})).filter((e=>!t.has(e.id))).filter((e=>this.mirror.has(e.id))),removes:this.removes,adds:e};(g.texts.length||g.attributes.length||g.removes.length||g.adds.length)&&(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={},this.mutationCb(g))})),En(this,"bufferBelongsToIframe",(e=>this.doc===e.contentDocument)),En(this,"genTextAreaValueMutation",(e=>{var t=this.attributeMap.get(e);t||(this.attributes.push(t={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}}),this.attributeMap.set(e,t));var r=Array.from(Gn.childNodes(e),(e=>Gn.textContent(e)||"")).join("");t.attributes.value=ja({element:e,maskInputOptions:this.maskInputOptions,tagName:e.tagName,type:Wa(e),value:r,maskInputFn:this.maskInputFn})})),En(this,"processMutation",(e=>{var t;if(!Ho(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":var r=Gn.textContent(e.target);Bo(e.target,this.blockClass,this.blockSelector,!1)||r===e.oldValue||this.texts.push({value:mo(e.target,this.maskTextClass,this.maskTextSelector,!0)&&r?this.maskTextFn?this.maskTextFn(r,jo(e.target)):r.replace(/[\S]/g,"*"):r,node:e.target});break;case"attributes":var i,n=e.target,a=e.attributeName,o=null!==(i=e.attributeNamespace)&&void 0!==i?i:null,s=function(e,t,r){if(!r)return t;var i=e.getAttributeNodeNS(r,t);if(i)return i.name;if("http://www.w3.org/1999/xlink"===r)return"xlink:"+t;if("http://www.w3.org/XML/1998/namespace"===r)return"xml:"+t;if("http://www.w3.org/2000/xmlns/"===r)return"xmlns"===t?t:"xmlns:"+t;var n=e.lookupPrefix(r);return n?n+":"+t:t}(n,a,o),u=o?n.getAttributeNS(o,a):e.target.getAttribute(a);if("value"===s){var l=n,h=Wa(l);u=ja({element:l,maskInputOptions:this.maskInputOptions,tagName:n.tagName,type:h,value:u,maskInputFn:this.maskInputFn})}if(Bo(e.target,this.blockClass,this.blockSelector,!1)||u===e.oldValue)return;var c=this.attributeMap.get(e.target),d="IFRAME"===n.tagName&&"src"===s;if(d&&!this.keepIframeSrcFn(u)&&n.contentDocument)return;if(c||(this.attributes.push(c={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}}),this.attributeMap.set(e.target,c)),"type"===s&&"INPUT"===n.tagName&&"password"===(e.oldValue||"").toLowerCase()&&n.setAttribute("data-rr-is-password","true"),!po(n.tagName,s)){var v=fo(this.doc,Ba(n.tagName),Ba(s),u,n,this.dataURLOptions);if(d&&!this.keepIframeSrcFn(u)&&(s="rr_src"),c.attributes[s]=v,null==(t=this.generatedAttributes.get(e.target))||t.delete(s),"style"===s){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(e){this.unattachedDoc=this.doc}var f=this.unattachedDoc.createElement("span"),p=n.style;for(var g of(e.oldValue&&(f.style.cssText=e.oldValue),Array.from(p))){var m=p.getPropertyValue(g),y=p.getPropertyPriority(g);m!==f.style.getPropertyValue(g)||y!==f.style.getPropertyPriority(g)?c.styleDiff[g]=""===y?m:[m,y]:c._unchangedStyles[g]=[m,y]}for(var b of Array.from(f.style))""===p.getPropertyValue(b)&&(c.styleDiff[b]=!1)}else if("open"===s&&"DIALOG"===n.tagName){c.attributes.rr_open_mode=n.matches("dialog:modal")?"modal":"non-modal";var w=this.generatedAttributes.get(e.target);w||this.generatedAttributes.set(e.target,w=new Set),w.add("rr_open_mode")}}break;case"childList":if(Bo(e.target,this.blockClass,this.blockSelector,!0))return;if("TEXTAREA"===e.target.tagName)return void this.genTextAreaValueMutation(e.target);e.addedNodes.forEach((t=>this.genAdds(t,e.target))),e.removedNodes.forEach((t=>{var r=this.mirror.getId(t),i=Ca(e.target)?this.mirror.getId(Gn.host(e.target)):this.mirror.getId(e.target);Bo(e.target,this.blockClass,this.blockSelector,!1)||Ho(t,this.mirror,this.slimDOMOptions)||!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?(ts(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===r||$o(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[Xo(r,i)]?ts(this.movedSet,t):(this.removes.push({parentId:i,id:r,isShadow:!(!Ca(e.target)||!Ma(e.target))||void 0}),function(e,t){for(var r=[e];r.length;){var i=r.pop();t.has(i)||(t.add(i),Gn.childNodes(i).forEach((e=>r.push(e))))}}(t,this.removesSubTreeCache))),this.mapRemoves.push(t))}))}})),En(this,"genAdds",((e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)){if(this.addedSet.has(e))return this.addedSet.delete(e),void this.addedSet.add(e);if(!this.movedSet.has(e)){if(this.mirror.hasNode(e)){if(Ho(e,this.mirror,this.slimDOMOptions))return;this.movedSet.add(e);var r=null;t&&this.mirror.hasNode(t)&&(r=this.mirror.getId(t)),r&&-1!==r&&(this.movedMap[Xo(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);Bo(e,this.blockClass,this.blockSelector,!1)||(Gn.childNodes(e).forEach((e=>this.genAdds(e))),Vo(e)&&Gn.childNodes(Gn.shadowRoot(e)).forEach((t=>{this.processedNodeManager.add(t,this),this.genAdds(t,e)})))}}}))}init(e){["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((t=>{this[t]=e[t]})),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(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift())}}function ts(e,t){for(var r=[t];r.length;){var i=r.pop();e.delete(i),Gn.childNodes(i).forEach((e=>r.push(e)))}}function rs(e,t,r){return 0!==e.size&&function(e,t,r){var i=Gn.parentNode(t);return!!i&&e.has(i)}(e,t)}function is(e,t){if(0===e.size)return!1;for(var r=Gn.parentNode(t);r;){if(e.has(r))return!0;r=Gn.parentNode(r)}return!1}var ns=function(e,t){return void 0===t&&(t="rrweb"),Ko?function(){try{return e(...arguments)}catch(e){if(Ko&&!0===Ko(e,t))return;throw e}}:e},as=[];function os(e){try{if("composedPath"in e){var t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch(e){}return e&&e.target}function ss(e,t){var r,i=new es;i.init(e);try{r=new(Vn())(ns(i.processMutations.bind(i)));var n={attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0};return e.attributeFilter&&e.attributeFilter.length>0&&(n.attributeFilter=e.attributeFilter),r.observe(t,n),as.push(i),{observer:r,buffer:i}}catch(e){try{null==r||r.disconnect(),i.destroy(),i.reset()}catch(e){}throw e}}function us(e){var t=e.scrollCb,r=e.doc,i=e.mirror,n=e.blockClass,a=e.blockSelector,o=e.sampling,s=new Map,u=e=>{var o=os(e);if(o&&!Bo(o,n,a,!0)){var u,l,h=i.getId(o);if(o===r&&r.defaultView){var c=Fo(r.defaultView);u=c.left,l=c.top}else u=o.scrollLeft,l=o.scrollTop;var d=u+","+l;s.get(h)!==d&&(s.set(h,d),t({id:h,x:u,y:l}))}},l=[Io("scroll",ns(Oo(ns((e=>u(e))),o.scroll||100)),r)];return"onscrollend"in r&&l.push(Io("scrollend",ns(u),r)),()=>l.forEach((e=>e()))}function ls(e,t){for(var r=as.length-1;r>=0;r--){var i=as[r];if(i){var n=i.bufferBelongsToIframe(e);!n&&t&&t.has(i.bufferDoc())&&(n=!0),n&&(i.reset(),as.splice(r,1))}}}var hs=["INPUT","TEXTAREA","SELECT"],cs=new WeakMap;function ds(e){return function e(t,r){if(ms("CSSGroupingRule")&&t.parentRule instanceof CSSGroupingRule||ms("CSSMediaRule")&&t.parentRule instanceof CSSMediaRule||ms("CSSSupportsRule")&&t.parentRule instanceof CSSSupportsRule||ms("CSSConditionRule")&&t.parentRule instanceof CSSConditionRule){var i=Array.from(t.parentRule.cssRules).indexOf(t);return r.unshift(i),e(t.parentRule,r)}if(t.parentStyleSheet){var n=Array.from(t.parentStyleSheet.cssRules).indexOf(t);r.unshift(n)}return r}(e,[])}function vs(e,t,r){var i,n;return e?(e.ownerNode?i=t.getId(e.ownerNode):n=r.getId(e),{styleId:n,id:i}):{}}var fs=5e3;function ps(e,t){var r,i,n,a,o=e.stylesheetManager;a=e.mirror.getId("#document"===t.nodeName?t:Gn.host(t));var s="#document"===t.nodeName?null==(r=t.defaultView)?void 0:r.Document:null==(n=null==(i=t.ownerDocument)?void 0:i.defaultView)?void 0:n.ShadowRoot,u=(null==s?void 0:s.prototype)?Object.getOwnPropertyDescriptor(null==s?void 0:s.prototype,"adoptedStyleSheets"):void 0;return null!==a&&-1!==a&&s&&u?(Object.defineProperty(t,"adoptedStyleSheets",{configurable:u.configurable,enumerable:u.enumerable,get(){var e;return null==(e=u.get)?void 0:e.call(this)},set(e){var t,r;try{r=null==(t=u.set)?void 0:t.call(this,e)}catch(e){if(e&&"object"==typeof e&&"NotAllowedError"===e.name)return;throw e}if(null!==a&&-1!==a)try{o.adoptStyleSheets(e,a)}catch(e){}return r}}),ns((()=>{Object.defineProperty(t,"adoptedStyleSheets",{configurable:u.configurable,enumerable:u.enumerable,get:u.get,set:u.set})}))):()=>{}}function gs(e,t){void 0===t&&(t={});var r,i,n=e.doc.defaultView;if(!n)return()=>{};!function(e,t){var r=e.mutationCb,i=e.mousemoveCb,n=e.mouseInteractionCb,a=e.scrollCb,o=e.viewportResizeCb,s=e.inputCb,u=e.mediaInteractionCb,l=e.styleSheetRuleCb,h=e.styleDeclarationCb,c=e.canvasMutationCb,d=e.fontCb,v=e.selectionCb,f=e.customElementCb;e.mutationCb=function(){t.mutation&&t.mutation(...arguments),r(...arguments)},e.mousemoveCb=function(){t.mousemove&&t.mousemove(...arguments),i(...arguments)},e.mouseInteractionCb=function(){t.mouseInteraction&&t.mouseInteraction(...arguments),n(...arguments)},e.scrollCb=function(){t.scroll&&t.scroll(...arguments),a(...arguments)},e.viewportResizeCb=function(){t.viewportResize&&t.viewportResize(...arguments),o(...arguments)},e.inputCb=function(){t.input&&t.input(...arguments),s(...arguments)},e.mediaInteractionCb=function(){t.mediaInteaction&&t.mediaInteaction(...arguments),u(...arguments)},e.styleSheetRuleCb=function(){t.styleSheetRule&&t.styleSheetRule(...arguments),l(...arguments)},e.styleDeclarationCb=function(){t.styleDeclaration&&t.styleDeclaration(...arguments),h(...arguments)},e.canvasMutationCb=function(){t.canvasMutation&&t.canvasMutation(...arguments),c(...arguments)},e.fontCb=function(){t.font&&t.font(...arguments),d(...arguments)},e.selectionCb=function(){t.selection&&t.selection(...arguments),v(...arguments)},e.customElementCb=function(){t.customElement&&t.customElement(...arguments),f(...arguments)}}(e,t);var a,o,s,u,l,c,d,v,f=[],p=ns((()=>{if(i){i.destroy(),i.reset();var t=as.indexOf(i);-1!==t&&as.splice(t,1)}e.shadowDomManager.resetForDoc(e.doc),null==r||r.disconnect(),f.forEach((e=>e()))}));try{if(e.recordDOM){var g=ss(e,e.doc);r=g.observer,i=g.buffer}if(f.push(function(e){var t=e.mousemoveCb,r=e.sampling,i=e.doc,n=e.mirror;if(!1===r.mousemove)return()=>{};var a,o="number"==typeof r.mousemove?r.mousemove:50,s="number"==typeof r.mousemoveCallback?r.mousemoveCallback:500,u=[],l=Oo(ns((e=>{var r=Date.now()-a;t(u.map((e=>(e.timeOffset-=r,e))),e),u=[],a=null})),s),h=ns(Oo(ns((e=>{var t=os(e),r=Uo(e)?e.changedTouches[0]:e,i=r.clientX,o=r.clientY;a||(a=Do()),u.push({x:i,y:o,id:n.getId(t),timeOffset:Do()-a}),l("undefined"!=typeof DragEvent&&e instanceof DragEvent?An.Drag:e instanceof MouseEvent?An.MouseMove:An.TouchMove)})),o,{trailing:!1})),c=[Io("mousemove",h,i),Io("touchmove",h,i),Io("drag",h,i)];return ns((()=>{c.forEach((e=>e()))}))}(e)),f.push(function(e){var t=e.mouseInteractionCb,r=e.doc,i=e.mirror,n=e.blockClass,a=e.blockSelector,o=e.sampling;if(!1===o.mouseInteraction)return()=>{};var s=!0===o.mouseInteraction||void 0===o.mouseInteraction?{}:o.mouseInteraction,u=[],l=null;return Object.keys(Ln).filter((e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==s[e])).forEach((e=>{var o=Ba(e),s=(e=>r=>{var o=os(r);if(!Bo(o,n,a,!0)){var s=null,u=e;if("pointerType"in r){switch(r.pointerType){case"mouse":s=On.Mouse;break;case"touch":s=On.Touch;break;case"pen":s=On.Pen}s===On.Touch&&(Ln[e]===Ln.MouseDown?u="TouchStart":Ln[e]===Ln.MouseUp&&(u="TouchEnd"))}else Uo(r)&&(s=On.Touch);null!==s?(l=s,(u.startsWith("Touch")&&s===On.Touch||u.startsWith("Mouse")&&s===On.Mouse)&&(s=null)):Ln[e]===Ln.Click&&(s=l,l=null);var c=Uo(r)?r.changedTouches[0]:r;if(c){var d=i.getId(o),v=c.clientX,f=c.clientY;ns(t)(h({type:Ln[u],id:d,x:v,y:f},null!==s&&{pointerType:s}))}}})(e);if(window.PointerEvent)switch(Ln[e]){case Ln.MouseDown:case Ln.MouseUp:o=o.replace("mouse","pointer");break;case Ln.TouchStart:case Ln.TouchEnd:return}u.push(Io(o,s,r))})),ns((()=>{u.forEach((e=>e()))}))}(e)),f.push(us(e)),f.push(function(e,t){var r=e.viewportResizeCb,i=t.win,n=-1,a=-1;return Io("resize",ns(Oo(ns((()=>{var e=No(),t=qo();n===e&&a===t||(r({width:Number(t),height:Number(e)}),n=e,a=t)})),200)),i)}(e,{win:n})),f.push(function(e){var t=e.inputCb,r=e.doc,i=e.mirror,n=e.blockClass,a=e.blockSelector,o=e.ignoreClass,s=e.ignoreSelector,u=e.maskInputOptions,l=e.maskInputFn,c=e.userTriggeredOnInput;function d(e){var t=os(e),i=e.isTrusted,h=r.defaultView;if(!t||!h||t instanceof h.HTMLElement){var d=t&&t.tagName;if(t&&"OPTION"===d&&(t=Gn.parentElement(t)),t&&d&&hs.indexOf(d)>=0&&!Bo(t,n,a,!0)&&!(t.classList.contains(o)||s&&t.matches(s))){var f=t.value,p=!1,g=Wa(t)||"";"radio"===g||"checkbox"===g?p=t.checked:(u[d.toLowerCase()]||u[g])&&(f=ja({element:t,maskInputOptions:u,tagName:d,type:g,value:f,maskInputFn:l})),v(t,c?{text:f,isChecked:p,userTriggered:i}:{text:f,isChecked:p});var m=t.name;"radio"===g&&m&&p&&r.querySelectorAll('input[type="radio"][name="'+m+'"]').forEach((e=>{if(e!==t){var r=e.value;v(e,c?{text:r,isChecked:!p,userTriggered:!1}:{text:r,isChecked:!p})}}))}}}function v(e,r){var n=cs.get(e);if(!n||n.text!==r.text||n.isChecked!==r.isChecked){cs.set(e,r);var a=i.getId(e);ns(t)(h({},r,{id:a}))}}var f=("last"===e.sampling.input?["change"]:["input","change"]).map((e=>Io(e,ns(d),r))),p=r.defaultView;if(!p)return()=>{f.forEach((e=>e()))};var g=p.Object.getOwnPropertyDescriptor(p.HTMLInputElement.prototype,"value");return g&&g.set&&f.push(...[[p.HTMLInputElement.prototype,"value"],[p.HTMLInputElement.prototype,"checked"],[p.HTMLSelectElement.prototype,"value"],[p.HTMLTextAreaElement.prototype,"value"],[p.HTMLSelectElement.prototype,"selectedIndex"],[p.HTMLOptionElement.prototype,"selected"]].map((e=>Po(e[0],e[1],{set(){ns(d)({target:this,isTrusted:!1})}},!1,p)))),ns((()=>{f.forEach((e=>e()))}))}(e)),f.push(function(e){var t=e.mediaInteractionCb,r=e.blockClass,i=e.blockSelector,n=e.mirror,a=e.sampling,o=e.doc,s=ns((e=>Oo(ns((a=>{var o=os(a);if(o&&!Bo(o,r,i,!0)){var s=o.currentTime,u=o.volume,l=o.muted,h=o.playbackRate,c=o.loop;t({type:e,id:n.getId(o),currentTime:s,volume:u,muted:l,playbackRate:h,loop:c})}})),a.media||500))),u=[Io("play",s(Dn.Play),o),Io("pause",s(Dn.Pause),o),Io("seeked",s(Dn.Seeked),o),Io("volumechange",s(Dn.VolumeChange),o),Io("ratechange",s(Dn.RateChange),o)];return ns((()=>{u.forEach((e=>e()))}))}(e)),e.recordDOM){var m=function(e){var t=new Map,r=new Set,i=!0,n=e=>{if(i)try{e()}catch(e){}},a=e=>{var r,i=t.get(e);if(i){for(;null==(r=i[0])?void 0:r.ready;){var a=i.shift();(null==a?void 0:a.emit)&&n(a.emit)}0===i.length&&t.delete(e)}};return{queueMutation(e,r){if(e){var i=t.get(e);i?(i.push({emit:r,ready:!0}),a(e)):n(r)}else n(r)},queuePendingMutation(o,s,u){if(!i)return()=>{};var l=t.get(o);l||t.set(o,l=[]);var h={emit:s,ready:!1};l.push(h);var c,d=!1,v=!1,f=()=>{d||v||(d=!0,void 0!==c&&r.delete(c),h.ready=!0,h.emit=void 0,a(o))};try{c=e.setTimeout(f,fs),d||v?e.clearTimeout(c):r.add(c)}catch(e){f()}return t=>{!v&&i&&(v=!0,void 0!==c&&(e.clearTimeout(c),r.delete(c)),d?t&&n(u):(h.ready=!0,t||(h.emit=void 0),a(o)))}},reset(){i=!1,r.forEach((t=>e.clearTimeout(t))),r.clear(),t.clear()}}}(n);f.push(m.reset),f.push(function(e,t){var r=e.styleSheetRuleCb,i=e.mirror,n=e.stylesheetManager,a=t.win,o=t.mutationQueue;if(!a.CSSStyleSheet||!a.CSSStyleSheet.prototype)return()=>{};var s=a.CSSStyleSheet.prototype.insertRule;a.CSSStyleSheet.prototype.insertRule=new Proxy(s,{apply:ns(((e,t,a)=>{var s=a[0],u=e.apply(t,a);n.onCssomSheetMutation(t);var l=vs(t,i,n.styleMirror),h=l.id,c=l.styleId;return(h&&-1!==h||c&&-1!==c)&&o.queueMutation(t,(()=>r({id:h,styleId:c,adds:[{rule:s,index:u}]}))),u}),"host")}),a.CSSStyleSheet.prototype.addRule=function(e,t,r){return void 0===r&&(r=this.cssRules.length),a.CSSStyleSheet.prototype.insertRule.apply(this,[e+" { "+t+" }",r])};var u,l,h=a.CSSStyleSheet.prototype.deleteRule;a.CSSStyleSheet.prototype.deleteRule=new Proxy(h,{apply:ns(((e,t,a)=>{var s=a[0],u=e.apply(t,a);n.onCssomSheetMutation(t);var l=vs(t,i,n.styleMirror),h=l.id,c=l.styleId;return(h&&-1!==h||c&&-1!==c)&&o.queueMutation(t,(()=>r({id:h,styleId:c,removes:[{index:s}]}))),u}),"host")}),a.CSSStyleSheet.prototype.removeRule=function(e){return a.CSSStyleSheet.prototype.deleteRule.apply(this,[e])},a.CSSStyleSheet.prototype.replace&&(u=a.CSSStyleSheet.prototype.replace,a.CSSStyleSheet.prototype.replace=new Proxy(u,{apply:ns(((e,t,a)=>{var s=a[0],u=e.apply(t,a);try{var l=null==u?void 0:u.then;if(t.ownerNode||!u||"function"!=typeof l)return u;n.onCssomSheetMutation(t);var h=vs(t,i,n.styleMirror),c=h.id,d=h.styleId;if(!(c&&-1!==c||d&&-1!==d))return u;var v=o.queuePendingMutation(t,(()=>r({id:c,styleId:d,replace:s})),(()=>{var e=Ra(t);null!==e&&r({id:c,styleId:d,replace:e})}));try{l.call(u,(()=>v(!0)),(()=>v(!1)))}catch(e){v(!1)}}catch(e){}return u}),"host")})),a.CSSStyleSheet.prototype.replaceSync&&(l=a.CSSStyleSheet.prototype.replaceSync,a.CSSStyleSheet.prototype.replaceSync=new Proxy(l,{apply:ns(((e,t,a)=>{var s=a[0],u=e.apply(t,a);n.onCssomSheetMutation(t);var l=vs(t,i,n.styleMirror),h=l.id,c=l.styleId;return(h&&-1!==h||c&&-1!==c)&&o.queueMutation(t,(()=>r({id:h,styleId:c,replaceSync:s}))),u}),"host")}));var c={};ys("CSSGroupingRule")?c.CSSGroupingRule=a.CSSGroupingRule:(ys("CSSMediaRule")&&(c.CSSMediaRule=a.CSSMediaRule),ys("CSSConditionRule")&&(c.CSSConditionRule=a.CSSConditionRule),ys("CSSSupportsRule")&&(c.CSSSupportsRule=a.CSSSupportsRule));var d={};return Object.entries(c).forEach((e=>{var t=e[0],a=e[1];d[t]={insertRule:a.prototype.insertRule,deleteRule:a.prototype.deleteRule},a.prototype.insertRule=new Proxy(d[t].insertRule,{apply:ns(((e,t,a)=>{var s=a[0],u=e.apply(t,a);n.onCssomSheetMutation(t.parentStyleSheet);var l=vs(t.parentStyleSheet,i,n.styleMirror),h=l.id,c=l.styleId;if(t.parentStyleSheet&&(h&&-1!==h||c&&-1!==c)){var d=[...ds(t),u];o.queueMutation(t.parentStyleSheet,(()=>r({id:h,styleId:c,adds:[{rule:s,index:d}]})))}return u}),"host")}),a.prototype.deleteRule=new Proxy(d[t].deleteRule,{apply:ns(((e,t,a)=>{var s=a[0],u=e.apply(t,a);n.onCssomSheetMutation(t.parentStyleSheet);var l=vs(t.parentStyleSheet,i,n.styleMirror),h=l.id,c=l.styleId;if(t.parentStyleSheet&&(h&&-1!==h||c&&-1!==c)){var d=[...ds(t),s];o.queueMutation(t.parentStyleSheet,(()=>r({id:h,styleId:c,removes:[{index:d}]})))}return u}),"host")})})),ns((()=>{a.CSSStyleSheet.prototype.insertRule=s,a.CSSStyleSheet.prototype.deleteRule=h,u&&(a.CSSStyleSheet.prototype.replace=u),l&&(a.CSSStyleSheet.prototype.replaceSync=l),Object.entries(c).forEach((e=>{var t=e[0],r=e[1];r.prototype.insertRule=d[t].insertRule,r.prototype.deleteRule=d[t].deleteRule}))}))}(e,{win:n,mutationQueue:m})),f.push(ps(e,e.doc)),f.push(function(e,t){var r=e.styleDeclarationCb,i=e.mirror,n=e.ignoreCSSAttributes,a=e.stylesheetManager,o=t.win,s=t.mutationQueue,u=o.CSSStyleDeclaration.prototype.setProperty;o.CSSStyleDeclaration.prototype.setProperty=new Proxy(u,{apply:ns(((e,t,o)=>{var u,l=o[0],h=o[1],c=o[2],d=e.apply(t,o);if(n.has(l))return d;var v=null==(u=t.parentRule)?void 0:u.parentStyleSheet;a.onCssomSheetMutation(v);var f=vs(v,i,a.styleMirror),p=f.id,g=f.styleId;if(p&&-1!==p||g&&-1!==g){var m=ds(t.parentRule);s.queueMutation(v,(()=>r({id:p,styleId:g,set:{property:l,value:h,priority:c},index:m})))}return d}),"host")});var l=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=new Proxy(l,{apply:ns(((e,t,o)=>{var u,l=o[0],h=e.apply(t,o);if(n.has(l))return h;var c=null==(u=t.parentRule)?void 0:u.parentStyleSheet;a.onCssomSheetMutation(c);var d=vs(c,i,a.styleMirror),v=d.id,f=d.styleId;if(v&&-1!==v||f&&-1!==f){var p=ds(t.parentRule);s.queueMutation(c,(()=>r({id:v,styleId:f,remove:{property:l},index:p})))}return h}),"host")}),ns((()=>{o.CSSStyleDeclaration.prototype.setProperty=u,o.CSSStyleDeclaration.prototype.removeProperty=l}))}(e,{win:n,mutationQueue:m})),e.collectFonts&&f.push(function(e){var t=e.fontCb,r=e.doc,i=r.defaultView;if(!i)return()=>{};var n=[],a=new WeakMap,o=i.FontFace;i.FontFace=function(e,t,r){var i=new o(e,t,r);return a.set(i,{family:e,buffer:"string"!=typeof t,descriptors:r,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),i};var s=Zn(r.fonts,"add",(function(e){return function(r){return setTimeout(ns((()=>{var e=a.get(r);e&&(t(e),a.delete(r))})),0),e.apply(this,[r])}}));return n.push((()=>{i.FontFace=o})),n.push(s),ns((()=>{n.forEach((e=>e()))}))}(e))}for(var y of(f.push((o=(a=e).doc,s=a.mirror,u=a.blockClass,l=a.blockSelector,c=a.selectionCb,d=!0,(v=ns((()=>{var e=o.getSelection();if(!(!e||d&&(null==e?void 0:e.isCollapsed))){d=e.isCollapsed||!1;for(var t=[],r=e.rangeCount||0,i=0;r>i;i++){var n=e.getRangeAt(i),a=n.startContainer,h=n.startOffset,v=n.endContainer,f=n.endOffset;Bo(a,u,l,!0)||Bo(v,u,l,!0)||t.push({start:s.getId(a),startOffset:h,end:s.getId(v),endOffset:f})}c({ranges:t})}})))(),Io("selectionchange",v))),f.push(function(e){var t=e.customElementCb,r=e.doc.defaultView;return r&&r.customElements?Zn(r.customElements,"define",(function(e){return function(r,i,n){try{t({define:{name:r}})}catch(e){console.warn("Custom element callback failed for "+r)}return e.apply(this,[r,i,n])}})):()=>{}}(e)),e.plugins))f.push(y.observer(y.callback,n,y.options))}catch(e){try{p()}catch(e){}throw e}return p}function ms(e){return void 0!==window[e]}function ys(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class bs{constructor(e){En(this,"iframeRemoteIdToLocalIdMap",new WeakMap),En(this,"iframeLocalIdToRemoteIdMap",new WeakMap),this.generateIdFn=e}getId(e,t,r,i){if(0>t)return t;var n=r||this.getRemoteIdToLocalIdMap(e),a=i||this.getLocalIdToRemoteIdMap(e),o=n.get(t);return void 0===o&&(o=this.generateIdFn(),n.set(t,o),a.set(o,t)),o}getIds(e,t){var r=this.getRemoteIdToLocalIdMap(e),i=this.getLocalIdToRemoteIdMap(e);return t.map((t=>this.getId(e,t,r,i)))}getRemoteId(e,t,r){var i;return"number"!=typeof t||0>t?t:null!==(i=(r||this.getLocalIdToRemoteIdMap(e)).get(t))&&void 0!==i?i:-1}getRemoteIds(e,t){var r=this.getLocalIdToRemoteIdMap(e);return t.map((t=>this.getRemoteId(e,t,r)))}reset(e){if(!e)return this.iframeRemoteIdToLocalIdMap=new WeakMap,void(this.iframeLocalIdToRemoteIdMap=new WeakMap);this.iframeRemoteIdToLocalIdMap.delete(e),this.iframeLocalIdToRemoteIdMap.delete(e)}getRemoteIdToLocalIdMap(e){var t=this.iframeRemoteIdToLocalIdMap.get(e);return t||this.iframeRemoteIdToLocalIdMap.set(e,t=new Map),t}getLocalIdToRemoteIdMap(e){var t=this.iframeLocalIdToRemoteIdMap.get(e);return t||this.iframeLocalIdToRemoteIdMap.set(e,t=new Map),t}}class ws{constructor(e){En(this,"iframes",new WeakMap),En(this,"crossOriginIframeMap",new WeakMap),En(this,"crossOriginIframeMirror",new bs(oo)),En(this,"crossOriginIframeStyleMirror"),En(this,"crossOriginIframeRootIdMap",new WeakMap),En(this,"mirror"),En(this,"mutationCb"),En(this,"wrappedEmit"),En(this,"loadListener"),En(this,"pageHideListener"),En(this,"stylesheetManager"),En(this,"recordCrossOriginIframes"),En(this,"messageHandler"),En(this,"nestedIframeListeners",new Map),En(this,"attachedWindows",new WeakMap),En(this,"attachedDocuments",new WeakMap),En(this,"attachedIframes",new Map),En(this,"loadListenerDisposers",new WeakMap),En(this,"iframeElementsById",new Map),En(this,"pageHideHandlers",new WeakMap),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new bs(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.messageHandler=this.handleMessage.bind(this),this.recordCrossOriginIframes&&window.addEventListener("message",this.messageHandler)}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}registerLoadListenerDisposer(e,t){var r=this.loadListenerDisposers.get(e);r||this.loadListenerDisposers.set(e,r=new Set),r.add(t);var i=this.mirror.getId(e);-1!==i&&this.iframeElementsById.set(i,e)}getIframeElementById(e){var t,r,i;return null!==(t=null!==(r=null==(i=this.attachedIframes.get(e))?void 0:i.element)&&void 0!==r?r:this.iframeElementsById.get(e))&&void 0!==t?t:null}forgetIframeId(e){this.attachedIframes.delete(e),this.iframeElementsById.delete(e)}disposeLoadListeners(e){var t=this.loadListenerDisposers.get(e);t&&(t.forEach((e=>Ro(e))),this.loadListenerDisposers.delete(e))}removePageHideListener(e){var t=this.pageHideHandlers.get(e);t&&(t.forEach((e=>{Eo(e.win,"pagehide",e.handler)})),this.pageHideHandlers.delete(e))}addLoadListener(e){this.loadListener=e}addPageHideListener(e){this.pageHideListener=e}removeLoadListener(){this.loadListener=void 0}trackIframeContent(e,t){var r=this.mirror.getId(e);return this.attachedIframes.set(r,{element:e,content:t}),r}attachIframe(e,t){var r,i=this.trackIframeContent(e,t);if(e.contentDocument){var n=this.attachedDocuments.get(e);n||this.attachedDocuments.set(e,n=new Set),n.add(e.contentDocument)}this.mutationCb({adds:[{parentId:i,nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0});var a=e.contentWindow;if(this.recordCrossOriginIframes&&a&&!this.nestedIframeListeners.has(a)){var o=this.handleMessage.bind(this);Ro((()=>{a.addEventListener("message",o),this.nestedIframeListeners.set(a,o);var t=this.attachedWindows.get(e);t||this.attachedWindows.set(e,t=new Set),t.add(a)}))}Ro((()=>{var t=e.contentWindow;if(t){var r=this.pageHideHandlers.get(e);if(r)for(var i of r)if(i.win===t)return;var n=()=>{var t;null==(t=this.pageHideListener)||t.call(this,e),e.contentDocument&&this.mirror.removeNodeFromMap(e.contentDocument),e.contentWindow&&this.crossOriginIframeMap.delete(e.contentWindow)};t.addEventListener("pagehide",n),r||this.pageHideHandlers.set(e,r=new Set),r.add({win:t,handler:n})}})),null==(r=this.loadListener)||r.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){var t=e;if("rrweb"===t.data.type&&t.origin===t.data.origin&&e.source){var r=this.crossOriginIframeMap.get(e.source);if(r){var i=this.transformCrossOriginEvent(r,t.data.event);i&&this.wrappedEmit(i,t.data.isCheckout)}}}transformCrossOriginEvent(e,t){var r;switch(t.type){case Rn.FullSnapshot:this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);var i=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,i),this.patchRootIdOnNode(t.data.node,i),this.trackIframeContent(e,t.data.node),{timestamp:t.timestamp,type:Rn.IncrementalSnapshot,data:{source:An.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case Rn.Meta:case Rn.Load:case Rn.DomContentLoaded:return!1;case Rn.Plugin:return t;case Rn.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case Rn.IncrementalSnapshot:switch(t.data.source){case An.Mutation:return t.data.adds.forEach((t=>{this.replaceIds(t,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(t.node,e);var r=this.crossOriginIframeRootIdMap.get(e);r&&this.patchRootIdOnNode(t.node,r)})),t.data.removes.forEach((t=>{this.replaceIds(t,e,["parentId","id"])})),t.data.attributes.forEach((t=>{this.replaceIds(t,e,["id"])})),t.data.texts.forEach((t=>{this.replaceIds(t,e,["id"])})),t;case An.Drag:case An.TouchMove:case An.MouseMove:return t.data.positions.forEach((t=>{this.replaceIds(t,e,["id"])})),t;case An.ViewportResize:return!1;case An.MediaInteraction:case An.MouseInteraction:case An.Scroll:case An.CanvasMutation:case An.Input:return this.replaceIds(t.data,e,["id"]),t;case An.StyleSheetRule:case An.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case An.Font:return t;case An.Selection:return t.data.ranges.forEach((t=>{this.replaceIds(t,e,["start","end"])})),t;case An.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),null==(r=t.data.styles)||r.forEach((t=>{this.replaceStyleIds(t,e,["styleId"])})),t}}return!1}replace(e,t,r,i){for(var n of i)(Array.isArray(t[n])||"number"==typeof t[n])&&(t[n]=Array.isArray(t[n])?e.getIds(r,t[n]):e.getId(r,t[n]));return t}replaceIds(e,t,r){return this.replace(this.crossOriginIframeMirror,e,t,r)}replaceStyleIds(e,t,r){return this.replace(this.crossOriginIframeStyleMirror,e,t,r)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach((e=>{this.replaceIdOnNode(e,t)}))}patchRootIdOnNode(e,t){e.type===Fn.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach((e=>{this.patchRootIdOnNode(e,t)}))}removeIframeById(e){var t=this.attachedIframes.get(e),r=(null==t?void 0:t.element)||this.iframeElementsById.get(e)||this.mirror.getNode(e);if(this.iframeElementsById.delete(e),r){var i=r.contentWindow,n=this.attachedWindows.get(r);n&&(n.forEach((e=>{var t=this.nestedIframeListeners.get(e);t&&(Eo(e,"message",t),this.nestedIframeListeners.delete(e)),this.crossOriginIframeMap.delete(e)})),this.attachedWindows.delete(r)),i&&this.nestedIframeListeners.has(i)&&(Eo(i,"message",this.nestedIframeListeners.get(i)),this.nestedIframeListeners.delete(i)),i&&this.crossOriginIframeMap.delete(i),this.iframes.delete(r),this.disposeLoadListeners(r),this.removePageHideListener(r);var a=this.attachedDocuments.get(r);a&&(a.forEach((e=>{Ro((()=>this.mirror.removeNodeFromMap(e)))})),Ro((()=>ls(r,a))),this.attachedDocuments.delete(r))}t&&this.attachedIframes.delete(e)}cleanupDetachedIframes(){if(0!==this.attachedIframes.size){var e=[];this.attachedIframes.forEach(((t,r)=>{this.mirror.has(r)||e.push(r)})),e.forEach((e=>this.removeIframeById(e)))}}reattachIframes(){this.attachedIframes.forEach(((e,t)=>{var r=e.content;this.mirror.has(t)?this.mutationCb({adds:[{parentId:t,nextId:null,node:r}],removes:[],texts:[],attributes:[],isAttachIframe:!0}):this.attachedIframes.delete(t)}))}destroy(){this.recordCrossOriginIframes&&Eo(window,"message",this.messageHandler),this.nestedIframeListeners.forEach(((e,t)=>{Eo(t,"message",e)})),this.nestedIframeListeners.clear();var e=new Set;this.iframeElementsById.forEach((t=>e.add(t))),this.attachedIframes.forEach((t=>e.add(t.element))),e.forEach((e=>{this.disposeLoadListeners(e),this.removePageHideListener(e)})),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}}class ks{constructor(e){En(this,"shadowDoms",new WeakSet),En(this,"mutationCb"),En(this,"scrollCb"),En(this,"bypassOptions"),En(this,"mirror"),En(this,"restoreHandlers",[]),this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(e,t){var r,i;if(Ma(e)&&!this.shadowDoms.has(e)){this.shadowDoms.add(e);var n=null!==(r=null==(i=Gn.host(e))?void 0:i.ownerDocument)&&void 0!==r?r:t,a=ss(h({},this.bypassOptions,{doc:n,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e),o=a.observer,s=a.buffer;this.restoreHandlers.push({doc:n,handler(){o.disconnect(),s.destroy(),s.releaseCanvasManager();var e=as.indexOf(s);-1!==e&&as.splice(e,1)}}),this.restoreHandlers.push({doc:n,handler:us(h({},this.bypassOptions,{scrollCb:this.scrollCb,doc:e,mirror:this.mirror}))}),setTimeout((()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(Gn.host(e))),this.restoreHandlers.push({doc:n,handler:ps({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e)})}),0)}}observeAttachShadow(e){e.contentWindow&&e.contentDocument&&this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}patchAttachShadow(e,t){var r=this;this.restoreHandlers.push({doc:t,handler:Zn(e.prototype,"attachShadow",(function(e){return function(i){var n=e.call(this,i),a=Gn.shadowRoot(this);return a&&Qo(this)&&r.addShadowRoot(a,t),n}}))})}reset(){this.restoreHandlers.forEach((e=>{var t=e.handler;try{t()}catch(e){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}resetForDoc(e){var t=[];for(var r of this.restoreHandlers)if(r.doc===e)try{r.handler()}catch(e){}else t.push(r);this.restoreHandlers=t}}var _s="skip-frame";function Ss(e){if("object"!=typeof e||null===e)return!1;var t=e.y,r=e.width,i=e.height;return Number.isFinite(e.x)&&Number.isFinite(t)&&Number.isFinite(r)&&Number.isFinite(i)&&r>=0&&i>=0}for(var xs="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Cs="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Ms=0;64>Ms;Ms++)Cs[xs.charCodeAt(Ms)]=Ms;var Ts=new Map,Is=(e,t,r)=>{if(e&&(As(e,t)||"object"==typeof e)){var i=function(e,t){var r=Ts.get(e);return r||Ts.set(e,r=new Map),r.has(t)||r.set(t,[]),r.get(t)}(r,e.constructor.name),n=i.indexOf(e);return-1===n&&(n=i.length,i.push(e)),n}};function Es(e,t,r,i){if(e instanceof Array)return e.map((e=>Es(e,t,r,i)));if(null===e)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray)return{rr_type:e.constructor.name,args:[Object.values(e)]};if(e instanceof ArrayBuffer){var n=e.constructor.name,a=function(e){var t,r=new Uint8Array(e),i=r.length,n="";for(t=0;i>t;t+=3)n+=xs[r[t]>>2],n+=xs[(3&r[t])<<4|r[t+1]>>4],n+=xs[(15&r[t+1])<<2|r[t+2]>>6],n+=xs[63&r[t+2]];return i%3==2?n=n.substring(0,n.length-1)+"=":i%3==1&&(n=n.substring(0,n.length-2)+"=="),n}(e);return{rr_type:n,base64:a}}return e instanceof DataView?{rr_type:e.constructor.name,args:[Es(e.buffer,t,r,i),e.byteOffset,e.byteLength]}:e instanceof HTMLImageElement?{rr_type:e.constructor.name,src:e.src}:e instanceof HTMLCanvasElement?{rr_type:"HTMLImageElement",src:e.toDataURL(i.type,i.quality)}:e instanceof ImageData?{rr_type:e.constructor.name,args:[Es(e.data,t,r,i),e.width,e.height]}:As(e,t)||"object"==typeof e?{rr_type:e.constructor.name,index:Is(e,t,r)}:e}var Rs=(e,t,r,i)=>e.map((e=>Es(e,t,r,i))),As=(e,t)=>{var r=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((e=>"function"==typeof t[e]));return Boolean(r.find((r=>e instanceof t[r])))},Ls=["webgl","webgl2"];function Os(e){return"nodeType"in e}function Ps(e,t,r,i){var n=[];try{if(i){var a=function(e,t,r){var i=e.GPUCanvasContext;if((null==i?void 0:i.prototype)&&"function"==typeof i.prototype.configure)return Zn(i.prototype,"configure",(function(i){return function(n){var a=function(e){var t=e.canvas;return t&&"object"==typeof t?t:null}(this);if(!a||Os(a)&&Bo(a,t,r,!0))return i.call(this,n);Os(a)&&!("__context"in a)&&(a.__context="webgpu");var o=function(e){var t=e.GPUTextureUsage;return t?t.COPY_SRC|t.RENDER_ATTACHMENT:null}(e);return i.call(this,null!==o&&n?h({},n,{usage:"number"==typeof n.usage?n.usage|o:o}):n)}}))}(e,t,r);a&&n.push(a)}var o=Zn(e.HTMLCanvasElement.prototype,"getContext",(function(e){return function(n){for(var a=function(e){return"experimental-webgl"===e?"webgl":e}(n),o=arguments.length,s=new Array(o>1?o-1:0),u=1;o>u;u++)s[u-1]=arguments[u];if(!Bo(this,t,r,!0)&&("__context"in this||(this.__context=a),i&&Ls.includes(a)))if(s[0]&&"object"==typeof s[0]){var l=s[0];l.preserveDrawingBuffer||(l.preserveDrawingBuffer=!0)}else s.splice(0,1,{preserveDrawingBuffer:!0});return e.apply(this,[n,...s])}}));n.push(o)}catch(e){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{n.forEach((e=>e()))}}function Ds(e,t,r,i,n,a,o){var s=[],u=Object.getOwnPropertyNames(e),l=function(u){if(["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(u))return 0;try{if("function"!=typeof e[u])return 0;var l=Zn(e,u,(function(e){return function(){for(var s=arguments.length,l=new Array(s),h=0;s>h;h++)l[h]=arguments[h];var c=e.apply(this,l);if(Is(c,a,this),this.canvas&&"tagName"in this.canvas&&!Bo(this.canvas,i,n,!0)){var d=Rs(l,a,this,o);r(this.canvas,{type:t,property:u,args:d})}return c}}));s.push(l)}catch(a){var h=Po(e,u,{set(e){this.canvas&&"tagName"in this.canvas&&!Bo(this.canvas,i,n,!0)&&r(this.canvas,{type:t,property:u,args:[e],setter:!0})}});s.push(h)}};for(var h of u)l(h);return s}var Fs,Ns,qs,js='(function() {\n "use strict";\n var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";\n var lookup = typeof Uint8Array === "undefined" ? [] : new Uint8Array(256);\n for (var i = 0; i < chars.length; i++) {\n lookup[chars.charCodeAt(i)] = i;\n }\n var encode = function(arraybuffer) {\n var bytes = new Uint8Array(arraybuffer), i2, len = bytes.length, base64 = "";\n for (i2 = 0; i2 < len; i2 += 3) {\n base64 += chars[bytes[i2] >> 2];\n base64 += chars[(bytes[i2] & 3) << 4 | bytes[i2 + 1] >> 4];\n base64 += chars[(bytes[i2 + 1] & 15) << 2 | bytes[i2 + 2] >> 6];\n base64 += chars[bytes[i2 + 2] & 63];\n }\n if (len % 3 === 2) {\n base64 = base64.substring(0, base64.length - 1) + "=";\n } else if (len % 3 === 1) {\n base64 = base64.substring(0, base64.length - 2) + "==";\n }\n return base64;\n };\n const lastFingerprintMap = /* @__PURE__ */ new Map();\n const transparentFingerprintMap = /* @__PURE__ */ new Map();\n const lastSentAtMap = /* @__PURE__ */ new Map();\n const PROVIDER_KEYFRAME_INTERVAL_MS = 3e4;\n function hashPixels(data) {\n const view = new Uint32Array(\n data.buffer,\n data.byteOffset,\n data.byteLength >>> 2\n );\n let primaryHash = 2166136261;\n let secondaryHash = 2654435769;\n for (let i2 = 0; i2 < view.length; i2++) {\n primaryHash ^= view[i2];\n primaryHash = Math.imul(primaryHash, 16777619);\n secondaryHash ^= view[i2];\n secondaryHash = Math.imul(secondaryHash, 2246822507);\n }\n return `${(primaryHash >>> 0).toString(16)}:${(secondaryHash >>> 0).toString(16)}`;\n }\n function frameFingerprint(width, height, data) {\n return `${width}x${height}:${hashPixels(data)}`;\n }\n function transparentFingerprint(width, height) {\n const pixelCount = width * height;\n let hash = transparentFingerprintMap.get(pixelCount);\n if (hash === void 0) {\n hash = hashPixels(new Uint8ClampedArray(pixelCount * 4));\n transparentFingerprintMap.set(pixelCount, hash);\n }\n return `${width}x${height}:${hash}`;\n }\n const worker = self;\n let reusableCanvas = null;\n let reusableCtx = null;\n worker.onmessage = async function(e) {\n if ("resetFrameDedup" in e.data) {\n lastFingerprintMap.clear();\n return;\n }\n if ("OffscreenCanvas" in globalThis) {\n const {\n id,\n bitmap,\n width,\n height,\n displayWidth,\n displayHeight,\n dataURLOptions,\n maskRegions\n } = e.data;\n try {\n if (!reusableCanvas || reusableCanvas.width !== width || reusableCanvas.height !== height) {\n reusableCanvas = new OffscreenCanvas(width, height);\n reusableCtx = reusableCanvas.getContext("2d", {\n willReadFrequently: true\n });\n }\n const ctx = reusableCtx;\n ctx.clearRect(0, 0, width, height);\n ctx.drawImage(bitmap, 0, 0);\n bitmap.close();\n if (maskRegions) {\n ctx.fillStyle = "black";\n for (const region of maskRegions) {\n ctx.fillRect(region.x, region.y, region.width, region.height);\n }\n }\n const fingerprint = frameFingerprint(\n width,\n height,\n ctx.getImageData(0, 0, width, height).data\n );\n const lastFingerprint = lastFingerprintMap.get(id) ?? transparentFingerprint(width, height);\n if (fingerprint === lastFingerprint) {\n const lastSentAt = lastSentAtMap.get(id);\n const keyframeDue = maskRegions !== void 0 && lastSentAt !== void 0 && Date.now() - lastSentAt >= PROVIDER_KEYFRAME_INTERVAL_MS;\n if (!keyframeDue) {\n return worker.postMessage({ id });\n }\n }\n const blob = await reusableCanvas.convertToBlob(dataURLOptions);\n const arrayBuffer = await blob.arrayBuffer();\n worker.postMessage({\n id,\n type: blob.type,\n base64: encode(arrayBuffer),\n // cpu intensive\n displayWidth,\n displayHeight\n });\n lastFingerprintMap.set(id, fingerprint);\n lastSentAtMap.set(id, Date.now());\n } catch {\n worker.postMessage({ id });\n }\n } else {\n e.data.bitmap.close();\n return worker.postMessage({ id: e.data.id });\n }\n };\n})();\n',Bs="undefined"!=typeof self&&self.Blob&&new Blob([js],{type:"text/javascript;charset=utf-8"});function Hs(e){var t;try{if(!(t=Bs&&(self.URL||self.webkitURL).createObjectURL(Bs)))throw"";var r=new Worker(t,{name:null==e?void 0:e.name});return r.addEventListener("error",(()=>{(self.URL||self.webkitURL).revokeObjectURL(t)})),r}catch(t){return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(js),{name:null==e?void 0:e.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}class $s{constructor(e){En(this,"pendingCanvasMutations",new Map),En(this,"rafStamps",{latestId:0,invokeId:null}),En(this,"mirror"),En(this,"mutationCb"),En(this,"resetObservers"),En(this,"frozen",!1),En(this,"locked",!1),En(this,"rafIdTimestamp",null),En(this,"rafIdFlush",null),En(this,"refCount",0),En(this,"torndown",!1),En(this,"resetFrameDedup",null),En(this,"processMutation",((e,t)=>{!(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId)&&this.rafStamps.invokeId||(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(e)||this.pendingCanvasMutations.set(e,[]),this.pendingCanvasMutations.get(e).push(t)}));var t=e.sampling,r=void 0===t?"all":t,i=e.win,n=e.blockClass,a=e.blockSelector,o=e.recordCanvas,s=e.dataURLOptions,u=e.resolutionScale,l=e.canvasMasking;this.mutationCb=e.mutationCb,this.mirror=e.mirror,o&&"all"===r&&this.initCanvasMutationObserver(i,n,a,s),o&&"number"==typeof r&&this.initCanvasFPSObserver(r,i,n,a,{dataURLOptions:s,resolutionScale:u,canvasMasking:l})}onFullSnapshot(){var e;null==(e=this.resetFrameDedup)||e.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}initCanvasFPSObserver(e,t,r,i,n){var a=this;if("OffscreenCanvas"in t){var o,s="number"==typeof n.resolutionScale&&Number.isFinite(n.resolutionScale)?Math.min(1,Math.max(.1,n.resolutionScale)):1,u=Ps(t,r,i,!0),h=new Map;try{o=new Hs}catch(e){return}var c=!1;o.onerror=()=>{var e;c=!0,cancelAnimationFrame(d),null==(e=o.terminate)||e.call(o),this.resetFrameDedup=null},this.resetFrameDedup=()=>{o.postMessage({resetFrameDedup:!0})},o.onmessage=e=>{var t=e.data.id;if(h.set(t,!1),"base64"in e.data){var r=e.data,i=r.displayWidth,n=r.displayHeight;this.mutationCb({id:t,type:Pn["2D"],commands:[{property:"clearRect",args:[0,0,i,n]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:r.base64}],type:r.type}]},0,0,i,n]}],displayWidth:i,displayHeight:n})}};var d,v=1e3/e,f=0,p=e=>{var u,g;c||(f&&v>e-f||(f=e,(u=[],g=e=>{try{e.querySelectorAll("canvas").forEach((e=>{Bo(e,r,i,!0)||u.push(e)})),e.querySelectorAll("*").forEach((e=>{e.shadowRoot&&g(e.shadowRoot)}))}catch(e){}},g(t.document),u).forEach(function(){var e=l((function*(e){var t,r,i=a.mirror.getId(e);if(!h.get(i)&&0!==e.width&&0!==e.height){h.set(i,!0);try{if(["webgl","webgl2"].includes(e.__context)){var u=e.getContext(e.__context);if(null==(t=null==u?void 0:u.isContextLost)?void 0:t.call(u))return void h.set(i,!1);!1===(null==(r=null==u?void 0:u.getContextAttributes())?void 0:r.preserveDrawingBuffer)&&u.clear(u.COLOR_BUFFER_BIT)}var l=e.clientWidth||e.width,c=e.clientHeight||e.height,d=Math.max(1,Math.round(l*s)),v=Math.max(1,Math.round(c*s)),f=function(e,t,r,i,n,a){if(e&&"function"==typeof e.regionsFn){var o;try{o=e.regionsFn(t)}catch(e){return _s}if(void 0!==o){if(!Array.isArray(o)||!o.every(Ss))return _s;var s=r/n,u=i/a;return o.filter((e=>e.width>0&&e.height>0)).map((e=>{var t=Math.floor(e.x*s),r=Math.floor(e.y*u);return{x:t,y:r,width:Math.ceil((e.x+e.width)*s)-t,height:Math.ceil((e.y+e.height)*u)-r}}))}}}(n.canvasMasking,e,d,v,l,c);if(f===_s)return void h.set(i,!1);var p=yield createImageBitmap(e,1>s?{resizeWidth:d,resizeHeight:v,resizeQuality:"medium"}:{resizeWidth:d,resizeHeight:v});o.postMessage({id:i,bitmap:p,width:d,height:v,displayWidth:l,displayHeight:c,dataURLOptions:n.dataURLOptions,maskRegions:f},[p])}catch(e){h.set(i,!1)}}}));return function(t){return e.apply(this,arguments)}}())),d=requestAnimationFrame(p))};d=requestAnimationFrame(p),this.resetObservers=()=>{var e;u(),cancelAnimationFrame(d),null==(e=o.terminate)||e.call(o),this.resetFrameDedup=null}}}initCanvasMutationObserver(e,t,r,i){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var n=Ps(e,t,r,!1),a=function(e,t,r,i,n){var a=[],o=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype),s=function(o){try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[o])return 1;var s=Zn(t.CanvasRenderingContext2D.prototype,o,(function(a){return function(){for(var s=arguments.length,u=new Array(s),l=0;s>l;l++)u[l]=arguments[l];return Bo(this.canvas,r,i,!0)||setTimeout((()=>{var r=Rs(u,t,this,n);e(this.canvas,{type:Pn["2D"],property:o,args:r})}),0),a.apply(this,u)}}));a.push(s)}catch(n){var u=Po(t.CanvasRenderingContext2D.prototype,o,{set(t){Bo(this.canvas,r,i,!0)||e(this.canvas,{type:Pn["2D"],property:o,args:[t],setter:!0})}});a.push(u)}};for(var u of o)s(u);return()=>{a.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,r,i),o=function(e,t,r,i,n){var a=[];return void 0!==t.WebGLRenderingContext&&a.push(...Ds(t.WebGLRenderingContext.prototype,Pn.WebGL,e,r,i,t,n)),void 0!==t.WebGL2RenderingContext&&a.push(...Ds(t.WebGL2RenderingContext.prototype,Pn.WebGL2,e,r,i,t,n)),()=>{a.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,r,i);this.resetObservers=()=>{n(),a(),o()}}startPendingCanvasMutationFlusher(){this.rafIdFlush=requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}startRAFTimestamping(){var e=t=>{this.rafStamps.latestId=t,this.rafIdTimestamp=requestAnimationFrame(e)};this.rafIdTimestamp=requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach(((e,t)=>{var r=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,r)})),this.rafIdFlush=requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}flushPendingCanvasMutationFor(e,t){if(!this.frozen&&!this.locked){var r=this.pendingCanvasMutations.get(e);if(r&&-1!==t){var i=r.map((e=>{var t=function(e,t){if(null==e)return{};var r={};for(var i in e)if({}.hasOwnProperty.call(e,i)){if(-1!==t.indexOf(i))continue;r[i]=e[i]}return r}(e,Tn);return t}));this.mutationCb({id:t,type:r[0].type,commands:i}),this.pendingCanvasMutations.delete(e)}}}}class Us{constructor(e){var t;En(this,"trackedLinkElements",new WeakSet),En(this,"pendingDeferredSheets",new Set),En(this,"mutationCb"),En(this,"adoptedStyleSheetCb"),En(this,"maskAllElementAttributes"),En(this,"maskAttributeFn"),En(this,"styleMirror",new Zo),this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb,this.maskAllElementAttributes=null!==(t=e.maskAllElementAttributes)&&void 0!==t&&t,this.maskAttributeFn=e.maskAttributeFn}attachLinkElement(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}beginDeferredLinkInlining(e,t){if(-1===t||!e.isConnected)return null;var r=null,i=null;try{(i=e.sheet)&&(r=Na(i))}catch(e){}if(!r||!i)return _a(),null;var n=r,a=!1,o={sheet:i,invalidate(){a=!0}};this.pendingDeferredSheets.add(o);var s=!1;return{advance:r=>{if(s)return!0;var u,l,h=Jn(),c=ea(),d=!0;try{if(a)return s=!0,_a(),!0;if(!n.advance(r))return d=!1,!1;s=!0;var v=n.text();if(!e.isConnected)return!0;var f=null;try{f=e.sheet}catch(e){}return f!==i?(_a(),!0):v?(this.emitCssTextMutation(e,t,v),!0):(_a(),!0)}finally{d&&this.pendingDeferredSheets.delete(o),ta(u=Jn()-h,null!=(l=c)?l:Yn)||(da.totalMs+=u,u>da.slowestSliceMs&&(da.slowestSliceMs=u))}},remainingRules:()=>n.remainingRules(),discard:()=>{this.pendingDeferredSheets.delete(o)}}}onCssomSheetMutation(e){if(e&&0!==this.pendingDeferredSheets.size)for(var t of this.pendingDeferredSheets)t.sheet===e&&(this.pendingDeferredSheets.delete(t),t.invalidate())}inlineDeferredLinkElement(e,t){var r;null==(r=this.beginDeferredLinkInlining(e,t))||r.advance(1/0)}emitCssTextMutation(e,t,r){this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t,attributes:{_cssText:$a({element:e,name:"_cssText",value:r,maskAllElementAttributes:this.maskAllElementAttributes,maskAttributeFn:this.maskAttributeFn})}}]})}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){var r=this;if(0!==e.length){var i={id:t,styleIds:[]},n=[],a=function(e){var t;if(r.styleMirror.has(e))t=r.styleMirror.getId(e);else{var a=r.styleMirror.add(e);t=a;var o=Jn();try{ba((()=>{try{var t=e.rules||e.cssRules;t&&ya(t)}catch(e){}n.push({styleId:a,rules:Array.from(e.rules||CSSRule,((t,r)=>({rule:Aa(t,e.href),index:r})))})}))}finally{wa(Jn()-o)}}i.styleIds.push(t)};for(var o of e)a(o);n.length>0&&(i.styles=n),this.adoptedStyleSheetCb(i)}}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet,this.pendingDeferredSheets.clear(),bo.forEach((e=>e.abort())),bo.clear()}trackStylesheetInLinkElement(e){}}class Ws{constructor(){En(this,"nodeMap",new WeakMap),En(this,"active",!1)}inOtherBuffer(e,t){var r=this.nodeMap.get(e);return r&&Array.from(r).some((e=>e!==t))}add(e,t){this.active||(this.active=!0,requestAnimationFrame((()=>{this.nodeMap=new WeakMap,this.active=!1}))),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}destroy(){}}var zs=!1;try{if(2!==Array.from([1],(e=>2*e))[0]){var Vs=document.createElement("iframe");document.body.appendChild(Vs),Array.from=(null==(Mn=Vs.contentWindow)?void 0:Mn.Array.from)||Array.from,document.body.removeChild(Vs)}}catch(e){console.debug("Unable to override Array.from",e)}var Zs=new qa,Gs=new Set([An.Mutation,An.MediaInteraction,An.StyleSheetRule,An.CanvasMutation,An.Font,An.Log,An.StyleDeclaration,An.AdoptedStyleSheet]);function Qs(e){var t=window;if("function"==typeof t.requestIdleCallback){var r=t.requestIdleCallback(e,{timeout:2e3});return{cancel(){var e;return null==(e=t.cancelIdleCallback)?void 0:e.call(t,r)}}}var i=setTimeout(e,250);return{cancel:()=>clearTimeout(i)}}function Js(e){var t;void 0===e&&(e={});var r=e,i=r.emit,n=r.checkoutEveryNms,a=r.checkoutEveryNth,o=r.blockClass,s=void 0===o?"rr-block":o,u=r.blockSelector,l=void 0===u?null:u,c=r.ignoreClass,d=void 0===c?"rr-ignore":c,v=r.ignoreSelector,f=void 0===v?null:v,p=r.maskTextClass,g=void 0===p?"rr-mask":p,m=r.maskTextSelector,y=void 0===m?null:m,b=r.inlineStylesheet,w=void 0===b||b,k=r.inlineStylesheetBudgetRules,_=r.maskAllInputs,S=r.maskInputOptions,x=r.slimDOMOptions,C=r.maskInputFn,M=r.maskTextFn,T=r.maskAllElementAttributes,I=void 0!==T&&T,E=r.maskAttributeFn,R=r.hooks,A=r.packFn,L=r.sampling,O=void 0===L?{}:L,P=r.dataURLOptions,D=void 0===P?{}:P,F=r.canvasResolutionScale,N=r.canvasMasking,q=r.mousemoveWait,j=r.recordDOM,B=void 0===j||j,H=r.recordCanvas,U=void 0!==H&&H,W=r.recordCrossOriginIframes,z=void 0!==W&&W,V=r.recordAfter,Z=void 0===V?"DOMContentLoaded"===e.recordAfter?e.recordAfter:"load":V,G=r.userTriggeredOnInput,Q=void 0!==G&&G,J=r.collectFonts,Y=void 0!==J&&J,K=r.inlineImages,X=void 0!==K&&K,ee=r.plugins,te=r.keepIframeSrcFn,re=void 0===te?()=>!1:te,ie=r.ignoreCSSAttributes,ne=void 0===ie?new Set([]):ie,ae=r.attributeFilter;Ko=r.errorHandler;var oe=h({type:"image/webp",quality:.4,maxBase64ImageLength:1048576},D),se=!z||window.parent===window,ue=!1;if(!se)try{window.parent.document&&(ue=!1)}catch(e){ue=!0}if(se&&!i)throw new Error("emit function is required");if(!se&&!ue)return()=>{};void 0!==q&&void 0===O.mousemove&&(O.mousemove=q),Zs.reset();var le,he=!0===_?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:void 0!==S?S:{password:!0},ce=Mo(void 0!==x&&x);!function(e){void 0===e&&(e=window),"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=[].forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=[].forEach)}();var de,ve,fe=0,pe=new Map,ge=e=>{for(var t of ee||[])t.eventProcessor&&(e=t.eventProcessor(e));return A&&!ue&&(e=A(e)),e};Fs=(e,t)=>{var r,o=e;if(o.timestamp=Do(),!(null==(r=as[0])?void 0:r.isFrozen())||o.type===Rn.FullSnapshot||o.type===Rn.IncrementalSnapshot&&Gs.has(o.data.source)||as.forEach((e=>e.unfreeze())),se)null==i||i(ge(o),t);else if(ue){var s={type:"rrweb",event:ge(o),origin:window.location.origin,isCheckout:t};window.parent.postMessage(s,"*")}if(o.type===Rn.FullSnapshot)le=o,fe=0;else if(o.type===Rn.IncrementalSnapshot){if(o.data.source===An.Mutation&&o.data.isAttachIframe)return;fe++,(a&&fe>=a||n&&o.timestamp-le.timestamp>n)&&Ns(!0)}};var me=e=>{if(e.removes&&e.removes.length>0){var t=e.adds.length>0?new Set(e.adds.map((e=>e.node.id))):null,r=new Set;if(e.adds.length>0)for(var i of e.adds){var n=Zs.getNode(i.node.id);n&&"IFRAME"===n.nodeName&&r.add(n)}e.removes.forEach((e=>{var i=e.id;if(!t||!t.has(i)){var n=ke.getIframeElementById(i);n&&r.has(n)?ke.forgetIframeId(i):(null==de||de(i),ke.removeIframeById(i))}})),null==ve||ve(),ke.cleanupDetachedIframes()}Fs({type:Rn.IncrementalSnapshot,data:h({source:An.Mutation},e)})},ye=e=>Fs({type:Rn.IncrementalSnapshot,data:h({source:An.Scroll},e)}),be=e=>Fs({type:Rn.IncrementalSnapshot,data:h({source:An.CanvasMutation},e)}),we=new Us({mutationCb:me,adoptedStyleSheetCb:e=>Fs({type:Rn.IncrementalSnapshot,data:h({source:An.AdoptedStyleSheet},e)}),maskAllElementAttributes:I,maskAttributeFn:E}),ke=new ws({mirror:Zs,mutationCb:me,stylesheetManager:we,recordCrossOriginIframes:z,wrappedEmit:Fs});for(var _e of ee||[])_e.getMirror&&_e.getMirror({nodeMirror:Zs,crossOriginIframeMirror:ke.crossOriginIframeMirror,crossOriginIframeStyleMirror:ke.crossOriginIframeStyleMirror});var Se=new Ws,xe=null==N?void 0:N.configured;qs=new $s({recordCanvas:U,mutationCb:be,win:window,blockClass:s,blockSelector:l,mirror:Zs,sampling:O.canvas,dataURLOptions:oe,resolutionScale:F,canvasMasking:N});var Ce=new ks({mutationCb:me,scrollCb:ye,bypassOptions:{blockClass:s,blockSelector:l,maskTextClass:g,maskTextSelector:y,inlineStylesheet:w,maskInputOptions:he,dataURLOptions:oe,maskTextFn:M,maskInputFn:C,maskAllElementAttributes:I,maskAttributeFn:E,recordCanvas:U,canvasMaskingConfigured:xe,inlineImages:X,sampling:O,slimDOMOptions:ce,iframeManager:ke,stylesheetManager:we,canvasManager:qs,keepIframeSrcFn:re,processedNodeManager:Se,attributeFilter:ae},mirror:Zs});Ns=function(e){if(void 0===e&&(e=!1),B){fa(k);try{Fs({type:Rn.Meta,data:{href:window.location.href,width:qo(),height:No()}},e),null==t||t.cancel(),t=void 0,we.reset(),Ce.init(),as.forEach((e=>e.lock()));var r,i=null;try{i=function(e,t){var r=t||{},i=r.mirror,n=void 0===i?new qa:i,a=r.blockClass,o=void 0===a?"rr-block":a,s=r.blockSelector,u=void 0===s?null:s,l=r.maskTextClass,h=void 0===l?"rr-mask":l,c=r.maskTextSelector,d=void 0===c?null:c,v=r.inlineStylesheet,f=void 0===v||v,p=r.inlineImages,g=void 0!==p&&p,m=r.recordCanvas,y=void 0!==m&&m,b=r.canvasMaskingConfigured,w=r.maskAllInputs,k=void 0!==w&&w,_=r.maskTextFn,S=r.maskInputFn,x=r.maskAllElementAttributes,C=void 0!==x&&x,M=r.maskAttributeFn,T=r.slimDOM,I=r.dataURLOptions,E=r.preserveWhiteSpace,R=r.onSerialize,A=r.onIframeLoad,L=r.iframeLoadTimeout,O=r.onIframeListenerRegistered,P=r.onStylesheetLoad,D=r.stylesheetLoadTimeout,F=r.keepIframeSrcFn,N=void 0===F?()=>!1:F,q=r.maxDepth,j=r.inlineStylesheetBudgetRules,B=!0===k?{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===k?{password:!0}:k,H=Mo(void 0!==T&&T);fa(j);try{return Co(e,{doc:e,mirror:n,blockClass:o,blockSelector:u,maskTextClass:h,maskTextSelector:d,skipChild:!1,inlineStylesheet:f,maskInputOptions:B,maskTextFn:_,maskInputFn:S,maskAllElementAttributes:C,maskAttributeFn:M,slimDOMOptions:H,dataURLOptions:I,inlineImages:g,recordCanvas:y,canvasMaskingConfigured:b,preserveWhiteSpace:E,onSerialize:R,onIframeLoad:A,iframeLoadTimeout:L,onIframeListenerRegistered:O,onStylesheetLoad:P,stylesheetLoadTimeout:D,keepIframeSrcFn:N,newlyAddedElement:!1,maxDepth:q})}finally{pa()}}(document,{mirror:Zs,blockClass:s,blockSelector:l,maskTextClass:g,maskTextSelector:y,inlineStylesheet:w,maskAllInputs:he,inlineStylesheetBudgetRules:k,maskTextFn:M,maskInputFn:C,maskAllElementAttributes:I,maskAttributeFn:E,slimDOM:ce,dataURLOptions:oe,recordCanvas:U,canvasMaskingConfigured:xe,inlineImages:X,onSerialize(e){Wo(e,Zs)&&ke.addIframe(e),zo(e,Zs)&&we.trackLinkElement(e),Vo(e)&&Ce.addShadowRoot(Gn.shadowRoot(e),document)},onIframeLoad(e,t){ke.attachIframe(e,t),Ce.observeAttachShadow(e)},onIframeListenerRegistered(e,t){ke.registerLoadListenerDisposer(e,t)},onStylesheetLoad(e,t){we.attachLinkElement(e,t)},keepIframeSrcFn:re})}finally{a=ua,ua=[],r=a}if(!i)return console.warn("Failed to snapshot the document");if(Fs({type:Rn.FullSnapshot,data:{node:i,initialOffset:Fo(window)}},e),as.forEach((e=>e.unlock())),qs.onFullSnapshot(),r.length){var n=function(e,t,r){var i=!1,n=null,a=0,o=null,s=()=>null!==o||e.length>a,u=()=>{var r=e[a];e[a]=null,a+=1,r&&Ro((()=>{o=t.beginDeferredLinkInlining(r,Zs.getId(r))}))},l=()=>{if(o){var e=o,t=!0;Ro((()=>{t=e.advance(200)})),t&&(o=null)}},h=e=>{if(n=null,!i){var t=0;do{try{o||u(),l()}catch(e){null==o||o.discard(),o=null,Sa(1)}t+=1}while(!i&&s()&&(e?!e.didTimeout&&e.timeRemaining()>5:10>t));i||(s()?n=Qs(h):r())}};return n=Qs(h),{cancel(){i=!0,null==o||o.discard(),o=null,null==n||n.cancel(),n=null},flush(){if(!i){i=!0,null==n||n.cancel(),n=null;for(var t=0,h=0;s()&&50>t;){o||u();var c=o;if(c)if(Math.floor(c.remainingRules()/200)+1>50-t)c.discard(),o=null,h+=1;else{try{l()}catch(e){null==o||o.discard(),o=null,h+=1}t+=1}}if(s()||h>0){for(var d=h+(null!==o?1:0),v=a;e.length>v;v++)null!==e[v]&&(d+=1);Sa(d),null==o||o.discard(),o=null}r()}}}}(r,we,(()=>{t===n&&(t=void 0)}));t=n}z&&ke.reattachIframes(),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&we.adoptStyleSheets(document.adoptedStyleSheets,Zs.getId(document))}finally{pa()}var a}};try{var Me=[];for(var Te of(Me.push(Io("pagehide",(()=>{try{null==t||t.flush()}catch(e){}t=void 0}),window)),["visibilitychange","freeze","resume"]))Me.push(Io(Te,Xn,document));de=e=>{var t=pe.get(e);t&&(t.forEach((e=>{Ro(e);var t=Me.indexOf(e);-1!==t&&Me.splice(t,1)})),pe.delete(e))},ve=()=>{for(var e of pe){var t=e[0],r=Zs.getNode(t);if(r)try{r.contentDocument&&r.contentDocument.defaultView||null==de||de(t)}catch(e){null==de||de(t)}else null==de||de(t)}};var Ie=e=>{var t;return ns(gs)({mutationCb:me,mousemoveCb:(e,t)=>Fs({type:Rn.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>Fs({type:Rn.IncrementalSnapshot,data:h({source:An.MouseInteraction},e)}),scrollCb:ye,viewportResizeCb:e=>Fs({type:Rn.IncrementalSnapshot,data:h({source:An.ViewportResize},e)}),inputCb:e=>Fs({type:Rn.IncrementalSnapshot,data:h({source:An.Input},e)}),mediaInteractionCb:e=>Fs({type:Rn.IncrementalSnapshot,data:h({source:An.MediaInteraction},e)}),styleSheetRuleCb:e=>Fs({type:Rn.IncrementalSnapshot,data:h({source:An.StyleSheetRule},e)}),styleDeclarationCb:e=>Fs({type:Rn.IncrementalSnapshot,data:h({source:An.StyleDeclaration},e)}),canvasMutationCb:be,fontCb:e=>Fs({type:Rn.IncrementalSnapshot,data:h({source:An.Font},e)}),selectionCb(e){Fs({type:Rn.IncrementalSnapshot,data:h({source:An.Selection},e)})},customElementCb(e){Fs({type:Rn.IncrementalSnapshot,data:h({source:An.CustomElement},e)})},blockClass:s,ignoreClass:d,ignoreSelector:f,maskTextClass:g,maskTextSelector:y,maskInputOptions:he,inlineStylesheet:w,sampling:O,recordDOM:B,recordCanvas:U,canvasMaskingConfigured:xe,inlineImages:X,userTriggeredOnInput:Q,collectFonts:Y,doc:e,maskInputFn:C,maskTextFn:M,maskAllElementAttributes:I,maskAttributeFn:E,keepIframeSrcFn:re,blockSelector:l,slimDOMOptions:ce,dataURLOptions:oe,mirror:Zs,iframeManager:ke,stylesheetManager:we,shadowDomManager:Ce,processedNodeManager:Se,canvasManager:qs,ignoreCSSAttributes:ne,attributeFilter:ae,plugins:(null==(t=null==ee?void 0:ee.filter((e=>e.observer)))?void 0:t.map((e=>({observer:e.observer,options:e.options,callback:t=>Fs({type:Rn.Plugin,data:{plugin:e.name,payload:t}})}))))||[]},R)};ke.addLoadListener((e=>{try{var t=Zs.getId(e),r=Ie(e.contentDocument);if("function"==typeof r&&(Me.push(r),-1!==t)){var i=pe.get(t);i||pe.set(t,i=new Set),i.add(r)}}catch(e){console.warn(e)}})),ke.addPageHideListener((e=>{var t=Zs.getId(e);null==de||de(t),ls(e)}));var Ee=-1,Re=e=>Fs({type:Rn.Custom,data:{tag:"rrweb/fullscreen",payload:e}}),Ae=()=>{var e,t,r,i,n=document,a=null!==(e=null!==(t=null!==(r=null!==(i=n.fullscreenElement)&&void 0!==i?i:n.webkitFullscreenElement)&&void 0!==r?r:n.mozFullScreenElement)&&void 0!==t?t:n.msFullscreenElement)&&void 0!==e?e:null,o=a?Zs.getId(a):-1;o!==Ee&&(-1!==Ee&&Re({id:Ee,enter:!1}),Ee=o,-1!==o&&Re({id:o,enter:!0}))},Le=()=>{Ns();var e=Ie(document);"function"==typeof e&&Me.push(e),Me.push(Io("fullscreenchange",Ae)),Me.push(Io("webkitfullscreenchange",Ae)),Me.push(Io("mozfullscreenchange",Ae)),Me.push(Io("MSFullscreenChange",Ae)),zs=!0};return["interactive","complete"].includes(document.readyState)?Le():(Me.push(Io("DOMContentLoaded",(()=>{Fs({type:Rn.DomContentLoaded,data:{}}),"DOMContentLoaded"===Z&&Le()}))),Me.push(Io("load",(()=>{Fs({type:Rn.Load,data:{}}),"load"===Z&&Le()}),window))),()=>{try{null==t||t.flush()}catch(e){}t=void 0,Me.forEach((e=>Ro(e))),Se.destroy(),ke.removeLoadListener(),ke.destroy(),pe.clear(),Ce.reset(),Zs.reset(),zs=!1,Ko=void 0}}catch(e){console.warn(e)}}Js.addCustomEvent=(e,t)=>{if(!zs)throw new Error("please add custom event after start recording");Fs({type:Rn.Custom,data:{tag:e,payload:t}})},Js.freezePage=()=>{as.forEach((e=>e.freeze()))},Js.takeFullSnapshot=e=>{if(!zs)throw new Error("please take full snapshot after start recording");Ns(e)},Js.mirror=Zs;var Ys=Object.defineProperty,Ks=(e,t,r)=>((e,t,r)=>t in e?Ys(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);class Xs{constructor(e){Ks(this,"fileName"),Ks(this,"functionName"),Ks(this,"lineNumber"),Ks(this,"columnNumber"),this.fileName=e.fileName||"",this.functionName=e.functionName||"",this.lineNumber=e.lineNumber,this.columnNumber=e.columnNumber}toString(){var e=this.lineNumber||"",t=this.columnNumber||"";return this.functionName?this.functionName+" ("+this.fileName+":"+e+":"+t+")":this.fileName+":"+e+":"+t}}var eu=/(^|@)\S+:\d+/,tu=/^\s*at .*(\S+:\d+|\(native\))/m,ru=/^(eval@)?(\[native code])?$/,iu={parse(e){return e?void 0!==e.stacktrace||void 0!==e["opera#sourceloc"]?this.parseOpera(e):e.stack&&e.stack.match(tu)?this.parseV8OrIE(e):e.stack?this.parseFFOrSafari(e):[]:[]},extractLocation(e){if(-1===e.indexOf(":"))return[e];var t=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));if(!t)throw new Error("Cannot parse given url: "+e);return[t[1],t[2]||void 0,t[3]||void 0]},parseV8OrIE(e){return e.stack.split("\n").filter((function(e){return!!e.match(tu)}),this).map((function(e){e.indexOf("(eval ")>-1&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));var t=e.replace(/^\s+/,"").replace(/\(eval code/g,"("),r=t.match(/ (\((.+):(\d+):(\d+)\)$)/),i=(t=r?t.replace(r[0],""):t).split(/\s+/).slice(1),n=this.extractLocation(r?r[1]:i.pop()),a=i.join(" ")||void 0,o=["eval","<anonymous>"].indexOf(n[0])>-1?void 0:n[0];return new Xs({functionName:a,fileName:o,lineNumber:n[1],columnNumber:n[2]})}),this)},parseFFOrSafari(e){return e.stack.split("\n").filter((function(e){return!e.match(ru)}),this).map((function(e){if(e.indexOf(" > eval")>-1&&(e=e.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===e.indexOf("@")&&-1===e.indexOf(":"))return new Xs({functionName:e});var t=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=e.match(t),i=r&&r[1]?r[1]:void 0,n=this.extractLocation(e.replace(t,""));return new Xs({functionName:i,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})}),this)},parseOpera(e){return!e.stacktrace||e.message.indexOf("\n")>-1&&e.message.split("\n").length>e.stacktrace.split("\n").length?this.parseOpera9(e):e.stack?this.parseOpera11(e):this.parseOpera10(e)},parseOpera9(e){for(var t=/Line (\d+).*script (?:in )?(\S+)/i,r=e.message.split("\n"),i=[],n=2,a=r.length;a>n;n+=2){var o=t.exec(r[n]);o&&i.push(new Xs({fileName:o[2],lineNumber:parseFloat(o[1])}))}return i},parseOpera10(e){for(var t=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,r=e.stacktrace.split("\n"),i=[],n=0,a=r.length;a>n;n+=2){var o=t.exec(r[n]);o&&i.push(new Xs({functionName:o[3]||void 0,fileName:o[2],lineNumber:parseFloat(o[1])}))}return i},parseOpera11(e){return e.stack.split("\n").filter((function(e){return!!e.match(eu)&&!e.match(/^Error created at/)}),this).map((function(e){var t=e.split("@"),r=this.extractLocation(t.pop()),i=(t.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new Xs({functionName:i,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})}),this)}};function nu(e){if(!e||!e.outerHTML)return"";for(var t="";e.parentElement;){var r=e.localName;if(!r)break;r=r.toLowerCase();var i=e.parentElement,n=[];if(i.children&&i.children.length>0)for(var a=0;i.children.length>a;a++){var o=i.children[a];o.localName&&o.localName.toLowerCase&&o.localName.toLowerCase()===r&&n.push(o)}n.length>1&&(r+=":eq("+n.indexOf(e)+")"),t=r+(t?">"+t:""),e=i}return t}function au(e){return Array.isArray(e)}function ou(e){return"object"==typeof e&&null!==e&&!au(e)}function su(e,t){if(0===t)return!0;var r=Object.keys(e);for(var i of r)if(ou(e[i])&&su(e[i],t-1))return!0;return!1}function uu(e,t){var r={numOfKeysLimit:50,depthOfLimit:4};Object.assign(r,t);var i=[],n=[];return JSON.stringify(e,(function(e,t){if(i.length>0){var a=i.indexOf(this);~a?i.splice(a+1):i.push(this),~a?n.splice(a,1/0,e):n.push(e),~i.indexOf(t)&&(t=i[0]===t?"[Circular ~]":"[Circular ~."+n.slice(0,i.indexOf(t)).join(".")+"]")}else i.push(t);if(null===t)return t;if(void 0===t)return"undefined";if(ou(o=t)&&Object.keys(o).length>r.numOfKeysLimit||"function"==typeof o||ou(o)&&su(o,r.depthOfLimit))return function(e){var t=e.toString();return r.stringLengthLimit&&t.length>r.stringLengthLimit&&(t=t.slice(0,r.stringLengthLimit)+"..."),t}(t);var o;if("bigint"==typeof t)return t.toString()+"n";if(t instanceof Event){var s={};for(var u in t){var l=t[u];s[u]=au(l)?nu(l.length?l[0]:null):l}return s}return t instanceof Node?t instanceof HTMLElement?t?t.outerHTML:"":t.nodeName:t instanceof Error?t.stack?t.stack+"\nEnd of stack for Error object":t.name+": "+t.message:t}))}var lu={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 hu(e,t,r){var i,n=r?Object.assign({},lu,r):lu,a=n.logger;if(!a)return()=>{};i="string"==typeof a?t[a]:a;var o=0,s=!1,u=[];if(n.level.includes("error")){var l=t=>{var r=t.message,i=iu.parse(t.error).map((e=>e.toString())),a=[uu(r,n.stringifyOptions)];e({level:"error",trace:i,payload:a})};t.addEventListener("error",l),u.push((()=>{t.removeEventListener("error",l)}));var h=t=>{var r,i;t.reason instanceof Error?i=[uu("Uncaught (in promise) "+(r=t.reason).name+": "+r.message,n.stringifyOptions)]:(r=new Error,i=[uu("Uncaught (in promise)",n.stringifyOptions),uu(t.reason,n.stringifyOptions)]);var a=iu.parse(r).map((e=>e.toString()));e({level:"error",trace:a,payload:i})};t.addEventListener("unhandledrejection",h),u.push((()=>{t.removeEventListener("unhandledrejection",h)}))}for(var c of n.level)u.push(d(i,c));return()=>{u.forEach((e=>e()))};function d(t,r){var i=this;return t[r]?function(t,a,u){try{if(!(a in t))return()=>{};var l=t[a],h={next:l},c=(t=>function(){for(var a=arguments.length,u=new Array(a),l=0;a>l;l++)u[l]=arguments[l];if(t.apply(i,u),!("assert"===r&&u[0]||s)){s=!0;try{var h=iu.parse(new Error).map((e=>e.toString())).splice(1),c=("assert"===r?u.slice(1):u).map((e=>uu(e,n.stringifyOptions)));o++,n.lengthThreshold>o?e({level:r,trace:h,payload:c}):o===n.lengthThreshold&&e({level:"warn",trace:[],payload:[uu("The number of log records reached the threshold.")]})}catch(e){t("rrweb logger error:",e,...u)}finally{s=!1}}})((function(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];return h.next.apply(this,t)}));return"function"==typeof c&&(c.prototype=c.prototype||{},Object.defineProperties(c,{__rrweb_original__:{enumerable:!1,value:l},__rrweb_layer__:{enumerable:!1,value:h}})),t[a]=c,()=>{if(t[a]!==c)for(var e=e=>{var t;return"function"==typeof e?null!==(t=e.__rrweb_layer__)&&void 0!==t?t:e.__posthog_layer__:void 0},r=t[a],i=e(r);i;){if(i.next===c)return void(i.next=h.next);i=e(r=i.next)}else t[a]=h.next}}catch(e){return()=>{}}}(t,r):()=>{}}}var cu=e=>({name:"rrweb/console@1",observer:hu,options:e}),du=e=>"undefined"!=typeof Document&&e instanceof Document,vu=()=>{},fu=e=>{var t;if(k(e))return null!==(t=e.__posthog_layer__)&&void 0!==t?t:e.__rrweb_layer__};function pu(e,t,r){try{if(!(t in e))return vu;var i={next:e[t]},n=r((function(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];return i.next.apply(this,t)}));return k(n)&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__posthog_wrapped__:{enumerable:!1,value:!0},__posthog_layer__:{enumerable:!1,value:i}})),e[t]=n,()=>{if(e[t]!==n)for(var r=e[t],a=fu(r);a;){if(a.next===n)return void(a.next=i.next);a=fu(r=a.next)}else e[t]=i.next}}catch(e){return vu}}function gu(e,t){var r,i=function(e){try{return"string"==typeof e?new URL(e).hostname:"url"in e?new URL(e.url).hostname:e.hostname}catch(e){return null}}(e),n={hostname:i,isHostDenied:!1};if(null==(r=t.payloadHostDenyList)||!r.length||null==i||!i.trim().length)return n;for(var a of t.payloadHostDenyList)if(i.endsWith(a))return{hostname:i,isHostDenied:!0};return n}var mu=Oe("[Recorder]"),yu=e=>"navigation"===e.entryType,bu=e=>"resource"===e.entryType;function wu(e,t){return!!t&&(E(t)||t[e])}function ku(e){if("undefined"==typeof Request)return!1;if(e instanceof Request)return!0;try{return"[object Request]"==={}.toString.call(e)}catch(e){return!1}}var _u=["image/","video/","audio/","font/","application/octet-stream","application/pdf","application/zip","application/wasm"];function Su(e){var t=e.type,r=e.recordBody,i=e.headers;function n(e){var t=Object.keys(i).find((e=>"content-type"===e.toLowerCase())),r=t&&i[t];return e.some((e=>null==r?void 0:r.toLowerCase().includes(e)))}if(!r)return!1;if(function e(t){try{return"string"==typeof t?t.startsWith("blob:"):t instanceof URL?"blob:"===t.protocol:!!ku(t)&&e(t.url)}catch(e){return!1}}(e.url))return!1;if(n(_u))return!1;if(E(r))return!0;if(w(r))return n(r);var a=r[t];return E(a)?a:n(a)}function xu(e,t,r,i,n,a){return Cu.apply(this,arguments)}function Cu(){return Cu=l((function*(e,t,r,i,n,a){if(void 0===a&&(a=0),a>10)return mu.warn("Failed to get performance entry for request",{url:r,initiatorType:t}),null;var o=function(e,r){for(var a=e.length-1;a>=0;a-=1)if(bu(o=e[a])&&o.initiatorType===t&&(S(i)||o.startTime>=i)&&(S(n)||n>=o.startTime))return e[a];var o}(e.performance.getEntriesByName(r));return o||(yield new Promise((e=>setTimeout(e,50*a))),xu(e,t,r,i,n,a+1))})),Cu.apply(this,arguments)}function Mu(e){var t=e.body,r=e.options,i=e.url;if(T(t))return null;var n=gu(i,r);if(n.isHostDenied)return n.hostname+" is in deny list";if(x(t))return t;if(du(t))return t.textContent;if(R(t))return Be(t);if(_(t))try{return JSON.stringify(t)}catch(e){return"[SessionReplay] Failed to stringify response object"}return"[SessionReplay] Cannot read body of type "+toString.call(t)}var Tu=e=>!M(e)&&("navigation"===e.entryType||"resource"===e.entryType);function Iu(e){var t=e.entry,r=e.method,i=e.status,n=e.networkRequest,a=e.isInitial,o=e.start,s=e.end,u=e.url,l=e.initiatorType;o=t?t.startTime:o,s=t?t.responseEnd:s;var c=Math.floor(Date.now()-performance.now()),d=Math.floor(c+(o||0)),v=[h({},t?t.toJSON():{name:u},{startTime:S(o)?void 0:Math.round(o),endTime:S(s)?void 0:Math.round(s),timeOrigin:c,timestamp:d,method:r,initiatorType:l||(t?t.initiatorType:void 0),status:i,requestHeaders:n.requestHeaders,requestBody:n.requestBody,responseHeaders:n.responseHeaders,responseBody:n.responseBody,isInitial:a})];if(Tu(t))for(var f of t.serverTiming||[])v.push({timeOrigin:c,timestamp:d,startTime:Math.round(t.startTime),name:f.name,duration:f.duration,entryType:"serverTiming"});return v}var Eu=["video/","audio/"];function Ru(e){return _(e)&&k(e.getReader)&&k(e.tee)}var Au=500,Lu="[SessionReplay] Timeout while trying to read body",Ou="[SessionReplay] Failed to read body";function Pu(e){return Ou+": "+e}function Du(e){return"[SessionReplay] Body too large to record (> "+e+" bytes)"}function Fu(e,t){if(!t.streamNetworkBody)return function(e){return new Promise((t=>{var r=setTimeout((()=>t(Lu)),Au);try{e.clone().text().then((e=>t(e)),(e=>t(Pu(e)))).finally((()=>clearTimeout(r)))}catch(e){clearTimeout(r),t(Ou)}}))}(e);var r=wt(t);return function(e,t){try{var r,i=null==(r=e.headers)||null==r.get?void 0:r.get("content-length");if(!i)return!1;var n=parseInt(i,10);return Number.isFinite(n)&&n>t}catch(e){return!1}}(e,r)?Promise.resolve(Du(r)):function(e,t){return new Promise((r=>{var i,n=!1;function a(){try{var e;null==(e=i)||e.cancel()}catch(e){}}function o(e){n||(n=!0,clearTimeout(u),a(),r(e))}var s,u=setTimeout((()=>o(Lu)),Au);try{s=e.clone()}catch(e){return void o(Ou)}var l=s.body;if(Ru(l)&&"undefined"!=typeof TextDecoder){try{i=l.getReader()}catch(e){return void o(Ou)}var h=[],c=0;!function e(){i.read().then((r=>{var i=r.done,s=r.value;if(n)a();else if(i)o((new TextDecoder).decode(function(e,t){var r=new Uint8Array(t),i=0;for(var n of e)r.set(n,i),i+=n.byteLength;return r}(h,c)));else{if(s){if(c+s.byteLength>t)return void o(Du(t));c+=s.byteLength,h.push(s)}e()}}),(e=>o(Pu(e))))}()}else try{s.text().then((e=>o(e)),(e=>o(Pu(e))))}catch(e){o(Ou)}}))}(e,r)}function Nu(){return Nu=l((function*(e){var t=e.r,r=e.options,i=gu(e.url,r);return i.isHostDenied?Promise.resolve(i.hostname+" is in deny list"):Fu(t,r)})),Nu.apply(this,arguments)}function qu(){return qu=l((function*(e){var t=e.r,r=e.options,i=function(e){var t,r=e.r,i=e.options,n=e.url;if("chunked"===r.headers.get("Transfer-Encoding"))return"Chunked Transfer-Encoding is not supported";var a=null==(t=r.headers.get("Content-Type"))?void 0:t.toLowerCase(),o=Eu.some((e=>null==a?void 0:a.startsWith(e)));if(a&&o)return"Content-Type "+a+" is not supported";var s=gu(n,i);return s.isHostDenied?s.hostname+" is in deny list":null}({r:t,options:r,url:e.url});return M(i)?Fu(t,r):Promise.resolve(i)})),qu.apply(this,arguments)}var ju=null;function Bu(e,t,r){if(!("performance"in t))return()=>{};if(ju)return mu.warn("Network observer already initialised, doing nothing"),()=>{};var i=r?Object.assign({},kt,r):kt,n=t=>{var r=[],n=!1;t.requests.forEach((e=>{var t="serverTiming"===e.entryType;if(!t||!n){var a=i.maskRequestFn(e);t||(n=!a||(e=>!!e&&Et.has(e))(a)),a&&r.push(a)}})),r.length>0&&e(h({},t,{requests:r}))},a=function(e,t,r){if(r.recordInitialRequests){var i=t.performance.getEntries().filter((e=>yu(e)||bu(e)&&r.initiatorTypes.includes(e.initiatorType)));e({requests:i.flatMap((e=>Iu({entry:e,method:void 0,status:void 0,networkRequest:{},isInitial:!0}))),isInitial:!0})}var n=new t.PerformanceObserver((t=>{var i=t.getEntries().filter((e=>yu(e)||bu(e)&&r.initiatorTypes.includes(e.initiatorType)&&(e=>!r.recordBody&&!r.recordHeaders||"xmlhttprequest"!==e.initiatorType&&"fetch"!==e.initiatorType)(e)));e({requests:i.flatMap((e=>Iu({entry:e,method:void 0,status:void 0,networkRequest:{}})))})})),a=PerformanceObserver.supportedEntryTypes.filter((e=>r.performanceEntryTypeToObserve.includes(e)));return n.observe({entryTypes:a}),()=>{n.disconnect()}}(n,t,i),o=()=>{},s=()=>{};return(i.recordHeaders||i.recordBody)&&(o=function(e,t,r){if(!r.initiatorTypes.includes("xmlhttprequest"))return()=>{};var i=wu("request",r.recordHeaders),n=wu("response",r.recordHeaders),a=pu(t.XMLHttpRequest.prototype,"open",(a=>function(o,s,u,l,h){void 0===u&&(u=!0);var c=this;try{var d,v,f=new Request(s),p={},g={},m=c.setRequestHeader.bind(c);c.setRequestHeader=(e,t)=>(g[e]=t,m(e,t)),i&&(p.requestHeaders=g);var y=c.send.bind(c);c.send=e=>(Su({type:"request",headers:g,url:s,recordBody:r.recordBody})&&(p.requestBody=Mu({body:e,options:r,url:s})),d=t.performance.now(),y(e));var b=()=>{c.removeEventListener("readystatechange",w),c.removeEventListener("error",b),c.removeEventListener("abort",b),c.removeEventListener("timeout",b)},w=()=>{if(c.readyState===c.DONE){b(),v=t.performance.now();var i={};c.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach((e=>{var t=e.split(": "),r=t.shift(),n=t.join(": ");r&&(i[r]=n)})),n&&(p.responseHeaders=i),Su({type:"response",headers:i,url:s,recordBody:r.recordBody})&&(p.responseBody=Mu({body:c.response,options:r,url:s})),xu(t,"xmlhttprequest",f.url,d,v).then((t=>{var r=Iu({entry:t,method:o,status:null==c?void 0:c.status,networkRequest:p,start:d,end:v,url:s.toString(),initiatorType:"xmlhttprequest"});e({requests:r})})).catch((()=>{}))}};c.addEventListener("readystatechange",w),c.addEventListener("error",b),c.addEventListener("abort",b),c.addEventListener("timeout",b)}catch(e){mu.error("Failed to instrument XHR for network capture",e)}a.call(c,o,s.toString(),u,l,h)}));return()=>{a()}}(n,t,i),s=function(e,t,r){if(!r.initiatorTypes.includes("fetch"))return()=>{};var i=wu("request",r.recordHeaders),n=wu("response",r.recordHeaders),a=pu(t,"fetch",(a=>function(){var o=l((function*(o,s){var u,l;try{u=new Request(o,s)}catch(e){return mu.error("Failed to instrument fetch for network capture",e),a(o,s)}var h,c,d={};try{try{var v={};u.headers.forEach(((e,t)=>{v[t]=e})),i&&(d.requestHeaders=v),!Ru(null==s?void 0:s.body)&&Su({type:"request",headers:v,url:o,recordBody:r.recordBody})&&(d.requestBody=yield function(e){return Nu.apply(this,arguments)}({r:u,options:r,url:o}))}catch(e){mu.error("Failed to record fetch request for network capture",e)}h=t.performance.now(),l=ku(o)?yield a(u):yield a(o,s),c=t.performance.now();var f={};return l.headers.forEach(((e,t)=>{f[t]=e})),n&&(d.responseHeaders=f),Su({type:"response",headers:f,url:o,recordBody:r.recordBody})&&(d.responseBody=yield function(e){return qu.apply(this,arguments)}({r:l,options:r,url:o})),l}finally{xu(t,"fetch",u.url,h,c).then((t=>{var r,i=Iu({entry:t,method:u.method,status:null==(r=l)?void 0:r.status,networkRequest:d,start:h,end:c,url:u.url,initiatorType:"fetch"});e({requests:i})})).catch((()=>{}))}}));return function(e,t){return o.apply(this,arguments)}}()));return()=>{a()}}(n,t,i)),ju=()=>{a(),o(),s(),ju=null}}var Hu=e=>({name:"rrweb/network@1",observer:Bu,options:e});s.__PosthogExtensions__=s.__PosthogExtensions__||{},s.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:cu,getRecordNetworkPlugin:Hu},s.__PosthogExtensions__.rrweb={record:Js,version:"v2",wasMaxDepthReached:()=>xo,resetMaxDepthState(){xo=!1,So=!1},getLastSnapshotCost:()=>oa,getMutationCost:()=>h({},ca),resetSnapshotCostState(){ra=0,ia=0,na=0,Yn=0,aa=Qn(),oa=null,sa=null,ua=[],la=0,ha=0,ca={slowestBatchMs:0},da={deferredCount:0,failedCount:0,abandonedCount:0,totalMs:0,slowestSliceMs:0}}},s.rrweb={record:Js,version:"v2"},s.rrwebConsoleRecord={getRecordConsolePlugin:cu},s.getRecordNetworkPlugin=Hu,s.__PosthogExtensions__=s.__PosthogExtensions__||{},s.__PosthogExtensions__.initSessionRecording=(e,t)=>new Cn(e,t);var $u,Uu,Wu,zu,Vu,Zu,Gu,Qu,Ju,Yu,Ku,Xu,el,tl,rl,il={},nl=[],al=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,ol=Array.isArray;function sl(e,t){for(var r in t)e[r]=t[r];return e}function ul(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function ll(e,t,r){var i,n,a,o={};for(a in t)"key"==a?i=t[a]:"ref"==a?n=t[a]:o[a]=t[a];if(arguments.length>2&&(o.children=arguments.length>3?$u.call(arguments,2):r),"function"==typeof e&&null!=e.defaultProps)for(a in e.defaultProps)void 0===o[a]&&(o[a]=e.defaultProps[a]);return hl(e,o,i,n,null)}function hl(e,t,r,i,n){var a={type:e,props:t,key:r,ref:i,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==n?++Wu:n,__i:-1,__u:0};return null==n&&null!=Uu.vnode&&Uu.vnode(a),a}function cl(e){return e.children}function dl(e,t){this.props=e,this.context=t}function vl(e,t){if(null==t)return e.__?vl(e.__,e.__i+1):null;for(var r;e.__k.length>t;t++)if(null!=(r=e.__k[t])&&null!=r.__e)return r.__e;return"function"==typeof e.type?vl(e):null}function fl(e){if(e.__P&&e.__d){var t=e.__v,r=t.__e,i=[],n=[],a=sl({},t);a.__v=t.__v+1,Uu.vnode&&Uu.vnode(a),xl(e.__P,a,t,e.__n,e.__P.namespaceURI,32&t.__u?[r]:null,i,null==r?vl(t):r,!!(32&t.__u),n),a.__v=t.__v,a.__.__k[a.__i]=a,Ml(i,a,n),t.__e=t.__=null,a.__e!=r&&pl(a)}}function pl(e){if(null!=(e=e.__)&&null!=e.__c)return e.__e=e.__c.base=null,e.__k.some((function(t){if(null!=t&&null!=t.__e)return e.__e=e.__c.base=t.__e})),pl(e)}function gl(e){(!e.__d&&(e.__d=!0)&&zu.push(e)&&!ml.__r++||Vu!=Uu.debounceRendering)&&((Vu=Uu.debounceRendering)||Zu)(ml)}function ml(){try{for(var e,t=1;zu.length;)zu.length>t&&zu.sort(Gu),e=zu.shift(),t=zu.length,fl(e)}finally{zu.length=ml.__r=0}}function yl(e,t,r,i,n,a,o,s,u,l,h){var c,d,v,f,p,g,m,y=i&&i.__k||nl,b=t.length;for(u=function(e,t,r,i,n){var a,o,s,u,l,h=r.length,c=h,d=0;for(e.__k=new Array(n),a=0;n>a;a++)null!=(o=t[a])&&"boolean"!=typeof o&&"function"!=typeof o?("string"==typeof o||"number"==typeof o||"bigint"==typeof o||o.constructor==String?o=e.__k[a]=hl(null,o,null,null,null):ol(o)?o=e.__k[a]=hl(cl,{children:o},null,null,null):void 0===o.constructor&&o.__b>0?o=e.__k[a]=hl(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):e.__k[a]=o,u=a+d,o.__=e,o.__b=e.__b+1,s=null,-1!=(l=o.__i=wl(o,r,u,c))&&(c--,(s=r[l])&&(s.__u|=2)),null==s||null==s.__v?(-1==l&&(n>h?d--:h>n&&d++),"function"!=typeof o.type&&(o.__u|=4)):l!=u&&(l==u-1?d--:l==u+1?d++:(l>u?d--:d++,o.__u|=4))):e.__k[a]=null;if(c)for(a=0;h>a;a++)null!=(s=r[a])&&0==(2&s.__u)&&(s.__e==i&&(i=vl(s)),El(s,s));return i}(r,t,y,u,b),c=0;b>c;c++)null!=(v=r.__k[c])&&(d=-1!=v.__i&&y[v.__i]||il,v.__i=c,g=xl(e,v,d,n,a,o,s,u,l,h),f=v.__e,v.ref&&d.ref!=v.ref&&(d.ref&&Il(d.ref,null,v),h.push(v.ref,v.__c||f,v)),null==p&&null!=f&&(p=f),(m=!!(4&v.__u))||d.__k===v.__k?(u=bl(v,u,e,m),m&&d.__e&&(d.__e=null)):"function"==typeof v.type&&void 0!==g?u=g:f&&(u=f.nextSibling),v.__u&=-7);return r.__e=p,u}function bl(e,t,r,i){var n,a;if("function"==typeof e.type){for(n=e.__k,a=0;n&&n.length>a;a++)n[a]&&(n[a].__=e,t=bl(n[a],t,r,i));return t}e.__e!=t&&(i&&(t&&e.type&&!t.parentNode&&(t=vl(e)),r.insertBefore(e.__e,t||null)),t=e.__e);do{t=t&&t.nextSibling}while(null!=t&&8==t.nodeType);return t}function wl(e,t,r,i){var n,a,o,s=e.key,u=e.type,l=t[r],h=null!=l&&0==(2&l.__u);if(null===l&&null==s||h&&s==l.key&&u==l.type)return r;if(i>(h?1:0))for(n=r-1,a=r+1;n>=0||t.length>a;)if(null!=(l=t[o=0>n?a++:n--])&&0==(2&l.__u)&&s==l.key&&u==l.type)return o;return-1}function kl(e,t,r){"-"==t[0]?e.setProperty(t,null==r?"":r):e[t]=null==r?"":"number"!=typeof r||al.test(t)?r:r+"px"}function _l(e,t,r,i,n){var a,o;e:if("style"==t)if("string"==typeof r)e.style.cssText=r;else{if("string"==typeof i&&(e.style.cssText=i=""),i)for(t in i)r&&t in r||kl(e.style,t,"");if(r)for(t in r)i&&r[t]==i[t]||kl(e.style,t,r[t])}else if("o"==t[0]&&"n"==t[1])a=t!=(t=t.replace(Ku,"$1")),o=t.toLowerCase(),t=o in e||"onFocusOut"==t||"onFocusIn"==t?o.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+a]=r,r?i?r[Yu]=i[Yu]:(r[Yu]=Xu,e.addEventListener(t,a?tl:el,a)):e.removeEventListener(t,a?tl:el,a);else{if("http://www.w3.org/2000/svg"==n)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=t&&"height"!=t&&"href"!=t&&"list"!=t&&"form"!=t&&"tabIndex"!=t&&"download"!=t&&"rowSpan"!=t&&"colSpan"!=t&&"role"!=t&&"popover"!=t&&t in e)try{e[t]=null==r?"":r;break e}catch(e){}"function"==typeof r||(null==r||!1===r&&"-"!=t[4]?e.removeAttribute(t):e.setAttribute(t,"popover"==t&&1==r?"":r))}}function Sl(e){return function(t){if(this.l){var r=this.l[t.type+e];if(null==t[Ju])t[Ju]=Xu++;else if(r[Yu]>t[Ju])return;return r(Uu.event?Uu.event(t):t)}}}function xl(e,t,r,i,n,a,o,s,u,l){var h,c,d,v,f,p,g,m,y,b,$,w,k,_,S,x,C=t.type;if(void 0!==t.constructor)return null;128&r.__u&&(u=!!(32&r.__u),a=[s=t.__e=r.__e]),(h=Uu.__b)&&h(t);e:if("function"==typeof C){c=o.length;try{if(y=t.props,b=C.prototype&&C.prototype.render,$=(h=C.contextType)&&i[h.__c],w=h?$?$.props.value:h.__:i,r.__c?m=(d=t.__c=r.__c).__=d.__E:(b?t.__c=d=new C(y,w):(t.__c=d=new dl(y,w),d.constructor=C,d.render=Rl),$&&$.sub(d),d.state||(d.state={}),d.__n=i,v=d.__d=!0,d.__h=[],d._sb=[]),b&&null==d.__s&&(d.__s=d.state),b&&null!=C.getDerivedStateFromProps&&(d.__s==d.state&&(d.__s=sl({},d.__s)),sl(d.__s,C.getDerivedStateFromProps(y,d.__s))),f=d.props,p=d.state,d.__v=t,v)b&&null==C.getDerivedStateFromProps&&null!=d.componentWillMount&&d.componentWillMount(),b&&null!=d.componentDidMount&&d.__h.push(d.componentDidMount);else{if(b&&null==C.getDerivedStateFromProps&&y!==f&&null!=d.componentWillReceiveProps&&d.componentWillReceiveProps(y,w),t.__v==r.__v||!d.__e&&null!=d.shouldComponentUpdate&&!1===d.shouldComponentUpdate(y,d.__s,w)){t.__v!=r.__v&&(d.props=y,d.state=d.__s,d.__d=!1),t.__e=r.__e,t.__k=r.__k,t.__k.some((function(e){e&&(e.__=t)})),nl.push.apply(d.__h,d._sb),d._sb=[],d.__h.length&&o.push(d);break e}null!=d.componentWillUpdate&&d.componentWillUpdate(y,d.__s,w),b&&null!=d.componentDidUpdate&&d.__h.push((function(){d.componentDidUpdate(f,p,g)}))}if(d.context=w,d.props=y,d.__P=e,d.__e=!1,k=Uu.__r,_=0,b)d.state=d.__s,d.__d=!1,k&&k(t),h=d.render(d.props,d.state,d.context),nl.push.apply(d.__h,d._sb),d._sb=[];else do{d.__d=!1,k&&k(t),h=d.render(d.props,d.state,d.context),d.state=d.__s}while(d.__d&&25>++_);d.state=d.__s,null!=d.getChildContext&&(i=sl(sl({},i),d.getChildContext())),b&&!v&&null!=d.getSnapshotBeforeUpdate&&(g=d.getSnapshotBeforeUpdate(f,p)),S=null!=h&&h.type===cl&&null==h.key?Tl(h.props.children):h,s=yl(e,ol(S)?S:[S],t,r,i,n,a,o,s,u,l),d.base=t.__e,t.__u&=-161,d.__h.length&&o.push(d),m&&(d.__E=d.__=null)}catch(e){if(o.length=c,t.__v=null,u||null!=a)if(e.then){for(t.__u|=u?160:128;s&&8==s.nodeType&&s.nextSibling;)s=s.nextSibling;null!=a&&(a[a.indexOf(s)]=null),t.__e=s}else{if(null!=a)for(x=a.length;x--;)ul(a[x]);Cl(t)}else t.__e=r.__e,!t.__k&&r.__k&&(t.__k=r.__k),e.then||Cl(t);Uu.__e(e,t,r)}}else null==a&&t.__v==r.__v?(t.__k=r.__k,t.__e=r.__e):s=t.__e=function(e,t,r,i,n,a,o,s,u){var l,h,c,d,v,f,p,g=r.props||il,m=t.props,y=t.type;if("svg"==y?n="http://www.w3.org/2000/svg":"math"==y?n="http://www.w3.org/1998/Math/MathML":n||(n="http://www.w3.org/1999/xhtml"),null!=a)for(l=0;a.length>l;l++)if((v=a[l])&&"setAttribute"in v==!!y&&(y?v.localName==y:3==v.nodeType)){e=v,a[l]=null;break}if(null==e){if(null==y)return document.createTextNode(m);e=document.createElementNS(n,y,m.is&&m),s&&(Uu.__m&&Uu.__m(t,a),s=!1),a=null}if(null==y)g===m||s&&e.data==m||(e.data=m);else{if(a="textarea"==y&&null!=m.defaultValue?null:a&&$u.call(e.childNodes),!s&&null!=a)for(g={},l=0;e.attributes.length>l;l++)g[(v=e.attributes[l]).name]=v.value;for(l in g)v=g[l],"dangerouslySetInnerHTML"==l?c=v:"children"==l||l in m||"value"==l&&"defaultValue"in m||"checked"==l&&"defaultChecked"in m||_l(e,l,null,v,n);for(l in m)v=m[l],"children"==l?d=v:"dangerouslySetInnerHTML"==l?h=v:"value"==l?f=v:"checked"==l?p=v:s&&"function"!=typeof v||g[l]===v||_l(e,l,v,g[l],n);if(h)s||c&&(h.__html==c.__html||h.__html==e.innerHTML)||(e.innerHTML=h.__html),t.__k=[];else if(c&&(e.innerHTML=""),yl("template"==t.type?e.content:e,ol(d)?d:[d],t,r,i,"foreignObject"==y?"http://www.w3.org/1999/xhtml":n,a,o,a?a[0]:r.__k&&vl(r,0),s,u),null!=a)for(l=a.length;l--;)ul(a[l]);s&&"textarea"!=y||(l="value","progress"==y&&null==f?e.removeAttribute("value"):null!=f&&(f!==e[l]||"progress"==y&&!f||"option"==y&&f!=g[l])&&_l(e,l,f,g[l],n),l="checked",null!=p&&p!=e[l]&&_l(e,l,p,g[l],n))}return e}(r.__e,t,r,i,n,a,o,u,l);return(h=Uu.diffed)&&h(t),128&t.__u?void 0:s}function Cl(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(Cl))}function Ml(e,t,r){for(var i=0;r.length>i;i++)Il(r[i],r[++i],r[++i]);Uu.__c&&Uu.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){Uu.__e(e,t.__v)}}))}function Tl(e){return"object"!=typeof e||null==e||e.__b>0?e:ol(e)?e.map(Tl):void 0!==e.constructor?null:sl({},e)}function Il(e,t,r){try{if("function"==typeof e){var i="function"==typeof e.__u;i&&e.__u(),i&&null==t||(e.__u=e(t))}else e.current=t}catch(e){Uu.__e(e,r)}}function El(e,t,r){var i,n;if(Uu.unmount&&Uu.unmount(e),(i=e.ref)&&(i.current&&i.current!=e.__e||Il(i,null,t)),null!=(i=e.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(e){Uu.__e(e,t)}i.base=i.__P=i.__n=null}if(i=e.__k)for(n=0;i.length>n;n++)i[n]&&El(i[n],t,r||"function"!=typeof e.type);r||ul(e.__e),e.__c=e.__=e.__e=void 0}function Rl(e,t,r){return this.constructor(e,r)}function Al(e,t,r){var i,n,a;t==document&&(t=document.documentElement),Uu.__&&Uu.__(e,t),i=t.__k,n=[],a=[],xl(t,e=t.__k=ll(cl,null,[e]),i||il,il,t.namespaceURI,i?null:t.firstChild?$u.call(t.childNodes):null,n,i?i.__e:t.firstChild,!1,a),Ml(n,e,a),e.props.children=null}$u=nl.slice,Uu={__e(e,t,r,i){for(var n,a,o;t=t.__;)if((n=t.__c)&&!n.__)try{if((a=n.constructor)&&null!=a.getDerivedStateFromError&&(n.setState(a.getDerivedStateFromError(e)),o=n.__d),null!=n.componentDidCatch&&(n.componentDidCatch(e,i||{}),o=n.__d),o)return n.__E=n}catch(t){e=t}throw e}},Wu=0,dl.prototype.setState=function(e,t){var r;r=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=sl({},this.state),"function"==typeof e&&(e=e(sl({},r),this.props)),e&&sl(r,e),null!=e&&this.__v&&(t&&this._sb.push(t),gl(this))},dl.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),gl(this))},dl.prototype.render=cl,zu=[],Zu="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Gu=function(e,t){return e.__v.__b-t.__v.__b},ml.__r=0,Qu=Math.random().toString(8),Ju="__d"+Qu,Yu="__a"+Qu,Ku=/(PointerCapture)$|Capture$/i,Xu=0,el=Sl(!1),tl=Sl(!0),rl=0;var Ll,Ol,Pl,Dl,Fl=0,Nl=[],ql=Uu,jl=ql.__b,Bl=ql.__r,Hl=ql.diffed,$l=ql.__c,Ul=ql.unmount,Wl=ql.__;function zl(e,t){ql.__h&&ql.__h(Ol,e,Fl||t),Fl=0;var r=Ol.__H||(Ol.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function Vl(e){return Fl=1,function(e,t,r){var i=zl(Ll++,2);if(i.t=e,!i.__c&&(i.__=[ih(void 0,t),function(e){var t=i.__N?i.__N[0]:i.__[0],r=i.t(t,e);t!==r&&(i.__N=[r,i.__[1]],i.__c.setState({}))}],i.__c=Ol,!Ol.__f)){var n=function(e,t,r){if(!i.__c.__H)return!0;var n=!1,o=i.__c.props!==e;if(i.__c.__H.__.some((function(e){if(e.__N){n=!0;var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(o=!0)}})),a){var s=a.call(this,e,t,r);return n?s||o:s}return!n||o};Ol.__f=!0;var a=Ol.shouldComponentUpdate,o=Ol.componentWillUpdate;Ol.componentWillUpdate=function(e,t,r){if(this.__e){var i=a;a=void 0,n(e,t,r),a=i}o&&o.call(this,e,t,r)},Ol.shouldComponentUpdate=n}return i.__N||i.__}(ih,e)}function Zl(e,t){var r=zl(Ll++,3);!ql.__s&&rh(r.__H,t)&&(r.__=e,r.u=t,Ol.__H.__h.push(r))}function Gl(e){return Fl=5,Ql((function(){return{current:e}}),[])}function Ql(e,t){var r=zl(Ll++,7);return rh(r.__H,t)&&(r.__=e(),r.__H=t,r.__h=e),r.__}function Jl(e){var t=Ol.context[e.__c],r=zl(Ll++,9);return r.c=e,t?(null==r.__&&(r.__=!0,t.sub(Ol)),t.props.value):e.__}function Yl(){for(var e;e=Nl.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(eh),t.__h.some(th),t.__h=[]}catch(r){t.__h=[],ql.__e(r,e.__v)}}}ql.__b=function(e){Ol=null,jl&&jl(e)},ql.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Wl&&Wl(e,t)},ql.__r=function(e){Bl&&Bl(e),Ll=0;var t=(Ol=e.__c).__H;t&&(Pl===Ol?(t.__h=[],Ol.__h=[],t.__.some((function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0}))):(t.__h.length&&Yl(),Ll=0)),Pl=Ol},ql.diffed=function(e){Hl&&Hl(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==Nl.push(t)&&Dl===ql.requestAnimationFrame||((Dl=ql.requestAnimationFrame)||Xl)(Yl)),t.__H.__.some((function(e){e.u&&(e.__H=e.u,e.u=void 0)}))),Pl=Ol=null},ql.__c=function(e,t){t.some((function(e){try{e.__h.some(eh),e.__h=e.__h.filter((function(e){return!e.__||th(e)}))}catch(r){t.some((function(e){e.__h&&(e.__h=[])})),t=[],ql.__e(r,e.__v)}})),$l&&$l(e,t)},ql.unmount=function(e){Ul&&Ul(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.some((function(e){try{eh(e)}catch(e){t=e}})),r.__H=void 0,t&&ql.__e(t,r.__v))};var Kl="function"==typeof requestAnimationFrame;function Xl(e){var t,r=function(){clearTimeout(i),Kl&&cancelAnimationFrame(t),setTimeout(e)},i=setTimeout(r,35);Kl&&(t=requestAnimationFrame(r))}function eh(e){var t=Ol,r=e.__c;"function"==typeof r&&(e.__c=void 0,r()),Ol=t}function th(e){var t=Ol;e.__c=e.__(),Ol=t}function rh(e,t){return!e||e.length!==t.length||t.some((function(t,r){return t!==e[r]}))}function ih(e,t){return"function"==typeof t?t(e):t}var nh={Tab:"tab",Selector:"selector"},ah={TopLeft:"top_left",TopRight:"top_right",TopCenter:"top_center",MiddleLeft:"middle_left",MiddleRight:"middle_right",MiddleCenter:"middle_center",Left:"left",Center:"center",Right:"right",NextToTrigger:"next_to_trigger"},oh={Top:"top",Left:"left",Right:"right",Bottom:"bottom"},sh={Popover:"popover",API:"api",Widget:"widget",ExternalSurvey:"external_survey"},uh={Open:"open",MultipleChoice:"multiple_choice",SingleChoice:"single_choice",Rating:"rating",Link:"link"},lh={End:"end",ResponseBased:"response_based",SpecificQuestion:"specific_question"},hh="always",ch={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent",ABANDONED:"survey abandoned"},dh={SURVEY_ID:"$survey_id",SURVEY_NAME:"$survey_name",SURVEY_ITERATION:"$survey_iteration",SURVEY_ITERATION_START_DATE:"$survey_iteration_start_date",SURVEY_PARTIALLY_COMPLETED:"$survey_partially_completed",SURVEY_SUBMISSION_ID:"$survey_submission_id",SURVEY_COMPLETED:"$survey_completed",SURVEY_LANGUAGE:"$survey_language"},vh=Oe("[Surveys]"),fh=(e,t)=>""+e+function(e){return e.current_iteration&&e.current_iteration>0?e.id+"_"+e.current_iteration:e.id}(t),ph=e=>fh("seenSurvey_",e),gh=e=>{try{var t=ph(e);if(localStorage.getItem(t))return;localStorage.setItem(t,"true")}catch(e){vh.error("Failed to persist survey seen state",e)}},mh=[sh.Popover,sh.Widget,sh.API];Math.trunc||(Math.trunc=function(e){return 0>e?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return I(e)&&isFinite(e)&&Math.floor(e)===e});class yh{constructor(e){if(this.bytes=e,16!==e.length)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,t,r,i){if(!Number.isInteger(e)||!Number.isInteger(t)||!Number.isInteger(r)||!Number.isInteger(i)||0>e||0>t||0>r||0>i||e>0xffffffffffff||t>4095||r>1073741823||i>4294967295)throw new RangeError("invalid field value");var n=new Uint8Array(16);return n[0]=e/Math.pow(2,40),n[1]=e/Math.pow(2,32),n[2]=e/Math.pow(2,24),n[3]=e/Math.pow(2,16),n[4]=e/256,n[5]=e,n[6]=112|t>>>8,n[7]=t,n[8]=128|r>>>24,n[9]=r>>>16,n[10]=r>>>8,n[11]=r,n[12]=i>>>24,n[13]=i>>>16,n[14]=i>>>8,n[15]=i,new yh(n)}toString(){for(var e="",t=0;this.bytes.length>t;t++)e=e+(this.bytes[t]>>>4).toString(16)+(15&this.bytes[t]).toString(16),3!==t&&5!==t&&7!==t&&9!==t||(e+="-");if(36!==e.length)throw new Error("Invalid UUIDv7 was generated");return e}clone(){return new yh(this.bytes.slice(0))}equals(e){return 0===this.compareTo(e)}compareTo(e){for(var t=0;16>t;t++){var r=this.bytes[t]-e.bytes[t];if(0!==r)return Math.sign(r)}return 0}}class bh{generate(){var e=this.generateOrAbort();if(!S(e))return e;this.Gr=0;var t=this.generateOrAbort();if(S(t))throw new Error("Could not generate UUID after timestamp reset");return t}generateOrAbort(){var e=Date.now();if(e>this.Gr)this.Gr=e,this.Qr();else{if(this.Gr>=e+1e4)return;this.Jr++,this.Jr>4398046511103&&(this.Gr++,this.Qr())}return yh.fromFieldsV7(this.Gr,Math.trunc(this.Jr/Math.pow(2,30)),this.Jr&Math.pow(2,30)-1,this.Yr.nextUint32())}Qr(){this.Jr=1024*this.Yr.nextUint32()+(1023&this.Yr.nextUint32())}constructor(){this.Gr=0,this.Jr=0,this.Yr=new _h}}var wh,kh=e=>{if("undefined"!=typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var t=0;e.length>t;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};e&&!S(e.crypto)&&crypto.getRandomValues&&(kh=e=>crypto.getRandomValues(e));class _h{nextUint32(){return this.At.length>this.Kr||(kh(this.At),this.Kr=0),this.At[this.Kr++]}constructor(){this.At=new Uint32Array(8),this.Kr=1/0}}var Sh=()=>xh().toString(),xh=()=>(wh||(wh=new bh)).generate(),Ch=null,Mh={Xr(){if(!M(Ch))return Ch;var t=!0;if(S(e))t=!1;else try{var r="__mplssupport__";Mh.ei(r,"xyz"),'"xyz"'!==Mh.ti(r)&&(t=!1),Mh.ri(r)}catch(e){t=!1}return t||Le.error("localStorage unsupported; falling back to cookie store"),Ch=t,t},ii(e){Le.error("localStorage error: "+e)},ti(t){try{return null==e?void 0:e.localStorage.getItem(t)}catch(e){Mh.ii(e)}return null},ni(e){try{return JSON.parse(Mh.ti(e))||{}}catch(e){}return null},ei(t,r){try{return null==e||e.localStorage.setItem(t,JSON.stringify(r)),!0}catch(e){Mh.ii(e)}return!1},ri(t){try{null==e||e.localStorage.removeItem(t)}catch(e){Mh.ii(e)}}},Th=Oe("[Stylesheet Loader]"),Ih=e,Eh=i,Rh="#020617",Ah={fontFamily:"inherit",backgroundColor:"#eeeded",submitButtonColor:"black",submitButtonTextColor:"white",ratingButtonColor:"white",ratingButtonActiveColor:"black",borderColor:"#c9c6c6",placeholder:"Start typing...",whiteLabel:!1,displayThankYouMessage:!0,thankYouMessageHeader:"Thank you for your feedback!",position:ah.Right,widgetType:nh.Tab,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:Rh,scrollbarThumbColor:"var(--ph-survey-border-color)",scrollbarTrackColor:"var(--ph-survey-background-color)"},Lh=[ah.Center,ah.Left,ah.Right];function Oh(e){if(e.startsWith("#")){var t=e.replace(/^#/,"");return/^[0-9A-Fa-f]{3}$/.test(t)&&(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]),/^[0-9A-Fa-f]{6}$/.test(t)?"rgb("+parseInt(t.slice(0,2),16)+","+parseInt(t.slice(2,4),16)+","+parseInt(t.slice(4,6),16)+")":"rgb(255, 255, 255)"}return"rgb(255, 255, 255)"}function Ph(e){var t;void 0===e&&(e=Ah.backgroundColor),"#"===e[0]&&(t=Oh(e)),e.startsWith("rgb")&&(t=e);var r={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"}[e.toLowerCase()];if(r&&(t=Oh(r)),!t)return Rh;var i=t.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);if(i){var n=parseInt(i[1]),a=parseInt(i[2]),o=parseInt(i[3]);return Math.sqrt(n*n*.299+a*a*.587+o*o*.114)>127.5?Rh:"white"}return Rh}var Dh=(e,t,r)=>{var i=tc(e),n=Eh.querySelector("."+i);if(n&&n.shadowRoot)return{shadow:n.shadowRoot,isNewlyCreated:!1};var a=Eh.createElement("div");((e,t,r)=>{var i=h({},Ah,r),n=e.style,a=!Lh.includes(i.position)||t===sh.Widget&&(null==r?void 0:r.widgetType)===nh.Tab;n.setProperty("--ph-survey-font-family",function(e){if("inherit"===e)return"inherit";var t='BlinkMacSystemFont, "Inter", "Segoe UI", "Roboto", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"';return e?e+", "+t:"-apple-system, "+t}(i.fontFamily)),n.setProperty("--ph-survey-box-padding",i.boxPadding),n.setProperty("--ph-survey-max-width",i.maxWidth),n.setProperty("--ph-survey-z-index",i.zIndex),n.setProperty("--ph-survey-border-color",i.borderColor),a?(n.setProperty("--ph-survey-border-radius",i.borderRadius),n.setProperty("--ph-survey-border-bottom","1.5px solid var(--ph-survey-border-color)")):(n.setProperty("--ph-survey-border-bottom","none"),n.setProperty("--ph-survey-border-radius",i.borderRadius+" "+i.borderRadius+" 0 0")),n.setProperty("--ph-survey-background-color",i.backgroundColor),n.setProperty("--ph-survey-box-shadow",i.boxShadow),n.setProperty("--ph-survey-disabled-button-opacity",i.disabledButtonOpacity),n.setProperty("--ph-survey-submit-button-color",i.submitButtonColor),n.setProperty("--ph-survey-submit-button-text-color",(null==r?void 0:r.submitButtonTextColor)||Ph(i.submitButtonColor)),n.setProperty("--ph-survey-rating-bg-color",i.ratingButtonColor),n.setProperty("--ph-survey-rating-active-bg-color",i.ratingButtonActiveColor),n.setProperty("--ph-survey-rating-active-text-color",Ph(i.ratingButtonActiveColor)),n.setProperty("--ph-survey-text-primary-color",(null==r?void 0:r.textColor)||Ph(i.backgroundColor)),n.setProperty("--ph-survey-text-subtle-color",i.textSubtleColor),n.setProperty("--ph-widget-color",i.widgetColor),n.setProperty("--ph-widget-text-color",Ph(i.widgetColor)),n.setProperty("--ph-widget-z-index",i.zIndex);var o=(null==r?void 0:r.inputBackground)||(null==r?void 0:r.inputBackgroundColor),s=o||i.inputBackground;o||"white"!==i.backgroundColor||(s="#f8f8f8"),n.setProperty("--ph-survey-input-background",s);var u=(null==r?void 0:r.inputTextColor)||Ph(s);n.setProperty("--ph-survey-input-text-color",u),n.setProperty("--ph-survey-rating-text-color",u),n.setProperty("--ph-survey-scrollbar-thumb-color",i.scrollbarThumbColor),n.setProperty("--ph-survey-scrollbar-track-color",i.scrollbarTrackColor),n.setProperty("--ph-survey-outline-color",i.outlineColor)})(a,e.type,e.appearance),a.className=i;var o=a.attachShadow({mode:"open"}),s=function(e){var t=((e,t,r)=>{var i=e.createElement("style");i.innerText=t;var n=(e=>{var t;return k(e)?e:null==e||null==(t=e.config)?void 0:t.prepare_external_dependency_stylesheet})(r);return n&&(i=n(i)),i||(Th.error("prepare_external_dependency_stylesheet returned null"),null)})(Eh,':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:2147483645;--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 rgba(0,0,0,.15);--ph-survey-submit-button-color:#000;--ph-survey-submit-button-text-color:#fff;--ph-survey-rating-bg-color:#fff;--ph-survey-rating-text-color:#020617;--ph-survey-rating-active-bg-color:#000;--ph-survey-rating-active-text-color:#fff;--ph-survey-text-primary-color:#020617;--ph-survey-text-subtle-color:#939393;--ph-widget-color:#e0a045;--ph-widget-text-color:#fff;--ph-survey-scrollbar-thumb-color:var(--ph-survey-border-color);--ph-survey-scrollbar-track-color:var(--ph-survey-background-color);--ph-survey-outline-color:rgba(59,130,246,.8);--ph-survey-input-background:#fff;--ph-survey-input-text-color:#020617;--ph-survey-disabled-button-opacity:0.6}.ph-survey{bottom:0;height:fit-content;margin:0;max-width:85%;min-width:300px;position:fixed;width:var(--ph-survey-max-width);z-index:var(--ph-survey-z-index)}.ph-survey h3,.ph-survey p{margin:0}.ph-survey *{box-sizing:border-box;color:var(--ph-survey-text-primary-color);font-family:var(--ph-survey-font-family)}.ph-survey .multiple-choice-options label,.ph-survey input[type=text],.ph-survey textarea{background:var(--ph-survey-input-background);border:1.5px solid var(--ph-survey-border-color);border-radius:4px;color:var(--ph-survey-input-text-color);padding:10px;transition:border-color .2s ease-out,box-shadow .2s ease-out,transform .15s ease-out}.ph-survey input[type=text],.ph-survey textarea{transition:border-color .2s ease-out,box-shadow .2s ease-out,transform .15s ease-out}.ph-survey input{margin:0}.ph-survey .form-submit:focus,.ph-survey .form-submit:focus-visible,.ph-survey input[type=checkbox]:focus,.ph-survey input[type=checkbox]:focus-visible,.ph-survey input[type=radio]:focus,.ph-survey input[type=radio]:focus-visible,.ph-survey input[type=text]:focus,.ph-survey input[type=text]:focus-visible,.ph-survey textarea:focus,.ph-survey textarea:focus-visible{border-color:var(--ph-survey-rating-active-bg-color);outline:1.5px solid var(--ph-survey-outline-color);outline-offset:2px}.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),.ph-survey input[type=text]:focus:not(:focus-visible),.ph-survey textarea:focus:not(:focus-visible){outline:none}.ph-survey input[type=text]:hover:not(:focus),.ph-survey textarea:hover:not(:focus){border-color:var(--ph-survey-rating-active-bg-color)}@media (max-width:768px){.ph-survey input[type=text],.ph-survey textarea{font-size:1rem}}.ph-survey .form-cancel,.ph-survey .multiple-choice-options label,.ph-survey .rating-options-number,.ph-survey input[type=checkbox],.ph-survey input[type=radio]{border:1.5px solid var(--ph-survey-border-color)}.ph-survey .footer-branding,.ph-survey .form-cancel,.ph-survey .form-submit,.ph-survey .ratings-emoji,.ph-survey .ratings-number,.ph-survey input[type=checkbox],.ph-survey input[type=radio],.ph-survey label{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);border:none;border-radius:3px 3px 0 0;color:var(--ph-widget-text-color);cursor:pointer;padding:10px 12px;position:fixed;text-align:center;transition:padding .2s ease-out;z-index:var(--ph-survey-z-index)}.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{gap:16px}.bottom-section,.survey-box{display:flex;flex-direction:column}.bottom-section{gap:8px}.intro-screen-header~.bottom-section,.thank-you-message-header~.bottom-section{padding-top:16px}.intro-screen,.question-container,.thank-you-message{display:flex;flex-direction:column;gap:8px}.survey-question{font-size:14px;font-weight:500}.survey-question-description{font-size:13px;opacity:.8;padding-top:4px}.intro-screen-body,.survey-question-description,.thank-you-message-body{word-wrap:break-word;overflow-wrap:break-word}:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) embed,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) iframe,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) img,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) object,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) video{height:auto;max-width:100%}:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) svg{height:auto;max-width:100%}.question-textarea-wrapper{display:flex;flex-direction:column}.survey-form{animation:ph-survey-fade-in .3s ease-out forwards}.intro-screen,.survey-form,.thank-you-message{background:var(--ph-survey-background-color);border:1.5px solid var(--ph-survey-border-color);border-bottom:var(--ph-survey-border-bottom);border-radius:var(--ph-survey-border-radius);box-shadow:var(--ph-survey-box-shadow);margin:0;padding:var(--ph-survey-box-padding);position:relative;text-align:left;width:100%;z-index:var(--ph-survey-z-index)}.survey-form input[type=text],.survey-form textarea{min-width:100%}:is(.survey-form textarea):focus,:is(.survey-form textarea):focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.08)}:is(.survey-form textarea):focus:not(:focus-visible){box-shadow:none}:is(.survey-box .question-header--empty)~.multiple-choice-options,:is(.survey-box .question-header--empty)~textarea{margin-top:0}.multiple-choice-options{border:none;display:flex;flex-direction:column;font-size:14px;gap:8px;margin:0;padding:1px 0}.multiple-choice-options .response-choice,.multiple-choice-options label{align-items:center;color:inherit;display:flex;gap:8px}.multiple-choice-options label{cursor:pointer;font-size:13px}:is(.multiple-choice-options label):hover:not(:has(input:checked)){border-color:var(--ph-survey-text-subtle-color);box-shadow:0 2px 8px rgba(0,0,0,.08)}:is(.multiple-choice-options label):has(input:checked){border-color:var(--ph-survey-rating-active-bg-color);box-shadow:0 1px 4px rgba(0,0,0,.05)}.choice-option-open:is(.multiple-choice-options label){flex-wrap:wrap}:is(.multiple-choice-options label) span{color:inherit}.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]{appearance:none;-webkit-appearance:none;-moz-appearance:none;background:var(--ph-survey-input-background);border-radius:3px;cursor:pointer;flex-shrink:0;height:1rem;position:relative;transition:all .2s cubic-bezier(.4,0,.2,1),transform .15s ease-out;width:1rem;z-index:1}: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{animation:ph-survey-checkmark-reveal .2s ease-out .1s forwards;border:solid var(--ph-survey-rating-active-text-color);border-width:0 2px 2px 0;height:8px;left:4px;transform:rotate(45deg) scale(0);width:4px}.multiple-choice-options input[type=radio]:checked:after{animation:ph-survey-radio-reveal .15s ease-out .05s forwards;background:var(--ph-survey-rating-active-text-color);border-radius:50%;height:6px;left:5px;top:5px;transform:scale(0);width:6px}.multiple-choice-options input[type=checkbox]:checked:after,.multiple-choice-options input[type=radio]:checked:after{box-sizing:content-box;content:"";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}:is(:is(.multiple-choice-options .choice-option-open) input[type=text])::placeholder{color:var(--ph-survey-text-subtle-color);font-weight:400}.rating-options-emoji{display:flex;justify-content:space-between}.rating-options-emoji-2{justify-content:space-around}.ratings-emoji{background-color:transparent;border:none;font-size:16px;opacity:.5;padding:0}.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;display:grid;grid-auto-columns:1fr;grid-auto-flow:column;overflow:hidden}.rating-options-number .ratings-number{border:none;border-right:1px solid var(--ph-survey-border-color);color:var(--ph-survey-rating-text-color);cursor:pointer;font-weight:700;text-align:center}:is(.rating-options-number .ratings-number):last-of-type{border-right:0}.rating-active:is(.rating-options-number .ratings-number){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{font-size:11px;justify-content:space-between;opacity:.7}.form-buttons,.rating-text{display:flex;flex-direction:row}.form-buttons{gap:8px;width:100%}.form-buttons-with-back>.form-submit{flex:1 1 auto;min-width:0}.form-submit{background:var(--ph-survey-submit-button-color);border:none;border-radius:6px;box-shadow:0 2px 0 rgba(0,0,0,.045);color:var(--ph-survey-submit-button-text-color);cursor:pointer;font-weight:700;min-width:100%;padding:12px;text-align:center;user-select:none}.form-submit:not([disabled]):hover{box-shadow:0 4px 8px rgba(0,0,0,.1);transform:scale(1.02)}.form-submit:not([disabled]):active{box-shadow:0 1px 2px rgba(0,0,0,.05);transform:scale(.98)}.form-submit[disabled]{cursor:not-allowed;opacity:var(--ph-survey-disabled-button-opacity)}.form-back{background:transparent;border:1.5px solid var(--ph-survey-border-color);border-radius:6px;color:var(--ph-survey-text-primary-color);cursor:pointer;flex:0 0 auto;font-weight:600;padding:12px 16px;text-align:center;user-select:none}.form-back:hover{transform:scale(1.02)}.form-back:active{transform:scale(.98)}.validation-hint{font-size:12px;margin-top:4px;opacity:.7}.form-cancel{background:#fff;border-radius:100%;cursor:pointer;line-height:0;padding:12px;position:absolute;right:0;top:0;transform:translate(50%,-50%)}.form-cancel:hover{opacity:.7;transform:translate(50%,-50%) scale(1.1)}.footer-branding{align-items:center;display:flex;font-size:11px;font-weight:500;gap:4px;justify-content:center;opacity:.6;text-decoration:none}.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{font-size:14px;opacity:.8}.intro-screen{animation:ph-survey-fade-in .3s ease-out forwards;text-align:center}.intro-screen-header{margin:10px 0 0}.intro-screen-body{font-size:14px;opacity:.8}.limit-height{max-height:256px;overflow-x:hidden;overflow-y:auto;scrollbar-color:var(--ph-survey-scrollbar-thumb-color) var(--ph-survey-scrollbar-track-color);scrollbar-width:thin}.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}:is(.limit-height::-webkit-scrollbar-thumb):hover{background-color:var(--ph-survey-text-subtle-color)}.sr-only{clip:rect(0,0,0,0);border:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}@media (prefers-reduced-motion:reduce){.ph-survey *{animation-duration:.01ms!important;animation-iteration-count:1!important;scroll-behavior:auto!important;transition-duration:.01ms!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)}}',e);return null==t||t.setAttribute("data-ph-survey-style","true"),t}(t);if(s){var u=o.querySelector("style");u&&o.removeChild(u),o.appendChild(s)}return Eh.body.appendChild(a),{shadow:o,isNewlyCreated:!0}},Fh=e=>{var t=e.responses,r=e.survey,i=e.surveySubmissionId,n=e.posthog,a=e.isSurveyCompleted,o=e.properties,s=e.surveyLanguage;n?(gh(r),n.capture(ch.SENT,h({[dh.SURVEY_NAME]:r.name,[dh.SURVEY_ID]:r.id,[dh.SURVEY_ITERATION]:r.current_iteration,[dh.SURVEY_ITERATION_START_DATE]:r.current_iteration_start_date,[dh.SURVEY_SUBMISSION_ID]:i,[dh.SURVEY_COMPLETED]:a},s&&{[dh.SURVEY_LANGUAGE]:s},{sessionRecordingUrl:null==n.get_session_replay_url?void 0:n.get_session_replay_url()},li(t,r),o,{$set:{[hi(r,"responded")]:!0}})),a&&(Ih.dispatchEvent(new CustomEvent("PHSurveySent",{detail:{surveyId:r.id}})),ec(r),n.reloadFeatureFlags())):vh.error("[survey sent] event not captured, PostHog instance not found.")},Nh=(e,t,r)=>{return h({[dh.SURVEY_NAME]:e.name,[dh.SURVEY_ID]:e.id,[dh.SURVEY_ITERATION]:e.current_iteration,[dh.SURVEY_ITERATION_START_DATE]:e.current_iteration_start_date,[dh.SURVEY_PARTIALLY_COMPLETED]:(i=null==t?void 0:t.responses,void 0===i&&(i={}),Object.values(i).some((e=>!T(e))))},(null==t?void 0:t.surveyLanguage)&&{[dh.SURVEY_LANGUAGE]:t.surveyLanguage},{sessionRecordingUrl:null==r.get_session_replay_url?void 0:r.get_session_replay_url(),[dh.SURVEY_SUBMISSION_ID]:null==t?void 0:t.surveySubmissionId},li(null==t?void 0:t.responses,e));var i},qh=(e,t,r,i)=>{if(t){if(!r){var n=Kh(e);t.capture(ch.DISMISSED,h({},Nh(e,n,t),i&&{[dh.SURVEY_LANGUAGE]:i},{$set:{[hi(e,"dismissed")]:!0}})),ec(e),gh(e),Ih.dispatchEvent(new CustomEvent("PHSurveyClosed",{detail:{surveyId:e.id}}))}}else vh.error("[survey dismissed] event not captured, PostHog instance not found.")},jh=(e,t)=>{if(t){var r=(e=>fh("abandonedSurvey_",e))(e);try{if("true"===localStorage.getItem(r))return}catch(e){return}var i=Kh(e);if(i){try{localStorage.setItem(r,"true")}catch(e){}t.capture(ch.ABANDONED,Nh(e,i,t),{transport:"sendBeacon"})}}else vh.error("[survey abandoned] event not captured, PostHog instance not found.")},Bh=e=>e.map((e=>({sort:Math.floor(10*Math.random()),value:e}))).sort(((e,t)=>e.sort-t.sort)).map((e=>e.value)),Hh=(e,t)=>e.length===t.length&&e.every(((e,r)=>e===t[r]))?t.reverse():t,$h=e=>{var t=e.map((e=>e.id));return t.every((e=>!!e))?t:void 0},Uh=(e,t)=>{return(e=>e.questions.some((e=>{var t;return!(null==(t=e.branching)||!t.type)})))(e)?e.questions:t?null!==(r=((e,t)=>{if(!t||t.length!==e.questions.length)return null;var r=new Map(e.questions.map((e=>[e.id,e]))),i=[];for(var n of t){var a=r.get(n);if(!a)return null;i.push(a)}return i})(e,t.questionOrder))&&void 0!==r?r:e.questions:e.appearance&&e.appearance.shuffleQuestions&&!e.enable_partial_responses?Hh(e.questions,Bh(e.questions)):e.questions;var r},Wh=e=>function(e){var t;return gi(e)&&!(null==(t=e.conditions)||null==(t=t.events)||!t.repeatedActivation)||"always"===e.schedule}(e)||Xh(e),zh=function(e){function t(e){var r,i;return this.getChildContext||(r=new Set,(i={})[t.__c]=this,this.getChildContext=function(){return i},this.componentWillUnmount=function(){r=null},this.shouldComponentUpdate=function(e){this.props.value!=e.value&&r.forEach((function(e){e.__e=!0,gl(e)}))},this.sub=function(e){r.add(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){r&&r.delete(e),t&&t.call(e)}}),e.children}return t.__c="__cC"+rl++,t.__=e,t.Provider=t.__l=(t.Consumer=function(e,t){return e.children(t)}).contextType=t,t}({isPreviewMode:!1,previewPageIndex:0,onPopupSurveyDismissed(){},isPopup:!0,onPreviewSubmit(){},onPreviewBack(){},surveySubmissionId:"",properties:void 0,surveyLanguage:null}),Vh=()=>Jl(zh),Zh=e=>{var t=e.children,r=e.style;return function(e,t,r){var i,n,a,o,s=sl({},e.props);for(a in e.type&&e.type.defaultProps&&(o=e.type.defaultProps),t)"key"==a?i=t[a]:"ref"==a?n=t[a]:s[a]=void 0===t[a]&&null!=o?o[a]:t[a];return arguments.length>2&&(s.children=arguments.length>3?$u.call(arguments,2):r),hl(e.type,s,i||e.key,n||e.ref,null)}(e.component,e.renderAsHtml?{dangerouslySetInnerHTML:{__html:t},style:r}:{children:t,style:r})};function Gh(e,t){var r,i;if(null==(r=e.conditions)||!r.url)return!0;var n=He(t);if(!n)return!1;var a=[e.conditions.url],o=function(e){return null!=e?e:"icontains"}(null==(i=e.conditions)?void 0:i.urlMatchType);return bi[o](a,[n])}function Qh(t){var i,n;return function(t,i){var n,o,s;if(!t||0===t.length)return!0;if(!a)return!1;var u,l,h,c,d,v,f=(u={userAgentDataPlatform:null==r||null==(n=r.userAgentData)?void 0:n.platform,maxTouchPoints:null==r?void 0:r.maxTouchPoints,screenWidth:null==e||null==(o=e.screen)?void 0:o.width,screenHeight:null==e||null==(s=e.screen)?void 0:s.height,devicePixelRatio:null==e?void 0:e.devicePixelRatio},(v=function(e){return ie.test(e)?V:re.test(e)?Z:te.test(e)?G:new RegExp(Y,"i").test(e)?Y:new RegExp("("+Q+"|WPDesktop)","i").test(e)?Q:/iPad/.test(e)?U:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?W:ne.test(e)?z:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":new RegExp(J,"i").test(e)?J:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(e)||/(kf[a-z]+)( bui|\)).+silk\//i.test(e)?"Kindle Fire":/(Android|ZTE)/i.test(e)?new RegExp(q).test(e)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(e)||/pixel[\daxl ]{1,6}/i.test(e)&&!/pixel c/i.test(e)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(e)||/lmy47v/i.test(e)&&!/QTAQZ3/i.test(e)?j:H:new RegExp("(pda|"+q+")","i").test(e)?X:new RegExp(B,"i").test(e)&&!new RegExp(B+" pc","i").test(e)?ee:""}(a))===U||v===H||"Kobo"===v||"Kindle Fire"===v||v===ee?B:v===V||v===G||v===Z||v===Y?"Console":v===W?"Wearable":v?q:"Android"===(null==u?void 0:u.userAgentDataPlatform)&&(null!==(l=null==u?void 0:u.maxTouchPoints)&&void 0!==l?l:0)>0?600>Math.min(null!==(h=null==u?void 0:u.screenWidth)&&void 0!==h?h:0,null!==(c=null==u?void 0:u.screenHeight)&&void 0!==c?c:0)/(null!==(d=null==u?void 0:u.devicePixelRatio)&&void 0!==d?d:1)?q:B:"Desktop");return bi[null!=i?i:"icontains"](t,[f])}(null==(i=t.conditions)?void 0:i.deviceTypes,null==(n=t.conditions)?void 0:n.deviceTypesMatchType)}var Jh=e=>fh("inProgressSurvey_",e),Yh=(e,t)=>{try{localStorage.setItem(Jh(e),JSON.stringify(t))}catch(e){vh.error("Error setting in-progress survey state in localStorage",e)}},Kh=e=>{try{var t=localStorage.getItem(Jh(e));if(t)return JSON.parse(t)}catch(e){vh.error("Error getting in-progress survey state from localStorage",e)}return null},Xh=e=>{var t=Kh(e);return!T(null==t?void 0:t.surveySubmissionId)},ec=e=>{try{localStorage.removeItem(Jh(e))}catch(e){vh.error("Error clearing in-progress survey state from localStorage",e)}};function tc(e,t){void 0===t&&(t=!1);var r="PostHogSurvey-"+e.id;return t?"."+r:r}function rc(e,t,r){if(void 0===t&&(t=ah.Right),e===sh.ExternalSurvey)return{};switch(t){case ah.TopLeft:return{top:"0",left:"0",transform:"translate(30px, 30px)"};case ah.TopRight:return{top:"0",right:"0",transform:"translate(-30px, 30px)"};case ah.TopCenter:return{top:"0",left:"50%",transform:"translate(-50%, 30px)"};case ah.MiddleLeft:return{top:"50%",left:"0",transform:"translate(30px, -50%)"};case ah.MiddleRight:return{top:"50%",right:"0",transform:"translate(-30px, -50%)"};case ah.MiddleCenter:return{top:"50%",left:"50%",transform:"translate(-50%, -50%)"};case ah.Left:return{left:"30px"};case ah.Center:return{left:"50%",transform:"translateX(-50%)"};default:return{right:e===sh.Widget&&r===nh.Tab?"60px":"30px"}}}var ic=0;function nc(e,t,r,i,n,a){t||(t={});var o,s,u=t;if("ref"in u)for(s in u={},t)"ref"==s?o=t[s]:u[s]=t[s];var l={type:e,props:u,key:r,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--ic,__i:-1,__u:0,__source:n,__self:a};if("function"==typeof e&&(o=e.defaultProps))for(s in o)void 0===u[s]&&(u[s]=o[s]);return Uu.vnode&&Uu.vnode(l),l}var ac=nc("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:nc("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"})}),oc=nc("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:nc("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"})}),sc=nc("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:nc("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"})}),uc=nc("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:nc("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"})}),lc=nc("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:nc("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"})}),hc=nc("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:nc("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"})}),cc=nc("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:nc("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"})}),dc=function(e){var t=(void 0===e?{}:e).fill,r=void 0===t?"currentColor":t;return nc("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:r,xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"close-survey-title-adam",children:[nc("title",{id:"close-survey-title",className:"adam-testing",children:"Close survey"}),nc("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:r})]})},vc=nc("svg",{width:"77",height:"14",viewBox:"0 0 77 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[nc("g",{"clip-path":"url(#clip0_2415_6911)",children:[nc("mask",{id:"mask0_2415_6911",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"77",height:"14",children:nc("path",{d:"M0.5 0H76.5V14H0.5V0Z",fill:"white"})}),nc("g",{mask:"url(#mask0_2415_6911)",children:[nc("path",{d:"M5.77226 8.02931C5.59388 8.37329 5.08474 8.37329 4.90634 8.02931L4.4797 7.20672C4.41155 7.07535 4.41155 6.9207 4.4797 6.78933L4.90634 5.96669C5.08474 5.62276 5.59388 5.62276 5.77226 5.96669L6.19893 6.78933C6.26709 6.9207 6.26709 7.07535 6.19893 7.20672L5.77226 8.02931ZM5.77226 12.6946C5.59388 13.0386 5.08474 13.0386 4.90634 12.6946L4.4797 11.872C4.41155 11.7406 4.41155 11.586 4.4797 11.4546L4.90634 10.632C5.08474 10.288 5.59388 10.288 5.77226 10.632L6.19893 11.4546C6.26709 11.586 6.26709 11.7406 6.19893 11.872L5.77226 12.6946Z",fill:"#1D4AFF"}),nc("path",{d:"M0.5 10.9238C0.5 10.508 1.02142 10.2998 1.32637 10.5938L3.54508 12.7327C3.85003 13.0267 3.63405 13.5294 3.20279 13.5294H0.984076C0.716728 13.5294 0.5 13.3205 0.5 13.0627V10.9238ZM0.5 8.67083C0.5 8.79459 0.551001 8.91331 0.641783 9.00081L5.19753 13.3927C5.28831 13.4802 5.41144 13.5294 5.53982 13.5294H8.0421C8.47337 13.5294 8.68936 13.0267 8.3844 12.7327L1.32637 5.92856C1.02142 5.63456 0.5 5.84278 0.5 6.25854V8.67083ZM0.5 4.00556C0.5 4.12932 0.551001 4.24802 0.641783 4.33554L10.0368 13.3927C10.1276 13.4802 10.2508 13.5294 10.3791 13.5294H12.8814C13.3127 13.5294 13.5287 13.0267 13.2237 12.7327L1.32637 1.26329C1.02142 0.969312 0.5 1.17752 0.5 1.59327V4.00556ZM5.33931 4.00556C5.33931 4.12932 5.39033 4.24802 5.4811 4.33554L14.1916 12.7327C14.4965 13.0267 15.0179 12.8185 15.0179 12.4028V9.99047C15.0179 9.86671 14.9669 9.74799 14.8762 9.66049L6.16568 1.26329C5.86071 0.969307 5.33931 1.17752 5.33931 1.59327V4.00556ZM11.005 1.26329C10.7 0.969307 10.1786 1.17752 10.1786 1.59327V4.00556C10.1786 4.12932 10.2296 4.24802 10.3204 4.33554L14.1916 8.06748C14.4965 8.36148 15.0179 8.15325 15.0179 7.7375V5.3252C15.0179 5.20144 14.9669 5.08272 14.8762 4.99522L11.005 1.26329Z",fill:"#F9BD2B"}),nc("path",{d:"M21.0852 10.981L16.5288 6.58843C16.2238 6.29443 15.7024 6.50266 15.7024 6.91841V13.0627C15.7024 13.3205 15.9191 13.5294 16.1865 13.5294H23.2446C23.5119 13.5294 23.7287 13.3205 23.7287 13.0627V12.5032C23.7287 12.2455 23.511 12.0396 23.2459 12.0063C22.4323 11.9042 21.6713 11.546 21.0852 10.981ZM18.0252 12.0365C17.5978 12.0365 17.251 11.7021 17.251 11.2901C17.251 10.878 17.5978 10.5436 18.0252 10.5436C18.4527 10.5436 18.7996 10.878 18.7996 11.2901C18.7996 11.7021 18.4527 12.0365 18.0252 12.0365Z",fill:"currentColor"}),nc("path",{d:"M0.5 13.0627C0.5 13.3205 0.716728 13.5294 0.984076 13.5294H3.20279C3.63405 13.5294 3.85003 13.0267 3.54508 12.7327L1.32637 10.5938C1.02142 10.2998 0.5 10.508 0.5 10.9238V13.0627ZM5.33931 5.13191L1.32637 1.26329C1.02142 0.969306 0.5 1.17752 0.5 1.59327V4.00556C0.5 4.12932 0.551001 4.24802 0.641783 4.33554L5.33931 8.86412V5.13191ZM1.32637 5.92855C1.02142 5.63455 0.5 5.84278 0.5 6.25853V8.67083C0.5 8.79459 0.551001 8.91331 0.641783 9.00081L5.33931 13.5294V9.79717L1.32637 5.92855Z",fill:"#1D4AFF"}),nc("path",{d:"M10.1787 5.3252C10.1787 5.20144 10.1277 5.08272 10.0369 4.99522L6.16572 1.26329C5.8608 0.969306 5.33936 1.17752 5.33936 1.59327V4.00556C5.33936 4.12932 5.39037 4.24802 5.48114 4.33554L10.1787 8.86412V5.3252ZM5.33936 13.5294H8.04214C8.47341 13.5294 8.6894 13.0267 8.38443 12.7327L5.33936 9.79717V13.5294ZM5.33936 5.13191V8.67083C5.33936 8.79459 5.39037 8.91331 5.48114 9.00081L10.1787 13.5294V9.99047C10.1787 9.86671 10.1277 9.74803 10.0369 9.66049L5.33936 5.13191Z",fill:"#F54E00"}),nc("path",{d:"M29.375 11.6667H31.3636V8.48772H33.0249C34.8499 8.48772 36.0204 7.4443 36.0204 5.83052C36.0204 4.21681 34.8499 3.17334 33.0249 3.17334H29.375V11.6667ZM31.3636 6.84972V4.81136H32.8236C33.5787 4.81136 34.0318 5.19958 34.0318 5.83052C34.0318 6.4615 33.5787 6.84972 32.8236 6.84972H31.3636ZM39.618 11.7637C41.5563 11.7637 42.9659 10.429 42.9659 8.60905C42.9659 6.78905 41.5563 5.45438 39.618 5.45438C37.6546 5.45438 36.2701 6.78905 36.2701 8.60905C36.2701 10.429 37.6546 11.7637 39.618 11.7637ZM38.1077 8.60905C38.1077 7.63838 38.7118 6.97105 39.618 6.97105C40.5116 6.97105 41.1157 7.63838 41.1157 8.60905C41.1157 9.57972 40.5116 10.2471 39.618 10.2471C38.7118 10.2471 38.1077 9.57972 38.1077 8.60905ZM46.1482 11.7637C47.6333 11.7637 48.6402 10.8658 48.6402 9.81025C48.6402 7.33505 45.2294 8.13585 45.2294 7.16518C45.2294 6.8983 45.5189 6.72843 45.9342 6.72843C46.3622 6.72843 46.8782 6.98318 47.0418 7.54132L48.527 6.94678C48.2375 6.06105 47.1677 5.45438 45.8713 5.45438C44.4743 5.45438 43.6058 6.25518 43.6058 7.21372C43.6058 9.53118 46.9663 8.88812 46.9663 9.84665C46.9663 10.1864 46.6391 10.417 46.1482 10.417C45.4434 10.417 44.9525 9.94376 44.8015 9.3735L43.3164 9.93158C43.6436 10.8537 44.6001 11.7637 46.1482 11.7637ZM53.4241 11.606L53.2982 10.0651C53.0843 10.1743 52.8074 10.2106 52.5808 10.2106C52.1278 10.2106 51.8257 9.89523 51.8257 9.34918V7.03172H53.3612V5.55145H51.8257V3.78001H49.9755V5.55145H48.9687V7.03172H49.9755V9.57972C49.9755 11.06 51.0202 11.7637 52.3921 11.7637C52.7696 11.7637 53.122 11.7031 53.4241 11.606ZM59.8749 3.17334V6.47358H56.376V3.17334H54.3874V11.6667H56.376V8.11158H59.8749V11.6667H61.8761V3.17334H59.8749ZM66.2899 11.7637C68.2281 11.7637 69.6378 10.429 69.6378 8.60905C69.6378 6.78905 68.2281 5.45438 66.2899 5.45438C64.3265 5.45438 62.942 6.78905 62.942 8.60905C62.942 10.429 64.3265 11.7637 66.2899 11.7637ZM64.7796 8.60905C64.7796 7.63838 65.3837 6.97105 66.2899 6.97105C67.1835 6.97105 67.7876 7.63838 67.7876 8.60905C67.7876 9.57972 67.1835 10.2471 66.2899 10.2471C65.3837 10.2471 64.7796 9.57972 64.7796 8.60905ZM73.2088 11.4725C73.901 11.4725 74.5177 11.242 74.845 10.8416V11.424C74.845 12.1034 74.2786 12.5767 73.4102 12.5767C72.7935 12.5767 72.2523 12.2854 72.1642 11.788L70.4776 12.0428C70.7042 13.1955 71.925 13.972 73.4102 13.972C75.361 13.972 76.6574 12.8679 76.6574 11.2298V5.55145H74.8324V6.07318C74.4926 5.69705 73.9136 5.45438 73.171 5.45438C71.409 5.45438 70.3014 6.61918 70.3014 8.46345C70.3014 10.3077 71.409 11.4725 73.2088 11.4725ZM72.1012 8.46345C72.1012 7.55345 72.655 6.97105 73.5109 6.97105C74.3793 6.97105 74.9331 7.55345 74.9331 8.46345C74.9331 9.37345 74.3793 9.95585 73.5109 9.95585C72.655 9.95585 72.1012 9.37345 72.1012 8.46345Z",fill:"currentColor"})]})]}),nc("defs",{children:nc("clipPath",{id:"clip0_2415_6911",children:nc("rect",{width:"76",height:"14",fill:"white",transform:"translate(0.5)"})})})]});function fc(e){var t=e.urlParams,r=t?Object.entries(t).map((e=>{var t=e[1];return encodeURIComponent(e[0])+"="+encodeURIComponent(t)})).join("&"):"";return nc("a",{href:"https://posthog.com/surveys"+(r?"?"+r:""),target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",vc]})}function pc(t){var r=t.text,i=t.submitDisabled,n=t.appearance,a=t.onSubmit,o=t.link,s=t.onPreviewSubmit,u=t.skipSubmitButton,l=t.canGoBack,h=t.onBack,c=Jl(zh).isPreviewMode,d=!!l&&!!h,v=!u&&nc("button",{className:"form-submit",disabled:i,"aria-label":"Submit survey",type:"button",onClick(){o&&(null==e||e.open(o)),c?null==s||s():a()},children:r});return nc("div",{className:"bottom-section",children:[d?nc("div",{className:"form-buttons form-buttons-with-back",children:[nc("button",{className:"form-back",type:"button","aria-label":"Go to previous question",onClick:h,children:n.backButtonText||"Back"}),v]}):v,!n.whiteLabel&&nc(fc,{urlParams:{utm_source:"survey-footer"}})]})}function gc(e){var t=e.question,r=e.forceDisableHtml;return nc("div",{class:t.question||t.description?"question-header":"question-header question-header--empty",children:[nc(t.type===uh.Open?"label":"h3",{className:"survey-question",htmlFor:e.htmlFor,children:t.question}),t.description&&Zh({component:ll("p",{className:"survey-question-description"}),children:t.description,renderAsHtml:!r&&"text"!==t.descriptionContentType})]})}function mc(e){return nc("button",{className:"form-cancel",onClick:e.onClick,disabled:Jl(zh).isPreviewMode,"aria-label":"Close survey",type:"button",children:dc({fill:"black"})})}nc("svg",{width:"16",height:"12",viewBox:"0 0 16 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:nc("path",{d:"M5.30769 10.6923L4.77736 11.2226C4.91801 11.3633 5.10878 11.4423 5.30769 11.4423C5.5066 11.4423 5.69737 11.3633 5.83802 11.2226L5.30769 10.6923ZM15.5303 1.53033C15.8232 1.23744 15.8232 0.762563 15.5303 0.46967C15.2374 0.176777 14.7626 0.176777 14.4697 0.46967L15.5303 1.53033ZM1.53033 5.85429C1.23744 5.56139 0.762563 5.56139 0.46967 5.85429C0.176777 6.14718 0.176777 6.62205 0.46967 6.91495L1.53033 5.85429ZM5.83802 11.2226L15.5303 1.53033L14.4697 0.46967L4.77736 10.162L5.83802 11.2226ZM0.46967 6.91495L4.77736 11.2226L5.83802 10.162L1.53033 5.85429L0.46967 6.91495Z",fill:"currentColor"})});var yc=e;function bc(e){var t=e.header,r=e.description,i=e.contentType,n=e.forceDisableHtml,a=e.appearance,o=e.onClose,s=Jl(zh).isPopup;return Zl((()=>{var e=e=>{"Enter"!==e.key&&"Escape"!==e.key||(e.preventDefault(),o())};return Ne(yc,"keydown",e),()=>{yc.removeEventListener("keydown",e)}}),[o]),nc("div",{className:"thank-you-message",role:"status",tabIndex:0,"aria-atomic":"true",children:[s&&!0!==a.hideCancelButton&&nc(mc,{onClick:()=>o()}),nc("h3",{className:"thank-you-message-header",children:t}),r&&Zh({component:ll("p",{className:"thank-you-message-body"}),children:r,renderAsHtml:!n&&"text"!==i}),s&&nc(pc,{text:a.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:a,onSubmit:()=>o()})]})}function wc(e){var t=e.header,r=e.description,i=e.contentType,n=e.forceDisableHtml,a=e.appearance,o=e.onStart,s=Jl(zh),u=s.onPreviewSubmit,l=s.onPopupSurveyDismissed;return nc("div",{className:"intro-screen",role:"status",tabIndex:0,"aria-atomic":"true",children:[s.isPopup&&!0!==a.hideCancelButton&&nc(mc,{onClick:()=>l()}),t&&nc("h3",{className:"intro-screen-header",children:t}),r&&Zh({component:ll("p",{className:"intro-screen-body"}),children:r,renderAsHtml:!n&&"text"!==i}),nc(pc,{text:a.introScreenButtonText||"Get started",submitDisabled:!1,appearance:a,onSubmit:o,onPreviewSubmit:()=>u(null)})]})}var kc=e=>w(e)&&e.every((e=>x(e)));function _c(e){var t=e.question,r=e.forceDisableHtml,i=e.appearance,n=e.onSubmit,a=e.onPreviewSubmit,o=e.displayQuestionIndex,s=e.initialValue,u=e.canGoBack,l=e.onBack,h=Vh().isPreviewMode,c=Gl(null),d=Vl((()=>x(s)?s:"")),p=d[0],g=d[1],m=null==i?void 0:i.disableAutofocus;Zl((()=>{m||setTimeout((()=>{var e;h||null==(e=c.current)||e.focus()}),100)}),[h,m]);var y="surveyQuestion"+o,b=Ql((()=>function(e,t,r){var i,n,a=e.trim();if(!r&&""===a)return"This field is required";if(""===a)return!1;if(t&&t.length>0)for(var o of t)switch(o.type){case v:if(void 0!==o.value&&o.value>a.length)return null!==(i=o.errorMessage)&&void 0!==i?i:"Please enter at least "+o.value+" characters";break;case f:if(void 0!==o.value&&a.length>o.value)return null!==(n=o.errorMessage)&&void 0!==n?n:"Please enter no more than "+o.value+" characters"}return!1}(p,t.validation,t.optional)),[p,t.validation,t.optional]),w=fe(t.validation,v),k=fe(t.validation,f),_=Ql((()=>function(e,t){var r=1===e?void 0:e;return r&&t?"Enter "+r+"-"+t+" characters":r?"Enter at least "+r+" "+(1===r?"character":"characters"):t?"Maximum "+t+" "+(1===t?"character":"characters"):void 0}(w,k)),[w,k]),S=()=>{b||n(p.trim())},C=()=>{b||a(p.trim())};return nc(cl,{children:[nc("div",{className:"question-container",children:[nc(gc,{question:t,forceDisableHtml:r,htmlFor:y}),nc("textarea",{ref:c,id:y,rows:4,placeholder:null==i?void 0:i.placeholder,minLength:w,maxLength:k,onInput(e){g(e.currentTarget.value),e.stopPropagation()},onKeyDown(e){e.stopPropagation(),"Enter"!==e.key||!e.metaKey&&!e.ctrlKey||b||(e.preventDefault(),h?C():S())},value:p}),_&&nc("div",{className:"validation-hint",children:_})]}),nc(pc,{text:t.buttonText||"Submit",submitDisabled:!!b,appearance:i,onSubmit:S,onPreviewSubmit:C,canGoBack:u,onBack:l})]})}function Sc(e){var t=e.question,r=e.appearance,i=e.onSubmit,n=e.onPreviewSubmit,a=e.canGoBack,o=e.onBack;return nc(cl,{children:[nc("div",{className:"question-container",children:nc(gc,{question:t,forceDisableHtml:e.forceDisableHtml})}),nc(pc,{text:t.buttonText||"Submit",submitDisabled:!1,link:t.link,appearance:r,onSubmit:()=>i("link clicked"),onPreviewSubmit:()=>n("link clicked"),canGoBack:a,onBack:o})]})}function xc(e){var t,r=e.question,i=e.forceDisableHtml,n=e.displayQuestionIndex,a=e.appearance,o=e.onSubmit,s=e.onPreviewSubmit,u=e.initialValue,l=e.canGoBack,h=e.onBack,c=r.scale,d=10===r.scale?0:1,v=Vl((()=>I(u)?u:w(u)&&u.length>0&&I(parseInt(u[0]))?parseInt(u[0]):x(u)&&I(parseInt(u))?parseInt(u):null)),f=v[0],p=v[1],g="emoji"===r.display&&2===r.scale,m=Vh().isPreviewMode,y=e=>m?s(e):o(e);return nc(cl,{children:[nc("div",{className:"question-container",children:[nc(gc,{question:r,forceDisableHtml:i}),nc("div",{className:"rating-section",children:[nc("div",{className:"rating-options",children:["emoji"===r.display&&nc("div",{className:"rating-options-emoji"+(g?" rating-options-emoji-2":""),children:null==(t=Rc[r.scale])?void 0:t.map(((e,t)=>nc("button",{"aria-label":"Rate "+(t+1),className:"ratings-emoji question-"+n+"-rating-"+t+" "+(t+1===f?"rating-active":""),value:t+1,type:"button",onClick(){var e=t+1;p(e),r.skipSubmitButton&&y(e)},children:e},t)))}),"number"===r.display&&nc("div",{className:"rating-options-number",style:{gridTemplateColumns:"repeat("+(c-d+1)+", minmax(0, 1fr))"},children:Ac(r.scale).map(((e,t)=>nc(Cc,{displayQuestionIndex:n,active:f===e,appearance:a,num:e,setActiveNumber(e){p(e),r.skipSubmitButton&&y(e)}},t)))})]}),!g&&nc("div",{className:"rating-text",children:[nc("div",{children:r.lowerBoundLabel}),nc("div",{children:r.upperBoundLabel})]})]})]}),nc(pc,{text:r.buttonText||(null==a?void 0:a.submitButtonText)||"Submit",submitDisabled:M(f)&&!r.optional,appearance:a,onSubmit:()=>o(f),onPreviewSubmit:()=>s(f),skipSubmitButton:r.skipSubmitButton,canGoBack:l,onBack:h})]})}function Cc(e){var t=e.num,r=e.setActiveNumber;return nc("button",{"aria-label":"Rate "+t,className:"ratings-number question-"+e.displayQuestionIndex+"-rating-"+t+" "+(e.active?"rating-active":""),type:"button",onClick(){r(t)},children:t})}function Mc(e){var t=e.question,r=e.forceDisableHtml,i=e.displayQuestionIndex,n=e.appearance,a=e.onSubmit,o=e.onPreviewSubmit,s=e.initialValue,u=e.canGoBack,l=e.onBack,c=Gl(null),d=Ql((()=>(e=>{if(!e.shuffleOptions)return e.choices;var t=e.choices,r="";e.hasOpenChoice&&(r=t.pop());var i=Hh(t,Bh(t));return e.hasOpenChoice&&(e.choices.push(r),i.push(r)),i})(t)),[t]),v=Vl((()=>((e,t)=>x(e)||kc(e)?e:t===uh.SingleChoice?null:[])(s,t.type))),f=v[0],p=v[1],g=Vl((()=>((e,t)=>{if(x(e)&&!t.includes(e))return{isSelected:!0,inputValue:e};if(kc(e)){var r=e.find((e=>!t.includes(e)));if(r)return{isSelected:!0,inputValue:r}}return{isSelected:!1,inputValue:""}})(s,d))),m=g[0],y=g[1],b=Vh().isPreviewMode,k=t.type===uh.SingleChoice,_=t.type===uh.MultipleChoice,S=t.skipSubmitButton&&k&&!t.hasOpenChoice,C=(e,t)=>{if(t){var r=!m.isSelected;return y((e=>h({},e,{isSelected:r,inputValue:r?e.inputValue:""}))),k&&p(""),void(r&&setTimeout((()=>{var e;return null==(e=c.current)?void 0:e.focus()}),75))}if(k)return p(e),y((e=>h({},e,{isSelected:!1,inputValue:""}))),void(S&&(a(e),b&&o(e)));_&&w(f)&&(f.includes(e)?p(f.filter((t=>t!==e))):p([...f,e]))},T=e=>{e.stopPropagation();var t=e.currentTarget.value;y((e=>h({},e,{inputValue:t}))),k&&p(t)},I=e=>{e.stopPropagation(),"Enter"!==e.key||E()||(e.preventDefault(),R()),"Escape"===e.key&&(e.preventDefault(),y((e=>h({},e,{isSelected:!1,inputValue:""}))),k&&p(null))},E=()=>!(t.optional||!M(f)&&(!w(f)||m.isSelected||0!==f.length)&&(!m.isSelected||""!==m.inputValue.trim())),R=()=>{m.isSelected&&_?w(f)&&(b?o([...f,m.inputValue]):a([...f,m.inputValue])):b?o(f):a(f)};return nc(cl,{children:[nc("div",{className:"question-container",children:[nc(gc,{question:t,forceDisableHtml:r}),nc("fieldset",{className:"multiple-choice-options limit-height",children:[nc("legend",{className:"sr-only",children:_?" Select all that apply":" Select one"}),d.map(((e,r)=>{var n=!!t.hasOpenChoice&&r===t.choices.length-1,a="surveyQuestion"+i+"Choice"+r,o=a+"Open",s=n?m.isSelected:k?f===e:w(f)&&f.includes(e);return nc("label",{className:n?"choice-option-open":"",children:[nc("div",{className:"response-choice",children:[nc("input",{type:k?"radio":"checkbox",name:a,checked:s,onChange:()=>C(e,n),id:a,"aria-controls":o}),nc("span",{children:n?e+":":e})]}),n&&nc("input",{type:"text",ref:c,id:o,name:"question"+i+"Open",value:m.inputValue,onKeyDown:I,onInput:T,onClick(t){m.isSelected||C(e,!0),t.stopPropagation()},"aria-label":e+" - please specify"})]},r)}))]})]}),nc(pc,{text:t.buttonText||"Submit",submitDisabled:E(),appearance:n,onSubmit:R,onPreviewSubmit:R,skipSubmitButton:S,canGoBack:u,onBack:l})]})}var Tc=[1,2,3,4,5],Ic=[1,2,3,4,5,6,7],Ec=[0,1,2,3,4,5,6,7,8,9,10],Rc={2:[hc,cc],3:[sc,oc,ac],5:[uc,sc,oc,ac,lc]};function Ac(e){switch(e){case 5:default:return Tc;case 7:return Ic;case 10:return Ec}}var Lc=Oe("[Surveys]");function Oc(e,t,r){var i,n=e.questions[t],a=t+1;if(null==(i=n.branching)||!i.type)return t===e.questions.length-1?lh.End:a;if(n.branching.type===lh.End)return lh.End;if(n.branching.type===lh.SpecificQuestion){if(Number.isInteger(n.branching.index))return n.branching.index}else if(n.branching.type===lh.ResponseBased){if(n.type===uh.SingleChoice){var o,s=n.choices.indexOf(""+r);if(-1===s&&n.hasOpenChoice&&(s=n.choices.length-1),null!=(o=n.branching)&&null!=(o=o.responseValues)&&o.hasOwnProperty(s)){var u=n.branching.responseValues[s];return Number.isInteger(u)?u:u===lh.End?lh.End:a}}else if(n.type===uh.Rating){var l;if("number"!=typeof r||!Number.isInteger(r))throw new Error("The response type must be an integer");var h=function(e,t){if(2===t){if(1>e||e>2)throw new Error("The response must be in range 1-2");return 1===e?"positive":"negative"}if(3===t){if(1>e||e>3)throw new Error("The response must be in range 1-3");return 1===e?"negative":2===e?"neutral":"positive"}if(5===t){if(1>e||e>5)throw new Error("The response must be in range 1-5");return e>2?3===e?"neutral":"positive":"negative"}if(7===t){if(1>e||e>7)throw new Error("The response must be in range 1-7");return e>3?4===e?"neutral":"positive":"negative"}if(10===t){if(0>e||e>10)throw new Error("The response must be in range 0-10");return e>6?e>8?"promoters":"passives":"detractors"}throw new Error("The scale must be one of: 2, 3, 5, 7, 10")}(r,n.scale);if(null!=(l=n.branching)&&null!=(l=l.responseValues)&&l.hasOwnProperty(h)){var c=n.branching.responseValues[h];return Number.isInteger(c)?c:c===lh.End?lh.End:a}}return a}return Lc.warn("Falling back to next question index due to unexpected branching type"),a}var Pc=Oe("[SurveyTranslations]");function Dc(e,t){var r=function(e){return function(e,t){var r=e.storedPersonProperties,i=e.locale,n=ci(e.overrideLanguage);if(n)return null==t||t.info("Using override display language: "+n),n;var a=function(e){return e&&"object"==typeof e&&"language"in e?ci(e.language):null}(r);if(a)return null==t||t.info("Using person property language: "+a),a;var o=ci(i);return o?(null==t||t.info("Using detected locale: "+o),o):(null==t||t.info("No user language detected"),null)}({overrideLanguage:e.config.override_display_language,storedPersonProperties:k(e.get_property)?e.get_property(zt):void 0,locale:navigator.language||navigator.userLanguage},Pc)}(t);if(!r)return Pc.info("No user language detected"),{survey:e,language:null};var i=pi(e,r,Pc);return{survey:i.survey,language:i.matchedKey}}var Fc=-1,Nc=e,qc=i,jc="ph:show_survey_widget",Bc="PHWidgetSurveyClickListener";function Hc(e,t){try{var r=e.getBoundingClientRect(),i=Nc.innerHeight,n=Nc.innerWidth,a=r.left+r.width/2-t/2;a+t>n-20&&(a=n-t-20),20>a&&(a=20);var o=i-r.bottom,s=250>o&&r.top>o;return{position:"fixed",top:s?"auto":r.bottom+12+"px",left:a+"px",right:"auto",bottom:s?i-r.top+12+"px":"auto",zIndex:Ah.zIndex}}catch(e){return vh.warn("Failed to calculate trigger position:",e),null}}class $c{constructor(e){var t=this;this.ai=new Map,this.oi=new Map,this.si=new Map,this.ui=new Set,this.handlePageUnload=()=>{var e=this._posthog.get_property("$surveys");if(e)for(var t of e)Xh(t)&&jh(t,this._posthog)},this.handlePopoverSurvey=function(e,r,i){var n,a,o,s,u,l=(void 0===i?{}:i).resumeDelayFromActivation,c=void 0!==l&&l,d=t.li(e),v=d.survey,f=d.language,p=null!=r&&r.position||null!=r&&r.selector?h({},v,{appearance:h({},v.appearance,r.position&&{position:r.position},r.selector&&{widgetSelector:r.selector})}):v;t.hi(p.id);var g=null!=r?r:{},m=g.properties,y=g.initialResponses,b=!(!y||0>=Object.keys(y).length)&&t.ci(p,y,m,f);if(!b||null!=(n=p.appearance)&&n.displayThankYouMessage){t.di(p);var w={};if((null==(a=p.appearance)?void 0:a.position)===ah.NextToTrigger&&null!=(o=p.appearance)&&o.widgetSelector){var k,_=qc.querySelector(p.appearance.widgetSelector);_&&(w=Hc(_,parseInt((null==(k=p.appearance)?void 0:k.maxWidth)||Ah.maxWidth))||{})}var S=(null==(s=p.appearance)?void 0:s.surveyPopupDelaySeconds)||0,x=Dh(p,t._posthog).shadow;t.si.set(x,x.host);var C={posthog:t._posthog,survey:p,removeSurveyFromFocus:t.vi,properties:m,style:w,isSurveyCompleted:b,skipShownEvent:null==r?void 0:r.skipShownEvent,surveyLanguage:f};if(0>=S)return Al(nc(Zc,h({},C)),x);var M=()=>{if(!t.fi(p))return vh.info("Survey "+p.id+" no longer eligible when its display delay elapsed; not displaying"),t.vi(p);Al(nc(Zc,h({},C,{survey:h({},p,{appearance:h({},p.appearance,{surveyPopupDelaySeconds:0})})})),x)},T=c?null==(u=t._posthog.surveys)||null==(u=u._surveyEventReceiver)||null==u.getActivationTimestamp?void 0:u.getActivationTimestamp(p.id):void 0,E=I(T)?Math.max(0,Date.now()-T):0,R=Math.max(0,1e3*S-E);if(0>=R)return M();var A=Nc.setTimeout((()=>{t.ai.delete(p.id),M()}),R);t.ai.set(p.id,A)}},this.pi=e=>{var t=this.li(e),r=t.survey,i=t.language,n=Dh(r,this._posthog),a=n.shadow,o=n.isNewlyCreated;this.si.set(a,a.host),o&&Al(nc(Qc,{posthog:this._posthog,survey:r,surveyLanguage:i},e.id),a)},this.gi=e=>{var t=this.oi.get(e);t&&(t.element.removeEventListener("click",t.listener),t.element.removeAttribute(Bc),this.oi.delete(e),vh.info("Removed click listener for survey "+e))},this.mi=e=>{this.yi(e)||(this.bi(e),this.gi(e.id))},this.yi=e=>{try{var t,r=qc.querySelector(tc(e,!0));return!(null==r||null==(t=r.shadowRoot)||!t.querySelector(".ph-survey"))}catch(e){return!1}},this.wi=(e,t)=>{var r=qc.querySelector(t),i=this.oi.get(e.id);if(r){if(this.pi(e),i){if(r===i.element)return;vh.info("Selector element changed for survey "+e.id+". Re-attaching listener."),this.gi(e.id)}if(!r.hasAttribute(Bc)){var n=t=>{var r,i;t.stopPropagation();var n=(null==(r=e.appearance)?void 0:r.position)===ah.NextToTrigger?Hc(t.currentTarget,parseInt((null==(i=e.appearance)?void 0:i.maxWidth)||Ah.maxWidth)):{};Nc.dispatchEvent(new CustomEvent(jc,{detail:{surveyId:e.id,position:n}}))};Ne(r,"click",n),r.setAttribute(Bc,"true"),this.oi.set(e.id,{element:r,listener:n,survey:e}),vh.info("Attached click listener for feedback button survey "+e.id)}}else i&&this.mi(e)},this.renderPopover=e=>{var t=this.li(e),r=t.survey,i=t.language,n=Dh(r,this._posthog).shadow;this.si.set(n,n.host),Al(nc(Zc,{posthog:this._posthog,survey:r,removeSurveyFromFocus:this.vi,surveyLanguage:i}),n)},this.renderSurvey=(e,t,r)=>{var i,n=this.li(e),a=n.survey,o=n.language,s=!1;null!=(i=this._posthog.config)&&null!=(i=i.surveys)&&i.prefillFromUrl&&(s=this.ki(a,o,r)),Al(nc(Zc,{posthog:this._posthog,survey:a,removeSurveyFromFocus:this.vi,isPopup:!1,properties:r,isSurveyCompleted:s,surveyLanguage:o}),t)},this.getActiveMatchingSurveys=function(e,r){var i;void 0===r&&(r=!1),null==(i=t._posthog)||null==(i=i.surveys)||i.getSurveys((r=>{var i=r.filter((e=>t.fi(e)));e(i)}),r)},this.callSurveysAndEvaluateDisplayLogic=function(e){void 0===e&&(e=!1),t.getActiveMatchingSurveys((e=>{var r=e.filter((e=>e.type===sh.Popover||e.type===sh.Widget)),i=new Set(r.map((e=>e.id)));for(var n of Array.from(t.ai.keys()))i.has(n)||t.cancelSurvey(n);var a=t.Si(r),o=new Set;a.forEach((e=>{if(e.type===sh.Widget){var r,i,n,a;if((null==(r=e.appearance)?void 0:r.widgetType)===nh.Tab)return void t.pi(e);(null==(i=e.appearance)?void 0:i.widgetType)===nh.Selector&&null!=(n=e.appearance)&&n.widgetSelector&&(o.add(e.id),t.wi(e,null==(a=e.appearance)?void 0:a.widgetSelector))}M(t.xi)&&e.type===sh.Popover&&t.handlePopoverSurvey(e,void 0,{resumeDelayFromActivation:!0})})),t.oi.forEach((e=>{var r=e.survey;o.has(r.id)||t.mi(r)}))}),e)},this.di=e=>{M(this.xi)||vh.error("Survey "+this.xi+" already in focus. Cannot add survey "+e.id+"."),this.xi=e.id},this.vi=e=>{this.xi!==e.id&&vh.error("Survey "+e.id+" is not in focus. Cannot remove survey "+e.id+"."),this.hi(e.id),this.xi=null,this.bi(e)},this._posthog=e,this.xi=null}get Ci(){var e,t,r;return null!==(e=null==(t=(r=this._posthog).getExtension)?void 0:t.call(r,"featureFlags"))&&void 0!==e?e:this._posthog.featureFlags}hi(e){var t=this.ai.get(e);t&&(clearTimeout(t),this.ai.delete(e))}cancelSurvey(e){this.ai.has(e)&&(vh.info("Cancelled pending survey "+e),this.hi(e),this.xi===e&&(this.xi=null))}setAutomaticDisplayDispose(e){this.Mi=e}dispose(){var e;null==(e=this.Mi)||e.call(this),this.Mi=void 0,this.ai.forEach(((e,t)=>this.hi(t))),this.oi.forEach(((e,t)=>this.gi(t))),this.si.forEach(((e,t)=>{Al(null,t),null==e||e.remove()})),this.si.clear(),this.xi=null}Si(e){return e.sort(((e,t)=>{var r,i,n=Xh(e),a=Xh(t);if(n&&!a)return-1;if(!n&&a)return 1;var o=e.schedule===hh,s=t.schedule===hh;return o&&!s?1:!o&&s?-1:((null==(r=e.appearance)?void 0:r.surveyPopupDelaySeconds)||0)-((null==(i=t.appearance)?void 0:i.surveyPopupDelaySeconds)||0)}))}li(e){return Dc(e,this._posthog)}ki(e,t,r){if(this.ui.has(e.id))return!1;var i=function(e){var t={},r=!1,i=e.replace(/^\?/,"");if(!i)return{params:t,autoSubmit:r};var n=i.split("&");for(var a of n){var o=a.split("="),s=o[0],u=o[1];if(s&&!S(u)){var l=decodeURIComponent(s),h=decodeURIComponent(u);if("auto_submit"!==l||"true"!==h){var c=l.match(/^q(\d+)$/);if(c){var d=parseInt(c[1],10);t[d]||(t[d]=[]),t[d].push(h)}}else r=!0}}return{params:t,autoSubmit:r}}(Nc.location.search),n=i.params;if(0===Object.keys(n).length)return!1;vh.info("[Survey Prefill] Detected URL prefill parameters");var a=this.Ti(e,n,t);return!!a&&(this.Ii(e,a,r,t),this.ui.add(e.id),a.isSurveyCompleted)}Ii(e,t,r,i){var n=t.responses,a=t.submissionId,o=t.isSurveyCompleted,s=t.skippedResponses;(Object.keys(s).length>0&&e.enable_partial_responses||o)&&Fh({responses:o?n:s,survey:e,surveySubmissionId:a,posthog:this._posthog,isSurveyCompleted:o,properties:r,surveyLanguage:i})}ci(e,t,r,i){var n={};for(var a of Object.entries(t)){var o=a[1];n[parseInt(a[0])]=w(o)?o.map(String):[String(o)]}vh.info("[Survey] Processing initial responses");var s=this.Ti(e,n,i);return!!s&&(this.Ii(e,s,r,i),s.isSurveyCompleted)}Ti(e,t,r){try{var i=function(e,t){var r={};return e.questions.forEach(((e,i)=>{if(t[i]&&e.id){var n=t[i],a=si(e.id);try{switch(e.type){case uh.SingleChoice:if(!e.choices||0===e.choices.length)return void Le.warn("[Survey Prefill] Question "+i+" has no choices");var o=parseInt(n[0],10);if(isNaN(o)||0>o||o>=e.choices.length)return void Le.warn("[Survey Prefill] Invalid choice index for q"+i+": "+n[0]);r[a]=e.choices[o];break;case uh.MultipleChoice:if(!e.choices||0===e.choices.length)return void Le.warn("[Survey Prefill] Question "+i+" has no choices");var s=n.map((e=>parseInt(e,10))).filter((t=>!isNaN(t)&&t>=0&&e.choices.length>t));if(0===s.length)return void Le.warn("[Survey Prefill] No valid choices for q"+i);var u=[...new Set(s.map((t=>e.choices[t])))];s.length>u.length&&Le.warn("[Survey Prefill] Removed duplicate choices for q"+i),r[a]=u;break;case uh.Rating:var l=parseInt(n[0],10),h=e.scale||10;if(isNaN(l)||0>l||l>h)return void Le.warn("[Survey Prefill] Invalid rating for q"+i+": "+n[0]+" (scale: 0-"+h+")");r[a]=l;break;default:Le.info("[Survey Prefill] Question type "+e.type+" does not support prefill")}}catch(e){Le.error("[Survey Prefill] Error converting q"+i+":",e)}}})),r}(e,t);if(0===Object.keys(i).length)return vh.warn("[Survey Prefill] No valid responses after conversion"),null;var n=Sh(),a=Object.keys(t).map((e=>parseInt(e,10))),o=function(e,t,r){for(var i=0,n={},a=[],o=e.questions.length+1,s=0;e.questions.length>i&&o>s&&(s++,t.includes(i));){var u=e.questions[i];if(!u||!("skipSubmitButton"in u)||!u.skipSubmitButton)break;if(u.id){var l=si(u.id);S(r[l])||(n[l]=r[l])}a.push(i);var h=Oc(e,i,u.id?r[si(u.id)]:null);if(h===lh.End)return{startQuestionIndex:e.questions.length,skippedResponses:n,skippedIndices:a};i=h}return{startQuestionIndex:i,skippedResponses:n,skippedIndices:a}}(e,a,i),s=o.startQuestionIndex,u=o.skippedResponses,l=o.skippedIndices,h=s>=e.questions.length;return Yh(e,{surveySubmissionId:n,responses:i,lastQuestionIndex:s,questionOrder:$h(e.questions),visitedIndices:l,surveyLanguage:r}),vh.info("[Survey Prefill] Stored prefilled responses in localStorage"),{responses:i,submissionId:n,startQuestionIndex:s,isSurveyCompleted:h,skippedResponses:u}}catch(e){return vh.error("[Survey Prefill] Error handling prefill:",e),null}}Ei(e,t){if(void 0===t&&(t=void 0),!e)return!0;var r=this.Ci,i=!(null==r||!r.isFeatureEnabled(e,{send_event:!e.startsWith("survey-targeting-")})),n=!0;return t&&(n=(null==r?void 0:r.getFeatureFlag(e,{send_event:!1}))===t||"any"===t),i&&n}Ri(e){return!e.conditions||Gh(e,this._posthog)&&Qh(e)&&function(e){var t;return null==(t=e.conditions)||!t.selector||!(null==Eh||!Eh.querySelector(e.conditions.selector))}(e)}Ai(e){var t;return Wh(e)?{satisfied:!0}:!e.internal_targeting_flag_key||!function(e){var t;return"recurring"===e.schedule||(null!==(t=e.current_iteration)&&void 0!==t?t:0)>0}(e)||null!=(t=this.Ci)&&t.hasLoadedFlags?{satisfied:this.Ei(e.internal_targeting_flag_key)}:{satisfied:!1,reason:"Feature flags have not loaded yet; deferring internal targeting flag check"}}checkSurveyEligibility(e){var t,r,i={eligible:!0,reason:void 0};if(!function(e){return!(!e.start_date||e.end_date)}(e))return i.eligible=!1,i.reason="Survey is not running. It was completed on "+e.end_date,i;if(!mh.includes(e.type))return i.eligible=!1,i.reason="Surveys of type "+e.type+" are never eligible to be shown in the app",i;var n=null==(t=e.conditions)?void 0:t.linkedFlagVariant;if(!this.Ei(e.linked_flag_key,n))return i.eligible=!1,i.reason=n?"Survey linked feature flag is not enabled for variant "+n:"Survey linked feature flag is not enabled",i;if(!this.Ei(e.targeting_flag_key))return i.eligible=!1,i.reason="Survey targeting feature flag is not enabled",i;var a,o=this.Ai(e);return o.satisfied?function(e,t){if(!e||!t)return!0;var r="string"==typeof t?new Date(t):t,i=new Date,n=Math.abs(i.getTime()-r.getTime());return Math.ceil(n/864e5)>e}(null==(r=e.conditions)?void 0:r.seenSurveyWaitPeriodInDays,Mh.ti("lastSeenSurveyDate"))?(e=>!!Mh.ti(ph(e))&&!Wh(e))(e)?(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!==(a=o.reason)&&void 0!==a?a:"Survey internal targeting flag is not enabled and survey cannot activate repeatedly and survey is not in progress",i)}checkSurveyRenderability(e){var t=this.checkSurveyEligibility(e);return t.eligible&&!this.Li(e)?{eligible:!1,reason:"Survey event/action trigger has not been fired yet"}:t}Li(e){var t;if(!gi(e)&&!function(e){var t;return!(null==(t=e.conditions)||null==(t=t.actions)||null==(t=t.values)||!t.length)}(e))return!0;var r=null==(t=this._posthog.surveys)||null==(t=t._surveyEventReceiver)?void 0:t.getSurveys();return!(null==r||!r.includes(e.id))}Oi(e){var t;return null==(t=e.feature_flag_keys)||!t.length||e.feature_flag_keys.every((e=>{var t=e.value;return!e.key||!t||this.Ei(t)}))}fi(e){return this.checkSurveyEligibility(e).eligible&&this.Ri(e)&&this.Li(e)&&this.Oi(e)}bi(e){try{var t=qc.querySelector(tc(e,!0));null!=t&&t.shadowRoot&&(Al(null,t.shadowRoot),this.si.delete(t.shadowRoot)),null==t||t.remove()}catch(t){vh.warn("Failed to remove survey "+e.id+" from DOM:",t)}}getTestAPI(){return{addSurveyToFocus:this.di,removeSurveyFromFocus:this.vi,surveyInFocus:this.xi,surveyTimeouts:this.ai,handleWidget:this.pi,handlePopoverSurvey:this.handlePopoverSurvey,manageWidgetSelectorListener:this.wi,sortSurveysByAppearanceDelay:this.Si,checkFlags:this.Oi.bind(this),isSurveyFeatureFlagEnabled:this.Ei.bind(this)}}}function Uc(e,t){if(qc&&Nc){var r,i=new $c(e);if(e.config.disable_surveys_automatic_display)return vh.info("Surveys automatic display is disabled. Skipping call surveys and evaluate display logic."),i;if(!1===t)return vh.info("There are no surveys to load or Surveys is disabled in the project settings."),i;i.callSurveysAndEvaluateDisplayLogic(!0);var n=()=>{S(r)&&(r=setInterval((()=>{i.callSurveysAndEvaluateDisplayLogic(!1)}),1e3))},a=()=>{S(r)||(clearInterval(r),r=void 0)};n();var o=()=>{qc.hidden?a():(i.callSurveysAndEvaluateDisplayLogic(!1),n())};return Ne(qc,"visibilitychange",o),i.setAutomaticDisplayDispose((()=>{a(),qc.removeEventListener("visibilitychange",o)})),i}}function Wc(e){var t=e.survey,r=e.removeSurveyFromFocus,i=void 0===r?()=>{}:r,n=e.setSurveyVisible,a=e.isPreviewMode,o=void 0!==a&&a,s=e.posthog;Zl((()=>{var e;if(!o&&null!=(e=t.conditions)&&e.url){var r=()=>{var e,r=t.type===sh.Widget,a=Gh(t,s),o=(null==(e=t.appearance)?void 0:e.widgetType)===nh.Tab&&r;if(!a)return vh.info("Hiding survey "+t.id+" because URL does not match"),n(!1),i(t);o&&(vh.info("Showing survey "+t.id+" because it is a feedback button tab and URL matches"),n(!0))};Ne(Nc,"popstate",r),Ne(Nc,"hashchange",r);var a=Nc.history.pushState,u=Nc.history.replaceState;return Nc.history.pushState=function(){for(var e=arguments.length,t=new Array(e),i=0;e>i;i++)t[i]=arguments[i];a.apply(this,t),r()},Nc.history.replaceState=function(){for(var e=arguments.length,t=new Array(e),i=0;e>i;i++)t[i]=arguments[i];u.apply(this,t),r()},()=>{Nc.removeEventListener("popstate",r),Nc.removeEventListener("hashchange",r),Nc.history.pushState=a,Nc.history.replaceState=u}}}),[o,t,i,n,s])}var zc=200;function Vc(e){switch(void 0===e&&(e=oh.Right),e){case oh.Top:return{top:"0",left:"50%",transform:"translateX(-50%)"};case oh.Left:return{top:"50%",left:"0",transform:"rotate(90deg) translateY(-100%)",transformOrigin:"left top"};case oh.Bottom:return{bottom:"0",left:"50%",transform:"translateX(-50%)"};default:return{top:"50%",right:"0",transform:"rotate(-90deg) translateY(-100%)",transformOrigin:"right top"}}}function Zc(e){var t,r,i,n,a,o,s,u,l,c,d,v,f=e.survey,p=e.forceDisableHtml,g=e.posthog,m=e.style,y=void 0===m?{}:m,b=e.previewPageIndex,w=e.removeSurveyFromFocus,k=void 0===w?()=>{}:w,_=e.isPopup,x=void 0===_||_,C=e.onPreviewSubmit,M=void 0===C?()=>{}:C,T=e.onPreviewBack,I=void 0===T?()=>{}:T,E=e.onPopupSurveyDismissed,R=void 0===E?()=>{}:E,A=e.onCloseConfirmationMessage,L=void 0===A?()=>{}:A,O=e.properties,P=e.isSurveyCompleted,D=e.skipShownEvent,F=e.surveyLanguage,N=Gl(null),q=Number.isInteger(b),j=null!=(t=f.appearance)&&t.surveyPopupDelaySeconds?1e3*f.appearance.surveyPopupDelaySeconds:0,B=function(e,t,r,i,n,a,o,s,u){var l=Vl(i||0===r||e.type===sh.ExternalSurvey),c=l[0],d=l[1],v=Vl(!1),f=v[0],p=v[1],g=Gl(!1),m=()=>{var t=()=>{a&&n(e),d(!1)};if(!g.current){var r=null==o?void 0:o.current;r?(g.current=!0,r.style.transition="opacity "+zc+"ms ease-out",r.style.opacity="0",setTimeout((()=>{g.current=!1,t()}),zc+50)):t()}},y=t=>{t.detail.surveyId===e.id&&m()};return Zl((()=>{if(t){if(!i){var n,a=t=>{var r,i;if(t.detail.surveyId===e.id){if(null==(r=e.appearance)||!r.displayThankYouMessage)return m();p(!0),null!=(i=e.appearance)&&i.autoDisappear&&(n&&clearTimeout(n),n=setTimeout(m,5e3))}},o=()=>{if(Gh(e,t)){d(!0),Nc.dispatchEvent(new Event("PHSurveyShown")),s||t.capture(ch.SHOWN,h({[dh.SURVEY_NAME]:e.name,[dh.SURVEY_ID]:e.id,[dh.SURVEY_ITERATION]:e.current_iteration,[dh.SURVEY_ITERATION_START_DATE]:e.current_iteration_start_date},u&&{[dh.SURVEY_LANGUAGE]:u},{sessionRecordingUrl:null==t.get_session_replay_url?void 0:t.get_session_replay_url()}));try{localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())}catch(e){}}};Ne(Nc,"PHSurveyClosed",y),Ne(Nc,"PHSurveySent",a);var l=r>0?setTimeout(o,r):void 0;return S(l)&&o(),()=>{S(l)||clearTimeout(l),S(n)||clearTimeout(n),Nc.removeEventListener("PHSurveyClosed",y),Nc.removeEventListener("PHSurveySent",a)}}}else vh.error("usePopupVisibility hook called without a PostHog instance.")}),[]),Wc({survey:e,removeSurveyFromFocus:n,setSurveyVisible:d,isPreviewMode:i,posthog:t}),{isPopupVisible:c,isSurveySent:f,setIsPopupVisible:d,hidePopupWithAnimation:m}}(f,g,j,q,k,x,N,D,F),H=B.isPopupVisible,U=B.hidePopupWithAnimation,W=B.isSurveySent||b===f.questions.length||!0===P,z=Vl(!1),V=z[0],Z=z[1],G=Ql((()=>!!Kh(f)),[f]),Q=!!(null!=(r=f.appearance)&&r.introScreenHeader||null!=(i=f.appearance)&&i.introScreenDescription),J=q?b===Fc:!(null==(n=f.appearance)||!n.displayIntroScreen)&&Q&&!V&&!G,Y=Ql((()=>{var e=Kh(f),t=(null==e?void 0:e.surveySubmissionId)||Sh();return{isPreviewMode:q,previewPageIndex:b,onPopupSurveyDismissed(){F?qh(f,g,q,F):qh(f,g,q),R()},isPopup:x||!1,surveySubmissionId:t,onPreviewSubmit:M,onPreviewBack:I,posthog:g,properties:O,surveyLanguage:F}}),[q,b,x,g,f,R,M,I,O,F]);return H?nc(zh.Provider,{value:Y,children:nc("div",{className:"ph-survey",style:h({},rc(f.type,null==(a=f.appearance)?void 0:a.position,null==(o=f.appearance)?void 0:o.widgetType),y),ref:N,children:W?nc(bc,{header:(null==(s=f.appearance)?void 0:s.thankYouMessageHeader)||"Thank you!",description:(null==(u=f.appearance)?void 0:u.thankYouMessageDescription)||"",forceDisableHtml:!!p,contentType:null==(l=f.appearance)?void 0:l.thankYouMessageDescriptionContentType,appearance:f.appearance||Ah,onClose(){U(),L()}}):J?nc(wc,{header:(null==(c=f.appearance)?void 0:c.introScreenHeader)||"",description:(null==(d=f.appearance)?void 0:d.introScreenDescription)||"",forceDisableHtml:!!p,contentType:null==(v=f.appearance)?void 0:v.introScreenDescriptionContentType,appearance:f.appearance||Ah,onStart:()=>Z(!0)}):nc(Gc,{survey:f,forceDisableHtml:!!p,posthog:g})})}):null}function Gc(e){var t,r,i=e.survey,n=e.forceDisableHtml,a=e.posthog,o=Ql((()=>{var e=Kh(i);if(!e)return null;var t=I(e.lastQuestionIndex);return!t||t&&e.lastQuestionIndex>=0&&i.questions.length>e.lastQuestionIndex?e:(ec(i),null)}),[i]),s=Vl((()=>(null!=o&&o.responses&&vh.info("Survey is already in progress, filling in initial responses"),(null==o?void 0:o.responses)||{}))),u=s[0],l=s[1],c=Jl(zh),d=c.previewPageIndex,v=c.onPopupSurveyDismissed,f=c.isPopup,p=c.onPreviewSubmit,g=c.onPreviewBack,m=c.surveySubmissionId,y=c.isPreviewMode,b=c.properties,w=c.surveyLanguage,k=Vl((()=>{var e=null==o?void 0:o.lastQuestionIndex,t=I(e)&&e>=0&&i.questions.length>e?e:0;return I(d)&&d>=0?d:t})),_=k[0],x=k[1],C=Vl((()=>{var e;return(null!==(e=null==o?void 0:o.visitedIndices)&&void 0!==e?e:[]).filter((e=>e>=0&&i.questions.length>e))})),M=C[0],T=C[1],E=Ql((()=>Uh(i,o)),[i,o]);Zl((()=>{!y||S(d)||0>d||x(d)}),[d,y]);var R=!(null==(t=i.appearance)||!t.allowGoBack)&&(y?(null!=d?d:0)>0:M.length>0),A=E.at(_);return A?nc("form",{className:"survey-form",name:"surveyForm",children:[f&&!0!==(null==(r=i.appearance)?void 0:r.hideCancelButton)&&nc(mc,{onClick(){v()}}),nc("div",{className:"survey-box","data-question-index":_,children:Jc({question:A,forceDisableHtml:n,displayQuestionIndex:_,appearance:i.appearance||Ah,onSubmit:e=>(e=>{var t=e.res,r=e.displayQuestionIndex,n=e.questionId;if(a)if(n){var o=si(n),s=h({},u,{[o]:t});l(s);var c=Oc(i,r,t),d=c===lh.End,v=[...M,r];if(d||(T(v),x(c),Yh(i,{surveySubmissionId:m,responses:s,lastQuestionIndex:c,questionOrder:$h(E),visitedIndices:v,surveyLanguage:w})),i.enable_partial_responses||d){var f=new Set(v.map((e=>{var t;return null==(t=E[e])?void 0:t.id})).filter((e=>!!e)).map((e=>si(e)))),p=Object.fromEntries(Object.entries(s).filter((e=>f.has(e[0]))));Fh({responses:p,survey:i,surveySubmissionId:m,isSurveyCompleted:d,posthog:a,properties:b,surveyLanguage:w})}}else vh.error("onNextButtonClick called without a questionId.");else vh.error("onNextButtonClick called without a PostHog instance.")})({res:e,displayQuestionIndex:_,questionId:A.id}),onPreviewSubmit:p,initialValue:A.id?u[si(A.id)]:void 0,canGoBack:R,onBack(){if(y)g();else if(0!==M.length){var e=M[M.length-1],t=M.slice(0,-1);T(t),x(e),Yh(i,{surveySubmissionId:m,responses:u,lastQuestionIndex:e,questionOrder:$h(E),visitedIndices:t,surveyLanguage:w})}}})})]}):null}function Qc(e){var t,r,i,n,a,o,s,u=e.survey,l=e.forceDisableHtml,h=e.posthog,c=e.readOnly,d=e.surveyLanguage,v=Vl(!0),f=v[0],p=v[1],g=Vl(!1),m=g[0],y=g[1],b=Vl({}),w=b[0],k=b[1],_=Gl(void 0),x=()=>{y(!m)};if(Zl((()=>{var e;if(h){if(!c){"tab"===(null==(e=u.appearance)?void 0:e.widgetType)&&k({top:"50%",bottom:"auto"});var t=e=>{var t,r=e;(null==(t=r.detail)?void 0:t.surveyId)===u.id&&(vh.info("Received show event for feedback button survey "+u.id),k(r.detail.position||{}),x())};return Ne(Nc,jc,t),()=>{S(_.current)||(clearTimeout(_.current),_.current=void 0),Nc.removeEventListener(jc,t)}}}else vh.error("FeedbackWidget called without a PostHog instance.")}),[h,c,u.id,null==(t=u.appearance)?void 0:t.widgetType,null==(r=u.appearance)?void 0:r.widgetSelector,null==(i=u.appearance)?void 0:i.borderColor]),Wc({survey:u,setSurveyVisible:p,posthog:h}),!f)return null;var C=()=>{u.schedule!==hh&&p(!1),S(_.current)||clearTimeout(_.current),_.current=setTimeout((()=>{_.current=void 0,y(!1)}),200)};return nc(cl,{children:["tab"===(null==(n=u.appearance)?void 0:n.widgetType)&&nc("button",{className:"ph-survey-widget-tab "+((null==(a=u.appearance)?void 0:a.tabPosition)===oh.Top?"widget-tab-top":""),onClick:x,disabled:c,style:Vc(null==(o=u.appearance)?void 0:o.tabPosition),children:(null==(s=u.appearance)?void 0:s.widgetLabel)||""}),m&&nc(Zc,{posthog:h,survey:u,forceDisableHtml:l,style:w,onPopupSurveyDismissed:C,onCloseConfirmationMessage:C,surveyLanguage:d})]})}var Jc=e=>{var t=e.question,r=e.onSubmit,i=e.onPreviewSubmit,n={forceDisableHtml:e.forceDisableHtml,appearance:e.appearance,onPreviewSubmit(e){i(e)},onSubmit(e){r(e)},initialValue:e.initialValue,displayQuestionIndex:e.displayQuestionIndex,canGoBack:e.canGoBack,onBack:e.onBack};switch(t.type){case uh.Open:return ll(_c,h({},n,{question:t,key:t.id}));case uh.Link:return ll(Sc,h({},n,{question:t,key:t.id}));case uh.Rating:return ll(xc,h({},n,{question:t,key:t.id}));case uh.SingleChoice:case uh.MultipleChoice:return ll(Mc,h({},n,{question:t,key:t.id}));default:return vh.error("Unsupported question type: "+t.type),null}};s.__PosthogExtensions__=s.__PosthogExtensions__||{},s.__PosthogExtensions__.generateSurveys=Uc,s.extendPostHogWithSurveys=Uc;var Yc=1e4,Kc=(e,t,r)=>r.remaining>0?t.length>r.remaining?(e.push(t.slice(0,r.remaining)),r.remaining=0,r.truncated=!0,!1):(e.push(t),r.remaining-=t.length,!0):(r.truncated=!0,!1),Xc=(e,t,r)=>{var i=JSON.stringify(e);if(r.remaining>=i.length)return Kc(t,i,r);if(r.truncated=!0,2>r.remaining)return!1;for(var n=0,a=Math.min(e.length,r.remaining-2);a>n;){var o=Math.ceil((n+a)/2);JSON.stringify(e.slice(0,o)).length>r.remaining?a=o-1:n=o}return Kc(t,JSON.stringify(e.slice(0,n)),r)},ed=e=>void 0!==e&&"function"!=typeof e&&"symbol"!=typeof e&&"bigint"!=typeof e,td=(e,t,r)=>{if(!r.truncated){if(r.keysRemaining-=1,r.sizeRemaining-=String(t).length+e.length,0>=r.keysRemaining||0>=r.sizeRemaining)return r.truncated=!0,void(r.result.attributes_truncated=!0);r.result[e]=t}},rd=(e,t,r)=>{if(!r.truncated)if(_(e)){if(r.seen.has(e))return void td(t||"circular","[Circular]",r);r.seen.add(e);try{for(var i in e)try{if(!{}.hasOwnProperty.call(e,i))continue;if(rd(e[i],t?t+"."+i:i,r),r.truncated)return}catch(e){continue}}catch(e){}}else td(t,e,r)},id=function(e,t,r,i,n,a){if(void 0===n&&(n=!1),!ed(e))return!n||Kc(t,"null",r);if(M(e)||(e=>{try{return I(e)||E(e)}catch(e){return!1}})(e))return Kc(t,JSON.stringify(e),r);if("string"==typeof e)return Xc(e,t,r);if(!_(e)&&!w(e))return Kc(t,JSON.stringify(e),r);if(i.has(e))return Xc("[Circular]",t,r);i.add(e);try{var o=e.toJSON;if(k(o))return id(o.call(e),t,r,i,n)}catch(e){}try{var s={}.toString.call(e);if("[object String]"===s)return Xc(String(e.valueOf()),t,r);if("[object Number]"===s||"[object Boolean]"===s)return Kc(t,JSON.stringify(e.valueOf()),r)}catch(e){}if(e instanceof Error){var u={};try{for(var l in e)({}).hasOwnProperty.call(e,l)&&(u[l]=e[l])}catch(e){}try{u.name=e.name}catch(e){}try{u.message=e.message}catch(e){}try{u.stack=e.stack}catch(e){}return id(u,t,r,i,n,a)}if(w(e)){if(!Kc(t,"[",r))return!1;for(var h=0;e.length>h;h++){if(h>0&&!Kc(t,",",r))return!1;var c=void 0;try{c=e[h]}catch(e){c=void 0}if(!id(c,t,r,i,!0))return!1}return Kc(t,"]",r)}if(!Kc(t,"{",r))return!1;var d=!0;try{for(var v in e)if({}.hasOwnProperty.call(e,v)){if(0>=r.remaining)return r.truncated=!0,!1;var f=void 0;try{f=e[v]}catch(e){continue}if(a)try{rd(f,v,a)}catch(e){}if(ed(f)){var p=(d?"":",")+JSON.stringify(v)+":";if(p.length>=r.remaining)return r.truncated=!0,!1;var g=t.length,m=r.remaining,y=r.truncated;if(!Kc(t,p,r))return!1;var b=t.length,S=id(f,t,r,i,!1),x=r.truncated;if(t.length!==b){if(d=!1,!S)return!1}else if(t.length=g,r.remaining=m,r.truncated=S?y:x,!S)return!1}}}catch(e){}return Kc(t,"}",r)},nd=(e,t)=>{for(var r=[],i={remaining:t,truncated:!1},n=_(e[0])?{result:{},keysRemaining:50,sizeRemaining:Yc,truncated:!1,seen:new WeakSet([e[0]])}:void 0,a=0;e.length>a&&(0>=a||Kc(r," ",i))&&id(e[a],r,i,new WeakSet,!1,0===a?n:void 0);a++);return{body:r.join("")+(i.truncated?"...":""),truncated:i.truncated,attributes:(null==n?void 0:n.result)||{}}},ad={debug:"debug",log:"info",warn:"warn",error:"error",info:"info"},od=e=>"canCapture"in e,sd=e=>od(e)?e.canCapture?e.getExtension("logs"):void 0:e.is_capturing()?e.logs:void 0;s.__PosthogExtensions__=s.__PosthogExtensions__||{},s.__PosthogExtensions__.logs={initializeLogs(e){var t=e,r=[],i={host:s.location.host},n=!1,a=function(e){var a=s.console[e];r.push(pu(s.console,e,(r=>{var o=(r=>function(){for(var a=!1,o=arguments.length,u=new Array(o),l=0;o>l;l++)u[l]=arguments[l];try{var c=t;if(u.length>0&&!n&&c){var d=sd(c);if(d){n=!0,a=!0;var v=nd(u,Yc),f=v.body,p=v.attributes,g=h({},i,v.truncated?{body_truncated:"true"}:{});((e,t,r)=>{if(od(e))t.captureConsoleLog(r);else{var i=(e=>{var t=/^1\.(\d+)\.(\d+)$/.exec(e);if(t){var r=Number(t[1]),i=Number(t[2]);if(r>=392&&419>=r)return 410===r?i>4?i>10?void 0:"de":"le":418===r?i>3?i>10?i>14?i>17?void 0:"vi":"ci":"ui":"he":419===r?i>2?void 0:"vi":410>r?"le":"he"}})(e.version),n=i?t[i]:void 0;k(n)&&n.call(t,r)}})(c,d,{level:ad[e],body:f,attributes:h({"log.source":"console."+e},g,p)})}}}catch(e){}finally{a&&(n=!1),r.apply(s.console,u)}})(r);return o.__rrweb_original__=(e=>{for(;null!=(t=e)&&t.__rrweb_original__;){var t;e=e.__rrweb_original__}return e})(a),o})))};for(var o of Object.keys(ad))a(o);return()=>{t=void 0,r.forEach((e=>e()))}},replayConsoleBuffer(e,t){var r=sd(e);if(r)for(var i of t)try{var n=nd(i.args,Yc);null==r.captureBufferedConsoleLog||r.captureBufferedConsoleLog({level:ad[i.level],body:n.body,attributes:h({"log.source":"console."+i.level,host:s.location.host},n.truncated?{body_truncated:"true"}:{},n.attributes)},i.context,i.occurredAtMs)}catch(e){}}},Oe("[Error tracking]");var ud=Oe("[ExceptionAutocapture]"),ld=new class{constructor(e,t,r){void 0===r&&(r=[]),this.coercers=e,this.stackParser=t,this.modifiers=r}buildFromUnknown(e,t){void 0===t&&(t={});var r=t&&t.mechanism||{handled:!0,type:"generic"},i=this.buildCoercingContext(r,t,0).apply(e),n=this.buildParsingContext(t),a=this.parseStacktrace(i,n);return{$exception_list:this.convertToExceptionList(a,r),$exception_level:"error"}}modifyFrames(e){var t=this;return l((function*(){for(var r of e)r.stacktrace&&r.stacktrace.frames&&w(r.stacktrace.frames)&&(r.stacktrace.frames=yield t.applyModifiers(r.stacktrace.frames));return e}))()}coerceFallback(e){var t;return{type:"Error",value:"Unknown error",stack:null==(t=e.syntheticException)?void 0:t.stack,synthetic:!0}}parseStacktrace(e,t){var r,i;return null!=e.cause&&(r=this.parseStacktrace(e.cause,t)),""!=e.stack&&null!=e.stack&&(i=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?t.skipFirstLines:0),t.chunkIdMap)),h({},e,{cause:r,stack:i})}applyChunkIds(e,t){return e.map((e=>(e.filename&&t&&(e.chunk_id=t[e.filename]),e)))}applyCoercers(e,t){for(var r of this.coercers)if(r.match(e))return r.coerce(e,t);return this.coerceFallback(t)}applyModifiers(e){var t=this;return l((function*(){var r=e;for(var i of t.modifiers)r=yield i(r);return r}))()}convertToExceptionList(e,t){var r,i,n,a={type:e.type,value:e.value,mechanism:{type:null!==(r=t.type)&&void 0!==r?r:"generic",handled:null===(i=t.handled)||void 0===i||i,synthetic:null!==(n=e.synthetic)&&void 0!==n&&n}};e.stack&&(a.stacktrace={type:"raw",frames:e.stack});var o=[a];return null!=e.cause&&o.push(...this.convertToExceptionList(e.cause,h({},t,{handled:!0}))),o}buildParsingContext(e){var t;return{chunkIdMap:pe(this.stackParser),skipFirstLines:null!==(t=e.skipFirstLines)&&void 0!==t?t:1}}buildCoercingContext(e,t,r){void 0===r&&(r=0);var i=(r,i)=>{if(4>=i){var n=this.buildCoercingContext(e,t,i);return this.applyCoercers(r,n)}};return h({},t,{syntheticException:0==r?t.syntheticException:void 0,mechanism:e,apply:e=>i(e,r),next:e=>i(e,r+1)})}}([new class{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,t){var r=x(e.stack);return{type:this.getType(e),value:this.getValue(e),stack:r?e.stack:void 0,cause:e.cause?t.next(e.cause):void 0,synthetic:!1}}getType(e){return this.isDOMError(e)?"DOMError":"DOMException"}getValue(e){var t=e.name||(this.isDOMError(e)?"DOMError":"DOMException");return e.message?t+": "+e.message:t}isDOMException(e){return L(e,"DOMException")}isDOMError(e){return L(e,"DOMError")}},new class{match(e){return L(e,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(e)}isCustomEventWrappingRejection(e){if(!P(e))return!1;try{var t=e.detail;return null!=t&&"object"==typeof t&&"reason"in t}catch(e){return!1}}coerce(e,t){var r,i=this.getUnhandledRejectionReason(e);return A(i)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(i),stack:null==(r=t.syntheticException)?void 0:r.stack,synthetic:!0}:t.apply(i)}getUnhandledRejectionReason(e){try{if("reason"in e)return e.reason;if("detail"in e&&null!=e.detail&&"object"==typeof e.detail&&"reason"in e.detail)return e.detail.reason}catch(e){}return e}},new class{constructor(){}match(e){return!!L(e,"ErrorEvent")&&(null!=e.error||this.Pi(e))}coerce(e,t){var r;if(null!=e.error)return t.apply(e.error);var i=t.apply(e.message);return h({},i,{stack:null!==(r=this.Di(e))&&void 0!==r?r:i.stack,synthetic:!0})}Pi(e){return x(e.message)&&e.message.length>0}Di(e){var t,r,i=e,n=null!==(t=i.lineno)&&void 0!==t?t:0,a=null!==(r=i.colno)&&void 0!==r?r:0;if(x(i.filename)&&0!==i.filename.length&&0!==n)return"Error\n at "+i.filename+":"+n+":"+a}},new class{match(e){return O(e)}coerce(e,t){var r,i=this.getStack(e),n=void 0===i;return{type:this.getType(e),value:this.getMessage(e,t),stack:null!=i?i:null==(r=t.syntheticException)?void 0:r.stack,cause:e.cause?t.next(e.cause):void 0,synthetic:n}}getType(e){return e.name||e.constructor.name}getMessage(e,t){var r=e.message;return String(r.error&&"string"==typeof r.error.message?r.error.message:r)}getStack(e){return e.stacktrace||e.stack||void 0}},new class{match(e){return P(e)}coerce(e,t){var r,i=e.constructor.name;return{type:i,value:i+" captured as exception with keys: "+Ee(e),stack:null==(r=t.syntheticException)?void 0:r.stack,synthetic:!0}}},new class{match(e){return"object"==typeof e&&null!==e}coerce(e,t){var r,i,n=this.getErrorPropertyFromObject(e);return n?t.apply(n):{type:this.getType(e),value:this.getValue(e),stack:null!==(r=this.getStack(e))&&void 0!==r?r:null==(i=t.syntheticException)?void 0:i.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}}getType(e){if(P(e))return e.constructor.name;var t="name"in e?e.name:void 0;return x(t)&&!C(t)?t:"Error"}getValue(e){if("name"in e&&"string"==typeof e.name){var t="'"+e.name+"' captured as exception";return"message"in e&&"string"==typeof e.message&&(t+=" with message: '"+e.message+"'"),t}if("message"in e&&"string"==typeof e.message)return e.message;var r=this.getObjectClassName(e);return(r&&"Object"!==r?"'"+r+"'":"Object")+" captured as exception with keys: "+Ee(e)}isSeverityLevel(e){return x(e)&&!C(e)&&Ie.indexOf(e)>=0}getStack(e){try{return x(e.stacktrace)&&e.stacktrace.length>0?e.stacktrace:x(e.stack)&&e.stack.length>0?e.stack:void 0}catch(e){return}}getErrorPropertyFromObject(e){for(var t in e)if({}.hasOwnProperty.call(e,t)){var r=e[t];if(O(r))return r}}getObjectClassName(e){try{var t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch(e){return}}},new class{match(e){return"string"==typeof e}coerce(e,t){var r,i=this.getInfos(e),n=i[0],a=i[1];return{type:null!=n?n:"Error",value:null!=a?a:e,stack:null==(r=t.syntheticException)?void 0:r.stack,synthetic:!0}}getInfos(e){var t="Error",r=e,i=e.match(Te);return i&&(t=i[1],r=i[2]),[t,r]}},new class{match(e){return A(e)}coerce(e,t){var r;return{type:"Error",value:"Primitive value captured as exception: "+String(e),stack:null==(r=t.syntheticException)?void 0:r.stack,synthetic:!0}}}],function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;t>i;i++)r[i-1]=arguments[i];return function(t,i){void 0===i&&(i=0);for(var n=[],a=t.split("\n"),o=i;a.length>o;o++){var s=a[o];if(1024>=s.length){var u=Me.test(s)?s.replace(Me,"$1"):s;if(!u.match(/\S*Error: /)){for(var l of r){var c=l(u,e);if(c){n.push(c);break}}if(n.length>=50)break}}}return function(e){if(!e.length)return[];var t=Array.from(e);return t.reverse(),t.slice(0,50).map((e=>{return h({},e,{filename:e.filename||(r=t,r[r.length-1]||{}).filename,function:e.function||ge});var r}))}(n)}}("web:javascript",_e,Ce)),hd=t=>{var r=e;r||ud.info("window not available, cannot wrap onerror");var i=r.onerror;return r.onerror=function(){for(var e,r=arguments.length,n=new Array(r),a=0;r>a;a++)n[a]=arguments[a];var o=ld.buildFromUnknown((e=>{var t=e[0],r=e[1],i=e[2],n=e[3],a=e[4];if(null!=a)return a;if(x(t)&&x(r)&&r.length>0&&"undefined"!=typeof ErrorEvent)try{return new ErrorEvent("error",{message:t,filename:r,lineno:i,colno:n})}catch(e){return t}return t})(n),{mechanism:{handled:!1}});return t(o),!!k(i)&&null!==(e=i(...n))&&void 0!==e&&e},r.onerror.__POSTHOG_INSTRUMENTED__=!0,()=>{var e;null==(e=r.onerror)||delete e.__POSTHOG_INSTRUMENTED__,r.onerror=i}},cd=function(t,r){void 0===r&&(r=!1);var i=e;i||ud.info("window not available, cannot wrap onUnhandledRejection");var n=i.onunhandledrejection;return i.onunhandledrejection=function(e){var i,a=ld.buildFromUnknown(e,{mechanism:{handled:!1}});return t(a),k(n)?null!==(i=n(e))&&void 0!==i&&i:r},i.onunhandledrejection.__POSTHOG_INSTRUMENTED__=!0,()=>{var e;null==(e=i.onunhandledrejection)||delete e.__POSTHOG_INSTRUMENTED__,i.onunhandledrejection=n}},dd={wrapOnError:hd,wrapUnhandledRejection:cd,wrapConsoleError(e){var t=console;t||ud.info("console not available, cannot wrap console.error");var r=t.error;return t.error=function(){for(var t,i=arguments.length,n=new Array(i),a=0;i>a;a++)n[a]=arguments[a];t=1==n.length?n[0]:n.join(" ");var o=n.find((e=>e instanceof Error)),s=ld.buildFromUnknown(o||t,{mechanism:{handled:!1},syntheticException:new Error("PostHog syntheticException"),skipFirstLines:2});e(s),k(r)&&r(...n)},t.error.__POSTHOG_INSTRUMENTED__=!0,()=>{var e;null==(e=t.error)||delete e.__POSTHOG_INSTRUMENTED__,t.error=r}}};s.__PosthogExtensions__=s.__PosthogExtensions__||{},s.__PosthogExtensions__.errorWrappingFunctions=dd,s.posthogErrorWrappingFunctions=dd;var vd=(e,t)=>{if(k(null==e?void 0:e.capture)){var r=null==t?void 0:t.autocaptureExceptions,i=!M(r)&&"object"==typeof r&&w(r.errors_to_ignore)?r.errors_to_ignore.reduce(((e,t)=>{try{e.push(new RegExp(t))}catch(e){ud.error("Ignoring invalid legacy exception exclusion rule",t,e)}return e}),[]):[],n=t=>{try{null==e.capture||e.capture("$exception",t,{_noTruncate:!0,_batchKey:"exceptionEvent",_noHeatmaps:!0})}catch(e){ud.error("Failed to capture exception for a legacy client",e)}};hd((e=>{i.some((t=>e.$exception_list.some((e=>t.test(e.value||"")))))||n(e)})),cd(n,!0)}};s.extendPostHogWithExceptionAutoCapture=vd,s.extendPostHogWithExceptionAutocapture=vd;var fd="X-POSTHOG-SESSION-ID",pd="X-POSTHOG-WINDOW-ID",gd="X-POSTHOG-DISTINCT-ID",md=[fd,pd,gd],yd=["attributionReporting","body","browsingTopics","cache","credentials","dispatcher","duplex","integrity","keepalive","method","mode","priority","redirect","referrer","referrerPolicy","signal","window"],bd=(e,t)=>({}.hasOwnProperty.call(e,t)),wd=e=>"object"==typeof e&&!M(e)||k(e),kd=e=>"undefined"!=typeof Request&&(e instanceof Request||"[object Request]"==={}.toString.call(e)),_d=t=>{try{var r;return kd(t)?t.url:new URL(t instanceof URL?t.toString():String(t),null==e||null==(r=e.location)?void 0:r.href).toString()}catch(e){return}},Sd=(e,t,r,i,n)=>{var a;try{a=new URL(i).hostname}catch(e){return!1}if(!e)return!1;if(w(e)&&!e.includes(a))return!1;var o=!1;if(r){var s=r.checkAndGetSessionAndWindowId(!0),u=s.windowId;n.set(fd,s.sessionId),n.set(pd,u),o=!0}var l=(e=>k(e)?e():e)(t);return l&&"$posthog_cookieless"!==l&&(n.set(gd,l),o=!0),o};s.__PosthogExtensions__=s.__PosthogExtensions__||{};var xd={_patchFetch:(t,r,i)=>pu(e,"fetch",(e=>function(n,a){var o=arguments.length>1?[n,a]:[n],s=o;try{var u=_d(n);if(u)if(kd(n)){var l=new Request(n,a);Sd(t,r,i,l.url,l.headers),s=[l]}else{var c=new Headers(wd(a)?a.headers:void 0);if(Sd(t,r,i,u,c)){var d=((e,t)=>{if(S(e)||M(e))return{headers:t};if(wd(e)){var r=e;if("undefined"==typeof Proxy||"undefined"==typeof Reflect){var i=Object.create(r);return Object.defineProperty(i,"headers",{configurable:!0,enumerable:!0,value:t,writable:!0}),i}return new Proxy({headers:t},{get:(e,t)=>bd(e,t)?Reflect.get(e,t):Reflect.get(r,t,r),has:(e,t)=>bd(e,t)||t in r,ownKeys(e){var t=new Set(Reflect.ownKeys(e));return Reflect.ownKeys(r).forEach((e=>t.add(e))),yd.forEach((e=>{e in r&&t.add(e)})),Array.from(t)},getOwnPropertyDescriptor(e,t){var i=Reflect.getOwnPropertyDescriptor(e,t);if(i)return i;if("string"==typeof t&&yd.includes(t)&&t in r)return{configurable:!0,enumerable:!0,get(){return Reflect.get(r,t,r)}};var n=Reflect.getOwnPropertyDescriptor(r,t);return n?h({},n,{configurable:!0}):void 0},getPrototypeOf:()=>Object.getPrototypeOf(r)})}})(a,c);d&&(s=[n,d])}}}catch(e){s=o}return e.apply(this,s)})),_patchXHR:(t,r,i)=>pu(e.XMLHttpRequest.prototype,"open",(e=>function(n,a,o,s,u){void 0===o&&(o=!0);var l=this,h=new Headers,c=_d(a);c&&Sd(t,r,i,c,h);var d=e.call(l,n,a,o,s,u);return md.forEach((e=>{var t=h.get(e);if(t)try{l.setRequestHeader(e,t)}catch(e){}})),d}))};s.__PosthogExtensions__.tracingHeadersPatchFns=xd,s.postHogTracingHeadersPatchFns=xd,"function"!=typeof[].at&&Object.defineProperty(Array.prototype,"at",{value(e){var t=this.length,r=Math.trunc(e)||0;return 0>r&&(r+=t),0>r||r>=t?void 0:this[r]},writable:!0,enumerable:!1,configurable:!0});let Cd=class{constructor(){this.t=void 0,this.o=0,this.i=[]}l(e){var t;if(!e.hadRecentInput){var r=this.i[0],i=this.i.at(-1);this.o&&r&&i&&1e3>e.startTime-i.startTime&&5e3>e.startTime-r.startTime?(this.o+=e.value,this.i.push(e)):(this.o=e.value,this.i=[e]),null==(t=this.t)||t.call(this,e)}}};var Md=()=>{var e=performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},Td=e=>{if("loading"===document.readyState)return"loading";var t=Md();if(t){if(t.domInteractive>e)return"loading";if(0===t.domContentLoadedEventStart||t.domContentLoadedEventStart>e)return"dom-interactive";if(0===t.domComplete||t.domComplete>e)return"dom-content-loaded"}return"complete"},Id=e=>{var t=e.nodeName;return 1===e.nodeType?t.toLowerCase():t.toUpperCase().replace(/^#/,"")},Ed=e=>{var t="";try{for(;9!==(null==(r=e)?void 0:r.nodeType);){var r,i,n=e,a=n.id?"#"+n.id:[Id(n),...Array.from(null!==(i=n.classList)&&void 0!==i?i:[]).sort()].join(".");if(t.length+a.length>99)return t||a;if(t=t?a+">"+t:a,n.id)break;e=n.parentNode}}catch(e){}return t},Rd=new WeakMap;function Ad(e,t){var r=Rd.get(t);return r||(r=new WeakMap,Rd.set(t,r)),r.get(e)||r.set(e,new t),r.get(e)}var Ld=-1,Od=()=>Ld,Pd=e=>{addEventListener("pageshow",(t=>{t.persisted&&(Ld=t.timeStamp,e(t))}),!0)},Dd=(e,t,r,i)=>{var n,a;return o=>{t.value>=0&&(o||i)&&((a=t.value-(null!=n?n:0))||void 0===n)&&(n=t.value,t.delta=a,t.rating=((e,t)=>e>t[1]?"poor":e>t[0]?"needs-improvement":"good")(t.value,r),e(t))}},Fd=e=>{requestAnimationFrame((()=>requestAnimationFrame(e)))},Nd=()=>{var e,t;return null!==(e=null==(t=Md())?void 0:t.activationStart)&&void 0!==e?e:0},qd=-1,jd=new Set,Bd=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,Hd=e=>{if("hidden"===document.visibilityState){if("visibilitychange"===e.type)for(var t of jd)t();isFinite(qd)||(qd="visibilitychange"===e.type?e.timeStamp:0,removeEventListener("prerenderingchange",Hd,!0))}},$d=function(e){if(void 0===e&&(e=!1),e&&(qd=1/0),0>qd){var t,r=Nd(),i=document.prerendering||null==(t=globalThis.performance.getEntriesByType("visibility-state").find((e=>"hidden"===e.name&&e.startTime>=r)))?void 0:t.startTime;qd=null!=i?i:Bd(),addEventListener("visibilitychange",Hd,!0),addEventListener("prerenderingchange",Hd,!0),Pd((()=>{setTimeout((()=>{qd=Bd()}))}))}return{get firstHiddenTime(){return qd},onHidden(e){jd.add(e)}}},Ud=function(e,t,r,i,n,a,o){void 0===t&&(t=-1),void 0===i&&(i=0);var s=Md(),u=(null==s?void 0:s.navigationId)||0,l="navigate";return r?l=r:0>Od()?s&&(document.prerendering||Nd()>0?l="prerender":document.wasDiscarded?l="restore":s.type&&(l=s.type.replace(/_/g,"-"))):l="back-forward-cache",{name:e,value:t,rating:"good",delta:0,entries:[],id:"v6-"+Date.now()+"-"+(Math.floor(8999999999999*Math.random())+1e12),navigationType:l,navigationId:i||u,navigationInteractionId:n,navigationURL:a||(null==s?void 0:s.name),navigationStartTime:o||0}},Wd=function(e,t,r){void 0===r&&(r={});try{var i=e.filter((e=>PerformanceObserver.supportedEntryTypes.includes(e)));if(i.length>0){var n=new PerformanceObserver((e=>{queueMicrotask((()=>{var r=e.getEntries();i.length>1&&r.sort(((e,t)=>e.startTime+e.duration-(t.startTime+t.duration))),t(r)}))}));for(var a of i)n.observe(h({type:a,buffered:!0},r));return n}}catch(e){}},zd=e=>{var t;return PerformanceObserver.supportedEntryTypes.includes("soft-navigation")&&"function"==typeof(null==(t=globalThis.PerformanceSoftNavigation)||null==(t=t.prototype)?void 0:t.getLargestInteractionContentfulPaint)&&e&&e.reportSoftNavs},Vd=(e,t)=>{if(e.set(t.navigationId,t),e.size>2){var r=e.keys().next().value;void 0!==r&&e.delete(r)}},Zd=e=>{var t=!1;return()=>{t||(e(),t=!0)}};let Gd=class{constructor(){this.u=void 0}};var Qd,Jd=e=>{document.prerendering?addEventListener("prerenderingchange",e,!0):e()},Yd=[1800,3e3],Kd=function(e,t){void 0===t&&(t={});var r=zd(t);Jd((()=>{var i,n=Ad(t,Gd),a=$d(),o=Ud("FCP"),s=Wd(["paint"],(e=>{for(var t of e)"first-contentful-paint"===t.name&&(s.disconnect(),a.firstHiddenTime>t.startTime&&(o.value=Math.max(t.startTime-Nd(),0),o.entries.push(t),o.navigationId=t.navigationId||o.navigationId,i(!0)))}));s&&(i=Dd(e,o,Yd,t.reportAllChanges),Pd((r=>{o=Ud("FCP",-1,"back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,Od()),i=Dd(e,o,Yd,t.reportAllChanges),Fd((()=>{o.value=performance.now()-r.timeStamp,i(!0)}))}))),r&&Wd(["soft-navigation"],(r=>{r.forEach((r=>{n.u&&r.navigationId&&Vd(n.u,r);var a=Math.max((r.presentationTime||r.paintTime||0)-r.startTime,0);o=Ud("FCP",a,"soft-navigation",r.navigationId,r.interactionId,r.name,r.startTime),(i=Dd(e,o,Yd,t.reportAllChanges))(!0)}))}),t)}))},Xd=[.1,.25],ev=e=>e.find((e=>{var t;return 1===(null==(t=e.node)?void 0:t.nodeType)}))||e[0],tv=0,rv=1/0,iv=0,nv=e=>{for(var t of e)t.interactionId&&(rv=Math.min(rv,t.interactionId),iv=Math.max(iv,t.interactionId),tv=iv?(iv-rv)/7+1:0)},av=()=>{var e;return Qd?tv:null!==(e=performance.interactionCount)&&void 0!==e?e:0},ov=0;let sv=class{constructor(){this.h=[],this.v=new Map,this.p=void 0,this.m=void 0}M(){ov=av(),this.h.length=0,this.v.clear()}T(e){var t=av()-ov,r=Math.min(this.h.length-1,Math.floor(t/50));return!t||-1!==r||"soft-navigation"!==e&&"back-forward-cache"!==e?this.h[r]:{D:8,id:-1,entries:[]}}l(e){var t;if(null!=(t=this.p)&&t.call(this,e),e.interactionId||"first-input"===e.entryType){var r=this.h.at(-1),i=this.v.get(e.interactionId);if(i||10>this.h.length||e.duration>r.D){var n;if(i?e.duration>i.D?(i.entries=[e],i.D=e.duration):e.duration===i.D&&e.startTime===i.entries[0].startTime&&i.entries.push(e):(this.v.set((i={id:e.interactionId,entries:[e],D:e.duration}).id,i),this.h.push(i)),this.h.sort(((e,t)=>t.D-e.D)),this.h.length>10){var a=this.h.splice(10);for(var o of a)this.v.delete(o.id)}null==(n=this.m)||n.call(this,i)}}}};var uv=e=>{var t="requestIdleCallback"in globalThis?1e3:0,r=globalThis.requestIdleCallback||setTimeout,i=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)e();else{var n=Zd(e),a=-1,o=()=>{i(a),n()};addEventListener("visibilitychange",o,{once:!0,capture:!0}),a=r((()=>{removeEventListener("visibilitychange",o,{capture:!0}),n()}),{timeout:t})}},lv=[200,500];let hv=class{constructor(){this.p=void 0,this.u=void 0}l(e){var t;null==(t=this.p)||t.call(this,e)}};var cv=[2500,4e3],dv=-1,vv=()=>dv,fv=e=>{addEventListener("pageshow",(t=>{t.persisted&&(dv=t.timeStamp,e(t))}),!0)},pv=(e,t,r,i)=>{var n,a;return o=>{t.value>=0&&(o||i)&&((a=t.value-(null!=n?n:0))||void 0===n)&&(n=t.value,t.delta=a,t.rating=((e,t)=>e>t[1]?"poor":e>t[0]?"needs-improvement":"good")(t.value,r),e(t))}},gv=e=>{requestAnimationFrame((()=>requestAnimationFrame(e)))},mv=()=>{var e=performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},yv=()=>{var e,t;return null!==(e=null==(t=mv())?void 0:t.activationStart)&&void 0!==e?e:0},bv=-1,wv=new Set,kv=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,_v=e=>{if("hidden"===document.visibilityState){if("visibilitychange"===e.type)for(var t of wv)t();isFinite(bv)||(bv="visibilitychange"===e.type?e.timeStamp:0,removeEventListener("prerenderingchange",_v,!0))}},Sv=function(e){if(void 0===e&&(e=!1),e&&(bv=1/0),0>bv){var t,r=yv(),i=document.prerendering||null==(t=globalThis.performance.getEntriesByType("visibility-state").find((e=>"hidden"===e.name&&e.startTime>=r)))?void 0:t.startTime;bv=null!=i?i:kv(),addEventListener("visibilitychange",_v,!0),addEventListener("prerenderingchange",_v,!0),fv((()=>{setTimeout((()=>{bv=kv()}))}))}return{get firstHiddenTime(){return bv},onHidden(e){wv.add(e)}}},xv=function(e,t,r,i,n,a,o){void 0===t&&(t=-1),void 0===i&&(i=0);var s=mv(),u=(null==s?void 0:s.navigationId)||0,l="navigate";return r?l=r:0>vv()?s&&(document.prerendering||yv()>0?l="prerender":document.wasDiscarded?l="restore":s.type&&(l=s.type.replace(/_/g,"-"))):l="back-forward-cache",{name:e,value:t,rating:"good",delta:0,entries:[],id:"v6-"+Date.now()+"-"+(Math.floor(8999999999999*Math.random())+1e12),navigationType:l,navigationId:i||u,navigationInteractionId:n,navigationURL:a||(null==s?void 0:s.name),navigationStartTime:o||0}},Cv=new WeakMap;function Mv(e,t){var r=Cv.get(t);return r||(r=new WeakMap,Cv.set(t,r)),r.get(e)||r.set(e,new t),r.get(e)}let Tv=class{constructor(){this.t=void 0,this.i=0,this.o=[]}h(e){var t;if(!e.hadRecentInput){var r=this.o[0],i=this.o.at(-1);this.i&&r&&i&&1e3>e.startTime-i.startTime&&5e3>e.startTime-r.startTime?(this.i+=e.value,this.o.push(e)):(this.i=e.value,this.o=[e]),null==(t=this.t)||t.call(this,e)}}};var Iv=function(e,t,r){void 0===r&&(r={});try{var i=e.filter((e=>PerformanceObserver.supportedEntryTypes.includes(e)));if(i.length>0){var n=new PerformanceObserver((e=>{queueMicrotask((()=>{var r=e.getEntries();i.length>1&&r.sort(((e,t)=>e.startTime+e.duration-(t.startTime+t.duration))),t(r)}))}));for(var a of i)n.observe(h({type:a,buffered:!0},r));return n}}catch(e){}},Ev=e=>{var t;return PerformanceObserver.supportedEntryTypes.includes("soft-navigation")&&"function"==typeof(null==(t=globalThis.PerformanceSoftNavigation)||null==(t=t.prototype)?void 0:t.getLargestInteractionContentfulPaint)&&e&&e.reportSoftNavs},Rv=(e,t)=>{if(e.set(t.navigationId,t),e.size>2){var r=e.keys().next().value;void 0!==r&&e.delete(r)}},Av=e=>{var t=!1;return()=>{t||(e(),t=!0)}};let Lv=class{constructor(){this.l=void 0}};var Ov,Pv=e=>{document.prerendering?addEventListener("prerenderingchange",e,!0):e()},Dv=[1800,3e3],Fv=function(e,t){void 0===t&&(t={});var r=Ev(t);Pv((()=>{var i,n=Mv(t,Lv),a=Sv(),o=xv("FCP"),s=Iv(["paint"],(e=>{for(var t of e)"first-contentful-paint"===t.name&&(s.disconnect(),a.firstHiddenTime>t.startTime&&(o.value=Math.max(t.startTime-yv(),0),o.entries.push(t),o.navigationId=t.navigationId||o.navigationId,i(!0)))}));s&&(i=pv(e,o,Dv,t.reportAllChanges),fv((r=>{o=xv("FCP",-1,"back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,vv()),i=pv(e,o,Dv,t.reportAllChanges),gv((()=>{o.value=performance.now()-r.timeStamp,i(!0)}))}))),r&&Iv(["soft-navigation"],(r=>{r.forEach((r=>{n.l&&r.navigationId&&Rv(n.l,r);var a=Math.max((r.presentationTime||r.paintTime||0)-r.startTime,0);o=xv("FCP",a,"soft-navigation",r.navigationId,r.interactionId,r.name,r.startTime),(i=pv(e,o,Dv,t.reportAllChanges))(!0)}))}),t)}))},Nv=[.1,.25],qv=function(e,t){void 0===t&&(t={});var r=Sv();Fv(Av((()=>{var i,n=xv("CLS",0),a=Mv(t,Tv),o=(r,o,s,u,l)=>{n=xv("CLS",0,r,o,s,u,l),a.i=0,i=pv(e,n,Nv,t.reportAllChanges)},s=function(e){void 0===e&&(e=!1),a.i>n.value&&(n.value=a.i,n.entries=a.o),i(e)},u=e=>{s(!0),o("soft-navigation",e.navigationId,e.interactionId,e.name,e.startTime)},l=e=>{for(var t of e)"soft-navigation"!==t.entryType?a.h(t):u(t);s()},h=["layout-shift"];Ev(t)&&h.push("soft-navigation");var c=Iv(h,l);c&&(i=pv(e,n,Nv,t.reportAllChanges),r.onHidden((()=>{l(c.takeRecords()),i(!0)})),fv((()=>{o("back-forward-cache",n.navigationId,n.navigationInteractionId,n.navigationURL,vv()),gv(i)})),setTimeout(i))})))},jv=0,Bv=1/0,Hv=0,$v=e=>{for(var t of e)t.interactionId&&(Bv=Math.min(Bv,t.interactionId),Hv=Math.max(Hv,t.interactionId),jv=Hv?(Hv-Bv)/7+1:0)},Uv=()=>{var e;return Ov?jv:null!==(e=performance.interactionCount)&&void 0!==e?e:0},Wv=0;let zv=class{constructor(){this.u=[],this.v=new Map,this.m=void 0,this.p=void 0}T(){Wv=Uv(),this.u.length=0,this.v.clear()}M(e){var t=Uv()-Wv,r=Math.min(this.u.length-1,Math.floor(t/50));return!t||-1!==r||"soft-navigation"!==e&&"back-forward-cache"!==e?this.u[r]:{_:8,id:-1,entries:[]}}h(e){var t;if(null!=(t=this.m)&&t.call(this,e),e.interactionId||"first-input"===e.entryType){var r=this.u.at(-1),i=this.v.get(e.interactionId);if(i||10>this.u.length||e.duration>r._){var n;if(i?e.duration>i._?(i.entries=[e],i._=e.duration):e.duration===i._&&e.startTime===i.entries[0].startTime&&i.entries.push(e):(this.v.set((i={id:e.interactionId,entries:[e],_:e.duration}).id,i),this.u.push(i)),this.u.sort(((e,t)=>t._-e._)),this.u.length>10){var a=this.u.splice(10);for(var o of a)this.v.delete(o.id)}null==(n=this.p)||n.call(this,i)}}}};var Vv=e=>{var t="requestIdleCallback"in globalThis?1e3:0,r=globalThis.requestIdleCallback||setTimeout,i=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)e();else{var n=Av(e),a=-1,o=()=>{i(a),n()};addEventListener("visibilitychange",o,{once:!0,capture:!0}),a=r((()=>{removeEventListener("visibilitychange",o,{capture:!0}),n()}),{timeout:t})}},Zv=[200,500],Gv=function(e,t){if(void 0===t&&(t={}),globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype){var r=Sv();Pv((()=>{var i;"interactionCount"in performance||Ov||(Ov=Iv(["event"],$v,{durationThreshold:0}));var n,a=xv("INP"),o=Mv(t,zv),s=(r,i,s,u,l)=>{o.T(),a=xv("INP",-1,r,i,s,u,l),n=pv(e,a,Zv,t.reportAllChanges)},u=()=>{var e=o.M(a.navigationType);e&&e._!==a.value&&(a.value=e._,a.entries=e.entries,n())},l=e=>{u(),n(!0),s("soft-navigation",e.navigationId,e.interactionId,e.name,e.startTime)},c=function(e,t){void 0===t&&(t=!1),Vv((()=>{for(var r of e)"soft-navigation"!==r.entryType?o.h(r):l(r);u(),t&&n(!0)}))},d=["event","first-input"];Ev(t)&&d.push("soft-navigation");var v=Iv(d,c,h({},t,{durationThreshold:null!==(i=t.durationThreshold)&&void 0!==i?i:40}));n=pv(e,a,Zv,t.reportAllChanges),v&&(r.onHidden((()=>{c(v.takeRecords(),!0)})),fv((()=>{s("back-forward-cache",a.navigationId,a.navigationInteractionId,a.navigationURL,vv())})))}))}};let Qv=class{constructor(){this.m=void 0,this.l=void 0}h(e){var t;null==(t=this.m)||t.call(this,e)}};var Jv=[2500,4e3],Yv=function(e,t){void 0===t&&(t={});var r=!1,i=Ev(t);Pv((()=>{var n,a=Sv(),o=xv("LCP"),s=Mv(t,Qv),u=(i,s,u,l,h)=>{o=xv("LCP",-1,i,s,u,l,h),n=pv(e,o,Jv,t.reportAllChanges),r=!1,"soft-navigation"===i&&(a=Sv(!0))},l=e=>{s.l&&e.navigationId&&Rv(s.l,e),r||n(!0),u("soft-navigation",e.navigationId,e.interactionId,e.name,e.startTime);var t=null==e.getLargestInteractionContentfulPaint?void 0:e.getLargestInteractionContentfulPaint();t&&h([t])},h=e=>{for(var r of(t.reportAllChanges||i||(e=e.slice(-1)),e))if(r)if("soft-navigation"!==r.entryType){var u=0,h=[],c=r.startTime;if("largest-contentful-paint"===r.entryType)u=Math.max(r.startTime-yv(),0),s.h(r),h=[r];else if("interaction-contentful-paint"===r.entryType){var d,v=r;if(!o.navigationId)continue;if("interactionId"in v&&v.interactionId!=o.navigationInteractionId)continue;c=(null==(d=v.largestContentfulPaint)?void 0:d.renderTime)||0,u=Math.max(c-r.startTime,0),v.largestContentfulPaint&&(s.h(v.largestContentfulPaint),h=[v.largestContentfulPaint])}a.firstHiddenTime>c&&(o.value=u,o.entries=h,n())}else l(r)},c=["largest-contentful-paint"];i&&c.push("interaction-contentful-paint","soft-navigation");var d=Iv(c,h);if(d){n=pv(e,o,Jv,t.reportAllChanges);var v=["keydown","click","visibilitychange"],f=e=>{if(e.isTrusted&&!r){var t=o.id;Vv((()=>{if(!r){if(!i)for(var e of(d.disconnect(),v))removeEventListener(e,f,{capture:!0});t===o.id&&(r=!0,n(!0))}}))}};for(var p of v)addEventListener(p,f,{capture:!0});fv((i=>{u("back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,vv()),n=pv(e,o,Jv,t.reportAllChanges),gv((()=>{o.value=performance.now()-i.timeStamp,r=!0,n(!0)}))}))}}))},Kv={onLCP(e,t){void 0===t&&(t={});var r=Ad(t=Object.assign({},t),hv),i=new WeakMap;zd(t)&&(r.u=new Map),r.p=e=>{var r=e.element;if(r){var n,a=null!==(n=null==t.generateTarget?void 0:t.generateTarget(r))&&void 0!==n?n:Ed(r);i.set(e,a)}else e.id&&i.set(e,"#"+e.id)},function(e,t){void 0===t&&(t={});var r=!1,i=zd(t);Jd((()=>{var n,a=$d(),o=Ud("LCP"),s=Ad(t,hv),u=(i,s,u,l,h)=>{o=Ud("LCP",-1,i,s,u,l,h),n=Dd(e,o,cv,t.reportAllChanges),r=!1,"soft-navigation"===i&&(a=$d(!0))},l=e=>{s.u&&e.navigationId&&Vd(s.u,e),r||n(!0),u("soft-navigation",e.navigationId,e.interactionId,e.name,e.startTime);var t=null==e.getLargestInteractionContentfulPaint?void 0:e.getLargestInteractionContentfulPaint();t&&h([t])},h=e=>{for(var r of(t.reportAllChanges||i||(e=e.slice(-1)),e))if(r)if("soft-navigation"!==r.entryType){var u=0,h=[],c=r.startTime;if("largest-contentful-paint"===r.entryType)u=Math.max(r.startTime-Nd(),0),s.l(r),h=[r];else if("interaction-contentful-paint"===r.entryType){var d,v=r;if(!o.navigationId)continue;if("interactionId"in v&&v.interactionId!=o.navigationInteractionId)continue;c=(null==(d=v.largestContentfulPaint)?void 0:d.renderTime)||0,u=Math.max(c-r.startTime,0),v.largestContentfulPaint&&(s.l(v.largestContentfulPaint),h=[v.largestContentfulPaint])}a.firstHiddenTime>c&&(o.value=u,o.entries=h,n())}else l(r)},c=["largest-contentful-paint"];i&&c.push("interaction-contentful-paint","soft-navigation");var d=Wd(c,h);if(d){n=Dd(e,o,cv,t.reportAllChanges);var v=["keydown","click","visibilitychange"],f=e=>{if(e.isTrusted&&!r){var t=o.id;uv((()=>{if(!r){if(!i)for(var e of(d.disconnect(),v))removeEventListener(e,f,{capture:!0});t===o.id&&(r=!0,n(!0))}}))}};for(var p of v)addEventListener(p,f,{capture:!0});Pd((i=>{u("back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,Od()),n=Dd(e,o,cv,t.reportAllChanges),Fd((()=>{o.value=performance.now()-i.timeStamp,r=!0,n(!0)}))}))}}))}((t=>{e((e=>{var t={timeToFirstByte:0,resourceLoadDelay:0,resourceLoadDuration:0,elementRenderDelay:e.value};if(e.entries.length){var n,a,o,s,u,l,c=e.entries.at(-1),d=c.url&&performance.getEntriesByType("resource").find((e=>e.name===c.url));t.target=i.get(c),t.lcpEntry=c,c.url&&(t.url=c.url),d&&(t.lcpResourceEntry=d);var v=0,f=0;if("soft-navigation"!==e.navigationType?(v=null!==(n=null==(a=l=Md())?void 0:a.activationStart)&&void 0!==n?n:0,f=null!==(o=null==(s=l)?void 0:s.responseStart)&&void 0!==o?o:0):(v=e.navigationStartTime||0,l=null==(u=r.u)?void 0:u.get(e.navigationId)),l){var p=Math.max(0,f-v),g=Math.max(p,d?(d.requestStart||d.startTime)-v:0),m=Math.min(e.value,Math.max(g,d?d.responseEnd-v:0));t=h({},t,{timeToFirstByte:p,resourceLoadDelay:g-p,resourceLoadDuration:m-g,elementRenderDelay:e.value-m,navigationEntry:l})}}return Object.assign(e,{attribution:t})})(t))}),t)},onCLS(e,t){void 0===t&&(t={});var r=Ad(t=Object.assign({},t),Cd),i=new WeakMap;r.t=e=>{var r;if(null!=e&&null!=(r=e.sources)&&r.length){var n=ev(e.sources),a=null==n?void 0:n.node;if(a){var o,s=null!==(o=null==t.generateTarget?void 0:t.generateTarget(a))&&void 0!==o?o:Ed(a);i.set(n,s)}}},function(e,t){void 0===t&&(t={});var r=$d();Kd(Zd((()=>{var i,n=Ud("CLS",0),a=Ad(t,Cd),o=(r,o,s,u,l)=>{n=Ud("CLS",0,r,o,s,u,l),a.o=0,i=Dd(e,n,Xd,t.reportAllChanges)},s=function(e){void 0===e&&(e=!1),a.o>n.value&&(n.value=a.o,n.entries=a.i),i(e)},u=e=>{s(!0),o("soft-navigation",e.navigationId,e.interactionId,e.name,e.startTime)},l=e=>{for(var t of e)"soft-navigation"!==t.entryType?a.l(t):u(t);s()},h=["layout-shift"];zd(t)&&h.push("soft-navigation");var c=Wd(h,l);c&&(i=Dd(e,n,Xd,t.reportAllChanges),r.onHidden((()=>{l(c.takeRecords()),i(!0)})),Pd((()=>{o("back-forward-cache",n.navigationId,n.navigationInteractionId,n.navigationURL,Od()),Fd(i)})),setTimeout(i))})))}((t=>{e((e=>{var t={};if(e.entries.length){var r,n=e.entries.reduce(((e,t)=>e.value>t.value?e:t));if(null!=n&&null!=(r=n.sources)&&r.length){var a=ev(n.sources);a&&(t={largestShiftTarget:i.get(a),largestShiftTime:n.startTime,largestShiftValue:n.value,largestShiftSource:a,largestShiftEntry:n,loadState:Td(n.startTime)})}}return Object.assign(e,{attribution:t})})(t))}),t)},onFCP(e,t){void 0===t&&(t={});var r=Ad(t=Object.assign({},t),Gd);zd(t)&&(r.u=new Map),Kd((t=>{e((e=>{var t={timeToFirstByte:0,firstByteToFCP:e.value,loadState:Td(Od())};if("soft-navigation"!==e.navigationType){if(e.entries.length){var i=Md(),n=e.entries.at(-1);if(i){var a=Math.max(0,i.responseStart-(i.activationStart||0));t={timeToFirstByte:a,firstByteToFCP:e.value-a,loadState:Td(e.entries[0].startTime),navigationEntry:i,fcpEntry:n}}}}else{var o,s=null==(o=r.u)?void 0:o.get(e.navigationId);s&&(t={timeToFirstByte:0,firstByteToFCP:e.value,loadState:"complete",navigationEntry:s})}return Object.assign(e,{attribution:t})})(t))}),t)},onINP(e,t){void 0===t&&(t={});var r=Ad(t=Object.assign({},t),sv),i=[],n=[],a=0,o=new WeakMap,s=new WeakMap,u=!1,l=()=>{u||(uv(c),u=!0)},c=()=>{var e=new Set(r.h.map((e=>o.get(e.entries[0])))),t=n.length-10;n=n.filter(((r,i)=>i>=t||e.has(r)));var s=new Set;for(var l of n){var h=d(l.startTime,l.processingEnd);for(var c of h)s.add(c)}i=i.filter((e=>e.startTime>a||s.has(e))),u=!1};r.p=e=>{var r,i=e.startTime+e.duration;a=Math.max(a,e.processingEnd);for(var s=n.length-1;s>=0;s--){var u=n[s];if(8>=Math.abs(i-u.renderTime)){(r=u).startTime=Math.min(e.startTime,r.startTime),r.processingStart=Math.min(e.processingStart,r.processingStart),r.processingEnd=Math.max(e.processingEnd,r.processingEnd),t.includeProcessedEventEntries&&r.entries.push(e);break}}r||n.push(r={startTime:e.startTime,processingStart:e.processingStart,processingEnd:e.processingEnd,renderTime:i,entries:t.includeProcessedEventEntries?[e]:[]}),(e.interactionId||"first-input"===e.entryType)&&o.set(e,r),l()},r.m=e=>{if(!s.get(e)){var r,i=null==(r=e.entries.find((e=>e.target)))?void 0:r.target;if(i){var n,a=null!==(n=null==t.generateTarget?void 0:t.generateTarget(i))&&void 0!==n?n:Ed(i);s.set(e,a)}else{var o,u=null==(o=e.entries.find((e=>e.targetSelector)))?void 0:o.targetSelector;u&&s.set(e,u)}}};var d=(e,t)=>{var r=[];for(var n of i)if(n.startTime+n.duration>=e){if(n.startTime>t)break;r.push(n)}return r};Wd(["long-animation-frame"],(e=>{i=i.concat(e),l()}),t),function(e,t){if(void 0===t&&(t={}),globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype){var r=$d();Jd((()=>{var i;"interactionCount"in performance||Qd||(Qd=Wd(["event"],nv,{durationThreshold:0}));var n,a=Ud("INP"),o=Ad(t,sv),s=(r,i,s,u,l)=>{o.M(),a=Ud("INP",-1,r,i,s,u,l),n=Dd(e,a,lv,t.reportAllChanges)},u=()=>{var e=o.T(a.navigationType);e&&e.D!==a.value&&(a.value=e.D,a.entries=e.entries,n())},l=e=>{u(),n(!0),s("soft-navigation",e.navigationId,e.interactionId,e.name,e.startTime)},c=function(e,t){void 0===t&&(t=!1),uv((()=>{for(var r of e)"soft-navigation"!==r.entryType?o.l(r):l(r);u(),t&&n(!0)}))},d=["event","first-input"];zd(t)&&d.push("soft-navigation");var v=Wd(d,c,h({},t,{durationThreshold:null!==(i=t.durationThreshold)&&void 0!==i?i:40}));n=Dd(e,a,lv,t.reportAllChanges),v&&(r.onHidden((()=>{c(v.takeRecords(),!0)})),Pd((()=>{s("back-forward-cache",a.navigationId,a.navigationInteractionId,a.navigationURL,Od())})))}))}}((t=>{e((e=>{if(0===e.entries.length){var t={processedEventEntries:[],longAnimationFrameEntries:[],inputDelay:0,processingDuration:0,presentationDelay:e.value,loadState:Td(e.navigationStartTime||0)};return Object.assign(e,{attribution:t})}var i=e.entries[0],n=o.get(i),a=n.processingStart,u=Math.max(i.startTime+i.duration,a),l=Math.min(n.processingEnd,u),h=n.entries.sort(((e,t)=>e.processingStart-t.processingStart)),c=d(i.startTime,l),v=r.v.get(i.interactionId),f={interactionTarget:s.get(v),interactionType:i.name.startsWith("key")?"keyboard":"pointer",interactionTime:i.startTime,nextPaintTime:u,processedEventEntries:h,longAnimationFrameEntries:c,inputDelay:a-i.startTime,processingDuration:l-a,presentationDelay:u-l,loadState:Td(i.startTime),longestScript:void 0,totalScriptDuration:void 0,totalStyleAndLayoutDuration:void 0,totalPaintDuration:void 0,totalUnattributedDuration:void 0};return((e,t)=>{var r=e.interactionTime,i=e.nextPaintTime;if(null!=(t=e.longAnimationFrameEntries)&&t.length&&r&&i){var n,a,o=e.inputDelay,s=e.processingDuration,u=0,l=0,h=0,c=0;for(var d of e.longAnimationFrameEntries)for(var v of(l=l+d.startTime+d.duration-d.styleAndLayoutStart,d.scripts)){var f=v.startTime+v.duration;if(f>=r){var p=f-Math.max(r,v.startTime),g=v.duration?p/v.duration*v.forcedStyleAndLayoutDuration:0;u+=p-g,l+=g,p>c&&(a=r+o>v.startTime?"input-delay":r+o+s>v.startTime?"processing-duration":"presentation-delay",n=v,c=p)}}var m=e.longAnimationFrameEntries.at(-1),y=m?m.startTime+m.duration:0;y>=r+o+s&&(h=i-y),n&&a&&(e.longestScript={entry:n,subpart:a,intersectingDuration:c}),e.totalScriptDuration=u,e.totalStyleAndLayoutDuration=l,e.totalPaintDuration=h,e.totalUnattributedDuration=i-r-u-l-h}})(f),Object.assign(e,{attribution:f})})(t))}),t)},withoutAttribution:{onLCP:Yv,onCLS:qv,onFCP:Fv,onINP:Gv}};s.__PosthogExtensions__=s.__PosthogExtensions__||{},s.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=s.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},s.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-with-attribution-soft-navs"]=Kv,s.__PosthogExtensions__.postHogWebVitalsCallbacks=Kv,s.postHogWebVitalsCallbacks=Kv;var Xv={onLCP:Yv,onCLS:qv,onFCP:Fv,onINP:Gv};s.__PosthogExtensions__=s.__PosthogExtensions__||{},s.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=s.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},s.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-soft-navs"]=Xv,s.__PosthogExtensions__.postHogWebVitalsCallbacks=Xv,s.postHogWebVitalsCallbacks=Xv,s.__PosthogExtensions__.loadWebVitalsCallbacks=()=>Xv;let ef=class{constructor(){this.t=void 0,this.o=0,this.i=[]}u(e){var t;if(!e.hadRecentInput){var r=this.i[0],i=this.i.at(-1);this.o&&r&&i&&1e3>e.startTime-i.startTime&&5e3>e.startTime-r.startTime?(this.o+=e.value,this.i.push(e)):(this.o=e.value,this.i=[e]),null==(t=this.t)||t.call(this,e)}}};var tf=()=>{var e=performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},rf=e=>{if("loading"===document.readyState)return"loading";var t=tf();if(t){if(t.domInteractive>e)return"loading";if(0===t.domContentLoadedEventStart||t.domContentLoadedEventStart>e)return"dom-interactive";if(0===t.domComplete||t.domComplete>e)return"dom-content-loaded"}return"complete"},nf=e=>{var t=e.nodeName;return 1===e.nodeType?t.toLowerCase():t.toUpperCase().replace(/^#/,"")},af=e=>{var t="";try{for(;9!==(null==(r=e)?void 0:r.nodeType);){var r,i=e,n=i.id?"#"+i.id:[nf(i),...Array.from(i.classList).sort()].join(".");if(t.length+n.length>99)return t||n;if(t=t?n+">"+t:n,i.id)break;e=i.parentNode}}catch(e){}return t},of=new WeakMap;function sf(e,t){var r=of.get(t);return r||(r=new WeakMap,of.set(t,r)),r.get(e)||r.set(e,new t),r.get(e)}var uf,lf=-1,hf=()=>lf,cf=e=>{addEventListener("pageshow",(t=>{t.persisted&&(lf=t.timeStamp,e(t))}),!0)},df=(e,t,r,i)=>{var n,a;return o=>{t.value>=0&&(o||i)&&((a=t.value-(null!=n?n:0))||void 0===n)&&(n=t.value,t.delta=a,t.rating=((e,t)=>e>t[1]?"poor":e>t[0]?"needs-improvement":"good")(t.value,r),e(t))}},vf=e=>{requestAnimationFrame((()=>requestAnimationFrame(e)))},ff=()=>{var e,t;return null!==(e=null==(t=tf())?void 0:t.activationStart)&&void 0!==e?e:0},pf=function(e,t){void 0===t&&(t=-1);var r=tf(),i="navigate";return 0>hf()?r&&(document.prerendering||ff()>0?i="prerender":document.wasDiscarded?i="restore":r.type&&(i=r.type.replace(/_/g,"-"))):i="back-forward-cache",{name:e,value:t,rating:"good",delta:0,entries:[],id:"v5-"+Date.now()+"-"+(Math.floor(8999999999999*Math.random())+1e12),navigationType:i}},gf=function(e,t,r){void 0===r&&(r={});try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var i=new PerformanceObserver((e=>{queueMicrotask((()=>{t(e.getEntries())}))}));return i.observe(h({type:e,buffered:!0},r)),i}}catch(e){}},mf=e=>{var t=!1;return()=>{t||(e(),t=!0)}},yf=-1,bf=new Set,wf=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,kf=e=>{if("hidden"===document.visibilityState){if("visibilitychange"===e.type)for(var t of bf)t();isFinite(yf)||(yf="visibilitychange"===e.type?e.timeStamp:0,removeEventListener("prerenderingchange",kf,!0))}},_f=()=>{if(0>yf){var e,t=ff(),r=document.prerendering||null==(e=globalThis.performance.getEntriesByType("visibility-state").find((e=>"hidden"===e.name&&e.startTime>=t)))?void 0:e.startTime;yf=null!=r?r:wf(),addEventListener("visibilitychange",kf,!0),addEventListener("prerenderingchange",kf,!0),cf((()=>{setTimeout((()=>{yf=wf()}))}))}return{get firstHiddenTime(){return yf},onHidden(e){bf.add(e)}}},Sf=e=>{document.prerendering?addEventListener("prerenderingchange",e,!0):e()},xf=[1800,3e3],Cf=function(e,t){void 0===t&&(t={}),Sf((()=>{var r,i=_f(),n=pf("FCP"),a=gf("paint",(e=>{for(var t of e)"first-contentful-paint"===t.name&&(a.disconnect(),i.firstHiddenTime>t.startTime&&(n.value=Math.max(t.startTime-ff(),0),n.entries.push(t),r(!0)))}));a&&(r=df(e,n,xf,t.reportAllChanges),cf((i=>{n=pf("FCP"),r=df(e,n,xf,t.reportAllChanges),vf((()=>{n.value=performance.now()-i.timeStamp,r(!0)}))})))}))},Mf=[.1,.25],Tf=e=>e.find((e=>{var t;return 1===(null==(t=e.node)?void 0:t.nodeType)}))||e[0],If=0,Ef=1/0,Rf=0,Af=e=>{for(var t of e)t.interactionId&&(Ef=Math.min(Ef,t.interactionId),Rf=Math.max(Rf,t.interactionId),If=Rf?(Rf-Ef)/7+1:0)},Lf=()=>{var e;return uf?If:null!==(e=performance.interactionCount)&&void 0!==e?e:0},Of=0;let Pf=class{constructor(){this.l=[],this.h=new Map,this.m=void 0,this.p=void 0}v(){Of=Lf(),this.l.length=0,this.h.clear()}M(){var e=Math.min(this.l.length-1,Math.floor((Lf()-Of)/50));return this.l[e]}u(e){var t;if(null!=(t=this.m)&&t.call(this,e),e.interactionId||"first-input"===e.entryType){var r=this.l.at(-1),i=this.h.get(e.interactionId);if(i||10>this.l.length||e.duration>r.T){var n;if(i?e.duration>i.T?(i.entries=[e],i.T=e.duration):e.duration===i.T&&e.startTime===i.entries[0].startTime&&i.entries.push(e):(this.h.set((i={id:e.interactionId,entries:[e],T:e.duration}).id,i),this.l.push(i)),this.l.sort(((e,t)=>t.T-e.T)),this.l.length>10){var a=this.l.splice(10);for(var o of a)this.h.delete(o.id)}null==(n=this.p)||n.call(this,i)}}}};var Df=e=>{var t=globalThis.requestIdleCallback||setTimeout,r=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)e();else{var i=mf(e),n=-1,a=()=>{r(n),i()};addEventListener("visibilitychange",a,{once:!0,capture:!0}),n=t((()=>{removeEventListener("visibilitychange",a,{capture:!0}),i()}))}},Ff=[200,500];let Nf=class{constructor(){this.m=void 0}u(e){var t;null==(t=this.m)||t.call(this,e)}};var $=[2500,4e3],qf=-1,jf=e=>{addEventListener("pageshow",(t=>{t.persisted&&(qf=t.timeStamp,e(t))}),!0)},Bf=(e,t,r,i)=>{var n,a;return o=>{t.value>=0&&(o||i)&&((a=t.value-(null!=n?n:0))||void 0===n)&&(n=t.value,t.delta=a,t.rating=((e,t)=>e>t[1]?"poor":e>t[0]?"needs-improvement":"good")(t.value,r),e(t))}},Hf=e=>{requestAnimationFrame((()=>requestAnimationFrame(e)))},$f=()=>{var e=performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},Uf=()=>{var e,t;return null!==(e=null==(t=$f())?void 0:t.activationStart)&&void 0!==e?e:0},Wf=function(e,t){void 0===t&&(t=-1);var r=$f(),i="navigate";return 0>qf?r&&(document.prerendering||Uf()>0?i="prerender":document.wasDiscarded?i="restore":r.type&&(i=r.type.replace(/_/g,"-"))):i="back-forward-cache",{name:e,value:t,rating:"good",delta:0,entries:[],id:"v5-"+Date.now()+"-"+(Math.floor(8999999999999*Math.random())+1e12),navigationType:i}},zf=new WeakMap;function Vf(e,t){var r=zf.get(t);return r||(r=new WeakMap,zf.set(t,r)),r.get(e)||r.set(e,new t),r.get(e)}class Zf{constructor(){this.t=void 0,this.i=0,this.o=[]}h(e){var t;if(!e.hadRecentInput){var r=this.o[0],i=this.o.at(-1);this.i&&r&&i&&1e3>e.startTime-i.startTime&&5e3>e.startTime-r.startTime?(this.i+=e.value,this.o.push(e)):(this.i=e.value,this.o=[e]),null==(t=this.t)||t.call(this,e)}}}var Gf,Qf=function(e,t,r){void 0===r&&(r={});try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var i=new PerformanceObserver((e=>{queueMicrotask((()=>{t(e.getEntries())}))}));return i.observe(h({type:e,buffered:!0},r)),i}}catch(e){}},Jf=e=>{var t=!1;return()=>{t||(e(),t=!0)}},Yf=-1,Kf=new Set,Xf=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,ep=e=>{if("hidden"===document.visibilityState){if("visibilitychange"===e.type)for(var t of Kf)t();isFinite(Yf)||(Yf="visibilitychange"===e.type?e.timeStamp:0,removeEventListener("prerenderingchange",ep,!0))}},tp=()=>{if(0>Yf){var e,t=Uf(),r=document.prerendering||null==(e=globalThis.performance.getEntriesByType("visibility-state").find((e=>"hidden"===e.name&&e.startTime>=t)))?void 0:e.startTime;Yf=null!=r?r:Xf(),addEventListener("visibilitychange",ep,!0),addEventListener("prerenderingchange",ep,!0),jf((()=>{setTimeout((()=>{Yf=Xf()}))}))}return{get firstHiddenTime(){return Yf},onHidden(e){Kf.add(e)}}},rp=e=>{document.prerendering?addEventListener("prerenderingchange",e,!0):e()},ip=[1800,3e3],np=function(e,t){void 0===t&&(t={}),rp((()=>{var r,i=tp(),n=Wf("FCP"),a=Qf("paint",(e=>{for(var t of e)"first-contentful-paint"===t.name&&(a.disconnect(),i.firstHiddenTime>t.startTime&&(n.value=Math.max(t.startTime-Uf(),0),n.entries.push(t),r(!0)))}));a&&(r=Bf(e,n,ip,t.reportAllChanges),jf((i=>{n=Wf("FCP"),r=Bf(e,n,ip,t.reportAllChanges),Hf((()=>{n.value=performance.now()-i.timeStamp,r(!0)}))})))}))},ap=[.1,.25],op=function(e,t){void 0===t&&(t={});var r=tp();np(Jf((()=>{var i,n=Wf("CLS",0),a=Vf(t,Zf),o=e=>{for(var t of e)a.h(t);a.i>n.value&&(n.value=a.i,n.entries=a.o,i())},s=Qf("layout-shift",o);s&&(i=Bf(e,n,ap,t.reportAllChanges),r.onHidden((()=>{o(s.takeRecords()),i(!0)})),jf((()=>{a.i=0,n=Wf("CLS",0),i=Bf(e,n,ap,t.reportAllChanges),Hf(i)})),setTimeout(i))})))},sp=0,up=1/0,lp=0,hp=e=>{for(var t of e)t.interactionId&&(up=Math.min(up,t.interactionId),lp=Math.max(lp,t.interactionId),sp=lp?(lp-up)/7+1:0)},cp=()=>{var e;return Gf?sp:null!==(e=performance.interactionCount)&&void 0!==e?e:0},dp=0;class vp{constructor(){this.l=[],this.u=new Map,this.m=void 0,this.p=void 0}v(){dp=cp(),this.l.length=0,this.u.clear()}T(){var e=Math.min(this.l.length-1,Math.floor((cp()-dp)/50));return this.l[e]}h(e){var t;if(null!=(t=this.m)&&t.call(this,e),e.interactionId||"first-input"===e.entryType){var r=this.l.at(-1),i=this.u.get(e.interactionId);if(i||10>this.l.length||e.duration>r.L){var n;if(i?e.duration>i.L?(i.entries=[e],i.L=e.duration):e.duration===i.L&&e.startTime===i.entries[0].startTime&&i.entries.push(e):(this.u.set((i={id:e.interactionId,entries:[e],L:e.duration}).id,i),this.l.push(i)),this.l.sort(((e,t)=>t.L-e.L)),this.l.length>10){var a=this.l.splice(10);for(var o of a)this.u.delete(o.id)}null==(n=this.p)||n.call(this,i)}}}}var fp=e=>{var t=globalThis.requestIdleCallback||setTimeout,r=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)e();else{var i=Jf(e),n=-1,a=()=>{r(n),i()};addEventListener("visibilitychange",a,{once:!0,capture:!0}),n=t((()=>{removeEventListener("visibilitychange",a,{capture:!0}),i()}))}},pp=[200,500],gp=function(e,t){if(void 0===t&&(t={}),globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype){var r=tp();rp((()=>{var i;"interactionCount"in performance||Gf||(Gf=Qf("event",hp,{durationThreshold:0}));var n,a=Wf("INP"),o=Vf(t,vp),s=e=>{fp((()=>{for(var t of e)o.h(t);var r=o.T();r&&r.L!==a.value&&(a.value=r.L,a.entries=r.entries,n())}))},u=Qf("event",s,{durationThreshold:null!==(i=t.durationThreshold)&&void 0!==i?i:40});n=Bf(e,a,pp,t.reportAllChanges),u&&(u.observe({type:"first-input",buffered:!0}),r.onHidden((()=>{s(u.takeRecords()),n(!0)})),jf((()=>{o.v(),a=Wf("INP"),n=Bf(e,a,pp,t.reportAllChanges)})))}))}};class mp{constructor(){this.m=void 0}h(e){var t;null==(t=this.m)||t.call(this,e)}}var yp=[2500,4e3],bp=function(e,t){void 0===t&&(t={}),rp((()=>{var r,i=tp(),n=Wf("LCP"),a=Vf(t,mp),o=e=>{for(var o of(t.reportAllChanges||(e=e.slice(-1)),e))a.h(o),i.firstHiddenTime>o.startTime&&(n.value=Math.max(o.startTime-Uf(),0),n.entries=[o],r())},s=Qf("largest-contentful-paint",o);if(s){r=Bf(e,n,yp,t.reportAllChanges);var u=Jf((()=>{o(s.takeRecords()),s.disconnect(),r(!0)})),l=e=>{e.isTrusted&&(fp(u),removeEventListener(e.type,l,{capture:!0}))};for(var h of["keydown","click","visibilitychange"])addEventListener(h,l,{capture:!0});jf((i=>{n=Wf("LCP"),r=Bf(e,n,yp,t.reportAllChanges),Hf((()=>{n.value=performance.now()-i.timeStamp,r(!0)}))}))}}))},wp={onLCP(e,t){void 0===t&&(t={});var r=sf(t=Object.assign({},t),Nf),i=new WeakMap;r.m=e=>{var r=e.element;if(r){var n,a=null!==(n=null==t.generateTarget?void 0:t.generateTarget(r))&&void 0!==n?n:af(r);i.set(e,a)}else e.id&&i.set(e,"#"+e.id)},function(e,t){void 0===t&&(t={}),Sf((()=>{var r,i=_f(),n=pf("LCP"),a=sf(t,Nf),o=e=>{for(var o of(t.reportAllChanges||(e=e.slice(-1)),e))a.u(o),i.firstHiddenTime>o.startTime&&(n.value=Math.max(o.startTime-ff(),0),n.entries=[o],r())},s=gf("largest-contentful-paint",o);if(s){r=df(e,n,$,t.reportAllChanges);var u=mf((()=>{o(s.takeRecords()),s.disconnect(),r(!0)})),l=e=>{e.isTrusted&&(Df(u),removeEventListener(e.type,l,{capture:!0}))};for(var h of["keydown","click","visibilitychange"])addEventListener(h,l,{capture:!0});cf((i=>{n=pf("LCP"),r=df(e,n,$,t.reportAllChanges),vf((()=>{n.value=performance.now()-i.timeStamp,r(!0)}))}))}}))}((t=>{e((e=>{var t={timeToFirstByte:0,resourceLoadDelay:0,resourceLoadDuration:0,elementRenderDelay:e.value};if(e.entries.length){var r=e.entries.at(-1),n=r.url&&performance.getEntriesByType("resource").find((e=>e.name===r.url));t.target=i.get(r),t.lcpEntry=r,r.url&&(t.url=r.url),n&&(t.lcpResourceEntry=n);var a=tf();if(a){var o=a.activationStart||0,s=Math.max(0,a.responseStart-o),u=Math.max(s,n?(n.requestStart||n.startTime)-o:0),l=Math.min(e.value,Math.max(u,n?n.responseEnd-o:0));t=h({},t,{timeToFirstByte:s,resourceLoadDelay:u-s,resourceLoadDuration:l-u,elementRenderDelay:e.value-l,navigationEntry:a})}}return Object.assign(e,{attribution:t})})(t))}),t)},onCLS(e,t){void 0===t&&(t={});var r=sf(t=Object.assign({},t),ef),i=new WeakMap;r.t=e=>{var r;if(null!=e&&null!=(r=e.sources)&&r.length){var n=Tf(e.sources),a=null==n?void 0:n.node;if(a){var o,s=null!==(o=null==t.generateTarget?void 0:t.generateTarget(a))&&void 0!==o?o:af(a);i.set(n,s)}}},function(e,t){void 0===t&&(t={});var r=_f();Cf(mf((()=>{var i,n=pf("CLS",0),a=sf(t,ef),o=e=>{for(var t of e)a.u(t);a.o>n.value&&(n.value=a.o,n.entries=a.i,i())},s=gf("layout-shift",o);s&&(i=df(e,n,Mf,t.reportAllChanges),r.onHidden((()=>{o(s.takeRecords()),i(!0)})),cf((()=>{a.o=0,n=pf("CLS",0),i=df(e,n,Mf,t.reportAllChanges),vf(i)})),setTimeout(i))})))}((t=>{e((e=>{var t={};if(e.entries.length){var r,n=e.entries.reduce(((e,t)=>e.value>t.value?e:t));if(null!=n&&null!=(r=n.sources)&&r.length){var a=Tf(n.sources);a&&(t={largestShiftTarget:i.get(a),largestShiftTime:n.startTime,largestShiftValue:n.value,largestShiftSource:a,largestShiftEntry:n,loadState:rf(n.startTime)})}}return Object.assign(e,{attribution:t})})(t))}),t)},onFCP(e,t){void 0===t&&(t={}),Cf((t=>{e((e=>{var t={timeToFirstByte:0,firstByteToFCP:e.value,loadState:rf(hf())};if(e.entries.length){var r=tf(),i=e.entries.at(-1);if(r){var n=Math.max(0,r.responseStart-(r.activationStart||0));t={timeToFirstByte:n,firstByteToFCP:e.value-n,loadState:rf(e.entries[0].startTime),navigationEntry:r,fcpEntry:i}}}return Object.assign(e,{attribution:t})})(t))}),t)},onINP(e,t){void 0===t&&(t={});var r=sf(t=Object.assign({},t),Pf),i=[],n=[],a=0,o=new WeakMap,s=new WeakMap,u=!1,l=()=>{u||(Df(h),u=!0)},h=()=>{var e=new Set(r.l.map((e=>o.get(e.entries[0])))),t=n.length-10;n=n.filter(((r,i)=>i>=t||e.has(r)));var s=new Set;for(var l of n){var h=c(l.startTime,l.processingEnd);for(var d of h)s.add(d)}i=i.filter((e=>e.startTime>a||s.has(e))),u=!1};r.m=e=>{var r,i=e.startTime+e.duration;a=Math.max(a,e.processingEnd);for(var s=n.length-1;s>=0;s--){var u=n[s];if(8>=Math.abs(i-u.renderTime)){(r=u).startTime=Math.min(e.startTime,r.startTime),r.processingStart=Math.min(e.processingStart,r.processingStart),r.processingEnd=Math.max(e.processingEnd,r.processingEnd),!1!==t.includeProcessedEventEntries&&r.entries.push(e);break}}r||n.push(r={startTime:e.startTime,processingStart:e.processingStart,processingEnd:e.processingEnd,renderTime:i,entries:!1!==t.includeProcessedEventEntries?[e]:[]}),(e.interactionId||"first-input"===e.entryType)&&o.set(e,r),l()},r.p=e=>{if(!s.get(e)){var r,i=null==(r=e.entries.find((e=>e.target)))?void 0:r.target;if(i){var n,a=null!==(n=null==t.generateTarget?void 0:t.generateTarget(i))&&void 0!==n?n:af(i);s.set(e,a)}else{var o,u=null==(o=e.entries.find((e=>e.targetSelector)))?void 0:o.targetSelector;u&&s.set(e,u)}}};var c=(e,t)=>{var r=[];for(var n of i)if(n.startTime+n.duration>=e){if(n.startTime>t)break;r.push(n)}return r};gf("long-animation-frame",(e=>{i=i.concat(e),l()})),function(e,t){if(void 0===t&&(t={}),globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype){var r=_f();Sf((()=>{var i;"interactionCount"in performance||uf||(uf=gf("event",Af,{durationThreshold:0}));var n,a=pf("INP"),o=sf(t,Pf),s=e=>{Df((()=>{for(var t of e)o.u(t);var r=o.M();r&&r.T!==a.value&&(a.value=r.T,a.entries=r.entries,n())}))},u=gf("event",s,{durationThreshold:null!==(i=t.durationThreshold)&&void 0!==i?i:40});n=df(e,a,Ff,t.reportAllChanges),u&&(u.observe({type:"first-input",buffered:!0}),r.onHidden((()=>{s(u.takeRecords()),n(!0)})),cf((()=>{o.v(),a=pf("INP"),n=df(e,a,Ff,t.reportAllChanges)})))}))}}((t=>{e((e=>{var t=e.entries[0],i=o.get(t),n=t.processingStart,a=Math.max(t.startTime+t.duration,n),u=Math.min(i.processingEnd,a),l=i.entries.sort(((e,t)=>e.processingStart-t.processingStart)),h=c(t.startTime,u),d=r.h.get(t.interactionId),v={interactionTarget:s.get(d),interactionType:t.name.startsWith("key")?"keyboard":"pointer",interactionTime:t.startTime,nextPaintTime:a,processedEventEntries:l,longAnimationFrameEntries:h,inputDelay:n-t.startTime,processingDuration:u-n,presentationDelay:a-u,loadState:rf(t.startTime),longestScript:void 0,totalScriptDuration:void 0,totalStyleAndLayoutDuration:void 0,totalPaintDuration:void 0,totalUnattributedDuration:void 0};return((e,t)=>{if(null!=(t=e.longAnimationFrameEntries)&&t.length){var r,i,n=e.interactionTime,a=e.inputDelay,o=e.processingDuration,s=0,u=0,l=0,h=0;for(var c of e.longAnimationFrameEntries)for(var d of(u=u+c.startTime+c.duration-c.styleAndLayoutStart,c.scripts)){var v=d.startTime+d.duration;if(v>=n){var f=v-Math.max(n,d.startTime),p=d.duration?f/d.duration*d.forcedStyleAndLayoutDuration:0;s+=f-p,u+=p,f>h&&(i=n+a>d.startTime?"input-delay":n+a+o>d.startTime?"processing-duration":"presentation-delay",r=d,h=f)}}var g=e.longAnimationFrameEntries.at(-1),m=g?g.startTime+g.duration:0;m>=n+a+o&&(l=e.nextPaintTime-m),r&&i&&(e.longestScript={entry:r,subpart:i,intersectingDuration:h}),e.totalScriptDuration=s,e.totalStyleAndLayoutDuration=u,e.totalPaintDuration=l,e.totalUnattributedDuration=e.nextPaintTime-n-s-u-l}})(v),Object.assign(e,{attribution:v})})(t))}),t)},withoutAttribution:{onLCP:bp,onCLS:op,onFCP:np,onINP:gp}};s.__PosthogExtensions__=s.__PosthogExtensions__||{},s.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=s.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},s.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-with-attribution"]=wp,s.__PosthogExtensions__.postHogWebVitalsCallbacks=wp,s.postHogWebVitalsCallbacks=wp;var kp={onLCP:bp,onCLS:op,onFCP:np,onINP:gp};function _p(e,t){return t.length>e?t.slice(0,e)+"...":t}function Sp(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do{t=t.previousSibling}while(t&&!ze(t));return t}function xp(t,r){var i,n,a=r.e,o=r.maskAllElementAttributes,s=r.maskAllText,u=r.elementAttributeIgnoreList,l=r.disableCaptureUrlHashes;if(!ze(t))return{props:{}};for(var c=[t],d=new Set([t]),v=t;v.parentNode&&!Ve(v,"body")&&Ge>c.length;)if(Ze(v.parentNode)){var f=v.parentNode.host;if(d.has(f))break;d.add(f),c.push(f),v=f}else{if(!ze(v.parentNode))break;if(d.has(v.parentNode))break;d.add(v.parentNode),c.push(v.parentNode),v=v.parentNode}var g,m,y=[],b={},w=!1,k=!1;if(Pe(c,(e=>{var t=it(e);if(Ve(e,"a")){var r=e.getAttribute("href");w=!!(t&&r&&dt(r))&&(l?ae(r):r)}p(Je(e),"ph-no-capture")&&(k=!0),y.push(function(e,t,r,i,n){void 0===n&&(n=!1);var a=e.tagName.toLowerCase(),o={tag_name:a};Ke.indexOf(a)>-1&&!r&&(o.$el_text="a"===a.toLowerCase()||"button"===a.toLowerCase()?_p(1024,vt(e)):_p(1024,Ye(e)));var s=Je(e);s.length>0&&(o.classes=s.filter((function(e){return""!==e}))),Pe(e.attributes,(function(r){var a;if((!nt(e)||-1!==["name","id","class","aria-label"].indexOf(r.name))&&(null==i||!i.includes(r.name))&&!t&&dt(r.value)&&(!x(a=r.name)||"_ngcontent"!==a.substring(0,10)&&"_nghost"!==a.substring(0,7))){var s=r.value;"class"===r.name&&(s=Qe(s).join(" ")),o["attr__"+r.name]=_p(1024,"href"===r.name&&n?ae(s):s)}}));for(var u=1,l=1,h=e;h=Sp(h);)u++,h.tagName===e.tagName&&l++;return o.nth_child=u,o.nth_of_type=l,o}(e,o,s,u,l));var i=function(e){if(!it(e))return{};var t={};return Pe(e.attributes,(function(e){if(e.name&&0===e.name.indexOf("data-ph-capture-attribute")){var r=e.name.replace("data-ph-capture-attribute-",""),i=e.value;r&&i&&dt(i)&&(t[r]=i)}})),t}(e);De(b,i)})),k)return{props:{},explicitNoCapture:k};if(s||(y[0].$el_text=Ve(t,"a")||Ve(t,"button")?vt(t):Ye(t)),w){var _,S;y[0].attr__href=w;var C=null==(_=je(w))?void 0:_.host,M=null==e||null==(S=e.location)?void 0:S.host;C&&M&&C!==M&&(g=w)}return{props:De({$event_type:a.type,$ce_version:1},{$elements:y},{$elements_chain:(m=y,function(e){var t=e.map((e=>{var t,r,i="";if(e.tag_name&&(i+=e.tag_name),e.attr_class)for(var n of(e.attr_class.sort(),e.attr_class))i+="."+n.replace(/"/g,"");var a=h({},e.text?{text:e.text}:{},{"nth-child":null!==(t=e.nth_child)&&void 0!==t?t:0,"nth-of-type":null!==(r=e.nth_of_type)&&void 0!==r?r:0},e.href?{href:e.href}:{},e.attr_id?{attr_id:e.attr_id}:{},e.attributes),o={};return Fe(a).sort(((e,t)=>function(e,t){return t>e?-1:e>t?1:0}(e[0],t[0]))).forEach((e=>{var t=e[1];return o[pt(e[0].toString())]=pt(t.toString())})),(i+=":")+Fe(o).map((e=>e[0]+'="'+e[1]+'"')).join("")}));return t.join(";")}(function(e){return e.map((e=>{var t,r,i={text:null==(t=e.$el_text)?void 0:t.slice(0,400),tag_name:e.tag_name,href:null==(r=e.attr__href)?void 0:r.slice(0,2048),attr_class:gt(e),attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return Fe(e).filter((e=>0===e[0].indexOf("attr__"))).forEach((e=>i.attributes[e[0]]=e[1])),i}))}(m)))},null!=(i=y[0])&&i.$el_text?{$el_text:null==(n=y[0])?void 0:n.$el_text}:{},g&&"click"===a.type?{$external_click_url:g}:{},b)}}s.__PosthogExtensions__=s.__PosthogExtensions__||{},s.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=s.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},s.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals"]=kp,s.__PosthogExtensions__.postHogWebVitalsCallbacks=kp,s.postHogWebVitalsCallbacks=kp,s.__PosthogExtensions__.loadWebVitalsCallbacks=()=>kp,Oe("[AutoCapture]");var Cp={};function Mp(t,r){var i=Cp[t];if(i)return i;var n=r[t];if((e=>k(e)&&-1!==e.toString().indexOf("[native code]"))(n)&&(null==e||!e.Zone))return Cp[t]=n.bind(r);var a=r.document;if(a&&k(a.createElement)){var o,s=!1;try{(o=a.createElement("iframe")).hidden=!0,a.head.appendChild(o);var u,l,h=o.contentWindow;h&&h[t]&&(n=h[t],"MutationObserver"===t&&function(e){return p(e,"AppleWebKit")&&!p(e,"Chrome")}(null!==(u=null==(l=r.navigator)?void 0:l.userAgent)&&void 0!==u?u:"")&&(o.classList.add("rr-block","ph-no-capture"),s=!0))}catch(e){Le.warn("Could not create sandbox iframe for "+t+" check, bailing to assignableWindow."+t+": ",e)}finally{var c;!s&&null!=(c=o)&&c.parentNode&&o.parentNode.removeChild(o)}}return n&&k(n)?Cp[t]=n.bind(r):n}function Tp(e,t){var r=function(e){var t;return S(e.target)?e.srcElement||null:null!=(t=e.target)&&t.shadowRoot?e.composedPath()[0]||null:e.target||null}(e);return r?h({node:r,originalEvent:e,timestamp:Date.now()},t):null}function Ip(e,t){return Math.abs(e)<Math.abs(t)?0>t?"up":"down":0>e?"left":"right"}function Ep(e){return"swipe"===e.type?"$dead_swipe":"$dead_click"}var Rp="canvas,video,audio,embed,object",Ap=1e3;function Lp(e,t){return I(e)&&e>=t}function Op(e){return e>=0&&Ap>e?e:void 0}function Pp(e,t){return t?Op(e-t):void 0}class Dp{Fi(e){var t,r,i,n,a,o,s,u,l=this.Ni((null==e?void 0:e.__onCapture)||this.qi.bind(this));return{element_attribute_ignorelist:null!==(t=null==e?void 0:e.element_attribute_ignorelist)&&void 0!==t?t:l.element_attribute_ignorelist,scroll_threshold_ms:null!==(r=null==e?void 0:e.scroll_threshold_ms)&&void 0!==r?r:l.scroll_threshold_ms,selection_change_threshold_ms:null!==(i=null==e?void 0:e.selection_change_threshold_ms)&&void 0!==i?i:l.selection_change_threshold_ms,mutation_threshold_ms:null!==(n=null==e?void 0:e.mutation_threshold_ms)&&void 0!==n?n:l.mutation_threshold_ms,capture_clicks_with_modifier_keys:null!==(a=null==e?void 0:e.capture_clicks_with_modifier_keys)&&void 0!==a?a:l.capture_clicks_with_modifier_keys,capture_dead_swipes:null!==(o=null==e?void 0:e.capture_dead_swipes)&&void 0!==o?o:l.capture_dead_swipes,swipe_threshold_px:null!==(s=null==e?void 0:e.swipe_threshold_px)&&void 0!==s?s:l.swipe_threshold_px,max_dead_swipes_per_page_load:null!==(u=null==e?void 0:e.max_dead_swipes_per_page_load)&&void 0!==u?u:l.max_dead_swipes_per_page_load,css_selector_ignorelist:null==e?void 0:e.css_selector_ignorelist,__onCapture:l.__onCapture}}constructor(e,t){this.ji=[],this.Bi=0,this.Ni=e=>({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:e}),this.Hi=e=>{var t=Tp(e,{type:"click"});M(t)||this.$i(t)||this.Ui(t),this.Wi()},this.zi=()=>{var e=Date.now();this.Vi=e,e%50==0&&this.ji.forEach((t=>{S(t.scrollDelayMs)&&(t.scrollDelayMs=e-t.timestamp)}))},this.Zi=()=>{this.Gi=Date.now()},this.$t=()=>{var e=Date.now();this.Qi=e,this.Ji("visibilityChangedDelayMs",e)},this.Yi=()=>{var e=Date.now();this.Ki=e,this.Ji("focusChangedDelayMs",e)},this.Xi=e=>{var t=e.touches,r=1===(null==t?void 0:t.length)?t[0]:void 0;this.en=r?{x:r.clientX,y:r.clientY,timestamp:Date.now()}:void 0},this.tn=()=>{this.en=void 0},this.rn=e=>{var t,r=this.en;if(this.en=void 0,!S(r)&&this.nn.max_dead_swipes_per_page_load>this.Bi){var n=e,a=null==(t=n.changedTouches)?void 0:t[0];if(a){var o=a.clientX-r.x,s=a.clientY-r.y,u=o*o+s*s,l=this.nn.swipe_threshold_px;if(u>=l*l&&![this.Vi,this.an,this.Gi].some((e=>I(e)&&e>=r.timestamp))){var h;if(this.sn()&&(null!==(h=null==i||null==i.elementsFromPoint?void 0:i.elementsFromPoint(r.x,r.y))&&void 0!==h?h:[]).some((e=>null==e.matches?void 0:e.matches(Rp))))return;var c=Tp(n,{type:"swipe",swipeDirection:Ip(o,s),swipeDistancePx:Math.round(Math.sqrt(u))});M(c)||this.$i(c)||this.Ui(c),this.Wi()}}}},this.instance=e,this.nn=this.Fi(t),this._onCapture=this.nn.__onCapture}start(e){this.un(),this.ln(),this.hn(),this.cn(),this.dn(),this.vn(e),this.nn.capture_dead_swipes&&this.fn()}vn(e){if(!this.pn){var t=function(e){return Mp("MutationObserver",e)}(s);this.pn=new t((e=>{this.gn(e)})),this.pn.observe(e,{attributes:!0,characterData:!0,childList:!0,subtree:!0})}}stop(){var e;null==(e=this.pn)||e.disconnect(),this.pn=void 0,s.removeEventListener("click",this.Hi),s.removeEventListener("scroll",this.zi,{capture:!0}),s.removeEventListener("selectionchange",this.Zi),s.removeEventListener("touchstart",this.Xi,{capture:!0}),s.removeEventListener("touchend",this.rn,{capture:!0}),s.removeEventListener("touchcancel",this.tn,{capture:!0}),null==i||i.removeEventListener("visibilitychange",this.$t),s.removeEventListener("blur",this.Yi),s.removeEventListener("focus",this.Yi),this.en=void 0}gn(e){this.an=Date.now()}un(){Ne(s,"click",this.Hi)}Ui(e){e.visibilityChangedDelayMs=Pp(e.timestamp,this.Qi),e.focusChangedDelayMs=Pp(e.timestamp,this.Ki),this.ji.push(e)}Wi(){this.ji.length&&S(this.mn)&&(this.mn=s.setTimeout((()=>{this.yn()}),1e3))}ln(){Ne(s,"scroll",this.zi,{capture:!0})}hn(){Ne(s,"selectionchange",this.Zi)}cn(){Ne(i,"visibilitychange",this.$t)}dn(){Ne(s,"blur",this.Yi),Ne(s,"focus",this.Yi)}Ji(e,t){this.ji.forEach((r=>{var i=Op(t-r.timestamp);I(i)&&(S(r[e])||r[e]>i)&&(r[e]=i)}))}fn(){Ne(s,"touchstart",this.Xi,{capture:!0,passive:!0}),Ne(s,"touchend",this.rn,{capture:!0,passive:!0}),Ne(s,"touchcancel",this.tn,{capture:!0,passive:!0})}sn(){var e=S(this.bn)||I(this.an)&&this.an>this.bn;return(S(this.wn)||e)&&(this.bn=Date.now(),this.wn=!(null==i||!i.querySelector(Rp))),!!this.wn}$i(e){return!e||("swipe"===e.type?this.kn(e):this._n(e))}kn(t){if((r=t.node)instanceof Element&&("__POSTHOG_TOOLBAR__"===r.id||null!=r.closest&&r.closest(".toolbar-global-fade-container")))return!0;var r,i=this.ji.some((e=>e.type===t.type&&e.node===t.node&&1e3>Math.abs(e.timestamp-t.timestamp)));return!(!i&&!Ve(t.node,"html")&&ze(t.node)&&function(t,r){var i;if(!e||tt(t))return!1;var n=E(r)?et:null!==(i=null==r?void 0:r.css_selector_ignorelist)&&void 0!==i?i:et;return!function(e,t){if(S(t))return!0;var r,i=function(e){if(t.some((t=>function(e,t){var r=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector;try{return!!r&&r.call(e,t)}catch(e){return!1}}(e,t))))return{v:!0}};for(var n of e)if(r=i(n))return r.v;return!1}(rt(t).targetElementList,n)}(t.node,{css_selector_ignorelist:this.nn.css_selector_ignorelist}))}_n(t){return!(this.nn.capture_clicks_with_modifier_keys||(r=t.originalEvent,!(r.ctrlKey||r.metaKey||r.altKey||r.shiftKey)))||!!this.kn(t)||(i=t.node,!(!e||tt(i))&&rt(i).targetElementList.some((e=>Ve(e,"a"))));var r,i}yn(){if(this.ji.length){clearTimeout(this.mn),this.mn=void 0;var e=this.ji;for(var t of(this.ji=[],e)){var r;t.mutationDelayMs=null!==(r=t.mutationDelayMs)&&void 0!==r?r:this.an&&this.an>=t.timestamp?this.an-t.timestamp:void 0,t.absoluteDelayMs=Date.now()-t.timestamp,t.selectionChangedDelayMs=this.Gi&&this.Gi>=t.timestamp?this.Gi-t.timestamp:void 0;var i=Lp(t.scrollDelayMs,this.nn.scroll_threshold_ms),n=Lp(t.selectionChangedDelayMs,this.nn.selection_change_threshold_ms),a=Lp(t.mutationDelayMs,this.nn.mutation_threshold_ms),o=Lp(t.absoluteDelayMs,1.1*this.nn.mutation_threshold_ms),s=I(t.scrollDelayMs)&&this.nn.scroll_threshold_ms>t.scrollDelayMs,u=I(t.mutationDelayMs)&&this.nn.mutation_threshold_ms>t.mutationDelayMs,l=I(t.selectionChangedDelayMs)&&this.nn.selection_change_threshold_ms>t.selectionChangedDelayMs,h=I(t.visibilityChangedDelayMs),c=I(t.focusChangedDelayMs);if(!(s||u||l||h||c))if(i||a||o||n){var d=Ep(t);if("$dead_swipe"===d){if(this.Bi>=this.nn.max_dead_swipes_per_page_load)continue;this.Bi++}this._onCapture(t,{[d+"_last_mutation_timestamp"]:this.an,[d+"_event_timestamp"]:t.timestamp,[d+"_scroll_timeout"]:i,[d+"_mutation_timeout"]:a,[d+"_absolute_timeout"]:o,[d+"_selection_changed_timeout"]:n,[d+"_visibility_changed_timeout"]:!1})}else this.nn.mutation_threshold_ms>t.absoluteDelayMs&&this.ji.push(t)}this.Wi()}}qi(e,t){var r=Ep(e);this.instance.capture(r,h({},t,xp(e.node,{e:e.originalEvent,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.nn.element_attribute_ignorelist,disableCaptureUrlHashes:this.instance.config.disable_capture_url_hashes}).props,{[r+"_scroll_delay_ms"]:e.scrollDelayMs,[r+"_mutation_delay_ms"]:e.mutationDelayMs,[r+"_absolute_delay_ms"]:e.absoluteDelayMs,[r+"_selection_changed_delay_ms"]:e.selectionChangedDelayMs,[r+"_visibility_changed_delay_ms"]:e.visibilityChangedDelayMs,[r+"_focus_changed_delay_ms"]:e.focusChangedDelayMs,$dead_swipe_direction:e.swipeDirection,$dead_swipe_distance_px:e.swipeDistancePx}),{timestamp:new Date(e.timestamp)})}}s.__PosthogExtensions__=s.__PosthogExtensions__||{},s.__PosthogExtensions__.initDeadClicksAutocapture=(e,t)=>new Dp(e,t)}();
1
+ !function(){"use strict";var e="undefined"!=typeof window?window:void 0,t="undefined"!=typeof globalThis?globalThis:e,r=null==t?void 0:t.navigator,i=null==t?void 0:t.document,n=null==t?void 0:t.location;null!=t&&t.XMLHttpRequest&&new t.XMLHttpRequest;var a=null==r?void 0:r.userAgent,o="undefined"!=typeof globalThis?globalThis:e;o&&"undefined"==typeof self&&(o.self=o),o&&"undefined"==typeof File&&(o.File=function(){});var s=null!=e?e:{};function u(e,t,r,i,n,a,o){try{var s=e[a](o),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(i,n)}function l(e){return function(){var t=this,r=arguments;return new Promise((function(i,n){var a=e.apply(t,r);function o(e){u(a,i,n,o,s,"next",e)}function s(e){u(a,i,n,o,s,"throw",e)}o(void 0)}))}}function h(){return h=Object.assign?Object.assign.bind():function(e){for(var t=1;arguments.length>t;t++){var r=arguments[t];for(var i in r)({}).hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},h.apply(null,arguments)}var c={DomContentLoaded:0,Load:1,FullSnapshot:2,IncrementalSnapshot:3,Meta:4,Custom:5,Plugin:6},d={Mutation:0,MouseMove:1,MouseInteraction:2,Scroll:3,ViewportResize:4,Input:5,TouchMove:6,MediaInteraction:7,StyleSheetRule:8,CanvasMutation:9,Font:10,Log:11,Drag:12,StyleDeclaration:13,Selection:14,AdoptedStyleSheet:15,CustomElement:16},v="min_length",f="max_length";function p(e,t){return-1!==e.indexOf(t)}var g=function(e){return e.trim()},m=Object.prototype,y=m.hasOwnProperty,b=m.toString,w=Array.isArray||function(e){return"[object Array]"===b.call(e)},k=e=>"function"==typeof e,_=e=>e===Object(e)&&!w(e),S=e=>void 0===e,x=e=>"[object String]"==b.call(e),C=e=>x(e)&&0===e.trim().length,M=e=>null===e,T=e=>S(e)||M(e),I=e=>"[object Number]"==b.call(e)&&e==e,E=e=>"[object Boolean]"===b.call(e),R=e=>e instanceof FormData;function A(e){return null===e||"object"!=typeof e}function L(e,t){return{}.toString.call(e)==="[object "+t+"]"}function O(e){switch({}.toString.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object DOMError]":case"[object WebAssembly.Exception]":return!0;default:return D(e,Error)}}function P(e){return"undefined"!=typeof Event&&D(e,Event)}function D(e,t){try{return e instanceof t}catch(e){return!1}}function F(e,t,r,i,n){return t>r&&(i.warn("min cannot be greater than max."),t=r),I(e)?e>r?(i.warn(" cannot be greater than max: "+r+". Using max value instead."),r):t>e?(i.warn(" cannot be less than min: "+t+". Using min value instead."),t):e:(i.warn(" must be a number. using max or fallback. max: "+r+", fallback: "+n),F(n||r,t,r,i))}class N{constructor(e){this.k={},this.S=e.S,this.C=F(e.bucketSize,0,100,e.I),this.R=F(e.refillRate,0,this.C,e.I),this.A=F(e.refillInterval,0,864e5,e.I)}O(e,t){var r=Math.floor((t-e.lastAccess)/this.A);r>0&&(e.tokens=Math.min(e.tokens+r*this.R,this.C),e.lastAccess=e.lastAccess+r*this.A)}consumeRateLimit(e){var t,r=Date.now(),i=String(e),n=this.k[i];return n?this.O(n,r):this.k[i]=n={tokens:this.C,lastAccess:r},0===n.tokens||(n.tokens--,0===n.tokens&&(null==(t=this.S)||t.call(this,e)),0===n.tokens)}stop(){this.k={}}}var q="Mobile",j="Android",B="Tablet",H=j+" "+B,U="iPad",W="Apple Watch",z="BlackBerry",V="Nintendo",Z="PlayStation",G="Xbox",Q="Windows Phone",J="Nokia",Y="Ouya",K="Generic",X=K+" "+q.toLowerCase(),ee=K+" "+B.toLowerCase(),te=new RegExp(G,"i"),re=new RegExp(Z+" \\w+","i"),ie=new RegExp(V+" \\w+","i"),ne=new RegExp(z+"|PlayBook|BB10","i");function ae(e){return e?e.split("#")[0]:e}var oe,se,ue,le,he="NativeGzipValidationError",ce=e=>{throw function(e,t){var r=new Error(t);try{Object.defineProperty(r,"name",{value:e,writable:!0,enumerable:!0,configurable:!0})}catch(e){}return r}(he,"Native gzip produced invalid output: "+e)},de=function(){var e=l((function*(e,t){18>e.size&&ce("too-short");var r,i=new Uint8Array(yield e.slice(0,10).arrayBuffer());(2>(r=i).length||31!==r[0]||139!==r[1]||8!==i[2])&&ce("invalid-header");var n=new DataView(yield e.slice(e.size-8).arrayBuffer());n.getUint32(0,!0)!==(e=>{for(var t=(()=>{if(oe)return oe;oe=[];for(var e=0;256>e;e++){for(var t=e,r=0;8>r;r++)t=1&t?3988292384^t>>>1:t>>>1;oe[e]=t>>>0}return oe})(),r=4294967295,i=0;e.length>i;i++)r=t[255&(r^e[i])]^r>>>8;return(4294967295^r)>>>0})(t)&&ce("invalid-crc");var a=t.length>>>0;n.getUint32(4,!0)!==a&&ce("invalid-size")}));return function(t,r){return e.apply(this,arguments)}}();function ve(){return ve=l((function*(e,t,r){void 0===t&&(t=!0);try{var i=(new TextEncoder).encode(e),n=new globalThis.CompressionStream("gzip"),a=n.writable.getWriter(),o=a.write(i).then((()=>a.close())).catch(function(){var e=l((function*(e){try{yield a.abort(e)}catch(e){}throw e}));return function(t){return e.apply(this,arguments)}}()),s=new Response(n.readable).blob(),u=(yield Promise.all([s,o]))[0];return yield de(u,i),u}catch(e){if(null!=r&&r.rethrow)throw e;return t&&console.error("Failed to gzip compress data",e),null}})),ve.apply(this,arguments)}function fe(e,t){if(e){var r=e.find((e=>e.type===t));return null==r?void 0:r.value}}function pe(e){var t=globalThis._posthogChunkIds;if(t){var r=Object.keys(t);return le&&r.length===ue||(ue=r.length,le=r.reduce(((r,i)=>{se||(se={});var n=se[i];if(n)r[n[0]]=n[1];else for(var a=e(i),o=a.length-1;o>=0;o--){var s=a[o],u=null==s?void 0:s.filename,l=t[i];if(u&&l){r[u]=l,se[i]=[u,l];break}}return r}),{})),le}}var ge="?";function me(e,t,r,i,n){var a={platform:e,filename:t,function:"<anonymous>"===r?ge:r,in_app:!(null!=t&&t.startsWith("webkit-masked-url://"))&&"<anonymous>"!==t};return S(i)||(a.lineno=i),S(n)||(a.colno=n),a}var ye=(e,t)=>{var r=-1!==e.indexOf("safari-extension"),i=-1!==e.indexOf("safari-web-extension");return r||i?[-1!==e.indexOf("@")?e.split("@")[0]:ge,r?"safari-extension:"+t:"safari-web-extension:"+t]:[e,t]},be=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,we=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,ke=/\((\S*)(?::(\d+))(?::(\d+))\)/,_e=(e,t)=>{var r=be.exec(e);if(r)return me(t,r[1],ge,+r[2],+r[3]);var i=we.exec(e);if(i){if(i[2]&&0===i[2].indexOf("eval")){var n=ke.exec(i[2]);n&&(i[2]=n[1],i[3]=n[2],i[4]=n[3])}var a=ye(i[1]||ge,i[2]);return me(t,a[1],a[0],i[3]?+i[3]:void 0,i[4]?+i[4]:void 0)}},Se=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,xe=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Ce=(e,t)=>{var r=Se.exec(e);if(r){if(r[3]&&r[3].indexOf(" > eval")>-1){var i=xe.exec(r[3]);i&&(r[1]=r[1]||"eval",r[3]=i[1],r[4]=i[2],r[5]="")}var n=r[3],a=r[1]||ge,o=ye(a,n);return me(t,n=o[1],a=o[0],r[4]?+r[4]:void 0,r[5]?+r[5]:void 0)}},Me=/\(error: (.*)\)/;var Te=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;var Ie=["fatal","error","warning","log","info","debug"];function Ee(e,t){void 0===t&&(t=40);var r=Object.keys(e);if(r.sort(),!r.length)return"[object has no keys]";for(var i=r.length;i>0;i--){var n=r.slice(0,i).join(", ");if(t>=n.length)return i===r.length?n:n.length>t?n.slice(0,t)+"...":n}return""}var Re={DEBUG:!1,LIB_VERSION:"0.6.2",LIB_NAME:"browser-common"},Ae=function(t,r){var i=(void 0===r?{}:r).debugEnabled,n={P(r){if(e&&(Re.DEBUG||e.POSTHOG_DEBUG||i)&&!S(e.console)&&e.console){for(var n=("__rrweb_original__"in e.console[r]?e.console[r].__rrweb_original__:e.console[r]),a=arguments.length,o=new Array(a>1?a-1:0),s=1;a>s;s++)o[s-1]=arguments[s];n(t,...o)}},debug(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];n.P("debug",...t)},info(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];n.P("log",...t)},warn(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];n.P("warn",...t)},error(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];n.P("error",...t)},critical(){for(var e=arguments.length,r=new Array(e),i=0;e>i;i++)r[i]=arguments[i];console.error(t,...r)},uninitializedWarning(e){n.error("You must initialize PostHog before calling "+e)},createLogger:(e,r)=>Ae(t+" "+e,r)};return n},Le=Ae("[PostHog.js]"),Oe=Le.createLogger;function Pe(e,t){if(!T(e))if(w(e))e.forEach(t);else if(R(e))e.forEach(((e,r)=>t(e,r)));else for(var r in e)y.call(e,r)&&t(e[r],r)}var De=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;t>i;i++)r[i-1]=arguments[i];for(var n of r)for(var a in n)void 0!==n[a]&&(e[a]=n[a]);return e};function Fe(e){for(var t=Object.keys(e),r=t.length,i=new Array(r);r--;)i[r]=[t[r],e[t[r]]];return i}function Ne(e,t,r,i){var n=null!=i?i:{},a=n.capture,o=n.passive;null==e||e.addEventListener(t,r,{capture:void 0!==a&&a,passive:void 0===o||o})}var qe=["localhost","127.0.0.1"],je=e=>{var t=null==i?void 0:i.createElement("a");return S(t)?null:(t.href=e,t)},Be=function(e,t){var r,i;void 0===t&&(t="&");var n=[];return Pe(e,(function(e,t){S(e)||S(t)||"undefined"===t||(r=encodeURIComponent((e=>e instanceof File)(e)?e.name:e.toString()),i=encodeURIComponent(t),n[n.length]=i+"="+r)})),n.join(t)};function He(t){var r,i=null==e||null==(r=e.location)?void 0:r.href;return S(i)?void 0:function(e,t){var r,i=null==e||null==(r=e.config)?void 0:r.get_current_url;if(!k(i))return t;try{var n=i(t);return x(n)&&n?n:t}catch(e){return Le.error("Error in get_current_url, falling back to window.location.href",e),t}}(t,i)}var $e=1,Ue=3,We=11;function ze(e){return!!e&&e.nodeType===$e}function Ve(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function Ze(e){return!!e&&e.nodeType===We&&ze(e.host)}var Ge=1e3;function Qe(e){return e?g(e).split(/\s+/):[]}function Je(e){var t="";switch(typeof e.className){case"string":t=e.className;break;case"object":t=(e.className&&"baseVal"in e.className?e.className.baseVal:null)||e.getAttribute("class")||"";break;default:t=""}return Qe(t)}function Ye(e){var t="";return it(e)&&!nt(e)&&e.childNodes&&e.childNodes.length&&Pe(e.childNodes,(function(e){var r;(function(e){return!!e&&e.nodeType===Ue})(e)&&e.textContent&&(t+=null!==(r=function(e){return T(e)?null:g(e).split(/(\s+)/).filter((e=>dt(e))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}(e.textContent))&&void 0!==r?r:"")})),g(t)}var Ke=["a","button","form","input","select","textarea","label"];function Xe(e){var t=e.parentNode;return!(!t||!ze(t))&&t}var et=[".ph-no-deadclick",".ph-no-capture"];var tt=e=>!e||Ve(e,"html")||!ze(e),rt=(t,r)=>{if(!e||tt(t))return{parentIsUsefulElement:!1,targetElementList:[]};for(var i=!1,n=[t],a=t;a.parentNode&&!Ve(a,"body");)if(Ze(a.parentNode))n.push(a.parentNode.host),a=a.parentNode.host;else{var o=Xe(a);if(!o)break;if(Ke.indexOf(o.tagName.toLowerCase())>-1)i=!0;else try{var s=e.getComputedStyle(o);s&&"pointer"===s.getPropertyValue("cursor")&&(i=!0)}catch(e){}n.push(o),a=o}return{parentIsUsefulElement:i,targetElementList:n}};function it(e){for(var t=new Set,r=0,i=e;i.parentNode&&!Ve(i,"body");i=i.parentNode){if(r++>=Ge||t.has(i))return!1;t.add(i);var n=Je(i);if(p(n,"ph-sensitive")||p(n,"ph-no-capture"))return!1}if(p(Je(e),"ph-include"))return!0;var a=e.type||"";if(x(a))switch(a.toLowerCase()){case"hidden":case"password":return!1}var o=e.name||e.id||"";return!x(o)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(o.replace(/[^a-zA-Z0-9]/g,""))}function nt(e){return!!(Ve(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||Ve(e,"select")||Ve(e,"textarea")||"true"===e.getAttribute("contenteditable"))}var at=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}))$"),ot=/(^|[^0-9A-Za-z_])([0-9][0-9 -]*[0-9])(?=$|[^0-9A-Za-z_])/g,st=[16,15,14,13],ut=new RegExp("^(\\d{3}-?\\d{2}-?\\d{4})$"),lt=new RegExp("(^|[^0-9])((?!000|666)[0-9]{3}-?(?!00)[0-9]{2}-?(?!0000)[0-9]{4})(?=$|([^0-9]))","g"),ht=/[0-9A-Za-z_]/;function ct(e){for(var t=0,r=!1,i=e.length-1;i>=0;i--){var n=e.charCodeAt(i)-48;r&&(n*=2)>9&&(n-=9),t+=n,r=!r}return t%10==0}function dt(e,t){if(void 0===t&&(t=!0),T(e))return!1;if(x(e)){e=g(e);var r=t?at.test((e||"").replace(/[- ]/g,"")):function(e){var t;for(ot.lastIndex=0;t=ot.exec(e);){var r=t[2];if(r)for(var i=r.replace(/[- ]/g,""),n=0;i.length>n;n++)for(var a of st){var o=n+a;if(i.length>=o){var s=i.slice(n,o);if(at.test(s)&&ct(s))return!0}}}return!1}(e);if(r)return!1;var i=t?ut.test(e):function(e){var t;for(lt.lastIndex=0;t=lt.exec(e);){var r=t[1],i=t[3];if(!(r&&i&&ht.test(r)&&ht.test(i)))return!0}return!1}(e);if(i)return!1}return!0}function vt(e){var t=Ye(e);return dt(t=(t+" "+ft(e)).trim())?t:""}function ft(e){var t="";return e&&e.childNodes&&e.childNodes.length&&Pe(e.childNodes,(function(e){var r;if(e&&"span"===(null==(r=e.tagName)?void 0:r.toLowerCase()))try{var i=Ye(e);t=(t+" "+i).trim(),e.childNodes&&e.childNodes.length&&(t=(t+" "+ft(e)).trim())}catch(e){Le.error("[AutoCapture]",e)}})),t}function pt(e){return e.replace(/"|\\"/g,'\\"')}function gt(e){var t=e.attr__class;if(t)return w(t)?t:Qe(t)}var mt="[SessionRecording]",yt="redacted",bt=1e6;function wt(e){var t;return Math.min(bt,null!==(t=e.payloadSizeLimitBytes)&&void 0!==t?t:bt)}var kt={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:e=>e,recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:bt,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},_t=["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"],St=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],xt=["auth","token","secret","session","api-key","apikey","api_key","credential","password","passwd","cookie","csrf","xsrf"],Ct=e=>{T(e)||Pe(Object.keys(e),(t=>{(e=>{var t=e.toLowerCase();return _t.includes(t)||xt.some((e=>t.includes(e)))})(t)&&(e[t]=yt)}))},Mt=["/s/","/e/","/i/"];function Tt(e,t,r,i){if(T(e))return e;var n=(null==t?void 0:t["content-length"])||function(e){return new Blob([e]).size}(e);return x(n)&&(n=parseInt(n)),n>r?mt+" "+i+" body too large to record ("+n+" bytes)":e}function It(e,t){if(T(e))return e;var r=e;return dt(r,!1)||(r=mt+" "+t+" body "+yt),Pe(St,(e=>{var i,n;null!=(i=r)&&i.length&&-1!==(null==(n=r)?void 0:n.indexOf(e))&&(r=mt+" "+t+" body "+yt+" as might contain: "+e)})),r}var Et=new WeakSet,Rt="$session_recording_remote_config",At="$replay_sample_rate",Lt="$replay_override_sampling",Ot="$replay_override_linked_flag",Pt="$replay_override_url_trigger",Dt="$replay_override_event_trigger",Ft="$session_is_sampled",Nt="$session_past_minimum_duration",qt="$session_recording_url_trigger_activated_session",jt="$session_recording_event_trigger_activated_session",Bt="$posthog_sr_group_event_trigger_",Ht="$posthog_sr_group_url_trigger_",$t="$posthog_sr_group_sampling_",Ut="$debug_first_full_snapshot_timestamp",Wt="$sess_rec_flush_size",zt="$stored_person_properties",Vt="$surveys",Zt="$sdk_debug_replay_pending_trigger_conditions",Gt="$sdk_debug_replay_remote_trigger_matching_config",Qt="disabled",Jt="sampled",Yt="active",Kt="buffering",Xt="paused",er="rrweb_error",tr="trigger",rr=tr+"_activated",ir=tr+"_pending",nr=tr+"_"+Qt;function ar(e,t,r,i,n,a){return 0===t?nr:(null==e?void 0:e.get_property(r?i+r:n))===a?rr:ir}function or(e,t,r){return t.some((t=>{var i;return"regex"===t.matching&&(null!==(i=null==r?void 0:r.get(t.url))&&void 0!==i?i:new RegExp(t.url)).test(e)}))}function sr(e){return e.includes(rr)?rr:e.includes(ir)?ir:nr}function ur(e){var t=new Set(e);switch(t.delete(nr),t.size){case 0:return nr;case 1:return Array.from(t)[0];default:return ir}}class lr{constructor(e){this.F=e}triggerStatus(e){return sr(this.F.map((t=>t.triggerStatus(e))))}triggerStatusNoSideEffects(e){return sr(this.F.map((t=>t.triggerStatusNoSideEffects(e))))}stop(){this.F.forEach((e=>e.stop()))}}class hr{constructor(e){this.F=e}triggerStatus(e){return ur(this.F.map((t=>t.triggerStatus(e))))}triggerStatusNoSideEffects(e){return ur(this.F.map((t=>t.triggerStatusNoSideEffects(e))))}stop(){this.F.forEach((e=>e.stop()))}}class cr{triggerStatus(){return this.triggerStatusNoSideEffects()}triggerStatusNoSideEffects(){return rr}stop(){}}var dr=e=>"sessionRecording"in e;class vr{constructor(e,t){this.N=[],this.q=[],this.j=new Map,this.B=new Map,this.H="",this.urlBlocked=!1,this._instance=e,this.$=t}onConfig(e){var t,r;this.N=(dr(e)?_(e.sessionRecording)?null==(t=e.sessionRecording)?void 0:t.urlTriggers:[]:null==e?void 0:e.urlTriggers)||[],this.q=(dr(e)?_(e.sessionRecording)?null==(r=e.sessionRecording)?void 0:r.urlBlocklist:[]:null==e?void 0:e.urlBlocklist)||[],this.U()}U(){for(var e of(this.j.clear(),this.B.clear(),this.N))if("regex"===e.matching&&!this.j.has(e.url))try{this.j.set(e.url,new RegExp(e.url))}catch(t){Le.error("Invalid URL trigger regex pattern:",e.url,t)}for(var t of this.q)if("regex"===t.matching&&!this.B.has(t.url))try{this.B.set(t.url,new RegExp(t.url))}catch(e){Le.error("Invalid URL blocklist regex pattern:",t.url,e)}}onRemoteConfig(e){this.onConfig(e)}W(e){return ar(this._instance,this.N.length,this.$,Ht,qt,e)}triggerStatus(e){var t=this.triggerStatusNoSideEffects(e);return this._instance.register_for_session({$sdk_debug_replay_url_trigger_status:t}),t}triggerStatusNoSideEffects(e){return this.W(e)}isCurrentUrlBlocked(){var e=He(this._instance);if(!e)return!1;try{return or(e,this.q,this.B)}catch(e){return!0}}checkUrlBlocklist(e,t){var r=He(this._instance);if(r&&r!==this.H){this.H=r;var i=this.urlBlocked,n=or(r,this.q,this.B);i&&n||(n&&!i?e():!n&&i&&t())}}checkUrlTriggerConditions(e,t,r,i){var n=He(this._instance);if(n&&n!==this.H){this.H=n;var a=this.urlBlocked,o=or(n,this.q,this.B);o&&!a?e():!o&&a&&t();var s=this.W(i)===rr,u=or(n,this.N,this.j);!s&&u&&r("url",n)}}stop(){this.H=""}}class fr{constructor(e){this.linkedFlag=null,this.linkedFlagSeen=!1,this.V=()=>{},this._instance=e}triggerStatus(){var e=this.triggerStatusNoSideEffects();return this._instance.register_for_session({$sdk_debug_replay_linked_flag_trigger_status:e}),e}triggerStatusNoSideEffects(){var e=ir;return T(this.linkedFlag)&&(e=nr),this.linkedFlagSeen&&(e=rr),e}onConfig(e,t){var r;if(this.linkedFlag=(dr(e)?_(e.sessionRecording)?null==(r=e.sessionRecording)?void 0:r.linkedFlag:null:null==e?void 0:e.linkedFlag)||null,!T(this.linkedFlag)&&!this.linkedFlagSeen){var i=x(this.linkedFlag)?this.linkedFlag:this.linkedFlag.flag,n=x(this.linkedFlag)?null:this.linkedFlag.variant;this.V=this._instance.onFeatureFlags(((e,r)=>{var a=!1;if(_(r)&&i in r){var o=r[i];a=E(o)?!0===o:n?o===n:!!o}var s=a&&!this.linkedFlagSeen;this.linkedFlagSeen=a,s&&t(i,n)}))}}onRemoteConfig(e,t){this.onConfig(e,t)}stop(){this.V()}}class pr{constructor(e,t){this.Z=[],this._instance=e,this.$=t}onConfig(e){var t;this.Z=(dr(e)?_(e.sessionRecording)?null==(t=e.sessionRecording)?void 0:t.eventTriggers:[]:null==e?void 0:e.eventTriggers)||[]}onRemoteConfig(e){this.onConfig(e)}G(e){return ar(this._instance,this.Z.length,this.$,Bt,jt,e)}triggerStatus(e){var t=this.triggerStatusNoSideEffects(e);return this._instance.register_for_session({$sdk_debug_replay_event_trigger_status:t}),t}triggerStatusNoSideEffects(e){return this.G(e)}checkEventTriggerConditions(e,t,r){if(0!==this.Z.length){var i=this.G(r)===rr,n=this.Z.includes(e);!i&&n&&t("event",e)}}stop(){}}class gr{constructor(e,t,r){if(this._instance=e,this.group=t,this.J=new vr(e,t.id),this.Y=new pr(e,t.id),this.K=new fr(e),t.conditions.events&&t.conditions.events.length>0||t.conditions.urls&&t.conditions.urls.length>0||t.conditions.flag){var i=(t.conditions.events||[]).map((e=>e.name)),n={urlTriggers:t.conditions.urls||[],eventTriggers:i,linkedFlag:t.conditions.flag||null,urlBlocklist:[]};this.J.onConfig(n),this.Y.onConfig(n),this.K.onConfig(n,r);var a=[this.Y,this.J,this.K];this.X="any"===t.conditions.matchType?new lr(a):new hr(a)}else this.X=new cr}triggerStatus(e){return this.X.triggerStatus(e)}triggerStatusNoSideEffects(e){return this.X.triggerStatusNoSideEffects(e)}getPendingTriggerConditions(e){return this.triggerStatusNoSideEffects(e)!==ir?[]:[{label:"URL condition not matched",status:this.J.triggerStatusNoSideEffects(e)},{label:"event condition not matched",status:this.Y.triggerStatusNoSideEffects(e)},{label:"linked flag condition not matched",status:this.K.triggerStatusNoSideEffects()}].filter((e=>e.status===ir)).map((e=>e.label))}checkEventTriggerConditions(e,t,r){this.Y.checkEventTriggerConditions(e,t,r)}checkUrlTriggerConditions(e,t,r,i){this.J.checkUrlTriggerConditions(e,t,r,i)}activateTrigger(e,t){var r;null==(r=this._instance.persistence)||r.register({["url"===e?Ht+this.group.id:Bt+this.group.id]:t})}stop(){this.J.stop(),this.Y.stop(),this.K.stop()}}function mr(e){if(e.rrwebError)return er;if(!e.receivedFlags)return Kt;if(!e.isRecordingEnabled)return Qt;if(e.urlTriggerMatching.urlBlocked)return Xt;var t=!0===e.isSampled,r=new lr([e.eventTriggerMatching,e.urlTriggerMatching,e.linkedFlagMatching]).triggerStatus(e.sessionId);return t?Jt:r===rr?Yt:r===ir?Kt:!1===e.isSampled?Qt:Yt}function yr(e){if(e.rrwebError)return er;if(!e.receivedFlags)return Kt;if(!e.isRecordingEnabled)return Qt;if(e.urlTriggerMatching.urlBlocked)return Xt;var t=new hr([e.eventTriggerMatching,e.urlTriggerMatching,e.linkedFlagMatching]).triggerStatus(e.sessionId),r=t!==nr,i=E(e.isSampled);return r&&t===ir?Kt:r&&t===nr||i&&!e.isSampled?Qt:!0===e.isSampled?Jt:Yt}function br(){var e=[];return function(t,r){if(_(r)||w(r)){for(;e.length>0&&e[e.length-1]!==this;)e.pop();return e.includes(r)?"[Circular]":(e.push(r),r)}return r}}function wr(e){var t=JSON.stringify(e,br());return t?new Blob([t]).size:0}function kr(e){if(M(e))return 4;if(S(e))return 0;switch(typeof e){case"string":return e.length+2;case"number":return String(e).length;case"boolean":return e?4:5;case"object":if(w(e)){for(var t=2,r=0;e.length>r;r++){r>0&&(t+=1);var i=e[r];t+=S(i)||M(i)?4:kr(i)}return t}var n=e,a=2,o=!0;for(var s in n)if({}.hasOwnProperty.call(n,s)){var u=n[s];S(u)||(o||(a+=1),o=!1,a+=s.length+3+kr(u))}return a;default:return 0}}function _r(e,t){if(void 0===t&&(t=6606028.8),e.size>=t&&e.data.length>1){var r=Math.floor(e.data.length/2),i=e.sizes.slice(0,r),n=e.sizes.slice(r);return[_r({size:i.reduce(((e,t)=>e+t),0),data:e.data.slice(0,r),sizes:i,sessionId:e.sessionId,windowId:e.windowId}),_r({size:n.reduce(((e,t)=>e+t),0),data:e.data.slice(r),sizes:n,sessionId:e.sessionId,windowId:e.windowId})].flatMap((e=>e))}return[e]}var Sr=Uint8Array,xr=Uint16Array,Cr=Uint32Array,Mr=new Sr([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]),Tr=new Sr([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]),Ir=new Sr([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Er=function(e,t){for(var r=new xr(31),i=0;31>i;++i)r[i]=t+=1<<e[i-1];var n=new Cr(r[30]);for(i=1;30>i;++i)for(var a=r[i];r[i+1]>a;++a)n[a]=a-r[i]<<5|i;return[r,n]},Rr=Er(Mr,2),Ar=Rr[1];Rr[0][28]=258,Ar[258]=28;for(var Lr=Er(Tr,0)[1],Or=new xr(32768),Pr=0;32768>Pr;++Pr){var Dr=(43690&Pr)>>>1|(21845&Pr)<<1;Or[Pr]=((65280&(Dr=(61680&(Dr=(52428&Dr)>>>2|(13107&Dr)<<2))>>>4|(3855&Dr)<<4))>>>8|(255&Dr)<<8)>>>1}var Fr=function(e,t,r){for(var i=e.length,n=0,a=new xr(t);i>n;++n)++a[e[n]-1];var o,s=new xr(t);for(n=0;t>n;++n)s[n]=s[n-1]+a[n-1]<<1;if(r){o=new xr(1<<t);var u=15-t;for(n=0;i>n;++n)if(e[n])for(var l=n<<4|e[n],h=t-e[n],c=s[e[n]-1]++<<h,d=c|(1<<h)-1;d>=c;++c)o[Or[c]>>>u]=l}else for(o=new xr(i),n=0;i>n;++n)o[n]=Or[s[e[n]-1]++]>>>15-e[n];return o},Nr=new Sr(288);for(Pr=0;144>Pr;++Pr)Nr[Pr]=8;for(Pr=144;256>Pr;++Pr)Nr[Pr]=9;for(Pr=256;280>Pr;++Pr)Nr[Pr]=7;for(Pr=280;288>Pr;++Pr)Nr[Pr]=8;var qr=new Sr(32);for(Pr=0;32>Pr;++Pr)qr[Pr]=5;var jr=Fr(Nr,9,0),Br=Fr(qr,5,0),Hr=function(e){return(e/8>>0)+(7&e&&1)},$r=function(e,t,r){(null==r||r>e.length)&&(r=e.length);var i=new(e instanceof xr?xr:e instanceof Cr?Cr:Sr)(r-t);return i.set(e.subarray(t,r)),i},Ur=function(e,t,r){var i=t/8>>0;e[i]|=r<<=7&t,e[i+1]|=r>>>8},Wr=function(e,t,r){var i=t/8>>0;e[i]|=r<<=7&t,e[i+1]|=r>>>8,e[i+2]|=r>>>16},zr=function(e,t){for(var r=[],i=0;e.length>i;++i)e[i]&&r.push({s:i,f:e[i]});var n=r.length,a=r.slice();if(!n)return[new Sr(0),0];if(1==n){var o=new Sr(r[0].s+1);return o[r[0].s]=1,[o,1]}r.sort((function(e,t){return e.f-t.f})),r.push({s:-1,f:25001});var s=r[0],u=r[1],l=0,h=1,c=2;for(r[0]={s:-1,f:s.f+u.f,l:s,r:u};h!=n-1;)s=r[r[c].f>r[l].f?l++:c++],u=r[l!=h&&r[c].f>r[l].f?l++:c++],r[h++]={s:-1,f:s.f+u.f,l:s,r:u};var d=a[0].s;for(i=1;n>i;++i)a[i].s>d&&(d=a[i].s);var v=new xr(d+1),f=Vr(r[h-1],v,0);if(f>t){i=0;var p=0,g=f-t,m=1<<g;for(a.sort((function(e,t){return v[t.s]-v[e.s]||e.f-t.f}));n>i;++i){var y=a[i].s;if(t>=v[y])break;p+=m-(1<<f-v[y]),v[y]=t}for(p>>>=g;p>0;){var b=a[i].s;t>v[b]?p-=1<<t-v[b]++-1:++i}for(;i>=0&&p;--i){var w=a[i].s;v[w]==t&&(--v[w],++p)}f=t}return[new Sr(v),f]},Vr=function(e,t,r){return-1==e.s?Math.max(Vr(e.l,t,r+1),Vr(e.r,t,r+1)):t[e.s]=r},Zr=function(e){for(var t=e.length;t&&!e[--t];);for(var r=new xr(++t),i=0,n=e[0],a=1,o=function(e){r[i++]=e},s=1;t>=s;++s)if(e[s]==n&&s!=t)++a;else{if(!n&&a>2){for(;a>138;a-=138)o(32754);a>2&&(o(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(o(n),--a;a>6;a-=6)o(8304);a>2&&(o(a-3<<5|8208),a=0)}for(;a--;)o(n);a=1,n=e[s]}return[r.subarray(0,i),t]},Gr=function(e,t){for(var r=0,i=0;t.length>i;++i)r+=e[i]*t[i];return r},Qr=function(e,t,r){var i=r.length,n=Hr(t+2);e[n]=255&i,e[n+1]=i>>>8,e[n+2]=255^e[n],e[n+3]=255^e[n+1];for(var a=0;i>a;++a)e[n+a+4]=r[a];return 8*(n+4+i)},Jr=function(e,t,r,i,n,a,o,s,u,l,h){Ur(t,h++,r),++n[256];for(var c=zr(n,15),d=c[0],v=c[1],f=zr(a,15),p=f[0],g=f[1],m=Zr(d),y=m[0],b=m[1],w=Zr(p),k=w[0],_=w[1],S=new xr(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=zr(S,7),M=C[0],T=C[1],I=19;I>4&&!M[Ir[I-1]];--I);var E,R,A,L,O=l+5<<3,P=Gr(n,Nr)+Gr(a,qr)+o,D=Gr(n,d)+Gr(a,p)+o+14+3*I+Gr(S,M)+(2*S[16]+3*S[17]+7*S[18]);if(P>=O&&D>=O)return Qr(t,h,e.subarray(u,u+l));if(Ur(t,h,1+(P>D)),h+=2,P>D){E=Fr(d,v,0),R=d,A=Fr(p,g,0),L=p;var F=Fr(M,T,0);for(Ur(t,h,b-257),Ur(t,h+5,_-1),Ur(t,h+10,I-4),h+=14,x=0;I>x;++x)Ur(t,h+3*x,M[Ir[x]]);h+=3*I;for(var N=[y,k],q=0;2>q;++q){var j=N[q];for(x=0;j.length>x;++x)Ur(t,h,F[B=31&j[x]]),h+=M[B],B>15&&(Ur(t,h,j[x]>>>5&127),h+=j[x]>>>12)}}else E=jr,R=Nr,A=Br,L=qr;for(x=0;s>x;++x)if(i[x]>255){var B;Wr(t,h,E[257+(B=i[x]>>>18&31)]),h+=R[B+257],B>7&&(Ur(t,h,i[x]>>>23&31),h+=Mr[B]);var H=31&i[x];Wr(t,h,A[H]),h+=L[H],H>3&&(Wr(t,h,i[x]>>>5&8191),h+=Tr[H])}else Wr(t,h,E[i[x]]),h+=R[i[x]];return Wr(t,h,E[256]),h+R[256]},Yr=new Cr([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Kr=function(){for(var e=new Cr(256),t=0;256>t;++t){for(var r=t,i=9;--i;)r=(1&r&&3988292384)^r>>>1;e[t]=r}return e}(),Xr=function(){var e=4294967295;return{p(t){for(var r=e,i=0;t.length>i;++i)r=Kr[255&r^t[i]]^r>>>8;e=r},d:()=>4294967295^e}},ei=function(e,t,r,i,n){return function(e,t,r,i,n,a){var o=e.length,s=new Sr(i+o+5*(1+Math.floor(o/7e3))+n),u=s.subarray(i,s.length-n),l=0;if(!t||8>o)for(var h=0;o>=h;h+=65535){var c=h+65535;o>c?l=Qr(u,l,e.subarray(h,c)):(u[h]=true,l=Qr(u,l,e.subarray(h,o)))}else{for(var d=Yr[t-1],v=d>>>13,f=8191&d,p=(1<<r)-1,g=new xr(32768),m=new xr(p+1),y=Math.ceil(r/3),b=2*y,w=function(t){return(e[t]^e[t+1]<<y^e[t+2]<<b)&p},k=new Cr(25e3),_=new xr(288),S=new xr(32),x=0,C=0,M=(h=0,0),T=0,I=0;o>h;++h){var E=w(h),R=32767&h,A=m[E];if(g[R]=A,m[E]=R,h>=T){var L=o-h;if((x>7e3||M>24576)&&L>423){l=Jr(e,u,0,k,_,S,C,M,I,h-I,l),M=x=C=0,I=h;for(var O=0;286>O;++O)_[O]=0;for(O=0;30>O;++O)S[O]=0}var P=2,D=0,F=f,N=R-A&32767;if(L>2&&E==w(h-N))for(var q=Math.min(v,L)-1,j=Math.min(32767,h),B=Math.min(258,L);j>=N&&--F&&R!=A;){if(e[h+P]==e[h+P-N]){for(var H=0;B>H&&e[h+H]==e[h+H-N];++H);if(H>P){if(P=H,D=N,H>q)break;var U=Math.min(N,H-2),W=0;for(O=0;U>O;++O){var z=h-N+O+32768&32767,V=z-g[z]+32768&32767;V>W&&(W=V,A=z)}}}N+=(R=A)-(A=g[R])+32768&32767}if(D){k[M++]=268435456|Ar[P]<<18|Lr[D];var Z=31&Ar[P],G=31&Lr[D];C+=Mr[Z]+Tr[G],++_[257+Z],++S[G],T=h+P,++x}else k[M++]=e[h],++_[e[h]]}}l=Jr(e,u,true,k,_,S,C,M,I,h-I,l)}return $r(s,0,i+Hr(l)+n)}(e,null==t.level?6:t.level,null==t.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+t.mem,r,i)},ti=function(e,t,r){for(;r;++t)e[t]=r,r>>>=8},ri=function(e,t){var r=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=2>t.level?4:9==t.level?2:0,e[9]=3,0!=t.mtime&&ti(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),r){e[3]=8;for(var i=0;r.length>=i;++i)e[i+10]=r.charCodeAt(i)}},ii=function(e){return 10+(e.filename&&e.filename.length+1||0)};function ni(e,t){for(var r="",i=0;e.length>i;){var n=e[i++];r+=String.fromCharCode(n)}return r}class ai{constructor(e,t){var r,i,n,a;void 0===t&&(t={}),this.ee={},this.te=Date.now(),this.re=-1/0,this.ie=()=>{var e=Date.now(),t=e-this.te;t>0?(this.ne=Math.min(this.ae,this.ne+t/1e3*this.oe),this.te=e):this.te=e},this.se=e=>{if(!this.ee[e]){var t,r;this.ee[e]=!0;var i=this.ue(e);null==(t=(r=this.le).onBlockedNode)||t.call(r,e,i)}},this.he=e=>{var t=this.ue(e);if("svg"!==(null==t?void 0:t.nodeName)&&t instanceof Element){var r=t.closest("svg");if(r)return[this._rrweb.mirror.getId(r),r]}return[e,t]},this.ue=e=>this._rrweb.mirror.getNode(e),this.ce=e=>{var t,r,i,n,a,o,s,u;return(null!==(t=null==(r=e.removes)?void 0:r.length)&&void 0!==t?t:0)+(null!==(i=null==(n=e.attributes)?void 0:n.length)&&void 0!==i?i:0)+(null!==(a=null==(o=e.texts)?void 0:o.length)&&void 0!==a?a:0)+(null!==(s=null==(u=e.adds)?void 0:u.length)&&void 0!==s?s:0)},this.throttleMutations=e=>{if(3!==e.type||0!==e.data.source)return e;var t=e.data,r=this.ce(t);if(t.attributes){var i=t.attributes.length;t.attributes=t.attributes.filter((e=>{var t=this.he(e.id);return!this.de.consumeRateLimit(t[0])&&e}));var n,a,o=i-t.attributes.length;o>0&&(null==(n=(a=this.le).onDroppedAttributeMutations)||n.call(a,o))}var s=this.ce(t);if(0!==s||r===s){if(this.ve)return e;this.ie();var u,l,h=kr(e);return h>this.ne?(null==(u=(l=this.le).onDroppedOversizedMutation)||u.call(l,h),void this.fe()):(this.ne-=h,e)}},this.fe=()=>{if(!this.pe){var e=Math.max(0,this.ge-(Date.now()-this.re));this.pe=setTimeout((()=>{var e,t;this.pe=void 0,this.re=Date.now(),null==(e=(t=this.le).requestFullSnapshot)||e.call(t)}),e)}},this._rrweb=e,this.le=t,this.de=new N({bucketSize:null!==(r=this.le.bucketSize)&&void 0!==r?r:100,refillRate:null!==(i=this.le.refillRate)&&void 0!==i?i:10,refillInterval:1e3,S:this.se,I:Le}),this.ae=null!==(n=this.le.bytesBucketSize)&&void 0!==n?n:0,this.oe=null!==(a=this.le.bytesRefillRate)&&void 0!==a?a:25600,this.ve=!Number.isFinite(this.ae)||0>=this.ae,this.ne=this.ae;var o=this.le.resyncIntervalMs;this.ge=I(o)&&Number.isFinite(o)&&o>0?o:3e5}reset(){this.ee={},this.pe&&(clearTimeout(this.pe),this.pe=void 0),this.re=Date.now()}stop(){this.de.stop(),this.reset(),this.ne=this.ae,this.te=Date.now(),this.re=-1/0}}Re.DEBUG=!1,Re.LIB_VERSION="1.422.4",Re.LIB_NAME="web";class oi{constructor(e){if(!e.persistence)throw new Error("it is not valid to not have persistence and be this far into setting up the application");this.me=e.get_property.bind(e),this.ye=e.persistence.set_property.bind(e.persistence)}trackSize(e,t){this.ye(Wt,{sessionId:e,size:this.currentTrackedSize(e)+t})}currentTrackedSize(e){var t,r=this.me(Wt);return _(t=r)&&x(t.sessionId)&&I(t.size)&&r.sessionId===e?r.size:0}}function si(e,t){return function(e){for(var t=0,r=0;e.length>r;r++)t=(t<<5)-t+e.charCodeAt(r),t|=0;return Math.abs(t)}(e)%100<F(100*t,0,100,Le)}function ui(e){return"$survey_response_"+e}function li(e,t){if(!t)return null;var r=e[ui(t)];return w(r)?[...r]:r}function hi(e,t,r){void 0===e&&(e={});var i={};return t.questions.forEach((t=>{if(!S(t.originalQuestionIndex)){var r,n=0===(r=t.originalQuestionIndex)?"$survey_response":"$survey_response_"+r,a=li(e,t.id);S(a)||(i[n]=a)}})),h({$survey_questions:t.questions.map((t=>{var i,n;return{id:t.id,question:null!==(i=null==r?void 0:r[null!==(n=t.id)&&void 0!==n?n:""])&&void 0!==i?i:t.question,response:li(e,t.id)}}))},e,i)}function ci(e,t){var r="$survey_"+t+"/"+e.id;return e.current_iteration&&e.current_iteration>0&&(r="$survey_"+t+"/"+e.id+"/"+e.current_iteration),r}function di(e){return"string"==typeof e&&e.trim()?e.trim():null}function vi(e){return e.toLowerCase()}function fi(e,t,r){if(!e||!t)return null;var i=vi(t),n=Object.keys(e).find((e=>vi(e)===i));if(n)return null==r||r.debug("Found exact translation match: "+n),n;if(i.includes("-")){var a=i.split("-")[0],o=Object.keys(e).find((e=>vi(e)===a));if(o)return null==r||r.debug("Found base language translation match: "+o+" (from "+t+")"),o}return null}var pi=["thankYouMessageHeader","thankYouMessageDescription","thankYouMessageCloseButtonText","introScreenHeader","introScreenDescription","introScreenButtonText","submitButtonText","backButtonText"];function gi(e,t,r){var i,n=fi(e.translations,t,r),a=h({},e),o=!1;if(n){var s,u=null==(s=e.translations)?void 0:s[n];if(u)if(null==r||r.info("Applying survey-level translation for language: "+n),S(u.name)||(a.name=u.name,o=!0),a.appearance){var l=h({},a.appearance);for(var c of pi){var d=u[c];S(d)||(l[c]=d,o=!0)}a.appearance=l}else(function(e){return pi.some((t=>!S(e[t])))})(u)&&(o=!0)}var v=e.questions.map((e=>function(e,t,r){var i,n=fi(e.translations,t,r);if(!n)return{question:e,matchedKey:null,hasChanges:!1};var a=null==(i=e.translations)?void 0:i[n];if(!a)return{question:e,matchedKey:null,hasChanges:!1};var o=h({},e),s=!1;return S(a.question)||(o.question=a.question,s=!0),S(a.description)||(o.description=a.description,s=!0),S(a.buttonText)||(o.buttonText=a.buttonText,s=!0),"link"in o&&!S(a.link)&&(o.link=a.link,s=!0),"lowerBoundLabel"in o&&!S(a.lowerBoundLabel)&&(o.lowerBoundLabel=a.lowerBoundLabel,s=!0),"upperBoundLabel"in o&&!S(a.upperBoundLabel)&&(o.upperBoundLabel=a.upperBoundLabel,s=!0),"choices"in o&&function(e){return w(e.choices)}(a)&&(o.choices=a.choices,s=!0),{question:s?o:e,matchedKey:s?n:null,hasChanges:s}}(e,t,r))),f=v.map((e=>e.question)),p=v.some((e=>e.hasChanges)),g=null;return n||(g=(null==(i=v.find((e=>e.matchedKey)))?void 0:i.matchedKey)||null),p&&(a.questions=f,o=!0,null==r||r.info("Applied question-level translations for language: "+t)),{survey:a,matchedKey:o?n||g:null}}function mi(e){var t;return!(null==(t=e.conditions)||null==(t=t.events)||null==(t=t.values)||!t.length)}var yi=(e,t)=>{if(!(e=>{try{new RegExp(e)}catch(e){return!1}return!0})(t))return!1;try{return new RegExp(t).test(e)}catch(e){return!1}},bi=e=>e.toLowerCase(),wi={exact:(e,t)=>t.some((t=>e.some((e=>t===e)))),is_not:(e,t)=>t.every((t=>e.every((e=>t!==e)))),regex:(e,t)=>t.some((t=>e.some((e=>yi(t,e))))),not_regex:(e,t)=>t.every((t=>e.every((e=>!yi(t,e))))),icontains:(e,t)=>t.map(bi).some((t=>e.map(bi).some((e=>t.includes(e))))),not_icontains:(e,t)=>t.map(bi).every((t=>e.map(bi).every((e=>!t.includes(e))))),gt:(e,t)=>t.some((t=>{var r=parseFloat(t);return!isNaN(r)&&e.some((e=>r>parseFloat(e)))})),lt:(e,t)=>t.some((t=>{var r=parseFloat(t);return!isNaN(r)&&e.some((e=>r<parseFloat(e)))}))},ki=new Set(["is_not","not_icontains","not_regex"]);function _i(e,t,r){return!e||0===e.length||e.every((e=>{var i="person"===e.type?r:t,n=null==i?void 0:i[e.key],a=e.operator||"exact";if(S(n)||M(n))return ki.has(a);var o=wi[a];return!!o&&!S(e.value)&&!M(e.value)&&o(w(e.value)?e.value.map(String):[String(e.value)],w(n)?n.map(String):[String(n)])}))}var Si=Oe("[SessionRecording]");function xi(e,t){return t?e:"!"+e}function Ci(e,t){return e===t||e!=="!"+t&&null}class Mi{constructor(e,t,r,i,n,a,o){this.be=null,this.we=yr,this._instance=e,this.J=t,this.Y=r,this.K=i,this.ke=n,this._e=a,this.Se=o}onRemoteConfig(e){this.be=I(e.sampleRate)?e.sampleRate:null,"any"===e.triggerMatchType?(this.xe=new lr([this.Y,this.J]),this.we=mr):(this.xe=new hr([this.Y,this.J]),this.we=yr),this._instance.register_for_session({[Gt]:e.triggerMatchType}),this.J.onConfig(e),this.Y.onConfig(e),this.K.onConfig(e,((e,t)=>{this.ke("linked_flag_matched",{flag:e,variant:t}),this.Se()}))}getStatus(e){return this.we({receivedFlags:!0,isRecordingEnabled:!0,isSampled:e.isSampled,rrwebError:e.rrwebError,urlTriggerMatching:e.urlTriggerMatching,eventTriggerMatching:e.eventTriggerMatching,linkedFlagMatching:e.linkedFlagMatching,sessionId:e.sessionId})}getMinimumDuration(e){var t=this._instance.get_property("$session_recording_remote_config"),r=null==t?void 0:t.minimumDurationMilliseconds;return I(r)?r:null}checkUrlTriggers(e,t,r,i){this.J.checkUrlTriggerConditions(t,r,i,e)}setupEventTriggerListeners(e,t,r){if(0!==this.Y.Z.length&&T(this.Ce))return this.Ce=e((e=>{try{this.Y.checkEventTriggerConditions(e.event,r,t)}catch(e){Si.error("Could not activate event trigger",e)}})),this.Ce}makeSamplingDecisions(e){var t,r,i,n=this.be;if(!I(n))return null==(r=this._instance.persistence)||r.unregister(Ft),void(null==(i=this._instance.persistence)||i.unregister(At));var a=this._instance.get_property(Ft),o=this._instance.get_property(At),s=Ci(a,e),u=I(o)&&o!==n,l=S(o)&&a===e,h=u||l||!E(s),c=h?si(e,n):s;h&&(c?this.ke("sampled"):Si.warn("Sample rate ("+n+") has determined that this sessionId ("+e+") will not be sent to the server.")),null==(t=this._instance.persistence)||t.register({[Ft]:xi(e,c),[At]:M(o)&&a===e?null:n})}ensureSamplingDecision(e){if(I(this.be)){var t=this._instance.get_property(Ft);E(Ci(t,e))||this.makeSamplingDecisions(e)}}onFlushComplete(){}clearConditionalRecordingPersistence(){var e,t,r,i,n;null==(e=this._instance.persistence)||e.unregister(jt),null==(t=this._instance.persistence)||t.unregister(qt),null==(r=this._instance.persistence)||r.unregister(Ft),null==(i=this._instance.persistence)||i.unregister(At),null==(n=this._instance.persistence)||n.unregister(Nt)}updateActiveTriggers(e){}hasPendingTriggers(e){var t;return(null==(t=this.xe)?void 0:t.triggerStatus(e))===ir}getPendingTriggerConditions(e){return[{label:"URL condition not matched",status:this.J.triggerStatusNoSideEffects(e)},{label:"event condition not matched",status:this.Y.triggerStatusNoSideEffects(e)},{label:"linked flag condition not matched",status:this.K.triggerStatusNoSideEffects()}].filter((e=>e.status===ir)).map((e=>e.label))}stop(){var e;null==(e=this.Ce)||e.call(this),this.Ce=void 0,this.Y.stop(),this.J.stop(),this.K.stop()}}class Ti{constructor(e,t,r,i,n){this.Me=[],this.Te=new Map,this.Ie=!1,this._instance=e,this.J=t,this.ke=r,this.Ee=i,this.Se=n}onRemoteConfig(e){e.triggerGroups&&0!==e.triggerGroups.length?(this.Re(e.triggerGroups),this._instance.register_for_session({[Gt]:"v2_trigger_groups",$sdk_debug_replay_trigger_groups_count:e.triggerGroups.length}),this.J.onConfig(e)):Si.warn("[V2Strategy] No trigger groups configured")}getStatus(e){return function(e){if(e.rrwebError)return er;if(e.urlTriggerMatching.urlBlocked)return Xt;var t=e.triggerGroupMatchers,r=e.triggerGroupSamplingResults;if(0===t.length)return Qt;var i=!1,n=!1;for(var a of t){var o=a.triggerStatus(e.sessionId);if(o===rr){var s=a.group.id,u=r.get(s);S(u)?Le.warn("[V2 Triggers] Group activated but no sampling decision found",{groupId:s}):!0===u&&(n=!0)}else o===ir&&(i=!0)}return n?Jt:i?Kt:Qt}({isSampled:e.isSampled,rrwebError:e.rrwebError,urlTriggerMatching:e.urlTriggerMatching,eventTriggerMatching:e.eventTriggerMatching,linkedFlagMatching:e.linkedFlagMatching,sessionId:e.sessionId,triggerGroupMatchers:this.Me,triggerGroupSamplingResults:this.Te,minimumDuration:this.getMinimumDuration(e.sessionId)})}getMinimumDuration(e){var t=null;for(var r of this.Me)if("trigger_activated"===r.triggerStatus(e)){var i=r.group.minDurationMs;I(i)&&(M(t)||t>i)&&(t=i)}return t}checkUrlTriggers(e,t,r,i){var n=this;this.J.checkUrlBlocklist(t,r);var a=function(i){i.checkUrlTriggerConditions(t,r,(t=>{n.Ae(i,void 0)&&(i.activateTrigger(t,e),n.updateActiveTriggers(e),n.Se(t))}),e)};for(var o of this.Me)a(o)}setupEventTriggerListeners(e,t,r){var i=this;return this.Ce=e((e=>{var r;if(this.Ie)return Si.info("[SessionRecorder] Stopping trigger checks - initial buffer flushed"),null==(r=this.Ce)||r.call(this),void(this.Ce=void 0);try{var n=function(r){r.checkEventTriggerConditions(e.event,(n=>{if(i.Ae(r,e.properties)){var a=(r.group.conditions.events||[]).filter((t=>t.name===e.event)),o=i._instance.get_property(zt),s=a.some((t=>!t.properties||0===t.properties.length||_i(t.properties,e.properties,o)));s&&(r.activateTrigger(n,t),i.updateActiveTriggers(t),i.Se(n))}}),t)};for(var a of this.Me)n(a)}catch(e){Si.error("Could not activate event trigger for trigger groups",e)}})),this.Ce}makeSamplingDecisions(e){for(var t of this.Me){var r,i=t.group,n=i.id,a=i.sampleRate,o=$t+n,s=this._instance.get_property(o),u=null,l=!1,h=!1,c=!1;if(_(s)){var d=s.sessionId,v=s.sampleRate,f=s.sampled;l="string"==typeof d&&d!==e,h=I(v)&&v!==a,u=d===e&&I(v)&&v===a&&E(f)?f:null}else u=s===e||null,l="string"==typeof s&&s!==e,c=s===e;var p=l||h||c||!E(u),g=p?si(e+n,a):u;p&&this.Ee("triggerGroupSamplingDecisionMade",{group_id:n,group_name:i.name,sampleRate:a,isSampled:g}),this.Te.set(n,g),null==(r=this._instance.persistence)||r.register({[o]:{sessionId:e,sampleRate:a,sampled:g}})}this.updateActiveTriggers(e)}ensureSamplingDecision(e){}onFlushComplete(){this.Ie=!0}clearConditionalRecordingPersistence(){var e,t,r;for(var i of(null==(e=this._instance.persistence)||e.unregister(Ft),null==(t=this._instance.persistence)||t.unregister(At),null==(r=this._instance.persistence)||r.unregister(Nt),this.Me)){var n,a,o,s=i.group.id;null==(n=this._instance.persistence)||n.unregister(Bt+s),null==(a=this._instance.persistence)||a.unregister(Ht+s),null==(o=this._instance.persistence)||o.unregister($t+s)}}updateActiveTriggers(e){var t=[];for(var r of this.Me){var i=r.group,n=i.id,a="trigger_activated"===r.triggerStatus(e),o=!0===this.Te.get(n);a&&t.push({id:n,name:i.name,matched:!0,sampled:o})}this._instance.register_for_session({$sdk_debug_replay_matched_recording_trigger_groups:t})}hasPendingTriggers(e){for(var t of this.Me)if(t.triggerStatus(e)===ir)return!0;return!1}getPendingTriggerConditions(e){return this.Me.flatMap((t=>t.triggerStatusNoSideEffects(e)!==ir?[]:t.getPendingTriggerConditions(e).map((e=>'trigger group "'+t.group.name+'": '+e))))}stop(){var e;null==(e=this.Ce)||e.call(this),this.Ce=void 0,this.Me.forEach((e=>e.stop())),this.Me=[],this.Te.clear(),this.J.stop()}Ae(e,t){var r=e.group.conditions.properties;return!r||0===r.length||_i(r,t,this._instance.get_property(zt))}Re(e){var t=this;this.Me.forEach((e=>e.stop())),this.Me=[],this.Te.clear();var r=function(e){var r=new gr(t._instance,e,((r,i)=>{t.ke("linked_flag_matched",{flag:r,variant:i,group_id:e.id,group_name:e.name}),t.Se()}));t.Me.push(r)};for(var i of e)r(i)}}var Ii=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],Ei=1e5,Ri="https://schema.org",Ai=[],Li="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(" "),Oi="Action BorrowAction ReadAction SearchAction SeekToAction SolveMathAction WatchAction".split(" "),Pi="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(" "),Di="Accommodation AdministrativeArea Country Place State".split(" "),Fi={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:Oi,publisher:Pi},Event:{startDate:!0,endDate:!0,previousStartDate:!0,aggregateRating:["AggregateRating"],offers:["AggregateOffer","Offer"]},ItemList:{itemListElement:["ListItem"]},ListItem:{item:Ai},Offer:{seller:Pi},Organization:{name:!0,legalName:!0,foundingDate:!0,dissolutionDate:!0,aggregateRating:["AggregateRating"],brand:["Brand"]},Person:{},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:Pi,offers:["Offer","AggregateOffer"],aggregateRating:["AggregateRating"]},Service:{name:!0,serviceType:!0,category:!0,provider:Pi,areaServed:Di,offers:["AggregateOffer","Offer"],aggregateRating:["AggregateRating"]},OfferCatalog:{name:!0,itemListElement:Ai}},Ni={},qi=[[Oi,Ni],["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(" "),Fi.CreativeWork],["BroadcastEvent BusinessEvent EducationEvent Festival MusicEvent SportsEvent TheaterEvent".split(" "),Fi.Event],[Pi,Fi.Organization],[Di,Fi.Place],["Car IndividualProduct ProductGroup ProductModel".split(" "),Fi.Product],["AggregateRating EmployerAggregateRating Rating".split(" "),Ni]],ji="AlignmentObject BedDetails Certification ContactPoint CreditCard DefinedRegion EducationalOccupationalCredential EntryPoint GeoCoordinates GeoShape InteractionCounter JobPosting LocationFeatureSpecification MathSolver MemberProgram MemberProgramTier MerchantReturnPolicy MerchantReturnPolicySeasonalOverride MonetaryAmount NutritionInformation OccupationalExperienceRequirements OfferShippingDetails OpeningHoursSpecification PeopleAudience PostalAddress PriceSpecification PropertyValue QuantitativeValue ServicePeriod ShippingConditions ShippingDeliveryTime ShippingRateSettings ShippingService SpeakableSpecification Thing UnitPriceSpecification".split(" ");function Bi(e,t){return y.call(e,t)?e[t]:void 0}function Hi(e){var t=typeof e;return M(e)||"string"===t||"number"===t||"boolean"===t}function $i(e){return Hi(e)||w(e)&&e.every(Hi)?e:void 0}function Ui(e){if(y.call(Fi,e))return Fi[e];for(var t of qi){var r=t[1];if(t[0].includes(e))return r}return ji.includes(e)?Ni:void 0}function Wi(e,t){if(!_(e))return null;var r=Bi(e,"@type"),i=function(e){return("string"==typeof e?[e]:w(e)?e:[]).filter((e=>"string"==typeof e)).map((e=>e.replace(/^https?:\/\/schema\.org\//,""))).filter((e=>!!Ui(e)))}(r).filter((e=>!t||!t.length||t.includes(e)));if(!i.length)return null;var n={"@type":"string"==typeof r?i[0]:i},a=$i(Bi(e,"@id"));for(var o of(S(a)||(n["@id"]=a),Li)){var s=$i(Bi(e,o));S(s)||(n[o]=s)}for(var u of i){var l=Ui(u),h=function(){var t=Bi(e,c),r=l[c];if(!0===r){var i=$i(t);S(i)||(n[c]=i)}else if(w(t)){var a=t.map((e=>Wi(e,r))).filter(_);a.length&&(n[c]=a)}else{var o=Wi(t,r);o&&(n[c]=o)}};for(var c of Object.keys(l))h()}return n}function zi(e){if(!_(e))return null;var t=Bi(e,"@context");if("string"!=typeof t||!/^https?:\/\/schema\.org\/?$/.test(t))return null;var r=Wi(e);if(r)return h({"@context":Ri},r);var i=Bi(e,"@graph");if(!w(i))return null;var n=i.map((e=>Wi(e))).filter(_);return n.length?{"@context":Ri,"@graph":n}:null}function Vi(e){var t;return"SCRIPT"===e.nodeName&&"application/ld+json"===(null==(t=e.getAttribute("type"))?void 0:t.trim().toLowerCase())}function Zi(e,t,r){if("string"==typeof t?e.classList.contains(t):t&&Array.from(e.classList).some((e=>(t.lastIndex=0,t.test(e)))))return!0;try{return!!r&&e.matches(r)}catch(e){return!1}}function Gi(e){return Vi(e)?[e]:e.nodeType!==e.ELEMENT_NODE?[]:Array.from(e.querySelectorAll("script")).filter(Vi)}function Qi(e){return S(e)?void 0:Math.round(e)}function Ji(e){return _(e)?e.network_timing:e}var Yi,Ki,Xi=943718.4,en="[SessionRecording]",tn=Oe(en),rn=[d.MouseMove,d.MouseInteraction,d.Scroll,d.ViewportResize,d.Input,d.TouchMove,d.MediaInteraction,d.Drag],nn=e=>({rrwebMethod:e,enqueuedAt:Date.now(),attempt:1});function an(){var e;return null==s||null==(e=s.__PosthogExtensions__)?void 0:e.rrweb}function on(){var e;return null==(e=an())?void 0:e.record}function sn(e){try{return JSON.stringify(e)}catch(t){return JSON.stringify(e,br())}}function un(e){return ni(function(e,t){void 0===t&&(t={});var r=Xr(),i=e.length;r.p(e);var n=ei(e,t,ii(t),8),a=n.length;return ri(n,t),ti(n,a-8,r.d()),ti(n,a-4,i),n}(function(e,t){var r=e.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var i=new Sr(e.length+(e.length>>>1)),n=0,a=function(e){i[n++]=e},o=0;r>o;++o){if(n+5>i.length){var s=new Sr(n+8+(r-o<<1));s.set(i),i=s}var u=e.charCodeAt(o);128>u?a(u):2048>u?(a(192|u>>>6),a(128|63&u)):u>55295&&57344>u?(a(240|(u=65536+(1047552&u)|1023&e.charCodeAt(++o))>>>18),a(128|u>>>12&63),a(128|u>>>6&63),a(128|63&u)):(a(224|u>>>12),a(128|u>>>6&63),a(128|63&u))}return $r(i,0,n)}(sn(e))))}function ln(e){return hn.apply(this,arguments)}function hn(){return hn=l((function*(e){var t=sn(e),r=yield function(e,t,r){return ve.apply(this,arguments)}(t,Re.DEBUG,{rethrow:!0});return ni(new Uint8Array(yield r.arrayBuffer()))})),hn.apply(this,arguments)}var cn="undefined"!=typeof globalThis&&"CompressionStream"in globalThis&&"TextEncoder"in globalThis&&"Response"in globalThis&&"function"==typeof Response.prototype.blob,dn=!1;function vn(e){return w(e)&&0===e.length?Yi=null!=Yi?Yi:un([]):un(e)}function fn(e){return pn.apply(this,arguments)}function pn(){return(pn=l((function*(e){return w(e)&&0===e.length?Yi||(Ki=null!=Ki?Ki:ln([]).then((e=>(Yi=e,e))).catch((e=>{throw Yi=void 0,Ki=void 0,e}))):ln(e)}))).apply(this,arguments)}function gn(e){return cn&&!dn&&function(e){return e.type===c.FullSnapshot||e.type===c.IncrementalSnapshot&&(e.data.source===d.Mutation||e.data.source===d.StyleSheetRule)}(e)}function mn(e){return{event:e,size:kr(e)}}function yn(e,t){return h({},e,{data:t,cv:"2024-10"})}function bn(e,t){return h({},e,{cv:"2024-10",data:h({},e.data,t)})}function wn(e){try{if(e.type===c.FullSnapshot)return mn(yn(e,un(e.data)));if(e.type===c.IncrementalSnapshot&&e.data.source===d.Mutation)return mn(bn(e,{texts:vn(e.data.texts),attributes:vn(e.data.attributes),removes:vn(e.data.removes),adds:vn(e.data.adds)}));if(e.type===c.IncrementalSnapshot&&e.data.source===d.StyleSheetRule)return mn(bn(e,{adds:e.data.adds?un(e.data.adds):void 0,removes:e.data.removes?un(e.data.removes):void 0}))}catch(e){tn.error("could not compress event - will use uncompressed event",e)}return{event:e,size:wr(e)}}function kn(){return kn=l((function*(e){try{if(e.type===c.FullSnapshot)return mn(yn(e,yield ln(e.data)));if(e.type===c.IncrementalSnapshot&&e.data.source===d.Mutation){var t=yield Promise.all([fn(e.data.texts),fn(e.data.attributes),fn(e.data.removes),fn(e.data.adds)]);return mn(bn(e,{texts:t[0],attributes:t[1],removes:t[2],adds:t[3]}))}if(e.type===c.IncrementalSnapshot&&e.data.source===d.StyleSheetRule){var r=yield Promise.all([e.data.adds?ln(e.data.adds):void 0,e.data.removes?ln(e.data.removes):void 0]);return mn(bn(e,{adds:r[0],removes:r[1]}))}}catch(t){return(e=>{if(!e||"object"!=typeof e)return!1;var t="name"in e?String(e.name):"";return(e=>!(!e||"object"!=typeof e)&&"NotReadableError"===("name"in e?String(e.name):""))(e)||t===he})(t)&&(dn=!0),tn.error("could not compress event asynchronously - trying synchronous compression",t),wn(e)}return{event:e,size:wr(e)}})),kn.apply(this,arguments)}function _n(e,t){return e.type===c.Custom&&e.data.tag===t}function Sn(e){return _n(e,"sessionIdle")}function xn(e){return _n(e,"$session_ending")}function Cn(e){return _n(e,"$session_starting")}class Mn{get sessionId(){return this.Le}get Oe(){if(!this._instance.sessionManager)throw new Error(en+" must be started with a valid sessionManager.");return this._instance.sessionManager}get Pe(){return this._instance.config.session_recording.session_idle_threshold_ms||3e5}get De(){return Ci(this._instance.get_property(Ft),this.sessionId)}get be(){var e,t=null==(e=this.Fe)?void 0:e.sampleRate;return I(t)?t:null}get Ne(){var e,t;return null!==(e=null==(t=this.qe)?void 0:t.getMinimumDuration(this.sessionId))&&void 0!==e?e:null}constructor(e,t){this.je="/s/",this._forceAllowLocalhostNetworkCapture=!1,this.Be=void 0,this.He=!1,this.$e=Date.now(),this.Ue=!1,this.We=[],this.ze="unknown",this.Ve=0,this.Ze=0,this.Ge=0,this.Qe=0,this.Je=!1,this.Ye=!1,this.Ke=!1,this.Xe=!1,this.et=!1,this.tt=!1,this.rt=!1,this.it=!1,this.nt=!1,this.ot=!1,this.st=!1,this.ut=!1,this.ht=[],this.ct=void 0,this.dt=void 0,this.vt=[],this.ft=0,this.yt=0,this.bt=!1,this.wt=void 0,this.Ce=void 0,this.kt=void 0,this._t=void 0,this.St=void 0,this.xt=(e,t,r)=>{var i,n,a;if(r&&(e!==this.Le||t!==this.Ct)){var o,s=!r.noSessionId&&(r.activityTimeout||r.sessionPastMaximumLength),u=this.Le,l=this.Ct;if(s&&this.Ee("$session_ending",{currentSessionId:u,currentWindowId:l,nextSessionId:e,nextWindowId:t,changeReason:r,lastActivityTimestamp:this.$e,flushed_size:null==(o=this.Mt)?void 0:o.currentTrackedSize(u)}),null==(i=this._instance.persistence)||i.unregister(Ut),this.rt=!1,null==(n=an())||null==n.resetMaxDepthState||n.resetMaxDepthState(),this.Ee("$session_id_change",{sessionId:e,windowId:t,changeReason:r}),this.Tt(),!(!1===this.ze&&this.isStarted||this.Le===e&&this.Ct===t)){var h=this.Le!==e&&!1!==this.ze;this.ze="unknown",this.It(h)}s&&this.Ee("$session_starting",{previousSessionId:u,previousWindowId:l,nextSessionId:e,nextWindowId:t,changeReason:r,lastActivityTimestamp:this.$e}),null==(a=this.qe)||a.makeSamplingDecisions(e)}},this.Et=()=>{var e;return(null==(e=this._instance.persistence)?void 0:e.props[Nt])===this.Le},this.Rt=()=>{var e,t;if(0===this.At.data.length)return null;var r=null==(e=this.At.data[0])?void 0:e.timestamp,i=null==(t=this.At.data[this.At.data.length-1])?void 0:t.timestamp;return I(r)&&I(i)?i-r:null},this.Lt=()=>{var e,t,r=this.Ne;if(!I(r))return!1;if(null===(e=null==(t=this._instance.config.session_recording)?void 0:t.strictMinimumDuration)||void 0===e||!e){var i=this.Ot;return I(i)&&i>=0&&r>i}if(this.Et())return!1;var n,a=this.Rt();return!!M(a)||r>a||(null==(n=this._instance.persistence)||n.register({[Nt]:this.Le}),!1)},this.Pt=()=>{this.status!==Kt?(this.Je&&this.Ye&&this.Dt&&!this.Ke&&(this.Je=!1),this.Ft(),this.Nt()):this.qt()},this.jt=()=>{this.Pt()},this.Bt=()=>{this.Ee("browser offline",{})},this.Ht=()=>{this.Ee("browser online",{})},this.$t=()=>{null!=i&&i.visibilityState&&("visible"===i.visibilityState&&(this.Dt=!0),this.Ee("window "+i.visibilityState,{}))},this._instance=e,this.Dt=null==t||t;var r=this.Oe.checkAndGetSessionAndWindowId(),n=r.windowId;this.Le=r.sessionId,this.Ct=n,this.K=new fr(this._instance),this.J=new vr(this._instance),this.Y=new pr(this._instance),this.At=this.qt(),this.Oe.sessionTimeoutMs>this.Pe||tn.warn("session_idle_threshold_ms ("+this.Pe+") is greater than the session timeout ("+this.Oe.sessionTimeoutMs+"). Session will never be detected as idle"),this.Mt=new oi(this._instance)}setDocumentWasEverVisible(e){e&&(this.Dt=!0)}get Ut(){var e,t,r,i,n,a,o,s,u,l=null==(e=this.Fe)?void 0:e.masking,h={maskAllInputs:null==(t=this._instance.config.session_recording)?void 0:t.maskAllInputs,maskTextSelector:null==(r=this._instance.config.session_recording)?void 0:r.maskTextSelector,blockSelector:null==(i=this._instance.config.session_recording)?void 0:i.blockSelector,maskAllElementAttributes:null==(n=this._instance.config.session_recording)?void 0:n.maskAllElementAttributes},c=null!==(a=null==h?void 0:h.maskAllInputs)&&void 0!==a?a:null==l?void 0:l.maskAllInputs,d=null!==(o=null==h?void 0:h.maskTextSelector)&&void 0!==o?o:null==l?void 0:l.maskTextSelector,v=null!==(s=null==h?void 0:h.blockSelector)&&void 0!==s?s:null==l?void 0:l.blockSelector,f=null!==(u=null==h?void 0:h.maskAllElementAttributes)&&void 0!==u?u:null==l?void 0:l.maskAllElementAttributes;return S(c)&&S(d)&&S(v)&&S(f)?void 0:{maskAllInputs:null==c||c,maskTextSelector:d,blockSelector:v,maskAllElementAttributes:f}}Wt(){var e;if(!this.nt){var t=null==(e=this.Fe)?void 0:e.masking;if(!T(t)){var r=this._instance.config.session_recording,i=["maskAllInputs","maskTextSelector","blockSelector","maskAllElementAttributes"].filter((e=>{var i=null==r?void 0:r[e],n=t[e];return!S(i)&&i!==n}));0!==i.length&&(this.nt=!0,tn.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==r?void 0:r.maskAllInputs,maskTextSelector:null==r?void 0:r.maskTextSelector,blockSelector:null==r?void 0:r.blockSelector,maskAllElementAttributes:null==r?void 0:r.maskAllElementAttributes},project:t}))}}}get zt(){var e;return F(null==(e=this._instance.config.session_recording.canvasCapture)?void 0:e.resolutionScale,.1,1,Oe("canvas recording resolution scale"),1)}get Vt(){var e,t,r,i,n,a,o,s=this._instance.config.session_recording.captureCanvas,u=null==(e=this.Fe)?void 0:e.canvasRecording,l=null!==(t=null!==(r=null==s?void 0:s.recordCanvas)&&void 0!==r?r:null==u?void 0:u.enabled)&&void 0!==t&&t,h=null!==(i=null!==(n=null==s?void 0:s.canvasFps)&&void 0!==n?n:null==u?void 0:u.fps)&&void 0!==i?i:4,c=null!==(a=null!==(o=null==s?void 0:s.canvasQuality)&&void 0!==o?o:null==u?void 0:u.quality)&&void 0!==a?a:.4;if("string"==typeof c){var d=parseFloat(c);c=isNaN(d)?.4:d}return{enabled:l,fps:F(h,0,12,Oe("canvas recording fps"),4),quality:F(c,0,1,Oe("canvas recording quality"),.4)}}get Zt(){var e,t=!(null==(e=this.Fe)||!e.consoleLogRecordingEnabled),r=this._instance.config.enable_recording_console_log;return null!=r?r:t}get Gt(){var e,t,r,i=null==(e=this.Fe)?void 0:e.networkPayloadCapture,n={recordHeaders:null==(t=this._instance.config.session_recording)?void 0:t.recordHeaders,recordBody:null==(r=this._instance.config.session_recording)?void 0:r.recordBody},a=(null==n?void 0:n.recordHeaders)||(null==i?void 0:i.recordHeaders),o=(null==n?void 0:n.recordBody)||(null==i?void 0:i.recordBody),s=Ji(this._instance.config.capture_performance),u=Ji(null==i?void 0:i.capturePerformance),l=!!(E(s)?s:u);return a||o||l?{recordHeaders:a,recordBody:o,recordPerformance:l}:void 0}Qt(){var e,t,r=[],i=null==(e=s.__PosthogExtensions__)||null==(e=e.rrwebPlugins)?void 0:e.getRecordConsolePlugin;i&&this.Zt&&r.push(i());var a=null==(t=s.__PosthogExtensions__)||null==(t=t.rrwebPlugins)?void 0:t.getRecordNetworkPlugin;if(this.Gt&&k(a))if(!qe.includes(n.hostname)||this._forceAllowLocalhostNetworkCapture){var o=k(this._instance.requestRouter.isIngestionEndpoint)?this._instance.requestRouter.isIngestionEndpoint.bind(this._instance.requestRouter):void 0;r.push(a(((e,t,r)=>{var i,n={payloadSizeLimitBytes:kt.payloadSizeLimitBytes,performanceEntryTypeToObserve:[...kt.performanceEntryTypeToObserve],payloadHostDenyList:[...t.payloadHostDenyList||[],...kt.payloadHostDenyList]},a=!1!==e.session_recording.recordHeaders&&t.recordHeaders,o=!1!==e.session_recording.recordBody&&t.recordBody,s=!1!==e.capture_performance&&t.recordPerformance,u=(i=wt(n),e=>(null!=e&&e.requestBody&&(e.requestBody=Tt(e.requestBody,e.requestHeaders,i,"Request")),null!=e&&e.responseBody&&(e.responseBody=Tt(e.responseBody,e.responseHeaders,i,"Response")),e)),l=t=>{return u(((e,t,r)=>{var i;if(null==r||!r(e.name)){var n=je(e.name),a=0===t.indexOf("http")?null==(i=je(t))?void 0:i.pathname:t;"/"===a&&(a="");var o=null==n?void 0:n.pathname.replace(a||"","");if(!(n&&o&&Mt.some((e=>0===o.indexOf(e)))))return e}})((Ct((i=t).requestHeaders),Ct(i.responseHeaders),i),e.api_host,r));var i},c=k(e.session_recording.maskNetworkRequestFn);return c&&k(e.session_recording.maskCapturedNetworkRequestFn)&&Le.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."),c&&(e.session_recording.maskCapturedNetworkRequestFn=t=>{var r=e.session_recording.maskNetworkRequestFn({url:t.name});return!r&&t.isInitial?r:h({},t,{name:null==r?void 0:r.url})}),n.maskRequestFn=k(e.session_recording.maskCapturedNetworkRequestFn)?t=>{var r=l(t);if(r){var i=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,n=null==e.session_recording.maskCapturedNetworkRequestFn?void 0:e.session_recording.maskCapturedNetworkRequestFn(r);return T(n)&&i?(Et.add(i),i):null!=n?n:void 0}}:e=>function(e){if(!S(e))return e.requestBody=It(e.requestBody,"Request"),e.responseBody=It(e.responseBody,"Response"),e}(l(e)),h({},kt,n,{recordHeaders:a,recordBody:o,recordPerformance:s,recordInitialRequests:s,streamNetworkBody:!0===e.session_recording.streamNetworkBody})})(this._instance.config,this.Gt,o)))}else tn.info("NetworkCapture not started because we are on localhost.");return r}Jt(e){return this._instance.config.disable_capture_url_hashes?ae(e):e}Yt(e,t){void 0===t&&(t=!1);var r=t?ae(e):this.Jt(e),i=this._instance.config.mask_personal_data_properties?[...Ii,...this._instance.config.custom_personal_data_properties||[]]:[];return this.Kt(function(e,t,r){if(!e||!t||!t.length)return e;for(var i=e.split("#"),n=i[1],a=(i[0]||"").split("?"),o=a[1],s=a[0],u=(o||"").split("&"),l=[],h=0;u.length>h;h++){var c=u[h].split("=");w(c)&&(t.includes(c[0])?l.push(c[0]+"=<masked>"):l.push(u[h]))}var d=s;return null!=o&&(d+="?"+l.join("&")),null!=n&&(d+="#"+n),d}(r,i))}Kt(e){var t=this._instance.config.session_recording;if(t.maskCapturedNetworkRequestFn){var r,i=t.maskCapturedNetworkRequestFn({name:e});return null!==(r=null==i?void 0:i.name)&&void 0!==r?r:null==i?void 0:i.url}if(t.maskNetworkRequestFn){var n=t.maskNetworkRequestFn({url:e});return null==n?void 0:n.url}return e}Xt(e){try{return e.rrwebMethod(),!0}catch(t){return 10>this.We.length?this.We.push({enqueuedAt:e.enqueuedAt||Date.now(),attempt:e.attempt+1,rrwebMethod:e.rrwebMethod}):tn.warn("could not emit queued rrweb event.",t,e),!1}}Ee(e,t){return this.Xt(nn((()=>on().addCustomEvent(e,t))))}er(){var e;return this.He&&!0===(null==(e=this._instance.config.session_recording)?void 0:e.captureJsonLd)&&!this.J.urlBlocked&&!0!==this.ze}tr(e){if(!this.er())return!1;try{var t=on();return!!t&&(t.addCustomEvent("$json_ld",e),this.er())}catch(e){return!1}}rr(e){void 0===e&&(e=!1),Promise.resolve().then((()=>{var t;return null==(t=this.ir)?void 0:t.scan(e)}))}nr(){try{if(this._instance.config.capture_pageview||!e)return;var t=new URL(e.location.href),r=this.Yt(t.origin+t.pathname+t.search);this.ar!==r&&(this.ar=r,this.Ee("$url_changed",{href:r}))}catch(e){}}sr(){if(this.We.length){var e=[...this.We];this.We=[],e.forEach((e=>{Date.now()-e.enqueuedAt>2e3||this.Xt(e)}))}}_e(){return this.Xt(nn((()=>on().takeFullSnapshot())))}get ur(){var e,t,r;if(null!=(e=this.qe)&&e.hasPendingTriggers(this.sessionId)&&!["sampled","active"].includes(this.status)){var i,n=null==(i=this._instance.config.session_recording)?void 0:i.trigger_pending_buffer_interval_millis;return I(n)&&Number.isFinite(n)&&n>=1e3&&36e5>=n?n:6e4}return null!==(t=null==(r=this._instance.config.session_recording)?void 0:r.full_snapshot_interval_millis)&&void 0!==t?t:3e5}lr(){if(this.hr&&clearInterval(this.hr),!0!==this.ze){var e=this.ur;e&&(this.hr=setInterval((()=>{this._e()}),e))}}Se(e){"event"===e&&this.cr(),!this.J.urlBlocked&&["sampled","active"].includes(this.status)&&this.lr()}dr(){var e;this.J.urlBlocked||(this.J.urlBlocked=!0,null==(e=this.ir)||e.scan(),clearInterval(this.hr),tn.info("recording paused due to URL blocker"),this.Ee("recording paused",{reason:"url blocker"}))}vr(){var e;this.J.urlBlocked&&(null==(e=this.ir)||e.scan(),this.J.urlBlocked=!1,this._e(),this.rr(),this.lr(),this.Ee("recording resumed",{reason:"left blocked url"}),tn.info("recording resumed"))}pr(e,t){var r;if("event"===e&&this.cr(),!this.Ue&&null!=(r=this.qe)&&r.hasPendingTriggers(this.sessionId)){this.Ue=!0;try{var i,n;null==(i=this._instance.persistence)||i.register({["url"===e?qt:jt]:this.sessionId}),null==(n=this.qe)||n.updateActiveTriggers(this.sessionId),this.Se(),this.Nt(),this.ke(e+"_trigger_matched",{["url"===e?"matchedUrl":"matchedEvent"]:t})}finally{this.Ue=!1}}}get isStarted(){return!!this.Be}get Fe(){var e=this._instance.get_property(Rt);if(e){var t;try{t=_(e)?e:JSON.parse(e)}catch(e){return void tn.warn("persisted remote config for session recording is invalid and will be ignored",e)}if(!this.isStarted){var r,i,n=null!==(r=t.cache_timestamp)&&void 0!==r?r:Date.now();if(Date.now()-n>36e5)return tn.info("persisted remote config for session recording is stale and will be ignored",{cacheTimestamp:n,persistedConfig:e}),void(null==(i=this._instance.persistence)||i.unregister(Rt))}return t}}gr(e,t,r){this._instance.get_property(e)&&(t(),r())}start(t){var r,n,a=this.Fe;if(a){this.isStarted||(this.Je=!1!==this.ze&&!this.Xe,this.Xe=!1,this.Ye=this.Je,this.Ke=!1),this.bt&&(this.mr(),this.qt());var o=this.Oe.checkAndGetSessionAndWindowId(),s=o.windowId;this.Le=o.sessionId,this.Ct=s,null==(r=this._instance.persistence)||r.unregister(Ut),null!=a&&a.endpoint&&(this.je=null==a?void 0:a.endpoint),this.qe=2===(null==a?void 0:a.version)&&(null==a?void 0:a.triggerGroups)&&a.triggerGroups.length>0?new Ti(this._instance,this.J,this.ke.bind(this),this.Ee.bind(this),this.Se.bind(this)):new Mi(this._instance,this.J,this.Y,this.K,this.ke.bind(this),this._e.bind(this),this.Se.bind(this)),this.qe.onRemoteConfig(a),null==(n=this.Ce)||n.call(this),this.Ce=this.qe.setupEventTriggerListeners(this._instance.on.bind(this._instance,"eventCaptured"),this.sessionId,((e,t)=>this.pr(e,t))),this.gr(Lt,(()=>{this.overrideSampling()}),(()=>{var e;return null==(e=this._instance.persistence)?void 0:e.unregister(Lt)})),this.gr(Ot,(()=>{this.overrideLinkedFlag()}),(()=>{var e;return null==(e=this._instance.persistence)?void 0:e.unregister(Ot)})),this.gr(Dt,(()=>{this.overrideTrigger("event")}),(()=>{var e;return null==(e=this._instance.persistence)?void 0:e.unregister(Dt)})),this.gr(Pt,(()=>{this.overrideTrigger("url")}),(()=>{var e;return null==(e=this._instance.persistence)?void 0:e.unregister(Pt)})),this.qe.makeSamplingDecisions(this.sessionId),this.yr(),this.et||(Ne(e,"beforeunload",this.Pt),Ne(e,"pagehide",this.jt),Ne(e,"offline",this.Bt),Ne(e,"online",this.Ht),Ne(i,"visibilitychange",this.$t),!this.kt&&k(this.Oe.onSessionId)&&(this.kt=this.Oe.onSessionId(this.xt)),!this._t&&k(this.Oe.on)?this._t=this.Oe.on("forcedIdleReset",(()=>{this.Tt(),this.ze="unknown",this.stop(),this.St=this.Oe.onSessionId(((e,t,r)=>{var i;null==(i=this.St)||i.call(this),this.St=void 0,this.xt(e,t,r)}))})):k(this.Oe.on)||tn.warn("bundled core has no SessionIdManager.on (requires posthog-js >= 1.268.6); recording will start but skip forced-idle-reset handling"),T(this.wt)&&(this.wt=this._instance.on("eventCaptured",(e=>{try{if("$pageview"===e.event){var t=null!=e&&e.properties.$current_url?this.Yt(e.properties.$current_url):"";if(!t)return;this.Ee("$pageview",{href:t})}}catch(e){tn.error("Could not add $pageview to rrweb session",e)}}))),this.status===Yt&&this.ke(t||"recording_initialized"))}else tn.info("remote config must be stored in persistence before recording can start")}br(){var t,r,n,a,o,s;null==e||e.removeEventListener("beforeunload",this.Pt),null==e||e.removeEventListener("pagehide",this.jt),null==e||e.removeEventListener("offline",this.Bt),null==e||e.removeEventListener("online",this.Ht),null==i||i.removeEventListener("visibilitychange",this.$t),clearInterval(this.hr),this.wr(),null==(t=this.wt)||t.call(this),this.wt=void 0,null==(r=this.Ce)||r.call(this),this.Ce=void 0,null==(n=this.kt)||n.call(this),this.kt=void 0,null==(a=this._t)||a.call(this),this._t=void 0,null==(o=this.St)||o.call(this),this.St=void 0,null==(s=this.qe)||s.stop(),this.kr(),this.mr()}mr(){this.yt+=1,this.vt=[],this.ft=0,this._r=void 0,this.bt=!1}kr(){var e,t,r;null==(e=this.Sr)||e.stop(),this.We=[],null==(t=this.ir)||t.stop(),this.ir=void 0,this.He=!1,null==(r=this.Be)||r.call(this),this.Be=void 0}Cr(){if(!this._r||0===this.ft)return!1;if(this.bt)return!0;this.bt=!0;var e=this.yt;return this.wr(),this.kr(),this._r.catch((()=>{})).then((()=>{e===this.yt&&(this.bt=!1,this.Nt(),this.qt(),this.br(),tn.info("stopped"))})).catch((()=>{this.bt=!1,this.br(),tn.info("stopped")})),!0}stop(){this.kr(),this.Cr()||(this.Nt(),this.qt(),this.br(),tn.info("stopped"))}It(e){var t;this.stop(),this.Mr=void 0,this.Tr=void 0,this.Ze=0,this.Ge=0,this.Qe=0,null==(t=an())||null==t.resetSnapshotCostState||t.resetSnapshotCostState(),this.start("session_id_changed"),this.Je=e,this.Ye=!1}cr(){this.isStarted||(this.Xe=!0),this.Je&&(this.Je=!1,this.Ye=!1,this.Ke&&(this.Ke=!1,this._e()),this.Ir())}discard(){this.qt(),this.br(),tn.info("discarded")}Er(e,t,r,i,n){var a={$snapshot_bytes:r,$snapshot_data:t,$session_id:i,$window_id:n};this.status!==Qt?(this.Rr(e,i),this.Ar(a)):this.qt()}Lr(){try{this.Or()}catch(e){this.it||(this.it=!0,tn.error("could not track full snapshot cost",e))}}Or(){var e,t=null==(e=an())||null==e.getLastSnapshotCost?void 0:e.getLastSnapshotCost();t&&t!==this.Tr&&(this.Tr=t,this.Mr&&this.Mr.durationMs>=t.durationMs||(this.Mr=t),500>t.durationMs||tn.warn("full snapshot was slow, the page may have been unresponsive while it ran",{durationMs:Math.round(t.durationMs),stylesheetMs:Math.round(t.stylesheetMs),nodeCount:t.nodeCount,cssRuleCount:t.cssRuleCount,nonDeferrableCssRuleCount:t.nonDeferrableCssRuleCount,deferredStylesheetCount:t.deferredStylesheetCount}))}Rr(e,t){e.type!==c.FullSnapshot?e.type===c.IncrementalSnapshot&&(S(this.ct)||this.ct===t||this.dt===t||(this.dt=t,tn.info("incremental snapshot for a session with no full snapshot - requesting one",{sessionId:t}),this._e())):this.ct=t}Pr(e){e.counted&&e.generation===this.yt&&(this.ft=Math.max(0,this.ft-1)),e.counted=!1,this.vt=this.vt.filter((t=>t!==e))}Dr(e,t,r){e.processed||e.generation!==this.yt||(e.processed=!0,this.Er(e.event,t,r,e.targetSessionId,e.targetWindowId))}Fr(e){try{var t=e.compressionEnabled?wn(e.event):{event:e.event,size:wr(e.event)};this.Dr(e,t.event,t.size)}finally{this.Pr(e)}}Ft(){[...this.vt].forEach((e=>{this.Fr(e)}))}Nr(e,t,r,i){var n=this,a={event:e,compressionEnabled:t,targetSessionId:r,targetWindowId:i,generation:this.yt,processed:!1,counted:!0};this.vt.push(a),this.ft+=1;var o=function(){var r=l((function*(){try{if(a.processed)return;var r,i;try{var o=t?gn(e)?yield function(e){return kn.apply(this,arguments)}(e):wn(e):{event:e,size:wr(e)};r=o.event,i=o.size}catch(t){tn.error("could not process queued compression event - will use uncompressed event",t),r=e,i=wr(e)}n.Dr(a,r,i)}finally{n.Pr(a)}}));return function(){return r.apply(this,arguments)}}();this._r=this._r?this._r.catch((()=>{})).then(o):o()}onRRwebEmit(e){var t,r,i,n,a,o,s,u,l;if(this._instance.sessionManager&&(this.sr(),e&&_(e))){if(e.type===c.Meta){var h=this.Yt(e.data.href);if(this.ar=h,!h)return;e.data.href=h}else this.nr();if(null==(t=this.qe)||t.checkUrlTriggers(this.sessionId,(()=>this.dr()),(()=>this.vr()),((e,t)=>this.pr(e,t))),!this.J.urlBlocked||function(e){return e.type===c.Custom&&"recording paused"===e.data.tag}(e)){var v,f,p;e.type===c.FullSnapshot&&(null!=(v=an())&&null!=v.wasMaxDepthReached&&v.wasMaxDepthReached()&&(this.rt=!0),this.Lr(),Promise.resolve().then((()=>this.Lr())),this.lr(),null==(f=this.Sr)||f.reset(),null==(p=this._instance.persistence)||p.register_once({[Ut]:e.timestamp},void 0));var g=e.type===c.FullSnapshot&&(null==(r=this.qe)?void 0:r.hasPendingTriggers(this.sessionId));g&&this.qr();var m=this.Sr?this.Sr.throttleMutations(e):e;if(m){var y=function(e){var t=e;if(t&&_(t)&&6===t.type&&_(t.data)&&"rrweb/console@1"===t.data.plugin){t.data.payload.payload.length>10&&(t.data.payload.payload=t.data.payload.payload.slice(0,10),t.data.payload.payload.push("...[truncated]"));for(var r=[],i=0;t.data.payload.payload.length>i;i++)r.push(t.data.payload.payload[i]&&t.data.payload.payload[i].length>2e3?t.data.payload.payload[i].slice(0,2e3)+"...[truncated]":t.data.payload.payload[i]);return t.data.payload.payload=r,e}return e}(m),b=function(e){return xn(e)?e.data.payload:null}(y),w=function(e){return Cn(e)?e.data.payload:null}(y),k=function(e){return Sn(e)?e.data.payload:null}(y);b||w?null!=b&&b.lastActivityTimestamp&&(y.timestamp=b.lastActivityTimestamp):null!=k&&k.sessionId||this.jr(y),e.type===c.FullSnapshot&&(this.ht.push([this.Le,e.timestamp]),this.ht.length>6&&(this.ht=this.ht.slice(-6)));var S=null!==(i=null!==(n=null!==(a=null==b?void 0:b.currentSessionId)&&void 0!==a?a:null==w?void 0:w.nextSessionId)&&void 0!==n?n:null==k?void 0:k.sessionId)&&void 0!==i?i:this.Le,x=null!==(o=null!==(s=null!==(u=null==b?void 0:b.currentWindowId)&&void 0!==u?u:null==w?void 0:w.nextWindowId)&&void 0!==s?s:null==k?void 0:k.windowId)&&void 0!==o?o:this.Ct;if(!0!==this.ze||function(e){return Sn(e)||xn(e)||Cn(e)}(y)){y.type===c.FullSnapshot&&(this.Ve=0),k&&(y.timestamp=k.lastActivityTimestamp+k.threshold);var C=this.He;this.He=!0,g?this.rr(!0):C||this.rr();var M=null===(l=this._instance.config.session_recording.compress_events)||void 0===l||l;if(this.ft>0||M&&gn(y))this.Nr(y,M,S,x);else{var T=M?wn(y):{event:y,size:wr(y)};this.Er(y,T.event,T.size,S,x)}}else(function(e){return e.type===c.FullSnapshot||e.type===c.Meta||e.type===c.IncrementalSnapshot&&e.data.source!==d.CanvasMutation})(y)&&this.Ve++}else!0===this.ze&&this.Ve++}}}get status(){return this.qe?this.qe.getStatus({instance:this._instance,sessionId:this.sessionId,isSampled:this.De,rrwebError:this.et,urlTriggerMatching:this.J,eventTriggerMatching:this.Y,linkedFlagMatching:this.K,remoteConfig:this.Fe}):Qt}log(e,t){var r;void 0===t&&(t="log"),null==(r=this._instance.sessionRecording)||r.onRRwebEmit({type:6,data:{plugin:"rrweb/console@1",payload:{level:t,trace:[],payload:[JSON.stringify(e)]}},timestamp:Date.now()})}overrideLinkedFlag(){this.K.linkedFlagSeen=!0,this._e(),this.cr(),this.ke("linked_flag_overridden")}overrideSampling(){var e;null==(e=this._instance.persistence)||e.register({[Ft]:this.sessionId,[At]:null}),this._e(),this.cr(),this.ke("sampling_overridden")}overrideTrigger(e){this.pr(e),this.cr()}Br(){try{var t,r=null==e||null==(t=e.location)?void 0:t.href;if(!r)return;var i=this.Yt(r);if(!i)return;return new URL(i).hostname||void 0}catch(e){return}}wr(){this.Hr&&(clearTimeout(this.Hr),this.Hr=void 0)}Ir(){this.Hr||(this.Hr=setTimeout((()=>{this.Nt()}),2e3))}$r(){return this.ct!==this.At.sessionId&&0!==this.At.data.length&&this.At.data.every((e=>(null==e?void 0:e.type)===c.Custom&&!xn(e)&&!Cn(e)))}Ur(){var e,t;return null!==(e=null==(t=this.qe)?void 0:t.getPendingTriggerConditions(this.sessionId))&&void 0!==e?e:[]}Wr(e){if(e!==Kt)return S(this.zr)||this._instance.register_for_session({[Zt]:[]}),void(this.zr=void 0);var t=this.Ur();if(0===t.length)return S(this.zr)||this._instance.register_for_session({[Zt]:[]}),void(this.zr=void 0);var r=t.join(", "),i=this.sessionId+":"+r;i!==this.zr&&(this.zr=i,this._instance.register_for_session({[Zt]:t}),tn.info("buffering: "+r))}Nt(){var e;if(this.wr(),this.Je)return this.At;if(this.$r())return this.At.size>Xi?this.qt():this.At;var t=this.At;null==(e=this.qe)||e.ensureSamplingDecision(this.sessionId);var r=this.Lt(),i=this.status;if(this.Wr(i),i===Kt||i===Xt||i===Qt||r)return this.Ir(),this.At;if(this.At!==t)return this.At;if(t.data.length>0){var n,a=this.Br();_r(t).forEach((e=>{var t;null==(t=this.Mt)||t.trackSize(e.sessionId,e.size),this.Vr({$snapshot_bytes:e.size,$snapshot_data:e.data,$session_id:e.sessionId,$window_id:e.windowId,$lib:Re.LIB_NAME,$lib_version:Re.LIB_VERSION,$snapshot_host:a})})),null==(n=this.qe)||n.onFlushComplete()}return this.qt()}Ar(e){var t,r=2+((null==(t=this.At)?void 0:t.data.length)||0),i=e.$session_id,n=this.At.sessionId!==i;if(n||!0!==this.ze&&!this.Je&&this.At.size+e.$snapshot_bytes+r>Xi){var a=this.Le;if(this.At=this.Nt(),this.Le!==a)return;n&&this.At.data.length>0&&(this.At=this.qt()),this.At.sessionId=i,this.At.windowId=e.$window_id}this.Je&&(this.Ke||this.At.size+e.$snapshot_bytes+r>Xi)?this.Ke||(this.Ke=!0,this.At=this.qt()):(this.At.size+=e.$snapshot_bytes,this.At.data.push(e.$snapshot_data),this.At.sizes.push(e.$snapshot_bytes),!0===this.ze||this.Je||this.Ir())}Vr(e){this._instance.capture("$snapshot",e,{_url:this._instance.requestRouter.endpointFor("api",this.je),_noTruncate:!0,_batchKey:"recordings",skip_client_rate_limiting:!0})}get Ot(){var e,t,r=null==(e=this.At)?void 0:e.data[(null==(t=this.At)?void 0:t.data.length)-1],i=this.Oe.checkAndGetSessionAndWindowId(!0);return r?r.timestamp-i.sessionStartTimestamp:null}qr(){if(!this.At||0===this.At.data.length)return this.qt();for(var e=-1,t=this.At.data.length-1;t>=0;t--)if(this.At.data[t].type===c.Meta){e=t;break}return 0>e?this.qt():(this.At.data=this.At.data.slice(e),this.At.sizes=this.At.sizes.slice(e),this.At.size=this.At.sizes.reduce(((e,t)=>e+t),0),this.At)}qt(){return this.At={size:0,data:[],sizes:[],sessionId:this.Le,windowId:this.Ct},this.At}ke(e,t){this._instance.register_for_session({$session_recording_start_reason:e}),tn.info(e.replace("_"," "),t),"session_id_changed"!==e&&this.Ee("$recording_started",h({reason:e},t))}Zr(e){var t;return 3===e.type&&-1!==rn.indexOf(null==(t=e.data)?void 0:t.source)}jr(e){var t=this.Zr(e);t||!0===this.ze||e.timestamp-this.$e>this.Pe&&(this.ze=!0,clearInterval(this.hr),this.Ee("sessionIdle",{eventTimestamp:e.timestamp,lastActivityTimestamp:this.$e,threshold:this.Pe,bufferLength:this.At.data.length,bufferSize:this.At.size,sessionId:this.Le,windowId:this.Ct}),this.Nt());var r=!1;if(t&&(this.$e=e.timestamp,this.ze)){var i="unknown"===this.ze;this.ze=!1,i||(this.Ee("sessionNoLongerIdle",{reason:"user activity",type:e.type}),r=!0)}var n=this.Oe.checkAndGetSessionAndWindowId(!t,e.timestamp),a=n.windowId,o=n.sessionId,s=this.Le!==o,u=this.Ct!==a;if(this.Ct=a,this.Le=o,s||u){var l=s&&!1!==this.ze;l&&(this.ze="unknown"),this.It(l)}else if(t&&this.cr(),r){var h,c=["sampled","active"].includes(this.status)||(null==(h=this.qe)?void 0:h.hasPendingTriggers(this.sessionId));this.Ve>0&&c&&this._e(),this.rr(),this.lr()}}Tt(){var e;null==(e=this.qe)||e.clearConditionalRecordingPersistence()}get sdkDebugProperties(){var e,t,r,i,n,a,o,s,u,l=this.Oe.checkAndGetSessionAndWindowId(!0).sessionStartTimestamp,h=null==(e=an())||null==e.getDeferredStylesheetStats?void 0:e.getDeferredStylesheetStats();return{$recording_status:this.status,$sdk_debug_replay_internal_buffer_length:this.At.data.length,$sdk_debug_replay_internal_buffer_size:this.At.size,$sdk_debug_current_session_duration:this.Ot,$sdk_debug_session_start:l,$sdk_debug_replay_flushed_size:null==(t=this.Mt)?void 0:t.currentTrackedSize(this.sessionId),$sdk_debug_replay_full_snapshots:this.ht,$snapshot_max_depth_exceeded:this.rt,$sdk_debug_replay_slowest_full_snapshot_ms:Qi(null==(r=this.Mr)?void 0:r.durationMs),$sdk_debug_replay_slowest_full_snapshot_stylesheet_ms:Qi(null==(i=this.Mr)?void 0:i.stylesheetMs),$sdk_debug_replay_slowest_full_snapshot_nodes:null==(n=this.Mr)?void 0:n.nodeCount,$sdk_debug_replay_slowest_full_snapshot_css_rules:null==(a=this.Mr)?void 0:a.cssRuleCount,$sdk_debug_replay_slowest_full_snapshot_css_rules_non_deferrable:null==(o=this.Mr)?void 0:o.nonDeferrableCssRuleCount,$sdk_debug_replay_deferred_stylesheets:null==h?void 0:h.deferredCount,$sdk_debug_replay_deferred_stylesheets_failed:null==h?void 0:h.failedCount,$sdk_debug_replay_deferred_stylesheets_abandoned:null==h?void 0:h.abandonedCount,$sdk_debug_replay_deferred_stylesheet_ms:Qi(null==h?void 0:h.totalMs),$sdk_debug_replay_deferred_stylesheet_slowest_slice_ms:Qi(null==h?void 0:h.slowestSliceMs),$sdk_debug_replay_slowest_mutation_batch_ms:Qi(null==(s=an())||null==s.getMutationCost||null==(s=s.getMutationCost())?void 0:s.slowestBatchMs),$sdk_debug_replay_discarded_duration_samples:null==(u=an())||null==u.getDiscardedDurationSamples?void 0:u.getDiscardedDurationSamples(),$sdk_debug_replay_throttled_mutations_dropped:this.Ze,$sdk_debug_replay_oversized_mutations_dropped:this.Ge,$sdk_debug_replay_oversized_mutation_bytes_dropped:this.Qe,$sdk_debug_replay_rrweb_error:this.et,$sdk_debug_rrweb_attached:!!this.Be,$sdk_debug_rrweb_start_attempted:this.tt}}yr(){var t;if(!this.Be){this.tt=!0;var r,n,a,o,s={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},u=this._instance.config.session_recording;for(var l of Object.entries(u||{})){var c=l[0],d=l[1];if(c in s)if("maskInputOptions"===c)s.maskInputOptions=h({password:!0},d);else if("sampling"===c){var v=null!=d?d:{},f={};S(v.mousemove)||(f.mousemove=v.mousemove),S(v.mouseInteraction)||(f.mouseInteraction=v.mouseInteraction),s.sampling=f}else s[c]=d}!0===(null==u?void 0:u.captureJsonLd)&&!0!==s.slimDOMOptions&&"all"!==s.slimDOMOptions&&(s.slimDOMOptions=h({},s.slimDOMOptions,{script:!0})),this.Vt&&this.Vt.enabled&&(s.recordCanvas=!0,s.sampling=h({},s.sampling,{canvas:this.Vt.fps}),s.dataURLOptions={type:"image/webp",quality:this.Vt.quality},s.canvasResolutionScale=this.zt,s.canvasMasking={configured:()=>{var e;return k(null==(e=this._instance.config.session_recording)||null==(e=e.canvasCapture)?void 0:e.maskRegionsFn)},regionsFn:e=>{var t,r=null==(t=this._instance.config.session_recording)||null==(t=t.canvasCapture)?void 0:t.maskRegionsFn;if(k(r))try{var i;return null!==(i=r(e))&&void 0!==i?i:null}catch(e){return this.st||(this.st=!0,tn.warn("canvasCapture.maskRegionsFn threw, canvas frames will be skipped",e)),null}}}),this.Ut&&(s.maskAllInputs=null===(r=this.Ut.maskAllInputs)||void 0===r||r,s.maskTextSelector=null!==(n=this.Ut.maskTextSelector)&&void 0!==n?n:void 0,s.blockSelector=null!==(a=this.Ut.blockSelector)&&void 0!==a?a:void 0,s.maskAllElementAttributes=null!==(o=this.Ut.maskAllElementAttributes)&&void 0!==o&&o),s.maskAllElementAttributes&&s.maskAttributeFn&&(s.maskAttributeFn=void 0,this.ot||(this.ot=!0,tn.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.Wt();var p=on();if(p){this.Sr=null!==(t=this.Sr)&&void 0!==t?t:new ai(p,{refillRate:this._instance.config.session_recording.__mutationThrottlerRefillRate,bucketSize:this._instance.config.session_recording.__mutationThrottlerBucketSize,onBlockedNode:(e,t)=>{var r="Too many mutations on node '"+e+"'. Rate limiting. This could be due to SVG animations or something similar";tn.info(r,{node:t}),this.log(en+" "+r,"warn")},onDroppedAttributeMutations:e=>this.Ze+=e,bytesRefillRate:this._instance.config.session_recording.__mutationBytesRefillRate,bytesBucketSize:this._instance.config.session_recording.__mutationBytesBucketSize,resyncIntervalMs:this.ur,onDroppedOversizedMutation:e=>{0===this.Ge&&this.log(en+" Dropped an oversized DOM mutation to keep the recording playable. The recording will resync with a full snapshot.","warn"),this.Ge+=1,this.Qe+=e},requestFullSnapshot:()=>this._e()});var g=this.Qt();if(this.Be=p(h({emit:e=>{this.onRRwebEmit(e)},plugins:g,errorHandler:(e,t)=>"rrweb"===t&&(this.ut||(this.ut=!0,tn.error("rrweb internal error - recording will continue but may be incomplete",e)),!0)},s)),!this.Be)return this.et=!0,void tn.error("rrweb failed to start - Loss of recording data is possible. Check the browser console for rrweb errors.");this.et=!1,!0===(null==u?void 0:u.captureJsonLd)&&i&&null!=e&&e.MutationObserver&&!this.ir&&(this.ir=function(e,t,r){var i=new WeakMap,n=r.getCaptureState||(()=>!0),a=Ei,o=t=>{try{var o=n();if(!a||!1===o||!t.isConnected||t.ownerDocument!==e||function(e,t){for(var r=e;r;){if(Zi(r,t.blockClass,t.blockSelector)||Zi(r,t.maskTextClass,t.maskTextSelector))return!0;var i=r.parentNode;r=r.parentElement||(i&&i.nodeType===i.DOCUMENT_FRAGMENT_NODE?i.host:null)}return!1}(t,r))return;var s=function(e){if(!e||e.length>Ei)return null;try{var t=JSON.parse(e),r=w(t)?t.map(zi):zi(t);if(M(r)||w(r)&&(!r.length||r.some(M)))return null;var i=JSON.stringify(r);return i.length>2e4?null:[r,i]}catch(e){return null}}(t.text);if(!s)return void i.delete(t);var u=s[0],l=s[1];if(M(o))return void i.set(t,l);if(i.get(t)!==l){if(l.length>a)return void(a=0);r.emit(u)&&(i.set(t,l),a-=l.length)}}catch(e){return}};try{var s=new t((e=>{try{if(!a||!1===n())return;var t=e=>{for(var t of Gi(e))o(t)};for(var r of e)if("childList"===r.type)Vi(r.target)&&o(r.target),r.addedNodes.forEach(t);else if("characterData"===r.type){var i=r.target.parentNode;i&&Vi(i)&&o(i)}else"attributes"===r.type&&Vi(r.target)&&o(r.target)}catch(e){return}}));return s.observe(e,{attributes:!0,attributeFilter:["type"],characterData:!0,childList:!0,subtree:!0}),{scan(t){void 0===t&&(t=!1),a&&!1!==n()&&Gi(e.documentElement).forEach((e=>{t&&i.delete(e),o(e)}))},stop(){return s.disconnect()}}}catch(e){return{scan(){},stop(){}}}}(i,e.MutationObserver,{blockClass:s.blockClass,blockSelector:s.blockSelector,maskTextClass:s.maskTextClass,maskTextSelector:s.maskTextSelector,getCaptureState:()=>{var e;return!0!==(null==(e=this._instance.config.session_recording)?void 0:e.captureJsonLd)||this.J.urlBlocked||this.J.isCurrentUrlBlocked()?null:this.er()},emit:e=>this.tr(e)}),this.J.isCurrentUrlBlocked()&&this.ir.scan()),this.$e=Date.now(),this.ze=E(this.ze)?this.ze:"unknown",this.tryAddCustomEvent("$remote_config_received",this.Fe),this.Ee("$session_options",{sessionRecordingOptions:s,activePlugins:g.map((e=>null==e?void 0:e.name))}),this.Ee("$posthog_config",{config:this._instance.config})}else tn.error("_startRecorder was called but rrwebRecord is not available. This indicates something has gone wrong.")}}tryAddCustomEvent(e,t){return this.Ee(e,t)}}var Tn,In=["type"],En=Object.defineProperty,Rn=(e,t,r)=>((e,t,r)=>t in e?En(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),An=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(An||{}),Ln=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(Ln||{}),On=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(On||{}),Pn=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(Pn||{}),Dn=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(Dn||{}),Fn=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e[e.RateChange=4]="RateChange",e))(Fn||{}),Nn=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(Nn||{});function qn(e,t){return-1!==e.indexOf(t)}var jn={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot"],MutationObserver:[]},Bn={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:["querySelector","querySelectorAll"],MutationObserver:["constructor"]},Hn={};function $n(e){if(Hn[e])return Hn[e];var t=function(e){var t,r,i=null==(r=null==(t=null==globalThis?void 0:globalThis.Zone)?void 0:t.__symbol__)?void 0:r.call(t,e);return i&&globalThis[i]?globalThis[i]:void 0}(e)||globalThis[e],r=t.prototype,i=e in jn?jn[e]:void 0,n=Boolean(i&&i.every((e=>{var t,i;return Boolean(null==(i=null==(t=Object.getOwnPropertyDescriptor(r,e))?void 0:t.get)?void 0:i.toString().includes("[native code]"))}))),a=e in Bn?Bn[e]:void 0,o=Boolean(a&&a.every((e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))})));if(n&&o)return Hn[e]=t.prototype,t.prototype;var s=document.createElement("iframe");s.style.display="none";var u=!1;try{document.body.appendChild(s);var l=s.contentWindow;if(!l)return t.prototype;var h=l[e].prototype;return h?(function(e){return qn(e,"AppleWebKit")&&!qn(e,"Chrome")}(navigator.userAgent)&&(s.classList.add("rr-block","ph-no-capture"),s.setAttribute("__rrwebUntaintedPrototype",e),u=!0),Hn[e]=h):r}catch(e){return r}finally{!u&&s.parentNode&&document.body.removeChild(s)}}var Un={};function Wn(e,t,r){var i,n=e+"."+String(r);if(Un[n])return Un[n].call(t);var a=$n(e),o=null==(i=Object.getOwnPropertyDescriptor(a,r))?void 0:i.get;return o?(Un[n]=o,o.call(t)):t[r]}var zn={};function Vn(e,t,r){var i=e+"."+String(r);if(zn[i])return zn[i].bind(t);var n=$n(e)[r];return"function"!=typeof n?t[r]:(zn[i]=n,n.bind(t))}function Zn(){return $n("MutationObserver").constructor}function Gn(e,t,r){try{if(!(t in e))return()=>{};var i=e[t],n={next:i},a=r((function(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];return n.next.apply(this,t)}));return"function"==typeof a&&(a.prototype=a.prototype||{},Object.defineProperties(a,{__rrweb_original__:{enumerable:!1,value:i},__rrweb_layer__:{enumerable:!1,value:n}})),e[t]=a,()=>{if(e[t]!==a)for(var r=e=>{var t;return"function"==typeof e?null!==(t=e.__rrweb_layer__)&&void 0!==t?t:e.__posthog_layer__:void 0},i=e[t],o=r(i);o;){if(o.next===a)return void(o.next=n.next);o=r(i=o.next)}else e[t]=n.next}}catch(e){return()=>{}}}var Qn={childNodes:e=>Wn("Node",e,"childNodes"),parentNode:e=>Wn("Node",e,"parentNode"),parentElement:e=>Wn("Node",e,"parentElement"),textContent:e=>Wn("Node",e,"textContent"),contains:(e,t)=>Vn("Node",e,"contains")(t),getRootNode:e=>Vn("Node",e,"getRootNode")(),host:e=>e&&"host"in e?Wn("ShadowRoot",e,"host"):null,styleSheets:e=>e.styleSheets,shadowRoot:e=>e&&"shadowRoot"in e?Wn("Element",e,"shadowRoot"):null,querySelector:(e,t)=>Vn("Element",e,"querySelector")(t),querySelectorAll:(e,t)=>Vn("Element",e,"querySelectorAll")(t),mutationObserver:Zn,patch:Gn},Jn=()=>({durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0});function Yn(){try{if("undefined"!=typeof performance&&performance.now)return performance.now()}catch(e){}return Date.now()}var Kn=0,Xn=6e4;function ea(){Kn+=1}function ta(){return Kn}function ra(e,t){return t!==Kn||e>Xn}var ia=0,na=0,aa=0,oa=Jn(),sa=null,ua=null,la=[],ha=0,ca=0,da={slowestBatchMs:0},va={deferredCount:0,failedCount:0,abandonedCount:0,totalMs:0,slowestSliceMs:0},fa=e=>e&&e>0?e:null;function pa(e){(ia+=1)>1||(oa=Jn(),la=[],ha=0,ua=fa(e),na=Yn(),aa=Kn)}function ga(){return 0===ia?sa||Jn():(ia-=1)>0?oa:(oa.durationMs=Yn()-na,oa.deferredStylesheetCount=ha,va.deferredCount+=ha,ua=null,ra(oa.durationMs,aa)?oa:sa=oa)}var ma=32;function ya(e,t,r){var i=e.length;if(r>=ma)return i;for(var n=0;e.length>n;n++){var a=e[n];try{var o=a.cssRules;if(o&&o.length)i+=ya(o,t,r+1);else if(t&&a.styleSheet){var s=a.styleSheet;if(!t.has(s)){t.add(s);var u=s.rules||s.cssRules;u&&(i+=ya(u,t,r+1))}}}catch(e){}}return i}function ba(e){if(0!==ia){var t=ya(e,null,0);oa.cssRuleCount+=t,ca>0&&(oa.nonDeferrableCssRuleCount+=t)}}function wa(e){ca+=1;try{return e()}finally{ca-=1}}function ka(e){ia>0&&(oa.stylesheetMs+=e)}function _a(e){if(0===ia||null===ua)return!1;var t=oa.cssRuleCount-oa.nonDeferrableCssRuleCount;return t>=ua||t+function(e){try{var t=e&&(e.rules||e.cssRules);if(!t)return 0;var r=new WeakSet;return r.add(e),ya(t,r,0)}catch(e){return 0}}(e)>ua}function Sa(){va.failedCount+=1}function xa(e){e>0&&(va.abandonedCount+=e)}function Ca(e){return e.nodeType===e.ELEMENT_NODE}function Ma(e){var t=e&&"host"in e&&"mode"in e&&Qn.host(e)||null;return Boolean(t&&"shadowRoot"in t&&Qn.shadowRoot(t)===e)}function Ta(e){return"[object ShadowRoot]"==={}.toString.call(e)}function Ia(e){return e.includes(" background-clip: text;")&&!e.includes(" -webkit-background-clip: text;")&&(e=e.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),e}function Ea(e){var t=e.cssText;if(3>t.split('"').length)return t;var r=["@import","url("+JSON.stringify(e.href)+")"];return""===e.layerName?r.push("layer"):e.layerName&&r.push("layer("+e.layerName+")"),e.supportsText&&r.push("supports("+e.supportsText+")"),e.media.length&&r.push(e.media.mediaText),r.join(" ")+";"}var Ra=0;function Aa(e){var t=0===Ra,r=t?Yn():0;Ra+=1;try{var i=e.rules||e.cssRules;if(!i)return null;ba(i);var n=e.href;return!n&&e.ownerNode&&(n=e.ownerNode.baseURI),Ia(Array.from(i,(e=>La(e,n))).join(""))}catch(e){return null}finally{Ra-=1,t&&ka(Yn()-r)}}function La(e,t){var r;if(Pa(e)){var i;try{i=Aa(e.styleSheet)||Ea(e)}catch(t){i=e.cssText}try{if(i&&(null==(r=e.styleSheet)?void 0:r.href))return Ja(i,e.styleSheet.href)}catch(e){}return i}var n=e.cssText;return Da(e)&&e.selectorText.includes(":")&&(n=Oa(n)),t?Ja(n,t):n}function Oa(e){return e.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")}function Pa(e){return"styleSheet"in e}function Da(e){return"selectorText"in e}var Fa=/^-?[A-Za-z_][\w-]*$/,Na=/^-?[A-Za-z_][\w-]*(\.-?[A-Za-z_][\w-]*)*$/;function qa(e){var t=[],r=!1,i=null,n=new Map;function a(e){var n=t.pop();if("group"===n.kind){if(null===e){for(;t.length>0&&"group"===t[t.length-1].kind;)t.pop();return void a(null)}var s=t[t.length-1];return s.parts.push(e),void(s.index+=1)}if(!n.importRule)return r=!0,void(i=e);o(t[t.length-1],n.importRule,e)}function o(e,t,r){var i;try{var n;try{n=r||Ea(t)}catch(e){n=t.cssText}try{n&&(null==(i=t.styleSheet)?void 0:i.href)&&(n=Ja(n,t.styleSheet.href))}catch(e){}n&&e.parts.push(n),e.index+=1}catch(e){a(null)}}function s(e){var r=e.rules[e.index];if("sheet"===e.kind&&Pa(r)){var i=n.get(r);return null===i?(e.parts.push(r.cssText),void(e.index+=1)):i?void t.push({kind:"sheet",sheet:i.sheet,rules:i.rules,sheetHref:i.sheetHref,index:0,parts:[],importRule:r}):void o(e,r,null)}if(!function(e,r){try{var i=function(e){var t,r=e;if(!r.cssRules||0===r.cssRules.length)return null;if(r.media&&"string"==typeof r.media.mediaText)return"@media "+r.media.mediaText+" {";if(Da(e)){if("number"==typeof r.type&&1!==r.type)return null;var i=r.style?r.style.cssText:"";return e.selectorText+" {"+(i?" "+i:"")}if("containerName"in r)return"string"!=typeof r.containerQuery||r.containerName&&!Fa.test(r.containerName)?null:"@container "+(r.containerName?r.containerName+" ":"")+r.containerQuery+" {";if("string"==typeof r.conditionText){var n="";try{n=(null==(t=e.constructor)?void 0:t.name)||""}catch(e){return null}return""===n||"Object"===n||"CSSSupportsRule"===n?"@supports "+r.conditionText+" {":null}return"string"==typeof r.name?"keyText"in r.cssRules[0]?Fa.test(r.name)?"@keyframes "+r.name+" {":null:""===r.name?"@layer {":Na.test(r.name)?"@layer "+r.name+" {":null:null}(e);if(null===i)return!1;var n=r.sheetHref;return t.push({kind:"group",rules:Array.from(e.cssRules),sheetHref:n,index:0,parts:[],prelude:n?Ja(i,n):i,fixColons:"sheet"===r.kind&&Da(e)&&e.selectorText.includes(":")}),!0}catch(e){return!1}}(r,e)){var a=r.cssText;"sheet"===e.kind&&Da(r)&&r.selectorText.includes(":")&&(a=Oa(a)),e.parts.push(e.sheetHref?Ja(a,e.sheetHref):a),e.index+=1}}return function(e){try{var r=e.rules||e.cssRules;if(!r)return!1;ba(r);var i=e.href;!i&&e.ownerNode&&(i=e.ownerNode.baseURI);var a=Array.from(r);return t.push({kind:"sheet",sheet:e,rules:a,sheetHref:i,index:0,parts:[],importRule:null}),function(e,t){for(var r=[{sheet:t,rules:e,index:0}],i=function(){var e=r[r.length-1];if(e.index>=e.rules.length)return r.pop(),0;var t=e.rules[e.index];if(e.index+=1,!Pa(t)||n.has(t))return 0;var i=null;try{i=t.styleSheet}catch(e){return n.set(t,null),0}if(!i||r.some((e=>e.sheet===i)))return 0;try{var a=i.rules||i.cssRules;if(!a)return 0;ba(a);var o=i.href;!o&&i.ownerNode&&(o=i.ownerNode.baseURI);var s=Array.from(a);n.set(t,{sheet:i,rules:s,sheetHref:o}),r.push({sheet:i,rules:s,index:0})}catch(e){}};r.length>0;)i()}(a,e),!0}catch(e){return!1}}(e)||(r=!0),{advance(e){if(r)return!0;var n=Yn(),o=e>0?e:1;try{for(;!r&&o>0;){var u=t[t.length-1];if(u.rules.length>u.index){o-=1;try{s(u)}catch(e){a(null)}}else{var l=null;try{if("group"===u.kind){var h=u.prelude+u.parts.join("")+"}";l=u.fixColons?Oa(h):h}else l=Ia(u.parts.join(""))}catch(e){}a(l)}}}catch(e){r=!0,i=null}finally{ka(Yn()-n)}return r},text:()=>r?i:null,remainingRules(){if(r)return 0;var e=0;for(var i of t)e+=i.rules.length-i.index;return e}}}class ja{constructor(){Rn(this,"idNodeMap",new Map),Rn(this,"nodeMetaMap",new WeakMap)}getId(e){var t;if(!e)return-1;var r=null==(t=this.getMeta(e))?void 0:t.id;return null!=r?r:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){var t=this.getId(e);if(this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach((e=>this.removeNodeFromMap(e))),Ca(e)){var r=Qn.shadowRoot(e);r&&this.removeNodeFromMap(r),"IFRAME"===e.nodeName&&e.contentDocument&&this.removeNodeFromMap(e.contentDocument)}}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){this.idNodeMap.set(t.id,e),this.nodeMetaMap.set(e,t)}replace(e,t){var r=this.getNode(e);if(r){var i=this.nodeMetaMap.get(r);i&&this.nodeMetaMap.set(t,i)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function Ba(e){var t=e.element,r=e.maskInputOptions,i=e.tagName,n=e.type,a=e.maskInputFn,o=e.value||"",s=n&&Ha(n);return(r[i.toLowerCase()]||s&&r[s])&&(o=a?a(o,t):"*".repeat(o.length)),o}function Ha(e){return e.toLowerCase()}var $a=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 Ua(e){var t=e.element,r=e.name,i=e.value,n=e.maskAttributeFn,a=e.isGenerated;return i?e.maskAllElementAttributes?void 0!==a&&a&&$a.has(Ha(r))?i:"*".repeat(i.length):n?n(r,i,t):i:i}var Wa="__rrweb_original__";function za(e){try{var t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?Ha(t):null}catch(e){return null}}var Va=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,Za=/^(?:[a-z+]+:)?\/\//i,Ga=/^www\..*/i,Qa=/^(data:)([^,]*),(.*)/i;function Ja(e,t){return(e||"").replace(Va,((e,r,i,n,a,o)=>{var s,u=i||a||o,l=r||n||"";if(!u)return e;if(Za.test(u)||Ga.test(u))return"url("+l+u+l+")";if(Qa.test(u))return"url("+l+u+l+")";if("/"===u[0])return"url("+l+(((s=t).indexOf("//")>-1?s.split("/").slice(0,3).join("/"):s.split("/")[0]).split("?")[0]+u)+l+")";var h=t.split("/"),c=u.split("/");for(var d of(h.pop(),c))"."!==d&&(".."===d?h.pop():h.push(d));return"url("+l+h.join("/")+l+")"}))}var Ya,Ka,Xa="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxkZWZzPgogICAgPHBhdHRlcm4gaWQ9InN0cmlwZXMiIHBhdHRlcm5Vbml0cz0idXNlclNwYWNlT25Vc2UiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+CiAgICAgIDxyZWN0IHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgZmlsbD0iYmxhY2siLz4KICAgICAgPHBhdGggZD0iTTggMEgxNkwwIDE2VjhMOCAwWiIgZmlsbD0iIzJEMkQyRCIvPgogICAgICA8cGF0aCBkPSJNMTYgOFYxNkg4TDE2IDhaIiBmaWxsPSIjMkQyRDJEIi8+CiAgICA8L3BhdHRlcm4+CiAgPC9kZWZzPgogIDxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjc3RyaXBlcykiLz4KPC9zdmc+Cg==",eo=4096,to=1e5,ro=10,io=new Map,no=1,ao=new RegExp("[^a-z0-9-_:]"),oo=-2;function so(){return no++}var uo=/^[^ \t\n\r\u000c]+/,lo=/^[, \t\n\r\u000c]+/,ho=new WeakMap;function co(e,t){return t&&""!==t.trim()?vo(e,t):t}function vo(e,t){var r=ho.get(e);if(r||(r=e.createElement("a"),ho.set(e,r)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return r.setAttribute("href",t),r.href}function fo(e,t){return(null==t?void 0:t.maxBase64ImageLength)?function(e,t){return t&&e.length>t?Xa:e}(e,t.maxBase64ImageLength):e}function po(e,t,r,i,n,a){var o;if(!i)return i;if("src"===r||"href"===r&&("use"!==t||"#"!==i[0])){if("link"===t&&n){var s=null==(o=n.sheet)?void 0:o.href;if(s)return s}var u=co(e,i);if(u.startsWith("data:")){if("img"===t&&n){var l=u;return((null==a?void 0:a.type)||void 0!==(null==a?void 0:a.quality))&&(l=function(e,t,r,i){if(to>t.length)return t;if(!e.complete||0===e.naturalWidth)return t;if(e.naturalWidth>eo||e.naturalHeight>eo)return t;var n=io.get(t);if(n&&n.type===r&&n.quality===i)return n.result;try{var a=document.createElement("canvas");a.width=e.naturalWidth,a.height=e.naturalHeight;var o=a.getContext("2d");if(!o)return t;o.drawImage(e,0,0);var s=a.toDataURL(r||"image/webp",null!=i?i:.4),u=t.length>s.length?s:t;if(io.size>=ro){var l=io.keys().next().value;void 0!==l&&io.delete(l)}return io.set(t,{type:r,quality:i,result:u}),u}catch(e){return t}}(n,u,a.type,a.quality)),fo(l,a)}if("image"===t)return fo(u,a)}return u}if("xlink:href"===r&&"#"!==i[0]){var h=co(e,i);return"image"===t&&h.startsWith("data:")?fo(h,a):h}return"background"!==r||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===r?function(e,t){if(""===t.trim())return t;var r=0;function i(e){var i,n=e.exec(t.substring(r));return n?(r+=(i=n[0]).length,i):""}for(var n=[];i(lo),t.length>r;){var a=i(uo);if(","===a.slice(-1))a=co(e,a.substring(0,a.length-1)),n.push(a);else{var o="";a=co(e,a);for(var s=!1;;){var u=t.charAt(r);if(""===u){n.push((a+o).trim());break}if(s)")"===u&&(s=!1);else{if(","===u){r+=1,n.push((a+o).trim());break}"("===u&&(s=!0)}o+=u,r+=1}}}return n.join(", ")}(e,i):"style"===r?Ja(i,vo(e)):"object"===t&&"data"===r?co(e,i):i:co(e,i)}function go(e,t,r){return("video"===e||"audio"===e)&&"autoplay"===t}function mo(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&mo(Qn.parentNode(e),t,r);for(var i=e.classList.length;i--;)if(t.test(e.classList[i]))return!0;return!!r&&mo(Qn.parentNode(e),t,r)}function yo(e,t,r,i){var n;if(Ca(e)){if(!Qn.childNodes(n=e).length)return!1}else{if(null===Qn.parentElement(e))return!1;n=Qn.parentElement(e)}try{if("string"==typeof t){if(i){if(n.closest("."+t))return!0}else if(n.classList.contains(t))return!0}else if(mo(n,t,i))return!0;if(r)if(i){if(n.closest(r))return!0}else if(n.matches(r))return!0}catch(e){}return!1}function bo(e,t,r){var i=e.removeEventListener;"function"==typeof i&&i.call(e,t,r)}var wo=new Map;function ko(e,t){return Array.from(e.styleSheets).find((e=>e.href===t))}function _o(e){return null==e?"":e.toLowerCase()}var So=50,xo=!1,Co=!1;function Mo(e,t){var r=t.doc,i=t.mirror,n=t.blockClass,a=t.blockSelector,o=t.maskTextClass,s=t.maskTextSelector,u=t.skipChild,l=void 0!==u&&u,h=t.inlineStylesheet,c=void 0===h||h,d=t.maskInputOptions,v=void 0===d?{}:d,f=t.maskTextFn,p=t.maskInputFn,g=t.maskAllElementAttributes,m=void 0!==g&&g,y=t.maskAttributeFn,b=t.slimDOMOptions,w=t.dataURLOptions,k=void 0===w?{}:w,_=t.inlineImages,S=void 0!==_&&_,x=t.recordCanvas,C=void 0!==x&&x,M=t.canvasMaskingConfigured,T=t.onSerialize,I=t.onIframeLoad,E=t.iframeLoadTimeout,R=void 0===E?5e3:E,A=t.onIframeListenerRegistered,L=t.onStylesheetLoad,O=t.stylesheetLoadTimeout,P=void 0===O?5e3:O,D=t.keepIframeSrcFn,F=void 0===D?()=>!1:D,N=t.newlyAddedElement,q=void 0!==N&&N,j=t.depth,B=void 0===j?0:j,H=t.maxDepth,U=void 0===H?So:H,W=t.needsMask,z=t.preserveWhiteSpace,V=void 0===z||z;if(B>=U)return Co=!0,xo||(xo=!0,console.warn("[rrweb-snapshot] DOM tree depth exceeded max depth of "+U+". Children beyond this depth will not be recorded. This may indicate deeply nested DOM structures.")),null;W||(W=yo(e,o,s,void 0===W)),ia>0&&(oa.nodeCount+=1);var Z,G=function(e,t){var r=t.doc,i=t.blockClass,n=t.blockSelector,a=t.needsMask,o=t.inlineStylesheet,s=t.maskInputOptions,u=void 0===s?{}:s,l=t.maskTextFn,h=t.maskInputFn,c=t.maskAllElementAttributes,d=void 0!==c&&c,v=t.maskAttributeFn,f=t.dataURLOptions,p=void 0===f?{}:f,g=t.inlineImages,m=t.recordCanvas,y=t.canvasMaskingConfigured,b=t.keepIframeSrcFn,w=t.newlyAddedElement,k=void 0!==w&&w,_=function(e,t){if(t.hasNode(e)){var r=t.getId(e);return 1===r?void 0:r}}(r,t.mirror);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:Nn.Document,childNodes:[],compatMode:e.compatMode}:{type:Nn.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:Nn.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:_};case e.ELEMENT_NODE:return function(e,t){for(var r,i,n,a=t.doc,o=t.inlineStylesheet,s=t.maskInputOptions,u=void 0===s?{}:s,l=t.maskInputFn,h=t.maskAllElementAttributes,c=void 0!==h&&h,d=t.maskAttributeFn,v=t.dataURLOptions,f=void 0===v?{}:v,p=t.inlineImages,g=t.recordCanvas,m=t.canvasMaskingConfigured,y=t.keepIframeSrcFn,b=t.newlyAddedElement,w=void 0!==b&&b,k=t.rootId,_=function(e,t,r){try{if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var i=e.classList.length;i--;)if(t.test(e.classList[i]))return!0;if(r)return e.matches(r)}catch(e){}return!1}(e,t.blockClass,t.blockSelector),S=function(e){if(e instanceof HTMLFormElement)return"form";var t=Ha(e.tagName);return ao.test(t)?"div":t}(e),x=new Set,C={},M=e.attributes.length,T=0;M>T;T++){var I=e.attributes[T];go(S,I.name)||(C[I.name]=po(a,S,Ha(I.name),I.value,e,f))}if("link"===S&&o&&!_){var E=e.sheet;if(!E){var R=function(e){return e.href}(e);R&&!(E=ko(a,R))&&R.includes(".css")&&(E=ko(a,window.location.origin+"/"+R.replace(window.location.href,"")))}var A=null;E&&(_a(E)?ia>0&&(la.push(e),ha+=1):A=Aa(E)),A&&(delete C.rel,delete C.href,C._cssText=A)}if("style"===S&&e.sheet&&!(e.innerText||Qn.textContent(e)||"").trim().length){var L=wa((()=>Aa(e.sheet)));L&&(C._cssText=L)}if("input"===S||"textarea"===S||"select"===S){var O=e.value,P=e.checked;"radio"!==C.type&&"checkbox"!==C.type&&"submit"!==C.type&&"button"!==C.type&&O?C.value=Ba({element:e,type:za(e),tagName:S,value:O,maskInputOptions:u,maskInputFn:l}):P&&(C.checked=P)}if("option"===S&&(e.selected&&!u.select?C.selected=!0:delete C.selected),"dialog"===S&&e.open){try{C.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal"}catch(e){C.rr_open_mode="modal",C.ph_rr_could_not_detect_modal=!0}x.add("rr_open_mode")}if("canvas"===S&&g&&!(null==m?void 0:m()))if("2d"===e.__context)(function(e){var t=e.getContext("2d");if(!t)return!0;for(var r=0;e.width>r;r+=50)for(var i=0;e.height>i;i+=50){var n=t.getImageData;if(new Uint32Array((Wa in n?n[Wa]:n).call(t,r,i,Math.min(50,e.width-r),Math.min(50,e.height-i)).data.buffer).some((e=>0!==e)))return!1}return!0})(e)||(C.rr_dataURL=e.toDataURL(f.type,f.quality));else if(!("__context"in e)){var D=e.toDataURL(f.type,f.quality),F=a.createElement("canvas");F.width=e.width,F.height=e.height,D!==F.toDataURL(f.type,f.quality)&&(C.rr_dataURL=D)}var N,q,j=!1;if("img"===S&&p){Ya||(Ya=a.createElement("canvas"),Ka=Ya.getContext("2d"));var B=e,H=B.currentSrc||B.getAttribute("src")||"<unknown-src>",U=B.crossOrigin,W=(t,r)=>j?Ua({element:e,name:t,value:r,maskAllElementAttributes:c,maskAttributeFn:d}):r,z=()=>{bo(B,"load",z);try{Ya.width=B.naturalWidth,Ya.height=B.naturalHeight,Ka.drawImage(B,0,0);var e=Ya.toDataURL(f.type,f.quality);C.rr_dataURL=W("rr_dataURL",e)}catch(e){if("anonymous"!==B.crossOrigin)return B.crossOrigin="anonymous",void(B.complete&&0!==B.naturalWidth?z():B.addEventListener("load",z));console.warn("Cannot inline img src="+H+"! Error: "+e)}"anonymous"===B.crossOrigin&&(U?C.crossOrigin=W("crossOrigin",U):B.removeAttribute("crossorigin"))};B.complete&&0!==B.naturalWidth?z():B.addEventListener("load",z)}if("audio"===S||"video"===S){var V=C;V.rr_mediaState=e.paused?"paused":"played",x.add("rr_mediaState"),V.rr_mediaCurrentTime=e.currentTime,V.rr_mediaPlaybackRate=e.playbackRate,V.rr_mediaMuted=e.muted,V.rr_mediaLoop=e.loop,V.rr_mediaVolume=e.volume}if(w||(e.scrollLeft&&(C.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(C.rr_scrollTop=e.scrollTop)),_){var Z=e.getBoundingClientRect(),G=Z.width,Q=Z.height,J=Z.left,Y=Z.top,K=null==(r=a.defaultView)?void 0:r.getComputedStyle(e);C={class:C.class,rr_width:G+"px",rr_height:Q+"px",rr_left:Math.floor(J+((null==(i=a.defaultView)?void 0:i.scrollX)||0))+"px",rr_top:Math.floor(Y+((null==(n=a.defaultView)?void 0:n.scrollY)||0))+"px"},x.add("rr_width"),x.add("rr_height"),x.add("rr_left"),x.add("rr_top"),K&&(C.rr_position=K.position||"static",x.add("rr_position"),K.transform&&"none"!==K.transform&&(C.rr_transform=K.transform,x.add("rr_transform")),K.display&&K.display.startsWith("inline")&&(C.rr_display=K.display,x.add("rr_display")))}if("iframe"!==S||y(C.src)||(e.contentDocument||(C.rr_src=C.src),delete C.src),c||d)for(var X of Object.entries(C)){var ee=X[0],te=X[1];"string"!=typeof te&&null!==te||(C[ee]=Ua({element:e,name:ee,value:te,maskAllElementAttributes:c,maskAttributeFn:d,isGenerated:x.has(ee)}))}j=!0;try{customElements.get(S)&&(N=!0)}catch(e){}return{type:Nn.Element,tagName:S,attributes:C,childNodes:[],isSVG:(q=e,Boolean("svg"===q.tagName||q.ownerSVGElement)||void 0),needBlock:_,rootId:k,isCustom:N}}(e,{doc:r,blockClass:i,blockSelector:n,inlineStylesheet:o,maskInputOptions:u,maskInputFn:h,maskAllElementAttributes:d,maskAttributeFn:v,dataURLOptions:p,inlineImages:g,recordCanvas:m,canvasMaskingConfigured:y,keepIframeSrcFn:b,newlyAddedElement:k,rootId:_});case e.TEXT_NODE:return function(e,t){var r,i=t.needsMask,n=t.maskTextFn,a=t.rootId,o=Qn.parentNode(e),s=o&&o.tagName,u=Qn.textContent(e),l="STYLE"===s||void 0,h="SCRIPT"===s||void 0;if(l&&u){try{if(e.nextSibling||e.previousSibling);else if(_a(o.sheet));else if(null==(r=o.sheet)?void 0:r.cssRules){var c=Aa(o.sheet);c&&!/(?:^|[\s;{}])-?[a-zA-Z][\w-]*\s*:\s*;/.test(c)&&(u=c)}}catch(t){console.warn("Cannot get CSS styles from text's parentNode. Error: "+t,e)}u=Ja(u,vo(t.doc))}return h&&(u="SCRIPT_PLACEHOLDER"),!l&&!h&&u&&i&&(u=n?n(u,Qn.parentElement(e)):u.replace(/[\S]/g,"*")),{type:Nn.Text,textContent:u||"",isStyle:l,rootId:a}}(e,{doc:r,needsMask:a,maskTextFn:l,rootId:_});case e.CDATA_SECTION_NODE:return{type:Nn.CDATA,textContent:"",rootId:_};case e.COMMENT_NODE:return{type:Nn.Comment,textContent:Qn.textContent(e)||"",rootId:_};default:return!1}}(e,{doc:r,mirror:i,blockClass:n,blockSelector:a,needsMask:W,inlineStylesheet:c,maskInputOptions:v,maskTextFn:f,maskInputFn:p,maskAllElementAttributes:m,maskAttributeFn:y,dataURLOptions:k,inlineImages:S,recordCanvas:C,canvasMaskingConfigured:M,keepIframeSrcFn:F,newlyAddedElement:q});if(!G)return console.warn(e,"not serialized"),null;Z=i.hasNode(e)?i.getId(e):function(e,t){if(t.comment&&e.type===Nn.Comment)return!0;if(e.type===Nn.Element){if(t.script&&("script"===e.tagName||"link"===e.tagName&&("preload"===e.attributes.rel&&"script"===e.attributes.as||"modulepreload"===e.attributes.rel)||"link"===e.tagName&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&"js"===function(e,t){var r,i;try{i=new URL(e,window.location.href)}catch(e){return null}var n=i.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!==(r=null==n?void 0:n[1])&&void 0!==r?r:null}(e.attributes.href)))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(_o(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===_o(e.attributes.name)||["icon","apple-touch-icon","shortcut icon"].includes(_o(e.attributes.rel)))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&_o(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(_o(e.attributes.property).match(/^(og|twitter|fb):/)||_o(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===_o(e.attributes.name)))return!0;if(t.headMetaRobots&&["robots","googlebot","bingbot"].includes(_o(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&(["author","generator","framework","publisher","progid"].includes(_o(e.attributes.name))||_o(e.attributes.property).match(/^article:/)||_o(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&["google-site-verification","yandex-verification","csrf-token","p:domain_verify","verify-v1","verification","shopify-checkout-api-token"].includes(_o(e.attributes.name)))return!0}}return!1}(G,b)||!V&&G.type===Nn.Text&&!G.isStyle&&!G.textContent.replace(/^\s+|\s+$/gm,"").length?oo:so();var Q=Object.assign(G,{id:Z});if(i.add(e,Q),Z===oo)return null;T&&T(e);var J=!l;if(Q.type===Nn.Element){J=J&&!Q.needBlock,delete Q.needBlock;var Y=Qn.shadowRoot(e);Y&&Ta(Y)&&(Q.isShadowHost=!0)}if((Q.type===Nn.Document||Q.type===Nn.Element)&&J){b.headWhitespace&&Q.type===Nn.Element&&"head"===Q.tagName&&(V=!1);var K={doc:r,mirror:i,blockClass:n,blockSelector:a,needsMask:W,maskTextClass:o,maskTextSelector:s,skipChild:l,inlineStylesheet:c,maskInputOptions:v,maskTextFn:f,maskInputFn:p,maskAllElementAttributes:m,maskAttributeFn:y,slimDOMOptions:b,dataURLOptions:k,inlineImages:S,recordCanvas:C,canvasMaskingConfigured:M,preserveWhiteSpace:V,onSerialize:T,onIframeLoad:I,iframeLoadTimeout:R,onIframeListenerRegistered:A,onStylesheetLoad:L,stylesheetLoadTimeout:P,keepIframeSrcFn:F,depth:B+1,maxDepth:U};if(Q.type===Nn.Element&&"textarea"===Q.tagName&&void 0!==Q.attributes.value);else for(var X of Array.from(Qn.childNodes(e))){var ee=Mo(X,K);ee&&Q.childNodes.push(ee)}var te=null;if(Ca(e)&&(te=Qn.shadowRoot(e)))for(var re of Array.from(Qn.childNodes(te))){var ie=Mo(re,K);ie&&(Ta(te)&&(ie.isShadow=!0),Q.childNodes.push(ie))}}var ne=Qn.parentNode(e);if(ne&&Ma(ne)&&Ta(ne)&&(Q.isShadow=!0),Q.type===Nn.Element&&"iframe"===Q.tagName){var ae=function(e,t,r){var i,n=()=>{},a=e.contentWindow;if(!a)return n;try{i=a.document.readyState}catch(e){return n}var o=()=>t();if("complete"!==i){var s=!1,u=null,l=()=>{s||(s=!0,null!==u&&(clearTimeout(u),u=null),bo(e,"load",h),e.addEventListener("load",o),t())},h=()=>l();return u=setTimeout(l,r),e.addEventListener("load",h),()=>{null!==u&&(clearTimeout(u),u=null),s?bo(e,"load",o):(s=!0,bo(e,"load",h))}}var c,d="about:blank";try{c=a.location.href}catch(e){return n}if(c!==d||e.src===d||""===e.src){var v=setTimeout(t,0);return e.addEventListener("load",o),()=>{clearTimeout(v),bo(e,"load",o)}}return e.addEventListener("load",o),()=>{bo(e,"load",o)}}(e,(()=>{var t=e.contentDocument;if(t&&I){var r=Mo(t,{doc:t,mirror:i,blockClass:n,blockSelector:a,needsMask:W,maskTextClass:o,maskTextSelector:s,skipChild:!1,inlineStylesheet:c,maskInputOptions:v,maskTextFn:f,maskInputFn:p,maskAllElementAttributes:m,maskAttributeFn:y,slimDOMOptions:b,dataURLOptions:k,inlineImages:S,recordCanvas:C,canvasMaskingConfigured:M,preserveWhiteSpace:V,onSerialize:T,onIframeLoad:I,iframeLoadTimeout:R,onIframeListenerRegistered:A,onStylesheetLoad:L,stylesheetLoadTimeout:P,keepIframeSrcFn:F,depth:B+1,maxDepth:U});r&&I(e,r)}}),R);null==A||A(e,ae)}return Q.type===Nn.Element&&"link"===Q.tagName&&"stylesheet"===Q.attributes.rel&&function(t,u,l){if(!wo.has(t)){var h;try{h=t.sheet}catch(e){return}if(!h){var d=new AbortController,g=!1,w=()=>{if(!g){g=!0;try{(()=>{if(L){var t=Mo(e,{doc:r,mirror:i,blockClass:n,blockSelector:a,needsMask:W,maskTextClass:o,maskTextSelector:s,skipChild:!1,inlineStylesheet:c,maskInputOptions:v,maskTextFn:f,maskInputFn:p,maskAllElementAttributes:m,maskAttributeFn:y,slimDOMOptions:b,dataURLOptions:k,inlineImages:S,recordCanvas:C,canvasMaskingConfigured:M,preserveWhiteSpace:V,onSerialize:T,onIframeLoad:I,iframeLoadTimeout:R,onStylesheetLoad:L,stylesheetLoadTimeout:P,keepIframeSrcFn:F,depth:B,maxDepth:U});t&&L(e,t)}})()}finally{wo.delete(t),d.abort()}}},_=setTimeout(w,l);d.signal.addEventListener("abort",(()=>clearTimeout(_)),{once:!0}),t.addEventListener("load",w,{signal:d.signal,once:!0}),wo.set(t,d)}}}(e,0,P),Q}function To(e){return!0===e||"all"===e?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===e,headMetaDescKeywords:"all"===e,headTitleMutations:"all"===e}:!1===e?{}:e}class Io{constructor(){Rn(this,"parentElement",null),Rn(this,"parentNode",null),Rn(this,"ownerDocument"),Rn(this,"firstChild",null),Rn(this,"lastChild",null),Rn(this,"previousSibling",null),Rn(this,"nextSibling",null),Rn(this,"ELEMENT_NODE",1),Rn(this,"TEXT_NODE",3),Rn(this,"nodeType"),Rn(this,"nodeName"),Rn(this,"RRNodeType")}get childNodes(){for(var e=[],t=this.firstChild;t;)e.push(t),t=t.nextSibling;return e}contains(e){if(!(e instanceof Io))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(e){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(e,t){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(e){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}function Eo(e,t,r){void 0===r&&(r=document);var i={capture:!0,passive:!0};return r.addEventListener(e,t,i),()=>Ro(r,e,t,i)}function Ro(e,t,r,i){Ao((()=>{var n=e.removeEventListener;"function"==typeof n&&(void 0!==i?n.call(e,t,r,i):n.call(e,t,r))}))}function Ao(e){try{e()}catch(e){if(!(e instanceof DOMException&&"SecurityError"===e.name))throw e}}var Lo="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.",Oo={map:{},getId(){return console.error(Lo),-1},getNode(){return console.error(Lo),null},removeNodeFromMap(){console.error(Lo)},has(){return console.error(Lo),!1},reset(){console.error(Lo)}};function Po(e,t,r){void 0===r&&(r={});var i=null,n=0;return function(){for(var a=arguments.length,o=new Array(a),s=0;a>s;s++)o[s]=arguments[s];var u=Date.now();n||!1!==r.leading||(n=u);var l=t-(u-n),h=this;0>=l||l>t?(i&&(clearTimeout(i),i=null),n=u,e.apply(h,o)):i||!1===r.trailing||(i=setTimeout((()=>{n=!1===r.leading?0:Date.now(),i=null,e.apply(h,o)}),l))}}function Do(e,t,r,i,n){void 0===n&&(n=window);var a=n.Object.getOwnPropertyDescriptor(e,t);return n.Object.defineProperty(e,t,i?r:{set(e){if(setTimeout((()=>{try{r.set.call(this,e)}catch(e){}}),0),a&&a.set){if(a.get)try{a.get.call(this)}catch(e){return}a.set.call(this,e)}}}),()=>Do(e,t,a||{},!0)}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(Oo=new Proxy(Oo,{get(e,t,r){return"map"===t&&console.error(Lo),Reflect.get(e,t,r)}}));var Fo=Date.now;function No(e){var t,r,i,n,a=e.document;return{left:a.scrollingElement?a.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:a.documentElement.scrollLeft||(null==a?void 0:a.body)&&(null==(t=Qn.parentElement(a.body))?void 0:t.scrollLeft)||(null==(r=null==a?void 0:a.body)?void 0:r.scrollLeft)||0,top:a.scrollingElement?a.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==a?void 0:a.documentElement.scrollTop)||(null==a?void 0:a.body)&&(null==(i=Qn.parentElement(a.body))?void 0:i.scrollTop)||(null==(n=null==a?void 0:a.body)?void 0:n.scrollTop)||0}}function qo(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function jo(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Bo(e){return e?e.nodeType===e.ELEMENT_NODE?e:Qn.parentElement(e):null}function Ho(e,t,r,i){if(!e)return!1;var n=Bo(e);if(!n)return!1;try{if("string"==typeof t){if(n.classList.contains(t))return!0;if(i&&null!==n.closest("."+t))return!0}else if(mo(n,t,i))return!0}catch(e){}if(r){if(n.matches(r))return!0;if(i&&null!==n.closest(r))return!0}return!1}function $o(e,t,r){return!("TITLE"!==e.tagName||!r.headTitleMutations)||t.getId(e)===oo}function Uo(e,t){if(Ma(e))return!1;var r=t.getId(e);if(!t.has(r))return!0;var i=Qn.parentNode(e);return(!i||i.nodeType!==e.DOCUMENT_NODE)&&(!i||Uo(i,t))}function Wo(e){return Boolean(e.changedTouches)}function zo(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function Vo(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function Zo(e){return!!e&&(e instanceof Io&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(Qn.shadowRoot(e)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(Fo=()=>(new Date).getTime());class Go{constructor(){Rn(this,"id",1),Rn(this,"styleIDMap",new WeakMap),Rn(this,"idStyleMap",new Map)}getId(e){var t;return null!==(t=this.styleIDMap.get(e))&&void 0!==t?t:-1}has(e){return this.styleIDMap.has(e)}add(e,t){return this.has(e)?this.getId(e):(r=void 0===t?this.id++:t,this.styleIDMap.set(e,r),this.idStyleMap.set(r,e),r);var r}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}function Qo(e){var t,r=null;return"getRootNode"in e&&(null==(t=Qn.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&Qn.host(Qn.getRootNode(e))&&(r=Qn.host(Qn.getRootNode(e))),r}function Jo(e){var t=e.ownerDocument;return!!t&&(Qn.contains(t,e)||function(e){var t=e.ownerDocument;if(!t)return!1;var r=function(e){for(var t,r=e;t=Qo(r);)r=t;return r}(e);return Qn.contains(t,r)}(e))}function Yo(e){return"__ln"in e}class Ko{constructor(){Rn(this,"length",0),Rn(this,"head",null),Rn(this,"tail",null)}get(e){if(e>=this.length)throw new Error("Position outside of list range");for(var t=this.head,r=0;e>r;r++)t=(null==t?void 0:t.next)||null;return t}addNode(e){var t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&Yo(e.previousSibling)){var r=e.previousSibling.__ln.next;t.next=r,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,r&&(r.previous=t)}else if(e.nextSibling&&Yo(e.nextSibling)&&e.nextSibling.__ln.previous){var i=e.nextSibling.__ln.previous;t.previous=i,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,i&&(i.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;null===t.next&&(this.tail=t),this.length++}removeNode(e){var t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next?t.next.previous=t.previous:this.tail=t.previous):(this.head=t.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)}}var Xo,es=(e,t)=>e+"@"+t;class ts{constructor(){Rn(this,"frozen",!1),Rn(this,"locked",!1),Rn(this,"texts",[]),Rn(this,"attributes",[]),Rn(this,"attributeMap",new WeakMap),Rn(this,"generatedAttributes",new WeakMap),Rn(this,"removes",[]),Rn(this,"mapRemoves",[]),Rn(this,"movedMap",{}),Rn(this,"addedSet",new Set),Rn(this,"movedSet",new Set),Rn(this,"droppedSet",new Set),Rn(this,"removesSubTreeCache",new Set),Rn(this,"mutationCb"),Rn(this,"blockClass"),Rn(this,"blockSelector"),Rn(this,"maskTextClass"),Rn(this,"maskTextSelector"),Rn(this,"inlineStylesheet"),Rn(this,"maskInputOptions"),Rn(this,"maskTextFn"),Rn(this,"maskInputFn"),Rn(this,"maskAllElementAttributes"),Rn(this,"maskAttributeFn"),Rn(this,"keepIframeSrcFn"),Rn(this,"recordCanvas"),Rn(this,"canvasMaskingConfigured"),Rn(this,"inlineImages"),Rn(this,"slimDOMOptions"),Rn(this,"dataURLOptions"),Rn(this,"doc"),Rn(this,"mirror"),Rn(this,"iframeManager"),Rn(this,"stylesheetManager"),Rn(this,"shadowDomManager"),Rn(this,"canvasManager"),Rn(this,"processedNodeManager"),Rn(this,"unattachedDoc"),Rn(this,"canvasManagerReleased",!1),Rn(this,"processMutations",(e=>{e.forEach(this.processMutation),this.emit()})),Rn(this,"emit",(()=>{if(!this.frozen&&!this.locked){var e,t,r=Yn(),i=ta();try{this.processBufferedMutations()}finally{e=Yn()-r,t=i,ia>0||ra(e,null!=t?t:Kn)||e>da.slowestBatchMs&&(da.slowestBatchMs=e)}}})),Rn(this,"processBufferedMutations",(()=>{for(var e=[],t=new Set,r=new Ko,i=e=>{for(var t=e,r=oo;r===oo;)r=(t=t&&t.nextSibling)&&this.mirror.getId(t);return r},n=n=>{var a=Qn.parentNode(n);if(a&&Jo(n)&&"TEXTAREA"!==a.tagName){var o=Ma(a)?this.mirror.getId(Qo(n)):this.mirror.getId(a),s=i(n);if(-1===o||-1===s)return r.addNode(n);var u=Mo(n,{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:e=>{zo(e,this.mirror)&&this.iframeManager.addIframe(e),Vo(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),Zo(e)&&!Ho(e,this.blockClass,this.blockSelector,!0)&&this.shadowDomManager.addShadowRoot(Qn.shadowRoot(e),this.doc)},onIframeLoad:(e,t)=>{this.iframeManager.attachIframe(e,t),this.shadowDomManager.observeAttachShadow(e)},onIframeListenerRegistered:(e,t)=>{this.iframeManager.registerLoadListenerDisposer(e,t)},onStylesheetLoad:(e,t)=>{this.stylesheetManager.attachLinkElement(e,t)}});u&&(e.push({parentId:o,nextId:s,node:u}),t.add(u.id))}};this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(var a of this.movedSet)is(this.removesSubTreeCache,a)&&!this.movedSet.has(Qn.parentNode(a))||n(a);for(var o of this.addedSet)ns(this.droppedSet,o)||is(this.removesSubTreeCache,o)?ns(this.movedSet,o)?n(o):this.droppedSet.add(o):n(o);for(var s=null;r.length;){var u=null;if(s){var l=this.mirror.getId(Qn.parentNode(s.value)),h=i(s.value);-1!==l&&-1!==h&&(u=s)}if(!u)for(var c=r.tail;c;){var d=c;if(c=c.previous,d){var v=this.mirror.getId(Qn.parentNode(d.value));if(-1===i(d.value))continue;if(-1!==v){u=d;break}var f=Qn.parentNode(d.value);if(f&&f.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var p=Qn.host(f);if(-1!==this.mirror.getId(p)){u=d;break}}}}if(!u){for(;r.head;)r.removeNode(r.head.value);break}s=u.previous,r.removeNode(u.value),n(u.value)}var g={texts:this.texts.map((e=>{var t=e.node,r=Qn.parentNode(t);return r&&"TEXTAREA"===r.tagName&&this.genTextAreaValueMutation(r),{id:this.mirror.getId(t),value:e.value}})).filter((e=>!t.has(e.id))).filter((e=>this.mirror.has(e.id))),attributes:this.attributes.map((e=>{var t,r=e.attributes;if(!this.maskAllElementAttributes&&!this.maskAttributeFn&&"string"==typeof r.style){var i=JSON.stringify(e.styleDiff),n=JSON.stringify(e._unchangedStyles);r.style.length>i.length&&(i+n).split("var(").length===r.style.split("var(").length&&(r.style=e.styleDiff)}if(this.maskAllElementAttributes||this.maskAttributeFn)for(var a of Object.entries(r)){var o=a[0],s=a[1];"string"!=typeof s&&null!==s||(r[o]=Ua({element:e.node,name:o,value:s,maskAllElementAttributes:this.maskAllElementAttributes,maskAttributeFn:this.maskAttributeFn,isGenerated:null==(t=this.generatedAttributes.get(e.node))?void 0:t.has(o)}))}return{id:this.mirror.getId(e.node),attributes:r}})).filter((e=>!t.has(e.id))).filter((e=>this.mirror.has(e.id))),removes:this.removes,adds:e};(g.texts.length||g.attributes.length||g.removes.length||g.adds.length)&&(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={},this.mutationCb(g))})),Rn(this,"bufferBelongsToIframe",(e=>this.doc===e.contentDocument)),Rn(this,"genTextAreaValueMutation",(e=>{var t=this.attributeMap.get(e);t||(this.attributes.push(t={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}}),this.attributeMap.set(e,t));var r=Array.from(Qn.childNodes(e),(e=>Qn.textContent(e)||"")).join("");t.attributes.value=Ba({element:e,maskInputOptions:this.maskInputOptions,tagName:e.tagName,type:za(e),value:r,maskInputFn:this.maskInputFn})})),Rn(this,"processMutation",(e=>{var t;if(!$o(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":var r=Qn.textContent(e.target);Ho(e.target,this.blockClass,this.blockSelector,!1)||r===e.oldValue||this.texts.push({value:yo(e.target,this.maskTextClass,this.maskTextSelector,!0)&&r?this.maskTextFn?this.maskTextFn(r,Bo(e.target)):r.replace(/[\S]/g,"*"):r,node:e.target});break;case"attributes":var i,n=e.target,a=e.attributeName,o=null!==(i=e.attributeNamespace)&&void 0!==i?i:null,s=function(e,t,r){if(!r)return t;var i=e.getAttributeNodeNS(r,t);if(i)return i.name;if("http://www.w3.org/1999/xlink"===r)return"xlink:"+t;if("http://www.w3.org/XML/1998/namespace"===r)return"xml:"+t;if("http://www.w3.org/2000/xmlns/"===r)return"xmlns"===t?t:"xmlns:"+t;var n=e.lookupPrefix(r);return n?n+":"+t:t}(n,a,o),u=o?n.getAttributeNS(o,a):e.target.getAttribute(a);if("value"===s){var l=n,h=za(l);u=Ba({element:l,maskInputOptions:this.maskInputOptions,tagName:n.tagName,type:h,value:u,maskInputFn:this.maskInputFn})}if(Ho(e.target,this.blockClass,this.blockSelector,!1)||u===e.oldValue)return;var c=this.attributeMap.get(e.target),d="IFRAME"===n.tagName&&"src"===s;if(d&&!this.keepIframeSrcFn(u)&&n.contentDocument)return;if(c||(this.attributes.push(c={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}}),this.attributeMap.set(e.target,c)),"type"===s&&"INPUT"===n.tagName&&"password"===(e.oldValue||"").toLowerCase()&&n.setAttribute("data-rr-is-password","true"),!go(n.tagName,s)){var v=po(this.doc,Ha(n.tagName),Ha(s),u,n,this.dataURLOptions);if(d&&!this.keepIframeSrcFn(u)&&(s="rr_src"),c.attributes[s]=v,null==(t=this.generatedAttributes.get(e.target))||t.delete(s),"style"===s){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(e){this.unattachedDoc=this.doc}var f=this.unattachedDoc.createElement("span"),p=n.style;for(var g of(e.oldValue&&(f.style.cssText=e.oldValue),Array.from(p))){var m=p.getPropertyValue(g),y=p.getPropertyPriority(g);m!==f.style.getPropertyValue(g)||y!==f.style.getPropertyPriority(g)?c.styleDiff[g]=""===y?m:[m,y]:c._unchangedStyles[g]=[m,y]}for(var b of Array.from(f.style))""===p.getPropertyValue(b)&&(c.styleDiff[b]=!1)}else if("open"===s&&"DIALOG"===n.tagName){c.attributes.rr_open_mode=n.matches("dialog:modal")?"modal":"non-modal";var w=this.generatedAttributes.get(e.target);w||this.generatedAttributes.set(e.target,w=new Set),w.add("rr_open_mode")}}break;case"childList":if(Ho(e.target,this.blockClass,this.blockSelector,!0))return;if("TEXTAREA"===e.target.tagName)return void this.genTextAreaValueMutation(e.target);e.addedNodes.forEach((t=>this.genAdds(t,e.target))),e.removedNodes.forEach((t=>{var r=this.mirror.getId(t),i=Ma(e.target)?this.mirror.getId(Qn.host(e.target)):this.mirror.getId(e.target);Ho(e.target,this.blockClass,this.blockSelector,!1)||$o(t,this.mirror,this.slimDOMOptions)||!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?(rs(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===r||Uo(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[es(r,i)]?rs(this.movedSet,t):(this.removes.push({parentId:i,id:r,isShadow:!(!Ma(e.target)||!Ta(e.target))||void 0}),function(e,t){for(var r=[e];r.length;){var i=r.pop();t.has(i)||(t.add(i),Qn.childNodes(i).forEach((e=>r.push(e))))}}(t,this.removesSubTreeCache))),this.mapRemoves.push(t))}))}})),Rn(this,"genAdds",((e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)){if(this.addedSet.has(e))return this.addedSet.delete(e),void this.addedSet.add(e);if(!this.movedSet.has(e)){if(this.mirror.hasNode(e)){if($o(e,this.mirror,this.slimDOMOptions))return;this.movedSet.add(e);var r=null;t&&this.mirror.hasNode(t)&&(r=this.mirror.getId(t)),r&&-1!==r&&(this.movedMap[es(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);Ho(e,this.blockClass,this.blockSelector,!1)||(Qn.childNodes(e).forEach((e=>this.genAdds(e))),Zo(e)&&Qn.childNodes(Qn.shadowRoot(e)).forEach((t=>{this.processedNodeManager.add(t,this),this.genAdds(t,e)})))}}}))}init(e){["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((t=>{this[t]=e[t]})),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(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift())}}function rs(e,t){for(var r=[t];r.length;){var i=r.pop();e.delete(i),Qn.childNodes(i).forEach((e=>r.push(e)))}}function is(e,t,r){return 0!==e.size&&function(e,t,r){var i=Qn.parentNode(t);return!!i&&e.has(i)}(e,t)}function ns(e,t){if(0===e.size)return!1;for(var r=Qn.parentNode(t);r;){if(e.has(r))return!0;r=Qn.parentNode(r)}return!1}var as=function(e,t){return void 0===t&&(t="rrweb"),Xo?function(){try{return e(...arguments)}catch(e){if(Xo&&!0===Xo(e,t))return;throw e}}:e},os=[];function ss(e){try{if("composedPath"in e){var t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch(e){}return e&&e.target}function us(e,t){var r,i=new ts;i.init(e);try{r=new(Zn())(as(i.processMutations.bind(i)));var n={attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0};return e.attributeFilter&&e.attributeFilter.length>0&&(n.attributeFilter=e.attributeFilter),r.observe(t,n),os.push(i),{observer:r,buffer:i}}catch(e){try{null==r||r.disconnect(),i.destroy(),i.reset()}catch(e){}throw e}}function ls(e){var t=e.scrollCb,r=e.doc,i=e.mirror,n=e.blockClass,a=e.blockSelector,o=e.sampling,s=new Map,u=e=>{var o=ss(e);if(o&&!Ho(o,n,a,!0)){var u,l,h=i.getId(o);if(o===r&&r.defaultView){var c=No(r.defaultView);u=c.left,l=c.top}else u=o.scrollLeft,l=o.scrollTop;var d=u+","+l;s.get(h)!==d&&(s.set(h,d),t({id:h,x:u,y:l}))}},l=[Eo("scroll",as(Po(as((e=>u(e))),o.scroll||100)),r)];return"onscrollend"in r&&l.push(Eo("scrollend",as(u),r)),()=>l.forEach((e=>e()))}function hs(e,t){for(var r=os.length-1;r>=0;r--){var i=os[r];if(i){var n=i.bufferBelongsToIframe(e);!n&&t&&t.has(i.bufferDoc())&&(n=!0),n&&(i.reset(),os.splice(r,1))}}}var cs=["INPUT","TEXTAREA","SELECT"],ds=new WeakMap;function vs(e){return function e(t,r){if(ys("CSSGroupingRule")&&t.parentRule instanceof CSSGroupingRule||ys("CSSMediaRule")&&t.parentRule instanceof CSSMediaRule||ys("CSSSupportsRule")&&t.parentRule instanceof CSSSupportsRule||ys("CSSConditionRule")&&t.parentRule instanceof CSSConditionRule){var i=Array.from(t.parentRule.cssRules).indexOf(t);return r.unshift(i),e(t.parentRule,r)}if(t.parentStyleSheet){var n=Array.from(t.parentStyleSheet.cssRules).indexOf(t);r.unshift(n)}return r}(e,[])}function fs(e,t,r){var i,n;return e?(e.ownerNode?i=t.getId(e.ownerNode):n=r.getId(e),{styleId:n,id:i}):{}}var ps=5e3;function gs(e,t){var r,i,n,a,o=e.stylesheetManager;a=e.mirror.getId("#document"===t.nodeName?t:Qn.host(t));var s="#document"===t.nodeName?null==(r=t.defaultView)?void 0:r.Document:null==(n=null==(i=t.ownerDocument)?void 0:i.defaultView)?void 0:n.ShadowRoot,u=(null==s?void 0:s.prototype)?Object.getOwnPropertyDescriptor(null==s?void 0:s.prototype,"adoptedStyleSheets"):void 0;return null!==a&&-1!==a&&s&&u?(Object.defineProperty(t,"adoptedStyleSheets",{configurable:u.configurable,enumerable:u.enumerable,get(){var e;return null==(e=u.get)?void 0:e.call(this)},set(e){var t,r;try{r=null==(t=u.set)?void 0:t.call(this,e)}catch(e){if(e&&"object"==typeof e&&"NotAllowedError"===e.name)return;throw e}if(null!==a&&-1!==a)try{o.adoptStyleSheets(e,a)}catch(e){}return r}}),as((()=>{Object.defineProperty(t,"adoptedStyleSheets",{configurable:u.configurable,enumerable:u.enumerable,get:u.get,set:u.set})}))):()=>{}}function ms(e,t){void 0===t&&(t={});var r,i,n=e.doc.defaultView;if(!n)return()=>{};!function(e,t){var r=e.mutationCb,i=e.mousemoveCb,n=e.mouseInteractionCb,a=e.scrollCb,o=e.viewportResizeCb,s=e.inputCb,u=e.mediaInteractionCb,l=e.styleSheetRuleCb,h=e.styleDeclarationCb,c=e.canvasMutationCb,d=e.fontCb,v=e.selectionCb,f=e.customElementCb;e.mutationCb=function(){t.mutation&&t.mutation(...arguments),r(...arguments)},e.mousemoveCb=function(){t.mousemove&&t.mousemove(...arguments),i(...arguments)},e.mouseInteractionCb=function(){t.mouseInteraction&&t.mouseInteraction(...arguments),n(...arguments)},e.scrollCb=function(){t.scroll&&t.scroll(...arguments),a(...arguments)},e.viewportResizeCb=function(){t.viewportResize&&t.viewportResize(...arguments),o(...arguments)},e.inputCb=function(){t.input&&t.input(...arguments),s(...arguments)},e.mediaInteractionCb=function(){t.mediaInteaction&&t.mediaInteaction(...arguments),u(...arguments)},e.styleSheetRuleCb=function(){t.styleSheetRule&&t.styleSheetRule(...arguments),l(...arguments)},e.styleDeclarationCb=function(){t.styleDeclaration&&t.styleDeclaration(...arguments),h(...arguments)},e.canvasMutationCb=function(){t.canvasMutation&&t.canvasMutation(...arguments),c(...arguments)},e.fontCb=function(){t.font&&t.font(...arguments),d(...arguments)},e.selectionCb=function(){t.selection&&t.selection(...arguments),v(...arguments)},e.customElementCb=function(){t.customElement&&t.customElement(...arguments),f(...arguments)}}(e,t);var a,o,s,u,l,c,d,v,f=[],p=as((()=>{if(i){i.destroy(),i.reset();var t=os.indexOf(i);-1!==t&&os.splice(t,1)}e.shadowDomManager.resetForDoc(e.doc),null==r||r.disconnect(),f.forEach((e=>e()))}));try{if(e.recordDOM){var g=us(e,e.doc);r=g.observer,i=g.buffer}if(f.push(function(e){var t=e.mousemoveCb,r=e.sampling,i=e.doc,n=e.mirror;if(!1===r.mousemove)return()=>{};var a,o="number"==typeof r.mousemove?r.mousemove:50,s="number"==typeof r.mousemoveCallback?r.mousemoveCallback:500,u=[],l=Po(as((e=>{var r=Date.now()-a;t(u.map((e=>(e.timeOffset-=r,e))),e),u=[],a=null})),s),h=as(Po(as((e=>{var t=ss(e),r=Wo(e)?e.changedTouches[0]:e,i=r.clientX,o=r.clientY;a||(a=Fo()),u.push({x:i,y:o,id:n.getId(t),timeOffset:Fo()-a}),l("undefined"!=typeof DragEvent&&e instanceof DragEvent?Ln.Drag:e instanceof MouseEvent?Ln.MouseMove:Ln.TouchMove)})),o,{trailing:!1})),c=[Eo("mousemove",h,i),Eo("touchmove",h,i),Eo("drag",h,i)];return as((()=>{c.forEach((e=>e()))}))}(e)),f.push(function(e){var t=e.mouseInteractionCb,r=e.doc,i=e.mirror,n=e.blockClass,a=e.blockSelector,o=e.sampling;if(!1===o.mouseInteraction)return()=>{};var s=!0===o.mouseInteraction||void 0===o.mouseInteraction?{}:o.mouseInteraction,u=[],l=null;return Object.keys(On).filter((e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==s[e])).forEach((e=>{var o=Ha(e),s=(e=>r=>{var o=ss(r);if(!Ho(o,n,a,!0)){var s=null,u=e;if("pointerType"in r){switch(r.pointerType){case"mouse":s=Pn.Mouse;break;case"touch":s=Pn.Touch;break;case"pen":s=Pn.Pen}s===Pn.Touch&&(On[e]===On.MouseDown?u="TouchStart":On[e]===On.MouseUp&&(u="TouchEnd"))}else Wo(r)&&(s=Pn.Touch);null!==s?(l=s,(u.startsWith("Touch")&&s===Pn.Touch||u.startsWith("Mouse")&&s===Pn.Mouse)&&(s=null)):On[e]===On.Click&&(s=l,l=null);var c=Wo(r)?r.changedTouches[0]:r;if(c){var d=i.getId(o),v=c.clientX,f=c.clientY;as(t)(h({type:On[u],id:d,x:v,y:f},null!==s&&{pointerType:s}))}}})(e);if(window.PointerEvent)switch(On[e]){case On.MouseDown:case On.MouseUp:o=o.replace("mouse","pointer");break;case On.TouchStart:case On.TouchEnd:return}u.push(Eo(o,s,r))})),as((()=>{u.forEach((e=>e()))}))}(e)),f.push(ls(e)),f.push(function(e,t){var r=e.viewportResizeCb,i=t.win,n=-1,a=-1;return Eo("resize",as(Po(as((()=>{var e=qo(),t=jo();n===e&&a===t||(r({width:Number(t),height:Number(e)}),n=e,a=t)})),200)),i)}(e,{win:n})),f.push(function(e){var t=e.inputCb,r=e.doc,i=e.mirror,n=e.blockClass,a=e.blockSelector,o=e.ignoreClass,s=e.ignoreSelector,u=e.maskInputOptions,l=e.maskInputFn,c=e.userTriggeredOnInput;function d(e){var t=ss(e),i=e.isTrusted,h=r.defaultView;if(!t||!h||t instanceof h.HTMLElement){var d=t&&t.tagName;if(t&&"OPTION"===d&&(t=Qn.parentElement(t)),t&&d&&cs.indexOf(d)>=0&&!Ho(t,n,a,!0)&&!(t.classList.contains(o)||s&&t.matches(s))){var f=t.value,p=!1,g=za(t)||"";"radio"===g||"checkbox"===g?p=t.checked:(u[d.toLowerCase()]||u[g])&&(f=Ba({element:t,maskInputOptions:u,tagName:d,type:g,value:f,maskInputFn:l})),v(t,c?{text:f,isChecked:p,userTriggered:i}:{text:f,isChecked:p});var m=t.name;"radio"===g&&m&&p&&r.querySelectorAll('input[type="radio"][name="'+m+'"]').forEach((e=>{if(e!==t){var r=e.value;v(e,c?{text:r,isChecked:!p,userTriggered:!1}:{text:r,isChecked:!p})}}))}}}function v(e,r){var n=ds.get(e);if(!n||n.text!==r.text||n.isChecked!==r.isChecked){ds.set(e,r);var a=i.getId(e);as(t)(h({},r,{id:a}))}}var f=("last"===e.sampling.input?["change"]:["input","change"]).map((e=>Eo(e,as(d),r))),p=r.defaultView;if(!p)return()=>{f.forEach((e=>e()))};var g=p.Object.getOwnPropertyDescriptor(p.HTMLInputElement.prototype,"value");return g&&g.set&&f.push(...[[p.HTMLInputElement.prototype,"value"],[p.HTMLInputElement.prototype,"checked"],[p.HTMLSelectElement.prototype,"value"],[p.HTMLTextAreaElement.prototype,"value"],[p.HTMLSelectElement.prototype,"selectedIndex"],[p.HTMLOptionElement.prototype,"selected"]].map((e=>Do(e[0],e[1],{set(){as(d)({target:this,isTrusted:!1})}},!1,p)))),as((()=>{f.forEach((e=>e()))}))}(e)),f.push(function(e){var t=e.mediaInteractionCb,r=e.blockClass,i=e.blockSelector,n=e.mirror,a=e.sampling,o=e.doc,s=as((e=>Po(as((a=>{var o=ss(a);if(o&&!Ho(o,r,i,!0)){var s=o.currentTime,u=o.volume,l=o.muted,h=o.playbackRate,c=o.loop;t({type:e,id:n.getId(o),currentTime:s,volume:u,muted:l,playbackRate:h,loop:c})}})),a.media||500))),u=[Eo("play",s(Fn.Play),o),Eo("pause",s(Fn.Pause),o),Eo("seeked",s(Fn.Seeked),o),Eo("volumechange",s(Fn.VolumeChange),o),Eo("ratechange",s(Fn.RateChange),o)];return as((()=>{u.forEach((e=>e()))}))}(e)),e.recordDOM){var m=function(e){var t=new Map,r=new Set,i=!0,n=e=>{if(i)try{e()}catch(e){}},a=e=>{var r,i=t.get(e);if(i){for(;null==(r=i[0])?void 0:r.ready;){var a=i.shift();(null==a?void 0:a.emit)&&n(a.emit)}0===i.length&&t.delete(e)}};return{queueMutation(e,r){if(e){var i=t.get(e);i?(i.push({emit:r,ready:!0}),a(e)):n(r)}else n(r)},queuePendingMutation(o,s,u){if(!i)return()=>{};var l=t.get(o);l||t.set(o,l=[]);var h={emit:s,ready:!1};l.push(h);var c,d=!1,v=!1,f=()=>{d||v||(d=!0,void 0!==c&&r.delete(c),h.ready=!0,h.emit=void 0,a(o))};try{c=e.setTimeout(f,ps),d||v?e.clearTimeout(c):r.add(c)}catch(e){f()}return t=>{!v&&i&&(v=!0,void 0!==c&&(e.clearTimeout(c),r.delete(c)),d?t&&n(u):(h.ready=!0,t||(h.emit=void 0),a(o)))}},reset(){i=!1,r.forEach((t=>e.clearTimeout(t))),r.clear(),t.clear()}}}(n);f.push(m.reset),f.push(function(e,t){var r=e.styleSheetRuleCb,i=e.mirror,n=e.stylesheetManager,a=t.win,o=t.mutationQueue;if(!a.CSSStyleSheet||!a.CSSStyleSheet.prototype)return()=>{};var s=a.CSSStyleSheet.prototype.insertRule;a.CSSStyleSheet.prototype.insertRule=new Proxy(s,{apply:as(((e,t,a)=>{var s=a[0],u=e.apply(t,a);n.onCssomSheetMutation(t);var l=fs(t,i,n.styleMirror),h=l.id,c=l.styleId;return(h&&-1!==h||c&&-1!==c)&&o.queueMutation(t,(()=>r({id:h,styleId:c,adds:[{rule:s,index:u}]}))),u}),"host")}),a.CSSStyleSheet.prototype.addRule=function(e,t,r){return void 0===r&&(r=this.cssRules.length),a.CSSStyleSheet.prototype.insertRule.apply(this,[e+" { "+t+" }",r])};var u,l,h=a.CSSStyleSheet.prototype.deleteRule;a.CSSStyleSheet.prototype.deleteRule=new Proxy(h,{apply:as(((e,t,a)=>{var s=a[0],u=e.apply(t,a);n.onCssomSheetMutation(t);var l=fs(t,i,n.styleMirror),h=l.id,c=l.styleId;return(h&&-1!==h||c&&-1!==c)&&o.queueMutation(t,(()=>r({id:h,styleId:c,removes:[{index:s}]}))),u}),"host")}),a.CSSStyleSheet.prototype.removeRule=function(e){return a.CSSStyleSheet.prototype.deleteRule.apply(this,[e])},a.CSSStyleSheet.prototype.replace&&(u=a.CSSStyleSheet.prototype.replace,a.CSSStyleSheet.prototype.replace=new Proxy(u,{apply:as(((e,t,a)=>{var s=a[0],u=e.apply(t,a);try{var l=null==u?void 0:u.then;if(t.ownerNode||!u||"function"!=typeof l)return u;n.onCssomSheetMutation(t);var h=fs(t,i,n.styleMirror),c=h.id,d=h.styleId;if(!(c&&-1!==c||d&&-1!==d))return u;var v=o.queuePendingMutation(t,(()=>r({id:c,styleId:d,replace:s})),(()=>{var e=Aa(t);null!==e&&r({id:c,styleId:d,replace:e})}));try{l.call(u,(()=>v(!0)),(()=>v(!1)))}catch(e){v(!1)}}catch(e){}return u}),"host")})),a.CSSStyleSheet.prototype.replaceSync&&(l=a.CSSStyleSheet.prototype.replaceSync,a.CSSStyleSheet.prototype.replaceSync=new Proxy(l,{apply:as(((e,t,a)=>{var s=a[0],u=e.apply(t,a);n.onCssomSheetMutation(t);var l=fs(t,i,n.styleMirror),h=l.id,c=l.styleId;return(h&&-1!==h||c&&-1!==c)&&o.queueMutation(t,(()=>r({id:h,styleId:c,replaceSync:s}))),u}),"host")}));var c={};bs("CSSGroupingRule")?c.CSSGroupingRule=a.CSSGroupingRule:(bs("CSSMediaRule")&&(c.CSSMediaRule=a.CSSMediaRule),bs("CSSConditionRule")&&(c.CSSConditionRule=a.CSSConditionRule),bs("CSSSupportsRule")&&(c.CSSSupportsRule=a.CSSSupportsRule));var d={};return Object.entries(c).forEach((e=>{var t=e[0],a=e[1];d[t]={insertRule:a.prototype.insertRule,deleteRule:a.prototype.deleteRule},a.prototype.insertRule=new Proxy(d[t].insertRule,{apply:as(((e,t,a)=>{var s=a[0],u=e.apply(t,a);n.onCssomSheetMutation(t.parentStyleSheet);var l=fs(t.parentStyleSheet,i,n.styleMirror),h=l.id,c=l.styleId;if(t.parentStyleSheet&&(h&&-1!==h||c&&-1!==c)){var d=[...vs(t),u];o.queueMutation(t.parentStyleSheet,(()=>r({id:h,styleId:c,adds:[{rule:s,index:d}]})))}return u}),"host")}),a.prototype.deleteRule=new Proxy(d[t].deleteRule,{apply:as(((e,t,a)=>{var s=a[0],u=e.apply(t,a);n.onCssomSheetMutation(t.parentStyleSheet);var l=fs(t.parentStyleSheet,i,n.styleMirror),h=l.id,c=l.styleId;if(t.parentStyleSheet&&(h&&-1!==h||c&&-1!==c)){var d=[...vs(t),s];o.queueMutation(t.parentStyleSheet,(()=>r({id:h,styleId:c,removes:[{index:d}]})))}return u}),"host")})})),as((()=>{a.CSSStyleSheet.prototype.insertRule=s,a.CSSStyleSheet.prototype.deleteRule=h,u&&(a.CSSStyleSheet.prototype.replace=u),l&&(a.CSSStyleSheet.prototype.replaceSync=l),Object.entries(c).forEach((e=>{var t=e[0],r=e[1];r.prototype.insertRule=d[t].insertRule,r.prototype.deleteRule=d[t].deleteRule}))}))}(e,{win:n,mutationQueue:m})),f.push(gs(e,e.doc)),f.push(function(e,t){var r=e.styleDeclarationCb,i=e.mirror,n=e.ignoreCSSAttributes,a=e.stylesheetManager,o=t.win,s=t.mutationQueue,u=o.CSSStyleDeclaration.prototype.setProperty;o.CSSStyleDeclaration.prototype.setProperty=new Proxy(u,{apply:as(((e,t,o)=>{var u,l=o[0],h=o[1],c=o[2],d=e.apply(t,o);if(n.has(l))return d;var v=null==(u=t.parentRule)?void 0:u.parentStyleSheet;a.onCssomSheetMutation(v);var f=fs(v,i,a.styleMirror),p=f.id,g=f.styleId;if(p&&-1!==p||g&&-1!==g){var m=vs(t.parentRule);s.queueMutation(v,(()=>r({id:p,styleId:g,set:{property:l,value:h,priority:c},index:m})))}return d}),"host")});var l=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=new Proxy(l,{apply:as(((e,t,o)=>{var u,l=o[0],h=e.apply(t,o);if(n.has(l))return h;var c=null==(u=t.parentRule)?void 0:u.parentStyleSheet;a.onCssomSheetMutation(c);var d=fs(c,i,a.styleMirror),v=d.id,f=d.styleId;if(v&&-1!==v||f&&-1!==f){var p=vs(t.parentRule);s.queueMutation(c,(()=>r({id:v,styleId:f,remove:{property:l},index:p})))}return h}),"host")}),as((()=>{o.CSSStyleDeclaration.prototype.setProperty=u,o.CSSStyleDeclaration.prototype.removeProperty=l}))}(e,{win:n,mutationQueue:m})),e.collectFonts&&f.push(function(e){var t=e.fontCb,r=e.doc,i=r.defaultView;if(!i)return()=>{};var n=[],a=new WeakMap,o=i.FontFace;i.FontFace=function(e,t,r){var i=new o(e,t,r);return a.set(i,{family:e,buffer:"string"!=typeof t,descriptors:r,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),i};var s=Gn(r.fonts,"add",(function(e){return function(r){return setTimeout(as((()=>{var e=a.get(r);e&&(t(e),a.delete(r))})),0),e.apply(this,[r])}}));return n.push((()=>{i.FontFace=o})),n.push(s),as((()=>{n.forEach((e=>e()))}))}(e))}for(var y of(f.push((o=(a=e).doc,s=a.mirror,u=a.blockClass,l=a.blockSelector,c=a.selectionCb,d=!0,(v=as((()=>{var e=o.getSelection();if(!(!e||d&&(null==e?void 0:e.isCollapsed))){d=e.isCollapsed||!1;for(var t=[],r=e.rangeCount||0,i=0;r>i;i++){var n=e.getRangeAt(i),a=n.startContainer,h=n.startOffset,v=n.endContainer,f=n.endOffset;Ho(a,u,l,!0)||Ho(v,u,l,!0)||t.push({start:s.getId(a),startOffset:h,end:s.getId(v),endOffset:f})}c({ranges:t})}})))(),Eo("selectionchange",v))),f.push(function(e){var t=e.customElementCb,r=e.doc.defaultView;return r&&r.customElements?Gn(r.customElements,"define",(function(e){return function(r,i,n){try{t({define:{name:r}})}catch(e){console.warn("Custom element callback failed for "+r)}return e.apply(this,[r,i,n])}})):()=>{}}(e)),e.plugins))f.push(y.observer(y.callback,n,y.options))}catch(e){try{p()}catch(e){}throw e}return p}function ys(e){return void 0!==window[e]}function bs(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class ws{constructor(e){Rn(this,"iframeRemoteIdToLocalIdMap",new WeakMap),Rn(this,"iframeLocalIdToRemoteIdMap",new WeakMap),this.generateIdFn=e}getId(e,t,r,i){if(0>t)return t;var n=r||this.getRemoteIdToLocalIdMap(e),a=i||this.getLocalIdToRemoteIdMap(e),o=n.get(t);return void 0===o&&(o=this.generateIdFn(),n.set(t,o),a.set(o,t)),o}getIds(e,t){var r=this.getRemoteIdToLocalIdMap(e),i=this.getLocalIdToRemoteIdMap(e);return t.map((t=>this.getId(e,t,r,i)))}getRemoteId(e,t,r){var i;return"number"!=typeof t||0>t?t:null!==(i=(r||this.getLocalIdToRemoteIdMap(e)).get(t))&&void 0!==i?i:-1}getRemoteIds(e,t){var r=this.getLocalIdToRemoteIdMap(e);return t.map((t=>this.getRemoteId(e,t,r)))}reset(e){if(!e)return this.iframeRemoteIdToLocalIdMap=new WeakMap,void(this.iframeLocalIdToRemoteIdMap=new WeakMap);this.iframeRemoteIdToLocalIdMap.delete(e),this.iframeLocalIdToRemoteIdMap.delete(e)}getRemoteIdToLocalIdMap(e){var t=this.iframeRemoteIdToLocalIdMap.get(e);return t||this.iframeRemoteIdToLocalIdMap.set(e,t=new Map),t}getLocalIdToRemoteIdMap(e){var t=this.iframeLocalIdToRemoteIdMap.get(e);return t||this.iframeLocalIdToRemoteIdMap.set(e,t=new Map),t}}class ks{constructor(e){Rn(this,"iframes",new WeakMap),Rn(this,"crossOriginIframeMap",new WeakMap),Rn(this,"crossOriginIframeMirror",new ws(so)),Rn(this,"crossOriginIframeStyleMirror"),Rn(this,"crossOriginIframeRootIdMap",new WeakMap),Rn(this,"mirror"),Rn(this,"mutationCb"),Rn(this,"wrappedEmit"),Rn(this,"loadListener"),Rn(this,"pageHideListener"),Rn(this,"stylesheetManager"),Rn(this,"recordCrossOriginIframes"),Rn(this,"messageHandler"),Rn(this,"nestedIframeListeners",new Map),Rn(this,"attachedWindows",new WeakMap),Rn(this,"attachedDocuments",new WeakMap),Rn(this,"attachedIframes",new Map),Rn(this,"loadListenerDisposers",new WeakMap),Rn(this,"iframeElementsById",new Map),Rn(this,"pageHideHandlers",new WeakMap),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new ws(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.messageHandler=this.handleMessage.bind(this),this.recordCrossOriginIframes&&window.addEventListener("message",this.messageHandler)}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}registerLoadListenerDisposer(e,t){var r=this.loadListenerDisposers.get(e);r||this.loadListenerDisposers.set(e,r=new Set),r.add(t);var i=this.mirror.getId(e);-1!==i&&this.iframeElementsById.set(i,e)}getIframeElementById(e){var t,r,i;return null!==(t=null!==(r=null==(i=this.attachedIframes.get(e))?void 0:i.element)&&void 0!==r?r:this.iframeElementsById.get(e))&&void 0!==t?t:null}forgetIframeId(e){this.attachedIframes.delete(e),this.iframeElementsById.delete(e)}disposeLoadListeners(e){var t=this.loadListenerDisposers.get(e);t&&(t.forEach((e=>Ao(e))),this.loadListenerDisposers.delete(e))}removePageHideListener(e){var t=this.pageHideHandlers.get(e);t&&(t.forEach((e=>{Ro(e.win,"pagehide",e.handler)})),this.pageHideHandlers.delete(e))}addLoadListener(e){this.loadListener=e}addPageHideListener(e){this.pageHideListener=e}removeLoadListener(){this.loadListener=void 0}trackIframeContent(e,t){var r=this.mirror.getId(e);return this.attachedIframes.set(r,{element:e,content:t}),r}attachIframe(e,t){var r,i=this.trackIframeContent(e,t);if(e.contentDocument){var n=this.attachedDocuments.get(e);n||this.attachedDocuments.set(e,n=new Set),n.add(e.contentDocument)}this.mutationCb({adds:[{parentId:i,nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0});var a=e.contentWindow;if(this.recordCrossOriginIframes&&a&&!this.nestedIframeListeners.has(a)){var o=this.handleMessage.bind(this);Ao((()=>{a.addEventListener("message",o),this.nestedIframeListeners.set(a,o);var t=this.attachedWindows.get(e);t||this.attachedWindows.set(e,t=new Set),t.add(a)}))}Ao((()=>{var t=e.contentWindow;if(t){var r=this.pageHideHandlers.get(e);if(r)for(var i of r)if(i.win===t)return;var n=()=>{var t;null==(t=this.pageHideListener)||t.call(this,e),e.contentDocument&&this.mirror.removeNodeFromMap(e.contentDocument),e.contentWindow&&this.crossOriginIframeMap.delete(e.contentWindow)};t.addEventListener("pagehide",n),r||this.pageHideHandlers.set(e,r=new Set),r.add({win:t,handler:n})}})),null==(r=this.loadListener)||r.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){var t=e;if("rrweb"===t.data.type&&t.origin===t.data.origin&&e.source){var r=this.crossOriginIframeMap.get(e.source);if(r){var i=this.transformCrossOriginEvent(r,t.data.event);i&&this.wrappedEmit(i,t.data.isCheckout)}}}transformCrossOriginEvent(e,t){var r;switch(t.type){case An.FullSnapshot:this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);var i=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,i),this.patchRootIdOnNode(t.data.node,i),this.trackIframeContent(e,t.data.node),{timestamp:t.timestamp,type:An.IncrementalSnapshot,data:{source:Ln.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case An.Meta:case An.Load:case An.DomContentLoaded:return!1;case An.Plugin:return t;case An.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case An.IncrementalSnapshot:switch(t.data.source){case Ln.Mutation:return t.data.adds.forEach((t=>{this.replaceIds(t,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(t.node,e);var r=this.crossOriginIframeRootIdMap.get(e);r&&this.patchRootIdOnNode(t.node,r)})),t.data.removes.forEach((t=>{this.replaceIds(t,e,["parentId","id"])})),t.data.attributes.forEach((t=>{this.replaceIds(t,e,["id"])})),t.data.texts.forEach((t=>{this.replaceIds(t,e,["id"])})),t;case Ln.Drag:case Ln.TouchMove:case Ln.MouseMove:return t.data.positions.forEach((t=>{this.replaceIds(t,e,["id"])})),t;case Ln.ViewportResize:return!1;case Ln.MediaInteraction:case Ln.MouseInteraction:case Ln.Scroll:case Ln.CanvasMutation:case Ln.Input:return this.replaceIds(t.data,e,["id"]),t;case Ln.StyleSheetRule:case Ln.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case Ln.Font:return t;case Ln.Selection:return t.data.ranges.forEach((t=>{this.replaceIds(t,e,["start","end"])})),t;case Ln.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),null==(r=t.data.styles)||r.forEach((t=>{this.replaceStyleIds(t,e,["styleId"])})),t}}return!1}replace(e,t,r,i){for(var n of i)(Array.isArray(t[n])||"number"==typeof t[n])&&(t[n]=Array.isArray(t[n])?e.getIds(r,t[n]):e.getId(r,t[n]));return t}replaceIds(e,t,r){return this.replace(this.crossOriginIframeMirror,e,t,r)}replaceStyleIds(e,t,r){return this.replace(this.crossOriginIframeStyleMirror,e,t,r)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach((e=>{this.replaceIdOnNode(e,t)}))}patchRootIdOnNode(e,t){e.type===Nn.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach((e=>{this.patchRootIdOnNode(e,t)}))}removeIframeById(e){var t=this.attachedIframes.get(e),r=(null==t?void 0:t.element)||this.iframeElementsById.get(e)||this.mirror.getNode(e);if(this.iframeElementsById.delete(e),r){var i=r.contentWindow,n=this.attachedWindows.get(r);n&&(n.forEach((e=>{var t=this.nestedIframeListeners.get(e);t&&(Ro(e,"message",t),this.nestedIframeListeners.delete(e)),this.crossOriginIframeMap.delete(e)})),this.attachedWindows.delete(r)),i&&this.nestedIframeListeners.has(i)&&(Ro(i,"message",this.nestedIframeListeners.get(i)),this.nestedIframeListeners.delete(i)),i&&this.crossOriginIframeMap.delete(i),this.iframes.delete(r),this.disposeLoadListeners(r),this.removePageHideListener(r);var a=this.attachedDocuments.get(r);a&&(a.forEach((e=>{Ao((()=>this.mirror.removeNodeFromMap(e)))})),Ao((()=>hs(r,a))),this.attachedDocuments.delete(r))}t&&this.attachedIframes.delete(e)}cleanupDetachedIframes(){if(0!==this.attachedIframes.size){var e=[];this.attachedIframes.forEach(((t,r)=>{this.mirror.has(r)||e.push(r)})),e.forEach((e=>this.removeIframeById(e)))}}reattachIframes(){this.attachedIframes.forEach(((e,t)=>{var r=e.content;this.mirror.has(t)?this.mutationCb({adds:[{parentId:t,nextId:null,node:r}],removes:[],texts:[],attributes:[],isAttachIframe:!0}):this.attachedIframes.delete(t)}))}destroy(){this.recordCrossOriginIframes&&Ro(window,"message",this.messageHandler),this.nestedIframeListeners.forEach(((e,t)=>{Ro(t,"message",e)})),this.nestedIframeListeners.clear();var e=new Set;this.iframeElementsById.forEach((t=>e.add(t))),this.attachedIframes.forEach((t=>e.add(t.element))),e.forEach((e=>{this.disposeLoadListeners(e),this.removePageHideListener(e)})),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}}class _s{constructor(e){Rn(this,"shadowDoms",new WeakSet),Rn(this,"mutationCb"),Rn(this,"scrollCb"),Rn(this,"bypassOptions"),Rn(this,"mirror"),Rn(this,"restoreHandlers",[]),this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(e,t){var r,i;if(Ta(e)&&!this.shadowDoms.has(e)){this.shadowDoms.add(e);var n=null!==(r=null==(i=Qn.host(e))?void 0:i.ownerDocument)&&void 0!==r?r:t,a=us(h({},this.bypassOptions,{doc:n,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e),o=a.observer,s=a.buffer;this.restoreHandlers.push({doc:n,handler(){o.disconnect(),s.destroy(),s.releaseCanvasManager();var e=os.indexOf(s);-1!==e&&os.splice(e,1)}}),this.restoreHandlers.push({doc:n,handler:ls(h({},this.bypassOptions,{scrollCb:this.scrollCb,doc:e,mirror:this.mirror}))}),setTimeout((()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(Qn.host(e))),this.restoreHandlers.push({doc:n,handler:gs({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e)})}),0)}}observeAttachShadow(e){e.contentWindow&&e.contentDocument&&this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}patchAttachShadow(e,t){var r=this;this.restoreHandlers.push({doc:t,handler:Gn(e.prototype,"attachShadow",(function(e){return function(i){var n=e.call(this,i),a=Qn.shadowRoot(this);return a&&Jo(this)&&r.addShadowRoot(a,t),n}}))})}reset(){this.restoreHandlers.forEach((e=>{var t=e.handler;try{t()}catch(e){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}resetForDoc(e){var t=[];for(var r of this.restoreHandlers)if(r.doc===e)try{r.handler()}catch(e){}else t.push(r);this.restoreHandlers=t}}var Ss="skip-frame";function xs(e){if("object"!=typeof e||null===e)return!1;var t=e.y,r=e.width,i=e.height;return Number.isFinite(e.x)&&Number.isFinite(t)&&Number.isFinite(r)&&Number.isFinite(i)&&r>=0&&i>=0}for(var Cs="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ms="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Ts=0;64>Ts;Ts++)Ms[Cs.charCodeAt(Ts)]=Ts;var Is=new Map,Es=(e,t,r)=>{if(e&&(Ls(e,t)||"object"==typeof e)){var i=function(e,t){var r=Is.get(e);return r||Is.set(e,r=new Map),r.has(t)||r.set(t,[]),r.get(t)}(r,e.constructor.name),n=i.indexOf(e);return-1===n&&(n=i.length,i.push(e)),n}};function Rs(e,t,r,i){if(e instanceof Array)return e.map((e=>Rs(e,t,r,i)));if(null===e)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray)return{rr_type:e.constructor.name,args:[Object.values(e)]};if(e instanceof ArrayBuffer){var n=e.constructor.name,a=function(e){var t,r=new Uint8Array(e),i=r.length,n="";for(t=0;i>t;t+=3)n+=Cs[r[t]>>2],n+=Cs[(3&r[t])<<4|r[t+1]>>4],n+=Cs[(15&r[t+1])<<2|r[t+2]>>6],n+=Cs[63&r[t+2]];return i%3==2?n=n.substring(0,n.length-1)+"=":i%3==1&&(n=n.substring(0,n.length-2)+"=="),n}(e);return{rr_type:n,base64:a}}return e instanceof DataView?{rr_type:e.constructor.name,args:[Rs(e.buffer,t,r,i),e.byteOffset,e.byteLength]}:e instanceof HTMLImageElement?{rr_type:e.constructor.name,src:e.src}:e instanceof HTMLCanvasElement?{rr_type:"HTMLImageElement",src:e.toDataURL(i.type,i.quality)}:e instanceof ImageData?{rr_type:e.constructor.name,args:[Rs(e.data,t,r,i),e.width,e.height]}:Ls(e,t)||"object"==typeof e?{rr_type:e.constructor.name,index:Es(e,t,r)}:e}var As=(e,t,r,i)=>e.map((e=>Rs(e,t,r,i))),Ls=(e,t)=>{var r=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((e=>"function"==typeof t[e]));return Boolean(r.find((r=>e instanceof t[r])))},Os=["webgl","webgl2"];function Ps(e){return"nodeType"in e}function Ds(e,t,r,i){var n=[];try{if(i){var a=function(e,t,r){var i=e.GPUCanvasContext;if((null==i?void 0:i.prototype)&&"function"==typeof i.prototype.configure)return Gn(i.prototype,"configure",(function(i){return function(n){var a=function(e){var t=e.canvas;return t&&"object"==typeof t?t:null}(this);if(!a||Ps(a)&&Ho(a,t,r,!0))return i.call(this,n);Ps(a)&&!("__context"in a)&&(a.__context="webgpu");var o=function(e){var t=e.GPUTextureUsage;return t?t.COPY_SRC|t.RENDER_ATTACHMENT:null}(e);return i.call(this,null!==o&&n?h({},n,{usage:"number"==typeof n.usage?n.usage|o:o}):n)}}))}(e,t,r);a&&n.push(a)}var o=Gn(e.HTMLCanvasElement.prototype,"getContext",(function(e){return function(n){for(var a=function(e){return"experimental-webgl"===e?"webgl":e}(n),o=arguments.length,s=new Array(o>1?o-1:0),u=1;o>u;u++)s[u-1]=arguments[u];if(!Ho(this,t,r,!0)&&("__context"in this||(this.__context=a),i&&Os.includes(a)))if(s[0]&&"object"==typeof s[0]){var l=s[0];l.preserveDrawingBuffer||(l.preserveDrawingBuffer=!0)}else s.splice(0,1,{preserveDrawingBuffer:!0});return e.apply(this,[n,...s])}}));n.push(o)}catch(e){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{n.forEach((e=>e()))}}function Fs(e,t,r,i,n,a,o){var s=[],u=Object.getOwnPropertyNames(e),l=function(u){if(["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(u))return 0;try{if("function"!=typeof e[u])return 0;var l=Gn(e,u,(function(e){return function(){for(var s=arguments.length,l=new Array(s),h=0;s>h;h++)l[h]=arguments[h];var c=e.apply(this,l);if(Es(c,a,this),this.canvas&&"tagName"in this.canvas&&!Ho(this.canvas,i,n,!0)){var d=As(l,a,this,o);r(this.canvas,{type:t,property:u,args:d})}return c}}));s.push(l)}catch(a){var h=Do(e,u,{set(e){this.canvas&&"tagName"in this.canvas&&!Ho(this.canvas,i,n,!0)&&r(this.canvas,{type:t,property:u,args:[e],setter:!0})}});s.push(h)}};for(var h of u)l(h);return s}var Ns,qs,js,Bs='(function() {\n "use strict";\n var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";\n var lookup = typeof Uint8Array === "undefined" ? [] : new Uint8Array(256);\n for (var i = 0; i < chars.length; i++) {\n lookup[chars.charCodeAt(i)] = i;\n }\n var encode = function(arraybuffer) {\n var bytes = new Uint8Array(arraybuffer), i2, len = bytes.length, base64 = "";\n for (i2 = 0; i2 < len; i2 += 3) {\n base64 += chars[bytes[i2] >> 2];\n base64 += chars[(bytes[i2] & 3) << 4 | bytes[i2 + 1] >> 4];\n base64 += chars[(bytes[i2 + 1] & 15) << 2 | bytes[i2 + 2] >> 6];\n base64 += chars[bytes[i2 + 2] & 63];\n }\n if (len % 3 === 2) {\n base64 = base64.substring(0, base64.length - 1) + "=";\n } else if (len % 3 === 1) {\n base64 = base64.substring(0, base64.length - 2) + "==";\n }\n return base64;\n };\n const lastFingerprintMap = /* @__PURE__ */ new Map();\n const transparentFingerprintMap = /* @__PURE__ */ new Map();\n const lastSentAtMap = /* @__PURE__ */ new Map();\n const PROVIDER_KEYFRAME_INTERVAL_MS = 3e4;\n function hashPixels(data) {\n const view = new Uint32Array(\n data.buffer,\n data.byteOffset,\n data.byteLength >>> 2\n );\n let primaryHash = 2166136261;\n let secondaryHash = 2654435769;\n for (let i2 = 0; i2 < view.length; i2++) {\n primaryHash ^= view[i2];\n primaryHash = Math.imul(primaryHash, 16777619);\n secondaryHash ^= view[i2];\n secondaryHash = Math.imul(secondaryHash, 2246822507);\n }\n return `${(primaryHash >>> 0).toString(16)}:${(secondaryHash >>> 0).toString(16)}`;\n }\n function frameFingerprint(width, height, data) {\n return `${width}x${height}:${hashPixels(data)}`;\n }\n function transparentFingerprint(width, height) {\n const pixelCount = width * height;\n let hash = transparentFingerprintMap.get(pixelCount);\n if (hash === void 0) {\n hash = hashPixels(new Uint8ClampedArray(pixelCount * 4));\n transparentFingerprintMap.set(pixelCount, hash);\n }\n return `${width}x${height}:${hash}`;\n }\n const worker = self;\n let reusableCanvas = null;\n let reusableCtx = null;\n worker.onmessage = async function(e) {\n if ("resetFrameDedup" in e.data) {\n lastFingerprintMap.clear();\n return;\n }\n if ("OffscreenCanvas" in globalThis) {\n const {\n id,\n bitmap,\n width,\n height,\n displayWidth,\n displayHeight,\n dataURLOptions,\n maskRegions\n } = e.data;\n try {\n if (!reusableCanvas || reusableCanvas.width !== width || reusableCanvas.height !== height) {\n reusableCanvas = new OffscreenCanvas(width, height);\n reusableCtx = reusableCanvas.getContext("2d", {\n willReadFrequently: true\n });\n }\n const ctx = reusableCtx;\n ctx.clearRect(0, 0, width, height);\n ctx.drawImage(bitmap, 0, 0);\n bitmap.close();\n if (maskRegions) {\n ctx.fillStyle = "black";\n for (const region of maskRegions) {\n ctx.fillRect(region.x, region.y, region.width, region.height);\n }\n }\n const fingerprint = frameFingerprint(\n width,\n height,\n ctx.getImageData(0, 0, width, height).data\n );\n const lastFingerprint = lastFingerprintMap.get(id) ?? transparentFingerprint(width, height);\n if (fingerprint === lastFingerprint) {\n const lastSentAt = lastSentAtMap.get(id);\n const keyframeDue = maskRegions !== void 0 && lastSentAt !== void 0 && Date.now() - lastSentAt >= PROVIDER_KEYFRAME_INTERVAL_MS;\n if (!keyframeDue) {\n return worker.postMessage({ id });\n }\n }\n const blob = await reusableCanvas.convertToBlob(dataURLOptions);\n const arrayBuffer = await blob.arrayBuffer();\n worker.postMessage({\n id,\n type: blob.type,\n base64: encode(arrayBuffer),\n // cpu intensive\n displayWidth,\n displayHeight\n });\n lastFingerprintMap.set(id, fingerprint);\n lastSentAtMap.set(id, Date.now());\n } catch {\n worker.postMessage({ id });\n }\n } else {\n e.data.bitmap.close();\n return worker.postMessage({ id: e.data.id });\n }\n };\n})();\n',Hs="undefined"!=typeof self&&self.Blob&&new Blob([Bs],{type:"text/javascript;charset=utf-8"});function $s(e){var t;try{if(!(t=Hs&&(self.URL||self.webkitURL).createObjectURL(Hs)))throw"";var r=new Worker(t,{name:null==e?void 0:e.name});return r.addEventListener("error",(()=>{(self.URL||self.webkitURL).revokeObjectURL(t)})),r}catch(t){return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(Bs),{name:null==e?void 0:e.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}class Us{constructor(e){Rn(this,"pendingCanvasMutations",new Map),Rn(this,"rafStamps",{latestId:0,invokeId:null}),Rn(this,"mirror"),Rn(this,"mutationCb"),Rn(this,"resetObservers"),Rn(this,"frozen",!1),Rn(this,"locked",!1),Rn(this,"rafIdTimestamp",null),Rn(this,"rafIdFlush",null),Rn(this,"refCount",0),Rn(this,"torndown",!1),Rn(this,"resetFrameDedup",null),Rn(this,"processMutation",((e,t)=>{!(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId)&&this.rafStamps.invokeId||(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(e)||this.pendingCanvasMutations.set(e,[]),this.pendingCanvasMutations.get(e).push(t)}));var t=e.sampling,r=void 0===t?"all":t,i=e.win,n=e.blockClass,a=e.blockSelector,o=e.recordCanvas,s=e.dataURLOptions,u=e.resolutionScale,l=e.canvasMasking;this.mutationCb=e.mutationCb,this.mirror=e.mirror,o&&"all"===r&&this.initCanvasMutationObserver(i,n,a,s),o&&"number"==typeof r&&this.initCanvasFPSObserver(r,i,n,a,{dataURLOptions:s,resolutionScale:u,canvasMasking:l})}onFullSnapshot(){var e;null==(e=this.resetFrameDedup)||e.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}initCanvasFPSObserver(e,t,r,i,n){var a=this;if("OffscreenCanvas"in t){var o,s="number"==typeof n.resolutionScale&&Number.isFinite(n.resolutionScale)?Math.min(1,Math.max(.1,n.resolutionScale)):1,u=Ds(t,r,i,!0),h=new Map;try{o=new $s}catch(e){return}var c=!1;o.onerror=()=>{var e;c=!0,cancelAnimationFrame(d),null==(e=o.terminate)||e.call(o),this.resetFrameDedup=null},this.resetFrameDedup=()=>{o.postMessage({resetFrameDedup:!0})},o.onmessage=e=>{var t=e.data.id;if(h.set(t,!1),"base64"in e.data){var r=e.data,i=r.displayWidth,n=r.displayHeight;this.mutationCb({id:t,type:Dn["2D"],commands:[{property:"clearRect",args:[0,0,i,n]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:r.base64}],type:r.type}]},0,0,i,n]}],displayWidth:i,displayHeight:n})}};var d,v=1e3/e,f=0,p=e=>{var u,g;c||(f&&v>e-f||(f=e,(u=[],g=e=>{try{e.querySelectorAll("canvas").forEach((e=>{Ho(e,r,i,!0)||u.push(e)})),e.querySelectorAll("*").forEach((e=>{e.shadowRoot&&g(e.shadowRoot)}))}catch(e){}},g(t.document),u).forEach(function(){var e=l((function*(e){var t,r,i=a.mirror.getId(e);if(!h.get(i)&&0!==e.width&&0!==e.height){h.set(i,!0);try{if(["webgl","webgl2"].includes(e.__context)){var u=e.getContext(e.__context);if(null==(t=null==u?void 0:u.isContextLost)?void 0:t.call(u))return void h.set(i,!1);!1===(null==(r=null==u?void 0:u.getContextAttributes())?void 0:r.preserveDrawingBuffer)&&u.clear(u.COLOR_BUFFER_BIT)}var l=e.clientWidth||e.width,c=e.clientHeight||e.height,d=Math.max(1,Math.round(l*s)),v=Math.max(1,Math.round(c*s)),f=function(e,t,r,i,n,a){if(e&&"function"==typeof e.regionsFn){var o;try{o=e.regionsFn(t)}catch(e){return Ss}if(void 0!==o){if(!Array.isArray(o)||!o.every(xs))return Ss;var s=r/n,u=i/a;return o.filter((e=>e.width>0&&e.height>0)).map((e=>{var t=Math.floor(e.x*s),r=Math.floor(e.y*u);return{x:t,y:r,width:Math.ceil((e.x+e.width)*s)-t,height:Math.ceil((e.y+e.height)*u)-r}}))}}}(n.canvasMasking,e,d,v,l,c);if(f===Ss)return void h.set(i,!1);var p=yield createImageBitmap(e,1>s?{resizeWidth:d,resizeHeight:v,resizeQuality:"medium"}:{resizeWidth:d,resizeHeight:v});o.postMessage({id:i,bitmap:p,width:d,height:v,displayWidth:l,displayHeight:c,dataURLOptions:n.dataURLOptions,maskRegions:f},[p])}catch(e){h.set(i,!1)}}}));return function(t){return e.apply(this,arguments)}}())),d=requestAnimationFrame(p))};d=requestAnimationFrame(p),this.resetObservers=()=>{var e;u(),cancelAnimationFrame(d),null==(e=o.terminate)||e.call(o),this.resetFrameDedup=null}}}initCanvasMutationObserver(e,t,r,i){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var n=Ds(e,t,r,!1),a=function(e,t,r,i,n){var a=[],o=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype),s=function(o){try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[o])return 1;var s=Gn(t.CanvasRenderingContext2D.prototype,o,(function(a){return function(){for(var s=arguments.length,u=new Array(s),l=0;s>l;l++)u[l]=arguments[l];return Ho(this.canvas,r,i,!0)||setTimeout((()=>{var r=As(u,t,this,n);e(this.canvas,{type:Dn["2D"],property:o,args:r})}),0),a.apply(this,u)}}));a.push(s)}catch(n){var u=Do(t.CanvasRenderingContext2D.prototype,o,{set(t){Ho(this.canvas,r,i,!0)||e(this.canvas,{type:Dn["2D"],property:o,args:[t],setter:!0})}});a.push(u)}};for(var u of o)s(u);return()=>{a.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,r,i),o=function(e,t,r,i,n){var a=[];return void 0!==t.WebGLRenderingContext&&a.push(...Fs(t.WebGLRenderingContext.prototype,Dn.WebGL,e,r,i,t,n)),void 0!==t.WebGL2RenderingContext&&a.push(...Fs(t.WebGL2RenderingContext.prototype,Dn.WebGL2,e,r,i,t,n)),()=>{a.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,r,i);this.resetObservers=()=>{n(),a(),o()}}startPendingCanvasMutationFlusher(){this.rafIdFlush=requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}startRAFTimestamping(){var e=t=>{this.rafStamps.latestId=t,this.rafIdTimestamp=requestAnimationFrame(e)};this.rafIdTimestamp=requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach(((e,t)=>{var r=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,r)})),this.rafIdFlush=requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}flushPendingCanvasMutationFor(e,t){if(!this.frozen&&!this.locked){var r=this.pendingCanvasMutations.get(e);if(r&&-1!==t){var i=r.map((e=>{var t=function(e,t){if(null==e)return{};var r={};for(var i in e)if({}.hasOwnProperty.call(e,i)){if(-1!==t.indexOf(i))continue;r[i]=e[i]}return r}(e,In);return t}));this.mutationCb({id:t,type:r[0].type,commands:i}),this.pendingCanvasMutations.delete(e)}}}}class Ws{constructor(e){var t;Rn(this,"trackedLinkElements",new WeakSet),Rn(this,"pendingDeferredSheets",new Set),Rn(this,"mutationCb"),Rn(this,"adoptedStyleSheetCb"),Rn(this,"maskAllElementAttributes"),Rn(this,"maskAttributeFn"),Rn(this,"styleMirror",new Go),this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb,this.maskAllElementAttributes=null!==(t=e.maskAllElementAttributes)&&void 0!==t&&t,this.maskAttributeFn=e.maskAttributeFn}attachLinkElement(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}beginDeferredLinkInlining(e,t){if(-1===t||!e.isConnected)return null;var r=null,i=null;try{(i=e.sheet)&&(r=qa(i))}catch(e){}if(!r||!i)return Sa(),null;var n=r,a=!1,o={sheet:i,invalidate(){a=!0}};this.pendingDeferredSheets.add(o);var s=!1;return{advance:r=>{if(s)return!0;var u,l,h=Yn(),c=ta(),d=!0;try{if(a)return s=!0,Sa(),!0;if(!n.advance(r))return d=!1,!1;s=!0;var v=n.text();if(!e.isConnected)return!0;var f=null;try{f=e.sheet}catch(e){}return f!==i?(Sa(),!0):v?(this.emitCssTextMutation(e,t,v),!0):(Sa(),!0)}finally{d&&this.pendingDeferredSheets.delete(o),ra(u=Yn()-h,null!=(l=c)?l:Kn)||(va.totalMs+=u,u>va.slowestSliceMs&&(va.slowestSliceMs=u))}},remainingRules:()=>n.remainingRules(),discard:()=>{this.pendingDeferredSheets.delete(o)}}}onCssomSheetMutation(e){if(e&&0!==this.pendingDeferredSheets.size)for(var t of this.pendingDeferredSheets)t.sheet===e&&(this.pendingDeferredSheets.delete(t),t.invalidate())}inlineDeferredLinkElement(e,t){var r;null==(r=this.beginDeferredLinkInlining(e,t))||r.advance(1/0)}emitCssTextMutation(e,t,r){this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t,attributes:{_cssText:Ua({element:e,name:"_cssText",value:r,maskAllElementAttributes:this.maskAllElementAttributes,maskAttributeFn:this.maskAttributeFn})}}]})}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){var r=this;if(0!==e.length){var i={id:t,styleIds:[]},n=[],a=function(e){var t;if(r.styleMirror.has(e))t=r.styleMirror.getId(e);else{var a=r.styleMirror.add(e);t=a;var o=Yn();try{wa((()=>{try{var t=e.rules||e.cssRules;t&&ba(t)}catch(e){}n.push({styleId:a,rules:Array.from(e.rules||CSSRule,((t,r)=>({rule:La(t,e.href),index:r})))})}))}finally{ka(Yn()-o)}}i.styleIds.push(t)};for(var o of e)a(o);n.length>0&&(i.styles=n),this.adoptedStyleSheetCb(i)}}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet,this.pendingDeferredSheets.clear(),wo.forEach((e=>e.abort())),wo.clear()}trackStylesheetInLinkElement(e){}}class zs{constructor(){Rn(this,"nodeMap",new WeakMap),Rn(this,"active",!1)}inOtherBuffer(e,t){var r=this.nodeMap.get(e);return r&&Array.from(r).some((e=>e!==t))}add(e,t){this.active||(this.active=!0,requestAnimationFrame((()=>{this.nodeMap=new WeakMap,this.active=!1}))),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}destroy(){}}var Vs=!1;try{if(2!==Array.from([1],(e=>2*e))[0]){var Zs=document.createElement("iframe");document.body.appendChild(Zs),Array.from=(null==(Tn=Zs.contentWindow)?void 0:Tn.Array.from)||Array.from,document.body.removeChild(Zs)}}catch(e){console.debug("Unable to override Array.from",e)}var Gs=new ja,Qs=new Set([Ln.Mutation,Ln.MediaInteraction,Ln.StyleSheetRule,Ln.CanvasMutation,Ln.Font,Ln.Log,Ln.StyleDeclaration,Ln.AdoptedStyleSheet]);function Js(e){var t=window;if("function"==typeof t.requestIdleCallback){var r=t.requestIdleCallback(e,{timeout:2e3});return{cancel(){var e;return null==(e=t.cancelIdleCallback)?void 0:e.call(t,r)}}}var i=setTimeout(e,250);return{cancel:()=>clearTimeout(i)}}function Ys(e){var t;void 0===e&&(e={});var r=e,i=r.emit,n=r.checkoutEveryNms,a=r.checkoutEveryNth,o=r.blockClass,s=void 0===o?"rr-block":o,u=r.blockSelector,l=void 0===u?null:u,c=r.ignoreClass,d=void 0===c?"rr-ignore":c,v=r.ignoreSelector,f=void 0===v?null:v,p=r.maskTextClass,g=void 0===p?"rr-mask":p,m=r.maskTextSelector,y=void 0===m?null:m,b=r.inlineStylesheet,w=void 0===b||b,k=r.inlineStylesheetBudgetRules,_=r.maskAllInputs,S=r.maskInputOptions,x=r.slimDOMOptions,C=r.maskInputFn,M=r.maskTextFn,T=r.maskAllElementAttributes,I=void 0!==T&&T,E=r.maskAttributeFn,R=r.hooks,A=r.packFn,L=r.sampling,O=void 0===L?{}:L,P=r.dataURLOptions,D=void 0===P?{}:P,F=r.canvasResolutionScale,N=r.canvasMasking,q=r.mousemoveWait,j=r.recordDOM,B=void 0===j||j,H=r.recordCanvas,U=void 0!==H&&H,W=r.recordCrossOriginIframes,z=void 0!==W&&W,V=r.recordAfter,Z=void 0===V?"DOMContentLoaded"===e.recordAfter?e.recordAfter:"load":V,G=r.userTriggeredOnInput,Q=void 0!==G&&G,J=r.collectFonts,Y=void 0!==J&&J,K=r.inlineImages,X=void 0!==K&&K,ee=r.plugins,te=r.keepIframeSrcFn,re=void 0===te?()=>!1:te,ie=r.ignoreCSSAttributes,ne=void 0===ie?new Set([]):ie,ae=r.attributeFilter;Xo=r.errorHandler;var oe=h({type:"image/webp",quality:.4,maxBase64ImageLength:1048576},D),se=!z||window.parent===window,ue=!1;if(!se)try{window.parent.document&&(ue=!1)}catch(e){ue=!0}if(se&&!i)throw new Error("emit function is required");if(!se&&!ue)return()=>{};void 0!==q&&void 0===O.mousemove&&(O.mousemove=q),Gs.reset();var le,he=!0===_?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:void 0!==S?S:{password:!0},ce=To(void 0!==x&&x);!function(e){void 0===e&&(e=window),"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=[].forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=[].forEach)}();var de,ve,fe=0,pe=new Map,ge=e=>{for(var t of ee||[])t.eventProcessor&&(e=t.eventProcessor(e));return A&&!ue&&(e=A(e)),e};Ns=(e,t)=>{var r,o=e;if(o.timestamp=Fo(),!(null==(r=os[0])?void 0:r.isFrozen())||o.type===An.FullSnapshot||o.type===An.IncrementalSnapshot&&Qs.has(o.data.source)||os.forEach((e=>e.unfreeze())),se)null==i||i(ge(o),t);else if(ue){var s={type:"rrweb",event:ge(o),origin:window.location.origin,isCheckout:t};window.parent.postMessage(s,"*")}if(o.type===An.FullSnapshot)le=o,fe=0;else if(o.type===An.IncrementalSnapshot){if(o.data.source===Ln.Mutation&&o.data.isAttachIframe)return;fe++,(a&&fe>=a||n&&o.timestamp-le.timestamp>n)&&qs(!0)}};var me=e=>{if(e.removes&&e.removes.length>0){var t=e.adds.length>0?new Set(e.adds.map((e=>e.node.id))):null,r=new Set;if(e.adds.length>0)for(var i of e.adds){var n=Gs.getNode(i.node.id);n&&"IFRAME"===n.nodeName&&r.add(n)}e.removes.forEach((e=>{var i=e.id;if(!t||!t.has(i)){var n=ke.getIframeElementById(i);n&&r.has(n)?ke.forgetIframeId(i):(null==de||de(i),ke.removeIframeById(i))}})),null==ve||ve(),ke.cleanupDetachedIframes()}Ns({type:An.IncrementalSnapshot,data:h({source:Ln.Mutation},e)})},ye=e=>Ns({type:An.IncrementalSnapshot,data:h({source:Ln.Scroll},e)}),be=e=>Ns({type:An.IncrementalSnapshot,data:h({source:Ln.CanvasMutation},e)}),we=new Ws({mutationCb:me,adoptedStyleSheetCb:e=>Ns({type:An.IncrementalSnapshot,data:h({source:Ln.AdoptedStyleSheet},e)}),maskAllElementAttributes:I,maskAttributeFn:E}),ke=new ks({mirror:Gs,mutationCb:me,stylesheetManager:we,recordCrossOriginIframes:z,wrappedEmit:Ns});for(var _e of ee||[])_e.getMirror&&_e.getMirror({nodeMirror:Gs,crossOriginIframeMirror:ke.crossOriginIframeMirror,crossOriginIframeStyleMirror:ke.crossOriginIframeStyleMirror});var Se=new zs,xe=null==N?void 0:N.configured;js=new Us({recordCanvas:U,mutationCb:be,win:window,blockClass:s,blockSelector:l,mirror:Gs,sampling:O.canvas,dataURLOptions:oe,resolutionScale:F,canvasMasking:N});var Ce=new _s({mutationCb:me,scrollCb:ye,bypassOptions:{blockClass:s,blockSelector:l,maskTextClass:g,maskTextSelector:y,inlineStylesheet:w,maskInputOptions:he,dataURLOptions:oe,maskTextFn:M,maskInputFn:C,maskAllElementAttributes:I,maskAttributeFn:E,recordCanvas:U,canvasMaskingConfigured:xe,inlineImages:X,sampling:O,slimDOMOptions:ce,iframeManager:ke,stylesheetManager:we,canvasManager:js,keepIframeSrcFn:re,processedNodeManager:Se,attributeFilter:ae},mirror:Gs});qs=function(e){if(void 0===e&&(e=!1),B){pa(k);try{Ns({type:An.Meta,data:{href:window.location.href,width:jo(),height:qo()}},e),null==t||t.cancel(),t=void 0,we.reset(),Ce.init(),os.forEach((e=>e.lock()));var r,i=null;try{i=function(e,t){var r=t||{},i=r.mirror,n=void 0===i?new ja:i,a=r.blockClass,o=void 0===a?"rr-block":a,s=r.blockSelector,u=void 0===s?null:s,l=r.maskTextClass,h=void 0===l?"rr-mask":l,c=r.maskTextSelector,d=void 0===c?null:c,v=r.inlineStylesheet,f=void 0===v||v,p=r.inlineImages,g=void 0!==p&&p,m=r.recordCanvas,y=void 0!==m&&m,b=r.canvasMaskingConfigured,w=r.maskAllInputs,k=void 0!==w&&w,_=r.maskTextFn,S=r.maskInputFn,x=r.maskAllElementAttributes,C=void 0!==x&&x,M=r.maskAttributeFn,T=r.slimDOM,I=r.dataURLOptions,E=r.preserveWhiteSpace,R=r.onSerialize,A=r.onIframeLoad,L=r.iframeLoadTimeout,O=r.onIframeListenerRegistered,P=r.onStylesheetLoad,D=r.stylesheetLoadTimeout,F=r.keepIframeSrcFn,N=void 0===F?()=>!1:F,q=r.maxDepth,j=r.inlineStylesheetBudgetRules,B=!0===k?{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===k?{password:!0}:k,H=To(void 0!==T&&T);pa(j);try{return Mo(e,{doc:e,mirror:n,blockClass:o,blockSelector:u,maskTextClass:h,maskTextSelector:d,skipChild:!1,inlineStylesheet:f,maskInputOptions:B,maskTextFn:_,maskInputFn:S,maskAllElementAttributes:C,maskAttributeFn:M,slimDOMOptions:H,dataURLOptions:I,inlineImages:g,recordCanvas:y,canvasMaskingConfigured:b,preserveWhiteSpace:E,onSerialize:R,onIframeLoad:A,iframeLoadTimeout:L,onIframeListenerRegistered:O,onStylesheetLoad:P,stylesheetLoadTimeout:D,keepIframeSrcFn:N,newlyAddedElement:!1,maxDepth:q})}finally{ga()}}(document,{mirror:Gs,blockClass:s,blockSelector:l,maskTextClass:g,maskTextSelector:y,inlineStylesheet:w,maskAllInputs:he,inlineStylesheetBudgetRules:k,maskTextFn:M,maskInputFn:C,maskAllElementAttributes:I,maskAttributeFn:E,slimDOM:ce,dataURLOptions:oe,recordCanvas:U,canvasMaskingConfigured:xe,inlineImages:X,onSerialize(e){zo(e,Gs)&&ke.addIframe(e),Vo(e,Gs)&&we.trackLinkElement(e),Zo(e)&&Ce.addShadowRoot(Qn.shadowRoot(e),document)},onIframeLoad(e,t){ke.attachIframe(e,t),Ce.observeAttachShadow(e)},onIframeListenerRegistered(e,t){ke.registerLoadListenerDisposer(e,t)},onStylesheetLoad(e,t){we.attachLinkElement(e,t)},keepIframeSrcFn:re})}finally{a=la,la=[],r=a}if(!i)return console.warn("Failed to snapshot the document");if(Ns({type:An.FullSnapshot,data:{node:i,initialOffset:No(window)}},e),os.forEach((e=>e.unlock())),js.onFullSnapshot(),r.length){var n=function(e,t,r){var i=!1,n=null,a=0,o=null,s=()=>null!==o||e.length>a,u=()=>{var r=e[a];e[a]=null,a+=1,r&&Ao((()=>{o=t.beginDeferredLinkInlining(r,Gs.getId(r))}))},l=()=>{if(o){var e=o,t=!0;Ao((()=>{t=e.advance(200)})),t&&(o=null)}},h=e=>{if(n=null,!i){var t=0;do{try{o||u(),l()}catch(e){null==o||o.discard(),o=null,xa(1)}t+=1}while(!i&&s()&&(e?!e.didTimeout&&e.timeRemaining()>5:10>t));i||(s()?n=Js(h):r())}};return n=Js(h),{cancel(){i=!0,null==o||o.discard(),o=null,null==n||n.cancel(),n=null},flush(){if(!i){i=!0,null==n||n.cancel(),n=null;for(var t=0,h=0;s()&&50>t;){o||u();var c=o;if(c)if(Math.floor(c.remainingRules()/200)+1>50-t)c.discard(),o=null,h+=1;else{try{l()}catch(e){null==o||o.discard(),o=null,h+=1}t+=1}}if(s()||h>0){for(var d=h+(null!==o?1:0),v=a;e.length>v;v++)null!==e[v]&&(d+=1);xa(d),null==o||o.discard(),o=null}r()}}}}(r,we,(()=>{t===n&&(t=void 0)}));t=n}z&&ke.reattachIframes(),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&we.adoptStyleSheets(document.adoptedStyleSheets,Gs.getId(document))}finally{ga()}var a}};try{var Me=[];for(var Te of(Me.push(Eo("pagehide",(()=>{try{null==t||t.flush()}catch(e){}t=void 0}),window)),["visibilitychange","freeze","resume"]))Me.push(Eo(Te,ea,document));de=e=>{var t=pe.get(e);t&&(t.forEach((e=>{Ao(e);var t=Me.indexOf(e);-1!==t&&Me.splice(t,1)})),pe.delete(e))},ve=()=>{for(var e of pe){var t=e[0],r=Gs.getNode(t);if(r)try{r.contentDocument&&r.contentDocument.defaultView||null==de||de(t)}catch(e){null==de||de(t)}else null==de||de(t)}};var Ie=e=>{var t;return as(ms)({mutationCb:me,mousemoveCb:(e,t)=>Ns({type:An.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>Ns({type:An.IncrementalSnapshot,data:h({source:Ln.MouseInteraction},e)}),scrollCb:ye,viewportResizeCb:e=>Ns({type:An.IncrementalSnapshot,data:h({source:Ln.ViewportResize},e)}),inputCb:e=>Ns({type:An.IncrementalSnapshot,data:h({source:Ln.Input},e)}),mediaInteractionCb:e=>Ns({type:An.IncrementalSnapshot,data:h({source:Ln.MediaInteraction},e)}),styleSheetRuleCb:e=>Ns({type:An.IncrementalSnapshot,data:h({source:Ln.StyleSheetRule},e)}),styleDeclarationCb:e=>Ns({type:An.IncrementalSnapshot,data:h({source:Ln.StyleDeclaration},e)}),canvasMutationCb:be,fontCb:e=>Ns({type:An.IncrementalSnapshot,data:h({source:Ln.Font},e)}),selectionCb(e){Ns({type:An.IncrementalSnapshot,data:h({source:Ln.Selection},e)})},customElementCb(e){Ns({type:An.IncrementalSnapshot,data:h({source:Ln.CustomElement},e)})},blockClass:s,ignoreClass:d,ignoreSelector:f,maskTextClass:g,maskTextSelector:y,maskInputOptions:he,inlineStylesheet:w,sampling:O,recordDOM:B,recordCanvas:U,canvasMaskingConfigured:xe,inlineImages:X,userTriggeredOnInput:Q,collectFonts:Y,doc:e,maskInputFn:C,maskTextFn:M,maskAllElementAttributes:I,maskAttributeFn:E,keepIframeSrcFn:re,blockSelector:l,slimDOMOptions:ce,dataURLOptions:oe,mirror:Gs,iframeManager:ke,stylesheetManager:we,shadowDomManager:Ce,processedNodeManager:Se,canvasManager:js,ignoreCSSAttributes:ne,attributeFilter:ae,plugins:(null==(t=null==ee?void 0:ee.filter((e=>e.observer)))?void 0:t.map((e=>({observer:e.observer,options:e.options,callback:t=>Ns({type:An.Plugin,data:{plugin:e.name,payload:t}})}))))||[]},R)};ke.addLoadListener((e=>{try{var t=Gs.getId(e),r=Ie(e.contentDocument);if("function"==typeof r&&(Me.push(r),-1!==t)){var i=pe.get(t);i||pe.set(t,i=new Set),i.add(r)}}catch(e){console.warn(e)}})),ke.addPageHideListener((e=>{var t=Gs.getId(e);null==de||de(t),hs(e)}));var Ee=-1,Re=e=>Ns({type:An.Custom,data:{tag:"rrweb/fullscreen",payload:e}}),Ae=()=>{var e,t,r,i,n=document,a=null!==(e=null!==(t=null!==(r=null!==(i=n.fullscreenElement)&&void 0!==i?i:n.webkitFullscreenElement)&&void 0!==r?r:n.mozFullScreenElement)&&void 0!==t?t:n.msFullscreenElement)&&void 0!==e?e:null,o=a?Gs.getId(a):-1;o!==Ee&&(-1!==Ee&&Re({id:Ee,enter:!1}),Ee=o,-1!==o&&Re({id:o,enter:!0}))},Le=()=>{qs();var e=Ie(document);"function"==typeof e&&Me.push(e),Me.push(Eo("fullscreenchange",Ae)),Me.push(Eo("webkitfullscreenchange",Ae)),Me.push(Eo("mozfullscreenchange",Ae)),Me.push(Eo("MSFullscreenChange",Ae)),Vs=!0};return["interactive","complete"].includes(document.readyState)?Le():(Me.push(Eo("DOMContentLoaded",(()=>{Ns({type:An.DomContentLoaded,data:{}}),"DOMContentLoaded"===Z&&Le()}))),Me.push(Eo("load",(()=>{Ns({type:An.Load,data:{}}),"load"===Z&&Le()}),window))),()=>{try{null==t||t.flush()}catch(e){}t=void 0,Me.forEach((e=>Ao(e))),Se.destroy(),ke.removeLoadListener(),ke.destroy(),pe.clear(),Ce.reset(),Gs.reset(),Vs=!1,Xo=void 0}}catch(e){console.warn(e)}}Ys.addCustomEvent=(e,t)=>{if(!Vs)throw new Error("please add custom event after start recording");Ns({type:An.Custom,data:{tag:e,payload:t}})},Ys.freezePage=()=>{os.forEach((e=>e.freeze()))},Ys.takeFullSnapshot=e=>{if(!Vs)throw new Error("please take full snapshot after start recording");qs(e)},Ys.mirror=Gs;var Ks=Object.defineProperty,Xs=(e,t,r)=>((e,t,r)=>t in e?Ks(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);class eu{constructor(e){Xs(this,"fileName"),Xs(this,"functionName"),Xs(this,"lineNumber"),Xs(this,"columnNumber"),this.fileName=e.fileName||"",this.functionName=e.functionName||"",this.lineNumber=e.lineNumber,this.columnNumber=e.columnNumber}toString(){var e=this.lineNumber||"",t=this.columnNumber||"";return this.functionName?this.functionName+" ("+this.fileName+":"+e+":"+t+")":this.fileName+":"+e+":"+t}}var tu=/(^|@)\S+:\d+/,ru=/^\s*at .*(\S+:\d+|\(native\))/m,iu=/^(eval@)?(\[native code])?$/,nu={parse(e){return e?void 0!==e.stacktrace||void 0!==e["opera#sourceloc"]?this.parseOpera(e):e.stack&&e.stack.match(ru)?this.parseV8OrIE(e):e.stack?this.parseFFOrSafari(e):[]:[]},extractLocation(e){if(-1===e.indexOf(":"))return[e];var t=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));if(!t)throw new Error("Cannot parse given url: "+e);return[t[1],t[2]||void 0,t[3]||void 0]},parseV8OrIE(e){return e.stack.split("\n").filter((function(e){return!!e.match(ru)}),this).map((function(e){e.indexOf("(eval ")>-1&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));var t=e.replace(/^\s+/,"").replace(/\(eval code/g,"("),r=t.match(/ (\((.+):(\d+):(\d+)\)$)/),i=(t=r?t.replace(r[0],""):t).split(/\s+/).slice(1),n=this.extractLocation(r?r[1]:i.pop()),a=i.join(" ")||void 0,o=["eval","<anonymous>"].indexOf(n[0])>-1?void 0:n[0];return new eu({functionName:a,fileName:o,lineNumber:n[1],columnNumber:n[2]})}),this)},parseFFOrSafari(e){return e.stack.split("\n").filter((function(e){return!e.match(iu)}),this).map((function(e){if(e.indexOf(" > eval")>-1&&(e=e.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===e.indexOf("@")&&-1===e.indexOf(":"))return new eu({functionName:e});var t=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=e.match(t),i=r&&r[1]?r[1]:void 0,n=this.extractLocation(e.replace(t,""));return new eu({functionName:i,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})}),this)},parseOpera(e){return!e.stacktrace||e.message.indexOf("\n")>-1&&e.message.split("\n").length>e.stacktrace.split("\n").length?this.parseOpera9(e):e.stack?this.parseOpera11(e):this.parseOpera10(e)},parseOpera9(e){for(var t=/Line (\d+).*script (?:in )?(\S+)/i,r=e.message.split("\n"),i=[],n=2,a=r.length;a>n;n+=2){var o=t.exec(r[n]);o&&i.push(new eu({fileName:o[2],lineNumber:parseFloat(o[1])}))}return i},parseOpera10(e){for(var t=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,r=e.stacktrace.split("\n"),i=[],n=0,a=r.length;a>n;n+=2){var o=t.exec(r[n]);o&&i.push(new eu({functionName:o[3]||void 0,fileName:o[2],lineNumber:parseFloat(o[1])}))}return i},parseOpera11(e){return e.stack.split("\n").filter((function(e){return!!e.match(tu)&&!e.match(/^Error created at/)}),this).map((function(e){var t=e.split("@"),r=this.extractLocation(t.pop()),i=(t.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new eu({functionName:i,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})}),this)}};function au(e){if(!e||!e.outerHTML)return"";for(var t="";e.parentElement;){var r=e.localName;if(!r)break;r=r.toLowerCase();var i=e.parentElement,n=[];if(i.children&&i.children.length>0)for(var a=0;i.children.length>a;a++){var o=i.children[a];o.localName&&o.localName.toLowerCase&&o.localName.toLowerCase()===r&&n.push(o)}n.length>1&&(r+=":eq("+n.indexOf(e)+")"),t=r+(t?">"+t:""),e=i}return t}function ou(e){return Array.isArray(e)}function su(e){return"object"==typeof e&&null!==e&&!ou(e)}function uu(e,t){if(0===t)return!0;var r=Object.keys(e);for(var i of r)if(su(e[i])&&uu(e[i],t-1))return!0;return!1}function lu(e,t){var r={numOfKeysLimit:50,depthOfLimit:4};Object.assign(r,t);var i=[],n=[];return JSON.stringify(e,(function(e,t){if(i.length>0){var a=i.indexOf(this);~a?i.splice(a+1):i.push(this),~a?n.splice(a,1/0,e):n.push(e),~i.indexOf(t)&&(t=i[0]===t?"[Circular ~]":"[Circular ~."+n.slice(0,i.indexOf(t)).join(".")+"]")}else i.push(t);if(null===t)return t;if(void 0===t)return"undefined";if(su(o=t)&&Object.keys(o).length>r.numOfKeysLimit||"function"==typeof o||su(o)&&uu(o,r.depthOfLimit))return function(e){var t=e.toString();return r.stringLengthLimit&&t.length>r.stringLengthLimit&&(t=t.slice(0,r.stringLengthLimit)+"..."),t}(t);var o;if("bigint"==typeof t)return t.toString()+"n";if(t instanceof Event){var s={};for(var u in t){var l=t[u];s[u]=ou(l)?au(l.length?l[0]:null):l}return s}return t instanceof Node?t instanceof HTMLElement?t?t.outerHTML:"":t.nodeName:t instanceof Error?t.stack?t.stack+"\nEnd of stack for Error object":t.name+": "+t.message:t}))}var hu={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 cu(e,t,r){var i,n=r?Object.assign({},hu,r):hu,a=n.logger;if(!a)return()=>{};i="string"==typeof a?t[a]:a;var o=0,s=!1,u=[];if(n.level.includes("error")){var l=t=>{var r=t.message,i=nu.parse(t.error).map((e=>e.toString())),a=[lu(r,n.stringifyOptions)];e({level:"error",trace:i,payload:a})};t.addEventListener("error",l),u.push((()=>{t.removeEventListener("error",l)}));var h=t=>{var r,i;t.reason instanceof Error?i=[lu("Uncaught (in promise) "+(r=t.reason).name+": "+r.message,n.stringifyOptions)]:(r=new Error,i=[lu("Uncaught (in promise)",n.stringifyOptions),lu(t.reason,n.stringifyOptions)]);var a=nu.parse(r).map((e=>e.toString()));e({level:"error",trace:a,payload:i})};t.addEventListener("unhandledrejection",h),u.push((()=>{t.removeEventListener("unhandledrejection",h)}))}for(var c of n.level)u.push(d(i,c));return()=>{u.forEach((e=>e()))};function d(t,r){var i=this;return t[r]?function(t,a,u){try{if(!(a in t))return()=>{};var l=t[a],h={next:l},c=(t=>function(){for(var a=arguments.length,u=new Array(a),l=0;a>l;l++)u[l]=arguments[l];if(t.apply(i,u),!("assert"===r&&u[0]||s)){s=!0;try{var h=nu.parse(new Error).map((e=>e.toString())).splice(1),c=("assert"===r?u.slice(1):u).map((e=>lu(e,n.stringifyOptions)));o++,n.lengthThreshold>o?e({level:r,trace:h,payload:c}):o===n.lengthThreshold&&e({level:"warn",trace:[],payload:[lu("The number of log records reached the threshold.")]})}catch(e){t("rrweb logger error:",e,...u)}finally{s=!1}}})((function(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];return h.next.apply(this,t)}));return"function"==typeof c&&(c.prototype=c.prototype||{},Object.defineProperties(c,{__rrweb_original__:{enumerable:!1,value:l},__rrweb_layer__:{enumerable:!1,value:h}})),t[a]=c,()=>{if(t[a]!==c)for(var e=e=>{var t;return"function"==typeof e?null!==(t=e.__rrweb_layer__)&&void 0!==t?t:e.__posthog_layer__:void 0},r=t[a],i=e(r);i;){if(i.next===c)return void(i.next=h.next);i=e(r=i.next)}else t[a]=h.next}}catch(e){return()=>{}}}(t,r):()=>{}}}var du=e=>({name:"rrweb/console@1",observer:cu,options:e}),vu=e=>"undefined"!=typeof Document&&e instanceof Document,fu=()=>{},pu=e=>{var t;if(k(e))return null!==(t=e.__posthog_layer__)&&void 0!==t?t:e.__rrweb_layer__};function gu(e,t,r){try{if(!(t in e))return fu;var i={next:e[t]},n=r((function(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];return i.next.apply(this,t)}));return k(n)&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__posthog_wrapped__:{enumerable:!1,value:!0},__posthog_layer__:{enumerable:!1,value:i}})),e[t]=n,()=>{if(e[t]!==n)for(var r=e[t],a=pu(r);a;){if(a.next===n)return void(a.next=i.next);a=pu(r=a.next)}else e[t]=i.next}}catch(e){return fu}}function mu(e,t){var r,i=function(e){try{return"string"==typeof e?new URL(e).hostname:"url"in e?new URL(e.url).hostname:e.hostname}catch(e){return null}}(e),n={hostname:i,isHostDenied:!1};if(null==(r=t.payloadHostDenyList)||!r.length||null==i||!i.trim().length)return n;for(var a of t.payloadHostDenyList)if(i.endsWith(a))return{hostname:i,isHostDenied:!0};return n}var yu=Oe("[Recorder]"),bu=e=>"navigation"===e.entryType,wu=e=>"resource"===e.entryType;function ku(e,t){return!!t&&(E(t)||t[e])}function _u(e){if("undefined"==typeof Request)return!1;if(e instanceof Request)return!0;try{return"[object Request]"==={}.toString.call(e)}catch(e){return!1}}var Su=["image/","video/","audio/","font/","application/octet-stream","application/pdf","application/zip","application/wasm"];function xu(e){var t=e.type,r=e.recordBody,i=e.headers;function n(e){var t=Object.keys(i).find((e=>"content-type"===e.toLowerCase())),r=t&&i[t];return e.some((e=>null==r?void 0:r.toLowerCase().includes(e)))}if(!r)return!1;if(function e(t){try{return"string"==typeof t?t.startsWith("blob:"):t instanceof URL?"blob:"===t.protocol:!!_u(t)&&e(t.url)}catch(e){return!1}}(e.url))return!1;if(n(Su))return!1;if(E(r))return!0;if(w(r))return n(r);var a=r[t];return E(a)?a:n(a)}function Cu(e,t,r,i,n,a){return Mu.apply(this,arguments)}function Mu(){return Mu=l((function*(e,t,r,i,n,a){if(void 0===a&&(a=0),a>10)return yu.warn("Failed to get performance entry for request",{url:r,initiatorType:t}),null;var o=function(e,r){for(var a=e.length-1;a>=0;a-=1)if(wu(o=e[a])&&o.initiatorType===t&&(S(i)||o.startTime>=i)&&(S(n)||n>=o.startTime))return e[a];var o}(e.performance.getEntriesByName(r));return o||(yield new Promise((e=>setTimeout(e,50*a))),Cu(e,t,r,i,n,a+1))})),Mu.apply(this,arguments)}function Tu(e){var t=e.body,r=e.options,i=e.url;if(T(t))return null;var n=mu(i,r);if(n.isHostDenied)return n.hostname+" is in deny list";if(x(t))return t;if(vu(t))return t.textContent;if(R(t))return Be(t);if(_(t))try{return JSON.stringify(t)}catch(e){return"[SessionReplay] Failed to stringify response object"}return"[SessionReplay] Cannot read body of type "+toString.call(t)}var Iu=e=>!M(e)&&("navigation"===e.entryType||"resource"===e.entryType);function Eu(e){var t=e.entry,r=e.method,i=e.status,n=e.networkRequest,a=e.isInitial,o=e.start,s=e.end,u=e.url,l=e.initiatorType;o=t?t.startTime:o,s=t?t.responseEnd:s;var c=Math.floor(Date.now()-performance.now()),d=Math.floor(c+(o||0)),v=[h({},t?t.toJSON():{name:u},{startTime:S(o)?void 0:Math.round(o),endTime:S(s)?void 0:Math.round(s),timeOrigin:c,timestamp:d,method:r,initiatorType:l||(t?t.initiatorType:void 0),status:i,requestHeaders:n.requestHeaders,requestBody:n.requestBody,responseHeaders:n.responseHeaders,responseBody:n.responseBody,isInitial:a})];if(Iu(t))for(var f of t.serverTiming||[])v.push({timeOrigin:c,timestamp:d,startTime:Math.round(t.startTime),name:f.name,duration:f.duration,entryType:"serverTiming"});return v}var Ru=["video/","audio/"];function Au(e){return _(e)&&k(e.getReader)&&k(e.tee)}var Lu=500,Ou="[SessionReplay] Timeout while trying to read body",Pu="[SessionReplay] Failed to read body";function Du(e){return Pu+": "+e}function Fu(e){return"[SessionReplay] Body too large to record (> "+e+" bytes)"}function Nu(e,t){if(!t.streamNetworkBody)return function(e){return new Promise((t=>{var r=setTimeout((()=>t(Ou)),Lu);try{e.clone().text().then((e=>t(e)),(e=>t(Du(e)))).finally((()=>clearTimeout(r)))}catch(e){clearTimeout(r),t(Pu)}}))}(e);var r=wt(t);return function(e,t){try{var r,i=null==(r=e.headers)||null==r.get?void 0:r.get("content-length");if(!i)return!1;var n=parseInt(i,10);return Number.isFinite(n)&&n>t}catch(e){return!1}}(e,r)?Promise.resolve(Fu(r)):function(e,t){return new Promise((r=>{var i,n=!1;function a(){try{var e;null==(e=i)||e.cancel()}catch(e){}}function o(e){n||(n=!0,clearTimeout(u),a(),r(e))}var s,u=setTimeout((()=>o(Ou)),Lu);try{s=e.clone()}catch(e){return void o(Pu)}var l=s.body;if(Au(l)&&"undefined"!=typeof TextDecoder){try{i=l.getReader()}catch(e){return void o(Pu)}var h=[],c=0;!function e(){i.read().then((r=>{var i=r.done,s=r.value;if(n)a();else if(i)o((new TextDecoder).decode(function(e,t){var r=new Uint8Array(t),i=0;for(var n of e)r.set(n,i),i+=n.byteLength;return r}(h,c)));else{if(s){if(c+s.byteLength>t)return void o(Fu(t));c+=s.byteLength,h.push(s)}e()}}),(e=>o(Du(e))))}()}else try{s.text().then((e=>o(e)),(e=>o(Du(e))))}catch(e){o(Pu)}}))}(e,r)}function qu(){return qu=l((function*(e){var t=e.r,r=e.options,i=mu(e.url,r);return i.isHostDenied?Promise.resolve(i.hostname+" is in deny list"):Nu(t,r)})),qu.apply(this,arguments)}function ju(){return ju=l((function*(e){var t=e.r,r=e.options,i=function(e){var t,r=e.r,i=e.options,n=e.url;if("chunked"===r.headers.get("Transfer-Encoding"))return"Chunked Transfer-Encoding is not supported";var a=null==(t=r.headers.get("Content-Type"))?void 0:t.toLowerCase(),o=Ru.some((e=>null==a?void 0:a.startsWith(e)));if(a&&o)return"Content-Type "+a+" is not supported";var s=mu(n,i);return s.isHostDenied?s.hostname+" is in deny list":null}({r:t,options:r,url:e.url});return M(i)?Nu(t,r):Promise.resolve(i)})),ju.apply(this,arguments)}var Bu=null;function Hu(e,t,r){if(!("performance"in t))return()=>{};if(Bu)return yu.warn("Network observer already initialised, doing nothing"),()=>{};var i=r?Object.assign({},kt,r):kt,n=t=>{var r=[],n=!1;t.requests.forEach((e=>{var t="serverTiming"===e.entryType;if(!t||!n){var a=i.maskRequestFn(e);t||(n=!a||(e=>!!e&&Et.has(e))(a)),a&&r.push(a)}})),r.length>0&&e(h({},t,{requests:r}))},a=function(e,t,r){if(r.recordInitialRequests){var i=t.performance.getEntries().filter((e=>bu(e)||wu(e)&&r.initiatorTypes.includes(e.initiatorType)));e({requests:i.flatMap((e=>Eu({entry:e,method:void 0,status:void 0,networkRequest:{},isInitial:!0}))),isInitial:!0})}var n=new t.PerformanceObserver((t=>{var i=t.getEntries().filter((e=>bu(e)||wu(e)&&r.initiatorTypes.includes(e.initiatorType)&&(e=>!r.recordBody&&!r.recordHeaders||"xmlhttprequest"!==e.initiatorType&&"fetch"!==e.initiatorType)(e)));e({requests:i.flatMap((e=>Eu({entry:e,method:void 0,status:void 0,networkRequest:{}})))})})),a=PerformanceObserver.supportedEntryTypes.filter((e=>r.performanceEntryTypeToObserve.includes(e)));return n.observe({entryTypes:a}),()=>{n.disconnect()}}(n,t,i),o=()=>{},s=()=>{};return(i.recordHeaders||i.recordBody)&&(o=function(e,t,r){if(!r.initiatorTypes.includes("xmlhttprequest"))return()=>{};var i=ku("request",r.recordHeaders),n=ku("response",r.recordHeaders),a=gu(t.XMLHttpRequest.prototype,"open",(a=>function(o,s,u,l,h){void 0===u&&(u=!0);var c=this;try{var d,v,f=new Request(s),p={},g={},m=c.setRequestHeader.bind(c);c.setRequestHeader=(e,t)=>(g[e]=t,m(e,t)),i&&(p.requestHeaders=g);var y=c.send.bind(c);c.send=e=>(xu({type:"request",headers:g,url:s,recordBody:r.recordBody})&&(p.requestBody=Tu({body:e,options:r,url:s})),d=t.performance.now(),y(e));var b=()=>{c.removeEventListener("readystatechange",w),c.removeEventListener("error",b),c.removeEventListener("abort",b),c.removeEventListener("timeout",b)},w=()=>{if(c.readyState===c.DONE){b(),v=t.performance.now();var i={};c.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach((e=>{var t=e.split(": "),r=t.shift(),n=t.join(": ");r&&(i[r]=n)})),n&&(p.responseHeaders=i),xu({type:"response",headers:i,url:s,recordBody:r.recordBody})&&(p.responseBody=Tu({body:c.response,options:r,url:s})),Cu(t,"xmlhttprequest",f.url,d,v).then((t=>{var r=Eu({entry:t,method:o,status:null==c?void 0:c.status,networkRequest:p,start:d,end:v,url:s.toString(),initiatorType:"xmlhttprequest"});e({requests:r})})).catch((()=>{}))}};c.addEventListener("readystatechange",w),c.addEventListener("error",b),c.addEventListener("abort",b),c.addEventListener("timeout",b)}catch(e){yu.error("Failed to instrument XHR for network capture",e)}a.call(c,o,s.toString(),u,l,h)}));return()=>{a()}}(n,t,i),s=function(e,t,r){if(!r.initiatorTypes.includes("fetch"))return()=>{};var i=ku("request",r.recordHeaders),n=ku("response",r.recordHeaders),a=gu(t,"fetch",(a=>function(){var o=l((function*(o,s){var u,l;try{u=new Request(o,s)}catch(e){return yu.error("Failed to instrument fetch for network capture",e),a(o,s)}var h,c,d={};try{try{var v={};u.headers.forEach(((e,t)=>{v[t]=e})),i&&(d.requestHeaders=v),!Au(null==s?void 0:s.body)&&xu({type:"request",headers:v,url:o,recordBody:r.recordBody})&&(d.requestBody=yield function(e){return qu.apply(this,arguments)}({r:u,options:r,url:o}))}catch(e){yu.error("Failed to record fetch request for network capture",e)}h=t.performance.now(),l=_u(o)?yield a(u):yield a(o,s),c=t.performance.now();var f={};return l.headers.forEach(((e,t)=>{f[t]=e})),n&&(d.responseHeaders=f),xu({type:"response",headers:f,url:o,recordBody:r.recordBody})&&(d.responseBody=yield function(e){return ju.apply(this,arguments)}({r:l,options:r,url:o})),l}finally{Cu(t,"fetch",u.url,h,c).then((t=>{var r,i=Eu({entry:t,method:u.method,status:null==(r=l)?void 0:r.status,networkRequest:d,start:h,end:c,url:u.url,initiatorType:"fetch"});e({requests:i})})).catch((()=>{}))}}));return function(e,t){return o.apply(this,arguments)}}()));return()=>{a()}}(n,t,i)),Bu=()=>{a(),o(),s(),Bu=null}}var $u=e=>({name:"rrweb/network@1",observer:Hu,options:e});s.__PosthogExtensions__=s.__PosthogExtensions__||{},s.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:du,getRecordNetworkPlugin:$u},s.__PosthogExtensions__.rrweb={record:Ys,version:"v2",wasMaxDepthReached:()=>Co,resetMaxDepthState(){Co=!1,xo=!1},getLastSnapshotCost:()=>sa,getMutationCost:()=>h({},da),resetSnapshotCostState(){ia=0,na=0,aa=0,Kn=0,oa=Jn(),sa=null,ua=null,la=[],ha=0,ca=0,da={slowestBatchMs:0},va={deferredCount:0,failedCount:0,abandonedCount:0,totalMs:0,slowestSliceMs:0}}},s.rrweb={record:Ys,version:"v2"},s.rrwebConsoleRecord={getRecordConsolePlugin:du},s.getRecordNetworkPlugin=$u,s.__PosthogExtensions__=s.__PosthogExtensions__||{},s.__PosthogExtensions__.initSessionRecording=(e,t)=>new Mn(e,t);var Uu,Wu,zu,Vu,Zu,Gu,Qu,Ju,Yu,Ku,Xu,el,tl,rl,il,nl={},al=[],ol=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,sl=Array.isArray;function ul(e,t){for(var r in t)e[r]=t[r];return e}function ll(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function hl(e,t,r){var i,n,a,o={};for(a in t)"key"==a?i=t[a]:"ref"==a?n=t[a]:o[a]=t[a];if(arguments.length>2&&(o.children=arguments.length>3?Uu.call(arguments,2):r),"function"==typeof e&&null!=e.defaultProps)for(a in e.defaultProps)void 0===o[a]&&(o[a]=e.defaultProps[a]);return cl(e,o,i,n,null)}function cl(e,t,r,i,n){var a={type:e,props:t,key:r,ref:i,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==n?++zu:n,__i:-1,__u:0};return null==n&&null!=Wu.vnode&&Wu.vnode(a),a}function dl(e){return e.children}function vl(e,t){this.props=e,this.context=t}function fl(e,t){if(null==t)return e.__?fl(e.__,e.__i+1):null;for(var r;e.__k.length>t;t++)if(null!=(r=e.__k[t])&&null!=r.__e)return r.__e;return"function"==typeof e.type?fl(e):null}function pl(e){if(e.__P&&e.__d){var t=e.__v,r=t.__e,i=[],n=[],a=ul({},t);a.__v=t.__v+1,Wu.vnode&&Wu.vnode(a),Cl(e.__P,a,t,e.__n,e.__P.namespaceURI,32&t.__u?[r]:null,i,null==r?fl(t):r,!!(32&t.__u),n),a.__v=t.__v,a.__.__k[a.__i]=a,Tl(i,a,n),t.__e=t.__=null,a.__e!=r&&gl(a)}}function gl(e){if(null!=(e=e.__)&&null!=e.__c)return e.__e=e.__c.base=null,e.__k.some((function(t){if(null!=t&&null!=t.__e)return e.__e=e.__c.base=t.__e})),gl(e)}function ml(e){(!e.__d&&(e.__d=!0)&&Vu.push(e)&&!yl.__r++||Zu!=Wu.debounceRendering)&&((Zu=Wu.debounceRendering)||Gu)(yl)}function yl(){try{for(var e,t=1;Vu.length;)Vu.length>t&&Vu.sort(Qu),e=Vu.shift(),t=Vu.length,pl(e)}finally{Vu.length=yl.__r=0}}function bl(e,t,r,i,n,a,o,s,u,l,h){var c,d,v,f,p,g,m,y=i&&i.__k||al,b=t.length;for(u=function(e,t,r,i,n){var a,o,s,u,l,h=r.length,c=h,d=0;for(e.__k=new Array(n),a=0;n>a;a++)null!=(o=t[a])&&"boolean"!=typeof o&&"function"!=typeof o?("string"==typeof o||"number"==typeof o||"bigint"==typeof o||o.constructor==String?o=e.__k[a]=cl(null,o,null,null,null):sl(o)?o=e.__k[a]=cl(dl,{children:o},null,null,null):void 0===o.constructor&&o.__b>0?o=e.__k[a]=cl(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):e.__k[a]=o,u=a+d,o.__=e,o.__b=e.__b+1,s=null,-1!=(l=o.__i=kl(o,r,u,c))&&(c--,(s=r[l])&&(s.__u|=2)),null==s||null==s.__v?(-1==l&&(n>h?d--:h>n&&d++),"function"!=typeof o.type&&(o.__u|=4)):l!=u&&(l==u-1?d--:l==u+1?d++:(l>u?d--:d++,o.__u|=4))):e.__k[a]=null;if(c)for(a=0;h>a;a++)null!=(s=r[a])&&0==(2&s.__u)&&(s.__e==i&&(i=fl(s)),Rl(s,s));return i}(r,t,y,u,b),c=0;b>c;c++)null!=(v=r.__k[c])&&(d=-1!=v.__i&&y[v.__i]||nl,v.__i=c,g=Cl(e,v,d,n,a,o,s,u,l,h),f=v.__e,v.ref&&d.ref!=v.ref&&(d.ref&&El(d.ref,null,v),h.push(v.ref,v.__c||f,v)),null==p&&null!=f&&(p=f),(m=!!(4&v.__u))||d.__k===v.__k?(u=wl(v,u,e,m),m&&d.__e&&(d.__e=null)):"function"==typeof v.type&&void 0!==g?u=g:f&&(u=f.nextSibling),v.__u&=-7);return r.__e=p,u}function wl(e,t,r,i){var n,a;if("function"==typeof e.type){for(n=e.__k,a=0;n&&n.length>a;a++)n[a]&&(n[a].__=e,t=wl(n[a],t,r,i));return t}e.__e!=t&&(i&&(t&&e.type&&!t.parentNode&&(t=fl(e)),r.insertBefore(e.__e,t||null)),t=e.__e);do{t=t&&t.nextSibling}while(null!=t&&8==t.nodeType);return t}function kl(e,t,r,i){var n,a,o,s=e.key,u=e.type,l=t[r],h=null!=l&&0==(2&l.__u);if(null===l&&null==s||h&&s==l.key&&u==l.type)return r;if(i>(h?1:0))for(n=r-1,a=r+1;n>=0||t.length>a;)if(null!=(l=t[o=0>n?a++:n--])&&0==(2&l.__u)&&s==l.key&&u==l.type)return o;return-1}function _l(e,t,r){"-"==t[0]?e.setProperty(t,null==r?"":r):e[t]=null==r?"":"number"!=typeof r||ol.test(t)?r:r+"px"}function Sl(e,t,r,i,n){var a,o;e:if("style"==t)if("string"==typeof r)e.style.cssText=r;else{if("string"==typeof i&&(e.style.cssText=i=""),i)for(t in i)r&&t in r||_l(e.style,t,"");if(r)for(t in r)i&&r[t]==i[t]||_l(e.style,t,r[t])}else if("o"==t[0]&&"n"==t[1])a=t!=(t=t.replace(Xu,"$1")),o=t.toLowerCase(),t=o in e||"onFocusOut"==t||"onFocusIn"==t?o.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+a]=r,r?i?r[Ku]=i[Ku]:(r[Ku]=el,e.addEventListener(t,a?rl:tl,a)):e.removeEventListener(t,a?rl:tl,a);else{if("http://www.w3.org/2000/svg"==n)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=t&&"height"!=t&&"href"!=t&&"list"!=t&&"form"!=t&&"tabIndex"!=t&&"download"!=t&&"rowSpan"!=t&&"colSpan"!=t&&"role"!=t&&"popover"!=t&&t in e)try{e[t]=null==r?"":r;break e}catch(e){}"function"==typeof r||(null==r||!1===r&&"-"!=t[4]?e.removeAttribute(t):e.setAttribute(t,"popover"==t&&1==r?"":r))}}function xl(e){return function(t){if(this.l){var r=this.l[t.type+e];if(null==t[Yu])t[Yu]=el++;else if(r[Ku]>t[Yu])return;return r(Wu.event?Wu.event(t):t)}}}function Cl(e,t,r,i,n,a,o,s,u,l){var h,c,d,v,f,p,g,m,y,b,$,w,k,_,S,x,C=t.type;if(void 0!==t.constructor)return null;128&r.__u&&(u=!!(32&r.__u),a=[s=t.__e=r.__e]),(h=Wu.__b)&&h(t);e:if("function"==typeof C){c=o.length;try{if(y=t.props,b=C.prototype&&C.prototype.render,$=(h=C.contextType)&&i[h.__c],w=h?$?$.props.value:h.__:i,r.__c?m=(d=t.__c=r.__c).__=d.__E:(b?t.__c=d=new C(y,w):(t.__c=d=new vl(y,w),d.constructor=C,d.render=Al),$&&$.sub(d),d.state||(d.state={}),d.__n=i,v=d.__d=!0,d.__h=[],d._sb=[]),b&&null==d.__s&&(d.__s=d.state),b&&null!=C.getDerivedStateFromProps&&(d.__s==d.state&&(d.__s=ul({},d.__s)),ul(d.__s,C.getDerivedStateFromProps(y,d.__s))),f=d.props,p=d.state,d.__v=t,v)b&&null==C.getDerivedStateFromProps&&null!=d.componentWillMount&&d.componentWillMount(),b&&null!=d.componentDidMount&&d.__h.push(d.componentDidMount);else{if(b&&null==C.getDerivedStateFromProps&&y!==f&&null!=d.componentWillReceiveProps&&d.componentWillReceiveProps(y,w),t.__v==r.__v||!d.__e&&null!=d.shouldComponentUpdate&&!1===d.shouldComponentUpdate(y,d.__s,w)){t.__v!=r.__v&&(d.props=y,d.state=d.__s,d.__d=!1),t.__e=r.__e,t.__k=r.__k,t.__k.some((function(e){e&&(e.__=t)})),al.push.apply(d.__h,d._sb),d._sb=[],d.__h.length&&o.push(d);break e}null!=d.componentWillUpdate&&d.componentWillUpdate(y,d.__s,w),b&&null!=d.componentDidUpdate&&d.__h.push((function(){d.componentDidUpdate(f,p,g)}))}if(d.context=w,d.props=y,d.__P=e,d.__e=!1,k=Wu.__r,_=0,b)d.state=d.__s,d.__d=!1,k&&k(t),h=d.render(d.props,d.state,d.context),al.push.apply(d.__h,d._sb),d._sb=[];else do{d.__d=!1,k&&k(t),h=d.render(d.props,d.state,d.context),d.state=d.__s}while(d.__d&&25>++_);d.state=d.__s,null!=d.getChildContext&&(i=ul(ul({},i),d.getChildContext())),b&&!v&&null!=d.getSnapshotBeforeUpdate&&(g=d.getSnapshotBeforeUpdate(f,p)),S=null!=h&&h.type===dl&&null==h.key?Il(h.props.children):h,s=bl(e,sl(S)?S:[S],t,r,i,n,a,o,s,u,l),d.base=t.__e,t.__u&=-161,d.__h.length&&o.push(d),m&&(d.__E=d.__=null)}catch(e){if(o.length=c,t.__v=null,u||null!=a)if(e.then){for(t.__u|=u?160:128;s&&8==s.nodeType&&s.nextSibling;)s=s.nextSibling;null!=a&&(a[a.indexOf(s)]=null),t.__e=s}else{if(null!=a)for(x=a.length;x--;)ll(a[x]);Ml(t)}else t.__e=r.__e,!t.__k&&r.__k&&(t.__k=r.__k),e.then||Ml(t);Wu.__e(e,t,r)}}else null==a&&t.__v==r.__v?(t.__k=r.__k,t.__e=r.__e):s=t.__e=function(e,t,r,i,n,a,o,s,u){var l,h,c,d,v,f,p,g=r.props||nl,m=t.props,y=t.type;if("svg"==y?n="http://www.w3.org/2000/svg":"math"==y?n="http://www.w3.org/1998/Math/MathML":n||(n="http://www.w3.org/1999/xhtml"),null!=a)for(l=0;a.length>l;l++)if((v=a[l])&&"setAttribute"in v==!!y&&(y?v.localName==y:3==v.nodeType)){e=v,a[l]=null;break}if(null==e){if(null==y)return document.createTextNode(m);e=document.createElementNS(n,y,m.is&&m),s&&(Wu.__m&&Wu.__m(t,a),s=!1),a=null}if(null==y)g===m||s&&e.data==m||(e.data=m);else{if(a="textarea"==y&&null!=m.defaultValue?null:a&&Uu.call(e.childNodes),!s&&null!=a)for(g={},l=0;e.attributes.length>l;l++)g[(v=e.attributes[l]).name]=v.value;for(l in g)v=g[l],"dangerouslySetInnerHTML"==l?c=v:"children"==l||l in m||"value"==l&&"defaultValue"in m||"checked"==l&&"defaultChecked"in m||Sl(e,l,null,v,n);for(l in m)v=m[l],"children"==l?d=v:"dangerouslySetInnerHTML"==l?h=v:"value"==l?f=v:"checked"==l?p=v:s&&"function"!=typeof v||g[l]===v||Sl(e,l,v,g[l],n);if(h)s||c&&(h.__html==c.__html||h.__html==e.innerHTML)||(e.innerHTML=h.__html),t.__k=[];else if(c&&(e.innerHTML=""),bl("template"==t.type?e.content:e,sl(d)?d:[d],t,r,i,"foreignObject"==y?"http://www.w3.org/1999/xhtml":n,a,o,a?a[0]:r.__k&&fl(r,0),s,u),null!=a)for(l=a.length;l--;)ll(a[l]);s&&"textarea"!=y||(l="value","progress"==y&&null==f?e.removeAttribute("value"):null!=f&&(f!==e[l]||"progress"==y&&!f||"option"==y&&f!=g[l])&&Sl(e,l,f,g[l],n),l="checked",null!=p&&p!=e[l]&&Sl(e,l,p,g[l],n))}return e}(r.__e,t,r,i,n,a,o,u,l);return(h=Wu.diffed)&&h(t),128&t.__u?void 0:s}function Ml(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(Ml))}function Tl(e,t,r){for(var i=0;r.length>i;i++)El(r[i],r[++i],r[++i]);Wu.__c&&Wu.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){Wu.__e(e,t.__v)}}))}function Il(e){return"object"!=typeof e||null==e||e.__b>0?e:sl(e)?e.map(Il):void 0!==e.constructor?null:ul({},e)}function El(e,t,r){try{if("function"==typeof e){var i="function"==typeof e.__u;i&&e.__u(),i&&null==t||(e.__u=e(t))}else e.current=t}catch(e){Wu.__e(e,r)}}function Rl(e,t,r){var i,n;if(Wu.unmount&&Wu.unmount(e),(i=e.ref)&&(i.current&&i.current!=e.__e||El(i,null,t)),null!=(i=e.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(e){Wu.__e(e,t)}i.base=i.__P=i.__n=null}if(i=e.__k)for(n=0;i.length>n;n++)i[n]&&Rl(i[n],t,r||"function"!=typeof e.type);r||ll(e.__e),e.__c=e.__=e.__e=void 0}function Al(e,t,r){return this.constructor(e,r)}function Ll(e,t,r){var i,n,a;t==document&&(t=document.documentElement),Wu.__&&Wu.__(e,t),i=t.__k,n=[],a=[],Cl(t,e=t.__k=hl(dl,null,[e]),i||nl,nl,t.namespaceURI,i?null:t.firstChild?Uu.call(t.childNodes):null,n,i?i.__e:t.firstChild,!1,a),Tl(n,e,a),e.props.children=null}Uu=al.slice,Wu={__e(e,t,r,i){for(var n,a,o;t=t.__;)if((n=t.__c)&&!n.__)try{if((a=n.constructor)&&null!=a.getDerivedStateFromError&&(n.setState(a.getDerivedStateFromError(e)),o=n.__d),null!=n.componentDidCatch&&(n.componentDidCatch(e,i||{}),o=n.__d),o)return n.__E=n}catch(t){e=t}throw e}},zu=0,vl.prototype.setState=function(e,t){var r;r=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=ul({},this.state),"function"==typeof e&&(e=e(ul({},r),this.props)),e&&ul(r,e),null!=e&&this.__v&&(t&&this._sb.push(t),ml(this))},vl.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),ml(this))},vl.prototype.render=dl,Vu=[],Gu="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Qu=function(e,t){return e.__v.__b-t.__v.__b},yl.__r=0,Ju=Math.random().toString(8),Yu="__d"+Ju,Ku="__a"+Ju,Xu=/(PointerCapture)$|Capture$/i,el=0,tl=xl(!1),rl=xl(!0),il=0;var Ol,Pl,Dl,Fl,Nl=0,ql=[],jl=Wu,Bl=jl.__b,Hl=jl.__r,$l=jl.diffed,Ul=jl.__c,Wl=jl.unmount,zl=jl.__;function Vl(e,t){jl.__h&&jl.__h(Pl,e,Nl||t),Nl=0;var r=Pl.__H||(Pl.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function Zl(e){return Nl=1,function(e,t,r){var i=Vl(Ol++,2);if(i.t=e,!i.__c&&(i.__=[nh(void 0,t),function(e){var t=i.__N?i.__N[0]:i.__[0],r=i.t(t,e);t!==r&&(i.__N=[r,i.__[1]],i.__c.setState({}))}],i.__c=Pl,!Pl.__f)){var n=function(e,t,r){if(!i.__c.__H)return!0;var n=!1,o=i.__c.props!==e;if(i.__c.__H.__.some((function(e){if(e.__N){n=!0;var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(o=!0)}})),a){var s=a.call(this,e,t,r);return n?s||o:s}return!n||o};Pl.__f=!0;var a=Pl.shouldComponentUpdate,o=Pl.componentWillUpdate;Pl.componentWillUpdate=function(e,t,r){if(this.__e){var i=a;a=void 0,n(e,t,r),a=i}o&&o.call(this,e,t,r)},Pl.shouldComponentUpdate=n}return i.__N||i.__}(nh,e)}function Gl(e,t){var r=Vl(Ol++,3);!jl.__s&&ih(r.__H,t)&&(r.__=e,r.u=t,Pl.__H.__h.push(r))}function Ql(e){return Nl=5,Jl((function(){return{current:e}}),[])}function Jl(e,t){var r=Vl(Ol++,7);return ih(r.__H,t)&&(r.__=e(),r.__H=t,r.__h=e),r.__}function Yl(e){var t=Pl.context[e.__c],r=Vl(Ol++,9);return r.c=e,t?(null==r.__&&(r.__=!0,t.sub(Pl)),t.props.value):e.__}function Kl(){for(var e;e=ql.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(th),t.__h.some(rh),t.__h=[]}catch(r){t.__h=[],jl.__e(r,e.__v)}}}jl.__b=function(e){Pl=null,Bl&&Bl(e)},jl.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),zl&&zl(e,t)},jl.__r=function(e){Hl&&Hl(e),Ol=0;var t=(Pl=e.__c).__H;t&&(Dl===Pl?(t.__h=[],Pl.__h=[],t.__.some((function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0}))):(t.__h.length&&Kl(),Ol=0)),Dl=Pl},jl.diffed=function(e){$l&&$l(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==ql.push(t)&&Fl===jl.requestAnimationFrame||((Fl=jl.requestAnimationFrame)||eh)(Kl)),t.__H.__.some((function(e){e.u&&(e.__H=e.u,e.u=void 0)}))),Dl=Pl=null},jl.__c=function(e,t){t.some((function(e){try{e.__h.some(th),e.__h=e.__h.filter((function(e){return!e.__||rh(e)}))}catch(r){t.some((function(e){e.__h&&(e.__h=[])})),t=[],jl.__e(r,e.__v)}})),Ul&&Ul(e,t)},jl.unmount=function(e){Wl&&Wl(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.some((function(e){try{th(e)}catch(e){t=e}})),r.__H=void 0,t&&jl.__e(t,r.__v))};var Xl="function"==typeof requestAnimationFrame;function eh(e){var t,r=function(){clearTimeout(i),Xl&&cancelAnimationFrame(t),setTimeout(e)},i=setTimeout(r,35);Xl&&(t=requestAnimationFrame(r))}function th(e){var t=Pl,r=e.__c;"function"==typeof r&&(e.__c=void 0,r()),Pl=t}function rh(e){var t=Pl;e.__c=e.__(),Pl=t}function ih(e,t){return!e||e.length!==t.length||t.some((function(t,r){return t!==e[r]}))}function nh(e,t){return"function"==typeof t?t(e):t}var ah={Tab:"tab",Selector:"selector"},oh={TopLeft:"top_left",TopRight:"top_right",TopCenter:"top_center",MiddleLeft:"middle_left",MiddleRight:"middle_right",MiddleCenter:"middle_center",Left:"left",Center:"center",Right:"right",NextToTrigger:"next_to_trigger"},sh={Top:"top",Left:"left",Right:"right",Bottom:"bottom"},uh={Popover:"popover",API:"api",Widget:"widget",ExternalSurvey:"external_survey"},lh={Open:"open",MultipleChoice:"multiple_choice",SingleChoice:"single_choice",Rating:"rating",Link:"link"},hh={End:"end",ResponseBased:"response_based",SpecificQuestion:"specific_question"},ch="always",dh={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent",ABANDONED:"survey abandoned"},vh={SURVEY_ID:"$survey_id",SURVEY_NAME:"$survey_name",SURVEY_ITERATION:"$survey_iteration",SURVEY_ITERATION_START_DATE:"$survey_iteration_start_date",SURVEY_PARTIALLY_COMPLETED:"$survey_partially_completed",SURVEY_SUBMISSION_ID:"$survey_submission_id",SURVEY_COMPLETED:"$survey_completed",SURVEY_LANGUAGE:"$survey_language"},fh=Oe("[Surveys]"),ph=(e,t)=>""+e+function(e){return e.current_iteration&&e.current_iteration>0?e.id+"_"+e.current_iteration:e.id}(t),gh=e=>ph("seenSurvey_",e),mh=e=>{try{var t=gh(e);if(localStorage.getItem(t))return;localStorage.setItem(t,"true")}catch(e){fh.error("Failed to persist survey seen state",e)}},yh=[uh.Popover,uh.Widget,uh.API];Math.trunc||(Math.trunc=function(e){return 0>e?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return I(e)&&isFinite(e)&&Math.floor(e)===e});class bh{constructor(e){if(this.bytes=e,16!==e.length)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,t,r,i){if(!Number.isInteger(e)||!Number.isInteger(t)||!Number.isInteger(r)||!Number.isInteger(i)||0>e||0>t||0>r||0>i||e>0xffffffffffff||t>4095||r>1073741823||i>4294967295)throw new RangeError("invalid field value");var n=new Uint8Array(16);return n[0]=e/Math.pow(2,40),n[1]=e/Math.pow(2,32),n[2]=e/Math.pow(2,24),n[3]=e/Math.pow(2,16),n[4]=e/256,n[5]=e,n[6]=112|t>>>8,n[7]=t,n[8]=128|r>>>24,n[9]=r>>>16,n[10]=r>>>8,n[11]=r,n[12]=i>>>24,n[13]=i>>>16,n[14]=i>>>8,n[15]=i,new bh(n)}toString(){for(var e="",t=0;this.bytes.length>t;t++)e=e+(this.bytes[t]>>>4).toString(16)+(15&this.bytes[t]).toString(16),3!==t&&5!==t&&7!==t&&9!==t||(e+="-");if(36!==e.length)throw new Error("Invalid UUIDv7 was generated");return e}clone(){return new bh(this.bytes.slice(0))}equals(e){return 0===this.compareTo(e)}compareTo(e){for(var t=0;16>t;t++){var r=this.bytes[t]-e.bytes[t];if(0!==r)return Math.sign(r)}return 0}}class wh{generate(){var e=this.generateOrAbort();if(!S(e))return e;this.Gr=0;var t=this.generateOrAbort();if(S(t))throw new Error("Could not generate UUID after timestamp reset");return t}generateOrAbort(){var e=Date.now();if(e>this.Gr)this.Gr=e,this.Qr();else{if(this.Gr>=e+1e4)return;this.Jr++,this.Jr>4398046511103&&(this.Gr++,this.Qr())}return bh.fromFieldsV7(this.Gr,Math.trunc(this.Jr/Math.pow(2,30)),this.Jr&Math.pow(2,30)-1,this.Yr.nextUint32())}Qr(){this.Jr=1024*this.Yr.nextUint32()+(1023&this.Yr.nextUint32())}constructor(){this.Gr=0,this.Jr=0,this.Yr=new Sh}}var kh,_h=e=>{if("undefined"!=typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var t=0;e.length>t;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};e&&!S(e.crypto)&&crypto.getRandomValues&&(_h=e=>crypto.getRandomValues(e));class Sh{nextUint32(){return this.At.length>this.Kr||(_h(this.At),this.Kr=0),this.At[this.Kr++]}constructor(){this.At=new Uint32Array(8),this.Kr=1/0}}var xh=()=>Ch().toString(),Ch=()=>(kh||(kh=new wh)).generate(),Mh=null,Th={Xr(){if(!M(Mh))return Mh;var t=!0;if(S(e))t=!1;else try{var r="__mplssupport__";Th.ei(r,"xyz"),'"xyz"'!==Th.ti(r)&&(t=!1),Th.ri(r)}catch(e){t=!1}return t||Le.error("localStorage unsupported; falling back to cookie store"),Mh=t,t},ii(e){Le.error("localStorage error: "+e)},ti(t){try{return null==e?void 0:e.localStorage.getItem(t)}catch(e){Th.ii(e)}return null},ni(e){try{return JSON.parse(Th.ti(e))||{}}catch(e){}return null},ei(t,r){try{return null==e||e.localStorage.setItem(t,JSON.stringify(r)),!0}catch(e){Th.ii(e)}return!1},ri(t){try{null==e||e.localStorage.removeItem(t)}catch(e){Th.ii(e)}}},Ih=Oe("[Stylesheet Loader]"),Eh=e,Rh=i,Ah="#020617",Lh={fontFamily:"inherit",backgroundColor:"#eeeded",submitButtonColor:"black",submitButtonTextColor:"white",ratingButtonColor:"white",ratingButtonActiveColor:"black",borderColor:"#c9c6c6",placeholder:"Start typing...",whiteLabel:!1,displayThankYouMessage:!0,thankYouMessageHeader:"Thank you for your feedback!",position:oh.Right,widgetType:ah.Tab,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:Ah,scrollbarThumbColor:"var(--ph-survey-border-color)",scrollbarTrackColor:"var(--ph-survey-background-color)"},Oh=[oh.Center,oh.Left,oh.Right];function Ph(e){if(e.startsWith("#")){var t=e.replace(/^#/,"");return/^[0-9A-Fa-f]{3}$/.test(t)&&(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]),/^[0-9A-Fa-f]{6}$/.test(t)?"rgb("+parseInt(t.slice(0,2),16)+","+parseInt(t.slice(2,4),16)+","+parseInt(t.slice(4,6),16)+")":"rgb(255, 255, 255)"}return"rgb(255, 255, 255)"}function Dh(e){var t;void 0===e&&(e=Lh.backgroundColor),"#"===e[0]&&(t=Ph(e)),e.startsWith("rgb")&&(t=e);var r={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"}[e.toLowerCase()];if(r&&(t=Ph(r)),!t)return Ah;var i=t.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);if(i){var n=parseInt(i[1]),a=parseInt(i[2]),o=parseInt(i[3]);return Math.sqrt(n*n*.299+a*a*.587+o*o*.114)>127.5?Ah:"white"}return Ah}var Fh=(e,t,r)=>{var i=rc(e),n=Rh.querySelector("."+i);if(n&&n.shadowRoot)return{shadow:n.shadowRoot,isNewlyCreated:!1};var a=Rh.createElement("div");((e,t,r)=>{var i=h({},Lh,r),n=e.style,a=!Oh.includes(i.position)||t===uh.Widget&&(null==r?void 0:r.widgetType)===ah.Tab;n.setProperty("--ph-survey-font-family",function(e){if("inherit"===e)return"inherit";var t='BlinkMacSystemFont, "Inter", "Segoe UI", "Roboto", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"';return e?e+", "+t:"-apple-system, "+t}(i.fontFamily)),n.setProperty("--ph-survey-box-padding",i.boxPadding),n.setProperty("--ph-survey-max-width",i.maxWidth),n.setProperty("--ph-survey-z-index",i.zIndex),n.setProperty("--ph-survey-border-color",i.borderColor),a?(n.setProperty("--ph-survey-border-radius",i.borderRadius),n.setProperty("--ph-survey-border-bottom","1.5px solid var(--ph-survey-border-color)")):(n.setProperty("--ph-survey-border-bottom","none"),n.setProperty("--ph-survey-border-radius",i.borderRadius+" "+i.borderRadius+" 0 0")),n.setProperty("--ph-survey-background-color",i.backgroundColor),n.setProperty("--ph-survey-box-shadow",i.boxShadow),n.setProperty("--ph-survey-disabled-button-opacity",i.disabledButtonOpacity),n.setProperty("--ph-survey-submit-button-color",i.submitButtonColor),n.setProperty("--ph-survey-submit-button-text-color",(null==r?void 0:r.submitButtonTextColor)||Dh(i.submitButtonColor)),n.setProperty("--ph-survey-rating-bg-color",i.ratingButtonColor),n.setProperty("--ph-survey-rating-active-bg-color",i.ratingButtonActiveColor),n.setProperty("--ph-survey-rating-active-text-color",Dh(i.ratingButtonActiveColor)),n.setProperty("--ph-survey-text-primary-color",(null==r?void 0:r.textColor)||Dh(i.backgroundColor)),n.setProperty("--ph-survey-text-subtle-color",i.textSubtleColor),n.setProperty("--ph-widget-color",i.widgetColor),n.setProperty("--ph-widget-text-color",Dh(i.widgetColor)),n.setProperty("--ph-widget-z-index",i.zIndex);var o=(null==r?void 0:r.inputBackground)||(null==r?void 0:r.inputBackgroundColor),s=o||i.inputBackground;o||"white"!==i.backgroundColor||(s="#f8f8f8"),n.setProperty("--ph-survey-input-background",s);var u=(null==r?void 0:r.inputTextColor)||Dh(s);n.setProperty("--ph-survey-input-text-color",u),n.setProperty("--ph-survey-rating-text-color",u),n.setProperty("--ph-survey-scrollbar-thumb-color",i.scrollbarThumbColor),n.setProperty("--ph-survey-scrollbar-track-color",i.scrollbarTrackColor),n.setProperty("--ph-survey-outline-color",i.outlineColor)})(a,e.type,e.appearance),a.className=i;var o=a.attachShadow({mode:"open"}),s=function(e){var t=((e,t,r)=>{var i=e.createElement("style");i.innerText=t;var n=(e=>{var t;return k(e)?e:null==e||null==(t=e.config)?void 0:t.prepare_external_dependency_stylesheet})(r);return n&&(i=n(i)),i||(Ih.error("prepare_external_dependency_stylesheet returned null"),null)})(Rh,':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:2147483645;--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 rgba(0,0,0,.15);--ph-survey-submit-button-color:#000;--ph-survey-submit-button-text-color:#fff;--ph-survey-rating-bg-color:#fff;--ph-survey-rating-text-color:#020617;--ph-survey-rating-active-bg-color:#000;--ph-survey-rating-active-text-color:#fff;--ph-survey-text-primary-color:#020617;--ph-survey-text-subtle-color:#939393;--ph-widget-color:#e0a045;--ph-widget-text-color:#fff;--ph-survey-scrollbar-thumb-color:var(--ph-survey-border-color);--ph-survey-scrollbar-track-color:var(--ph-survey-background-color);--ph-survey-outline-color:rgba(59,130,246,.8);--ph-survey-input-background:#fff;--ph-survey-input-text-color:#020617;--ph-survey-disabled-button-opacity:0.6}.ph-survey{bottom:0;height:fit-content;margin:0;max-width:85%;min-width:300px;position:fixed;width:var(--ph-survey-max-width);z-index:var(--ph-survey-z-index)}.ph-survey h3,.ph-survey p{margin:0}.ph-survey *{box-sizing:border-box;color:var(--ph-survey-text-primary-color);font-family:var(--ph-survey-font-family)}.ph-survey .multiple-choice-options label,.ph-survey input[type=text],.ph-survey textarea{background:var(--ph-survey-input-background);border:1.5px solid var(--ph-survey-border-color);border-radius:4px;color:var(--ph-survey-input-text-color);padding:10px;transition:border-color .2s ease-out,box-shadow .2s ease-out,transform .15s ease-out}.ph-survey input[type=text],.ph-survey textarea{transition:border-color .2s ease-out,box-shadow .2s ease-out,transform .15s ease-out}.ph-survey input{margin:0}.ph-survey .form-submit:focus,.ph-survey .form-submit:focus-visible,.ph-survey input[type=checkbox]:focus,.ph-survey input[type=checkbox]:focus-visible,.ph-survey input[type=radio]:focus,.ph-survey input[type=radio]:focus-visible,.ph-survey input[type=text]:focus,.ph-survey input[type=text]:focus-visible,.ph-survey textarea:focus,.ph-survey textarea:focus-visible{border-color:var(--ph-survey-rating-active-bg-color);outline:1.5px solid var(--ph-survey-outline-color);outline-offset:2px}.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),.ph-survey input[type=text]:focus:not(:focus-visible),.ph-survey textarea:focus:not(:focus-visible){outline:none}.ph-survey input[type=text]:hover:not(:focus),.ph-survey textarea:hover:not(:focus){border-color:var(--ph-survey-rating-active-bg-color)}@media (max-width:768px){.ph-survey input[type=text],.ph-survey textarea{font-size:1rem}}.ph-survey .form-cancel,.ph-survey .multiple-choice-options label,.ph-survey .rating-options-number,.ph-survey input[type=checkbox],.ph-survey input[type=radio]{border:1.5px solid var(--ph-survey-border-color)}.ph-survey .footer-branding,.ph-survey .form-cancel,.ph-survey .form-submit,.ph-survey .ratings-emoji,.ph-survey .ratings-number,.ph-survey input[type=checkbox],.ph-survey input[type=radio],.ph-survey label{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);border:none;border-radius:3px 3px 0 0;color:var(--ph-widget-text-color);cursor:pointer;padding:10px 12px;position:fixed;text-align:center;transition:padding .2s ease-out;z-index:var(--ph-survey-z-index)}.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{gap:16px}.bottom-section,.survey-box{display:flex;flex-direction:column}.bottom-section{gap:8px}.intro-screen-header~.bottom-section,.thank-you-message-header~.bottom-section{padding-top:16px}.intro-screen,.question-container,.thank-you-message{display:flex;flex-direction:column;gap:8px}.survey-question{font-size:14px;font-weight:500}.survey-question-description{font-size:13px;opacity:.8;padding-top:4px}.intro-screen-body,.survey-question-description,.thank-you-message-body{word-wrap:break-word;overflow-wrap:break-word}:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) embed,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) iframe,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) img,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) object,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) video{height:auto;max-width:100%}:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) svg{height:auto;max-width:100%}.question-textarea-wrapper{display:flex;flex-direction:column}.survey-form{animation:ph-survey-fade-in .3s ease-out forwards}.intro-screen,.survey-form,.thank-you-message{background:var(--ph-survey-background-color);border:1.5px solid var(--ph-survey-border-color);border-bottom:var(--ph-survey-border-bottom);border-radius:var(--ph-survey-border-radius);box-shadow:var(--ph-survey-box-shadow);margin:0;padding:var(--ph-survey-box-padding);position:relative;text-align:left;width:100%;z-index:var(--ph-survey-z-index)}.survey-form input[type=text],.survey-form textarea{min-width:100%}:is(.survey-form textarea):focus,:is(.survey-form textarea):focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.08)}:is(.survey-form textarea):focus:not(:focus-visible){box-shadow:none}:is(.survey-box .question-header--empty)~.multiple-choice-options,:is(.survey-box .question-header--empty)~textarea{margin-top:0}.multiple-choice-options{border:none;display:flex;flex-direction:column;font-size:14px;gap:8px;margin:0;padding:1px 0}.multiple-choice-options .response-choice,.multiple-choice-options label{align-items:center;color:inherit;display:flex;gap:8px}.multiple-choice-options label{cursor:pointer;font-size:13px}:is(.multiple-choice-options label):hover:not(:has(input:checked)){border-color:var(--ph-survey-text-subtle-color);box-shadow:0 2px 8px rgba(0,0,0,.08)}:is(.multiple-choice-options label):has(input:checked){border-color:var(--ph-survey-rating-active-bg-color);box-shadow:0 1px 4px rgba(0,0,0,.05)}.choice-option-open:is(.multiple-choice-options label){flex-wrap:wrap}:is(.multiple-choice-options label) span{color:inherit}.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]{appearance:none;-webkit-appearance:none;-moz-appearance:none;background:var(--ph-survey-input-background);border-radius:3px;cursor:pointer;flex-shrink:0;height:1rem;position:relative;transition:all .2s cubic-bezier(.4,0,.2,1),transform .15s ease-out;width:1rem;z-index:1}: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{animation:ph-survey-checkmark-reveal .2s ease-out .1s forwards;border:solid var(--ph-survey-rating-active-text-color);border-width:0 2px 2px 0;height:8px;left:4px;transform:rotate(45deg) scale(0);width:4px}.multiple-choice-options input[type=radio]:checked:after{animation:ph-survey-radio-reveal .15s ease-out .05s forwards;background:var(--ph-survey-rating-active-text-color);border-radius:50%;height:6px;left:5px;top:5px;transform:scale(0);width:6px}.multiple-choice-options input[type=checkbox]:checked:after,.multiple-choice-options input[type=radio]:checked:after{box-sizing:content-box;content:"";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}:is(:is(.multiple-choice-options .choice-option-open) input[type=text])::placeholder{color:var(--ph-survey-text-subtle-color);font-weight:400}.rating-options-emoji{display:flex;justify-content:space-between}.rating-options-emoji-2{justify-content:space-around}.ratings-emoji{background-color:transparent;border:none;font-size:16px;opacity:.5;padding:0}.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;display:grid;grid-auto-columns:1fr;grid-auto-flow:column;overflow:hidden}.rating-options-number .ratings-number{border:none;border-right:1px solid var(--ph-survey-border-color);color:var(--ph-survey-rating-text-color);cursor:pointer;font-weight:700;text-align:center}:is(.rating-options-number .ratings-number):last-of-type{border-right:0}.rating-active:is(.rating-options-number .ratings-number){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{font-size:11px;justify-content:space-between;opacity:.7}.form-buttons,.rating-text{display:flex;flex-direction:row}.form-buttons{gap:8px;width:100%}.form-buttons-with-back>.form-submit{flex:1 1 auto;min-width:0}.form-submit{background:var(--ph-survey-submit-button-color);border:none;border-radius:6px;box-shadow:0 2px 0 rgba(0,0,0,.045);color:var(--ph-survey-submit-button-text-color);cursor:pointer;font-weight:700;min-width:100%;padding:12px;text-align:center;user-select:none}.form-submit:not([disabled]):hover{box-shadow:0 4px 8px rgba(0,0,0,.1);transform:scale(1.02)}.form-submit:not([disabled]):active{box-shadow:0 1px 2px rgba(0,0,0,.05);transform:scale(.98)}.form-submit[disabled]{cursor:not-allowed;opacity:var(--ph-survey-disabled-button-opacity)}.form-back{background:transparent;border:1.5px solid var(--ph-survey-border-color);border-radius:6px;color:var(--ph-survey-text-primary-color);cursor:pointer;flex:0 0 auto;font-weight:600;padding:12px 16px;text-align:center;user-select:none}.form-back:hover{transform:scale(1.02)}.form-back:active{transform:scale(.98)}.validation-hint{font-size:12px;margin-top:4px;opacity:.7}.form-cancel{background:#fff;border-radius:100%;cursor:pointer;line-height:0;padding:12px;position:absolute;right:0;top:0;transform:translate(50%,-50%)}.form-cancel:hover{opacity:.7;transform:translate(50%,-50%) scale(1.1)}.footer-branding{align-items:center;display:flex;font-size:11px;font-weight:500;gap:4px;justify-content:center;opacity:.6;text-decoration:none}.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{font-size:14px;opacity:.8}.intro-screen{animation:ph-survey-fade-in .3s ease-out forwards;text-align:center}.intro-screen-header{margin:10px 0 0}.intro-screen-body{font-size:14px;opacity:.8}.limit-height{max-height:256px;overflow-x:hidden;overflow-y:auto;scrollbar-color:var(--ph-survey-scrollbar-thumb-color) var(--ph-survey-scrollbar-track-color);scrollbar-width:thin}.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}:is(.limit-height::-webkit-scrollbar-thumb):hover{background-color:var(--ph-survey-text-subtle-color)}.sr-only{clip:rect(0,0,0,0);border:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}@media (prefers-reduced-motion:reduce){.ph-survey *{animation-duration:.01ms!important;animation-iteration-count:1!important;scroll-behavior:auto!important;transition-duration:.01ms!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)}}',e);return null==t||t.setAttribute("data-ph-survey-style","true"),t}(t);if(s){var u=o.querySelector("style");u&&o.removeChild(u),o.appendChild(s)}return Rh.body.appendChild(a),{shadow:o,isNewlyCreated:!0}},Nh=e=>{var t=e.responses,r=e.survey,i=e.surveySubmissionId,n=e.posthog,a=e.isSurveyCompleted,o=e.properties,s=e.surveyLanguage,u=e.questionSnapshots;n?(mh(r),n.capture(dh.SENT,h({[vh.SURVEY_NAME]:r.name,[vh.SURVEY_ID]:r.id,[vh.SURVEY_ITERATION]:r.current_iteration,[vh.SURVEY_ITERATION_START_DATE]:r.current_iteration_start_date,[vh.SURVEY_SUBMISSION_ID]:i,[vh.SURVEY_COMPLETED]:a},s&&{[vh.SURVEY_LANGUAGE]:s},{sessionRecordingUrl:null==n.get_session_replay_url?void 0:n.get_session_replay_url()},hi(t,r,u),o,{$set:{[ci(r,"responded")]:!0}})),a&&(Eh.dispatchEvent(new CustomEvent("PHSurveySent",{detail:{surveyId:r.id}})),tc(r),n.reloadFeatureFlags())):fh.error("[survey sent] event not captured, PostHog instance not found.")},qh=(e,t,r)=>{return h({[vh.SURVEY_NAME]:e.name,[vh.SURVEY_ID]:e.id,[vh.SURVEY_ITERATION]:e.current_iteration,[vh.SURVEY_ITERATION_START_DATE]:e.current_iteration_start_date,[vh.SURVEY_PARTIALLY_COMPLETED]:(i=null==t?void 0:t.responses,void 0===i&&(i={}),Object.values(i).some((e=>!T(e))))},(null==t?void 0:t.surveyLanguage)&&{[vh.SURVEY_LANGUAGE]:t.surveyLanguage},{sessionRecordingUrl:null==r.get_session_replay_url?void 0:r.get_session_replay_url(),[vh.SURVEY_SUBMISSION_ID]:null==t?void 0:t.surveySubmissionId},hi(null==t?void 0:t.responses,e,null==t?void 0:t.questionSnapshots));var i},jh=(e,t,r,i)=>{if(t){if(!r){var n=Xh(e),a=n?n.surveyLanguage:i;t.capture(dh.DISMISSED,h({},qh(e,n,t),a&&{[vh.SURVEY_LANGUAGE]:a},{$set:{[ci(e,"dismissed")]:!0}})),tc(e),mh(e),Eh.dispatchEvent(new CustomEvent("PHSurveyClosed",{detail:{surveyId:e.id}}))}}else fh.error("[survey dismissed] event not captured, PostHog instance not found.")},Bh=(e,t)=>{if(t){var r=(e=>ph("abandonedSurvey_",e))(e);try{if("true"===localStorage.getItem(r))return}catch(e){return}var i=Xh(e);if(i){try{localStorage.setItem(r,"true")}catch(e){}t.capture(dh.ABANDONED,qh(e,i,t),{transport:"sendBeacon"})}}else fh.error("[survey abandoned] event not captured, PostHog instance not found.")},Hh=e=>e.map((e=>({sort:Math.floor(10*Math.random()),value:e}))).sort(((e,t)=>e.sort-t.sort)).map((e=>e.value)),$h=(e,t)=>e.length===t.length&&e.every(((e,r)=>e===t[r]))?t.reverse():t,Uh=e=>{var t=e.map((e=>e.id));return t.every((e=>!!e))?t:void 0},Wh=(e,t)=>{return(e=>e.questions.some((e=>{var t;return!(null==(t=e.branching)||!t.type)})))(e)?e.questions:t?null!==(r=((e,t)=>{if(!t||t.length!==e.questions.length)return null;var r=new Map(e.questions.map((e=>[e.id,e]))),i=[];for(var n of t){var a=r.get(n);if(!a)return null;i.push(a)}return i})(e,t.questionOrder))&&void 0!==r?r:e.questions:e.appearance&&e.appearance.shuffleQuestions&&!e.enable_partial_responses?$h(e.questions,Hh(e.questions)):e.questions;var r},zh=e=>function(e){var t;return mi(e)&&!(null==(t=e.conditions)||null==(t=t.events)||!t.repeatedActivation)||"always"===e.schedule}(e)||ec(e),Vh=function(e){function t(e){var r,i;return this.getChildContext||(r=new Set,(i={})[t.__c]=this,this.getChildContext=function(){return i},this.componentWillUnmount=function(){r=null},this.shouldComponentUpdate=function(e){this.props.value!=e.value&&r.forEach((function(e){e.__e=!0,ml(e)}))},this.sub=function(e){r.add(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){r&&r.delete(e),t&&t.call(e)}}),e.children}return t.__c="__cC"+il++,t.__=e,t.Provider=t.__l=(t.Consumer=function(e,t){return e.children(t)}).contextType=t,t}({isPreviewMode:!1,previewPageIndex:0,onPopupSurveyDismissed(){},isPopup:!0,onPreviewSubmit(){},onPreviewBack(){},surveySubmissionId:"",properties:void 0,surveyLanguage:null}),Zh=()=>Yl(Vh),Gh=e=>{var t=e.children,r=e.style;return function(e,t,r){var i,n,a,o,s=ul({},e.props);for(a in e.type&&e.type.defaultProps&&(o=e.type.defaultProps),t)"key"==a?i=t[a]:"ref"==a?n=t[a]:s[a]=void 0===t[a]&&null!=o?o[a]:t[a];return arguments.length>2&&(s.children=arguments.length>3?Uu.call(arguments,2):r),cl(e.type,s,i||e.key,n||e.ref,null)}(e.component,e.renderAsHtml?{dangerouslySetInnerHTML:{__html:t},style:r}:{children:t,style:r})};function Qh(e,t){var r,i;if(null==(r=e.conditions)||!r.url)return!0;var n=He(t);if(!n)return!1;var a=[e.conditions.url],o=function(e){return null!=e?e:"icontains"}(null==(i=e.conditions)?void 0:i.urlMatchType);return wi[o](a,[n])}function Jh(t){var i,n;return function(t,i){var n,o,s;if(!t||0===t.length)return!0;if(!a)return!1;var u,l,h,c,d,v,f=(u={userAgentDataPlatform:null==r||null==(n=r.userAgentData)?void 0:n.platform,maxTouchPoints:null==r?void 0:r.maxTouchPoints,screenWidth:null==e||null==(o=e.screen)?void 0:o.width,screenHeight:null==e||null==(s=e.screen)?void 0:s.height,devicePixelRatio:null==e?void 0:e.devicePixelRatio},(v=function(e){return ie.test(e)?V:re.test(e)?Z:te.test(e)?G:new RegExp(Y,"i").test(e)?Y:new RegExp("("+Q+"|WPDesktop)","i").test(e)?Q:/iPad/.test(e)?U:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?W:ne.test(e)?z:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":new RegExp(J,"i").test(e)?J:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(e)||/(kf[a-z]+)( bui|\)).+silk\//i.test(e)?"Kindle Fire":/(Android|ZTE)/i.test(e)?new RegExp(q).test(e)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(e)||/pixel[\daxl ]{1,6}/i.test(e)&&!/pixel c/i.test(e)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(e)||/lmy47v/i.test(e)&&!/QTAQZ3/i.test(e)?j:H:new RegExp("(pda|"+q+")","i").test(e)?X:new RegExp(B,"i").test(e)&&!new RegExp(B+" pc","i").test(e)?ee:""}(a))===U||v===H||"Kobo"===v||"Kindle Fire"===v||v===ee?B:v===V||v===G||v===Z||v===Y?"Console":v===W?"Wearable":v?q:"Android"===(null==u?void 0:u.userAgentDataPlatform)&&(null!==(l=null==u?void 0:u.maxTouchPoints)&&void 0!==l?l:0)>0?600>Math.min(null!==(h=null==u?void 0:u.screenWidth)&&void 0!==h?h:0,null!==(c=null==u?void 0:u.screenHeight)&&void 0!==c?c:0)/(null!==(d=null==u?void 0:u.devicePixelRatio)&&void 0!==d?d:1)?q:B:"Desktop");return wi[null!=i?i:"icontains"](t,[f])}(null==(i=t.conditions)?void 0:i.deviceTypes,null==(n=t.conditions)?void 0:n.deviceTypesMatchType)}var Yh=e=>ph("inProgressSurvey_",e),Kh=(e,t)=>{try{localStorage.setItem(Yh(e),JSON.stringify(t))}catch(e){fh.error("Error setting in-progress survey state in localStorage",e)}},Xh=e=>{try{var t=localStorage.getItem(Yh(e));if(t)return JSON.parse(t)}catch(e){fh.error("Error getting in-progress survey state from localStorage",e)}return null},ec=e=>{var t=Xh(e);return!T(null==t?void 0:t.surveySubmissionId)},tc=e=>{try{localStorage.removeItem(Yh(e))}catch(e){fh.error("Error clearing in-progress survey state from localStorage",e)}};function rc(e,t){void 0===t&&(t=!1);var r="PostHogSurvey-"+e.id;return t?"."+r:r}function ic(e,t,r){if(void 0===t&&(t=oh.Right),e===uh.ExternalSurvey)return{};switch(t){case oh.TopLeft:return{top:"0",left:"0",transform:"translate(30px, 30px)"};case oh.TopRight:return{top:"0",right:"0",transform:"translate(-30px, 30px)"};case oh.TopCenter:return{top:"0",left:"50%",transform:"translate(-50%, 30px)"};case oh.MiddleLeft:return{top:"50%",left:"0",transform:"translate(30px, -50%)"};case oh.MiddleRight:return{top:"50%",right:"0",transform:"translate(-30px, -50%)"};case oh.MiddleCenter:return{top:"50%",left:"50%",transform:"translate(-50%, -50%)"};case oh.Left:return{left:"30px"};case oh.Center:return{left:"50%",transform:"translateX(-50%)"};default:return{right:e===uh.Widget&&r===ah.Tab?"60px":"30px"}}}var nc=0;function ac(e,t,r,i,n,a){t||(t={});var o,s,u=t;if("ref"in u)for(s in u={},t)"ref"==s?o=t[s]:u[s]=t[s];var l={type:e,props:u,key:r,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--nc,__i:-1,__u:0,__source:n,__self:a};if("function"==typeof e&&(o=e.defaultProps))for(s in o)void 0===u[s]&&(u[s]=o[s]);return Wu.vnode&&Wu.vnode(l),l}var oc=ac("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:ac("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"})}),sc=ac("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:ac("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"})}),uc=ac("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:ac("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"})}),lc=ac("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:ac("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"})}),hc=ac("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:ac("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"})}),cc=ac("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:ac("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"})}),dc=ac("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:ac("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"})}),vc=function(e){var t=(void 0===e?{}:e).fill,r=void 0===t?"currentColor":t;return ac("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:r,xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"close-survey-title-adam",children:[ac("title",{id:"close-survey-title",className:"adam-testing",children:"Close survey"}),ac("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:r})]})},fc=ac("svg",{width:"77",height:"14",viewBox:"0 0 77 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[ac("g",{"clip-path":"url(#clip0_2415_6911)",children:[ac("mask",{id:"mask0_2415_6911",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"77",height:"14",children:ac("path",{d:"M0.5 0H76.5V14H0.5V0Z",fill:"white"})}),ac("g",{mask:"url(#mask0_2415_6911)",children:[ac("path",{d:"M5.77226 8.02931C5.59388 8.37329 5.08474 8.37329 4.90634 8.02931L4.4797 7.20672C4.41155 7.07535 4.41155 6.9207 4.4797 6.78933L4.90634 5.96669C5.08474 5.62276 5.59388 5.62276 5.77226 5.96669L6.19893 6.78933C6.26709 6.9207 6.26709 7.07535 6.19893 7.20672L5.77226 8.02931ZM5.77226 12.6946C5.59388 13.0386 5.08474 13.0386 4.90634 12.6946L4.4797 11.872C4.41155 11.7406 4.41155 11.586 4.4797 11.4546L4.90634 10.632C5.08474 10.288 5.59388 10.288 5.77226 10.632L6.19893 11.4546C6.26709 11.586 6.26709 11.7406 6.19893 11.872L5.77226 12.6946Z",fill:"#1D4AFF"}),ac("path",{d:"M0.5 10.9238C0.5 10.508 1.02142 10.2998 1.32637 10.5938L3.54508 12.7327C3.85003 13.0267 3.63405 13.5294 3.20279 13.5294H0.984076C0.716728 13.5294 0.5 13.3205 0.5 13.0627V10.9238ZM0.5 8.67083C0.5 8.79459 0.551001 8.91331 0.641783 9.00081L5.19753 13.3927C5.28831 13.4802 5.41144 13.5294 5.53982 13.5294H8.0421C8.47337 13.5294 8.68936 13.0267 8.3844 12.7327L1.32637 5.92856C1.02142 5.63456 0.5 5.84278 0.5 6.25854V8.67083ZM0.5 4.00556C0.5 4.12932 0.551001 4.24802 0.641783 4.33554L10.0368 13.3927C10.1276 13.4802 10.2508 13.5294 10.3791 13.5294H12.8814C13.3127 13.5294 13.5287 13.0267 13.2237 12.7327L1.32637 1.26329C1.02142 0.969312 0.5 1.17752 0.5 1.59327V4.00556ZM5.33931 4.00556C5.33931 4.12932 5.39033 4.24802 5.4811 4.33554L14.1916 12.7327C14.4965 13.0267 15.0179 12.8185 15.0179 12.4028V9.99047C15.0179 9.86671 14.9669 9.74799 14.8762 9.66049L6.16568 1.26329C5.86071 0.969307 5.33931 1.17752 5.33931 1.59327V4.00556ZM11.005 1.26329C10.7 0.969307 10.1786 1.17752 10.1786 1.59327V4.00556C10.1786 4.12932 10.2296 4.24802 10.3204 4.33554L14.1916 8.06748C14.4965 8.36148 15.0179 8.15325 15.0179 7.7375V5.3252C15.0179 5.20144 14.9669 5.08272 14.8762 4.99522L11.005 1.26329Z",fill:"#F9BD2B"}),ac("path",{d:"M21.0852 10.981L16.5288 6.58843C16.2238 6.29443 15.7024 6.50266 15.7024 6.91841V13.0627C15.7024 13.3205 15.9191 13.5294 16.1865 13.5294H23.2446C23.5119 13.5294 23.7287 13.3205 23.7287 13.0627V12.5032C23.7287 12.2455 23.511 12.0396 23.2459 12.0063C22.4323 11.9042 21.6713 11.546 21.0852 10.981ZM18.0252 12.0365C17.5978 12.0365 17.251 11.7021 17.251 11.2901C17.251 10.878 17.5978 10.5436 18.0252 10.5436C18.4527 10.5436 18.7996 10.878 18.7996 11.2901C18.7996 11.7021 18.4527 12.0365 18.0252 12.0365Z",fill:"currentColor"}),ac("path",{d:"M0.5 13.0627C0.5 13.3205 0.716728 13.5294 0.984076 13.5294H3.20279C3.63405 13.5294 3.85003 13.0267 3.54508 12.7327L1.32637 10.5938C1.02142 10.2998 0.5 10.508 0.5 10.9238V13.0627ZM5.33931 5.13191L1.32637 1.26329C1.02142 0.969306 0.5 1.17752 0.5 1.59327V4.00556C0.5 4.12932 0.551001 4.24802 0.641783 4.33554L5.33931 8.86412V5.13191ZM1.32637 5.92855C1.02142 5.63455 0.5 5.84278 0.5 6.25853V8.67083C0.5 8.79459 0.551001 8.91331 0.641783 9.00081L5.33931 13.5294V9.79717L1.32637 5.92855Z",fill:"#1D4AFF"}),ac("path",{d:"M10.1787 5.3252C10.1787 5.20144 10.1277 5.08272 10.0369 4.99522L6.16572 1.26329C5.8608 0.969306 5.33936 1.17752 5.33936 1.59327V4.00556C5.33936 4.12932 5.39037 4.24802 5.48114 4.33554L10.1787 8.86412V5.3252ZM5.33936 13.5294H8.04214C8.47341 13.5294 8.6894 13.0267 8.38443 12.7327L5.33936 9.79717V13.5294ZM5.33936 5.13191V8.67083C5.33936 8.79459 5.39037 8.91331 5.48114 9.00081L10.1787 13.5294V9.99047C10.1787 9.86671 10.1277 9.74803 10.0369 9.66049L5.33936 5.13191Z",fill:"#F54E00"}),ac("path",{d:"M29.375 11.6667H31.3636V8.48772H33.0249C34.8499 8.48772 36.0204 7.4443 36.0204 5.83052C36.0204 4.21681 34.8499 3.17334 33.0249 3.17334H29.375V11.6667ZM31.3636 6.84972V4.81136H32.8236C33.5787 4.81136 34.0318 5.19958 34.0318 5.83052C34.0318 6.4615 33.5787 6.84972 32.8236 6.84972H31.3636ZM39.618 11.7637C41.5563 11.7637 42.9659 10.429 42.9659 8.60905C42.9659 6.78905 41.5563 5.45438 39.618 5.45438C37.6546 5.45438 36.2701 6.78905 36.2701 8.60905C36.2701 10.429 37.6546 11.7637 39.618 11.7637ZM38.1077 8.60905C38.1077 7.63838 38.7118 6.97105 39.618 6.97105C40.5116 6.97105 41.1157 7.63838 41.1157 8.60905C41.1157 9.57972 40.5116 10.2471 39.618 10.2471C38.7118 10.2471 38.1077 9.57972 38.1077 8.60905ZM46.1482 11.7637C47.6333 11.7637 48.6402 10.8658 48.6402 9.81025C48.6402 7.33505 45.2294 8.13585 45.2294 7.16518C45.2294 6.8983 45.5189 6.72843 45.9342 6.72843C46.3622 6.72843 46.8782 6.98318 47.0418 7.54132L48.527 6.94678C48.2375 6.06105 47.1677 5.45438 45.8713 5.45438C44.4743 5.45438 43.6058 6.25518 43.6058 7.21372C43.6058 9.53118 46.9663 8.88812 46.9663 9.84665C46.9663 10.1864 46.6391 10.417 46.1482 10.417C45.4434 10.417 44.9525 9.94376 44.8015 9.3735L43.3164 9.93158C43.6436 10.8537 44.6001 11.7637 46.1482 11.7637ZM53.4241 11.606L53.2982 10.0651C53.0843 10.1743 52.8074 10.2106 52.5808 10.2106C52.1278 10.2106 51.8257 9.89523 51.8257 9.34918V7.03172H53.3612V5.55145H51.8257V3.78001H49.9755V5.55145H48.9687V7.03172H49.9755V9.57972C49.9755 11.06 51.0202 11.7637 52.3921 11.7637C52.7696 11.7637 53.122 11.7031 53.4241 11.606ZM59.8749 3.17334V6.47358H56.376V3.17334H54.3874V11.6667H56.376V8.11158H59.8749V11.6667H61.8761V3.17334H59.8749ZM66.2899 11.7637C68.2281 11.7637 69.6378 10.429 69.6378 8.60905C69.6378 6.78905 68.2281 5.45438 66.2899 5.45438C64.3265 5.45438 62.942 6.78905 62.942 8.60905C62.942 10.429 64.3265 11.7637 66.2899 11.7637ZM64.7796 8.60905C64.7796 7.63838 65.3837 6.97105 66.2899 6.97105C67.1835 6.97105 67.7876 7.63838 67.7876 8.60905C67.7876 9.57972 67.1835 10.2471 66.2899 10.2471C65.3837 10.2471 64.7796 9.57972 64.7796 8.60905ZM73.2088 11.4725C73.901 11.4725 74.5177 11.242 74.845 10.8416V11.424C74.845 12.1034 74.2786 12.5767 73.4102 12.5767C72.7935 12.5767 72.2523 12.2854 72.1642 11.788L70.4776 12.0428C70.7042 13.1955 71.925 13.972 73.4102 13.972C75.361 13.972 76.6574 12.8679 76.6574 11.2298V5.55145H74.8324V6.07318C74.4926 5.69705 73.9136 5.45438 73.171 5.45438C71.409 5.45438 70.3014 6.61918 70.3014 8.46345C70.3014 10.3077 71.409 11.4725 73.2088 11.4725ZM72.1012 8.46345C72.1012 7.55345 72.655 6.97105 73.5109 6.97105C74.3793 6.97105 74.9331 7.55345 74.9331 8.46345C74.9331 9.37345 74.3793 9.95585 73.5109 9.95585C72.655 9.95585 72.1012 9.37345 72.1012 8.46345Z",fill:"currentColor"})]})]}),ac("defs",{children:ac("clipPath",{id:"clip0_2415_6911",children:ac("rect",{width:"76",height:"14",fill:"white",transform:"translate(0.5)"})})})]});function pc(e){var t=e.urlParams,r=t?Object.entries(t).map((e=>{var t=e[1];return encodeURIComponent(e[0])+"="+encodeURIComponent(t)})).join("&"):"";return ac("a",{href:"https://posthog.com/surveys"+(r?"?"+r:""),target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",fc]})}function gc(t){var r=t.text,i=t.submitDisabled,n=t.appearance,a=t.onSubmit,o=t.link,s=t.onPreviewSubmit,u=t.skipSubmitButton,l=t.canGoBack,h=t.onBack,c=Yl(Vh).isPreviewMode,d=!!l&&!!h,v=!u&&ac("button",{className:"form-submit",disabled:i,"aria-label":"Submit survey",type:"button",onClick(){o&&(null==e||e.open(o)),c?null==s||s():a()},children:r});return ac("div",{className:"bottom-section",children:[d?ac("div",{className:"form-buttons form-buttons-with-back",children:[ac("button",{className:"form-back",type:"button","aria-label":"Go to previous question",onClick:h,children:n.backButtonText||"Back"}),v]}):v,!n.whiteLabel&&ac(pc,{urlParams:{utm_source:"survey-footer"}})]})}function mc(e){var t=e.question,r=e.forceDisableHtml;return ac("div",{class:t.question||t.description?"question-header":"question-header question-header--empty",children:[ac(t.type===lh.Open?"label":"h3",{className:"survey-question",htmlFor:e.htmlFor,children:t.question}),t.description&&Gh({component:hl("p",{className:"survey-question-description"}),children:t.description,renderAsHtml:!r&&"text"!==t.descriptionContentType})]})}function yc(e){return ac("button",{className:"form-cancel",onClick:e.onClick,disabled:Yl(Vh).isPreviewMode,"aria-label":"Close survey",type:"button",children:vc({fill:"black"})})}ac("svg",{width:"16",height:"12",viewBox:"0 0 16 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:ac("path",{d:"M5.30769 10.6923L4.77736 11.2226C4.91801 11.3633 5.10878 11.4423 5.30769 11.4423C5.5066 11.4423 5.69737 11.3633 5.83802 11.2226L5.30769 10.6923ZM15.5303 1.53033C15.8232 1.23744 15.8232 0.762563 15.5303 0.46967C15.2374 0.176777 14.7626 0.176777 14.4697 0.46967L15.5303 1.53033ZM1.53033 5.85429C1.23744 5.56139 0.762563 5.56139 0.46967 5.85429C0.176777 6.14718 0.176777 6.62205 0.46967 6.91495L1.53033 5.85429ZM5.83802 11.2226L15.5303 1.53033L14.4697 0.46967L4.77736 10.162L5.83802 11.2226ZM0.46967 6.91495L4.77736 11.2226L5.83802 10.162L1.53033 5.85429L0.46967 6.91495Z",fill:"currentColor"})});var bc=e;function wc(e){var t=e.header,r=e.description,i=e.contentType,n=e.forceDisableHtml,a=e.appearance,o=e.onClose,s=Yl(Vh).isPopup;return Gl((()=>{var e=e=>{"Enter"!==e.key&&"Escape"!==e.key||(e.preventDefault(),o())};return Ne(bc,"keydown",e),()=>{bc.removeEventListener("keydown",e)}}),[o]),ac("div",{className:"thank-you-message",role:"status",tabIndex:0,"aria-atomic":"true",children:[s&&!0!==a.hideCancelButton&&ac(yc,{onClick:()=>o()}),ac("h3",{className:"thank-you-message-header",children:t}),r&&Gh({component:hl("p",{className:"thank-you-message-body"}),children:r,renderAsHtml:!n&&"text"!==i}),s&&ac(gc,{text:a.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:a,onSubmit:()=>o()})]})}function kc(e){var t=e.header,r=e.description,i=e.contentType,n=e.forceDisableHtml,a=e.appearance,o=e.onStart,s=Yl(Vh),u=s.onPreviewSubmit,l=s.onPopupSurveyDismissed;return ac("div",{className:"intro-screen",role:"status",tabIndex:0,"aria-atomic":"true",children:[s.isPopup&&!0!==a.hideCancelButton&&ac(yc,{onClick:()=>l()}),t&&ac("h3",{className:"intro-screen-header",children:t}),r&&Gh({component:hl("p",{className:"intro-screen-body"}),children:r,renderAsHtml:!n&&"text"!==i}),ac(gc,{text:a.introScreenButtonText||"Get started",submitDisabled:!1,appearance:a,onSubmit:o,onPreviewSubmit:()=>u(null)})]})}var _c=e=>w(e)&&e.every((e=>x(e)));function Sc(e){var t=e.question,r=e.forceDisableHtml,i=e.appearance,n=e.onSubmit,a=e.onPreviewSubmit,o=e.displayQuestionIndex,s=e.initialValue,u=e.canGoBack,l=e.onBack,h=Zh().isPreviewMode,c=Ql(null),d=Zl((()=>x(s)?s:"")),p=d[0],g=d[1],m=null==i?void 0:i.disableAutofocus;Gl((()=>{m||setTimeout((()=>{var e;h||null==(e=c.current)||e.focus()}),100)}),[h,m]);var y="surveyQuestion"+o,b=Jl((()=>function(e,t,r){var i,n,a=e.trim();if(!r&&""===a)return"This field is required";if(""===a)return!1;if(t&&t.length>0)for(var o of t)switch(o.type){case v:if(void 0!==o.value&&o.value>a.length)return null!==(i=o.errorMessage)&&void 0!==i?i:"Please enter at least "+o.value+" characters";break;case f:if(void 0!==o.value&&a.length>o.value)return null!==(n=o.errorMessage)&&void 0!==n?n:"Please enter no more than "+o.value+" characters"}return!1}(p,t.validation,t.optional)),[p,t.validation,t.optional]),w=fe(t.validation,v),k=fe(t.validation,f),_=Jl((()=>function(e,t){var r=1===e?void 0:e;return r&&t?"Enter "+r+"-"+t+" characters":r?"Enter at least "+r+" "+(1===r?"character":"characters"):t?"Maximum "+t+" "+(1===t?"character":"characters"):void 0}(w,k)),[w,k]),S=()=>{b||n(p.trim())},C=()=>{b||a(p.trim())};return ac(dl,{children:[ac("div",{className:"question-container",children:[ac(mc,{question:t,forceDisableHtml:r,htmlFor:y}),ac("textarea",{ref:c,id:y,rows:4,placeholder:null==i?void 0:i.placeholder,minLength:w,maxLength:k,onInput(e){g(e.currentTarget.value),e.stopPropagation()},onKeyDown(e){e.stopPropagation(),"Enter"!==e.key||!e.metaKey&&!e.ctrlKey||b||(e.preventDefault(),h?C():S())},value:p}),_&&ac("div",{className:"validation-hint",children:_})]}),ac(gc,{text:t.buttonText||"Submit",submitDisabled:!!b,appearance:i,onSubmit:S,onPreviewSubmit:C,canGoBack:u,onBack:l})]})}function xc(e){var t=e.question,r=e.appearance,i=e.onSubmit,n=e.onPreviewSubmit,a=e.canGoBack,o=e.onBack;return ac(dl,{children:[ac("div",{className:"question-container",children:ac(mc,{question:t,forceDisableHtml:e.forceDisableHtml})}),ac(gc,{text:t.buttonText||"Submit",submitDisabled:!1,link:t.link,appearance:r,onSubmit:()=>i("link clicked"),onPreviewSubmit:()=>n("link clicked"),canGoBack:a,onBack:o})]})}function Cc(e){var t,r=e.question,i=e.forceDisableHtml,n=e.displayQuestionIndex,a=e.appearance,o=e.onSubmit,s=e.onPreviewSubmit,u=e.initialValue,l=e.canGoBack,h=e.onBack,c=r.scale,d=10===r.scale?0:1,v=Zl((()=>I(u)?u:w(u)&&u.length>0&&I(parseInt(u[0]))?parseInt(u[0]):x(u)&&I(parseInt(u))?parseInt(u):null)),f=v[0],p=v[1],g="emoji"===r.display&&2===r.scale,m=Zh().isPreviewMode,y=e=>m?s(e):o(e);return ac(dl,{children:[ac("div",{className:"question-container",children:[ac(mc,{question:r,forceDisableHtml:i}),ac("div",{className:"rating-section",children:[ac("div",{className:"rating-options",children:["emoji"===r.display&&ac("div",{className:"rating-options-emoji"+(g?" rating-options-emoji-2":""),children:null==(t=Ac[r.scale])?void 0:t.map(((e,t)=>ac("button",{"aria-label":"Rate "+(t+1),className:"ratings-emoji question-"+n+"-rating-"+t+" "+(t+1===f?"rating-active":""),value:t+1,type:"button",onClick(){var e=t+1;p(e),r.skipSubmitButton&&y(e)},children:e},t)))}),"number"===r.display&&ac("div",{className:"rating-options-number",style:{gridTemplateColumns:"repeat("+(c-d+1)+", minmax(0, 1fr))"},children:Lc(r.scale).map(((e,t)=>ac(Mc,{displayQuestionIndex:n,active:f===e,appearance:a,num:e,setActiveNumber(e){p(e),r.skipSubmitButton&&y(e)}},t)))})]}),!g&&ac("div",{className:"rating-text",children:[ac("div",{children:r.lowerBoundLabel}),ac("div",{children:r.upperBoundLabel})]})]})]}),ac(gc,{text:r.buttonText||(null==a?void 0:a.submitButtonText)||"Submit",submitDisabled:M(f)&&!r.optional,appearance:a,onSubmit:()=>o(f),onPreviewSubmit:()=>s(f),skipSubmitButton:r.skipSubmitButton,canGoBack:l,onBack:h})]})}function Mc(e){var t=e.num,r=e.setActiveNumber;return ac("button",{"aria-label":"Rate "+t,className:"ratings-number question-"+e.displayQuestionIndex+"-rating-"+t+" "+(e.active?"rating-active":""),type:"button",onClick(){r(t)},children:t})}function Tc(e){var t=e.question,r=e.forceDisableHtml,i=e.displayQuestionIndex,n=e.appearance,a=e.onSubmit,o=e.onPreviewSubmit,s=e.initialValue,u=e.canGoBack,l=e.onBack,c=Ql(null),d=Jl((()=>(e=>{if(!e.shuffleOptions)return e.choices;var t=e.choices,r="";e.hasOpenChoice&&(r=t.pop());var i=$h(t,Hh(t));return e.hasOpenChoice&&(e.choices.push(r),i.push(r)),i})(t)),[t]),v=Zl((()=>((e,t)=>x(e)||_c(e)?e:t===lh.SingleChoice?null:[])(s,t.type))),f=v[0],p=v[1],g=Zl((()=>((e,t)=>{if(x(e)&&!t.includes(e))return{isSelected:!0,inputValue:e};if(_c(e)){var r=e.find((e=>!t.includes(e)));if(r)return{isSelected:!0,inputValue:r}}return{isSelected:!1,inputValue:""}})(s,d))),m=g[0],y=g[1],b=Zh().isPreviewMode,k=t.type===lh.SingleChoice,_=t.type===lh.MultipleChoice,S=t.skipSubmitButton&&k&&!t.hasOpenChoice,C=(e,t)=>{if(t){var r=!m.isSelected;return y((e=>h({},e,{isSelected:r,inputValue:r?e.inputValue:""}))),k&&p(""),void(r&&setTimeout((()=>{var e;return null==(e=c.current)?void 0:e.focus()}),75))}if(k)return p(e),y((e=>h({},e,{isSelected:!1,inputValue:""}))),void(S&&(a(e),b&&o(e)));_&&w(f)&&(f.includes(e)?p(f.filter((t=>t!==e))):p([...f,e]))},T=e=>{e.stopPropagation();var t=e.currentTarget.value;y((e=>h({},e,{inputValue:t}))),k&&p(t)},I=e=>{e.stopPropagation(),"Enter"!==e.key||E()||(e.preventDefault(),R()),"Escape"===e.key&&(e.preventDefault(),y((e=>h({},e,{isSelected:!1,inputValue:""}))),k&&p(null))},E=()=>!(t.optional||!M(f)&&(!w(f)||m.isSelected||0!==f.length)&&(!m.isSelected||""!==m.inputValue.trim())),R=()=>{m.isSelected&&_?w(f)&&(b?o([...f,m.inputValue]):a([...f,m.inputValue])):b?o(f):a(f)};return ac(dl,{children:[ac("div",{className:"question-container",children:[ac(mc,{question:t,forceDisableHtml:r}),ac("fieldset",{className:"multiple-choice-options limit-height",children:[ac("legend",{className:"sr-only",children:_?" Select all that apply":" Select one"}),d.map(((e,r)=>{var n=!!t.hasOpenChoice&&r===t.choices.length-1,a="surveyQuestion"+i+"Choice"+r,o=a+"Open",s=n?m.isSelected:k?f===e:w(f)&&f.includes(e);return ac("label",{className:n?"choice-option-open":"",children:[ac("div",{className:"response-choice",children:[ac("input",{type:k?"radio":"checkbox",name:a,checked:s,onChange:()=>C(e,n),id:a,"aria-controls":o}),ac("span",{children:n?e+":":e})]}),n&&ac("input",{type:"text",ref:c,id:o,name:"question"+i+"Open",value:m.inputValue,onKeyDown:I,onInput:T,onClick(t){m.isSelected||C(e,!0),t.stopPropagation()},"aria-label":e+" - please specify"})]},r)}))]})]}),ac(gc,{text:t.buttonText||"Submit",submitDisabled:E(),appearance:n,onSubmit:R,onPreviewSubmit:R,skipSubmitButton:S,canGoBack:u,onBack:l})]})}var Ic=[1,2,3,4,5],Ec=[1,2,3,4,5,6,7],Rc=[0,1,2,3,4,5,6,7,8,9,10],Ac={2:[cc,dc],3:[uc,sc,oc],5:[lc,uc,sc,oc,hc]};function Lc(e){switch(e){case 5:default:return Ic;case 7:return Ec;case 10:return Rc}}var Oc=Oe("[Surveys]");function Pc(e,t,r){var i,n=e.questions[t],a=t+1;if(null==(i=n.branching)||!i.type)return t===e.questions.length-1?hh.End:a;if(n.branching.type===hh.End)return hh.End;if(n.branching.type===hh.SpecificQuestion){if(Number.isInteger(n.branching.index))return n.branching.index}else if(n.branching.type===hh.ResponseBased){if(n.type===lh.SingleChoice){var o,s=n.choices.indexOf(""+r);if(-1===s&&n.hasOpenChoice&&(s=n.choices.length-1),null!=(o=n.branching)&&null!=(o=o.responseValues)&&o.hasOwnProperty(s)){var u=n.branching.responseValues[s];return Number.isInteger(u)?u:u===hh.End?hh.End:a}}else if(n.type===lh.Rating){var l;if("number"!=typeof r||!Number.isInteger(r))throw new Error("The response type must be an integer");var h=function(e,t){if(2===t){if(1>e||e>2)throw new Error("The response must be in range 1-2");return 1===e?"positive":"negative"}if(3===t){if(1>e||e>3)throw new Error("The response must be in range 1-3");return 1===e?"negative":2===e?"neutral":"positive"}if(5===t){if(1>e||e>5)throw new Error("The response must be in range 1-5");return e>2?3===e?"neutral":"positive":"negative"}if(7===t){if(1>e||e>7)throw new Error("The response must be in range 1-7");return e>3?4===e?"neutral":"positive":"negative"}if(10===t){if(0>e||e>10)throw new Error("The response must be in range 0-10");return e>6?e>8?"promoters":"passives":"detractors"}throw new Error("The scale must be one of: 2, 3, 5, 7, 10")}(r,n.scale);if(null!=(l=n.branching)&&null!=(l=l.responseValues)&&l.hasOwnProperty(h)){var c=n.branching.responseValues[h];return Number.isInteger(c)?c:c===hh.End?hh.End:a}}return a}return Oc.warn("Falling back to next question index due to unexpected branching type"),a}var Dc=Oe("[SurveyTranslations]");function Fc(e,t){var r=function(e){return function(e,t){var r=e.storedPersonProperties,i=e.locale,n=di(e.overrideLanguage);if(n)return null==t||t.info("Using override display language: "+n),n;var a=function(e){return e&&"object"==typeof e&&"language"in e?di(e.language):null}(r);if(a)return null==t||t.info("Using person property language: "+a),a;var o=di(i);return o?(null==t||t.info("Using detected locale: "+o),o):(null==t||t.info("No user language detected"),null)}({overrideLanguage:e.config.override_display_language,storedPersonProperties:k(e.get_property)?e.get_property(zt):void 0,locale:navigator.language||navigator.userLanguage},Dc)}(t);if(!r)return Dc.info("No user language detected"),{survey:e,language:null};var i=gi(e,r,Dc);return{survey:i.survey,language:i.matchedKey}}var Nc=-1,qc=e,jc=i,Bc="ph:show_survey_widget",Hc="PHWidgetSurveyClickListener";function $c(e,t){try{var r=e.getBoundingClientRect(),i=qc.innerHeight,n=qc.innerWidth,a=r.left+r.width/2-t/2;a+t>n-20&&(a=n-t-20),20>a&&(a=20);var o=i-r.bottom,s=250>o&&r.top>o;return{position:"fixed",top:s?"auto":r.bottom+12+"px",left:a+"px",right:"auto",bottom:s?i-r.top+12+"px":"auto",zIndex:Lh.zIndex}}catch(e){return fh.warn("Failed to calculate trigger position:",e),null}}class Uc{constructor(e){var t=this;this.ai=new Map,this.oi=new Map,this.si=new Map,this.ui=new Set,this.li=null,this.hi=!1,this.ci=null,this.di=null,this.vi=null,this.handlePageUnload=()=>{var e=this._posthog.get_property(Vt);if(e)for(var t of e)ec(t)&&Bh(t,this._posthog)},this.handlePopoverSurvey=function(e,r,i){var n,a,o,s,u,l=(void 0===i?{}:i).resumeDelayFromActivation,c=void 0!==l&&l,d=t.fi(e),v=d.survey,f=d.language;t.li=f,t.vi=null,t.pi=r;var p=t.gi(v,r);t.mi(p.id);var g=null!=r?r:{},m=g.properties,y=g.initialResponses,b=!(!y||0>=Object.keys(y).length)&&t.yi(p,y,m,f);if(!b||null!=(n=p.appearance)&&n.displayThankYouMessage){t.bi(p);var w={};if((null==(a=p.appearance)?void 0:a.position)===oh.NextToTrigger&&null!=(o=p.appearance)&&o.widgetSelector){var k,_=jc.querySelector(p.appearance.widgetSelector);_&&(w=$c(_,parseInt((null==(k=p.appearance)?void 0:k.maxWidth)||Lh.maxWidth))||{})}var S=(null==(s=p.appearance)?void 0:s.surveyPopupDelaySeconds)||0,x=Fh(p,t._posthog).shadow;t.si.set(x,x.host);var C={posthog:t._posthog,survey:p,removeSurveyFromFocus:t.wi,properties:m,style:w,isSurveyCompleted:b,skipShownEvent:null==r?void 0:r.skipShownEvent,surveyLanguage:f};if(t.vi=C,0>=S)return t.hi=!0,Ll(ac(Gc,h({},C)),x);var M=()=>{if(!t.ki(p))return fh.info("Survey "+p.id+" no longer eligible when its display delay elapsed; not displaying"),t.wi(p);(()=>{t.hi=!0;var i=t.fi(e),n=i.survey,a=i.language;t.li=a;var o=t.gi(n,r),s=h({},C,{survey:o,surveyLanguage:a});t.vi=s,Ll(ac(Gc,h({},s,{survey:h({},o,{appearance:h({},o.appearance,{surveyPopupDelaySeconds:0})})})),x)})()},T=c?null==(u=t._posthog.surveys)||null==(u=u._surveyEventReceiver)||null==u.getActivationTimestamp?void 0:u.getActivationTimestamp(p.id):void 0,E=I(T)?Math.max(0,Date.now()-T):0,R=Math.max(0,1e3*S-E);if(0>=R)return M();var A=qc.setTimeout((()=>{t.ai.delete(p.id),M()}),R);t.ai.set(p.id,A)}},this.Si=e=>{var t=this.fi(e),r=t.survey,i=t.language,n=Fh(r,this._posthog),a=n.shadow,o=n.isNewlyCreated;this.si.set(a,a.host),o&&Ll(ac(Jc,{posthog:this._posthog,survey:r,surveyLanguage:i},e.id),a)},this.xi=e=>{var t=this.oi.get(e);t&&(t.element.removeEventListener("click",t.listener),t.element.removeAttribute(Hc),this.oi.delete(e),fh.info("Removed click listener for survey "+e))},this.Ci=e=>{this.Mi(e)||(this.Ti(e),this.xi(e.id))},this.Mi=e=>{try{var t,r=jc.querySelector(rc(e,!0));return!(null==r||null==(t=r.shadowRoot)||!t.querySelector(".ph-survey"))}catch(e){return!1}},this.Ii=(e,t)=>{var r=jc.querySelector(t),i=this.oi.get(e.id);if(r){if(this.Si(e),i){if(r===i.element)return;fh.info("Selector element changed for survey "+e.id+". Re-attaching listener."),this.xi(e.id)}if(!r.hasAttribute(Hc)){var n=t=>{var r,i;t.stopPropagation();var n=(null==(r=e.appearance)?void 0:r.position)===oh.NextToTrigger?$c(t.currentTarget,parseInt((null==(i=e.appearance)?void 0:i.maxWidth)||Lh.maxWidth)):{};qc.dispatchEvent(new CustomEvent(Bc,{detail:{surveyId:e.id,position:n}}))};Ne(r,"click",n),r.setAttribute(Hc,"true"),this.oi.set(e.id,{element:r,listener:n,survey:e}),fh.info("Attached click listener for feedback button survey "+e.id)}}else i&&this.Ci(e)},this.renderPopover=e=>{var t=this.fi(e),r=t.survey,i=t.language,n=Fh(r,this._posthog).shadow;this.si.set(n,n.host),Ll(ac(Gc,{posthog:this._posthog,survey:r,removeSurveyFromFocus:this.wi,surveyLanguage:i}),n)},this.renderSurvey=(e,t,r)=>{var i,n=this.fi(e),a=n.survey,o=n.language,s=!1;null!=(i=this._posthog.config)&&null!=(i=i.surveys)&&i.prefillFromUrl&&(s=this.Ei(a,o,r)),Ll(ac(Gc,{posthog:this._posthog,survey:a,removeSurveyFromFocus:this.wi,isPopup:!1,properties:r,isSurveyCompleted:s,surveyLanguage:o}),t)},this.getActiveMatchingSurveys=function(e,r){var i;void 0===r&&(r=!1),null==(i=t._posthog)||null==(i=i.surveys)||i.getSurveys((r=>{var i=r.filter((e=>t.ki(e)));e(i)}),r)},this.callSurveysAndEvaluateDisplayLogic=function(e){void 0===e&&(e=!1),t.getActiveMatchingSurveys((e=>{var r=e.filter((e=>e.type===uh.Popover||e.type===uh.Widget)),i=new Set(r.map((e=>e.id)));for(var n of Array.from(t.ai.keys()))i.has(n)||t.cancelSurvey(n);var a=t.Ri(r),o=new Set;a.forEach((e=>{if(e.type===uh.Widget){var r,i,n,a;if((null==(r=e.appearance)?void 0:r.widgetType)===ah.Tab)return void t.Si(e);(null==(i=e.appearance)?void 0:i.widgetType)===ah.Selector&&null!=(n=e.appearance)&&n.widgetSelector&&(o.add(e.id),t.Ii(e,null==(a=e.appearance)?void 0:a.widgetSelector))}M(t.Ai)&&e.type===uh.Popover&&t.handlePopoverSurvey(e,void 0,{resumeDelayFromActivation:!0})})),t.oi.forEach((e=>{var r=e.survey;o.has(r.id)||t.Ci(r)}))}),e)},this.bi=e=>{M(this.Ai)||fh.error("Survey "+this.Ai+" already in focus. Cannot add survey "+e.id+"."),this.Ai=e.id},this.wi=e=>{this.Ai!==e.id&&fh.error("Survey "+e.id+" is not in focus. Cannot remove survey "+e.id+"."),this.mi(e.id),this.Ai=null,this.li=null,this.hi=!1,this.vi=null,this.pi=void 0,this.Ti(e)},this._posthog=e,this.Ai=null,this.ci=()=>this.Li(),Ne(qc,"languagechange",this.ci),this.di=e.onFeatureFlags((()=>this.Li()))}Li(){if(!M(this.Ai)){var e=this._posthog.get_property(Vt),t=null==e?void 0:e.find((e=>e.id===this.Ai));if(t){var r=this.fi(t),i=r.survey,n=r.language;if(n!==this.li&&(this.li=n,this.hi)){var a=this.gi(i,this.pi),o=Fh(a,this._posthog).shadow;Ll(ac(Gc,h({},this.vi,{posthog:this._posthog,survey:a,removeSurveyFromFocus:this.wi,surveyLanguage:n})),o)}}}}get Oi(){var e,t,r;return null!==(e=null==(t=(r=this._posthog).getExtension)?void 0:t.call(r,"featureFlags"))&&void 0!==e?e:this._posthog.featureFlags}gi(e,t){return null!=t&&t.position||null!=t&&t.selector?h({},e,{appearance:h({},e.appearance,t.position&&{position:t.position},t.selector&&{widgetSelector:t.selector})}):e}mi(e){var t=this.ai.get(e);t&&(clearTimeout(t),this.ai.delete(e))}cancelSurvey(e){this.ai.has(e)&&(fh.info("Cancelled pending survey "+e),this.mi(e),this.Ai===e&&(this.Ai=null,this.li=null,this.hi=!1,this.vi=null,this.pi=void 0))}setAutomaticDisplayDispose(e){this.Pi=e}dispose(){var e;null==(e=this.Pi)||e.call(this),this.Pi=void 0,this.ci&&(qc.removeEventListener("languagechange",this.ci),this.ci=null),this.di&&(this.di(),this.di=null),this.ai.forEach(((e,t)=>this.mi(t))),this.oi.forEach(((e,t)=>this.xi(t))),this.si.forEach(((e,t)=>{Ll(null,t),null==e||e.remove()})),this.si.clear(),this.Ai=null}Ri(e){return e.sort(((e,t)=>{var r,i,n=ec(e),a=ec(t);if(n&&!a)return-1;if(!n&&a)return 1;var o=e.schedule===ch,s=t.schedule===ch;return o&&!s?1:!o&&s?-1:((null==(r=e.appearance)?void 0:r.surveyPopupDelaySeconds)||0)-((null==(i=t.appearance)?void 0:i.surveyPopupDelaySeconds)||0)}))}fi(e){return Fc(e,this._posthog)}Ei(e,t,r){if(this.ui.has(e.id))return!1;var i=function(e){var t={},r=!1,i=e.replace(/^\?/,"");if(!i)return{params:t,autoSubmit:r};var n=i.split("&");for(var a of n){var o=a.split("="),s=o[0],u=o[1];if(s&&!S(u)){var l=decodeURIComponent(s),h=decodeURIComponent(u);if("auto_submit"!==l||"true"!==h){var c=l.match(/^q(\d+)$/);if(c){var d=parseInt(c[1],10);t[d]||(t[d]=[]),t[d].push(h)}}else r=!0}}return{params:t,autoSubmit:r}}(qc.location.search),n=i.params;if(0===Object.keys(n).length)return!1;fh.info("[Survey Prefill] Detected URL prefill parameters");var a=this.Di(e,n,t);return!!a&&(this.Fi(e,a,r,t),this.ui.add(e.id),a.isSurveyCompleted)}Fi(e,t,r,i){var n=t.responses,a=t.submissionId,o=t.isSurveyCompleted,s=t.skippedResponses;(Object.keys(s).length>0&&e.enable_partial_responses||o)&&Nh({responses:o?n:s,survey:e,surveySubmissionId:a,posthog:this._posthog,isSurveyCompleted:o,properties:r,surveyLanguage:i})}yi(e,t,r,i){var n={};for(var a of Object.entries(t)){var o=a[1];n[parseInt(a[0])]=w(o)?o.map(String):[String(o)]}fh.info("[Survey] Processing initial responses");var s=this.Di(e,n,i);return!!s&&(this.Fi(e,s,r,i),s.isSurveyCompleted)}Di(e,t,r){try{var i=function(e,t){var r={};return e.questions.forEach(((e,i)=>{if(t[i]&&e.id){var n=t[i],a=ui(e.id);try{switch(e.type){case lh.SingleChoice:if(!e.choices||0===e.choices.length)return void Le.warn("[Survey Prefill] Question "+i+" has no choices");var o=parseInt(n[0],10);if(isNaN(o)||0>o||o>=e.choices.length)return void Le.warn("[Survey Prefill] Invalid choice index for q"+i+": "+n[0]);r[a]=e.choices[o];break;case lh.MultipleChoice:if(!e.choices||0===e.choices.length)return void Le.warn("[Survey Prefill] Question "+i+" has no choices");var s=n.map((e=>parseInt(e,10))).filter((t=>!isNaN(t)&&t>=0&&e.choices.length>t));if(0===s.length)return void Le.warn("[Survey Prefill] No valid choices for q"+i);var u=[...new Set(s.map((t=>e.choices[t])))];s.length>u.length&&Le.warn("[Survey Prefill] Removed duplicate choices for q"+i),r[a]=u;break;case lh.Rating:var l=parseInt(n[0],10),h=e.scale||10;if(isNaN(l)||0>l||l>h)return void Le.warn("[Survey Prefill] Invalid rating for q"+i+": "+n[0]+" (scale: 0-"+h+")");r[a]=l;break;default:Le.info("[Survey Prefill] Question type "+e.type+" does not support prefill")}}catch(e){Le.error("[Survey Prefill] Error converting q"+i+":",e)}}})),r}(e,t);if(0===Object.keys(i).length)return fh.warn("[Survey Prefill] No valid responses after conversion"),null;var n=xh(),a=Object.keys(t).map((e=>parseInt(e,10))),o=function(e,t,r){for(var i=0,n={},a=[],o=e.questions.length+1,s=0;e.questions.length>i&&o>s&&(s++,t.includes(i));){var u=e.questions[i];if(!u||!("skipSubmitButton"in u)||!u.skipSubmitButton)break;if(u.id){var l=ui(u.id);S(r[l])||(n[l]=r[l])}a.push(i);var h=Pc(e,i,u.id?r[ui(u.id)]:null);if(h===hh.End)return{startQuestionIndex:e.questions.length,skippedResponses:n,skippedIndices:a};i=h}return{startQuestionIndex:i,skippedResponses:n,skippedIndices:a}}(e,a,i),s=o.startQuestionIndex,u=o.skippedResponses,l=o.skippedIndices,h=s>=e.questions.length;return Kh(e,{surveySubmissionId:n,responses:i,lastQuestionIndex:s,questionOrder:Uh(e.questions),visitedIndices:l,surveyLanguage:r}),fh.info("[Survey Prefill] Stored prefilled responses in localStorage"),{responses:i,submissionId:n,startQuestionIndex:s,isSurveyCompleted:h,skippedResponses:u}}catch(e){return fh.error("[Survey Prefill] Error handling prefill:",e),null}}Ni(e,t){if(void 0===t&&(t=void 0),!e)return!0;var r=this.Oi,i=!(null==r||!r.isFeatureEnabled(e,{send_event:!e.startsWith("survey-targeting-")})),n=!0;return t&&(n=(null==r?void 0:r.getFeatureFlag(e,{send_event:!1}))===t||"any"===t),i&&n}qi(e){return!e.conditions||Qh(e,this._posthog)&&Jh(e)&&function(e){var t;return null==(t=e.conditions)||!t.selector||!(null==Rh||!Rh.querySelector(e.conditions.selector))}(e)}ji(e){var t;return zh(e)?{satisfied:!0}:!e.internal_targeting_flag_key||!function(e){var t;return"recurring"===e.schedule||(null!==(t=e.current_iteration)&&void 0!==t?t:0)>0}(e)||null!=(t=this.Oi)&&t.hasLoadedFlags?{satisfied:this.Ni(e.internal_targeting_flag_key)}:{satisfied:!1,reason:"Feature flags have not loaded yet; deferring internal targeting flag check"}}checkSurveyEligibility(e){var t,r,i={eligible:!0,reason:void 0};if(!function(e){return!(!e.start_date||e.end_date)}(e))return i.eligible=!1,i.reason="Survey is not running. It was completed on "+e.end_date,i;if(!yh.includes(e.type))return i.eligible=!1,i.reason="Surveys of type "+e.type+" are never eligible to be shown in the app",i;var n=null==(t=e.conditions)?void 0:t.linkedFlagVariant;if(!this.Ni(e.linked_flag_key,n))return i.eligible=!1,i.reason=n?"Survey linked feature flag is not enabled for variant "+n:"Survey linked feature flag is not enabled",i;if(!this.Ni(e.targeting_flag_key))return i.eligible=!1,i.reason="Survey targeting feature flag is not enabled",i;var a,o=this.ji(e);return o.satisfied?function(e,t){if(!e||!t)return!0;var r="string"==typeof t?new Date(t):t,i=new Date,n=Math.abs(i.getTime()-r.getTime());return Math.ceil(n/864e5)>e}(null==(r=e.conditions)?void 0:r.seenSurveyWaitPeriodInDays,Th.ti("lastSeenSurveyDate"))?(e=>!!Th.ti(gh(e))&&!zh(e))(e)?(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!==(a=o.reason)&&void 0!==a?a:"Survey internal targeting flag is not enabled and survey cannot activate repeatedly and survey is not in progress",i)}checkSurveyRenderability(e){var t=this.checkSurveyEligibility(e);return t.eligible&&!this.Bi(e)?{eligible:!1,reason:"Survey event/action trigger has not been fired yet"}:t}Bi(e){var t;if(!mi(e)&&!function(e){var t;return!(null==(t=e.conditions)||null==(t=t.actions)||null==(t=t.values)||!t.length)}(e))return!0;var r=null==(t=this._posthog.surveys)||null==(t=t._surveyEventReceiver)?void 0:t.getSurveys();return!(null==r||!r.includes(e.id))}Hi(e){var t;return null==(t=e.feature_flag_keys)||!t.length||e.feature_flag_keys.every((e=>{var t=e.value;return!e.key||!t||this.Ni(t)}))}ki(e){return this.checkSurveyEligibility(e).eligible&&this.qi(e)&&this.Bi(e)&&this.Hi(e)}Ti(e){try{var t=jc.querySelector(rc(e,!0));null!=t&&t.shadowRoot&&(Ll(null,t.shadowRoot),this.si.delete(t.shadowRoot)),null==t||t.remove()}catch(t){fh.warn("Failed to remove survey "+e.id+" from DOM:",t)}}getTestAPI(){return{addSurveyToFocus:this.bi,removeSurveyFromFocus:this.wi,surveyInFocus:this.Ai,surveyTimeouts:this.ai,handleWidget:this.Si,handlePopoverSurvey:this.handlePopoverSurvey,manageWidgetSelectorListener:this.Ii,sortSurveysByAppearanceDelay:this.Ri,checkFlags:this.Hi.bind(this),isSurveyFeatureFlagEnabled:this.Ni.bind(this),onLanguageChange:this.Li.bind(this),currentLanguage:this.li,surveyIsRendered:this.hi}}}function Wc(e,t){if(jc&&qc){var r,i=new Uc(e);if(e.config.disable_surveys_automatic_display)return fh.info("Surveys automatic display is disabled. Skipping call surveys and evaluate display logic."),i;if(!1===t)return fh.info("There are no surveys to load or Surveys is disabled in the project settings."),i;i.callSurveysAndEvaluateDisplayLogic(!0);var n=()=>{S(r)&&(r=setInterval((()=>{i.callSurveysAndEvaluateDisplayLogic(!1)}),1e3))},a=()=>{S(r)||(clearInterval(r),r=void 0)};n();var o=()=>{jc.hidden?a():(i.callSurveysAndEvaluateDisplayLogic(!1),n())};return Ne(jc,"visibilitychange",o),i.setAutomaticDisplayDispose((()=>{a(),jc.removeEventListener("visibilitychange",o)})),i}}function zc(e){var t=e.survey,r=e.removeSurveyFromFocus,i=void 0===r?()=>{}:r,n=e.setSurveyVisible,a=e.isPreviewMode,o=void 0!==a&&a,s=e.posthog;Gl((()=>{var e;if(!o&&null!=(e=t.conditions)&&e.url){var r=()=>{var e,r=t.type===uh.Widget,a=Qh(t,s),o=(null==(e=t.appearance)?void 0:e.widgetType)===ah.Tab&&r;if(!a)return fh.info("Hiding survey "+t.id+" because URL does not match"),n(!1),i(t);o&&(fh.info("Showing survey "+t.id+" because it is a feedback button tab and URL matches"),n(!0))};Ne(qc,"popstate",r),Ne(qc,"hashchange",r);var a=qc.history.pushState,u=qc.history.replaceState;return qc.history.pushState=function(){for(var e=arguments.length,t=new Array(e),i=0;e>i;i++)t[i]=arguments[i];a.apply(this,t),r()},qc.history.replaceState=function(){for(var e=arguments.length,t=new Array(e),i=0;e>i;i++)t[i]=arguments[i];u.apply(this,t),r()},()=>{qc.removeEventListener("popstate",r),qc.removeEventListener("hashchange",r),qc.history.pushState=a,qc.history.replaceState=u}}}),[o,t,i,n,s])}var Vc=200;function Zc(e){switch(void 0===e&&(e=sh.Right),e){case sh.Top:return{top:"0",left:"50%",transform:"translateX(-50%)"};case sh.Left:return{top:"50%",left:"0",transform:"rotate(90deg) translateY(-100%)",transformOrigin:"left top"};case sh.Bottom:return{bottom:"0",left:"50%",transform:"translateX(-50%)"};default:return{top:"50%",right:"0",transform:"rotate(-90deg) translateY(-100%)",transformOrigin:"right top"}}}function Gc(e){var t,r,i,n,a,o,s,u,l,c,d,v,f=e.survey,p=e.forceDisableHtml,g=e.posthog,m=e.style,y=void 0===m?{}:m,b=e.previewPageIndex,w=e.removeSurveyFromFocus,k=void 0===w?()=>{}:w,_=e.isPopup,x=void 0===_||_,C=e.onPreviewSubmit,M=void 0===C?()=>{}:C,T=e.onPreviewBack,I=void 0===T?()=>{}:T,E=e.onPopupSurveyDismissed,R=void 0===E?()=>{}:E,A=e.onCloseConfirmationMessage,L=void 0===A?()=>{}:A,O=e.properties,P=e.isSurveyCompleted,D=e.skipShownEvent,F=e.surveyLanguage,N=Ql(null),q=Number.isInteger(b),j=null!=(t=f.appearance)&&t.surveyPopupDelaySeconds?1e3*f.appearance.surveyPopupDelaySeconds:0,B=function(e,t,r,i,n,a,o,s,u){var l=Zl(i||0===r||e.type===uh.ExternalSurvey),c=l[0],d=l[1],v=Zl(!1),f=v[0],p=v[1],g=Ql(!1),m=()=>{var t=()=>{a&&n(e),d(!1)};if(!g.current){var r=null==o?void 0:o.current;r?(g.current=!0,r.style.transition="opacity "+Vc+"ms ease-out",r.style.opacity="0",setTimeout((()=>{g.current=!1,t()}),Vc+50)):t()}},y=t=>{t.detail.surveyId===e.id&&m()};return Gl((()=>{if(t){if(!i){var n,a=t=>{var r,i;if(t.detail.surveyId===e.id){if(null==(r=e.appearance)||!r.displayThankYouMessage)return m();p(!0),null!=(i=e.appearance)&&i.autoDisappear&&(n&&clearTimeout(n),n=setTimeout(m,5e3))}},o=()=>{if(Qh(e,t)){d(!0),qc.dispatchEvent(new Event("PHSurveyShown")),s||t.capture(dh.SHOWN,h({[vh.SURVEY_NAME]:e.name,[vh.SURVEY_ID]:e.id,[vh.SURVEY_ITERATION]:e.current_iteration,[vh.SURVEY_ITERATION_START_DATE]:e.current_iteration_start_date},u&&{[vh.SURVEY_LANGUAGE]:u},{sessionRecordingUrl:null==t.get_session_replay_url?void 0:t.get_session_replay_url()}));try{localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())}catch(e){}}};Ne(qc,"PHSurveyClosed",y),Ne(qc,"PHSurveySent",a);var l=r>0?setTimeout(o,r):void 0;return S(l)&&o(),()=>{S(l)||clearTimeout(l),S(n)||clearTimeout(n),qc.removeEventListener("PHSurveyClosed",y),qc.removeEventListener("PHSurveySent",a)}}}else fh.error("usePopupVisibility hook called without a PostHog instance.")}),[]),zc({survey:e,removeSurveyFromFocus:n,setSurveyVisible:d,isPreviewMode:i,posthog:t}),{isPopupVisible:c,isSurveySent:f,setIsPopupVisible:d,hidePopupWithAnimation:m}}(f,g,j,q,k,x,N,D,F),H=B.isPopupVisible,U=B.hidePopupWithAnimation,W=B.isSurveySent||b===f.questions.length||!0===P,z=Zl(!1),V=z[0],Z=z[1],G=Jl((()=>!!Xh(f)),[f]),Q=!!(null!=(r=f.appearance)&&r.introScreenHeader||null!=(i=f.appearance)&&i.introScreenDescription),J=q?b===Nc:!(null==(n=f.appearance)||!n.displayIntroScreen)&&Q&&!V&&!G,Y=Jl((()=>{var e=Xh(f),t=(null==e?void 0:e.surveySubmissionId)||xh();return{isPreviewMode:q,previewPageIndex:b,onPopupSurveyDismissed(){F?jh(f,g,q,F):jh(f,g,q),R()},isPopup:x||!1,surveySubmissionId:t,onPreviewSubmit:M,onPreviewBack:I,posthog:g,properties:O,surveyLanguage:F}}),[q,b,x,g,f,R,M,I,O,F]);return H?ac(Vh.Provider,{value:Y,children:ac("div",{className:"ph-survey",style:h({},ic(f.type,null==(a=f.appearance)?void 0:a.position,null==(o=f.appearance)?void 0:o.widgetType),y),ref:N,children:W?ac(wc,{header:(null==(s=f.appearance)?void 0:s.thankYouMessageHeader)||"Thank you!",description:(null==(u=f.appearance)?void 0:u.thankYouMessageDescription)||"",forceDisableHtml:!!p,contentType:null==(l=f.appearance)?void 0:l.thankYouMessageDescriptionContentType,appearance:f.appearance||Lh,onClose(){U(),L()}}):J?ac(kc,{header:(null==(c=f.appearance)?void 0:c.introScreenHeader)||"",description:(null==(d=f.appearance)?void 0:d.introScreenDescription)||"",forceDisableHtml:!!p,contentType:null==(v=f.appearance)?void 0:v.introScreenDescriptionContentType,appearance:f.appearance||Lh,onStart:()=>Z(!0)}):ac(Qc,{survey:f,forceDisableHtml:!!p,posthog:g})})}):null}function Qc(e){var t,r,i=e.survey,n=e.forceDisableHtml,a=e.posthog,o=Jl((()=>{var e=Xh(i);if(!e)return null;var t=I(e.lastQuestionIndex);return!t||t&&e.lastQuestionIndex>=0&&i.questions.length>e.lastQuestionIndex?e:(tc(i),null)}),[i]),s=Zl((()=>(null!=o&&o.responses&&fh.info("Survey is already in progress, filling in initial responses"),(null==o?void 0:o.responses)||{}))),u=s[0],l=s[1],c=Yl(Vh),d=c.previewPageIndex,v=c.onPopupSurveyDismissed,f=c.isPopup,p=c.onPreviewSubmit,g=c.onPreviewBack,m=c.surveySubmissionId,y=c.isPreviewMode,b=c.properties,w=c.surveyLanguage,k=Zl((()=>{var e=null==o?void 0:o.lastQuestionIndex,t=I(e)&&e>=0&&i.questions.length>e?e:0;return I(d)&&d>=0?d:t})),_=k[0],x=k[1],C=Zl((()=>{var e;return(null!==(e=null==o?void 0:o.visitedIndices)&&void 0!==e?e:[]).filter((e=>e>=0&&i.questions.length>e))})),M=C[0],T=C[1],E=Zl((()=>{var e,t=Xh(i);return null!==(e=null==t?void 0:t.questionSnapshots)&&void 0!==e?e:{}})),R=E[0],A=E[1],L=Jl((()=>Uh(Wh(i,o))),[i.id,o]),O=Jl((()=>{if(!L||new Set(L).size!==L.length)return Wh(i,o);var e=new Map(i.questions.map((e=>[e.id,e]))),t=L.map((t=>e.get(t))).filter((e=>!!e));return t.length===L.length?t:i.questions}),[L,i.questions,i,o]);Gl((()=>{!y||S(d)||0>d||x(d)}),[d,y]);var P=!(null==(t=i.appearance)||!t.allowGoBack)&&(y?(null!=d?d:0)>0:M.length>0),D=O.at(_);return D?ac("form",{className:"survey-form",name:"surveyForm",children:[f&&!0!==(null==(r=i.appearance)?void 0:r.hideCancelButton)&&ac(yc,{onClick(){v()}}),ac("div",{className:"survey-box","data-question-index":_,children:Yc({question:D,forceDisableHtml:n,displayQuestionIndex:_,appearance:i.appearance||Lh,onSubmit:e=>(e=>{var t=e.res,r=e.displayQuestionIndex,n=e.questionId;if(a)if(n){var o=ui(n),s=h({},u,{[o]:t});l(s);var c=O[r],d=null!=c&&c.id?h({},R,{[c.id]:c.question}):R;A(d);var v=Pc(i,r,t),f=v===hh.End,p=[...M,r];if(f||(T(p),x(v),Kh(i,{surveySubmissionId:m,responses:s,lastQuestionIndex:v,questionOrder:Uh(O),visitedIndices:p,surveyLanguage:w,questionSnapshots:d})),i.enable_partial_responses||f){var g=new Set(p.map((e=>{var t;return null==(t=O[e])?void 0:t.id})).filter((e=>!!e)).map((e=>ui(e)))),y=Object.fromEntries(Object.entries(s).filter((e=>g.has(e[0]))));Nh({responses:y,survey:i,surveySubmissionId:m,isSurveyCompleted:f,posthog:a,properties:b,surveyLanguage:w,questionSnapshots:d})}}else fh.error("onNextButtonClick called without a questionId.");else fh.error("onNextButtonClick called without a PostHog instance.")})({res:e,displayQuestionIndex:_,questionId:D.id}),onPreviewSubmit:p,initialValue:D.id?u[ui(D.id)]:void 0,canGoBack:P,onBack(){if(y)g();else if(0!==M.length){var e=M[M.length-1],t=M.slice(0,-1);T(t),x(e),Kh(i,{surveySubmissionId:m,responses:u,lastQuestionIndex:e,questionOrder:Uh(O),visitedIndices:t,surveyLanguage:w,questionSnapshots:R})}}})})]}):null}function Jc(e){var t,r,i,n,a,o,s,u=e.survey,l=e.forceDisableHtml,h=e.posthog,c=e.readOnly,d=e.surveyLanguage,v=Zl(!0),f=v[0],p=v[1],g=Zl(!1),m=g[0],y=g[1],b=Zl({}),w=b[0],k=b[1],_=Ql(void 0),x=()=>{y(!m)};if(Gl((()=>{var e;if(h){if(!c){"tab"===(null==(e=u.appearance)?void 0:e.widgetType)&&k({top:"50%",bottom:"auto"});var t=e=>{var t,r=e;(null==(t=r.detail)?void 0:t.surveyId)===u.id&&(fh.info("Received show event for feedback button survey "+u.id),k(r.detail.position||{}),x())};return Ne(qc,Bc,t),()=>{S(_.current)||(clearTimeout(_.current),_.current=void 0),qc.removeEventListener(Bc,t)}}}else fh.error("FeedbackWidget called without a PostHog instance.")}),[h,c,u.id,null==(t=u.appearance)?void 0:t.widgetType,null==(r=u.appearance)?void 0:r.widgetSelector,null==(i=u.appearance)?void 0:i.borderColor]),zc({survey:u,setSurveyVisible:p,posthog:h}),!f)return null;var C=()=>{u.schedule!==ch&&p(!1),S(_.current)||clearTimeout(_.current),_.current=setTimeout((()=>{_.current=void 0,y(!1)}),200)};return ac(dl,{children:["tab"===(null==(n=u.appearance)?void 0:n.widgetType)&&ac("button",{className:"ph-survey-widget-tab "+((null==(a=u.appearance)?void 0:a.tabPosition)===sh.Top?"widget-tab-top":""),onClick:x,disabled:c,style:Zc(null==(o=u.appearance)?void 0:o.tabPosition),children:(null==(s=u.appearance)?void 0:s.widgetLabel)||""}),m&&ac(Gc,{posthog:h,survey:u,forceDisableHtml:l,style:w,onPopupSurveyDismissed:C,onCloseConfirmationMessage:C,surveyLanguage:d})]})}var Yc=e=>{var t=e.question,r=e.onSubmit,i=e.onPreviewSubmit,n={forceDisableHtml:e.forceDisableHtml,appearance:e.appearance,onPreviewSubmit(e){i(e)},onSubmit(e){r(e)},initialValue:e.initialValue,displayQuestionIndex:e.displayQuestionIndex,canGoBack:e.canGoBack,onBack:e.onBack};switch(t.type){case lh.Open:return hl(Sc,h({},n,{question:t,key:t.id}));case lh.Link:return hl(xc,h({},n,{question:t,key:t.id}));case lh.Rating:return hl(Cc,h({},n,{question:t,key:t.id}));case lh.SingleChoice:case lh.MultipleChoice:return hl(Tc,h({},n,{question:t,key:t.id}));default:return fh.error("Unsupported question type: "+t.type),null}};s.__PosthogExtensions__=s.__PosthogExtensions__||{},s.__PosthogExtensions__.generateSurveys=Wc,s.extendPostHogWithSurveys=Wc;var Kc=1e4,Xc=(e,t,r)=>r.remaining>0?t.length>r.remaining?(e.push(t.slice(0,r.remaining)),r.remaining=0,r.truncated=!0,!1):(e.push(t),r.remaining-=t.length,!0):(r.truncated=!0,!1),ed=(e,t,r)=>{var i=JSON.stringify(e);if(r.remaining>=i.length)return Xc(t,i,r);if(r.truncated=!0,2>r.remaining)return!1;for(var n=0,a=Math.min(e.length,r.remaining-2);a>n;){var o=Math.ceil((n+a)/2);JSON.stringify(e.slice(0,o)).length>r.remaining?a=o-1:n=o}return Xc(t,JSON.stringify(e.slice(0,n)),r)},td=e=>void 0!==e&&"function"!=typeof e&&"symbol"!=typeof e&&"bigint"!=typeof e,rd=(e,t,r)=>{if(!r.truncated){if(r.keysRemaining-=1,r.sizeRemaining-=String(t).length+e.length,0>=r.keysRemaining||0>=r.sizeRemaining)return r.truncated=!0,void(r.result.attributes_truncated=!0);r.result[e]=t}},id=(e,t,r)=>{if(!r.truncated)if(_(e)){if(r.seen.has(e))return void rd(t||"circular","[Circular]",r);r.seen.add(e);try{for(var i in e)try{if(!{}.hasOwnProperty.call(e,i))continue;if(id(e[i],t?t+"."+i:i,r),r.truncated)return}catch(e){continue}}catch(e){}}else rd(t,e,r)},nd=function(e,t,r,i,n,a){if(void 0===n&&(n=!1),!td(e))return!n||Xc(t,"null",r);if(M(e)||(e=>{try{return I(e)||E(e)}catch(e){return!1}})(e))return Xc(t,JSON.stringify(e),r);if("string"==typeof e)return ed(e,t,r);if(!_(e)&&!w(e))return Xc(t,JSON.stringify(e),r);if(i.has(e))return ed("[Circular]",t,r);i.add(e);try{var o=e.toJSON;if(k(o))return nd(o.call(e),t,r,i,n)}catch(e){}try{var s={}.toString.call(e);if("[object String]"===s)return ed(String(e.valueOf()),t,r);if("[object Number]"===s||"[object Boolean]"===s)return Xc(t,JSON.stringify(e.valueOf()),r)}catch(e){}if(e instanceof Error){var u={};try{for(var l in e)({}).hasOwnProperty.call(e,l)&&(u[l]=e[l])}catch(e){}try{u.name=e.name}catch(e){}try{u.message=e.message}catch(e){}try{u.stack=e.stack}catch(e){}return nd(u,t,r,i,n,a)}if(w(e)){if(!Xc(t,"[",r))return!1;for(var h=0;e.length>h;h++){if(h>0&&!Xc(t,",",r))return!1;var c=void 0;try{c=e[h]}catch(e){c=void 0}if(!nd(c,t,r,i,!0))return!1}return Xc(t,"]",r)}if(!Xc(t,"{",r))return!1;var d=!0;try{for(var v in e)if({}.hasOwnProperty.call(e,v)){if(0>=r.remaining)return r.truncated=!0,!1;var f=void 0;try{f=e[v]}catch(e){continue}if(a)try{id(f,v,a)}catch(e){}if(td(f)){var p=(d?"":",")+JSON.stringify(v)+":";if(p.length>=r.remaining)return r.truncated=!0,!1;var g=t.length,m=r.remaining,y=r.truncated;if(!Xc(t,p,r))return!1;var b=t.length,S=nd(f,t,r,i,!1),x=r.truncated;if(t.length!==b){if(d=!1,!S)return!1}else if(t.length=g,r.remaining=m,r.truncated=S?y:x,!S)return!1}}}catch(e){}return Xc(t,"}",r)},ad=(e,t)=>{for(var r=[],i={remaining:t,truncated:!1},n=_(e[0])?{result:{},keysRemaining:50,sizeRemaining:Kc,truncated:!1,seen:new WeakSet([e[0]])}:void 0,a=0;e.length>a&&(0>=a||Xc(r," ",i))&&nd(e[a],r,i,new WeakSet,!1,0===a?n:void 0);a++);return{body:r.join("")+(i.truncated?"...":""),truncated:i.truncated,attributes:(null==n?void 0:n.result)||{}}},od={debug:"debug",log:"info",warn:"warn",error:"error",info:"info"},sd=e=>"canCapture"in e,ud=e=>sd(e)?e.canCapture?e.getExtension("logs"):void 0:e.is_capturing()?e.logs:void 0;s.__PosthogExtensions__=s.__PosthogExtensions__||{},s.__PosthogExtensions__.logs={initializeLogs(e){var t=e,r=[],i={host:s.location.host},n=!1,a=function(e){var a=s.console[e];r.push(gu(s.console,e,(r=>{var o=(r=>function(){for(var a=!1,o=arguments.length,u=new Array(o),l=0;o>l;l++)u[l]=arguments[l];try{var c=t;if(u.length>0&&!n&&c){var d=ud(c);if(d){n=!0,a=!0;var v=ad(u,Kc),f=v.body,p=v.attributes,g=h({},i,v.truncated?{body_truncated:"true"}:{});((e,t,r)=>{if(sd(e))t.captureConsoleLog(r);else{var i=(e=>{var t=/^1\.(\d+)\.(\d+)$/.exec(e);if(t){var r=Number(t[1]),i=Number(t[2]);if(r>=392&&419>=r)return 410===r?i>4?i>10?void 0:"de":"le":418===r?i>3?i>10?i>14?i>17?void 0:"vi":"ci":"ui":"he":419===r?i>2?void 0:"vi":410>r?"le":"he"}})(e.version),n=i?t[i]:void 0;k(n)&&n.call(t,r)}})(c,d,{level:od[e],body:f,attributes:h({"log.source":"console."+e},g,p)})}}}catch(e){}finally{a&&(n=!1),r.apply(s.console,u)}})(r);return o.__rrweb_original__=(e=>{for(;null!=(t=e)&&t.__rrweb_original__;){var t;e=e.__rrweb_original__}return e})(a),o})))};for(var o of Object.keys(od))a(o);return()=>{t=void 0,r.forEach((e=>e()))}},replayConsoleBuffer(e,t){var r=ud(e);if(r)for(var i of t)try{var n=ad(i.args,Kc);null==r.captureBufferedConsoleLog||r.captureBufferedConsoleLog({level:od[i.level],body:n.body,attributes:h({"log.source":"console."+i.level,host:s.location.host},n.truncated?{body_truncated:"true"}:{},n.attributes)},i.context,i.occurredAtMs)}catch(e){}}},Oe("[Error tracking]");var ld=Oe("[ExceptionAutocapture]"),hd=new class{constructor(e,t,r){void 0===r&&(r=[]),this.coercers=e,this.stackParser=t,this.modifiers=r}buildFromUnknown(e,t){void 0===t&&(t={});var r=t&&t.mechanism||{handled:!0,type:"generic"},i=this.buildCoercingContext(r,t,0).apply(e),n=this.buildParsingContext(t),a=this.parseStacktrace(i,n);return{$exception_list:this.convertToExceptionList(a,r),$exception_level:"error"}}modifyFrames(e){var t=this;return l((function*(){for(var r of e)r.stacktrace&&r.stacktrace.frames&&w(r.stacktrace.frames)&&(r.stacktrace.frames=yield t.applyModifiers(r.stacktrace.frames));return e}))()}coerceFallback(e){var t;return{type:"Error",value:"Unknown error",stack:null==(t=e.syntheticException)?void 0:t.stack,synthetic:!0}}parseStacktrace(e,t){var r,i;return null!=e.cause&&(r=this.parseStacktrace(e.cause,t)),""!=e.stack&&null!=e.stack&&(i=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?t.skipFirstLines:0),t.chunkIdMap)),h({},e,{cause:r,stack:i})}applyChunkIds(e,t){return e.map((e=>(e.filename&&t&&(e.chunk_id=t[e.filename]),e)))}applyCoercers(e,t){for(var r of this.coercers)if(r.match(e))return r.coerce(e,t);return this.coerceFallback(t)}applyModifiers(e){var t=this;return l((function*(){var r=e;for(var i of t.modifiers)r=yield i(r);return r}))()}convertToExceptionList(e,t){var r,i,n,a={type:e.type,value:e.value,mechanism:{type:null!==(r=t.type)&&void 0!==r?r:"generic",handled:null===(i=t.handled)||void 0===i||i,synthetic:null!==(n=e.synthetic)&&void 0!==n&&n}};e.stack&&(a.stacktrace={type:"raw",frames:e.stack});var o=[a];return null!=e.cause&&o.push(...this.convertToExceptionList(e.cause,h({},t,{handled:!0}))),o}buildParsingContext(e){var t;return{chunkIdMap:pe(this.stackParser),skipFirstLines:null!==(t=e.skipFirstLines)&&void 0!==t?t:1}}buildCoercingContext(e,t,r){void 0===r&&(r=0);var i=(r,i)=>{if(4>=i){var n=this.buildCoercingContext(e,t,i);return this.applyCoercers(r,n)}};return h({},t,{syntheticException:0==r?t.syntheticException:void 0,mechanism:e,apply:e=>i(e,r),next:e=>i(e,r+1)})}}([new class{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,t){var r=x(e.stack);return{type:this.getType(e),value:this.getValue(e),stack:r?e.stack:void 0,cause:e.cause?t.next(e.cause):void 0,synthetic:!1}}getType(e){return this.isDOMError(e)?"DOMError":"DOMException"}getValue(e){var t=e.name||(this.isDOMError(e)?"DOMError":"DOMException");return e.message?t+": "+e.message:t}isDOMException(e){return L(e,"DOMException")}isDOMError(e){return L(e,"DOMError")}},new class{match(e){return L(e,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(e)}isCustomEventWrappingRejection(e){if(!P(e))return!1;try{var t=e.detail;return null!=t&&"object"==typeof t&&"reason"in t}catch(e){return!1}}coerce(e,t){var r,i=this.getUnhandledRejectionReason(e);return A(i)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(i),stack:null==(r=t.syntheticException)?void 0:r.stack,synthetic:!0}:t.apply(i)}getUnhandledRejectionReason(e){try{if("reason"in e)return e.reason;if("detail"in e&&null!=e.detail&&"object"==typeof e.detail&&"reason"in e.detail)return e.detail.reason}catch(e){}return e}},new class{constructor(){}match(e){return!!L(e,"ErrorEvent")&&(null!=e.error||this.$i(e))}coerce(e,t){var r;if(null!=e.error)return t.apply(e.error);var i=t.apply(e.message);return h({},i,{stack:null!==(r=this.Ui(e))&&void 0!==r?r:i.stack,synthetic:!0})}$i(e){return x(e.message)&&e.message.length>0}Ui(e){var t,r,i=e,n=null!==(t=i.lineno)&&void 0!==t?t:0,a=null!==(r=i.colno)&&void 0!==r?r:0;if(x(i.filename)&&0!==i.filename.length&&0!==n)return"Error\n at "+i.filename+":"+n+":"+a}},new class{match(e){return O(e)}coerce(e,t){var r,i=this.getStack(e),n=void 0===i;return{type:this.getType(e),value:this.getMessage(e,t),stack:null!=i?i:null==(r=t.syntheticException)?void 0:r.stack,cause:e.cause?t.next(e.cause):void 0,synthetic:n}}getType(e){return e.name||e.constructor.name}getMessage(e,t){var r=e.message;return String(r.error&&"string"==typeof r.error.message?r.error.message:r)}getStack(e){return e.stacktrace||e.stack||void 0}},new class{match(e){return P(e)}coerce(e,t){var r,i=e.constructor.name;return{type:i,value:i+" captured as exception with keys: "+Ee(e),stack:null==(r=t.syntheticException)?void 0:r.stack,synthetic:!0}}},new class{match(e){return"object"==typeof e&&null!==e}coerce(e,t){var r,i,n=this.getErrorPropertyFromObject(e);return n?t.apply(n):{type:this.getType(e),value:this.getValue(e),stack:null!==(r=this.getStack(e))&&void 0!==r?r:null==(i=t.syntheticException)?void 0:i.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}}getType(e){if(P(e))return e.constructor.name;var t="name"in e?e.name:void 0;return x(t)&&!C(t)?t:"Error"}getValue(e){if("name"in e&&"string"==typeof e.name){var t="'"+e.name+"' captured as exception";return"message"in e&&"string"==typeof e.message&&(t+=" with message: '"+e.message+"'"),t}if("message"in e&&"string"==typeof e.message)return e.message;var r=this.getObjectClassName(e);return(r&&"Object"!==r?"'"+r+"'":"Object")+" captured as exception with keys: "+Ee(e)}isSeverityLevel(e){return x(e)&&!C(e)&&Ie.indexOf(e)>=0}getStack(e){try{return x(e.stacktrace)&&e.stacktrace.length>0?e.stacktrace:x(e.stack)&&e.stack.length>0?e.stack:void 0}catch(e){return}}getErrorPropertyFromObject(e){for(var t in e)if({}.hasOwnProperty.call(e,t)){var r=e[t];if(O(r))return r}}getObjectClassName(e){try{var t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch(e){return}}},new class{match(e){return"string"==typeof e}coerce(e,t){var r,i=this.getInfos(e),n=i[0],a=i[1];return{type:null!=n?n:"Error",value:null!=a?a:e,stack:null==(r=t.syntheticException)?void 0:r.stack,synthetic:!0}}getInfos(e){var t="Error",r=e,i=e.match(Te);return i&&(t=i[1],r=i[2]),[t,r]}},new class{match(e){return A(e)}coerce(e,t){var r;return{type:"Error",value:"Primitive value captured as exception: "+String(e),stack:null==(r=t.syntheticException)?void 0:r.stack,synthetic:!0}}}],function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;t>i;i++)r[i-1]=arguments[i];return function(t,i){void 0===i&&(i=0);for(var n=[],a=t.split("\n"),o=i;a.length>o;o++){var s=a[o];if(1024>=s.length){var u=Me.test(s)?s.replace(Me,"$1"):s;if(!u.match(/\S*Error: /)){for(var l of r){var c=l(u,e);if(c){n.push(c);break}}if(n.length>=50)break}}}return function(e){if(!e.length)return[];var t=Array.from(e);return t.reverse(),t.slice(0,50).map((e=>{return h({},e,{filename:e.filename||(r=t,r[r.length-1]||{}).filename,function:e.function||ge});var r}))}(n)}}("web:javascript",_e,Ce)),cd=t=>{var r=e;r||ld.info("window not available, cannot wrap onerror");var i=r.onerror;return r.onerror=function(){for(var e,r=arguments.length,n=new Array(r),a=0;r>a;a++)n[a]=arguments[a];var o=hd.buildFromUnknown((e=>{var t=e[0],r=e[1],i=e[2],n=e[3],a=e[4];if(null!=a)return a;if(x(t)&&x(r)&&r.length>0&&"undefined"!=typeof ErrorEvent)try{return new ErrorEvent("error",{message:t,filename:r,lineno:i,colno:n})}catch(e){return t}return t})(n),{mechanism:{handled:!1}});return t(o),!!k(i)&&null!==(e=i(...n))&&void 0!==e&&e},r.onerror.__POSTHOG_INSTRUMENTED__=!0,()=>{var e;null==(e=r.onerror)||delete e.__POSTHOG_INSTRUMENTED__,r.onerror=i}},dd=function(t,r){void 0===r&&(r=!1);var i=e;i||ld.info("window not available, cannot wrap onUnhandledRejection");var n=i.onunhandledrejection;return i.onunhandledrejection=function(e){var i,a=hd.buildFromUnknown(e,{mechanism:{handled:!1}});return t(a),k(n)?null!==(i=n(e))&&void 0!==i&&i:r},i.onunhandledrejection.__POSTHOG_INSTRUMENTED__=!0,()=>{var e;null==(e=i.onunhandledrejection)||delete e.__POSTHOG_INSTRUMENTED__,i.onunhandledrejection=n}},vd={wrapOnError:cd,wrapUnhandledRejection:dd,wrapConsoleError(e){var t=console;t||ld.info("console not available, cannot wrap console.error");var r=t.error;return t.error=function(){for(var t,i=arguments.length,n=new Array(i),a=0;i>a;a++)n[a]=arguments[a];t=1==n.length?n[0]:n.join(" ");var o=n.find((e=>e instanceof Error)),s=hd.buildFromUnknown(o||t,{mechanism:{handled:!1},syntheticException:new Error("PostHog syntheticException"),skipFirstLines:2});e(s),k(r)&&r(...n)},t.error.__POSTHOG_INSTRUMENTED__=!0,()=>{var e;null==(e=t.error)||delete e.__POSTHOG_INSTRUMENTED__,t.error=r}}};s.__PosthogExtensions__=s.__PosthogExtensions__||{},s.__PosthogExtensions__.errorWrappingFunctions=vd,s.posthogErrorWrappingFunctions=vd;var fd=(e,t)=>{if(k(null==e?void 0:e.capture)){var r=null==t?void 0:t.autocaptureExceptions,i=!M(r)&&"object"==typeof r&&w(r.errors_to_ignore)?r.errors_to_ignore.reduce(((e,t)=>{try{e.push(new RegExp(t))}catch(e){ld.error("Ignoring invalid legacy exception exclusion rule",t,e)}return e}),[]):[],n=t=>{try{null==e.capture||e.capture("$exception",t,{_noTruncate:!0,_batchKey:"exceptionEvent",_noHeatmaps:!0})}catch(e){ld.error("Failed to capture exception for a legacy client",e)}};cd((e=>{i.some((t=>e.$exception_list.some((e=>t.test(e.value||"")))))||n(e)})),dd(n,!0)}};s.extendPostHogWithExceptionAutoCapture=fd,s.extendPostHogWithExceptionAutocapture=fd;var pd="X-POSTHOG-SESSION-ID",gd="X-POSTHOG-WINDOW-ID",md="X-POSTHOG-DISTINCT-ID",yd=[pd,gd,md],bd=["attributionReporting","body","browsingTopics","cache","credentials","dispatcher","duplex","integrity","keepalive","method","mode","priority","redirect","referrer","referrerPolicy","signal","window"],wd=(e,t)=>({}.hasOwnProperty.call(e,t)),kd=e=>"object"==typeof e&&!M(e)||k(e),_d=e=>"undefined"!=typeof Request&&(e instanceof Request||"[object Request]"==={}.toString.call(e)),Sd=t=>{try{var r;return _d(t)?t.url:new URL(t instanceof URL?t.toString():String(t),null==e||null==(r=e.location)?void 0:r.href).toString()}catch(e){return}},xd=(e,t,r,i,n)=>{var a;try{a=new URL(i).hostname}catch(e){return!1}if(!e)return!1;if(w(e)&&!e.includes(a))return!1;var o=!1;if(r){var s=r.checkAndGetSessionAndWindowId(!0),u=s.windowId;n.set(pd,s.sessionId),n.set(gd,u),o=!0}var l=(e=>k(e)?e():e)(t);return l&&"$posthog_cookieless"!==l&&(n.set(md,l),o=!0),o};s.__PosthogExtensions__=s.__PosthogExtensions__||{};var Cd={_patchFetch:(t,r,i)=>gu(e,"fetch",(e=>function(n,a){var o=arguments.length>1?[n,a]:[n],s=o;try{var u=Sd(n);if(u)if(_d(n)){var l=new Request(n,a);xd(t,r,i,l.url,l.headers),s=[l]}else{var c=new Headers(kd(a)?a.headers:void 0);if(xd(t,r,i,u,c)){var d=((e,t)=>{if(S(e)||M(e))return{headers:t};if(kd(e)){var r=e;if("undefined"==typeof Proxy||"undefined"==typeof Reflect){var i=Object.create(r);return Object.defineProperty(i,"headers",{configurable:!0,enumerable:!0,value:t,writable:!0}),i}return new Proxy({headers:t},{get:(e,t)=>wd(e,t)?Reflect.get(e,t):Reflect.get(r,t,r),has:(e,t)=>wd(e,t)||t in r,ownKeys(e){var t=new Set(Reflect.ownKeys(e));return Reflect.ownKeys(r).forEach((e=>t.add(e))),bd.forEach((e=>{e in r&&t.add(e)})),Array.from(t)},getOwnPropertyDescriptor(e,t){var i=Reflect.getOwnPropertyDescriptor(e,t);if(i)return i;if("string"==typeof t&&bd.includes(t)&&t in r)return{configurable:!0,enumerable:!0,get(){return Reflect.get(r,t,r)}};var n=Reflect.getOwnPropertyDescriptor(r,t);return n?h({},n,{configurable:!0}):void 0},getPrototypeOf:()=>Object.getPrototypeOf(r)})}})(a,c);d&&(s=[n,d])}}}catch(e){s=o}return e.apply(this,s)})),_patchXHR:(t,r,i)=>gu(e.XMLHttpRequest.prototype,"open",(e=>function(n,a,o,s,u){void 0===o&&(o=!0);var l=this,h=new Headers,c=Sd(a);c&&xd(t,r,i,c,h);var d=e.call(l,n,a,o,s,u);return yd.forEach((e=>{var t=h.get(e);if(t)try{l.setRequestHeader(e,t)}catch(e){}})),d}))};s.__PosthogExtensions__.tracingHeadersPatchFns=Cd,s.postHogTracingHeadersPatchFns=Cd,"function"!=typeof[].at&&Object.defineProperty(Array.prototype,"at",{value(e){var t=this.length,r=Math.trunc(e)||0;return 0>r&&(r+=t),0>r||r>=t?void 0:this[r]},writable:!0,enumerable:!1,configurable:!0});let Md=class{constructor(){this.t=void 0,this.o=0,this.i=[]}l(e){var t;if(!e.hadRecentInput){var r=this.i[0],i=this.i.at(-1);this.o&&r&&i&&1e3>e.startTime-i.startTime&&5e3>e.startTime-r.startTime?(this.o+=e.value,this.i.push(e)):(this.o=e.value,this.i=[e]),null==(t=this.t)||t.call(this,e)}}};var Td=()=>{var e=performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},Id=e=>{if("loading"===document.readyState)return"loading";var t=Td();if(t){if(t.domInteractive>e)return"loading";if(0===t.domContentLoadedEventStart||t.domContentLoadedEventStart>e)return"dom-interactive";if(0===t.domComplete||t.domComplete>e)return"dom-content-loaded"}return"complete"},Ed=e=>{var t=e.nodeName;return 1===e.nodeType?t.toLowerCase():t.toUpperCase().replace(/^#/,"")},Rd=e=>{var t="";try{for(;9!==(null==(r=e)?void 0:r.nodeType);){var r,i,n=e,a=n.id?"#"+n.id:[Ed(n),...Array.from(null!==(i=n.classList)&&void 0!==i?i:[]).sort()].join(".");if(t.length+a.length>99)return t||a;if(t=t?a+">"+t:a,n.id)break;e=n.parentNode}}catch(e){}return t},Ad=new WeakMap;function Ld(e,t){var r=Ad.get(t);return r||(r=new WeakMap,Ad.set(t,r)),r.get(e)||r.set(e,new t),r.get(e)}var Od=-1,Pd=()=>Od,Dd=e=>{addEventListener("pageshow",(t=>{t.persisted&&(Od=t.timeStamp,e(t))}),!0)},Fd=(e,t,r,i)=>{var n,a;return o=>{t.value>=0&&(o||i)&&((a=t.value-(null!=n?n:0))||void 0===n)&&(n=t.value,t.delta=a,t.rating=((e,t)=>e>t[1]?"poor":e>t[0]?"needs-improvement":"good")(t.value,r),e(t))}},Nd=e=>{requestAnimationFrame((()=>requestAnimationFrame(e)))},qd=()=>{var e,t;return null!==(e=null==(t=Td())?void 0:t.activationStart)&&void 0!==e?e:0},jd=-1,Bd=new Set,Hd=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,$d=e=>{if("hidden"===document.visibilityState){if("visibilitychange"===e.type)for(var t of Bd)t();isFinite(jd)||(jd="visibilitychange"===e.type?e.timeStamp:0,removeEventListener("prerenderingchange",$d,!0))}},Ud=function(e){if(void 0===e&&(e=!1),e&&(jd=1/0),0>jd){var t,r=qd(),i=document.prerendering||null==(t=globalThis.performance.getEntriesByType("visibility-state").find((e=>"hidden"===e.name&&e.startTime>=r)))?void 0:t.startTime;jd=null!=i?i:Hd(),addEventListener("visibilitychange",$d,!0),addEventListener("prerenderingchange",$d,!0),Dd((()=>{setTimeout((()=>{jd=Hd()}))}))}return{get firstHiddenTime(){return jd},onHidden(e){Bd.add(e)}}},Wd=function(e,t,r,i,n,a,o){void 0===t&&(t=-1),void 0===i&&(i=0);var s=Td(),u=(null==s?void 0:s.navigationId)||0,l="navigate";return r?l=r:0>Pd()?s&&(document.prerendering||qd()>0?l="prerender":document.wasDiscarded?l="restore":s.type&&(l=s.type.replace(/_/g,"-"))):l="back-forward-cache",{name:e,value:t,rating:"good",delta:0,entries:[],id:"v6-"+Date.now()+"-"+(Math.floor(8999999999999*Math.random())+1e12),navigationType:l,navigationId:i||u,navigationInteractionId:n,navigationURL:a||(null==s?void 0:s.name),navigationStartTime:o||0}},zd=function(e,t,r){void 0===r&&(r={});try{var i=e.filter((e=>PerformanceObserver.supportedEntryTypes.includes(e)));if(i.length>0){var n=new PerformanceObserver((e=>{queueMicrotask((()=>{var r=e.getEntries();i.length>1&&r.sort(((e,t)=>e.startTime+e.duration-(t.startTime+t.duration))),t(r)}))}));for(var a of i)n.observe(h({type:a,buffered:!0},r));return n}}catch(e){}},Vd=e=>{var t;return PerformanceObserver.supportedEntryTypes.includes("soft-navigation")&&"function"==typeof(null==(t=globalThis.PerformanceSoftNavigation)||null==(t=t.prototype)?void 0:t.getLargestInteractionContentfulPaint)&&e&&e.reportSoftNavs},Zd=(e,t)=>{if(e.set(t.navigationId,t),e.size>2){var r=e.keys().next().value;void 0!==r&&e.delete(r)}},Gd=e=>{var t=!1;return()=>{t||(e(),t=!0)}};let Qd=class{constructor(){this.u=void 0}};var Jd,Yd=e=>{document.prerendering?addEventListener("prerenderingchange",e,!0):e()},Kd=[1800,3e3],Xd=function(e,t){void 0===t&&(t={});var r=Vd(t);Yd((()=>{var i,n=Ld(t,Qd),a=Ud(),o=Wd("FCP"),s=zd(["paint"],(e=>{for(var t of e)"first-contentful-paint"===t.name&&(s.disconnect(),a.firstHiddenTime>t.startTime&&(o.value=Math.max(t.startTime-qd(),0),o.entries.push(t),o.navigationId=t.navigationId||o.navigationId,i(!0)))}));s&&(i=Fd(e,o,Kd,t.reportAllChanges),Dd((r=>{o=Wd("FCP",-1,"back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,Pd()),i=Fd(e,o,Kd,t.reportAllChanges),Nd((()=>{o.value=performance.now()-r.timeStamp,i(!0)}))}))),r&&zd(["soft-navigation"],(r=>{r.forEach((r=>{n.u&&r.navigationId&&Zd(n.u,r);var a=Math.max((r.presentationTime||r.paintTime||0)-r.startTime,0);o=Wd("FCP",a,"soft-navigation",r.navigationId,r.interactionId,r.name,r.startTime),(i=Fd(e,o,Kd,t.reportAllChanges))(!0)}))}),t)}))},ev=[.1,.25],tv=e=>e.find((e=>{var t;return 1===(null==(t=e.node)?void 0:t.nodeType)}))||e[0],rv=0,iv=1/0,nv=0,av=e=>{for(var t of e)t.interactionId&&(iv=Math.min(iv,t.interactionId),nv=Math.max(nv,t.interactionId),rv=nv?(nv-iv)/7+1:0)},ov=()=>{var e;return Jd?rv:null!==(e=performance.interactionCount)&&void 0!==e?e:0},sv=0;let uv=class{constructor(){this.h=[],this.v=new Map,this.p=void 0,this.m=void 0}M(){sv=ov(),this.h.length=0,this.v.clear()}T(e){var t=ov()-sv,r=Math.min(this.h.length-1,Math.floor(t/50));return!t||-1!==r||"soft-navigation"!==e&&"back-forward-cache"!==e?this.h[r]:{D:8,id:-1,entries:[]}}l(e){var t;if(null!=(t=this.p)&&t.call(this,e),e.interactionId||"first-input"===e.entryType){var r=this.h.at(-1),i=this.v.get(e.interactionId);if(i||10>this.h.length||e.duration>r.D){var n;if(i?e.duration>i.D?(i.entries=[e],i.D=e.duration):e.duration===i.D&&e.startTime===i.entries[0].startTime&&i.entries.push(e):(this.v.set((i={id:e.interactionId,entries:[e],D:e.duration}).id,i),this.h.push(i)),this.h.sort(((e,t)=>t.D-e.D)),this.h.length>10){var a=this.h.splice(10);for(var o of a)this.v.delete(o.id)}null==(n=this.m)||n.call(this,i)}}}};var lv=e=>{var t="requestIdleCallback"in globalThis?1e3:0,r=globalThis.requestIdleCallback||setTimeout,i=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)e();else{var n=Gd(e),a=-1,o=()=>{i(a),n()};addEventListener("visibilitychange",o,{once:!0,capture:!0}),a=r((()=>{removeEventListener("visibilitychange",o,{capture:!0}),n()}),{timeout:t})}},hv=[200,500];let cv=class{constructor(){this.p=void 0,this.u=void 0}l(e){var t;null==(t=this.p)||t.call(this,e)}};var dv=[2500,4e3],vv=-1,fv=()=>vv,pv=e=>{addEventListener("pageshow",(t=>{t.persisted&&(vv=t.timeStamp,e(t))}),!0)},gv=(e,t,r,i)=>{var n,a;return o=>{t.value>=0&&(o||i)&&((a=t.value-(null!=n?n:0))||void 0===n)&&(n=t.value,t.delta=a,t.rating=((e,t)=>e>t[1]?"poor":e>t[0]?"needs-improvement":"good")(t.value,r),e(t))}},mv=e=>{requestAnimationFrame((()=>requestAnimationFrame(e)))},yv=()=>{var e=performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},bv=()=>{var e,t;return null!==(e=null==(t=yv())?void 0:t.activationStart)&&void 0!==e?e:0},wv=-1,kv=new Set,_v=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,Sv=e=>{if("hidden"===document.visibilityState){if("visibilitychange"===e.type)for(var t of kv)t();isFinite(wv)||(wv="visibilitychange"===e.type?e.timeStamp:0,removeEventListener("prerenderingchange",Sv,!0))}},xv=function(e){if(void 0===e&&(e=!1),e&&(wv=1/0),0>wv){var t,r=bv(),i=document.prerendering||null==(t=globalThis.performance.getEntriesByType("visibility-state").find((e=>"hidden"===e.name&&e.startTime>=r)))?void 0:t.startTime;wv=null!=i?i:_v(),addEventListener("visibilitychange",Sv,!0),addEventListener("prerenderingchange",Sv,!0),pv((()=>{setTimeout((()=>{wv=_v()}))}))}return{get firstHiddenTime(){return wv},onHidden(e){kv.add(e)}}},Cv=function(e,t,r,i,n,a,o){void 0===t&&(t=-1),void 0===i&&(i=0);var s=yv(),u=(null==s?void 0:s.navigationId)||0,l="navigate";return r?l=r:0>fv()?s&&(document.prerendering||bv()>0?l="prerender":document.wasDiscarded?l="restore":s.type&&(l=s.type.replace(/_/g,"-"))):l="back-forward-cache",{name:e,value:t,rating:"good",delta:0,entries:[],id:"v6-"+Date.now()+"-"+(Math.floor(8999999999999*Math.random())+1e12),navigationType:l,navigationId:i||u,navigationInteractionId:n,navigationURL:a||(null==s?void 0:s.name),navigationStartTime:o||0}},Mv=new WeakMap;function Tv(e,t){var r=Mv.get(t);return r||(r=new WeakMap,Mv.set(t,r)),r.get(e)||r.set(e,new t),r.get(e)}let Iv=class{constructor(){this.t=void 0,this.i=0,this.o=[]}h(e){var t;if(!e.hadRecentInput){var r=this.o[0],i=this.o.at(-1);this.i&&r&&i&&1e3>e.startTime-i.startTime&&5e3>e.startTime-r.startTime?(this.i+=e.value,this.o.push(e)):(this.i=e.value,this.o=[e]),null==(t=this.t)||t.call(this,e)}}};var Ev=function(e,t,r){void 0===r&&(r={});try{var i=e.filter((e=>PerformanceObserver.supportedEntryTypes.includes(e)));if(i.length>0){var n=new PerformanceObserver((e=>{queueMicrotask((()=>{var r=e.getEntries();i.length>1&&r.sort(((e,t)=>e.startTime+e.duration-(t.startTime+t.duration))),t(r)}))}));for(var a of i)n.observe(h({type:a,buffered:!0},r));return n}}catch(e){}},Rv=e=>{var t;return PerformanceObserver.supportedEntryTypes.includes("soft-navigation")&&"function"==typeof(null==(t=globalThis.PerformanceSoftNavigation)||null==(t=t.prototype)?void 0:t.getLargestInteractionContentfulPaint)&&e&&e.reportSoftNavs},Av=(e,t)=>{if(e.set(t.navigationId,t),e.size>2){var r=e.keys().next().value;void 0!==r&&e.delete(r)}},Lv=e=>{var t=!1;return()=>{t||(e(),t=!0)}};let Ov=class{constructor(){this.l=void 0}};var Pv,Dv=e=>{document.prerendering?addEventListener("prerenderingchange",e,!0):e()},Fv=[1800,3e3],Nv=function(e,t){void 0===t&&(t={});var r=Rv(t);Dv((()=>{var i,n=Tv(t,Ov),a=xv(),o=Cv("FCP"),s=Ev(["paint"],(e=>{for(var t of e)"first-contentful-paint"===t.name&&(s.disconnect(),a.firstHiddenTime>t.startTime&&(o.value=Math.max(t.startTime-bv(),0),o.entries.push(t),o.navigationId=t.navigationId||o.navigationId,i(!0)))}));s&&(i=gv(e,o,Fv,t.reportAllChanges),pv((r=>{o=Cv("FCP",-1,"back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,fv()),i=gv(e,o,Fv,t.reportAllChanges),mv((()=>{o.value=performance.now()-r.timeStamp,i(!0)}))}))),r&&Ev(["soft-navigation"],(r=>{r.forEach((r=>{n.l&&r.navigationId&&Av(n.l,r);var a=Math.max((r.presentationTime||r.paintTime||0)-r.startTime,0);o=Cv("FCP",a,"soft-navigation",r.navigationId,r.interactionId,r.name,r.startTime),(i=gv(e,o,Fv,t.reportAllChanges))(!0)}))}),t)}))},qv=[.1,.25],jv=function(e,t){void 0===t&&(t={});var r=xv();Nv(Lv((()=>{var i,n=Cv("CLS",0),a=Tv(t,Iv),o=(r,o,s,u,l)=>{n=Cv("CLS",0,r,o,s,u,l),a.i=0,i=gv(e,n,qv,t.reportAllChanges)},s=function(e){void 0===e&&(e=!1),a.i>n.value&&(n.value=a.i,n.entries=a.o),i(e)},u=e=>{s(!0),o("soft-navigation",e.navigationId,e.interactionId,e.name,e.startTime)},l=e=>{for(var t of e)"soft-navigation"!==t.entryType?a.h(t):u(t);s()},h=["layout-shift"];Rv(t)&&h.push("soft-navigation");var c=Ev(h,l);c&&(i=gv(e,n,qv,t.reportAllChanges),r.onHidden((()=>{l(c.takeRecords()),i(!0)})),pv((()=>{o("back-forward-cache",n.navigationId,n.navigationInteractionId,n.navigationURL,fv()),mv(i)})),setTimeout(i))})))},Bv=0,Hv=1/0,$v=0,Uv=e=>{for(var t of e)t.interactionId&&(Hv=Math.min(Hv,t.interactionId),$v=Math.max($v,t.interactionId),Bv=$v?($v-Hv)/7+1:0)},Wv=()=>{var e;return Pv?Bv:null!==(e=performance.interactionCount)&&void 0!==e?e:0},zv=0;let Vv=class{constructor(){this.u=[],this.v=new Map,this.m=void 0,this.p=void 0}T(){zv=Wv(),this.u.length=0,this.v.clear()}M(e){var t=Wv()-zv,r=Math.min(this.u.length-1,Math.floor(t/50));return!t||-1!==r||"soft-navigation"!==e&&"back-forward-cache"!==e?this.u[r]:{_:8,id:-1,entries:[]}}h(e){var t;if(null!=(t=this.m)&&t.call(this,e),e.interactionId||"first-input"===e.entryType){var r=this.u.at(-1),i=this.v.get(e.interactionId);if(i||10>this.u.length||e.duration>r._){var n;if(i?e.duration>i._?(i.entries=[e],i._=e.duration):e.duration===i._&&e.startTime===i.entries[0].startTime&&i.entries.push(e):(this.v.set((i={id:e.interactionId,entries:[e],_:e.duration}).id,i),this.u.push(i)),this.u.sort(((e,t)=>t._-e._)),this.u.length>10){var a=this.u.splice(10);for(var o of a)this.v.delete(o.id)}null==(n=this.p)||n.call(this,i)}}}};var Zv=e=>{var t="requestIdleCallback"in globalThis?1e3:0,r=globalThis.requestIdleCallback||setTimeout,i=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)e();else{var n=Lv(e),a=-1,o=()=>{i(a),n()};addEventListener("visibilitychange",o,{once:!0,capture:!0}),a=r((()=>{removeEventListener("visibilitychange",o,{capture:!0}),n()}),{timeout:t})}},Gv=[200,500],Qv=function(e,t){if(void 0===t&&(t={}),globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype){var r=xv();Dv((()=>{var i;"interactionCount"in performance||Pv||(Pv=Ev(["event"],Uv,{durationThreshold:0}));var n,a=Cv("INP"),o=Tv(t,Vv),s=(r,i,s,u,l)=>{o.T(),a=Cv("INP",-1,r,i,s,u,l),n=gv(e,a,Gv,t.reportAllChanges)},u=()=>{var e=o.M(a.navigationType);e&&e._!==a.value&&(a.value=e._,a.entries=e.entries,n())},l=e=>{u(),n(!0),s("soft-navigation",e.navigationId,e.interactionId,e.name,e.startTime)},c=function(e,t){void 0===t&&(t=!1),Zv((()=>{for(var r of e)"soft-navigation"!==r.entryType?o.h(r):l(r);u(),t&&n(!0)}))},d=["event","first-input"];Rv(t)&&d.push("soft-navigation");var v=Ev(d,c,h({},t,{durationThreshold:null!==(i=t.durationThreshold)&&void 0!==i?i:40}));n=gv(e,a,Gv,t.reportAllChanges),v&&(r.onHidden((()=>{c(v.takeRecords(),!0)})),pv((()=>{s("back-forward-cache",a.navigationId,a.navigationInteractionId,a.navigationURL,fv())})))}))}};let Jv=class{constructor(){this.m=void 0,this.l=void 0}h(e){var t;null==(t=this.m)||t.call(this,e)}};var Yv=[2500,4e3],Kv=function(e,t){void 0===t&&(t={});var r=!1,i=Rv(t);Dv((()=>{var n,a=xv(),o=Cv("LCP"),s=Tv(t,Jv),u=(i,s,u,l,h)=>{o=Cv("LCP",-1,i,s,u,l,h),n=gv(e,o,Yv,t.reportAllChanges),r=!1,"soft-navigation"===i&&(a=xv(!0))},l=e=>{s.l&&e.navigationId&&Av(s.l,e),r||n(!0),u("soft-navigation",e.navigationId,e.interactionId,e.name,e.startTime);var t=null==e.getLargestInteractionContentfulPaint?void 0:e.getLargestInteractionContentfulPaint();t&&h([t])},h=e=>{for(var r of(t.reportAllChanges||i||(e=e.slice(-1)),e))if(r)if("soft-navigation"!==r.entryType){var u=0,h=[],c=r.startTime;if("largest-contentful-paint"===r.entryType)u=Math.max(r.startTime-bv(),0),s.h(r),h=[r];else if("interaction-contentful-paint"===r.entryType){var d,v=r;if(!o.navigationId)continue;if("interactionId"in v&&v.interactionId!=o.navigationInteractionId)continue;c=(null==(d=v.largestContentfulPaint)?void 0:d.renderTime)||0,u=Math.max(c-r.startTime,0),v.largestContentfulPaint&&(s.h(v.largestContentfulPaint),h=[v.largestContentfulPaint])}a.firstHiddenTime>c&&(o.value=u,o.entries=h,n())}else l(r)},c=["largest-contentful-paint"];i&&c.push("interaction-contentful-paint","soft-navigation");var d=Ev(c,h);if(d){n=gv(e,o,Yv,t.reportAllChanges);var v=["keydown","click","visibilitychange"],f=e=>{if(e.isTrusted&&!r){var t=o.id;Zv((()=>{if(!r){if(!i)for(var e of(d.disconnect(),v))removeEventListener(e,f,{capture:!0});t===o.id&&(r=!0,n(!0))}}))}};for(var p of v)addEventListener(p,f,{capture:!0});pv((i=>{u("back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,fv()),n=gv(e,o,Yv,t.reportAllChanges),mv((()=>{o.value=performance.now()-i.timeStamp,r=!0,n(!0)}))}))}}))},Xv={onLCP(e,t){void 0===t&&(t={});var r=Ld(t=Object.assign({},t),cv),i=new WeakMap;Vd(t)&&(r.u=new Map),r.p=e=>{var r=e.element;if(r){var n,a=null!==(n=null==t.generateTarget?void 0:t.generateTarget(r))&&void 0!==n?n:Rd(r);i.set(e,a)}else e.id&&i.set(e,"#"+e.id)},function(e,t){void 0===t&&(t={});var r=!1,i=Vd(t);Yd((()=>{var n,a=Ud(),o=Wd("LCP"),s=Ld(t,cv),u=(i,s,u,l,h)=>{o=Wd("LCP",-1,i,s,u,l,h),n=Fd(e,o,dv,t.reportAllChanges),r=!1,"soft-navigation"===i&&(a=Ud(!0))},l=e=>{s.u&&e.navigationId&&Zd(s.u,e),r||n(!0),u("soft-navigation",e.navigationId,e.interactionId,e.name,e.startTime);var t=null==e.getLargestInteractionContentfulPaint?void 0:e.getLargestInteractionContentfulPaint();t&&h([t])},h=e=>{for(var r of(t.reportAllChanges||i||(e=e.slice(-1)),e))if(r)if("soft-navigation"!==r.entryType){var u=0,h=[],c=r.startTime;if("largest-contentful-paint"===r.entryType)u=Math.max(r.startTime-qd(),0),s.l(r),h=[r];else if("interaction-contentful-paint"===r.entryType){var d,v=r;if(!o.navigationId)continue;if("interactionId"in v&&v.interactionId!=o.navigationInteractionId)continue;c=(null==(d=v.largestContentfulPaint)?void 0:d.renderTime)||0,u=Math.max(c-r.startTime,0),v.largestContentfulPaint&&(s.l(v.largestContentfulPaint),h=[v.largestContentfulPaint])}a.firstHiddenTime>c&&(o.value=u,o.entries=h,n())}else l(r)},c=["largest-contentful-paint"];i&&c.push("interaction-contentful-paint","soft-navigation");var d=zd(c,h);if(d){n=Fd(e,o,dv,t.reportAllChanges);var v=["keydown","click","visibilitychange"],f=e=>{if(e.isTrusted&&!r){var t=o.id;lv((()=>{if(!r){if(!i)for(var e of(d.disconnect(),v))removeEventListener(e,f,{capture:!0});t===o.id&&(r=!0,n(!0))}}))}};for(var p of v)addEventListener(p,f,{capture:!0});Dd((i=>{u("back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,Pd()),n=Fd(e,o,dv,t.reportAllChanges),Nd((()=>{o.value=performance.now()-i.timeStamp,r=!0,n(!0)}))}))}}))}((t=>{e((e=>{var t={timeToFirstByte:0,resourceLoadDelay:0,resourceLoadDuration:0,elementRenderDelay:e.value};if(e.entries.length){var n,a,o,s,u,l,c=e.entries.at(-1),d=c.url&&performance.getEntriesByType("resource").find((e=>e.name===c.url));t.target=i.get(c),t.lcpEntry=c,c.url&&(t.url=c.url),d&&(t.lcpResourceEntry=d);var v=0,f=0;if("soft-navigation"!==e.navigationType?(v=null!==(n=null==(a=l=Td())?void 0:a.activationStart)&&void 0!==n?n:0,f=null!==(o=null==(s=l)?void 0:s.responseStart)&&void 0!==o?o:0):(v=e.navigationStartTime||0,l=null==(u=r.u)?void 0:u.get(e.navigationId)),l){var p=Math.max(0,f-v),g=Math.max(p,d?(d.requestStart||d.startTime)-v:0),m=Math.min(e.value,Math.max(g,d?d.responseEnd-v:0));t=h({},t,{timeToFirstByte:p,resourceLoadDelay:g-p,resourceLoadDuration:m-g,elementRenderDelay:e.value-m,navigationEntry:l})}}return Object.assign(e,{attribution:t})})(t))}),t)},onCLS(e,t){void 0===t&&(t={});var r=Ld(t=Object.assign({},t),Md),i=new WeakMap;r.t=e=>{var r;if(null!=e&&null!=(r=e.sources)&&r.length){var n=tv(e.sources),a=null==n?void 0:n.node;if(a){var o,s=null!==(o=null==t.generateTarget?void 0:t.generateTarget(a))&&void 0!==o?o:Rd(a);i.set(n,s)}}},function(e,t){void 0===t&&(t={});var r=Ud();Xd(Gd((()=>{var i,n=Wd("CLS",0),a=Ld(t,Md),o=(r,o,s,u,l)=>{n=Wd("CLS",0,r,o,s,u,l),a.o=0,i=Fd(e,n,ev,t.reportAllChanges)},s=function(e){void 0===e&&(e=!1),a.o>n.value&&(n.value=a.o,n.entries=a.i),i(e)},u=e=>{s(!0),o("soft-navigation",e.navigationId,e.interactionId,e.name,e.startTime)},l=e=>{for(var t of e)"soft-navigation"!==t.entryType?a.l(t):u(t);s()},h=["layout-shift"];Vd(t)&&h.push("soft-navigation");var c=zd(h,l);c&&(i=Fd(e,n,ev,t.reportAllChanges),r.onHidden((()=>{l(c.takeRecords()),i(!0)})),Dd((()=>{o("back-forward-cache",n.navigationId,n.navigationInteractionId,n.navigationURL,Pd()),Nd(i)})),setTimeout(i))})))}((t=>{e((e=>{var t={};if(e.entries.length){var r,n=e.entries.reduce(((e,t)=>e.value>t.value?e:t));if(null!=n&&null!=(r=n.sources)&&r.length){var a=tv(n.sources);a&&(t={largestShiftTarget:i.get(a),largestShiftTime:n.startTime,largestShiftValue:n.value,largestShiftSource:a,largestShiftEntry:n,loadState:Id(n.startTime)})}}return Object.assign(e,{attribution:t})})(t))}),t)},onFCP(e,t){void 0===t&&(t={});var r=Ld(t=Object.assign({},t),Qd);Vd(t)&&(r.u=new Map),Xd((t=>{e((e=>{var t={timeToFirstByte:0,firstByteToFCP:e.value,loadState:Id(Pd())};if("soft-navigation"!==e.navigationType){if(e.entries.length){var i=Td(),n=e.entries.at(-1);if(i){var a=Math.max(0,i.responseStart-(i.activationStart||0));t={timeToFirstByte:a,firstByteToFCP:e.value-a,loadState:Id(e.entries[0].startTime),navigationEntry:i,fcpEntry:n}}}}else{var o,s=null==(o=r.u)?void 0:o.get(e.navigationId);s&&(t={timeToFirstByte:0,firstByteToFCP:e.value,loadState:"complete",navigationEntry:s})}return Object.assign(e,{attribution:t})})(t))}),t)},onINP(e,t){void 0===t&&(t={});var r=Ld(t=Object.assign({},t),uv),i=[],n=[],a=0,o=new WeakMap,s=new WeakMap,u=!1,l=()=>{u||(lv(c),u=!0)},c=()=>{var e=new Set(r.h.map((e=>o.get(e.entries[0])))),t=n.length-10;n=n.filter(((r,i)=>i>=t||e.has(r)));var s=new Set;for(var l of n){var h=d(l.startTime,l.processingEnd);for(var c of h)s.add(c)}i=i.filter((e=>e.startTime>a||s.has(e))),u=!1};r.p=e=>{var r,i=e.startTime+e.duration;a=Math.max(a,e.processingEnd);for(var s=n.length-1;s>=0;s--){var u=n[s];if(8>=Math.abs(i-u.renderTime)){(r=u).startTime=Math.min(e.startTime,r.startTime),r.processingStart=Math.min(e.processingStart,r.processingStart),r.processingEnd=Math.max(e.processingEnd,r.processingEnd),t.includeProcessedEventEntries&&r.entries.push(e);break}}r||n.push(r={startTime:e.startTime,processingStart:e.processingStart,processingEnd:e.processingEnd,renderTime:i,entries:t.includeProcessedEventEntries?[e]:[]}),(e.interactionId||"first-input"===e.entryType)&&o.set(e,r),l()},r.m=e=>{if(!s.get(e)){var r,i=null==(r=e.entries.find((e=>e.target)))?void 0:r.target;if(i){var n,a=null!==(n=null==t.generateTarget?void 0:t.generateTarget(i))&&void 0!==n?n:Rd(i);s.set(e,a)}else{var o,u=null==(o=e.entries.find((e=>e.targetSelector)))?void 0:o.targetSelector;u&&s.set(e,u)}}};var d=(e,t)=>{var r=[];for(var n of i)if(n.startTime+n.duration>=e){if(n.startTime>t)break;r.push(n)}return r};zd(["long-animation-frame"],(e=>{i=i.concat(e),l()}),t),function(e,t){if(void 0===t&&(t={}),globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype){var r=Ud();Yd((()=>{var i;"interactionCount"in performance||Jd||(Jd=zd(["event"],av,{durationThreshold:0}));var n,a=Wd("INP"),o=Ld(t,uv),s=(r,i,s,u,l)=>{o.M(),a=Wd("INP",-1,r,i,s,u,l),n=Fd(e,a,hv,t.reportAllChanges)},u=()=>{var e=o.T(a.navigationType);e&&e.D!==a.value&&(a.value=e.D,a.entries=e.entries,n())},l=e=>{u(),n(!0),s("soft-navigation",e.navigationId,e.interactionId,e.name,e.startTime)},c=function(e,t){void 0===t&&(t=!1),lv((()=>{for(var r of e)"soft-navigation"!==r.entryType?o.l(r):l(r);u(),t&&n(!0)}))},d=["event","first-input"];Vd(t)&&d.push("soft-navigation");var v=zd(d,c,h({},t,{durationThreshold:null!==(i=t.durationThreshold)&&void 0!==i?i:40}));n=Fd(e,a,hv,t.reportAllChanges),v&&(r.onHidden((()=>{c(v.takeRecords(),!0)})),Dd((()=>{s("back-forward-cache",a.navigationId,a.navigationInteractionId,a.navigationURL,Pd())})))}))}}((t=>{e((e=>{if(0===e.entries.length){var t={processedEventEntries:[],longAnimationFrameEntries:[],inputDelay:0,processingDuration:0,presentationDelay:e.value,loadState:Id(e.navigationStartTime||0)};return Object.assign(e,{attribution:t})}var i=e.entries[0],n=o.get(i),a=n.processingStart,u=Math.max(i.startTime+i.duration,a),l=Math.min(n.processingEnd,u),h=n.entries.sort(((e,t)=>e.processingStart-t.processingStart)),c=d(i.startTime,l),v=r.v.get(i.interactionId),f={interactionTarget:s.get(v),interactionType:i.name.startsWith("key")?"keyboard":"pointer",interactionTime:i.startTime,nextPaintTime:u,processedEventEntries:h,longAnimationFrameEntries:c,inputDelay:a-i.startTime,processingDuration:l-a,presentationDelay:u-l,loadState:Id(i.startTime),longestScript:void 0,totalScriptDuration:void 0,totalStyleAndLayoutDuration:void 0,totalPaintDuration:void 0,totalUnattributedDuration:void 0};return((e,t)=>{var r=e.interactionTime,i=e.nextPaintTime;if(null!=(t=e.longAnimationFrameEntries)&&t.length&&r&&i){var n,a,o=e.inputDelay,s=e.processingDuration,u=0,l=0,h=0,c=0;for(var d of e.longAnimationFrameEntries)for(var v of(l=l+d.startTime+d.duration-d.styleAndLayoutStart,d.scripts)){var f=v.startTime+v.duration;if(f>=r){var p=f-Math.max(r,v.startTime),g=v.duration?p/v.duration*v.forcedStyleAndLayoutDuration:0;u+=p-g,l+=g,p>c&&(a=r+o>v.startTime?"input-delay":r+o+s>v.startTime?"processing-duration":"presentation-delay",n=v,c=p)}}var m=e.longAnimationFrameEntries.at(-1),y=m?m.startTime+m.duration:0;y>=r+o+s&&(h=i-y),n&&a&&(e.longestScript={entry:n,subpart:a,intersectingDuration:c}),e.totalScriptDuration=u,e.totalStyleAndLayoutDuration=l,e.totalPaintDuration=h,e.totalUnattributedDuration=i-r-u-l-h}})(f),Object.assign(e,{attribution:f})})(t))}),t)},withoutAttribution:{onLCP:Kv,onCLS:jv,onFCP:Nv,onINP:Qv}};s.__PosthogExtensions__=s.__PosthogExtensions__||{},s.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=s.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},s.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-with-attribution-soft-navs"]=Xv,s.__PosthogExtensions__.postHogWebVitalsCallbacks=Xv,s.postHogWebVitalsCallbacks=Xv;var ef={onLCP:Kv,onCLS:jv,onFCP:Nv,onINP:Qv};s.__PosthogExtensions__=s.__PosthogExtensions__||{},s.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=s.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},s.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-soft-navs"]=ef,s.__PosthogExtensions__.postHogWebVitalsCallbacks=ef,s.postHogWebVitalsCallbacks=ef,s.__PosthogExtensions__.loadWebVitalsCallbacks=()=>ef;let tf=class{constructor(){this.t=void 0,this.o=0,this.i=[]}u(e){var t;if(!e.hadRecentInput){var r=this.i[0],i=this.i.at(-1);this.o&&r&&i&&1e3>e.startTime-i.startTime&&5e3>e.startTime-r.startTime?(this.o+=e.value,this.i.push(e)):(this.o=e.value,this.i=[e]),null==(t=this.t)||t.call(this,e)}}};var rf=()=>{var e=performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},nf=e=>{if("loading"===document.readyState)return"loading";var t=rf();if(t){if(t.domInteractive>e)return"loading";if(0===t.domContentLoadedEventStart||t.domContentLoadedEventStart>e)return"dom-interactive";if(0===t.domComplete||t.domComplete>e)return"dom-content-loaded"}return"complete"},af=e=>{var t=e.nodeName;return 1===e.nodeType?t.toLowerCase():t.toUpperCase().replace(/^#/,"")},of=e=>{var t="";try{for(;9!==(null==(r=e)?void 0:r.nodeType);){var r,i=e,n=i.id?"#"+i.id:[af(i),...Array.from(i.classList).sort()].join(".");if(t.length+n.length>99)return t||n;if(t=t?n+">"+t:n,i.id)break;e=i.parentNode}}catch(e){}return t},sf=new WeakMap;function uf(e,t){var r=sf.get(t);return r||(r=new WeakMap,sf.set(t,r)),r.get(e)||r.set(e,new t),r.get(e)}var lf,hf=-1,cf=()=>hf,df=e=>{addEventListener("pageshow",(t=>{t.persisted&&(hf=t.timeStamp,e(t))}),!0)},vf=(e,t,r,i)=>{var n,a;return o=>{t.value>=0&&(o||i)&&((a=t.value-(null!=n?n:0))||void 0===n)&&(n=t.value,t.delta=a,t.rating=((e,t)=>e>t[1]?"poor":e>t[0]?"needs-improvement":"good")(t.value,r),e(t))}},ff=e=>{requestAnimationFrame((()=>requestAnimationFrame(e)))},pf=()=>{var e,t;return null!==(e=null==(t=rf())?void 0:t.activationStart)&&void 0!==e?e:0},gf=function(e,t){void 0===t&&(t=-1);var r=rf(),i="navigate";return 0>cf()?r&&(document.prerendering||pf()>0?i="prerender":document.wasDiscarded?i="restore":r.type&&(i=r.type.replace(/_/g,"-"))):i="back-forward-cache",{name:e,value:t,rating:"good",delta:0,entries:[],id:"v5-"+Date.now()+"-"+(Math.floor(8999999999999*Math.random())+1e12),navigationType:i}},mf=function(e,t,r){void 0===r&&(r={});try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var i=new PerformanceObserver((e=>{queueMicrotask((()=>{t(e.getEntries())}))}));return i.observe(h({type:e,buffered:!0},r)),i}}catch(e){}},yf=e=>{var t=!1;return()=>{t||(e(),t=!0)}},bf=-1,wf=new Set,kf=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,_f=e=>{if("hidden"===document.visibilityState){if("visibilitychange"===e.type)for(var t of wf)t();isFinite(bf)||(bf="visibilitychange"===e.type?e.timeStamp:0,removeEventListener("prerenderingchange",_f,!0))}},Sf=()=>{if(0>bf){var e,t=pf(),r=document.prerendering||null==(e=globalThis.performance.getEntriesByType("visibility-state").find((e=>"hidden"===e.name&&e.startTime>=t)))?void 0:e.startTime;bf=null!=r?r:kf(),addEventListener("visibilitychange",_f,!0),addEventListener("prerenderingchange",_f,!0),df((()=>{setTimeout((()=>{bf=kf()}))}))}return{get firstHiddenTime(){return bf},onHidden(e){wf.add(e)}}},xf=e=>{document.prerendering?addEventListener("prerenderingchange",e,!0):e()},Cf=[1800,3e3],Mf=function(e,t){void 0===t&&(t={}),xf((()=>{var r,i=Sf(),n=gf("FCP"),a=mf("paint",(e=>{for(var t of e)"first-contentful-paint"===t.name&&(a.disconnect(),i.firstHiddenTime>t.startTime&&(n.value=Math.max(t.startTime-pf(),0),n.entries.push(t),r(!0)))}));a&&(r=vf(e,n,Cf,t.reportAllChanges),df((i=>{n=gf("FCP"),r=vf(e,n,Cf,t.reportAllChanges),ff((()=>{n.value=performance.now()-i.timeStamp,r(!0)}))})))}))},Tf=[.1,.25],If=e=>e.find((e=>{var t;return 1===(null==(t=e.node)?void 0:t.nodeType)}))||e[0],Ef=0,Rf=1/0,Af=0,Lf=e=>{for(var t of e)t.interactionId&&(Rf=Math.min(Rf,t.interactionId),Af=Math.max(Af,t.interactionId),Ef=Af?(Af-Rf)/7+1:0)},Of=()=>{var e;return lf?Ef:null!==(e=performance.interactionCount)&&void 0!==e?e:0},Pf=0;let Df=class{constructor(){this.l=[],this.h=new Map,this.m=void 0,this.p=void 0}v(){Pf=Of(),this.l.length=0,this.h.clear()}M(){var e=Math.min(this.l.length-1,Math.floor((Of()-Pf)/50));return this.l[e]}u(e){var t;if(null!=(t=this.m)&&t.call(this,e),e.interactionId||"first-input"===e.entryType){var r=this.l.at(-1),i=this.h.get(e.interactionId);if(i||10>this.l.length||e.duration>r.T){var n;if(i?e.duration>i.T?(i.entries=[e],i.T=e.duration):e.duration===i.T&&e.startTime===i.entries[0].startTime&&i.entries.push(e):(this.h.set((i={id:e.interactionId,entries:[e],T:e.duration}).id,i),this.l.push(i)),this.l.sort(((e,t)=>t.T-e.T)),this.l.length>10){var a=this.l.splice(10);for(var o of a)this.h.delete(o.id)}null==(n=this.p)||n.call(this,i)}}}};var Ff=e=>{var t=globalThis.requestIdleCallback||setTimeout,r=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)e();else{var i=yf(e),n=-1,a=()=>{r(n),i()};addEventListener("visibilitychange",a,{once:!0,capture:!0}),n=t((()=>{removeEventListener("visibilitychange",a,{capture:!0}),i()}))}},Nf=[200,500];let qf=class{constructor(){this.m=void 0}u(e){var t;null==(t=this.m)||t.call(this,e)}};var $=[2500,4e3],jf=-1,Bf=e=>{addEventListener("pageshow",(t=>{t.persisted&&(jf=t.timeStamp,e(t))}),!0)},Hf=(e,t,r,i)=>{var n,a;return o=>{t.value>=0&&(o||i)&&((a=t.value-(null!=n?n:0))||void 0===n)&&(n=t.value,t.delta=a,t.rating=((e,t)=>e>t[1]?"poor":e>t[0]?"needs-improvement":"good")(t.value,r),e(t))}},$f=e=>{requestAnimationFrame((()=>requestAnimationFrame(e)))},Uf=()=>{var e=performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},Wf=()=>{var e,t;return null!==(e=null==(t=Uf())?void 0:t.activationStart)&&void 0!==e?e:0},zf=function(e,t){void 0===t&&(t=-1);var r=Uf(),i="navigate";return 0>jf?r&&(document.prerendering||Wf()>0?i="prerender":document.wasDiscarded?i="restore":r.type&&(i=r.type.replace(/_/g,"-"))):i="back-forward-cache",{name:e,value:t,rating:"good",delta:0,entries:[],id:"v5-"+Date.now()+"-"+(Math.floor(8999999999999*Math.random())+1e12),navigationType:i}},Vf=new WeakMap;function Zf(e,t){var r=Vf.get(t);return r||(r=new WeakMap,Vf.set(t,r)),r.get(e)||r.set(e,new t),r.get(e)}class Gf{constructor(){this.t=void 0,this.i=0,this.o=[]}h(e){var t;if(!e.hadRecentInput){var r=this.o[0],i=this.o.at(-1);this.i&&r&&i&&1e3>e.startTime-i.startTime&&5e3>e.startTime-r.startTime?(this.i+=e.value,this.o.push(e)):(this.i=e.value,this.o=[e]),null==(t=this.t)||t.call(this,e)}}}var Qf,Jf=function(e,t,r){void 0===r&&(r={});try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var i=new PerformanceObserver((e=>{queueMicrotask((()=>{t(e.getEntries())}))}));return i.observe(h({type:e,buffered:!0},r)),i}}catch(e){}},Yf=e=>{var t=!1;return()=>{t||(e(),t=!0)}},Kf=-1,Xf=new Set,ep=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,tp=e=>{if("hidden"===document.visibilityState){if("visibilitychange"===e.type)for(var t of Xf)t();isFinite(Kf)||(Kf="visibilitychange"===e.type?e.timeStamp:0,removeEventListener("prerenderingchange",tp,!0))}},rp=()=>{if(0>Kf){var e,t=Wf(),r=document.prerendering||null==(e=globalThis.performance.getEntriesByType("visibility-state").find((e=>"hidden"===e.name&&e.startTime>=t)))?void 0:e.startTime;Kf=null!=r?r:ep(),addEventListener("visibilitychange",tp,!0),addEventListener("prerenderingchange",tp,!0),Bf((()=>{setTimeout((()=>{Kf=ep()}))}))}return{get firstHiddenTime(){return Kf},onHidden(e){Xf.add(e)}}},ip=e=>{document.prerendering?addEventListener("prerenderingchange",e,!0):e()},np=[1800,3e3],ap=function(e,t){void 0===t&&(t={}),ip((()=>{var r,i=rp(),n=zf("FCP"),a=Jf("paint",(e=>{for(var t of e)"first-contentful-paint"===t.name&&(a.disconnect(),i.firstHiddenTime>t.startTime&&(n.value=Math.max(t.startTime-Wf(),0),n.entries.push(t),r(!0)))}));a&&(r=Hf(e,n,np,t.reportAllChanges),Bf((i=>{n=zf("FCP"),r=Hf(e,n,np,t.reportAllChanges),$f((()=>{n.value=performance.now()-i.timeStamp,r(!0)}))})))}))},op=[.1,.25],sp=function(e,t){void 0===t&&(t={});var r=rp();ap(Yf((()=>{var i,n=zf("CLS",0),a=Zf(t,Gf),o=e=>{for(var t of e)a.h(t);a.i>n.value&&(n.value=a.i,n.entries=a.o,i())},s=Jf("layout-shift",o);s&&(i=Hf(e,n,op,t.reportAllChanges),r.onHidden((()=>{o(s.takeRecords()),i(!0)})),Bf((()=>{a.i=0,n=zf("CLS",0),i=Hf(e,n,op,t.reportAllChanges),$f(i)})),setTimeout(i))})))},up=0,lp=1/0,hp=0,cp=e=>{for(var t of e)t.interactionId&&(lp=Math.min(lp,t.interactionId),hp=Math.max(hp,t.interactionId),up=hp?(hp-lp)/7+1:0)},dp=()=>{var e;return Qf?up:null!==(e=performance.interactionCount)&&void 0!==e?e:0},vp=0;class fp{constructor(){this.l=[],this.u=new Map,this.m=void 0,this.p=void 0}v(){vp=dp(),this.l.length=0,this.u.clear()}T(){var e=Math.min(this.l.length-1,Math.floor((dp()-vp)/50));return this.l[e]}h(e){var t;if(null!=(t=this.m)&&t.call(this,e),e.interactionId||"first-input"===e.entryType){var r=this.l.at(-1),i=this.u.get(e.interactionId);if(i||10>this.l.length||e.duration>r.L){var n;if(i?e.duration>i.L?(i.entries=[e],i.L=e.duration):e.duration===i.L&&e.startTime===i.entries[0].startTime&&i.entries.push(e):(this.u.set((i={id:e.interactionId,entries:[e],L:e.duration}).id,i),this.l.push(i)),this.l.sort(((e,t)=>t.L-e.L)),this.l.length>10){var a=this.l.splice(10);for(var o of a)this.u.delete(o.id)}null==(n=this.p)||n.call(this,i)}}}}var pp=e=>{var t=globalThis.requestIdleCallback||setTimeout,r=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)e();else{var i=Yf(e),n=-1,a=()=>{r(n),i()};addEventListener("visibilitychange",a,{once:!0,capture:!0}),n=t((()=>{removeEventListener("visibilitychange",a,{capture:!0}),i()}))}},gp=[200,500],mp=function(e,t){if(void 0===t&&(t={}),globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype){var r=rp();ip((()=>{var i;"interactionCount"in performance||Qf||(Qf=Jf("event",cp,{durationThreshold:0}));var n,a=zf("INP"),o=Zf(t,fp),s=e=>{pp((()=>{for(var t of e)o.h(t);var r=o.T();r&&r.L!==a.value&&(a.value=r.L,a.entries=r.entries,n())}))},u=Jf("event",s,{durationThreshold:null!==(i=t.durationThreshold)&&void 0!==i?i:40});n=Hf(e,a,gp,t.reportAllChanges),u&&(u.observe({type:"first-input",buffered:!0}),r.onHidden((()=>{s(u.takeRecords()),n(!0)})),Bf((()=>{o.v(),a=zf("INP"),n=Hf(e,a,gp,t.reportAllChanges)})))}))}};class yp{constructor(){this.m=void 0}h(e){var t;null==(t=this.m)||t.call(this,e)}}var bp=[2500,4e3],wp=function(e,t){void 0===t&&(t={}),ip((()=>{var r,i=rp(),n=zf("LCP"),a=Zf(t,yp),o=e=>{for(var o of(t.reportAllChanges||(e=e.slice(-1)),e))a.h(o),i.firstHiddenTime>o.startTime&&(n.value=Math.max(o.startTime-Wf(),0),n.entries=[o],r())},s=Jf("largest-contentful-paint",o);if(s){r=Hf(e,n,bp,t.reportAllChanges);var u=Yf((()=>{o(s.takeRecords()),s.disconnect(),r(!0)})),l=e=>{e.isTrusted&&(pp(u),removeEventListener(e.type,l,{capture:!0}))};for(var h of["keydown","click","visibilitychange"])addEventListener(h,l,{capture:!0});Bf((i=>{n=zf("LCP"),r=Hf(e,n,bp,t.reportAllChanges),$f((()=>{n.value=performance.now()-i.timeStamp,r(!0)}))}))}}))},kp={onLCP(e,t){void 0===t&&(t={});var r=uf(t=Object.assign({},t),qf),i=new WeakMap;r.m=e=>{var r=e.element;if(r){var n,a=null!==(n=null==t.generateTarget?void 0:t.generateTarget(r))&&void 0!==n?n:of(r);i.set(e,a)}else e.id&&i.set(e,"#"+e.id)},function(e,t){void 0===t&&(t={}),xf((()=>{var r,i=Sf(),n=gf("LCP"),a=uf(t,qf),o=e=>{for(var o of(t.reportAllChanges||(e=e.slice(-1)),e))a.u(o),i.firstHiddenTime>o.startTime&&(n.value=Math.max(o.startTime-pf(),0),n.entries=[o],r())},s=mf("largest-contentful-paint",o);if(s){r=vf(e,n,$,t.reportAllChanges);var u=yf((()=>{o(s.takeRecords()),s.disconnect(),r(!0)})),l=e=>{e.isTrusted&&(Ff(u),removeEventListener(e.type,l,{capture:!0}))};for(var h of["keydown","click","visibilitychange"])addEventListener(h,l,{capture:!0});df((i=>{n=gf("LCP"),r=vf(e,n,$,t.reportAllChanges),ff((()=>{n.value=performance.now()-i.timeStamp,r(!0)}))}))}}))}((t=>{e((e=>{var t={timeToFirstByte:0,resourceLoadDelay:0,resourceLoadDuration:0,elementRenderDelay:e.value};if(e.entries.length){var r=e.entries.at(-1),n=r.url&&performance.getEntriesByType("resource").find((e=>e.name===r.url));t.target=i.get(r),t.lcpEntry=r,r.url&&(t.url=r.url),n&&(t.lcpResourceEntry=n);var a=rf();if(a){var o=a.activationStart||0,s=Math.max(0,a.responseStart-o),u=Math.max(s,n?(n.requestStart||n.startTime)-o:0),l=Math.min(e.value,Math.max(u,n?n.responseEnd-o:0));t=h({},t,{timeToFirstByte:s,resourceLoadDelay:u-s,resourceLoadDuration:l-u,elementRenderDelay:e.value-l,navigationEntry:a})}}return Object.assign(e,{attribution:t})})(t))}),t)},onCLS(e,t){void 0===t&&(t={});var r=uf(t=Object.assign({},t),tf),i=new WeakMap;r.t=e=>{var r;if(null!=e&&null!=(r=e.sources)&&r.length){var n=If(e.sources),a=null==n?void 0:n.node;if(a){var o,s=null!==(o=null==t.generateTarget?void 0:t.generateTarget(a))&&void 0!==o?o:of(a);i.set(n,s)}}},function(e,t){void 0===t&&(t={});var r=Sf();Mf(yf((()=>{var i,n=gf("CLS",0),a=uf(t,tf),o=e=>{for(var t of e)a.u(t);a.o>n.value&&(n.value=a.o,n.entries=a.i,i())},s=mf("layout-shift",o);s&&(i=vf(e,n,Tf,t.reportAllChanges),r.onHidden((()=>{o(s.takeRecords()),i(!0)})),df((()=>{a.o=0,n=gf("CLS",0),i=vf(e,n,Tf,t.reportAllChanges),ff(i)})),setTimeout(i))})))}((t=>{e((e=>{var t={};if(e.entries.length){var r,n=e.entries.reduce(((e,t)=>e.value>t.value?e:t));if(null!=n&&null!=(r=n.sources)&&r.length){var a=If(n.sources);a&&(t={largestShiftTarget:i.get(a),largestShiftTime:n.startTime,largestShiftValue:n.value,largestShiftSource:a,largestShiftEntry:n,loadState:nf(n.startTime)})}}return Object.assign(e,{attribution:t})})(t))}),t)},onFCP(e,t){void 0===t&&(t={}),Mf((t=>{e((e=>{var t={timeToFirstByte:0,firstByteToFCP:e.value,loadState:nf(cf())};if(e.entries.length){var r=rf(),i=e.entries.at(-1);if(r){var n=Math.max(0,r.responseStart-(r.activationStart||0));t={timeToFirstByte:n,firstByteToFCP:e.value-n,loadState:nf(e.entries[0].startTime),navigationEntry:r,fcpEntry:i}}}return Object.assign(e,{attribution:t})})(t))}),t)},onINP(e,t){void 0===t&&(t={});var r=uf(t=Object.assign({},t),Df),i=[],n=[],a=0,o=new WeakMap,s=new WeakMap,u=!1,l=()=>{u||(Ff(h),u=!0)},h=()=>{var e=new Set(r.l.map((e=>o.get(e.entries[0])))),t=n.length-10;n=n.filter(((r,i)=>i>=t||e.has(r)));var s=new Set;for(var l of n){var h=c(l.startTime,l.processingEnd);for(var d of h)s.add(d)}i=i.filter((e=>e.startTime>a||s.has(e))),u=!1};r.m=e=>{var r,i=e.startTime+e.duration;a=Math.max(a,e.processingEnd);for(var s=n.length-1;s>=0;s--){var u=n[s];if(8>=Math.abs(i-u.renderTime)){(r=u).startTime=Math.min(e.startTime,r.startTime),r.processingStart=Math.min(e.processingStart,r.processingStart),r.processingEnd=Math.max(e.processingEnd,r.processingEnd),!1!==t.includeProcessedEventEntries&&r.entries.push(e);break}}r||n.push(r={startTime:e.startTime,processingStart:e.processingStart,processingEnd:e.processingEnd,renderTime:i,entries:!1!==t.includeProcessedEventEntries?[e]:[]}),(e.interactionId||"first-input"===e.entryType)&&o.set(e,r),l()},r.p=e=>{if(!s.get(e)){var r,i=null==(r=e.entries.find((e=>e.target)))?void 0:r.target;if(i){var n,a=null!==(n=null==t.generateTarget?void 0:t.generateTarget(i))&&void 0!==n?n:of(i);s.set(e,a)}else{var o,u=null==(o=e.entries.find((e=>e.targetSelector)))?void 0:o.targetSelector;u&&s.set(e,u)}}};var c=(e,t)=>{var r=[];for(var n of i)if(n.startTime+n.duration>=e){if(n.startTime>t)break;r.push(n)}return r};mf("long-animation-frame",(e=>{i=i.concat(e),l()})),function(e,t){if(void 0===t&&(t={}),globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype){var r=Sf();xf((()=>{var i;"interactionCount"in performance||lf||(lf=mf("event",Lf,{durationThreshold:0}));var n,a=gf("INP"),o=uf(t,Df),s=e=>{Ff((()=>{for(var t of e)o.u(t);var r=o.M();r&&r.T!==a.value&&(a.value=r.T,a.entries=r.entries,n())}))},u=mf("event",s,{durationThreshold:null!==(i=t.durationThreshold)&&void 0!==i?i:40});n=vf(e,a,Nf,t.reportAllChanges),u&&(u.observe({type:"first-input",buffered:!0}),r.onHidden((()=>{s(u.takeRecords()),n(!0)})),df((()=>{o.v(),a=gf("INP"),n=vf(e,a,Nf,t.reportAllChanges)})))}))}}((t=>{e((e=>{var t=e.entries[0],i=o.get(t),n=t.processingStart,a=Math.max(t.startTime+t.duration,n),u=Math.min(i.processingEnd,a),l=i.entries.sort(((e,t)=>e.processingStart-t.processingStart)),h=c(t.startTime,u),d=r.h.get(t.interactionId),v={interactionTarget:s.get(d),interactionType:t.name.startsWith("key")?"keyboard":"pointer",interactionTime:t.startTime,nextPaintTime:a,processedEventEntries:l,longAnimationFrameEntries:h,inputDelay:n-t.startTime,processingDuration:u-n,presentationDelay:a-u,loadState:nf(t.startTime),longestScript:void 0,totalScriptDuration:void 0,totalStyleAndLayoutDuration:void 0,totalPaintDuration:void 0,totalUnattributedDuration:void 0};return((e,t)=>{if(null!=(t=e.longAnimationFrameEntries)&&t.length){var r,i,n=e.interactionTime,a=e.inputDelay,o=e.processingDuration,s=0,u=0,l=0,h=0;for(var c of e.longAnimationFrameEntries)for(var d of(u=u+c.startTime+c.duration-c.styleAndLayoutStart,c.scripts)){var v=d.startTime+d.duration;if(v>=n){var f=v-Math.max(n,d.startTime),p=d.duration?f/d.duration*d.forcedStyleAndLayoutDuration:0;s+=f-p,u+=p,f>h&&(i=n+a>d.startTime?"input-delay":n+a+o>d.startTime?"processing-duration":"presentation-delay",r=d,h=f)}}var g=e.longAnimationFrameEntries.at(-1),m=g?g.startTime+g.duration:0;m>=n+a+o&&(l=e.nextPaintTime-m),r&&i&&(e.longestScript={entry:r,subpart:i,intersectingDuration:h}),e.totalScriptDuration=s,e.totalStyleAndLayoutDuration=u,e.totalPaintDuration=l,e.totalUnattributedDuration=e.nextPaintTime-n-s-u-l}})(v),Object.assign(e,{attribution:v})})(t))}),t)},withoutAttribution:{onLCP:wp,onCLS:sp,onFCP:ap,onINP:mp}};s.__PosthogExtensions__=s.__PosthogExtensions__||{},s.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=s.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},s.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-with-attribution"]=kp,s.__PosthogExtensions__.postHogWebVitalsCallbacks=kp,s.postHogWebVitalsCallbacks=kp;var _p={onLCP:wp,onCLS:sp,onFCP:ap,onINP:mp};function Sp(e,t){return t.length>e?t.slice(0,e)+"...":t}function xp(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do{t=t.previousSibling}while(t&&!ze(t));return t}function Cp(t,r){var i,n,a=r.e,o=r.maskAllElementAttributes,s=r.maskAllText,u=r.elementAttributeIgnoreList,l=r.disableCaptureUrlHashes;if(!ze(t))return{props:{}};for(var c=[t],d=new Set([t]),v=t;v.parentNode&&!Ve(v,"body")&&Ge>c.length;)if(Ze(v.parentNode)){var f=v.parentNode.host;if(d.has(f))break;d.add(f),c.push(f),v=f}else{if(!ze(v.parentNode))break;if(d.has(v.parentNode))break;d.add(v.parentNode),c.push(v.parentNode),v=v.parentNode}var g,m,y=[],b={},w=!1,k=!1;if(Pe(c,(e=>{var t=it(e);if(Ve(e,"a")){var r=e.getAttribute("href");w=!!(t&&r&&dt(r))&&(l?ae(r):r)}p(Je(e),"ph-no-capture")&&(k=!0),y.push(function(e,t,r,i,n){void 0===n&&(n=!1);var a=e.tagName.toLowerCase(),o={tag_name:a};Ke.indexOf(a)>-1&&!r&&(o.$el_text="a"===a.toLowerCase()||"button"===a.toLowerCase()?Sp(1024,vt(e)):Sp(1024,Ye(e)));var s=Je(e);s.length>0&&(o.classes=s.filter((function(e){return""!==e}))),Pe(e.attributes,(function(r){var a;if((!nt(e)||-1!==["name","id","class","aria-label"].indexOf(r.name))&&(null==i||!i.includes(r.name))&&!t&&dt(r.value)&&(!x(a=r.name)||"_ngcontent"!==a.substring(0,10)&&"_nghost"!==a.substring(0,7))){var s=r.value;"class"===r.name&&(s=Qe(s).join(" ")),o["attr__"+r.name]=Sp(1024,"href"===r.name&&n?ae(s):s)}}));for(var u=1,l=1,h=e;h=xp(h);)u++,h.tagName===e.tagName&&l++;return o.nth_child=u,o.nth_of_type=l,o}(e,o,s,u,l));var i=function(e){if(!it(e))return{};var t={};return Pe(e.attributes,(function(e){if(e.name&&0===e.name.indexOf("data-ph-capture-attribute")){var r=e.name.replace("data-ph-capture-attribute-",""),i=e.value;r&&i&&dt(i)&&(t[r]=i)}})),t}(e);De(b,i)})),k)return{props:{},explicitNoCapture:k};if(s||(y[0].$el_text=Ve(t,"a")||Ve(t,"button")?vt(t):Ye(t)),w){var _,S;y[0].attr__href=w;var C=null==(_=je(w))?void 0:_.host,M=null==e||null==(S=e.location)?void 0:S.host;C&&M&&C!==M&&(g=w)}return{props:De({$event_type:a.type,$ce_version:1},{$elements:y},{$elements_chain:(m=y,function(e){var t=e.map((e=>{var t,r,i="";if(e.tag_name&&(i+=e.tag_name),e.attr_class)for(var n of(e.attr_class.sort(),e.attr_class))i+="."+n.replace(/"/g,"");var a=h({},e.text?{text:e.text}:{},{"nth-child":null!==(t=e.nth_child)&&void 0!==t?t:0,"nth-of-type":null!==(r=e.nth_of_type)&&void 0!==r?r:0},e.href?{href:e.href}:{},e.attr_id?{attr_id:e.attr_id}:{},e.attributes),o={};return Fe(a).sort(((e,t)=>function(e,t){return t>e?-1:e>t?1:0}(e[0],t[0]))).forEach((e=>{var t=e[1];return o[pt(e[0].toString())]=pt(t.toString())})),(i+=":")+Fe(o).map((e=>e[0]+'="'+e[1]+'"')).join("")}));return t.join(";")}(function(e){return e.map((e=>{var t,r,i={text:null==(t=e.$el_text)?void 0:t.slice(0,400),tag_name:e.tag_name,href:null==(r=e.attr__href)?void 0:r.slice(0,2048),attr_class:gt(e),attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return Fe(e).filter((e=>0===e[0].indexOf("attr__"))).forEach((e=>i.attributes[e[0]]=e[1])),i}))}(m)))},null!=(i=y[0])&&i.$el_text?{$el_text:null==(n=y[0])?void 0:n.$el_text}:{},g&&"click"===a.type?{$external_click_url:g}:{},b)}}s.__PosthogExtensions__=s.__PosthogExtensions__||{},s.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=s.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},s.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals"]=_p,s.__PosthogExtensions__.postHogWebVitalsCallbacks=_p,s.postHogWebVitalsCallbacks=_p,s.__PosthogExtensions__.loadWebVitalsCallbacks=()=>_p,Oe("[AutoCapture]");var Mp={};function Tp(t,r){var i=Mp[t];if(i)return i;var n=r[t];if((e=>k(e)&&-1!==e.toString().indexOf("[native code]"))(n)&&(null==e||!e.Zone))return Mp[t]=n.bind(r);var a=r.document;if(a&&k(a.createElement)){var o,s=!1;try{(o=a.createElement("iframe")).hidden=!0,a.head.appendChild(o);var u,l,h=o.contentWindow;h&&h[t]&&(n=h[t],"MutationObserver"===t&&function(e){return p(e,"AppleWebKit")&&!p(e,"Chrome")}(null!==(u=null==(l=r.navigator)?void 0:l.userAgent)&&void 0!==u?u:"")&&(o.classList.add("rr-block","ph-no-capture"),s=!0))}catch(e){Le.warn("Could not create sandbox iframe for "+t+" check, bailing to assignableWindow."+t+": ",e)}finally{var c;!s&&null!=(c=o)&&c.parentNode&&o.parentNode.removeChild(o)}}return n&&k(n)?Mp[t]=n.bind(r):n}function Ip(e,t){var r=function(e){var t;return S(e.target)?e.srcElement||null:null!=(t=e.target)&&t.shadowRoot?e.composedPath()[0]||null:e.target||null}(e);return r?h({node:r,originalEvent:e,timestamp:Date.now()},t):null}function Ep(e,t){return Math.abs(e)<Math.abs(t)?0>t?"up":"down":0>e?"left":"right"}function Rp(e){return"swipe"===e.type?"$dead_swipe":"$dead_click"}var Ap="canvas,video,audio,embed,object",Lp=1e3;function Op(e,t){return I(e)&&e>=t}function Pp(e){return e>=0&&Lp>e?e:void 0}function Dp(e,t){return t?Pp(e-t):void 0}class Fp{Wi(e){var t,r,i,n,a,o,s,u,l=this.zi((null==e?void 0:e.__onCapture)||this.Vi.bind(this));return{element_attribute_ignorelist:null!==(t=null==e?void 0:e.element_attribute_ignorelist)&&void 0!==t?t:l.element_attribute_ignorelist,scroll_threshold_ms:null!==(r=null==e?void 0:e.scroll_threshold_ms)&&void 0!==r?r:l.scroll_threshold_ms,selection_change_threshold_ms:null!==(i=null==e?void 0:e.selection_change_threshold_ms)&&void 0!==i?i:l.selection_change_threshold_ms,mutation_threshold_ms:null!==(n=null==e?void 0:e.mutation_threshold_ms)&&void 0!==n?n:l.mutation_threshold_ms,capture_clicks_with_modifier_keys:null!==(a=null==e?void 0:e.capture_clicks_with_modifier_keys)&&void 0!==a?a:l.capture_clicks_with_modifier_keys,capture_dead_swipes:null!==(o=null==e?void 0:e.capture_dead_swipes)&&void 0!==o?o:l.capture_dead_swipes,swipe_threshold_px:null!==(s=null==e?void 0:e.swipe_threshold_px)&&void 0!==s?s:l.swipe_threshold_px,max_dead_swipes_per_page_load:null!==(u=null==e?void 0:e.max_dead_swipes_per_page_load)&&void 0!==u?u:l.max_dead_swipes_per_page_load,css_selector_ignorelist:null==e?void 0:e.css_selector_ignorelist,__onCapture:l.__onCapture}}constructor(e,t){this.Zi=[],this.Gi=0,this.zi=e=>({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:e}),this.Qi=e=>{var t=Ip(e,{type:"click"});M(t)||this.Ji(t)||this.Yi(t),this.Ki()},this.Xi=()=>{var e=Date.now();this.en=e,e%50==0&&this.Zi.forEach((t=>{S(t.scrollDelayMs)&&(t.scrollDelayMs=e-t.timestamp)}))},this.tn=()=>{this.rn=Date.now()},this.$t=()=>{var e=Date.now();this.nn=e,this.an("visibilityChangedDelayMs",e)},this.sn=()=>{var e=Date.now();this.un=e,this.an("focusChangedDelayMs",e)},this.ln=e=>{var t=e.touches,r=1===(null==t?void 0:t.length)?t[0]:void 0;this.hn=r?{x:r.clientX,y:r.clientY,timestamp:Date.now()}:void 0},this.cn=()=>{this.hn=void 0},this.dn=e=>{var t,r=this.hn;if(this.hn=void 0,!S(r)&&this.vn.max_dead_swipes_per_page_load>this.Gi){var n=e,a=null==(t=n.changedTouches)?void 0:t[0];if(a){var o=a.clientX-r.x,s=a.clientY-r.y,u=o*o+s*s,l=this.vn.swipe_threshold_px;if(u>=l*l&&![this.en,this.fn,this.rn].some((e=>I(e)&&e>=r.timestamp))){var h;if(this.pn()&&(null!==(h=null==i||null==i.elementsFromPoint?void 0:i.elementsFromPoint(r.x,r.y))&&void 0!==h?h:[]).some((e=>null==e.matches?void 0:e.matches(Ap))))return;var c=Ip(n,{type:"swipe",swipeDirection:Ep(o,s),swipeDistancePx:Math.round(Math.sqrt(u))});M(c)||this.Ji(c)||this.Yi(c),this.Ki()}}}},this.instance=e,this.vn=this.Wi(t),this._onCapture=this.vn.__onCapture}start(e){this.gn(),this.mn(),this.yn(),this.bn(),this.wn(),this.kn(e),this.vn.capture_dead_swipes&&this._n()}kn(e){if(!this.Sn){var t=function(e){return Tp("MutationObserver",e)}(s);this.Sn=new t((e=>{this.xn(e)})),this.Sn.observe(e,{attributes:!0,characterData:!0,childList:!0,subtree:!0})}}stop(){var e;null==(e=this.Sn)||e.disconnect(),this.Sn=void 0,s.removeEventListener("click",this.Qi),s.removeEventListener("scroll",this.Xi,{capture:!0}),s.removeEventListener("selectionchange",this.tn),s.removeEventListener("touchstart",this.ln,{capture:!0}),s.removeEventListener("touchend",this.dn,{capture:!0}),s.removeEventListener("touchcancel",this.cn,{capture:!0}),null==i||i.removeEventListener("visibilitychange",this.$t),s.removeEventListener("blur",this.sn),s.removeEventListener("focus",this.sn),this.hn=void 0}xn(e){this.fn=Date.now()}gn(){Ne(s,"click",this.Qi)}Yi(e){e.visibilityChangedDelayMs=Dp(e.timestamp,this.nn),e.focusChangedDelayMs=Dp(e.timestamp,this.un),this.Zi.push(e)}Ki(){this.Zi.length&&S(this.Cn)&&(this.Cn=s.setTimeout((()=>{this.Mn()}),1e3))}mn(){Ne(s,"scroll",this.Xi,{capture:!0})}yn(){Ne(s,"selectionchange",this.tn)}bn(){Ne(i,"visibilitychange",this.$t)}wn(){Ne(s,"blur",this.sn),Ne(s,"focus",this.sn)}an(e,t){this.Zi.forEach((r=>{var i=Pp(t-r.timestamp);I(i)&&(S(r[e])||r[e]>i)&&(r[e]=i)}))}_n(){Ne(s,"touchstart",this.ln,{capture:!0,passive:!0}),Ne(s,"touchend",this.dn,{capture:!0,passive:!0}),Ne(s,"touchcancel",this.cn,{capture:!0,passive:!0})}pn(){var e=S(this.Tn)||I(this.fn)&&this.fn>this.Tn;return(S(this.In)||e)&&(this.Tn=Date.now(),this.In=!(null==i||!i.querySelector(Ap))),!!this.In}Ji(e){return!e||("swipe"===e.type?this.En(e):this.Rn(e))}En(t){if((r=t.node)instanceof Element&&("__POSTHOG_TOOLBAR__"===r.id||null!=r.closest&&r.closest(".toolbar-global-fade-container")))return!0;var r,i=this.Zi.some((e=>e.type===t.type&&e.node===t.node&&1e3>Math.abs(e.timestamp-t.timestamp)));return!(!i&&!Ve(t.node,"html")&&ze(t.node)&&function(t,r){var i;if(!e||tt(t))return!1;var n=E(r)?et:null!==(i=null==r?void 0:r.css_selector_ignorelist)&&void 0!==i?i:et;return!function(e,t){if(S(t))return!0;var r,i=function(e){if(t.some((t=>function(e,t){var r=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector;try{return!!r&&r.call(e,t)}catch(e){return!1}}(e,t))))return{v:!0}};for(var n of e)if(r=i(n))return r.v;return!1}(rt(t).targetElementList,n)}(t.node,{css_selector_ignorelist:this.vn.css_selector_ignorelist}))}Rn(t){return!(this.vn.capture_clicks_with_modifier_keys||(r=t.originalEvent,!(r.ctrlKey||r.metaKey||r.altKey||r.shiftKey)))||!!this.En(t)||(i=t.node,!(!e||tt(i))&&rt(i).targetElementList.some((e=>Ve(e,"a"))));var r,i}Mn(){if(this.Zi.length){clearTimeout(this.Cn),this.Cn=void 0;var e=this.Zi;for(var t of(this.Zi=[],e)){var r;t.mutationDelayMs=null!==(r=t.mutationDelayMs)&&void 0!==r?r:this.fn&&this.fn>=t.timestamp?this.fn-t.timestamp:void 0,t.absoluteDelayMs=Date.now()-t.timestamp,t.selectionChangedDelayMs=this.rn&&this.rn>=t.timestamp?this.rn-t.timestamp:void 0;var i=Op(t.scrollDelayMs,this.vn.scroll_threshold_ms),n=Op(t.selectionChangedDelayMs,this.vn.selection_change_threshold_ms),a=Op(t.mutationDelayMs,this.vn.mutation_threshold_ms),o=Op(t.absoluteDelayMs,1.1*this.vn.mutation_threshold_ms),s=I(t.scrollDelayMs)&&this.vn.scroll_threshold_ms>t.scrollDelayMs,u=I(t.mutationDelayMs)&&this.vn.mutation_threshold_ms>t.mutationDelayMs,l=I(t.selectionChangedDelayMs)&&this.vn.selection_change_threshold_ms>t.selectionChangedDelayMs,h=I(t.visibilityChangedDelayMs),c=I(t.focusChangedDelayMs);if(!(s||u||l||h||c))if(i||a||o||n){var d=Rp(t);if("$dead_swipe"===d){if(this.Gi>=this.vn.max_dead_swipes_per_page_load)continue;this.Gi++}this._onCapture(t,{[d+"_last_mutation_timestamp"]:this.fn,[d+"_event_timestamp"]:t.timestamp,[d+"_scroll_timeout"]:i,[d+"_mutation_timeout"]:a,[d+"_absolute_timeout"]:o,[d+"_selection_changed_timeout"]:n,[d+"_visibility_changed_timeout"]:!1})}else this.vn.mutation_threshold_ms>t.absoluteDelayMs&&this.Zi.push(t)}this.Ki()}}Vi(e,t){var r=Rp(e);this.instance.capture(r,h({},t,Cp(e.node,{e:e.originalEvent,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.vn.element_attribute_ignorelist,disableCaptureUrlHashes:this.instance.config.disable_capture_url_hashes}).props,{[r+"_scroll_delay_ms"]:e.scrollDelayMs,[r+"_mutation_delay_ms"]:e.mutationDelayMs,[r+"_absolute_delay_ms"]:e.absoluteDelayMs,[r+"_selection_changed_delay_ms"]:e.selectionChangedDelayMs,[r+"_visibility_changed_delay_ms"]:e.visibilityChangedDelayMs,[r+"_focus_changed_delay_ms"]:e.focusChangedDelayMs,$dead_swipe_direction:e.swipeDirection,$dead_swipe_distance_px:e.swipeDistancePx}),{timestamp:new Date(e.timestamp)})}}s.__PosthogExtensions__=s.__PosthogExtensions__||{},s.__PosthogExtensions__.initDeadClicksAutocapture=(e,t)=>new Fp(e,t)}();
2
2
  //# sourceMappingURL=all-external-dependencies.js.map